var cUrl=location.href;var cUrlToks=cUrl.split("/");if ( cUrlToks[2]=="localhost" ) {	var prUrl="http://localhost/projects/https://www.goals.gr";	var prDepth=5;} else {	var prUrl="https://www.goals.gr";	var prDepth=3;}function burgerSwitch(x) {    x.classList.toggle("change");	$("div.menu-cont").toggle();	$("div.league-cont").hide();}$(function () {	// basic version is: $('div.demo marquee').marquee() - but we're doing some sexy extras		$("#hot-odds").marquee("hot-odds").mouseover(function () {		$(this).trigger('stop');	}).mouseout(function () {		$(this).trigger('start');	}).mousemove(function (event) {		if ($(this).data('drag') == true) {			this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);		}	}).mousedown(function (event) {		$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);	}).mouseup(function () {		$(this).data('drag', false);	});		$("#live-ticker").marquee("live-ticker").mouseover(function () {		$(this).trigger('stop');	}).mouseout(function () {		$(this).trigger('start');	}).mousemove(function (event) {		if ($(this).data('drag') == true) {			this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);		}	}).mousedown(function (event) {		$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);	}).mouseup(function () {		$(this).data('drag', false);	});	});$(function() {	$("#datepicker").datepicker({		showOn: "button",		buttonImage: prUrl+"/images/calendar_d.png",		buttonImageOnly: true,		buttonText: "Επιλέξτε ημερομηνία...",		dateFormat: "yy-mm-dd"	},		$.datepicker.regional["el"]	);});$(function() {	$(document).ajaxSend(function(event, xhr, settings){		if (typeof pageTracker !== "undefined" && pageTracker !== null) {			pageTracker._trackPageview(settings.url);		}	});});function sideLoad(action) {	var mainSiteWidth=$("div.content").width();	var header=$("div.header-cont").height()+$("div.subheader-cont").height()+$("div.menu-cont").height();	var pageWidth=$(document).width();	var pageHeight=$(document).height()-header;	var SLWidth=(pageWidth-mainSiteWidth)/2;	if ( pageWidth >= mainSiteWidth ) {		$("span.click-me").css("width",SLWidth+"px");		$("span.click-me").css("height",pageHeight+"px");		if ( $(document).scrollTop() > header ) {			$("span.click-me").css("top","0px");		} else {			$("span.click-me").css("top",header+"px");		}		$("#click-me-left").css("left","0px");		$("#click-me-right").css("left",Number(SLWidth+mainSiteWidth)+"px");	}}$(window).on('resize load',function(e){	window.resizeEvt;	$(window).on('resize',function(){		clearTimeout(window.resizeEvt);		window.resizeEvt=setTimeout(function(){			sideLoad();		},10);	});});$(document).ready(function() {		//$("#col-right").stick_in_parent();		/// League menu	$("#leagues").live("click",function() {		$("div.league-cont").toggle();		$("div.menu-cont").hide();		$("div.burger-container").removeClass("change");	});	/// League menu		/// Side load! ///		sideLoad();	$(document).live("scroll",function(e) {		var header=$("div.header-cont").height()+$("div.subheader-cont").height()+$("div.menu-cont").height();		if ( $(this).scrollTop() > header ) {			$("span.click-me").css("top","0px");		} else {			$("span.click-me").css("top",Number(header-$(this).scrollTop())+"px");		}	});		/// Side load! ///			/// Resfresh ticker	$.doTimeout("updateTicker",120000,function(){			$.ajax({			url: prUrl+"/ajax/ticker.php",			data: "&source=ajax&"+Math.random(),			type: "GET",			dataType: "text",			timeout: 9000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				$("div.live-ticker").children("div").html(text);			}					});		return true;			});	/// Refresh ticker			/// Change date	$("#datepicker").live("change",function() {		if ( $("#live-type").val() == "gr" ) {			location.href=prUrl+"/coupon/"+$("#datepicker").val();		} else if ( $("#live-type").val() == "en" ) {			location.href=prUrl+"/livescores/"+$("#datepicker").val();		}	});	/// Change date				/// Toolbar functionality	$("span.tb, span.tb-league-selection").live("click",function() {				//var id=$(this).attr("id").replace("tb-","");		$(this).parent("span").parent("div").children("span.tb-cont").children("span.hb").removeClass("no-show").addClass("no-show");		$(this).parent("span").children("span.hb").removeClass("no-show");		$(this).parent("span").parent("div").next().children("span.hb-option").html($(this).attr("title"));				var livetype=$("#live-type").val();		var livedate=$("#live-date").val();				if ( $(this).attr("id")=="tb-time" || $(this).attr("id")=="tb-league" ) {						$("#live-holder").html("<div class=\"loading-live\"></span><span class=\"loading\"></span><br />Loading</div>");					$.ajax({				url: prUrl+"/ajax/toolbar.php",				data: "&id="+$(this).attr("id")+"&livetype="+livetype+"&livedate="+livedate,				type: "GET",				dataType: "text",				timeout: 15000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					$("#live-holder").html(text);				}			});					} else if ( $(this).attr("id")=="tb-ns" || $(this).attr("id")=="tb-live" || $(this).attr("id")=="tb-fin" ) {						$("tr.ad-row").hide();						var stT=$(this).attr("id").replace("tb-","");			$("table.live-table").children("tbody").children("tr").each(function(index) {				var sPlus=0;				$(this).removeClass("no-show").addClass("no-show");				if ( $(this).children("td.live-status").hasClass("l-"+stT) || !$(this).hasClass("live-row") ) {					$(this).removeClass("no-show");				}			});						$("table.live-table").children("tbody").children("tr").each(function(index) {				if ( $(this).hasClass("live-league") ) {					if ( $(this).next("tr").hasClass("live-row") ) {						if ( !$(this).next("tr").hasClass("no-show") ) {							$(this).children("td").children("span.live-league-open").removeClass("llo-close").addClass("llo-open");							$(this).children("td").children("span.live-league-open").html("&#8211;");						} else {							$(this).children("td").children("span.live-league-open").removeClass("llo-open").addClass("llo-close");							$(this).children("td").children("span.live-league-open").html("+");						}					}				}			});					} else if ( $(this).attr("id")=="tb-all" ) {						$("tr.ad-row").show();			$("table.live-table").children("tbody").children("tr").removeClass("no-show");			$("table.live-table").children("tbody").children("tr.live-league").children("td").children("span.live-league-open").removeClass("llo-close").addClass("llo-open");			$("table.live-table").children("tbody").children("tr.live-league").children("td").children("span.live-league-open").html("&#8211;");					} else if ( $(this).attr("id")=="tb-sel" ) {						$("tr.ad-row").hide();			var stT=$(this).attr("id").replace("tb-","");			$("table.live-table").children("tbody").children("tr").each(function(index) {								$(this).removeClass("no-show").addClass("no-show");				if ( $(this).children("td.live-select").children("span.game-select").hasClass("gs-on") || !$(this).hasClass("live-row") ) {					$(this).removeClass("no-show");				}							});						$("table.live-table").children("tbody").children("tr").each(function(index) {								if ( $(this).hasClass("live-league") ) {					if ( $(this).next("tr").hasClass("live-row") ) {						if ( !$(this).next("tr").hasClass("no-show") ) {							$(this).children("td").children("span.live-league-open").removeClass("llo-close").addClass("llo-open");							$(this).children("td").children("span.live-league-open").html("&#8211;");						} else {							$(this).children("td").children("span.live-league-open").removeClass("llo-open").addClass("llo-close");							$(this).children("td").children("span.live-league-open").html("+");						}					}				}							});					} else if ( $(this).attr("id")=="tb-mute" || $(this).attr("id")=="tb-commentator" || $(this).attr("id")=="tb-field" || $(this).attr("id")=="tb-bell" ) {						var sound=$(this).attr("id").replace("tb-","");						$.ajax({				url: prUrl+"/ajax/toolbar.php",				data: "&sound="+sound,				type: "GET",				dataType: "text",				timeout: 15000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					$("#live-sound").val(text);				}			});					} else {						if ( $(this).children("span.arrow").hasClass("active") ) {				$(this).children("span.arrow").removeClass("active");				$("#league-selector").hide();			} else {				$(this).children("span.arrow").addClass("active");				$("#league-selector").show();			}					}			});		$("select.toolbar").live("change",function() {				var livetype=$("#live-type").val();		var livedate=$("#live-date").val();		$("#fixture-int-cont").hide();				if ( $(this).attr("id")=="toolbar-sort" ) {						$("#live-holder").html("<div class=\"loading-live\"></span><span class=\"loading\"></span><br />Loading</div>");					$.ajax({				url: prUrl+"/ajax/toolbar.php",				data: "&id="+$(this).val()+"&livetype="+livetype+"&livedate="+livedate,				type: "GET",				dataType: "text",				timeout: 15000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					$("#live-holder").html(text);				}			});					} else if ( $(this).attr("id")=="toolbar-filter" ) {						$("tr.ad-row").hide();			var stT=$(this).val().replace("tb-","");						if ( stT!="all" ) {								if ( stT=="sel" ) {										$("table.live-table").children("tbody").children("tr.live-row").each(function(index) {										var sPlus=0;						$(this).removeClass("no-show").addClass("no-show");						$(this).next().removeClass("no-show").addClass("no-show");						if ( $(this).children("td.live-status").hasClass("fav") || !$(this).hasClass("live-row") ) {							$(this).removeClass("no-show");							$(this).next().removeClass("no-show");						}					});									} else {									$("table.live-table").children("tbody").children("tr.live-row").each(function(index) {										var sPlus=0;						$(this).removeClass("no-show").addClass("no-show");						$(this).next().removeClass("no-show").addClass("no-show");						if ( $(this).children("td.live-status").hasClass("l-"+stT) || !$(this).hasClass("live-row") ) {							$(this).removeClass("no-show");							$(this).next().removeClass("no-show");						}					});									}								$("table.live-table").children("tbody").children("tr").each(function(index) {					if ( $(this).hasClass("live-league") ) {						if ( $(this).next("tr").hasClass("live-row") ) {							if ( !$(this).next("tr").hasClass("no-show") ) {								$(this).children("td").children("span.live-league-open").removeClass("llo-close").addClass("llo-open");								$(this).children("td").children("span.live-league-open").html("&#8211;");							} else {								$(this).children("td").children("span.live-league-open").removeClass("llo-open").addClass("llo-close");								$(this).children("td").children("span.live-league-open").html("+");							}						}					}				});							} else {								$("tr.ad-row").show();				$("table.live-table").children("tbody").children("tr").removeClass("no-show");				$("table.live-table").children("tbody").children("tr.live-league").children("td").children("span.live-league-open").removeClass("llo-close").addClass("llo-open");				$("table.live-table").children("tbody").children("tr.live-league").children("td").children("span.live-league-open").html("&#8211;");							}					} else if ( $(this).attr("id")=="toolbar-sound" ) {						var sound=$(this).val().replace("tb-","");						$.ajax({				url: prUrl+"/ajax/toolbar.php",				data: "&sound="+sound,				type: "GET",				dataType: "text",				timeout: 15000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					$("#live-sound").val(text);				}			});					}			});		$("span.toolbar-league").live("click",function() {		$("#league-selector").toggle();		$(this).toggleClass("on");		$("div.search").hide();		$("#fixture-int-cont").hide();		$("span.toolbar-search").removeClass("on");	});		$("span.toolbar-search").live("click",function() {		$("div.search").toggle();		$(this).toggleClass("on");		$("#league-selector").hide();		$("#fixture-int-cont").hide();		$("span.toolbar-league").removeClass("on");		if ( $(this).hasClass("on") ) {			$("#search").focus();		}	});		$("#search").live("keyup",function(e) {				$("#toolbar-filter option[value=tb-all]").prop("selected",true);		var w=e.target.value.toUpperCase();		var classAp="";		var liveType=$("#live-type").val();		if ( liveType=="en" ) {			classAp="-en";		}				$("table.live-table").children("tbody").children("tr.live-row").each(function(index) {						var c=$(this).next().children("td.live-code").html();			var t1=$(this).children("td.live-home"+classAp).html();			var t2=$(this).next().children("td.live-away"+classAp).html();			$(this).removeClass("no-show").addClass("no-show");			$(this).next().removeClass("no-show").addClass("no-show");			if ( c.includes(w) || t1.includes(w) || t2.includes(w) ) {				$(this).removeClass("no-show");				$(this).next().removeClass("no-show");				$("tr.ad-row").hide();			}		});				if ( w=="" ) {			$("tr.ad-row").show();		}	});		$("span.league-selector").live("click",function() {				if ( $(this).attr("data-league") ) {			var h=1;			var sf=$(this).attr("data-league");		} else if ( $(this).attr("data-country") ) {			var h=0;			var sf=$(this).attr("data-country");		}				if ( sf=="all") {						$("table.live-table").children("tbody").children("tr").each(function(index) {				$(this).removeClass("no-show");				$("tr.ad-row").show();			});					} else {					$("table.live-table").children("tbody").children("tr").each(function(index) {				if ( $(this).attr("data-lg") ) {					var cl=$(this).attr("data-lg").split("|");					$(this).removeClass("no-show").addClass("no-show");					if ( cl[h]==sf ) {						$(this).removeClass("no-show");					}				}			});					$("tr.ad-row").hide();					}				$("#league-selector").hide();		$("span.toolbar-league").removeClass("on");		$("span.tb-league-selection").children("span.arrow").removeClass("active");		$("#toolbar-filter option[value=tb-all]").prop("selected",true);			});		/// Toolbar functionality			/// Show/hide league games	$("span.live-league-open").live("click",function() {		if ( $(this).hasClass("llo-close") ) {			$(this).parent("td").parent("tr").nextUntil("tr.live-league").each(function(index) {				$(this).removeClass("no-show");			});			$(this).removeClass("llo-close").addClass("llo-open");			$(this).html("&#8211;");		} else if ( $(this).hasClass("llo-open") ) {			$(this).parent("td").parent("tr").nextUntil("tr.live-league").each(function(index) {				$(this).addClass("no-show");			});			$(this).removeClass("llo-open").addClass("llo-close");			$(this).html("+");		}	});	/// Show/hide league games			/// Game selection	$("span.game-select, #fixture-int-cont span.favorites").live("click",function() {				var sGames=$("#live-selected").val().split("|");		var nString="";				if ( $(this).hasClass("game-select") ) {			var game=$(this).parent("td").parent("tr").attr("id").replace("gm","");		} else if ( $(this).hasClass("favorites") ) {			var game=$("#fixture-int-cont").attr("data-id");		}				if ( $(this).hasClass("gs-on") ) {			$(this).removeClass("gs-on").addClass("gs-off");			if ( $(this).hasClass("favorites") ) {				$("#gm"+game+" td.live-status").removeClass("fav");				$("#fixture-int-cont").hide();			}			for ( i=0; i<sGames.length; i++ ) {				if ( sGames[i]!=game && sGames[i]!="" ) {					nString+="|"+sGames[i];				}			}			$("#live-selected").val(nString);		} else {			$(this).removeClass("gs-off").addClass("gs-on");			if ( $(this).hasClass("favorites") ) {				$("#gm"+game+" td.live-status").addClass("fav");				$("#fixture-int-cont").hide();			}			var inSel=0;			for ( i=0; i<sGames.length; i++ ) {				if ( sGames[i]==game ) {					inSel=1;				}			}			if ( inSel==0 ) {				nString=$("#live-selected").val()+"|"+game;				$("#live-selected").val(nString);			}		}				$.ajax({			url: prUrl+"/ajax/setsel.php",			data: "&livetype="+$("#live-type").val()+"&sel="+nString,			type: "GET",			dataType: "text",			timeout: 15000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				//No need for output			}		});			});	/// Game selection				/// Toggle left column stats	$("div.box-left-country").live("click",function() {		if ( $(this).attr("id") ) {			var id=$(this).attr("id").replace("blc-","");			if ( $("#blc-cont-"+id).hasClass("no-show") ) {				$("#blc-cont-"+id).removeClass("no-show");			} else {				$("#blc-cont-"+id).addClass("no-show");			}		}	});		$("span.more-countries").live("click",function() {		$("div.box-left-country.tier-2").each(function(index) {			$(this).toggleClass("no-show");			$(this).next("div").removeClass("no-show").addClass("no-show");		});	});		/// Toggle left column stats			/// Blink ;)	$.doTimeout("blink",500,function(){		var vis=$("span.blink").filter(":first").css("visibility");		if ( vis == "visible" ) {			$("span.blink").css({"visibility":"hidden"});		} else {			$("span.blink").css({"visibility":"visible"});		}		return true;	});	/// Blink ;)			/// Odds popup	$("td.live-odds").live("click", function() {    			var c=3;    	$("#events-cont").hide();    	var id=$(this).parent("tr").attr("id").replace("gm","");		var offset=$(this).offset();		$("#odds-cont").css("top",offset.top-84);		$("#odds-cont").css("left",offset.left-273);		$("#odds-cont").show();		$("#odds-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up-"+c+"\"></span><span class=\"loading\"></span>");				if ( $(this).hasClass("stats") ) {			var date=$(this).children("input").val();			var c=3;		} else {			var date=$("#live-date").val();			var c=3;		}				if ( date==undefined ) {			var date=$(this).parent("tr").attr("data-date");		}		var rString="&d="+date+"&id="+id;				$.ajax({			url: prUrl+"/ajax/oddsPop.php",			data: rString,			type: "GET",			dataType: "text",			timeout: 5000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				gtag('config','UA-162951-3',{'page_title':'Odds details: '+id,'page_path': '/oddsdetails/'+id});				$("#odds-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up-"+c+"\"></span>"+text);			}		});			});	/// Odds popup		/// Odds popup load markets	$("span.odds-pop-more").live("click", function() {		if ( $(this).hasClass("load-market") ) {			var market=$(this).attr("id").replace("odds-","");			var rString="&d="+$("#odds-pop-date").val()+"&id="+$("#odds-pop-id").val()+"&market="+market;			$("#odds-cont-mid").html("<span class=\"odds-close\"></span><span class=\"loading\"></span>");			$.ajax({				url: prUrl+"/ajax/oddsPop.php",				data: rString,				type: "GET",				dataType: "text",				timeout: 5000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					$("#odds-cont-mid").html("<span class=\"odds-close\"></span>"+text);				}			});		}	});	/// Odds popup load markets			/// Odds comparison single odd hover	/*	$("td.odds-odd").live("mouseover", function() {    	var oData=$(this).attr("data-odds").split("|");    	var offset=$(this).offset();		$("#odds-cmp-cont").css("top",offset.top-220);		$("#odds-cmp-cont").css("left",offset.left+25);		$("#odds-cmp-cont").show();		var cont="<span class=\"odds-pop-logo b100x18-"+oData[0]+"\"></span>";		if ( Number(oData[1])!=0 ) {			if ( Number(oData[1]) < 0 ) {				var oddChangeStyle="red";			} else if ( Number(oData[1]) > 0 ) {				var oddChangeStyle="green";				oData[1]="+"+oData[1];			}			cont+="<span class=\"odds-change-date\">"+oData[2]+"</span><span class=\"odds-change-val "+oddChangeStyle+"\">"+oData[1]+"</span>";		}		$("#odds-cmp-cont-mid").html(cont);	});		$("td.odds-odd").live("mouseout", function() {		$("#odds-cmp-cont").hide();	});		*/	/// Odds comparison single odd hover			/// Sure bets popup	$("span.calc").live("click", function() {    			var c=3;    	$("#events-cont").hide();    	var id=$(this).parent("td").parent("tr").attr("id").replace("gm","");		var offset=$(this).offset();		$("#odds-cont").css("top",offset.top-84);		$("#odds-cont").css("left",offset.left-288);		$("#odds-cont").show();		$("#odds-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up-"+c+"\"></span><span class=\"loading\"></span>");				var date=$("#live-date").val();		var rString="&d="+date+"&id="+id;				$.ajax({			url: prUrl+"/ajax/sureBetCalc.php",			data: rString,			type: "GET",			dataType: "text",			timeout: 5000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				$("#odds-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up-"+c+"\"></span>"+text);			}		});			});	/// Sure bets popup			/// Sure bet calculator	$("#sure-bet-stake").live("change", function() {		var stake=Number($(this).val());		var table=$(this).parent("td").parent("tr").parent("tbody").parent("table");		var odd1=Number(table.children("tbody").children("tr").eq(2).children("td").eq(2).children("a").html().replace(",","."));		var oddX=Number(table.children("tbody").children("tr").eq(3).children("td").eq(2).children("a").html().replace(",","."));		var odd2=Number(table.children("tbody").children("tr").eq(4).children("td").eq(2).children("a").html().replace(",","."));		var gan=Number(100+(-1*(100*(1-(1/((1/odd1)+(1/oddX)+(1/odd2)))))));		gan=gan/100;		var ret=stake*gan;		var stake1=Number(stake*gan/odd1).toFixed(2).replace(".",",");		var stakeX=Number(stake*gan/oddX).toFixed(2).replace(".",",");		var stake2=Number(stake*gan/odd2).toFixed(2).replace(".",",");		table.children("tbody").children("tr").eq(2).children("td").eq(3).html(stake1);		table.children("tbody").children("tr").eq(3).children("td").eq(3).html(stakeX);		table.children("tbody").children("tr").eq(4).children("td").eq(3).html(stake2);		table.children("tbody").children("tr").eq(6).children("td").eq(4).html(ret.toFixed(2).replace(".",","));			});	/// Sure bet calculator			/// Events popup	$("td.live-score, span.score").live("click", function() {				if ( $("#leagues").length==0 ) {    					var c="";			$("#odds-cont").hide();			var offset=$(this).offset();			$("#events-cont").css("top",offset.top-84);						if ( $(this).hasClass("score") ) {				var dt=$(this).parent("td").parent("tr").attr("id").replace("gm","").split("_");				var id=dt[3];				var date=dt[4];				var league=dt[1];				var season=dt[2];				var rString="&d="+date+"&id="+id+"&l="+league+"&s="+season;				$("#events-cont").css("left",offset.left-345);				c="1";			} else {				var id=$(this).parent("tr").attr("id").replace("gm","");				var date=$(this).parent("tr").attr("data-date");				var rString="&d="+date+"&id="+id;				$("#events-cont").css("left",offset.left-520);				c="2";			}						$("#events-cont").show();			$("#events-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up-"+c+"\"></span><span class=\"loading\"></span>");						$.ajax({				url: prUrl+"/ajax/eventsPop.php",				data: rString,				type: "GET",				dataType: "text",				timeout: 5000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					gtag('config','UA-162951-3',{'page_title':'Event details: '+id,'page_path': '/eventdetails/'+id});					$("#events-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up-"+c+"\"></span>"+text);				}			});					}			});	/// Events popup		/// Live popup close	$("span.odds-close").live("click", function() {		$("#odds-cont").hide();		$("#events-cont").hide();		$("body").removeClass("noscroll");	});	/// Live popup close			/// Report a bug	$("div.footer-bug").live("click", function() {		$("#footer_contact_text").val("Θα ήθελα να αναφέρω πρόβλημα στη σελίδα: "+location.href+"\nΠεριγραφή: ");	});	/// Report a bug			/// Scroll left and right columns	/*	$(window).scroll(function () { 		var ad120=$("div.ad120:last");		var offset=ad120.offset();		var vo=Number(Number(window.pageYOffset)+Number($(window).height()));		var rc=Number(Number(offset.top)+Number($("div.ad120:last").css("height").replace("px","")));		if ( vo > rc ) {			var pad=vo-rc;			$("#col-right").css("padding-top",pad+"px");		}	});	*/	/// Scroll left and right columns		/// Betfair sort	$("#betfair-sort").live("change", function() {		location.href=prUrl+"/tziroi/"+$("#oDate").val()+"/"+$("#betfair-sort option:selected").val()+"/";	});	/// Betfair sort		/// Team fixture filter		$("select.team-option").live("change", function() {		var team=$("#team").val();		var league=$("#team-league").val();		var ground=$("#team-ground").val();		var opponent=$("#team-opponent").val();		var rString="&team="+team+"&league="+league+"&ground="+ground+"&opponent="+opponent+"&"+Math.random();		$("#team-cont").html("<div class=\"loading-live\"><span class=\"loading\"></span><br />Loading</div>");		$.ajax({			url: prUrl+"/ajax/teamfixtures.php",			data: rString,			type: "GET",			dataType: "text",			timeout: 10000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				$("#team-cont").html(text);			}		});	});		$("span.pager").live("click", function() {		var team=$("#team").val();		var league=$("#team-league").val();		var ground=$("#team-ground").val();		var opponent=$("#team-opponent").val();		var page=$(this).attr("id").replace("p-","");		var rString="&team="+team+"&league="+league+"&ground="+ground+"&opponent="+opponent+"&page="+page+"&"+Math.random();		$("#team-cont").html("<div class=\"loading-live\"><span class=\"loading\"></span><br />Loading</div>");		$.ajax({			url: prUrl+"/ajax/teamfixtures.php",			data: rString,			type: "GET",			dataType: "text",			timeout: 10000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				$("#team-cont").html(text);			}		});	});		/// Team fixture filter				/// Season selector		$("#season").live("change",function() {		location.href=prUrl+"/stats/"+cUrlToks[prDepth+1]+"/"+$("#season").val();	});		/// Season selector			/// Basketball	$.doTimeout("updateBbTable",60000,function(){				if ( cUrlToks[prDepth]=="basketball" ) {				$.ajax({				url: prUrl+"/ajax/basketball.php",				data: "&d="+$("#live-date").val()+"&"+Math.random(),				type: "GET",				dataType: "text",				timeout: 9000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					$("#bbTable").html(text);				}							});			return true;					}			});	/// Basketball			/// Live betting	$.doTimeout("livebetting",120000,function(){			$.ajax({			url: prUrl+"/ajax/livebetting.php",			data: "&source=ajax&"+Math.random(),			type: "GET",			dataType: "text",			timeout: 9000,			cache: false,			error: function(){				//alert("Error loading XML document");			},			success: function(text){				if ( text!="" ) {					$("#live-betting").html("<span class=\"live-betting-close\"></span>"+text);				}			}					});		return true;			});		$("span.live-betting-close").live("click", function() {		var h=$("#live-betting-cont").height();		$("#live-betting-cont").animate({			bottom: -Number(h+20)+"px"		}, 1000, function() {			$.ajax({				url: prUrl+"/ajax/createCookie.php",				data: "&dur=1&name=livebetting&sessionId=xxx"+Math.random(),				type: "GET",				dataType: "text",				timeout: 9000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){									}							});		});	});		/// Live betting			/// Footer bookies	$("#footer-bookies").unslider({		animation: 'fade',		autoplay: true,		arrows: false,		delay: 7000,		nav: false,		arrows: false	});	/// Footer bookies			/// 3D pitch toggle size	$("span.pitch-size").live("click",function() {		$("#pitch").toggleClass("huge");		$("#pitch").toggleClass("pos");		$("#pitch").children("canvas").toggleClass("huge");		$("body").toggleClass("noscroll");	});	/// 3D pitch toggle size			/// Mobile interactions		$("#fixture-int-cont span.details").live("click",function() {				$("body").addClass("noscroll");		$("#events-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up\"></span><span class=\"loading\"></span>");		$("#events-cont").show();		$("#fixture-int-cont").hide();				var id=$("#fixture-int-cont").attr("data-id");		var date=$("#fixture-int-cont").attr("data-date");		var h=$("#fixture-int-cont").attr("data-home");		var a=$("#fixture-int-cont").attr("data-away");		var l=$("#fixture-int-cont").attr("data-league");		var rString="&d="+date+"&id="+id+"&h="+h+"&a="+a;				$.ajax({				url: prUrl+"/ajax/eventsPop.php",				data: rString,				type: "GET",				dataType: "text",				timeout: 5000,				cache: false,				error: function(){					//alert("Error loading XML document");				},				success: function(text){					gtag('config','UA-162951-3',{'page_title':'Event details: '+id,'page_path': '/eventdetails/'+id});					$("#events-cont").html("<span class=\"odds-close\"></span><span class=\"arrow-up\"></span>"+text);				}			});			});		if ( $("#fixture-int-cont")!=="undefined" ) {				$("#liveTable tr").live("click",function() {			if ( $(this).attr("data-lg") ) {				var init=$(this);				if ( !$(this).attr("id") ) {					var init=$(this).prev();				}				var offset=init.offset();				var h=init.height()+init.next().height();				$("#fixture-int-cont").attr("data-id",init.attr("id").replace("gm",""));				$("#fixture-int-cont").attr("data-date",init.attr("data-date"));				$("#fixture-int-cont").attr("data-home",init.children("td.live-home").attr("data-perm"));				$("#fixture-int-cont").attr("data-away",init.next().children("td.live-away").attr("data-perm"));				$("#fixture-int-cont").attr("data-league",init.children("td.live-flag").attr("data-perm"));				var sGames=$("#live-selected").val().split("|");				var inSel=0;				for ( i=0; i<sGames.length; i++ ) {					if ( sGames[i]==$("#fixture-int-cont").attr("data-id") ) {						inSel=1;					}				}				$("#fixture-int-cont span.favorites").removeClass("gs-on").removeClass("gs-off");				if ( inSel==1 ) {					$("#fixture-int-cont span.favorites").addClass("gs-on");				}				if ( init.children("td.live-flag").attr("data-perm")!="" ) {					$("#fixture-int-cont span.league").parent("a").prop("href",prUrl+init.children("td.live-flag").attr("data-perm"));					$("#fixture-int-cont span.league").show();				} else {					$("#fixture-int-cont span.league").hide();				}				$("#fixture-int-cont #team1").parent("a").prop("href","teams/"+init.children("td.live-home").attr("data-perm"));				$("#fixture-int-cont #team1").text(init.children("td.live-home").text());				$("#fixture-int-cont #team2").parent("a").prop("href","teams/"+init.next().children("td.live-away").attr("data-perm"));				$("#fixture-int-cont #team2").text(init.next().children("td.live-away").text());				$("#fixture-int-cont").css("top",offset.top-62).css("height",h+"px");				$("#fixture-int-cont").show();			}		});				$("#fixture-int-cont span.close").live("click",function() {			$("#fixture-int-cont").hide();			$("#fixture-int-cont").attr("data-id","");			$("#fixture-int-cont").attr("data-date","");			$("#fixture-int-cont").attr("data-home","");			$("#fixture-int-cont").attr("data-away","");			$("#fixture-int-cont").attr("data-league","");		});			}		if ( $("table.league-1 tr.tbl-overheader td:nth-child(n+2)").css("display")=="none" ) {				$("table.league-1").each(function(index) {			var html="";			var h=0;			$(this).find("tr.tbl-overheader td").each(function(i) {				var span=Number($(this).attr("colspan"));				h+=span;				l=h-span+1;				html+="<span class=\"button\" data-control=\""+l+"|"+h+"\">"+$(this).html()+"</span>";			});			$(this).find("tr.tbl-overheader td:first-child").html(html);					$(this).find("tr.tbl-overheader td:first-child span:first-child").addClass("on");		});				$("table.league-1 tr.tbl-overheader td:first-child span").live("click",function() {			$(this).parent("td").children("span").removeClass("on");			$(this).addClass("on");			var lim=$(this).attr("data-control").split("|");			$("table.league-1 tr:nth-child(n+2)").each(function(index) {				$(this).children("td").each(function(i) {					var j=i+1;					if ( j<=2 || (j>=lim[0] && j<=lim[1]) ) {						$(this).show();					} else {						$(this).hide();					}				});			});					});				}		if ( $("table.league-3 tr td:nth-child(n+4)").css("display")=="none" ) {				var html="<span class=\"button-title\">"+$("table.league-3 tr.tbl-overheader td:first-child").html()+"</span>";		$("table.league-3 tr.tbl-header td:nth-child(n+3)").each(function(index) {			html+="<span class=\"button\" data-control=\""+index+"\">"+$(this).html()+"</span>";		});				$("table.league-3 tr.tbl-overheader td:first-child").html(html);		$("table.league-3 tr.tbl-overheader td:first-child span:nth-child(2)").addClass("on");				$("table.league-3 tr.tbl-overheader td:first-child span.button").live("click",function() {			$(this).parent("td").children("span.button").removeClass("on");			$(this).addClass("on");			var lim=Number($(this).attr("data-control"))+3;			$("table.league-3 tr:nth-child(n+2)").each(function(index) {				$(this).children("td").each(function(i) {					var j=i+1;					if ( j<=2 || j==lim ) {						$(this).show();					} else {						$(this).hide();					}				});			});					});				}		if ( $("table.league-4 tr.tbl-header:nth-child(2) td:nth-child(n+3)").css("display")=="none" ) {				var html="<span class=\"button-title\">"+$("table.league-4 tr.tbl-overheader td:first-child").html()+"</span>";		$("table.league-4 tr.tbl-header:nth-child(2) td:nth-child(n+2)").each(function(index) {			html+="<span class=\"button\" data-control=\""+index+"\">"+$(this).html()+"</span>";		});				$("table.league-4 tr.tbl-overheader td:first-child").html(html);		$("table.league-4 tr.tbl-overheader td:first-child span:nth-child(2)").addClass("on");				$("table.league-4 tr.tbl-overheader td:first-child span.button").live("click",function() {			$(this).parent("td").children("span.button").removeClass("on");			$(this).addClass("on");			var h=8*(Number($(this).attr("data-control"))+1)+2;			var l=h-7;			var lim=Number($(this).attr("data-control"))+2;			$("table.league-4 tr:nth-child(n+2) td").each(function(i) {				var j=i+1;				if ( j==1 || j==lim ) {					$(this).show();				} else {					$(this).hide();				}			});			$("table.league-4 tr:nth-child(n+3)").each(function(index) {				$(this).children("td").each(function(i) {					var j=i+1;					if ( j<=2 || (j>=l && j<=h) ) {						$(this).show();					} else {						$(this).hide();					}				});			});		});				}			$("table.tab1-table tr td, table.tab2-table tr td, table.tab3-table tr td").live("click",function() {				$(this).siblings().removeClass("on");		$(this).addClass("on");		$("div.eventdetails").hide();				var idt=$(this).attr("id").split("-");		var lvl=idt.length;				$("table.tab"+lvl+"-table").hide();		$("#cnt-"+$(this).attr("id")).show();		$("#details-"+$(this).attr("id")).show();				if ( $(this).closest("table").hasClass("tab1-table") ) {			$("table.tab3-table").hide();		}				$("#cnt-"+$(this).attr("id")).find("td").each(function(index) {			if ( $(this).hasClass("on") ) {				$("#cnt-"+$(this).attr("id")).show();				$("#details-"+$(this).attr("id")).show();			}		});			});			/// Mobile interactions	});