function shoppingcart_add(id)
{
	e = document.getElementById("shop_"+id+"_variante");
	
	if (e.options)
		variante = e.options[e.selectedIndex].value;
	else
		variante = e.value;

    var options = {	
		        	method : "post",
					parameters : "id="+id+"&variante="+variante,
					onSuccess : shoppingcart_reload 
                 };
 
    new Ajax.Request("shoppingcart_add.php", options);
}
	  
function shoppingcart_remove(index)
{ 
    var options = {	
		        	method : "post",
					parameters : "index="+index,
					onSuccess : shoppingcart_reload 
                 };
 
    new Ajax.Request("shoppingcart_remove.php", options);
}	  
	  
function shoppingcart_plus(index)
{
    var options = {	
		        	method : "post",
					parameters : "index="+index,
					onSuccess : shoppingcart_reload
                 };
 
    new Ajax.Request("shoppingcart_plus.php", options);
}

function shoppingcart_minus(index)
{
    var options = {	
		        	method : "post",
					parameters : "index="+index,
					onSuccess : shoppingcart_reload 
                 };
 
    new Ajax.Request("shoppingcart_minus.php", options);
}

function shoppingcart_reload()
{
    var options = {	
		        	method : "post",
					onSuccess : shoppingcart_refresh 
                 };
 
    new Ajax.Request("shoppingcart_reload.php", options);

    var options = {	
		        	method : "post",
					onSuccess : shoppingcart_checkout_refresh 
                 };
 
    new Ajax.Request("shoppingcart_reload_checkout.php", options);
}

function shoppingcart_refresh(t)
{
	if (document.getElementById("warenkorb")) document.getElementById("warenkorb").innerHTML = t.responseText;
}

function shoppingcart_checkout_refresh(t)
{
	if (document.getElementById("warenkorb_checkout")) document.getElementById("warenkorb_checkout").innerHTML = t.responseText;
}
