/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
	// Pause autoscrolling if the user moves with the cursor over the clip.
	 carousel.clip.hover(function() {
	 	carousel.stopAuto();
	 }, function() {
	 	carousel.startAuto();
	 });
};

/**
 * Helper function for printing out debug messages.
 * Not needed for jCarousel.
 */
var row = 1;
function display(s) {
	// Log to Firebug (getfirebug.com) if available
	//if (window.console != undefined && typeof window.console.log == 'function')
	  //  console.log(s);

	if (row >= 1000)
		var r = row;
	else if (row >= 100)
		var r = '&nbsp;' + row;
	else if (row >= 10)
		var r = '&nbsp;&nbsp;' + row;
	else
		var r = '&nbsp;&nbsp;&nbsp;' + row;

	jQuery('#display').html(jQuery('#display').html() + r + ': ' + s + '<br />').get(0).scrollTop += 10000;

	row++;
};

// Ride the carousel...
jQuery(document).ready(function() {
	jQuery("#mycarousel").jcarousel({
		auto: 5,
		scroll: 1,
		initCallback: mycarousel_initCallback,
		
		// This tells jCarousel NOT to autobuild prev/next buttons
		buttonNextHTML: null,
		buttonPrevHTML: null
	});
});