function validateComment() {
	
	// Get logged in status
	var loggedin = document.getElementById('loggedin').value;

	// If not logged in, validate login form
	if (loggedin == "false")
	{
		var nameBox = document.getElementById('author');
		var emailBox = document.getElementById('email');
		
		if (nameBox.value.length == 0)
		{
			alert("Your name is required to leave a comment.");
			nameBox.focus();
			return false;
		}
		
		if (emailBox.value.length == 0)
		{
			alert('Your email address is required to leave a comment.');
			emailBox.focus();
			return false;
		}
	}

	// Validate text area
	var commentBox = document.getElementById('commentbox');
	if (commentBox.value.length == 0)
	{
		alert('Please enter a comment.');
		commentBox.focus();
		return false;
	}
	
	// Fin.
	return true;
}