$(function() {
	$('#navigation .head').click( function() { return false; });
	if (!$.browser.msie) $('#navigation .section > .container').css('opacity', 0.8);
	
	var current = $('#navigation a').not('.head').filter(function() { return location.href.indexOf(this.href) != -1; });
	
	if (current.size()) {
		current.addClass('current');
		current.parents('div.section, div.subSection, div.container').addClass('selected').children('.head').addClass('current');
	}
	
	function close(e) {
		$('> .container', e).slideUp(150);
	}
	
	var timers = new Array();
	
	$('#navigation .section, #navigation .subSection').hover(
		function() {
			var e = this;
			clearTimeout(timers[$(e).attr('id')]);
			$('> .container', e).slideDown(150);
		},
		function() {
			var e = this;
			timers[$(e).attr('id')] = setTimeout(function() { close(e); }, 500);
		}
	);
});