function letters(e) {
var k;
document.all ? k = e.keyCode : k = e.which;
return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}

function cijfers(e)
      {
         var charCode = (e.which) ? e.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }

var downStrokeField;
function autojump(fieldName,nextFieldName,fakeMaxLength)
{
var myForm=document.forms[document.forms.length - 1];
var myField=myForm.elements[fieldName];
myField.nextField=myForm.elements[nextFieldName];

if (myField.maxLength == null)
   myField.maxLength=fakeMaxLength;

myField.onkeydown=autojump_keyDown;
myField.onkeyup=autojump_keyUp;
}

function autojump_keyDown()
{
this.beforeLength=this.value.length;
downStrokeField=this;
}

function autojump_keyUp()
{
if (
   (this == downStrokeField) && 
   (this.value.length > this.beforeLength) && 
   (this.value.length >= this.maxLength)
   )
   this.nextField.focus();
downStrokeField=null;
}

function toUpperBedrijf() {
    var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters 

    var a = document.bevestigform.bedrijfsnaam.value.split(/\s+/g); // split the sentence into an array of words

    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
    }
    
    document.bevestigform.bedrijfsnaam.value = a.join(' '); // join it back together
}

function toUpperNaam() {
    var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters 

    var a = document.bevestigform.naam.value.split(/\s+/g); // split the sentence into an array of words

    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
    }
    
    document.bevestigform.naam.value = a.join(' '); // join it back together
}

function toUpperAdres() {
    var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters 

    var a = document.bevestigform.adres.value.split(/\s+/g); // split the sentence into an array of words

    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
    }
    
    document.bevestigform.adres.value = a.join(' '); // join it back together
}

function toUpperPlaats() {
    var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters 

    var a = document.bevestigform.plaats.value.split(/\s+/g); // split the sentence into an array of words

    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
    }
    
    document.bevestigform.plaats.value = a.join(' '); // join it back together
}


function checkForm()
{
  var frm = document.forms['zoeken'];

  var ok = true;
  var msg = "";
  
  if (frm['zoekitem'].value.length==0)
  {
    msg += "First Name may not be blank.";
    ok = false;
  } // if

  if (!ok)
  {
    alert(msg);
  }

  return ok;
} // checkForm
