var dom=document.getElementById;
if (dom){ //if not modern dom based browser then do not execute any Java Script
	var ObjMenuPos=window.top.document.getElementById("MenuPos");
	var ObjSubMenuPos=window.top.document.getElementById("SubMenuPos");
}

function SelectAssayMenu(pLink){
	if (!dom) return //not modern browser then do not execute script
	var TextNode=window.top.document.createTextNode(pLink);
	ObjMenuPos.innerHTML="Catalogue";
	ObjSubMenuPos.innerHTML=pLink;
	window.top.document.getElementById("ScrollFlag").innerHTML="false";
	window.top.document.getElementById("BoxMenu").style.color="#e40059";
	AssayNewObj=window.top.document.getElementById(pLink);
	ChangeSelection(false,AssayNewObj);
}

function ChangeMenu(pLink){
	if (!dom) return //not modern browser then do not execute script
	OldObj=(ObjMenuPos.innerHTML!="") ? window.top.document.getElementById(ObjMenuPos.innerHTML) : false; 
	NewObj=window.top.document.getElementById(pLink);
	ChangeSelection(OldObj, NewObj);
	ObjMenuPos.innerHTML=pLink;
}

function ChangeSelection(pOld, pNew){
	var label
	if (pOld){
		a=findchild(pOld,"#text");
		a.nodeValue="";
		a=findchild(pOld,"A");
		a.style.display="inline";
	}
	if (pNew){
		a=findchild(pNew,"A");
		label=a.innerHTML
		a.style.display="none";
		a=findchild(pNew,"#text");
		if (a)
			a.nodeValue=label;
		else{
 			var TextNode=document.createTextNode(label);
			pNew.appendChild(TextNode);
		}
	}
}

function findchild(obj,tag){
	cn=obj.childNodes;
	for (k=0; k<cn.length; k++){
		if (cn[k].nodeName==tag) return cn[k];
	}
	return false;
}


