
function cur_val_cad() {
	
	cpf				=	document.form.cpf.value;
	nome				=	document.form.nome.value;
	email				=	document.form.email.value;
	senha				=	document.form.senha.value;
	nascimento		=	document.form.nascimento.value;
	telefone_res	=	document.form.telefone_res.value;
	endereco			=	document.form.endereco.value;
	bairro			=	document.form.bairro.value;
	cidade			=	document.form.cidade.value;
	pais				=	document.form.pais.value;
	nacionalidade	=	document.form.nacionalidade.value;
	cargos			=	document.form.cargos.value;

	if(!testaCPF(cpf)){
		alert(MSGLang.FieldCPF);
		cur_muda_td('db');
		return false;
	}
	
	if(nome.length<3 || nome.length>100 ){
		alert(MSGLang.FieldName);
		cur_muda_td('db');
		return false;
	}	
	
	if(!testaEmail(email)){
		alert(MSGLang.FieldEmail);
		cur_muda_td('db');
		return false;
	}
	
	if(senha.length<5 || senha.length>15 ){
		alert(MSGLang.FieldPassword);
		cur_muda_td('db');
		return false;
	}

	if(!testaData(nascimento)){
		alert(MSGLang.FieldNascimento);
		cur_muda_td('dp');
		return false;
	}
	
	if(telefone_res.length<8 || telefone_res.length>30 ){
		alert(MSGLang.FieldFoneRes);
		cur_muda_td('dp');
		return false;
	}
	
	if(endereco.length<5 || endereco.length>200 ){
		alert(MSGLang.FieldAddress);
		cur_muda_td('dp');
		return false;
	}
	
	if(bairro.length<5 || bairro.length>50 ){
		alert(MSGLang.FieldQuarter);
		cur_muda_td('dp');
		return false;
	}	
	
	if(cidade.length<5 || cidade.length>50 ){
		alert(MSGLang.FieldCity);
		cur_muda_td('dp');
		return false;
	}	
	
	if(pais.length<5 || pais.length>50 ){
		alert(MSGLang.FieldCountry);
		cur_muda_td('dp');
		return false;
	}	
	
	if(nacionalidade.length<5 || nacionalidade.length>50 ){
		alert(MSGLang.FieldNationality);
		cur_muda_td('dp');
		return false;
	}	

	if(cargos.length<5){
		alert(MSGLang.FieldPositions);
		cur_muda_td('dp');
		return false;
	}

}


function cur_muda_td(qual) {
    todas	=	new Array("db", "dp", "fe", "id", "ep", "ic");

	td		=	"td_"+qual;
	fs		=	"fs_"+qual;

	document.getElementById(td).className		=	"cur-link-escolhido";
	document.getElementById(fs).style.display	=	"block";

	for(i=0;i<todas.length;i++){
			td_laco	=	"td_"+todas[i];
			fs_laco	=	"fs_"+todas[i];
		if(td != td_laco){
			document.getElementById(td_laco).className		=	"cur-link-sem-foco";
			document.getElementById(fs_laco).style.display	=	"none";
		}
	}

}



function vg_senha_perdida()
{
	email	=	window.prompt(MSGLang.RecuperarPassword,'');

	if(email != null)
	{
		xmlhttp	=	mount_XMLHttp();
		url	=	ajax_path + "vg.senhaperdida.php?email="+email;
		xmlhttp.open("GET", url,true);
	
		xmlhttp.onreadystatechange=function() {
		
			if(xmlhttp.readyState==4){
				alert(xmlhttp.responseText);
			}
		}
	
	xmlhttp.send(null);
	}
}


function vg_esconde_em(campo) {
    tam	=	campo.value.length;
	if(tam >3){
		document.getElementById('fs_fe_em').style.display	=	"none";
	}
}
