// combined.js

<!-- // hide scripts for JavaScript disabled browsers

//autojump functions
var downStrokeField;

function enableAutoJump(theForm) {
	for(veldIndex=0; veldIndex < theForm.length; veldIndex++) {
		field = theForm.elements[veldIndex];
		if ((field.type == "text" || field.type == "password") && field.jump) {
			if (field.maxLength > 0 && field.maxLength < 255) { 
				field.onkeydown = autojump_keyDown;
				field.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)) {
	   	// slice belet dat er meer dan maxlength aantal karakters kunnen ingegeven worden
			this.value = this.value.slice(0, this.maxLength);
	   	// enkel hier gaan we het volgende veld ophalen
	   	nextField = this.form.elements[(getIndex(this)+1) % this.form.length];
	   	// We springen naar het volgende veld als dat geen button, submit of reset knop is
	   	if (!(nextField.type == "button" || nextField.type == "submit" ||	nextField.type == "reset")) {
				nextField.focus();
				if (nextField.type == "text" || nextField.type == "password") {
					nextField.select();
				}
			}
	}
	downStrokeField = null;
}

function getIndex(input) {
	var index = -1, i = 0;
	while (i < input.form.length && index == -1) {
		if (input.form.elements[i] == input) {
			index = i;
		} else {
			i++;
		}
	}
	return index;
}

//checkboxSelection functions
function checkboxSelection(formName, checkbox, groupname) {

 if(groupname) {
  for (var i = 0; i < formName.elements.length; i++) {    
    if (formName.elements[i].type == "checkbox" 
    	  && formName.elements[i].name == groupname) {
    		formName.elements[i].checked = checkbox.checked;
   }
  }	
 } else {
  for (var i = 0; i < formName.elements.length; i++) {    
    if (formName.elements[i].type == "checkbox") {
    		formName.elements[i].checked = checkbox.checked;
   }
  }	
 }
}

//checkFormChanged functions
function checkFormChanged(theForm) {
	changedForm = false;
	veldIndex=0;
	
	while((!changedForm) && (veldIndex < theForm.length)){
		field = theForm.elements[veldIndex];
		//if (field.type != "button") {
		if( field.type == "checkbox" || 
			field.type == "radio" || 
			field.type == "select-one" || 
			field.type == "select-multiple" || 
			field.type == "text" || 
			field.type == "textarea"){
			if (field.type == "radio" || field.type == "checkbox") {
				if(field.initValue != field.checked){
					changedForm = true;
				}	
			}else{
				if(field.initValue != field.value){
					changedForm = true;
				}
			}
		}
		veldIndex++;
	}
	if(changedForm){
		theForm._formChanged.value = "Y";
	}
	else{
		theForm._formChanged.value = "N";
	}
}




//fillDestinationAndSubmit functions
function fillDestinationAndSubmit(formName,destination)
{
      formName._dest.value = destination;
      formName.submit();	
}

//fillMAndSubmit functions
function fillMAndSubmit(formName,mValue)
{
      formName.m.value = mValue;
      formName.submit();	
}

//openHelp functions
function openHelp(url)
{
	var win = window.open(url, 'help', 'dependent=no,directories=no,hotkeys=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
	return false;
}

//saveFormValues functions
function saveFormValues(theForm) {
	veldIndex=0;
	while(veldIndex < theForm.length){
		field = theForm.elements[veldIndex];
		//if (field.type != "button") {
		if( field.type == "checkbox" || 
			field.type == "radio" || 
			field.type == "select-one" || 
			field.type == "select-multiple" || 
			field.type == "text" || 
			field.type == "textarea"){
			if (field.type == "radio" || field.type == "checkbox") {
				field.initValue = field.checked;
			}else{
				field.initValue = field.value;
			}
		}
		veldIndex++;
	}
}

//setFocus functions
function setFocus(field) {
  if (field) {
    if (field[0] && (field[0].type == "radio" || 
        field[0].type == "checkbox")) {
         field[0].focus();
    } else if(field.type == "text") {
       field.focus();
       field.select();
    } else {
       field.focus();
    }
  }
}

//setFocusAndSelect
function setFocusAndSelect(formField)
{
    	formField.select();
	formField.focus();	
}

//showContent functions
function showContent() {
	document.getElementById('waitMessage').style.display = 'none';
	document.getElementById('content').style.display = 'block';
}

//showWaitMessage functions
function showWaitMessage() {
	document.getElementById('content').style.display = 'none';
	document.getElementById('waitMessage').style.display = 'block';
}

//showWaitSearch functions
function showWaitSearch() {
	document.getElementById('screenButtons').style.display = 'none';
	if (document.getElementById('screenInfo')) {
		document.getElementById('screenInfo').style.display = 'none';
	}
	if (document.getElementById('screenError')) {
		document.getElementById('screenError').style.display = 'none';
	}
	document.getElementById('searchWaitInfo').style.display = 'block';
	document.getElementById('searchStopButton').style.display = 'block';
	document.searchStopForm.stopButton.focus();
}

//fillBehavior functions
function fillBehavior(formName,behaviorValue)
{
      formName.behavior.value = behaviorValue;
}

//fillMConfirmAndSubmit functions
function fillMConfirmAndSubmit(formName, mValue, message){
  
    confirmed = confirm(message);
    
    if (confirmed) {
      formName.m.value = mValue;
      formName.submit();
    }
}

//fillParam functions
function fillParam(param,paramValue)
{
      param.value = paramValue;
}

//setErrorLayout functions
function setErrorLayout(field) {
	
	if ( field && field.type && 
			(field.type == "text" || 
			 field.type == "password" ||
			 field.type == "textarea" ||
			 field.type == "file" ||
			 field.type == "select-multiple" ||
			 field.type == "select-one") ) {
		if (field.className) {
			field.className += ' errorBackground';
		} else {	
			field.className = 'errorBackground';
		}
	}
}

function fillListMetadata(formName, mValue, listId, list, index) {

	formName.f_t_scrollPixels.value = document.getElementById(listId).scrollTop;
	formName._list.value = list;
	if(index) {
		formName._index.value = index;
	}
	formName.m.value = mValue;
}


// end hiding of JavaScript code -->
