   (function($){
        $(function(){
	       $(document).pngFix();
           
            makeTabs();
           
            $("ul#menu").superfish();

            $('#image_rotator').cycle({
                    fx: 'fade'
            });
            
            makeSidebarArrows();
        });        
        
        function makeTabs(){
            var rotator = $('div.rotator');
            
            $('ul.content-rotator li:first', rotator).show();
            $('ul.nav-rotator li:first a', rotator).addClass('active');
            
            $('ul.nav-rotator a', rotator).click(function(){
                $('ul.nav-rotator a', rotator).removeClass('active');
                $(this).addClass('active');
                var link = $(this).attr('href');
                
                $('ul.content-rotator li:visible', rotator).animate({
                    opacity: 0
                }, 500, function(){
                    $(this).removeAttr('style');
                    
                    $(link).css({'display': 'block', 'opacity': 0}).animate({
                        opacity: 1
                    }, 500);
                });
                
                return false;
            });
        }
        
        function makeSidebarArrows(){
            $('ul#leftmenu li').each(function(){
                var elem = $(this);
                if(elem.children().eq(1).is('ul') ){
                    elem.addClass("menu-has-bottom-border").children().eq(0).prepend('<span class="arrow">&nbsp;</span>');
                    
                    if( elem.hasClass("current-menu-ancestor") || elem.hasClass("current-menu-item") ){
                        elem.children().eq(1).show();
                    }
                }
            });
       
            /* slide down and up */
            /*
            $('ul#leftmenu > li > ul > li > a').click(function(){
                var ret = true;
                var elem = $(this).parent().children().eq(1);
            
                if( elem.is('ul') ){
                    
                    if( elem.is(":visible") ){
                        elem.slideUp("normal");
                    }else{
                        elem.slideDown("normal");
                    }
                    
                    ret = false;
                }
                
                return ret;
            });
            */
        }
        
    })(jQuery.noConflict());
