﻿/*
Match Code mapping
胜负彩 WOL
六场半全 Six
四场进球 Four
北京单场 BjSingle
竞彩 Jingcai
*/

window.onload = PageLoad;
//Page Load Init Event
function PageLoad(){  
	var firstIn = 0;
	//Get Match Handle Mantch Panel Object
	var MatchPanelSelectPanel = document.getElementById("MatchPanelSelectPanel");
	var cookie = getCookie("LiveOddsSelectTypeID");
	if(cookie==null) cookie="5";

	//Get Selected childNode List Object arrayList
	var CheckBoxList = MatchPanelSelectPanel.getElementsByTagName("INPUT");
	for(var i=0;i<CheckBoxList.length;i++){
		var Panel = document.getElementById(CheckBoxList[i].id.replace("chkShow","")+"Panel");
		Panel.style.display = "block";
		Panel.setAttribute("totteryName",eval("CheckBoxList[i].parentNode."+(document.all?"innerText":"textContent")));
		if(CheckBoxList[i].value.length != 0 && parseInt(CheckBoxList[i].value)){
			switch(SystemGlobal.HandleType){
				case 1://process score data
					if(cookie==CheckBoxList[i].value){
						 var zcs = document.getElementById("zcs"+CheckBoxList[i].value);
						 zcs.parentNode.className = "myons";
						 DataReader("/info/match/Handle/DataReader.aspx?HandleType="+SystemGlobal.HandleType+"&TypeID="+CheckBoxList[i].value,Panel);
						 break;
					}
					break;
				case 2://process index data					
					var _cookie = getCookie("CookiesIndexCompany");
					try{
						var Com = _cookie.split(']');
					}
					catch(e){
						setCookie("CookiesIndexCompany","[4][30][1][12][3][24]");
						var Com = "[4][30][1][12][3][24]".split(']');
					}
					
					var chkBoxCompanyList = document.getElementById("CompanySelectPanel").getElementsByTagName("INPUT");
					for(var j =0 ;j<Com.length-1;j++){
						for(var c=0;c<chkBoxCompanyList.length;c++){
							if(chkBoxCompanyList[c].value == Com[j].replace('[',"")){
								chkBoxCompanyList[c].checked = true;
							}
						}
					}
					
					if(cookie==CheckBoxList[i].value){
						var zcs = document.getElementById("zcs"+CheckBoxList[i].value);
						zcs.parentNode.className = "myons";
						var param = "";
						for(var j=0;j<chkBoxCompanyList.length;j++)
							if(chkBoxCompanyList[j].checked) param += chkBoxCompanyList[j].value+',';
							
						DataReader("/info/match/Handle/DataReader.aspx?HandleType="+SystemGlobal.HandleType+"&TypeID="+CheckBoxList[i].value+"&CompanyID="+param,Panel);
						break;
					}
					break;
			}
		}
	}
	//Laod function cookies
	var _functionArr = getCookie("CookiesScore");
	if(_functionArr)
	for(var i=0;i<_functionArr.split(',').length;i++){
		if(_functionArr.split(',')[i] != "1"){
			var CheckFunctionBox = document.getElementById("Scoreright").getElementsByTagName("INPUT");
			for(var j=0;j<CheckFunctionBox.length;j++){
				if(j==i) CheckFunctionBox[j].checked = false;
			}
		}
	}
 	setTimeout("UpdateTimer()",5000);
}
function SwitchMenu(code,sender){
	var List = sender.parentNode.parentNode.childNodes;
	for(var i=0;i<List.length;i++){
		List[i].className = "";
	}
	sender.parentNode.className = "myons";
}

//Match Panel Display Method
function ShowPanel(code) {
	try{
		var chkBoxRadioList = document.getElementById("MatchPanelSelectPanel").getElementsByTagName("INPUT");
		for(var i=0;i<chkBoxRadioList.length;i++){
			document.getElementById(chkBoxRadioList[i].id.replace("chkShow","")+"Panel").style.display = "none";
		}
	
		var CurrentPanel = ConvertObjectByString(code+"SessionPanel");
		CurrentPanel.style.display = "block";
		var CurrentCheckBox = ConvertObjectByString("chkShow"+code+"Session");		
		
		if(code=='BjSingle') setCookie("LiveOddsSelectTypeID",'5');
		if(code=='Jingcai') setCookie("LiveOddsSelectTypeID",'101');
		if(code=='WOL') setCookie("LiveOddsSelectTypeID",'1');
		if(code=='Six') setCookie("LiveOddsSelectTypeID",'3');
		if(code=='Four') setCookie("LiveOddsSelectTypeID",'4');

			CurrentPanel.setAttribute("totteryName",eval("CurrentCheckBox.parentNode."+(document.all?"innerText":"textContent")));
				switch(SystemGlobal.HandleType){
					case 1://process score data
						if(document.all){
							//if(CurrentPanel.childNodes.length==0)
								DataReader("/info/match/Handle/DataReader.aspx?HandleType=" + SystemGlobal.HandleType + "&TypeID=" + CurrentCheckBox.value, CurrentPanel);
						}else{
							if(CurrentPanel.childNodes.length==1)
								DataReader("/info/match/Handle/DataReader.aspx?HandleType=" + SystemGlobal.HandleType + "&TypeID=" + CurrentCheckBox.value, CurrentPanel);
						}
						break;
					case 2://process index data
						if(document.all){
							if(CurrentPanel.childNodes.length==0){
								var param = "";
								var chkBoxCompanyList = document.getElementById("CompanySelectPanel").getElementsByTagName("INPUT");
								for(var j=0;j<chkBoxCompanyList.length;j++)
									if(chkBoxCompanyList[j].checked)
										param += chkBoxCompanyList[j].value+',';
									DataReader("/info/match/Handle/DataReader.aspx?HandleType=" + SystemGlobal.HandleType + "&TypeID=" + CurrentCheckBox.value + "&CompanyID=" + param, CurrentPanel);
							}
						}else{
							if(CurrentPanel.childNodes.length==1){
								var param = "";
								var chkBoxCompanyList = document.getElementById("CompanySelectPanel").getElementsByTagName("INPUT");
								for(var j=0;j<chkBoxCompanyList.length;j++)
									if(chkBoxCompanyList[j].checked)
										param += chkBoxCompanyList[j].value+',';
									DataReader("/info/match/Handle/DataReader.aspx?HandleType=" + SystemGlobal.HandleType + "&TypeID=" + CurrentCheckBox.value + "&CompanyID=" + param, CurrentPanel);
							}
						}
						break;
					default: if (document.all) {
							if (CurrentPanel.childNodes.length == 0)
								DataReader("/Info/Match/Handle/DataReader.aspx?HandleType=" + SystemGlobal.HandleType + "&TypeID=" + CurrentCheckBox.value, CurrentPanel);
						} else {
							if (CurrentPanel.childNodes.length == 1)
								DataReader("/Info/Match/Handle/DataReader.aspx?HandleType=" + SystemGlobal.HandleType + "&TypeID=" + CurrentCheckBox.value, CurrentPanel);
						}
						
						break;
				}
		}catch(e){
		CatchException(e);
	}
}
//Convert parameters string type for object type
function ConvertObjectByString(str){
	var obj = document.getElementById(str);
	if(obj)
		//return result
		return obj;
	else{
		//not exist object alert info
		CatchException("字符串\""+str+"\"无法转化为Object类型! 请检查是否存在该对象");
		return null;
	}
}
//Show All panel hidden row item
function ShowHiddenItem(){
	document.getElementById("HiddenSceneNumber").innerHTML = "0";
	var HiddenScene = document.getElementsByName("HiddenScene");
	
	for(var i=0;i<HiddenScene.length;i++){
		switch(SystemGlobal.HandleType){
			case 1:
				HiddenScene[i].checked = true;
				HiddenScene[i].parentNode.parentNode.style.display = "block";
				break;
			case 2:
				HiddenScene[i].parentNode.parentNode.parentNode.style.display = "block";
				break;
		}
	}
}

//Update Timer
function UpdateTimer(){
    if(SystemGlobal.HandleType==1){
        GetScoreChangeXml();
    }
    else{
	    DataUpdater("/info/match/Handle/DataUpdater.aspx?HandleType=" + SystemGlobal.HandleType);
	}
    setTimeout("UpdateTimer()",SystemGlobal.UpdateTime);
}

//set background to white
function SetColor(senderNode){
	setTimeout(function(){
		senderNode.style.backgroundColor = "";
		SetColor(senderNode);
	},SystemGlobal.Timeout);
}
//Create card element
function CreateCard(Color,DataObject,senderNode){
	if(parseInt(DataObject.Color)!=0&&DataObject.Color!=undefined){
		
		var Card = document.createElement("IMG");
		Card.className = Color;
		Card.id = DataObject.Card +"_"+DataObject.ScheduleID;
		Card.src = "/info/match/Images/" + Color + DataObject.Color + ".gif";
		Card.style.height = 14+"px";
		Card.style.width = 12+"px";
		
		senderNode.appendChild(Card);
		return Card;
	}
}
//dropdownlist control selector
function DropListDateSelector(Date,SenderNode){
	for(var i=0;i<SenderNode.options.length;i++){
		if(SenderNode.options[i].value == Date){
			SenderNode.options[i].selected = true;
		}
	}
}
//Display Company Odds by companyID
function ShowCompany(senderNode){
	//add cookie
	var _cookie = getCookie("CookiesIndexCompany");
	if(_cookie.indexOf("["+senderNode.value+"]") == -1){
		if(senderNode.checked){
			setCookie("CookiesIndexCompany",_cookie+"["+senderNode.value+"]");
		}
	}
	else{
		if(senderNode.checked){
		}
		else{
			_cookie = _cookie.replace("["+senderNode.value+"]","");
			setCookie("CookiesIndexCompany",_cookie);
		}
	}
	
	//get all row item
	var CompanyList = document.getElementsByName("CompanyRow_"+senderNode.value);
	
	for(var i=0;i<CompanyList.length;i++){
		var Row = undefined;
		
		if(document.all&&CompanyList[i].tagName != "INPUT")
			Row = CompanyList[i];
		else if(document.all!=true&&CompanyList[i].tagName == "INPUT")
			Row = CompanyList[i].parentNode.parentNode;
			
		if(Row == undefined)
			continue;
		
		if(senderNode.checked)//checked is true for block
			Row.style.display = "block";
		else
			Row.style.display = "none";
	}
	
	if(CompanyList.length==0){
		var param = "";
		var no = "";
		var PanelList = new Array("BjSingle","Jingcai","WOL","Six","Four");
		var CheckBoxList = document.getElementById("MatchPanelSelectPanel").getElementsByTagName("INPUT");
		for(var i=0;i<CheckBoxList.length;i++){
				// try{
					for(var j=0;j<PanelList.length;j++){
						var Panel = document.getElementById(PanelList[j]+"SessionPanel");
						if(Panel.childNodes.length!=0&&CheckBoxList[i].value == Panel.getAttribute("value")){
							no += Panel.getElementsByTagName("Select").item(0).value+",";
							param += CheckBoxList[i].value +",";
						}
					}
			  //  }catch(e){}
		}
		DataReader("/info/match/Handle/DataReader.aspx?HandleType=3&TypeID=" + param + "&CompanyID=" + senderNode.value + "&no=" + no, senderNode, "ReaderCompany");
	}
}
//Show all start page default company odds
function ShowDefaultCompany(){
	//default value
	var defaultStr = "[4][30][1][12][3][24]";
	setCookie("CookiesIndexCompany",defaultStr);
	//get all checkbok item
	var CheckList = document.getElementById("CompanySelectPanel").getElementsByTagName("INPUT");
	var param=no=company="";
	for(var i=0;i<CheckList.length;i++){
		var tempStr = defaultStr.split(CheckList[i].value);
		//if exist this value
		if(tempStr.length==1||i==11){
			CheckList[i].checked = false;//set change false
			
			var CompanyList = document.getElementsByName("CompanyRow_"+CheckList[i].value);
			for(var j=0;j<CompanyList.length;j++){//set display none and hidden
				var Row = undefined;
				
				if(document.all&&CompanyList[j].tagName != "INPUT")
					Row = CompanyList[j];
				else if(document.all!=true&&CompanyList[j].tagName == "INPUT")
					Row = CompanyList[j].parentNode.parentNode;
				
				if(Row == undefined){
					continue;
				}else{
					Row.style.display = "none";
				}
			}
		}else{
			CheckList[i].checked = true;//set change true
			
			var CompanyList = document.getElementsByName("CompanyRow_"+CheckList[i].value);
			if(CompanyList.length != 0){
				for(var j=0;j<CompanyList.length;j++){//set display none and hidden
					var Row = undefined;
					
					if(document.all&&CompanyList[j].tagName != "INPUT")
						Row = CompanyList[j];
					else if(document.all!=true&&CompanyList[j].tagName == "INPUT")
						Row = CompanyList[j].parentNode.parentNode;
					
					if(Row == undefined)
						continue;
					else
						Row.style.display = "block";
				}
			}else{
				company += CheckList[i].value+',';
				
				var PanelList = new Array("BjSingle","Jingcai","WOL","Six","Four");
				var CheckBoxList = document.getElementById("MatchPanelSelectPanel").getElementsByTagName("INPUT");
				for(var j=0;j<PanelList.length;j++){
					var Panel = document.getElementById(PanelList[j]+"SessionPanel");
					if(Panel.childNodes.length!=0){//&&CheckBoxList[i].value == Panel.getAttribute("value")
						no = Panel.getElementsByTagName("Select").item(0).value+",";
						param = Panel.getAttribute("value") +",";
						DataReader("/info/match/Handle/DataReader.aspx?HandleType=3&TypeID=" + param + "&CompanyID=" + CheckList[i].value + "&no=" + no, Panel, "ReaderCompany");
					}
				}
			}
		}
	}
	

}
//log function status cookies
function FunctionCookies(key,senderNode){
	var _cookies = "";
	var _cookie = "1,1,1,1";
	
	var cookiearr=document.cookie.toString().split(';');
	for (var i=0;i<cookiearr.length;i++){
		var cookiesubarr=cookiearr[i].split('=');
		if (cookiesubarr[0].replace(" ","")=="CookiesScore"){
			_cookie = cookiesubarr[1];
		}
	}
	
	for(var i=0;i<_cookie.split(',').length;i++){
		if(i==key)
			if(senderNode.checked)
				_cookies += "1";
			else
				_cookies += "0";
		else
			_cookies += _cookie.split(',')[i];
		if(i!=_cookie.split(',').length-1)
			_cookies += ",";
	}
	setCookie("CookiesScore",_cookies);
}
//Load mode Framework
function Loading(){
	var LoadFramework = document.createElement("DIV");
	LoadFramework.id = "LoadFramework";
	document.body.appendChild(LoadFramework);

		var LoadingBar = document.createElement("DIV");
		LoadingBar.id = "LoadingBar";
		LoadingBar.style.width = 0+"px";
		LoadFramework.appendChild(LoadingBar);
		
		LoadingTimer();
		
		var LoadingText = document.createElement("DIV");
		LoadingText.id = "LoadingText";
		LoadingText.innerHTML = "正在加载中 请稍等...";
		LoadFramework.appendChild(LoadingText);
		
		var LoadingTips = document.createElement("DIV");
		LoadingTips.innerHTML = "加载完成后窗口将自动关闭";
		LoadFramework.appendChild(LoadingTips);
}
function LoadingTimer(){
		setTimeout(function(){
			try{
					var LoadingBar = document.getElementById("LoadingBar");
					var LoadingText = document.getElementById("LoadingText");
					if((parseInt(LoadingBar.style.width.replace('px',''))+5)<=260)
						LoadingBar.style.width = (parseInt(LoadingBar.style.width.replace('px',''))+5)+"px";
					else
						LoadingText.innerHTML = "数据加载完毕...";
					LoadingTimer();
			}catch(e){}
		},100);
}
function RemoveLoading(){
	try{
		var LoadingBar = document.getElementById("LoadingBar");
		LoadingBar.style.width = 260+"px";
		setTimeout(function(){
			var LoadFramework = document.getElementById("LoadFramework");
			LoadFramework.parentNode.removeChild(LoadFramework);
		},100);
	}catch(e){
	}
}

var ajax = new Ajax();

function zXmlHttp(){
	return ajax.CreateXMLHttpRequest();
}
/*Call page results page data
	URL: Handle Page Link Url;
*/
function DataReader(URL,senderNode){
	//Get creater new ajax object
	ajax.CreateXMLHttpRequest(); 
	var HttpRequest = ajax.HttpRequest;
	
	if(URL.indexOf('?')<0){
		URL+="?now="+ new Date().getTime();
	}else{
		URL+="&now="+ new Date().getTime(); 
	}
	
	HttpRequest.open("GET", URL, true);
	
	var param = arguments.length>2 ? arguments[2]:"Reader";
	//Loading
	if(param=="Reader")
		Loading();
	//Asynchronous call method
	HttpRequest.onreadystatechange = function() {
		if (HttpRequest.readyState == 4 && HttpRequest.status == 200) {
			Processor(HttpRequest.responseText,senderNode,param);
		}
	}
	HttpRequest.send(null);
}
function PageReader(URL,Method){
	//Get creater new ajax object
	ajax.CreateXMLHttpRequest(); 
	var HttpRequest = ajax.HttpRequest;
	
	if(URL.indexOf('?')<0){
		URL+="?now="+ new Date().getTime();
	}else{
		URL+="&now="+ new Date().getTime(); 
	}

	HttpRequest.open("GET", "/info/match/Handle/PageReader.ashx?HandleType=" + Method + "&URL=" + URL, true);

	//Asynchronous call method
	HttpRequest.onreadystatechange = function() {
		if (HttpRequest.readyState == 4 && HttpRequest.status == 200) {
			OpenWindow(HttpRequest.responseText,Method);
		}
	}
	HttpRequest.send(null);
}
//Ajax Updater processor
function DataUpdater(URL){
	DataReader(URL,"","Updater");
}

function OpenWindow(Response,HandleType){
	//alert(((window.screen.width/2)-(700/2)));
	//
	switch(HandleType){
		case "Score":
			var win = window.open('', '',"'width=700, height=550,left="+((window.screen.width/2)-(700/2))+",top=50,scrollbars=yes,resizable=no'");
			win.document.writeln(Response);
		break;
		case "OddsDown":
			var win = window.open('', '',"'width=700, height=550,left="+((window.screen.width/2)-(700/2))+",top=50,scrollbars=yes,resizable=no'");
			win.document.writeln(Response);
		break;
		case "Over_ASPX_HTML":
			WriterHTML(Response);
		break;
		case "Future_ASPX_HTML":
			WriterHTML(Response);
		break;
	}
}
//Sceoc Dialog Alarm
function Dialog(DataObject, HandleType) {
	var Dialog = document.getElementById(DataObject.ID);
	//if dialog framework is exist by remove
	var ItemList;
	/*if(Dialog){
	ItemList = Dialog.childNodes[1].childNodes;
	Dialog.parentNode.removeChild(Dialog);
	}*/
	if (Dialog == undefined) {
		//create dialog framework div
		Dialog = document.createElement("DIV");
		Dialog.style.top = GetScrollTop() + "px";
		Dialog.id = DataObject.ID;
		document.body.appendChild(Dialog); //add to body area
		//Add dialog header area
		var Header = document.createElement("DIV");
		Header.className = "Header";
		Dialog.appendChild(Header);
		//left dialog title 
		var Title = document.createElement("DIV");
		Title.className = "Title";
		Title.innerHTML = DataObject.Title;
		Header.appendChild(Title);
		//right handle help area
		var Handle = document.createElement("DIV");
		Handle.className = "Handle";
		Handle.innerHTML = "[关闭]";
		Header.appendChild(Handle);
		Handle.onclick = function() {
			this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); //remove this node
			clearTimeout(clock); //clear auto close event
		}
		//Add dialog body area
		var Body = document.createElement("DIV");
		Body.className = "Body";
		Dialog.appendChild(Body);

		var Item = document.createElement("DIV");
		Item.innerHTML = DataObject.Text;
		Body.appendChild(Item);

		var DialogHidden = document.createElement("INPUT");
		DialogHidden.type = "checkbox";
		DialogHidden.name = "DialogHidden";
		DialogHidden.id = "DialogHidden";
		DialogHidden.style.display = "none";
		Dialog.appendChild(DialogHidden);

	}
	else {
		var Body = Dialog.childNodes[1];

		var Item = document.createElement("DIV");
		Item.innerHTML = DataObject.Text;
		Body.appendChild(Item);
	}
	//statup auto close event
	clock = setTimeout(function() {
		Dialog.parentNode.removeChild(Dialog);
	}, SystemGlobal.DialogTime);

	var chkSoundTips = document.getElementById("chkSoundTips");
	if (chkSoundTips.checked)
		Sound();
}
//player sound
function Sound() {
	var Sound = document.createElement("DIV");
	Sound.style.dispaly = "none";
	Sound.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='1' height='1'><param name='movie' value='/info/match/Sound/Default.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='/info/match/Sound/Default.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
	document.body.appendChild(Sound);

	setTimeout(function() {
		Sound.parentNode.removeChild(Sound);
	}, 3000);
}
//ShowMatchType
function ShowMatchType() {
	var MatchType = document.getElementById("MatchType");
	MatchType.style.display = "block";
	MatchType.innerHTML = "";

	var Header = document.createElement("DIV");
	Header.className = "Header";
	MatchType.appendChild(Header);
	//left dialog title 
	var Title = document.createElement("DIV");
	Title.className = "Title";
	Title.innerHTML = "赛事选择";
	Header.appendChild(Title);
	//right handle help area
	var Handle = document.createElement("DIV");
	Handle.className = "Handle";
	Header.appendChild(Handle);
	var IconClose = document.createElement("IMG");
	IconClose.src = "/info/match/Images/Close.gif";
	IconClose.onclick = function() {
		this.parentNode.parentNode.parentNode.style.display = "none";
	}
	Handle.appendChild(IconClose);

	var both = document.createElement("DIV");
	both.style.clear = "both";
	Header.appendChild(both);

	for (var i = 0; i < MatchTypeSclass.split(',').length - 1; i++) {
		var Name = MatchTypeSclass.split(',')[i].split('$')[0];
		var Color = MatchTypeSclass.split(',')[i].split('$')[1];

		var MatchSclass = document.createElement("DIV");
		MatchSclass.className = "MatchSclass";
		MatchSclass.style.backgroundColor = "#FFF0F0"; //Color;
		MatchType.appendChild(MatchSclass);

		var lab = document.createElement("Label");
		MatchSclass.appendChild(lab);

		var chkSclassBox = document.createElement("INPUT");
		chkSclassBox.type = "checkbox";
		lab.appendChild(chkSclassBox);
		chkSclassBox.checked = true;
		chkSclassBox.onclick = function() {
	        var trs=document.getElementById("TableScore").getElementsByTagName("tr");
	        for(var i=1;i<trs.length;i++){
	            var sclass=this.parentNode.getElementsByTagName("SPAN").item(0).innerHTML;
    	        if(trs[i].cells[2].innerHTML==sclass){
                    trs[i].style.display=this.checked ? "block" : "none";
                }
	        }
		}
		var SPAN = document.createElement("SPAN");
		SPAN.innerHTML = Name;
		lab.appendChild(SPAN);

	}
}
var MatchTypeSclass = "";
function SclassSingle(Name, Color) {
	if (MatchTypeSclass.indexOf(Name) == -1) {
		MatchTypeSclass += Name + "$" + Color + ",";
	}
}

var w3c = (document.getElementById) ? true : false;
var agt = navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));

function IeTrueBody() {
	return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
}

function GetScrollTop() {
	return ie ? IeTrueBody().scrollTop : window.pageYOffset;
}

window.onscroll = function() {
	var DialogList = document.getElementsByName("DialogHidden");
	for (var i = 0; i < DialogList.length; i++) {
		DialogList[i].parentNode.style.top = GetScrollTop() + "px";
	}
}

function getScroll() {
	var t, l, w, h;
	if (document.documentElement && document.documentElement.scrollTop) {
		t = document.documentElement.scrollTop;
		l = document.documentElement.scrollLeft;
		w = document.documentElement.scrollWidth;
		h = document.documentElement.scrollHeight;
	} else if (document.body) {
		t = document.body.scrollTop;
		l = document.body.scrollLeft;
		w = document.body.scrollWidth;
		h = document.body.scrollHeight;
	}
	return { t: t, l: l, w: w, h: h };
}

function EuropeOdds(ID) {
var theURL='/1x2/'+ID+'.html';
window.open(theURL,'','');}
function AsianOdds(ID) {
var theURL='/handicap/'+ID+'.html';
window.open(theURL,'','');}
function analysis(ID){
var theURL='/analysis/'+ID+'.htm';
window.open(theURL,'','');
}

function showgoallist(ID){
	window.open("/info/match/detail.aspx?id=" + ID , "","scrollbars=yes,resizable=yes,width=668, height=520");
}
