function staticNav() {
	var leftHeight = $("#left").height(); //Get height of sidenav
	var winHeight = $(window).height(); //Get height of viewport

	$("#left").css({'position' : 'fixed'}); //reset the sidenav to be fixed

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

$(document).ready(function() {

	staticNav(); //Execute function on load
	
	$(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function
		staticNav();
	});
 
	$('#subnav li').hover(
		function() {
		$(this).addClass('hover');
	},
	function(){
		$(this).removeClass('hover');
	}
	);
	
	$('#explore_the_range').click(
		function() {
			$('#explore_range').slideDown('slow');
			$('#footer_close').fadeIn('slow');
		}
	);
	
	$('#footer_close').click(
		function() {
			$('#explore_range').slideUp('slow');
			$('#footer_close').fadeOut('slow');
		}
	);
	
	//$("#subnav1 a").colorbox({inline:true, href:"#aog_updates"});
	$("#subnav1 a, .slide3").colorbox({iframe:true, width:"340px", height:"386px"});
	//$('.modal_slider').hide();

});
