/*	Small script to handle the dropdown menu for RSS button.
		I'm not gonna claim copyright, as it is a mixture of a couple scripts I found.
		Feel free to use as you wish.
*/
var menuitem = 0;
var closetimer	= 0;
var timeout	= 0; //how long after moving the cursor away should the popup be visible, time in milliseconds

function showContent(d) {
	if(d.length < 1) { 
		return; 
	}
	// close old layer
	if(menuitem) menuitem.style.display = 'none';
	if (closetimer != 0) { //if you have opened the menu, don't close until you completely move away from it
		window.cancelCloseTimer();
	}
	menuitem = document.getElementById(d);
	menuitem.style.display = "block";
}

//count down to close
function closeTimer(t) {
	if(t > 0) {
		timeout = t;
	}else{
		timeout = 200;
	}
	closetimer = window.setTimeout(hideContent, timeout);
	timeout = 0;
}

//stop the count down to close if you just moved to the submenu
function cancelCloseTimer()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

function hideContent() {	
	if(menuitem) { 
		menuitem.style.display='none';		
	}
}


