'); } }); }); var greatestWidth = 0; $("#containterIsotopFetchBrand .row-head-brands").each(function() { var theWidth = $(this).width(); if( theWidth > greatestWidth) { greatestWidth = theWidth; } }); $("#containterIsotopFetchBrand .row-head-brands").width(greatestWidth); $(".initial-h img").each(function(){ console.log($(this).height()); var ih = $(this).height(); if(ih < 210){ $(this).addClass("wider"); } }); var $containerFBrand = $("#containterIsotopFetchBrand").isotope(); var $container = $("#containerIsotop").isotope({ layoutMode: "vertical", }); equalheight(".isotopRowHeight"); $(window).resize(function(){ equalheight(".isotopRowHeight"); }); $("input[type='checkbox']").each(function() { $(this).data("checked", "no"); $(this).removeAttr("checked"); }); var myVar; $('input[type="checkbox"]').on("click", function() { var condcheck = $(this).data("checked"); if (condcheck == "no") { $(this).data("checked", "yes"); } else { $(this).data("checked", "no"); } evCheckboxClick(); }); function evCheckboxClick(){ clearTimeout(myVar); var combofilterHF = []; var combofilterBN = []; var combofilterSG = []; var combofilterAC = []; var combofilterPG = []; var filterExec = ""; var iteration = 0; $('input[type="checkbox"]').each(function() { var actualchecked = $(this).data("checked"); var dataRoot = $(this).data("root"); if (actualchecked == "yes" && dataRoot == "propertyFacilities") { combofilterHF[iteration] = $(this).data("filter"); iteration++; } }); var strcombofilterHF = combofilterHF.join(""); filterExec = strcombofilterHF; var iteration = 0; $('input[type="checkbox"]').each(function() { var actualchecked = $(this).data("checked"); var dataRoot = $(this).data("root"); if (actualchecked == "yes" && dataRoot == "starsGiven") { combofilterSG[iteration] = $(this).data("filter")+filterExec; iteration++; } }); var strcombofilterSG = combofilterSG.join(","); if(strcombofilterSG){ filterExec = strcombofilterSG; } var iteration = 0; $('input[type="checkbox"]').each(function() { var actualchecked = $(this).data("checked"); var dataRoot = $(this).data("root"); if (actualchecked == "yes" && dataRoot == "pricingGiven") { combofilterPG[iteration] = $(this).data("filter"); iteration++; } }); if(combofilterPG.length > 0){ var splitSG = filterExec.split(","); if(splitSG.length > 0){ var newComboFilterPG = []; var iteration = 0; for(var i=0; i < combofilterPG.length; i++){ for(var j=0; j < splitSG.length; j++){ newComboFilterPG[iteration] = combofilterPG[i]+splitSG[j]; iteration++; } } var strcombofilterPG = newComboFilterPG.join(","); filterExec = strcombofilterPG; }else{ var strcombofilterPG = combofilterPG.join(","); filterExec = strcombofilterPG; } } var iteration = 0; $('input[type="checkbox"]').each(function() { var actualchecked = $(this).data("checked"); var dataRoot = $(this).data("root"); if (actualchecked == "yes" && dataRoot == "brandName") { combofilterBN[iteration] = $(this).data("filter"); iteration++; } }); if(combofilterBN.length > 0){ var splitSG = filterExec.split(","); if(splitSG.length > 0){ var newComboFilterBN = []; var iteration = 0; for(var i=0; i < combofilterBN.length; i++){ for(var j=0; j < splitSG.length; j++){ newComboFilterBN[iteration] = combofilterBN[i]+splitSG[j]; iteration++; } } var strcombofilterBN = newComboFilterBN.join(","); filterExec = strcombofilterBN; }else{ var strcombofilterBN = combofilterBN.join(","); filterExec = strcombofilterBN; } } var iteration = 0; $('input[type="checkbox"]').each(function() { var actualchecked = $(this).data("checked"); var dataRoot = $(this).data("root"); if (actualchecked == "yes" && dataRoot == "accInside") { combofilterAC[iteration] = $(this).data("filter"); iteration++; } }); if(combofilterAC.length > 0){ var splitBN = filterExec.split(","); if(splitBN.length > 0){ var newComboFilterAC = []; var iteration = 0; for(var i=0; i < combofilterAC.length; i++){ for(var j=0; j < splitBN.length; j++){ newComboFilterAC[iteration] = combofilterAC[i]+splitBN[j]; iteration++; } } var strcombofilterAC = newComboFilterAC.join(","); filterExec = strcombofilterAC; }else{ var strcombofilterAC = combofilterAC.join(","); filterExec = strcombofilterAC; } } $container.isotope({ filter: filterExec }); $containerFBrand.isotope({ filter: filterExec }); equalheight(".isotopRowHeight"); $(window).resize(function(){ equalheight(".isotopRowHeight"); }); scrollToTop(); } function scrollToTop(){ myVar = setTimeout(function(){ var currentdate = new Date(); var datetime = currentdate.getDay() + "/"+currentdate.getMonth() + "/" + currentdate.getFullYear() + " @ " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds(); console.log("scrolling to top at ", datetime); $("html, body").animate({scrollTop : 0},800); }, 1000); } $( ".ceks" ).click(function() { $(this).next(".div-cek").slideToggle(); if ($(this).hasClass("open")) { $(this).removeClass("open"); $(this).addClass("close"); window.setTimeout(function(){ ionSort(); }, 500); return false; } else { $(this).removeClass("close"); $(this).addClass("open"); window.setTimeout(function(){ ionSort(); }, 500); return false; } }); setTimeout(function(){evCheckboxClick();},2000);$("#destinationselection").chosen().change(function(){ setTimeout(function(){ $("#checkin-small").datepicker("show"); },125); var val = $(this).val(); if($("#hs"+val).length){ var adult = $("#hs"+val+" .adult").data("id"); var child = $("#hs"+val +" .children").data("id"); $("#form-rsv-adult").val(adult); $("#form-rsv-children").val(child); if($("#hs"+val +" .children").length){ $("#info-occupancy-form-rsv").val(adult+" adult, "+child+" children"); }else{ $("#info-occupancy-form-rsv").val(adult+" adult"); } }});$(window).scroll(sticky_date_change_box);sticky_date_change_box(); if(!$("#specialOffersPage").length){ $(".btn-show-more-row").on("click", function(){ if($(".show-more-row").is(":visible")){ $(".show-more-row").hide(); $(this).html("Show More"); }else{ $(".show-more-row").show(); $(this).html("Less"); } }); $( "#price-range" ).slider({ range: true, min: 0, max: 0, values: [ 0, 0 ], slide: function( event, ui ) { var priceClass = "fprice-"+ui.values[0]+ui.values[1]; $(".sectionContent").removeClass(function (index, className) { return (className.match (/(^|\s)fprice-\S+/g) || []).join(" "); }); $(".sectionContent").each(function(){ var price = parseInt($(this).data("price")); if(price >= parseInt(ui.values[0]) && price <= parseInt(ui.values[1])){ $(this).addClass(priceClass); } }); $("#priceCheckbox").data("filter","."+priceClass); $("#priceCheckbox").data("checked","no"); $("#priceCheckbox").trigger("click"); $( ".min-price" ).html(formatIDR(parseInt(ui.values[0]))); $( ".max-price" ).html(formatIDR(parseInt(ui.values[1]))); } }); }else{ $("#sidebar-narrow-result").hide(); }$.widget( "custom.autocomplete", $.ui.autocomplete, { _create: function() { this._super(); this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); }, _renderMenu: function( ul, items ) { var that = this, currentCategory = ""; $.each( items, function( index, item ) { var li; if ( item.category != currentCategory ) { ul.append( "
" + item.category + "
" ); currentCategory = item.category; } li = that._renderItemData( ul, item ); if ( item.category ) { li.attr( "aria-label", item.category + " : " + item.label ); } if ( item.logo ) { li.find( "a" ) .addClass( "ui-menu-item-icon" ) .css( "background-image", "url(" + item.logo + ")" ); } }); } }); $("#city_click").val("NTT");var city_list = [{"value":"117","label":"Banyuwangi\r","desc":"Find All Hotels in Banyuwangi\r","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"104","label":"Batam\r","desc":"Find All Hotels in Batam\r","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5273","label":"Bukhara","desc":"Find All Hotels in Bukhara","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"320","label":"Jakarta\r","desc":"Find All Hotels in Jakarta\r","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5267","label":"Jawa Barat","desc":"Find All Hotels in Jawa Barat","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5268","label":"Jawa Tengah","desc":"Find All Hotels in Jawa Tengah","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5269","label":"Jawa Timur","desc":"Find All Hotels in Jawa Timur","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"2","label":"Jayapura\r","desc":"Find All Hotels in Jayapura\r","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5272","label":"Maluku","desc":"Find All Hotels in Maluku","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5271","label":"NTT","desc":"Find All Hotels in NTT","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5270","label":"Sulawesi","desc":"Find All Hotels in Sulawesi","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"5265","label":"Sumatera","desc":"Find All Hotels in Sumatera","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"670","label":"Ternate\r","desc":"Find All Hotels in Ternate\r","category":"Cities","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-city-marker.png"},{"value":"AEGH","label":"Adiroso Managed By Sahid, Jawa Barat","desc":"Hotels in Jawa Barat area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"CRMM","label":"Capa Resort Maumere Managed By Sahid , NTT","desc":"Hotels in NTT area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"GRSJ","label":"Grand Sahid Jaya Jakarta, Jakarta\r","desc":"Hotels in Jakarta\r area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"GSKS","label":"Griyadi Kusuma Solo, Jawa Tengah","desc":"Hotels in Jawa Tengah area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"KSPH","label":"Kusuma Sahid Prince Solo, Jawa Tengah","desc":"Hotels in Jawa Tengah area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"MMOR","label":"Moloka'i Morotai Managed By Sahid, Maluku","desc":"Hotels in Maluku area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SBCC","label":"Sahid Batam Center Hotel & Convention, Batam\r","desc":"Hotels in Batam\r area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SBLH","label":"Sahid Bandar Lampung, Sumatera","desc":"Hotels in Sumatera area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SBTH","label":"Sahid Bela Ternate, Ternate\r","desc":"Hotels in Ternate\r area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SHMH","label":"Sahid Manado, Sulawesi","desc":"Hotels in Sulawesi area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SHZF","label":"Sahid Zarafshon Bukhara, Bukhara","desc":"Hotels in Bukhara area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SJLH","label":"Sahid Jaya Lippo Cikarang, Jawa Barat","desc":"Hotels in Jawa Barat area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SJSH","label":"Sahid Jaya Solo, Jawa Tengah","desc":"Hotels in Jawa Tengah area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SKMH","label":"Sahid Kawanua Manado, Sulawesi","desc":"Hotels in Sulawesi area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SMKH","label":"Sahid Mutiara Karawaci, Jawa Barat","desc":"Hotels in Jawa Barat area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SMPH","label":"Sahid Mandarin Pekalongan, Jawa Tengah","desc":"Hotels in Jawa Tengah area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SMSH","label":"Sahid Montana Malang, Jawa Timur","desc":"Hotels in Jawa Timur area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SMTD","label":"Sahid Montana Dua Malang, Jawa Timur","desc":"Hotels in Jawa Timur area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SOKB","label":"Sahid Osing Kemiren Banyuwangi, Banyuwangi\r","desc":"Hotels in Banyuwangi\r area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SPPH","label":"Sahid Papua, Jayapura\r","desc":"Hotels in Jayapura\r area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SRHY","label":"Sahid Raya Hotel & Convention Yogyakarta, Jawa Tengah","desc":"Hotels in Jawa Tengah area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SSBH","label":"Sahid Surabaya, Jawa Timur","desc":"Hotels in Jawa Timur area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SSCJ","label":"Sahid Skyland City Jatinangor, Jawa Barat","desc":"Hotels in Jawa Barat area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"SSRH","label":"Sahid Serpong, Jawa Barat","desc":"Hotels in Jawa Barat area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"STJH","label":"Sahid Toraja, Sulawesi","desc":"Hotels in Sulawesi area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"STMK","label":"Sahid T-More Kupang, NTT","desc":"Hotels in NTT area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"},{"value":"WPDR","label":"Wakatobi Patuno Diving & Beach Resort Managed By Sahid, Sulawesi","desc":"Hotels in Sulawesi area","category":"Hotels","logo":"https:\/\/booking.alarichotels.com\/assets\/images\/icon-bed-marker.png"}];$("#city_click").click(function(){ ShowDialog(true); }); $("#dialogClose").click(function(e) { HideDialog(); }); $(".choose_h").click(function(){ var type = $(this).attr("data-type"); var vall = $(this).attr("data-value"); var labell = $(this).html(); $("#city_click").val(labell); $("#city").val(vall); if(type == "city"){ $("#formreservation").attr("action", "https://booking.alarichotels.com/bydestination/rates"); }else{ $("#formreservation").attr("action", "https://booking.alarichotels.com/rates/index"); } HideDialog(); return false; }); function ShowDialog(modal) { $("#overlay").show(); $("#dialog").fadeIn(300); $(".abs-wrapper").css("z-index", "41"); $(".menus-m").masonry({ itemSelector: ".menus-m-item", columnWidth: 110 }); if (modal) { $("#overlay").unbind("click"); } else { $("#overlay").click(function(e) { HideDialog(); }); } $("#shadows_bg").fadeIn(300); } function HideDialog() { $("#overlay").hide(); $("#dialog").fadeOut(300); $(".abs-wrapper").css("z-index", "3"); $("#shadows_bg").fadeOut(300); } $(".rate-detaildestination").live("click", (function() { var rel = $(this) . attr("rel"); var pid = $(this) . data("pid"); $.ajax({ type: "POST", url: "https://booking.alarichotels.com/specialoffers/policy/"+pid, dataType: "html", success: function(data) { $(".policycontent") . html(data); }, beforeSend: function() { $(".policycontent").html(""); } }); })); $(function(){ $(".current_curr").click(function(){ $("#signin-dropdown").hide(); if ($("#selected_currency").is(":visible")) { $("#selected_currency").hide(); $("#shadows_bg_curr").hide(); $("#shadows_bg_curr").css("z-index", 40); $("#filterCurrInput").val(""); filterCurr(); } else { $("#selected_currency").slideDown(100); $("#shadows_bg_curr").show(); $("#shadows_bg_curr").css("z-index", 42); } $("#curr_container").css("overflow-y", "scroll"); return false; }); $("#closedCurr").click(function(){ $(".current_curr").trigger("click"); }); var jsonCurr = [{"curr":"AED","country":"United Arab Emirates Dirham"},{"curr":"ANG","country":"Netherlands Antillean Guilder"},{"curr":"ARS","country":"Argentine Peso"},{"curr":"AUD","country":"Australian Dollar"},{"curr":"BDT","country":"Bangladeshi Taka"},{"curr":"BGN","country":"Bulgarian Lev"},{"curr":"BHD","country":"Bahraini Dinar"},{"curr":"BND","country":"Brunei Dollar"},{"curr":"BOB","country":"Bolivian Boliviano"},{"curr":"BRL","country":"Brazilian Real"},{"curr":"BWP","country":"Botswanan Pula"},{"curr":"CAD","country":"Canadian Dollar"},{"curr":"CHF","country":"Swiss Franc"},{"curr":"CLP","country":"Chilean Peso"},{"curr":"CNY","country":"Chinese Yuan"},{"curr":"COP","country":"Colombian Peso"},{"curr":"CRC","country":"Costa Rican Col\u00f3n"},{"curr":"CZK","country":"Czech Republic Koruna"},{"curr":"DKK","country":"Danish Krone"},{"curr":"DOP","country":"Dominican Peso"},{"curr":"DZD","country":"Algerian Dinar"},{"curr":"EEK","country":"Estonian Kroon"},{"curr":"EGP","country":"Egyptian Pound"},{"curr":"EUR","country":"Euro"},{"curr":"FJD","country":"Fijian Dollar"},{"curr":"GBP","country":"British Pound Sterling"},{"curr":"HKD","country":"Hong Kong Dollar"},{"curr":"HNL","country":"Honduran Lempira"},{"curr":"HRK","country":"Croatian Kuna"},{"curr":"HUF","country":"Hungarian Forint"},{"curr":"IDR","country":"Indonesian Rupiah"},{"curr":"ILS","country":"Israeli New Sheqel"},{"curr":"INR","country":"Indian Rupee"},{"curr":"JMD","country":"Jamaican Dollar"},{"curr":"JOD","country":"Jordanian Dinar"},{"curr":"JPY","country":"Japanese Yen"},{"curr":"KES","country":"Kenyan Shilling"},{"curr":"KRW","country":"South Korean Won"},{"curr":"KWD","country":"Kuwaiti Dinar"},{"curr":"KYD","country":"Cayman Islands Dollar"},{"curr":"KZT","country":"Kazakhstani Tenge"},{"curr":"LBP","country":"Lebanese Pound"},{"curr":"LKR","country":"Sri Lankan Rupee"},{"curr":"LTL","country":"Lithuanian Litas"},{"curr":"LVL","country":"Latvian Lats"},{"curr":"MAD","country":"Moroccan Dirham"},{"curr":"MDL","country":"Moldovan Leu"},{"curr":"MKD","country":"Macedonian Denar"},{"curr":"MUR","country":"Mauritian Rupee"},{"curr":"MVR","country":"Maldivian Rufiyaa"},{"curr":"MXN","country":"Mexican Peso"},{"curr":"MYR","country":"Malaysian Ringgit"},{"curr":"NAD","country":"Namibian Dollar"},{"curr":"NGN","country":"Nigerian Naira"},{"curr":"NIO","country":"Nicaraguan C\u00f3rdoba"},{"curr":"NOK","country":"Norwegian Krone"},{"curr":"NPR","country":"Nepalese Rupee"},{"curr":"NZD","country":"New Zealand Dollar"},{"curr":"OMR","country":"Omani Rial"},{"curr":"PEN","country":"Peruvian Nuevo Sol"},{"curr":"PGK","country":"Papua New Guinean Kina"},{"curr":"PHP","country":"Philippine Peso"},{"curr":"PKR","country":"Pakistani Rupee"},{"curr":"PLN","country":"Polish Zloty"},{"curr":"PYG","country":"Paraguayan Guarani"},{"curr":"QAR","country":"Qatari Rial"},{"curr":"RON","country":"Romanian Leu"},{"curr":"RSD","country":"Serbian Dinar"},{"curr":"RUB","country":"Russian Ruble"},{"curr":"SAR","country":"Saudi Riyal"},{"curr":"SCR","country":"Seychellois Rupee"},{"curr":"SEK","country":"Swedish Krona"},{"curr":"SGD","country":"Singapore Dollar"},{"curr":"SKK","country":"Slovak Koruna"},{"curr":"SLL","country":"Sierra Leonean Leone"},{"curr":"SVC","country":"Salvadoran Col\u00f3n"},{"curr":"THB","country":"Thai Baht"},{"curr":"TND","country":"Tunisian Dinar"},{"curr":"TRY","country":"Turkish Lira"},{"curr":"TTD","country":"Trinidad and Tobago Dollar"},{"curr":"TWD","country":"New Taiwan Dollar"},{"curr":"TZS","country":"Tanzanian Shilling"},{"curr":"UAH","country":"Ukrainian Hryvnia"},{"curr":"UGX","country":"Ugandan Shilling"},{"curr":"USD","country":"US Dollar"},{"curr":"UYU","country":"Uruguayan Peso"},{"curr":"UZS","country":"Uzbekistan Som"},{"curr":"VEF","country":"Venezuelan Bol\u00edvar"},{"curr":"VND","country":"Vietnamese Dong"},{"curr":"XOF","country":"CFA Franc BCEAO"},{"curr":"YER","country":"Yemeni Rial"},{"curr":"ZAR","country":"South African Rand"},{"curr":"ZMK","country":"Zambian Kwacha"},{"curr":"ZMW","country":"Zambian Kwacha"}]; function jsonSortByProperty(property){ return function(a,b){ if(a[property] > b[property]) return 1; else if(a[property] < b[property]) return -1; return 0; } } function filterCurr(){ $("#curr_container").html(""); $(".changers-currency-opt").html(""); var fl = $("#filterCurrInput").val(); var jsonData = jsonCurr.filter(function(j){return j.country.toLowerCase().includes(fl.toLowerCase()); }); jsonData.sort(jsonSortByProperty("country")); jsonData.forEach((e) => { if(e.curr == "IDR"){ $(".changers-currency-opt").append(""); } }); jsonData.forEach((e) => { var html = ""; if(e.curr == $.cookie("currcode")){ html = "