$(document).ready(function(){
	
	// Popup for links that have the class outta-site
	$('.outta-site').click(function(){
		newWindow = window.open($(this).attr('href'), $(this).attr('href'));
		if(window.focus)
		{
			newWindow.focus();
		}
		return false;
	});
	
	var images = $('.detailed-image');
	var cssClass = 'show';
	
	jQuery.each(images, function(){
		/*
		if(location.hash)
		{
			var id = location.hash.slice(location.hash.lastIndexOf('_'), location.hash.length);
			$('.detailed-image').addClass('hide');
			$('#img' + id).removeClass('hide');
			$('#img' + id).addClass('show');
			return;
		}
		*/
		$(this).addClass(cssClass);
		cssClass = 'hide';
	});
	
	//console.log(location.hash);
	
	$('.topnav').click(function(){
		var id = $(this).attr('id');
		id = id.slice(id.lastIndexOf('_')+1, id.length);
		
		//$('.topnav').css({fontWeight: 'normal'});
		//$(this).css({fontWeight: 'bold'});
		
		$('.detailed-image').removeClass('show');
		$('.detailed-image').addClass('hide');
		$('#img_' + id).removeClass('hide');
		$('#img_' + id).addClass('show');
	});
});