$(document).ready(function() {
	
	$("#header ul.top-nav").hover (function () {
		$(this).fadeTo("fast", 0.95);
		},
		function () {
		$(this).fadeTo("fast", 0.5);
		}
	);
	
	$("#header ul.top-nav li").hover (
		function () {
		//$("#header ul.top-nav").fadeTo("fast", 0.9);
		//$(this).find("ul").css('opacity', 0);
		// $(this).find("li").css("display", "block");
		//alert ($('ul', $(this)).html());
		//$(this).next().fadeIn();
		$(this).find("ul").css("opacity", 0);
		$(this).find("ul").show();
		if ($.browser.msie) {
			$(this).find("ul").fadeTo("fast", 0.9);
		} else {
			$(this).find("ul").fadeTo("fast", 1);
		}
		
		//$("#header ul.top-nav").("opacity", 0.9);
		}, 
		function () {
			$(this).find("ul").fadeOut("fast");
		}
	);
	
	$("a.external").click(function () {
		this.target = "_blank";
	});
	
	$("a.print").click(function () {
		window.print();
	});
	
	$(".buttonback").click(function () {
		history.back();
	});
	
	$('a.mailto').click( function() {
		$(this).attr('href', 'mailto:' + $(this).attr('title').replace(/\[at\]/, '@'));
	} );
	
})