'); } if (e.keyCode === 38 || e.keyCode === 40) { if (!$('#auto-suggest').hasClass('hide')) { var totalElems = 0; var activeElem = 0; $('#auto-suggest span').each(function () { totalElems++; if ($(this).hasClass('focus')) activeElem = totalElems; }); $('#auto-suggest span.focus').removeClass('focus'); if (e.keyCode === 38) activeElem--; if (e.keyCode === 40) activeElem++; if (activeElem <= 0) activeElem = totalElems; if (activeElem > totalElems) activeElem = 1; $('#auto-suggest span:nth-child(' + activeElem + ')').addClass('focus'); $('#keyword, .fake-keyword').val($('#auto-suggest span.focus').data('keyword')); } } else if (e.keyCode === 27) { $(this).val(''); $('#auto-suggest').addClass('hide'); } else if (e.keyCode === 13) { var locationIds = $('#auto-suggest span.focus').data('location'); if (locationIds && locationIds != 'undefined') { e.preventDefault(); Search.addressKeyword = $('#auto-suggest span.focus').data('location-keyword'); Search.autosuggestLocations(locationIds); } $('#auto-suggest').addClass('hide'); } else { $('#auto-suggest').addClass('hide'); if (Search.autoCompleteTimeout) clearTimeout(Search.autoCompleteTimeout); Search.autoCompleteTimeout = setTimeout(Search.createAutoComplete, 200); } }); } if (DEVICE === 'mobile') { $('.fake-keyword').on('focus keyup', function (e) { $('#keyword, .fake-keyword').val($(this).val()).trigger('fake-keyword', [e.originalEvent]); }); $('.fake-keyword').on('blur', function (e) { $('#auto-suggest').addClass('hide'); }); let roomsPrefix = agentForm ? '#agent_rooms' : '#rooms'; $(roomsPrefix + '_select a').on('click', function () { let $min = $(roomsPrefix + '_min'); let $max = $(roomsPrefix + '_max'); let currVal = parseInt($(this).data('value')); if ($min.val() == $max.val() && currVal == $min.val()) currVal = 0; if (!currVal) { $min.val(''); $max.val(''); } else if (!$min.val() && !$max.val()) { $min.val(currVal); $max.val(currVal); } else if ($min.val() == currVal) { $min.val(currVal+1); } else if ($max.val() == currVal || !$max.val() && currVal === 5) { $max.val(currVal-1); } else { $min.val() < currVal ? $max.val(currVal) : $min.val(currVal); } if ($max.val() == 5) { $max.val(''); if (!$min.val()) $min.val(5); } $min.trigger('change'); }); $(roomsPrefix + '_min, ' + roomsPrefix + '_max').on('change', function () { let min = parseInt($(roomsPrefix + '_min').val()); let max = parseInt($(roomsPrefix + '_max').val()); if (!max) max = 5; let $roomsSelect = $(roomsPrefix + '_select a'); $roomsSelect.removeClass('active'); if (!min) { $roomsSelect.first().addClass('active'); } else { for (var i = min; i <= max; i++) { $roomsSelect.eq(i).addClass('active'); } } }).trigger('change'); $('.main-search .collapse a').on('click', function () { setTimeout(function () { if ($('#search-outer,#search-outer-modulars').hasClass('show')) { $('.main-menu').removeClass('hide'); } else if (PAGE !== 'home') { $('.main-menu').addClass('hide'); } }); }); $('#rooms_min').on('change', function () { log('max => ' + $('#rooms_max').val()); }); $('#short-search').on('stateChanged', function () { let copyElem; if (Search.resetPages.includes(PAGE) && ($(this).hasClass('show') || (!$(this).hasClass('show') && !$(this).hasClass('hide')))) { $('.main-search div[data-copy-short-search]').each(function () { copyElem = $($(this).data('copy-short-search')); copyElem.after('
'); $(this).replaceWith(copyElem); let cityElem = $('[data-group="city"]'); if (cityElem.html() === '') { $('.short-search-city').addClass('hide'); } }); } else { Search.hideMobileSearch(); } }); } Search.$form.on('submit', function () { KV.newSearch = true; }); }, createAutoComplete: function () { let urlParams = KV.trimUrl('/search/keyword' + '&' + Search.$form.serialize(), Search.$form.data('post-trim')); KV.api('/search/keyword' + urlParams, null, function (res) { if (res['items']) { let keyword = $('#keyword' + (MOBILE ? ', .fake-keyword' : '')).val().trim(); let html = ''; for (var row of res['items']) { var pattern = '(' + keyword.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&") + ')'; row['label'] = row['label'].toString() .replace(new RegExp(pattern, 'gi'), '$1<\/strong>') .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/<(\/?strong)>/g, '<$1>'); html += ''; if (row['location_str']) html += ' ' + row['location_str'] + ''; html += row['label']; if (row['category']) html += ' ' + lang('lbl_autocomplete_' + row['category']) + ''; html += ''; } if (html) { if (!keyword) { html = '
' + lang('popular_searches') + '
' + html + '
'; } $('#auto-suggest').html(html).removeClass('hide'); setTimeout(function () { $('#auto-suggest span').on('mousedown tap', function () { var locationIds = $(this).data('location'); if (locationIds && locationIds != 'undefined') { Search.addressKeyword = $(this).data('location-keyword'); Search.autosuggestLocations(locationIds, false); } else { $('#keyword, .fake-keyword').val($(this).data('keyword')); $('#auto-suggest').addClass('hide'); Search.$form.submit(); } }); }, 100); } else { $('#auto-suggest').addClass('hide'); } } }); }, createParishSelect: function (opts) { if (!opts) { Search.$form.find('[name="parish"]').prop('disabled', true).find('option').not(':first,:disabled').remove(); return false; } opts.sort((a, b) => (a['new_parish_name'] > b['new_parish_name']) ? 1 : -1); var html = ''; var usedOpts = []; for (var i in opts) { if (!usedOpts.includes(opts[i]['new_parish_name'])) { usedOpts.push(opts[i]['new_parish_name']); html += ''; if (opts[i]['old_parish_count'] > 1) { for (var i2 in opts) { if (opts[i2]['new_parish_id'] != opts[i]['new_parish_id']) continue; html += ''; } } } } let parishVal = (typeof Search.tmp_parish_id != 'undefined' ? Search.tmp_parish_id : ''); Search.$form.find('[name="parish"]').prop('disabled', false).append(html).val(parishVal).trigger('change'); delete Search.tmp_parish_id; if (Search.$form.attr('id') === 'agent_searchform') { Search.$form.find('select[name="parish"]').prop('disabled', true); } if (Search.submitAfter === 'parish') { $('#keyword, .fake-keyword').val(Search.addressKeyword); Search.$form.submit(); delete Search.submitAfter; } }, createCitySelect: function (opts) { if (!opts) { Search.$form.find('[data-group="city"]').html(''); return false; } opts.sort((a, b) => (a['city_name'] > b['city_name']) ? 1 : -1); var html = '
'; var htmlAfter = ''; for (var i in opts) { if (opts[i]['parent_city_id']) continue; var sub = ''; for (var i2 in opts) { if (opts[i2]['parent_city_id'] != opts[i]['city_id']) continue; sub += ''; sub += ''; } var currHtml = ''; currHtml += ''; if (sub) { html += currHtml + sub; html += '
Address: Apt. 814 34339 Sauer Islands, Hirtheville, GA 02446-8771
Phone: +337636892828
Job: Lead Hospitality Designer
Hobby: Urban exploration, Tai chi, Lockpicking, Fashion, Gunsmithing, Pottery, Geocaching
Introduction: My name is Ray Christiansen, I am a fair, good, cute, gentle, vast, glamorous, excited person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.