// JavaScript Document

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/***********************************************
* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
	var returnval=emailfilter.test(e.value)
	if (returnval==false){
		alert("Por favor coloque um email valido.")
		e.select()
	}
	return returnval
}

function verifica(){
	if($('assunto').value == "0"){
		alert('Selecione um Assunto!');
		return false;
	} 
	
	if($('nome').value == ""){
		alert('O campo \'Nome\' é obrigatório!');
		$('nome').focus();
		return false;
	} 
	if($('nome').value.length < 3){
		alert('O campo \'Nome\' é muito pequeno!');
		$('nome').focus();
		return false;
	}
	if($('email').value == ""){
		alert('O campo \'Email\' é obrigatório!');
		$('email').focus();
		return false;
	} 
	if($('email').value.length <= 6 || $('email').value.indexOf(".") == -1 || $('email').value.indexOf("@") == -1 || $('email').value.indexOf(".@") > 0 || $('email').value.indexOf("@.") > 0 || $('email').value.indexOf("@ ") > 0 || $('email').value.indexOf(" @") > 0 || $('email').value.indexOf(" .") > 0 || $('email').value.indexOf(". ") > 0) {
		alert('O campo \'Email\' é inválido!');
		$('email').focus();
		return false;
	}
	if($('mensagem').value == 0){
		alert('O campo \'Mensagem\' é obrigatório!');
		return false;
	}
	return true;
}
