$(document).ready(function(){
	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
	$("ul.menu li a").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on hover

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('medium'); //When the mouse hovers out of the subnav, move it back up
		});

		/*Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
		*/
	});
	
	$('#slideshow').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 6000,
		next:   '#nextslide', 
		prev:   '#prevslide',
		after:	function() {
					$('#slidecaption').html(this.alt);
				},
		pager:  '#nav',
		pauseOnPagerHover: true
	});
	
	
	$('#slideshow3').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 5000,
		next:   '#nextslide3', 
		prev:   '#prevslide3',
		after:	function() {
					$('#slidecaption').html(this.alt);
				},
		pager:  '#nav3' 		
	});
	/*
	$('#slideshow') 
		.before('<div id="nav">') 
		.cycle({ 
    	fx:     'turnDown', 
    	speed:  'fast', 
    	timeout: 0, 
    	
	});
	*/
	$('#slideshow2').cycle({
		fx: 'scrollHorz',
		speed: 500,
		timeout: 6000,
		next:   '#prevslide2', 
		prev:   '#nextslide2',
		after:	function() {
					$('#slidecaption').html(this.alt);
				}
	});
	$('#quote_1').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 10000
	});
	$('#quote_2').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 10000,
		delay: 500
	});
	$('#quote_3').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 10000,
		delay: 1000
	});
	
	$("a#inline").fancybox({
		
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true
	});
	
	
});

$(document).init(function() {
	$("a.zoom").fancybox({
		'zoomSpeedIn'		:	300,
		'zoomSpeedOut'		:	300,
		'overlayShow'		:	true,
		'overlayOpacity'	: 	0.8,
		'overlayColor'		: 	'black'
	});
});

