 function limitaNroAlojamientos(t) {	var str = new String(t);	document.frmDatos.elements['ta_real'].value = t; if (str.search('GR') > 0) { document.getElementById('nAloj').value = 1; document.getElementById('nAloj').disabled = true; } else document.getElementById('nAloj').disabled =false; } function setMaxAdultos() {	var maxAdultos = 0; var nAlojamientos = 0; var i; if (document.frmDatos.elements['maxAdultos']) maxAdultos = document.frmDatos.elements['maxAdultos'].value; if (document.frmDatos.elements['nAloj']) nAlojamientos = document.frmDatos.elements['nAloj'].value;	var selNAdultos = document.getElementById('nAdultos'); if (selNAdultos) { for (i = selNAdultos.length - 1; i >= 0; i--) { selNAdultos.remove(i); } }	for (i = nAlojamientos; i <= (maxAdultos * nAlojamientos); i++) { var opt = document.createElement("option"); opt.text = i; opt.value = i; selNAdultos.options.add(opt); } } function getMaxPersonas(zdiv, wm, t) { try { getRemote_std(zdiv, '', '_remote.asp?fx=GETMP&wm=' + wm + '&t=' + t); } catch (e) { alert('errsetdisp:' + e.description); } } function rellenaTipo() { var sTmp; sTmp = ""; for (i = 1; i < document.frmDatos.chkTipo.length; i++) { if (document.frmDatos.chkTipo[i].checked) sTmp += ":" + document.frmDatos.chkTipo[i].getAttribute('cod') + ":, "; } if (sTmp.length > 0) sTmp = sTmp.substr(0, sTmp.length - 2); document.frmDatos.elements['ta'].value = sTmp; } function ocultaZonaReserva() { showZona('div_res', 'none'); showZona('div_reservar', 'none'); showZona('div_res2', 'none'); } function checkDisp() { document.getElementById('div_res').innerHTML = ''; showZona('div_res', ''); showZona('div_reservar', 'none'); showZona('div_res2', 'none'); setresobligatorios('N'); esperando(); postFormAjaxSite('div_res', 'frmDatos', '_remote.asp?fx=CHKDI'); } function reservar() { var nAlojDisabled; AbreVentana('/comun/blank.html', 'reservar', 720, 500, 0);	if (document.getElementById('nAloj').disabled) nAlojDisabled = true; else nAlojDisabled = false; if (nAlojDisabled) document.getElementById('nAloj').disabled = false; document.frmDatos.submit(); if (nAlojDisabled) document.getElementById('nAloj').disabled = true; return 0; showZona('div_res', 'none'); showZona('div_res2', 'none'); showZona('div_reservar', ''); document.frmDatos.elements['nombre'].focus(); } function checkEmailValid(email) {	var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/; if (!filter.test(email)) { alert('Please enter a valid email address'); return false; } else return true; } function reservafin() { setresobligatorios('S'); var res; res = checkForm('frmDatos'); if (res == '') { res = checkCreditCard(document.frmDatos.elements['ntarjeta'].value, document.frmDatos.elements['tcre'].value); if (res) { res = checkEmailValid(document.frmDatos.elements['email'].value); if (res) { showZona('zona_btn_reserva_wait', 'block'); showZona('zona_btn_reserva', 'none'); esperando('zona_btn_reserva_wait', 'Book'); showZona('div_res2', ''); postFormAjaxSite('div_res2', 'frmDatos', '_remote.asp?fx=SETRES'); } } else alert('Not entered a valid card number'); } else alert(res); } function setresobligatorios(val) { try { if (document.frmDatos.elements['nombre']) document.frmDatos.elements['nombre'].setAttribute('obligatorio', val); if (document.frmDatos.elements['ntarjeta']) document.frmDatos.elements['ntarjeta'].setAttribute('obligatorio', val); if (document.frmDatos.elements['email']) document.frmDatos.elements['email'].setAttribute('obligatorio', val); if (document.frmDatos.elements['tcre']) document.frmDatos.elements['tcre'].setAttribute('obligatorio', val); } catch (e) { alert('roblig_' + e.description); } } function reservaOK() { showZona('div_reservar', 'none'); esperando_fin(); showZona('zona_btn_reserva_wait', 'none'); showZona('zona_btn_reserva', 'block'); if (parent.name == 'popup') { document.location.href = 'reservar.asp?wm=' + document.frmDatos.elements['wm'].value + '&res=' + encode(document.getElementById('div_res2').innerHTML); } } function reservaMAL() { alert('NO se ha podido realizar la reserva'); esperando_fin(); showZona('zona_btn_reserva_wait', 'none'); showZona('zona_btn_reserva', 'block'); }
