	$(document).ready(function() {
		$(scroll_func);
		if (window.attachEvent && navigator.userAgent.indexOf("Opera")==-1) $(jsHover);


		lightgallery.init({
			enableZoom:false,
			speed:50,
			fadeImage:false
		});
	});


	var scroll_func = function() {
		//Get our elements for faster access and set overlay width
		var div = $('div.gallery-scroll'),
			ul = $('ul.gallery-scroll'),
			ulPadding = 15;

		//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);
		});
	}


	var jsHover = function() {
		var hEls = document.getElementById("menu").getElementsByTagName("TD");
		for (var i=0, len=hEls.length; i<len; i++) {
			if (1) {
				hEls[i].onmouseover=function() { this.className+=" jshover"; }
				hEls[i].onmouseout=function() { this.className=this.className.replace(" jshover", ""); }
			}
		}
	}
//	if (window.attachEvent && navigator.userAgent.indexOf("Opera")==-1) window.attachEvent("onload", jsHover);
