if(document.getElementById && document.createTextNode) Event.observe(window, 'load', function()
{
	if($('contactForm')){Event.observe('contactForm','submit', validate, false);};
});
function validate(e)
{
	var i=3;
	var formArray = Form.getElements('contactForm');
	formArray.reverse();
	formArray.each(function(eachElement)
	{
		if(eachElement.value == '')
		{
			if(eachElement.previousSibling.getElementsByTagName('span').length < 1)
			{
				eachElement.previousSibling.innerHTML += " <span> is required</span>";
				
			}
			eachElement.focus();
		}
		else
		{
			if(eachElement.previousSibling.getElementsByTagName('span').length > 0)
			{
				eachElement.previousSibling.removeChild(eachElement.previousSibling.lastChild);
			}
			i--;
		}
		
	});
	if(i>0){Event.stop(e);}
};