﻿var xmlHttp;if(!xmlHttp&&typeof XMLHttpRequest!='undefined'){try{xmlHttp=new XMLHttpRequest()}catch(e){xmlHttp=false}}function GetXmlHttpObject(){var xmlhttplocal;try{xmlhttplocal=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlhttplocal=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){xmlhttplocal=false}}if(!xmlhttplocal&&typeof XMLHttpRequest!='undefined'){try{var xmlhttplocal=new XMLHttpRequest()}catch(e){var xmlhttplocal=false;alert('couldn\'t create xmlhttp object')}}return(xmlhttplocal)}function getEmail(){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("emailst").style.display='';var email=document.getElementById('email');$.get(homeurl+'email.php?action=reg',{email:email.value},function(result){if(result==0){alert('خطأ!')}else{document.getElementById("emailst").innerHTML=result}})}function delEmail(){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("emailst").style.display='';var email=document.getElementById('email');$.get(homeurl+'email.php?action=del',{email:email.value},function(result){if(result==0){alert('خطأ!')}else{document.getElementById("emailst").innerHTML=result}})}function changePoll(newid){document.getElementById("hid").value=newid}function getPoll(){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}var polls=document.getElementById('hid');if(polls.value==0){alert('الرجاء اختيار احد الاسئله لاكمال العمليه')}else{document.getElementById("ajaxpro").innerHTML="<img src='"+homeurl+"images/progressbar2.gif' alt='processing' />";$.get(homeurl+'poll.php?action=vote',{poll:polls.value},function(result){if(result==0){alert('خطأ!')}else{document.getElementById("ajaxpro").innerHTML="";document.getElementById("ajaxpoll").innerHTML=result;var options={};$("#pollresview").show('highlight',options,1000)}})}}function sendcomment(){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}var author=document.getElementById('author');var email=document.getElementById('email');var url=document.getElementById('url');var content=document.getElementById('comment');var sid=document.getElementById('sid');document.getElementById("ajaxproc").style.display="";$.get(homeurl+'article.php',{c:content.value,a:author.value,e:email.value,u:url.value,s:sid.value},function(result){if(result==0){alert('خطأ!')}else{$(result).appendTo('#ajaxcomment');content.value='';document.getElementById("ajaxproc").style.display='none'}})}function report_bad(id,type){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}$.get(homeurl+'ajax.php?action=report',{type:type,id:id},function(result){alert('تم ارسال التبليغ عن المشاركه السيئه بنجاح...شكرا لاهتمامكم')})}function Confirm_User(username){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("confim_user_pro").style.display='';$.get(homeurl+'register.php?action=ajax&do=userconfirm',{username:username},function(result){document.getElementById("confim_user_pro").style.display='none';document.getElementById("confim_user_yes").style.display='none';document.getElementById("confim_user_no").style.display='none';if(result==1){document.getElementById("confim_user_yes").style.display=''}else{document.getElementById("confim_user_no").style.display=''}})}function Confirm_Email(email){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("confim_email_pro").style.display='';$.get(homeurl+'register.php?action=ajax&do=emailconfirm',{email:email},function(result){document.getElementById("confim_email_pro").style.display='none';document.getElementById("confim_email_yes").style.display='none';document.getElementById("confim_email_no").style.display='none';if(result==1){document.getElementById("confim_email_yes").style.display=''}else{document.getElementById("confim_email_no").style.display=''}})}function verify_2Email(email,vemail){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("confim_emailver_no").style.display='none';document.getElementById("confim_emailver_yes").style.display='none';if(email!=vemail){document.getElementById("confim_emailver_no").style.display=''}else{document.getElementById("confim_emailver_yes").style.display=''}}function verify_two_password(pass,vpass){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("confim_passowrd_no").style.display='none';document.getElementById("confim_passowrd_yes").style.display='none';if(pass!=vpass){document.getElementById("confim_passowrd_no").style.display=''}else{document.getElementById("confim_passowrd_yes").style.display=''}}function ChangeStyle(style_id){window.location='login.php?action=changestyle&style_id='+style_id}function Comment_Paging(paging,article_id){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById('ajax_processing').style.display='';$.get(homeurl+'article.php?action=comments',{page:paging,article_id:article_id},function(result){if(result==0){alert('خطأ!')}else{document.getElementById("Update_comments_ajax").innerHTML=result;document.getElementById('ajax_processing').style.display='none'}})}function Redirect(redirecturl){var pausefor=10;setTimeout(postaction(redirecturl),pausefor*1000)}function postaction(redirecturl){if(window.timer){clearInterval(timer);clearInterval(timer_2)}window.location=redirecturl}function addBookmark(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,'')}else if(document.all){window.external.AddFavorite(url,title)}}function RegenerateCaptcha(){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}document.getElementById("regenerate_captcha").innerHTML='<img src="'+homeurl+'/images/progressbar1.gif" width="100px" height="35px" />';document.getElementById("regenerate_captcha").innerHTML='<img src="'+homeurl+'/captcha.php?'+Math.random()+'" onclick="RegenerateCaptcha()" style="cursor:pointer" />'}function checkDelBoxes(pForm,boxName,parent){for(i=0;i<pForm.elements.length;i++)if(pForm.elements[i].name==boxName)pForm.elements[i].checked=parent}function GoodTh(id,userid,action){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}$.get(homeurl+'article.php?action=good',{id:id,userid:userid,type:action},function(result){if(result==0){alert('خطأ!')}else{$("#Update_good").show('highlight',[],1000);document.getElementById("Update_good").innerHTML=result}})}function Tabs(elm,loop){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}for(var i=1;i<=loop;i++){document.getElementById("tabs_"+i).style.backgroundColor='#4072A5';document.getElementById("td_"+i).style.display='none'}document.getElementById("tabs_"+elm).style.backgroundColor='#68ACEF';document.getElementById("td_"+elm).style.display=''}function TabsSide(elm,loop){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}for(var i=1;i<=loop;i++){document.getElementById("th_"+i).style.backgroundColor='#fff';document.getElementById("li_"+i).style.display='none'}document.getElementById("th_"+elm).style.backgroundColor='#CFCFCF';document.getElementById("li_"+elm).style.display=''}function appendsmil(text){var comment=document.getElementById('comment');comment.value=comment.value+'  '+text}