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');
    this.req.get({'product_id': product_id});
    alert("Товар добавлен в корзину!");
},

clear : function(){
    $('basket').addClass('ajax-loading');
    this.req.get({'clear':"all"});
    alert("Корзина очищена!");
}

});

window.addEvent('domready', function() {
 Basket = new Basket();
});
