/////////////////////////////////////////////////////// /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// ///////////// C Ó D I G O B A S E ////////////////// /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// function trata_js(js) { js = js.replace(/\n/g,""); js = js.replace(/\r/g,""); js = js.replace(/\"/g,"\\\""); js = js.replace(/\'/g,"\\'"); return js; } function getPageSizeWithScroll(){ if (window.innerHeight && window.scrollMaxY) { // Firefox yWithScroll = window.innerHeight + window.scrollMaxY; xWithScroll = window.innerWidth + window.scrollMaxX; } else if (window.parent.document.body.scrollHeight > window.parent.document.body.offsetHeight) { // all but Explorer Mac yWithScroll = window.parent.document.body.scrollHeight; xWithScroll = window.parent.document.body.scrollWidth; } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari yWithScroll = window.parent.document.body.offsetHeight; xWithScroll = window.parent.document.body.offsetWidth; } arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll); //alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll ); return arrayPageSizeWithScroll; } function make_alert(title,msg,extra_js) { extra_js = trata_js(extra_js); h = getPageSizeWithScroll(); x = h[0]; y = h[1]; //verifica se existe barra de scroll vertical, porque o x (width da pagina) empurra a largura da barra, //criando scroll horizontal var winheight = parseInt(window.parent.document.window.parent.documentElement.scrollHeight) var boheight = parseInt(window.parent.document.body.scrollHeight) if (winheight >= boheight) { x = x-15; } window.parent.document.getElementById('alert_fundo').style.height = y; window.parent.document.getElementById('alert_fundo').style.width = x; window.parent.document.getElementById('alert_fundo').style.display = ''; window.parent.document.getElementById('alertLayer').style.display=''; makeAlert(title,msg,extra_js); } function make_confirm(title,msg,bot_sim,bot_nao,js_sim,js_nao) { js_sim = trata_js(js_sim); js_nao = trata_js(js_nao); h = getPageSizeWithScroll(); x = h[0]; y = h[1]; //verifica se existe barra de scroll vertical, porque o x (width da pagina) empurra a largura da barra, //criando scroll horizontal var winheight = parseInt(window.parent.document.window.parent.documentElement.scrollHeight) var boheight = parseInt(window.parent.document.body.scrollHeight) if (winheight >= boheight) { x = x-15; } window.parent.document.getElementById('alert_fundo').style.height = y; window.parent.document.getElementById('alert_fundo').style.width = x; window.parent.document.getElementById('alert_fundo').style.display = ''; window.parent.document.getElementById('alertLayer').style.display=''; makeConfirm(title,msg,bot_sim,bot_nao,js_sim,js_nao); } function BrowserCheck() { var b = navigator.appName; if (b == "Netscape") this.b = "NS"; else if (b == "Microsoft Internet Explorer") this.b = "IE"; else this.b = b; this.v = parseInt(navigator.appVersion); this.NS = (this.b == "NS" && this.v>=4); this.NS4 = (this.b == "NS" && this.v == 4); this.NS5 = (this.b == "NS" && this.v == 5); this.IE = (this.b == "IE" && this.v>=4); this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0); this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0); if (this.IE5 || this.NS5) this.VER5 = true; if (this.IE4 || this.NS4) this.VER4 = true; this.OLD = (! this.VER5 && ! this.VER4) ? true : false; this.min = (this.NS||this.IE); } is = new BrowserCheck(); alertBox = (is.VER5) ? window.parent.document.getElementById("alertLayer").style : (is.NS) ? window.parent.document.layers["alertLayer"] : window.parent.document.all["alertLayer"].style; alertFundo = (is.VER5) ? window.parent.document.getElementById("alert_fundo").style : (is.NS) ? window.parent.document.layers["alert_fundo"] : window.parent.document.all["alert_fundo"].style; function hideAlert(){ alertBox.visibility = "hidden"; } function button_function(extra_js) { alertBox.visibility = "hidden"; alertBox.display = "none"; alertFundo.display = "none"; eval(extra_js); } function fecha_form() { alertBox.visibility = "hidden"; alertFundo.display = "none"; } function makeAlert(aTitle,aMessage,extra_js){ window.parent.document.getElementById('alertLayer').contentWindow.window.parent.document.body.innerHTML = "
" + "" + "" + "" + "" + "" + "" + "
" + " " + aTitle + "
" + aMessage + "

" + "
"; thisText = aMessage.length; if (aTitle.length > aMessage.length){ thisText = aTitle.length; } aWidth = (thisText * 5) + 80; aHeight = 100; if (aWidth < 150){ aWidth = 200; } if (aWidth > 350) { aWidth = 350; } if (thisText > 60) { aHeight = 110; } if (thisText > 120){ aHeight = 130; } if (thisText > 180){ aHeight = 150; } if (thisText > 240){ aHeight = 170; } if (thisText > 300){ aHeight = 190; } if (thisText > 360){ aHeight = 210; } if (thisText > 420){ aHeight = 230; } if (thisText > 490){ aHeight = 250; } if (thisText > 550){ aHeight = 270; } if (thisText > 610){ aHeight = 290; } alertBox.width = aWidth; alertBox.height = aHeight+5; alertBox.left = ((window.parent.document.body.clientWidth)/2)-(aWidth/2); alertBox.top = ((window.parent.document.body.clientHeight)/2)-(aHeight/2); tmp = eval("window.parent.document.getElementById('alertLayer').contentWindow.document"); tmp.getElementById('alert_var_button').blur(); tmp.getElementById('alert_var_button').focus(); alertBox.visibility = "visible"; } function makeConfirm(aTitle,aMessage,bot_sim,bot_nao,js_sim,js_nao){ window.parent.document.getElementById('alertLayer').contentWindow.window.parent.document.body.innerHTML = "
" + "" + "" + "" + "" + "" + "" + "
" + " " + aTitle + "
" + aMessage + "
  
" + "
"; thisText = aMessage.length; if (aTitle.length > aMessage.length){ thisText = aTitle.length; } aWidth = (thisText * 5) + 80; aHeight = 100; if (aWidth < 150){ aWidth = 200; } if (aWidth > 350) { aWidth = 350; } if (thisText > 60) { aHeight = 110; } if (thisText > 120){ aHeight = 130; } if (thisText > 180){ aHeight = 150; } if (thisText > 240){ aHeight = 170; } if (thisText > 300){ aHeight = 190; } if (thisText > 360){ aHeight = 210; } if (thisText > 420){ aHeight = 230; } if (thisText > 490){ aHeight = 250; } if (thisText > 550){ aHeight = 270; } if (thisText > 610){ aHeight = 290; } alertBox.width = aWidth; alertBox.height = aHeight+5; alertBox.left = ((window.parent.document.body.clientWidth)/2)-(aWidth/2); alertBox.top = ((window.parent.document.body.clientHeight)/2)-(aHeight/2); if (document.getElementById('alertLayer')) { tmp = document.getElementById('alertLayer').offsetHeight; } else { tmp = 0; } //alertBox.height = tmp+5; alertBox.visibility = "visible"; } /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// /////////// C Ó D I G O E X T R A ////////////////// /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// //skyscraper function browser () { var b = navigator.appName; var v = this.version = navigator.appVersion; var ua = navigator.userAgent.toLowerCase(); this.v = parseInt(v); this.safari = ua.indexOf("safari")>-1; // always check for safari & opera this.opera = ua.indexOf("opera")>-1; // before ns or ie this.ns = !this.opera && !this.safari && (b=="Netscape"); this.ie = !this.opera && (b=="Microsoft Internet Explorer"); this.gecko = ua.indexOf('gecko')>-1; // check for gecko engine if (this.ns) { this.ns4 = (this.v==4); this.ns6 = (this.v>=5); this.b = "Netscape"; }else if (this.ie) { this.ie4 = this.ie5 = this.ie55 = this.ie6 = false; if (v.indexOf('MSIE 4')>0) { this.ie4 = true; this.v = 4; } else if (v.indexOf('MSIE 5')>0) { this.ie5 = true; this.v = 5; } else if (v.indexOf('MSIE 5.5')>0) { this.ie55 = true; this.v = 5.5; } else if (v.indexOf('MSIE 6')>0) { this.ie6 = true; this.v = 6; } this.b = "MSIE"; }else if (this.opera) { this.v=parseInt(ua.substr(ua.indexOf("opera")+6,1)); // set opera version this.opera6=(this.v>=6); this.opera7=(this.v>=7); this.b = "Opera"; }else if (this.safari) { this.ns6 = (this.v>=5); // ns6 compatible correct? this.b = "Safari"; } this.dom = (window.parent.document.createElement && window.parent.document.appendChild && window.parent.document.getElementsByTagName)? true : false; this.def = (this.ie||this.dom); this.win32 = ua.indexOf("win")>-1; this.mac = ua.indexOf("mac")>-1; this.other = (!this.win32 && !this.mac); this.supported = (this.def||this.ns4||this.ns6||this.opera)? true:false; } function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) { if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { window.parent.document.MM_pgW=innerWidth; window.parent.document.MM_pgH=innerHeight; onresize=MM_reloadPage; } } else if (innerWidth!=window.parent.document.MM_pgW || innerHeight!=window.parent.document.MM_pgH) { location.reload(); } } MM_reloadPage (true); window.onresize = init; //Caso a janela seja carregada a função init vai ser chamada para mudar a pósição horizontal do banner function init(){ naveg = new browser(); if(naveg.ie || naveg.opera){ //block = window.parent.document.all["alertLayer"].style; block = window.parent.document.getElementById("alertLayer").style; //block.left = (window.screen.availWidth-parseInt(block.width)/2) //block.left = (window.parent.document.body.clientWidth-parseInt(block.width))-window.parent.document.body.scrollLeft - 10; } else if (naveg.ns4){ block = window.parent.document.layers["alertLayer"]; //block.left = (window.screen.availWidth/2) //block.left = (window.innerWidth-100)-window.pageXOffset - 70; } else if (naveg.ns6){ block = window.parent.document.getElementById("alertLayer").style; //block.left = (window.screen.availWidth-parseInt(block.width)/2) //block.left = (window.parent.document.body.clientWidth-parseInt(block.width))-window.pageXOffset - 12; } a = 0; } function ad(){ if(naveg.ie || naveg.opera){ pósY = window.parent.document.body.scrollTop; } else if (naveg.ns){ pósY = window.pageYOffset; } else if (naveg.ns6){ pósY = window.pageYOffset; } //alert(window.screen.availHeight); //tmp = (window.screen.availHeight/2)-125; tmp = window.screen.availHeight; if((pósY % 2) !== 0) pósY-=1; if(pósY+tmp != parseInt(block.top)){ for(i=0; i<5; i++){ if (pósY+tmp > parseInt(block.top)) a+= 2; else a-=2; block.top = a; } } setTimeout("ad()",10); }