$(document).ready(function(){
	$("#sub_categories_big li.section:last").attr("id","last");
 });


jQuery(function( $ ){
	$('.search_div').serialScroll({
		target:'#sub_categories_big_window',
		items:'li.section', //selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'a.prev',//selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'a.next',//selector to the 'next' button (absolute too)
		axis:'x',//the default is 'y'
		queue:false,//we scroll on both axes, scroll both at the same time.
		event:'click',//on which event to react (click is the default, you probably won't need to specify it)
		duration:700,//length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, //force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		cycle:true,//cycle endlessly ( constant velocity, true is the default )
		step:1, //how many items to scroll each time ( 1 is the default, no need to specify )
		jump:false, //if true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
		lazy:false,//(default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
		interval:false, //it's the number of milliseconds to automatically go to the next
		constant:true,
		onBefore:function( e, elem, $pane, $items, pos ){
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			var currentView = $(elem).attr("id");
			if ( currentView == "first" ) { $("a.prev").addClass("faded"); } else { $("a.prev").removeClass("faded"); }
			if( currentView == "last" ) { $("a.next").addClass("faded"); } else { $("a.next").removeClass("faded"); }
		}
	});
});