/* ================================================================== */
/* retrieve an XML "instrument" descriptor file. This is an XML file with a particular structure (see lookupNodeVar for details)
Will read the "ith" array element from instList, where instList is created by displayInstrumentTable.
Typically, this is called after a click on a link.
After reading XML file (using ajax), extract the name and description nodes.
*/
function getInstrumentDescription(ith,ido) {
var uu0,uu,tm2;
var aname,adesc,iname,idesc,icurrent,tmp,isessid ;
if (arguments.length<2) ido=0 ;
if (ido==0) {
var toget=getInstrumentURL+instList[ith];
Get_xmlFile(toget,'instNode','retrieving xml instrument file ','getInstrumentDescription',ith,2,instList[ith]) ;
return 0;
}
if (ido==2) {
currentInst=ith ; // set the current instrument global
instName= strip(lookupNodeVar(instNode,'name'));
instDesc= lookupNodeVar(instNode,'DESCRIPTION');
idesc=document.getElementById('selectedInstrumentDesc');
idesc.innerHTML=instDesc;
icurrent=document.getElementById('currentInst');
tmp=instList[ith].replace(/\..*/,'');tmp=makeProjName(tmp);
// icurrent.setAttribute('value',instList[ith].replace(/\..*/,''));
icurrent.setAttribute('value',tmp);
icurrent.style.color='darkred';
icurrent=document.getElementById('currentInst2');
isessid=document.getElementById('sessionName');
if (isessid) isessid.style.backgroundColor='#fefefe';
isessid=document.getElementById('sessionProject');
if (isessid) isessid.style.backgroundColor='#fefefe';
uu0=instList[ith].replace(/\..*/,'')
uu=extractProjectName(uu0);
tmp2=makeProjName(uu0);
icurrent.innerHTML=' '+makeProjName(tmp2)+' ';
iname=document.getElementById('selectedInstrumentName');
iname.innerHTML=''+makeProjName(instName)+'' ;
// supress readonly on sessionName (if it exists)
tmp=document.getElementById('sessionName');
if (tmp) {
tmp.setAttribute('readOnly',false);
tmp.readOnly=false;
if (tmp.title==''){
tmp.title='Enter session name here ';
tmp.setAttribute('title','Enter session name here ');
}
}
// supress readonly on sessionProject (if it exists)
tmp=document.getElementById('sessionProject');
if (tmp) {
tmp.setAttribute('readOnly',false);
tmp.readOnly=false;
if (tmp.title==''){
tmp.title="Enter the session's project here ";
tmp.setAttribute('title',"Enter the session's project here ");
}
tmp.value=uu[1];
}
tmp=document.getElementById('doit');
if (tmp) {
tmp.setAttribute('readOnly',false);
tmp.readOnly=false;
tmp.title='Click here to create the new session ';
tmp.setAttribute('title','Click here to create the new session ');
}
return 1 ;
}
}