jQuery.noConflict();

jQuery(document).ready(function($) {
    var speed = 300;
    var w = '';
    var ddh = '';
    var o = false;
    var z = 50;

    if (jQuery.browser.msie) { $('#navlist .dd_menu').show(); }

    $('#navlist > li').each(function() {
        w = $(this).width() + 28;
        $(this).find('.block').css({ 'width': w,  'marginLeft': '-16px' });
        ddh = $(this).find('.dd_menu').show().height() - 25;
        $(this).find('.dd_menu').hide();
        $(this).find('.primary').height(ddh);
    });

    $('#navlist > li').hover(
        function() {
            if (!o) {
                o = true;
                $(this).find('.block').show();
                $(this).attr('class', 'roll');
                $(this).find('.dd_menu').css('zIndex', z + 1);
                $(this).find('.dd_menu').stop().fadeTo(speed, 1, function() {
                    if (jQuery.browser.msie){
                        $(this).get(0).style.removeAttribute('filter');
                    }
                });
            } else {
                $(this).find('.block').show();
                $(this).attr('class', 'roll');
                $(this).find('.dd_menu').css('zIndex', z + 1);
                $(this).find('.dd_menu').show();
            }
        },
        function(e) {
            if (!$(this).children('a#adminnav').length || !$('.ac_results').length || $('.ac_results').css('display') == 'none') {
                $(this).find('.dd_menu').css('zIndex', z - 10);
                $(this).find('.block').hide();
                $(this).attr('class', '');
                $(this).find('.dd_menu').fadeOut(speed, 0);
            }
        }
    );

    $('#navlist').hover(function() {}, function() { o = false; });

});
