function validar_envio(){
  errores = new Array();
  if (document.form1.nombre.value.length==0){
      errores[0]= "Nombre";
    }
	if (document.form1.email.value.length==0){
      errores[1]= "Email";
    }
	if (document.form1.msg.value.length==0){
      errores[2]= "Mensaje";
    }

  if (errores.length>0)
    {
    campos_pendientes ="";
    for ( var error in errores )
      {
      campos_pendientes += "\n"+errores[error];
      }
    alert("Los siguientes datos son necesarios para tramitar su solicitud:\n"+campos_pendientes);
    return 0;
    }
  else {document.form1.action = "contactar.php";document.form1.submit();}
	
}
