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    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 11;
objAD.ADType         = 4;
objAD.ADName         = "内容页-内容标题上面570广告";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table borderColor=#cccccc cellSpacing=0 cellPadding=3 width=\"100%\" bgColor=#f2f6fb border=0 heihgt=\"\">\n\r                      <tr>\n\r                        <td>\n\r                        <div align=center><A style=\"PADDING-RIGHT: 2px; DISPLAY: block; PADDING-LEFT: 20px; FONT-SIZE: 12px; BACKGROUND: url(http://shuqian.qq.com/img/add.gif) no-repeat 0px 0px; PADDING-BOTTOM: 0px; WIDTH: 116px; COLOR: #155da5; PADDING-TOP: 2px; HEIGHT: 23px; TEXT-DECORATION: none\" href=\"javascript:window.open(\'http://shuqian.qq.com/post?from=3&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)\">收藏到QQ书签</A></div></td>\n\r                        <td>\n\r                        <P align=center><A style=\"FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: none\" href=\"javascript:window.open(\'http://cang.baidu.com/do/add?it=\'+encodeURIComponent(document.title.substring(0,76))+\'&iu=\'+encodeURIComponent(location.href)+\'&fr=ien#nw=1\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\"><SPAN style=\"PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 10px; CURSOR: pointer; PADDING-TOP: 5px\"><IMG alt=添加到百度搜藏 src=\"http://cang.baidu.com/-/remote/fav1.jpg\" align=absMiddle border=0> 添加到百度搜藏</SPAN></A></P></td>\n\r                        <td>\n\r                        <P align=center><A onclick=\"window.open(\'http://myweb.cn.yahoo.com/popadd.html?url=\'+encodeURIComponent(document.location.href)+\'&title=\'+encodeURIComponent(document.title), \'Yahoo\',\'scrollbars=yes,width=780,height=550,left=80,top=80,status=yes,resizable=yes\');\" href=\"#\"><IMG src=\"http://cn.yimg.com/i/fav/add2myweb.gif\" border=0>添加到雅虎收藏</A><SUP>+</SUP></P></td>\n\r                        <td>\n\r                        <P align=center><A title=收藏的网页将被永久地保存到爱问ViVi收藏夹http://vivi.sina.com.cn href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(vivi=window.open(\'http://vivi.sina.com.cn/collect/icollect.php?pid=2008&title=\'+escape(d.title)+\'&url=\'+escape(d.location.href)+\'&desc=\'+escape(t),\'vivi\',\'scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes\'));vivi.focus();\"><IMG src=\"http://image2.sina.com.cn/pfp/iweb/vivi_coop.gif\" border=0></A></P></td>\n\r                        <td></td>\n\r                      </tr>\n\r                    </table><script type=\"text/javascript\"><!--\n\r  google_ad_client = \"pub-2329678248725865\";\n\r  google_ad_format = \"configurable_sdo\";\n\r  google_link_target = 1;\n\r  google_color_bg = \"f2f6fb\";\n\r  google_color_link = \"000000\";\n\r  google_color_text = \"000000\";\n\r  google_encoding = \"GB2312\";\n\r  google_ad_channel = \"8584319068\";\n\r  google_box_len = 31;\n\r  google_rs_pos = \"below\";\n\r  google_ad_height = 65;\n\r  google_ad_width = 500;\n\r//-->\n\r</script>\n\r<script type=\"text/javascript\"\n\r  src=\"http://pagead2.googlesyndication.com/pagead/show_sdo.js\">\n\r</script>\n\r";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 1;
objAD.CountClick     = 0;
objAD.ADDIR          = "AD";
ZoneAD_11.AddAD(objAD);

ZoneAD_11.Show();
