// JavaScript Document
	//Get our elements for faster access and set overlay width
	var div = $('div#scroll'),
		ul = $('ul#album_content'),
		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);
	});


	$('#slider').cycle({
		fx: 'scrollHorz',
		speed: 500,
		prev: '#prev',
		next: '#next',
		timeout: 0
	});

	/*
	$('#slider').cycle({
		fx: 'scrollHorz',
		speed: 500,
		prev: '#prev',
		next: '#next',
		timeout: 0,
		before: function() {
			$('.gallerywrapper').css('margin-bottom','5px');
			$('.gallerywrapper').css('overflow','hidden');
			$('#slider').css('overflow','hidden');
		},
		after: function() {
			$('.gallerywrapper').css('margin-bottom','0px');
			$('.gallerywrapper').css('overflow','visible');
			$('#slider').css('overflow','visible');
		}
	});
	*/
	
	$('#gallery .thePhoto').lightBox({fixedNavigation:true});
	
	$('.album_pic').hover(function() {$(this).css('cursor','pointer')});
	
	$('.gallerywrapper').css('overflow','visible');
	$('#slider').css('overflow','visible');
