/* 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;
current_rooms = 1;
global_maxRooms = 1;
/////////////////////////////////////////////////////////////////
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() {
/* Widget autocomplete */
$i.widget( "custom.catcomplete", $i.ui.autocomplete, {
_renderMenu: function( ul, items ) {
var that = this,
currentCategory = "";
$i.each( items, function( index, item ) {
if ( item.category != currentCategory ) {
ul.append( "
" + item.category + "
" );
currentCategory = item.category;
}
that._renderItemData( ul, item );
});
},
_renderItem: function (ul, item){
var listItem = $i("").data("item.autocomplete", item);
var anchor=$i("");
if (item.indent) {
var indent=item.indent-1;
if (item.type=="hotel") indent++;
anchor.addClass("ui-autocomplete-indent-"+indent);
}
if (item.type=="hotel") anchor.addClass("ui-autocomplete-hotel");
if (item.type=="zone") anchor.addClass("ui-autocomplete-zone");
if (item.allhotelslink==true) {
anchor.html("Todos os hotéis");
} else {
anchor.html(item.label);
}
listItem.append(anchor);
return listItem.appendTo(ul);
}
});
var accentMap = {
"á":"a", "à":"a", "ä":"a", "â":"a", "ã":"a",
"é":"e", "è":"e", "ë":"e", "ê":"e",
"í":"i", "ì":"i", "ï":"i", "î":"i",
"ó":"o", "ò":"o", "ö":"o", "ô":"o", "õ":"o",
"ú":"u", "ù":"u", "ü":"u", "û":"u",
"ç":"c",
"ñ":"n"
};
var normalize = function(term) {
var ret = "";
for ( var i = 0; i < term.length; i++ ) {
ret += accentMap[ term.charAt(i) ] || term.charAt(i);
}
return ret;
};
// CARGAR Lista de hoteles
var hotel = new Hotel(
"6200082",
"3HB Clube Humbria",
"N" == "S",
"5",
"4",
"4",
"17"
);
hotels[hotels.length] = hotel;
autocompleteDataSearching[autocompleteDataSearching.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
autocompleteData[autocompleteData.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
var hotel = new Hotel(
"6200081",
"3HB Falésia Mar ",
"N" == "S",
"5",
"4",
"4",
"17"
);
hotels[hotels.length] = hotel;
autocompleteDataSearching[autocompleteDataSearching.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
autocompleteData[autocompleteData.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
var hotel = new Hotel(
"6200083",
"3HB Golden Beach ",
"N" == "S",
"8",
"6",
"7",
"14"
);
hotels[hotels.length] = hotel;
autocompleteDataSearching[autocompleteDataSearching.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
autocompleteData[autocompleteData.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
var hotel = new Hotel(
"6200080",
"3HB Falésia Garden ",
"N" == "S",
"5",
"4",
"4",
"17"
);
hotels[hotels.length] = hotel;
autocompleteDataSearching[autocompleteDataSearching.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
autocompleteData[autocompleteData.length] = {label:hotel.description, category:"", indent:'0', allhotelslink:false, type:'hotel'}
$i('#city').val("3HB Falésia Garden ");
autocompleteDataSearching.sort(function(a, b) {
return a.label > b.label;
});
autocompleteData.sort(function(a, b) {
return a.label > b.label;
});
updateOccupationFromSelectedHotel($i('#codigoHotelSeleccionado').val());
/* ACTIVAR OBJETOS HTML */
// MOSTRAR Lista de hoteles y zonas
$i('#city').catcomplete({
source: autocompleteData,
minLength: 0,
sortResults: true,
select: function(event, ui) {
var zoneSelected=false;
if (ui.item) {
$i.each(zoneTree, function(key, value) {
if (ui.item.value==value.description) {
$i('#zonaSeleccionada').val(value.id);
zoneSelected=true;
return false;
}
});
if (zoneSelected) {
// Se ha seleccionado una zona
// Si en la zona sólo hay un hotel, no buscar en la zona
for (i=0; i0) {
$i('#city-btn-erase').show();
} else {
$i('#city-btn-erase').hide();
}
} else {
mostrarErrorWeb('isAlert.ERROR_SELECT_DESTINO');
}
}
}).focus(function () {
closeAllPopups();
$i(this).select();
$i(this).catcomplete("search");
}).click(function () {
closeAllPopups();
$i(this).select();
$i(this).catcomplete("search");
}).keyup(function () {
if ($i(this).val().length>0) {
$i('#city-btn-erase').show();
} else {
$i('#city-btn-erase').hide();
}
});
$i('.ui-autocomplete-input').on('keyup', function(e){
if ($i('#city').val().length > 0) {
$i('#city').catcomplete("option","source",
function( request, response ) {
var matcher = new RegExp( $i.ui.autocomplete.escapeRegex( request.term ), "i" );
response( $i.grep( autocompleteDataSearching, function( value ) {
value = value.label || value.value || value;
return matcher.test( value ) || matcher.test( normalize( value ) );
}) );
}
);
} else {
$i('#city').catcomplete("option","source",autocompleteData);
}
});
drawRoomsConfig();
drawOccupationIcon(true);
if ($i('#city').val().length>0) {
$i('#city-btn-erase').show();
} else {
$i('#city-btn-erase').hide();
}
$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('#booking-form').attr('action','//3hb.idiso.com/desk/nReservations/jsp/C_Rates.jsp');
$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 agência: " + $i('#codigoAgencia').val());
} else {
$i('#codigoAgenciaBis').text("");
}
});
if ($i('#codigoAgencia').val()!==undefined && $i('#codigoAgencia').val()!="") {
$i('#codigoAgenciaBis').text("Código agência: " + $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 && "2"!="") {
if (parseInt("2")!=a) {
var na = "2";
if (0 == $("#adultsRoom1 option[value='+na+']").length) {
$i('#adultsRoom1').append("");
}
$i('#adultsRoom1').val(na)
$i('#icon-adults-number').text("2");
$i('#icon-adults-img').show();
showOccupationError();
}
if ($i('#childrenRoom1').length>0 && parseInt("1")!=c) {
var nc = "1";
if (0 == $("#childrenRoom1 option[value='+nc+']").length) {
$i('#childrenRoom1').append("");
}
$i('#childrenRoom1').val(nc)
$i('#icon-children-number').text("1");
$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("2")!=a) {
a = "2";
}
if (parseInt("1")!=c) {
c = "1";
}
}
$i('#occupation-text-adults').text(a + " " + ( a==1 ? "Adulto" : "Adultos" ) );
if (c>0) {
var childrenText = c + " " + ( c==1 ? "Criança" : "Crianças" ) + " (";
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(
"
"+
"
Quarto "+r+"
"+
""+
"
"+
""+
"
"+
""+
""+
"
"+
"
"+
""+
"
"+
""+
"
"+
""+
""+
"
"+
"
"+
"
"+
"
Atenção
"+
"
A ocupação máxima é {0} de pessoas (adultos e crianças).
"+
"
"+
"
"+
"
"+
"
"
);
}
// 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) {
$i("#adultsRoom1").val(2);
}
}
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) {
var childrenRoom = $i("#childrenRoom1");
if (!current_adultsOnly && childrenRoom.length > 0) {
childrenRoom.val(1);
drawChildrenAges(childrenRoom);
}
}
}
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+=""+
"
"
;
}
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();
});
$i("#child1Room1").val(2);
}
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 += '
';
}
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 += '
';
aZones.push(zones);
}
for (var i=0; i';
html += '
' + value + '
';
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 += '