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           = 3;
objAD.ADType         = 4;
objAD.ADName         = "内容页顶部";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<TABLE cellSpacing=0 cellPadding=0 width=965 border=0>\n\r  <TBODY>\n\r  <TR>\n\r    <TD bgColor=#f5f5f5 height=25>\n\r      <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>\n\r        <TBODY>\n\r        <TR>\n\r          <TD width=\"2%\"> </TD>\n\r          <TD width=\"98%\">\n\r            <TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>\n\r              <TBODY>\n\r              <TR>\n\r                <TD width=\"49%\"><STRONG>八脚热点栏目</STRONG>>>　<IMG height=11 \n\r                  src=\"/images1/top7.gif\" width=13><A \n\r                  href=\"/Article/\" target=_top>精彩图摘</A>　<IMG \n\r                  height=11 src=\"/images1/top7.gif\" width=13><A \n\r                  href=\"/vod/\" target=_top>在线电影</A>　<IMG \n\r                  height=11 src=\"/images1/top7.gif\" width=13><A \n\r                  href=\"/joke/\" target=_top>幽默笑话</A>　<IMG \n\r                  height=11 src=\"/images1/top7.gif\" width=13><A \n\r                  href=\"/mm/\" target=_top>美女图片</A>　<IMG \n\r                  height=11 src=\"/images1/top7.gif\" width=13><A \n\r                  href=\"/tv.htm\" target=_top>在线电视</A></TD>\n\r                <TD align=middle width=\"34%\">\n\r                  <TABLE cellSpacing=0 cellPadding=0 width=\"90%\" border=0>\n\r                    <TBODY>\n\r                    <TR>\n\r                      <TD align=right width=160>八脚娱乐网<STRONG>→</STRONG></TD>\n\r                      <TD width=88>\n\r                        <DIV align=center><IMG height=9 src=\"/images1/top6.gif\" \n\r                        width=7><A style=\"CURSOR: hand\" \n\r                        onclick=\"var strHref=window.location.href;this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.6554.cn\');\" \n\r                        href=\"http://www.6554.cn/\" target=_top><FONT \n\r                        color=#ff0000>设为首页</FONT></A></DIV></TD>\n\r                      <TD width=72>\n\r                        <DIV align=center><IMG height=9 src=\"/images1/top6.gif\" \n\r                        width=7><A \n\r                        href=\"javascript:window.external.AddFavorite(\'http://www.6554.cn\',\'八脚娱乐网%20每天都要上喔！\');\" \n\r                        target=_self><FONT \n\r                    color=#ff0000>加入收藏</FONT></A></DIV></TD></TR></TBODY></TABLE></TD>\n\r                <TD align=middle width=\"17%\">八脚娱乐网\n\r          每天都要上喔！</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>\n\r  <TR>\n\r    <TD bgColor=#cccccc height=1><IMG height=1 alt=\"\" src=\"\" width=1 \n\r    name=\"\"></TD></TR></TBODY></TABLE>\n\r<TABLE cellSpacing=0 cellPadding=0 width=965 border=0>\n\r  <TBODY>\n\r  <TR>\n\r    <TD height=5><IMG height=1 src=\"/images1/0.gif\" \n\rwidth=1></TD></TR></TBODY></TABLE>\n\r<table width=\"965\" border=\"0\">\n\r  <tr>\n\r    <td>\n\r<script language=\"JavaScript\" type=\"text\/JavaScript\" src=\"http:\/\/code.qihoo.com\/ad_bcast\/news.js?a=2036&b=1003&p=2001&nt=&m=150861\"> <\/script> \n\r\n\r</td>\n\r  </tr>\n\r</table>\n\r";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.InstallDir     = "/";
objAD.ADDIR          = "AD";
ZoneAD_4.AddAD(objAD);

ZoneAD_4.Show();
