var Shop=new Class({initialize:function(){this.growlBasket=$("growlbasket");this.basketContainer=$("basket-container")},hideGrowlBasket:function(){this.set({morph:{duration:500}});this.morph({opacity:0,"margin-top":20})},basketInfo:function(){(new Request.HTML({url:absoluteUrl+"buy/count_basket_items/1",update:"basket-info",method:"post",onSuccess:function(){$("basket-info").setStyle("display","block")}})).send()},basketAction:function(a,b,c,d){(new Request.HTML({url:absoluteUrl+"buy/basket_action/"+ a+"/"+b,update:"growlbasket",method:"post",data:c?$(c).toQueryString():"",onFailure:function(){this.basketContainer.set("html",'<span id="status" class="oops">Sorry, a problem occured while adding item. Please try again.</span>')}.bind(this),onSuccess:function(f,g,e){this.growlBasket.set({html:e,morph:{duration:500}});this.growlBasket.morph({opacity:1,"margin-top":[-20,0]});this.basketInfo(a,b);this.hideGrowlBasket.delay(5E3,this.growlBasket);e.indexOf("basket-error")===-1&&d&&d()}.bind(this)})).send()}}); basket_action=function(a,b,c){(new Shop).basketAction(a,b,c)};
