﻿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_6=new CodeZoneAD("ZoneAD_6");var objAD = new ObjectAD();
objAD.ADID= 6;objAD.ADType= 4;objAD.ADName= "导航";objAD.ImgUrl= "";objAD.ImgWidth       = 0;objAD.ImgHeight      = 0;objAD.FlashWmode     = 0;objAD.ADIntro ="<b>装修设计：</b>\r\n<a href=\"http://www.yjba.com/Category_12/Index.aspx\" target=_blank title=\"家装锦囊\">家装锦囊</a>\r\n<a href=\"http://www.yjba.com/Category_61/Index.aspx\" target=_blank title=\"格局结构详解\">格局结构详解</a> \r\n<a href=\"http://www.yjba.com/Category_62/Index.aspx\" target=_blank title=\"装修前期准备\">装修前期准备</a> \r\n<a href=\"http://www.yjba.com/Category_63/Index.aspx\" target=_blank title=\"装修期间注意\">装修期间注意</a> \r\n<a href=\"http://www.yjba.com/Category_64/Index.aspx\" target=_blank title=\"装修完毕验收\">装修完毕验收</a> \r\n<a href=\"http://www.yjba.com/Category_65/Index.aspx\" target=_blank title=\"装修经验分享\">装修经验分享</a> <b>效果图：</b>\r\n<a href=\"http://www.yjba.com/Category_19/Index.aspx\" target=_blank title=\"客厅效果图\">客厅效果图</a> \r\n<a href=\"http://www.yjba.com/Category_20/Index.aspx\" target=_blank title=\"卧室效果图\">卧室效果图</a> \r\n<a href=\"http://www.yjba.com/Category_21/Index.aspx\" target=_blank title=\"厨房效果图\">厨房效果图</a> \r\n<a href=\"http://www.yjba.com/Category_22/Index.aspx\" target=_blank title=\"卫浴效果图\">卫浴效果图</a> \r\n<a href=\"http://www.yjba.com/Category_23/Index.aspx\" target=_blank title=\"书房效果图\">书房效果图</a> \r\n<a href=\"http://www.yjba.com/Category_25/Index.aspx\" target=_blank title=\"玄关效果图\">玄关效果图</a> \r\n<a href=\"http://www.yjba.com/Category_40/Index.aspx\" target=_blank title=\"餐厅效果图\">餐厅效果图</a> <b>按风格分：</b>\r\n<a href=\"http://www.yjba.com/Category_32/Index.aspx\" target=_blank title=\"现代简约\">现代简约</a> \r\n<a href=\"http://www.yjba.com/Category_42/Index.aspx\" target=_blank title=\"温馨浪漫\">温馨浪漫</a> \r\n<a href=\"http://www.yjba.com/Category_37/Index.aspx\" target=_blank title=\"田园风格\">田园风格</a> \r\n<a href=\"http://www.yjba.com/Category_39/Index.aspx\" target=_blank title=\"混搭风格\">混搭风格</a> \r\n<a href=\"http://www.yjba.com/Category_36/Index.aspx\" target=_blank title=\"中国传统\">中式传统</a> \r\n<a href=\"http://www.yjba.com/Category_35/Index.aspx\" target=_blank title=\"日韩风格\">日韩风格</a> \r\n<a href=\"http://www.yjba.com/Category_38/Index.aspx\" target=_blank title=\"美式风格\">美式风格</a> \r\n<a href=\"http://www.yjba.com/Category_33/Index.aspx\" target=_blank title=\"欧式风格\">欧式风格</a> \r\n<a href=\"http://www.yjba.com/Category_34/Index.aspx\" target=_blank title=\"西洋古典\">西洋古典</a> \r\n<a href=\"http://www.yjba.com/Category_43/Index.aspx\" target=_blank title=\"地中海风格\">地中海风格</a> <b>按功能分：</b>\r\n<a href=\"http://www.yjba.com/Category_131/Index.aspx\" target=_blank title=\"客厅\">客厅</a> \r\n<a href=\"http://www.yjba.com/Category_132/Index.aspx\" target=_blank title=\"卧室\">卧室</a> \r\n<a href=\"http://www.yjba.com/Category_133/Index.aspx\" target=_blank title=\"厨房\">厨房</a> \r\n<a href=\"http://www.yjba.com/Category_134/Index.aspx\" target=_blank title=\"书房\">书房</a> \r\n<a href=\"http://www.yjba.com/Category_135/Index.aspx\" target=_blank title=\"餐厅\">餐厅</a>  \r\n<a href=\"http://www.yjba.com/Category_136/Index.aspx\" target=_blank title=\"卫浴\">卫浴</a>";objAD.LinkUrl        = "";objAD.LinkTarget     = 0;objAD.LinkAlt        = "";objAD.Priority       = 1;objAD.CountView      = false;objAD.CountClick     = false;objAD.OverdueDate    = "2019/05/29";objAD.InstallDir     = "/";objAD.ADDIR= "IAA";ZoneAD_6.AddAD(objAD);ZoneAD_6.ZoneID=6;ZoneAD_6.ZoneWidth=468;ZoneAD_6.ZoneHeight=60;ZoneAD_6.ShowType=1;ZoneAD_6.Show();