jQuery.fn.selectionSlider = function() {
  return this.each(function(){
      var container =$(this).find("#widgetSelectionSlider_products");
      var containerChildren = container.children();
      var newWidth = containerChildren.width() * (containerChildren.length + 1);
      container.width( newWidth );

      $(this).find("#widgetSelectionSlider_prev").click( function() {
          var item = $(this).nextAll("#widgetSelectionSlider_products");

          if( item.position().left < 0 ) {
            item.animate({left: "+=134"}, 'fast');
            var clipLeft = Math.abs(item.position().left) - 134;
            var clipRight = clipLeft + 536;
            item.css("clip", "rect(0px, "+ clipRight +"px, 240px, "+ clipLeft +"px)");
          }
      });
      $(this).find("#widgetSelectionSlider_next").click( function() {
          var item = $(this).nextAll("#widgetSelectionSlider_products");

          if( item.position().left > -268 ) {
            item.animate({left: "-=134"}, 'fast');
            var clipLeft = Math.abs(item.position().left) + 134;
            var clipRight = clipLeft + 536;
            item.css("clip", "rect(0px, "+ clipRight +"px, 240px, "+ clipLeft +"px)");
          }
      });
  });
};


