function initMenu(path) {
	
	$('#menu ul').hide();
	
	if (path)
     	$('#menu a[@href$="' + path + '"]').attr('class', 'selected');
		
	$('#menu a.selected').parents('li').parents('ul').show();
	
	//$('#menu a.selected').parents('li').parents('ul').slideDown('slow');
	
	if ($('#menu a.selected').parents('li').children('ul').length > 0) {
		//$('#menu a.selected').parents('li').children('ul').slideDown('slow');
		$('#menu a.selected').parents('li').children('ul').show();
	}
	
	$('#menu li.link a').click (
		function(event) {
			event.preventDefault();
			var linkPath = this.href;
			
			if ($('#menu li.category ul:visible').length > 0) {
				$('#menu li.category ul:visible').slideUp('slow', 
					function() {
						window.location = linkPath;
					}
				);
			} else {
				window.location = linkPath;	
			}
		}
	);
	
	$('#menu li.category a').unbind('click');
	
	$('#menu li.category a').bind('click', 
		function(event) {
			event.preventDefault();
			var linkPath = this.href;
			
			if ($('#menu li.category ul:visible').length > 0) {
				$('#menu li.category ul:visible').slideUp('slow');
				$(this).parents('li').children('ul').slideDown('slow',
					function() {	
						window.location = linkPath;
					}
				);
			} else {
				//window.location = linkPath;	
				$(this).parents('li').children('ul').slideDown('slow',
					function() {	
						window.location = linkPath;
					}
				);
			}
		}
	);
	
	$('#menu li.category ul li a').unbind('click');
	
	$('#menu li.category ul li a').click (
		function(event) {	
			event.preventDefault();
			var linkPath = this.href;
			var target = $(this).attr('target').length
			if ( target > 0) {
				window.open(linkPath);
			} else {
				//$('#menu li.category ul:visible').slideUp('slow', 
					//function() {
						window.location = linkPath;
					//}
				//);
			}
		}
	);
	
	$('#scrollPane a, #privacy a').click (
		function(event) {
			event.preventDefault();
			var linkPath = this.href;
			var target = $(this).attr('target').length;
			
			if ( target > 0) {
				window.open(linkPath);
			} else {
				if ($('#menu li.category ul:visible').length > 0) {
					$('#menu li.category ul:visible').slideUp('slow', 
						function() {
						}
					);
					var hostlen = location.hostname.length + 7; //added 7 for 'http://'
					var linkPath2 = linkPath.substr(hostlen);
					$('#menu a[@href$="' + linkPath2 + '"]').attr('class', 'new-selected');
				
					$('#menu a.new-selected').parents('li').parents('ul').slideDown('slow',
						function () {
							$(this).delay(800,function() {
								window.location = linkPath;
								return false;
							});
						}
					);
				} else {
					window.location = linkPath;	
				}
			}
		}
	);
	
	$('#scrollPane a.same-category').unbind('click');
	
	$('#scrollPane a.same-category').click (
		function(event) {
			event.preventDefault();
			var linkPath = this.href;
			window.location = linkPath;
		}
	);
}

