// JavaScript Document
function form_validation () 
{
	var errorIndex = 0;
	var errorAlert = "Form Submission Errors Occurred\n";
	errorAlert += "========================\n";
	
	document.getElementById('loginname').value= document.getElementById('Login_ID').value;
	document.getElementById('loginpass').value= document.getElementById('passwd').value;
	document.getElementById('josso_username').value= document.getElementById('Login_ID').value;
	document.getElementById('josso_password').value= document.getElementById('passwd').value;
	document.getElementById('txtID').value= document.getElementById('Login_ID').value;
	document.getElementById('txtPassword').value= document.getElementById('passwd').value;
		
	var pwEntry = document.getElementById('passwd').value;	
	var spwEntry = document.getElementById('txtPassword').value;	
	
	var a_pwRegExp = /^A(.*)/;	
	var a_pwValid = pwEntry.match(a_pwRegExp);
	var e_pwRegExp = /^E(.*)/;
	var e_pwValid = pwEntry.match(e_pwRegExp);
	var se_pwRegExp = /^e(.*)/;
	var se_pwValid = spwEntry.match(se_pwRegExp);

//http://expresscourier.report.airclic.com/common/Menu.php
//Change expresscourier to expcourier
//http://expcourier.report.airclic.com/josso/signon/usernamePasswordLogin.do
	if(a_pwValid) 
	{document.usernamePasswordLoginForm.action="http://expcourier.report.airclic.com/josso/signon/usernamePasswordLogin.do";	
	errorIndex = 0;}
	else if(e_pwValid) 	
	{document.usernamePasswordLoginForm.action="http://apps.etrac.net/retailoe/LoginX.asp";	
	errorIndex = 0;}
	else if(se_pwValid) 	
	{//document.usernamePasswordLoginForm.action="http://216.216.180.186:8080/login.asp";	
	document.usernamePasswordLoginForm.action="http://74.95.20.5:8080/login.asp";	
	errorIndex = 0;}
	else
	{errorAlert += "- Please enter a valid password\n";errorIndex = 1;}

	//errorIndex = 0;
	
	if ((errorIndex == 0)) 
		submitFormOK = true;
	else 
	{	submitFormOK = false;	alert(errorAlert);	}	

}