﻿self.onError=null;

function stoperror(){return true;};
window.onerror=stoperror;

function AddFavorites(){window.external.addFavorite(location.href,'即时比分[知足网] livescore[zQzz.com]');}
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 diffTime=0;
var LANG=0; 
var ShowMatch_Type="";
var sound_B="";
var SssAry=["<font color=#6699FF>未</font>","上","下","<font color=olivedrab>中</font>","<font color=#EE0000>完</font>","<font color=red>×</font>","<font color=copper>加</font>","<font color=dimgray>停</font>","<font color=gray>待</font>","<font color=green>1TH</font>","<font color=green>2TH</font>","<font color=green>3TH</font>","<font color=green>4TH</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=["","1T","2T","<font color=olivedrab>HF</font>","<font color=#EE0000>FT</font>","<font color=red>X</font>","<font color=copper>OT</font>","<font color=dimgray>IN</font>","<font color=gray>WT</font>","<font color=green>1TH</font>","<font color=green>2TH</font>","<font color=green>3TH</font>","<font color=green>4TH</font>"];}
if(LANG==0){setCookie("LANG","0",1000*60*60*24*30);}
var ginfoWIN=null;

function select_scroller(){
	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(){
	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(){
	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)
{
	n=document.getElementById("Tableone");
	if(m!="1")
	{
		n.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{
		n.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){if(ginfoWIN!=null){ginfoWIN.close();}ginfoWIN=window.open("../goalinfo.htm?bg="+document.getElementById('ss_'+addr).parentNode.style.backgroundColor+"&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="#8CACDD"; 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="<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='../swf/G"+SoundArray[changeSound]+".swf'><param name='quality' value='High'><param name='wmode' value='transparent'><param name='loop' value='false'><param name='menu' value='false'><embed src='../swf/G"+SoundArray[changeSound]+".swf' width=1 height=1 wmode='transparent' quality='High' loop='false' menu='false'></embed></object>"; 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=["選賽事","精簡版","完全版","隱藏:","賽　程","完　場"];
	if(LANG==1){Me=["选赛事","精简版","完全版","隐藏:","赛　程","完　场"];}
	if(LANG==2){Me=["Match","Pick","Full","Hidden:","Fixture","Results"];}
	var Tp='<table border="0" id="DiyOptionDIV" cellspacing="1" cellpadding="0">'+
		'<tr>'+
			'<td style="padding:2px 1px 0px 0px;">'+
			'<a class="intm" onClick="utilityOBJ.ClickLeagueDIV(this)" href="javascript:void(0);">'+Me[0]+'</a>'+
			'<a id="aPick" class="intm" onclick="setCookie(\'ShowMatch_Type\',\'1\',1000*60*60*24*30);location.href=\'nowfree.htm?LANG='+LANG+'&TYPE=1\'" href="#">'+Me[1]+'</a>'+
			'<a id="aFull" class="intm" onclick="setCookie(\'ShowMatch_Type\',\'\',1000*60*60*24*30);location.href=\'nowfree.htm?LANG='+LANG+'\'" href="#">'+Me[2]+'</a>'+
			'<a class="intm" onclick="window.open(\'/fixture.htm\');" href="javascript:void(0);">'+Me[4]+'</a>'+
			'<a class="intm" onclick="window.open(\'/last.html\');" href="javascript:void(0);">'+Me[5]+'</a>'+
			'</td>'+
			'<td>'+
			'<select name="SetBgcolors" style="font-family:Verdana;font-size:10px;width:68px;color:#017ea7;" size="1" onchange="selectAColor(document.getElementsByName(\'SetBgcolors\')[0].options[document.getElementsByName(\'SetBgcolors\')[0].selectedIndex].value);">'+
			'	<option value="0">BgColor</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>'+
			'<select name="SetSounds" style="font-family:Verdana;font-size:10px;width:68px;color:#017ea7;" size="1" onchange="selectSounds(document.getElementsByName(\'SetSounds\')[0].options[document.getElementsByName(\'SetSounds\')[0].selectedIndex].value);document.getElementById(\'PlaySound\').innerHTML=sound_B;">'+
			'	<option value="0">Sounds</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>'+
			'<td style="padding-bottom:5px">'+
			'<input type=image src="../images/min_1.gif" border=0 id=\'s_min_1\' onclick=\'select_scroller_s()\'>'+
			'<input type=image src="../images/min_2.gif" border=0 id=\'s_min_2\' onclick=\'select_scroller_f()\'>'+
			'<input type=image src="../images/min_3.gif" border=0 id=\'s_min_3\' onclick=\'select_scroller()\'>'+
			'<input type=image src="../images/min_4.gif" border=0 id=\'s_min_4\' onclick=\'select_fontSize(1)\'>'+
			'<input type=image src="../images/min_5.gif" border=0 id=\'s_min_5\' onclick=\'select_fontSize(0)\'>'+
			'</td><td style="padding:3px 3px 0px 6px;">'+
			'<a href="javascript:void(0)" onclick="utilityOBJ.select_ssall()" target="_self" style="color:black">'+Me[3]+'[<b><span id="MatchHideNum" style="color:red">0</span></b>]'+
			'</td>'+
			'<td style="padding-top:2px;width:90px;text-align:right;"><div style="width:100%;clear:both">'+
			'<a class="intl" onClick="location.href=\'nowfree.htm?LANG=2\'" href="#">EN</a>'+
			'<a class="intl" onClick="location.href=\'nowfree.htm?LANG=1\'" href="#">简</a>'+
			'<a class="intl" onClick="location.href=\'nowfree.htm\'" href="#">繁</a>'+
			'</div></td>'+
		'</tr>'+
		'</table>';
	return Tp;
}

function MenuTowLine()
{
	var Me=new Array();
	if(LANG==0)
	{
		Me[0]='<a target="_blank" href="http://sport.zqzz.com/">體育資訊</a>';
		Me[1]='<a target="_blank" href="/live.htm">足球比分</a>';
		Me[2]='<a target="_blank" href="/basket/live">籃球比分</a>';
		Me[3]='<a target="_blank" href="/tennis/index.htm">網球比分</a>';
		Me[4]='<a target="_blank" href="/database.htm">資料寶庫</a>';
		//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]='<a target="_blank" href="http://buy.betzc.com/cooperate/zqzz/index.htm">彩票合買</a>';
		//Me[6]='<a style="color:#ffff00" target="_blank" href="http://xs.zqzz.com">*心水吧*</a>';
	}
	if(LANG==1)
	{
		Me[0]='<a target="_blank" href="http://sport.zqzz.com/">体育资讯</a>';
		Me[1]='<a target="_blank" href="/live.htm">足球比分</a>';
		Me[2]='<a target="_blank" href="/nba/index.htm">篮球比分</a>';
		Me[3]='<a target="_blank" href="/tennis/index.htm">网球比分</a>';
		Me[4]='<a target="_blank" href="/database.htm">资料宝库</a>';
		//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]='<a target="_blank" href="http://buy.betzc.com/cooperate/zqzz/index.htm">彩票合买</a>';
		//Me[6]='<a style="color:red" target="_blank" href="http://xs.zqzz.com">*心水吧*</a>';
	}
	if(LANG==2)
	{
		Me[0]='<a target="_blank" href="/database.htm">Data</a>';
		Me[1]='<a target="_blank" href="/live.htm?LANG=2">LiveScore</a>';
		Me[2]='<a target="_blank" href="/last_en.html">LastScore</a>';
		Me[3]='<a target="_blank" href="/data/fixture_en.htm">Fixture</a>';
		//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;
}