var isShowAd=true;
if(typeof a_left == 'undefined'||typeof a_right == 'undefined'){isShowAd=false;}
if(typeof a_left == 'undefined')a_left="http://k1.tiancity.com/";
if(typeof img_left == 'undefined')img_left="Images/CSonline1.gif";
if(typeof a_right == 'undefined')a_right="http://www.shumenol.com/?stat=36981";
if(typeof img_right == 'undefined')img_right="images/CSonline.gif";

lastScrollY = 0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("leftDiv").style.top = parseInt(document.getElementById("leftDiv").style.top)+percent+"px";
document.getElementById("rightDiv").style.top = parseInt(document.getElementById("rightDiv").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
//下面这段删除后，对联将不跟随屏幕而移动。
if(isShowAd)window.setInterval("heartBeat()",1);
//-->
//关闭按钮
function close_left1(){
    left1.style.visibility='hidden';
}
function close_right1(){
    right1.style.visibility='hidden';
}
if(isShowAd)
{
//显示样式
document.writeln("<style type=\"text\/css\">");
document.writeln("#leftDiv,#rightDiv{width:85px;height:100px;background-color:#fff;position:absolute;}");
document.writeln(".itemFloat{width:100px;height:auto;line-height:5px}");
document.writeln("<\/style>");
//以下为主要内容
document.writeln("<div id=\"leftDiv\" style=\"top:116px;left:5px\">");
//------左侧各块开始
//---L1
document.writeln("<div id=\"left1\" class=\"itemFloat\">");
document.writeln("<layer id=tiantian top=100 width=85 height=300><a href='"+a_left+"' target=_blank><img src='"+img_left+"' width=85 height=300 border=0></a></layer>");
document.writeln("<br><br><a href=\"javascript:close_left1();\" title=\"关闭上面的广告\">关闭<\/a><br><br><br><br>");
document.writeln("<\/div>");
//------左侧各块结束
document.writeln("<\/div>");
document.writeln("<div id=\"rightDiv\" style=\"top:116px;right:5px\">");
//------右侧各块结束
//---R1
document.writeln("<div id=\"right1\" class=\"itemFloat\">");
document.writeln("<layer id=myleft top=100 width=85 height=300><a href='"+a_right+"' target=_blank><img src='"+img_right+"' width=85 height=300 border=0></a></layer>");
document.writeln("<br><br><a href=\"javascript:close_right1();\" title=\"关闭上面的广告\">关闭<\/a><br><br><br><br>");
document.writeln("<\/div>");
//------右侧各块结束
document.writeln("<\/div>");
}
