$(document).ready(function() {
	$(document).pngFix(); 
	$(".hat a").colorbox();
	
	$(".checkFields").click(function() {
		emptyFields = 0;
		$("label").removeClass("error");
		errorMessage = '<p><strong>Please fill in the following fields:</strong></p>';
		$("input[type='text']").each(function() {
			if (!$(this).val()) {
				errorMessage = errorMessage + ' - ' + $(this).attr("name") + "<br />";
				$(this).parents("tr:first").find("label").eq(0).addClass("error");
				emptyFields = 1;
			}
		});
		
		if (emptyFields) {
			$(".error_message").html(errorMessage);
			return false;
		}
	});
});
