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();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		 vertical: true,
        scroll: 1,
		visible: 4,
        auto: 5,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});

function display(myimage) {
  html = "<HTML><HEAD><TITLE>Foto</TITLE>" +
         "</HEAD><BODY LEFTMARGIN=0 " +
         "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" +
         "<IMG SRC='" + myimage + "' BORDER=0 NAME=image " +
         "onload='window.resizeTo(document.image.width,document.image.height+100)'>" + 
         "</CENTER>" +
         "</BODY></HTML>";
  popup= window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
  popup.document.open();
  popup.document.write(html);
  popup.document.focus();
  popup.document.close()
};
