$(function(){
			$.fn.supersized.options = {  
				startwidth: 640,  
				startheight: 480,
				vertical_center: 1,
				slideshow: 1,
				navigation: 0,
				transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
				pause_hover: 0,
				slide_counter: 0,
				slide_captions: 0,
				slide_interval: 4000  
			};
	        $("#supersize").supersized();
	        
	        function staticNav() {
       			var sidenavHeight = $("#sidenav").height(); //Get height of sidenav
       			var winHeight = $(window).height(); //Get height of viewport
        		var browserIE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false; //Check for IE6

        	if (browserIE6) { //if IE6...
            	$("#sidenav").css({'position' : 'absolute'});  //reset the sidenav to be absolute
       		} else { //if not IE6...
            	$("#sidenav").css({'position' : 'fixed'}); //reset the sidenav to be fixed
       		}

       		if (sidenavHeight > winHeight) { //If sidenav is taller than viewport...
           		$("#sidenav").css({'position' : 'static'}); //switch the fixed positioning to static. Say good bye to sticky nav!
        	}
    }

    staticNav(); //Execute function on load

    $(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function
        staticNav();
    });
    
    
      
    
    var offset = $("#floatMenu").offset();
            var topPadding = 15;
            $(window).scroll(function() {
                if ($(window).scrollTop() > offset.top) {
                    $("#floatMenu").stop().animate({
                        marginTop: $(window).scrollTop() - offset.top + topPadding
                    });
                } else {
                    $("#floatMenu").stop().animate({
                        marginTop: 0
                    });
                };
            });
    function collapsing_nav() {
		$("body").addClass("enhanced");
		$("#collapsing-nav > li:first").addClass("selected");
		$("#collapsing-nav > li").not(":first").find("ul").hide();
		$("#collapsing-nav > li span").click(function() {
			if ($(this).parent().find("ul").is(":hidden")) {
				$("#collapsing-nav ul:visible").slideUp("slow");
				$("#collapsing-nav > li").removeClass("selected");
				$(this).parent().addClass("selected");
				$(this).parent().find("ul").slideDown("slow");
				}
			});
		}
		$(collapsing_nav);
	    });
	    
	    
