/////////////////////////////////////////////////////////
//  Set this variable to be the ID of the "page" that  //
//   you want shown on load if one isn't in the URL.   //
/////////////////////////////////////////////////////////
var showOnLoad = 'photos';


/////////////////////////////////////////////////////////
//        And the rest takes care of itself!           //
/////////////////////////////////////////////////////////
function navigate(navTo, speed, navFrom) {
	if(navFrom === undefined) {
		$('div#'+navTo).slideDown(speed,function(){
			$('div#'+navTo).addClass('current');
		});
		$('a[href*='+navTo+']').addClass('current');
	} else if(navTo != navFrom) {
		$('div#'+navFrom).slideUp(speed,function(){
			$('div#'+navFrom).removeClass('current');
			$('div#'+navTo).slideDown(speed,function(){
				$('div#'+navTo).addClass('current');
			});
		});
		$('a[href*='+navFrom+']').removeClass('current');
		$('a[href*='+navTo+']').addClass('current');
	}
}
$(document).ready(function() {
	$('div.article').hide(0);
	if(window.location.hash.substr(1)) {
		navigate(window.location.hash.substr(1),400);
	} else {
		window.location.hash = showOnLoad;
		navigate(showOnLoad,400);
	}

	$('ul#nav li a').click(function(){
		navigate(this.href.split('#')[1],200,$('div.current.article').attr('id'));
	});
 });
var d = new Date();
var viewportWidth = window.innerWidth ? window.innerWidth : $(window).width();
imageWidth = (viewportWidth > 1124) ? 'auto' : viewportWidth - 100;
//var viewportWidth = window.innerWidth ? window.innerWidth : $(window).width();
TopUp.addPresets({
	'.recent-photos a': {
		//type: 'images',
		title: 'Image {current} of {total}. &copy; '+d.getFullYear()+' Kerrick Long. <a href="http://www.flickr.com/photos/kerricklong/{alt}/">View or comment on Flickr</a>',
		layout: 'quicklook',
		shaded: 1,
		group: 1,
		overlayClose: 1,
		modal: 1,
		width: imageWidth,
		
	}
});
//  Code is copyright Kerrick Long, 2009.