function checkExistingUser
(theElement) {
              var userName = theElement.value;
              
              if (userName.length > 0){
                var xmlhttp;
                if (window.XMLHttpRequest)  //Non IE Browser
                  xmlhttp = new XMLHttpRequest();
                else  //IE Browser
                  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                var url = "fmhsec.pkg_validate.checkUserExists?iUserName="+userName;
                xmlhttp.open("POST", url, false);
                xmlhttp.send(null);
                var app = xmlhttp.responseText.split("\n");
                
                if (app[0]=="User Exists"){
                  alert(userName + " already exists. Please select a new user name.");
                  setTimeout(function(){document.getElementById(theElement.id).focus()}, 2);
                  document.getElementById(theElement.id).select();                  
                  return false;
                }
                if (app[0]=="Invalid user"){
                  alert("Please enter a new user name without spaces.");
                  setTimeout(function(){document.getElementById(theElement.id).focus()}, 2);
                  document.getElementById(theElement.id).select();
                  return false;
                }
                if (app[0]=="Invalid length"){
                  alert("User name must be at least 4 characters long.");
                  setTimeout(function(){document.getElementById(theElement.id).focus()}, 2);
                  document.getElementById(theElement.id).select();
                  return false;
                }
              }
              return true;
            }          
