var initial = true;
/*
* boolean (returns true if the form contains all values, 
* and false otherwise)
* checkRegForm() using jQuery
* learned from Chris Power's blog example: 
* the function alters the innerHTML of the error div
* and uses jQuery slideUp and slideDown methods for showing
* the error message to the user
*/
function checkRegForm()
{
	if($("#username").val() == "")
	{
		$("#error").slideUp("normal", function()
			{
				$("#error").html("<p>Please enter a username with 6 - 20 alphanumeric characters!</p>").slideDown("slow");
			}
		);
		
		return false;
	}
	
	if($("#password").val() == "")
	{
		$("#error").slideUp("normal", function()
			{
				$("#error").html("<p>Please provide a password with 6- 20 alphanumeric characters!</p>").slideDown("slow");
			}
		);
		
		
		return false;
	}
	
	if($("#weight").val() == "")
	{
		$("#error").slideUp("normal", function()
			{
				$("#error").html("<p>Please enter your weight in kg (30 - 300, e.g., 111.11)!</p>").slideDown("slow");
			}
		);
		
		return false;
		}
		
	
	if($("#height").val() == "")
	{
		$("#error").slideUp("normal", function()
			{
				$("#error").html("<p>Please provide your height in cm (50-300, e.g., 180)!</p>").slideDown("slow");
			}
		);
		
		return false;
	}
	
				
	return true;	
}

