/*
(C) MeloNet Internet Consultancy, 2006
http://www.melonet.co.uk
This notice may not be removed from the source code.
*/

//alert('test');

/* DropDown Globals */
var g_menu_timer = 0;		/* The timer ID */
var g_current = "";		/* The ID of the currently selected item*/
var g_dropdown = false;		/* Is there a dropdown currently visible */
var g_oldhoverimage = "";	/* If its a hoverimage then this is the previous image */
var g_oldtextcolor = "";	/* If its hover text then this is the previous colour */
var g_oldbgcolor = "";	/* If its hover text then this is the previous colour */

function showMenu(id,newim,drop) 
{
	//alert('1');
	if( id!=g_current )
	{
		if(g_current!="")
		{
			clearMyTimer();
			hide();
		}

//alert('2');
		if(drop==1)
		{
			var d = document.getElementById(id);
			d.style.display = 'block';
			g_dropdown=true;
		}
		//alert('3');
		g_current = id;

		
	}
	else
	{
		clearMyTimer();
	}
}


function clearMyTimer()
{
	if(g_menu_timer!=0)
	{
		clearTimeout(g_menu_timer);
		g_menu_timer=0;
	}
}


function shide()
{
	//alert('10');
	if(g_menu_timer==0)
	{
		if(g_current!="")
		{
			g_menu_timer=setTimeout( 'hide()', 600 );
		}
	}
}


function hide()
{
	clearMyTimer();
	
	if(g_current!="")
	{
		if(g_dropdown)
		{
			var d = document.getElementById(g_current);
			d.style.display='none';
			g_dropdown=false;
		}



		g_current = "";
	}
}
