jQuery(function($) {

    $("ul#menu").superfish();

    $("#slideshow-wrapper").anythingSlider({});

    // yes yes, virtually identifcal code, dont have time to refactor
    hideTimetablesAndShowWhenSelected();
    hideLocationsAndShowWhenSelected();
    redirectOnLocationChosen();
});

function hideTimetablesAndShowWhenSelected() {
    $("div.timetable").hide();
    $("#timetable_1").show();

    $("#timetable-chooser").change(function() {
        var ord = $("#timetable-chooser option:selected").val();

        $("div.timetable").hide();
        $("#timetable_" + ord).show();
    });
}

function hideLocationsAndShowWhenSelected() {
    $("#locator ul li").hide();
    $("#location_1").show();

    $("#locate-select").change(function() {
        var ord = $("#locate-select option:selected").val();

        $("#locator ul li").hide();
        $("#location_" + ord).show();
    });
}


