function addToBasket() {
	var form = document.mandjeFormName
	var elementName = ""
	var optionsString = ""
	for(var i = 0; i < document.getElementsByTagName('select').length; i++) {
		elementName = document.getElementsByTagName('select')[i].name;
		catValue = document.getElementsByName(elementName)[0].options[document.getElementsByName(elementName)[0].selectedIndex].value;
		optionsString = optionsString + "&" + elementName + "=" + catValue;
	}
	requestCustomerInfo(form.productNummer.value, form.aantalField.value, optionsString);
	startBezel();
	return false
}
function updateBasket(articleId, optionCatId, optionValueId) {
	updateCustomerInfo(articleId, optionCatId, optionValueId);
	return false
}
function deleteBasketItem(articleId) {
	deleteCustomerInfo(articleId);
	search_delay2(this);
	return false
}
function confirmDeleting(articleId, articleName) {
	if(confirm('Weet u zeker dat u `' + articleName + '` uit de winkelwagen wilt verwijderen?')) {
		deleteBasketItem(articleId);
	} else {
		return false
	}
}



function requestInfo(articleId, aantal) {
	search_delay(this, articleId, aantal);
	return false
}
function search_delay(element, articleId, aantal) {
	var func = function() { updateBasketAantal(articleId, aantal); };
	// Check to see if there is already a timeout and if so......cancel it and create a new one
	if ( element.zid ) {
		clearTimeout(element.zid);
	}
	element.zid = setTimeout(func,1000);
}
function search_delay2(element) {
	var func = function() { updateShoppingBasket(); };
	// Check to see if there is already a timeout and if so......cancel it and create a new one
	if ( element.zid ) {
		clearTimeout(element.zid);
	}
	element.zid = setTimeout(func,500);
}
function updateBasketAantal(articleId, aantal) {
	updateAantalCustomerInfo(articleId, aantal);
	search_delay2(this);
}
function updateShoppingBasket() {
	requestCustomerInfo();
}

