$(document).ready(function(){
	// Home page slideshow
	$('#slideshow').plusSlider({
		createArrows: true, // Creates forward and backward navigation
		createPagination: true, // Creates Numbered pagination
	
		displayTime: 8000, // The amount of time the slide waits before automatically moving on to the next one. This requires 'autoPlay: true'
		speed: 1000, // The amount of time it takes for a slide to fade into another slide
	
		autoPlay: true, // Creats a times, looped 'slide-show'
		keyboardNavigation: true, // The keyboard's directional left and right arrows function as next and previous buttons
		pauseOnHover: true, // Autoplay does not continue ifsomeone hovers over Plus Slider.
	
		sliderEasing: 'linear', // Anything other than 'linear' and 'swing' requires the easing plugin
		sliderType: 'fade', // Choose whether the carousel is a 'slider' or a 'fader'
	
		width: false, // Overide the default CSS width
		height: false // Overide the default CSS width
	});
	
	
	// Testimonials rotator
	$('#testimonials').innerfade({
		speed: 900,
		timeout: 8000,
		type: 'sequence',
		containerheight: 'auto'
	});
	
	
	// Navigation slider
	$('li.sub a').click(function() {
		var link_rel = $(this).attr('rel');

		if ( $('.subnav-panel:visible') ) {
		
			var tpanel = $('.subnav-panel:visible').attr('id');
			var open_panel = '#'+(tpanel);

			$(open_panel).slideUp('500');
			$('#'+link_rel).delay('300').slideDown('500');
			
		} else {		
			$('#'+link_rel).slideDown('500');
		};
		
		return false;
	});
	

});
