$(document).ready(function() {
	$('input[name=updates]').click(function() {
		if (($('input[name=updates]:checked').val() == 'Yes'))
			$('#personal').show('slow');
		else
			$('#personal').hide('slow');
	}).blur();

	$("#submit").click(function() {
		$('span.error').hide();		// hide all error messages

		if ($("input:checkbox:checked").length == 0) {
			$('span.interest').show();
			return false
		}

		if ($("input:radio:checked").length == 0) {
			$('span.updates').show();
			return false
		}

		if (($('input[name=updates]:checked').val() == 'Yes')) {
			$('#personal span').hide();		// hide all error messages

			if (!$("input#name").val()) {
				$("input#name").focus().next("span").show();
				return false;
			}

			if (($("input#email").val().length) < 5) {
				$("input#email").focus().next('span').show();
				return false
			}

		}
		return true;
	});
});