function showBlushVerticals()
{
	$('#blushVerticals').show();	
	if($('#email').val() == "enter email address"){$('#email').val("");}
}

function hideBlushVerticals()
{
	$('#blushVerticals').hide();	
}

function hideBlushThankYou()
{
	$('#blushThankYou').hide();	
}

function doAll()
{
	if($('#all').attr("checked"))
			$("input:checkbox[id^=interests]").attr("checked", true);
		else
			$("input:checkbox[id^=interests]").attr("checked", false);
}

$(document).ready(function() {
	
	/* submit a form */
	var options = {
		beforeSubmit:		validateSignUpForm,
		success:			processResponse,
		dataType:			"json",
		clearForm:			true,
		resetForm:			true
	};
	
	$("#submit").click(function() {
		$("#signUpForm").ajaxSubmit(options);
		return false;
	});
	
});

function validateSignUpForm(formData, jqForm, options) {
	if( !isValid("email", $("#email").val()) ) {
		alert("Please enter a valid email address.");
		$("#email").focus();
	} else if( $("input[@name=interests]:checked").size() == 0 ) {
		alert("Please select your newsletter choices.");
	} else {
		$("#signUpForm").block();
		return true;
	}
	return false;
}

function processResponse(responce, responceStatus) {
	if (responce.success) {
		$("#signUpForm").unblock();
		$('#blushVerticals').hide();
		$('#blushThankYou').show();		
	}
	else {
		alert('Your email address failed to be subscribed. Please try again.');
		$("#signUpForm").unblock();		
	}
}

 /*
function processResponse(response, responseStatus) {
	if(response.RESPONSE == 'SUCCESS') {
		$("#signUpForm").unblock();
		$('#blushVerticals').hide();
		$('#blushThankYou').show();		
	}
	else {
		alert('Your email address failed to be subscribed. Please try again.');
		$("#signUpForm").unblock();			
	}
}
*/
