var showad = true; //是否显示广告

var Toppx = 160; //上端位置

var AdDivW = 100; //宽度

var AdDivH = 160; //高度

var PageWidth = 1024; //页面多少宽度象素下正好不出现左右滚动条

var MinScreenW = 800; //显示广告的最小屏幕宽度象素

var Text = "新生网络报到系统现已开通，报到时间截止为2011年9月17日12:00";	//要显示的html
	
var Link = "#";  //链接

var ClosebuttonHtml = '<div style="background:#fff;color:black;height:20px;line-height:20px;text-align:center;cursor:pointer" onclick="hidead();">关闭</div>';

var AdContentHtmllf = '<div style="background:#B03A3A;" align="center"><a style="color:#fff;font-size:16pt;" href="'+Link+'">'+Text+'</a></div>';
var AdContentHtmlrt = '';

document.write ('<div id="Javascript.LeftDiv" style="position: absolute;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;"><div>'+AdContentHtmllf+'</div><div>'+ClosebuttonHtml+'</div></div>'); 

document.write ('<div id="Javascript.RightDiv" style="position: absolute;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;"><div>'+AdContentHtmllf +'</div><div>'+ClosebuttonHtml+'</div></div>');

function scall(){

if(!showad){return;}

if (window.screen.width<MinScreenW){


showad = false;

document.getElementById("Javascript.LeftDiv").style.display="none";

document.getElementById("Javascript.RightDiv").style.display="none";

return;

}

var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;

document.getElementById("Javascript.LeftDiv").style.display="";

document.getElementById("Javascript.LeftDiv").style.top=(document.documentElement.scrollTop+Toppx)+"px";

document.getElementById("Javascript.LeftDiv").style.left=(document.documentElement.scrollLeft+Borderpx)+"px";

document.getElementById("Javascript.RightDiv").style.display="";

document.getElementById("Javascript.RightDiv").style.top=(document.documentElement.scrollTop+Toppx)+"px";

document.getElementById("Javascript.RightDiv").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Javascript.RightDiv").offsetWidth-Borderpx)+"px";

}

function hidead()

{

showad = false;

document.getElementById("Javascript.LeftDiv").style.display="none";

document.getElementById("Javascript.RightDiv").style.display="none";

}

window.onscroll=scall;

window.onresize=scall;

window.onload=scall;

