var sound0 = '';
var sound1 = '<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="10" height="10"><param name="movie" value="bf_img/sound1.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound2 = '<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="10" height="10"><param name="movie" value="bf_img/sound2.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound3 = '<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="10" height="10"><param name="movie" value="bf_img/sound3.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound4 = '<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="10" height="10"><param name="movie" value="bf_img/sound4.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound5 = '<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="10" height="10"><param name="movie" value="bf_img/sound5.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound6 = '<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="10" height="10"><param name="movie" value="bf_img/sound6.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound7 = '<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="10" height="10"><param name="movie" value="bf_img/sound7.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var sound8 = '<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="10" height="10"><param name="movie" value="bf_img/sound8.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>';
var cSound = getSound();

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//显示进球窗口
var startani_C,startani_A,startani_B,pop_TC

function ShowCHWindow(sclass,team1,team2,score1,score2,entertime,index)
{
if(document.all["windowCheck"].checked)
{
if (sclass!=null && team1!=null && team2!=null && score1!=null && score2!=null && entertime!=null){
var asclass=sclass.split("^");
var ateam1=team1.split("^");
var ateam2=team2.split("^");
var ascore1=score1.split("^");
var ascore2=score2.split("^");
var aentertime=entertime.split("^");
var showhtml = "";
for (var i=0;i<asclass.length-1;i++){
  showhtml+="<tr><td align=center style='font-family:Verdana;'><table width='100%' bgcolor=#F5F5F5 border=0 cellpadding=0 style='font-size:9pt;border-collapse:collapse'><tr height=30>";
  showhtml+="<td width='8%' align=center style='padding-bottom:2px;'>"+aentertime[i]+"<img src='bf_img/in.gif'></td><td width='19%' align=right style='padding-top:2px;'><b>"+asclass[i]+"</b></td><td width='30%' align=right><b>"+ateam1[i]+"</b>&nbsp;</td><td width='13%' align=center><b>"+ascore1[i]+" - "+ascore2[i]+"</b></td><td width='30%' align=left>&nbsp;<b>"+ateam2[i]+"</b></td>";
  showhtml+="</tr></table></td></tr>";
}
poptext="<table bgcolor=#EEEEEE bordercolor=#660000 border=1 style='font-size:9pt;' width='100%'>"
+showhtml
+"<tr height=18>"
+"<td align=center style='background-color:#AA0000;color:#FFFFFF;padding-top:2px;padding-bottom:0px;'><b>透透网 - 即时比分</b></td>"
+"</tr>"
+"</table>";

imagewidth=328;
if (asclass.length==2){
  imageheight=60;
}else{
  imageheight=(30+asclass.length)*(asclass.length-1)+30;
}
oPopup = window.createPopup();
oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = poptext;
x=(screen.width-imagewidth)/2;
y=0;
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=100;
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 changeSound(no)
{
	var sound;
	switch(Number(no)){
		case 0:
		  sound = sound0;
		  break;
		case 1:
		  sound = sound1;
		  break;
		case 2:
		  sound = sound2;
		  break;
		case 3:
		  sound = sound3;
		  break;
		case 4:
		  sound = sound4;
		  break;
		case 5:
		  sound = sound5;
		  break;
		case 6:
		  sound = sound6;
		  break;
		case 7:
		  sound = sound7;
		  break;
		case 8:
		  sound = sound8;
		  break;
		default:
		  sound = sound1;
	}
	cSound = sound;
	playSound()
	setCookie("bfSound",cSound,"0");	
}

function playSound(){
	if (cSound==null){
		 cSound = sound1;
	}
	if(document.all["soundCheck"].checked){
		document.getElementById("goalplay").innerHTML=cSound;
	}	
}

function getSound(){
	return getCookie("bfSound");
}

function setBgColor(the,i)
{
	if (i % 2 == 0)
	{
		the.style.backgroundColor="#FFB3FF";
	}else
	{
		the.style.backgroundColor="#BBFFBB";
	}
	
}

function clearBgColor(the)
{
	the.style.backgroundColor="";
}

function selBgColor(){
  window.open("colorpicker.html","","height=240,width=232,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,top="+(screen.availHeight-300)/2+",left="+(screen.availWidth-230)/2+"");
}

function ChgLang(){
  var langs = langform.langSelect;
  var str = "0";
  for(var i=0;i<langs.length;i++){
    if (langs[i].checked){
      str = langs[i].value;
      break;
    }
  }
  location.replace("?"+str);
}

function ChgOdds(){
  var oddss = oddsform.oddsSelect;
  var str = "0";
  for(var i=0;i<oddss.length;i++){
    if (oddss[i].checked){
      str = oddss[i].value;
      break;
    }
  }
  var lValue = "1";
  var ustr = location.href;
  if (ustr.indexOf("?0") > 0){
    lValue = "0";
  }else{
     if (ustr.indexOf("?2") > 0){
       lValue = "2";
     }
  }
  switch (str) {
    case "0" :
       location.replace("index.html?"+lValue);
       break;
    case "1" :
       location.replace("index1.html?"+lValue);
       break;
    case "2" :
       location.replace("index2.html?"+lValue);
       break;
    case "3" :
       location.replace("index3.html?"+lValue);
       break;
    case "5" :
       location.replace("index5.html?"+lValue);
       break;
    default :
       location.replace("index.html?"+lValue);
  } 
  //location.replace("index"+str+".html?"+lValue);
}

function EuropeOdds(path){
   var theURL="http://web.totou.com/odds/1x2/"+path+".html";
   window.open(theURL,null,"height="+screen.availHeight+",width="+screen.availWidth+",scrollbars=yes,resizable=yes");
}

function InfoWin(path){
   var theURL="http://web.totou.com/info/"+path+".htm";
   window.open(theURL,null,"height="+screen.availHeight+",width="+screen.availWidth+",scrollbars=yes,resizable=yes");
}

function HistoryWin(path){
   var theURL;
   if (path!=""){
       theURL="http://web.totou.com/info/history/"+path+".htm";
   }else{
       theURL="http://web.totou.com/null.html";
   }
   window.open(theURL,null,"height="+screen.availHeight+",width="+screen.availWidth+",scrollbars=yes,resizable=yes");
}
