var isShowAd=true;
if(typeof a_left == 'undefined'||typeof a_right == 'undefined'){isShowAd=false;}
if(typeof a_left == 'undefined')a_left="";
if(typeof img_left == 'undefined')img_left="";
if(typeof a_right == 'undefined')a_right="";
if(typeof img_right == 'undefined')img_right="";

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_left(){
    left1.style.visibility='hidden';
}
function close_right(){
    right1.style.visibility='hidden';
}
if(isShowAd)
{
//显示样式
document.writeln("<style type=\"text\/css\">");
document.writeln("#leftDiv,#rightDiv{position:absolute;z-index:200}");
document.writeln(".itemFloat{line-height:25px}");
document.writeln("<\/style>");

//------左侧开始
document.writeln("<div id=\"leftDiv\" style=\"top:128px;left:10px\">");
document.writeln("<div id=\"left1\" class=\"itemFloat\">");
document.writeln("<layer><a href='"+a_left+"' target=_blank><img src='"+img_left+"' border=0></a></layer>");
document.writeln("<br><a href=\"javascript:close_left();\" title=\"关闭广告\">关闭<\/a>");
document.writeln("<\/div>");
document.writeln("<\/div>");
//------左侧结束
//------右侧开始
document.writeln("<div id=\"rightDiv\" style=\"top:128px;right:10px\">");
document.writeln("<div id=\"right1\" class=\"itemFloat\">");
document.writeln("<layer><a href='"+a_right+"' target=_blank><img src='"+img_right+"' border=0></a></layer>");
document.writeln("<br><a href=\"javascript:close_right();\" title=\"关闭广告\">关闭<\/a>");
document.writeln("<\/div>");
document.writeln("<\/div>");
//------右侧结束
}