function validEmail(supposeEmailAddress)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(supposeEmailAddress))
	{
		return (true)
	}
	return (false)
}

var collectEmail = function()
{
	var errors = new Array();
	if (!validEmail(document.getElementById('alertEmail').value))
	{
		errors.push("Please insert a valid email address!");
	}
	if (document.getElementById('alertEmail').value !== document.getElementById('alertRetypeEmail').value)
	{
		errors.push("The email addresses you entered must be the same!");
	}
	if(errors.length > 0)
	{
		alert(errors.join("\n"));
		return false;
	}
	return true; 
}
