/////////////////////////função list menu
	function MascaraEntrada(Campo, Mascara) 
	{ 
	var Tecla = window.event.keyCode; 
	var ValorCampo = Campo.value; 
	var Seps = ".-,:;/"; 
	var EstaMascara = Mascara.substring(ValorCampo.length,ValorCampo.length+1); 
	var ProxMascara = Mascara.substring(ValorCampo.length+1,ValorCampo.length+2); 
	var Ret=false; 
	// BackSpace ou TAB 
	if (Tecla==8 || Tecla==9 || window.event.ctrlKey==true) { return true; } 
	// Números 
	if (Tecla>47 && Tecla<58 && (EstaMascara=="#" || EstaMascara=="?")==true) { Ret=true; } 
	// Letras 
	if (Tecla>96 && Tecla<123 && (EstaMascara=="@" || EstaMascara=="?")==true) { Ret=true; } 
	if (Tecla>64 && Tecla<91 && (EstaMascara=="@" || EstaMascara=="?")==true) { Ret=true; } 
	if (Ret==true) 
	{ 
	Campo.value=Campo.value+String.fromCharCode(Tecla); 
	if (Seps.indexOf(ProxMascara)>-1) 
	{ 
	Campo.value=Campo.value+ProxMascara; 
	} 
	} 
	return false; 
	} 

function load1(form) {
     		var url = form.cidades.options[form.cidades.selectedIndex].value;
		     if (url != '') location.href = url;
     			return false;
							}
// /////////////////////função layers dreamweaver
<!--
/*
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_showHideLayers() { //v6.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; }
}*/
/////////////////////////////////////////////////////////////////////////////////////////////////////

///////Esse é o carinha para remover o bug que a div fica por baixo do select do form/////////////

/////////////////////DIV META RH
	function MostraDiv_RH(state)
	{
	var DivRef = document.getElementById('rh_vagas');
	var IfrRef = document.getElementById('DivMestra');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	function MostraDiv2_RH(state)
	{
	var DivRef = document.getElementById('rh_servicos');
	var IfrRef = document.getElementById('DivMestra2');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}	
	
	function MostraDiv3_RH(state)
	{
	var DivRef = document.getElementById('rh_curriculo');
	var IfrRef = document.getElementById('DivMestra3');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	
	function MostraDiv4_RH(state)
	{
	var DivRef = document.getElementById('rh_dicas');
	var IfrRef = document.getElementById('DivMestra4');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}	
	
	
	function MostraDiv5_RH(state)
	{
	var DivRef = document.getElementById('rh_assessoria');
	var IfrRef = document.getElementById('DivMestra5');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
		function MostraDiv6_RH(state)
	{
	var DivRef = document.getElementById('meta_net');
	var IfrRef = document.getElementById('DivMestra6');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
/////////////////////DIV META CONTABIL
	function MostraDiv_Meta(state)
	{
	var DivRef = document.getElementById('meta_servicos_contabeis');
	var IfrRef = document.getElementById('DivMestra');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	function MostraDiv2_Meta(state)
	{
	var DivRef = document.getElementById('meta_gestao_estrategica');
	var IfrRef = document.getElementById('DivMestra2');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	function MostraDiv4_Meta(state)
	{
	var DivRef = document.getElementById('assessoria_metacon');
	var IfrRef = document.getElementById('DivMestra4');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	function MostraDiv3_Meta(state)
	{
	var DivRef = document.getElementById('assessoria1_metacon');
	var IfrRef = document.getElementById('DivMestra3');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	function MostraDiv4_Meta(state)
	{
	var DivRef = document.getElementById('assessoria_metacon');
	var IfrRef = document.getElementById('DivMestra4');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	
	
	
	function MostraDiv7_Meta(state)
	{
	var DivRef = document.getElementById('assessoria2_metacon');
	var IfrRef = document.getElementById('DivMestra7');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
//////////////////////////DIV PRUMO
	
	function MostraDiv_Prumo(state)
	{
	var DivRef = document.getElementById('prumo_serv_gerenc');
	var IfrRef = document.getElementById('DivMestra');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}
	
	function MostraDiv2_Prumo(state)
	{
	var DivRef = document.getElementById('assessoria_prumo');
	var IfrRef = document.getElementById('DivMestra2');
	if(state)
	{
		
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
	}	
//////////////////////////////////////////////////////////////////////////////////-->


/////////////////////função botão over
<!--
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];}
}
//////////////////////////////////////////////////////////////////////////////////-->

/////////////////////////////////////////////////////////////////////////////////////valida ouvidoria
String.prototype.trim = function() {
		var x = this;
		x = x.replace(/^\s*(.*)/, "$1");
		x = x.replace(/(.*?)\s*$/, "$1");
		return x;
		}
		
	function valida_ouvidoria() { 
	if (document.form.txtnome.value.trim() == '') { 
	alert("Por favor, informe o campo Nome!")
	document.form.txtnome.focus();
	return false; 
	}
	aux = 0
	if (aux==0) {
	if (document.form.txtemail.value.indexOf("@") < 0){
	aux=1;
	alert("Por favor, informe o campo e-mail no formato seu@email.com.br")
	document.form.txtemail.focus();
	return false;
	}
	}
	if (aux==0) {
	if (document.form.txtemail.value.indexOf(".") < 0){
	aux=1;
	alert("Por favor, informe o campo e-mail no formato seu@email.com.br");
	document.form.txtemail.focus();
	return false;
	}
	}	
	}
///////////////////////////////////////////////////////valida contato	
	function valida_contato() { 
	if (document.form.empresa.value.trim() == '') { 
	alert("Por favor, informe o campo Sua Empresa!")
	document.form.empresa.focus();
	return false; 
	}

	if (document.form.nome.value.trim() == '') { 
	alert("Por favor, informe o campo Seu Nome!")
	document.form.nome.focus();
	return false; 
	}
	
	if (document.form.cidade.value.trim() == '') { 
	alert("Por favor, informe o campo Cidade!")
	document.form.cidade.focus();
	return false; 
	}
	
	aux = 0
	if (aux==0) {
	if (document.form.email.value.indexOf("@") < 0){
	aux=1;
	alert("Por favor, informe o campo e-mail no formato seu@email.com.br")
	document.form.email.focus();
	return false;
	}
	}
	if (aux==0) {
	if (document.form.email.value.indexOf(".") < 0){
	aux=1;
	alert("Por favor, informe o campo e-mail no formato seu@email.com.br");
	document.form.email.focus();
	return false;
	}
	}
	if (document.form.telefone.value.trim() == '') { 
	alert("Por favor, informe o campo Telefone!")
	document.form.telefone.focus();
	return false; 
	}
	if (document.form.unidade.value.trim() == '0') { 
	alert("Por favor, informe o campo unidade para contato!")
	document.form.unidade.focus();
	return false; 
	}
	if (document.form.mensagem.value.trim() == '') { 
	alert("Por favor, informe o campo Mensagem!")
	document.form.mensagem.focus();
	return false; 
	}	
	}	
	
/////////////////////////////////////////////////////////////////////////valida o currículo
	function valida_form2() {
		base = document.forms[0];
		enviar=true;
		
		function Limpa(S)
		{
			var Digitos = "0123456789";
			var temp = "";
			var digito = "";
			for (var i=0; i<S.length; i++){
				digito = S.charAt(i);
				if (Digitos.indexOf(digito)>=0) {
					temp = temp + digito;
				}
			}
			return temp;
		}
		
		function Inverte(S)
		{
			var temp = "";
			for (var i=0; i<S.length; i++) {
				temp = S.charAt(i) + temp;
			}
			return temp;
		}		
		
		function Resto(S)
		{
			var invertido = Inverte(Limpa(S));
			var soma = 0;
			for (var i=0; i<invertido.length; i++) {
				soma = soma + (i+2) * eval(invertido.charAt(i));
			}
			soma *= 10;
			return ((soma % 11) % 10);
		}		


		function Validar_CPF()
		{
			if ((base.f_cpf.value == "00000000000") || (base.f_cpf.value == "11111111111") || (base.f_cpf.value == "22222222222") || (base.f_cpf.value == "33333333333") || (base.f_cpf.value == "44444444444") || (base.f_cpf.value == "55555555555") || (base.f_cpf.value == "66666666666") || (base.f_cpf.value == "77777777777") || (base.f_cpf.value == "88888888888") || (base.f_cpf.value == "99999999999")) {
				return (false);
			}
			var result = "";
			var OK = false;
			var temp = Limpa(base.f_cpf.value);
			if (temp.length>10) {
				var work = temp.substring(0,(temp.length)-2);
				var resto = Resto(work);
				OK = (resto == eval(temp.charAt((temp.length)-2)));
				if (OK){
					work = work + resto;
					resto = Resto(work);
					OK = (resto == eval(temp.charAt((temp.length)-1)));
				}
			}
			if (OK){
				return (true);
			}
			else 
			{
				return (false);
			}
		}
	
		function Mascarar_CPF(keypress, objeto)
		{
			campo = eval (objeto);
			caracteres = '1234567890';
			if ((caracteres.search(String.fromCharCode (keypress)) == -1) || (keypress == 36) || (keypress == 41) || (keypress == 46) || (keypress == 94) || (keypress == 124)) {
				event.returnValue = false;
			}
			else {
				if (campo.value.length == 3 ) { 
					campo.value = campo.value;
					campo.value = campo.value + '';
				}
				if (campo.value.length == 7 ) { 
					campo.value = campo.value;
					campo.value = campo.value + '';
				}
				if (campo.value.length == 11 ) { 
					campo.value = campo.value;
					campo.value = campo.value + '';
				}
			}
		}		
		
		if (enviar && base.f_nome.value==''){
			alert('It informs its name.');
			enviar=false;
			base.f_nome.focus();
		}
		
			if (enviar && base.f_cpf.value=='') {
				alert("It informs its Insurance Number.!");
				enviar=false;							
				return;
			}
			else {
				if (enviar && base.f_cpf.value < 11) {
					alert("incomplete number. 00000000000!");
					enviar=false;						
					return;
				}
				else {
					if (!Validar_CPF()) {
						
						if (enviar && base.f_cpf.value!=''){
							alert("Invalid number. types again!");
						}
						
						enviar=false;								
						return;
					}
				}
			}		
		

		if ((enviar && !check_date2(base.f_dt_nasc))){
			//alert('Você deve informar sua data de nascimento.');
			enviar=false;
			base.f_dt_nasc.focus();
		}
		if (enviar && !validaemail2(base.f_email)){
			enviar=false;
		}
		if (enviar && !select_not_empty2(base.f_escolaridade)) {
			alert('It informs its education.');
			enviar=false;
			base.f_escolaridade.focus();
		}
		if (enviar && !select_not_empty2(base.f_regiao)) {
			alert('It informs its region.');
			enviar=false;
			base.f_regiao.focus();
		}
		if (enviar && !select_not_empty2(base.f_funcao1)) {
			alert('It informs its functions you are capable of.');
			enviar=false;
			base.f_funcao1.focus();
		}		
		if (enviar && !anexou_curriculo2()) {
			enviar=false;
			base.blob.focus();
		}
		
		if (enviar && base.sms[0].checked==1 && base.f_telefone.value=='') {
			alert('It informs its Cell Phone.')
			enviar=false;
			base.f_telefone.focus();
		}
		
		if (enviar) {
			base.action="curriculo_OK.asp";
			//base.action="../www/rh_envia/outputFile.asp";
			base.submit();
		}
	}
	
	function anexou_curriculo2() {
		var filename = base.blob.value;
		var tamanho  = base.blob.value.length;
		var extensao = filename.substring(tamanho-4,tamanho);
		if (extensao == ".doc") {
			return true;
		} else {
			if (filename=='') {
				alert('You must send your resume in word format (.doc)');
			} else {
				alert('Please send your resume in extension ".doc" - Word');
			}
			return false;
		}
	}


	function select_not_empty2(obj_select){
		selected=false;
		for (i=0;i<obj_select.length;i++){
			if (obj_select.options[i].selected && i>0){
				selected=true;
				break;
			}
		}
		return selected;
	}

	function ver_outro_bairro2() {
		base = document.forms[0];
		base.f_regiao_outro.value='';
		base.f_regiao_outro.style.backgroundColor='#F3F3F3';
		for (i=0;i<base.f_regiao.length;i++) {
			if (base.f_regiao.options[i].selected) {
				if (base.f_regiao.options[i].value=='outro') {
					base.f_regiao_outro.style.backgroundColor='#FFFFFF';
					base.f_regiao_outro.disabled=false;
					base.f_regiao_outro.focus();
				} else {
					base.f_regiao_outro.style.backgroundColor='#F3F3F3';
					base.f_regiao_outro.disabled=true;
				}
				break;
			}
		}
	}


function check_date2(field) {
	var checkstr = "0123456789";
	var DateField = field;
	var Datevalue = "";
	var DateTemp = "";
	var seperator = "/";
	var day;
	var month;
	var year;
	var leap = 0;
	var err = 0;
	var i;
	err = 0;
	DateValue = DateField.value;
	/* Delete all chars except 0..9 */
	for (i = 0; i < DateValue.length; i++) {
		if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
			DateTemp = DateTemp + DateValue.substr(i,1);
		}
	}
	DateValue = DateTemp;
	/* Always change date to 8 digits - string*/
	/* if year is entered as 2-digit / always assume 20xx */
	if (DateValue.length == 6) {
		DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2);
	}
	if (DateValue.length != 8) {
		err = 19;
	}
	/* year is wrong if year = 0000 */
	year = DateValue.substr(4,4);
	if (year == 0) {
		err = 20;
	}
	/* Validation of month*/
	month = DateValue.substr(2,2);
	if ((month < 1) || (month > 12)) {
		err = 21;
	}
	/* Validation of day*/
	day = DateValue.substr(0,2);
	if (day < 1) {
		err = 22;
	}
	/* Validation leap-year / february / day */
	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
		leap = 1;
	}
	if ((month == 2) && (leap == 1) && (day > 29)) {
		err = 23;
	}
	if ((month == 2) && (leap != 1) && (day > 28)) {
		err = 24;
	}
	/* Validation of other months */
	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
		err = 25;
	}
	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
		err = 26;
	}
	/* if 00 ist entered, no error, deleting the entry */
	if ((day == 0) && (month == 0) && (year == 00)) {
		err = 0; day = ""; month = ""; year = ""; seperator = "";
	}
	/* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
	if (err == 0) {
		DateField.value = day + seperator + month + seperator + year;
		if (DateField.value=='') {
			alert("It informs its date of birth.");
			return false;
		}
		return true;
	} else {
		/* Error-message if err != 0 */
		alert("Format the date incorrect! Please it informs the date in the format: DD/MM/AAAA.");
		DateField.select();
		DateField.focus();
		return false;
	}
}

function validaemail2(obj_email){ 
        aux = 0
	xemail = obj_email
	msg_erro = "It fills its E-mail in the format seu@email.com.br";
	if (aux==0) {
	if (xemail.value == ""){
		aux=1;
		alert("It informs its E-mail");
		xemail.select();
		xemail.focus();
		return false;
	}
	}
	if (aux==0) {
		if (xemail.value.indexOf("@") < 0){
			aux=1;
			alert(msg_erro)
			xemail.select();
			xemail.focus();
			return false;
		}
	}
	if (aux==0) {
		if (xemail.value.indexOf(".") < 0){
			aux=1;
			alert(msg_erro);
			xemail.select();
			xemail.focus();
			return false;
		}
	}
	return true;
}

	function valida_form() {
		base = document.forms[0];
//		base = document.form_curriculo;
		enviar=true;

		function Limpa(S)
		{
			var Digitos = "0123456789";
			var temp = "";
			var digito = "";
			for (var i=0; i<S.length; i++){
				digito = S.charAt(i);
				if (Digitos.indexOf(digito)>=0) {
					temp = temp + digito;
				}
			}
			return temp;
		}
		
		function Inverte(S)
		{
			var temp = "";
			for (var i=0; i<S.length; i++) {
				temp = S.charAt(i) + temp;
			}
			return temp;
		}		
		
		function Resto(S)
		{
			var invertido = Inverte(Limpa(S));
			var soma = 0;
			for (var i=0; i<invertido.length; i++) {
				soma = soma + (i+2) * eval(invertido.charAt(i));
			}
			soma *= 10;
			return ((soma % 11) % 10);
		}		


		function Validar_CPF()
		{
			if ((base.f_cpf.value == "00000000000") || (base.f_cpf.value == "11111111111") || (base.f_cpf.value == "22222222222") || (base.f_cpf.value == "33333333333") || (base.f_cpf.value == "44444444444") || (base.f_cpf.value == "55555555555") || (base.f_cpf.value == "66666666666") || (base.f_cpf.value == "77777777777") || (base.f_cpf.value == "88888888888") || (base.f_cpf.value == "99999999999")) {
				return (false);
			}
			var result = "";
			var OK = false;
			var temp = Limpa(base.f_cpf.value);
			if (temp.length>10) {
				var work = temp.substring(0,(temp.length)-2);
				var resto = Resto(work);
				OK = (resto == eval(temp.charAt((temp.length)-2)));
				if (OK){
					work = work + resto;
					resto = Resto(work);
					OK = (resto == eval(temp.charAt((temp.length)-1)));
				}
			}
			if (OK){
				return (true);
			}
			else 
			{
				return (false);
			}
		}
	
		function Mascarar_CPF(keypress, objeto)
		{
			campo = eval (objeto);
			caracteres = '1234567890';
			if ((caracteres.search(String.fromCharCode (keypress)) == -1) || (keypress == 36) || (keypress == 41) || (keypress == 46) || (keypress == 94) || (keypress == 124)) {
				event.returnValue = false;
			}
			else {
				if (campo.value.length == 3 ) { 
					campo.value = campo.value;
					campo.value = campo.value + '';
				}
				if (campo.value.length == 7 ) { 
					campo.value = campo.value;
					campo.value = campo.value + '';
				}
				if (campo.value.length == 11 ) { 
					campo.value = campo.value;
					campo.value = campo.value + '';
				}
			}
		}

if (enviar && base.f_nome.value==''){
			alert('Você deve informar seu nome.');
			enviar=false;
			base.f_nome.focus();
		}
			if (enviar && base.f_cpf.value=='') {
				alert("Informe o cpf!");
				enviar=false;							
				return;
			}
			else {
				if (enviar && base.f_cpf.value < 11) {
					alert("CPF incompleto. Ex.: 00000000000!");
					enviar=false;						
					return;
				}
				else {
					if (!Validar_CPF()) {
						
						if (enviar && base.f_cpf.value!=''){
							alert("CPF inválido. Digite novamente!");
						}
						
						enviar=false;								
						return;
					}
				}
			}
		
/*	if (enviar && base.f_cpf.value=='')  {
		alert('Você deve informar seu cpf.');
			enviar=false;
			base.f_cpf.focus();		
	}
		if (base.f_cpf.value!='')  {
		
		vai=checaCPF(base.f_cpf.value)
		if (!vai){
		alert('CPF inválido.');
		base.f_cpf.focus();	
		return false;
		}
	
		function checaCPF (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")
		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)))
		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)))
		return false;
		return true;
		}
		}
*/
		if ((enviar && !check_date(base.f_dt_nasc))){
			//alert('Você deve informar sua data de nascimento.');
			enviar=false;
			base.f_dt_nasc.focus();
		}
		if (enviar && !validaemail(base.f_email)){
			enviar=false;
		}
		if (enviar && !select_not_empty(base.f_escolaridade)) {
			alert('Você deve informar seu grau de escolaridade.');
			enviar=false;
			base.f_escolaridade.focus();
		}
		if (enviar && !select_not_empty(base.f_regiao)) {
			alert('Você deve informar sua região.');
			enviar=false;
			base.f_regiao.focus();
		}
		if (enviar && !select_not_empty(base.f_funcao1)) {
			alert('Você deve informar no mínimo uma função.');
			enviar=false;
			base.f_funcao1.focus();
		}		
		if (enviar && !anexou_curriculo()) {
			enviar=false;
			base.blob.focus();
		}
		if (enviar && base.sms[0].checked==1 && base.f_telefone.value=='') {
			alert('Você deve informar seu celular.')
			enviar=false;
			base.f_telefone.focus();
		}

		if (enviar) {
			base.action="curriculo_OK.asp";
			//base.action="../www/rh_envia/outputFile.asp";
			base.submit();
		}
	}
	
	function anexou_curriculo() {
		var filename = base.blob.value;
		var tamanho  = base.blob.value.length;
		var extensao = filename.substring(tamanho-4,tamanho);
		if (extensao == ".doc") {
			return true;
		} else {
			if (filename=='') {
				alert('Você deve nos enviar seu currículo no formato Word.');
			} else {
				alert('Por favor enviar seu currículo com a extensão ".doc" - Word');
			}
			return false;
		}
	}


	function select_not_empty(obj_select){
		selected=false;
		for (i=0;i<obj_select.length;i++){
			if (obj_select.options[i].selected && i>0){
				selected=true;
				break;
			}
		}
		return selected;
	}

	function ver_outro_bairro() {
		base = document.forms[0];
		base.f_regiao_outro.value='';
		base.f_regiao_outro.style.backgroundColor='#F3F3F3';
		for (i=0;i<base.f_regiao.length;i++) {
			if (base.f_regiao.options[i].selected) {
				if (base.f_regiao.options[i].value=='outro') {
					base.f_regiao_outro.style.backgroundColor='#FFFFFF';
					base.f_regiao_outro.disabled=false;
					base.f_regiao_outro.focus();
				} else {
					base.f_regiao_outro.style.backgroundColor='#F3F3F3';
					base.f_regiao_outro.disabled=true;
				}
				break;
			}
		}
	}


function check_date(field) {
	var checkstr = "0123456789";
	var DateField = field;
	var Datevalue = "";
	var DateTemp = "";
	var seperator = "/";
	var day;
	var month;
	var year;
	var leap = 0;
	var err = 0;
	var i;
	err = 0;
	DateValue = DateField.value;
	/* Delete all chars except 0..9 */
	for (i = 0; i < DateValue.length; i++) {
		if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
			DateTemp = DateTemp + DateValue.substr(i,1);
		}
	}
	DateValue = DateTemp;
	/* Always change date to 8 digits - string*/
	/* if year is entered as 2-digit / always assume 20xx */
	if (DateValue.length == 6) {
		DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2);
	}
	if (DateValue.length != 8) {
		err = 19;
	}
	/* year is wrong if year = 0000 */
	year = DateValue.substr(4,4);
	if (year == 0) {
		err = 20;
	}
	/* Validation of month*/
	month = DateValue.substr(2,2);
	if ((month < 1) || (month > 12)) {
		err = 21;
	}
	/* Validation of day*/
	day = DateValue.substr(0,2);
	if (day < 1) {
		err = 22;
	}
	/* Validation leap-year / february / day */
	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
		leap = 1;
	}
	if ((month == 2) && (leap == 1) && (day > 29)) {
		err = 23;
	}
	if ((month == 2) && (leap != 1) && (day > 28)) {
		err = 24;
	}
	/* Validation of other months */
	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
		err = 25;
	}
	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
		err = 26;
	}
	/* if 00 ist entered, no error, deleting the entry */
	if ((day == 0) && (month == 0) && (year == 00)) {
		err = 0; day = ""; month = ""; year = ""; seperator = "";
	}
	/* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
	if (err == 0) {
		DateField.value = day + seperator + month + seperator + year;
		if (DateField.value=='') {
			alert("Você deve informar a data de seu nascimento.");
			return false;
		}
		return true;
	} else {
		/* Error-message if err != 0 */
		alert("Formato da data incorreto! Por favor informe data no formato: DD/MM/AAAA.");
		DateField.select();
		DateField.focus();
		return false;
	}
}

function validaemail(obj_email){ 
        aux = 0
	xemail = obj_email
	msg_erro = "Preencha o campo e-mail no formato seu@email.com.br";
	if (aux==0) {
	if (xemail.value == ""){
		aux=1;
		alert("Por favor informe: E-mail");
		xemail.select();
		xemail.focus();
		return false;
	}
	}
	if (aux==0) {
		if (xemail.value.indexOf("@") < 0){
			aux=1;
			alert(msg_erro)
			xemail.select();
			xemail.focus();
			return false;
		}
	}
	if (aux==0) {
		if (xemail.value.indexOf(".") < 0){
			aux=1;
			alert(msg_erro);
			xemail.select();
			xemail.focus();
			return false;
		}
	}
	return true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////valida indique
function verificarcampos(){
	if (document.all.textde.value=='') {
		alert('Por favor informe o seu nome.');
		document.all.textde.focus();
		return false;
	}
	if (document.all.textemailde.value=='') {
		alert('Por favor informe o seu e-Mail.');
		document.all.textemailde.focus();
		return false;
	}else{
		aux = 0
		if (aux==0) {
			if (document.all.textemailde.value.indexOf("@") < 0){
				aux=1;
				alert("Preencha o seu e-Mail no formato seu@email.com.br")
				document.all.textemailde.select()
				document.all.textemailde.focus();
				return false;
			}
		}
		if (aux==0) {
			if (document.all.textemailde.value.indexOf(".") < 0){
				aux=1;
				alert("Preencha o seu e-Mail no formato seu@email.com.br");
				document.all.textemailde.select()
				document.all.textemailde.focus();
				return false;
			}
		}	
	}
	if (document.all.textpara.value=='') {
		alert('Por favor informe o nome do destinatário.');
		document.all.textpara.focus();
		return false;
	}
	if (document.all.textemailpara.value=='') {
		alert('Por favor informe o e-Mail do destinatário.');
		document.all.textemailpara.focus();
		return false;
	}else{
		aux = 0
		if (aux==0) {
			if (document.all.textemailpara.value.indexOf("@") < 0){
				aux=1;
				alert("Preencha o e-Mail do destinatário no formato seu@email.com.br")
				document.all.textemailpara.select()
				document.all.textemailpara.focus();
				return false;
			}
		}
		if (aux==0) {
			if (document.all.textemailpara.value.indexOf(".") < 0){
				aux=1;
				alert("Preencha o e-Mail do destinatário no formato seu@email.com.br");
				document.all.textemailpara.select()
				document.all.textemailpara.focus();
				return false;
			}
}
}
}

function valid_talk(){
		if (form.txtnome.value==''){
		alert('It informs its Name');
		form.txtnome.focus()
		return false;
	}
	if (form.txtemail.value==''){
		alert('It informs its e-Mail.');
		form.txtemail.focus();
		return false;
	}else{
		aux = 0
		if (aux==0) {
			if (form.txtemail.value.indexOf("@") < 0){
				aux=1;
				alert("It fills field email in the format seu@email.com.br")
				form.txtemail.focus();
				return false;
			}
		}
		if (aux==0) {
			if (form.txtemail.value.indexOf(".") < 0){
				aux=1;
				alert("It fills field email in the format seu@email.com.br");
				form.txtemail.focus();
				return false;
			}
		}

	}
}
function valid_contact(){
	if (document.form.empresa.value.trim() == '') { 
	alert("Please it informs its Company!")
	document.form.empresa.focus();
	return false; 
	}

	if (document.form.nome.value.trim() == '') { 
	alert("Please it informs its Name!")
	document.form.nome.focus();
	return false; 
	}
	
	if (document.form.cidade.value.trim() == '') { 
	alert("Please it informs its City!")
	document.form.cidade.focus();
	return false; 
	}
	
	aux = 0
	if (aux==0) {
	if (document.form.email.value.indexOf("@") < 0){
	aux=1;
	alert("It fills its E-mail in the format seu@email.com.br")
	document.form.email.focus();
	return false;
	}
	}
	if (aux==0) {
	if (document.form.email.value.indexOf(".") < 0){
	aux=1;
	alert("It fills its E-mail in the format seu@email.com.br");
	document.form.email.focus();
	return false;
	}
	}
	if (document.form.telefone.value.trim() == '') { 
	alert("Please it informs its Telephone!")
	document.form.telefone.focus();
	return false; 
	}
	if (document.form.unidade.value.trim() == '0') { 
	alert("Please it informs its META Unit which you wish to contact!")
	document.form.unidade.focus();
	return false; 
	}
	if (document.form.mensagem.value.trim() == '') { 
	alert("Please it informs its Message!")
	document.form.mensagem.focus();
	return false; 
	}	
	}
function verificarcampos_eng(){
	if (document.all.textde.value=='') {
		alert('Please it informs its name.');
		document.all.textde.focus();
		return false;
	}
	if (document.all.textemailde.value=='') {
		alert('Please it informs its E-mail.');
		document.all.textemailde.focus();
		return false;
	}else{
		aux = 0
		if (aux==0) {
			if (document.all.textemailde.value.indexOf("@") < 0){
				aux=1;
				alert("It fills its E-mail in the format seu@email.com.br")
				document.all.textemailde.select()
				document.all.textemailde.focus();
				return false;
			}
		}
		if (aux==0) {
			if (document.all.textemailde.value.indexOf(".") < 0){
				aux=1;
				alert("It fills its E-mail in the format seu@email.com.br");
				document.all.textemailde.select()
				document.all.textemailde.focus();
				return false;
			}
		}	
	}
	if (document.all.textpara.value=='') {
		alert('Please it informs the name of the addressee.');
		document.all.textpara.focus();
		return false;
	}
	if (document.all.textemailpara.value=='') {
		alert('Please it informs the E-mail of the addressee.');
		document.all.textemailpara.focus();
		return false;
	}else{
		aux = 0
		if (aux==0) {
			if (document.all.textemailpara.value.indexOf("@") < 0){
				aux=1;
				alert("It fills the E-mail of the addressee in the format seu@email.com.br")
				document.all.textemailpara.select()
				document.all.textemailpara.focus();
				return false;
			}
		}
		if (aux==0) {
			if (document.all.textemailpara.value.indexOf(".") < 0){
				aux=1;
				alert("It fills the E-mail of the addressee in the format seu@email.com.br");
				document.all.textemailpara.select()
				document.all.textemailpara.focus();
				return false;
			}
}
}
}


function validaVaga() {
		base = document.forms[0];
		enviar=true;
		if (enviar && base.f_nome.value==''){
			alert('Você deve informar seu nome.');
			enviar=false;
			base.f_nome.focus();
		}

		if ((enviar && !check_date(base.f_dt_nasc))){
			//alert('Você deve informar sua data de nascimento.');
			enviar=false;
			base.f_dt_nasc.focus();
		}

		if (enviar && !select_not_empty(base.f_sexo)) {
			alert('Você deve informar o seu sexo.');
			enviar=false;
			base.f_sexo.focus();
		}

		if (base.f_cpf.value!='')  {
		
		vai=checaCPF(base.f_cpf.value)
		if (!vai){
		alert('CPF inválido.');
		base.f_cpf.focus();	
		return false;
		}
	
		function checaCPF (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")
		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)))
		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)))
		return false;
		return true;
		}
		}

		if (enviar && base.sms[0].checked==1 && base.f_telefone.value=='') {
			alert('Você deve informar o seu celular.')
			enviar=false;
			base.f_telefone.focus();
		}

		if (enviar) {
			base.action="vagaOK.asp";
			//base.action="../www/rh_envia/outputFile.asp";
			base.submit();
		}
	}
	

	function select_not_empty(obj_select){
		selected=false;
		for (i=0;i<obj_select.length;i++){
			if (obj_select.options[i].selected && i>0){
				selected=true;
				break;
			}
		}
		return selected;
	}

function check_date(field) {
	var checkstr = "0123456789";
	var DateField = field;
	var Datevalue = "";
	var DateTemp = "";
	var seperator = "/";
	var day;
	var month;
	var year;
	var leap = 0;
	var err = 0;
	var i;
	err = 0;
	DateValue = DateField.value;
	/* Delete all chars except 0..9 */
	for (i = 0; i < DateValue.length; i++) {
		if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
			DateTemp = DateTemp + DateValue.substr(i,1);
		}
	}
	DateValue = DateTemp;
	/* Always change date to 8 digits - string*/
	/* if year is entered as 2-digit / always assume 20xx */
	if (DateValue.length == 6) {
		DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2);
	}
	if (DateValue.length != 8) {
		err = 19;
	}
	/* year is wrong if year = 0000 */
	year = DateValue.substr(4,4);
	if (year == 0) {
		err = 20;
	}
	/* Validation of month*/
	month = DateValue.substr(2,2);
	if ((month < 1) || (month > 12)) {
		err = 21;
	}
	/* Validation of day*/
	day = DateValue.substr(0,2);
	if (day < 1) {
		err = 22;
	}
	/* Validation leap-year / february / day */
	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
		leap = 1;
	}
	if ((month == 2) && (leap == 1) && (day > 29)) {
		err = 23;
	}
	if ((month == 2) && (leap != 1) && (day > 28)) {
		err = 24;
	}
	/* Validation of other months */
	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
		err = 25;
	}
	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
		err = 26;
	}
	/* if 00 ist entered, no error, deleting the entry */
	if ((day == 0) && (month == 0) && (year == 00)) {
		err = 0; day = ""; month = ""; year = ""; seperator = "";
	}
	/* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
	if (err == 0) {
		DateField.value = day + seperator + month + seperator + year;
		if (DateField.value=='') {
			alert("Você deve informar a data de seu nascimento.");
			return false;
		}
		return true;
	} else {
		/* Error-message if err != 0 */
		alert("Formato da data incorreto! Por favor informe data no formato: DD/MM/AAAA.");
		DateField.select();
		DateField.focus();
		return false;
	}
}

function validaVaga2() {
		base = document.forms[0];
		enviar=true;
		if (enviar && base.f_nome.value==''){
			alert('It informs its name');
			enviar=false;
			base.f_nome.focus();
		}

		if ((enviar && !check_date2(base.f_dt_nasc))){
			//alert('Você deve informar sua data de nascimento.');
			enviar=false;
			base.f_dt_nasc.focus();
		}

		if (enviar && !select_not_empty(base.f_sexo)) {
			alert('It informs its sex.');
			enviar=false;
			base.f_sexo.focus();
		}
		
		if (base.f_cpf.value!='')  {
		
		vai=checaCPF(base.f_cpf.value)
		if (!vai){
		alert('CPF invalid.');
		base.f_cpf.focus();	
		return false;
		}
	
		function checaCPF (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")
		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)))
		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)))
		return false;
		return true;
		}
		}		
		
		if (enviar && base.sms[0].checked==1 && base.f_telefone.value=='') {
			alert('It informs its cell phone.')
			enviar=false;
			base.f_telefone.focus();
		}

		if (enviar) {
			base.action="vagaOK.asp";
			//base.action="../www/rh_envia/outputFile.asp";
			base.submit();
		}
	}
	

	function select_not_empty(obj_select){
		selected=false;
		for (i=0;i<obj_select.length;i++){
			if (obj_select.options[i].selected && i>0){
				selected=true;
				break;
			}
		}
		return selected;
	}

function check_date2(field) {
	var checkstr = "0123456789";
	var DateField = field;
	var Datevalue = "";
	var DateTemp = "";
	var seperator = "/";
	var day;
	var month;
	var year;
	var leap = 0;
	var err = 0;
	var i;
	err = 0;
	DateValue = DateField.value;
	/* Delete all chars except 0..9 */
	for (i = 0; i < DateValue.length; i++) {
		if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
			DateTemp = DateTemp + DateValue.substr(i,1);
		}
	}
	DateValue = DateTemp;
	/* Always change date to 8 digits - string*/
	/* if year is entered as 2-digit / always assume 20xx */
	if (DateValue.length == 6) {
		DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2);
	}
	if (DateValue.length != 8) {
		err = 19;
	}
	/* year is wrong if year = 0000 */
	year = DateValue.substr(4,4);
	if (year == 0) {
		err = 20;
	}
	/* Validation of month*/
	month = DateValue.substr(2,2);
	if ((month < 1) || (month > 12)) {
		err = 21;
	}
	/* Validation of day*/
	day = DateValue.substr(0,2);
	if (day < 1) {
		err = 22;
	}
	/* Validation leap-year / february / day */
	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
		leap = 1;
	}
	if ((month == 2) && (leap == 1) && (day > 29)) {
		err = 23;
	}
	if ((month == 2) && (leap != 1) && (day > 28)) {
		err = 24;
	}
	/* Validation of other months */
	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
		err = 25;
	}
	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
		err = 26;
	}
	/* if 00 ist entered, no error, deleting the entry */
	if ((day == 0) && (month == 0) && (year == 00)) {
		err = 0; day = ""; month = ""; year = ""; seperator = "";
	}
	/* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
	if (err == 0) {
		DateField.value = day + seperator + month + seperator + year;
		if (DateField.value=='') {
			alert("It informs its date of birth.");
			return false;
		}
		return true;
	} else {
		/* Error-message if err != 0 */
		alert("Format the date incorrect! Please it informs the date in the format: DD/MM/AAAA.");
		DateField.select();
		DateField.focus();
		return false;
	}
}