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           = 4;
objAD.ADType         = 4;
objAD.ADName         = "网页尾";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<style type=\"text/css\">\n\r<!--\n\r.STYLE1 {color: #FFFFFF}\n\r-->\n\r</style>\n\r<table cellSpacing=0 cellPadding=0 width=910 align=center border=0 style=\"margin-top:5px\">\n\r    <tr>\n\r      <td height=\"31\" colspan=\"2\" background=\"/images/index3_09.gif\"><div align=\"center\"><A href=\"/zidingyi/guanyu.html\">关于我们</A> | <A href=\"/zidingyi/pinzhi.html\">品质保证</A> | <A href=\"/zidingyi/lianxi.html\">联系我们</A> | <A href=\"/zidingyi/baoming.html\">报名参团</A> | <A href=\"/zidingyi/zhifu.html\">支付方式</A> | <A href=\"/FriendSite/Index.asp\">友情链接</A> | <A href=\"/zidingyi/map.html\">网站地图</A> | <A href=\"/zidingyi/banquan.html\">版权声名</A></div></td>\n\r    </tr>\n\r    <tr>\n\r      <td width=170 height=\"40\" background=\"/images/B_logo.jpg\"><img src=\"/B_logo.jpg\" width=\"207\" height=\"112\"></td>\n\r      <td width=\"737\" height=40 vAlign=top><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"line-height:22px;\">\n\r        <tr>\n\r          <td width=\"316\">【网站名称】昆明康辉旅行社有限公司</td>\n\r          <td width=\"387\">【网站地址】<a href=\"http://www.okcct.com\">www.okcct.com</a></td>\n\r        </tr>\n\r        <tr>\n\r          <td>【联系电话】0871-3551655 3551755 <br /></td>\n\r          <td>【网站备案】<a href=\"http://www.miibeian.gov.cn\" target=\"_blank\">滇ICP备08100067号</a></td>\n\r        </tr>\n\r        <tr>\n\r          <td>【负 责 人】周 军 13888748881</td>\n\r          <td>【开 户 行】交通银行昆明分行拓东路支行</td>\n\r        </tr>\n\r		<tr>\n\r          <td>【联 系 人】贺先生 13888832978</td>\n\r          <td>【 户  名 】昆明康辉旅行社有限公司</td>\n\r        </tr>\n\r		<tr>\n\r          <td>【业务传真】0871-3551655</td>\n\r          <td>【公司帐号】5310 7804 5018 16000 4658</td>\n\r        </tr>\n\r		\n\r        <tr>\n\r          <td>【工作QQ 】<A href=\"tencent://message/?uin=515589756&Site=www.okcct.com&Menu=yes\" target=blank>515589756</A> <A href=\"tencent://message/?uin=515589756&Site=www.okcct.com&Menu=yes\" target=blank>645700719</A></td>\n\r          <td>【联系地址】昆明市永安路1号康辉烟草楼</td>\n\r        </tr>\n\r      </table></td>\n\r    </tr>\n\r    \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();
