$(document).ready(function() {
	
	$("#menu a, #header .knobs div").mouseover( function() {
		var classname = $(this).get(0).className;
		$("body").addClass(classname);
	});
	
	$("#menu a, #header .knobs div").mouseout( function() { 
		var classname = $(this).get(0).className;
		$("body").removeClass(classname);
	});

	// confusing rotating doors
	// middleground = right, background = middle
	
	var section = $('body').attr('id'); // current section
	var middleground = (section == 'inklings') ? 'images' : (section == 'installations') ? 'inklings' : 'installations';
	var background = (section == 'inklings') ? 'installations' : (section == 'installations') ? 'images' : 'inklings';
	
	$('#header div.middleground').hover(function() {
		$('body').addClass(middleground);
	}, function() {
		$('body').removeClass(middleground);
	}).click(function() {
		url = (true) ? '/door/' + middleground + '/': '/';
		window.location.href = url;
	});
	

	$('#header div.background').hover(function() {
		$('body').addClass(background);
	}, function() {
		$('body').removeClass(background);
	}).click(function() {
		url = (true) ? '/door/' + background + '/' : '/';
		window.location.href = url;
	});
	

});
