function pop( ){
	if (document.ENTRADA.NOME.value != '' && document.ENTRADA.NOME.value != 'Digite seu nome'){
		document.ENTRADA.ORIGEM.value = window.location.href;
		DispWin = window.open('about:blank','clickpop',
'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=361,height=447');
		document.ENTRADA.target='clickpop';
		document.ENTRADA.submit();
	}
}


// funcao que valida o endereco de email.
function validaEmail(email) {
	indice = email.indexOf("@");
	if ( (email == "") || (indice< 1) || (indice != email.lastIndexOf("@")) ||
     	     (email.indexOf(".",indice) < indice+2) ||
     	     (email.charAt(email.length-1)==".") || (email.charAt(0)==".") ) {
	     	return false;
	}
	else return true;
}     
     

// verifica os campos de formulario. Caso for positivo, envia a mensagem
function enviaMensagem(n) {
	if ( !validaEmail(n.TO.value) ) {
	 	n.TO.focus();
		alert("Por favor preencha corretamente o endereço de email.");
		return;
	 }

	if ( n.SUBJECT.value=='') {
	 	n.SUBJECT.focus();
		alert("Por favor preencha o campo Assunto!");
		return;	
	}
	
	if ( !validaEmail(n.FROM.value) ) {
	 	n.FROM.focus();
		alert("Por favor preencha corretamente o endereço de email.");	
		return;	
	}
	
	if ( n.MESS.value=='') {
	 	n.MESS.focus();
		alert("O campo Mensagem está vazio!");
		return;	
	}	

	n.submit();
}
