function validate_form(thisform)
{
	with(thisform)
	{
		if(password.value.length<1)
		{
			alert("Password field is empty");
			password.focus();
			return false;
		}
		if(password.value!=password2.value)
		{
			alert("Password fields don't match");
			password.value="";
			password2.value="";
			password.focus();
			return false;
		}
		if(username.value.indexOf("@")!=-1)
		{
			alert("Username cannot contain an @");
			username.focus();
			return false;
		}
		if(email.value.substr(email.value.length-8, 8)!="@epfl.ch")
		{
			alert("You must provide an @epfl.ch e-mail address");
			email.focus();
			return false;
		}
		return true;
	}
}

