	function validate(chosen_form) {
	
			eval('var vali_form = document.'+chosen_form+';');
	
			//verificando campos
		 if (vali_form.nome.value=='' || vali_form.nome.value == "Deve ser preenchido"){
		 	alert("Informe seu nome");
			return false;	
		 }
		 
		 if (vali_form.mensagem.value=='' || vali_form.mensagem.value == "deixe sua mensagem"){
		 	alert("O texto da mensagem está vazio");
			return false;	
		 }

		//verificando se email é válido 
		var str=vali_form.email.value;
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if ((str.indexOf(at)==-1)||
			(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)||
			(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)||
			(str.indexOf(at,(lat+1))!=-1)||
			(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)||
			(str.indexOf(dot,(lat+2))==-1)||
			(str.indexOf(" ")!=-1))
			{
		    alert("E-mail inválido")
		    return false;
		 }
	
	 		 return true	
		}
	/*function only_nums(chosen_form, chosen_field){
		eval('var leleo=document.' + chosen_form + '.' + chosen_field + ';');	
		leleo.value = leleo.value.replace(/\D/, '');
	}*/
	
	function only_nums( local ){
		var campo = document.getElementById( local );
		campo.value = campo.value.replace(/\D/, '');
	}
	
	function mudaClasse ( local , classe ){
		document.getElementById( local ).className = classe;
	}
	function testarInput(){
		if(document.cadastro.informativo.checked == true){
			document.cadastro.informativo.value="sim";
		}		
		else{
		document.cadastro.informativo.value="não";
		}	
}

