var hasBoth = /^[a-zA-Z0-9]+$/;
var hasNumericOnly = /^[0-9]+$/;
var hasStringOnly = /^[a-zA-Z]+$/;

function isValid2(txt){
 outcome = false;
 if(hasBoth.test(txt) && !hasNumericOnly.test(txt) && !hasStringOnly.test(txt)){outcome = true;}
 return outcome;
}
function popUp(url) {
  sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=650,height=450');
  self.name = "mainWin";
}
function checkEnter(e) {
  var characterCode;
  if (e && e.which) {
    e = e;
    characterCode = e.which;
  } else {
    e = event;
    characterCode = e.keyCode;
  }	 
	if (characterCode == 13) {
    document.forms[0].loginBtn.disabled = true; 
    document.forms[0].submit();
    return false;
  }
  return true;
}
function isEmpty(ctrl) {
	var result = ctrl.value.length==0;
	return result;
}
function validateForm() {
  if ( isEmpty(document.form.AccountNumber) ) {
    alert("Please enter your Username");
    return false
  }
  return true;
}

function login()
{
	document.form.forgotPassword.value='true'
	document.form.Action.value="ACT0002";
	if(validateForm()){
		document.form.submit();
	}
	return true;
}

function forgotPassword()
{
	document.form.forgotPassword.value='true'
	document.form.Action.value="ACT0113";
	document.form.submit();
	return true;
}
//---------

function validatePrompt(Ctrl, PromptStr) {
        alert(PromptStr);
        Ctrl.focus();
		if (Ctrl.type == "text" || Ctrl.type == "password") {
		Ctrl.select();
	}
        return;
}


  
  function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
   function TruncateAccountNumber(strAccnt)
   {
   	var offset = strAccnt.length - 7;
   	return strAccnt.substring(offset);
   }
   
   function IsLongerThan7(strAccnt)
   {
	if(strAccnt.lenght > 7) {
	 return true;
	} else {
	 return false;
	}
   }
