/** * Kaboose Game Overlay AD Class. ROCKON */ if( typeof GameOverlayAD == "undefined" ) var GameOverlayAD = new Object(); GameOverlayAD.overlayAD = function( nm ) { this.name = nm; window.onresize = this.delegate( this, this.reposition ); } GameOverlayAD.overlayAD.prototype = { delegate: function( obj, meth ) { return function() { return meth.call( obj ); } }, displayGameOverlayAD: function( id, left, top ) { this.xOffset = left; this.yOffset = top; this.id = id; // need to get the position of the game div as a reference for the AD position on the page // this.flashDiv is document.getElementById('swfObject.attributes.id'); if(this.containerDiv == undefined) { //alert('containerdiv = undefined, flashDIv = ' + this.flashDiv); var pos = this.findPos( this.flashDiv ); } else { //alert('containerdiv = defined, ' + this.containerDiv ); var pos = this.findPos( this.containerDiv ); } var x = pos[0] + this.xOffset; var y = pos[1] + this.yOffset; // create the div which contains the ad this.newdiv = document.createElement('div'); this.newdiv.setAttribute('id', this.id); // hardcoded large rec for now // TODO: send in an adType argument so we can choose the style of ad to display this.newdiv.style.width = 300; this.newdiv.style.height = 250; this.newdiv.style.border = "2px solid"; this.newdiv.style.borderColor = "#000000"; this.newdiv.style.position = "absolute"; this.newdiv.style.left = x + "px"; this.newdiv.style.top = y + "px"; var dartRoot=''; if(location.hostname.indexOf('zeeks') >= 0) { dartRoot='kb.zk.game/play'; } else { dartRoot='kb.fs.arcade/game'; } var ord = Math.random()*100000000000000000; // works var adHTML = '