// JavaScript Document

function validar_solicitud( form ){
	if ( form.p_categoria.options[ form.p_categoria.selectedIndex ].value == '' ){
		alert("Debe selecionar una categoría");
		return false;
	}
		
	if ( form.p_nombre.value == '' ){
		alert("Debe introducir su nombre");
		return false;
	}
	
	if ( form.p_apellidos.value == '' ){
		alert("Debe introducir sus apellidos");
		return false;
	}
	
	if ( form.p_edad.value == '' ){
		alert("Debe introducir su edad");
		return false;
	}
	
	if ( form.p_sexo.options[ form.p_sexo.selectedIndex ].value == '' ){
		alert("Debe selecionar el sexo");
		return false;
	}
	
	if ( form.p_direccion.value == '' ){
		alert("Debe introducir su dirección");
		return false;
	}
	
	if ( form.p_poblacion.value == '' ){
		alert("Debe introducir su población");
		return false;
	}
	
	if ( form.p_cp.value == '' ){
		alert("Debe introducir su código postal");
		return false;
	}
	
	if ( form.p_provincia.value == '' ){
		alert("Debe introducir la provincia");
		return false;
	}
		
	if ( form.p_carnet.options[ form.p_carnet.selectedIndex ].value == '' ){
		alert("Debe indicar si posee o no carnet de conducir.s");
		return false;
	}
	
	if ( form.p_telefono_1.value == '' && form.p_telefono_2.value == '' ){
		alert("Debe introducir al menos un número de teléfono");
		return false;		
	}
	

	form.submit();
	return true;
		
}

function validar_contacto( form ){
	if ( form.p_nombre.value == '' ){
		alert("Debe introducir su nombre");
		return false;
	}
	
	if ( form.p_email.value == '' ){
		alert("Debe introducir su mail");
		return false;
	}
	
	if ( form.p_asunto.value == '' ){
		alert("Debe introducir el asunto de contacto");
		return false;
	}
	
	if ( form.p_descripcion.value == '' ){
		alert("Debe introducir una breve descripción explicando el motivo de su contacto.");
		return false;
	}
	
	form.submit();
	return true;
}


function validar_formulario(form)
{
	if( form.form_nombre.value==''){
		alert("Debe introducir su nombre");
		return false;
	}

	if(form.form_email.value==''){
		alert("Debe introducir su email");
		return false;
	}
	
	form.submit();
	return true;
}



