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_11 = new CodeZoneAD("ZoneAD_11");
ZoneAD_11.ZoneID      = 11;
ZoneAD_11.ZoneWidth   = 0;
ZoneAD_11.ZoneHeight  = 0;
ZoneAD_11.ShowType    = 2;

var objAD = new ObjectAD();
objAD.ADID           = 11;
objAD.ADType         = 4;
objAD.ADName         = "站内广告";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table width=670>\n\r<tr><td align=left width=480 height=30 valign=bottom>&nbsp;\n\r<a href=\"/Shop/ShowNew.asp\" target=_blank><u><font color=blue>购买游戏脚本/注册码</font></u></a> &nbsp;\n\r<a href=\"/User/User_Order.asp\" target=_blank><u><font color=green>查看我的订单</font></u></a>&nbsp;&nbsp;\n\r<a href=\"/User/User_Exchange.asp?Action=GetCard\"><u>查询注册码</u></a>   &nbsp;\n\r<a href=\"/Shop/Special/mzpykt/Index.html\" target=_blank><u>购买麦点充值卡</u></a></td>\n\r<td width=188 height=30 align=left valign=bottom><font size=3>有问题请看</font>→ <a href=\"/bangzhu.html\" target=_blank><img src=/images/bangzhu.gif alt=\"有不懂，看帮助！\" border=0 valign=bottom></a></td></tr>\n\r\n\r<tr><td></td> </tr>\n\r\n\r<tr><td height=28 align=left valign=bottom colspan=\"2\"><b><font color=#393939>[游戏攻略]</font></b> \n\r<a href=/Article/wangyou/xy2/Index.html target=_blank><font color=#26305a>大话西游Ⅱ</font></a> |\n\r<a href=/Article/wangyou/xyq/Index.html target=_blank><font color=#26305a>梦幻西游</font></a> |\n\r<a href=/Article/wangyou/tx2/Index.html target=_blank><font color=#26305a>天下贰</font></a> | \n\r<a href=/Article/wangyou/mhzx/Index.html target=_blank><font color=#26305a>梦幻诛仙</font></a> | \n\r<a href=/Article/danji/jinyong/Index.html target=_blank><font color=#26305a>金庸群侠传</font></a> |\n\r<a href=/Article/Index.html target=_blank><font color=#26305a>更多...</font></a>   &nbsp;&nbsp;&nbsp;\n\r<font color=red>本站唯一客服QQ：10657147</font></td></tr>\n\r </table>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 11;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.ADDIR          = "zanzhu";
ZoneAD_11.AddAD(objAD);

ZoneAD_11.Show();
