jQuery.jQueryRandom = 0;
jQuery.extend(jQuery.expr[":"], {
    random: function (a, i, m, r) {
        if (i == 0) {
            jQuery.jQueryRandom = Math.floor(Math.random() * r.length);
        };
        return i == jQuery.jQueryRandom;
    }
});

$(document).ready(function () {
    $("div#shortcuts a").hover(

    function () {
        $(this).animate({
            "opacity": 0.8,
        }, 400);
    }, function () {
        $(this).animate({
            "opacity": 0.3,
        }, 1200);
    });

    function randomLink() {
        var link = $("div#shortcuts a:random");

        link.animate({
            "opacity": 0.8,
        }, 1500);
        link.animate({
            "opacity": 0.3,
        }, 2000);
    };

    setInterval(randomLink, 5000);

});
