
var ShowDouble = true;
var Toppx = 60;   //上端位置
var AdDivW = 100;  //宽度
var AdDivH = 300;  //高度
var PageWidth = 800; //页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 1024; //显示广告的最小屏幕宽度象素 
var ClosebuttonHtmlLeft = '<a href="javascript:;" onclick="Hidead()" style="color:#999999;">关闭</a>'
var ClosebuttonHtmlRight = '<a href="javascript:;" onclick="Hidead()" style="color:#999999;">关闭</a>'
//var AdContentHtmlLeft = '<a target="_blank" href="http://www.last.gov.cn/work.asp"><img src="http://www.last.gov.cn/images/work.gif" border="0"></a>';  //左侧广告内容
//var AdContentHtmlRight = '<a target="_blank" href="http://www.last.gov.cn/work.asp"><img src="http://www.last.gov.cn/images/work.gif" border="0"></a>'; //右侧广告内容
var AdContentHtmlLeft = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100" height="200" ID="Shockwaveflash1" VIEWASTEXT><param name="movie" value="http://www.last.gov.cn/images/work.swf"><param name="quality" value="high"><param name="wmode" value="opaque"><embed src="http://www.last.gov.cn/images/work.swf"  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="200"></embed></object>';  //左侧广告内容
var AdContentHtmlRight = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100" height="200" ID="Shockwaveflash1" VIEWASTEXT><param name="movie" value="http://www.last.gov.cn/images/work.swf"><param name="quality" value="high"><param name="wmode" value="opaque"><embed src="http://www.last.gov.cn/images/work.swf"  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="200"></embed></object>'; //右侧广告内容


function scall(){
 if(!ShowDouble){return;}
 if (window.screen.width<MinScreenW){
  alert("临时提示：\n\n显示器分辨率宽度小于"+MinScreenW+",不显示广告");
  ShowDouble = 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.body.scrollTop+Toppx;
 document.getElementById("Javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx;
 document.getElementById("Javascript.RightDiv").style.display="";
 document.getElementById("Javascript.RightDiv").style.top=document.body.scrollTop+Toppx;
 document.getElementById("Javascript.RightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("Javascript.RightDiv").offsetWidth-Borderpx;
}
function Hidead()
{
 ShowDouble = false;
 document.getElementById("Javascript.LeftDiv").style.display="none";
 document.getElementById("Javascript.RightDiv").style.display="none";
}

function ShowDoubleAll()
{
	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;"><table border="0" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid #cccccc;"><tr><td><div>'+AdContentHtmlLeft+'</div></td></tr><tr><td bgcolor="#efefef" align="center">'+ClosebuttonHtmlLeft+'</td></tr></table></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;"><table border="0" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid #cccccc;"><tr><td><div>'+AdContentHtmlRight+'</div></td></tr><tr><td bgcolor="#efefef" align="center">'+ClosebuttonHtmlRight+'</td></tr></table></div>');

	window.onscroll=scall;
	window.onresize=scall;
	window.onload=scall;
}
ShowDoubleAll(); //输出广告
