$(function() {
	$('#side_nav_contact_form').submit(function() {
		if(!$('#contact_name').val()) {
			alert('Name is required');
			$('#contact_name').focus();
			return false;
		}
		if(!$('#contact_email').val()) {
			alert('Email is required');
			$('#contact_email').focus();
			return false;
		}
		if(!$('#contact_email').val().match(/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/)) {
			alert('Your Email appears to be invalid');
			$('#contact_email').focus();
			return false;
		}
		if(!$('#contact_comments').val()) {
			alert('Please provide a comment with this request.');
			$('#contact_comments').focus();
			return false;
		}
		return true;
	});
	$('#top_nav li').hover(function(){
		$(this).addClass('over');
		showTopMenu();
	}, function(){
		$(this).removeClass('over')
		setTimeout(function() {
			$('#top_nav li[class!=over]').find("ul.act").slideUp(300, function(){ $(this).removeClass("act") });
		}, 400); 
		
	});
	$('#top_nav li ul a').hover(function() {
		//$(this).stop().animate({paddingLeft: '25px'}, 300, function(){
			$(this).css("background-position", "center left");
			$(this).css("background-repeat", "no-repeat");
			
		//});
	}, function() {
		//$(this).stop().animate({paddingLeft: '4px'}, 150, function(){
			
		//});
	});
});
function showTopMenu() {
	if($('#top_nav li.over').find('ul').length && $('#top_nav li.over').find('ul.act').length) {
		setTimeout('showTopMenu()', 50);
	} else {
		$('#top_nav li.over').find('ul[class!=act]').addClass('act').slideDown(300);
	}
}
