var LRoot="http://football.maktoob.com/world-cup/";var MatchEventXMLRoot="http://football.maktoob.com/world-cup/";var Indicator="<b>يرجى الإنتظار ...</b>";function GetXmlHttp(){var a=false;if(window.XMLHttpRequest){a=new XMLHttpRequest();}else{if(window.ActiveXObject){try{a=new ActiveXObject("Msxml2.XMLHTTP");}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP");}catch(b){a=false;}}}}return a;}function AJAXGet(a,e,d,c){var b=new GetXmlHttp();if(b){b.onreadystatechange=function(){if(b&&b.readyState==4){if(b.status==200){if(e!=null){e(b.responseText);}}}};if(String(d).toLowerCase()=="post"){b.open("POST",a,true);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Content-length",c.length);b.setRequestHeader("Connection","close");b.send(c);}else{b.open("GET",a,true);b.send(null);}}}function AJAXGetJS(a,g,f,d,c){var b=document.createElement("script");b.type="text/javascript";b.src=a;if(b.readyState){b.onreadystatechange=function(){if(b.readyState=="loaded"||b.readyState=="complete"){b.onreadystatechange=null;GoTocallback(g,c);}};}else{b.onload=function(){GoTocallback(g,c);};}document.getElementsByTagName("head")[0].appendChild(b);}function GoTocallback(callback,Flag){if(eval("strResult"+Flag)!="undefined"){callback(eval("strResult"+Flag));}}function $$(a){return document.getElementById(a);}function getkey(a){if(window.event){return window.event.keyCode;}else{if(a){return a.which;}else{return null;}}}function HitKey(b,c){var a=$$(c);key=getkey(b);if(key==13){a.click();return false;}}function DoSearch(){if($$("ygmasearchInput")==null){return false;}cleanInjection("ygmasearchInput");if($$("ygmasearchInput").value.trim()==""||$$("ygmasearchInput").value.trim()=="بحث"){alert("الرجاء إدخال نص للبحث");$$("ygmasearchInput").focus();return false;}var a=encodeURI($$("ygmasearchInput").value);self.location.href=SPLink.replace("[KEYWORD]",a);return false;}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};function ValidateEmail(a,c){var b=$$(a).value;var d=new RegExp(/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);if(d.exec(b)==null){$$(a).focus();alert(c);return false;}return true;}function isValidLongText(c){var a=new String($$(c).value);if(a.split(" ").length==1){if(a.length<55){return true;}return false;}for(var b=0;b<a.split(" ").length;b++){if(a.split(" ")[b].length>40){return false;}}return true;}function cleanInjection(a){if($$(a).type!="file"){var b=new RegExp("[/!@#$%^&*_+}|(){:?.<>'\"]","g");$$(a).value=$$(a).value.trim().replace(b,"");}}function validateInput(b,a,h){var f=new String(b);var c=new String(a);for(var e=0;e<f.split(",").length;e++){var d=f.split(",")[e];var g=c.split(",")[e];var k=true;switch($$(d).tagName.toLowerCase()){case"select":if($$(d).value==-1){k=false;}break;case"input":case"textarea":if($$(d).type=="file"){if($$(d).value!=""&&$$(d).value.toLowerCase().indexOf(".jpg")==-1){alert("(.Jpg) انواع الملفات المسموح بها فقط");k=false;}}if($$(d).type!="file"){if(!isValidLongText(d)){alert("بعض الكلمات تحتوي على أحرف أكثر من المسموح");$$(d).select();return false;}}if($$(d).value==""){k=false;}else{if(d.toLowerCase().indexOf("email")>-1){if(!ValidateEmail(d,"الرجاء ادخال بريد صحيح")){return false;}}else{cleanInjection(d);}}break;}if(!k){alert(g);if($$(d).style.display!="none"){$$(d).focus();}return false;}}if($$("divLoadingUpld")){$$("divLoadingUpld").style.display="block";}if($$(h)){$$(h).style.display="none";}if($$("btnDum")){$$("btnDum").style.display="block";}return true;}function SubmitComment(a,e,b,d,c){CollectParams(a,e,b,d,c);GetUserAddCommentResults("post");}function CollectParams(a,e,b,d,c){params="EId="+a;params=params+"&typeId="+c;if($$(b)!=null){params=params+"&name="+sReplaceHTMLSpecialCharacters($$(b).value);}if($$(e)!=null){params=params+"&Content="+sReplaceHTMLAndsCharacter(sReplaceHTMLSpecialCharacters($$(e).value));}if($$(d)!=null){params=params+"&CodeValue="+sReplaceHTMLAndsCharacter(sReplaceHTMLSpecialCharacters($$(d).value));}}function sReplaceHTMLAndsCharacter(b){var a=new RegExp("[&]","g");b=b.replace(a,"^#38;");return b;}function sReplaceHTMLSpecialCharacters(b){var a=new RegExp("(script)","gi");b=b.replace(a,"");return b;}function GetUserAddCommentResults(a){AJAXGet(LRoot+"Controls/Ajax_Handlers/General_AJAX.ashx?Flag=1",FillAddCommentForm,a,params);}function FillAddCommentForm(b){str1=b.split("~!~")[0];if(str1.trim()=="0"){$$("divCommentAddResult").style.display="block";$$("divCommentAddResult").innerHTML="عذرًا، فشل الإرسال .. الرجاء المحاولة لاحقًا";var a=b.split("~!~")[1];$$("ctl02_Comments1_imgCode").src=a;}else{$$("divCommentAddResult").style.display="block";$$("divCommentAddResult").innerHTML="شكرًا لك .. تم إرسال تعليقك بنجاح!";$$("ctl02_Comments1_tbContent").value="";$$("ctl02_Comments1_tbName").value="";$$("ctl02_Comments1_tbcode").value="";var a=b.split("~!~")[1];$$("ctl02_Comments1_imgCode").src=a;}}function SprtImgError(c,a){var b=new RegExp("/([0-9])+/","g");c.onerror=null;c.src=c.src.replace(b,"/0/");}function SubmitTellFriend(b,c,a,d){CollectParamsTellFriend(b,c,a,d);GetTellFreindResults("post");}function CollectParamsTellFriend(b,c,a,d){params="URL="+window.location.href;if($$(b)!=null){params=params+"&name="+sReplaceHTMLSpecialCharacters($$(b).value);}if($$(c)!=null){params=params+"&Code="+sReplaceHTMLAndsCharacter(sReplaceHTMLSpecialCharacters($$(c).value));}if($$(a)!=null){params=params+"&frnName="+sReplaceHTMLAndsCharacter(sReplaceHTMLSpecialCharacters($$(a).value));}if($$(d)!=null){params=params+"&frnEmail="+sReplaceHTMLAndsCharacter(sReplaceHTMLSpecialCharacters($$(d).value));}}function GetTellFreindResults(a){AJAXGet(LRoot+"Controls/Ajax_Handlers/General_AJAXPage.aspx?Flag=2",FillTellFriendForm,a,params);}function FillTellFriendForm(b){str1=b.split("~!~")[0];if(str1.trim()=="0"){$$("divTellFriendResult").innerHTML="<br /><b class='red'>عذرًا، فشل الإرسال .. الرجاء المحاولة مجددًا.</b><br />";var a=b.split("~!~")[1];$$("ctl02_TellFriend1_imgCode").src=a;}else{$$("divTellFriend").style.display="none";$$("ctl02_TellFriend1_tbName").value="";$$("ctl02_TellFriend1_tbFriendName").value="";$$("ctl02_TellFriend1_tbFriendEmail").value="";$$("ctl02_TellFriend1_tbCode").value="";}}function ChangeTabs(f,d,g,e,a,b,c){if(b=="0"){$$("divTable").innerHTML='<strong><a href="'+a+'">جدول</a></strong>';$$("divGraph").innerHTML='<a href="'+c+'">تأهيلات</a>';}else{$$("divGraph").innerHTML='<strong><a href="'+c+'">تأهيلات</a></strong>';$$("divTable").innerHTML='<a href="'+a+'">جدول</a>';}if(e=="1"){$$("DivGroupNav").style.display="Block";$$("DivAllNav").style.display="none";}for(i=1;i<=g;i++){if(d==i){$$(f+i).className="alfaselect1";}else{if(i==g&&d!=g){$$(f+i).className="last1";}else{$$(f+i).className="alfa1";}}}return;}function showImage(a){if($$(a)!=null){$$(a).style.visibility="visible";}}function hideImage(a){if($$(a)!=null){$$(a).style.visibility="hidden";}}function GoToURL(a){window.location.href=a;}function GoToAnchor(c,a){var b=self.location.href;if(b.indexOf("#")>-1){b=b.split("#")[0];}self.location.href=b+"#"+c;if($$(a)!=null){$$(a).focus();}return false;}function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString();}else{var a="";}document.cookie=c+"="+d+a+"; path=/";}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length);}if(f.indexOf(e)==0){return f.substring(e.length,f.length);}}return null;}function eraseCookie(a){createCookie(a,"",-1);}function ReportAbuse(a){params="id="+a;$$("liC"+a).innerHTML="أبلغ عن إساءة";if($$("hdnCrumbID")==null||$$("hdnCrumbID").value==""){FillCrumbId();setTimeout("GetReportAbuse('post')",10000);}else{GetReportAbuse("post");}}function GetReportAbuse(a){AJAXGet(LRoot+"Controls/Ajax_Handlers/General_AJAX.ashx?Flag=3&crumbID="+$$("hdnCrumbID").value,FillAbuse,a,params);}function FillAbuse(c){str1=c.split("~!~")[0];id=c.split("~!~")[1];if(str1.trim()=="0"){$$("liC"+id).innerHTML="عذرًا، حدث خطأ أثناء الإبلاغ عن إساءة!";}else{var b="ComAbuse_"+id;createCookie(b,"1",1);var a=readCookie(b);$$("liC"+id).innerHTML="شكرًا لك لإبلاغنا عن إساءة!";}}function HideReportAbuse(c){var b="ComAbuse_"+c;var a=readCookie(b);if(a=="1"){$$("liC"+c).innerHTML="شكرًا لك لإبلاغنا عن إساءة!";}}function tabChange(b,d,c){for(var a=1;a<=d;a++){if($$(b+a)){$$(b+a).className="";}}if($$(b+c)){$$(b+c).className="selected";}}function tabs_global(a,f,b,h,g){tabChange(a,h,g);for(var d=1;d<=h;d++){var c=f+d.toString();var e=b+d.toString();if(f!=""){$$(c).style.display="none";}if($$(e)){$$(e).style.display="none";}}var e=b+g.toString();if($$(e)){$$(e).style.display="block";}return false;}function getElementLeft(a){var b;if(document.getElementById){var b=document.getElementById(a);}else{if(document.all){var b=document.all[a];}}xPos=b.offsetLeft;tempEl=b.offsetParent;while(tempEl!=null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent;}return xPos;}function getElementTop(a){if(document.getElementById){var b=document.getElementById(a);}else{if(document.all){var b=document.all[a];}}yPos=b.offsetTop;tempEl=b.offsetParent;while(tempEl!=null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent;}return yPos;}function OpenPlayerPopUp(l,c,f,a,b,e,k,d){$$("imgPlayerPop").style.display="none";var h=0;var g=0;$$("divPlayerPopUp").style.left=(getElementLeft(l)+50)+"px";$$("divPlayerPopUp").style.top=(getElementTop(l)-150)+"px";$$("divPlayerPopUp").style.display="block";$$("spnName").innerHTML=d;$$("spnClub").innerHTML=e;$$("spnDate").innerHTML=a;$$("spnPlace").innerHTML=b;if(c.trim()!=""){$$("LiWeight").style.display="block";$$("spnWeight").innerHTML=c;}else{$$("LiWeight").style.display="none";}if(f.trim()!=""){$$("Lihieght").style.display="block";$$("spnHeight").innerHTML=f;}else{$$("Lihieght").style.display="none";}$$("imgPlayerPop").src=k;$$("imgPlayerPop").onerror=function(){var m=new RegExp("/([0-9])+/","g");$$("imgPlayerPop").onerror=null;$$("imgPlayerPop").src=$$("imgPlayerPop").src.replace(m,"/0/");};$$("imgPlayerPop").style.display="";}function HidePlayerPopUp(){$$("divPlayerPopUp").style.display="none";}function HidePlayerPopUp_1(){$$("divPlayerPopUp").style.display="none";}function GetMatchEvent(b){var a=MatchEventXMLRoot+"JS/matches/events/"+b+".js?Ran="+guid();AJAXGet(a,FillMatchEvent,"get",null);setTimeout("GetMatchEvent('"+b+"')",1000*60);}function FillMatchEvent(d){if(d!=null||d!=""){d=d.replace("</div>","");d=d.replace('<div id="parent">',"");if(d.trim()==""){return false;}if(d.split("~!!~").length<4){return false;}var b=d.split("~!!~")[0].split("~!~")[0];var e=d.split("~!!~")[0].split("~!~")[3];var l=d.split("~!!~")[0].split("~!~")[2];var a=d.split("~!!~")[0].split("~!~")[4];if(a=="0"){return false;}$$("DivMainDuring").style.display="Block";var m=d.split("~!!~")[0].split("~!~")[1];var f=d.split("~!!~")[1].split("~!~");var r=d.split("~!!~")[3].split("~!~");var k=d.split("~!!~")[2].split("~!~");SetPointOfArrow(m,b);$$("DivAwayGoals").innerHTML=l;$$("DivHomeGoals").innerHTML=e;var g;$$("Events").innerHTML="";for(g=0;g<f.length;g++){if(f[g]!=""){var o=f[g].split(",")[0];var p=0;p=GetPointOfTimeLine(m,o);var n=document.createElement("Div");var c=document.createElement("Div");var q=document.createElement("Div");n.setAttribute("ID","MainPopEvent"+g);n.setAttribute("onMouseOver","MaxPopupEvent('"+g+"','"+f[g].split(",")[1]+"')");n.setAttribute("onmouseout","MinPopupEvent('"+g+"')");if(f[g].split(",")[4]=="1"){n.setAttribute("class","drpdon w20");}else{n.setAttribute("class","drpdond w20");}n.style.left=p;n.setAttribute("style","left:"+p+"px;");q.setAttribute("ID","DivPopupEventMiddle"+g);if(f[g].split(",")[4]=="1"){q.setAttribute("class","popup");}else{q.setAttribute("class","popupd");}c.setAttribute("ID","DivPopupEventImg"+g);c.setAttribute("class",SelectEventClass(f[g].split(",")[2]));n.appendChild(q);q.appendChild(c);var h=$$("Events");h.appendChild(n);$$("Events").innerHTML=$$("Events").innerHTML;}}FillSubEvents(r,m,g);fillPenaltyDiv(k);}}function FillSubEvents(h,d,b){for(j=0;j<h.length;j++){if(h[j]!=""){var f=h[j].split(",")[2];var g=0;g=GetPointOfTimeLine(d,f);var e=document.createElement("Div");var a=document.createElement("Div");var k=document.createElement("Div");e.setAttribute("ID","MainPopEvent"+b);e.setAttribute("onMouseOver","MaxPopupEventSup('"+b+"','"+h[j].split(",")[0]+"')");e.setAttribute("onmouseout","MinPopupEventSup('"+b+"','"+h[j].split(",")[0]+"')");if(h[j].split(",")[1]=="1"){e.setAttribute("class","drpdon w20");}else{e.setAttribute("class","drpdond w20");}e.style.left=g;e.setAttribute("style","left:"+g+"px;");k.setAttribute("ID","DivPopupEventMiddle"+b);k.setAttribute("class","popup");a.setAttribute("ID","DivPopupEventImg"+b);a.setAttribute("class",SelectEventClass(5));e.appendChild(k);k.appendChild(a);var c=$$("Events");c.appendChild(e);$$("Events").innerHTML=$$("Events").innerHTML;}b++;}}var isSelectedStartTeamForPenalty=false;function SelectStartTeamForPenalty(a){if(!isSelectedStartTeamForPenalty){if(a=="0"){var b=$$("DivPenaltyHomeTeamName").innerHTML;$$("DivPenaltyHomeTeamName").innerHTML=$$("DivPenaltyAwayTeamName").innerHTML;$$("DivPenaltyAwayTeamName").innerHTML=b;}}isSelectedStartTeamForPenalty=true;}function fillPenaltyDiv(b){if(b.length>1){$$("DivPenaltyMain").style.display="block";SelectStartTeamForPenalty(b[0].split(",")[4]);var c;var d="<ul>";var a="dark";for(c=0;c<b.length-1;c=c+2){if(a=="dark"){a="light";}else{a="dark";}d+='<li class="'+a+'"><span class="number">'+((c/2)+1)+"</span>";if(b[c].split(",")[2]=="44"){d+='<div class="icn_mtch1n">&nbsp;</div>';}else{d+='<div class="icn_mtch7">&nbsp;</div>';}if(b.length-1>c+1){if(b[c+1].split(",")[2]=="44"){d+='<div class="icn_mtch1n">&nbsp;</div>';}else{d+='<div class="icn_mtch7">&nbsp;</div>';}}d+="</li>";}$$("DivPenalty").innerHTML=d+"</ul>";}CheckPenaltyScroll(b.length);}var MaxPXLeftPenaltyScroll=1;function CheckPenaltyScroll(a){if(a>18){$$("DivLeftPenaltyArrow").style.display="block";$$("DivRightPenaltyArrow").style.display="block";$$("DivPenaltyEvents").className=" fltlt overflow-height scrl1";$$("DivPenalty").className="scrl2";var b=(((a/2)-9)*50)+(((a/2)-9)*13);$$("DivPenalty").style.left=b*-1+"px";MaxPXLeftPenaltyScroll=b*-1;}else{$$("DivLeftPenaltyArrow").style.display="none";$$("DivRightPenaltyArrow").style.display="none";$$("DivPenaltyEvents").className=" fltlt overflow-height scrl";$$("DivPenalty").className="";$$("DivPenalty").style.left="1px";MaxPXLeftPenaltyScroll=1;}}function SetPointOfArrow(a,b){if(a==1){$$("DivDuring_arrow").style.width=(548-((548*b)/90))+56;}else{if(a==2){$$("DivDuring_arrow").style.width=(548-((548*b)/90))+20;}else{if(a==3){$$("DivMainDuring").className="during";$$("DivDuring_arrow").style.width=(548-((548*b)/120))+56;}else{if(a==4){$$("DivMainDuring").className="during";$$("DivDuring_arrow").style.width=(548-((548*b)/120))+20;}}}}}function GetPointOfTimeLine(a,b){var c=0;if(b<=45){if(a==1||a==2){c=((280*b)/45)+8;}else{c=((180*b)/45)+8;}}else{if(b<=90){if(a==1||a==2){c=((280*(b-45))/45)+316;}else{c=((180*(b-45))/45)+216;}}else{if(b<=105){c=((90*(b-90))/15)+398;}else{if(b<=120){c=((90*(b-105))/15)+498;}}}}return c;}function SelectEventClass(b){var a="";if(b=="1"){a="icn_mtch1b";}else{if(b=="2"){a="icn_mtch2b";}else{if(b=="3"||b=="23"){a="icn_mtch3b";}else{if(b=="24"){a="icn_mtch6b";}else{if(b=="5"){a="icn_mtch8b";}}}}}return a;}function MaxPopupEventSup(c,d){var f="1";if(d.toString().split(":").length>3){f="2";}var b="MainPopEvent"+c;var e="DivPopupEventImg"+c;var a="DivPopupEventMiddle"+c;$$(b).className=$$(b).className.split(" ")[0].replace(f,"")+f;$$(a).className=$$(a).className.replace(f,"")+f;$$(e).innerHTML=d.toString().replace(new RegExp(":","g"),"<br/>");$$(e).className=$$(e).className.replace("b","");$$(b).style.zIndex=999;}function MinPopupEventSup(c,d){var f="1";if(d.toString().split(":").length>3){f="2";}var b="MainPopEvent"+c;var e="DivPopupEventImg"+c;var a="DivPopupEventMiddle"+c;$$(b).className=$$(b).className.split(f)[0]+" w20";$$(a).className=$$(a).className.split(f)[0];$$(e).innerHTML="";$$(e).className=$$(e).className+"b";$$(b).style.zIndex=0;}function MaxPopupEvent(b,c){var a="MainPopEvent"+b;var d="DivPopupEventImg"+b;$$(a).className=$$(a).className.split(" ")[0];$$(d).innerHTML=c;$$(d).className=$$(d).className.replace("b","");$$(a).style.zIndex=999;}function MinPopupEvent(b){var a="MainPopEvent"+b;var c="DivPopupEventImg"+b;$$(a).className=$$(a).className+" w20";$$(c).innerHTML="";$$(c).className=$$(c).className+"b";$$(a).style.zIndex=0;}var PenaltyScrollInterval;function RunPenaltyScrollInterval(a){if(a=="right"){PenaltyScrollInterval=setInterval(PenaltyScrollRight,10);}else{PenaltyScrollInterval=setInterval(PenaltyScrollLeft,10);}}function StopPenaltyScrollInterval(){clearInterval(PenaltyScrollInterval);}function PenaltyScrollRight(){var a=parseInt($$("DivPenalty").style.left.replace("px",""));if(a<=MaxPXLeftPenaltyScroll){clearInterval(PenaltyScrollInterval);}else{$$("DivPenalty").style.left=(a-2)+"px";}}function PenaltyScrollLeft(){var a=parseInt($$("DivPenalty").style.left.replace("px",""));if(a>=1){clearInterval(PenaltyScrollInterval);}else{$$("DivPenalty").style.left=(a+2)+"px";}}function guid(){return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());}function S4(){return(((1+Math.random())*65536)|0).toString(16).substring(1);}function ValidateContentLength(d,f,a){var e="لقد وصلت للحد الأقصى المسموح به لعدد أحرف التعليق الواحد.";var g=null;var b=null;if($$(d)!=null){g=$$(d);}if($$(f)!=null){b=$$(f);}if(g!=null&&b!=null){if(g.value.length>a){alert(e);g.value=g.value.substring(0,a);}}var h="";if(g.value.length<a){h="<b style='color:green'>"+g.value.length+"</b>";}else{h="<b style='color:red'>"+g.value.length+"</b>";}b.innerHTML=h+" <b>من "+a+"</b>";}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length);}if(f.indexOf(e)==0){return f.substring(e.length,f.length);}}return null;}function FillCrumbId(){var a=Math.random()*11;AJAXGet(LRoot+"Controls/Ajax_Handlers/General_AJAXPage.aspx?random="+guid()+"&Flag=4",callBackFromAjaxFillCrumbId,"get","");}function callBackFromAjaxFillCrumbId(a){if(a!=""){var b=a.split("~!~")[0].split("[CrumbID]")[1];$$("hdnCrumbID").value=b;}}function FixPNG(){var f=navigator.appVersion.split("MSIE");var g=parseFloat(f[1]);if((g>=5.5)&&(document.body.filters)){for(var c=0;c<document.images.length;c++){var d=document.images[c];var k=d.src.toUpperCase();if(k.substring(k.length-3,k.length)=="PNG"){var e=(d.id)?"id='"+d.id+"' ":"";var l=(d.className)?"class='"+d.className+"' ":"";var b=(d.title)?"title='"+d.title+"' ":"title='"+d.alt+"' ";var h="display:inline-block;"+d.style.cssText;if(d.align=="left"){h="float:left;"+h;}if(d.align=="right"){h="float:right;"+h;}if(d.parentElement.href){h="cursor:hand;"+h;}var a="<span "+e+l+b+' style="width:'+d.width+"px; height:"+d.height+"px;"+h+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"', sizingMethod='scale');\"></span>";d.outerHTML=a;c=c-1;}}}}
