|
Solicitar reserva function vacio(q) { for ( i = 0; i < q.length; i++ ) { if ( q.charAt(i) != " " ) { return true } } return false } function fValidarEmail(valor) { var str=valor var filtro=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i if (filtro.test(str)) resultado=true else{ resultado=false } return (resultado) } function getTimestamp(fecha_dd_mm_yyyy) { var dia_aux = parseInt(fecha_dd_mm_yyyy.substring(0, 2),10); var mes_aux = parseInt(fecha_dd_mm_yyyy.substring(3, 5),10); var ano_aux = parseInt(fecha_dd_mm_yyyy.substring(6, 10),10); var fecha = new Date(); fecha.setFullYear(ano_aux); fecha.setMonth(mes_aux-1); fecha.setDate(dia_aux); fecha.setHours(0); fecha.setMinutes(0); fecha.setSeconds(0); fecha.setMilliseconds(0); var timestamp = parseInt(fecha.getTime(),10); return timestamp; } function ValidarEntreFechas(f1,f2) { if (getTimestamp(f1) >= getTimestamp(f2)) { document.getElementById("fecha1").style.color = "#C00000"; document.getElementById("fecha2").style.color = "#C00000"; return false; } else { document.getElementById("fecha1").style.color = "#000000"; document.getElementById("fecha2").style.color = "#000000"; } } function Valida(formulario) { var xValor = true; var xMensaje; if(vacio(formulario.telefono.value) == false) { document.getElementById("telefono").style.color = "#C00000"; formulario.telefono.focus(); xValor = false; } else { document.getElementById("telefono").style.color = "#000000"; } if(vacio(formulario.email.value) == false || (fValidarEmail(formulario.email.value) == false)) { document.getElementById("email").style.color = "#C00000"; formulario.email.focus(); xValor = false; } else { document.getElementById("email").style.color = "#000000"; } if(vacio(formulario.direccion.value) == false) { document.getElementById("direccion").style.color = "#C00000"; formulario.direccion.focus(); xValor = false; } else { document.getElementById("direccion").style.color = "#000000"; } if(vacio(formulario.apellidos.value) == false) { document.getElementById("apellidos").style.color = "#C00000"; formulario.apellidos.focus(); xValor = false; } else { document.getElementById("apellidos").style.color = "#000000"; } if(vacio(formulario.nombre.value) == false) { document.getElementById("nombre").style.color = "#C00000"; formulario.nombre.focus(); xValor = false; } else { document.getElementById("nombre").style.color = "#000000"; } if(vacio(formulario.num.value) == false) { document.getElementById("num").style.color = "#C00000"; formulario.num.focus(); xValor = false; } else { document.getElementById("num").style.color = "#000000"; } if((formulario.doble.checked==false) && (formulario.doble_individual.checked==false)) { document.getElementById("tipohab").style.color = "#C00000"; xValor = false; } else { document.getElementById("tipohab").style.color = "#000000"; } if(vacio(formulario.fecha2.value) == false || ValidarEntreFechas(formulario.fecha1.value,formulario.fecha2.value) == false) { document.getElementById("fecha2").style.color = "#C00000"; xValor = false; } else { document.getElementById("fecha2").style.color = "#000000"; } if(vacio(formulario.fecha1.value) == false || ValidarEntreFechas(formulario.fecha1.value,formulario.fecha2.value) == false) { document.getElementById("fecha1").style.color = "#C00000"; xValor = false; } else { document.getElementById("fecha1").style.color = "#000000"; } return xValor; } | Fecha de llegada: * | | | Fecha de salida: * | | | Tipo de habitación: * | doble doble individual | | Número de habitaciones * | 1 2 3 4 5 6 7 8 9 | | (si se solicita mas de una habitación de diferente tipología detallarlo en el apartado Observaciones) | Datos personales | Empresa: | | | Nombre: * | | | Apellidos: * | | | Dirección: * | | | E-mail: * | | | Teléfono: * | | Observaciones Nota: la respuesta a la solicitud de reserva realizada a través de la web no podra garantizarse si la misma se realiza con un plazo inferior a 24 horas antes del servicio solicitado. (*) Campos requeridos |
|