/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {
		
		
		$('#collection-nav li').each(function(){
			
			var $ul = $(this).find('ul');
			var $li = $(this);
			
			if ($ul.css('display') != 'none'){
				$li.find('div:first-child').addClass('collection-nav-section-selected').removeClass('collection-nav-arrow');
			}
			
			$(this).find('div:first-child').click(function(){
			if ($ul.css('display') == 'none') {
				$li.find('div:first-child').addClass('collection-nav-section-selected').removeClass('collection-nav-arrow');
				$ul.slideDown(500);
				//css('height', '100%');
			} else {
				$li.find('div:first-child').removeClass('collection-nav-section-selected').addClass('collection-nav-arrow');
				$ul.slideUp(500);
				//$li.css('height', '0px');
			}
			})
		});
		
		/*if ($.browser.msie && $.browser.version < 7) return;
        
        $('#navigation li')
            .removeClass('highlight')
            .find('a')
			.append('<div class="up"></div>').each(function () {
                    
					var $span = $('> div.up',this).css('opacity', 1);
	
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(500, 0);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(500, 1);
                    });
                })
            .append('<div class="hover"></div>').each(function () {
                    
					var $span = $('> div.hover',this).css('opacity', 0);

                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(500, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(500, 0);
                    });
                });*/
			
	
	});


	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);
