﻿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       = "";
  this.OverdueDate = "";
}

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) {
  var date = new Date();
  var getdate = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate();
  var today = new Date(getdate);
  var overdueDate = new Date(_AD.OverdueDate);
  if(today <= overdueDate)
  {
    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_29=new CodeZoneAD("ZoneAD_29");var objAD = new ObjectAD();
objAD.ADID= 29;objAD.ADType= 4;objAD.ADName= "分享按钮";objAD.ImgUrl= "";objAD.ImgWidth       = 0;objAD.ImgHeight      = 0;objAD.FlashWmode     = 0;objAD.ADIntro ="转发到：<a href=\"javascript:window.open(\'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=\'+encodeURIComponent(location.href)+\'&rcontent=\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\" style=\"color:#000000;text-decoration:none;font-size:12px;font-weight:normal\"><SPAN style=\"PADDING-RIGHT: 5px; PADDING-left: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 0px; CURSOR: pointer; PADDING-TOP: 5px\"><IMG alt=分享到QQ空间 src=\"http://www.icaidao.com/images/qqfavicon.ico\" align=absMiddle border=0>&nbsp;QQ空间</SPAN></a>\r\n<a href=\"javascript:window.open(\'http://v.t.sina.com.cn/share/share.php?title=\'+encodeURIComponent(document.title.substring(0,76))+\'&url=\'+encodeURIComponent(location.href)+\'&rcontent=\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\" style=\"color:#000000;text-decoration:none;font-size:12px;font-weight:normal\"><SPAN style=\"PADDING-RIGHT: 5px; PADDING-left: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 0px; CURSOR: pointer; PADDING-TOP: 5px\"><IMG alt=转发到新浪微博 src=\"http://www.icaidao.com/images/sinafavicon.ico\" align=absMiddle border=0>&nbsp;新浪微博</SPAN></a> <a href=\"javascript:window.open(\'http://www.kaixin001.com/repaste/share.php?rtitle=\'+encodeURIComponent(document.title.substring(0,76))+\'&rurl=\'+encodeURIComponent(location.href)+\'&rcontent=\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\" style=\"color:#000000;text-decoration:none;font-size:12px;font-weight:normal\"><SPAN style=\"PADDING-RIGHT: 5px; PADDING-left: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 0px; CURSOR: pointer; PADDING-TOP: 5px\"><IMG alt=转帖到开心网 src=\"http://www.icaidao.com/images/kaixinfavicon.ico\" align=absMiddle border=0>&nbsp;开心网</SPAN></a>\r\n<a href=\"javascript:window.open(\'http://share.renren.com/share/buttonshare.do?title=\'+encodeURIComponent(document.title.substring(0,76))+\'&link=\'+encodeURIComponent(location.href)+\'&content=\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\" style=\"color:#000000;text-decoration:none;font-size:12px;font-weight:normal\"><SPAN style=\"PADDING-RIGHT: 5px; PADDING-left: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 0px; CURSOR: pointer; PADDING-TOP: 5px\"><IMG alt=转帖到人人网 src=\"http://www.icaidao.com/images/favicon-rr.ico\" align=absMiddle border=0>&nbsp;人人网</SPAN></a>\r\n<a href=\"javascript:window.open(\'http://cang.baidu.com/do/add?it=\'+encodeURIComponent(document.title.substring(0,76))+\'&iu=\'+encodeURIComponent(location.href)+\'&rcontent=\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\" style=\"color:#000000;text-decoration:none;font-size:12px;font-weight:normal\"><SPAN style=\"PADDING-RIGHT: 5px; PADDING-left: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 0px; CURSOR: pointer; PADDING-TOP: 5px\"><IMG alt=转发到百度收藏 src=\"http://www.icaidao.com/images/baidufavicon.ico\" align=absMiddle border=0>&nbsp;百度收藏</SPAN></a> <a href=\"#\" onclick=\"window.open(\'http://myweb.cn.yahoo.com/popadd.html?url=\'+encodeURIComponent(document.location.href)+\'&title=\'+encodeURIComponent(document.title), \'Yahoo\',\'scrollbars=yes,width=440,height=440,left=80,top=80,status=yes,resizable=yes\');\"><img src=\"http://www.icaidao.com/images/add2myweb.gif\" border=0>雅虎收藏</a>";objAD.LinkUrl        = "";objAD.LinkTarget     = 0;objAD.LinkAlt        = "";objAD.Priority       = 5;objAD.CountView      = false;objAD.CountClick     = false;objAD.OverdueDate    = "2017/07/03";objAD.InstallDir     = "/";objAD.ADDIR= "IAA";ZoneAD_29.AddAD(objAD);ZoneAD_29.ZoneID=29;ZoneAD_29.ZoneWidth=468;ZoneAD_29.ZoneHeight=60;ZoneAD_29.ShowType=1;ZoneAD_29.Show();
