function validate(f) {
			var msg = [];
			if (f.email.value.IsEmpty()) msg[msg.length] = "Please fill in your email address.";
			else if (!f.email.value.Validate(String.FormatTypes.Email)) msg[msg.length] = "Please fill in your valid email address.";
			if (f.friendname.value.IsEmpty()) msg[msg.length] = "Please fill in your friend's name.";
			if (f.friend.value.IsEmpty()) msg[msg.length] = "Please fill in your friend's email address.";
			else if (!f.friend.value.Validate(String.FormatTypes.Email)) msg[msg.length] = "Please fill in your friend's valid email address.";
			if (msg.length > 0) {
				alert(msg.join("\n"));
				return false;
			}
			return true;			 
		}
