$(document).ready(function() {
	// Initialize the Scrollable control
	$(".scrollable").scrollable({speed: 400});
	// Get the Scrollable control
	var scrollable = $(".scrollable").data("scrollable");
	// Set to the number of visible items
	var size = 3;
	// Handle the Scrollable control's onSeek event
	scrollable.onSeek(function(event, index) {
		// Check to see if we're at the end
		if (this.getIndex() >= this.getSize() - size) {
			// Disable the Next link
			$("li.next").addClass("disabled");
		}
		
		// Handle the progress shown
		var itemCount = this.getSize();
		var itemCurrentIndex = this.getIndex() + 1;
		var itemsCurrentlyShowing = this.getIndex() + 3;
		$("#current-count").html('showing ' + itemCurrentIndex + '-' + itemsCurrentlyShowing + ' of');
	});	
	// Handle the Scrollable control's onBeforeSeek event
	scrollable.onBeforeSeek(function(event, index) {
	// Check to see if we're at the end
		if (this.getIndex() >= this.getSize() - size) {
		// Check to see if we're trying to move forward
			if (index > this.getIndex()) {
				// Cancel navigation
				return false;
			}
		}
	});
	// carousel navigation
	$(".scroll-trigger a").click(function(e){
		e.preventDefault();	
	}); 
	// get last item in carousel and remove border
	$(".carousel-item-wrapper:last").css('border', 'none');
});
