
function initMenus() {
	$('ul.menu ul').hide();
	var path=document.location.pathname;
	if ( path.match("fulfillment") )
	{
		$('#fulf').slideDown('normal');	
	}
	if ( path.match("rebates") )
	{
		$('#reba').slideDown('normal');	
	}
	if ( path.match("promotional") )
	{
		$('#prom').slideDown('normal');	
	}
	if ( path.match("pipeline") )
	{
		$('#pipe').slideDown('normal');	
	}
	if ( path.match("printing") )
	{
		$('#prin').slideDown('normal');	
	}
	if ( path.match("program_management") )
	{
		$('#prog').slideDown('normal');	
	}
	if ( path.match("distribution") )
	{
		$('#dist').slideDown('normal');	
	}
	if ( path.match("technology") )
	{
		$('#tech').slideDown('normal');	
	}
	$.each($('ul.menu'), function(){
		//$('#' + this.id + '.expandfirst ul:first').show();
		//$(’#’ this.id ‘ .expand ul’).show();
	});
	$('ul.menu li a').click(
		function() {
			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;

			if($('#' + parent).hasClass('noaccordion')) {
				$(this).next().slideToggle('normal');
				return false;
			}
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				if($('#' + parent).hasClass('collapsible')) {
					$('#' + parent + ' ul:visible').slideUp('normal');
				}
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
}
$(document).ready(function() {initMenus();});
