
$(document).ready(function(){
// hide info container on page load
$(".toggle_container").hide();
				   
$('div#button li:first').addClass('active'); // Set the class for active state
$('div#button li a').hover(function(){ // When link is hovered
$('div#button li').removeClass('active'); // Remove active class from links
$(this).parent().addClass('active'); //Set parent of clicked link class to active
});

//disjointed rollover function starting point
$("div#button li").hover(function(){
	//make a variable and assign the hovered id to it
	var elid = $(this).attr('id');
	//hide the image currently there
	$("div#galleryWrapper div").hide();
	//fade in the image with the same id as the selected buttom
	$("div#galleryWrapper div#" + elid + "Img").fadeIn("slow");
	// Hide toggle container on hover
	$(".toggle_container").hide();
	});
	
	//Switch the "Open" and "Close" state per click
	$(".trigger").toggle(function(){
		$(this).addClass("active");
		}, function () {
	});
	//Slide up and down on click
	$(".trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow");
	});
});
