// JavaScript Document
<!--
//<![CDATA[ 

/*SCRIPT PARA VALIDAR EL FORMULARIO DE CONTACTO/ NO OBSTRUCTIVO, SI EL USUARIO NO TIENE JAVASCRIPT ACTIVO, EL FORMULARIO SE ENVIARÁ DE TODAS FORMAS Y LA COMPROBACIÓN DE DATOS SE HARÁ DEL LADO DEL SERVIDOR*/

function remitente() {
	var email = document.getElementById('email');
	alert (email.value);
	var from = document.getElementById('from');
	alert (from.value);
	from.value = email.value;
	alert (from.value);
	}


function validacion(formulario) {
	//remitente();
	//var email = document.getElementById('email');
	var email = document.getElementById('email');
	var from = document.getElementById('from');
	from.value = email.value;
	//alert (email.value);
	//return false;
	
	var valor = formulario.nombre.value;
  	if ( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
	formulario.nombre.focus();
    alert('Debe introducir su nombre para poder enviar el formulario.');
    return false;
  	}
  else{	valor = formulario.vehiculo.value;
  	if ( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
	formulario.vehiculo.focus();
    alert('Debe introducir su veh\xEDculo. En caso de no tener veh\xEDculo ind\xEDquelo en el campo para poder enviar el formulario." ');
    return false;
  	}
  else{	valor = formulario.email.value;
  	if ( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
	formulario.email.focus();
    alert('Debe introducir su email. En caso de no tener email ind\xEDquelo en el campo para poder enviar el formulario." ');
    return false;
  	}
  else{	valor = formulario.mensaje.value;
 	if ( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
    // Si no se cumple la condicion...
	formulario.mensaje.focus();
    alert('[ERROR] Mesaje vac\xEDo. Debe introducir algún mensaje para poder enviar el formulario.');
    return false;
  	}}}}
}
//]]>
//-->