        (function($){            
            //The function to swap the hidden src and img src
            function swapImages( imgObj ){
                var hiddenObj = imgObj.parent('div.tooltipIcon').find('input[name=src]');
                var tempSrc = imgObj.attr('src');
                   
                imgObj.attr('src', hiddenObj.val());
                hiddenObj.val( tempSrc );
            }
            
            $(function(){
                
                //some fixes
                var wHeight = $(window).height();
                if( wHeight >= $(document).height() ){
                    $('body').height( wHeight );
                    $('#container').attr('style', 'height: '+(wHeight-84)+'px !important;');
                }
                
                //IE6 Fixes
                if( $.browser.msie && ($.browser.version < 7) ){
                    //png fix
                    $(document).pngFix();
                    
                    //:first-child pseudo element fix
                    $('ul#main li > ul.sub-menu li:first').addClass('first-child');
                    
                    //:hover pseudo element fix
                    $('ul#main li').hover(function(){
                        $(this).addClass('ie6fix');
                    }, function(){
                        $(this).removeClass('ie6fix');
                    });
                }
                if( $.browser.msie ){
                    
                    if( $.browser.version != 7 ){
                        $('div#topLevels a h2, div#childCat h1 span').textShadow();
                    }
                    
                    $('div#header').hover(function(){
                        $(this).css('z-index', '9');
                    }, function(){
                        $(this).removeAttr('style');
                    })
                }
                //END IE Fixes
                
                //Menu slider
                $('ul#main li').hover(function(){
                    var height = $('ul.sub-menu', this).eq(0).height();
                    $('ul.sub-menu', this).css({'height': '0px', 'opacity': 0 , 'display': 'block'}).animate({height: height, opacity: 1}, 200);
                }, function(){
                    $('ul.sub-menu', this).animate({height: 'toggle', opacity: 0}, 200, function(){
                        $('ul.sub-menu', this).removeAttr('style');
                    });
                });
                
                //Icons Hover efects - img switch, tooltip, etc.                
                $('div.tooltipIcon img').tooltip({
                    position: 'top right',
                    relative: true,
                    offset: [0, -75], 
                	// when the overlay is opened, load our player
                	onBeforeShow: function() {
                		swapImages( this.getTrigger() );
                	},
                	onHide: function() {
                	   swapImages( this.getTrigger() );
                	},
                    events: {
                        tooltip: false
                    }
                });
                
                //Sidebar menu                                    
                $('div#sidebar li.current-menu-item, div#sidebar li.current-menu-ancestor').children('ul').map(function(){
                    if( $(this).is('ul') )
                        $(this).show();
                });
                
                //Fancybox
                $('a[rel=fancybox]').fancybox({'overlayShow'	: false,
                                				'transitionIn'	: 'elastic',
                                				'transitionOut'	: 'elastic',
                                                'titleShow'     : false,
                                                'hideOnContentClick': true
                            			     });


                  
      		});
        })(jQuery.noConflict());
