$(document).ready(function(){
	$('.gallery-list li a').append('<span class="magnifier"></span>');					   
						   
	$('.thumbnail-list a').click(function() {
		var $current_image = $('.gallery-list li:eq(' + $(this).attr('rel') + ')');
		//$current_image.fadeOut(300);
		$('.image-window').stop().scrollTo( $current_image, 900, {easing:'easeOutQuart'});
		return false;
	});
	 $('.gallery-list a').colorbox({transition:'fade', speed:500});
	if ( typeof(openbox) != 'undefined' ) {
		$('.gallery-list a:eq(0)').click();
	}
	$('.thumbnail-wrapper').mousemove(function(e){
											   
		var containerWidth = 350;
		var listWidth = $('.thumbnail-list').width();
		
		if ( containerWidth >= listWidth ) {
			return false;
		}
		
		var ratio = (listWidth-containerWidth)/containerWidth;
		
		
		
		var offset = $(this).offset();
		var mousePosition = e.pageX - offset.left;
		
		var listPosition = mousePosition*ratio;
		//alert( listPosition );
		//$('#test').text( listPosition );
		
		$('.thumbnail-list').stop().css({left: -listPosition});
		//$('#test').text( e.pageX - offset.left );
	});
	
});
