$(document).ready(function(){
	
	//$(".thumbs img").fadeTo("500", 0.8); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	$(".thumbs img").hover(function() {  
                $(this).stop().animate({   width: '236px', height: '236px', marginTop: '-50px', marginLeft: '-10px', opacity: '1.0'}, 200);  
                },function() {  
                $(this).stop().animate({  width: '125px', height: '125px', marginTop: '0px',  marginLeft: '0px', opacity: '1.0'}, 500);  
    });
	
	//$(".thumbs-web img").fadeTo("500", 0.5); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	$(".thumbs-web img").hover(function() {  
				bgAnimationIsOn = false;
                $(this).stop().animate({   marginTop: '0'}, {duration: 500, easing: 'easeOutQuint'});  
                },function() {  
                $(this).stop().animate({  marginTop: '-125px'}, {duration: 500, easing: 'easeInOutQuint'});  
				
				//$('#content').animate({scrollLeft: amtToScrollcontent+'px'}, {duration: 3000, easing: 'easeInOutQuint'});
    });
	
	$(".thumbs-subnav img").hover(function() {  
				bgAnimationIsOn = false;
                $(this).stop().animate({   marginLeft: '-90px'}, {duration: 500, easing: 'easeOutElastic'});  
                },function() {  
                $(this).stop().animate({  marginLeft: '-125px'}, {duration: 2500, easing: 'easeOutElastic'});  
				
				//$('#content').animate({scrollLeft: amtToScrollcontent+'px'}, {duration: 3000, easing: 'easeInOutQuint'});
    });
	
	$(".thumbs-subnav-back img").hover(function() {  
				bgAnimationIsOn = false;
                $(this).stop().animate({   marginLeft: '-85px'}, {duration: 1500, easing: 'easeOutElastic'});  
                },function() {  
                $(this).stop().animate({  marginLeft: '-70px'}, {duration: 2500, easing: 'easeOutElastic'});  
				
				//$('#content').animate({scrollLeft: amtToScrollcontent+'px'}, {duration: 3000, easing: 'easeInOutQuint'});
    });
	
	$('a').click(function(e) {
		
		var galleryToShow;
		var galleryToHide;
		var galleryToShowInitSlidePos;
		var galleryToHideEndSlidePos;
		
		if($(this).attr('href') == "#web-gallery-two"){
			galleryToShow = "#gallery-two";
			galleryToHide = "#gallery-one";
			
			galleryToShowInitSlidePos = "-138px";
			galleryToHideEndSlidePos  = "62px";
		
		}else if($(this).attr('href') == "#web-gallery-one"){
			galleryToShow = "#gallery-one";
			galleryToHide = "#gallery-two";
			
			galleryToShowInitSlidePos = "62px";
			galleryToHideEndSlidePos  = "-138px";
			
		}else{
			return;
		}
		
		$(galleryToShow).css({ opacity: '0.0', visibility:'visible', zIndex:'999', marginLeft: galleryToShowInitSlidePos }); 
		$(galleryToHide).css({ zIndex:'998'}); 
		$(galleryToShow).animate({ opacity: '1.0', marginLeft:'-38px'}, 500); 
		$(galleryToHide).animate({ opacity: '0.0', marginLeft:galleryToHideEndSlidePos}, 500, function() { $(galleryToHide).css({ visibility:'hidden'}); });
		
	});
	 
})
