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_17 = new CodeZoneAD("ZoneAD_17");
ZoneAD_17.ZoneID      = 17;
ZoneAD_17.ZoneWidth   = 0;
ZoneAD_17.ZoneHeight  = 0;
ZoneAD_17.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 14;
objAD.ADType         = 4;
objAD.ADName         = "首页顶右侧260*60";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<script type=\"text/javascript\"> /*悬浮100*100，创建于2010-9-2*/ var cpro_id = \'u181430\';</script>\n\r<script type=\"text/javascript\" src=\"http://cpro.baidu.com/cpro/ui/f.js\"></script>\n\r\n\r\n\r\n\r<li><strong><font color=\"#FF0000\">①</font></strong><a href=\"http://www.dyjy1.cn/Soft/wlrj/201001/8.html\" target=_blank><FONT color=#0000FF>Vagaa哇嘎免费版下载</FONT></a> <a href=\"http://www.dyjy1.cn/Soft/xtgj/201001/12.html\" target=_blank><font color=\"#FF0000\">一键还原精灵下载</font></a></li>\n\r<li><strong><font color=\"#FF0000\">②</font></strong><a href=\"http://www.dyjy1.cn/Soft/youxi/201001/17.html\" target=_blank><font color=\"#9900FF\">QQ开心农场外挂下载</font></a> <a href=\"http://www.dyjy1.cn/Soft/youxi/201005/28.html\" target=_blank><FONT color=green>QQ牧场全能助手</FONT></a></li>\n\r<li><strong><font color=\"#FF0000\">③</font></strong><a href=\"http://www.dyjy1.cn/Soft/shaduanquan/200912/2.html\" target=_blank><FONT color=#CC9900>瑞星杀毒免费6个月</FONT></a> <a href=\"http://www.dyjy1.cn/Soft/shaduanquan/201003/22.html\" target=_blank><font color=\"#FF0099\">金山毒霸官方下载</font></a></li>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 1;
objAD.CountClick     = 0;
objAD.ADDIR          = "AD";
ZoneAD_17.AddAD(objAD);

ZoneAD_17.Show();
