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 bannerzonead(_id) { /* define constants */ this.adnum = 0; this.addelay = 6000; /* define common variables*/ this.id = _id; this.zoneid = 0; this.zonename = ""; this.zonewidth = 0; this.zoneheight = 0; this.showtype = 1; this.divname = ""; this.div = null; /* define unique variables*/ /* define objects */ this.allad = new array(); this.showad = null; /* define functions */ this.addad = bannerzonead_addad; this.getshowad = bannerzonead_getshowad; this.show = bannerzonead_show; this.loopshow = bannerzonead_loopshow; } function bannerzonead_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 bannerzonead_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 bannerzonead_show() { if (!this.allad) { return; } else { this.getshowad(); } if (this.showad == null) return false; this.divname = "bannerzonead_div" + this.zoneid; if (!this.showad.imgwidth) this.showad.imgwidth = this.zonewidth if (!this.showad.imgheight) this.showad.imgheight = this.zoneheight if (this.showad.addir=="") this.showad.addir = "ad" if (this.showtype == 3) { if(document.all) { document.write("
" + ad_content(this.showad) + "
"); } else { document.write("
" + ad_content(this.showad) + "
"); } } else { document.write("
" + ad_content(this.showad) + "
"); if (this.showad.countview) { document.write ("