﻿
jQuery.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++)
        jQuery("<img>").attr("src", arguments[i]);
}


function pageLoad(sender, args) {

    // dynamically preload over images
    $(".jrollover").each(
    function() {
        jQuery("<img>").attr("src", this.src.replace(".gif", "_Over.gif"));
    }
       );

    // setup rollover actions
    $(".jrollover").hover(
            function() {
                if (this.src.search("_Over") < 0)
                    this.src = this.src.replace(".gif", "_Over.gif");
            },
            function() {
                this.src = this.src.replace("_Over", "");
            }
        );

    // rollover wine cellar
    $("#wine_cellar").hover(
            function() {
                $(this).addClass("wine_cellar_over");
            },
            function() {
                $(this).removeClass("wine_cellar_over");
            }
        );

    //rollover subsections
    $(".section").hover(
            function() {
                $(this).addClass("section_over");
            },
            function() {
                $(this).removeClass("section_over");
            }
        );
}

