$(document).ready(
	function() {
	
		// BEGIN configuring superfish menu
		$("#nav").superfish({
			hoverClass: 'sfhover',			// the class applied to hovered list items
			pathClass: 'overideThisToUse',	// the class you have applied to list items that lead to the current page
			pathLevels: 1,					// the number of levels of submenus that remain open or are restored using pathClass
			delay: 150,						// the delay in milliseconds that the mouse can remain outside a submenu without it closing 
			animation: {opacity:'show'},	// an object equivalent to first parameter of jQuery's .animate() method
			speed: 'fast',					// speed of the animation. Equivalent to second parameter of jQuery's .animate() method 
			autoArrows: false,				// if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance
			dropShadows: false				// disable drop shadows
		});
		// END configuring superfish menu

		// BEGIN toggling homepage welcome text
		$(document).ready(function() {
			// the div that will be hidden/shown
			var panel = $("#about_this_season");
			//the button that will toggle the panel
			var button = $("#about_this_season_toggle");
			// do you want the panel to start off collapsed or expanded?
			var initialState = "collapsed"; // "expanded" OR "collapsed"
			// the class added when the panel is hidden
			var activeClass = "open";
			// the text of the button when the panel's expanded
			var visibleText = "About This Season";
			// the text of the button when the panel's collapsed
			var hiddenText = "About This Season";
			//---------------------------
			// don't edit below this line,<
			// unless you really know what you're doing
			//---------------------------</p>
			if($.cookie("panelState") == undefined) {
				$.cookie("panelState", initialState, {
					expires: 30,
					path: '/'
				});
			}
			var state = $.cookie("panelState");
			if(state == "collapsed") {
				panel.hide();
				button.text(hiddenText);
				button.addClass(activeClass);
			}
			button.click(function(){
				if($.cookie("panelState") == "expanded") {
					$.cookie("panelState", "collapsed", {
						expires: 30,
						path: '/'
					});
					button.text(hiddenText);
					button.addClass(activeClass);
				} else {
					$.cookie("panelState", "expanded", {
						expires: 30,
						path: '/'
					});
					button.text(visibleText);
					button.removeClass(activeClass);
				}
				panel.slideToggle("slow");
				return false;
			});
		});
		// END toggling homepage welcome text

		// BEGIN tabs
		$("ul.tabs").tabs("div.panes > div.pane");
		// END tabs

		// BEGIN current season menu
		$("select.go").change(function() {
			window.location = $(this).val();
		});
		// END current season menu

		// BEGIN slideshow
		$('#slideshow ul')
		.before('<div id="slideshow_nav" class="clr">')
		.cycle({
			cleartype: 1, // enable cleartype corrections
			fx: 'fade',
			timeout: 10000,
			pager: '#slideshow_nav'
		});
		// END slideshow
		
		// BEGIN lightbox
		$('ul.gallery a').lightBox();
		// END lightbox

	}
);
