var yy=-1;function trim(e){var b=0;var c=e.length-1;var 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){for(var b=0;b<c.value.length;b++){var 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 SetCookie(c,e){var a=SetCookie.arguments;var h=SetCookie.arguments.length;var b=(h>2)?a[2]:null;var g=(h>3)?a[3]:"/";var 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 DeleteCookie(a){var c=new Date();c.setTime(c.getTime()-1);var b=GetCookie(a);document.cookie=a+"="+b+"; expires="+c.toGMTString();}function logOut(c,a){if(c=="en"){var b="Are you sure you want to logout?";}else{var 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 getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length;}return unescape(document.cookie.substring(b,a));}function GetCookie(e){var b=e+"=";var g=b.length;var a=document.cookie.length;var f=0;while(f<a){var 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 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);var e=new Array(12);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]="كانون الأول";}var g=new Date();var c=g.getDate();if(g.getDate()<10){c="0"+g.getDate();}var 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){}}}var http=createRequestObject();var URL="/";var loadingImages="/images/";function createRequestObject(){var b;var a=navigator.appName;if(a=="Microsoft Internet Explorer"||typeof ActiveXObject!="undefined"){b=new ActiveXObject("Microsoft.XMLHTTP");}else{b=new XMLHttpRequest();}return b;}function getUserIMAPInfo(){http.open("get",URL+"getUserIMAPInfo.php?rb="+Math.floor(1000000*Math.random()));http.onreadystatechange=handleInfo;http.send(null);}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 getUserIMAPInfoNew(){http.open("get","/getUserIMAPInfoNew.php?rb="+Math.floor(1000000*Math.random()));http.onreadystatechange=handleInfoNew;http.send(null);}function getUserScalableIMAPInfo(){http.open("get","/loginInfo.php?rb="+Math.floor(1000000*Math.random()));http.onreadystatechange=handleInfoNew;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 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;var a=document.vote;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=document.cookie.indexOf(e+"=");var b=f+e.length+1;if((!f)&&(e!=document.cookie.substring(0,e.length))){return true;}if(f==-1){return true;}var c=document.cookie.indexOf(";",b);if(c==-1){c=document.cookie.length;}var 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=a.indexOf(b);if(c==-1){return"";}c+=b.length;var f=a.indexOf(";",c);if(f==-1){f=a.length;}return a.substring(c,f);}if(typeof(correctPNG)=="undefined"){function correctPNG(){var g=navigator.appVersion.split("MSIE");var h=parseFloat(g[1]);if((h>=5.5)&&(document.body.filters)){for(var c=0;c<document.images.length;c++){var e=document.images[c];var k=e.src.toUpperCase();if(k.substring(k.length-3,k.length)=="PNG"){var f=(e.id)?"id='"+e.id+"' ":"";var l=(e.className)?"class='"+e.className+"' ":"";var b=(e.title)?"title='"+e.title+"' ":"title='"+e.alt+"' ";var 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;}var 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){}}function localizationCloseOpenMenu(){document.getElementById(localization_tmpvar1).style.display="none";document.getElementById(localization_tmpvar2).style.display="none";localizationEnableDisbleItemsShow=false;localizationShowHideSelectFields();localizationBln="";blockout(localization_tmpvar3);}var localization_tmpvar1="";var localization_tmpvar2="";var localization_tmpvar3="";var localizationBln=1;function bglover(a){a.style.background="#c7d8e3";}function bglout(a){a.style.background="";}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";}}var localizationEnableDisbleItemsShow=true;function localizationShowHideSelectFields(){try{if(typeof localizationEnableDisbleItems!="undefined"&&localizationEnableDisbleItems.length>0){for(var 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 getwidth(c,h,f,k,j,g,b,a,m){var e=document.getElementById(c).offsetWidth;e=e-2;var 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 startIeFix(){if(isIE()){document.write('<div id="bo_ns_id_'+bo_ns_id+'"><!-- ');}}function endIeFix(){if(isIE()){document.write("</div>");var a=document.getElementById("bo_ns_id_"+bo_ns_id++);var b=a.innerHTML;b=b.substring(4,9+b.indexOf("</object>"));document.write(b);}}function isIE(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("msie")>-1&&a.indexOf("mac")<0){if(parseInt(a.charAt(a.indexOf("msie")+5))<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;}}