﻿self.onError=null;

function stoperror(){return true;};
window.onerror=stoperror;

function AddFavorites(){

 //window.external.addFavorite(location.href,'即时比分[知足网] livescore[zQzz.com]');
	 var title="即时比分[知足网]";
	 
	 var url=location.href;
	 
	 var ua = navigator.userAgent.toLowerCase();
	 
     try{
         external.AddToFavoritesBar(url,title,'知足网');//IE8
     }catch(e){
	 try {
           window.external.addFavorite(url, title);
         } catch(e) {
           try {
                window.sidebar.addPanel(title, url, "");//firefox
               } catch(e) {
                     alert("加入收藏失败，请使用Ctrl+D进行添加");
               }
	 
	 }
     }



}
function setCookie(name, value, expire){var expDate=new Date();if(expire){expDate.setTime(expDate.getTime()+expire);document.cookie = name + "=" + escape(value)+ "; expires=" + expDate.toGMTString();}else{document.cookie = name + "=" + escape(value);}}
function getCookie(Name){var search=Name+"=";if(document.cookie.length > 0){offset=document.cookie.indexOf(search);if(offset != -1){offset+=search.length;end=document.cookie.indexOf(";", offset);if(end == -1)end=document.cookie.length;return unescape(document.cookie.substring(offset, end));}else  return "";}else return "";}

var DropIdAry = getCookie("DropIdAry");
var MyTeamAry = getCookie("MyTeamAry"); 
var diffTime=0;
var LANG=0; 
var ShowMatch_Type="";
var sound_B="";
var SssAry={1:"<font color=#6699FF>未</font>", 2:"上",  3:"<font color=olivedrab>中</font>", 4:"下",5:"<font color=#EE0000>完</font>",  6:"<font color=copper>加</font>", 7:"<font color=dimgray>点</font>",8: "加", 9: "点",10: "斩", 11:"<font color=gray>延</font>", 12:"<font color=green>待</font>", 13:"<font color=green>斩</font>", 14:"<font color=green>点</font>", 15: "点",16: "W.O.",17:"<font color=green>换</font>"};
var SoundArray=["3","1","2","0","4","5"];
if(getCookie("ShowMatch_Type")!=""){ShowMatch_Type="1";}
if(location.href.indexOf("TYPE=1") != -1){ ShowMatch_Type="1";/*setCookie("ShowMatch_Type","1",1000*60*60*24*30);*/ }
if(location.href.indexOf("LANG=1") != -1){ LANG=1;setCookie("LANG","1",1000*60*60*24*30); }
if(location.href.indexOf("LANG=2") != -1){ LANG=2;setCookie("LANG","2",1000*60*60*24*30);SssAry = {1:"", 2:"1T", 3:"<font color=olivedrab>HF</font>", 4:"2T", 5:"<font color=#EE0000>FT</font>", 6:"<font color=red>ET</font>", 7:"<font color=copper>Pen</font>",8: "加", 9: "点",10: "斩", 11:"<font color=dimgray>Postp.</font>", 12:"<font color=gray>FT Only</font>", 13:"<font color=green>Susp.</font>", 14:"<font color=green>Pen.</font>", 15: "点",16: "W.O.",17:"<font color=green>ANL</font>"};}
if(LANG==0){setCookie("LANG","0",1000*60*60*24*30);}
var ginfoWIN=null;

function select_scroller(){
	var n=document.getElementsByName("showscroller")[0];
	if(n.checked){
		n.checked=false;
		document.getElementById("zqzz_showgoaltext").parentNode.style.display="none";
		setCookie("DiShowPopTxt","1",1000*60*60*24*30);
		document.getElementById("s_min_3").src="../images/min_3x.gif";
	}else{
		n.checked=true;
		document.getElementById("zqzz_showgoaltext").parentNode.style.display="";
		setCookie("DiShowPopTxt","",1000*60*60*24*30);
		document.getElementById("s_min_3").src="../images/min_3.gif";
	}
}

function select_scroller_f(){
	var n=document.getElementsByName("showgoal_f")[0];
	if(n.checked){
		n.checked=false;
		setCookie("DiShowWindow","1",1000*60*60*24*30);
		document.getElementById("s_min_2").src="../images/min_2x.gif";
	}else{
		n.checked=true;
		setCookie("DiShowWindow","",1000*60*60*24*30);
		document.getElementById("s_min_2").src="../images/min_2.gif";
	}
}

function select_scroller_s(){
	var n=document.getElementsByName("showgoal_s")[0];
	if(n.checked){
		n.checked=false;
		setCookie("DiShowPlaySound","1",1000*60*60*24*30);
		document.getElementById("s_min_1").src="../images/min_1x.gif";
	}else{
		n.checked=true;
		setCookie("DiShowPlaySound","",1000*60*60*24*30);
		document.getElementById("s_min_1").src="../images/min_1.gif";
	}
}

function select_fontSize(m)
{
	var n1=document.getElementById("Tableone");
	var n2=document.getElementById("TableMy");
	if(m!="1")
	{
		n1.style.fontSize = "9pt"; n2.style.fontSize = "9pt";
		setCookie("DiTabFontSize","0",1000*60*60*24*30);
		document.getElementById("s_min_4").src = "../images/min_4.gif";
		document.getElementById("s_min_5").src = "../images/min_5x.gif";
	}else{
		n1.style.fontSize = "10.5pt"; n2.style.fontSize = "10.5pt";
		setCookie("DiTabFontSize","1",1000*60*60*24*30);
		document.getElementById("s_min_4").src = "../images/min_4x.gif";
		document.getElementById("s_min_5").src = "../images/min_5.gif";
	}
}


function openplayer(addr,dsString){if(ginfoWIN!=null){ginfoWIN.close();} var now=new Date(dsString);ginfoWIN=window.open("../goalinfo.htm?bg="+document.getElementById('ss_'+addr).parentNode.style.backgroundColor+"&date="+now.getFullYear()+"/"+(now.getMonth()+1)+"/"+now.getDate()+"&id="+addr,"ginfoWIN","width=480,height=380,scrollbars=1");}
function openslots(addr){window.open("../data/slot/"+addr+".htm","zqzzslots","width=465,height=460,scrollbars=yes,resizable=yes");}
function selectAColor(m)
{
	if(m==""){m="0";}
	switch(m){
		case "0": document.body.style.backgroundColor="#FFFFFF"; document.body.style.color="#333333"; break;
		case "1": document.body.style.backgroundColor="#245DDB"; document.body.style.color="#000000"; break;
		case "2": document.body.style.backgroundColor="#FB8F8E"; document.body.style.color="#333333"; break;
		case "3": document.body.style.backgroundColor="#DD0000"; document.body.style.color="#333333"; break;
		case "4": document.body.style.backgroundColor="#9AD861"; document.body.style.color="#333333"; break;
		case "5": document.body.style.backgroundColor="#72EB61"; document.body.style.color="#333333"; break;
		case "6": document.body.style.backgroundColor="#F3B352"; document.body.style.color="#333333"; break;
		case "7": document.body.style.backgroundColor="#DD8800"; document.body.style.color="#333333"; break;
		case "8": document.body.style.backgroundColor="#FCFCFC"; document.body.style.color="#333333"; break;
		case "9": document.body.style.backgroundColor="#CECECE"; document.body.style.color="#333333"; break;
	}
	window.setTimeout("setCookie(\"selectbgColor\","+m+","+1000*60*60*24*30+")",500);
}
function selectSounds(changeSound){ if(changeSound==""){changeSound=0;} sound_B="<embed src='../swf/G"+SoundArray[changeSound]+".swf' width=1 height=1></embed>"; window.setTimeout("setCookie(\"selectSounds\","+changeSound+","+1000*60*60*24*30+")",500); }


selectAColor(getCookie("selectbgColor"));
selectSounds(getCookie("selectSounds"));

function FixedTime(T){var TimeStr=""; Tmp=T.split(",");TimeStr=Tmp[3]+":"+Tmp[4];return TimeStr;}
function GoStratTime(T)
{
	T = T.split(",");
	var d = new Date(T[0],T[1]-1,T[2],T[3],T[4],0);
	var SS = d.getDay();
	var YY = d.getFullYear();
	var MM = ((d.getMonth()+1) < 10)? "0"+(d.getMonth()+1):(d.getMonth()+1);
	var DD = (d.getDate() <10)? "0"+d.getDate():d.getDate();
	var ss = (d.getHours() <10)? "0"+d.getHours():d.getHours();
	var mm = (d.getMinutes() < 10)? "0"+d.getMinutes():d.getMinutes();
	return YY+"-"+MM+"-"+DD+" "+ss+":"+mm;
}

function DiyMinMenuHTML()
{

	var Me=["賽事選擇","澳門","完整","隱藏:","賽程","賽果","SB"];
	if(LANG==1){Me=["赛事选择","澳门","完整","隐藏:","赛程","赛果","SB"];}
	if(LANG==2){Me=["Match","OM","Full","Hide:","Fixture","Results","SB"];}
	var Tp='<table border="0" id="DiyOptionDIV" cellspacing="0" cellpadding="0">'+
		'<tr>'+
			'<td style="padding:2px 3px 0px 6px; border-right:1px solid #9c9c9c; width:189px;">'+
				'<img src="../images/bf_min_ss.gif" border=0 style="margin-top:2px; margin-right:5px; float:left; cursor:default">'+
				'<input style="float:left; width:100px; height:15px;line-height:15px;" id="bf_collect" name="bf_colledct" value="请输入赛事或球队" />'+
				'<img src="../images/bf_ss_btn.gif" style="margin-left:3px;margin-right:3px;float:left;" border=0 id=\'bf_ss\' onclick=\'\'>'+
			'</td>'+
			'<td align="center" style="margin-left:5px; border-right:1px solid #9c9c9c; width:78px;">'+
				'<a href="javascript:void(0)" onclick="utilityOBJ.select_ssall()" target="_self" style="color:black">'+Me[3]+'[<b><span id="MatchHideNum" style="font-family:Tahoma;color:red">0</span></b>]'+
			'</td>'+
			'<td align="center" style="padding-bottom:1px; border-right:1px solid #9c9c9c; width:154px;">'+
				'<table width="100%" cellspacing="0" cellpadding="0" style="border-bottom:1px solid #9c9c9c;">'+
				'<tr style="border-bottom:1px solid #9c9c9c;height:20px;">'+
				'<td width="40" align="center">'+
				'声效:'+
				'</td>'+
				'<td  align="left">'+
				'<img style="margin-top:-2px;"  src="../images/min_1.gif" border=0 id=\'s_min_1\' onclick=\'select_scroller_s()\'> '+
				'</td>'+
				'<td width="40" align="center">'+
				'文字:'+
				'</td>'+
				'<td  align="left">'+
				'<img style="margin-top: -4px;" src="../images/min_4.gif" border=0 id=\'s_min_4\' onclick=\'select_fontSize(1)\'><img style="margin-top: -4px;" src="../images/min_5.gif" border=0 id=\'s_min_5\' onclick=\'select_fontSize(0)\'>'+
				'</td>'+
				'</tr>'+
				'</table>'+
				'<table width="100%" cellspacing="0" cellpadding="0" border="0">'+
				'<tr style="height:20px;">'+
				'<td width="40" align="center">'+
				'弹窗:'+
				'</td>'+
				'<td width="20"  align="left">'+
				'<img style="margin-top: -4px;" src="../images/min_2.gif" border=0 id=\'s_min_2\' onclick=\'select_scroller_f()\'>'+
				'</td>'+
				'<td width="40" align="center">'+
				'入球:'+
				'</td>'+
				'<td align="left">'+
				'<img style="margin-top: -4px;" src="../images/min_3.gif" border=0 id=\'s_min_3\' onclick=\'select_scroller()\'>'+
				'</td>'+
				'</tr>'+
				'</table>'+
			'</td>' +
			'<td align="center" style="padding-bottom:1px; border-right:1px solid #9c9c9c; width:49px;">'+
				'<table border="0" cellspacing="0" cellpadding="0" width="49">'+
				'<tr width="49">'+
				'<td align="center" width="35">'+
				''+Me[0]+''+
				'</td>'+
				'<td align="right" >'+
				'<a onClick="utilityOBJ.ClickLeagueDIV(this)" href="javascript:void(0);"><img src="../images/match_btn.gif" border=0></a>'+
				'</td>'+
				'</tr>'+
				'</table>'+
			'</td>'+
			'<td align="center" style="padding-bottom:1px; width:150px;">'+
				'<table width="100%" cellspacing="0" cellpadding="0" height="20" >'+
				'<tr>'+
				'<td colspan="3">'+
				'<select name="SetBgcolors" style="font-family:Verdana;font-size:12px;color:#000;" size="1" onchange="selectAColor(document.getElementsByName(\'SetBgcolors\')[0].options[document.getElementsByName(\'SetBgcolors\')[0].selectedIndex].value);">'+
				'	<option value="0">风格选择</option>'+
				'	<option value="0" style="background-color:#8CACDD;color:#8CACDD"></option>'+
				'	<option value="1" style="background-color:#245DDB;color:#8CACDD"></option>'+
				'	<option value="2" style="background-color:#FB8F8E;color:#FB8F8E"></option>'+
				'	<option value="3" style="background-color:#DD0000;color:#72EB61"></option>'+
				'	<option value="4" style="background-color:#9AD861;color:#72EB61"></option>'+
				'	<option value="5" style="background-color:#72EB61;color:#72EB61"></option>'+
				'	<option value="6" style="background-color:#F3B352;color:#F3B352"></option>'+
				'	<option value="7" style="background-color:#DD8800;color:#DD8800"></option>'+
				'	<option value="8" style="background-color:#FCFCFC;color:#FCFCFC"></option>'+
				'	<option value="9" style="background-color:#CECECE;color:#CECECE"></option>'+
				'</select>'+
				'</td>'+
				'<td>'+
				'<select name="SetSounds" style="font-family:Verdana;font-size:12px;color:#000;" size="1" onchange="selectSounds(document.getElementsByName(\'SetSounds\')[0].options[document.getElementsByName(\'SetSounds\')[0].selectedIndex].value);document.getElementById(\'PlaySound\').innerHTML=sound_B;">'+
				'	<option value="0">声音选择</option>'+
				'	<option value="0">Sound1</option>'+
				'	<option value="1">Sound2</option>'+
				'	<option value="2">Sound3</option>'+
				'	<option value="3">Sound4</option>'+
				'	<option value="4">Sound5</option>'+
				'	<option value="5">Sound6</option>'+
				'</select>'+
				'</td>'+
				'</tr>'+
				'</table>'+
				'<table width="100%" border="0" cellspacing="0" cellpadding="0" style="height:21px;">'+
				'<tr>'+
				'<td style="border-right:1px solid #9c9c9c;" width="50" align="center">'+
				'<a id="aFull"  onclick="setCookie(\'ShowMatch_Type\',\'\',1000*60*60*24*30);location.href=\'now.htm?LANG='+LANG+'\'" href="#">'+Me[2]+'</a>'+
				'</td>'+
				'<td style="border-right:1px solid #9c9c9c;"  width="50" align="center">'+
				'<a id="aPick" onclick="setCookie(\'ShowMatch_Type\',\'1\',1000*60*60*24*30);location.href=\'now.htm?LANG='+LANG+'&TYPE=1\'" href="#">'+Me[1]+'</a>'+
				'</td>'+
				'<td width="50" align="center">'+
				'<a id="aSlot" onclick="location.href=\'nowBet.htm\'" href="#">'+Me[6]+'</a>'+
				'</td>'+
				'</tr>'+
				'</table>'+
			'</td>'+
/*			
			'<td>'+
			'</td>'+*/
		'</tr>'+
		'</table>';
	return Tp;
}

function DiyMinMenuHTML_1(){
	var Me=["完場比分","下日賽程","熱門聯賽","熱門盃賽"];
	if(LANG==1){Me=["完场比分","下日赛程","热门比赛","热门杯赛"];}
	if(LANG==2){Me=["Fixture","Results","hotmatch","hotcup"];}
	var Tp='<div style="margin-left:10px; margin-top:3px;_margin-left:5px; float:left;">'+
			'<a class="inti" style="margin-right:2px" onclick="window.open(\'/last.html\');" href="javascript:void(0);">'+Me[0]+'</a>'+
			'<a class="inti" style="margin-right:2px" onclick="window.open(\'/fixture.htm\');" href="javascript:void(0);">'+Me[1]+'</a>'+
			'<a class="inti" style="margin-right:2px" onclick="window.open(\'/fixture.htm\');" href="javascript:void(0);">'+Me[2]+'</a>'+
			'<a class="inti" style="margin-right:2px" onclick="window.open(\'/last.html\');" href="javascript:void(0);">'+Me[3]+'</a>'+
			'</div>';
	return Tp;
	}
function DiyMinMenuHTML_2(){
			Tp='<div style="float:right; margin-top:3px; margin-right:7px; width:72px;">'+
			'<a id="laId2" class="intl" onClick="javascript:ChangePageLang(2)" href="#">En</a>'+
			'<a id="laId1" class="intl" onClick="javascript:ChangePageLang(1)" href="#">简</a>'+
			'<a id="laId0" class="intl" onClick="javascript:ChangePageLang(0)" href="#">繁</a>'+
			'</div>';
	return Tp;
}

function MenuTowLine()
{
	var Me=new Array();
	//if(LANG==0)
	//{
		//Me[0]='<li><a target="_blank" href="http://www.zqzz.com/">體育資訊</a></li>';
		//Me[1]='<li class="nav_action"><a target="_blank" href="/live.htm">足球比分</a></li>';
		//Me[2]='<li><a target="_blank" href="/basket/live">籃球比分</a></li>';
		//Me[3]='<li><a target="_blank" href="/tennis/index.htm">網球比分</a></li>';
		//Me[3]='<li><a target="_blank" href="/database.htm">資料庫</a></li>';
		//Me[4]='<li><a target="_blank" href="http://cp.zqzz.com/">彩票大廳</a></li>';
		//Me[5]='<li><a target="_blank" href="http://live.zqzz.com/fodds/">足球指數</a></li>';
		//Me[6]='<li><a target="_blank" href="http://live.zqzz.com/bodds/">籃球指數</a></li>';
		//Me[7]='<a target="_blank" href="/odds/om/">指數參考</a>';
		//Me[5]='<li><a target="_blank" href="http://buy.betzc.com/cooperate/zqzz/index.htm">彩票合買</a></li>';
		//Me[6]='<a style="color:#ffff00" target="_blank" href="http://xs.zqzz.com">*心水吧*</a>';
	//}
	//if(LANG==1)
	//{
		Me[0]='<li><a target="_blank" href="http://www.zqzz.com/">首页</a></li>';
		Me[1]='<li><a target="_blank" href="/live.htm">足球比分</a></li>';
		Me[2]='<li><a target="_blank" href="/nba/index.htm">篮球比分</a></li>';
		Me[3]='<li><a target="_blank" href="/database.htm">资料库</a></li>';
		Me[4]='<li><a target="_blank" href="http://cp.zqzz.com/">彩票大厅</a></li>';
		Me[5]='<li><a target="_blank" href="http://live.zqzz.com/fodds/">足球指数</a></li>';
		Me[6]='<li><a target="_blank" href="http://live.zqzz.com/bodds/">篮球指数</a></li>';
		//Me[5]='<a target="_blank" href="/sms.htm">短信频道</a>';
		//Me[6]='<a target="_blank" href="http://www.ballvod.com/">宽频直播</a>';
		//Me[7]='<a target="_blank" href="/odds/om/">指数参考</a>';
//		Me[5]='<li><a target="_blank" href="http://buy.betzc.com/cooperate/zqzz/index.htm">彩票合买</a></li>';
		//Me[6]='<a style="color:red" target="_blank" href="http://xs.zqzz.com">*心水吧*</a>';
	//}
	//if(LANG==2)
	//	Me[0]='<li class="nav_action"><a target="_blank" href="/database.htm">Data</a></li>';
	//	Me[1]='<li><a target="_blank" href="/live.htm?LANG=2">LiveScore</a></li>';
	//	Me[2]='<li><a target="_blank" href="/last_en.html">LastScore</a></li>';
	//	Me[3]='<li><a target="_blank" href="/data/fixture_en.htm">Fixture</a></li>';
	//	Me[4]='<li><a target="_blank" href="http://cp.zqzz.com/">Lottery hall</a></li>';
		//Me[4]='<a target="_blank" href="http://www.ballvod.com/">VOD</a>';
	//}
	
	var Tp="";
	for(var i=0;i<Me.length;i++){Tp += Me[i];}
	return Tp;
}

function ChangePageLang(n)
{
	var OldDay="";
	var nUrl="";
	var mUrl=location.href;
	if(mUrl.indexOf("LANG=") != -1)
	{
		OldDay=mUrl.substring(mUrl.indexOf("LANG="),mUrl.indexOf("LANG=")+6);nUrl=mUrl.replace(OldDay,"LANG="+n);
	}else if(mUrl.indexOf("?") != -1){
		nUrl=mUrl+"&LANG="+n;
	}else{
		nUrl=mUrl+"?LANG="+n;
	}
	location.href=nUrl;
}
