﻿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_32=new CodeZoneAD("ZoneAD_32");var objAD = new ObjectAD();
objAD.ADID= 45;objAD.ADType= 4;objAD.ADName= "首页顶部导航";objAD.ImgUrl= "";objAD.ImgWidth       = 0;objAD.ImgHeight      = 0;objAD.FlashWmode     = 0;objAD.ADIntro ="<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>\r\n<TBODY>\r\n<TR>\r\n<TD width=\"20%\" height=16><STRONG>在线免费算命导航</STRONG></TD>\r\n<TD><A href=\"http://pp.41888.com/chouqian/zgjm.asp\" target=_blank>周公解梦</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sm/sm.asp?sm=1\" target=_blank>生辰八字</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sm/sm.asp?sm=6\" target=_blank>姓名配对</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sm/sm.asp?sm=5\" target=_blank>姓名测试</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sm/sm.asp?sm=2\" target=_blank>八字算命</A></TD>\r\n<TD><A href=\"http://pp.41888.com/astro/xzyc.asp?type=yearlove\" \r\ntarget=_blank>爱情运势</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sm/sm.asp?sm=3\" \r\ntarget=_blank>日干算命</A></TD></TR>\r\n<TR>\r\n<TD height=17><A href=\"http://pp.41888.com/astro/xzyc.asp?type=today\" \r\ntarget=_blank>今日运程</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sfz/index.asp\" target=_blank>身份证号</A></TD>\r\n<TD><A href=\"http://pp.41888.com/qinglv/index.asp\" target=_blank>情侣速配</A></TD>\r\n<TD><A href=\"http://pp.41888.com/sm/sm.asp?sm=4\" target=_blank>称骨算命</A></TD>\r\n<TD><A href=\"http://pp.41888.com/yuce/sanshishu.asp\" target=_blank>三世财运</A></TD>\r\n<TD><A href=\"http://pp.41888.com/yuce/snsn.asp\" target=_blank>生男生女</A></TD>\r\n<TD><A href=\"http://pp.41888.com/yuce/hdjr.asp?act=xrz&amp;word=嫁娶&amp;upto=365\" \r\ntarget=_blank>结婚吉日</A></TD>\r\n<TD><A href=\"http://pp.41888.com/qinglv/pd_sxxx.asp\" \r\ntarget=_blank>生肖算命</A></TD></TR>\r\n<TR>\r\n<TD height=17><A href=\"http://pp.41888.com/yuce/hdjr.asp\" \r\ntarget=_blank>择日黄历</A></TD>\r\n<TD><A href=\"http://pp.41888.com/hunpei/index.asp\" target=_blank>婚姻指数</A></TD>\r\n<TD><A href=\"http://www.41888.com/sm/EQ/EQ1.html\" target=_blank>ＩＱ测试</A></TD>\r\n<TD><A href=\"http://www.41888.com/sm/EQ/EQ1.html\" target=_blank>ＥＱ测试</A></TD>\r\n<TD><A href=\"http://pp.41888.com/qinglv/pd_qq.asp\" target=_blank>QQ号算命</A></TD>\r\n<TD><A href=\"http://pp.41888.com/chouqian/index.asp\" target=_blank>抽签占卜</A></TD>\r\n<TD><A href=\"http://pp.41888.com/qinglv/pd_astro.asp\" target=_blank>星座配对</A> \r\n</TD>\r\n<TD><A href=\"http://www.41888.com/Soft/index.html\" \r\ntarget=_blank>易学导航</A></TD></TR></TBODY></TABLE>";objAD.LinkUrl        = "";objAD.LinkTarget     = 0;objAD.LinkAlt        = "";objAD.Priority       = 1;objAD.CountView      = true;objAD.CountClick     = false;objAD.OverdueDate    = "2019/08/23";objAD.InstallDir     ="http://www.41888.com/";objAD.ADDIR= "IAA";ZoneAD_32.AddAD(objAD);ZoneAD_32.ZoneID=32;ZoneAD_32.ZoneWidth=468;ZoneAD_32.ZoneHeight=60;ZoneAD_32.ShowType=1;ZoneAD_32.Show();