
function Check_It(input) {
	var input=input.value;
	var matchArray = new Array();
	for (i = 0; i < input.length; i++) {
		matchArray[i] = input.charAt([i]);
		var match;
		var regex = /[A-Za-z0-9]/;  // Create a regular expression to match any character in the given sets.   
		var result = regex.test(matchArray[i]);
		if (result) {
			match=true;
		}
		else{
			match=false;
				alert("All Banner fields must only contain alphabetical or characters (a-z) or numerals (0-9).  The invalid character entered is " +matchArray[i]+ ".");
				break;
			}
	}
	
	
	if (input.length < 6) { 
	   alert("Please enter valid 6-digit Banner Codes for all Banner related fields.");
	}
	   
	
} 
function ConEmailAddress(input) {
	var input=input.value;
	var find_AtSign=input.search("@");
	if (find_AtSign < 2) {
		alert("Please type a complete Email Address for the Contact Person in item 1.");
		}
	if (input.length < 8) { 
	   alert("Please enter a valid Email Address of at least 8 characters in length for the Contact Person in item 1.");
	}
} 
function AuthEmailAddress(input) {
	var input=input.value;
	var find_AtSign=input.search("@");
	if (find_AtSign < 2) {
		alert("Please type a complete Email Address for the Authorization Person in item 2.");
		}
	if (input.length < 8) { 
	   alert("Please enter a valid Email Address of at least 8 characters in length for the Authorization Person in item 2.");
	}
} 
function checkforblanks()
	{
	for (var i = 0; i < arguments.length; i += 2)
		{
		if (!arguments[i])
			{alert("Please " + arguments[i+1] + ".");return false;}
		}
	return true;
	}

function validate(thisform)
	{
	//Make sure that either grant or nongrant is selected
	if (!(thisform.grantornon[0].checked || thisform.grantornon[1].checked))
	{
		alert("You must select Grant Or Non Grant");
		return false;
	}
	// Make sure none of the required fields are empty
	var isFull = checkforblanks(
					document.reqForm.confirstname.value, "enter the FIRST NAME of the Contact Person for item 1", 
					document.reqForm.conlastname.value, "enter the LAST NAME of the Contact Person for item 1",
					document.reqForm.conemail.value, "enter the complete EMAIL ADDRESS of the Contact Person for item 1",
					document.reqForm.conphone.value, "enter the PHONE NUMBER of the Contact Person for item 1",
					document.reqForm.authfirstname.value, "enter the FIRST NAME of the person authorizing the request for item 2",
					document.reqForm.authlastname.value, "enter the LAST NAME of the person authorizing the request for item 2",
					document.reqForm.authemail.value, "enter the complete EMAIL ADDRESS of the person authorizing the request for item 2",
					document.reqForm.authphone.value, "enter the PHONE NUMBER of the person authorizing the request for item 2");
		if (isFull)
		thisform.submit();
	}
function resetField(form) {
reqForm.authfirstname.value = reqForm.confirstname.value;
reqForm.authlastname.value = reqForm.conlastname.value;
reqForm.authemail.value = reqForm.conemail.value;
reqForm.authphone.value = reqForm.conphone.value;
}

function resetField2(form) {
reqForm.authfirstname.value = reqForm.authfirstname.defaultValue;
reqForm.authlastname.value = reqForm.authlastname.defaultValue;
reqForm.authemail.value = reqForm.authemail.defaultValue;
reqForm.authphone.value = reqForm.authphone.defaultValue;
}
function startHere()
	{
		document.reqForm.confirstname.focus();
		return true;
	}
	

