jQuery(function( $ ){

      $("#line").serialScroll({
		items: 'a',
		prev:'a.prev',
		next:'a.next',
		offset: -200, //when scrolling to photo, stop 230 before reaching it (from the left)
		start: 1, //as we are centering it, start at the 2nd
		duration: 200,
		force: false,
		stop: true,
		lock: true,
		cycle: true, //don't pull back once you reach the end
		jump: true, //click on the images to scroll to them
		onAfter:function( elem ){

			var largePath = $(elem).attr("href");
			var largeAlt = $(elem).attr("title");
			
			var onepix='images/1x1.gif';
				
			 
			 $("#largeImg").hide(); 
 			 $("#largeImg").css('background-image','url('+largePath+')');
			 $("#largeImg").fadeTo(1000,1);                
			 			

                	$("#line img").removeClass('curr');
			$("#line img").fadeTo(0,0.3);
			$(elem).find("img").addClass('curr');					 
			$(elem).find("img").fadeTo(100,0.9);					 
			 
			}
		});

});

 $(document).ready(function(){
	
	$("img.menu").fadeTo(100, 0.3);
	$("img.menu").hover(function(){$(this).fadeTo('fast',1);},
                             function(){$(this).fadeTo('fast',0.3);}
                             );

	$("a.prev").click(function(){
		$("#line").trigger('prev');
		});
	$("a.next").click(function(){
		$("#line").trigger('next');
		});
	
	

	$("#line img").fadeTo(100, 0.7);
	$("#line img").hover(function(){$(this).fadeTo('fast',1);},
                             function(){$(this).fadeTo('slow',0.7);}
                             );
	
	$("a.prev").fadeTo('slow',0);
	$("a.next").fadeTo('slow',0);

	$("a.prev").hover(function(){$(this).fadeTo('slow',0.3);},
                                 function(){$(this).fadeTo('fast',0);}
                             );
	$("a.next").hover(function(){$(this).fadeTo('slow',0.3);},
                                 function(){$(this).fadeTo('fast',0);}
                             );

	$("#line").trigger('goto',[0]);	
		

	
        });


