// when the DOM is ready...
$(document).ready(function () {

var $panels2 = $('#slider .scrollcontainer-auction > div');
var $container2 = $('#slider .scrollcontainer-auction');


var $scroll2 = $('#slider .scroll-auction').css('overflow', 'hidden');


// handle nav selection
function selectNavAuction() {
  $(this)
    .parents('ul#auction-menu:first')
      .find('a')
        .removeClass('selected')
      .end()
    .end()
    .addClass('selected');
}



var scrollOptions = {
	target: $scroll2, // the element that has the overflow
	items: $panels2,
	navigation: '#auction-menu a',
	prev: 'img.left', 
	next: 'img.right',
	axis: 'xy',
	duration: 700,
	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.
$('#slider').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);

});