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_24 = new CodeZoneAD("ZoneAD_24");
ZoneAD_24.ZoneID      = 24;
ZoneAD_24.ZoneWidth   = 0;
ZoneAD_24.ZoneHeight  = 0;
ZoneAD_24.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 20;
objAD.ADType         = 4;
objAD.ADName         = "测试";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<DIV id=headerRdh>\n\r<!-- cms17173:chipTag 首页顶上菜单 begin --><DIV class=\"dhlist colOne\">\n\r<H3><A title=新闻中心 href=\"http://www.zheyits.com/news\" target=_blank></A></H3>\n\r<UL>\n\r<LI><A href=\"http://www.zheyits.com/news/gnwyzx/Index.html\" target=_blank>新网游</A> \n\r<LI><A href=\"http://www.zheyits.com/news/xypc/\" target=_blank>测评</A> \n\r<LI><A href=\"http://www.zheyits.com/news/dianj/\" target=_blank>竞技</A> \n\r<LI><A href=\"http://www.zheyits.com/pcgame/\" target=_blank>找单游</A> \n\r<LI><A href=\"http://www.zheyits.com/news/gnyjzx/\" target=_blank>国内</A> \n\r<LI><A href=\"http://www.zheyits.com/news/gwyjzx/\" target=_blank>国外</A></LI></UL></DIV>\n\r<DIV class=\"dhlist colTwo\">\n\r<H3><A title=找游戏 href=\"http://www.zheyits.com/zhao\" target=_blank></A></H3>\n\r<UL>\n\r<LI><A href=\"http://www.zheyits.com/zhao/wlyx/\" target=_blank>网游游戏</A> \n\r<LI><A href=\"http://www.zheyits.com/news/xypc\" target=_blank>截图</A> \n\r<LI><A href=\"http://www.zheyits.com/zhao/djyx/\" target=_blank>单机游戏</A> \n\r<LI><A href=\"http://www.zheyits.com/news/wysp/\" target=_blank>视频</A></LI></UL></DIV>\n\r<DIV class=\"dhlist colThree\">\n\r<H3><A title=游戏下载 href=\"http://www.zheyits.com/down\" target=_blank></H3>\n\r<UL>\n\r<LI><A href=\"http://www.zheyits.com/down/wlyxkhd/Index.html\" target=_blank>网络游戏</A> \n\r<LI><A href=\"http://www.zheyits.com/down/djyxxz/Index.html\" target=_blank>单机游戏</A> \n\r<LI><A href=\"http://www.zheyits.com/down/wlyxbd/Index.html\" target=_blank>网游补丁</A> \n\r<LI><A href=\"http://www.zheyits.com/down/yxfzrj/Index.html\" target=_blank>辅助软件</A> </LI></UL></DIV>\n\r<DIV class=\"dhlist colFour\">\n\r<H3><A title=互动社区 href=\"http://www.zheyits.com/bbs\" target=_blank></A></H3>\n\r<UL>\n\r<LI><A href=\"http://www.zheyits.com/bbs/forumdisplay.php?fid=32\" target=_blank>招募</A> \n\r<LI><A href=\"http://www.zheyits.com/bbs/forumdisplay.php?fid=2\" target=_blank>公告</A> \n\r<LI><A href=\"http://www.zheyits.com/bbs/forumdisplay.php?fid=3\" target=_blank>报道</A> \n\r<LI><A href=\"http://www.zheyits.com/bbs/forumdisplay.php?fid=4\" target=_blank>拜访</A> \n\r<LI><A href=\"http://www.zheyits.com/bbs/index.php?gid=5\" target=_blank>进驻</A> </LI></UL></DIV>\n\r<DIV class=\"dhlist colFive\">\n\r<H3><A title=会员中心 href=\"http://www.zheyits.com\" target=_blank></A></H3>\n\r<UL>\n\r<LI><A href=\"http://www.zheyits.com/bbs/plugin.php?id=qqfarm:qqfarm\" target=_blank>农场</A> \n\r<LI><A href=\"http://www.zheyits.com/bbs/2fly_gift.php\" target=_blank>发号中心 </A>\n\r<LI><A href=\"http://www.zheyits.com/bbs/plugin.php?id=dps_sign:sign\" target=_blank>签到</A> \n\r<LI><A href=\"http://www.zheyits.com/sky\" target=_blank>天空</A> \n\r</UL></DIV>\n\r<DIV class=clear></DIV><!-- cms17173:chipTag 首页顶上菜单 end --></DIV>\n\r<DIV class=clear></DIV></DIV>\n\r<DIV class=clear></DIV></DIV>\n\r<DIV class=clear></DIV></DIV>\n\r<SCRIPT src=\"http://www.zheyits.com/news/sy_background.js\" type=text/javascript></SCRIPT>\n\r<DIV class=banner960602><!-- cms17173:chipTag 首页第一屏banner begin -->";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.ADDIR          = "AD";
ZoneAD_24.AddAD(objAD);

ZoneAD_24.Show();

