﻿//赛程赛果
function setSchenduleStyle(file){
	var t=document.getElementById('divScsg');
	if(!t){return;}
	t=t.getElementsByTagName('table');
	if(t.length<1){return;}
	var rows=t[0].rows,cells,td;
	var name=file.split('_')[1];
	if(!name){
		if(!(t[1] && t[1].rows[2] && t[1].rows[2].cells[0])){return;}
		td=t[1].rows[2].cells[0];
		name=td.innerText||td.textContent;
	}
	if(name==undefined){return;}
	for(var i=0,l=rows.length;i!=l;i++){
		cells=rows[i].cells;
		for(var j=0,l2=cells.length;j!=l2;j++){
			td=cells[j];
			if((td.innerText||td.textContent)==name){
				td.className='lsmsel';
				td.setAttribute("style","background-color:#025aac;");
				return;
			}
		}
	}
}


function ChangeSchedule(file){
	
	var script=document.getElementById("scriptScsg");
	var  s=document.createElement("script");   
	s.type="text/javascript";   
	s.src="http://data.8bo.com/ls/FileJs/scsg/"+ file +".js";
	script.removeChild(script.firstChild);
	script.appendChild(s,"script");	  
	setTimeout("set_width()",1000);
	setTimeout("setSchenduleStyle('"+file+"')",100);
	
}
//积分
function ChangeScore(file){
	
	var script=document.getElementById("scriptScore");
	var  s=document.createElement("script");   
	s.type="text/javascript";   
	s.src="http://data.8bo.com/ls/FileJs/score/"+ file +".js";
	script.removeChild(script.firstChild);
	script.appendChild(s,"script");	  
	setTimeout("set_width()",1000);
}
//var hdl_width=null;
	function set_width()
	{
		//clearTimeout(hdl_width);
		try
		{
			//parent.document.all("data_8bo").style.height=document.body.scrollHeight; 
			parent.$("data_8bo").style.height=document.body.scrollHeight; 
		}
		catch(e){}
		//hdl_width = setTimeout("set_width();",3000);
	}
	
function ChangeJS(sclassID,kind){
	
    if(kind==1){
        ChangeSchedule(sclassID);
        ChangeScore(sclassID);
    }
    else{
        ChangeSchedule(sclassID);
        document.getElementById("divScore").innerHTML="";
    }
	//set_width_2();
	//setTimeout("set_width()",1000);
	//set_width();
}
function showLeagueList(type){
    if(type==1){
	    document.getElementById("leagueList").style.display="";
	    document.getElementById("hotLeague").style.display="none";
	    document.getElementById("hotCup").style.display="none";
        document.getElementById("LeagueKind1").className="sel";
        document.getElementById("LeagueKind2").className="";
        document.getElementById("LeagueKind3").className="";
		ChangeJS(Blsdata[0],Blsdata[1]);
    }
    if(type==2){
	    document.getElementById("leagueList").style.display="none";
	    document.getElementById("hotLeague").style.display="";
	    document.getElementById("hotCup").style.display="none";
        document.getElementById("LeagueKind1").className="";
        document.getElementById("LeagueKind2").className="sel";
        document.getElementById("LeagueKind3").className="";
       ChangeJS(535 ,1);
    }
    if(type==3){
	    document.getElementById("leagueList").style.display="none";
	    document.getElementById("hotLeague").style.display="none";
	    document.getElementById("hotCup").style.display="";
        document.getElementById("LeagueKind1").className="";
        document.getElementById("LeagueKind2").className="";
        document.getElementById("LeagueKind3").className="sel";
        ChangeJS(830 ,2);
    }
}
var i=0;
function todMatch()
{
	var script=document.getElementById("leagueList");
	var  s=document.createElement("script");   
	s.type="text/javascript";   
	s.src="http://data.8bo.com/ls/data/todayData.js";
	script.removeChild(script.firstChild);
	script.appendChild(s,"script");	

	window.setTimeout("todMatch()",2000);
}
 function ScoreDetail(ids)
{
		  
}
/*
function updateTableBorder(){
	var ts=document.getElementsByTagName('table');
	for(var i=0,l=ts.length;i!=l;i++){
		ts[i].setAttribute("border","0");
		ts[i].setAttribute("cellspacing","1");
	}
}
document.onclick=function(){setTimeout(function(){updateTableBorder();},100);};
*/