// JavaScript Document
/* <![CDATA[ */

jQuery(document).ready(function(){
	
	//	Description block code
	$(".description_show").hover(function(){
		var img = $(this).attr("title");
		img = img.replace( " ", "");
		img = img.toLowerCase();
		$("#" + img + "_heading").css("color", "#ff9933");
	},
	function(){
		var img = $(this).attr("title");
		img = img.replace( " ", "");
		img = img.toLowerCase();
		$("#" + img + "_heading").css("color", "#666");
	});
	
	var current_top_selection = "";
	
	$(".description_show").click(function(event){
		event.preventDefault();
		var display = $("#content").css("display");
		var query = $(this).attr("title");
		var img = query.replace( " ", "");
		img = img.toLowerCase();
		$("#content").slideUp(400, function() {
			if( ( display != "block" || current_top_selection != query ) && window.location.hash != '#' + query ) {
				$.ajax({
					url		: "external.php",
					data	: "key=" + query,
					success	: function(data) {
						$("#content").html(data);
						$("#content").slideDown(400);
						current_top_selection = query;
						window.location.hash = query;
					}
				});
			} else {
				window.location.hash = '';
			}
		});
	});
	
});

/* ]]> */
