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_43 = new CodeZoneAD("ZoneAD_43");
ZoneAD_43.ZoneID      = 43;
ZoneAD_43.ZoneWidth   = 0;
ZoneAD_43.ZoneHeight  = 0;
ZoneAD_43.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 43;
objAD.ADType         = 4;
objAD.ADName         = "头部通栏广告";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table width=\"820\" height=\"6\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\">\n\r  <tr>\n\r    <td> </td>\n\r  </tr>\n\r</table>\n\r<table width=\"820\"  border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"#6A96B9\">\n\r  <FORM name=search action=http://www.cnshu.cn/search.asp method=get target=_blank>\n\r    <tr>\n\r      <td align=\"left\" bgcolor=\"#DEE8EF\">\n\r        <img src=\"http://www.cnshu.cn/2008_Images/xzss.gif\" align=\"absMiddle\" width=\"97\" height=\"23\">\n\r        <Input type=hidden value=Soft name=ModuleName>\n\r        <Input style=\"BORDER-RIGHT: #b3d6f4 1px solid; BORDER-TOP: #b3d6f4 1px solid; BORDER-LEFT: #b3d6f4 1px solid; WIDTH: 288px; BORDER-BOTTOM: #b3d6f4 1px solid; HEIGHT: 20px\" id=Keyword onfocus=\"this.value=\'\';\" maxLength=50 value=&nbsp; name=Keyword>\n\r        <Input id=Submit type=submit value=·搜索· name=Submit>\n\r      <Input id=Field type=hidden value=Title name=Field>\n\r      热门：<a href=\"http://www.cnshu.cn/pzgl/List_450.html\">QC</a> <a href=\"http://www.cnshu.cn/scgl/List_420.html\">5S</a> <a href=\"http://www.cnshu.cn/qygl/List_383.html\">执行力</a> <a href=\"http://www.cnshu.cn/topzd.html\" target=\"_blank\">制度表格</a> <a href=\"http://www.cnshu.cn/cwgl/List_453.html\" target=\"_blank\">财务制度</a></td>\n\r    </tr>\n\r  </FORM>\n\r</table>\n\r<table width=\"820\" height=\"6\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\">\n\r  <tr>\n\r    <td> </td>\n\r  </tr>\n\r</table>\n\r<table width=\"820\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n\r  <tr>\n\r    <td width=\"500\" height=\"90\"><a title href=\"http://www.cnshu.cn/zzzsoufei/vod.htm\" target=\"_blank\"><img src=\"http://www.cnshu.cn/AD/images/07-03_tonglan-50090.gif\" width=\"500\" height=\"90\" border=\"0\"></a></td>\n\r    <td width=\"320\"><a title href=\"http://www.cnshu.cn/zzzsoufei/pay.htm\" target=\"_blank\"><img src=\"http://www.cnshu.cn/AD/images/07-03_tonglan-32090.gif\" width=\"320\" height=\"90\" border=\"0\"></a></td>\n\r  </tr>\n\r</table> \n\r<table width=\"820\" height=\"6\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\">\n\r  <tr>\n\r    <td> </td>\n\r  </tr>\n\r</table>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.InstallDir     = "/";
objAD.ADDIR          = "agg";
ZoneAD_43.AddAD(objAD);

ZoneAD_43.Show();

