// Load search product tabs and bind to the tabsselect event
$(document).ready(function() {
                           
    // Check for IE6
    if ($.browser.name == 'msie' && $.browser.versionX == 6)
    {
            $('#oldie6').show();
    }
    // Change the non-JS links to the ones required by jQuery UI
    $('#a_product_package').attr('href', '/include/search_box_package.htm');
    $('#a_product_flight').attr('href', '/include/search_box_flight.htm');
    $('#a_product_hotel').attr('href', '/include/search_box_hotel.htm');
    $("#tabs").tabs();
    $('#tabs').bind('tabsselect', function(event, ui) {
        if (ui.index == 1) {
            $("#Search for Package Holidays > input").empty();
        }
    });
    // Update the Fusion lookups
    $('#tabs').bind('tabsload', function(event, ui) {
        $("#Search_Form > input").empty();
        $("#Search_Form > fieldset").empty();
        $("#Search_Form > select").empty();
        // Attach the calendar
        $('#depdate').datepicker({
            mandatory: true,
            closeText: '',
            prevText: 'Earlier',
            nextText: 'Later',
            highlightWeek: true,
            dateFormat: 'dd/mm/yy',
            onSelect: onCalendarDateSelected,
            yearRange: '-0:+2',
            minDate: new Date(2009, 01 - 1, 01),
            hideIfNoPrevNext: true,
            changeYear: true,
            navigationAsDateFormat: true,
            changeMonth: true
        });
        loadDropdownValues(ui.index);
    });
    
    // prevent FOUC - http://bluerobot.com/web/css/fouc.asp/
    //$('.map').css("border", "none").show().maphilight();

    // hide search country field
    $("#SearchCountry").hide();

    // add accordian
    $("#destinations").accordion();
    // cycle images on homepage
    if (window.location.href == "http://rdco-opholidays.dev/default.aspx" || 
        window.location.href == "http://rdco-opholidays.dev/" || 
        window.location.href == "http://www.co-opholidays.co.uk/" || 
        window.location.href == "http://www.co-opholidays.co.uk/default.aspx")
    {
        $(".mainban")
        .after('<div class="cycle-nav"><div class="nav-ban">')
        .cycle({
            fx: 'scrollLeft',
            speed: 300,
            timeout: 5000, 
            pager: '.nav-ban'
           });     
    }
});
function ShowDestinations(continentName) {
        $('.continent').hide();
        var divname = '.' + continentName;
        $(divname).slideDown("fast");
}