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 + " -->");
	};
	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>';
				};
				document.getElementById(target).innerHTML = adHtml;
				$("#" + target).addClass("adsense_banners");
			};
		};
	};
	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>';
				};
				document.getElementById(target).innerHTML = adHtml;
				$("#" + target).addClass("adsense_banners");
			};
		};
	};
	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>';
				};
				document.getElementById(target).innerHTML = adHtml;
				$("#" + target).addClass("adsense_banners");
			};
		};
	};
	this.show950x90 = function( target, ad_qtde ) {
		if ( ad_qtde == null || ad_qtde > 5 )
			ad_qtde = 5;
		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>';
				};
				document.getElementById(target).innerHTML = adHtml;
				$("#" + target).addClass("adsense_banners");
			};
		};
	};
	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.showFrame = function(){
		if( !this.fake ){
			OAS_AD( 'Frame2' );
		};
	};
	this.showPosition1 = function(){
		if( !this.fake ){
			OAS_AD( 'Position1' );
		};
	};
	this.showPosition2 = function(){
		if( !this.fake ){
			OAS_AD( 'Position2' );
		};
	};
	this.showArroba = function(){
		if( !this.fake ){
			OAS_AD( 'Middle' );
		};
	};
	this.showAdArroba = function(){
		if( !this.fake ){
			OAS_AD( 'Middle2' );
		};
	};
	this.showSky = function(){
		if( !this.fake ){
			OAS_AD( 'Right1' );
		};
	};
	this.showAdSky = function(){
		if( !this.fake ){
			OAS_AD( 'Right' );
		};
	};
	this.showX01 = function(){
		if( !this.fake ){
			OAS_AD( 'x01' );
		};
	};
	this.showX05 = function(){
		if( !this.fake ){
			OAS_AD( 'x05' );
		};
	};
	this.show = function( position ){
		if( !this.fake ){
			OAS_AD(position);
		};
	};
	this._constructor = function( fake ){
		this.fake = fake;
		this.doConfig();
	};
	this._constructor.apply( this, arguments );
};
