var Basket = new Class({

initialize : function(){
        $('basket').addClass('ajax-loading');
        this.req = new Request.HTML({url:'/ajax/basket.php',
                onSuccess: function(html) {
                        $('basket').removeClass('ajax-loading');
                        $('basket').set('text', '');
                        $('basket').adopt(html);
                },
                onFailure: function() {
                        $('basket').set('text', 'The request failed.');
                }
        });
        this.req.get({'user_id': 25});
},

go_pruduct : function(product_id){
    $('basket').addClass('ajax-loading');
    if($('product_count['+product_id+']'))product_count = $('product_count['+product_id+']').value;
    else product_count = 1;

    this.req.get({'product_id': product_id,'product_count':product_count});
    alert("Vielen Dank.Der Artikel wird jetzt in den Warenkorb (rechts oben) gelegt.");
},

clear : function(){
    $('basket').addClass('ajax-loading');
    this.req.get({'clear':"all"});
    alert("Der Warenkorb wurde geloescht!");
}

});

window.addEvent('domready', function() {
 Basket = new Basket();
});

