jQuery.fn.extend({
  ShoppingBasketPresenter: function(properties) {
    return this.each(function() {

      if (properties != undefined) {
        this.__properties = properties;
      }

/*
      clickEvent = function() {
        w = this.parentNode;
        $(w).publixeEvent(w.__properties.anchorPurhcaseClick);
      };
*/

      if (this.__properties != undefined) {
        if (this.__properties.autoshow) {
          $('.ShoppingBasketPresenter table').data('autoshow', true).show();

          setTimeout(function() {
            $('.ShoppingBasketPresenter table').data('autoshow', false).fadeOut(200);
          }, 3000);


        }
      }

      $('.box_wrapper', this).mouseenter(function() {
        $('.ShoppingBasketPresenter table').fadeIn(0);
      });

      $('.box_wrapper', this).mouseleave(function() {
        sel = $('.ShoppingBasketPresenter table');
        if (sel.data('autoshow') != true) {
          sel.fadeOut(200);
        }
      });

      $('.remove', this).data('owner', this).click(function() {
        var id = this.id.split('__');

        o = $(this).data('owner');
        $(o).publixeEvent(o.id + '::removeItemClick', {item_id: id[1]});
      });

    });
  }
});

