/* * 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!=null && cad.indexOf("")!=-1){ cad = cad.substring(0,cad.indexOf("")); } 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!=null && cad.indexOf("")!=-1){ cad = cad.substring(0,cad.indexOf("")); } 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,tarifaSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,cambioDivisa,edadNinio1,edadNinio2,edadNinio3) { //*********************************************************************** // 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tarifaSel=" + encodeURIComponent(tarifaSel) + "&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)+ "&edad1="+encodeURIComponent(edadNinio1)+ "&edad2="+encodeURIComponent(edadNinio2)+ "&edad3="+encodeURIComponent(edadNinio3),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarSubPrecioReserva(idHotel,tarifaSel,tipHab,numAdultos,numNinos,numSelecc,regSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,cambioDivisa,indicePetHab,indiceHab,indiceHabitacion,edad1,edad2,edad3) { var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaSubPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tarifaSel=" + encodeURIComponent(tarifaSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "®Selecc=" + encodeURIComponent(regSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(paisSel) + "&cambioDivisa="+encodeURIComponent(cambioDivisa) + "&indicePetHab="+encodeURIComponent(indicePetHab) + "&indiceHab="+encodeURIComponent(indiceHab) + "&indiceHabitacion="+encodeURIComponent(indiceHabitacion)+ "&edad1="+encodeURIComponent(edad1)+ "&edad2="+encodeURIComponent(edad2)+ "&edad3="+encodeURIComponent(edad3),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarSubPrecioReservaDOE(idHotel,tarifaSel,tipHab,numAdultos,numNinos,numSelecc,regSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,cambioDivisa,indicePetHab,indiceHab,indiceHabitacion) { var req = newXMLHttpRequest(); var precio = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/grupos/busquedaSubPrecioReservaDOE.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tarifaSel=" + encodeURIComponent(tarifaSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "®Selecc=" + encodeURIComponent(regSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent(modoVisPrecios) + "&paisSel="+encodeURIComponent(paisSel) + "&cambioDivisa="+encodeURIComponent(cambioDivisa) + "&indicePetHab="+encodeURIComponent(indicePetHab) + "&indiceHab="+encodeURIComponent(indiceHab) + "&indiceHabitacion="+encodeURIComponent(indiceHabitacion),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaBX (idHotel,tarifaSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,paisSel,divisaBX,edadNinio1,edadNinio2,edadNinio3) { //*********************************************************************** // 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tarifaSel=" + encodeURIComponent(tarifaSel) + "&tipHab=" + encodeURIComponent(tipHab) + "&numAdultos=" + encodeURIComponent(numAdultos) + "&numNinos=" + encodeURIComponent(numNinos) + "&numSelecc=" + encodeURIComponent(numSelecc) + "&aduRegimenPedi=" + encodeURIComponent(aduRegimenPedi) + "&ninRegimenPedi=" + encodeURIComponent(ninRegimenPedi) + "&accion=" + encodeURIComponent(accion) + "&modoVisPrecios="+encodeURIComponent('M') + "&paisSel="+encodeURIComponent(paisSel) + "&divisaBX="+encodeURIComponent(divisaBX)+ "&edad1="+encodeURIComponent(edadNinio1)+ "&edad2="+encodeURIComponent(edadNinio2)+ "&edad3="+encodeURIComponent(edadNinio3),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (resultado!=null && resultado.indexOf("")!=-1){ resultado = resultado.substring(0,resultado.indexOf("")); } 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; if (resultado!=null && resultado.indexOf("")!=-1){ resultado = resultado.substring(0,resultado.indexOf("")); } 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!=null && cad.indexOf("")!=-1){ cad = cad.substring(0,cad.indexOf("")); } 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!=null && cad.indexOf("")!=-1){ cad = cad.substring(0,cad.indexOf("")); } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaHP (idHotel,tarifaSel,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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/hotelplus/reservas/nueva/busquedaPrecioReserva.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tarifaSel=" + encodeURIComponent(tarifaSel) + "&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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recalcularSuplementosTrasladoVuelta(hora,minuto) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // LOS NUEVOS SUPLEMENTOS DE VUELTA //*********************************************************************** var req = newXMLHttpRequest(); var precioVuelta = "--"; req.onreadystatechange=function() { if(req.readyState==4) { if (req.status == 200) { precioVuelta = req.responseText; if (precioVuelta!=null && precioVuelta.indexOf("")!=-1){ precioVuelta = precioVuelta.substring(0,precioVuelta.indexOf("")); } } else { alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/busquedaSuplementosTrasladoVuelta.jsf?hora="+hora+"&minuto="+minuto,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precioVuelta = req.responseText; if (precioVuelta!=null && precioVuelta.indexOf("")!=-1){ precioVuelta = precioVuelta.substring(0,precioVuelta.indexOf("")); } } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precioVuelta; } function validaReferenciaInterna(referencia){ var req = newXMLHttpRequest(); var valida = "0"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ valida = req.responseText; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } if (valida!=null && valida.indexOf("\n")!=-1){ valida = valida.substring(0,valida.indexOf("\n")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } if (valida!=null && valida.indexOf("\n")!=-1){ valida = valida.substring(0,valida.indexOf("\n")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (salida!=null && salida.indexOf("")!=-1){ salida = salida.substring(0,salida.indexOf("")); } } 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; if (salida!=null && salida.indexOf("")!=-1){ salida = salida.substring(0,salida.indexOf("")); } } else{ salida = -1000; } } return salida; } function validaTasasReserva(idHotel,fechaEntrada){ var req = newXMLHttpRequest(); var salida = ""; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ salida = req.responseText; if (salida!=null && salida.indexOf("")!=-1){ salida = salida.substring(0,salida.indexOf("")); } } else{ salida = -1000; } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/validaTasasReserva.jsf?idHotel=" + idHotel+"&fechaEntrada="+fechaEntrada,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ salida = req.responseText; if (salida!=null && salida.indexOf("")!=-1){ salida = salida.substring(0,salida.indexOf("")); } } 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!="") { idPais = idPais.split("$$")[0]; var salida = buscarDistanciasAjax(idPais,check,kilometros); if (eval(salida)>0) { document.getElementById(check).checked=true; document.getElementById(check).value="S"; document.getElementById(kilometros)[0].value=salida; } else { document.getElementById(check).checked=false; document.getElementById(check).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; if (salida!=null && salida.indexOf("")!=-1){ salida = salida.substring(0,salida.indexOf("")); } } 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; if (salida!=null && salida.indexOf("")!=-1){ salida = salida.substring(0,salida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } } } } 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; if (valida!=null && valida.indexOf("")!=-1){ valida = valida.substring(0,valida.indexOf("")); } }else{ alert('Problema Servidor'); } } return valida; } function recuperarPrecioSeguro (idSeguro, 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio del seguro, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/nueva/calculoPrecioSeguro.jsf?idSeguro=" + encodeURIComponent(idSeguro) + "&numPerAdicionales=" + encodeURIComponent(numPerAdicionales),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio del seguro, intentelo de nuevo'); } } return precio; } function recuperarPrecioReservaDOE (idHotel,tarifaSel,tipHab,numAdultos,numNinos,numSelecc,aduRegimenPedi,ninRegimenPedi,accion,modoVisPrecios,paisSel,cambioDivisa,edadNinio1,edadNinio2,edadNinio3) { //*********************************************************************** // 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } } req.open("GET", "/TOR/jsp/transhotel/reservas/grupos/busquedaPrecioReservaDOE.jsf?idHotel=" + encodeURIComponent(idHotel) + "&tarifaSel=" + encodeURIComponent(tarifaSel) + "&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)+ "&edad1="+encodeURIComponent(edadNinio1)+ "&edad2="+encodeURIComponent(edadNinio2)+ "&edad3="+encodeURIComponent(edadNinio3),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else{ alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } function recuperarPrecioModificacion (id,valor,accion,modoVisPrecios,tipo,pais,cambioDivisa,idVehiculo) { //*********************************************************************** // 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; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } 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) + "&idVehiculo="+encodeURIComponent(idVehiculo),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) + "&idVehiculo="+encodeURIComponent(idVehiculo),false); } req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200) { precio = req.responseText; if (precio!=null && precio.indexOf("")!=-1){ precio = precio.substring(0,precio.indexOf("")); } } else { alert('Error al calcular el precio, intentelo de nuevo'); } } return precio; } //llamada para recuperar el numero de habitaciones que se seleccionan en la reserva. function validarHabitacionesReserva (idHotel) { //*********************************************************************** // HACEMOS PETICION AL SERVIDOR POR AJAX PARA OBTENER // EL NUMERO DE HABITACIONES QUE SE HAN SELECCIONADO //*********************************************************************** var req = newXMLHttpRequest(); var habitaciones = "--"; req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ habitaciones = req.responseText; } //else{ //alert('Error al recuperar las habitaciones, intentelo de nuevo'); //} } } req.open("GET", "/TOR/jsp/validarHabitaciones.jsf?idHotel=" + encodeURIComponent(idHotel),false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ habitaciones = req.responseText; } //else{ //alert('Error al recuperar las habitaciones, intentelo de nuevo'); //} } return habitaciones; } function estadisticasBX (localizador) { //*********************************************************************** // 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/statsBX.jsf?localizador="+localizador,true); req.send(null); } function validaAgDescuentosAj (pagina) { var req = newXMLHttpRequest(); req.onreadystatechange=function(){ if(req.readyState==4){ if (req.status == 200){ procesarRespuestaAjax(req.responseText); } else{ alert('Error'); } } } req.open("GET", "/TOR/jsp/accessControl/validacionAGDescuentos.jsf?pagina="+pagina,false); req.send(null); if (navigator.appName.indexOf("Microsoft Internet Explorer")==-1) //Firefox { if (req.status == 200){ procesarRespuestaAjax(req.responseText); } else{ alert('Error'); } } }