
	//  functions to show and hide the dropdown menu
	
	function Flow_ShowMenu(pThis) {
		$(pThis)
			.next().css( {'visibility': 'visible'} )
			.css( {'left': $(pThis).position().left + 'px' } );
	}
	
	function Flow_HideMenu (pThis, pEvent) {
		xSubMenu = $(pThis).next();
		if ((pEvent.pageY < xSubMenu.offset().top) || (xSubMenu.children().length == 0)) {
			$(pThis)
				.next().css( {'visibility': 'hidden'} );
		} 
	}
	
	function Flow_HideSubMenu(pThis) {
		$(pThis)
			.css( {'visibility': 'hidden'} );
	}
	

	$(window).load(function(){ 

		// attach functions to event handlers to the menu anchors 
		$('#menu div').each(function() {
				$(this)
					.mouseleave(function() {Flow_HideSubMenu(this) } )
					.prev()
					.mouseenter(function () { Flow_ShowMenu(this) } )
					.mouseleave(function(event) { Flow_HideMenu(this, event) } );
		});


	});
	


