function AdSense(){
    this.adChannel = "";
    this.reloadConfig = function (){
        google_ad_client = "ca-pub-5597832529264086";
        google_ad_channel = this.adChannel;
        google_ad_output = "js";
        google_feedback = "on";
        google_ad_type = "text";
        document.write("<!-- google_ad_channel: " + google_ad_channel + " -->");
    };
    this.doConfig = function ( ad_channel ){
        this.adChannel = ad_channel;
        google_ad_client = "ca-pub-5597832529264086";
        google_ad_channel = ad_channel;
        google_ad_output = "js";
        google_feedback = "on";
        google_ad_type = "text";
        document.write("<!-- google_ad_channel: " + google_ad_channel + " -->");
    };
    /* Modelos Verficais - 140x550 ou  140x300 */
    this.show140xN = function( target, ad_qtde ) {
        google_max_num_ads = ad_qtde;
        google_ad_request_done = function( google_ads ) {
            if ( google_ads.length > 0 ) {
                var adHtml = '<div class="AdGoogle140xN">';
                adHtml += '<p class="tituloGoogle"><a target="_blank" href="' + google_info.feedback_url + '">An&uacute;ncios Google</a></p>';
                for ( i = 0; i < google_ads.length; ++i ) {
                    adHtml += '<div class="AdAnuncio">';
                    adHtml += '<p class="tituloAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].line1 + '</a></p>';
                    adHtml += '<p class="linha1Anuncio">' + google_ads[i].line2 + '</p>';
                    adHtml += '<p class="linha2Anuncio">' + google_ads[i].line3 + '</p>';
                    adHtml += '<p class="urlAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].visible_url + '</a></p>';
                    adHtml += '</div>';
                };
                adHtml += '<div class="clear"><hr /></div></div>';
                document.getElementById(target).innerHTML = adHtml;
            };
        };
    };
    
    /*300x500 ou  300x250 */
    this.show300xN = function( target, ad_qtde ) {
        google_max_num_ads = ad_qtde;
        google_ad_request_done = function( google_ads ) {
            if ( google_ads.length > 0 ) {
                var adHtml = '<div class="AdGoogle300xN">';
                adHtml += '<p class="tituloGoogle"><a target="_blank" href="' + google_info.feedback_url + '">An&uacute;ncios Google</a></p>';
                for ( i = 0; i < google_ads.length; ++i ) {
                    adHtml += '<div class="AdAnuncio">';
                    adHtml += '<p class="tituloAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].line1 + '</a></p>';
                    adHtml += '<p class="linha1Anuncio">' + google_ads[i].line2 + '</p>';
                    adHtml += '<p class="linha2Anuncio">' + google_ads[i].line3 + '</p>';
                    adHtml += '<p class="urlAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].visible_url + '</a></p>';
                    adHtml += '</div>';
                };
                adHtml += '<div class="clear"><hr /></div></div>';
                document.getElementById(target).innerHTML = adHtml;
            };
        };
    };
    
    /* Modelos Horizontais*/
    /*625x90 */
    this.show625x90 = function( target, ad_qtde ) {
        if ( ad_qtde == null || ad_qtde > 4 )
            ad_qtde = 4;
        google_max_num_ads = ad_qtde;
        google_ad_request_done = function( google_ads ) {
            if ( google_ads.length > 0 ) {
                var qtde = ( google_ads.length < ad_qtde ) ? google_ads.length : ad_qtde;
                var adHtml = '<div class="AdGoogle625x90 Ad625Qtde' + qtde + '">';
                adHtml += '<p class="tituloGoogle"><a target="_blank" href="' + google_info.feedback_url + '">An&uacute;ncios Google</a></p>';
                for ( i = 0; i < qtde; ++i ) {
                    adHtml += '<div class="AdAnuncio">';
                    adHtml += '<p class="tituloAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].line1 + '</a></p>';
                    adHtml += '<p class="linha1Anuncio">' + google_ads[i].line2 + '</p>';
                    adHtml += '<p class="linha2Anuncio">' + google_ads[i].line3 + '</p>';
                    adHtml += '<p class="urlAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].visible_url + '</a></p>';
                    adHtml += '</div>';
                };
                adHtml += '<div class="clear"><hr /></div></div>';
                document.getElementById(target).innerHTML = adHtml;
            };
        };
    };
    /*950x90 */
    this.show950x90 = function( target, ad_qtde ) {
        if ( ad_qtde == null || ad_qtde > 6 )
            ad_qtde = 6;
        google_max_num_ads = ad_qtde;
        google_ad_request_done = function( google_ads ) {
            if ( google_ads.length > 0 ) {
                var qtde = ( google_ads.length < ad_qtde ) ? google_ads.length : ad_qtde;
                var adHtml = '<div class="AdModelo950x90 Ad950Qtde' + qtde + '">';
                adHtml += '<p class="tituloGoogle"><a target="_blank" href="' + google_info.feedback_url + '">An&uacute;ncios Google</a></p>';
                for ( i = 0; i < qtde; ++i ) {
                    adHtml += '<div class="AdAnuncio">';
                    adHtml += '<p class="tituloAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].line1 + '</a></p>';
                    adHtml += '<p class="linha1Anuncio">' + google_ads[i].line2 + '</p>';
                    adHtml += '<p class="linha2Anuncio">' + google_ads[i].line3 + '</p>';
                    adHtml += '<p class="urlAnuncio"><a target="_blank" href="' +google_ads[i].url + '">' + google_ads[i].visible_url + '</a></p>';
                    adHtml += '</div>';
                };
                adHtml += '<div class="clear"><hr /></div></div>';
                document.getElementById(target).innerHTML = adHtml;
            };
        };
    };
    this._constructor = function( ad_channel ){
        this.adChannel = ad_channel;
        this.doConfig( ad_channel );
    };
    this._constructor.apply( this, arguments );
};
function Banner(){
    this.doConfig = function (){
        document.write("<!-- OAS_sitepage:" + OAS_sitepage + "-->");
        document.write("<!-- OAS_listpos:" + OAS_listpos + "-->");
        
        if( this.fake ) return;
        
        OAS_url="http://rm.estadao.com.br/RealMedia/ads/";
        OAS_query="";
        OAS_rns=new String(Math.random()).substring(2,11);
        OAS_NORMAL = function( pos ){
            document.write( [
                '<A HREF="',
                OAS_url,
                'click_nx.ads/',
                OAS_sitepage,
                '/1',
                OAS_rns,
                '@',
                OAS_listpos,
                '!',
                pos,
                OAS_query,
                '" TARGET=_top>'
            ].join('') );
            document.write( [
                '<IMG SRC="',
                 OAS_url,
                 'adstream_nx.ads/',
                 OAS_sitepage,
                 '/1',
                 OAS_rns,
                 '@',
                 OAS_listpos,
                 '!',
                 pos,
                 OAS_query,
                 '" BORDER=0></A>'
             ].join('') );
        };
        OAS_version = 11;
        if (navigator.userAgent.indexOf('Mozilla/3') != -1){
            OAS_version = 10;
        }else{
            document.write([
                '<scr','ipt type="text/javascript" SRC="',
                OAS_url,
                'adstream_mjx.ads/',
                OAS_sitepage,
                '/1',
                OAS_rns,
                '@',
                OAS_listpos,
                OAS_query,
                '"></scr','ipt>'
            ].join('') );
        };
        
        OAS_AD = function( pos ){
            if( OAS_version >= 11 ){
                window.OAS_RICH && OAS_RICH( pos );
            }else{
                OAS_NORMAL( pos );
            };
        };
    };
    
    this.showFrame1 = function(){
        if( !this.fake ){
            OAS_AD( 'Frame1' );
        };
    };
    
    
    this.showLeft = function(){
        if( !this.fake ){
            OAS_AD( 'Left' );
        };
    };
    
    this.showFrame = function(){
        if( !this.fake ){
            OAS_AD( 'Frame2' );
        };
    };
    
    this.showFull = function(){
        if( !this.fake ){
            OAS_AD( 'Position1' );
        };
    };
    this.showArroba = function(){
        if( !this.fake ){
            OAS_AD( 'Middle' );
        };
    };
    
    this.showMiddle1 = function(){
        if( !this.fake ){
            OAS_AD( 'Middle1' );
        };
    };
    
    this.showX3 = function(){
        if( !this.fake ){
            OAS_AD( 'x03' );
        };
    };
    
    this.showX4 = function(){
        if( !this.fake ){
            OAS_AD( 'x04' );
        };
    };
    this.showX6 = function(){
        if( !this.fake ){
            OAS_AD( 'x06' );
        };
    };
    this.showX6 = function(){
        if( !this.fake ){
            OAS_AD( 'x06' );
        };
    };
    this.showX8 = function(){
        if( !this.fake ){
            OAS_AD( 'x08' );
        };
    };
    this.showX9 = function(){
        if( !this.fake ){
            OAS_AD( 'x09' );
        };
    };
    this.showX10 = function(){
        if( !this.fake ){
            OAS_AD( 'x10' );
        };
    };
    this.showX11 = function(){
        if( !this.fake ){
            OAS_AD( 'x11' );
        };
    };
    this.showX12 = function(){
        if( !this.fake ){
            OAS_AD( 'x12' );
        };
    };
    this.showSky = function(){
        if( !this.fake ){
            OAS_AD( 'Right1' );
        };
    };
    this.showTop = function(){
        if( !this.fake ){
            OAS_AD( 'Top' );
        };
    };
    
    this.showBottom = function(){
        if( !this.fake ){
            OAS_AD( 'Bottom' );
        };
    };
    
    this.showBottom1 = function(){
        if( !this.fake ){
            OAS_AD( 'Bottom1' );
        };
    };
    this.showMobile = function(){
        if( !this.fake ){
            OAS_AD( 'Mobile' );
        };
    };
    this.showAdArroba = function(){
        if( !this.fake ){
            OAS_AD( 'Middle2' );
        };
    };
    this.showAdSky = function(){
        if( !this.fake ){
            OAS_AD( 'Right' );
        };
    };
    this.showAdFull = function(){
        if( !this.fake ){
            OAS_AD( 'Position2' );
        };
    };
    this.showPosition2 = function(){
        if( !this.fake ){
            OAS_AD( 'Position2' );
        };
    };
    
    this.show = function(position){
        if( !this.fake ){
            OAS_AD(position);
        };
    };
    
    this._constructor = function( fake ){
        this.fake = fake;
        this.doConfig();
    };
    
    this._constructor.apply( this, arguments );
};
var oAdSense = new AdSense();

function posicionaSelo(){
    id = "bannerTopo";
    var selo = document.getElementById(id);
    if(selo.className.indexOf("comSelo") < 0 ){
        selo.className += " comSelo";
    }
}
 
// Exibe o selo de publicidade ao lado do Super Banner
function exibeSeloPublicidade(nomeDiv)
{
    if(document.getElementById(nomeDiv)){
        if(document.getElementById(nomeDiv).className == "")
            document.getElementById(nomeDiv).className = "bannerComSelo";
        else
            document.getElementById(nomeDiv).className += " bannerComSelo";
    }
}
