﻿
function changeURL(url) {
    document.location = url;
}

jQuery.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++)
        jQuery("<img>").attr("src", arguments[i]);
}

// main menu
$(document).ready(function() {
    // hide submenus
    $(".divMenuItem .divMenuSub li")
            .addClass("divMenuSubItemUnselected")
            .hide();
    // set background of rollover divs
    $(".divMenuButton").addClass("divMenuUnselected");
    // popup submenu
    $(".divMenuItem").hover(
            function() {
                $(this).find(".divMenuSub").show();
                $(this).find(".divMenuSub>li")
                    .hide()
                    .show();
            },
            function() {
                $(this).find(".divMenuSub").hide();
            }
        )
    // popup subsubmenu
    $(".divMenuSubItem").hover(
            function() {
                $(this).find(".divMenuSubChild").show();
                $(this).find(".divMenuSubChild>li")
                    .hide()
                    .show();
            },
            function() {
                $(this).find(".divMenuSubChild").hide();
            }
        )
    // rollover submenu item (colour only, sub and subsubmenu)
    $(".divMenuSub>li, .divMenuSubChild>li").hover(
            function() {
                $(this)
                    .removeClass("divMenuItemUnselected")
                    .addClass("divMenuItemSelected");
            },
            function() {
                $(this)
                    .removeClass("divMenuItemSelected")
                    .addClass("divMenuItemUnselected");
            }
        );
});

// left hand menu
$(document).ready(function() {
    

    // stuff for side menu
    $(".jexpand").hover(
        function() {
            $(this).find(".jscrollable").slideDown("slow");
        },
        function() {
        }
    );

});