function enforceLength (checkme, minlen, maxlen, changeme)
  {
      currentlength = checkme.value.length;
      if (currentlength > maxlen )
        {
          checkme.value = checkme.value.substring(0,maxlen);
          charactersleft = 0;
        }
       else
        {
          charactersleft = maxlen - currentlength;
        }
          changeme.value = charactersleft;
          return true;
        }
function toshort (checkme, minlen)
         {
         if( currentlength > 0 && currentlength < minlen)
            {
              alert("Text is too short; use at least "+minlen+" characters");
              checkme.focus();
              return false;
          }
          return false;
          }
var impname;
var toto ;


  function toUpper(toto) {
  impname = toto;
  //alert (impname.name);
  //alert (impname.value);
    var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters
    var a = impname.value.split(/\s+/g); // split the sentence into an array of words
  //alert (a);
  for (i = 0 ; i < a.length ; i ++ ) {
  var parts = a[i].match(pattern); // just a temp variable to store the fragments in.
  var firstLetter = parts[1].toUpperCase();
  var restOfWord = parts[2].toLowerCase();
  a[i] = firstLetter + restOfWord; // re-assign it back to the array and move on
  }

  impname.value = a.join(' '); // join it back together
  }