// Basic Javascript Functionality

$(document).ready(function(){
	
	$("#nav li .link").click(function(){
		//Hide all menus
		$("#nav li .link").parent().removeClass('selected');
		$("#nav li .sub").slideUp(200);
		
		//The menu we want to expand
		var obj = $(this).next(".sub");
		
		//If it's not already visible, expand it
		if (!$(obj).is(':visible')) {								  			
			$(this).parent().addClass('selected');
			$(obj).slideDown(200);
		}
	});
	
	$('#slideshow').cycle({
		fx: 'fade',
		next: '#next',
		prev: '#prev', 
		speed: 500,
		timeout: 4000,
	});

});
