	function isPosInteger(inputVal){

		inputStr = inputVal.toString();
		for ( var i = 0; i < inputStr.length; i++){
			var oneChar = inputStr.charAt(i);
			if (oneChar < "0" || oneChar > "9" ) {
				return false;
			}
		}
		return true
	}


	function isNumber(inputVal){
		oneDecimal = false
		inputStr = inputVal.toString();
		for ( var i = 0; i < inputStr.length; i++){
			var oneChar = inputStr.charAt(i);
			if ( i == 0 && oneChar == "-" ) {
				continue
			}
			if ( (oneChar == "." || oneChar == "," ) && !oneDecimal) {
				ondeDecimal = true
				continue
			}
			if (oneChar < "0" || oneChar > "9" ) {
				return false;
			}
		}
		return true
	}

	function required(elements,display) {
		var NumericList;
		var NumericDisplay;
		var ArrNumeric;
		var ArrDisplay;
		ArrNumeric = "";
		ArrDisplay = "";
		NumericList = elements;
		NumericDisplay = display;
		ArrNumeric = NumericList.split(",");
		ArrDisplay = NumericDisplay.split(",");
		for (var i = 0; i < ArrNumeric.length; i++) {

			if ( eval('document.x.' + ArrNumeric[i] + '.type') == 'text' || eval('document.x.' + ArrNumeric[i] + '.type') == 'file' || eval('document.x.' + ArrNumeric[i] + '.type') == 'textarea' || eval('document.x.' + ArrNumeric[i] + '.type') == 'password' || eval('document.x.' + ArrNumeric[i] + '.type') == '' ){


				var t = eval ( "document.x." + ArrNumeric[i] + ".value");

			}else{

				var t = eval ( "document.x." + ArrNumeric[i] + ".options[document.x." + ArrNumeric[i] + ".selectedIndex].value");

			}

			if (t == null || t == "") {

				alert("Het veld " + ArrDisplay[i] + " is een verplicht veld.");
				eval("document.x." + ArrNumeric[i] + ".focus()");
				return false;
				break;
			}
		}
		return true;
	}


	function requiredNumber(elements,display) {

		var NumericList;
		var NumericDisplay;
		var ArrNumeric;
		var ArrDisplay;
		ArrNumeric = "";
		ArrDisplay = "";
		NumericList = elements;
		NumericDisplay = display;
		ArrNumeric = NumericList.split(",");
		ArrDisplay = NumericDisplay.split(",");
		for (var i = 0; i < ArrNumeric.length; i++) {

			if ( eval('document.x.' + ArrNumeric[i] + '.type') == 'text' || eval('document.x.' + ArrNumeric[i] + '.type') == 'file' || eval('document.x.' + ArrNumeric[i] + '.type') == 'textarea' || eval('document.x.' + ArrNumeric[i] + '.type') == 'password' || eval('document.x.' + ArrNumeric[i] + '.type') == '' ){
				var t = eval ( "document.x." + ArrNumeric[i] + ".value");
			}else{
				var t = eval ( "document.x." + ArrNumeric[i] + ".options[document.x." + ArrNumeric[i] + ".selectedIndex].value");
			}

				if (!isNumber(t)) {
					alert("Het veld " + ArrDisplay[i] + " is een numeriek veld.");
					eval("document.x." + ArrNumeric[i] + ".focus()");
					return false;
					break;
				}
		}
		return true;
	}

      // whitespace characters
      var whitespace = " \t\n\r";

      /****************************************************************/

      // Check whether string s is empty.
      function isEmpty(s)
      { return ((s == null) || (s.length == 0)) }

      /****************************************************************/

      function isWhitespace (s)
      {
           var i;

           // Is s empty?
           if (isEmpty(s)) return true;

           // Search through string's characters one by one
           // until we find a non-whitespace character.
           // When we do, return false; if we don't, return true.

           for (i = 0; i < s.length; i++)
           {
                // Check that current character isn't whitespace.
                var c = s.charAt(i);

                if (whitespace.indexOf(c) == -1) return false;
           }

           // All characters are whitespace.
           return true;
      }

      /****************************************************************/


function FillComboExWith (base, element, defaultval) {
/* **********************
Name: FillComboWith
Params: base; string, comma delimited ","
        element; form object
		defaultval; string	
*/
	var Arr;
	Arr = new Array;
	Arr = base.split("%");
	element.options.length=0;
	element.length=Arr.length/2;
	for (var i=0 ; i < Arr.length ; i=i+2) {
		if (Arr[i] != "") {
			element[i/2] = new Option(Arr[i], Arr[i+1],false,false);
		}
	}

	element.value=defaultval;
}



function FillComboWith (base,lengte, element) {
	var Arr;
	Arr = new Array;
	Arr = base.split(",");
	eval( element +'.options.length=0');
	eval( element +'.length='+lengte);
	//eval(element + "[" + 0 + "] = new Option('" + Arr[0] + "','" + Arr[0] + "',true,false)");
	for (var i=0 ; i < lengte ; i++ ) {
		//alert(Arr[i]);
		//eval(element + ".options[" + i + "] = new Option('" + Arr[i] + "','" + Arr[i] + "',false,true)");
		eval(element + "[" + i + "] = new Option('" + Arr[i] + "','" + Arr[i] + "',false,false)");
	}
	element.value="Onbepaald";
}
