/*-----------------------------------------------------------+
|  This function reveals or hides submenu from the menu bar  |
+-----------------------------------------------------------*/
function MenuShowHide(SubMenuId,State){
	
	// If State is 'show' this is mouseover event; always expend submenu
	if (State == "show"){
		document.getElementById(SubMenuId).style.display = "block";
	}
	else{	// this is an onclick event
		// Let's get the status: are we collapsed or expanded?
		SubMenuState = document.getElementById(SubMenuId).style.display;
		
		// Now collapse if we are expanded or expand if we are collapsed
		if(SubMenuState == 'none'){
			document.getElementById(SubMenuId).style.display = "block";
		}
		else{
			document.getElementById(SubMenuId).style.display = "none";
		}
	}
}

/*--------------------------------------------------------------------------------------+
|  This function ask the visitor whether to open an external link in a separate window  |
+---------------------------------------------------------------------------------------*/
function OpenExternalLink(TheLink){
//	alert(TheLink);
	if(confirm("Open the link in a separate window?")){
		window.open(TheLink);
	}
	else{
		location.href = TheLink;
	}
}