$(document).ready(function() {

	// Dropdown Navigation
	function megaHoverOver() {
		$(this).find('.sub').stop().fadeTo('fast',1).show();
	};
	
	function megaHoverOut() {
		$(this).find('.sub').stop().fadeTo('fast', 0, function() {
		$(this).hide();
	});
	}
	
	//Set custom configurations
	var config = {
	     sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
	     interval: 50, // number = milliseconds for onMouseOver polling interval
	     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
	     timeout: 50, // number = milliseconds delay before onMouseOut
	     out: megaHoverOut // function = onMouseOut callback (REQUIRED)
	};
	
	$("ul#nav li .sub").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
	$("ul#nav li").hoverIntent(config); //Trigger Hover intent with custom configurations
	
	
	$('#slider').nivoSlider({
		effect:			'fold',
		slices:			10,
		controlNav: 	false, 
		keyboardNav:	false,
		directionNav:	false,
		animSpeed:		700,
		pauseTime:		6500,
		pauseOnHover:	false 
	});
	
	// Make home page service boxes clickable
	$('.service').click(function(){
		window.location=$(this).find('a').attr('href');
		return false;
	});
	
	// Table on Services Page
	$('#services-table tbody tr:even').addClass('alt'); // Zebra Striping
	$('#services-table tr:last').addClass('final-row'); // Last table cell specific styling

	// Footer Testimonials
	$('.testimonials').cycle({
		fx:	'fade',
		timeout: 9000,
		speed: 1000
	});

	$("#scroller").simplyScroll({
			autoMode: 'loop'
		});
		
		


});

