var menu_timeout = null;
$('document').ready(function(){
	$('div.header>ul>li>a>img').each(function(){
		$('<img>').attr('src', $(this).attr('src').replace('_off','_on'));
	});
	$('div.header>ul>li').hover(
		function() {
			var new_src = $(this).find('.over').attr('src').replace('_off','_on');
			$(this).find('.over').attr('src', new_src);
			if (menu_timeout) {
				clearTimeout(menu_timeout);
			}
			$('div.header>ul>li>ul').fadeOut();
			$(this).find('ul').fadeIn();
		},
		function() {
			if (!$(this).hasClass('current')) {
				var new_src = $(this).find('.over').attr('src').replace('_on','_off');
				$(this).find('.over').attr('src', new_src);
			}
			var t = this;
			menu_timeout = setTimeout(function(){$(t).find('ul').fadeOut();}, 500);

		}
	);
/*	$('div.header>ul>li>ul>li>a').hover(
		function() {
			$(this).find('img').fadeIn('fast');
		},
		function() {
			$(this).find('img').fadeOut('fast');
		}
	);
*/
	$('a.external').click(function(){
		window.open(this.href);
		return false;
	});
	$('.question h2').click(function() {
		if (!$(this).parent().find('.content').is(':visible')) {
			$('.question .content').slideUp('fast').removeClass('visible');
			$(this).parent().find('.content').slideDown('fast');
		}
	});
});