<!--
// JavaScript Document

// DIMINUI E AUMENTA FONT


// Início do código de Aumentar/ Diminuir a letra
 
// Para usar coloque o comando: "javascript:mudaTamanho('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:mudaTamanho('tag_ou_id_alvo', +1);" para aumentar
 
var tagAlvo = new Array('p'); //pega todas as tags p//
 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array( '9px','10px','11px','12px','13px','14px','15px','16px','17px','18px','19px','20px','21px','22px' );
var tamanhoInicial = 4;

function mudaTamanho( idAlvo,acao ){
  if (!document.getElementById) return
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho += acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 13 ) tamanho = 13;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
  selecionados.style.fontSize = tamanhos[ tamanho ];
  
  for ( i = 0; i < tagAlvo.length; i++ ){
    tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );
    for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];
  }
}
//POPUP IMPRESSÃO
function popImpressao(obj){
	window.open('impressao.php?post='+obj,'Impressao','toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=756,height=500');
}

//SHOW/HIDE DIV
function showHideDiv(id){
	ID = document.getElementById(id);
	if(ID.style.display == "block")
	     ID.style.display = "none";
	else
	     ID.style.display = "block";
}
function confereEnviaPostEmail(){
	if(document.getElementById('nomeUsuario').value == ""){
	   alert("Coloque seu nome.");
	   document.getElementById('nomeUsuario').focus();
	   return false;
   }else if(document.getElementById('emailUsuario').value == ""){
	   alert("Coloque seu e-mail.");
	   document.getElementById('emailUsuario').focus();
	   return false;
   }else if(document.getElementById('nomeAmigo').value == ""){
	   alert("Coloque o nome do(a) amigo(a).");
	   document.getElementById('nomeAmigo').focus();
	   return false;
   }else if(document.getElementById('emailAmigo').value == ""){
	   alert("Coloque o e-mail do(a) amigo(a).");
	   document.getElementById('emailAmigo').focus();
	   return false;
   }else{
 	mail ='nomeUsuario='+document.getElementById('nomeUsuario').value+'&emailUsuario='+document.getElementById('emailUsuario').value+'&nomeAmigo='+document.getElementById('nomeAmigo').value+'&emailAmigo='+document.getElementById('emailAmigo').value+'&idPost='+document.getElementById('idPost').value;
	atualiza("sistema/enviaPostEmail.php", mail, "enviaEmail", "");
   }
}
function confereManualPara(){
   if(document.getElementById('conteudoManualPara').value == ""){
	   alert("Poste um conteúdo");
	   document.getElementById('conteudoManualPara').focus();
	   return false;
   }else{
   valoresManualPara ='manual_pk='+document.getElementById('manual_pk').value+'&idTemas='+document.getElementById('idTemas').value+'&conteudoManualPara='+document.getElementById('conteudoManualPara').value;
	//alert(valoresManualPara);
   atualiza("sistema/manualPara_action.php", valoresManualPara, "manualParaForm", "manualPara");
   //return true;
  }
}
function confereComentarioTarefa(){
   if(document.getElementById('conteudoComentarioTarefa').value == ""){
	   alert("Poste um conteúdo");
	   document.getElementById('conteudoComentarioTarefa').focus();
	   return false;
   }else{
   valoresComentarioTarefa ='&idTemas='+document.getElementById('idTemas').value+'&conteudoComentarioTarefa='+document.getElementById('conteudoComentarioTarefa').value+'&idTarefa='+document.getElementById('idTarefa').value;
   atualiza("sistema/tarefaComentario_action.php", valoresComentarioTarefa, "TarefaForm", "");
   //return true;
  }
}
function confereTarefaPost(){
	var o = 1;
	if(document.getElementById('conteudoPosts').value != ""){
		o++;
	}
	valoresTarefa ='&idTemas='+document.getElementById('idTemas').value+'&conteudoPosts='+document.getElementById('conteudoPosts').value;
	if(document.getElementById('videoPosts')){
		valoresTarefa += '&videoPosts='+document.getElementById('videoPosts').value;
		o++;
	}
	if(document.getElementById('nomeMp3')){
		valoresTarefa += '&mp3Posts='+document.getElementById('nomeMp3').value;
		o++;
	}
	if(document.getElementById('valorImg')){
		valoresTarefa += '&imgPosts='+document.getElementById('valorImg').value;
		o++;
	}
	if(o == 1){
	   alert("Poste algum conteúdo");
	   return false;
   }
  	atualiza("sistema/tarefa_action.php", valoresTarefa, "TarefaForm", "");
}
function confereRespostaPosts()
{
	if(document.getElementById('tituloPosts').value == "")
	{
		alert("Poste o título da resposta");
		document.getElementById('tituloPosts').focus();
		return false;
	}
	
	if(document.getElementById('conteudoPosts').value == "")
	{
		alert("Poste o conteúdo da resposta");
		document.getElementById('conteudoPosts').focus();
		return false;
	}
	else
	{
		valoresComentarioPosts = '&idTemas='+document.getElementById('idTemas').value+'&conteudoPosts='+document.getElementById('conteudoPosts').value+'&tituloPosts='+document.getElementById('tituloPosts').value+'&idPost='+document.getElementById('idPost').value+'&idArea='+document.getElementById('idArea').value;
		if(document.getElementById('videoPosts')){
			  valoresComentarioPosts += '&videoPosts='+document.getElementById('videoPosts').value;
		}
		if(document.getElementById('nomeMp3')){
			  valoresComentarioPosts += '&mp3Posts='+document.getElementById('nomeMp3').value;
		}
		if(document.getElementById('valorImg')){
			  valoresComentarioPosts += '&imgPosts='+document.getElementById('valorImg').value;
		}
		
		atualiza("sistema/postsResposta_action.php", valoresComentarioPosts, "postsForm", "");
	}
}

function confereCadastroPosts()
{
	if(document.getElementById('tituloPosts').value == "")
	{
	   alert("Coloque o título do post");
	   document.getElementById('tituloPosts').focus();
	   return false;
	}
	else
	{
		if(document.getElementById('conteudoPosts').value == "")
		{
		   alert("Poste um conteúdo");
		   document.getElementById('conteudoPosts').focus();
		   return false;
		}
		else
		{
			valoresPosts  = '&idTemas='+document.getElementById('idTemas').value;
			valoresPosts += '&conteudoPosts='+document.getElementById('conteudoPosts').value+'&idPost='+document.getElementById('idPost').value+'&tituloPosts='+document.getElementById('tituloPosts').value;
			valoresPosts += '&idPost='+document.getElementById('idPost').value+'&tituloPosts='+document.getElementById('tituloPosts').value;
			valoresPosts += '&tituloPosts='+document.getElementById('tituloPosts').value;
			valoresPosts += '&idArea='+document.getElementById('idArea').value;
			
			if(document.getElementById('videoPosts')){
				valoresPosts += '&videoPosts='+document.getElementById('videoPosts').value;
			}
			
			if(document.getElementById('nomeMp3')){
				valoresPosts += '&mp3Posts='+document.getElementById('nomeMp3').value;
			}
			
			if(document.getElementById('valorImg')){
				valoresPosts += '&imgPosts='+document.getElementById('valorImg').value;
			}
			
			atualiza("sistema/posts_action.php", valoresPosts, "PostsForm", "");
		}
	}
}

function campo(obj){
	if(obj=="c"){
		videoPosts ='&videoPost='+document.getElementById('videoPost').value;
		atualiza("inc/campoVideo.php", videoPosts, "videoPost", "");
	//return true;
	}else if(obj=="m"){
		mp3Posts ='&mp3Post='+document.getElementById('mp3Post').value;
		atualiza("inc/campoMp3.php", mp3Posts, "mp3Post", "");
	}else if(obj=="i"){
		imgPosts ='&imgPost='+document.getElementById('imgPost').value;
		atualiza("inc/campoImg.php", imgPosts, "imgPost", "");
	}
}


//
function consultarExistenciaLogin(){
	if(document.getElementById('usuarios_login').value == ""){
	   alert("Coloque seu login");
	   document.getElementById('usuarios_login').focus();
	   return false;
   }else{
		voltaExistenciaLogin='loginUsuario='+document.getElementById("usuarios_login").value;
		atualiza("sistema/existenciaLogin.php", voltaExistenciaLogin, "retornoExistencia", "");
	}
}
// CADASTRO
function cadastroStart(){
	voltaCadastro = 'usuarios_nome='+document.getElementById("usuarios_nome").value;
	voltaCadastro +='&usuarios_nasc='+document.getElementById("usuarios_nasc").value;
	voltaCadastro +='&usuarios_sexo='+document.getElementById("usuarios_sexo").value;
	voltaCadastro +='&usuarios_nacionalidade='+document.getElementById("usuarios_nacionalidade").value;
//	voltaCadastro +='&usuarios_logradouro='+document.getElementById("usuarios_logradouro").value;
//	voltaCadastro +='&usuarios_numero='+document.getElementById("usuarios_numero").value;
//	voltaCadastro +='&usuarios_cidade='+document.getElementById("usuarios_cidade").value;
//	voltaCadastro +='&usuarios_uf='+document.getElementById("usuarios_uf").value;
//	voltaCadastro +='&usuarios_cep='+document.getElementById("usuarios_cep").value;
	voltaCadastro +='&usuarios_login='+document.getElementById("usuarios_login").value;
	voltaCadastro +='&usuarios_complemento='+document.getElementById("usuarios_complemento").value;
	voltaCadastro +='&usuarios_senha='+document.getElementById("usuarios_senha").value;
	voltaCadastro +='&usuarios_email='+document.getElementById("usuarios_email").value;
	voltaCadastro +='&usuarios_webSiteBolgFotolog='+document.getElementById("usuarios_webSiteBolgFotolog").value;
	voltaCadastro +='&usuarios_divulgarPerfil='+document.getElementById("usuarios_divulgarPerfil").value;
	voltaCadastro +='&paginaSubmit='+document.getElementById("paginaSubmit").value;
	atualiza("inc/cadastro.php", voltaCadastro, "cadastro", "");
}
function cadastroLogado(){
	logaCadastro ='';
	atualiza("inc/menuHeader.php", logaCadastro, "headerMenu", "");
}
function confereCadastro()
{
   if(document.getElementById('usuarios_nome').value == "")
   {
	   alert("Coloque seu nome");
	   document.getElementById('usuarios_nome').focus();
	   return false;
   }
   
   if(document.getElementById('usuarios_nasc').value == "")
   {
	   alert("Preencha o campo nascimento.");
	   document.getElementById('usuarios_nasc').focus();
	   return false;
   }
   
   if(document.getElementById('usuarios_sexoF').checked == false && document.getElementById('usuarios_sexoM').checked == false)
   {
	   alert("Diga seu sexo.");
	   document.getElementById('usuarios_sexoM').focus();
	   return false;
   }
   
   if(document.getElementById('usuarios_nacionalidade').value == "")
   {
	   alert("Preencha sua nacionalidade.");
	   document.getElementById('usuarios_nacionalidade').focus();
	   return false;
   }
   
   /* CAIO - BOX DE ENDEREÇO REMOVIDO (ITEM 1) */
//   if(document.getElementById('usuarios_logradouro').value == "")
//   {
//	   alert("Preencha seu logradouro.");
//	   document.getElementById('usuarios_logradouro').focus();
//	   return false;
//   }
//   
//   if(document.getElementById('usuarios_cidade').value == "")
//   {
//	   alert("Preencha sua cidade.");
//	   document.getElementById('usuarios_cidade').focus();
//	   return false;
//   }
//   
//   if(document.getElementById('usuarios_uf').value == ""){
//	   alert("Preencha sua UF.");
//	   document.getElementById('usuarios_uf').focus();
//	   return false;
//   }
//   
//   if(document.getElementById('usuarios_cep').value == ""){
//	   alert("Preencha seu CEP.");
//	   document.getElementById('usuarios_cep').focus();
//	   return false;
//   }
   
   if(document.getElementById('usuarios_login').value == ""){
	   alert("Preencha seu login.");
	   document.getElementById('usuarios_login').focus();
	   return false;
   }
   
   if(document.getElementById('usuarios_senha').value == ""){
	   alert("Preencha sua senha.");
	   document.getElementById('usuarios_senha').focus();
	   return false;
   }
   
   if(document.getElementById('confSenha').value != document.getElementById('usuarios_senha').value){
	   alert("A confirmação de senha não bate com a senha.");
	   document.getElementById('confSenha').focus();
	   return false;
   }
   
   if(document.getElementById('usuarios_email').value == ""){
	   alert("Preencha seu e-mail.");
	   document.getElementById('usuarios_email').focus();
	   return false;
   }
   
   if(document.getElementById('concordo') && document.getElementById('concordo').checked==false){
	   alert("Aceite o termo");
	   document.getElementById('concordo').focus();
	   return false;
   }
   
	valores='acao='+document.getElementById('acao').value;
	valores +='&usuarios_nome='+document.getElementById('usuarios_nome').value;
	valores +='&usuarios_sexo='+document.getElementById('usuarios_sexo').value;
	valores +='&usuarios_nacionalidade='+document.getElementById('usuarios_nacionalidade').value;
	valores +='&usuarios_nasc='+document.getElementById('usuarios_nasc').value;
//	valores +='&usuarios_logradouro='+document.getElementById('usuarios_logradouro').value;
//	valores +='&usuarios_numero='+document.getElementById('usuarios_numero').value;
//	valores +='&usuarios_complemento='+document.getElementById('usuarios_complemento').value;
//	valores +='&usuarios_cidade='+document.getElementById('usuarios_cidade').value;
//	valores +='&usuarios_uf='+document.getElementById('usuarios_uf').value;
//	valores +='&usuarios_cep='+document.getElementById('usuarios_cep').value;
	valores +='&usuarios_login='+document.getElementById('usuarios_login').value;
	valores +='&usuarios_senha='+document.getElementById('usuarios_senha').value;
	valores +='&usuarios_email='+document.getElementById('usuarios_email').value;
	valores +='&usuarios_webSiteBolgFotolog='+document.getElementById('usuarios_webSiteBolgFotolog').value;
	valores +='&usuarios_divulgarPerfil='+document.getElementById('usuarios_divulgarPerfil').value;
	valores +='&usuarios_img='+document.getElementById('usuarios_img').value;
	valores +='&paginaSubmit='+document.getElementById('paginaSubmit').value;
	atualiza("sistema/cadastro_action.php", valores, "cadastro", "");
	window.location.href='#topoPagina';
	//return true;
}
// START LOGIN
function loginStart(){
	voltaLogin="";
	atualiza("login1.php", voltaLogin, "loginForm", "");
}
function confereLogin(){
   if(document.getElementById('loginUsuario').value == ""){
	   alert("Coloque seu login");
	   document.getElementById('loginUsuario').focus();
	   return false;
   }else if(document.getElementById('senhaUsuario').value == ""){
	   alert("Coloque sua senha.");
	   document.getElementById('senhaUsuario').focus();
	   return false;
   }else{
   valoresLogin ='loginUsuario='+document.getElementById("loginUsuario").value+'&senhaUsuario='+document.getElementById("senhaUsuario").value;
   atualiza("sistema/login_action.php", valoresLogin, "loginForm", "login");
   //return true;
  }
}
// ESQUECI MINHA SENHA
function esqueciMinhaSenhaStart(){
	voltaEsqueci="";
	atualiza("esqueciMinhaSenha.php", voltaEsqueci, "esqueciMinhaSenha", "");
}

function confereEsqueciMinhaSenha(){
	if(document.getElementById('emailUsuario').value == ""){
	   alert("Coloque seu e-mail");
	   document.getElementById('emailUsuario').focus();
	   return false;
   }else{
   		voltaEsqueciMinhaSenha='emailUsuario='+document.getElementById('emailUsuario').value;
		atualiza("sistema/esqueciMinhaSenha_action.php", voltaEsqueciMinhaSenha, "esqueciMinhaSenha", "");
   }
}
///////////////////////////////
/*# CPF */
 function validarCPF (obj){
   var cpf = document.getElementById(obj).value;
   var filtro = /^\d{3}.\d{3}.\d{3}-\d{2}$/i;
   if(!filtro.test(cpf)){
     window.alert("CPF inválido. Tente novamente.");
	 document.getElementById(obj).value="";
	 return false;
   }
   
   cpf = remove(cpf, ".");
   cpf = remove(cpf, "-");
    
   if(cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" ||
	  cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" ||
	  cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" ||
	  cpf == "88888888888" || cpf == "99999999999"){
	  window.alert("CPF inválido. Tente novamente.");
	 document.getElementById(obj).value="";
	  return false;
   }

   soma = 0;
   for(i = 0; i < 9; i++)
   	 soma += parseInt(cpf.charAt(i)) * (10 - i);
   resto = 11 - (soma % 11);
   if(resto == 10 || resto == 11)
	 resto = 0;
   if(resto != parseInt(cpf.charAt(9))){
	 window.alert("CPF inválido. Tente novamente.");
	 document.getElementById(obj).value="";
	 return false;
   }
   soma = 0;
   for(i = 0; i < 10; i ++)
	 soma += parseInt(cpf.charAt(i)) * (11 - i);
   resto = 11 - (soma % 11);
   if(resto == 10 || resto == 11)
	 resto = 0;
   if(resto != parseInt(cpf.charAt(10))){
     window.alert("CPF inválido. Tente novamente.");
	 document.getElementById(obj).value="";
	 return false;
   }
 	//window.alert("CPF valido.");
  //return false;
 }
 
 function remove(str, sub) {
   i = str.indexOf(sub);
   r = "";
   if (i == -1) return str;
   r += str.substring(0,i) + remove(str.substring(i + sub.length), sub);
   return r;
 }

/*# */
function pergunta(pagina,texto){
var name = confirm(texto)
	if (name == true){
		window.location=pagina;
	}
}

 /*# MUDA PARA O PROXIMO CAMPO # */
function proximoCampo(valor, campo1, campo2){
	var v = document.getElementById(campo1).value;
	if(v.length==valor){
		document.getElementById(campo2).focus();
	}
}

/*#SO NUMERO#*/
var reDigits = /^\d+$/;
function doDigits(pStr, path){
	if (reDigits.test(pStr)) {
		//alert(pStr + " contém apenas dã­gitos.");
	} else if (pStr != null && pStr != "") {
		//alert(pStr + " Não contém apenas dã­gitos.");
		document.getElementById(path).value = pStr.substring(0,(pStr.length-1));
	}
}

/*# MOEDA */
var reMoeda = /^\d{1,3}(\.\d{3})*\,\d{2}$/;
function doMoeda(pStr, path){
	if (reMoeda.test(pStr)) {
		//alert(pStr + " é um valor financeiro válido.");
	} else if (pStr != null && pStr != "") {
		alert(pStr + " Não é um valor financeiro válido.");
		document.getElementById(path).focus();
	}
}

/*# TELEFONE */
padraoFone = /\d{4}-\d{4}/;
//padraoFone = /\(?\d{2}\)?\d{4}-\d{4}/;
function testFone(x) {
   a = x.Phone.value;
   OK = padraoFone.exec(a);
   if ( !OK ){
       window.alert ("Este numero de telefone esta incorreto!");
       x.Phone.focus();
   }
   else {
       window.alert ("Obrigado, seu numero de telefone é: " + OK[0]);
   }
}

/*# MASCARA */
function txtBoxFormat(objeto, sMask, evtKeyPress) {
    var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;


if(document.all) { // Internet Explorer
    nTecla = evtKeyPress.keyCode;
} else if(document.layers) { // Nestcape
    nTecla = evtKeyPress.which;
} else {
    nTecla = evtKeyPress.which;
    if (nTecla == 8) {
        return true;
    }
}

    sValue = objeto.value;

    // Limpa todos os caracteres de formataã§ã£o que
    // jã¡ estiverem no campo.
    sValue = sValue.toString().replace( "-", "" );
    sValue = sValue.toString().replace( "-", "" );
    sValue = sValue.toString().replace( ".", "" );
    sValue = sValue.toString().replace( ".", "" );
    sValue = sValue.toString().replace( "/", "" );
    sValue = sValue.toString().replace( "/", "" );
    sValue = sValue.toString().replace( ":", "" );
    sValue = sValue.toString().replace( ":", "" );
    sValue = sValue.toString().replace( "(", "" );
    sValue = sValue.toString().replace( "(", "" );
    sValue = sValue.toString().replace( ")", "" );
    sValue = sValue.toString().replace( ")", "" );
    sValue = sValue.toString().replace( " ", "" );
    sValue = sValue.toString().replace( " ", "" );
    fldLen = sValue.length;
    mskLen = sMask.length;

    i = 0;
    nCount = 0;
    sCod = "";
    mskLen = fldLen;

    while (i <= mskLen) {
      bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":"))
      bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))

      if (bolMask) {
        sCod += sMask.charAt(i);
        mskLen++; }
      else {
        sCod += sValue.charAt(nCount);
        nCount++;
      }

      i++;
    }

    objeto.value = sCod;

    if (nTecla != 8) { // backspace
      if (sMask.charAt(i-1) == "9") { // apenas nãºmeros...
        return ((nTecla > 47) && (nTecla < 58)); } 
      else { // qualquer caracter...
        return true;
      } 
    }
    else {
      return true;
    }
  }
//<input type="text" size="20" onkeypress="return txtBoxFormat(this, '999.999.999-99', event);" maxlength="14"> XXX.XXX.XXX-XX

//////////

/*
 Padawan's JavaScript-Mega-Validator 3000+
 Todos os direitos reservados para Diego Pires Plentz
 Vocãª pode usar esse cã³digo nas suas pã¡ginas desde que mantenha os créditos ;-)
 */
 
 //Verifica qual o browser do visitante e armazena na variã¡vel pãºbica clientNavigator,
 //Caso Internet Explorer(IE) outros (Other)
 if (navigator.appName.indexOf('Microsoft') != -1){
 	clientNavigator = "IE";
 }else{
 	clientNavigator = "Other";
 }
 function Verifica_Data(data, obrigatorio){
 //Se o parã¢metro obrigatã³rio for igual ã  zero, significa que elepode estar vazio, caso contrã¡rio, não
  var data = document.getElementById(data);
 	var strdata = data.value;
 	if((obrigatorio == 1) || (obrigatorio == 0 && strdata != "")){
 		//Verifica a quantidade de digitos informada esta correta.
 		if (strdata.length != 10){
 			alert("Formato da data não é válido. Formato correto: - dd/mm/aaaa.");
			data.value="";
 			data.focus();
 			return false
 		}
 		//Verifica mã¡scara da data
 		if ("/" != strdata.substr(2,1) || "/" != strdata.substr(5,1)){
 			alert("Formato da data não é válido. Formato correto: - dd/mm/aaaa.");
			data.value="";
 			data.focus();
 			return false
 		}
 		dia = strdata.substr(0,2)
 		mes = strdata.substr(3,2);
 		ano = strdata.substr(6,4);
 		//Verifica o dia
 		if (isNaN(dia) || dia > 31 || dia < 1){
 			alert("Formato do dia não é válido.");
			data.value="";
 			data.focus();
 			return false
 		}
 		if (mes == 4 || mes == 6 || mes == 9 || mes == 11){
 			if (dia == "31"){
 				alert("O mês informado não possui 31 dias.");
				data.value="";
 				data.focus();
 				return false
 			}
 		}
 		if (mes == "02"){
 			bissexto = ano % 4;
 			if (bissexto == 0){
 				if (dia > 29){
 					alert("O mês informado possui somente 29 dias.");
					data.value="";
 					data.focus();
 					return false
 				}
 			}else{
 				if (dia > 28){
 					alert("O mês informado possui somente 28 dias.");
					data.value="";
 					data.focus();
 					return false
 				}
 			}
 		}
 	//Verifica o mês
 		if (isNaN(mes) || mes > 12 || mes < 1){
 			alert("Formato do mês não é válido.");
			data.value="";
 			data.focus();
 			return false
 		}
 		//Verifica o ano
 		if (isNaN(ano)){
 			alert("Formato do ano não é válido.");
			data.value="";
 			data.focus();
 			return false
 		}
 	}
 }
 
 /*# COMPARA DUAS DATAS */
 function Compara_Datas(data_inicial, data_final){
 	//Verifica se a data inicial é maior que a data final
 	var data_inicial = document.getElementById(data_inicial);
 	var data_final   = document.getElementById(data_final);
 	str_data_inicial = data_inicial.value;
 	str_data_final   = data_final.value;
 	dia_inicial      = data_inicial.value.substr(0,2);
 	dia_final        = data_final.value.substr(0,2);
 	mes_inicial      = data_inicial.value.substr(3,2);
 	mes_final        = data_final.value.substr(3,2);
 	ano_inicial      = data_inicial.value.substr(6,4);
 	ano_final        = data_final.value.substr(6,4);
 	if(ano_inicial > ano_final){
 		alert("A data inicial deve ser menor que a data final."); 
 		data_inicial.focus();
 		return false
 	}else{
  	if(ano_inicial == ano_final){
   	if(mes_inicial > mes_final){
    	alert("A data inicial deve ser menor que a data final.");
 				data_final.focus();
 				return false
 			}else{
 				if(mes_inicial == mes_final){
 					if(dia_inicial > dia_final){
 						alert("A data inicial deve ser menor que a data final.");
 						data_final.focus();
 						return false
 					}
 				}
 			}
 		}
 	}
 }
 
 function Verifica_Hora(hora, obrigatorio){
 //Se o parã¢metro obrigatã³rio for igual ã  zero, significa que elepode estar vazio, caso contrã¡rio, não
 	var hora = document.getElementById(hora);
 	if((obrigatorio == 1) || (obrigatorio == 0 && hora.value != "")){
 		if(hora.value.length < 5){
 			alert("Formato da hora invválido. Por favor, informe a hora no formato correto: hh:mm");
 			hora.focus();
 			return false
 		}
 		if(hora.value.substr(0,2) > 23 || isNaN(hora.value.substr(0,2))){
 			alert("Formato da hora inválido.");
 			hora.focus();
 			return false
 		}
 		if(hora.value.substr(3,2) > 59 || isNaN(hora.value.substr(3,2))){
 			alert("Formato do minuto inválido.");
 			hora.focus();
 			return false
 		}
 	}
 }
 
  /*# VERIFICA E-MAIL */
var reEmail1 = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
var reEmail2 = /^[\w-]+(\.[\w-]+)*@(([\w-]{2,63}\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
var reEmail3 = /^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
var reEmail = reEmail3;
 function doEmail(obj){
 eval("reEmail = reEmail" + 3);
 pStr = document.getElementById(obj).value;
	if (reEmail.test(pStr)) {
		//alert(pStr + " é um endereço de e-mail válido.");
	} else if (pStr != null && pStr != "") {
		alert(pStr + " não é um endereço de e-mail válido.");
		document.getElementById(obj).value="";
		document.getElementById(obj).focus();
		return false;
	}
} // doEmai
 
 
 /*# TAMANHO DO CAMPO */
 function Verifica_Tamanho(campo, tamanho){
 //usado para campos textarea onde não se tem o atributo maxlenght
 	var campo = document.getElementById(campo);
 	if(campo.value.length > tamanho){
 		alert("O campo suporta no máximo " + tamanho + " caracteres.");
 		campo.focus();
 		return false
 	}
 }
 
 function Verifica_Cep(cep, obrigatorio){
 //Se o parã¢metro obrigatã³rio for igual ã  zero, significa que elepode estar vazio, caso contrã¡rio, não
 	var cep    = document.getElementById(cep);
 	var strcep = cep.value;
 	if((obrigatorio == 1) || (obrigatorio == 0 && strcep != "")){
 		if (strcep.length != 9){
 			alert("CEP informado inválido.");
 			cep.focus();
 			return false
 		}else{
 			if (strcep.indexOf("-") != 5){
 				alert("Formato de CEP informado inválido.");
 				cep.focus();
 				return false
 			}else{
 				if (isNaN(strcep.replace("-","0"))){
 					alert("CEP informado inválido.");
 					cep.focus();
 					return false
 				}
 			}
 		}
 	}	  
 }
 
 function Bloqueia_Caracteres(evnt){
 //Funã§ã£o permite digitaã§ã£o de nãºmeros
 	if (clientNavigator == "IE"){
 		if (evnt.keyCode < 48 || evnt.keyCode > 57){
 			return false
 		}
 	}else{
 		if ((evnt.charCode < 48 || evnt.charCode > 57) && evnt.keyCode == 0){
 			return false
 		}
 	}
 }
 
 function Ajusta_Data(input, evnt){
 //Ajusta mã¡scara de Data e sã³ permite digitaã§ã£o de nãºmeros
 	if (input.value.length == 2 || input.value.length == 5){
 		if(clientNavigator == "IE"){
 			input.value += "/";
 		}else{
 			if(evnt.keyCode == 0){
 				input.value += "/";
 			}
 		}
 	}
 //Chama a funã§ã£o Bloqueia_Caracteres para sã³ permitir a digitaã§ã£o de nãºmeros
 	return Bloqueia_Caracteres(evnt);
 }
 
 function Ajusta_Hora(input, evnt){
 //Ajusta mã¡scara de Hora e sã³ permite digitaã§ã£o de nãºmeros
 	if (input.value.length == 2){
 		if(clientNavigator == "IE"){
 			input.value += ":";
 		}else{
 			if(evnt.keyCode == 0){
 				input.value += ":";
 			}
 		}
 	}
 //Chama a funã§ã£o Bloqueia_Caracteres para sã³ permitir a digitaã§ã£o de nãºmeros
 	return Bloqueia_Caracteres(evnt);
 }
 
 function Ajusta_Cep(input, evnt){
 //Ajusta mã¡scara de CEP e sã³ permite digitaã§ã£o de nãºmeros
 	if (input.value.length == 5){
 		if(clientNavigator == "IE"){
 			input.value += "-";
 		}else{
 			if(evnt.keyCode == 0){
 				input.value += "-";
 			}
 		}
 	}
 //Chama a funã§ã£o Bloqueia_Caracteres para sã³ permitir a digitaã§ã£o de nãºmeros
 	return Bloqueia_Caracteres(evnt);
 }
 
 function Atualiza_Opener(){
 //Atualiza a pã¡gina opener da popup que chamar a funã§ã£o
 	window.opener.location.reload();
 }

 /*
 <input name="data" type="text" id="data" maxlength="10" onKeypress="return Ajusta_Data(this, event);"> 
 <input name="hora" type="text" id="hora" maxlength="5" onKeypress="return Ajusta_Hora(this, event);"> 
 <input name="cep" type="text" id="cep" maxlength="9" onKeypress="return Ajusta_Cep(this, event);">
 <input name="numero" type="text" id="numero" maxlength="20" onKeypress="return Bloqueia_Caracteres(event);""> 
*/


function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->