﻿var showad = true;        //是否显示广告
var Toppx = 30;            //上端位置
var AdDivW = 90;        //宽度
var AdDivH = 99;        //高度
var PageWidth = 1024;    //页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 800;    //显示广告的最小屏幕宽度象素
var ClosebuttonHtml = ''
var AdContentHtml = '<div class="kiwilogo" align="center"><a href="guide.html" onfocus="this.blur();">参赛指南</a></div>';
document.write ('<div id="Javascript.LeftDiv" style=" visibility: hidden; position: absolute; z-index:1000; width:'+AdDivW+'px; height:'+AdDivH+'px; top:-1000px; display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</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;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</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 = ((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-20)+"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;
