
 var autoreflash = 0;
window.onbeforeunload = function() {    
 if (document.getElementById("onLoadingBar"))
 {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='about:blank' height=0 width=0 target='self'></iframe>";
 }
//if (autoreflash==0) return "";
}

function testad() {
 if (!document.getElementById("onLoadingBar"))
 {
	 return;
 }	

	autoreflash = 1;
	var randid = parseInt(10*Math.random());
if (randid <= 2) {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='http://g.miaozhen.com/r.gif?%5Ek=544%5Ep=1a50%5Eo=http://www.csn88.com/' height=0 width=0 target='self'></iframe>";
pageTracker._trackPageview('/outgoing/odds/auto_banner1');
setTimeout("document.getElementById('onLoadingBar').innerHTML = '';window.status ='完成';",5000);
}

else if (randid <= 3) {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='http://www.bet3636.com/' height=0 width=0 target='self'></iframe>";
pageTracker._trackPageview('/outgoing/odds/auto_banner1');
setTimeout("document.getElementById('onLoadingBar').innerHTML = '';window.status ='完成';",6000);
}
/*
else if (randid <= 3) {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='http://www.hypertracker.com/go/fun88/10JansportscnOdds2S01/' height=0 width=0 target='self'></iframe>";
pageTracker._trackPageview('/outgoing/odds/auto_banner2');
setTimeout("document.getElementById('onLoadingBar').innerHTML = '';window.status ='完成';",6000);
}
else if (randid <= 3) {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='http://www.wewbet.net/proxy.htm?username=yinuyin786' height=0 width=0 target='self'></iframe>";
pageTracker._trackPageview('/outgoing/odds/auto_banner2');
setTimeout("document.getElementById('onLoadingBar').innerHTML = '';window.status ='完成';",6000);
}
else if (randid <= 7) {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='http://aus888.com/user_aus888/?referral=37' height=0 width=0 target='self'></iframe>";
pageTracker._trackPageview('/outgoing/odds/auto_banner3');
setTimeout("document.getElementById('onLoadingBar').innerHTML = '';window.status ='完成';",6000);
}
else if (randid <= 9) {
	document.getElementById("onLoadingBar").innerHTML = "<iframe src='http://www.soonbet.com/?ad=314' height=0 width=0 target='self'></iframe>";
pageTracker._trackPageview('/outgoing/odds/auto_banner4');
setTimeout("document.getElementById('onLoadingBar').innerHTML = '';window.status ='完成';",6000);
}*/
else {
document.getElementById("onLoadingBar").innerHTML = "<iframe src='about:blank' height=0 width=0 target='self'></iframe>";
window.status ="完成";
}
}

//Base Code
var Commercial=new Object();
Commercial.PosLeft_Left=25;
Commercial.PosLeft_Right=25;
Commercial.Pos_Outer=800;
Commercial.LeftItem=new Array();
Commercial.RightItem=new Array();
Commercial.OuterItem=new Array();
Commercial.TopItem=new Array();
Commercial.BigItem=new Array();
Commercial.BigIndex=-1;
Commercial.ZIndex=1;
Commercial.IsLoaded=0;
Commercial.OutLink=

Commercial.CommercialItem=function(top,iurl,lurl,ltar,iwidth,iheight,outlink){
	this.Top=top;
	this.ImgURL=iurl;
	this.ImgWidth=iwidth;
	this.ImgHeight=iheight;
	this.LinkURL=lurl;
	this.LinkTarget=ltar;
	this.OutLink = outlink;
}
Commercial.ShowBanner=function(){
	while(true){
		var tmp=Math.round(Math.random()*(Commercial.BigItem.length-1));
		if(tmp!=Commercial.BigIndex){
			Commercial.BigIndex=tmp;
			break;
		}
	}
	if(Commercial.BigIndex!=-1&&Commercial.BigItem.length>0){
	    document.getElementById("a_banner_a").href=Commercial.BigItem[Commercial.BigIndex].LinkURL;
		document.getElementById("a_banner_img").src=Commercial.BigItem[Commercial.BigIndex].ImgURL;
	}

	if(Commercial.BigItem.length>1)
		setTimeout(Commercial.ShowBanner,120000);
}

Commercial.ShowCommercial=function(){
	if(Commercial.IsLoaded==1)
		return;
	Commercial.ShowBanner();
	//document.getElementById("a_banner").style.display="";
	var topdiv=document.getElementById("a_top");
	topdiv.innerHTML="";
	for(var i=0;i<Commercial.TopItem.length;i++){
		topdiv.innerHTML+="<a href=\""+Commercial.TopItem[i].LinkURL+"\" target=\""+Commercial.TopItem[i].LinkTarget+"\" "+Commercial.TopItem[i].OutLink+"><img border=0 src=\""+Commercial.TopItem[i].ImgURL+"\" width=\""+Commercial.TopItem[i].ImgWidth+"\" height=\""+Commercial.TopItem[i].ImgHeight+"\"></a>&nbsp;"
	}
var mainwin = document.getElementById("mainwin");

		var CommercialEle  = null;
	if (document.getElementById("addiv"))
	{
		CommercialEle = document.getElementById("addiv");
		document.getElementById("addiv").innerHTML = "";
	}
	else {
	    CommercialEle=document.createElement("div");
    	CommercialEle.id = "addiv";
	}

	document.body.appendChild(CommercialEle);	

	for(var i=0;i<Commercial.LeftItem.length;i++){
		var htmlStr="<span id=\"lgg"+i+"\" style=\"position:absolute;float :left; text-align:center;width:80px; margin:auto;z-index:"+Commercial.ZIndex+"; left: "+ Commercial.PosLeft_Left  +"px; top: "+Commercial.LeftItem[i].Top+"px;\"><a href=\""+Commercial.LeftItem[i].LinkURL+"\" target=\""+Commercial.LeftItem[i].LinkTarget+"\" "+Commercial.LeftItem[i].OutLink+"><img border=0 src=\""+Commercial.LeftItem[i].ImgURL+"\" width=\""+Commercial.LeftItem[i].ImgWidth+"\" height\""+Commercial.LeftItem[i].ImgHeight+"\"></a></span>";
		CommercialEle.innerHTML+=htmlStr;
		Commercial.ZIndex++;
	}
	for(var i=0;i<Commercial.RightItem.length;i++){
		var htmlStr="<span id=\"rgg"+i+"\" style=\"position:absolute; text-align:center;width:80px;margin:auto; z-index:"+Commercial.ZIndex+"; right: "+Commercial.PosLeft_Right +"px; top: "+Commercial.RightItem[i].Top+"px;\"><a href=\""+Commercial.RightItem[i].LinkURL+"\" target=\""+Commercial.RightItem[i].LinkTarget+"\" "+Commercial.RightItem[i].OutLink+"><img border=0 src=\""+Commercial.RightItem[i].ImgURL+"\" width=\""+Commercial.RightItem[i].ImgWidth+"\" height\""+Commercial.RightItem[i].ImgHeight+"\"></a></span>";
		CommercialEle.innerHTML+=htmlStr;
		Commercial.ZIndex++;
	}
	for(var i=0;i<Commercial.OuterItem.length;i++){
		var htmlStr="<span id=\"rgg"+i+"\" style=\"position:absolute; text-align:center;width:80px;margin:auto; z-index:"+Commercial.ZIndex+"; left: "+Commercial.Pos_Outer+"px; top: "+Commercial.OuterItem[i].Top+"px;\"><a href=\""+Commercial.OuterItem[i].LinkURL+"\" target=\""+Commercial.OuterItem[i].LinkTarget+"\" "+Commercial.OuterItem[i].OutLink+"><img border=0 src=\""+Commercial.OuterItem[i].ImgURL+"\" width=\""+Commercial.OuterItem[i].ImgWidth+"\" height\""+Commercial.OuterItem[i].ImgHeight+"\"></a></span>";
		CommercialEle.innerHTML+=htmlStr;
		Commercial.ZIndex++;
	}

	for(var i=0;i<Commercial.MatchAdInfo.length;i++){
		try{
	var htmlStr="<span><a href=\""+Commercial.MatchAdInfo[i].LinkURL+"\" target=\""+Commercial.MatchAdInfo[i].LinkTarget+"\" "+Commercial.MatchAdInfo[i].OutLink+">"+Commercial.MatchAdInfo[i].ImgURL+"</a></span>";

	document.getElementById("remark_AD"+Commercial.MatchAdInfo[i].Top).innerHTML+=htmlStr;
	document.getElementById("remark_ADROW"+Commercial.MatchAdInfo[i].Top).style.display="";
		
		}catch(e){}
	}
	Commercial.IsLoaded=1;
}
Commercial.LeftFloat=new Array();
Commercial.RightFloat=new Array();
Commercial.MatchAdInfo=new Array();
Commercial.AddLeftFloat=function(idx){
	Commercial.LeftFloat[Commercial.LeftFloat.length]=idx;
}
Commercial.AddRightFloat=function(idx){
	Commercial.RightFloat[Commercial.RightFloat.length]=idx;
}
window.onscroll=function(){
	var mainwin = document.getElementById("mainwin");

	for(var i=0;i<Commercial.LeftFloat.length;i++){
		try{
			document.getElementById("lgg"+Commercial.LeftFloat[i]).style.top=Commercial.LeftItem[Commercial.LeftFloat[i]].Top+document.body.scrollTop+"px";

		}catch(e){}
	}
	for(var i=0;i<Commercial.RightFloat.length;i++){
		try{
			document.getElementById("rgg"+Commercial.RightFloat[i]).style.top=Commercial.RightItem[Commercial.RightFloat[i]].Top+document.body.scrollTop+"px";
		}catch(e){}
	}
}

//顶部大广告项
//Commercial.BigItem[0]=new Commercial.CommercialItem(0,"http://img.gooooal.com/god/macauslot.gif","http://www.macauslot.com/index.html?AFF=5","_blank",468,60,"onClick=\"javascript:urchinTracker('/outgoing/macauslot_com/ad1');\"");

//顶部小广告项
//Commercial.TopItem[0]=new Commercial.CommercialItem(0,"http://img.gooooal.com/god/ga003_1.gif","http://www.ga003.com/","_blank",140,35,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/ga003_com/ad1');\"");
//Commercial.TopItem[1]=new Commercial.CommercialItem(0,"http://img.gooooal.com/god/txw32888.gif","http://www.32888.com/","_blank",200,35,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/32888_com/ad1');\"");
//Commercial.TopItem[2]=new Commercial.CommercialItem(0,"http://img.gooooal.com/god/660111_2.gif","http://www.660111.com/","_blank",140,35,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/660111_com/ad1');\"");

//左边广告项
/*
Commercial.LeftItem[0]=new Commercial.CommercialItem(360,"http://image.sportscn.com/other/live/120x60.gif","http://aus888.com/user_aus888/?referral=37","_blank",120,60,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/aus888');\"");

Commercial.LeftItem[1]=new Commercial.CommercialItem(430,"http://image.sportscn.com/other/live/soonbet120_60.gif","http://www.soonbet.com/?ad=314","_blank",120,60,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/soonbet');\"");

Commercial.LeftItem[2]=new Commercial.CommercialItem(500,"http://image.sportscn.com/other/live/88m.gif","http://www.88m.cc/","_blank",120,60,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/hll888');\"");

Commercial.LeftItem[3]=new Commercial.CommercialItem(570,"http://banner.12biying.com/Football/315.gif","http://www.12biying.com/1823759/sportsbook/cs/index.aspx","_blank",120,140,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/12biying');\"");

Commercial.LeftItem[4]=new Commercial.CommercialItem(720,"http://image.sportscn.com/other/odds/ad_kaishilo_110X50.gif","http://www.kaishilo.com/","_blank",110,50,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/kaishilo');\"");
*/
//左边广告漂浮项
//Commercial.AddLeftFloat(0);
//Commercial.AddLeftFloat(1);
//Commercial.AddLeftFloat(2);
//Commercial.AddLeftFloat(3);


//右边广告项


//Commercial.RightItem[0]=new Commercial.CommercialItem(165,"http://image.sportscn.com/other/odds/120x150_2.gif","http://www.121winsb.com?affiliate=365_024130&oty=1&lng=10","_blank",120,150,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/bet365');\"");

//Commercial.RightItem[1]=new Commercial.CommercialItem(325,"http://image.sportscn.com/ad/ad_081104_120X120.gif","http://www.888wanjia.com/?TSN=3972&LangID=1","_blank",120,120,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/888stars');\"");

Commercial.RightItem[0]=new Commercial.CommercialItem(165,"http://image.sportscn.com/other/live/120x150_csn88.gif","http://g.miaozhen.com/r.gif?%5Ek=544%5Ep=1a50%5Eo=http://www.csn88.com/","_blank",120,150,"onClick=\"javascript:pageTracker._trackPageview('/outgoing/odds/csn88');\"");

//右边广告漂浮项
//Commercial.AddRightFloat(0);
//Commercial.AddRightFloat(1);
//Commercial.AddRightFloat(2);

//右边广告项
//Commercial.OuterItem[0]=new Commercial.CommercialItem(30,"http://img.gooooal.com/god/0429-wsom-80x200.gif","http://www.jjclub.com.cn/2007/04/wsom/gooooal/index.htm?SubjectID=77","_blank",80,200);

Commercial.MatchAdInfo[0]=new Commercial.CommercialItem(0,"<font color=red><b>广告: 皇冠亚洲博彩娱乐公司提供足球在线投注，系统出租或合作等服务！咨询4006366993</b></font>","http://www.bet3636.com","_blank",0,0,"");
Commercial.MatchAdInfo[1]=new Commercial.CommercialItem(1,"<font color=blue><b>广告: 重心推荐：八大胜 首存资金10%回赠积分换现金 百年品牌资金安全、随意无限量提款！</b></font>","http://www.8d128.com/?TSN=2662&LangID=1","_blank",0,0,"");
/*
Commercial.MatchAdInfo[2]=new Commercial.CommercialItem(2,"<font color=red><b>广告: 信心推荐：盈禾国际 最高水位1.99，0.75%高返水,24小时随意申请提款，30分钟到帐！</b></font>","http://www.wewbet.net/proxy.htm?username=yinuyin786","_blank",0,0,"");
Commercial.MatchAdInfo[3]=new Commercial.CommercialItem(3,"<font color=blue><b>广告: 必博国际，滚球1秒确认，半场派彩，每日提款尽情提款，次数不限制！</b></font>","http://www.3beebet.com/Coop=10003&Lang=CHS","_blank",0,0,"");*/