$(document).ready(function(){
	$("#expander").hide();
	$("#expanderBtn").click(function(){
		if ($("#expander").css("display") == "none"){
			$("#expander").slideDown('slow');
			$("#expanderBtn").html("Show Less")
		}else{
			$("#expander").slideUp('slow');
			$("#expanderBtn").html("Show More")
		}
	});	
	$('#mainNav > li').bind('mouseover', mainNav_open);
	$('#mainNav > li').bind('mouseout',  mainNav_timer);
});
	
var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

function mainNav_open()
{	mainNav_canceltimer();
	mainNav_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
	}

function mainNav_close()
{	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}

function mainNav_timer()
{	closetimer = window.setTimeout(mainNav_close, timeout);}

function mainNav_canceltimer()
{	if(closetimer)
	{	window.clearTimeout(closetimer);
		closetimer = null;}}


document.onclick = mainNav_close;


