$(document).ready(function() {
	//$(".pagenav").find("ul").append('<li><a class="contact">Contact</a></li>');
	$("#contact-form").validate({
		rules: {
			name: {
				required:true,
				rangelength:[2,35]
			},
			email: {
				required:true,
				email:true
			},
			message: {
				required:true,
				rangelength:[4,500]
			}
		},
		errorPlacement: function(error, element) {
			element.parent().after(error);
		}
	});

	$("a.contact").click(function() {
		showContact();
	});
	
	$("#contact-close").click(function() {
		hideContact();
	});
});

function showContact() {
	$("#contact-overlay").show();
	$("#contact").show();
}

function hideContact() {
	$("#contact-overlay").hide();
	$("#contact").hide();
}