﻿
$j(function() {

    if ($get('RouteGroup') && $get('HotelLocation')) {
        initAccomDatesVisibility();
    }

    if (searchLocations) {
        $j('#HotelLocation').autocomplete(searchLocations);
    }
    else {
        if (searchLocationsUrl && searchLocationsUrl != '') $j('#HotelLocation').autocomplete(searchLocationsUrl, { minChars: 2 });
    }

    common_onload();
});

function initAccomDatesVisibility() {
    if (showAccomDates) {
        showHotelDates();
    }
    else {
        hideHotelDates();
    }
    $get('hideHotelDatesLink').style.display = '';
}

function showHotelDates() {
    toggle.show('accomCheckInRow');
    toggle.show('accomDurationRow');

    toggle.hide('accomDatesLinkRow');
}

function hideHotelDates() {
    toggle.hide('accomCheckInRow');
    toggle.hide('accomDurationRow');

    toggle.show('accomDatesLinkRow');
}

