(function ($) {
    var cache = [];
    // Arguments are image paths relative to the current page.
    $.preLoadImages = function () {
        var args_len = arguments.length;
        for (var i = args_len; i--; ) {
            var cacheImage = document.createElement('img');
            cacheImage.src = arguments[i];
            cache.push(cacheImage);
        }
    }
})(jQuery)
jQuery.preLoadImages("../F1inSchools_Assets/images/homepage/toplinks/top_links_bg.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_hover_bg.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_arabic_left.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_right_sep.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_left_sep_hover.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_right_sep_hover.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_arabic_left_hover.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_contact_right.png", "../F1inSchools_Assets/images/homepage/toplinks/top_links_contact_right_hover.png");
$(document).ready(function () {
    $("#a1").hover(function () {
        $("#a1Left").addClass("a1LeftHover");
        $("#a1Right").addClass("a1RightHover");
    },
                    function () {
                        $("#a1Left").removeClass("a1LeftHover");
                        $("#a1Left").addClass("a1Left");
                        $("#a1Right").removeClass("a1RightHover");
                        $("#a1Right").addClass("a1Right");
                    });

    $("#a2").hover(function () {
        $("#a2Left").addClass("a2LeftHover");
        $("#a2Right").addClass("a2RightHover");
        $("#a1Right").removeClass("a1Right");
    },
                    function () {
                        $("#a2Left").removeClass("a2LeftHover");
                        $("#a2Left").addClass("a2Left");
                        $("#a2Right").removeClass("a2RightHover");
                        $("#a2Right").addClass("a2Right");
                        $("#a1Right").addClass("a1Right");
                    });

    $("#a3").hover(function () {
        $("#a3Left").addClass("a3LeftHover");
        $("#a3Right").addClass("a3RightHover");
        $("#a2Right").removeClass("a2Right");
    },
                    function () {
                        $("#a3Left").removeClass("a3LeftHover");
                        $("#a3Left").addClass("a3Left");
                        $("#a3Right").removeClass("a3RightHover");
                        $("#a3Right").addClass("a3Right");
                        $("#a2Right").addClass("a2Right");
                    });

    $("#a4").hover(function () {
        $("#a4Left").addClass("a4LeftHover");
        $("#a4Right").addClass("a4RightHover");
        $("#a3Right").removeClass("a3Right");
    },
                    function () {
                        $("#a4Left").removeClass("a4LeftHover");
                        $("#a4Left").addClass("a4Left");
                        $("#a4Right").removeClass("a4RightHover");
                        $("#a4Right").addClass("a4Right");
                        $("#a3Right").addClass("a3Right");
                    });


});

