jQuery.fn.extend({
	
	bnuSlider: function( action, opt_value ){
	  var returnValue, args = arguments;
	  
		this.each(function(){
		  
		  // do actions
		  if( typeof action == "string" ){
		    returnValue=$(this).slider(action,opt_value);
			}
		  else{
				var content=action.content;
				if($(content).attr("scrollWidth") - $(content).width()>0){
					$(this).data("slider",1);
					return $(this).slider({from: 0, to: 100,  step: 2 ,smooth: true,onstatechange: function (value){
							var maxScroll = $(content).attr("scrollWidth") - $(content).width();
							$(content).attr({scrollLeft: value * (maxScroll / 100) });
							}
							})
					}
				  
		  }
		});
		
		return returnValue || this;
	}
})

