var activeID, activeMenu, activeLink;
var gecko = (navigator.product == ('Gecko'))
var ie = (document.all)? true:false;
var jssection = "";
var popWin;
function showMenu(theLink, menuName) {
	var menuObj = document.getElementById(menuName);
	if (activeID) {
		clearTimeout(activeID);
		hideMenu(activeMenu);
	}
	activeLink = theLink;
	activeLink.className = "hover";
	var winW = (gecko)? window.innerWidth-16 : document.body.offsetWidth-20;
	menuObj.style.top = '100px';
	if(theLink.offsetLeft >650) {		
		menuObj.style.left = theLink.offsetLeft + -73 + 'px';
	} else {
		menuObj.style.left = theLink.offsetLeft + -2 + 'px';
	}	
	//menuObj.style.display = "block";
	menuObj.style.visibility = 'visible';
}

function startHide(menuName) {
	activeMenu = menuName
	
	activeID = setTimeout("hideMenu('" + menuName + "')", 360);
	
}

function hideMenu(menuName) {
	var menuImg = menuName.substr(4, menuName.length);
	var swapSource = menuImg.toLowerCase();
	if(swapSource != jssection) {
		swapImage(swapSource, swapSource+'_off');
	}
	var menuObj = document.getElementById(menuName);
	activeLink.className = "";
	//menuObj.style.display = "none";
	menuObj.style.visibility = 'hidden';
}

function swapImage(imgName,swapSrc, drop) {
	//eval("document." + imgName + ".src = \"http://www.medimmune.com/images/misc/menu/" + swapSrc + ".gif\"");
	eval("document." + imgName + ".src = \"images/" + swapSrc + ".gif\"");
	var dropSource  = document.getElementById(drop);
}

function checkQuery(){
	if(!document.searchform.query.value){
		return false;
	}
	return true;
}

function showResource(URL) {
	popWin = window.open(URL, 'resourceWin');
	popWin.focus();
}
