var yy=-1;function trim(e){var b=0,c=e.length-1,a;while(e.charAt(b)===" "){b++;}while(e.charAt(c)===" "){c--;}if(c<b){return"";}a=e.substring(b,c+1);return a;}var expDays=30;var exp=new Date();exp.setTime(exp.getTime()+(expDays*24*60*60*1000));function testuser(c){var b,a;for(b=0;b<c.value.length;b++){a=c.value.charCodeAt(b);if(a>=65&&a<=90){continue;}if(a>=97&&a<=122){continue;}if(a>=48&&a<=57){continue;}if(a===45||a===95){continue;}return false;}return true;}function checkLogin(){if(document.theForm.username.value===""){alert("الرجاء التأكد من إدخال الإسم");document.theForm.username.focus();return false;}else{if(document.theForm.userpass.value===""){alert("الرجاء التأكد من إدخال كلمة السر");document.theForm.userpass.focus();return false;}else{if(document.theForm.username.value.length>32){window.alert("اسم الدخول يجب أن يكون أقل من 32 حرف");document.theForm.username.focus();return false;}}}}function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a===-1){a=document.cookie.length;}return unescape(document.cookie.substring(b,a));}function SetCookie(c,e){var a,h,b,g,f;a=SetCookie.arguments;h=SetCookie.arguments.length;b=(h>2)?a[2]:null;g=(h>3)?a[3]:"/";f=(h>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((g===null)?"":("; path="+g))+((f===true)?"; secure":"")+"; domain=.maktoob.com";}function GetCookie(e){var b,g,a,f,c;b=e+"=";g=b.length;a=document.cookie.length;f=0;while(f<a){c=f+g;if(document.cookie.substring(f,c)===b){return getCookieVal(c);}f=document.cookie.indexOf(" ",f)+1;if(f===0){break;}}return null;}function DeleteCookie(a){var c,b;c=new Date();c.setTime(c.getTime()-1);b=GetCookie(a);document.cookie=a+"="+b+"; expires="+c.toGMTString();}function logOut(c,a){var b;if(c==="en"){b="Are you sure you want to logout?";}else{b="هل انت متأكد بأنك تريد الخروج";}if(confirm(b)){top.location="http://www.maktoob.com/logout.pl?language="+c+"source="+a;}}function maktoobLogOut(){var a="هل انت متأكد بأنك تريد الخروج";if(confirm(a)){top.location="http://www.maktoob.com/logOut.php?lang=ar";}}function load_data(){if(GetCookie("remember_remember")===0||GetCookie("remember_remember")===null){document.theForm.remember_me.checked=false;}else{document.theForm.remember_me.checked=true;if(GetCookie("meuser_login")!==null){document.theForm.username.value=GetCookie("meuser_login");}}}function homepageDate(f){var b=new Array(7),e=new Array(12),g,c,a;b[0]="الاحد";b[1]="الاثنين";b[2]="الثلاثاء";b[3]="الاربعاء";b[4]="الخميس";b[5]="الجمعة";b[6]="السبت";if(f==="eg"||f==="ae"||f==="bh"||f==="sa"||f==="om"||f==="qa"||f==="kw"){e[0]="يناير";e[1]="فبراير";e[2]="مارس";e[3]="إبريل";e[4]="مايو";e[5]="يونيو";e[6]="يوليو";e[7]="أغسطس";e[8]="سبتمبر";e[9]="أكتوبر";e[10]="نوفمبر";e[11]="ديسمبر";}else{e[0]="كانون الثاني";e[1]="شباط";e[2]="أذار";e[3]="نيسان";e[4]="أيار";e[5]="حزيران";e[6]="تموز";e[7]="أب";e[8]="أيلول";e[9]="تشرين أول";e[10]="تشرين الثاني";e[11]="كانون الأول";}g=new Date();c=g.getDate();if(g.getDate()<10){c="0"+g.getDate();}a=""+b[g.getDay()]+"، "+c+" "+e[g.getMonth()]+"، "+g.getFullYear()+" ";return a;}function dictionary(){var a=trim(document.getElementById("word").value);if(a===""||a==="أدخل كلمتك"){alert("الرجاء أدخل الكلمة");document.getElementById("word").focus();return false;}else{try{window.open("brg.php?word="+document.getElementById("word").value,"Dictionarywin","resizable=no,width=760,height=440,status=yes,location=no,toolbar=no,scrollbars=1");}catch(b){}}}function createRequestObject(){var b,a=navigator.appName;if(a==="Microsoft Internet Explorer"||typeof ActiveXObject!=="undefined"){b=new ActiveXObject("Microsoft.XMLHTTP");}else{b=new XMLHttpRequest();}return b;}var http=createRequestObject();var URL="/";var loadingImages="/images/";function handleInfo(){if(http.readyState===1||http.readyState===2||http.readyState===3){document.getElementById("mail").innerHTML="<br/><br/><center><b>جاري التحميل .....</b></center>";}if(http.readyState===4){if(http.status===200){var a=http.responseText;document.getElementById("mail").innerHTML=a;}}}function getUserIMAPInfo(){http.open("get",URL+"getUserIMAPInfo.php?rb="+Math.floor(1000000*Math.random()));http.onreadystatechange=handleInfo;http.send(null);}function handleInfoNew(){if(http.readyState===1||http.readyState===2||http.readyState===3){document.getElementById("mail").innerHTML="<br /><br /><center><b>جاري التحميل .....</b></center>";}if(http.readyState===4){if(http.status===200){var a=http.responseText;document.getElementById("mail").innerHTML=a;if(document.theForm){if(document.theForm.username.value!==""&&document.theForm.userpass.value===""){document.theForm.userpass.focus();}else{if(document.theForm.username.value===""&&document.theForm.userpass.value===""){document.theForm.username.focus();}}}}}}function getUserScalableIMAPInfo(){http.open("get","/loginInfo.php?rb="+Math.floor(1000000*Math.random()));http.onreadystatechange=handleInfoNew;http.send(null);}function getUserIMAPInfoNew(){http.open("get","/getUserIMAPInfoNew.php?rb="+Math.floor(1000000*Math.random()));http.onreadystatechange=handleInfoNew;http.send(null);}function breaking(a){window.open(a,"Dictionarywin","resizable=no,width=655,height=150,status=yes,location=no,toolbar=no,scrollbars=0");}function dic(){window.open("http://web4.maktoob.com:8080/dictionary/index_homePage.jsp?language=ar","Dictionarywin","resizable=no,width=760,height=440,status=yes,location=no,toolbar=no,scrollbars=1");}function voteCheck(){var b=false,a=document.vote,i;for(i=0;i<a.answerId.length;i++){if(a.answerId[i].checked){b=true;yy=a.answerId[i].value;break;}}if(b){return true;}else{alert(".عفواً! الرجاء تحديد أحد الخيارات لكي تتمكّن من التصويت");return false;}}function open_vote(b,a){window.open("result.php?id="+b+"&voteId="+a,"Vote","top=100,left=100,width=760,height=460,scrollbars=1");}function open_vote_result(a){window.open("result.php?voteId="+a,"Vote","top=100,left=100,width=760,height=460,scrollbars=1");}function Get_Cookie(e){var f,b,c,a;f=document.cookie.indexOf(e+"=");b=f+e.length+1;if((!f)&&(e!==document.cookie.substring(0,e.length))){return true;}if(f===-1){return true;}c=document.cookie.indexOf(";",b);if(c===-1){c=document.cookie.length;}a=unescape(document.cookie.substring(b,c));if(document.getElementById("prevq416").value===a){return false;}else{return true;}}function openPreviousVote(){window.close();window.open("previousVotes.php","Vote");}function open_chat_room(a){window.open(a,"chat","top=100,left=100,width800,height=600,scrollbars=1");}var documentURL=document.URL;if(documentURL){if(documentURL.indexOf("#")){documentURL=documentURL.replace("#","%23");}}function cookie_check(b,a){var c,f;c=a.indexOf(b);if(c===-1){return"";}c+=b.length;f=a.indexOf(";",c);if(f===-1){f=a.length;}return a.substring(c,f);}if(typeof(correctPNG)==="undefined"){function correctPNG(){var g,h,c,e,k,f,l,b,j,a;g=navigator.appVersion.split("MSIE");h=parseFloat(g[1]);if((h>=5.5)&&(document.body.filters)){for(c=0;c<document.images.length;c++){e=document.images[c];k=e.src.toUpperCase();if(k.substring(k.length-3,k.length)==="PNG"){f=(e.id)?"id='"+e.id+"' ":"";l=(e.className)?"class='"+e.className+"' ":"";b=(e.title)?"title='"+e.title+"' ":"title='"+e.alt+"' ";j="display:inline-block;"+e.style.cssText;if(e.align==="left"){j="float:left;"+j;}if(e.align==="right"){j="float:right;"+j;}if(e.parentElement.href){j="cursor:hand;"+j;}a="<span "+f+l+b+' style="width:'+e.width+"px; height:"+e.height+"px;"+j+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.src+"', sizingMethod='scale');\"></span>";e.outerHTML=a;c=c-1;}}}}try{window.attachEvent("onload",correctPNG);}catch(err){}}var localization_tmpvar1="";var localization_tmpvar2="";var localization_tmpvar3="";var localizationBln=1;var localizationEnableDisbleItemsShow=true;var localizationEnableDisbleItems;function localizationShowHideSelectFields(){try{var localizationEnableDisbleItemsShow,b,a;if(typeof localizationEnableDisbleItems!=="undefined"&&localizationEnableDisbleItems.length>0){for(b=0,a=localizationEnableDisbleItems.length;b<a;b++){if(localizationEnableDisbleItemsShow){document.getElementById(localizationEnableDisbleItems[b]).style.display="none";}else{document.getElementById(localizationEnableDisbleItems[b]).style.display="";}}if(localizationEnableDisbleItemsShow){localizationEnableDisbleItemsShow=false;}else{localizationEnableDisbleItemsShow=true;}}}catch(c){}}function blockover(a){document.getElementById(a).style.background="#fafafa";document.getElementById(a).style.border="1px solid #dfdfdf";document.getElementById(a).style.padding="0px 3px";}function blockout(a){if(localizationBln!==a){document.getElementById(a).style.background="";document.getElementById(a).style.padding="1px 4px";document.getElementById(a).style.border="0px";}}function localizationCloseOpenMenu(){document.getElementById(localization_tmpvar1).style.display="none";document.getElementById(localization_tmpvar2).style.display="none";localizationEnableDisbleItemsShow=false;localizationShowHideSelectFields();localizationBln="";blockout(localization_tmpvar3);}function bglover(a){a.style.background="#c7d8e3";}function bglout(a){a.style.background="";}function getwidth(c,h,f,k,j,g,b,a,m){var e,l;e=document.getElementById(c).offsetWidth;e=e-2;l=document.getElementById(b).offsetWidth-2;if(e===l){localizationEnableDisbleItemsShow=false;localizationShowHideSelectFields();document.getElementById(b).style.display="none";document.getElementById(k).style.display="none";localizationBln="";}else{localizationEnableDisbleItemsShow=true;localizationShowHideSelectFields();document.getElementById(b).style.width=e+"px";document.getElementById(b).style.display="block";document.getElementById(k).style.display="block";document.getElementById(j).style.display="none";document.getElementById(g).style.display="none";document.getElementById(a).style.display="none";document.getElementById(m).style.display="none";localizationBln=c;blockout(h);blockout(f);localization_tmpvar1=b;localization_tmpvar2=k;localization_tmpvar3=c;setTimeout(localizationCloseOpenMenu,10000);}}var bo_ns_id=0;function isIE(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("msie")>-1&&a.indexOf("mac")<0){if(parseInt(a.charAt(a.indexOf("msie")+5),10)<6){return false;}if(a.indexOf("win98")>-1||a.indexOf("win 9x 4.90")>-1||a.indexOf("winnt4.0")>-1||a.indexOf("windows nt 5.0")>-1){return false;}return true;}else{return false;}}
