// code for navigation
$(document).ready(function() {
	$(".nav").ready(function() { // scan the page for any navigations
		$(".sub").toggle(); // hide the sub menus
		$(".sub").parent().mouseover(function(){
			$(this).children(".sub").toggle(); // show the sub menu
		});

		$(".sub").parent().mouseout(function(){
			$(this).children(".sub").toggle(); // hide the sub menu
		});
	});	

	if (window.inAction != true){
	
			$(".tests-box-internal a").hover(
				function ()
				{
					$(this).find("em")
						.stop()
						.animate({"left":65, opacity:1},300)
					;
				}
				,
				function ()
				{
					$(this).find("em")
						.stop()
						.animate({"left":25, opacity:0},300)
					;
				}
			);
	
	}

	
	

	$("ul.test-list").find('p').hide(); // hide the descriptions

	
	var strLocation = '';

	/* This method checks for changes in the location */
	var fnCheckLocation = function(){
		if (strLocation != window.location.href){
			strLocation = window.location.href;
			$(window.location).trigger("change");
		}
	}
	
	/* Set an interval to check the location */
	setInterval(fnCheckLocation, 100);


	$(window.location).bind(
		'change',
		function(){
			if (window.location.hash.length != 0) {
				$(".test-list li p:visible")
					.hide()
					.parent("li")
						.removeClass("activated")
				;
				
				$(".test-list li > a[name=" + window.location.hash + "]")
					.siblings('p')
						.show()
						.parent("li")
							.addClass("activated");	
				;
			}
		}
	);

	

	
});