function valida(form) {

var elementos = form.elements; 
for (var i=0; i < elementos.length; i++){   
if (elementos[i].getAttribute("type")=="text") {    
if (elementos[i].getAttribute("name")!="texto") {     
if (elementos[i].value=="") {
alert("O campo "+elementos[i].getAttribute("name")+  " é obrigatorio.");      
return false; 
}else if(elementos[i].getAttribute("name") == "email"){
validaremail(elementos);
}	 	 
 } 
   } 
    } 
        return true;

}
function validaremail(form) {
	emailRE = new RegExp("^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$");
  var email = document.getElementById("email").value;
  if (emailRE.test(email)) {
    var form = document.getElementById("form");
    return true;
    form.submit();
  }
  alert("O email deve ser preenchido no formato correto (usu?rio@dominio).");
  return false;
}