$(document).ready(function() 
{
			// 	put all your jQuery goodness in here.
			// 265 wo content
	ch = $('#content').height();
	wh = $(window).height();
			
	if(wh > (ch+265))
	{
		$('#content').height(wh-325);
	}
		
	counter = 0;
	$('#access li').each
	(
		function(i) 
		{ 
			if(this.parentNode.className != 'children')
			{
				// head item
				this.id = 'menu_item_' + counter;
				this.onmouseover = function()
				{
					is_expanded = true;
					show_submenu(this.id);
				}
				this.onmouseout = function()
				{
					is_expanded = false;
					setTimeout("hide_submenu()", 700);
				}
				counter++;
			}
			
		}
	);

});

	//jQuery.each('#menu', 'li', function() { alert('f'); });//
//jQuery.each(i, 'li', function() {alert(i)});
	
	
	
var is_expanded = false;
function show_submenu(element)
{
	$('#access ul').each
	(
		function(i) 
		{ 
			if(this.className == 'children')
			{
				if(this.parentNode.id == element)
				{
					this.style.display = 'block';
					this.onmouseover = function()
					{
						show_submenu(this.parentNode.id);
						is_expanded = true;
					}					
				}
				else
				{
					this.style.display = 'none';
				}
			}
		}
	);	
}

function hide_submenu()
{
	if(!is_expanded)
	{
		show_submenu(false);
	}
}
