﻿function Banner(){
	this.toString = function(){
		return '[object Banner]';
	};
	
	this.getSitePage = function(){
		var predefinido = false;
		var sitePage = null;
		try{
			if (OAS_sitepage != "" && OAS_listpos != ""){
				predefinido = true;
				sitePage = OAS_sitepage;
				listPos = OAS_listpos;
			};
		}catch(e){};
		if (!predefinido){
			if ( pageSession ){
				sitePage = "eldorado/" + pageSession;
				var listPos = "Position1,Middle,Middle1,Frame2,Bottom,x50";
				if(pageSession == 'promocoes'){
					var listPos = "Position1,Middle,Middle1,Frame2,Bottom,Bottom1,Bottom2,x50";
				}else if(pageSession == 'teste'){
					sitePage = "teste/"+subSection;
					var listPos = "Position1,Middle,Middle1,Frame2,Bottom,Bottom1,Bottom2,Top";
				}else if(pageSession == 'programas'){
					try{
						if ( programa ){
							sitePage = "eldorado/programas/" + programa;
							/*listPos = "Position1,Middle,Middle1,Frame2,Bottom,Bottom1,Bottom2";*/
							listPos = "Position1,Middle,Middle1,Frame2,Bottom1,Bottom2,x50";							
						}else{
							sitePage = "eldorado/programas";
							listPos = "Position1,Middle,Middle1,Frame2,Bottom,x50";
						};
					}catch(e){
						sitePage = "eldorado/programas";
						listPos = "Position1,Middle,Middle1,Frame2,x50";
					};
				};
			}else{
				sitePage = "eldorado/home";
				var listPos = "Position1,Middle,Middle1,Frame2,x50";
			};
		};
		return {
			'sitePage' : sitePage,
			'listPos' : listPos 
		};
	};
	
	this.doConfig = function (){
		var oSitePage = this.getSitePage();
		OAS_sitepage = oSitePage.sitePage;
		OAS_listpos = oSitePage.listPos;
		
		
		document.write( [ '<!','-- OAS_site_page: ', OAS_sitepage, '--','>' ].join('') );
		document.write( [ '<!','-- OAS_listpos: ',   OAS_listpos,  '--','>' ].join('') );
		
		if( this.fake ) return;
		
		OAS_url ='http://rm.limao.com.br/RealMedia/ads/';
		OAS_query = '';
		OAS_version = 10;
		OAS_rn = new String( Math.random() );
		OAS_rns = OAS_rn.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;
		};
		if (OAS_version >= 11){
			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.showFull = function(){
		if( this.fake ){
			document.write( '<img src="http://rm.estadao.com.br/RealMedia/ads/Creatives/OasDefault/teste_ae_396/coca-396.gif"/>' );
		} else {
			OAS_AD( 'Position1' );
		};
	};
	
	this.showArroba = function(){
		if( this.fake ){
			document.write( '<img src="/te/img/te/banner_direita.jpg" width="302" height="252" alt="Banner Direita" />' );
		} else {
			OAS_AD( 'Middle' );
		};
	};
	
	
	this.showFrame2 = function(){
		if( ! this.fake ){
			OAS_AD( 'Frame2' );
		};
	};
	
	this.Top = function(){
		if( ! this.fake ){
			OAS_AD( 'Top' );
		};
	};
	
	this.bottom_ = function(){
		if( ! this.fake ){
			OAS_AD( 'Bottom' );
		};
	};
	
	this.showArroba1 = function(){
		if( this.fake ){
			document.write( '<img src="/te/img/te/banner_direita.jpg" width="302" height="252" alt="Banner Direita" />' );
		} else {
			OAS_AD( 'Middle1' );
		};
	};
	
	this.show = function(position){
		OAS_AD( position );
	};

	this.bottom_01 = function(){
		if( ! this.fake ){
			OAS_AD( 'Bottom1' );
		};
	};
	
	this.bottom_02 = function(){
		if( ! this.fake ){
			OAS_AD( 'Bottom2' );
		};
	};
	
	this._constructor = function( fake ){
		this.fake = fake;
		this.doConfig();
	};
	
	this._constructor.apply( this, arguments );
};
posicionaSelo = function () {
	 id = "bannerduplo";
	 var selo = document.getElementById(id);
	 if (selo.className.indexOf("comSelo") < 0) {
		 	selo.className += "comSelo";
	}
};



