/*//window.addEvent('domready', attachEvents);

function validate_email(email)
{
	var el_id = 'email_container';
	var newFx = new Fx.Style(el_id, 'backgroundColor', {
		duration: 2000,
		transition: Fx.Transitions.Back.easeInOut
	});
	if (((email.indexOf(".") > 2) && (email.indexOf("@") > 0)) || (email == ''))
	{
		newFx.start('ffffff');
		return;
	}
	else
	{
		newFx.start('dddddd');
		return 'Please fill in a valid email address';
	}
}

function validate_required(els)
{
	for (var i = 0; i < els.length; i++)
	{
		if ((els[i].getAttribute('rel') == 'required') && (els[i].id != ''))
		{
			var el_id = els[i].id+'_container';
			var newFx = new Fx.Style(el_id, 'backgroundColor', {
				duration: 2000,
				transition: Fx.Transitions.Back.easeInOut
			});

			if ((els[i].value == '') || (els[i].value == 'PLEASE SELECT'))
			{
				var bgcolour = $(el_id).style.backgroundColor;
				var error = 'Please fill in all required fields';
				newFx.start('dddddd');
				//alert(els[i].value);
			}
			else
			{
				newFx.start('ffffff');
			}
		}
	}
	if (error != null)
	{
		return error;
	}
	return null;
}

window.addEvent('domready', function(){
	if ($('submit'))
	{
		$('submit').addEvent('click', function(e){
			var error = null;
			
			error = validate_required(document.getElementsByTagName("select"));
			error = validate_required(document.getElementsByTagName("textarea"));
			error = validate_required(document.getElementsByTagName("input"));
			if ((error == '') || (error == null))
			{
				error = validate_email($('emailto').value);
			}
			
			if ((error != '') && (error != null))
			{
				e.stop();
				window.alert(error);
			}
		});
	}
});*/
