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       = "";
}

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) {
  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");
ZoneAD_1.ZoneID      = 1;
ZoneAD_1.ZoneWidth   = 950;
ZoneAD_1.ZoneHeight  = 60;
ZoneAD_1.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 1;
objAD.ADType         = 4;
objAD.ADName         = "百度960";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table width=\"950\" border=\"0\">\n\r  <tr>\n\r    <td><p class=\"STYLE6 style1\"><a href=\"http://www.ygedu.net/daohangye/shuxue71.html\">七年级数学上 </a><a href=\"http://www.ygedu.net/daohangye/shuxue72.html\">七年级数学下 </a><a href=\"http://www.ygedu.net/daohangye/shuxue81.html\">八年级数学上 </a> <a href=\"http://www.ygedu.net/daohangye/shuxue82.html\">八年级数学下 </a> <a href=\"http://www.ygedu.net/daohangye/shuxue91.html\">九年级数学上</a> <a href=\"http://www.ygedu.net/daohangye/shuxue92.html\">九年级数学下</a> <a href=\"http://www.ygedu.net/daohangye/wuli81.html\">八年级物理上</a> <a href=\"http://www.ygedu.net/daohangye/wuli82.html\">八年级物理下</a><a href=\"http://www.ygedu.net/daohangye/wuli91.html\">\n\r  九年级物理上</a><a href=\"http://www.ygedu.net/daohangye/wuli92.html\"> 九年级物理下</a> <a href=\"http://www.ygedu.net/daohangye/huaxue91.html\">九年级化学上 </a><a href=\"http://www.ygedu.net/daohangye/huaxue92.html\">九年级化学下</a> <a href=\"http://www.ygedu.net/daohangye/shuxueb1.html\">高中数学必修1</a> <a href=\"http://www.ygedu.net/daohangye/shuxueb2.html\"> 高中数学必修2</a> <a href=\"http://www.ygedu.net/daohangye/shuxueb3.html\">高中数学必修3</a> <a href=\"http://www.ygedu.net/daohangye/shuxueb4.html\">高中数学必修4</a><a href=\"http://www.ygedu.net/daohangye/shuxueb5.html\">  高中数学必修5\n\r  </a><a href=\"http://www.ygedu.net/daohangye/shuxuex1.html\">高中数学选修1</a> <a href=\"http://www.ygedu.net/daohangye/shuxuex2.html\"> 高中数学选修2</a> <a href=\"http://www.ygedu.net/daohangye/shuxuex3.html\">高中数学选修3</a> <a href=\"http://www.ygedu.net/daohangye/shuxuex4.html\">高中数学选修4</a> <a href=\"http://www.ygedu.net/daohangye/wulib1.html\">高中物理必修1</a> <a href=\"http://www.ygedu.net/daohangye/wulib2.html\">高中物理必修2<br>\n\r  </a><a href=\"http://www.ygedu.net/daohangye/wulix1.html\">高中物理选修1 </a><a href=\"http://www.ygedu.net/daohangye/wulix2.html\">高中物理选修2</a> <a href=\"http://www.ygedu.net/daohangye/wulix3.html\">\n\r    高中物理选修3</a> <a href=\"http://www.ygedu.net/daohangye/hauxeb1.html\">高中化学必修1</a> <a href=\"http://www.ygedu.net/daohangye/hauxeb2.html\">高中化学必修2</a> <a href=\"http://www.ygedu.net/daohangye/hauxex1.html\">高中化学选修1</a> <a href=\"http://www.ygedu.net/daohangye/hauxex2.html\">高中化学选修2</a><a href=\"http://www.ygedu.net/daohangye/hauxex3.html\">高中化学选修3</a> <a href=\"http://www.ygedu.net/daohangye/hauxex4.html\">高中化学选修4</a><a href=\"http://www.ygedu.net/daohangye/hauxex5.html\">高中化学选修5</a> <a href=\"http://www.ygedu.net/daohangye/hauxex6.html\"> 高中化学选修6</a></p>\n\r    </td>\n\r  </tr>\n\r</table>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.ADDIR          = "AD";
ZoneAD_1.AddAD(objAD);

ZoneAD_1.Show();

