		//Checks the minimum and maximum amounts and granularities
      	function checkAmounts() {
      		//walk trough the document, and find all minimum amounts, maximumamount and granularities.
      		//get all inputfields
      		var inputFieldList = document.getElementsByTagName("input");
      		for (var index = 0; index < inputFieldList.length; index++) {
      			hiddenField = inputFieldList[index];
      			if (hiddenField.id.match("_minimum")) {
    	  			var id = hiddenField.id.replace("_minimum", "");
   	  				
					//check for minimumamount
					var checkField = document.getElementById(id +  "_value");
					var minAmount = document.getElementById(hiddenField.id).value;
					var currentAmount = checkField.value;
					var field = null;
					//see if theres a depositfield coupled to this field
					var depositfield = document.getElementById(id + "_deposit");
					if (depositfield != null) {
						//get the value of the depositfield
						field = document.getElementById(depositfield.value + "_value");
						minAmount = parseInt(minAmount) + parseInt(field.value);
					}

					//check if the currentamount is not valid
					if (parseInt(currentAmount) < parseInt(minAmount)) {
						if (field == null) {
							alert("U moet minimaal " + minAmount + " euro invoeren.");
						} else {
							var minAmountTemp = parseInt(minAmount) - parseInt(field.value);
							alert("Uw aankoopbedrag - aanbetaling moet tenminste " + minAmountTemp + " euro bedragen. In uw geval moet u een minimaal aankoopbedrag van " + minAmount + " euro invoeren.");
						}
						setFocus(checkField);
						return false;
					}
				}
				
				else if (hiddenField.id.match("_maximum")) {
    	  			var id = hiddenField.id.replace("_maximum", "");
   	  				
					//check for maximumamount
					var checkField = document.getElementById(id +  "_value");
					var maxAmount = document.getElementById(hiddenField.id).value;
					var currentAmount = checkField.value;

					//check if the currentamount is not valid
					if (parseInt(currentAmount) > parseInt(maxAmount)) {
						alert("U kunt maximaal " + maxAmount + " euro invoeren.");
						setFocus(checkField);
						return false;
					}
				} else if (hiddenField.id.match("_granularity")) {
    	  			var id = hiddenField.id.replace("_granularity", "");
   	  				
					//check for granularity
					var checkField = document.getElementById(id +  "_value");
					var granularity = document.getElementById(hiddenField.id).value;
					var currentAmount = checkField.value;

					//check if the currentamount is not valid
					if (currentAmount % granularity != 0) {
						alert("U moet een meervoud van " + granularity + " euro invoeren.");
						setFocus(checkField);
						return false;
					}
				}
      		}
      		return true;
      	}
      	      	
      	
      	//set the focus to element
      	function setFocus(element) {
      		try {
				
				element.select();
				element.focus();
			} catch (e) {}
      	}
      	
