var oChaser = { topMargin : document.all ? 700 : 700, callRate : 75, slideTime : 800, maxDiff : document.all ? document.body.clientHeight : window.innerHeight, isIE : document.all ? true : false, chaserDiv : document.getElementById("contentSkyscrapper"), link1 : '', slideDelay : 0 }; oChaser.main = function( ) { if (this.topMargin<0) this.topMargin=10; try { this.currentY = this.isIE ? this.chaserDiv.style.pixelTop : this.chaserDiv.offsetTop; this.scrollTop = this.isIE ? document.documentElement.scrollTop : window.pageYOffset; if (this.scrollTop < oChaser.topMargin) var newTargetY = oChaser.topMargin else var newTargetY = this.scrollTop + this.topMargin - oChaser.topMargin; if ( this.currentY != newTargetY) { if ( newTargetY != this.targetY ) { this.targetY = newTargetY; this.slideInit( ); } this.slide( ) ; } this.Centrar(); } catch(ex) {alert(ex);} }; oChaser.slideInit = function( ) { var now = new Date( ); this.A = this.targetY - this.currentY; this.B = Math.PI / ( 2 * this.slideTime ); this.C = now.getTime( ); if (Math.abs(this.A) > this.maxDiff) { this.D = this.A > 0 ? this.targetY - this.maxDiff : this.targetY + this.maxDiff; this.A = this.A > 0 ? this.maxDiff : -this.maxDiff; } else { this.D = this.currentY; } }; oChaser.slide = function( ) { var now = new Date( ); var newY = this.A * Math.sin( this.B * ( now.getTime( ) - this.C ) ) + this.D; newY = Math.round( newY ); if (( this.A > 0 && newY > this.currentY ) ||( this.A < 0 && newY < this.currentY )) { if ( this.isIE ) this.chaserDiv.style.pixelTop = newY; else this.chaserDiv.style.top = newY+"px"; } }; oChaser.Centrar = function( ) { if ( this.isIE ) this.chaserDiv.style.pixelLeft = GetRelativeLeft(document.getElementById("barralimpa")); else this.chaserDiv.style.left = GetRelativeLeft(document.getElementById("barralimpa"))+"px"; }; oChaser.Fecha = function() { this.chaserDiv.innerHTML = ''; clearInterval(this.slideDelay); document.getElementById("barralimpa").style.width = 0; document.getElementById("contentSkyscrapper").style.visibility = 'hidden'; }; function initSkyscrapper() { oChaser.chaserDiv = document.getElementById("contentSkyscrapper"); oChaser.slideDelay = setInterval("oChaser.main( )", 75); oChaser.Centrar(); balancepagSkyscrapper(); getScriptToEval(); } function getScriptToEval() { var posI_ScriptToEval = -1; var posF_ScriptToEval = -1; var Script_To_Eval = ""; src = document.getElementById("contentSkyscrapper").innerHTML; posI_ScriptToEval = src.indexOf('ScriptToEval') + 14; if( posI_ScriptToEval > 20) { posF_ScriptToEval = src.indexOf('\';'); if(posF_ScriptToEval > 3) { Script_To_Eval = src.substring(posI_ScriptToEval,posF_ScriptToEval); oChaser.link1 = Script_To_Eval; } } } function new_window() { window.open(oChaser.link1, "Pub"); } function new_window3() { popupAllower(oChaser.link1); } function fecha3() { oChaser.Fecha(); } function GetRelativeLeft(obj) { try { if(obj == null) return 0; return obj.offsetLeft + this.GetRelativeLeft(obj.offsetParent); } catch (ex) { //alert("Bug GetRelativeLeft\n" + ex.message); } } function balancepagSkyscrapper() { if (oChaser.chaserDiv.innerHTML.match(/embed/)) { document.getElementById("contentSkyscrapper").style.visibility = 'visible'; } }