// prepare the form when the DOM is ready 
$(document).ready(function(){ 
	
	$("input.text").focus(function(){
		$(this).val("");
	});
	
	$("input#email").blur(function(){
		if ($(this).val() == "")
		{
			$(this).val("Email"); 
		}
	});
	
	$("input#name").blur(function(){
		if ($(this).val() == "")
		{
			$(this).val("Name"); 
		}
	});
	
	$('#subscriber-capture').ajaxForm({success: showResponse}); 
	
});
 
// post-submit callback 
function showResponse(responseText, statusText)
{ 
	if (responseText.indexOf("Success") != -1)
	{
		$("#subscriber-capture").before('<p class="success">Thanks! You’ll receive an email confirmation soon.</p>');
		$("#subscriber-capture").remove();
		$("p.error").remove();		
	}
	else
	{
		$("#subscriber-capture").before('<p class="error">' + responseText + '</p>');
	}
}