function removeProd(klantid,id){
	   new Ajax.Request(BASE+"ajax/addtocart.php",
	   	  {	   	  		
			   postBody : 'klantid='+klantid+'&id='+id+'',
			   method : 'post',
	           onComplete : function(t)
	           {
	           	getBestellingen(klantid);
	           }
	       }
	   );
}
function addToCartSelected2(id,aantal,klantid)
{

		   new Ajax.Request("http://www.pepernotenpret.nl/ajax/addtocart.php",
	   	  {	   	  		
			   postBody : 'klantid='+klantid+'&aantal='+aantal+'&id='+id+'',
			   method : 'post',
	           onComplete : function(t)
	           {
		           	getBestellingen(klantid);
	           }
	       }
	   );
}
function logout(klantid)
{
   new Ajax.Request(BASE+"ajax/deleteTempbestelling.php",
	   	  {	   	  		
			   postBody : 'klantid='+klantid+'',
			   method : 'post',
	           onComplete : function(t)
	           {
	           	getBestellingen(klantid);
	           	document.location.href=BASE+'pagina/loguit/';
	           }
	       }
	   );	
	  
}
function addToCartSelected(id)
{
	var aantal;
	aantal = $('aantal').value;
	klantid = 1;	
	   new Ajax.Request(BASE+"ajax/addtocart.php",
	   	  {	   	  		
			   postBody : 'klantid='+klantid+'&aantal='+aantal+'&id='+id+'',
			   method : 'post',
	           onComplete : function(t)
	           {
	           	getBestellingen(klantid);
	           }
	       }
	   );
}
function editAantal(klant,prod)
{
	var aantal;
	if(aantal = prompt('Wijzig het aantal in:',''))
	{
		if(!isNaN(aantal)&&aantal!=0)addToCartSelected2(prod,aantal,klant);
	
	}	
}
function getBestellingen(klantid)
{
	   new Ajax.Request(BASE+"ajax/getcart.php",
	   	  {	   
			   postBody : 'klantid='+klantid+'',
			   method : 'post',
	           onComplete : function(t)
	           {
	           	$("bon").update(t.responseText);
	           }
	       }
	   );
}
