
//################################################################################################
// PESQUISAS
function Fc_Pesquisa(){
	var texto, texto_b, msgaux, erro; 
	msgaux = 'Alerta da Pesquisa: \n' 
	erro=false;
	ObjFucus = true;
	
	//texto = document.getElementById('EMP_frm_nome').value;
	texto = document.getElementById('frm_itemPesquisado').value;
	if (texto.length < 3 ){ 
		//msgaux+='\n- Informe o termo a ser pesquisado'; 
		msgaux+='-Informe o termo ser pesquisado. Minimo de 3 caracteres.'; 
		erro=true;
		if(ObjFucus == true)ObjFucus = document.getElementById('frm_itemPesquisado');
	} 
	if (texto == "Localizar..."){ 
		msgaux+='-Informe o termo para pesquisa'; 
		erro=true;
		if(ObjFucus == true)ObjFucus = document.getElementById('frm_itemPesquisado');
	}	
	
   if (erro) alert(msgaux);
   return !(erro);
}
// JavaScript Document
function esvazia(valor_campo){

if (valor_campo.value == valor_campo.defaultValue)
	valor_campo.value='';
}

function padrao(valor_campo){
	if (valor_campo.value == ''){
		valor_campo.value=valor_campo.defaultValue;
	}
}

function Fc_NewsLetter(){
	var texto, texto_b, msgaux, erro; 
	msgaux = 'Alerta da Pesquisa: \n' 
	erro=false;
	ObjFucus = true;
	
	texto = document.getElementById('frmNews_nome').value;
	if (texto.length < 3 ){ 
		msgaux+='-Informe o nome para identificar o e-mail.'; 
		erro=true;
		if(ObjFucus == true)ObjFucus = document.getElementById('frmNews_nome');
	} 
	
	texto = document.getElementById('frmNews_email').value;
	if (texto.length < 6){ 
		msgaux+='\n- Informe o e-mail.';
		erro=true;
		if(ObjFucus == true)ObjFucus = document.getElementById('frmNews_email');
	}else{
		if	 (!/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(document.getElementById('frmNews_email').value)) { 
			msgaux+='\n- O e-mail informado não é um e-mail válido.';
			erro=true;
			if(ObjFucus == true)ObjFucus = document.getElementById('frmNews_emaill');
		}     
	}	
	//Valida
	if (erro){ 
		alert(msgaux);
		ObjFucus.focus();
	}else{
		document.getElementById('frmNews_cad').submit();
	}	
}




//################################################################################################
// Login do Cliente
function Fc_LoginCliente(valTipo){
	if(valTipo == 'acesso'){
		document.getElementById('acesso').style.display='';
		document.getElementById('ftp').style.display='none';
	}
	if(valTipo == 'ftp'){
		document.getElementById('acesso').style.display='none';
		document.getElementById('ftp').style.display='';
	}
}
