var visible = false;

function showhideDiv(divName, display) {
	
	if (display == 'none')  {
		visible = false;
	} else {
		if (visible == false) {
			display = '';
			visible = true;
		} else {		
			display = 'none';
			visible = false;
		}
	}
	
	document.getElementById(divName).style.display = display;
}

function ValidNumber(thestring){	
	for (i = 0; i < thestring.length; i++) {		
		ch = thestring.substring(i, i+1);		    
		if ((ch < "0" || ch > "9")) {          
			alert("Nummers mogen alleen uit de cijfers van 0 t/m 9 bestaan!");   
			return false;
		}
	}	
	return true;
}

function keyIsEnter(event) {
	if (event.keyCode == 13) {
		return true;
	} else {
		return false;
	}	
}

function checkFormNotEmpty(formName) {
	elems = $(formName).elements;
	for(i = 0; i < elems.length; i++) {		
		if (elems[i].name.indexOf('aantal_') > -1) {
			if (elems[i].value > 0) {
				return true;
			}
		}
	}
	alert("U dient tenminste een artikel te bestellen!");
	return false;
}

function editorder(order) {
	document.getElementById('step').value='bestelling';
	document.getElementById('b_id').value=order;
	document.frm_bestellen.submit();	
}

function updateTotaal() {
	pars = 'ajax=updateTotaal';
	vars = $('frm_bestellen').serialize();
	pars += '&' + vars;	
	var myAjax = new Ajax.Updater('div_leeg_totprijs', 'addons/addon.debeer/class.php', {method: 'post', parameters: pars, evalScripts: true});		
}