function ValidateClient() {

 if (frmForm.CurrentPage.value == "2") {
   if (isEmpty(frmForm.FirstName.value)) {
     alert("First Name is Required");
     frmForm.FirstName.focus();
     return (false);
   }
   if (isEmpty(frmForm.LastName.value)) {
     alert("Last Name is Required");
     frmForm.LastName.focus();
     return (false);
   }
   if (isEmpty(frmForm.Email.value)) {
     alert("Email is Required.");
     frmForm.Email.focus();
     return false;
   }
   if (!isEmail(frmForm.Email.value)) {
     frmForm.Email.focus();
     return false;
   }
   if (isEmpty(frmForm.User.value)) {
     alert("A User Name is Required");
     frmForm.User.focus();
     return (false);
   }
   if (isEmpty(frmForm.Password.value)) {
     alert("Password is Required");
     frmForm.Password.focus();
     return (false);
   }
   if (frmForm.Repeat.value != frmForm.Password.value) {
     alert("Repeat Password does not match Password.");
     frmForm.Repeat.focus();
     return (false);
   }
   if (isEmpty(frmForm.Hint.value)) {
     alert("Password Hint is Required. This provides another level of security in case of lost passwords.");
     frmForm.Hint.focus();
     return (false);
   }
   if (isEmpty(frmForm.Answer.value)) {
     alert("The Answer to the Password Hint is Required. This provides another level of security in case of lost passwords.");
     frmForm.Answer.focus();
     return (false);
   }
   return (true);
 }
 else {
   return (true);
 }
}

function SplashScreen() {

 var mlRandom = Math.round(5 * Math.random()) + 1;

 if (screen.width <= 800 || screen.height <= 600) {
   document.write('    <link rel="stylesheet" href="css/splash800.css" type="text/css" media="all" />');
   document.write('    <style type="text/css">');
   document.write('    <!--');
   document.write('     #splashwrapper{');
   document.write('      background: #000 url(img/splash' + mlRandom + 'a.jpg) no-repeat;');
   document.write('     }');
   document.write('    -->');
   document.write('    </style>');
 }
 else {
   document.write('    <style type="text/css">');
   document.write('    <!--');
   document.write('     #splashwrapper{');
   document.write('      background: #000 url(img/splash' + mlRandom + '.jpg) no-repeat;');
   document.write('     }');
   document.write('    -->');
   document.write('    </style>');
 }
}

// Determine if url contains http:// ----------------------------------------------------
function isURL(msString) {
  
 msString = msString.toLowerCase();

 var myRegExp=/http:\/\//gi;
 var myArray = myRegExp.exec(msString);
 var msRetValue = false;

 if ((myArray) && (myArray.length == 1) && (myRegExp.lastIndex == 7)) {
   msRetValue = true;
 }
 return msRetValue;
}

// Determine if url contains http:// ----------------------------------------------------
function isSecuredURL(msString) {
  
 var myRegExp=/https:\/\//gi;
 var myArray = myRegExp.exec(msString);
 var msRetValue = false;
   
 if ((myArray) && (myArray.length == 1) && (myRegExp.lastIndex == 8)) {
   msRetValue = true;
 }
 else {
   msRetValue = isURL(msString);
 }
 return msRetValue;
}

// Determine if parameter is empty ------------------------------------------------------
function isEmpty(msString) {
 return ((msString == null) || (msString.length == 0))
}

// Validate Postal Code in US Format, ##### or #####-#### -------------------------------
function isZipcode(msString) { 

 if (msString.length != 5 && msString.length != 10) {
   alert("Postal Code must be in a valid 5 or 10 digit U.S. Postal Code format");
   return false;
 }

 for (var i=0; i < msString.length; i++) {
   if ((msString.charAt(i) < '0' || msString.charAt(i) > '9') && msString.charAt(i) != '-') {
     alert("Postal Code must be in a valid 5 or 10 digit U.S. Postal Code format");
     return false;
   }
 }
 return true;
}

// Make sure that strGraphic has the extension .jpg or .gif -----------------------------
function isValidGraphic(strGraphic, strName) { 

 if (isEmpty(strGraphic)) return true;
 
 strGraphic = strGraphic.toLowerCase();
 
 if (strGraphic.indexOf(".jpg") == -1) {
   if (strGraphic.indexOf(".gif") == -1) {
     alert(strName + " must contain an extension of .jpg or .gif");
     return false;
   }
 }
 return true;
}

// Valid that strColor is in a valid hex color format -----------------------------------
function isValidHexColor(strColor) {
 
 if (isEmpty(strColor)) return true;

 strColor = strColor.toLowerCase();

 if (strColor.length != 6) {
   alert("Color must be 6 characters long");
   return false;
 }

 for (var i = 0; i < strColor.length; i++) {
   if ((strColor.charAt(i) < '0' || strColor.charAt(i) > '9')) {
     if ((strColor.charAt(i) < 'a' || strColor.charAt(i) > 'f')) {
       alert("Color must be a valid RGB Format");
       return false;
     }
   }
 }
 return true;
}

// Returns true if the string passed in is a valid number (no alpha characters), else it displays an error message
function ForceNumber(objField, FieldName) {

 var strField = new String(objField.value);
 var i = 0;

 if (isWhitespace(strField)) return true;
 for (i = 0; i < strField.length; i++) {
   if (strField.charAt(i) < '0' || strField.charAt(i) > '9') {
     alert(FieldName + " must be a valid numeric entry.\nPlease do not use commas or any non-numeric symbols.");
     objField.focus();
     return false;
   }
 }
 return true;
}

// Returns true if msString is empty or whitespace characters only ----------------------

function isWhitespace(msString) {

 var i;
 var whitespace = " \t\n\r";
 
 if (isEmpty(msString)) return true;

 // Check that current character isn't whitespace.
 for (i = 0; i < msString.length; i++) {   
   var c = msString.charAt(i);
   if (whitespace.indexOf(c) == -1) return false;
 }
 return true;
}

// Returns true if the string passed in is a valid money (no alpha characters except a decimal place)
function ForceMoney(objField, FieldName) {

 var strField = new String(objField.value);
 var i = 0;

 if (isWhitespace(strField)) return true;

 for (i = 0; i < strField.length; i++) {
   if ((strField.charAt(i) < '0' || strField.charAt(i) > '9') && (strField.charAt(i) != '.') && (strField.charAt(i) != ',') && (strField.charAt(i) != '$')) {
     alert(FieldName + " must be a valid numeric entry.");
     objField.focus();
     return false;
   }
 }
 return true;
}

// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c ... in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function isEmail (s) {

  if (isEmpty(s)) 
  if (isEmail.arguments.length == 1) return true;
  else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) {
      alert("Format of Email is Invalid");
      return false;
    }
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@")) {
      i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) {
      alert("Format of Email is Invalid");
      return false;
    }
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != ".")) {
      i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) {
      alert("Format of Email is Invalid");
      return false;
    }
    else return true;
}