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           = 1;
objAD.ADType         = 4;
objAD.ADName         = "容错代码,改变图片大小,无级缩放图片大小,双击鼠标滚动屏幕的代码";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<SCRIPT LANGUAGE=\"JavaScript\">\n\r//容错代码\n\r<!-- Hide\n\rfunction killErrors() {\n\rreturn true;\n\r}\n\rwindow.onerror = killErrors;\n\r// -->\n\r</SCRIPT>\n\r<script language=\"JavaScript\" type=\"text/JavaScript\">\n\r//改变图片大小\n\rfunction resizepic(thispic)\n\r{\n\rif(thispic.width>700) thispic.width=700;\n\r}\n\r//无级缩放图片大小\n\rfunction bbimg(o)\n\r{\n\r  return false;\n\r}\n\r//检查评论表单\n\rfunction Check(){\n\r  if (document.form1.Content.value==\'\'){\n\r    alert(\'请输入内容！\');\n\r    document.form1.Content.focus();\n\r    return false;\n\r  }\n\r  return true;  \n\r}\n\r//双击鼠标滚动屏幕的代码\n\rvar currentpos,timer;\n\rfunction initialize()\n\r{\n\rtimer=setInterval (\"scrollwindow ()\",30);\n\r}\n\rfunction sc()\n\r{\n\rclearInterval(timer);\n\r}\n\rfunction scrollwindow()\n\r{\n\rcurrentpos=document.body.scrollTop;\n\rwindow.scroll(0,++currentpos);\n\rif (currentpos !=document.body.scrollTop)\n\rsc();\n\r}\n\rdocument.onmousedown=sc\n\rdocument.ondblclick=initialize\n\r\n\r//更改字体大小\n\rvar status0=\'\';\n\rvar curfontsize=10;\n\rvar curlineheight=18;\n\rfunction fontZoomA(){\n\r  if(curfontsize>8){\n\r    document.getElementById(\'fontzoom\').style.fontSize=(--curfontsize)+\'pt\';\n\r	document.getElementById(\'fontzoom\').style.lineHeight=(--curlineheight)+\'pt\';\n\r  }\n\r}\n\rfunction fontZoomB(){\n\r  if(curfontsize<64){\n\r    document.getElementById(\'fontzoom\').style.fontSize=(++curfontsize)+\'pt\';\n\r	document.getElementById(\'fontzoom\').style.lineHeight=(++curlineheight)+\'pt\';\n\r  }\n\r}\n\r</script>\n\r";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.InstallDir     = "/";
objAD.ADDIR          = "60duAD";
ZoneAD_1.AddAD(objAD);

ZoneAD_1.Show();
