
//#####################################################################################
//	removeArticle()
//#####################################################################################

function addArticle(id,countInput)
{
	var count = $(countInput).value;
	$(countInput).value = 1;
	
	var product = new Request(
	{
		method: 'post',
		url: '/inc/handleBasket.ajax.php',
		onSuccess: function(count)
		{
			$('basketPreview_count').innerHTML = count;
			message.show('Warenkorb','Das Produkt wurde in den Warenkorb gelegt.','OK');
		},
		onFailure: function() { alert("ERROR"); }
	});
	product.send('addArticle='+id+'&count='+count);
}

//#####################################################################################
//	setBasket()
//#####################################################################################

function setBasket()
{
	var product = new Request(
	{
		method: 'post',
		url: '/inc/handleBasket.ajax.php',
		onSuccess: function(count) { $('basketPreview_count').innerHTML = count; },
		onFailure: function() { alert("ERROR"); }
	});
	product.send('setBasket=1');
}

window.addEvent("domready",function(){
	if($('basketPreview_count')) { setBasket(); }
});