mod_shop_cart = {
  add_item: function (cart_id, id, photo, weight, name, quantity, max_quantity, price){
        LibDefault.ajax_message(location.href, 'module_group=shop&module_name=cart&cart_id='+ escape(cart_id) + '&action=add_item&item_id='+escape(id)+'&photo='+escape(photo)+ '&weight='+encodeURIComponent(weight)+'&name='+encodeURIComponent(name)+'&quantity='+escape(quantity)+'&price='+escape(price)+'&max_quantity='+escape(max_quantity));
  },
  
  prepare_name: function (name, id) {
    var size_option = document.getElementById('ware_' + id + '_size');
    var color_option = document.getElementById('ware_' + id + '_color');
    if(size_option)
      name = name + ' (' + size_option.value + ')'; 
    if(color_option)
      name = name + ' (' + color_option.value + ')';
    return name; 
  },
    
  remove_item: function(cart_id, id){ 
    LibDefault.ajax_message(location.href, 'module_group=shop&module_name=cart&cart_id='+ escape(cart_id) + '&action=remove_item&item_id='+escape(id));
  },

  change_count: function(cart_id, id, quantity){ 
    LibDefault.ajax_message(location.href, 'module_group=shop&module_name=cart&cart_id='+ escape(cart_id) + '&action=change_quantity&item_id='+escape(id) + '&quantity='+escape(quantity));
  },
  
  filter: function (e) {
    if (!e){
      e = window.event;
    }
     
    var c = 0;
      
    if(e.key){
      c = e.key();
    }else{
      c = e.keyCode;
    }
    
    if(c >= 96 && c<= 105)
      c = c - 96;
  
    if(c >= 48 && c <= 57)
      c = c - 48;
    
    
    if ("0123456789".indexOf(c) == -1) {
      /* unknown key pressed; ignore it */
      if(c != 8 && c != 13 && c!= 46 && c!=116 && c!=37 && c!=39 && c!=35 && c!= 36)
        e.stop(); 
    }
  }  
}  
