
 
function myload()
{  
	if (document.documentElement.scrollTop==MyTop && document.body.clientWidth==MyWidth)
	{
		setTimeout("myload();",200);
		return false;
	}
	MyTop=document.body.scrollTop;
	if(MyTop==0) MyTop=document.documentElement.scrollTop; 
	MyWidth=document.body.clientWidth;
	
	for (var p in right_layer)
	{      
		var mlayer=eval("right"+p);
		var new_top=MyTop+200+imgheight*p ;	
		var pos_top=right_layer_top+imgheight*p ;
		if (new_top>pos_top)  mlayer.style.top= new_top; else mlayer.style.top=pos_top;  

		if(document.body.clientWidth>830) 
			mlayer.style.left= (MyWidth-830)/2+734;
		else
			mlayer.style.left=734;
	}

	for (var p in left_layer)
	{      
		var mlayer=eval("left"+p);
		var new_top=MyTop+200+imgheight*p ;	
		var pos_top=left_layer_top+imgheight*p ;
		if (new_top>pos_top)  mlayer.style.top= new_top; else mlayer.style.top=pos_top;  
		if(MyWidth>778) 
			mlayer.style.left= (MyWidth-830)/2+6;
		else
			mlayer.style.left=6;
	}
	setTimeout("myload();",200);		
}
function ShowTop30pxAd()
{
//	document.write("<div align=center style='width:830px; background-color:white;'><a href='http://www.gangdu18.com/' target='_blank'><img src='http://img2.betad.cn/ad/gangdu18.gif' width=160 height=30 border=0></a> <a href='http://www.25882588.com' target='_blank'><img src='http://img2.betad.cn/ad/25882588new.gif' width=658 height=30 border=0 ></a></div>");
}
function ShowBottomAd()
{
//	document.write("<div align=center><a href='http://www.zq228.com' target='_blank'><img src='http://img2.bet007.com/ad/zq228.gif' width=620 height=46 border=0></a></div>");
}

function ShowLayer(sName){
	if (document.getElementById(sName).style.display =="none"){
		document.getElementById(sName).style.display ="";
	}else{
		document.getElementById(sName).style.display ="none";
	}
}
    function see_next()
	{
		window.open("Next.aspx?id=1");
	}
	function openwanchang()
	{
		window.open("Over.aspx?id=1");
	}


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; }
}


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; 
}



//显示进球窗口
function ShowCHWindow(str,matchnum)
{
	imagewidth=420;
	imageheight=28+34*matchnum ;
	x=280;
	y=1;
	var winLoc=document.getElementById("winLocation").options[document.getElementById("winLocation").selectedIndex].value;
	switch(winLoc)
	{			
    case "0":
        x=(document.body.clientWidth-imagewidth)/2;
        y=1;
        break;
    case "1":
        x=(document.body.clientWidth-imagewidth)/2;
        y=document.body.clientHeight-imageheight-2;
        break;
    case "2":
        x=(document.body.clientWidth-imagewidth)/2-(880-imagewidth)/2;
        y=1;//y=(screen.height-imageheight)/2;
        break;
    case "3":
        x=(document.body.clientWidth-880)/2+880-imagewidth;
        y=1;//y=(screen.height-imageheight)/2;
        break;
    case "4":
        x=1;
        y=1;
        break;
    case "5":
        x=document.body.clientWidth-imagewidth-2;
        y=1;
        break;
    case "6":
        x=1;
        y=document.body.clientHeight-imageheight-2;
        break;
    case "7":
        x=document.body.clientWidth-imagewidth-2;
        y=document.body.clientHeight-imageheight-2;
        break;
	}
	
	if(!window.XMLHttpRequest){IE6ShowCHWindow(str,matchnum,x,y);}else{popup.markPop(str,x,y,15000);}
}

	
//显示进球窗口
var startani_C,startani_A,startani_B,pop_TC

function IE6ShowCHWindow(str,matchnum)
{
imagewidth=420;
imageheight=28+34*matchnum ;
var st='<div  style="width:420px; height:62px;">';
st=st+'<div style="height:24px; width:420px; background:url(images/showbf_bg_01.gif);">';
st=st+'<div style="float:left; background:url(images/showbf_07.gif); width:136px; height:24px;"></div>';
st=st+'<div style="float:right; background: url(images/showbf_09.gif); width:27px; height:24px;"></div></div>';
st=st+'<div style="height:38px; width:416px; border-bottom-width:2px; border-bottom-color:#CC0000; border-bottom-style:solid;border-left:2px; border-left-color:#CC0000; border-left-style:solid; border-right:2px; border-right-color:#CC0000; border-right-style:solid">';
st=st +'<table border=0 cellpadding=0 cellspacing=0 bgcolor="#FFFFFF" style="marign:0px;auto;width:416px; height:36px;">';
st=st +str
st=st +'</table>';
st=st + '<style type="text/css">'
st=st + 'td {font-family: "Tahoma", "宋体";font-size: 13px;}'
st=st + '.line td { border-bottom:solid 1px #FFD8CA; line-height:32px;}'
st=st + '</style>'
st=st +'</div></div>';

oPopup = window.createPopup();
oPopupBody = oPopup.document.body;
oPopupBody.bgColor="white";

oPopupBody.innerHTML = st
x=280;
y=1;
var winLoc=document.getElementById("winLocation").options[document.getElementById("winLocation").selectedIndex].value;
switch(winLoc)
{			
    case "0":
        x=(screen.width-imagewidth)/2;
        y=1;
        break;
    case "1":
        x=(screen.width-imagewidth)/2;
        y=screen.height-imageheight-30;
        break;
    case "2":
        x=2;
        y=(screen.height-imageheight)/2;
        break;
    case "3":
        x=screen.width-imagewidth-2;
        y=(screen.height-imageheight)/2;
        break;
    case "4":
        x=1;
        y=1;
        break;
    case "5":
        x=screen.width-imagewidth-2;
        y=1;
        break;
    case "6":
        x=1;
        y=screen.height-imageheight-30;
        break;
    case "7":
        x=screen.width-imagewidth-2;
        y=screen.height-imageheight-30;
        break;
}
oPopupBody.style.cursor="pointer";
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(){
  try{
	oPopup.show(x,y,imagewidth, imageheight);
	startani_A=setTimeout("pop()",100);  //显示15秒
	if(pop_TC<0){dismisspopup();};
	pop_TC=pop_TC-1;
  }catch(e){}
}
function dismisspopup()
{	clearTimeout(startani_A);
	oPopup.hide();
}

function showgoallist(ID)
{
	window.open("http://live.90a.cn/detail.aspx?id=" + ID +"", "","scrollbars=yes,resizable=yes,width=668, height=720");
}
function  analysis(ID)
{
	var theURL="http://live.90a.cn/analysis.aspx?id=" + ID + ""
	//window.open(theURL,"","width=900,height=800,top=20,left=90,resizable=yes,scrollbars=yes");
	window.open(theURL);
}
function  mf_liao(ID)
{
	var theURL="http://xs.90a.cn/tuijie.asp?id=" + ID + ""
	window.open(theURL);
}
function AsianOdds(ID)
{
	var theURL="http://live.90a.cn/AsianOdds_n.aspx?id="  +ID;
	window.open(theURL);
}
function tuijie(ID)
{
	
	window.open("http://live.90a.cn/tuijie.asp?id=" + ID +"", "","scrollbars=no,resizable=no,width=400, height=320");
}
function EuropeOdds(ID)
{
	var theURL="http://live.90a.cn/oddslist.aspx?id=" + ID + ".htm";
	window.open(theURL);
}

function TeamPanlu_10(ID)
{
    var	theURL="http://live.90a.cn/panlu.aspx?id=" + ID + "";
	window.open(theURL,"","width=640,height=700,top=10,left=100,resizable=yes,scrollbars=yes");
	//window.open(theURL);
}
function dxp(i)
{
	var	theURL="http://live.90a.cn/overdown_n.aspx?id=" +  A[i][0] +"&team1=" + A[i][5+m_language] + "&team2=" + A[i][8+m_language] ;
	window.open (theURL,"","width=700,height=400,top=20,left=90,resizable=yes,scrollbars=yes");
}
function advices(ID)
{
    var	theURL="http://live.90a.cn/panlu.aspx?id=" + ID;
    window.open(theURL,"","width=640,height=700,top=10,left=100,resizable=yes,scrollbars=yes");
	//window.open(theURL);
}



var zXml = {
    useActiveX: (typeof ActiveXObject != "undefined"),
    useXmlHttp: (typeof XMLHttpRequest != "undefined")
};

zXml.ARR_XMLHTTP_VERS = ["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.3.0"];

function zXmlHttp() {}

zXmlHttp.createRequest = function ()
{
    if (zXml.useXmlHttp)  return new XMLHttpRequest(); 

    if(zXml.useActiveX)  //IE < 7.0 = use ActiveX
    {  
        if (!zXml.XMLHTTP_VER) {
            for (var i=0; i < zXml.ARR_XMLHTTP_VERS.length; i++) {
                try {
                    new ActiveXObject(zXml.ARR_XMLHTTP_VERS[i]);
                    zXml.XMLHTTP_VER = zXml.ARR_XMLHTTP_VERS[i];
                    break;
                } catch (oError) {}
            }
        }        
        if (zXml.XMLHTTP_VER) return new ActiveXObject(zXml.XMLHTTP_VER);
    } 
    alert("对不起，您的电脑不支持 XML 插件，请安装好或升级浏览器。");
};



Date.prototype.format = function(format)
{
    var o =
    {
        "M+" : this.getMonth()+1, //month
        "d+" : this.getDate(),    //day
        "h+" : this.getHours(),   //hour
        "m+" : this.getMinutes(), //minute
        "s+" : this.getSeconds(), //second
        "q+" : Math.floor((this.getMonth()+3)/3),  //quarter
        "S" : this.getMilliseconds() //millisecond
    }
    if(/(y+)/.test(format))
    format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length));
    for(var k in o)
    if(new RegExp("("+ k +")").test(format))
    format = format.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
    return format;
}

function Comparetime(temper){
 var nowtime=new Date().format("yyyy/MM/dd hh:mm:ss"); 
 var ctime = new Date(temper.replace("-","/").replace("-","/")).format("yyyy/MM/dd hh:mm:ss");
 return Date.parse(nowtime) > Date.parse(ctime)?false:true;
};

