function mycarousel_initCallback(carousel)
{


    // Pause autoscrolling if the user moves with the cursor over the clip.
  /*  carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
      if($counter<2){  carousel.startAuto();}
    });*/
    
    // bind to .jcarousel-control links
      jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(
        	jQuery.jcarousel.intval(
        		jQuery(this).children(":first").attr('alt')
        	)
        );
        carousel.startAuto(0);
        return false;
    });



};
var counter=0;
function lastout(carousel, item, idx, state)
	{
		if(idx==1){
			if(counter>0){
			carousel.stopAuto();
			//window.alert('lastout');
			}
		counter++;
		return false;
		}
	}
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 4,
        scroll: 1,
        wrap: 'last',
        initCallback: mycarousel_initCallback,
        itemLastInCallback:  lastout
    });
});


