
var txtBoxWithFocus = 'firstKeyword';  

function select2(text){
document.getElementById(txtBoxWithFocus).value=text;
}

function WhoHasFocus(txt){  
  txtBoxWithFocus = txt;
}

function ShowHide(divname, show){
	mydiv = document.getElementById(divname);
	mydiv.style.display = show; //to hide it
}

function SwitchList(){
	var linktext = document.getElementById("listlink").innerHTML;;
	var thelink = document.getElementById("listlink");
		
	switch(linktext){
		case "View Instrument List":
			thelink.innerHTML="View Keyword List";
			ShowHide('keywords1', 'none');
			ShowHide('keywords2', 'none');
			ShowHide('instruments1', 'block');
			ShowHide('instruments2', 'none');
			break;
		case "View Keyword List":
			thelink.innerHTML="View Instrument List";
			ShowHide('keywords1', 'block');
			ShowHide('keywords2', 'none');
			ShowHide('instruments1', 'none');
			ShowHide('instruments2', 'none');
			break;
	}
}

