$(document).ready(function() {
		
		
		$('.nav').supersubs({
		minWidth: 		9,						// requires em unit.
		maxWidth: 		25,						// requires em unit.
		extraWidth: 	0						// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
    }).superfish({
		hoverClass:		'nav-hover',			// 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:			400,					// 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:		true,					// if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
		disableHI:		false					// set to true to disable hoverIntent detection 
	//	onInit:			function(){},			// callback function fires once Superfish is initialised Ð 'this' is the containing ul 
	//	onBeforeShow:	function(){},			// callback function fires just before reveal animation begins Ð 'this' is the ul about to open 
	//	onShow:			function(){},			// callback function fires once reveal animation completed Ð 'this' is the opened ul 
	//	onHide:			function(){}			// callback function fires after a sub-menu has closed Ð 'this' is the ul that just closed 
	});
	
		
		// Member sign In Dropdown script
	
            $(".signin").click(function(e) {
                e.preventDefault();
                $("fieldset#signin_menu").toggle();
                $(".signin").toggleClass("menu-open");
            });

            $("fieldset#signin_menu").mouseup(function() {
                return false
            });
            $(document).mouseup(function(e) {
                if($(e.target).parent("a.signin").length==0) {
                    $(".signin").removeClass("menu-open");
                    $("fieldset#signin_menu").hide();
                }
            });            
			
	// Homepage photo gallery script		
	$("#fullwidth_slider").PikaChoose({transition:[0], showCaption:false}); // 0: full frame cross fade
		
	$("#fullwidth_slider").jcarousel({scroll:4,					
		  initCallback: function(carousel) {
		  $(carousel.list).find('img').click(function() {
				carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
		  });
		}
	});
	
	
	
	
	// PrettyPhoto
	$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_square',slideshow:2000});
	$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000});
	
	// Fade Effect on Hover
	$(".fade_top").hover(
		function() {
		$(this).stop().animate({"opacity": "0"}, "slow");
	},
		function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
	
	
});
