$(document).ready(function() {

	$('.photo_gallery_photo a.photo_thumb, .photo_gallery_photo .links a.current_page').click(function(){
		$('.photo_gallery_photo .photo_thumb').show();
		$('.photo_gallery_photo .photo').hide();

		var show_block = '#'+$(this).attr('href').split('#')[1];
		$(show_block).find('.photo_thumb').hide();
		$(show_block).find('.photo').show();
	});

	$('.photo_gallery').ready(function(){
		var url = new String(document.location);
		if(url.indexOf('#photo_') != -1)
		{
			var show_block = '#'+url.split('#')[1];
			$(show_block).find('.photo_thumb').hide();
			$(show_block).find('.photo').show();
		}
		else if(url.indexOf('#first') != -1)
		{
			$('.photo_gallery .photo_gallery_photo:first').find('.photo_thumb').hide();
			$('.photo_gallery .photo_gallery_photo:first').find('.photo').show();
		}
		else if(url.indexOf('#last') != -1)
		{
			$('.photo_gallery .photo_gallery_photo:last').find('.photo_thumb').hide();
			$('.photo_gallery .photo_gallery_photo:last').find('.photo').show();
		}
	});
});

