// not very generic, but we don't need to validate many forms at this point.
// this looks in the myForm object for two specific fields: UID and password
// it then cleans up any bad chars and returns the cleaned strings
function validateForm(){
	var myUser=document.logon.UID.value;
	var myPwd=document.logon.password.value;
	if ((myUser.length == 0 || myPwd.length==0 ))
	{
		//document.write("Invalid Username Length");
		myUser=cleanChars(myUser);
		myPwd=cleanChars(myPwd);
		//return false;
	}
	if ((myUser.length > 0) && (myPwd.length > 0 )) {
		return true;
	} else {
		//alert("Error entering Userid and Password, please try again");
		return false;
	}
}

// this takes a string and removes any unwanted characters
function cleanChars(strTest){
	var i,ch,strClean;
	strClean="";

	var strBad = " =.,[]{};:|/?!@#$%^&*()-_+<>`~";
	for (i=0; i<strTest.length; i++) {
		ch = strTest.charAt(i); 				// grab a character and see if it's in the bad array
		if ( strBad.indexOf(ch) > 0 ) { 		// if it is bad, discard the character
			// do nothing                       // (we could turn the test around, but this seemed intuitive)
		} else {								// otherwise, add it to the strClean string
			strClean += ch;
		}
	}
	return strClean;
}

