/* 20090130 - V1 */

document.write('<script language="JavaScript" src="http://images.ig.com.br/novoscanais/js/generico.js"></script>');
/* OPEC */ 
function OAS_VARS(OAS_page, OAS_pos) {
OAS_site = 'www.delas.com.br';
OAS_sitepage = OAS_site + OAS_page;
OAS_listpos = OAS_pos;}
OAS_url = 'http://adserver.ig.com.br/RealMedia/ads/';
OAS_query = '';
OAS_target = '_blank';
OAS_version = 10;
OAS_rn = '001234567890'; OAS_rns = '1234567890';
OAS_rn = new String(Math.random()); OAS_rns = OAS_rn.substring(2, 11);
function OAS_NORMAL (pos) {
 document.write('<a href="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" target="'+ OAS_target + '">');
 document.write('<img src="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" border="0"></a>');}
function OAS_START() {
OAS_version = 11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1 || navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1)
 OAS_version = 10;
if (OAS_version >= 11)
 document.write('<SCRIP' + 'T LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '?' + OAS_query + '"><\/SCRIP' + 'T>');}
document.write('');
function OAS_AD(pos){
 if (OAS_version >= 11)
  OAS_RICH(pos);
 else
  OAS_NORMAL(pos);}

function opecStart(){
  OAS_VARS('/'+OAS_page,'x15,Top2,x07,x09,Frame1,Right,Right1,x05,x06');
	OAS_START();
}

function publicidade_left(){OAS_AD("x09");}
function publicidade_middle(){OAS_AD("Middle");}
function publicidade_top(){OAS_AD("Right1");}


/*Tag Clouds */
function tagCloudsPrint() {/*
  tags = document.getElementById("tagClouds1").getElementsByTagName("span");
	arrayPalavras = [];
	for(i=0; i<tags.length; i++) {
		arrayPalavras[i] = tags[i].innerHTML + "|" + (i+1);
	}
	arrayPalavras.sort(ordenaPalavras);
	document.getElementById("tagClouds1").innerHTML = "";
	for(j=0; j<arrayPalavras.length; j++) {
		valor = arrayPalavras[j].split("|");
		relevancia = Math.ceil(parseInt(valor[1]) / 2);
		document.getElementById("tagClouds1").innerHTML+= "<a href='http://busca.igbusca.com.br/app/search?q=" + escape(valor[0]) + "&o=TAGCLOUDDELAS'><span class='tm" + relevancia + ((j%2==1) ? " fwb" : "") + "'> " + valor[0] + "<\/span><\/a>";
	}*/
}

function tagClouds(){
  OAS_AD("Right1");
}

function ordenaPalavras(a, b) {
	a = a.toString();
	b = b.toString();
	if(a.toLowerCase() < b.toLowerCase()) {
		return -1;
	}
	else if (a.toLowerCase() == b.toLowerCase()) {
		return 0;
	}
	else if(a.toLowerCase() > b.toLowerCase()) {
		return 1;
	}
}

function MM_swapImgRestore() { /*v3.0*/
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { /*v3.0*/
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openGalPop(p){window.open(p, 'Galeria', 'toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=yes,resizable=0,width=796,height=540,top=100,left=50')}

/* ---------------------------------- Home area 2 noticias horizontais ----------------------------------*/
hNoticeVis = -1;
var arrNotices = new Array();

function hNoticesPositions() {
	notices = document.getElementById("h_notice");
	for (i=0; i<notices.childNodes.length; i++){
		if (notices.childNodes[i].nodeName=='SPAN') {
			arrNotices[arrNotices.length] = i;
		}
	}
	h_notice('+');
}

function h_notice(mov){
	notices = document.getElementById("h_notice");
	for (i=0; i<arrNotices.length; i++){
		notices.childNodes[arrNotices[i]].style.display = "none";
	}
	hNoticeVis = (mov == '+'? hNoticeVis+1 : hNoticeVis-1 );
	if (hNoticeVis>=arrNotices.length) hNoticeVis = 0;
	if (hNoticeVis<0) hNoticeVis = arrNotices.length - 1;
	notices.childNodes[arrNotices[hNoticeVis]].style.display = "block";
  if (mov == '+') {
    if ((hNoticeVis+1)>=arrNotices.length) {
      h_notice('+');
    } else {
      notices.childNodes[arrNotices[hNoticeVis+1]].style.display = "block";
    }
  } else {
    if (hNoticeVis-1<0) {
      h_notice('-');
    } else {
      notices.childNodes[arrNotices[hNoticeVis-1]].style.display = "block";
    }
  }
}

function trocaAba(aba) {
  switch (aba) {
  	case "horoscopo":
  		document.getElementById("abaHoroscopo").style.display = "block"
  		document.getElementById("abaJogue").style.display = "none"
  		document.getElementById("abaSuadica").style.display = "none"
  		break
  	case "jogue":
  		document.getElementById("abaHoroscopo").style.display = "none"
  		document.getElementById("abaJogue").style.display = "block"
  		document.getElementById("abaSuadica").style.display = "none"
  		break
  	case "sua_dica":
  		document.getElementById("abaHoroscopo").style.display = "none"
  		document.getElementById("abaJogue").style.display = "none"
  		document.getElementById("abaSuadica").style.display = "block"
  		break
  	default:
  		document.getElementById("abaHoroscopo").style.display = "block"
  		document.getElementById("abaJogue").style.display = "none"
  		document.getElementById("abaSuadica").style.display = "none"
  }
}

/*----------------------------------------------------------------------------------------Validação Enquete*/

var clicado = false;

function votarEnquete() {

for (i = 0; i < document.formEnquete.id_alternativa.length; i++) {
	if (document.formEnquete.id_alternativa[i].checked) {
	  document.formEnquete.id_alternativa[i].value=document.formEnquete.id_alternativa[i].id;
		clicado = true;
		break;
	}
}

if (clicado) {
	janelaEnquete = window.open('','janelaEnquete','toolbar=0, location=0, directories=0, menubar=0, scrollbars=YES, resizable=0 , width=325, height=455, top=100, left=100, status=no');
	window.document.formEnquete.submit();
} else {
	alert('Escolha uma opção antes de votar');
}
}
function resultadoEnquete(){
	var lkn = "http://enquete.ig.com.br/resultados.php?id_enquete=" + document.formEnquete.id_enquete.value;
	janelaEnquete = window.open(lkn,'janelaEnquete','toolbar=0, location=0, directories=0, menubar=0, scrollbars=YES, resizable=0 , width=325, height=455, top=100, left=100, status=no');
}

/*---------------------------------------------------- Player ----------------------------------------------------------*/
var largura   = 295;

if(document.all) {
	var altura    = 185;
} else {
	var altura    = 247;
}

var tempoDuracao = "";
var tempoStart;
var objPlayer;
var objPlayPause;

function montaVideo(url) {
	var objVideo  = document.getElementById("conteudoVideo");

	var player = "<object id='player' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' width='" + largura + "' height='" + altura + "'>";
 	player+= "	<param name='url' value='" + url + "'/>";
	player+= "	<param name='AutoStart' value='true'/>";
	player+= "	<param name='TransparentAtStart' value='0'/>";
	player+= "	<param name='ShowStatusBar' value='0'/>";
	player+= "	<param name='ShowDisplay' value='0'/>";
	player+= "	<param name='AutoSize' value='0'/>";
	player+= "	<param name='UImode' value='none'/>";
	player+= "	<param name='AnimationAtStart' value='True'/>";
	player+= "	<param name='StretchToFit' value='False'/>";
	player+= "	<embed width='" + largura + "' height='" + altura + "' src='" + url + "' autostart='True'></embed>";
	player+= "</object>";

	document.getElementById("videoControlesFake").style.display = "none";

	objVideo.innerHTML = player;

	if(document.all) {
		tempoStart = setTimeout(
			funcao = function () { document.getElementById("player").controls.play(); }, 1000
		);

		if(document.all) {
			document.getElementById("videoControlesPlayer").style.display = "";
		}

		tempoDuracao = setTimeout("montaDecorrer()", 1000);

		objPlayer    = document.getElementById("player");
		objPlayPause = document.getElementById("playPause");
	}
}

function playPause() {
	if(isPlaying()) {
		objPlayPause.src = "http://images.ig.com.br/atitude/versao2007/tv_play.gif";
		objPlayer.controls.pause();
	} else {
		objPlayPause.src = "http://image.ig.com.br/ultimosegundo/versao_2006/useg_player_pause.gif";
		objPlayer.controls.play();
	}
}

function isPlaying() {
	if(document.all) {
		if(objPlayer.readyState == 4 && objPlayer.PlayState == 3) {
			return true;
		} else {
			return false;
		}
	} else {
		return objPlayer.isplaying();
	}
}

function montaDecorrer() {
	if(typeof objPlayer != 'undefined') {
		posicaoAtual = objPlayer.controls.CurrentPosition;
		duracao      = objPlayer.controls.currentItem.duration;

		fator = 1.18; /* (Largura do track / 100) - 0.02*/
		tamanhoPx = ((100 * fator) * posicaoAtual) / duracao;

		document.getElementById("cursorVideo").style.width = ((Math.ceil(tamanhoPx) > 0) ? Math.ceil(tamanhoPx) : 1);
		document.getElementById("cursorVideo").style.height = 15;
		if(objPlayer.playState == 10) {
			objPlayPause.src = "http://images.ig.com.br/atitude/versao2007/tv_play.gif";
			document.getElementById("cursorVideo").style.width = 1;
			document.getElementById("cursorVideo").style.height = 15;
			clearTimeout(tempoDuracao);
			clearTimeout(tempoStart);
		} else {
			tempoDuracao = setTimeout("montaDecorrer()", 1000);
		}
	}
}

function controlaVolume(statusVolume) {
	volumeAtual = objPlayer.settings.volume;

	if(statusVolume == '+') {
		if(volumeAtual <= 100) {
			objPlayer.settings.volume = volumeAtual + 10;
		}
	} else if(statusVolume == '-') {
		if(volumeAtual >= 0) {
			objPlayer.settings.volume = volumeAtual - 10;
		}
	}
}

/*Compare preços*/
function comparePrecos(){
	var html;
	html =  '<form name="FormBusca" action="http://igshopping.ig.com.br/template.aspx" method="get" target="_blank" style="width:128px">\n';
	html +=  '<input id="acao" type="hidden" value="busca" name="acao" \/>\n';
	html +=  '<input id="menu" type="hidden" value="compareprecos" name="menu" \/>\n';
	html +=  '<input id="origem" type="hidden" value="CANALDELAS" name="origem" \/>\n';
	html +=  '<label for="input_compare">Compare Preços<\/label>\n';
	html +=  '<input id="palavra" name="palavra" type="text"  value="" class="campo" style="width:95px" \/>\n';
	html +=  '<input type="image" src="http://images.ig.com.br/delas/novo_site/bt_ok_shopping.gif" title="OK" alt="OK" class="botao"  style="width:26px; heigth:22px; margin-left:5px;" \/>\n';
	html +=  '<\/form>\n';
	document.write(html);
}




//iG Busca NOVO - Início
var $IB=new Object();
		$IB.onMenu=false;
		$IB.menu=null;
		$IB.timeoutObj=null;
		$IB.origin=null;
		$IB.origins=new Object();
		$IB.searchPath="http://busca.igbusca.com.br/";
		$IB.msgErro = 'Digite uma consulta antes de acionar a busca';
		
		$IB.trim						= function(str){return str.replace(/^\s+|\s+$/g,"");}
		$IB.checkMenu				= function(timeout){if($IB.timeoutObj != null )clearTimeout($IB.timeoutObj);$IB.timeoutObj=setTimeout($IB.timeoutCheck,timeout);}
		$IB.timeoutCheck		= function(){$IB.timeoutObj=null;$IB.closeMenu(false);}
		$IB.showMenu				= function(){$IB.menu.style.display="block";}
		$IB.closeMenu				= function(force){if( $IB.menu==null || (!force && $IB.onMenu) )return;$IB.menu.style.display="none";}
		$IB.searchFromForm	= function(form){if($IB.origin.searchType=="OTHERS"){var q=$IB.trim(document.getElementById("ib_search").value);document.location=$IB.origin.directURL+q;return false;}return true;}
		
		$IB.vldBusca				= function(){var q=$IB.trim(document.getElementById("ib_search").value);var form_busca =	document.getElementById("form_busca");q.length == 0?alert($IB.msgErro):form_busca.submit();}
		$IB.exibemaisbusca	= function(){var exibe = document.getElementById('cmbbusca');if(exibe.style.display == "block"){exibe.style.display = "none";}else{exibe.style.display = "block";}}
		$IB.abaiGbusca			= function(argA,label){$IB.setCurrentOrigin(label,argA);var tags = argA.parentNode.parentNode.getElementsByTagName("li");for (i=0;i<tags.length;i++){tags[i].className = ""};argA.parentNode.className = "active";}
		$IB.initIGBusca			= function(currentOrigin){$IB.setCurrentOrigin(currentOrigin,null);}		
		
		$IB.setCurrentOrigin = function(originName,argA){			       
			document.getElementById("ib_o").value=originName;var origin=$IB.origins[originName];$IB.origin=origin;
			if(origin.acessType=="secondary"){var q=$IB.trim(document.getElementById("ib_search").value);if(q.length > 0){var urlLocation = "";if(origin.searchType=="OTHERS"){urlLocation = $IB.searchPath+"other";return;}
				else {
					urlLocation = $IB.searchPath+"search?o="+originName+"&q="+q;}
					window.location = urlLocation;return;}
				else {
				alert($IB.msgErro);return;}}
			else{
				if(origin.searchType=="OTHERS"){document.getElementById("form_busca").action = $IB.searchPath+"other";}else{document.getElementById("form_busca").action = $IB.searchPath+"search";}}
			var services=origin.services;var innerHTML="";var evalStr="";var checked;
			for(i = 0; i < services.length ; i++){
				var service=services[i];
				if(service.name == origin.currentService){checked=" checked ";}else{checked=" ";}
				innerHTML+="<input  type='radio' "+checked+" name='s' id='ib_"+service.name+"' value='"+service.name+"' class='radiobusca'/> <label for='ib_"+service.name+"'>"+service.label+"</label>";
				evalStr+="document.getElementById('ib_"+service.name+"').originName='"+originName+"'; ";}			
			var div_services=document.getElementById("ib_origin_services");
			if(innerHTML.length > 0){div_services.innerHTML="<cite class='pesquisar'>Pesquisar:</cite> "+innerHTML;} else {div_services.innerHTML="";	}
			return false;}	

//configuração/parametrização do busca

	$IB.origins.IGDELAS=new Object();
	$IB.origins.IGDELAS.name="IGDELAS";
	$IB.origins.IGDELAS.acessType="primary";
	$IB.origins.IGDELAS.searchType="IG_WEB";
	$IB.origins.IGDELAS.services=new Object();			
	$IB.origins.IGDELAS.currentService="delas_content";
	$IB.origins.IGDELAS.services=[{name:"delas_content",label:"no iG Delas"},{name:"ig_content",label:"no iG"},{name:"google_content",label:"na Web"}];

	$IB.origins.VIDEOS=new Object();
	$IB.origins.VIDEOS.name="VIDEOS"; 
	$IB.origins.VIDEOS.acessType="primary";
	$IB.origins.VIDEOS.searchType="IG_WEB";
	$IB.origins.VIDEOS.services=new Object();			
	$IB.origins.VIDEOS.currentService="ig_videos";
	$IB.origins.VIDEOS.services=[{name:"ig_videos",label:"no iG"},{name:"google_videos",label:"na Web"}];

	$IB.origins.IMAGENS=new Object();
	$IB.origins.IMAGENS.name="IMAGENS";
	$IB.origins.IMAGENS.acessType="primary";
	$IB.origins.IMAGENS.searchType="IG_WEB";
	$IB.origins.IMAGENS.services=new Object();			
	$IB.origins.IMAGENS.currentService="ig_imagens";
	$IB.origins.IMAGENS.services=[{name:"ig_imagens",label:"no iG"},{name:"google_imagens",label:"na Web"}];			 

	$IB.origins.IG_SHOPPING=new Object();
	$IB.origins.IG_SHOPPING.name="IG_SHOPPING";
	$IB.origins.IG_SHOPPING.acessType="primary";
	$IB.origins.IG_SHOPPING.searchType="OTHERS";
	$IB.origins.IG_SHOPPING.services=new Object();			
	$IB.origins.IG_SHOPPING.currentService="";

	$IB.origins.IGESPORTES=new Object();
	$IB.origins.IGESPORTES.name="IGESPORTES";
	$IB.origins.IGESPORTES.acessType="secondary";
	$IB.origins.IGESPORTES.searchType="IG_WEB";			
	$IB.origins.IGESPORTES.currentService="";
	$IB.origins.IGESPORTES.services=new Object(); 

	$IB.origins.BABADO=new Object();
	$IB.origins.BABADO.name="BABADO";
	$IB.origins.BABADO.acessType="secondary";
	$IB.origins.BABADO.searchType="IG_WEB";			
	$IB.origins.BABADO.currentService="";
	$IB.origins.BABADO.services=new Object(); 

	$IB.origins.ULTIMOSEGUNDO=new Object();
	$IB.origins.ULTIMOSEGUNDO.name="ULTIMOSEGUNDO";
	$IB.origins.ULTIMOSEGUNDO.acessType="secondary";
	$IB.origins.ULTIMOSEGUNDO.searchType="IG_WEB";			
	$IB.origins.ULTIMOSEGUNDO.currentService="";
	$IB.origins.ULTIMOSEGUNDO.services=new Object(); 

	$IB.origins.BLOGSCOLUNISTAS=new Object();
	$IB.origins.BLOGSCOLUNISTAS.name="BLOGSCOLUNISTAS";
	$IB.origins.BLOGSCOLUNISTAS.acessType="secondary";
	$IB.origins.BLOGSCOLUNISTAS.searchType="IG_WEB";			
	$IB.origins.BLOGSCOLUNISTAS.currentService="";
	$IB.origins.BLOGSCOLUNISTAS.services=new Object(); 



	function iGBusca(){
	//Renomeia classes da Busca Antiga - Não remover
	htmlDivs = document.getElementsByTagName("div");
	for (buscaI=0;buscaI<htmlDivs.length;buscaI++) {
	  if(htmlDivs[buscaI].className == "buscaGoogle")
	  {
		  htmlDivs[buscaI].className = "novabusca";
	  }
	}

	var html;
	html =  '<form onsubmit="$IB.vldBusca();return false" name="form_busca"  id="form_busca" method="post" action="http://busca.igbusca.com.br/app/search" enctype="application/x-www-form-urlencoded" lang="atmors">\n';				
	html +=  '<ul>\n';
	html +=  '<li class="active"><a href="#" onClick="$IB.abaiGbusca(this,\'IGDELAS\');return false;">Busca</a></li>\n';
	html +=  '<li><a href="#" onClick="$IB.abaiGbusca(this,\'IMAGENS\');return false;">Imagens</a></li>\n';
	html +=  '<li><a href="#" onClick="$IB.abaiGbusca(this,\'VIDEOS\');return false;">Vídeos</a></li>\n';
	html +=  '<li><a href="#" onClick="$IB.abaiGbusca(this,\'IG_SHOPPING\');return false;">iG Shopping</a></li>\n';
	html +=  '<li><a href="#" class="more" onMouseOver="$IB.exibemaisbusca();" onClick="return false;" onMouseOut="$IB.exibemaisbusca();">Mais</a></li>\n';
	html +=  '</ul>\n';
	html +=  '<br />\n';
	html +=  '<input type="Hidden" 	name="o" id="ib_o" value="IGDELAS" />\n';
	html +=  '<input type="text" 		name="q" id="ib_search" title="BUSCA" alt="BUSCA" class="campo_texto" />\n';
	html +=  '<input type="image" src="http://images.ig.com.br/ig_casa/btn_buscar.gif" class="bt_ok" />\n';
	html +=  '<p id="ib_origin_services">\n';
	html +=  '<cite class=\'pesquisar\'>Pesquisar:</cite> \n';
	html +=  '<input type="radio" name="a" class="radiobusca" checked="checked" /><label>no iG Delas</label>\n';
	html +=  '<input type="radio" name="a" class="radiobusca" /><label>no iG</label>\n';
	html +=  '<input type="radio" name="a" class="radiobusca" /><label>na Web</label>\n';
	html +=  '</p>\n';
	html +=  '<p class="enhanced">enhanced by Google</p><br class="clear" />\n';			
	html +=  '<div id="cmbbusca" onMouseOver="$IB.exibemaisbusca();" onMouseOut="$IB.exibemaisbusca();">\n';
	html +=  '<ul>\n';
	html +=  '<li><a href="#"  onClick="$IB.setCurrentOrigin(\'ULTIMOSEGUNDO\',this);return false;">Último Segundo</a></li>\n';
	html +=  '<li><a href="#"  onClick="$IB.setCurrentOrigin(\'IGESPORTES\',this);return false;">Esportes</a></li>\n';
	html +=  '<li><a href="#"  onClick="$IB.setCurrentOrigin(\'BABADO\',this);return false;">Babado</a></li>\n';
	html +=  '<li><a href="#"  onClick="$IB.setCurrentOrigin(\'BLOGSCOLUNISTAS\',this);return false;">Colunistas</a></li>\n';					
	html +=  '</ul>\n';
	html +=  '</div>\n';
	html +=  '</form>\n';
	document.write(html); 
	//Indica qual a origen inicial
	$IB.initIGBusca('IGDELAS');
}
 
//iG Busca NOVO - Fim


function footer(){
  document.write('<script type="text/javascript" src="http://images.ig.com.br/home/rodape.js"><!--//--></script>')
}

function validaMandaEmail() {
/*NOME = document.NEWS.NOME.value;*/
EMAIL = document.NEWS.EMAIL.value;
/*OPERACAO = document.NEWS.OPERACAO.value;*/

/**if ( NOME == "" ) {
  alert( "Entre com a NOME!" );
  document.NEWS.NOME.focus();
  return;
} else */
  if ( EMAIL == "" ) {
    alert( "Entre com o seu E-MAIL!" );
    document.NEWS.EMAIL.focus();
    return;
  } else if ( ( EMAIL.indexOf( "@", 0 ) == -1 || EMAIL.indexOf( ".", 0 ) == -1 ) || ( EMAIL.length < 5 ) ) {
    alert( "O E-MAIL informado é inválido!" );
    document.NEWS.EMAIL.focus();
    return;
  }else{
    document.NEWS.submit();
  }
}

/*window.onload=preparaAFC;*/


/*-------- INICIO - FUNÇÂO PARA RODAR SCRIPTS APÓS O CARREGAMENTO DA PÁGINA --------*
window.onload = function(){
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	opecStart();
}
/*-------- FIM - FUNÇÂO PARA RODAR SCRIPTS APÓS O CARREGAMENTO DA PÁGINA --------*/

function limitaTextoChamadas() {
	for(x=1;x<=3;x++){
		if (document.getElementById('brtpTituloUltimasNoticias'+[x]).innerHTML.length > 33){
			document.getElementById('brtpLinkUltimasNoticias'+[x]+'_1').title = document.getElementById('brtpTituloUltimasNoticias'+[x]).innerHTML;
			document.getElementById('brtpTituloUltimasNoticias'+[x]).innerHTML = document.getElementById('brtpTituloUltimasNoticias'+[x]).innerHTML.substr(0,33)+"...";
		}
		if (document.getElementById('brtpOlhoUltimasNoticias'+[x]).innerHTML.length > 33){
			document.getElementById('brtpLinkUltimasNoticias'+[x]+'_2').title = document.getElementById('brtpOlhoUltimasNoticias'+[x]).innerHTML;
			document.getElementById('brtpOlhoUltimasNoticias'+[x]).innerHTML = document.getElementById('brtpOlhoUltimasNoticias'+[x]).innerHTML.substr(0,33)+"...";
		}
    }
}

/* SELO COMBINE */
function urlForm(){
	var gender = document.getElementById('gender').value;
	var age = document.getElementById('agerange').value;
	var state = document.getElementById('state').value;
	
	var page="http://combine-ig.parperfeito.com.br/adsearch/results/19_"+ gender + "_" + age +"_"+state+".jsp?utm_medium=selo_BUSCA&utm_source=combine_cob&utm_campaign=COMBINE_BUSCA&gender="
	+ gender + "&agerange="+ age + "&stateb=" + state;
	
	window.open(page, '_blank');
}