$(function() {

$('#access .menu-header li:last').addClass('last');

/*
// ----- Carousel
			$('#billy_scroller').billy({
				slidePause: 20000,
				// We need custom next/prev buttons for this example. If we used the defaults (#billy_next/#billy_prev), every carousel instance on the page would scroll when they're clicked...
				nextLink: $('#carousel_billy_next'),
				prevLink: $('#carousel_billy_prev')
			});
			
		// ----- Fading Carousel
			$('#billy_fader').billy({
				transition: 'fade',
				slidePause: 20000,
				// We need custom next/prev buttons for this example. If we used the defaults (#billy_next/#billy_prev), every carousel instance on the page would scroll when they're clicked...
				nextLink: $('#fader_billy_next'),
				prevLink: $('#fader_billy_prev'),
				indicators: $('#fade_indicators')
			});
			
		// ----- Tabber
			$('#tabber').billy({
				slidePause: 8000,
				indicators: $('ul#tabber_tabs'),
				customIndicators: true,
				autoAnimate: false,
				noAnimation: true
			});
			
*/
           $('#billy_clip').scrollable({
		items: '#billy_fader',
		circular: true,
		speed: 50,
		onBeforeSeek: function(e,i) {
			var slides = this.getItems();			
			$(slides).eq(i).fadeOut(600);
			//alert(i);
			},
		onSeek: function(e,i){
			var slides = this.getItems();
			var size = this.getSize();
			//console.log('size'+size+' index'+i);
			var b = (size-i > 1 ? i+1 : i);
			var slide = $(slides).eq(b);
			
			if (slide.is(':hidden'))
			$(slides).eq(i).show();
			
			if (size-i == 1)
			$(slides).show();
			//alert(i);
		}
		}).autoscroll({ autoplay: true, interval: 15000 });
		
});



