if (!imagePath)
    var imagePath = '';

jQuery.preloadImages = function() {
    for(var i = 0; i<arguments.length; i++)
        jQuery("<img>").attr("src", imagePath + arguments[i]);
}

// Preload various background images
$.preloadImages('images/bgTileLow.jpg',
                'images/ffo-faq-folder-bg.png',
                'images/ffo-pages-tile.png',
                'images/ffo-about-lg.png',
                'images/ffo-nav-bc-on.png',
                'images/ffo-nav-mm-on.png',
                'images/ffo-nav-syp-on.png',
                'images/ffo-nav-ci-on.png',
                'images/ffo-nav-al-on.png',
                'images/ffo-nav-ch-on.png',
                'images/ffo-02-complete-on.png',
                'images/off-03-on.jpg',
                'images/off-04-on.jpg',
                'images/ffo-getfftag-on.png'
                );

// Document load functions
$(document).ready(function () {
    // setup hover images
    $('#mtmission').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-meet-btn-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-meet-btn.png'); }
    );
    $('#syplans').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-btn-submit-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-btn-submit.png'); }
    );
    $('#ms').hover(
        function () { $(this).attr('src', imagePath + 'images/off-04-on.jpg'); },
        function () { $(this).attr('src', imagePath + 'images/off-04.jpg'); }
    );
    $('#comm').hover(
        function () { $(this).attr('src', imagePath + 'images/off-03-on.jpg'); },
        function () { $(this).attr('src', imagePath + 'images/off-03.jpg'); }
    );
    $('#ms-faq').hover(
        function () { $(this).attr('src', imagePath + 'images/off-faq-04-on.jpg'); },
        function () { $(this).attr('src', imagePath + 'images/off-faq-04.jpg'); }
    );
    $('#comm-faq').hover(
        function () { $(this).attr('src', imagePath + 'images/off-faq-03-on.jpg'); },
        function () { $(this).attr('src', imagePath + 'images/off-faq-03.jpg'); }
    );
    $('#getff').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-getfftag-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-getfftag.png'); }
    );
    $('#basecamp[class!=selected]').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-bc-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-bc.png'); }
    );
    $('#mm[class!=selected]').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-mm-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-mm.png'); }
    );
    $('#syp[class!=selected]').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-syp-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-syp.png'); }
    );
    $('#ci[class!=selected]').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-ci-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-ci.png'); }
    );
    $('#al[class!=selected]').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-al-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-al.png'); }
    );
    $('#ch[class!=selected]').hover(
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-ch-on.png'); },
        function () { $(this).attr('src', imagePath + 'images/ffo-nav-ch.png'); }
    );
    $('#completebox').hover(
        function () { $('#complete').attr('src', imagePath + 'images/ffo-02-complete-on.png'); },
        function () { $('#complete').attr('src', imagePath + 'images/ffo-02-complete.png'); }
    );
});