//Logon script for Personal

function validateLogonP( host ) {

	var userid 		= document.form_p.j_username.value;
	
	if ( userid.length == 0 ) {
		alert( "In order to access First National Online, please enter your User ID then select Logon again.  If you forgot your User ID, please click on the 'Forgot Your User ID' link." );
		document.form_p.j_username.select();
		document.form_p.j_username.focus();
	}
	else {
		if (document.form_p.submitted.value != "yes") {
			document.form_p.submitted.value = "yes";
			document.form_p.action = "https://" + host + "/iwsOnline/public/authenticate/authenticate.do";
			document.form_p.submit();
		}
	}
}
function forceAlphaNumericP(e,textObject) {		
	var charCode = (navigator.appName == "Netscape")?e.which:e.keyCode;
	var targetElement = (navigator.appName == "Netscape")?e.target:e.srcElement;
	
	// NS 6.0 weirdness
	if ((charCode==0)&&(e.keyCode > 0)) {
		charCode = e.keyCode;
	}
	
	var aChar = String.fromCharCode(charCode);
	
	var myCriteria = /[0-9]/gi;
	var myMatch = aChar.match(myCriteria);
	if (myMatch != null){return charCode;}
	
	var myCriteria = /[a-z]/gi;
	var myMatch = aChar.match(myCriteria);
	if (myMatch != null){return charCode;}
	
	if(charCode==8){return charCode;}
	if(charCode==9){return charCode;}
	if(charCode==13){
		if (targetElement==document.form_p.j_username){
			document.form_p.submit();
		}
	}
	return false;
}

function go(location){
	var form = document.form_p;
	self.parent.window.location = location;
}


