﻿/*<![CDATA[*/
$(function(){
	//Get our elements for faster access and set overlay width
	var div = $('div.sc_menu'),
		ul = $('ul.sc_menu'),
		ulPadding = 15;
	
	//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

if (lastLi[0] != "undefined") {

		var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;	

		var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;

		div.scrollLeft(left);

		if (divWidth >= ulWidth) {
			balra = (divWidth-ulWidth)/2
			document.getElementById('kozepre').style.left = 0+'px';
			document.getElementById('kozepre').style.width = ulWidth+'px';
		}
}

	});
});
/*]]>*/


		$(document).ready(function() {

			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Kép ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});


		});
