﻿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_63=new CodeZoneAD("ZoneAD_63");var objAD = new ObjectAD();
objAD.ADID= 89;objAD.ADType= 4;objAD.ADName= "妇联合作公益活动";objAD.ImgUrl= "";objAD.ImgWidth       = 0;objAD.ImgHeight      = 0;objAD.FlashWmode     = 0;objAD.ADIntro ="<script type=\"text/javascript\">\r\nvar pic_width=320; //图片宽度288\r\nvar pic_height=248; //图片高度\r\nvar button_pos=1; //按扭位置 1左 2右 3上 4下\r\nvar stop_time=5000; //图片停留时间(1000为1秒钟)\r\nvar show_text=0; //是否显示文字标签 1显示 0不显示\r\nvar txtcolor=\"000000\"; //文字色\r\nvar bgcolor=\"f4f3f4\"; //背景色\r\nvar imag=new Array();\r\nvar link=new Array();\r\nvar text=new Array();\r\nimag[1] =\"/Skin/Default/Images/flhzhd/flash_ad10.jpg\";\r\nlink[1] =\"http://www.dg16.com/2010/03/39395.html\";\r\ntext[1] =\"#\";\r\n imag[2] =\"/Skin/Default/Images/flhzhd/flash_ad9.jpg\";\r\nlink[2] =\"#\";\r\ntext[2] =\"#\";\r\nimag[3] =\"/Skin/Default/Images/flhzhd/flash_ad8.jpg\";\r\nlink[3] =\"http://www.dg16.com/2009/10/20143.html\";\r\ntext[3] =\"#\";\r\nimag[4] =\"/Skin/Default/Images/flhzhd/flash_ad1.jpg\";\r\nlink[4] =\"#\";\r\ntext[4] =\"#\";\r\nimag[5] =\"/Skin/Default/Images/flhzhd/flash_ad2.jpg\";\r\nlink[5] =\"#\";\r\ntext[5] =\"#\";\r\nimag[6] =\"/Skin/Default/Images/flhzhd/flash_ad3.jpg\";\r\nlink[6] =\"#\";\r\ntext[6] =\"#\";\r\nimag[7] =\"/Skin/Default/Images/flhzhd/flash_ad4.jpg\";\r\nlink[7] =\"#\";\r\ntext[7] =\"#\";\r\nimag[8] =\"/Skin/Default/Images/flhzhd/flash_ad5.jpg\";\r\nlink[8] =\"#\";\r\ntext[8] =\"#\";\r\nimag[9] =\"/Skin/Default/Images/flhzhd/flash_ad6.jpg\";\r\nlink[9] =\"#\";\r\ntext[9] =\"#\";\r\nimag[10] =\"/Skin/Default/Images/flhzhd/flash_ad7.jpg\";\r\nlink[10] =\"#\";\r\ntext[10] =\"#\";\r\n\r\n//可编辑内容结束\r\nvar swf_height=show_text==1?pic_height+20:pic_height;\r\nvar pics=\"\", links=\"\", texts=\"\";\r\nfor(var i=1; i<imag.length; i++){\r\n	pics=pics+(\"|\"+imag[i]);\r\n	links=links+(\"|\"+link[i]);\r\n	texts=texts+(\"|\"+text[i]);\r\n}\r\npics=pics.substring(1);\r\nlinks=links.substring(1);\r\ntexts=texts.substring(1);\r\ndocument.write(\'<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0\" width=\"\'+ pic_width +\'\" height=\"\'+ swf_height +\'\">\');\r\ndocument.write(\'<param name=\"movie\" value=\"/Skin/Default/Images/focus.swf\">\');\r\ndocument.write(\'<param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"opaque\">\');\r\ndocument.write(\'<param name=\"FlashVars\" value=\"pics=\'+pics+\'&links=\'+links+\'&texts=\'+texts+\'&pic_width=\'+pic_width+\'&pic_height=\'+pic_height+\'&show_text=\'+show_text+\'&txtcolor=\'+txtcolor+\'&bgcolor=\'+bgcolor+\'&button_pos=\'+button_pos+\'&stop_time=\'+stop_time+\'\">\');\r\ndocument.write(\'<embed src=\"/Skin/Default/Images/focus.swf\" FlashVars=\"pics=\'+pics+\'&links=\'+links+\'&texts=\'+texts+\'&pic_width=\'+pic_width+\'&pic_height=\'+pic_height+\'&show_text=\'+show_text+\'&txtcolor=\'+txtcolor+\'&bgcolor=\'+bgcolor+\'&button_pos=\'+button_pos+\'&stop_time=\'+stop_time+\'\" quality=\"high\" width=\"\'+ pic_width +\'\" height=\"\'+ swf_height +\'\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\');\r\ndocument.write(\'</object>\');\r\n</script>";objAD.LinkUrl        = "";objAD.LinkTarget     = 0;objAD.LinkAlt        = "";objAD.Priority       = 1;objAD.CountView      = false;objAD.CountClick     = false;objAD.OverdueDate    = "2010/09/18";objAD.InstallDir     = "/";objAD.ADDIR= "IAA";ZoneAD_63.AddAD(objAD);ZoneAD_63.ZoneID=63;ZoneAD_63.ZoneWidth=468;ZoneAD_63.ZoneHeight=60;ZoneAD_63.ShowType=1;ZoneAD_63.Show();