	/* 
	*****************************************************************************************
	DESENVOLVIDO PELA EQUIPE WEB UNIFRAN
	
	ANO DE DESENVOLVIMENTO: 2009
	TIPO DE SISTEMA: SISTEMA DE INSCRIÇÃO EM PROCESSO SELETIVO
	TIPO DE ARQUIVO: FUNÇÕES EM JAVASCRIPT
	*****************************************************************************************
	*/
	
	
	/* ################################################################################ */
	function isNumeric(evt){
		var charCode = (evt.which) ? evt.which : event.keyCode;
		if ((charCode<48)||(charCode>57)){ // Internet Explorer
			if(charCode==8) return true
			else return false;
		}
	}
	/* ################################################################################ */	
	

	/* ################################################################################ */
	function configCEP(Campo,evt){
		vr=Campo.value;
		tam=vr.length+1;
		if(isNumeric(evt)!=false){
			if(tam==6){
				Campo.value=vr.substr(0,tam-1)+'-';
			}
			return Campo.value;
		}
		else{
			return false;
		}
	}
	/* ################################################################################ */
	
	
	/* ################################################################################ */
	function consultarCEP(campo){
		var vr  = campo.value;
		var tam = campo.value.length;
		if(tam==9){
			xajax_verificarCEP(vr);
		}
	}
	/* ################################################################################ */	
	
	
	/* ################################################################################ */
	function configData(Campo,evt){
		vr=Campo.value;
		tam=vr.length+1;
		if(isNumeric(evt)!=false){
			if(tam==3){
				Campo.value=vr.substr(0,tam-1)+'/';
			}
			else if(tam==6){
				Campo.value=vr.substr(0,tam-1)+'/';
			}
			return Campo.value;
		}
		else{
			return false;
		}
	}
	/* ################################################################################ */	
	
	
	/* ################################################################################ */
	function configURL(Campo,evt){
		vr=Campo.value;
		tam=vr.length+1;
		if(tam==1){
			Campo.value=vr.substr(0,tam-1)+'http://';
		}
		return Campo.value;
	}
	/* ################################################################################ */		
	
	
	/* ################################################################################ */
	function configFone(Campo,evt){
		vr=Campo.value;
		tam=vr.length+1;
		if(isNumeric(evt)!=false){
			if(tam==1){
				Campo.value=vr.substr(0,tam-1)+'(';
			}
			else if(tam==4){
				Campo.value=vr.substr(0,tam-1)+')';
			}
			else if(tam==9){
				Campo.value=vr.substr(0,tam-1)+'-';
			}
			return Campo.value;
		}
		else{
			return false;
		}
	}
	/* ################################################################################ */	
	
	
	/* ################################################################################ */
	function confereEnter_Aprovados(campo,evt){
		var charCode = (evt.which) ? evt.which : event.keyCode;
		if(charCode==13){
			xajax_consultaCodigo(xajax.getFormValues('formConsulta'));
		}
	}	
	
	function confereEnter(campo,evt){
		var charCode = (evt.which) ? evt.which : event.keyCode;
		if(charCode==13){
			xajax_entradaCPF(xajax.getFormValues('formCPF'));
		}
	}
	
	function confereEnter_Itinerante(campo,evt){
		var charCode = (evt.which) ? evt.which : event.keyCode;
		if(charCode==13){
			xajax_entradaCPF_Itinerante(xajax.getFormValues('formCPF'));
		}
	}	
	/* ################################################################################ */	
	
	
	/* ################################################################################ */		
	function controleCaracter(target,qtdeCaracter,exibir){
			var StrLen;
			var corte;
			var nome;
			var adicional;
			var maximo;
			maximo = qtdeCaracter;
			adicional = 0;  // Caracteres que serão adicionados para formatar a mensagem.
			StrLen = adicional;
			corte = StrLen;
			if (document.getElementById(target).value.length != "" )
			{
				StrLen = StrLen + document.getElementById(target).value.length;
			}
			if (StrLen == 1 && document.getElementById(target).value.substring(0,1) == " ")
			{
				document.getElementById(target).value = "";
				StrLen = StrLen - 1;
			}
			if (StrLen > qtdeCaracter)
			{
				document.getElementById(target).value = document.getElementById(target).value.substring(0,qtdeCaracter);
				StrLen = StrLen - 1;
			}
		   document.getElementById(exibir).value = qtdeCaracter - StrLen;
	}	
	/* ################################################################################ */	
	
	
	/* ################################################################################ */
	function validaEmail(){
			prim = document.formulario.EMAIL.value.indexOf("@")
			if(prim < 2) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("@",prim + 1) != -1) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf(".") < 1) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf(" ") != -1) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("zipmeil.com") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("hotmeil.com") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf(".@") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("@.") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf(".com.br.") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("/") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf(";") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("[") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("]") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("(") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf(")") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
			if(document.formulario.EMAIL.value.indexOf("..") > 0) {
				alert("E-mail inválido. Por favor, verifique !");
				document.formulario.EMAIL.focus();
				document.formulario.EMAIL.select();
				return false;
			}
	}
	/* ################################################################################ */
			
	
		
