﻿/// <reference path="jquery-1.4.1-vsdoc.js" />

var loadedImages = []; // this must be outside any function to remain in scope all the time

$(function() {
    $("#MainMenu a img, .FooterContactButton img").each(function() {
        var normalSrc = $(this).attr("src");
        var hoverSrc = normalSrc.replace(".gif", "-over.gif");

        // preload rollovers
        var cacheImage = document.createElement('img');
        cacheImage.src = hoverSrc;
        loadedImages.push(cacheImage);

        // setup rollover
        $(this).hover(
            function() {
                $(this).attr("src", hoverSrc);
            },
            function() {
                $(this).attr("src", normalSrc);
            }
        );
    });
});
