// DESCRIPTION:	Utility functions
// DEPENDS:		prototype.js
INTERNETWARE.certainty.main = function () {

	var overlay;

	return {

		initWatermarks : function() 
		{
			$$('span.name').each(function(element) 
			{
				var firstname = element.getElementsByTagName('input')[0];
				var surname = element.getElementsByTagName('input')[1];

				INTERNETWARE.certainty.main.setWatermark(firstname, ' First Name');
				INTERNETWARE.certainty.main.setWatermark(surname, ' Surname');
								
				Event.observe(firstname, 'focus', function() { if (firstname.value == ' First Name') {firstname.value = '';}  });
				Event.observe(surname,   'focus', function() { if (surname.value == ' Surname' ) surname.value = ''});
				
				Event.observe(firstname, 'blur', function() { INTERNETWARE.certainty.main.setWatermark(firstname, ' First Name'); });
				Event.observe(surname, 'blur', function() { INTERNETWARE.certainty.main.setWatermark(surname, ' Surname'); });
			});
		},

		setWatermark : function(el, name) 
		{
			if(el.value[0] == ' ' || el.value == '') 
			{
			   // el.value = name;
			}
		}
	}
}();
