// File Name: a1-inc.js
// Author: P. Cearns

var btnBack = 0;
var btnNext = 0;

function setfocus(theForm) 
{
    theForm.AccountCode.focus();
}

function validate(theForm) 
{
    var i,pasw,code;

    if ((btnBack == 1) && (btnNext == 0)) {
      history.go(-1);
      return false;
      }
    
    if (theForm.AccountCode.value == '') {
      alert("No Account Code entered.");
      theForm.AccountCode.focus();
      return false;
      }
      
    if (theForm.AccountCode.value.length > 8) {
      alert("Account Code must be 8 or less characters.");
      theForm.AccountCode.focus();
      return false;
      }

    if (theForm.AccountPasw.value == '') {
      alert("No Password entered.");
      theForm.AccountPasw.focus();
      return false;
      }
      
    pasw = theForm.AccountPasw.value;
    for (i = 0; i < pasw.length; i++)
      if ((pasw.substr(i,1) > "9") || (pasw.substr(i,1) < "0")) {
        alert("Password must be numeric.");
        theForm.AccountPasw.focus();
        return false;
        }
        
    return true;
}



