$().ready(function(){											

	$("a[rel^='fancybox'], a[rel^='clearbox']").fancybox({ 'zoomSpeedIn': 1000, 'zoomSpeedOut': 500, 'overlayShow': true });
	
	// horizontal scroller via http://valums.com/scroll-menu-jquery/
	$('.box').each(function(i){
			
			var div = $(this).children('div.images');
			var ul = $(this).children('div').children('ul.sc_menu');
			var ulPadding = 0;
			
			//Get menu width
			var divWidth = div.width();
		
			//Remove scrollbars	
			div.css({overflow: 'hidden'});
			
			//Find last image container
			var lastLi = ul.find('li:last-child');
			
			//When user move mouse over menu
			div.mousemove(function(e){
				//As images are loaded ul width increases,
				//so we recalculate it each time
				var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;	
				var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
				div.scrollLeft(left);
			});
			
	});
	
//	$('.prohlednout a').click(function(){
//		$('.box').fadeIn();
//		$(this).fadeOut().parent().slideUp();
//		return false;
//	});
//	
//	$('.box').hide();

});
