

$(document).ready(function(){

	clearInput('#homepage_body input#signup_box');

	

	
});


/*
 * 
 * 
 * 
 * 	$("#signup_submit_button").click( function(event) {
		
		event.preventDefault(); // cancel default behavior which is to submit the form
		
		$("#error").empty();

		var email = $("#signup_box").val();

		var post_location = $("#signup_submit_form").attr("action"); 
		
		//alert(post_location);
		
		$.post("/contact/email_submit", { email: email }, function(data) {
			if(data == "success") {
				$("#error").fadeOut(500, function() {
					$("#error").empty().append("<br /><br /><span class='success'>Thank you for your submission!</span><br /><br />").fadeIn(2000);
				});
			} else {
				$("#error").html(data).hide().slideDown("slow");
			}
		});
	});
 * 
 * 
 * 
 */

function clearInput(tag)
{

	var clearMePrevious = '';
	
	//clear input on focus
	$(tag).focus(function()
	{
		if($(this).val()==$(this).attr('title'))
		{
		clearMePrevious = $(this).val();
			$(this).val('');
		}
		$(this).css("color", "#000");
	});
	
	//if field is empty afterward, add text again
	$(tag).blur(function()
	{
		if($(this).val()=='')
		{
			$(this).val(clearMePrevious);
		}
		$(this).css("color", "#ccc");
	});


}

 
