/* * Returns an new XMLHttpRequest object, or false if the browser * doesn't support it */ function newXMLHttpRequest() { var xmlreq = false; // Create XMLHttpRequest object in non-Microsoft browsers if (window.XMLHttpRequest) { xmlreq = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { // Try to create XMLHttpRequest in later versions // of Internet Explorer xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { // Failed to create required ActiveXObject try { // Try version supported by older versions // of Internet Explorer xmlreq = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { // Unable to create an XMLHttpRequest by any means alert(e2); xmlreq = false; } } } return xmlreq; } /* * Returns a function that waits for the specified XMLHttpRequest * to complete, then passes it XML response to the given handler function. * req - The XMLHttpRequest whose state is changing * responseXmlHandler - Function to pass the XML response to */ function getReadyStateHandler(req, responseXmlHandler) { // Return an anonymous function that listens to the XMLHttpRequest instance return function () { // If the request's status is "complete" if (req.readyState == 4) { // Check that we received a successful response from the server if (req.status == 200) { // Pass the XML payload of the response to the handler function. responseXmlHandler(req.responseXML); } else { // An HTTP problem has occurred alert("HTTP error "+req.status+": "+req.statusText); } } } } function recuperarPoblacion (nombrePoblacion, codigoPais) { //****************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL CODIGO DE POBLACION //****************************************************** var req = newXMLHttpRequest(); var datosPob = new Array(); //Dos elementos, el primero el codigo de la poblacion, el segundo el nombre de la poblacion req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { var cad = req.responseText; if (cad != '') { var arraycad = cad.split("#"); datosPob[0]=arraycad[0]; if (arraycad[1] != '') { datosPob[1] = arraycad[1]; } } } else { alert('Error al comprobar poblacion, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPoblacion.jsf?codPais=" + encodeURIComponent(codigoPais) + "&nomPoblacion=" + encodeURIComponent(nombrePoblacion),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { var cad = req.responseText; if (cad != '') { var arraycad = cad.split("#"); datosPob[0]=arraycad[0]; if (arraycad[1] != '') { datosPob[1] = arraycad[1]; } } } else { alert('Error al comprobar poblacion, intentelo de nuevo'); } } return datosPob; } function recuperarPrecioReserva (idHotel,productoSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,cambioDivisa) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&indice=" + encodeURIComponent(productoSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(paisSel) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaEntradas (idHotel,tipHab,numSelecc,modoVisPrecios,paisSel) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioReservaTickets.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numSelecc=" + encodeURIComponent(numSelecc) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(paisSel),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaBX (idHotel,productoSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,divisaBX) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&indice=" + encodeURIComponent(productoSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(paisSel) + "&divisaBX="+encodeURIComponent(divisaBX),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarRegimenVistas (idHotel) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var resultado = ""; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { resultado = req.responseText; var cadena; cadena = resultado.split("#"); recargarRegimenVistas(cadena[0],cadena[1],cadena[2],cadena[3]); } else { alert('Error al calcular el regimen, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaRegimenVistas.jsf?idHotel=" + encodeURIComponent(idHotel),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { resultado = req.responseText; var cadena; cadena = resultado.split("#"); recargarRegimenVistas(cadena[0],cadena[1],cadena[2],cadena[3]); } else { alert('Error al calcular el regimen, intentelo de nuevo'); } } } function recuperarHotel (nombrePoblacion, nombreHotel, codigoPais) { //****************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL CODIGO DEL HOTEL //****************************************************** var req = newXMLHttpRequest(); var datosPob = new Array(); //Dos elementos, el primero el codigo del hotel, el segundo el nombre del hotel req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { var cad = req.responseText; if (cad != '') { var arraycad = cad.split("#"); datosPob[0]=arraycad[0]; if (arraycad[1] != '') { datosPob[1] = arraycad[1]; } } } else { alert('Error al comprobar poblacion, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaHotel.jsf?codPais=" + encodeURIComponent(codigoPais) + "&nomPoblacion=" + encodeURIComponent(nombrePoblacion) + "&nomHotel=" + encodeURIComponent(nombreHotel),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { var cad = req.responseText; if (cad != '') { var arraycad = cad.split("#"); datosPob[0]=arraycad[0]; if (arraycad[1] != '') { datosPob[1] = arraycad[1]; } } } else { alert('Error al comprobar poblacion, intentelo de nuevo'); } } return datosPob; } function recuperarPrecioVisita (idVehiculo,idVisita,valor,accion,modoVisPrecios,pais,cambioDivisa) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioVisita.jsf?idVehiculo=" + encodeURIComponent(idVehiculo) + "&idVisita=" + encodeURIComponent(idVisita) + "&valor=" + encodeURIComponent(valor) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(pais) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioVisitaRegimen (idVisita,valor,accion,modoVisPrecios,pais,cambioDivisa) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioVisita.jsf?idVehiculo=&idVisita=" + encodeURIComponent(idVisita) + "&valor=" + encodeURIComponent(valor) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(pais) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioTraslado (idVehiculo,idTraslado,valor,accion,modoVisPrecios,pais,cambioDivisa) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioTraslado.jsf?idVehiculo=" + encodeURIComponent(idVehiculo) + "&idTraslado=" + encodeURIComponent(idTraslado) + "&valor=" + encodeURIComponent(valor) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&pais="+encodeURIComponent(pais) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaHP (idHotel,productoSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/hotelplus/reservas/nueva/busquedaPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&indice=" + encodeURI(productoSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recalcularSuplementos() { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // LOS NUEVOS SUPLEMENTOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaSuplementosTraslado.jsf",false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recalcularSuplementosTraslado(hora,minuto) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // LOS NUEVOS SUPLEMENTOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaSuplementosTraslado.jsf?hora="+hora+"&minuto="+minuto,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function validaReferenciaInterna(referencia){ var req = newXMLHttpRequest(); var valida = "0"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida=-1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/validaReferencia.jsf?referencia=" + referencia,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida=-1000; } } return valida; } function validaTAC(tac){ var req = newXMLHttpRequest(); var valida = "false"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ alert('La TAC no es válida'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/validaTAC.jsf?tac=" + tac,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ alert('La TAC no es válida'); } } return valida; } function validarCuenta(entidad,oficina,dc,nc){ var req = newXMLHttpRequest(); var valida = "false"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ alert('El numero de cuenta no es válido'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/validaCuentaBancaria.jsf?entidad=" + entidad + "&oficina=" + oficina + "&dc=" + dc + "&nc=" + nc,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ alert('El numero de cuenta no es válido'); } } return valida; } function validarModifReservaOnline(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/modificar/validaReservaOnline.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarReservaOnline(idInterface, idProducto){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/validaReservaOnline.jsf?idInterface=" + idInterface + "&idProducto=" + idProducto,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarModResHabitaciones(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/modificar/validaModResHabitaciones.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarModResFechas(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/modificar/validaModResFechas.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarModResHabitacionesHP(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/hotelplus/reservas/modificar/validaModResHabitaciones.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarSemaforo(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/modificar/validaSemaforo.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarSemaforoHP(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/hotelplus/reservas/modificar/validaSemaforo.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function validarModResFechasHP(idReserva){ var req = newXMLHttpRequest(); var valida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } } req.open("GET", "/TOR/jsp/hotelplus/reservas/modificar/validaModResFechas.jsf?idReserva=" + idReserva,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida = -1000; } } return valida; } function actualizarMarkUp(importeMK,importeMinMK,porcentajeMK){ var req = newXMLHttpRequest(); var salida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ salida = req.responseText; } else{ salida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/recargaMarkUp.jsf?importeMK=" + encodeURIComponent(importeMK) + "&importeMinMK=" + encodeURIComponent(importeMinMK) + "&porcentajeMK=" + encodeURIComponent(porcentajeMK),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ salida = req.responseText; } else{ salida = -1000; } } return salida; } function validaTasasReserva(idPoblacion,fechaEntrada){ var req = newXMLHttpRequest(); var salida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ salida = req.responseText; } else{ salida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/validaTasasReserva.jsf?idPoblacion=" + idPoblacion+"&fechaEntrada="+fechaEntrada,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ salida = req.responseText; } else{ salida = -1000; } } return salida; } function buscarDistancias(idPais,check,kilometros) { try { if (idPais=="") { idPaisAux = document.fBR.lPais[document.fBR.lPais.selectedIndex].value; } else { idPaisAux = idPais; } if (idPaisAux!="") { var salida = buscarDistanciasAjax(idPaisAux,check,kilometros); if (eval(salida)>0) { document.getElementsByName(check)[0].checked=true; document.getElementsByName(check)[0].value="S"; document.getElementsByName(kilometros)[0].value=salida; } else { document.getElementsByName(check)[0].checked=false; document.getElementsByName(check)[0].value="N"; } } } catch(e){} } function pulsarBoton(formulario,nombre){ if (document.getElementById(formulario+":"+nombre)!=null){ document.getElementById(formulario+":"+nombre).click(); } } function buscarDistancias(f,check,kilometros) { try { var idPais = eval("document.getElementById('"+f+":paisSel').value"); if (idPais!="") { var salida = buscarDistanciasAjax(idPais,check,kilometros); if (eval(salida)>0) { document.getElementsByName(check)[0].checked=true; document.getElementsByName(check)[0].value="S"; document.getElementsByName(kilometros)[0].value=salida; } else { document.getElementsByName(check)[0].checked=false; document.getElementsByName(check)[0].value="N"; } } } catch(e){} pulsarBoton(f,"pr3"); } function buscarDistanciasAjax(idPais,check,kilometros){ var req = newXMLHttpRequest(); var salida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ salida = req.responseText; } else{ salida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/obtenerDistancias.jsf?idPais=" + idPais,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ salida = req.responseText; } else{ salida = -1000; } } return salida; } function peticionCodigosMyTorAjax(pUsuario){ var req = newXMLHttpRequest(); var valida = "0"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } else{ valida=-1000; } } } req.open("GET", "/TOR/jsp/resellers/home/heOlvidadoCodigosMyTor.jsf?usuario=" + pUsuario,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; } else{ valida=-1000; } } return valida; } function pasarDatosPestaniasAjax(poblacion, pais, diaEnt, mesEnt, anioEnt, diaSal, mesSal, anioSal, numAdultos, numNinios ){ var req = newXMLHttpRequest(); req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/guardarDatos.jsf?poblacion=" + poblacion + "&pais=" + pais + "&diaEnt=" + diaEnt + "&mesEnt=" + mesEnt + "&anioEnt=" + anioEnt + "&diaSal=" + diaSal + "&mesSal=" + mesSal + "&anioSal=" + anioSal + "&numAdultos=" + numAdultos + "&numNinios=" + numNinios ,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ valida = req.responseText; }else{ alert('Problema Servidor'); } } return valida; } function recuperarPrecioSeguro (numPerAdicionales) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO DEL SEGURO INCLUYENDO LAS PERSONAS ADICIONALES //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio del seguro, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/calculoPrecioSeguro.jsf?numPerAdicionales=" + encodeURIComponent(numPerAdicionales),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio del seguro, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaDOE (idHotel,productoSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,cambioDivisa) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/grupos/busquedaPrecioReservaDOE.jsf?idHotel=" + encodeURIComponent(idHotel) + "&indice=" + encodeURIComponent(productoSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(paisSel) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioModificacion (id,valor,accion,modoVisPrecios,tipo,pais,cambioDivisa) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL PRECIO PARA LA RESERVA INDICADA CUANDO SE MODIFICAN LOS COMBOS //*********************************************************************** var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } if (tipo == 'V') { req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioVisita.jsf?idVisita=" + encodeURIComponent(id) + "&valor=" + encodeURIComponent(valor) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(pais) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); } else { req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioTraslado.jsf?idTraslado=" + encodeURIComponent(id) + "&valor=" + encodeURIComponent(valor) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&pais="+encodeURIComponent(pais) + "&cambioDivisa="+encodeURIComponent(cambioDivisa),false); } req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function estadisticaHotelPatrocinado (idHotel,desHotel,fechaEntrada,fechaSalida) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA // LLAMAR A UNA JSP QUE APAERZCA EN EL AWSTATS //*********************************************************************** var req = newXMLHttpRequest(); req.onreadystatechange=function() { return; } req.open("GET", "/TOR/jsp/patrocinados.jsf?idHotel=" + idHotel + "&desHotel=" + desHotel+ "&fechaEntrada=" + fechaEntrada + "&fechaSalida=" + fechaSalida,true); req.send(null); }