var selectedMenus = new Array();

/** rotate images for hp **/
$(document).ready(function() {
    PreloadImages();
    // set the menu items to the over src that are in the selected menus array
    $(selectedMenus).each(function(i, image) {
        imgSelector = 'img[src$="images/' + image + '"]';
        if ($(imgSelector).length > 0) {
            newSrc = $(imgSelector).attr('current') ? $(imgSelector).attr('current') : $(imgSelector).attr('over');
            $(imgSelector).attr('src', newSrc).removeAttr('over').removeAttr('current');
        }
    });
});

/** image roll over **/
function PreloadImages() {
    $('img[over], input[over]').each(function() {
        $('<img />').attr('src', $(this).attr('over'));
        $(this).mouseover(function() {
            $(this).attr('out', $(this).attr('src'));
            $(this).attr('src', $(this).attr('over'));
        });
        $(this).mouseout(function() {
            $(this).attr('src', $(this).attr('out'));
        });
    });
}