function swapimage(position) {
    elementHeight = document.getElementById('visual').offsetHeight;
    position = elementHeight * position;
    document.getElementById('visual').style.background = 'url(gfx/visual/visual.jpg) 0px ' + position + 'px';
}

function invert(id) {
    document.getElementById(id).style.background = "#ddd";
}
function revert(id) {
    document.getElementById(id).style.background = "transparent";
}
// Save selectie van de AJAX velden in het hidden id veld
function saveSelectionId(field, li) {
  var Id = field.id.replace('_','_idnr_');
  var saveElement = document.getElementById(Id);
  saveElement.value = li.id;
}



function isEmpty( inputStr ) { if ( null == inputStr || "" == inputStr ) { return true; } return false; }

function isInteger(s) {
return (s.toString().search(/^-?[0-9]+$/) == 0);
}

function elfcheck(nummer)
  {
    var reSofi = /(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)/;
    var bValid = false;
    var array;
    var lSom = 0;

    if ((nummer.length == 0) || (nummer == null))
    bValid = true;
    else
    {
      bValid = (reSofi.test(nummer));
      if (bValid)
      {
        // 11 proef
        array = (nummer.match(reSofi));

        for (i=1;i<9;i+=1)
          lSom += (array[i] * (9-(i-1)));

        bValid = (((lSom -= array[9]) % 11) == 0)
      }
    }
  
    if (!bValid) return false;
      
    return (bValid);
  }
