$(document).ready(function() {
    $('#menu li').each(function() {
       
        
        $('div',this).mouseover(function() {
        // first, add the black class to the button
           $('span',this).removeClass('clear').addClass('hover');
            // initiate slide for the hidden element
            $(this).siblings('ul:hidden').slideDown(50);
        })
        $(this).hover(function() {},
            function() {
                $('ul:visible', this).slideUp(100,'linear',function () {
                  // remove black class from the button when complete. Holy shit, this is like Actionscript for morons!
                  $(this).siblings('div').children('span').removeClass('hover').addClass('clear');
                });
        })
       
    });
    
    // do highlights
    $("table.highlightable tbody tr").mouseover(function(){$(this).addClass("hilite");}).mouseout(function(){$(this, ".hilite").removeClass("hilite");});
    $("table.highlightable tbody tr").click(function(){$(this).toggleClass("select");});
});


