$(document).ready(function() {
  $('.gallery a').each( function() {
  var title = $( this ).find("img").attr("alt");
  $(this).attr("title",title);
  });
//   var title = $('.gallery a img').attr("alt");
//   $('.gallery a').attr("title",title);
  $('.gallery a').lightBox();
});


	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({
	                //visible: 4,
                        animation: 8000,
			auto: 0.0001,
			wrap: 'circular',
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null,
			initCallback: mycarousel_initCallback
		});
	});








	function openWin(url,w,h,scrolling) {
			popupwin = window.open(url, "popupwin", "scrollbars="+scrolling+",resizable=yes,menubar=no,locationbar=no,height="+h+",width="+w);
			window.popupwin.focus();
		}

