function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

$(document).ready(function() { 
	// initialize scrollable
	$("div.scrollable").scrollable();


$(".recordDetails").click(function(){
	var id = $(this).attr('id');
	$('#layout').html('czekaj');
	$('#popup').fadeIn("slow");
	jQuery.ajax({
			 type:'GET',
			 url:' /realizacja/'+id,
			 //data:'id='+id,
			   success: function(data){
				$('#layout').html(data);
				//$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});


			   }
			}); 
}); 
$("#curtain").click(function(){
	$('#popup').fadeOut('slow');
	$('#layout').html();
}); 

jQuery('#mycarousel').jcarousel({
        vertical: true,
        scroll: 1,
		wrap: 'last',
		initCallback: mycarousel_initCallback

    });


$('a.lightsGal').zoomimage({
	border: 20,
	centered: true,
	hideSource: true
});

});


