﻿
function isIE() {

    if (navigator.userAgent.match(/MSIE \d\.\d+/))

        return true;

    return false;

}  

function zIndexWorkaround() {

    // If the browser is IE,  
    if (isIE()) {
        /*  
        ** For each div with class menu (i.e.,  
        ** the thing we want to be on top),  
        */

        $("#mainmenu").parents().each(function () {

            var p = $(this);

            var pos = p.css("position");

            // If it's positioned,  

            if (pos == "relative" ||
               pos == "absolute" ||
               pos == "fixed") {

                /*  

                ** Add the "on-top" class name when the  

                ** mouse is hovering over it, and remove  

                ** it when the mouse leaves.  

                */

                p.hover(function () {

                    $(this).addClass("on-top");

                },

                    function () {

                        $(this).removeClass("on-top");

                    });

            }

        });

    }

}


$(document).ready(function () {

    if ($("ul.sf-menu").length > 0) {
        $("ul.sf-menu").supersubs({
            minWidth: 12,
            maxWidth: 200,
            extraWidth: 1
        }).superfish({
            delay: 1000,                            // one second delay on mouseout 
            animation: { opacity: 'show', height: 'show' },  // fade-in and slide-down animation 
            speed: 'fast',                          // faster animation speed 
            dropShadows: false                            // disable drop shadows 
        }).find('ul').bgIframe({ opacity: false });

        $("#breadcrumb-menu-ul").jBreadCrumb();

        zIndexWorkaround();
    }

});

