//联赛
function getrighthtml(lid,type,sid,perid) //加载网页右侧html
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @perid 国家编号
	**/
	if(type==1){
		var url="index.php?controller=operation&action=index";
	}else if( type==99 ){
		var url="index.php?controller=operation&action=scores";

		for(var i=0;i<8;i++){
			if(i.toString()==0){
				$('menu'+i).className="hover";
			}else{
				$('menu'+i).className="";
			}
		}
	}else{
	  var url="index.php?controller=operation&action=index2";
	}
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&cid='+perid;

	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnrighthtml
	});
}
function Returnrighthtml(response){ 
	var stringText=response.responseText;//返回串
	if(stringText=="")return;
	arr=stringText.split('$');
	$('centent').innerHTML=arr[0];
	loadpicswf(arr[1]);

}
/**
    加载饼型图
**/
function loadpicswf(str){
	//var jslid=$('swflid').value;
	//var jssid=$('swfsid').value;
	//var str=jslid+'^'+jssid;
	swfobject.embedSWF(
  "open-flash-chart.swf", "pie001",
  "200", "200", "9.0.0", "expressInstall.swf",
  {"data-file":"ofc/data2.php?s="+str} );
  swfobject.embedSWF(
  "open-flash-chart.swf", "pie002",
  "200", "200", "9.0.0", "expressInstall.swf",
  {"data-file":"ofc/data.php?s="+str} );
  
  swfobject.embedSWF(
  "open-flash-chart.swf", "pie003",
  "350", "150", "9.0.0", "expressInstall.swf",
  {"data-file":"ofc/bardata.php?s="+str} );
}

//联赛内层页签加载
function getinnerhtml(site,lid,sid,type){
	/**
	   @site 页签标记
	   @lid 联赛ID
	   @sid 赛季ID
	   @type 联赛类型
	**/

	//if(site=='') var site=1;
	switch(site){
		case 0:
		     var action='scores';
		     break;
		case 1:
		     var action='index';  
		     break;
	    case 2:
		     var action='gongfang';  
		     break;   
		case 3:
		     var action='banquan';  
		     break; 
		case 4:
		     var action='totalgoals';  
		     break; 
		case 5:
		     var action='danshuang';
		     break;
		case 6:
		     var action='firstscore';
		     break;
		case 7:
		     var action='rank';
		     break;
		case 8:
		     var action='matchresult';
		     break;
		case 9:
		     var action='teams';
		     break; 
		default:
			var action='index';                         
			case 5:

	}
	var url="index.php?controller=operation&inner=1&action="+action;
	var update='';
	var pars='site='+site+'&lid='+lid+'&t='+type+'&sid='+sid;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returninnerhtml
	});
	for(var i=0;i<=9;i++){
		if(i.toString()==site){
			$('menu'+i).className="hover";
		}else{
			$('menu'+i).className="";
		}
	}
}
function Returninnerhtml(response){
	var stringText=response.responseText;//返回串
	if(stringText=='') return;
	$('content1').innerHTML=stringText;
}
//子内层大小加载
function getdaxiaohtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=daxiao";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returndaxiaohtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('dx'+i).className="hover";
		}else{
			$('dx'+i).className="";
		}
	}
}
function Returndaxiaohtml(response){ 
	var stringText=response.responseText;//返回串
	if(stringText=='')return;
	$('daxiao').innerHTML=stringText;
}

//子内层单双加载
function getdanshhtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=dansh";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returndanshhtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('ds'+i).className="hover";
		}else{
			$('ds'+i).className="";
		}
	}
}
function Returndanshhtml(response){ 
	var stringText=response.responseText;//返回串
	if(stringText=='')return;
	$('dansh').innerHTML=stringText;
}


//子内层总进球加载
function getgoalshtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=goals";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returngoalshtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('goals'+i).className="hover";
		}else{
			$('goals'+i).className="";
		}
	}
}

function getpanluhtml(index){
	for(var i=0;i<3;i++){
		if(i.toString()==index){
			$('palu'+i).style.display="";
			$('pa'+i).className="hover";
		}else{
			$('palu'+i).style.display="none";
			$('pa'+i).className="";
		}
	}
}

function Returngoalshtml(response){ 
	var stringText=response.responseText;//返回串
	if(stringText=='')return;
	$('totalgoals').innerHTML=stringText;
}


//子内层半全加载
function getbanqhtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=inbanquan";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnbanqhtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('bq'+i).className="hover";
		}else{
			$('bq'+i).className="";
		}
	}
}
function Returnbanqhtml(response){ 
	var stringText=response.responseText;//返回串
	//alert(stringText);
	if(stringText=='')return;
	$('banquan001').innerHTML=stringText;
}

//子内层攻击排行加载
function getgongjihtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=gongji";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returngongjihtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('gj'+i).className="hover";
		}else{
			$('gj'+i).className="";
		}
	}
}
function Returngongjihtml(response){ 
	var stringText=response.responseText;//返回串
	//alert(stringText);
	if(stringText=='')return;
	$('gongji').innerHTML=stringText;
}


//子内层防守排行加载
function getfangshouhtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=fangshou";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnfangshouhtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('fs'+i).className="hover";
		}else{
			$('fs'+i).className="";
		}
	}
}
function Returnfangshouhtml(response){ 
	var stringText=response.responseText;//返回串
	//alert(stringText);
	if(stringText=='')return;
	$('fangshou').innerHTML=stringText;
}


//积分榜子页签加载
function getpointshtml(lid,type,sid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/

	var url="index.php?controller=operation&action=points";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnpointshtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('ps'+i).className="hover";
		}else{
			$('ps'+i).className="";
		}
	}
}


//积分榜子页签加载 美联
//getpointshtml2(326,2,2008,2,0)
function getpointshtml2(lid,type,sid,tp,orderid) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/

	var url="index.php?controller=operation&action=points";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&tp='+tp+'&ctype=a&orderid='+orderid;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnpointshtml
	});
	for(var i=0;i<3;i++){
		if(i.toString()==tp){
			$('ps'+i).className="hover";
		}else{
			$('ps'+i).className="";
		}
	}
}

function Returnpointshtml(response){ 
	var stringText=response.responseText;//返回串
	//alert(stringText);
	if(stringText=='')return;
	$('points').innerHTML=stringText;
}

function Changerid(lid,sid,rid){
	var lis=$('luns').getElementsByTagName('li');
	var nodes = $A(lis);
	nodes.each(function(node){
		if(node.value==rid){
			node.className="hover";
		}else{
			node.className="";
		}
	});

	//加载数据
	getridmatchhtml(lid,1,sid,rid,'','');
}


function menu_m(orderid){
	var td=$('menus_m').getElementsByTagName('td');
	var nodes = $A(td);
	nodes.each(function(node){
		if(node.id=="m_"+orderid){
			node.bgColor="#ACDAFF";
		}else{
			node.bgColor="#D9EEFF";
		}
	});
}
function Changerid2(lid,sid,rid,orderid){
	var lis=$('luns').getElementsByTagName('li');
	var nodes = $A(lis);
	nodes.each(function(node){
		if(node.value==rid){
			node.className="hover";
		}else{
			node.className="";
		}
	});

	//加载数据
	getridmatchhtml2(lid,1,sid,rid,'','',orderid);
}

function getridmatchhtml2(lid,type,sid,rid,ext1,ext2,orderid) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=ridmatch";
	var update='';
	var pars='lid='+lid+'&orderid='+orderid+'&sid='+sid+'&rid='+rid+'&ext1='+ext1+'&ext2='+ext2+'&type=2&t='+type;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnridmatchhtml
	});
}

//指定轮比赛加载
function getridmatchhtml(lid,type,sid,rid,ext1,ext2) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	var url="index.php?controller=operation&action=ridmatch";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&rid='+rid+'&ext1='+ext1+'&ext2='+ext2;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnridmatchhtml
	});
}
function Returnridmatchhtml(response){ 
	var stringText=response.responseText;//返回串
	if(stringText=='')return;
	$('ridmatch').innerHTML=stringText;
}
//根据球队选择比赛
function Selectmatchs(lid,type,sid,teamid){
	if(teamid==0)return;
	getridmatchhtml(lid,type,sid,'all',teamid,'');
}
function Selecteamtomatch(lid,type,sid){
	var hteamid=$('hteamid').value;
	var gteamid=$('gteamid').value;
	if(hteamid==0||gteamid==0){
		alert('请选择主客队！');
		return;
	}
	getridmatchhtml(lid,type,sid,'all',hteamid,gteamid);
}
/**
   杯赛
**/
//Getbshtml(107,2,1360,3,0,'all')
function Getbshtml(lid,type,sid,xid,flag,zid){
	/**
	  @xid 序号
	  @flag 分组标记
	**/
	var url="index.php?controller=operation&action=getbs";
	var update='';
	var pars='lid='+lid+'&t='+type+'&sid='+sid+'&xid='+xid+'&flag='+flag+'&zid='+zid;
	var myAjax = new Ajax.Updater(
	update,
	url,
	{
		method: 'POST',
		parameters: pars,
		evalScripts : true,
		onComplete:Returnbshtml
	});
   
}
function Returnbshtml(response){
	var stringText=response.responseText;//返回串
	if(stringText=='')return;
	 $('content2').innerHTML=stringText;
}
function Wa_SetImgAutoSize(obj) 
{ 
//var img=document.all.img1;//获取图片 
var img=obj; 
var MaxWidth=95;//设置图片宽度界限 
var MaxHeight=95;//设置图片高度界限 
var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比 
var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高比 
if(img.readyState!="complete")return false;//确保图片完全加载 
if(img.offsetWidth>MaxWidth){ 
img.width=MaxWidth; 
img.height=MaxWidth*HeightWidth; 
} 
if(img.offsetHeight>MaxHeight){ 
img.height=MaxHeight; 
img.width=MaxHeight*WidthHeight; 
} 
} 

//
function getParentRow(obj) 
{ 
    do 
    {
        if(isFireFox()) 
        {
            obj = obj.parentNode; 
        }
        else {
        obj = obj.parentElement; 
        }
    }
    while(obj.tagName != "TR") 
   
   return obj;   
} 
function isFireFox() 
{
    return navigator.appName == "Netscape"; 
}
/****************球队信息******************/
//加载球队基本信息
function loadteaminfo(){
	if(team_logo!='')
	$('teamimg').src='../teamlogo/'+team_logo;
	if(team_enname!='')
	var teamname=team_cnname+'('+team_enname+')';
	else
    var teamname=team_cnname;
    $('teamname').innerHTML=teamname;
    
    $('biaoqian1').innerHTML='&nbsp;&nbsp;<strong>成立时间：</strong>'+(team_edate==''?'未知':team_edate);
    $('biaoqian2').innerHTML='&nbsp;&nbsp;<strong>国家地区：</strong>'+(team_country==''?'未知':team_country);
    $('biaoqian3').innerHTML='&nbsp;&nbsp;<strong>所在城市：</strong>'+(team_city==''?'未知':team_city);
    $('biaoqian4').innerHTML='&nbsp;&nbsp;<strong>球场：</strong>'+(team_stadium==''?'未知':team_stadium); 
    $('biaoqian5').innerHTML='<strong>球场容量：</strong>'+(team_capacity==''?'未知':team_capacity);
    $('biaoqian6').innerHTML='<strong>官方网址：</strong>'+(team_web==''?'未知':team_web);  
    $('biaoqian7').innerHTML='<strong>球队E-mail：</strong>'+((team_email==''||team_email=="'")?'未知':team_email); 
    $('biaoqian8').innerHTML='<strong>联系地址：</strong>'+(team_addr==''?'未知':team_addr); 
}
function echo(el)
{
	//if(el=='')
	//return document.write('-');
	//else
	if(el=='')
	el=0;
	return document.write(el);
}

//球队内页实现
function Teammenu(lid,sid,tid,tp) 
{
	/**
	   @lid 联赛ID
	   @type 联赛类型
	   @sid 赛季ID
	   @tp 操作代码
	**/
	for(var i=0;i<4;i++){
		if(i.toString()==tp){
			$('tm'+i).className="hover";
			$('content'+i).style.display='';
		}else{
			if( $('tm'+i) != null ){
				$('tm'+i).className="";
				$('content'+i).style.display='none';
			}
		}
	}
}
//首页js

function loadindexmenu(lnid){
	if(lnid!=''&&lnid<6&&lnid>=0)
	{
		var html='';
		var temln=ln[lnid];
		var len = temln.length;
		for(var i=0;i<len;i++){
			var zindex = len - i;
			var cid=temln[i]; //国家ID
			var cimg=country[cid][1];
			var cname=country[cid][0]; //国家名
			html+='<div class="logoPic">';
			html+='<ul>';
			html+='<li class="pic"><table><tr><td valgin="middle" height="100"><a href="javascript:void(0);" onclick="Indexmain('+cid+',0,1,'+cid+')"><img src="'+cimg+'" onload="Wa_SetImgAutoSize(this)"/></a></td></tr></table></li><li><div class="menu" style="z-index:'+zindex+';">';
			html+='<ul>';
			html+='<li><a href="#">'+cname+'<table class="table">';


    
    var temlid=js_lid[cid];
    var lidlen=temlid.length;
    var temj=0;
    for(var j=0;j<lidlen;j++){
    	if(temj==0)
    html+='<tr><td><ul style="border-bottom:1px solid #ddd;" >';
    var lid=temlid[j][0];
    var thisseason=seasons[lid];
	var len3=thisseason.length;
    if(len3==0)continue;
    html+='<li><a href="#" >'+temlid[j][1]+'&nbsp;&nbsp;<img src="images/sign.gif" align="absmiddle" />';
	html+='<table class="table"><tr><td id="child'+temlid[j][0]+'">';
	
    //赛季数据
    html+='<ul style="border-bottom:1px solid #ddd;">'
	for(var r=0;r<len3;r++){
	   html+='<li><a href="javascript:void(0);" onclick="Indexmain('+lid+','+thisseason[r][0]+','+temlid[j][2]+','+cid+')">'+thisseason[r][1]+'</a></li>';	
	}
	html+='</ul>';
    html+='</td></tr></table>';
	html+='</a></li>';
	if(temj==9){
	html+='</ul></td></tr>';
	temj=0;
	}

	temj++;
    }
	if(temj<9&&temj>0)
	html+='</ul></td></tr>';
	//html+=' </ul></td></tr>';
	html+='</table>';
	html+='</a></li>';
	html+='</ul>';
	html+='</div>';
	html+='</li></ul></div>';
		}
		$('menuinfo').innerHTML=html;
	}else{
		return;
	}
	
}

function Changearea(areaid){
	for(var i=1;i<6;i++){
		if(i==areaid)
		$('area'+i).className='hover';
		else
		$('area'+i).className='';
	}
	//loadindexmenu(areaid);
	ShowAreaUI('content1111',ln[areaid]);
}

//
function Indexmain(lid,sid,type,perid){
	if(lid==0||lid=='')return;
	if(perid==0||perid=='')return;
	if(lid=='worldcup'||sid==300000)
	var url='http://'+__odds+'/sdata/2010worldcup/index.php';
	else
	var url="index.php?controller=main&lid="+lid+"&sid="+sid+"&cid="+perid+'&t='+type;
	window.open(url);
}


function asynPlayersDetail(playerid,count,indexid,type){
	if(playerid==0||playerid==''||count==0||count==''||type==0||type=='')return;
	var url="/index.php?" + Date.parse(new Date());
	var pars='controller=teaminfo&action=pdetail&playerid='+playerid;
	var update='';
	var locationp = ['前锋','中场','后卫','守门员'];
	var type_reference = [[],['playid1','playid2'],['iplayid1','iplayid2'],['oplayid1','oplayid2']];
	var myAjax = new Ajax.Updater(
		update,
		url,
		{
			method: 'GET',
			parameters: pars,
			evalScripts : true,
			onComplete:function(response) {
				var data = response.responseText;
				if(data==false)return;
				json	=	eval("("+data+")");
				
			//0	  1		   2		3		4			5				6			7		8
			//`id`,`cnname`,`enname`,`logo`,`description`,`nationality`,`birthday`,`height`,`weight
			//	9		10		11		12		13			14
			//`,`number`,`point`,`added`,`bfteam`,`ofteams`,`teamname_cn`
				document.getElementById('fullplayername').innerHTML = json.info.cnname+"("+json.info.enname+")";
				document.getElementById('nationality').innerHTML = json.info.nationality;
				document.getElementById('birthday').innerHTML = json.info.birthday;
				document.getElementById('height').innerHTML = json.info.height;
				document.getElementById('weight').innerHTML = json.info.weight;
				document.getElementById('number').innerHTML = json.info.number;
				document.getElementById('point').innerHTML = locationp[parseInt(json.info.point)];
				document.getElementById('added').innerHTML = json.info.added;
				document.getElementById('bfteam').innerHTML = json.info.bfteam;
				document.getElementById('ofteams').innerHTML = json.info.ofteams;
				document.getElementById('teamname_cn').innerHTML = json.info.teamname_cn;
				if( json.info.logo != "err.gif" ){
					var directory = parseInt(json.info.id / 5000) + 1;
					document.getElementById('playerlogo').src = "playerlogo/"+directory+"/"+json.info.logo;
				}else{
					document.getElementById('playerlogo').src = "playerlogo/"+json.info.logo;
				}
				
				for(var jj=0;jj<count;jj++){
					if( jj == parseInt(indexid) ){
						document.getElementById(type_reference[parseInt(type)][0]+"_"+jj).bgColor = "#deefff";
						document.getElementById(type_reference[parseInt(type)][1]+"_"+jj).bgColor = "#deefff";
	
					}else{
						document.getElementById(type_reference[parseInt(type)][0]+"_"+jj).bgColor = "#FFFFFF";
						document.getElementById(type_reference[parseInt(type)][1]+"_"+jj).bgColor = "#FFFFFF";

					}
				}

				if( json.info.description != "" ){
					document.getElementById('description_u').style.display = '';
					document.getElementById('description').innerHTML = json.info.description;
				}else{
					document.getElementById('description_u').style.display = 'none';
					document.getElementById('description').innerHTML = '';
				}
				
				var score_html = "";
				var jq = 0;
				var dq = 0;
				var wl = 0;
				var yc = 0;
				var rc = 0;
				if( json.goal != ""){
					score_html += '<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#066CB6" class="cent">';
					score_html += '<tr class="fcfff"><td width="60" height="24" bgcolor="#2A94E0">赛事</td><td width="110" bgcolor="#2A94E0">时间</td><td width="100" bgcolor="#2A94E0">主队</td><td width="35" bgcolor="#2A94E0">比分</td><td width="100" bgcolor="#2A94E0">客队</td><td width="35" bgcolor="#2A94E0">进球</td><td width="35" bgcolor="#2A94E0">点球</td><td width="35" bgcolor="#2A94E0">乌龙</td><td width="35" bgcolor="#2A94E0">黄牌</td><td width="35" bgcolor="#2A94E0">红牌</td></tr>';
					for(var i=0; i<json.goal.length;i++){
						var color1 = "";
						var color2 = "";
						jq += parseInt(json.goal[i][7]);
						dq += parseInt(json.goal[i][9]);
						wl += parseInt(json.goal[i][10]);
						yc += parseInt(json.goal[i][8]);
						rc += parseInt(json.goal[i][11]);
						if( parseInt(json.goal[i][4]) > parseInt(json.goal[i][5]) ){
							color1 = 'style="color:#FF0000"';
						}else if( parseInt(json.goal[i][4]) < parseInt(json.goal[i][5]) ){
							color2 = 'style="color:#FF0000"';
						}

						score_html += '<tr>';
						score_html += '<td bgcolor="#'+json.goal[i][1]+'" height="20" class="fcfff">'+json.goal[i][0]+'</td>';
						score_html += '<td bgcolor="#ffffff">'+json.goal[i][6]+'</td>';
						score_html += '<td bgcolor="#ffffff" class="fc00f" '+color1+'>'+json.goal[i][2]+'</td>';
						score_html += '<td bgcolor="#FFFFFF"  class="fcf00">'+json.goal[i][4]+'-'+json.goal[i][5]+'</td>';
						score_html += '<td bgcolor="#ffffff"  class="fc00f" '+color2+'>'+json.goal[i][3]+'</td>';
						score_html += '<td bgcolor="#FFFFFF" class="fc008001" >'+json.goal[i][7]+'</td>';
						score_html += '<td bgcolor="#FFFFFF">'+json.goal[i][9]+'</td>';
						score_html += '<td bgcolor="#FFFFFF">'+json.goal[i][10]+'</td>';
						score_html += '<td bgcolor="#FFFFFF">'+json.goal[i][8]+'</td>';
						score_html += '<td bgcolor="#FFFFFF"  class="fcf00">'+json.goal[i][11]+'</td>';
						score_html += '</tr>';	
					}
					score_html += '<tr>';
					score_html += '<td bgcolor="#ffffff" colspan="5" class="fc00f">总计</td>';
					score_html += '<td bgcolor="#ffffff" class="fc008001">'+jq+'</td>';
					score_html += '<td bgcolor="#ffffff">'+dq+'</td>';
					score_html += '<td bgcolor="#ffffff">'+wl+'</td>';
					score_html += '<td bgcolor="#ffffff">'+yc+'</td>';
					score_html += '<td bgcolor="#ffffff" class="fcf00">'+rc+'</td>';
					score_html += '</tr>';
					score_html += '</table>';
					document.getElementById('score_html').innerHTML = score_html;
					document.getElementById('score_u').style.display = '';
				}else{
					document.getElementById('score_u').style.display = 'none';	
					document.getElementById('score_html').innerHTML = '';
				}
			}
		}
	);
}

function loadnews(){
	if(domininfo=='163info.cpdyj.com'){
		$('news').innerHTML=html;
		$('news').style.display="";
	}
}

function constring(arr){
				 var mac_html='';
				  for(var __i=0;__i<6;__i++){
				  	  if(arr[__i]=='W'){
				  	  mac_html+='<span class="dyj_sy2_1">W</span>';
				  	  }else if(arr[__i]=='D'){
				  		  mac_html+='<span class="dyj_sy2_3">D</span>';
				  		}else if(arr[__i]=='L'){
				  			mac_html+='<span class="dyj_sy2_2">L</span>';
				  		}else{
				  			mac_html+='-';
				  		}
				  	}
				  	return mac_html;
				}
				function mac_star(n){
					var mac_html='';
					for(var i=0;i<n;i++){
						  mac_html+='<img src="images/dyj_zc_14.jpg" width="11" height="11" />';
						}
					return mac_html;
				}
				
function loadmac(){
			var ids=new Array();
			ids=['mac_home','mac_away','mac_home_','mac_rec','mac_text','mac_h','mac_d','mac_l','mac_hrecent','mac_arecent','mac_hhandicap','mac_ahandicap','mac_confidence'];
			var values=new Array();
			values=[home+(stadium_mac==0?"(主)":"(中)"),away,home,(recommend==1?home:(recommend==2?away:'和局')),content,recentm[0]+"胜",recentm[1]+"和",recentm[2]+"负",constring(hrecent),constring(arecent),constring(hhandicap),constring(ahandicap),mac_star(confidence)];
			for(var i in ids){
				 $(ids[i]).innerHTML=values[i];
				}
			}
