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_10 = new CodeZoneAD("ZoneAD_10");
ZoneAD_10.ZoneID      = 10;
ZoneAD_10.ZoneWidth   = 0;
ZoneAD_10.ZoneHeight  = 0;
ZoneAD_10.ShowType    = 2;

var objAD = new ObjectAD();
objAD.ADID           = 38;
objAD.ADType         = 4;
objAD.ADName         = "在线客服";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table style=\"WIDTH: 200px\" cellSpacing=0 cellPadding=0 width=200 border=0>\n\r    <tr borderColor=#ffffff width>\n\r      <td>\n\r        <table style=\"WIDTH: 180px; HEIGHT: 70px\" height=70 cellSpacing=0 cellPadding=0 width=180 align=center border=0>\n\r          <tr>\n\r            <td width=\"50%\"><A href=\"tencent://message/?uin=278237851&Site=中国电子制作&Menu=yes\" target=blank><IMG alt=QQ客服 src=\"http://wpa.qq.com/pa?p=1:278237851:10\" border=0></A></td>\n\r            <td> <A href=\"http://amos.im.alisoft.com/msg.aw?v=2&uid=%E4%B8%AD%E5%9B%BD%E7%94%B5%E5%AD%90%E5%88%B6%E4%BD%9C&site=cntaobao&s=1&charset=utf-8\" target=_blank><IMG style=\"FILTER: ; WIDTH: 63px; HEIGHT: 19px\" height=19 alt=旺旺客服 hspace=0 src=\"http://www.im.alisoft.com/actions/wbtx/tesetaobao/images/online.gif\" width=63 border=0></A></td>\n\r          </tr>\n\r          <tr>\n\r            <td colSpan=2>\n\r            <P align=center>电话：13561326848<A href=\"http://amos.im.alisoft.com/msg.aw?v=2&uid=shinyuan1&site=cntaobao&s=1&charset=utf-8\" target=_blank></A></P></td>\n\r          </tr>\n\r          <tr>\n\r            <td colSpan=2>\n\r            <P align=center><A title=\"\" href=\"http://shop60634652.taobao.com/\" target=_blank><B><FONT color=#ff0000>进入－淘宝网店</FONT></B></A><A href=\"http://amos.im.alisoft.com/msg.aw?v=2&uid=%E4%B8%AD%E5%9B%BD%E7%94%B5%E5%AD%90%E5%88%B6%E4%BD%9C&site=cntaobao&s=1&charset=utf-8\" target=_blank></A></P></td>\n\r          </tr>\n\r        </table>\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          = "AD";
ZoneAD_10.AddAD(objAD);

ZoneAD_10.Show();
