// // JavaScript code (c) 2000 Bert Boer (bert@geenpunt.nl) // var ua = navigator; var ns4 = false; var ie4 = false; if (ua.appName == "Netscape") if (ua.appVersion.substr(0, 2) == "4.") ns4 = true; if (ua.appName == "Microsoft Internet Explorer") if (ua.appVersion.substr(0,2) == "4.") ie4 = true; function Banner() { /* static vars */ this.loop = 1; // loop at this position, also number of ads in cycle if (this.loop > 1) this.current = Math.round(Math.random() *(this.loop -1) +1); // start at random position in cycle else this.current = 1; this.delta = 60 *1000; // delta time in msecs this.origin = "http://ad.geenpunt.nl/getad.php3?ident=waobank"; this.name = ""; this.imgid = 0; this.utc = 0; /* member functions */ this.init = Banner.init; this.next = Banner.next; this.update = Banner.update; this.redirect = Banner.redirect; } Banner.init = function(varname, layerid, imgid) { /* variable vars */ this.name = varname; if (ns4) { if (document.layers[layerid]) { this.imgid = document.layers[layerid].document.images[imgid]; this.formid = document.layers[layerid].document.forms[0]; } else { this.imgid = document.images[imgid]; this.formid = document.forms[0]; } } else { this.imgid = document.images[imgid]; this.formid = document.forms[0]; } var tmp = new Date(); var utc = Date.UTC(2000, tmp.getMonth(), tmp.getDate(), tmp.getHours(), tmp.getMinutes(), tmp.getSeconds()) /1000; this.utc = utc; this.update(); /* start cycle */ if (this.loop > 1) setTimeout(this.name +".next()", this.delta); } Banner.next = function() { this.utc += (this.delta /1000); this.current++; if (this.current > this.loop) this.current = 1; this.update(); setTimeout(this.name +".next()", this.delta); } Banner.update = function() { this.imgid.src = this.origin +"&id=" +this.current +"&utc=" +this.utc; } Banner.redirect = function() { this.formid.action = this.origin; this.formid.id.value = this.current; this.formid.submit(); } var banner = new Banner();