// JavaScript Document
//  Dykam/Mark de Bruijn 2008 -> kramieb at gmail dot com
(function($){$(function() {
	
	$("body").addClass("js");
	var middle = $("#middle");
	var content = $("#content");
	children = $("#content > div");
	children.hide();	
	var visible = null;	
	function show(id) {
		var oldid = visible.attr("id");
		if(id == oldid) { return; } 
		visible.hide();
		visible = $('#' + id).show();		
	}
	
	var menuItems = middle.find("#sidebar > ul > li > a");
	menuItems.click(function() {
		id = $(this).attr("href").replace(/^#/, '');
		show(id);
		$.history.add(id);
	});
	visible = $(menuItems.filter(".main").attr("href")).show();
	$(".lightbox").each(function() {
		$(this)
			.children()
			.children()
			.lightBox();
	});
	
	
	$.history.init(function(id) {
		show(id);
	});
})})(jQuery);