var showad1 = true;
var showad2 = true;
var showad3 = true;
var showad4 = true;
<!--var Toppx = 160;  //上端位置-->
var Toppx = 260;      //上端位置
var AdDivW = 120;		//宽度
var AdDivH = 150;		//高度
var PageWidth = 800;	//页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 1024;	//显示广告的最小屏幕宽度象素
function initIndexAD(l1,l2,r1,r2){
	var CloserigthHtml = '<div align="right" style="position: absolute;top:-20px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead(0)" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>';
	var CloseleftHtml = '<div align="right" style="position: absolute;top:-20px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead(1)" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>';
	var Closeleft1Html = '<div align="right" style="position: absolute;top:-20px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead(2)" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>';
	var Closeright1Html = '<div align="right" style="position: absolute;top:-20px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead(3)" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>';
	if(l1=='')
		showad1=false;
	if(l2=='')
		showad2=false;
	if(r1=='')
		showad3=false;
	if(r2=='')
		showad4=false;	
	//var AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"> <a href="http://www.macro.org/index.html" target="_blank"><img src="images/macro.jpg" width="120" height="200" border="0"></a></div>';
	document.write ('<div id="Javascript.LeftDiv" style="position: absolute;border: 0px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:0px;word-break:break-all;display:none;">'+CloseleftHtml+'<div>'+l1+'</div></div>');
	//AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"> <a href="http://www.moxa.com.cn/" target="_blank"><img src="images/moxa.jpg" width="120" height="200" border="0"></a></div>';
	document.write ('<div id="leftdiv1" style="position: absolute;border: 0px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:0px;word-break:break-all;display:none;">'+Closeleft1Html+'<div>'+l2+'</div></div>');
	//AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"> <a href="http://www.moxa.com.cn/" target="_blank"><img src="images/moxa.jpg" width="120" height="200" border="0"></a></div>';
	document.write ('<div id="Javascript.RightDiv" style="position: absolute;border: 0px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:60px;word-break:break-all;display:none;">'+CloserigthHtml+'<div>'+r1+'</div></div>');
	//AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"> <a href="http://www.moxa.com.cn/" target="_blank"><img src="images/moxa.jpg" width="120" height="200" border="0"></a></div>';
	document.write ('<div id="right1" style="position: absolute;border: 0px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:60px;word-break:break-all;display:none;">'+Closeright1Html+'<div>'+r2+'</div></div>');
}
function scall(){
	if (window.screen.width<MinScreenW){
		//alert("临时提示：\n\n显示器分辨率宽度小于"+MinScreenW+",不显示广告");
		showad = false;
		document.getElementById("Javascript.LeftDiv").style.display="none";
		document.getElementById("Javascript.RightDiv").style.display="none";
		document.getElementById("leftdiv1").style.display="none";
		document.getElementById("right1").style.display="none";
		return;
	}
	var Borderpx = (((window.screen.width-PageWidth)/2-AdDivW)/2)/2;
	if(showad1)
		document.getElementById("Javascript.LeftDiv").style.display="";
	document.getElementById("Javascript.LeftDiv").style.top=getScrollTop()+Toppx+'px';
	document.getElementById("Javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx+'px';
	if(showad2)
		document.getElementById("leftdiv1").style.display="";
	document.getElementById("leftdiv1").style.top=getScrollTop()+AdDivH+Toppx*2+'px';
	document.getElementById("leftdiv1").style.left=document.body.scrollLeft+Borderpx+'px';
	if(showad3)
		document.getElementById("Javascript.RightDiv").style.display="";
	document.getElementById("right1").style.top=getScrollTop()+AdDivH+Toppx*2+'px';
	document.getElementById("right1").style.left=document.body.clientWidth-Borderpx-AdDivW+'px';
	if(showad4)
		document.getElementById("right1").style.display="";
	document.getElementById("Javascript.RightDiv").style.top=getScrollTop()+Toppx+'px';
	document.getElementById("Javascript.RightDiv").style.left=document.body.clientWidth-Borderpx-AdDivW+'px';
}
function hidead(id)
{
	if(id==0){
		document.getElementById("Javascript.RightDiv").style.display="none";
		showad3=false;
	}else if(id==1){
		document.getElementById("Javascript.LeftDiv").style.display="none";
		showad1=false
	}else if(id==2){
		document.getElementById("leftdiv1").style.display="none";
		showad2=false;
	}else{
		document.getElementById("right1").style.display="none";
		showad4=false;
	}
}
function _ieTrueBody() { 
        return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body; 
    } 

    function getScrollTop() { 
        return document.all ? _ieTrueBody().scrollTop : window.pageYOffset; 
    } 

