function ObjectAD() {
  /* Define Variables*/
  this.ADID        = 0;
  this.ADType      = 0;
  this.ADName      = "";
  this.ImgUrl      = "";
  this.ImgWidth    = 0;
  this.ImgHeight   = 0;
  this.FlashWmode  = 0;
  this.LinkUrl     = "";
  this.LinkTarget  = 0;
  this.LinkAlt     = "";
  this.Priority    = 0;
  this.CountView   = 0;
  this.CountClick  = 0;
  this.InstallDir  = "";
  this.ADDIR       = "";
}

function CodeZoneAD(_id) {
  /* Define Common Variables*/
  this.ID          = _id;
  this.ZoneID      = 0;

  /* Define Unique Variables*/

  /* Define Objects */
  this.AllAD       = new Array();
  this.ShowAD      = null;

  /* Define Functions */
  this.AddAD       = CodeZoneAD_AddAD;
  this.GetShowAD   = CodeZoneAD_GetShowAD;
  this.Show        = CodeZoneAD_Show;

}

function CodeZoneAD_AddAD(_AD) {
  this.AllAD[this.AllAD.length] = _AD;
}

function CodeZoneAD_GetShowAD() {
  if (this.ShowType > 1) {
    this.ShowAD = this.AllAD[0];
    return;
  }
  var num = this.AllAD.length;
  var sum = 0;
  for (var i = 0; i < num; i++) {
    sum = sum + this.AllAD[i].Priority;
  }
  if (sum <= 0) {return ;}
  var rndNum = Math.random() * sum;
  i = 0;
  j = 0;
  while (true) {
    j = j + this.AllAD[i].Priority;
    if (j >= rndNum) {break;}
    i++;
  }
  this.ShowAD = this.AllAD[i];
}

function CodeZoneAD_Show() {
  if (!this.AllAD) {
    return;
  } else {
    this.GetShowAD();
  }

  if (this.ShowAD == null) return false;
  document.write(this.ShowAD.ADIntro);
}

var ZoneAD_18 = new CodeZoneAD("ZoneAD_18");
ZoneAD_18.ZoneID      = 18;
ZoneAD_18.ZoneWidth   = 100;
ZoneAD_18.ZoneHeight  = 360;
ZoneAD_18.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 41;
objAD.ADType         = 4;
objAD.ADName         = "创先争优";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<script language=\"JavaScript\">\n\rvar showad = true;\n\rvar Toppx = 60;   //上端位置\n\rvar AdDivW = 100;  //宽度\n\rvar AdDivH = 360;  //高度\n\rvar PageWidth = 800; //页面多少宽度象素下正好不出现左右滚动条\n\rvar MinScreenW = 1024; //显示广告的最小屏幕宽度象素\n\rvar ClosebuttonHtml = \'<div align=\"right\" style=\"position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000;\"><a href=\"javascript:;\" onclick=\"hidead()\" style=\"color:red;text-decoration:none;font-size:12px;\">关闭</a></div>\';\n\rvar AdContentHtml1 = \'<div align=\"center\" style=\"color:green;font-size:23pt;font-family:黑体;\"><a href=\"/kxfz\" target=\"_blank\"><img src=\"../Images/upload/cxzy1.jpg\" /></a></div>\';\n\rvar AdContentHtml2 = \'<div align=\"center\" style=\"color:green;font-size:23pt;font-family:黑体;\"><a href=\"/kxfz\" target=\"_blank\"><img src=\"../Images/upload/cxzy2.jpg\" /></a></div>\';\n\rdocument.write (\'<div id=\"Javascript.LeftDiv\" style=\"position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:\'+AdDivW+\'px;height:\'+AdDivH+\'px;top:-1000px;word-break:break-all;display:none;\">\'+ClosebuttonHtml+\'<div>\'+AdContentHtml1+\'</div></div>\');\n\rdocument.write (\'<div id=\"Javascript.RightDiv\" style=\"position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:\'+AdDivW+\'px;height:\'+AdDivH+\'px;top:-1000px;word-break:break-all;display:none;\">\'+ClosebuttonHtml+\'<div>\'+AdContentHtml2+\'</div></div>\');\n\rfunction scall(){\n\r if(!showad){return;}\n\r if (window.screen.width<MinScreenW){\n\r  alert(\"临时提示：\n\n显示器分辨率宽度小于\"+MinScreenW+\",不显示广告\");\n\r  showad = false;\n\r  document.getElementById(\"Javascript.LeftDiv\").style.display=\"none\";\n\r  document.getElementById(\"Javascript.RightDiv\").style.display=\"none\";\n\r  return;\n\r }\n\r var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;\n\r document.getElementById(\"Javascript.LeftDiv\").style.display=\"\";\n\r document.getElementById(\"Javascript.LeftDiv\").style.top=document.body.scrollTop+Toppx;\n\r document.getElementById(\"Javascript.LeftDiv\").style.left=document.body.scrollLeft+Borderpx;\n\r document.getElementById(\"Javascript.RightDiv\").style.display=\"\";\n\r document.getElementById(\"Javascript.RightDiv\").style.top=document.body.scrollTop+Toppx;\n\r document.getElementById(\"Javascript.RightDiv\").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById(\"Javascript.RightDiv\").offsetWidth-Borderpx;\n\r}\n\rfunction hidead()\n\r{\n\r showad = false;\n\r document.getElementById(\"Javascript.LeftDiv\").style.display=\"none\";\n\r document.getElementById(\"Javascript.RightDiv\").style.display=\"none\";\n\r}\n\rwindow.onscroll=scall;\n\rwindow.onresize=scall;\n\rwindow.onload=scall;\n\r</script>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 100;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.ADDIR          = "hchabc";
ZoneAD_18.AddAD(objAD);

ZoneAD_18.Show();

