var SignUp =
{
	text: null,
	init: function()
	{
		SignUp.text = Form.Element.getValue($('suemail'));
		Event.observe($('suemail'), 'focus', SignUp.clear);
		Event.observe($('suemail'), 'blur', SignUp.replace);
		Event.observe($('h-signup'), 'submit', SignUp.submit);
	},

	clear: function(event)
	{
		if (Form.Element.getValue(this) == SignUp.text)
			this.clear();
	},

	replace: function(event)
	{
		//	If its an empty box, clear it.
		if (!this.present())
		{
			this.value = SignUp.text;
			$('suvemail').writeAttribute({'value' : ''});
		}
	},

	submit: function(event)
	{
		//	Not quiet ready to go yet.
		if (!$('suemail').present() || Form.Element.getValue($('suemail')) == SignUp.text)
		{
			event.stop()
			alert('Please Fill In Your email');
		}
		//	Email is in box, don't check if its valid, cause the contact form will handle that
		else
		{
			if (!$('suvemail').present())
				$('suvemail').writeAttribute({'value' : Form.Element.getValue($('suemail'))});
		}
	}
};

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