// JavaScript Document


// Open Close
// # element ID
var onmenu = null;
var slowHideTimer = null;

function showSelect(elm, show) {
	slowHideTimer = null;
	element = document.getElementById('menu_' + elm);
	if (element) {
		if (show == 1) {
			element.style.display = '';
			theTimer = setTimeout("showSelect('" + elm + "', 0, 0)", 1000);
		} else {
			if (onmenu == 0) {
				element.style.display = 'none';
				theTimer = null;
			} else {
				theTimer = setTimeout("showSelect('" + elm + "', 0, 0)", 1000);
			}
		}
	}
}

function slowHide(field) {
	
	slowHideTimer = setTimeout("onmenu = 0; showSelect('"+field+"', 0)", 5000);
}
// -

function selectItem(inputField, inputValue, showField, showValue, menuName) {
	
	if(elem = document.getElementById(inputField)) {
		elem.value=inputValue; 
	}
	if(elem2 = document.getElementById(showField)) {
		elem2.innerHTML=showValue; 
	}
	onmenu=0; 
	showSelect(menuName, 0);
}

function ValidNumber(thestring, foutmelding) {

	for (i = 0; i < thestring.length; i++) {        
		ch = thestring.substring(i, i+1);		      
		if ((ch < "0" || ch > "9")) {          
			alert(foutmelding);
			return false;
		}
	}
	return true;
	
}

