// Controle de Abertura e Fechamento dos Boxes
function abrirDiv(idDiv){ 
	divStyle_ = document.getElementById(idDiv).style;
	btaStyle_ = document.getElementById(idDiv + '_a').style;
	btfStyle_ = document.getElementById(idDiv + '_f').style;
	divStyle_.display = ''; 
	btaStyle_.display = 'none'; 
	btfStyle_.display = ''; 
	return false; 
}

function fecharDiv(idDiv){
	divStyle_ = document.getElementById(idDiv).style;
	btaStyle_ = document.getElementById(idDiv + '_a').style;
	btfStyle_ = document.getElementById(idDiv + '_f').style;
	divStyle_.display = 'none'; 
	btaStyle_.display = ''; 
	btfStyle_.display = 'none'; 
	return false; 
}

function valida_form1() {

     var Form; 
     Form = document.cadastro;

	if (Form.nome.value.length == 0) {
	alert("Por favor preencha o campo Nome!");
        Form.nome.focus();
        return false;
     }
	if (Form.email.value.length == 0) {
	alert("Por favor preencha o campo E-mail!");
        Form.email.focus();
        return false;
     }
	if (Form.assunto.value.length == 0) {
	alert("Por favor preencha o campo Assunto!");
        Form.assunto.focus();
        return false;
     } 
	if (Form.mensagem.value.length == 0) {
	alert("Por favor preencha o campo Mensagem!");
        Form.mensagem.focus();
        return false;
     }	 
	return true;
}

/************************************************
* function isEmpty
* Verifica se um campo está vazio
************************************************/               
function isEmpty(s) {
	return ((s == null) || (s.length == 0));
}

/************************************************
* function AvisoInvalido
* Gera um alert para o usuário 
* volta o foco p/campo
* Parâmetros: theField - campo do formulário com problema
*        warnText - texto a ser mostrado no alert
************************************************/
function AvisoInvalido (theField, warnText) {
	theField.focus()
	theField.select()
	alert(warnText)
	return false
}

/************************************************
* function valida
* Faz a validação do formulário preenchido
************************************************/
function valida() {
	var tamanho_pesquisa = new String()
	tamanho_pesquisa = document.pesquisa.id.value
	
	if(tamanho_pesquisa.length < 2)
	{
	avisoInvalido(document.pesquisa.id,'ATENÇÃO: Sua pesquisa deve conter no mínimo 2 caracteres!\n\n');
		return false;
	}
}

function pesquisa(){
window.open('ajuda.htm','explica','toolbar=no,location=no,directories=no,status=no,menubar=no,_

scrollbars=no,resizable=no,copyhistory=no,width=270,height=310,top=40,left=150');
}
