﻿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_71=new CodeZoneAD("ZoneAD_71");var objAD = new ObjectAD();
objAD.ADID= 99;objAD.ADType= 4;objAD.ADName= "首页新增滚动文字广告";objAD.ImgUrl= "";objAD.ImgWidth       = 0;objAD.ImgHeight      = 0;objAD.FlashWmode     = 0;objAD.ADIntro ="<SCRIPT type=text/javascript>\r\n				<!--\r\n				var rollText_k=6; //菜单总数\r\n				var rollText_i=1; //菜单默认值\r\n				//setFocus1(0);\r\n				rollText_tt=setInterval(\"rollText(1)\",4000);\r\n				function rollText(a){\r\n				clearInterval(rollText_tt);\r\n				rollText_tt=setInterval(\"rollText(1)\",4000);\r\n				rollText_i+=a;\r\n				if (rollText_i>rollText_k){rollText_i=1;}\r\n				if (rollText_i==0){rollText_i=rollText_k;}\r\n				//alert(i)\r\n				 for (var j=1; j<=rollText_k; j++){\r\n				 document.getElementById(\"rollTextMenu\"+j).style.display=\"none\";\r\n				 }\r\n				 document.getElementById(\"rollTextMenu\"+rollText_i).style.display=\"block\";\r\n				 document.getElementById(\"pageShow\").innerHTML = rollText_i+\"/\"+rollText_k;\r\n				} \r\n				//-->\r\n</SCRIPT>\r\n<table width=\"285\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr>\r\n    <td height=\"20\" align=\"right\" valign=\"middle\" background=\"/Skin/Default/Images/new/bg_hot.gif\"><table width=\"235\" cellspacing=\"0\" cellpadding=\"0\">\r\n      <tr>\r\n        <td width=\"174\" height=\"20\" align=\"center\"><DIV class=rollTextMenus>\r\n      <DIV id=rollTextMenu1 style=\"DISPLAY: block\"><A style=\"color:#FF0000; text-decoration:none;\"\r\n      href=\"http://www.dg16.com/2009/12/36486.html\" target=\"_blank\">我院获全国最受欢迎男科医院</A></DIV>\r\n      <DIV id=rollTextMenu2 style=\"DISPLAY: none\"><A style=\"color:#FF0000; text-decoration:none;\"\r\n      href=\"http://www.dg16.com/2010/03/39395.html\" target=\"_blank\">\"珍爱生命 关爱女性\"二期</A></DIV>\r\n      <DIV id=rollTextMenu3 style=\"DISPLAY: none\"><A style=\"color:#FF0000; text-decoration:none;\"\r\n      href=\"http://www.dg16.com/2010/03/38974.html\" target=\"_blank\">高埗镇妇联向我院赠送锦旗</A></DIV>\r\n      <DIV id=rollTextMenu4 style=\"DISPLAY: none\"><A style=\"color:#FF0000; text-decoration:none;\"\r\n      href=\"http://120ka.zoossoft.com/LR/Chatpre.aspx?id=LDF31671888&lng=cn\" target=\"_blank\">微创介入大汗腺清除术治腋臭</A></DIV>\r\n      <DIV id=rollTextMenu5 style=\"DISPLAY: none\"><A style=\"color:#FF0000; text-decoration:none;\"\r\n      href=\"http://www.dg16.com/2009/07/17723.html\" target=\"_blank\">第三代美式包皮美容手术</A></DIV>\r\n      <DIV id=rollTextMenu6 style=\"DISPLAY: none\"><A style=\"color:#FF0000; text-decoration:none;\"\r\n      href=\"http://www.sun0769.com/subject/2010/2ai/\" target=\"_blank\">防治\"两癌\" 让女人花健康绽放</A></DIV></DIV></td>\r\n        <td width=\"29\" align=\"center\" id=pageShow>1/6</td>\r\n        <td width=\"32\" align=\"center\" valign=\"middle\"><A title=上一条 href=\"javascript:rollText(-1);\"><IMG src=\"/Skin/Default/Images/new/last.gif\" \r\n      alt=上一条 width=\"11\" height=\"11\" border=\"0\"></A> <A title=下一条 href=\"javascript:rollText(1);\"><IMG src=\"/Skin/Default/Images/new/next.gif\" \r\n      alt=下一条 width=\"11\" height=\"11\" border=\"0\"></A></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n</table>";objAD.LinkUrl        = "";objAD.LinkTarget     = 0;objAD.LinkAlt        = "";objAD.Priority       = 1;objAD.CountView      = false;objAD.CountClick     = false;objAD.OverdueDate    = "2010/10/03";objAD.InstallDir     = "/";objAD.ADDIR= "IAA";ZoneAD_71.AddAD(objAD);ZoneAD_71.ZoneID=71;ZoneAD_71.ZoneWidth=468;ZoneAD_71.ZoneHeight=60;ZoneAD_71.ShowType=1;ZoneAD_71.Show();