
$(document).ready(function() {
    $(".menuoverstate").each(function(i) {

        preload_image = new Image();
        preload_image.src = this.src.replace(".gif", "_o.gif");

        $(this).hover(
            function() {
                if (this.src.indexOf("_o.gif") == -1) {
                    this.src = this.src.replace(".gif", "_o.gif");
                }

            },

            function() {
                this.src = this.src.replace("_o.gif", ".gif");

            });

    }
        );
});


$(document).ready(function() {


    $(".hidden-content").hide();

    // preload background images on nav divs

    $("#[id^=nav] a").each(function() {
        var preview_image = new Image();
        var image = $(this).css("background-image");

        preview_image.src = image.replace(".gif)", "_d.gif").replace("url(", "");

    });

    $("#[id^=nav]").toggle(function() {
        $(this).addClass("active");
    }, function() {
        $(this).removeClass("active");
    });

    $("#[id^=nav]").click(function() {
        $(this).next(".hidden-content").slideToggle("slow");
    });

});






