﻿/*
    Etienne's Simple Drop Down Menu
    Last update: 24 Aug 2010 
    
    How to use:
    
        1) On the HyperLink Add the attribute SubMenu (the ID of the Sub Menu): 
        <a href="#" SubMenu="menu-about"> Show Menu </a>
        
        2) Create the menus
        <ul id="menu-about" class="submenu">
            <li>a</li>
            <li>b</li>
        </ul>
        
*/

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) //test for MSIE x.x;
{
    var ieversion = new Number(RegExp.$1) // capture x.x portion and store as a number
}
else { //Only execute if we are not in IE. Code for IE is in ie.simple.dropdown.menu.js

    //SETTINGS
    var opacity = 0.90;

    $(document).ready(function () {

        var submenu;
        $(".menu a").mouseover(function () {
            //close last opened menu
            $(submenu).stop().fadeOut(200);

            //Open the new menu
            submenu = "#" + $(this).attr('submenu');
            $(submenu).stop().fadeTo(200, opacity);

        });

        $(".submenu").mouseleave(function () { $(submenu).stop().fadeOut(200); });

    });
}
