//detect MSIE
var isIE=false;
if(navigator.userAgent.toString().toUpperCase().indexOf("MSIE")!=-1){isIE=true;} //first detect
isIE=(isNaN(window.innerWidth))?true:false; //second detect

function GetDocumentFileName(DocLocation){
	var CurDocLocation=DocLocation;
	var CurrentFileName='';
	var LastSlashIndex1M;
	var LastSlashIndex2M;
	var LSl="\\";
	var RSl="\/";
	eval("LastSlashIndex1M=(window.top."+CurDocLocation+".document.location.toString()).lastIndexOf(LSl)");
	eval("LastSlashIndex2M=(window.top."+CurDocLocation+".document.location.toString()).lastIndexOf(RSl)");
	var LastSlashIndexM=Math.max(LastSlashIndex1M,LastSlashIndex2M);
	eval("CurrentFileName=(window.top."+CurDocLocation+".document.location.toString()).substr(LastSlashIndexM+1)");
	return CurrentFileName;
}

function SetNone() {
	window.top.menu.HeldButton='';
	window.top.menu.document.getElementById("ButEve").style.visibility='visible';
	window.top.menu.document.getElementById("ButRech").style.visibility='visible';
	window.top.menu.document.getElementById("ButReso").style.visibility='visible';
	window.top.menu.document.getElementById("ButGall").style.visibility='visible';
	window.top.menu.document.getElementById("ButLink").style.visibility='visible';
	window.top.menu.document.getElementById("ButEveP").style.visibility='hidden';
	window.top.menu.document.getElementById("ButRechP").style.visibility='hidden';
	window.top.menu.document.getElementById("ButResoP").style.visibility='hidden';
	window.top.menu.document.getElementById("ButGallP").style.visibility='hidden';
	window.top.menu.document.getElementById("ButLinkP").style.visibility='hidden';
}

function SetMenu(StatusToSet) {
	SetNone();
	if(isIE){
		switch (StatusToSet) {
			case "Events" :
				window.top.menu.HeldButton=window.top.menu.document.getElementById("ButEve");
				window.top.menu.document.getElementById("ButEve").style.visibility='hidden';
				window.top.menu.document.getElementById("ButEveP").style.visibility='visible';
				break;
			case "Researches" :
				window.top.menu.HeldButton=window.top.menu.document.getElementById("ButRech");
				window.top.menu.document.getElementById("ButRech").style.visibility='hidden';
				window.top.menu.document.getElementById("ButRechP").style.visibility='visible';
				break;
			case "Resources" :
				window.top.menu.HeldButton=window.top.menu.document.getElementById("ButReso");
				window.top.menu.document.getElementById("ButReso").style.visibility='hidden';
				window.top.menu.document.getElementById("ButResoP").style.visibility='visible';
				break;
			case "Gallery" :
				window.top.menu.HeldButton=window.top.menu.document.getElementById("ButGall");
				window.top.menu.document.getElementById("ButGall").style.visibility='hidden';
				window.top.menu.document.getElementById("ButGallP").style.visibility='visible';
				break;
			case "Links" :
				window.top.menu.HeldButton=window.top.menu.document.getElementById("ButLink");
				window.top.menu.document.getElementById("ButLink").style.visibility='hidden';
				window.top.menu.document.getElementById("ButLinkP").style.visibility='visible';
				break;
		}
	}
}
