/* Template Housekeeping (requires jQuery) */

$(document).ready(function()
{
	/* Dropdown menus */
	
	$("#header li").mouseover(function() {
		$(this).addClass("hover");
	}).mouseout(function() {
		$(this).removeClass("hover");
	});
	
	/* Making them keyboard accessible (based off of http://carroll.org.uk/sandbox/suckerfish/bones2.html */
	
	$("#header a").each(function() {
		$(this).focus(function() {
			$(this).parent().addClass("hover");
			$(this).parents("li").addClass("hover");
		});
		
		$(this).blur(function() {
			$(this).parent().removeClass("hover");
			$(this).parents("li").removeClass("hover");
		});
	});

	SetupPictureThis();

});

function SetupPictureThis ()
{
	$("#picture-this .next a, #picture-this .previous a").click(function(event)
	{
		var link = $(this).attr("href").split('?');
		$.get("picture-this/?" + link[1], function(data)
		{
			$("#picture-this").replaceWith(data);
			SetupPictureThis();
		});
		
		return false;
	});
}