var showad = true;
var Toppx = 60;   //上端位置
var AdDivW = 170;  //宽度
var AdDivH = 360;  //高度
var PageWidth = 940; //页面多少宽度象素下正好不出现左右滚动条

var MinScreenW = 1152; //显示广告的最小屏幕宽度象素 
var ClosebuttonHtml = '<div align="right" valign="top" style="position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:1;"><a href="JavaScript:;" onclick="hidead()" style="color:white;text-decoration:none;font-size:12px;"><img src="imagenew/close.gif" border=0 alt="close"></a></div>'
var AdContentHtml1 = '<div align="center"><table width="170" border="0" cellspacing="0" cellpadding="0"><tr><td><img src="image/left.gif"></td></tr></table></div>';
var AdContentHtml2 = '<div align="center"><table width="170" border="0" cellspacing="0" cellpadding="0"><tr><td><OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="559" hspace="0" width="170" vspace="0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID="Shockwaveflash1"><PARAM NAME="_cx" VALUE="14155"><PARAM NAME="_cy" VALUE="2249"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="image/right.swf"><PARAM NAME="Src" VALUE="image/right.swf"><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE=""><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false"><embed src="image/right.swf" height="559" hspace="0" width="170" vspace="0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></OBJECT></td></tr></table></div>';

document.write ('<div id="JavaScript.LeftDiv" style="position: absolute;border: 1px solid #cccccc;background-color:#f7f7f7;z-index:1;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml1+'</div></div>');
document.write ('<div id="JavaScript.RightDiv" style="position: absolute;border: 1px solid #cccccc;background-color:#f7f7f7;z-index:1;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml2+'</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.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;
//document.getElementById("Javascript.LeftDiv").style.posLeft=5;
//document.getElementById("Javascript.RightDiv").style.posRight=5;
}
function hidead()
{
 showad = false;
 document.getElementById("Javascript.LeftDiv").style.display="none";
 document.getElementById("Javascript.RightDiv").style.display="none";
}
window.onscroll=scall;
window.onresize=scall;
scall();
