/**********************************************************
* incLogon.js
* this file contains functions specific to psLogon.asp
* (c) copyright, 2000. max mail
**********************************************************/


/************************************************************
************************************************************/
/////////////////////////////////////////////////////////////////////////////////////////
//ReplaceChars replaces all the non-alphanumeric chars in a textbox object argument

function ReplaceChars(obj) {
	// (/\W+/g, '') is same as (/[^a-zA-Z0-9]+/g,'')
	obj.value = obj.value.replace(/\W+/g, '');
	
}//ReplaceChars()
/////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////
function VerifyLogonLength(varURL, varUsername, varPassword) {
	if (varUsername.value.length > 0 && varUsername.value.length <= 20 &&  varPassword.value.length > 0 && varPassword.value.length <= 20) {
		VerifyLength = true;
		}
		else {
			//document.frmLogon.action = "psLogon.asp";
			document.frmLogon.action = varURL;
			VerifyLength = false;
			}
	
}//VerifyLogonLength(varUsername, varPassword)
/////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////
function SetFormAction(obj){	
	if (obj.selectedIndex == 0){
		// user claims admin status
		//document.frmLogon.action = "../adm/psNavAdm.asp?iMenu=0&b1stCall=true&sUserClass=adm";
		document.frmLogon.action = '../adm/psMMAdm.asp?b1st=1&iMenu=0&sBW=A&sList=h11901914&sOption=19&sPKID=0&sSKID=0&sSB=Dates&sUC=adm';
		}
	else if (obj.selectedIndex == 1){
		// user claims client status
		//document.frmLogon.action = "../cli/psCliNav.asp?b1st=0&iMenu=0&sBW=A&sList=H190716&sOpn=4&sPKID=0&sRSID=0&sUC=cli";
		document.frmLogon.action = '../cli/psMMCli.asp?b1st=1&iMenu=0&sBW=A&sList=h13201911&sOption=19&sPKID=0&sSKID='+GetDefaultClientReportPeriod()+'&sUC=cli';
		}
	else if (obj.selectedIndex == 2){
		// user claims operative status
		document.frmLogon.action = "../opr/psOprNav.asp?b1st=0&iMenu=0&sBW=a&sList=H19072&sOpn=4&sPKID=0&sRSID=0&sUC=opr";
		}
	else if (obj.selectedIndex == 3){
		// user claims processor status
		document.frmLogon.action = "../pro/psProNav.asp?b1st=0&iMenu=0&sBW=a&sList=H19072&sOpn=4&sPKID=0&sRSID=0&sUC=pro";
		}
	
}//SetFormAction(obj)
/////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////
function GetDefaultClientReportPeriod(){
	var dRP = new Date();
	dRP = (dRP.getMonth()+1) + '-' + dRP.getYear();
	
	return dRP;
}//GetDefaultReportPeriod()
/////////////////////////////////////////////////////////////////////////////////////////
