// wide expansivel

var timeout;
		
		function expandeDivWide() {
                    if (typeof(timeout) != 'undefined') {
                        clearTimeout(timeout);
                    }
                    var block = document.getElementById('widebanner');
                    block.style.width = '320px';
                    block.style.marginLeft = '-160px';
		}
		
		function contraiDivWide() {
                    var block = document.getElementById('widebanner');
                    timeout = setTimeout(function () {
                    block.style.width = '160px'
                    block.style.marginLeft = '0px';
                }, 1000 * 1.5);
		}
		
		// expansivel lateral

		function expandeDivRetExp(id, w, lf) {
                    var block = document.getElementById(id);
                    block.style.width = w+'px';

					tamleft = w-lf;
                    block.style.marginLeft = '-'+tamleft+'px';
		}
		
		function contraiDivRetExp(id, w, lf) {
                    var block = document.getElementById(id);
                    block.style.width = lf+'px';
                    block.style.marginLeft = '0px';
		}

// fullbar
function fullbar_configura(fullbar_div_id){
	fullbar_maximo = 115;//automatico: tamanho maximo da DIV 
	fullbar_minimo = 0;//tamanho minimo da DIV 
	fullbar_tempo = 10;//tempo para mostrar e esconder
	fullbar_incremento = 5;//interfere no item acima
	fullbar_cont = 0;//verificador para saber o fim
	fullbar_fim = false;//nao existe acao enquanto executando
}

// fullbar funcao controla altura
function fullbar_contador(fullbar_div,fullbar_tipo){
	var fullbar_divAction = document.getElementById(fullbar_div);
	var fullbar_divUl = document.getElementById('pubDownUL');
	if(fullbar_divAction.clientHeight > 10){
		fullbar_divUl.style.display = "block";
	}
	if(navigator.appName == "Microsoft Internet Explorer"){
		if(document.getElementById(fullbar_div).clientHeight <= 25 && fullbar_cont == 1){
				document.getElementById(fullbar_div).style.display = "none";
				clearInterval(fullbar_inter);
		}
	}
	if(fullbar_divAction.clientHeight < fullbar_maximo && fullbar_tipo == "show"){
		fullbar_soma = fullbar_divAction.clientHeight + fullbar_incremento;
		fullbar_divAction.style.height = fullbar_soma+"px";
		fullbar_fim = true;
	}else if(fullbar_divAction.clientHeight != fullbar_minimo && fullbar_tipo != "show"){
		fullbar_soma = fullbar_divAction.clientHeight - fullbar_incremento;
		fullbar_divAction.style.height = fullbar_soma+"px";
		fullbar_fim = true;
	}else{
		clearInterval(fullbar_inter);
		fullbar_fim = false;
		fullbar_cont = 1;
	}
}

// fullbar funcao controla browser
function fullbar_mostra(fullbar_idDiv){
	clearInterval(fullbar_inicial);
	fullbar_divAcao = document.getElementById(fullbar_idDiv);
	if(!fullbar_fim){
		if(fullbar_divAcao.clientHeight == fullbar_minimo){
			fullbar_inter = setInterval("fullbar_contador('pubDown','show')",fullbar_tempo);
		}else if(fullbar_divAcao.clientHeight >= fullbar_maximo){
			fullbar_divAcao.style.display = "none";
		}
	}
}

function posiciona01(s)
{
	if(document.layers){
	return document.layers[s];
	}else if(document.all && !document.getElementById) {
	return document.all[s];
	}else {
	return document.getElementById(s);
	}
}

function posiciona02(s,x,y)
{
	_o = posiciona01(s);
	_o.style.clip = 'rect(0px '+x+'px '+y+'px 0px)';
}

function apagadivbann()
{
    document.getElementById('banncorner').style.display = "none";
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	obj.visibility=v; }
}

function fecha2_banner()
{
	MM_showHideLayers('layer_onda2dhtml','','hide');
}

function abre2_banner()
{
	MM_showHideLayers('layer_onda2dhtml','','show');
}

function Temporizador(tempo)
{
	myTimer=setTimeout("fecha2_banner()",tempo*1000);
}

if(typeof oasBanners != "undefined") oasBanners[oasObj.div] = oasObj;

oas_flash_write = function() {
	if(!this.version) this.version = 7;
	this.flashvars = 'lnk='+this.lnk;
	this.flashvars+= '&url='+this.lnk;
	var oasALIGN = '';
	if(this.align=='center') oasALIGN = 'margin:0 auto;';
	var oasSTYLE = '';
	if(this.style) oasSTYLE = this.style;
	var oasWMODE = '';
	if(this.wmode) oasWMODE = ' wmode="' +this.wmode+ '" ';
	var oasHTM = '';
	if(this.pixelContador) {
		oasHTM+='<div style="position:absolute;visibility:hidden;width:1px;height:1px;z-index:-1000">';
		oasHTM+='<img src="' + this.pixelContador + '" width="1" height="1" border="0" /></div>';
	}
	
	if (this.publicidade)
	{
		oasHTM+='<img src="http://img.rpc.com.br/p.gif" width="160" height="5" vspace ="2" style="display:block;margin-top:5px;margin-bottom:3px;" />';
	}
	
	if (this.height == 60 || this.alturafechada == 60)
	{
		this.marginsuperior = '15px';
	}
	else
	{
		this.marginsuperior = '0';
	}

	if (this.cornerad)
	{
		oasHTM+='<div id="banncorner" style="position:absolute;top:-10px;left:-1px;">';
		this.flash = "http://canais.rpc.com.br/publicidade/corner.swf?clicktarget=_blank&clicktag=" + this.clicktag + "&clicktag2=javascript:apagadivbann()&clicktarget2=_self&banner=" + this.criativo + this.arquivo;
		
		this.width = 370;
		this.height = 455;	
	}
	else if (this.dhtml)
	{
		if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
                winW = window.innerWidth;
				winH = window.innerHeight;
         }
         if (navigator.appName.indexOf("Microsoft")!=-1) {
                winW = document.body.offsetWidth-4;
                winH = document.body.offsetHeight-10;
         }
        }
        
        if (this.centralizanalargura)
        {
        	this.posw = Math.round((winW-this.width)/2);
		}
        else
        {
        	this.posw = this.posicaolargura;
        }
        
        if (this.centralizanaaltura)
        {
        	this.posh = Math.round((winH-this.height)/2);
        }
        else
        {
        	this.posh = this.posicaoaltura;
        }
		
		oasHTM+='<div id="layer_onda2dhtml" style="position:absolute; left:'+this.posw+'px; top:'+this.posh+'px; width:'+this.width+'px; height:'+this.height+'px; z-index:1000">';
		
		if (this.fechar)
		{
			oasHTM+='<p align="right"><a href="javascript:fecha2_banner()" target="_self"><img src="http://portal.rpc.com.br/ads/fechar.gif" border="0" /></a></p>';
		}
		
		this.flash = this.criativo + this.arquivo + "?clicktarget=_blank&clicktag=" + this.clicktag + "&clicktag2=javascript:fecha2_banner()&clicktarget2=_self";
	}
	else if (this.expansivel)
	{
		var nomealea = Math.floor ( Math.random ( ) * 90000 + 10000 );
		oasHTM+='<table style="width:' + this.width + 'px; margin: '+ this.marginsuperior +' auto 0" width="'+this.width+'" height="'+this.alturafechada+'" border="0"><tr><td valign="top"><DIV id=Layer0'+nomealea+' style="Z-INDEX: 9000; WIDTH: '+this.width+'px; POSITION: relative; HEIGHT: '+this.alturafechada+'px"><DIV id=Layer'+nomealea+' onmouseover=posiciona02("Layer'+nomealea+'",'+this.width+','+this.height+') style="Z-INDEX: 9000; LEFT: 0px; WIDTH: '+this.width+'px; CLIP: rect(0px '+this.width+'px '+this.alturafechada+'px 0px); POSITION: absolute; TOP: 0px; HEIGHT: '+this.alturafechada+'px" onmouseout=posiciona02("Layer'+nomealea+'",'+this.width+','+this.alturafechada+')>';
		this.flash = this.criativo + this.arquivo + "?clicktarget=_blank&clicktag=" + this.clicktag;
		this.marginsuperior = '0';
	}	
	else if (this.fullbar)
	{
		oasHTM+='<style type="text/css" media="screen">@import "http://portal.rpc.com.br/ads/fullbar_08.02.26.css";</style><div id="pubDown" style="background-color:#'+this.cordefundo+'"><ul id="pubDownUL"><li><a href="javascript:fullbar_mostra(\'pubDown\');" style="color:#'+this.cordofechar+'">FECHAR</a></li><li><div style="width:730px;margin:0 auto 5px;">';
		this.flash = this.criativo + this.arquivo + "?clicktarget=_blank&clicktag=" + this.clicktag;
	}
	else if (this.widexp)
	{
		oasHTM+='<style type="text/css" media="screen">#widebanner { width: 160px; height: 600px; position: relative; overflow: hidden;}     #widebanner_in { position: absolute; right: 0; top: 0; }</style><div id="widebanner" onmouseout="contraiDivWide();" onmouseover="expandeDivWide();">';
		this.oasBanID = 'id="widebanner_in"';
		this.flash = this.criativo + this.arquivo + "?clicktarget=_blank&clicktag=" + this.clicktag;
	}
	else if (this.explateral)
	{
		var nomealea = Math.floor ( Math.random ( ) * 90000 + 10000 );
		oasHTM+='<style type="text/css" media="screen">#explateral_'+nomealea+' { width: '+this.largurafechada+'px; height: '+this.height+'px; position: relative; overflow: hidden;} #explateral_'+nomealea+'_in { position: absolute; right: 0; top: 0; }</style><div id="explateral_'+nomealea+'" onmouseout="contraiDivRetExp(\'explateral_'+nomealea+'\', \''+this.width+'\', \''+this.largurafechada+'\');">';
		this.oasBanID = 'id="explateral_'+nomealea+'_in"';
		this.flash = this.criativo + this.arquivo + "?clicktarget=_self&clicktag=javascript:expandeDivRetExp('explateral_"+nomealea+"', '"+this.width+"', '"+this.largurafechada+"')&clicktarget2=_self&clicktag2=javascript:contraiDivRetExp('explateral_"+nomealea+"', '"+this.width+"', '"+this.largurafechada+"')&clicktarget3=_blank&clicktag3="+this.clicktag;
	}
	else
	{		
		this.flash = this.criativo + this.arquivo + "?clicktarget=_blank&clicktag=" + this.clicktag;
	}
	
	if (this.swf || this.cornerad)
	{
		if (!this.widexp && this.width != 728 && this.heigth != 90 && !this.explateral)
		{
			oasHTM+='<div style="width:' + this.width + 'px; margin: '+ this.marginsuperior +' auto 0">';
		}

		oasHTM+='<object ' + this.oasBanID + ' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownloadocument.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+',0,0,0" width="'+this.width+'" height="'+this.height+'">';
		oasHTM+='<param name="movie" value="'+this.flash+'" /><param name="quality" value="high" /><param name="flashvars" value="' + this.flashvars + '" /><param name="AllowScriptAccess" value="always" />';
		if(this.wmode) oasHTM += '<param name="wmode" value="'+this.wmode+'" />';
		oasHTM+='<embed ' + oasWMODE + ' src="'+this.flash+'" flashvars="'+this.flashvars+'" AllowScriptAccess="always" quality="high" width="'+this.width+'" height="'+this.height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		
		if (!this.widexp && this.width != 728 && this.heigth != 90 && !this.explateral)
		{
			oasHTM+='</div>';
		}
	}
	else if (this.img)
	{
		oasHTM+='<div style="width:' + this.width + 'px; margin: '+ this.marginsuperior +' auto 0"><a href="'+ this.clicktag +'" target="_blank"><img src="'+this.criativo + this.arquivo +'" width="'+this.width+'" height="'+this.height+'" border="0"></a></div>';
	}	
	
	if (this.cornerad || this.dhtml)
	{
		oasHTM+='</div>';
	}
	
	if (this.expansivel)
	{
		oasHTM+='</DIV></DIV></td></tr></table>';
	}
	
	if (this.widexp)
	{
		oasHTM+='</div>';
	}
	
	if (this.fullbar)
	{
		oasHTM+='</div></li></ul></div>';
	}	
	
	this.htm = oasHTM;
	if(this.div) {
		if(document.getElementById(this.div)) document.getElementById(this.div).innerHTML = this.htm;
		else document.write(this.htm);
	}
	else document.write(this.htm);
	
	if (this.dhtml)
	{
		Temporizador(this.temporizador);
	}
}

if (typeof oasBanners == "undefined") {
	oasObj.write = oas_flash_write;
	oasObj.write();
}

if (oasObj.fullbar)
{
	//document.getElementById('shopping2').style.display = 'none';
	fullbar_configura('pubDown');
	fullbar_inicial = setInterval("fullbar_mostra('pubDown');",3000);
}	

