//显示或隐藏赛事列表
function ShowLayer(sName){
	//var addHeight =document.getElementById("ToolsTopAd").style.height;
	if (document.getElementById(sName).style.display =="none"){
		document.getElementById(sName).style.display ="";
	}else{
		document.getElementById(sName).style.display ="none";
	}
}
//

//显示进球窗口
var startani_C,startani_A,startani_B,pop_TC

function ShowCHWindow(sclass,team1,team2,score1,score2,entertime,index)
{
imagewidth=272;
imageheight=67;
var sText

sText="<table width=270 border=0 cellpadding=1 cellspacing=0 bgcolor=#29818F><tr><td><table width=270 border=0 cellpadding=0 cellspacing=0><tr><td height=22 colspan=3 align=right><div  style='color:white'><b>入球提示</b></div></td><td height=22 align=right><img src='images/off.gif' width='12' height='12'>&nbsp;&nbsp;</td></tr>"
sText +="<tr bgcolor=#FFFFFF class=tr_color2 height=22 align=center><td width=19%><font color=blue>" + sclass +"</font></td>"

if (index==1)
{ 
	sText += "<td width=38% style='color:red;'><b>" + team1 +"</b></td>" 
	sText += "<td width=5%  style='color:blue;'>-</td>" 
	sText += "<td width=38%><b>" + team2 +"</b></td>" 
	sText += "</tr><tr bgcolor=#FFFFFF align=center>"
    sText += "<td>" + entertime + "'</td>"
    sText += "<td style='color:red;font-size:18px;font-family:Arial, '><b>" + score1 + "</b></td>"
    sText += "<td></td><td style='font-size:18px;font-family:Arial'><b>" + score2 + "</b></td>"
}
else
{
	sText += "<td width=38%><b>" + team1 +"</b></td>" 
	sText += "<td width=5%  style='color:blue;'>-</td>" 
	sText += "<td width=38% style='color:red;'><b>" + team2 +"</b></td>" 
	sText += "</tr><tr bgcolor=#FFFFFF align=center>"
    sText += "<td>" + entertime + "'</td>"
    sText += "<td style='font-size:18px;font-family:Arial, '><b>" + score1 + "</b></td>"
    sText += "<td></td><td style='color:red;font-size:18px;font-family:Arial'><b>" + score2 + "</b></td>"
}

sText=sText + "</tr></table></td></tr></table>" 

sText=sText + "<style type='text/css'>"
sText=sText + "td {font-family: 'Tahoma', '宋体';font-size: 12px;}"
sText=sText + "</style>"

oPopup = window.createPopup();
oPopupBody = oPopup.document.body;
oPopupBody.bgColor="white";

oPopupBody.innerHTML = sText
x=300;
y=1;
oPopupBody.style.cursor="hand";
oPopup.document.body.onmouseover=new Function("clearTimeout(startani_A)");
oPopup.document.body.onmouseout=pop;    
oPopup.document.body.onclick=dismisspopup;
oPopup.document.body.oncontextmenu=dismisspopup;
pop_TC=150;
pop();
}

function pop(){
	oPopup.show(x,y,imagewidth, imageheight);
	startani_A=setTimeout("pop()",100);  //显示15秒
	if(pop_TC<0){dismisspopup();};
	pop_TC=pop_TC-1;
}
function dismisspopup()
{	clearTimeout(startani_A);
	oPopup.hide();
}

function getCookie(name)
{
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0) 
	{
		begin = dc.indexOf(cname);
		if (begin != -1) 
		{
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return dc.substring(begin, end);
		}
	}
	return null;
}
function writeCookie(name, value) 
{ 
	var expire = ""; 
	var hours = 365;
	expire = new Date((new Date()).getTime() + hours * 3600000); 
	expire = ";path=/;expires=" + expire.toGMTString(); 
	document.cookie = name + "=" + escape(value) + expire; 
}