/* jQuery SlideUp menu v1.0 - http://adis.ro/jquery/slideup/
 * Open source under the BSD License. 
 * Copyright � 2011 Adi Ban
 * All rights reserved (please read the full terms on the original website) */
(function($){
    $.fn.slideupbrenner=function(b){
        var c=jQuery.extend({
            slideUpSpeed:500,
            slideDownSpeed:500,
            ease:"easeInOutCubic",
            stopQueue:true
        },b);
        
        var d=this;
        $(this).find('li').unbind('click mouseenter mouseleave');
        $(this).find('ul.top-menu-main').css({
            'cursor':'pointer'
        });
        $(this).find('ul.top-menu-main > li').css({
            'position':'relative',
            'float':'left',
            'list-style':'none'
        });
        
        $(this).find('ul.top-menu-main > li > a').css({
            'display':'block'
        });
        
        /*$(this).find('ul.top-menu-main > li > a')
        .hover(function() { 
            $(this).css("color", "#94D516"); 
        },
        function() {
            $(this).css("color", "#FFFFFF");
        })
        
        $(this).find('ul.top-submenu')
        .hover(function() { 
            $(this).parent().find('a').css("color", "#94D516");
        },
        function() {
            $(this).parent().find('a').css("color", "#FFFFFF");
        })*/
        
        $(this).find('ul.top-submenu').find('a').css({
            'width' : '100%',
            'height' : '100%'
        });

        $(this).find('ul.top-submenu').css({
            'display':'none'
        }).css({
            'bottom':$('ul.top-menu-main > li').height()+'px',
            'display':'none',
            'position':'absolute',
            'padding':'0px',
            'margin':'0px',
            'white-space':'nowrap'
        });
        
        $(this).find('ul.top-submenu > li').css({
            'list-style':'none'
        });
        $(this).find('ul.top-submenu').css({
            'display':'none'
        }).css({
            'bottom':$('ul.top-menu-main > li').height()+'px'
        });
        $(this).find('ul.top-submenu > li').hover(function(){
            $(this).addClass('hover')
        },function(){
            $(this).removeClass('hover')
        });
        $(this).find('ul.top-menu-main > li').hover(function(){
            var a=$(this).find('ul').css('width',$(this).find('ul').width()+'px');
            if(c.stopQueue)a=a.stop(true,true);
            a.slideDown(c.slideUpSpeed,c.ease)
        },function(){
            var a=$(this).find('ul');
            if(c.stopQueue)a=a.stop(true,true);
            a.slideUp(c.slideDownSpeed,c.ease)
        })
        
    }
})(jQuery);
