﻿///<reference path="jquery-1.6.2.min.js"/>
///<reference path="jquery.hoverIntent.minified.js"/>
$(function () {
    //Animated menu hover
    //Animation now done with css transitions
    if (!($.browser.msie && $.browser.version == "6.0")) {
        $("ul#menu li:not(.current)").each(function () {
            var item = $(this)
            item.children("a").css({ backgroundImage: "none" }).before("<div class=\"hover-bg\"></div");
            item.hoverIntent(
            { over: function () {
                $(this).find(".hover-bg").fadeIn("normal");
            },
                out: function () {
                    $(this).find(".hover-bg").fadeOut("slow");
                },
                interval: 50,
                timeout: 10
            }
            );
        });
    }
    else {
        //IE6
        //Disable animation
        jQuery.fx.off = true;
    }

    //Lang menu
    $("#lang-select").hoverIntent(
        function () {
            $(this).find("#lang-menu").fadeIn("normal");
            $(this).find(".current-lang .name").fadeIn("normal");
            $(this).find(".arrow").fadeOut("normal");
        },
        function () {
            $(this).find("#lang-menu").fadeOut("normal");
            $(this).find(".current-lang .name").fadeOut("normal");
            $(this).find(".arrow").fadeIn("normal");
        });
});
