var Search =
{
	originalText: null,
	targetBox: null,

	init: function()
	{
		Search.targetBox = $('sign-up-f');
		Search.originalText = Search.targetBox.value;
		Event.observe(Search.targetBox.up(), 'submit', Search.submit);
		Event.observe(Search.targetBox, 'focus', Search.clear);
		Event.observe(Search.targetBox, 'blur', Search.reset);
	},

	clear: function(event)
	{
		//	Only clear the search string if the user
		//	has not previously entered anything.
		if (this.value == Search.originalText)
			this.value = '';
	},

	reset: function(event)
	{
		//	Only reset the search string if there was
		//	nothing entered into the search box.
		if (!this.value)
			this.value = Search.originalText;
	},

	submit: function(event)
	{
		if ((!Search.targetBox.value) || (Search.targetBox.value == Search.originalText))
		{
			Event.stop(event);
			alert('Please Enter Your Email Address!');
			Search.targetBox.focus();
		}
	}
};

Event.observe(window, 'load', Search.init);
