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_4 = new CodeZoneAD("ZoneAD_4");
ZoneAD_4.ZoneID      = 4;
ZoneAD_4.ZoneWidth   = 0;
ZoneAD_4.ZoneHeight  = 0;
ZoneAD_4.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 1;
objAD.ADType         = 4;
objAD.ADName         = "网络收藏代码";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<script language=\"javascript\">\n\r   function copy2c(){\n\r    var clipBoardContent=\"\";\n\r    clipBoardContent+=document.title;\n\r    clipBoardContent+=this.location.href;\n\r    window.clipboardData.setData(\"Text\",clipBoardContent);\n\r    alert(\"复制成功喽!你现在可以粘贴到你的QQ/MSN上推荐给你的好友哦\");\n\r  }\n\r  </script>\n\r<table bgcolor=\"#FFFFFF\" width=\"720\" align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\r <tr>\n\r  <td align=\"center\">收藏到→<A title=\"收藏到自己电脑的收藏夹,方便以后观看哦\" href=\"javascript:window.external.addFavorite(window.location.href,document.title)\" \n\r><strong>我的电脑</strong></A>&nbsp;&nbsp;<a title=\"点击永久收藏到我的雅虎网络收藏夹\" href=\"javascript:window.open(\'http://myweb.cn.yahoo.com/popadd.html?url=\'+encodeURIComponent(document.location.href)\n\r+\'&title=\'+encodeURIComponent(document.title), \'Yahoo\',\'scrollbars=yes,width=780,height=550,left=80,top=80,status=yes,resizable=yes\');void(0)\"><img src=\"http://cn.yimg.com/i/fav/add2myweb.gif\" border=0>雅虎收藏</a><sup>+</sup>&nbsp;&nbsp; <a href=\"javascript:window.open(\'http://shuqian.qq.com/post?title=\'+encodeURIComponent(document.title)+\'&uri=\'+encodeURIComponent(document.location.href)+\'&jumpback=2&noui=1\',\'favit\',\'width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes\');void(0)\" title=\"点击永远收藏到我的QQ书签保存哦!\"><img alt=\"点击永远收藏到我的QQ书签保存哦\" src=\"http://shuqian.qq.com/img/add.gif\" width=\"16\" height=\"17\" border=\"0\"> QQ书签</a>&nbsp;&nbsp;<a href=\"javascript:u=location.href;t=document.title;c=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,480);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=js#nw=1%22;window.open(url,\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\');void 0\" title=\"点击把本页收藏到百度搜索收藏\"><img alt=\"点击把本页收藏到百度搜索收藏\" src=\"http://cang.baidu.com/-/remote/fav1.jpg\" width=\"13\" height=\"15\" border=\"0\">百度搜藏</a>&nbsp;<a href=\"javascript:copy2c()\"> <img alt=\"点击复制本网页的标题和网址和朋友分享\" src=\"images/tell.jpg\" border=\"0\"> </a> &nbsp;<a href=\"http://www.leshou.com/post\" onclick=\"window.open(\'http://www.leshou.com/post?act=shou&reuser=&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&intro=&tags=&tool=1\',\'leshou\',\'scrollbars=yes,width=700,height=500,left=80,top=80,status=no,resizable=yes\'); return false;\"><img src=\"/images/ubb/addtoleshou.jpg\" title=\"收藏此页到乐收\" border=\"0\" width=\"15px\" height=\"16px\" />收藏到乐收</a>&nbsp;  \n\r  </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          = "Anew";
ZoneAD_4.AddAD(objAD);

ZoneAD_4.Show();

