﻿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_1=new CodeZoneAD("ZoneAD_1");var objAD = new ObjectAD();
objAD.ADID= 1;objAD.ADType= 4;objAD.ADName= "视频广告";objAD.ImgUrl= "";objAD.ImgWidth       = 0;objAD.ImgHeight      = 0;objAD.FlashWmode     = 0;objAD.ADIntro ="<form name=\"ShowDownloadUrl\" method=\"post\" action=\"ShowDownloadUrl.aspx?urlid=0&amp;id=7\" onsubmit=\"javascript:return WebForm_OnSubmit();\" id=\"ShowDownloadUrl\">\r\n<input type=\"hidden\" name=\"__REFRESH_FIELD\" id=\"__REFRESH_FIELD\" value=\"\" />\r\n<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"/wEPBYwCZU5wTmpzMnF3akFVaEdudmRhRWczYm1VY1BZMkxmVVBzYjZCZ3VEQ2JVeWlDYlpOYkU2dDlkMThOcTMzSWppTFdYeDhNUFAwZ2s1M2tzVHplQnhGVVNBR3Z2L3oxMTR3OEllL08zbkR6c1ByOThoWGxqSS9TRUZjeVZOUWlIWkJxYzFZSTh1d01kVzVDcm5KUDhBcVM1MFdkTC9lOFhoejU4bm12cTNwTlhUMUVRZzJWcWJBck0wMFo2aE5RVzhqcHd3LzErd3FSOGVNT1FXa3pvMW9MU3haNFN3clpZRkFMaFhMTkRidHVqNjlGUzFRcFRDZUpVQ1ViQkdta0V6bnNQcS9MVjV3NlVSMGTvkky7jgFjDsZfHaTb4Na9MBdwqQ==\" />\r\n<script src=\"/WebResource.axd?d=9UON-BDLe6rHuaO6PmIjMIWXl8r4Sx2v2ldt5XIxrydCRL1zx8wHgH1jPFdmVl_-5i-xkew8zi39upLTXUMizvXwOZgN2GcBgYRVuSY28tHFethgFGgaDa8pBclmQBKc0&amp;t=634061842597817264\" type=\"text/javascript\"></script>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\nfunction WebForm_OnSubmit() {\r\nrefreshModule.createPageIdentifier();\r\nreturn true;\r\n}\r\n//]]>\r\n</script>    \r\n            <embed src=\"http://player.youku.com/player.php/sid/XMTkwNTQ4Njcy/v.swf\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" quality=\"high\" width=\"217\" height=\"216\">\r\n    </form>";objAD.LinkUrl        = "";objAD.LinkTarget     = 0;objAD.LinkAlt        = "";objAD.Priority       = 1;objAD.CountView      = false;objAD.CountClick     = false;objAD.OverdueDate    = "2019/06/26";objAD.InstallDir     = "/";objAD.ADDIR= "IAA";ZoneAD_1.AddAD(objAD);ZoneAD_1.ZoneID=1;ZoneAD_1.ZoneWidth=468;ZoneAD_1.ZoneHeight=60;ZoneAD_1.ShowType=1;ZoneAD_1.Show();
