Shadowbox.init({
	overlayOpacity: 0.75
});

$(document).ready(function(){
	$('.additional_photos a').each(function(){
		$(this).attr('title', $('img', this).attr('alt'));
	});
	Shadowbox.setup('.instrument .additional_photos a', {
		gallery: 'additional_photos'
	});
	
	$('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"]').not('.additional_photos a').attr('rel', 'lightbox');
	
	if($('.home #slideshow').length > 0){
		$('.home #slideshow img').css({
			'opacity': '0',
			'position': 'absolute',
			'top': '-300px'
		});
		function slideshow(which_img){
			$(which_img).animate({opacity: '1'}, { queue: false, duration:1500 }).animate( { top: '0' }, { queue: false, duration:7500 }).delay(4000).animate({ opacity: '0' }, 2500, function(){
				$('.home #slideshow img').css('top', '-300px');
				if($(this).next().length > 0){
					slideshow($(this).next());
				}else{
					slideshow($('.home #slideshow img').first());
				}
			});
		}
		slideshow($('.home #slideshow img').first());
	
		$('.home #site_title').animate({opacity: 1, left: '+=50'}, 2500, function(){
			$('p', this).fadeIn('slow');
		});
	}
	
	$('.blog .months select').change(function(){
		if($(this).val()){
			window.location = $(this).val();
		}
	});
});
