//Logon script for Personal
function validateLogonP( host ) {

	var userid 		= document.form_p.j_username.value;
	
	if ( userid.length == 0 ) {
		alert( "In order to access Direct Card Access Online, please enter your User ID and click Log In." );
		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;
}





//Logon script for Business
function validateLogonB( host ) {

	var userid 		= document.form_b.USERID.value;
	
	if ( userid.length == 0 ) {
		alert( "In order to access Direct Card Access Online, please enter your User ID and click Log In." );
		document.form_b.USERID.select();
		document.form_b.USERID.focus();
	}
	else {
		document.form_b.action = "https://" + host + "/IBWS/checkUser.do?action=userName"
		document.form_b.submit();
	}
}
function forceAlphaNumeric(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_b.USERID){
			document.form_b.submit();
		}
	}
	return false;
}
function go(location){
	var form = document.form_b;
	self.parent.window.location = location;
}

function popWin(url,width,height) {
	open (url,"NewWindow", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=" + width + ",height=" + height);
}