jQuery(document).ready(function($) {





		// We might arrive at the site with a hash already in the URL.
		if(window.location.hash == "" || window.location.hash == "#") {
			// Do nothing; we can load normally.
		} else {
			var desiredArticle = window.location.hash;
			$(".pompous").hide();
			$(".showcase").show();
			$(".showcase article").hide();
			$(".showcase article#" + desiredArticle ).show();
		}

		

		// Close-the-Panel functionality
		if($(".closeShowcase").length != 0) {
			$(".closeShowcase").click(function(){
				$(".showcase").fadeOut(300, function(){
					window.location.href = "#";
					$(".pompous").fadeIn(300);
				});
			});
		}



	
		// Existence check
		if($(".roadmap a").length != 0) {



			// Round up all the strictly-internal links -- no outbound or binary ones
			var internalLinks = $(".roadmap section > ul > li").not(".social").find($("a").not(".binary"));

			// Click events on internal links
			$(internalLinks).each(function(){
				$(this).click(function(){

					var desiredAnchor = $(this).attr("href");
					
					if($(".pompous").is(":visible")) {

						// We're starting from the home screen.
						$(".pompous").fadeOut(400, function(){
							$("html,body").animate( { scrollTop: 0 }, 0 );
							$(".showcase article").hide();
							$(".showcase article#" + desiredAnchor).show();
							$(".showcase").fadeIn(400);
						});

					} else {

						// We're starting from an existing article.
						$(".showcase").fadeOut(300, function(){
							$("html,body").animate( { scrollTop: 0 }, 0 );
							$(".showcase article").hide();
							$(".showcase article#" + desiredAnchor).show();
							$(".showcase").fadeIn(300);
						});

					}

				});
			});




		} // end existence check




		// Cosmetic Ephemera
		var colophonLink = $(".roadmap a[href='#colophon']").parent("li");
		$(colophonLink).addClass("colophon");



		// Markup validation is good.
		// HTML5 is good.
		// RDFa (for Open Graph) is good.
		// But the W3c doesn't know how to validate RDFa in HTML5.
		// ow ow ow ow ow
		/*
		var ogTitle = "<meta property=\"og:title\" content=\"Jon White\" />";
		var ogType = "<meta property=\"og:type\" content=\"website\" />";
		var ogUrl = "<meta property=\"og:url\" content=\"http://jonwhitestudio.com/\" />";
		var ogImage = "<meta property=\"og:image\" content=\"http://jonwhitestudio.com/media/jw-opengraph.jpg\" />";
		var ogDesc = "<meta property=\"og:description\" content=\"The portfolio of front-end developer, designer, and educator Jon White.\" />";
		var ogSitename = "<meta property=\"og:site_name\" content=\"Jon White\" />";
		var ogLocality = "<meta property=\"og:locality\" content=\"Washington\" />";
		var ogRegion = "<meta property=\"og:region\" content=\"DC\" />";
		var ogEmail = "<meta property=\"og:email\" content=\"jon@jonwhitestudio.com\" />";

		$("head")
			.prepend(ogTitle)
			.prepend(ogType)
			.prepend(ogUrl)
			.prepend(ogImage)
			.prepend(ogDesc)
			.prepend(ogSitename)
			.prepend(ogLocality)
			.prepend(ogRegion)
			.prepend(ogEmail);
		*/
		// ...You know, on second thought, I'm just going to wait on this for the W3C to pick it up.
		// Just not worth it.





});
