$(document).ready(function () {
	// Show/Hide menus for navigation dropdowns
	$("#navMain .dir").hoverIntent(showNavigation, hideNavigation);
	function showNavigation() {
		$(this).find("ul:first").slideDown("fast");
	}
	function hideNavigation() {
		$(this).parent().find("ul").slideUp("fast");
	}
	
	// Form Validation
	$('#submitButton').formValidator({
		onSuccess	: '',
		errorDiv	: '#errorDiv1'
	});
	
	$("#main").scrollable({
 
	// basic settings
	vertical: true,
 
	// up/down keys will always control this scrollable
	keyboard: 'static',
 
	// assign left/right keys to the actively viewed scrollable
	onSeek: function(event, i) {
		horizontal.eq(i).data("scrollable").focus();
		}
	})
 
	// horizontal scrollables. each one is circular and has its own navigator instance
	var horizontal = $(".scrollable").scrollable({ circular: true }).autoscroll({interval:8000, autopause:true}).navigator(".navi");
 
	// when page loads setup keyboard focus on the first horzontal scrollable
	if(horizontal.length > 0)
	{
		horizontal.eq(0).data("scrollable").focus();
	}
});
