<!--

//this function checks if all reqirements are met
function checkFields (inputForm)
{
	ref = document.referrer;
	document.a.Referrer.value = ref;
	var alertMsg = "Following error has occured:\n";
	var alertNum = 1;
	var valid = true;

	if (inputForm.memberID != null)  {

	if (inputForm.memberID.value == "")
	{
		alertMsg += alertNum + ". The Member ID field cannot be empty.\n";
		alertNum++;
		valid = false;
	}

	if (inputForm.password.value == "")
	{
		alertMsg += alertNum + ". The Password field cannot be empty.\n";
		alertNum++;
		valid = false;
	}

	if (inputForm.password.value != inputForm.confirmPassword.value)
	{
		alertMsg += alertNum + ". The confirmed password does not match the password.\n";
		alertNum++;
		valid = false;
	}

	}
	
	if (inputForm.firstName.value == "")
	{
		alertMsg += alertNum + ". The First Name field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	
	if (inputForm.lastName.value == "")
	{
		alertMsg += alertNum + ". The Last Name field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	
	if (inputForm.email.value == "")
	{
		alertMsg += alertNum + ". The Email field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	else
	{
		if (inputForm.email.value.indexOf('@') < 0)
		{
			alertMsg += alertNum + ". The Email is invalid.\n";
			alertNum++;
			valid = false;
		}
	}
	
	if (inputForm.telephone.value == "")
	{
		alertMsg += alertNum + ". The Phone field cannot be empty.\n";
		alertNum++;
		valid = false;
	}

	if (inputForm.company.value == "")
	{
		alertMsg += alertNum + ". The Company field cannot be empty.\n";
		alertNum++;
		valid = false;
	}

	if (inputForm.notes.value.length > 255)
	{
		alertMsg += alertNum + ". The Comments field cannot be longer than 255 characters.\n";
		alertNum++;
		valid = false;
	}
	
	if (valid == false)
	{
		alert(alertMsg);
	}

	return valid;
}

//this function checks if all reqirements are met
function checkModFields (inputForm)
{
	var alertMsg = "Following error has occured:\n";
	var alertNum = 1;
	var valid = true;

	if (inputForm.password.value == "")
	{
		alertMsg += alertNum + "The Password field cannot be empty.\n";
		alertNum++;
		valid = false;
	}

	if (inputForm.password.value != inputForm.confirmPassword.value)
	{
		alertMsg += alertNum + ". The confirmed password does not match the password.\n";
		alertNum++;
		valid = false;
	}
	
	if (inputForm.firstName.value == "")
	{
		alertMsg += alertNum + ". The First Name field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	
	if (inputForm.lastName.value == "")
	{
		alertMsg += alertNum + ". The Last Name field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	
	if (inputForm.email.value == "")
	{
		alertMsg += alertNum + ". The Email field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	else
	{
		if (inputForm.email.value.indexOf('@') < 0)
		{
			alertMsg += alertNum + ". The Email is invalid.\n";
			alertNum++;
			valid = false;
		}
	}
	
	if (inputForm.telephone.value == "")
	{
		alertMsg += alertNum + ". The Phone field cannot be empty.\n";
		alertNum++;
		valid = false;
	}
	
	if (inputForm.company.value == "")
	{
		alertMsg += alertNum + ". The Company field cannot be empty.\n";
		alertNum++;
		valid = false;
	}

	if (valid == false)
	{
		alert(alertMsg);
	}

	return valid;
}

//this function set limits for a textarea
function limitText(inputFiled, maxSize)
{
	if (inputFiled.value.length > maxSize) // if too long, trim it
	{
		inputFiled.value = inputFiled.value.substring(0, maxSize);	
	}	
}
-->

