

function mycarousel_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }
        if (i > mycarousel_itemList.length) {
            break;
        }
        var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i-1])).get(0);
        carousel.add(i, item);
    }
	carousel.buttonNext.bind('click', function() {	
		carousel.startButt(0);
	});
	carousel.buttonPrev.bind('click', function() {	
		carousel.startButt(0);
	});				
	carousel.buttonPlay.bind('click', function() {
		carousel.startButt(2);
	});
	carousel.buttonPause.bind('click', function() {
		carousel.startButt(0);
	});	
	carousel.buttonNext.hoverIntent(function() {
		carousel.buttonNext.fadeTo("fast", 1.0);
		}, function() {
		carousel.buttonNext.fadeTo("fast", 0.25);					 
	});
	carousel.buttonPrev.hoverIntent(function() {
		carousel.buttonPrev.fadeTo("fast", 1.0);
		}, function() {
		carousel.buttonPrev.fadeTo("fast", 0.25);					 
	});	
	$("div.close").bind('click', function() {
		carousel.closeButt();				
	});
};

function mycarousel_getItemHTML(item) { 
	return '<span id="' + item.caption + '"><a href="#" class="fz' + item.title + '" title=""><img lowsrc="../images/ajax-loader.gif" id="im' + item.caption + '" src="' + item.url + '" width="224" height="150" border="0" alt="" /></a></span>';
};

function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, self, idx, state) {
	$("div.jcarousel-zoom-horizontal").bind('click', function() {			
		$("div#showfz"+idx).show(800);
/*		 var $this = $(self);
		 var x = $this.find("object").attr("id");	
		$("object#"+idx).fadeIn("fast");*/
		carousel.stopButt();	
	});
	$("a.fz"+idx).bind('click', function() {														 
	$("div#showfz"+idx).show(800);
/*		 var $this = $(self);
		 var x = $this.find("object").attr("id");	
		$("object#"+idx).fadeIn("fast");*/
	carousel.stopButt();	
	});
	var $this = $(self);
	var x = $this.find("span").attr("id");
   $("div#caption").html(' ' + x + ' ').fadeIn("fast");	
};
function mycarousel_itemVisibleOutCallbackBeforeAnimation(carousel, item, idx, state) {
    $("div.jcarousel-zoom-horizontal").unbind( "click" );	
		$("a.fz"+idx).unbind( "click" );	
		$("div#caption").fadeOut("fast").html('');

};