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   = 0;
ZoneAD_1.ZoneHeight  = 0;
ZoneAD_1.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 26;
objAD.ADType         = 4;
objAD.ADName         = "网站菜单";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table border=0 cellSpacing=0 cellPadding=0 width=780>\n\r  <tr> \n\r    <td width=80> <div align=center><A href=\"http://www.meduol.com/glkt/\"><FONT color=#0000ff>课堂</FONT></A></div></td>\n\r    <td> <A href=\"http://www.meduol.com/jckj\">基础会计</A> <A href=\"http://www.meduol.com/zjcwkj\">中级财务会计</A> \n\r      <A href=\"http://www.meduol.com/cwgl\">财务管理</A> <A href=\"http://www.meduol.com/adver\">广告实务</A> \n\r      <A href=\"http://www.meduol.com/pr\"><FONT color=#000000>公共关系</FONT></A> <A href=\"http://www.meduol.com/emkt\">网络营销</A> \n\r      <A href=\"http://www.meduol.com/digphoto\">摄影课堂</A> <A href=\"http://search.dangdang.com/search_pub.php?key=%E7%D1%C6%F4%BE%FC\"><FONT color=blue>当当网</font></A> \n\r    </td>\n\r    <td width=80> <div align=center></div></td>\n\r  </tr>\n\r  <tr bgcolor=\"#F5F5F5\"> \n\r    <td rowspan=\"2\"> \n\r      <div align=center><A href=\"http://www.meduol.com/edu/jiaocai/Index.html\"><STRONG><FONT color=#ff0000>教材</FONT></STRONG></A></div></td>\n\r    <td colSpan=2> 会计财务类: <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/ptjc/Index.html\" target=_blank> \n\r      <FONT color=#0000ff>会计基础与实务</FONT><FONT color=red>(江苏省精品教材)</FONT> </A> \n\r      <a href=\"/edu/jiaocai/zhzy/kjjc/Index.html\"><font color=\"#0000FF\">会计基础</font>（基于会计工作过程）</a><A href=\"http://www.meduol.com/edu/jiaocai/zhzy/zjcwkj/Index.html\">中级财务会计</A> \n\r      <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/cwgl/Index.html\">财务管理</A> \n\r\n\r <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/cwgl/Index.html\">财务管理实训</A> \n\r\n\r\n\r    </td>\n\r  </tr>\n\r  <tr>\n\r    <td colSpan=2>营销管理类: <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/pr/Index.html\"><FONT color=#ff0000>公共关系实务</FONT></A> \n\r      <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/wlyx/Index.html\">网络营销</A> \n\r      <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/ggsw/Index.html\">广告实务</A> \n\r      <A href=\"http://www.meduol.com/edu/jiaocai/zhzy/eb/Index.html\">电子商务概论</A> \n\r      <A href=\"http://www.lixinaph.com/default.php?mod=goods&fid=-1&keyword=%E5%90%AF%E5%86%9B+&x=25&y=16\"><FONT color=blue>购买教材</font></A> \n\r    </td>\n\r  </tr>\n\r  <tr> \n\r    <td> <div align=center><FONT color=#333333><STRONG>综合</STRONG></FONT></div></td>\n\r    <td colSpan=2><A href=\"http://www.meduol.com/glpx/\">会计在线</A> <A href=\"http://www.meduol.com/glpx/ShowClass.asp?ClassID=50\"><FONT color=#ff0000>2011江苏会计从业资格</FONT></A> \n\r      <A href=\"http://www.meduol.com/market/Index.asp\">营销管理</A> <A href=\"http://www.meduol.com/photo\"><FONT color=#006600>摄影作品</FONT></A> \n\r      <A href=\"http://www.meduol.com/kjjcysw\"><FONT color=#ff0000>会计基础课程资源库</FONT></A> \n\r      <A href=\"http://www.amazon.cn/s?ie=UTF8&search-alias=books&field-author=%E7%BC%AA%E5%90%AF%E5%86%9B\"><FONT color=blue>亚马逊</font></A> \n\r    </td>\n\r  </tr>\n\r</table>\n\r";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.InstallDir     = "http://www.meduol.com/";
objAD.ADDIR          = "abook";
ZoneAD_1.AddAD(objAD);

ZoneAD_1.Show();

