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("The Banner fields in item 1 must only contain alphabetical or characters (a-z) or numerals (0-9).  The invalid character entered is " +matchArray[i]+ ".  If blank, an empty space was entered.");
				break;
			}
	}
	
	
	if (input.length < 6) { 
	   alert("Please enter valid 6-digit Banner Codes for all Banner fields in Item 1.");
	}
	   
	
}   
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 2.");
		}
	if (input.length < 8) { 
	   alert("Please enter a valid Email Address of at least 8 characters in length for the Contact Person in item 2.");
	}
} 
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 3.");
		}
	if (input.length < 8) { 
	   alert("Please enter a valid Email Address of at least 8 characters in length for the Authorization Person in item 3.");
	}
} 
function CardHolderEmailAddress(input) {
	var input=input.value;
	var find_AtSign=input.search("@");
	if (find_AtSign < 2) {
		alert("Please type a complete Email Address of the person who will ultimately utilize the Calling Card in item 4.");
		}
	if (input.length < 8) { 
	   alert("Please enter a valid Email Address of at least 8 characters in length for the person who will ultimately utilize the Calling Card in item 4.");
	}
} 


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)
	{
	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.deptname.value, "enter the DEPARTMENT NAME to be billed for services for item 1",
					document.reqForm.confirstname.value, "enter the FIRST NAME of the Contact Person for item 2", 
					document.reqForm.conlastname.value, "enter the LAST NAME of the Contact Person for item 2",
					document.reqForm.conemail.value, "enter the complete EMAIL ADDRESS of the Contact Person for item 2",
					document.reqForm.conphone.value, "enter the PHONE NUMBER of the Contact Person for item 2",
					document.reqForm.authfirstname.value, "enter the FIRST NAME of the person authorizing the request for item 3",
					document.reqForm.authlastname.value, "enter the LAST NAME of the person authorizing the request for item 3",
					document.reqForm.authemail.value, "enter the complete EMAIL ADDRESS of the person authorizing the request for item 3",
					document.reqForm.authphone.value, "enter the PHONE NUMBER of the person authorizing the request for item 3",
					document.reqForm.cardholderfirstname.value, "enter the FIRST NAME of the person who will ultimately utilize the Calling Card for item 5",
					document.reqForm.cardholderlastname.value, "enter the LAST NAME of the person who will ultimately utilize the Calling Card for item 5",
					document.reqForm.cardholderphone.value, "enter the PHONE NUMBER of the person who will ultimately utilize the Calling Card for item 5",
					document.reqForm.cardholderlocation.value, "enter the LOCATION of the person who will ultimately utilize the Calling Card for item 5")
	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;
reqForm.authlocation.value = reqForm.conlocation.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;
reqForm.authlocation.value = reqForm.authlocation.defaultValue;
}
function startHere()
	{
		document.reqForm.deptname.focus();
		return true;
	}

