<!--
	
//VALIDATEPW.JS (for CREATEPW.asp and DWNLOGIN.asp)

function REQFORM_Validator()
	{
	var theForm = document.REQFORM;
	var allValid = true;
	var docName = document.title

	//VALIDATE EMAIL
	var checkStr = theForm.Email.value;
	if (checkStr == "" || checkStr == null)
		{
		alert("You must enter your Email address.");
		theForm.Email.focus();
		allValid = false;
		return (false);
		}
	if (checkStr !== "" && checkStr !== null)
		{
		if (isEmail(checkStr) == false)
			{
			alert("You have not entered a valid Email address.")
			theForm.Email.focus();
			theForm.Email.select();
			allValid = false;
			return (false);
			}
		if (checkStr.length > 50)
			{
			alert("The EMAIL field cannot contain more than 50 characters.");
			theForm.Email.focus();
			theForm.Email.select();
			allValid = false;
			return (false);
			}
		}

	//VALIDATE PASSWORD
	var checkStr = theForm.Password.value
	if (checkStr == "" || checkStr == null)
		{
		alert("You have not entered a PASSWORD (up to eight characters).");
		theForm.Password.focus();
		allValid = false;
		return (false);
		}
	else
		{
		if (checkStr.length < 3 || checkStr.length > 8)
			{
			alert("The password cannot have fewer than 3 or more than 8 characters.");
			theForm.Password.focus();
			theForm.Password.select();
			allValid = false;
			return (false);
			}
		else if (checkStr.length >= 3 && checkStr.length <= 8)
			{
			isPWord = /^[0-9a-zA-Z]+$/;
			if (isPWord.test(checkStr) == false)
				{
				alert("The password can only contain alphanumeric characters (no spaces).");
				theForm.Password.focus();
				theForm.Password.select();
				allValid = false;
				return (false);
				}
			}
		}

	//VALIDATE PASSWORD VERIFICATION
	var checkStr = theForm.Verify.value
	if (checkStr == "" || checkStr == null)
		{
		alert("You have not verified your password.");
		theForm.Verify.focus();
		allValid = false;
		return (false);
		}
	else
		{
		var PSWord = theForm.Password.value;
		var VerifyPSWord = theForm.Verify.value;
		if (PSWord !== "" && PSWord !== null)
			{
			if (PSWord !== VerifyPSWord)
				{
				alert("Password verification failed.");
				theForm.Verify.focus();
				theForm.Verify.select();
				allValid = false;
				return (false);
				}
			}
		}
	}
					
function Email_onBlur()
	{
	var theForm = document.REQFORM;
	var checkStr = theForm.Email.value;
	//REMOVE ANY SPACES
	do
		{
		i = checkStr.indexOf(" ");
		if (i == (checkStr.length - 1))
			{
			checkStr = checkStr.substr(0, i);
			}
		else
			{
			checkStr = checkStr.substr(0, i) + checkStr.substr(i + 1, (checkStr.length - (i + 1)));
			}
		}
	while (checkStr.indexOf(" ") > -1);
	theForm.Email.value = checkStr;
	}

function isEmail(s) 
	{
  	return (isEmail1.test(s) && isEmail2.test(s));
	}

isEmail1    = /^\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w+$/;
isEmail2    = /^.*@[^_]*$/;

function PWENTRY_Validator()
	{
	var theForm = document.PWENTRY;
	var allValid = true;

	//VALIDATE EMAIL
	var checkStr = theForm.Email.value
	if (checkStr == "" || checkStr == null)
		{
		alert("You must enter your Email address.");
		theForm.Email.focus();
		allValid = false;
		return (false);
		}

	//VALIDATE PASSWORD
	var checkStr = theForm.Password.value
	if (checkStr == "" || checkStr == null)
		{
		alert("You must enter your PASSWORD.");
		theForm.Password.focus();
		allValid = false;
		return (false);
		}
	}

//-->
