	var ns6=document.getElementById&&!document.all?1:0

	var head="display:''"
	var folder=''

	function expande(curobj){
	folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
	if (folder.display=="none")
	folder.display=""
	else
	folder.display="none"
	}

	function noticias(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}

	function CheckForm2 () {
		// docement.nome do form.nome do campo.value=""
		if (document.frmInterSaerch.search.value==""){
			alert("Você deve digitar uma ou mais palavras!");
			document.frmInterSaerch.search.focus();
			return false;
		}
	
		return true
	}

	function winchat (name) {
			 icone = window.open('' + name,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,maximized=no,width=400,height=150,left=100,top=80');
	}

	
	//Função abrejanela
	//O link de ficar = <A HREF="javascript:abrejanela('<%=vcaminho%>')">LINK</A>
	function abrejanela_addurl(name) {
    		icone = window.open('' + name,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,maximized=no,width=610,height=480,left=100,top=80'); 
    	}

	function abrejanela_ajuda(name) {
    		icone = window.open('' + name,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,maximized=no,width=570,height=216,left=100,top=80'); 
    	}

	function fechajanela_ajuda(name) {
    		icone = window.close('' + name,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,maximized=no,width=570,height=188,left=100,top=80'); 
    	}

	function abrejanela_email(name) {
    		icone = window.open('' + name,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,maximized=no,width=250,height=450,left=100,top=80'); 
    	}

	function fechajanela_email(name) {
    		icone = window.close('' + name,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,maximized=no,width=570,height=188,left=100,top=80'); 
    	}

	//Function to count the number of characters in the description text box
	function DescriptionCharCount() {
		document.frmAddURL.countcharacters.value = document.frmAddURL.description.value.length;
	}

	//Function to check that the form is filled in correctly
	function CheckForm () {

		//Check for a category
		if (document.frmAddURL.category.value == ""){
			alert("Selecione uma categoria");
			document.frmAddURL.category.focus();
			return false;
		}

		//Check for a URL title
		if (document.frmAddURL.title.value == ""){
			alert("Digite o nome do site");
			document.frmAddURL.title.focus();
			return false;
		}

		//Check for a URL address
		if (document.frmAddURL.url.value == ""){
			alert("Digite o endereço do site");
			document.frmAddURL.url.focus();
			return false;
		}

		//Check for a URL address after the http: bit
		if (document.frmAddURL.url.value == "http://"){
			alert("Digite o endereço do site");
			document.frmAddURL.url.focus();
			return false;
		}

		//Check for keywords
		if (document.frmAddURL.keywords.value == ""){
			alert("Digite algumas palavras separadas por vírgura, para que seu site seja encontrado facilmente");
			document.frmAddURL.keywords.focus();
			return false;
		}

		//Check for a description
		if (document.frmAddURL.description.value == ""){
			alert("Digite uma pequena descrição do seu site");
			document.frmAddURL.description.focus();
			return false;
		}

		//Check the description length before submiting the form
		if (document.frmAddURL.description.value.length >= 200){
			alert("Desculpe, sua descrição tem mais de 200 caracteres");
			document.frmAddURL.description.focus();
			return false;
		}

		//Check for HTML tags before submitting the form
		for (var count = 0; count <= 3; ++count){
			if ((document.frmAddURL.elements[count].value.indexOf("<", 0) >= 0) && (document.frmAddURL.elements[count].value.indexOf(">", 0) >= 0)){
				alert("Desculpe, comandos HTML não são permitidos");
				document.frmAddURL.elements[count].focus();
				return false;
			}
		}

		//Check for a URL responsavel
		if (document.frmAddURL.responsavel.value == ""){
			alert("Digite o seu nome");
			document.frmAddURL.responsavel.focus();
			return false;
		}


		//Check for a URL email
		if (document.frmAddURL.email.value.length == 0) {
			alert("Digite o seu email !");
			document.frmAddURL.email.focus();
			return false;
		}
		if (document.frmAddURL.email.value.search("@") == -1 || document.frmAddURL.email.value.search("[.*]") == -1)
		{
			alert("O preenchimento do campo >> EMAIL >> está incorreto!");
			document.frmAddURL.email.focus();
			return(false);
		}

		//Check for a URL pais
		if (document.frmAddURL.pais.value == ""){
			alert("Selecione o País");
			document.frmAddURL.pais.focus();
			return false;
		}

	return true;
	}


	var now = new Date();
	var mName = now.getMonth() + 1;
	var dName = now.getDay() + 1;
	var dayNr = ((now.getDate() < 10) ? "0" : "")+ now.getDate();
	var yearNr = now.getYear(); 

	if(dName==1) Day = "Domingo";
	if(dName==2) Day = "Segunda";
	if(dName==3) Day = "Terça";
	if(dName==4) Day = "Quarta";
	if(dName==5) Day = "Quinta";
	if(dName==6) Day = "Sexta";
	if(dName==7) Day = "Sábado";

	if(mName==1) Month="Janeiro";
	if(mName==2) Month="Fevereiro";
	if(mName==3) Month="Março";
	if(mName==4) Month="Abril";
	if(mName==5) Month="Maio";
	if(mName==6) Month="Junho";
	if(mName==7) Month="Julho";
	if(mName==8) Month="Agosto";
	if(mName==9) Month="Setembro";
	if(mName==10) Month="Outubro";
	if(mName==11) Month="Novembro";
	if(mName==12) Month="Dezembro";

	// String to display current date.

	   var todaysDate =("<font size=1> "
	       + Day
	       + ", "
	       + dayNr
	       + " de "
	       + Month
	       + " de "
	       + yearNr
	       + ". ");

	// Write date to page.

	var timerID = null;
	var timerRunning = false;
	function stopclock()
	{
	    if(timerRunning)
		clearTimeout(timerID)
	    timerRunning = false;
	}

	function startclock()
	{
	    stopclock();
	    showtime();
	}

	function showtime()
	{
	    var now = new Date();
	    var hours = now.getHours();
	    var minutes = now.getMinutes();
	    var seconds = now.getSeconds();
	    var timeValue = "" + ((hours > 24) ? hours - 12 : hours);
	    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes;
	    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds;

	    document.clock.face.value = timeValue;
	    timerID = setTimeout("showtime()",1000);
	    timerRunning = true;
	}


	function showMenuTopo(divName)
	{
	 oDiv = document.getElementById(divName);
		oDiv.style.display = "block";
	}

	function hideMenuTopo(divName)
	{
	 oDiv = document.getElementById(divName);
		oDiv.style.display = "none";
	}

	function gravaCookie()
	{
	var expDays = 30;
	var exp = new Date(); 
	exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
	document.cookie = "id_signo =" + id_cookie +"; expires=" + exp.toGMTString(); 
	}

	function showDiv()
	{
	 oDiv = document.getElementById("comentarios");
	 if(oDiv.style.display == "none")
	 {
		oDiv.style.display = "block";
	    document.formComentNot.comentario.focus();
	 }
	 else
	 {
		oDiv.style.display = "none";
	 }
	}

	function showResultDiv(iIdDiv)
	{
	 oDiv = document.getElementById("Result" + iIdDiv);
	 oDiv.style.display = "block";
	}

	function CalcResultTest(PointsResult1, PointsResult2, PointsResult3, PointsResult4)
	{
	objRadio = document.all.tags("input");
	iQuest = objRadio.length / 4;
	iResult = 0;
	for(i=1;i<=iQuest; i++)
	{
		for(j=0;j<=3; j++)
		{
			if(document.all.item(String(i))[j].checked)
			{
				iResult+= Number(document.all.item(String(i))[j].value);
			}
		}
	}
	if(iResult <= PointsResult1)
		{
			return 1;
		}
	else if(iResult > PointsResult1 && iResult <= PointsResult2)
			{
				return 2;
			}
	else if(iResult > PointsResult2 &&iResult  <= PointsResult3)
			{
				return 3;
			}
	else if(iResult > PointsResult3 && iResult <= PointsResult4)
			{
				return 4;
			}

	}


	function mOvr(src,clrOver) {

	 if (!src.contains(event.fromElement)) {

	  src.style.cursor = 'hand';                

	  src.bgColor = clrOver;

	 }



	}

	function mOut(src,clrIn) {

	 if (!src.contains(event.toElement)) {

	  src.style.cursor = 'default';

	  src.bgColor = clrIn;



	 }

	}

	function mClk(src) {

	 if(event.srcElement.tagName=='TD'){

	  src.children.tags('A')[0].click();

	 }



	}



	function MM_findObj(n, d) { //v4.0

	  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 && document.getElementById) x=document.getElementById(n); return x;

	}



	function MM_showHideLayers() { //v3.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 checarBusca(){

	   with(document.busca){

	   //if(engines[engines.selectedIndex].value != "0"){

	      if(searchwords.value == ""){

		 alert("Digite a palavra para a busca");

		 searchwords.focus();

		 return false;

	      }
		  else
		  {
			if(document.busca.engines[document.busca.engines.selectedIndex].value == "portal") {
				document.busca.action = "busca.php";
				document.busca.submit();
			 }else{
				document.busca.action = "busca/busca.php";
				document.busca.submit();
			}	
			 return true;

		  }

	   /*}else{

	     alert('Escolha uma ferramenta de busca');

	     engines.focus();

	     return false;*/


	   //}

	 }

	}



	function valida()

	{



		var indiceEstado = document.frm_parceiro.siglaEstado.selectedIndex;

		var nomeLocalidade = document.frm_parceiro.nomeLocalidade.value;

		var siglaEstado = document.frm_parceiro.siglaEstado[document.frm_parceiro.siglaEstado.selectedIndex].value;



		document.frm_parceiro.abrangencia.value = "";



		if(document.frm_parceiro.palavraChave.value == "")

		{

			alert("Informe a Palavra-chave para realizar a busca.");

			return false;

		} else

			if (siglaEstado=="NOK")

			{

				alert("Selecione um Estado para efetuar a busca, ou selecione a opção Todos Estados.");

				return false;

			} else {



				// Todos

				if(siglaEstado == "0")

				{

					if(nomeLocalidade!="")

					{

						document.frm_parceiro.nomeLocalidade.value = "";

					}

					document.frm_parceiro.abrangencia.value = "Y";

				} else

					if (nomeLocalidade==""){

							alert("Informe uma Cidade para efetuar a busca, ou selecione a opção BR para fazer uma busca em todo o Brasil.");

							return false;

					}



			}



		document.frm_parceiro.palavraChave.value=ajeitarPalavraString(document.frm_parceiro.palavraChave.value);

		document.frm_parceiro.nomeLocalidade.value=ajeitarPalavraString(document.frm_parceiro.nomeLocalidade.value);

		document.frm_parceiro.indiceEstado.value = document.frm_parceiro.siglaEstado.selectedIndex;

		return true;

	}

	function AbreJanela(pCaminho, pX, pY, pZ){

	   window.open (pCaminho,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+ pZ +',resizable=no,width=' + pX + ',height=' + pY + ',top=0,left=0');

	}



	function checarWebmail(){

		with(document.login){

		     if(username.value==""){

			username.focus();

			alert("Favor preencher o campo Email");

			return false;

		     }

		     if((username.value.indexOf('@',0)==-1) || (username.value.indexOf('.',0)==-1)){

			       alert("Entre com o e-mail completo.")

			       username.focus()

			       return false

		     }



		     if(password.value==""){

			password.focus();

			alert("Favor preencher o campo Senha");

			return false;

		     }

		}

	}



	function funcRedireciona(pUrl){

	 if(pUrl != '0'){

	      window.location.href = pUrl;

	 }

	}

	function criticaCometario(){
	    with(document.formComentNot){
		 if (comentario.value==""){
		     alert("Por favor escreva o seu comentário.");
		     comentario.focus();
		     return false;
		 }
	    }
	}

	function openWindow(theURL,winName,features) { 
	  window.open(theURL,winName,features);
	}

	function funcEscolheRegiao(idLocalidade)
	{

	 if (idLocalidade != '')
	     funcRedireciona('cookie_localidade_homenova.php?idLocalidade='+idLocalidade);

	}

	// Contador de caracteres digitados
	function DFtextareaMaxLength(f,length,e, pag){
		if(is.ns){if(e.which==0||e.which==8)return true}
	    StrLen = f.value.length; 
	    if (document.frmCandidato.ass.value.length != "" ){
			StrLen = StrLen + document.frmCandidato.ass.value.length;
	    }

		if(StrLen>=length){
			 var tecla= event.keyCode; 
	//		 alert(tecla);
			 if ( tecla != 8 && tecla != 46 && tecla != 37){ 
				return false;
			 }
			 else if (pag=="Layers") {
				DFtextareaCounter(f,'lentxt');
			 }else if (pag=="MenuDir"){
				escreveContador(f);
			 }
		}	 
	}



	function DFtextareaCounter(f,counter){
	    var CharQtd = 0;
		CharQtd = 151 - (document.frmCandidato.resumo.value.length+document.frmCandidato.ass.value.length);
	    if(CharQtd<0){
		   f.value = f.value.substring(0,f.value.length+CharQtd);
		   CharQtd = 0;
		}
	    eval('f.form.'+counter).value=CharQtd;
	}

	function escreveContador(objCampo){
	    var strContador;
		numCaracteres = 151-(document.frmCandidato.resumo.value.length+document.frmCandidato.ass.value.length);
		if(numCaracteres<0){
		   objCampo.value = objCampo.value.substring(0,objCampo.value.length+numCaracteres);
		   numCaracteres=0;
		}

		strContador = "<span class=f-branco><b>" + numCaracteres + " caracteres restantes</b></span>";
		if (n4){
			document.layers['Contador'].document.write(strContador);
			document.layers['Contador'].document.close();
		}else{
			contador.innerHTML = strContador;
		}
	}

