function tt_news_slider(Options) {

var $sliderid = '#tt_news_slider-'+Options.uid;
var $panels = jQuery($sliderid+' .tt_news_slider_scrollContainer > div');
var $container = jQuery($sliderid+' .tt_news_slider_scrollContainer');

// if false, we'll float all the panels left and fix the width 
// of the container
var horizontal = true;

// float the panels left if we're going horizontal
if (horizontal) {
  $panels.css({
    'float' : 'left',
    'position' : 'relative' // IE fix to ensure overflow is hidden
  });
  
  // calculate a new width for the container (so it holds all panels)
  $container.css('width', $panels[0].offsetWidth * $panels.length);
}

// collect the scroll object, at the same time apply the hidden overflow
// to remove the default scrollbars that will appear
var $scroll = jQuery($sliderid+' .tt_news_slider_scroll').css('overflow', 'hidden');

if(Options.betweenArrows)
{var $textArrows = '<span class="tt_news_slider_scrollButton tt_news_slider_scrollButton_text" >'+Options.betweenArrows+'</span>';}
else
{var $textArrows ='';}

// apply our left + right buttons if more than one element
if (Options.showArrows == true)
{$scroll.after('<div class="tt_news_slider_scrollButtons" ><a href="#" onclick="return false;" class="tt_news_slider_scrollButton tt_news_slider_scrollButton_left" title="Pr&eacute;c&eacute;dents"></a>'+$textArrows+'<a href="#" onclick="return false;" class="tt_news_slider_scrollButton tt_news_slider_scrollButton_right" title="Suivants"></a></div>');};

var scrollOptions = {
  target: $scroll, // the element that has the overflow
  
  // can be a selector which will be relative to the target
  items: $panels,
  
  // selectors are NOT relative to document, i.e. make sure they're unique
  prev: 'a.tt_news_slider_scrollButton_left', 
  next: 'a.tt_news_slider_scrollButton_right',
  
  // allow the scroll effect to run both directions
  axis: 'xy',
   
  
  // duration of the sliding effect
  duration: Options.duration,
  
  // easing - can be used with the easing plugin: 
  // http://gsgd.co.uk/sandbox/$/easing/
  easing: 'swing'
};

// apply serialScroll to the slider - we chose this plugin because it 
// supports// the indexed next and previous scroll along with hooking 
// in to our navigation.
jQuery($sliderid).serialScroll(scrollOptions);

// now apply localScroll to hook any other arbitrary links to trigger 
// the effect
//$.localScroll(scrollOptions);

// finally, if the URL has a hash, move the slider in to position, 
// setting the duration to 1 because I don't want it to scroll in the
// very first page load.  We don't always need this, but it ensures
// the positioning is absolutely spot on when the pages loads.
scrollOptions.duration = 1;
//$.localScroll.hash(scrollOptions);
//setTimeout(function(){jQuery($sliderid).ScrollTo();},2000);

}
