/* J_Inc_SearchForm */ /******************************************************************/ /** HOTELES, ZONAS Y CONFIGURACIÓN DE HABITACIONES ****************/ /******************************************************************/ var global_maxRooms = 5; var global_adultsOnly = false; var global_maxPaxTotal = 3; var global_maxPaxAdults = 2; var global_maxPaxChildren = 2; var global_maxChildrenAge = 17; var current_maxRooms = global_maxRooms; var current_adultsOnly = global_adultsOnly; var current_maxPaxTotal = global_maxPaxTotal; var current_maxPaxAdults = global_maxPaxAdults; var current_maxPaxChildren = global_maxPaxChildren; var current_maxChildrenAge = global_maxChildrenAge; var current_rooms = 0; ///////////////////////////////////////////////////////////////// function UserRoomConfig(adults, children, ages) { this.adults = adults; this.children = children; this.ages = ages; } userRoomConfigs = new Array(); ///////////////////////////////////////////////////////////////// function Zone(id, description, level, isLeaf, parent) { this.id = id; this.description = description; this.level = level; this.isLeaf = isLeaf; this.parent = parent; this.hotels = new Array(); this.addHotel = function(id, description, adultsOnly, maxPaxTotal, maxPaxAdults, maxPaxChildren, maxChildrenAge, idZone) { this.hotels[this.hotels.length] = new Hotel(id, description, adultsOnly, maxPaxTotal, maxPaxAdults, maxPaxChildren, maxChildrenAge, idZone); } this.addHotel = function(hotel) { this.hotels[this.hotels.length] = hotel; } } function Hotel(id, description, adultsOnly, maxPaxTotal, maxPaxAdults, maxPaxChildren, maxChildrenAge, latitud, longitud, idZone) { this.id = id; this.description = description; this.adultsOnly = adultsOnly; this.maxPaxTotal = maxPaxTotal; this.maxPaxAdults = maxPaxAdults; this.maxPaxChildren = maxPaxChildren; this.maxChildrenAge = maxChildrenAge; this.latitud = latitud; this.longitud = longitud; this.idZone = idZone; } hotels = new Array(); /* Contains the list of hotels with occupation information (class Hotel) */ zoneTree = new Array(); /* Contains the list of zones and hotels with occupation information in each zone */ autocompleteDataSearching = new Array(); /* Contains autocomplete-format list of zones and hotels */ autocompleteData = new Array(); /* Contains autocomplete-format list of zones, used for partners with more than maxHotelsToShowThem */ ///////////////////////////////////////////////////////////////// var nHoteles=0; var maxHotelsToShowThem=100; var zoneTreeLevel = 0; $i(function() { // CARGAR Y OCULTAR Lista de hoteles para HOTEL ÚNICO var hotel = new Hotel( "6200017", "Melia Ria", "N" == "S", "3", "3", "2", "12" ); hotels[0] = hotel; $i('#codigoHotelSeleccionado').val('6200017'); $i('#nombreHotelSeleccionado').val("Melia Ria"); current_adultsOnly = hotels[0].adultsOnly; current_maxPaxTotal = parseInt(hotels[0].maxPaxTotal); current_maxPaxAdults = parseInt(hotels[0].maxPaxAdults); current_maxPaxChildren = parseInt(hotels[0].maxPaxChildren); current_maxChildrenAge = parseInt(hotels[0].maxChildrenAge); $i('#city').val("Melia Ria"); $i('#city').attr("disabled","disabled"); drawRoomsConfig(); $i('#booking-form').attr('action','//booking.meliaria.com/desk/nReservations/jsp/C_Rates.jsp'); $i('#booking-form').addClass("hotelUnico"); /* ACTIVAR OBJETOS HTML */ drawRoomsConfig(); drawOccupationIcon(true); $i('#city-btn-erase').on("click",function() { $i('#city').val(""); $i('#city').catcomplete("option","source",autocompleteData) $i('#city').focus(); $i('#codigoHotelSeleccionado').val(""); $i('#nombreHotelSeleccionado').val(""); $i('#zonaSeleccionada').val(""); updateOccupationFromSelectedZone(""); drawRoomsConfig(); drawOccupationIcon(); $i(this).hide(); }); $i('.occupation .occupation-info.pop-btn').on("click",function() { if (!$i('.occupation-data.popup').is(":visible")) { closeAllPopups(); $i('.occupation-data.popup').slideDown("fast"); placepopup.check(); } else { $i('.occupation-data.popup').slideUp("fast"); } }); $i('.special-search .special-search-info.pop-btn').on("click",function() { if (!$i('.special-search-data.popup').is(":visible")) { closeAllPopups(); $i('.special-search-data.popup').slideDown("fast"); placepopup.check(); } else { $i('.special-search-data.popup').slideUp("fast"); } }); $i('.promotionalcode .pop-btn').on("click",function() { if (!$i('.promotionalcode .popup').is(":visible")) { closeAllPopups(); $i('.promotionalcode .popup').slideDown("fast"); $i('.promotionalcode #codigoPromocion').focus(); } else { $i('.promotionalcode .popup').slideUp("fast"); } }); $i('.promotionalcode #codigoPromocionBis').on("click",function() { if (!$i('.promotionalcode .popup').is(":visible")) { closeAllPopups(); $i('.promotionalcode .popup').slideDown("fast"); $i('.promotionalcode #codigoPromocion').focus(); } else { $i('.promotionalcode .popup').slideUp("fast"); } }); $i('#rooms').on("change",function() { drawOccupationIcon(); }); $i('#codigoPromocion').on("keyup",function() { if ($i('#codigoPromocion').val()!==undefined && $i('#codigoPromocion').val()!="") { $i('#codigoPromocionBis').text("Código promocional: " + $i('#codigoPromocion').val()); } else { $i('#codigoPromocionBis').text(""); $i('#codigoEmpresaBis').text(""); $i('#codigoEmpresa').val(""); } }); if ($i('#codigoPromocion').val()!==undefined && $i('#codigoPromocion').val()!="") { $i('#codigoPromocionBis').text("Código promocional: " + $i('#codigoPromocion').val()); } $i('#codigoAgencia').on("keyup",function() { if ($i('#codigoAgencia').val()!==undefined && $i('#codigoAgencia').val()!="") { $i('#codigoAgenciaBis').text("Código agencia: " + $i('#codigoAgencia').val()); } else { $i('#codigoAgenciaBis').text(""); } }); if ($i('#codigoAgencia').val()!==undefined && $i('#codigoAgencia').val()!="") { $i('#codigoAgenciaBis').text("Código agencia: " + $i('#codigoAgencia').val()); } $i('#codigoEmpresa').on("keyup",function() { if ($i('#codigoEmpresa').val()!==undefined && $i('#codigoEmpresa').val()!="") { $i('#codigoEmpresaBis').text("Código empresa: " + $i('#codigoEmpresa').val()); } else { $i('#codigoEmpresaBis').text(""); $i('#codigoPromocionBis').text(""); $i('#codigoPromocion').val(""); } }); if ($i('#codigoEmpresa').val()!==undefined && $i('#codigoEmpresa').val()!="") { $i('#codigoEmpresaBis').text("Código empresa: " + $i('#codigoEmpresa').val()); } // Duplicate the value of #city to #city-copy $i('#city-copy').html($i('#city').val()); $i('#nombreHotelSeleccionado').val($i('#city').val()); // Se comprueba el nivel del arbol de zonas if (zoneTree != null) { for (var i=0; i 0) { zoneTreeLevel = zone.level; break; } } } if (zoneTreeLevel == 1) $i("#hotel-list").show(); else if (zoneTreeLevel == 2) $i("#destine-list").show(); if (zoneTreeLevel != 0) $i("#destine-map").show(); // In vouchers mode, set the category selectbox }); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// function drawOccupationIcon(initial) { $i('#occupation-icon').removeClass("occ2").removeClass("occ1").removeClass("occn").removeClass("occn-group"); hideOccupationError(); if ($i('#rooms').val()=="1") { var a = parseInt($i('#adultsRoom1').find(":selected").val()); var c = parseInt($i('#childrenRoom1').find(":selected").val()); if (isNaN(c)) c=0; if (a>0) { $i('#icon-adults-number').text(a); $i('#icon-adults-img').show(); } else { $i('#icon-adults-number').text(""); $i('#icon-adults-img').hide(); } if (c>0) { $i('#icon-children-number').text(c); $i('#icon-children-img').show(); } else { $i('#icon-children-number').text(""); $i('#icon-children-img').hide(); } // Si hay parámetros en la url, lo usamos (sólo en la primera vez que se ejecuta la página) if (initial && ""!="") { if (parseInt("")!=a) { var na = ""; if (0 == $("#adultsRoom1 option[value='+na+']").length) { $i('#adultsRoom1').append(""); } $i('#adultsRoom1').val(na) $i('#icon-adults-number').text(""); $i('#icon-adults-img').show(); showOccupationError(); } if ($i('#childrenRoom1').length>0 && parseInt("")!=c) { var nc = ""; if (0 == $("#childrenRoom1 option[value='+nc+']").length) { $i('#childrenRoom1').append(""); } $i('#childrenRoom1').val(nc) $i('#icon-children-number').text(""); $i('#icon-children-img').show(); showOccupationError(); } if ($i('#childrenRoom1').length>0) drawChildrenAges($i("#childrenRoom1")); } $i('#occupation-icon-pnr').show(); $i('#occupation-icon').hide(); } else { $i('#occupation-icon-pnr').hide(); $i('#occupation-icon').addClass("occn-group"); $i('#occupation-icon').show(); } drawOccupationInformation(initial); if (typeof initial === "undefined") { if ($i("#adultsRoom1 option[disabled='disabled']").length != 0) { $i("#adultsRoom1 option[disabled='disabled']").remove(); } if ($i("#childrenRoom1 option[disabled='disabled']").length != 0) { $i("#childrenRoom1 option[disabled='disabled']").remove(); } } } function drawOccupationInformation(initial) { var r=$i('#rooms').val(); if (r=="1") { var a = parseInt($i('#adultsRoom1').val()); var c = parseInt($i('#childrenRoom1').val()); // Si hay parámetros en la url, lo usamos if (initial) { if (parseInt("")!=a) { a = ""; } if (parseInt("")!=c) { c = ""; } } $i('#occupation-text-adults').text(a + " " + ( a==1 ? "Adulto" : "Adultos" ) ); if (c>0) { var childrenText = c + " " + ( c==1 ? "Niño" : "Niños" ) + " ("; for (var n=1; n<=c; n++) { childrenText+=$i('#child'+n+'Room1').val(); if (n"+r+""); } if (current_rooms) { $i('#rooms').val(current_rooms); } drawRooms(); $i('#rooms').change(function() { drawRooms(); drawOccupationIcon(); }); } function drawRooms() { var styleRoomText = ""; $i('.habs').html(""); for (var r=1; r<=$i('#rooms').val(); r++) { $i('.habs').append( "
"+ "

Habitación "+r+"

"+ ""+ "
"+ ""+ "
"+ ""+ ""+ "
"+ "
"+ ""+ "
"+ ""+ "
"+ ""+ ""+ "
"+ "
"+ "
"+ "
Atención
"+ "
La ocupación máxima es de {0} personas (adultos + niños)
"+ "
"+ "
"+ "
"+ "
" ); } // Occupation Tooltip $i('.room .text-tooltip').html($i('.text-tooltip').html().replace(/\{0\}/g,current_maxPaxTotal)); $i(".childrenRoom").tooltip({ items: "*[data-tooltip]", content: function () { return $i(this).attr('data-tooltip'); }, position: { my: 'left-30 bottom-20', at: 'center' }, }); $i(".childrenRoom").tooltip().off(); $i('.childrenRoom').on("click", function(e) { $i(this).tooltip("open"); }); fillAdultsSelectBoxes(); setValAdults(true); fillChildrenSelectBoxes(); setValChildren(true); storeUserRoomConfig(); drawOccupationInformation(); $i('.childrenRoom').on("change",function() { drawChildrenAges(this); }); if (current_adultsOnly) $i('.children').remove(); $i('.childrenRoom').on("mouseout",function(e) { e.stopImmediatePropagation(); }); $i('#adultsRoom1').on("change",function() { drawOccupationIcon(); }); $i('#childrenRoom1').on("change",function() { drawOccupationIcon(); }); // Update max pax according to room configuration $i('.adultsRoom').on("change",function() { fillChildrenSelectBoxes(); setValChildren(false); }); $i('.childrenRoom').on("change",function() { fillAdultsSelectBoxes(); setValAdults(false); }); // Stores the user configuration after every change $i('.adultsRoom, .childrenRoom').on("change",function() { storeUserRoomConfig(); }); $i('.childrenRoom').trigger("change"); } function fillAdultsSelectBoxes() { var i=0; $i(".adults select").each(function() { var nRoom = $i(this).attr("id").replace(/adultsRoom/,""); $i('#adultsRoom'+nRoom+" option").remove(); var selectedChildren = $i('#childrenRoom'+nRoom).val(); if (!selectedChildren) { selectedChildren=0; } i++; for (var n=1; n<=current_maxPaxAdults; n++) { if (n <= current_maxPaxTotal - selectedChildren) { $i(this).append(""); } } }); } function fillChildrenSelectBoxes() { var i=0; $i(".children select").each(function() { var nRoom = $i(this).attr("id").replace(/childrenRoom/,""); $i('#childrenRoom'+nRoom+" option").remove(); var selectedAdults = $i('#adultsRoom'+nRoom).val(); if (!selectedAdults) { selectedAdults=0; } i++; for (var n=0; n<=current_maxPaxChildren; n++) { if (n <= current_maxPaxTotal - selectedAdults) { $i(this).append(""); } } }); } function showOccupationError() { if (!$i('.occupation-info').hasClass("error")) { $i('.occupation-info').addClass("error"); $i('.occupation-info').append("
"); $i('#occupation-error-information').show(); } } function hideOccupationError() { $i('.occupation-info').removeClass("error"); $i('#occupation-error-icon').remove(); $i('#occupation-error-information').hide(); } function setValAdults(getFromSession) { var i=0; $i(".adults select").each(function() { i++; if (current_maxPaxAdults>=2) $i(this).val(2); if (userRoomConfigs[i]) { // Get the user room config if (userRoomConfigs[i].adults && parseInt(userRoomConfigs[i].adults)<=$i(this).find(":last").val()) { if (parseInt(userRoomConfigs[i].adults)<=current_maxPaxAdults) { $i(this).val(userRoomConfigs[i].adults); } } else { $i(this).val( $i(this).find(":last").val() ); } } }); if (getFromSession) { } } function setValChildren(getFromSession) { var i=0; $i(".children select").each(function() { i++; if (userRoomConfigs[i]) { // Get the user room config if (userRoomConfigs[i].children) { if (parseInt(userRoomConfigs[i].children)<=current_maxPaxChildren) { $i(this).val(userRoomConfigs[i].children); } } else { $i(this).val( $i(this).find(":last").val() ); $i("#childrenRoom" + i).trigger("change"); } } }); if (getFromSession) { } } function drawChildrenAges(obj) { var childrenAges=""; var r=$i(obj).attr("id").replace( /^\D+/g, ''); $i(".fieldsetchildren"+r).remove(); if ($i(obj).find(":selected").val()>0) { childrenAges+=""+ "
"+ "Edad niños" ; for (var c=1; c<=$i(obj).find(":selected").val(); c++) { childrenAges+=""+ "
"+ ""+ "
"+ ""+ ""+ "
"+ "
" ; } childrenAges+=""+ "
" ; } var objParent=$i(obj).parent().parent().parent(); objParent.append(childrenAges); objParent.find(".edad").children().children("select").children("option").remove(); for (var a=0; a<=current_maxChildrenAge; a++) { objParent.find(".edad").children().children("select").append(""); } if ($i(obj).find(":selected").val()>0) { if (userRoomConfigs[r]) { // Get the user room config for (var c=0; c<=$i(obj).find(":selected").val()-1; c++) { if (userRoomConfigs[r].ages[c]) { $i('.fieldsetchildren'+r+" select:eq("+parseInt(c)+")").val(userRoomConfigs[r].ages[c]); } } } } // Stores the user configuration after every change $i('.childrenAge').on("change",function() { storeUserRoomConfig(); drawOccupationInformation(); }); } function storeUserRoomConfig() { for (var r=1; r<=$i('#rooms').val(); r++) { var adults = $i('#adultsRoom'+r).find(":selected").val(); var children = $i('#childrenRoom'+r).find(":selected").val(); var ages=new Array(); $i('.fieldsetchildren'+r+' select').each(function() { ages[ages.length]=$i(this).val(); }) u = new UserRoomConfig(adults, children, ages); userRoomConfigs[r] = u; } } /* Set occupation values from selected item in city autocomplete */ function updateOccupationFromSelectedZone(idZone, recursive) { } function updateOccupationFromSelectedHotel(idHotel) { if (idHotel!="") { $i.each( hotels, function( key, value ) { if (idHotel==value.id){ current_adultsOnly=value.adultsOnly; if (parseInt(value.maxPaxTotal)>0) current_maxPaxTotal=parseInt(value.maxPaxTotal); else current_maxPaxTotal=global_maxPaxTotal; if (parseInt(value.maxPaxAdults)>0) current_maxPaxAdults=parseInt(value.maxPaxAdults); else current_maxPaxAdults=global_maxPaxAdults; if (parseInt(value.maxPaxChildren)>0) current_maxPaxChildren=parseInt(value.maxPaxChildren); else current_maxPaxChildren=global_maxPaxChildren; if (parseInt(value.maxChildrenAge)>0) current_maxChildrenAge=parseInt(value.maxChildrenAge); else current_maxChildrenAge=global_maxChildrenAge; } }); } else { current_adultsOnly = true; current_maxPaxTotal = 0; current_maxPaxAdults = 0; current_maxPaxChildren = 0; current_maxChildrenAge = 0; $i.each( hotels, function( key, value ) { if (value.adultsOnly == false) current_adultsOnly=false; if (parseInt(value.maxPaxTotal)>current_maxPaxTotal) current_maxPaxTotal=parseInt(value.maxPaxTotal); if (parseInt(value.maxPaxAdults)>current_maxPaxAdults) current_maxPaxAdults=parseInt(value.maxPaxAdults); if (value.adultsOnly == false) { if (parseInt(value.maxPaxChildren)>current_maxPaxChildren) current_maxPaxChildren=parseInt(value.maxPaxChildren); if (parseInt(value.maxChildrenAge)>current_maxChildrenAge) current_maxChildrenAge=parseInt(value.maxChildrenAge); } }); } } function initHotelListLevel1() { var html = ''; var aZones = new Array(); var hCountries = new HashMap(); for (var i=0; i' + hotel.description + ''; if ($i('#codigoHotelSeleccionado').val() == hotel.id && $i('#city').val() == $i('#nombreHotelSeleccionado').val()) actionSelected = '' + hotel.description + ''; hotels += '
'; hotels += ''; hotels += ''; hotels += actionSelected; hotels += '
'; } var subzoneHotelId = ""; var subzoneHotelName = ""; var subzoneCode = zone.id; var subzoneName = zone.description.replace("'", "\\'"); if (hotelsInZone == 1) { subzoneHotelId = zone.hotels[0].id; subzoneHotelName = zone.hotels[0].description.replace("'", "\\'"); } var zones = ''; zones += '
  • '; zones += '

    ' + zone.description + '

    ' + hotels; zones += '
  • '; aZones.push(zones); } for (var i=0; i'; html += ''; } $i('#hotel-list-content').html(html); } function initHotelListLevel2() { var html = ''; var hZones = new HashMap(); var hSubzones = new HashMap(); var hCountries = new HashMap(); for (var i=0; i' + hotel.description + ''; if ($i('#codigoHotelSeleccionado').val() == hotel.id && $i('#city').val() == $i('#nombreHotelSeleccionado').val()) { actionSelected = '' + hotel.description + ''; subzoneSelected = true; } hotels += '
  • ' + actionSelected + '
  • '; } var classSubzones = ''; var styleSubzones = ''; if (subzoneSelected) { classSubzones = 'show'; styleSubzones = 'display:block;'; } var subzoneHotelId = ""; var subzoneHotelName = ""; var subzoneCode = zone.id; var subzoneName = zone.description.replace("'", "\\'"); if (hotelsInZone == 1) { subzoneHotelId = zone.hotels[0].id; subzoneHotelName = zone.hotels[0].description.replace("'", "\\'"); } var subzones = hSubzones.exists(zone.parent) ? hSubzones.get(zone.parent) : ''; subzones += '
    '; subzones += ''; subzones += ''; subzones += '' + zone.description + '(' + zone.hotels.length + ')'; subzones += '
    '; subzones += '
      ' + hotels + '
    '; hSubzones.put(zone.parent, subzones); } } for (var i=0; i' + value + '' + hSubzones.get(key) + ''; hCountries.put(i%3, countries); } for (var i=0; i'; html += ''; } $i('#destine-list-content').html(html); // Se activa la accion al pulsar en + del listado de zonas $i('.destine-col .display').click(function(event) { var target = $i( event.target ); if(target.hasClass('fa')){ target.closest('.display').nextAll('.subzones').eq(0).slideToggle(); target.closest('.display').toggleClass('show'); return false; } }); } function initMap() { hotelCode = ""; if ($i('#codigoHotelSeleccionado').val() != "" && $i('#city').val() == $i('#nombreHotelSeleccionado').val()) hotelCode = $i('#codigoHotelSeleccionado').val(); googleMapInitialize(hotelCode); } function setHotelFromSearch(zoneCode, zoneName, hotelCode, hotelName, isZone, hotelsInZone, source) { $i('#zonaSeleccionada').val(zoneCode); $i('#city').val(zoneName); $i('#codigoHotelSeleccionado').val(hotelCode); $i('#nombreHotelSeleccionado').val(hotelName); if (hotelsInZone == null || hotelsInZone == 1) { $i('#booking-form').attr('action','//booking.meliaria.com/desk/nReservations/jsp/C_Rates.jsp'); } else { $i('#booking-form').attr('action','//booking.meliaria.com/desk/nReservations/jsp/C_SearchAvailability.jsp'); } $i('#city-btn-erase').show(); if (isZone) { updateOccupationFromSelectedZone(zoneCode); } else { updateOccupationFromSelectedHotel(hotelCode); } drawRoomsConfig(); if (source == 'MAP') $i(".map-list").find(".mfp-close").trigger('click'); else if (source == 'DESTINE') $i(".destine-list").find(".mfp-close").trigger('click'); else $i(".hotel-list").find(".mfp-close").trigger('click'); } function sendSearchForm(forceGetRates, changeNumGuest) { searchToHotels(forceGetRates); } function continueDeleteShoppingCart(forceGetRates) { $i('.mfp-close').trigger('click'); // processingRequest(); searchToHotels(forceGetRates); manageCart('', 'EMPTY_ALL', '', ''); } function searchToHotels(forceGetRates) { if ($i('#main-popup-loading .line2').html()=="") { // Defecto $i('#main-popup-loading .line2').html("Estamos buscando hoteles"); $i('#main-popup-loading .line3').html("De " + $i("#inDate-text").val() + " a " + $i("#outDate-text").val()); if ($i('#city').val()) { $i('#main-popup-loading .line2').html("Estamos buscando hoteles
    en " + $i('#city').val()); $i('#main-popup-loading .line3').html("De " + $i("#inDate-text").val() + " a " + $i("#outDate-text").val()); } if ($i('#codigoHotelSeleccionado').val()!="") { $i('#main-popup-loading .line2').html("Estamos buscando los mejores precios
    en " + $i('#nombreHotelSeleccionado').val()); $i('#main-popup-loading .line3').html("De " + $i("#inDate-text").val() + " a " + $i("#outDate-text").val()); } } // Definimos el action del form dependiendo de las variables seleccionadas if ($i('#codigoHotelSeleccionado').val()!="") { $i('#booking-form').attr('action','//booking.meliaria.com/desk/nReservations/jsp/C_Rates.jsp'); } // Comprobamos si las fechas son correctas var fechaEntrada = $i("#inDate-searchform").datepicker("getDate"); var fechaSalida = $i("#outDate-searchform").datepicker("getDate"); var numNoches = getStayNights(fechaEntrada, fechaSalida); if (parseInt(numNoches) > 0) { // Consultamos disponibilidad var param = "?idPartner=MELIARIA"; param += "&lang=es"; param += "&inDay=" + strPad(fechaEntrada.getDate(), 2, 0); param += "&inMonth=" + strPad(fechaEntrada.getMonth()+1, 2, 0); param += "&inYear=" + fechaEntrada.getFullYear(); param += "&outDay=" + strPad(fechaSalida.getDate(), 2, 0); param += "&outMonth=" + strPad(fechaSalida.getMonth()+1, 2, 0); param += "&outYear=" + fechaSalida.getFullYear(); if ($i("#codigoHotelSeleccionado").val()!="") param += "&hotelCode=" + $i("#codigoHotelSeleccionado").val(); // Used in C_Rates param += "&rooms=" + $i("#rooms").val(); for (i=0; i