function addASPSessionID(u){if(theFrames.WV>=3 && theFrames.WV<=4){var IS='/IS='+theFrames.ASPSessionID;u=addToUrl(u,IS);if(dbg1){debug(IS+' added to URL request');}
}
return u;}
function addToUrl(url,tok){var t=tok.split('=');t[0]+='=';var tv=GetUrlParam(url,t[0]);if(tv==-1){var li='/LI=';var u=url.split(li)
return(u.length>1)?u[0]+tok+li+u[1]:u[0]+tok;}else{return changeUrlParam(url,t[0],t[1]);}
}
function amBusyMinusOne(){if(theFrames.amBusy==1){doEvents('onambusyend');}
if(--theFrames.amBusy>=0){if(dbg5){debug('() theFrames.amBusy='+theFrames.amBusy);}
if(theFrames.amBusy>0){return;}
doAlert();theFrames.LHAPonly=false;if(theFrames.TBSearchNext !=''){var scr='if(!isBusy()){theToolbar.buttonClick("'+theFrames.TBSearchNext+'", 1)}else{';scr+='setTimeout(\'theToolbar.buttonClick("' + theFrames.TBSearchNext + '",1);\',50);}';setTimeout(scr,50);theFrames.TBSearchNext='';}
if(theFrames.onclickWindowName=="RH_FRAME"){var images=theFrames.TOP.window.document.all.tags('IMG');var i;for(i=0;i<images.length;i++)
if(images[i].alt=='undefined'||images[i].alt==theMsgs.TOP_BTN_WAIT_MSG){images[i].alt=images[i].OrigAlt;}
}
document.all.LEFT_CTRL.rows='*,0';return;}
alert('Error theFrames.amBusy has gone negative ?');}
function amBusyPlusOne(){if(theFrames.amBusy==0){document.all.LEFT_CTRL.rows='*,'+working_h;}
theFrames.amBusy++;if(dbg5){debug('() theFrames.amBusy='+theFrames.amBusy);}
}
function areas_onclick(){if(isBusy()){return false;}
var e=theFrames.RH.event.srcElement
switch(GetUrlParam(e.href,'/AC=')){case 'BA':case 'CC':return hypertextSource_onclick();break;case 'AZ':loadCPforEvent('onbeforepopup','loadCP_document');if(!doEvents('onbeforepopup',e)){var ev=theFrames.RH.event;ev.returnValue=false;ev.cancelBubble=true;return;}
break;}
}
function bactrackobj_click(){theFrames.JS.bactrackobj_click();}
function changeUrlParam(url,tok,val){var tv=GetUrlParam(url,tok);var U=url.split(tok+tv);return(U.length>1)?U[0]+tok+val+U[1]:U[0]+tok+val;}
function CloseAllPopupWindows(){var tF=theFrames;while(tF.popupWindowHead !=false){theCurrentPopupWnd=tF.popupWindowHead.window;tF.popupWindowHead=tF.popupWindowHead.previous;theCurrentPopupWnd.myFrames.EN_exit=true;theCurrentPopupWnd.close();}
}
function deInit(){if(theFrames.initialised==true){if(theFrames.dbwin !=false && theFrames.dbwin.closed==false){theFrames.dbwin.close();}
CloseAllPopupWindows();return;}
}
var reFunc=/function\x20(\w*)/;function debug(text){if(typeof(theFrames) !='object'||typeof(theFrames.dbwin) !='object'){return;}
if(theFrames.dbwin.closed){return;}
var s=new Date();var t=s.toString().split(' ')[3]+'.';var ms='00'+String(s.getMilliseconds());t+=ms.substr(ms.length-3,3);var a=arguments.caller;var fn=(a!=null)?a.callee.toString().match(reFunc)[1]:'';a=(a!=null && a.caller !=a)?a.caller:null;var fnc=(a!=null)?a.callee.toString().match(reFunc)[1]:'';fnc=((fnc==null)||(fnc.length)==0)?'**EVENT** ':fnc+'() > ';theFrames.dbwin.document.writeln('<BR>'+t+' '+window.name+' - '+fnc+' '+fn+' '+text);theFrames.dbwin.scrollTo(0,screen.availHeight);if(theFrames.dbwinStop){if(confirm('Trace window was double clicked, select:\n\nOK to debug now.\nCancel to continue.')){debugger;}
theFrames.dbwinStop=false;}
}
function debug_ondblclick(){theFrames.dbwinStop=true;}
function display(Tags,display){var j=0;while(Tags[j].tagName !='BODY'){j++;}
for(++j;j<Tags.length;j++){Tags[j].style.display=display;}
}
function displayPopupWindow(){var tF=theFrames;var DN=GetUrlParam(theFrames.ModalTextSRC,'/DN=');if(DN !=-1 && DN.indexOf('.',0)>-1){var e=new Object;while(DN.indexOf('+')>-1){var dn=DN.split('+');DN=dn[0];var j;for(j=1;j<dn.length;j++){DN+='/'+dn[j];}
}
if(DN.indexOf('/')==-1){DN=theFrames.libVDir+DN;}
e.src=DN;e.scrollWidth=-1;theFrames.imageObject=e;var h=w=100;var posTop=0;var posLeft=0;var imgFile="TroveIMG.HTM";var bT31ADG=(theFrames.WV>=1 )?true:false;if(bT31ADG){posTop=(screenHeight-h)/2;posLeft=(screenWidth-w)/2;imgFile="TroveIMG2.HTM";}
window_open(path2statics+imgFile,null,'height='+h+',width='+w+',resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no,top='+posTop+',left='+posLeft+'');return;}
var screenPos=',top=0,left=0';tF.modalX=tF.modalY=0;var top=tF.lastRHClickY;var ll=tF.lastRHClickX+(screen.availWidth/4);var left=(ll<screen.availWidth)?tF.lastRHClickX:screen.availWidth-(screen.availWidth/4);screenPos=',top='+top+',left='+left;tF.modalY=top;tF.modalX=left;if(GetUrlParam(tF.ModalTextSRC,'/AC=')=='AL'){tF.TOPUpdated++;tF.RHUpdated++;if(!usingJoust){tF.NAVUpdated++;}
}
if(theFrames.popupWindowHead && theFrames.popupWindowHead.window.canReuse){theFrames.popupWindowHead.window.Update();}else{tF.popupWindowCount++;var windowName="PopUp"+tF.popupWindowCount;window_open(path2statics+'TrovePop.htm',windowName,popupParams+screenPos);}
}
function doAlert(){var s=theFrames.ModalTextSRC;if(s==''||s.toUpperCase().substr(0,4)=='HTTP'||s.toUpperCase().substr(0,1)=='/' ){return;}
if(isBusy()){setTimeout('doAlert();',50);return;}
if(debugging){debug(s);}
if(theFrames.searchinError){var shelvesSelected=(GetUrlParam(theToolbar.search.form.action,'/OS=') !=-1) &&(GetUrlParam(theToolbar.library_img.parentElement.href,'/ST=')=='ag');theFrames.stemmedSearch=stemthesearch(theToolbar.search.value.toLowerCase());switch(theFrames.stemphase){case 0:theFrames.unstemmedSearch=theToolbar.search.value.toLowerCase();if(theFrames.stemmedSearch !=theFrames.unstemmedSearch){var m=shelvesSelected?doAlertSubst(theMsgs.STEMNOHITS2,theFrames.unstemmedSearch,theFrames.stemmedSearch):doAlertSubst(theMsgs.STEMNOHITS1,theFrames.unstemmedSearch,theFrames.stemmedSearch);m+=doAlertSubst(theMsgs.STEMNOHITS3,theFrames.unstemmedSearch,theFrames.stemmedSearch);if(confirm(m)){theFrames.searchinError=false;doalertAlterSearch(theFrames.stemmedSearch);theFrames.stemphase=1;break;}else{doalertSelectSearch();theFrames.stemphase=0;break;}
}
case 1:if(shelvesSelected){var m=(theFrames.stemphase==0)?doAlertSubst(theMsgs.SHELFNOHITS1,theFrames.unstemmedSearch,theFrames.stemmedSearch):doAlertSubst(theMsgs.SHELFNOHITS1,theFrames.stemmedSearch,theFrames.stemmedSearch);m+=doAlertSubst(theMsgs.SHELFNOHITS2,theFrames.unstemmedSearch,theFrames.stemmedSearch);if(confirm(m)){theFrames.searchinError=false;theToolbar.search.form.action=RemoveUrlParam(theToolbar.search.form.action,'/OS=');setTimeout('theToolbar.search.form.submit()',100);theFrames.stemphase=2;break;}else{doalertSelectSearch();theFrames.stemphase=0;break;}
}else{alert(s);}
break;case 2:alert(s);}
}else{alert(s);}
theFrames.ModalTextSRC='';}
function FindSearchInputField(){var i=parent.frames.length;for(var j=0;j<i;j++){try{var o=parent.frames[j].document.all.searchtext;if(o.tagName=='INPUT'){return o;}
}
catch(e){}
}
}
function doalertAlterSearch(s){if(theFrames.customToolbar){var searchField=FindSearchInputField();searchField.value=s;}
theToolbar.search.value=s;setTimeout('theToolbar.search.go();',50);}
function doalertSelectSearch(){if(theFrames.customToolbar){var searchField=FindSearchInputField();searchField.select();}else{theToolbar.search.input.select();}
}
reSEARCHENTERED=/\{SEARCHENTERED\}/g;reSTEMMEDSEARCH=/\{STEMMEDSEARCH\}/g;function doAlertSubst(msg,searchentered,stemmedsearch){var m=msg.replace(reSEARCHENTERED,searchentered);return m.replace(reSTEMMEDSEARCH,stemmedsearch);}
function document_oncopy(){window.clipboardData.setData('Text',theMsgs.NoCopyMessage);return false;}
var titletext;var LHtitletext;function document_onbeforeprint(){switch(window.document.activeElement.id){case 'LH_FRAME':if(theFrames.LH.menuDIV){if(ControlledWebAccess){var t=theFrames.LH.document.all.tags('TITLE')[0];LHtitletext=t.text;t.text=theMsgs.NoPrintMessage;theFrames.LH.menuDIV.style.display='none';t.style.display='inline';}
}else{display(theFrames.LH.document.all,'none');}
default:var t=theFrames.RH.document.all.tags('TITLE')[0];titletext=t.text;t.text=theMsgs.NoPrintMessage;display(theFrames.RH.document.all,'none');t.style.display='inline';if(!theFrames.RH.noprintmessage){var oDIV=theFrames.RH.document.createElement("DIV");oDIV.id="noprintmessage";theFrames.RH.document.appendChild(oDIV);}
theFrames.RH.noprintmessage.innerText=theMsgs.NoPrintMessage;theFrames.RH.noprintmessage.style.display='inline';}
}
function document_onafterprint(){switch(window.document.activeElement.id){case 'LH_FRAME':if(theFrames.LH.menuDIV){if(ControlledWebAccess){var t=theFrames.LH.document.all.tags('TITLE')[0];t.text=LHtitletext
theFrames.LH.menuDIV.style.display='inline';}
}else{display(theFrames.LH.document.all,'inline');}
default:var t=theFrames.RH.document.all.tags('TITLE')[0];t.text=titletext
display(theFrames.RH.document.all,'inline');theFrames.RH.noprintmessage.style.display='none';}
}
function doEvents(eventName,obj){amBusyPlusOne();var rc=eval('theFrames.'+eventName+'(obj)');amBusyMinusOne();if(debugging){debug('EVENT:'+eventName+' return='+rc);}
return rc;}
function findNextSearchDocument(obj,fwd){var unreadMsg=theMsgs.LHS_UNREAD_NOHITS;if(theTree.firstHasHits==theTree.lastHasHits){var e=theMenu.entry[theTree.firstHasHits];if(e.TRVNoSearchUnread){alert(unreadMsg);return false;}
theTree.nid=e.id;return true;}
var URL=obj.href;var di=Number(GetUrlParam(URL,'/DI='));if(di==-1){di=Number(GetUrlParam(URL,'/DS='));}
var nid;var id=nid=theMenu.findEntry(di,'TRVDI','exact',0);var showdoc=false;do{nid=(fwd)?theMenu.entry[nid].nextItem:theMenu.entry[nid].prevItem;nid=(nid==-1)?(fwd)?theTree.firstHasHits:theTree.lastHasHits:nid;var e=theMenu.entry[nid];if(bdivShowAll){if(theFrames.bShowAllDocs){showdoc=e.TRVhasHits;}else{showdoc=(e.TRVisWithdrawn)?false:(e.TRVhasHits)?true:false;}
}else{showdoc=e.TRVhasHits;}
}while(id !=nid &&((showdoc==true && e.TRVNoSearchUnread==true)||(showdoc==false && e.nextItem !=-1 && e.nextItem !=id)))
if(id !=nid &&(showdoc==false)){return false;}
if(id==nid && theMenu.entry[theTree.firstHasHits].TRVNoSearchUnread){alert(unreadMsg);return false;}
theTree.nid=nid;return true;}
function findP(tr){if(dbg5){debug(tr.children.length);}
var o,oo,ooo,oooo,i,k,l;for(i=0;i<tr.cells.length;i++){oo=tr.cells[i];o=false;if(debugging){debug('e '+tr.cells[i].tagName);}
for(k=0;k<oo.children.length;k++){o=oo.children[k];if(debugging){debug(' f['+k+'] '+o.tagName);}
if(o.tagName=='P'){break;}
if(o.tagName=='TABLE'){for(l=0;l<o.rows.length;l++){ooo=o.rows[0];oooo=findP(ooo);if(oooo.tagName=='P'){o=oooo;break;}
}
if(o.tagName=='P'){k=oo.children.length;}
}
}
if(o && o.tagName=='P'){break;}
}
return o;}
function findParentP(o){var ot=o.tagName;if(ot !='TR' && ot !='P'){while(o.tagName !='BODY' && o.tagName !='TBODY'){if(debugging){debug('a -- '+o.tagName);}
o=o.parentElement;if(o.tagName=='P'){break;}
if(o.tagName=='TR'){break;}
}
}
if(debugging){debug('b -- '+o.tagName);}
if(o.tagName=='TR'){o=findP(o);}
return o;}
function Frames(){this.fixLevel='T40MFS';this.jsLevel='T40549';this.TROVETTLASPLevel='T40MFS';this.scriptinglevel;this.treelevel;this.dbwin=false;this.dbwinStop=false;this.initialised=false;this.LH=false;this.LH_href='';this.LHI=false;this.RH=false;this.RH_href='';this.RH_SrcElement=false;this.RHresizing=false;this.RHI=false;this.TOP=false;this.TOP_href='';this.NAV=false;this.NAV_href='';this.TRCTL=false;this.TRCTL_href='';this.JS;this.protocol;this.host;this.TOPdoc;this.LHUpdated=0;this.RHUpdated=0;this.TOPUpdated=0;this.NAVUpdated=0;this.TRCTLUpdated=0;this.TRCTLUsed=0;this.TLC=false;this.TLCsrc='';this.loadTSC=false;this.TSC=false;this.TSCsrc='';this.TFC=false;this.loadTFC=false;this.TFCsrc='';this.loadTDC=true;this.TDC=false;this.TDCsrc='';this.popupWindowHead=false;this.popupWindowCount=0;this.modalX=0;this.modalmX=0;this.modalY=0;this.modalClose=false;this.modalPopupJump=false;this.ModalTextSRC='';this.ModalButtonSRC='';this.imageObject;this.TOPheight=38;this.NAVheight=66;this.TRCTLheight=0;this.customToolbar=false;this.ToolbarInitalStatus=true;this.netscape=false;this.haveSelection=false;this.amBusy=0;this.keep_RH_FRAME=false
this.keep_TOP_FRAME=false
this.RHscrollTo=false;this.RHSync=true;this.NAVDI=false;this.NAVFI=false;this.NAVSearchClear=false;this.TRCTLBackTrackhref='';this.lastRHClickX=0;this.lastRHClickY=0;this.onclickWindowName='';this.refresh=0;this.splitterMode=0;this.SplitterPos;this.SplitterMinWidth=10;this.textAutoViewing=false;this.topwindow=(window.top==self)?true:false;this.RHLO=0;this.RHHypertextSource=null;this.RHIh=0;this.RHIvisible=true;this.RHIch=0;this.RHItitle="";this.searchinError=false;this.stemphase=0;this.unstemmedSearch='';this.title=""
this.libname;this.libVDir;this.currentFolder;this.XferDoc=0;this.bShowAll=false;this.bShowAllDocs=false;this.bFolderHasHits=false;this.folderOpenning=false;this.firstSearch=false;this.shelfScrollTo=-1;this.libMenu=false;this.lockoutPeriod=0;this.pendingFolderOpen=false
this.LHAPonly=false;this.delayRHframe=false;this.delayRHURI='';this.searching=false;this.ToolbarOnly=false;this.TBSearchNext='';this.remoteUser='';this.ASPSessionID=0;this.WV=0;this.lastDocumentDI='';this.NoPrintMessage='';this.NoCopyMessage='';this.usersCanPrint=true;this.delayedRHSync='';this.hideWithdrawnDocuments=true;this.SearchFromPA=-1;this.StyleSheetsFolder="";this.XferDlgUpdate=false;this.onbeforeshelfselect=function(){return true;}
this.onbeforeshelfdeselect=function(){return true;}
this.onbeforefolderopen=function(){return true;}
this.onbeforeacceptrevision=function(){return true;}
this.onexpandheading=function(){return true;}
this.onselectheading=function(){return true;}
this.onbuttonclick=function(){return true;}
this.onbeforehypertextlink=function(){return true;}
this.onbeforeexternalhypertextlink=function(){return true;}
this.onbeforepopup=function(){return true;}
this.onbeforeimagezoom=function(){return true;}
this.onsearchfocus=function(){return true;}
this.ondocumentdisplay=function(){return true;}
this.onnewdocumentdisplay=function(){return true;}
this.onbeforesearch=function(){return true;}
this.onbeforegotobookmark=function(){return true;}
this.onupdateframe=function(){return true;};this.onambusyend=function(){return true;}
this.onxmlnavload=function(u){return u;}
}
Frames.prototype.options=new TroveOptions;Frames.prototype.setupLockout=setupLockout;Frames.prototype.setLockoutTimer=setLockoutTimer;function GetMsgFromINI(libname,entryname,defaultmsg){var oXINI=GetTROVESYSINI();var msg=''
try{msg=oXINI.selectSingleNode('Trovesysini/Libraries[@Name="'+libname.replace(/\x20/g,'_')+'"]/Entry[@Name="'+entryname.toLowerCase()+'"]/@Value').value
}
catch(e){try{msg=oXINI.selectSingleNode('Trovesysini/Trove_webserver/Entry[@Name="'+entryname.toLowerCase()+'"]/@Value').value
}
catch(e){msg=defaultmsg;}
}
return msg.replace(/\\n/g,'\n');}
function GetStyleSheetsFolder(oXINI,iniKey){var ssFolder,startsWith;try{ssFolder=oXINI.selectSingleNode('Trovesysini/Libraries[@Name="'+theFrames.libname.replace(/\x20/g,'_')+'"]/Entry[@Name="'+iniKey.toLowerCase()+'"]/@Value').value;startsWith=ssFolder.charAt(0);if(startsWith=='\\'||startsWith=='/'){ssFolder=theFrames.libVDir+"WebServer/";}
else{ssFolder=theFrames.libVDir+ssFolder;}
}
catch(e){try{ssFolder=oXINI.selectSingleNode('Trovesysini/Trove_webserver/Entry[@Name="'+iniKey.toLowerCase()+'"]/@Value').value;startsWith=ssFolder.charAt(0);if(startsWith=='\\'||startsWith=='/'){ssFolder=theFrames.libVDir+"WebServer/";}
else{ssFolder=path2statics+ssFolder;}
}
catch(e){ssFolder=theFrames.libVDir+"WebServer/";}
}
if(ssFolder.charAt(ssFolder.length-1) !='/'){ssFolder+='/';}
return ssFolder;}
var bGetTROVESYSINI=false;var oXINI;function GetTROVESYSINI(){if(!bGetTROVESYSINI){oXINI=TROVESYSINI.XMLDocument;oXINI.async=false;oXINI.async=false;oXINI.load(theFrames.protocol+'//'+theFrames.host+path2statics+"trovesysini.asp")
bGetTROVESYSINI=true;}
return oXINI;}
function GetUrlParam(url,tok){var x=url.indexOf(tok,0);var y=url.indexOf('/',x+1);y=(y==-1)?url.length:y;return(x>0)?url.substring(x+4,y):-1;}
function hex(num){var s='0000000'+num.toString(16);return s.substr(s.length-8,8);}
function hypertextSource_onclick(){if(isBusy()){return false;}
var e=theFrames.RH.event.srcElement
while(e.tagName !='A' && e.tagName !='AREA'){e=e.parentElement;}
var ev=theFrames.RH.event;loadCPforEvent('onbeforehypertextlink','loadCP_document');if(!doEvents('onbeforehypertextlink',e)){ev.returnValue=false;ev.cancelBubble=true;return;}
var tB=theToolbar;var Ls=theFrames.RH.document.all.tags(e.tagName)
var j;for(j=0;j<Ls.length;j++){Ls[j].name=j;}
if(theFrames.RHLO==0){theFrames.RHHypertextSource=e;theFrames.lastRHClickX=theFrames.RH.event.screenX;theFrames.lastRHClickY=theFrames.RH.event.screenY;RH_FRAME_onscroll();}else{pushBackTrack(e);LHRH_onclick(e,'RH_FRAME');tB.backtrackHead.RHscrollTo=theFrames.RHscrollTo;theFrames.RHscrollTo=false;}
ev.cancelBubble=true;ev.returnValue=false;return false;}
function hypertextSourceExternal_onclick(){if(isBusy()){return false;}
var e=theFrames.RH.event.srcElement
while(e.tagName !='A' && e.tagName !='AREA'){e=e.parentElement;}
var ev=theFrames.RH.event;loadCPforEvent('onbeforeexternalhypertextlink','loadCP_document');if(!doEvents('onbeforeexternalhypertextlink',e)){ev.returnValue=false;ev.cancelBubble=true;return;}
}
function init(){if(theFrames.dbwin !=false){var w=screen.availWidth;theFrames.dbwin=window_open('','TroveDebug',debugParams);theFrames.dbwin.document.open();theFrames.dbwin.document.ondblclick=debug_ondblclick;}
if(dbg5){debug('Trove.asp fixlevel is: '+TroveASP);debug('Trove.htm fixlevel is: '+Required_TroveASP);debug('Trove.js fixlevel is: '+theFrames.jsLevel);debug('Trove.htm sync level level is: '+theFrames.fixLevel);debug('DB='+dbgLevel);}
theFrames.TOP=self.frames[0];theFrames.NAV=self.frames[1];theFrames.TRCTL=self.frames[2];theFrames.JS=self.frames[3];theFrames.LH=self.frames.LH_FRAME;theFrames.LHI=self.frames.LH_FRAME_INFO;theFrames.RH=self.frames.RH_FRAME;theFrames.RHI=self.frames.RH_FRAME_INFO;if(usingJoust){theFrames.NAVheight=theFrames.TRCTLheight;}
if(screen.width<800){theFrames.TOPheight=58;}
theFrames.libname=theFrames.title;theFrames.setupLockout();var oXINI=GetTROVESYSINI();try{theFrames.hideWithdrawnDocuments=!(oXINI.selectSingleNode('Trovesysini/Trove_webserver/Entry[@Name="hidewithdrawndocuments"]/@Value').value=="0");}
catch(e){theFrames.hideWithdrawnDocuments=true;}
var fs=GetUrlParam(startURL,'/FS=');var iniKey="StyleSheetsFolder";if(fs !=-1){iniKey+=fs;}
theFrames.StyleSheetsFolder=GetStyleSheetsFolder(oXINI,iniKey);theFrames.RHI.document.styleSheets[0].href=theFrames.StyleSheetsFolder+"TroveTTL.css";if(theFrames.TRCTLUpdated>0){if(dbg5){debug('Starting WebServer after refresh.');}
theFrames.TRCTLUpdated==1;theFrames.TRCTL.location.reload();}else{var U=startURL.split('/LI=');if(GetUrlParam(U[1],'/FI=')!=-1 && usingJoust){U[0]+=theFrames.treelevel;}
var url=U[0]+"/LO="+theFrames.ASPSessionID;url+=theFrames.scriptinglevel+'/LI='+U[1];if(dbg5){debug('Starting WebServer requests: '+url);}
theFrames.TRCTL.document.write(StartMessage(url));theFrames.TRCTLUpdated++;amBusyPlusOne();var SC=unescape(GetUrlParam(url,'/SC='));var FI=GetUrlParam(url,'/FI=');var HL=GetUrlParam(url,'/HL=');var PS=GetUrlParam(url,'/PS=');if(SC !=-1){theFrames.searching=true;theToolbar.search.input=new Object;theToolbar.search.input.value=SC;if((FI !=-1) && !(HL !=-1 && PS !=-1)){theFrames.firstSearch=true;}
}
theFrames.LHI.location.replace(theFrames.StyleSheetsFolder+'TROVEWRK.HTM');UpdateFrame('TRCTL',url);}
theFrames.initialised=true;}
function isBusy(){if(theFrames.lockoutPeriod>0 && arguments.length==0){if(bLockedout){alert(theMsgs.LockoutMsg);return true;}
theFrames.setLockoutTimer();}
if(theFrames.amBusy){if(debugging){debug(' -- theFrames.amBusy true');}
isModal();return true;}
if(isModal()){if(debugging){debug(' -- isModal() true');}
return true;}
if(theMenuisBusy()){if(debugging){debug(' -- theMenuisBusy() true');}
return true;}
return false;}
function isLastCheveron(obj){var imgs=theFrames.RH.document.all.tags('IMG');var i;for(i=imgs.length-1;i>-1;i--){if(imgs[i].src.toUpperCase().indexOf('NEXTS.GIF')>-1 ){imgs[i].id=i;if(obj.id !=i){return};break;}
}
if(i==-1){return};var a=theFrames.RH.document.all.lastNext;if(typeof(a)=='object'){var o=obj.parentElement;o.href=a.href;o.target=a.target;}
}
function isModal(){if(typeof(theFrames.popupWindowHead)=='object' && theFrames.popupWindowHead !=null){if(debugging){debug(' -- isModal.');}
if(theFrames.popupWindowHead.window.closed){theFrames.popupWindowHead=false;}
else{theFrames.popupWindowHead.window.focus();return true;}
}
return false;}
function JoustActivate(href){var JS=theFrames.JS;if(typeof(JS.dbg5)=='undefined'||!JS.JoustActivate){setTimeout('JoustActivate("'+href+'")',50);return;}
theMenu=JS.JoustActivate(href);}
function LH_FRAME_onreadystatechange(frm,doc){if(dbg5){debug('('+frm+') amBusy='+theFrames.amBusy+' refresh= '+theFrames.refresh);}
if(typeof(theFrames.LH.location)=='undefined'){return;}
var AC=GetUrlParam(theFrames.LH_href,'/AC=');if(theFrames.LHUpdated==0){if(debugging){debug(' -- unsolicited frame update.');}
theFrames.refresh++;if(theFrames.LH.location){if(AC=='BV' && jousting){history.back();}
}
return;}
if(theFrames.LHUpdated>0){theFrames.LHUpdated--;}
if(!jousting){setContextMenu(doc);}
if(AC=='BV'){var As=theFrames.LH.document.all.tags('A');var j=0;var i;for(i=0;i<As.length;i++){if(GetUrlParam(As[i].href,'/AC=')=='AO'){if(theFrames.shelfScrollTo==j++||As[i].className=='selnode'){As[i].parentElement.scrollIntoView(true);break;}
}
}
theFrames.shelfScrollTo=-1;}
amBusyMinusOne();if(dbg4){debug('(EXIT) busy='+theFrames.amBusy);}
}
function LH_INFO_onresize(){if(theFrames.amBusy>0){document.all.LEFT_CTRL.rows='*,'+working_h;}else{document.all.LEFT_CTRL.rows='*,0';}
}
function LHRH_onclick(obj,windowname){if(dbg5){debug('() '+windowname+': '+obj.id+' '+typeof(obj)+' '+obj.tagName);}
if(isBusy()){return false;}
amBusyPlusOne();var retVal=LHRH_onclick_body(obj,windowname)
amBusyMinusOne();return retVal;}
function LHRH_onclick_body(obj,windowname){theFrames.onclickWindowName=windowname;switch(windowname){case 'TRVTREE':if(debugging){debug('-- TRVTREE theMenu.amBusy:'+theMenuisBusy());debug(obj.tagName+' '+obj.name);}
if(obj.tagName=='BODY'||(obj.name=='' && obj.tagName !='A')){return;}
var o=obj;while(o.parentElement.tagName !='BODY'){o=o.parentElement;if(o.tagName=='DIV'){break;}
}
var id=o.id.substr(4);var e=theMenu.entry[id];if(!theMenu||theMenuisBusy()||!theMenu.entry[id]){return;};switch(obj.tagName){case 'IMG':if(obj.name.substring(0,13)=='plusMinusIcon'){if(e.FirstChild !=-1){theMenu.toggle(id);}
break;}
var unread=/unread.gif$/i;if(obj.href.match(unread)){theFrames.refresh=true;}
case 'A':if(obj.href.substr(obj.href.length-1)=="#" && e.FirstChild !=-1){theMenu.toggle(id);}else{return theMenu.itemClicked(id);}
default:}
return false;break;case 'TOP':if(!(obj.tagName=='IMG'||obj.tagName=='INPUT')){return;}
switch(obj.tagName){case 'INPUT':if(obj.type !='image'){break;}
case 'IMG':if(!eval('theToolbar.'+obj.id)){return;}
if(!doEvents('onbuttonclick',obj)){return false;}
}
switch(obj.id){case 'annotation':if(theToolbar.annotationCanAdd && !theFrames.haveSelection){var agree=confirm(theMsgs.ANNO_NO_PARA_SELECTED);if(!agree){return false;}
}
case 'bookmark':if(theToolbar.annotationCanAdd||theToolbar.bookmarkCanAdd){if(theFrames.haveSelection<0){alert(theMsgs.RHS_MORE_PARAS_SELECTED);return false;}
else if((theToolbar.annotationCanAdd||theToolbar.bookmarkCanAdd) && typeof(theFrames.haveSelection)=='object'){obj.parentElement.href=addToUrl(obj.parentElement.href,'/AP='+theFrames.haveSelection.id);if(GetUrlParam(obj.parentElement.href,'/PA=')==-1){var pa=GetUrlParam(theFrames.RH_href,'/PA=');if(pa !=-1){obj.parentElement.href=addToUrl(obj.parentElement.href,'/PA='+pa);}
}
if(GetUrlParam(obj.parentElement.href,'/DI=')==-1){var ds=GetUrlParam(obj.parentElement.href,'/DS=');if(ds !=-1 && pa !=-1){obj.parentElement.href=addToUrl(obj.parentElement.href,'/DI='+ds);}
}
if(debugging){debug(' /AP= '+theFrames.haveSelection.id+' appended to A href');}
theFrames.keep_RH_FRAME=true;}
}
break;case 'endSearch':theFrames.keep_TOP_FRAME=false;theFrames.searchinError=false;theFrames.stemphase=0;theToolbar.cancellingSearch=true;if(jousting){theFrames.RHI.RHDI=theTree.lastRHSync="";theTree.currentSearch=theTree.Hlevel=theTree.tgtMenuEntry=0;theTree.toplevelData=true;}
break;case 'home':setTimeout('window.top.location.replace("'+obj.parentElement.href+'")',50);return false;case 'library':if(jousting && theMenuisBusy()){return false;}
theFrames.bShowAllDocs=false;theFrames.TLCsrc=theFrames.TSCsrc=theFrames.TFCsrc=theFrames.TDCsrc='';loadCPFile('TLC',0);theFrames.searchinError=false;theFrames.keep_TOP_FRAME=false;theFrames.lastDocumentDI='';theFrames.usersCanPrint=true;theFrames.currentfolder='';theFrames.RHI.RHDI=theTree.lastRHSync="";var U=obj.parentElement.href;if(theFrames.options.clearSearch){sfURL=U;U=SearchFreeURL();theToolbar.search.value='';var searchField=FindSearchInputField();searchField.value="";}
obj.parentElement.href=U;if(typeof(theToolbar.onbuttonstatechange)=='function'){theToolbar.onbuttonstatechange(theToolbar.backTrack_i,'backTrack',false);}
resetTextAutoView();if(jousting){PleaseWait();var JS=theFrames.JS;jousting=JS.theTree=theTree=JS.theMenu=theMenu=false;}
break;case 'print':theFrames.ModalTextSRC=obj.parentElement.href;theFrames.modalX=prtX;theFrames.modalY=prtY;window_open(path2statics+'TrovePrt.htm','DISPLAY',printParams);return false;case 'split':switch(theFrames.splitterMode++){case 0:theFrames.SplitterPos=theFrames.LH.document.body.clientWidth;theFrames.NAV.parent.document.all.LHRH.cols=theFrames.SplitterMinWidth+',*';break;case 1:theFrames.NAV.parent.document.all.LHRH.cols='*,'+theFrames.SplitterMinWidth;break;case 2:theFrames.NAV.parent.document.all.LHRH.cols=theFrames.SplitterPos+',*';theFrames.splitterMode=0;break;}
return false;break;case 'previous':case 'next':var dir=(obj.id=='next')?true:false;if(!searchNextDocument(obj.parentElement,dir)){return false;}
if(theFrames.SearchFromPA>=0){var btnU=obj.parentElement.href;if(GetUrlParam(btnU,'/PA=')==-1)
btnU=addToUrl(btnU,'/PA='+theFrames.SearchFromPA);else{btnU=changeUrlParam(btnU,'/PA=',theFrames.SearchFromPA);btnU=RemoveUrlParam(btnU,'/HL=');btnU=RemoveUrlParam(btnU,'/PS=');}
obj.parentElement.href=btnU;}
theFrames.SearchFromPA=-1;case 'first':case 'last':if(theFrames.TBSearchNext=='' && theToolbar.search.input.value.toUpperCase()=='UNREAD'){if(typeof(dir)=='undefined' && !findNextSearchDocument(obj.parentElement,true)){return false;}
}
if(!theFrames.ToolbarOnly){theFrames.TBSearchNext='';}
if(jousting){if(theFrames.searchinError && theTree.firstHasHits==-1){alert(theMsgs.LHS_ERR_NOHITS1+theToolbar.search.input.value+theMsgs.LHS_ERR_NOHITS2);return false;}
if(theMenuisBusy()){return false;}
obj.parentElement.href=addToUrl(obj.parentElement.href,theFrames.treelevel);theTree.searchAction=obj.id;}
break;case 'topLevel':if(jousting){if(theMenuisBusy()){return false;}
if(theMenu.selectedEntry !=-1){var id=theMenu.selectedEntry;do{var e=id;id=theMenu.entry[id].parent;}while(id>-1)
}else{e=theMenu.firstEntry;}
theMenu.setAll(false,e);theTree.SelectEntry(e);}
resetTextAutoView();break;case 'upLevel':if(jousting){if(theMenuisBusy()){return false;}
var id=theMenu.entry[theMenu.selectedEntry].parent;if(id>-1){theMenu.setAll(false,id);theTree.SelectEntry(id);}
}
resetTextAutoView();break;case 'friendlyURL':if(window.name==''){window.name='TroveFURL';}
var tgt=(window.parent==self)?'_top':window.name;while(obj.tagName !='A' && obj.tagName !='BODY'){obj=obj.parentElement;}
obj.target=tgt;break;}
break;case 'LH_FRAME':var e=theFrames.LH.event.srcElement;var IsShelfOpenLink=(obj.tagName=='A' && obj.target=='TRCTL' && GetUrlParam(obj.href,'/AC=')=='AO')?true:false;if(IsShelfOpenLink){var selected=(e.parentElement.innerHTML.toUpperCase().indexOf('SSLF.GIF')>-1)?true:false;if(selected){loadCPforEvent('onbeforeshelfdeselect','loadCP_shelf',e);if(!doEvents('onbeforeshelfdeselect',e)){return false;}
}else{loadCPforEvent('onbeforeshelfselect','loadCP_shelf',e);if(!doEvents('onbeforeshelfselect',e)){return false;}
}
if(theToolbar.search.value !=''){theFrames.searchinError=false;}
var As=theFrames.LH.document.all.tags('A');var j=0;var i;for(i=0;i<As.length;i++){As[i].id=j++;if(obj.id==As[i].id){theFrames.shelfScrollTo=Number(As[i].id);break;}
}
}
else if(obj.tagName=='IMG' && obj.src.toUpperCase().indexOf('MORHDNG.GIF')>-1){while(e.tagName !='TR'){e=e.parentElement;}
loadCPforEvent('onexpandheading','loadCP_document');if(!doEvents('onexpandheading',e)){return false;}
}
else if(obj.tagName=='IMG' && obj.src.toUpperCase().indexOf('UNREAD.GIF')>-1){loadCPforEvent('onbeforeacceptrevision','loadCP_document');if(!doEvents('onbeforeacceptrevision',e)){return false;}
}
else{var cn=obj.className;var pcn=obj.parentElement.className;if(cn=='node'||pcn=='node'||cn=='DOCHEADINGS'||cn=='DOCTITLES'||pcn=='DOCTITLES'){e=(pcn=='DOCTITLES'||pcn=='node')?e.parentElement:e;loadCPforEvent('onselectheading','loadCP_document');if(!doEvents('onselectheading',e)){return false;}
}
}
break;case 'RH_FRAME':var RH=theFrames.RH;theFrames.lastRHClickX=RH.event.screenX;theFrames.lastRHClickY=RH.event.screenY;var IsFolderOpenLink=(obj.tagName=='A' && obj.target=='TRCTL' && GetUrlParam(obj.href,'/AC=')=='AP')?true:false;var RHisFoldersPane=(GetUrlParam(theFrames.RH_href,'/AC=')=='BW')?true:false;if(RHisFoldersPane){theFrames.haveSelection=false;if(usingJoust && IsFolderOpenLink){var div=obj.parentElement.parentElement;theFrames.bFolderHasHits=(div.id=='HIT')?true:false;theFrames.LHAPonly=true;}
}else{var o=obj
o=findParentP(o)
var bsetRHscrollTo=true;switch(obj.tagName){case 'A':switch(GetUrlParam(obj.href,'/AC=')){case 'BA':case 'CC':bsetRHscrollTo=false;break;default:}
default:if(bsetRHscrollTo){theFrames.haveSelection=(o.tagName=='P')?o:-1;if(typeof(theFrames.haveSelection)=='object'){setRHscrollTo(o);}
}
}
}
if(debugging && typeof(theFrames.haveSelection)=='object'){debug(' -- selected paragraph # is: '+theFrames.haveSelection.id);}
if(IsFolderOpenLink){var e=RH.event.srcElement;var o=obj.className;var op=obj.parentElement.className;if(o=='node'||op=='node'||o=='nodeUnread'||op=='nodeUnread'||o=='FOLDERNAMES'||op=='FOLDERNAMES'||o=='REVISION'||op=='REVISION'){e=(op=='node'||op=='FOLDERNAMES'||op=='REVISION' )?e.parentElement:e;if(RH.SF){e.href=addToUrl(e.href,'/SF='+RH.SF);}
loadCPforEvent('onbeforefolderopen','loadCP_folder',e);if(!doEvents('onbeforefolderopen',e)){return false;}
theFrames.currentfolder=e.innerText;}
}
else if(obj.tagName=='IMG' && obj.src.toUpperCase().indexOf('UNREAD.GIF')>-1){if(RHisFoldersPane){if(RH.SF){obj.parentElement.href=addToUrl(obj.parentElement.href,'/SF='+RH.SF);}
loadCPforEvent('onbeforeacceptrevision','loadCP_folder',obj.parentElement);if(!doEvents('onbeforeacceptrevision',obj)){return false;}
if(!confirm(theMsgs.acceptRevMsg)){return false;}
}
var tr=obj.parentElement
var x=ma='magic';while(tr.tagName !='TR' && tr.tagName !='BODY'){if(tr.tagName=='TD' && x){tr.TRid=x;x=false;}
tr=tr.parentElement;}
if(tr.tagName !='BODY'){var j;for(j=0;j<tr.children.length;j++){if(tr.children[j].TRid==ma){while(tr.children[j+1].tagName !='TD'){j++;}
x=tr.children[j+1].children[0]
if(x.tagName=='P'){setRHscrollTo(x);}
}
}
theFrames.refresh++;}else{var o=obj.parentElement.parentElement
setRHscrollTo(o.children[2]);switch(o.children[2].className){case 'node':case 'nodeUnread':case 'FOLDERNAMES':case 'REVISION':break;default:alert('Error in LHRH_onclick RH_FRAME analysis');debugger;}
}
}
else if((obj.tagName=='IMG') &&(obj.src.toUpperCase().indexOf('BABUTN.GIF')>-1||obj.src.toUpperCase().indexOf('BOOKBUTN.GIF')>-1||obj.src.toUpperCase().indexOf('ANNOBUTN.GIF')>-1)){var e=(obj.src.toUpperCase().indexOf('ANNOBUTN.GIF')>-1 )?theToolbar.getObject('annotation'):theToolbar.getObject('bookmark')
loadCPforEvent('onbuttonclick','loadCP_document');if(!doEvents('onbuttonclick',e)){return false;}
var notePa=GetUrlParam(obj.parentElement.href,'/PA=');var Ps=theFrames.RH.document.all.tags('P');var renderPa=Ps[0].id.substr(1);if((renderPa !=-1) &&(notePa !=renderPa)){obj.parentElement.href=changeUrlParam(obj.parentElement.href,'/PA=',renderPa);}
theFrames.keep_RH_FRAME=true;}
else if(RH.event.ctrlKey==true && obj.tagName=='IMG' && obj.id.toUpperCase()=='INLINEIMAGE'){loadCPforEvent('onbeforeimagezoom','loadCP_document');if(!doEvents('onbeforeimagezoom',o)){theFrames.RH.event.cancelBubble=true;return false;}
var bT31ADG=(theFrames.WV>=1)?true:false;var w=obj.scrollWidth+0;if(bT31ADG){var h=obj.scrollHeight+30+0;}else{var h=obj.scrollHeight+60+0;}
h=(h>screenHeight-32)?screenHeight-32:h;w=(w>screenWidth)?screenWidth-32:w;theFrames.imageObject=obj;var posTop=0;var posLeft=0;var imgFile="TroveIMG.HTM";if(bT31ADG){posTop=(screenHeight-h)/2;posLeft=(screenWidth-w)/2;imgFile="TroveIMG2.HTM";}
window_open(path2statics+imgFile,null,'height='+h+',width='+w+',resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no,top='+posTop+',left='+posLeft+'');return;}
else if((obj.tagName=='IMG') &&((obj.src.toUpperCase().indexOf('NEXTS.GIF')>-1)||(obj.src.toUpperCase().indexOf('PREVS.GIF')>-1 ))){if(obj.src.toUpperCase().indexOf('NEXTS.GIF')>-1 ){isLastCheveron(obj);if(!searchNextDocument(obj.parentElement,true)){return false;}
}
else if(obj.src.toUpperCase().indexOf('PREVS.GIF')>-1 ){if(!searchNextDocument(obj.parentElement,false)){return false;}
}
}
else{}
break;}
return TRCTL_requestUrl(obj);}
function loadCPFile(fExtn,id){if(dbg5){debug('('+fExtn+','+id+')');}
if(eval('theFrames.load'+fExtn) && id !=-1){var fid=hex(Number(id))+'.'+fExtn;var oXML=eval('document.all.'+fExtn+'.XMLDocument');oXML.async=false;oXML.load(theFrames.libVDir+fid);if(eval('document.all.'+fExtn+'.readyState') !='complete'){alert('CP load incomplete:'+fExtn+' '+id+'('+fid+')');}
eval('theFrames.'+fExtn+'src = "'+fid+'"');eval('theFrames.'+fExtn+' = document.all.'+fExtn);}else{if(dbg5){debug('Load suppressed by customisation');}
}
}
function loadCPforEvent(e,f){if(dbg5){debug('('+e+','+f+')')}
if(eval('theFrames.'+e+'.toString() != "function(){return true;}"')){var args='(';if(arguments.length>2){var i;for(i=2;i<arguments.length;i++){args+='arguments['+i+']';if(i !=arguments.length-1){args+=',';}
}
}
args+=')';eval(f+args);}
}
function loadCP_document(){var hr=theFrames.RH_href;var ds=GetUrlParam(hr,'/DS=');loadCPFile('TDC',(ds=='-1'?GetUrlParam(hr,'/DI='):ds));loadCPFile('TFC',GetUrlParam(hr,'/FI='));}
function loadCP_folder(e){loadCPFile('TFC',GetUrlParam(e.href,'/FI='));}
function loadCP_shelf(e){loadCPFile('TSC',GetUrlParam(e.href,'/SI='));}
function MsgText(){this.acceptRevMsg=GetMsgFromINI(theFrames.libname,'acceptRevMsg','Do you wish to mark all revisions in the document / folder as read?');this.AnnotationTitle=GetMsgFromINI(theFrames.libname,'AnnotationTitle','Trove Annotation');this.BookmarkTitle=GetMsgFromINI(theFrames.libname,'BookmarkTitle','Trove Bookmark');this.GraphicTitle=GetMsgFromINI(theFrames.libname,'GraphicTitle','Trove Graphic');this.LHS_ERR_NOHITS1=GetMsgFromINI(theFrames.libname,'LHSERRNOHITS1','Search for "');this.LHS_ERR_NOHITS2=GetMsgFromINI(theFrames.libname,'LHSERRNOHITS2','" was not found.');this.LHS_UNREAD_NOHITS=GetMsgFromINI(theFrames.libname,'LHSUNREADNOHITS1','All unread revisions have been accepted in all documents in this folder.\n\nYou should now cancel the search for "unread", or return to the library view and select another folder.');this.LHS_ERR_NODOCS=GetMsgFromINI(theFrames.libname,'LHSERRNODOCS','There are no current documents in this folder.');this.LHS_ERR_NOANNOS=GetMsgFromINI(theFrames.libname,'LHSERRNOANNOS','There are no visible annotations in this document.');this.LHS_ERR_NOBOOKS=GetMsgFromINI(theFrames.libname,'LHSERRNOBOOKS','There are no visible bookmarks in this library.');this.LHS_ERR_INVPHRASE=GetMsgFromINI(theFrames.libname,'LHSERRINVPHRASE','is an invalid search phrase.');this.PLEASE_WAIT1=GetMsgFromINI(theFrames.libname,'PLEASEWAIT1','Please wait while the <B>"');this.PLEASE_WAIT2=GetMsgFromINI(theFrames.libname,'PLEASEWAIT2','"</B> library is accessed...');this.PopupTitle=GetMsgFromINI(theFrames.libname,'PopupTitle','Trove Information');this.POPUPBLOCKER_MSG=GetMsgFromINI(theFrames.libname,'POPUPBLOCKERMSG','The activation of a Popup Blocker may be preventing the Trove application from functioning correctly.\n\nPlease review your Popup Blocker settings if applicable.');this.STEMNOHITS1=GetMsgFromINI(theFrames.libname,'STEMNOHITS1','Your search for "{SEARCHENTERED}" returned no results.\n\nWould you like to re-run your search for a broader range of similar words?');this.STEMNOHITS2=GetMsgFromINI(theFrames.libname,'STEMNOHITS2','Your search for "{SEARCHENTERED}" returned no results.\nThis may be due to the search being limited to the shelve(s) you have selected.\n\nWould you like to re-run your search for a broader range of similar words?');this.STEMNOHITS3=GetMsgFromINI(theFrames.libname,'STEMNOHITS3','\n\nChoose:\n\n OK to re-run the search as: "{STEMMEDSEARCH}"\n Cancel to change the search');this.SHELFNOHITS1=GetMsgFromINI(theFrames.libname,'SHELFNOHITS1','Your search for "{SEARCHENTERED}" returned no results.\nThis may be due to the search being limited to the shelve(s) you have selected.\n\nWould you like to re-run your search on the entire library?');this.SHELFNOHITS2=GetMsgFromINI(theFrames.libname,'SHELFNOHITS2','\n\nChoose:\n\nOK to re-run the search on the entire library\nCancel to change the search');this.SHOW_ALL_FOLDERS=GetMsgFromINI(theFrames.libname,'SHOWALLFOLDERS','Show all folders');this.SHOW_ALL_DOCUMENTS=GetMsgFromINI(theFrames.libname,'SHOWALLDOCUMENTS','Show all documents');this.LockoutMsg=GetMsgFromINI(theFrames.libname,'LockoutMsg','Access to Trove has been timed out, you must close this window and start again.');this.LockOutIsThisYou=GetMsgFromINI(theFrames.libname,'LockOutIsThisYou','If you are not %USERNAME%, please close this window and start again.');this.NoCopyMessage=GetMsgFromINI(theFrames.libname,'NoCopyMessage','Use of copy to clipboard is not allowed for this frame.');this.NoPrintMessage=GetMsgFromINI(theFrames.libname,'NoPrintMessage','Printing is not allowed from this frame.');TOP_BTN_WAIT_MSG=GetMsgFromINI(theFrames.libname,'TOPBTNWAITMSG','Please wait, working...');this.RHS_MORE_PARAS_SELECTED=GetMsgFromINI(theFrames.libname,'RHSMOREPARASSELECTED','You appear to have selected more than one paragraph. Please select a single paragraph to create a new bookmark or annotation.');this.ANNO_NO_PARA_SELECTED=GetMsgFromINI(theFrames.libname,'ANNONOPARASELECTED','You can add annotations but you have not selected an anchor paragraph, press:\nOK - to display annotations.\nCancel - to stop and set an anchor paragraph.');this.ANNO_DLG_EXCEED_MSG=GetMsgFromINI(theFrames.libname,'ANNODLGEXCEEDMSG','Annotations cannot exceed 4000 characters. Please reduce this annotation by ');this.LHS_ERR_DOC_NO_EXIST=GetMsgFromINI(theFrames.libname,'LHSERRDOCNOEXIST','This document does not exist:\n\n');this.LHS_ERR_DOC_DELETED=GetMsgFromINI(theFrames.libname,'LHSERRDOCDELETED','This document has been deleted:\n\n');this.LHS_ERR_DOC_NO_ACCESS=GetMsgFromINI(theFrames.libname,'LHSERRDOCNOACCESS','You do not have access to this document:\n\n');this.LHS_ERR_NO_HEADING=GetMsgFromINI(theFrames.libname,'LHSERRNOHEADING','This heading was not found in the document version currently available to you:\n\n');}
function ondocumentdisplay(url){var LO=GetUrlParam(theFrames.RH_href,'/LO=');if(LO !=1 && typeof(url) !='undefined'){LO=GetUrlParam(url,'/LO=');}
var currentDocumentID=GetUrlParam(theFrames.RH_href,'/DI=');var DI=currentDocumentID;if(currentDocumentID==-1){currentDocumentID=GetUrlParam(theFrames.RH_href,'/DS=');}
if(currentDocumentID !=theFrames.lastDocumentDI){theFrames.usersCanPrint=true;theFrames.lastDocumentDI=currentDocumentID;resetContextMenu(theFrames.LH.document);loadCP_document();var TDC=theFrames.TDC;var o;if(TDC && TDC.XMLDocument.xml.length !=0){var path='/Document/Word/CustomProperties/Property';o=TDC.XMLDocument.selectSingleNode(path+'[@Name="Trove_UsersCanPrint"]')
if(o){theFrames.usersCanPrint=o.text.toUpperCase()=='1'?true:false;}
if(theFrames.usersCanPrint){if(theFrames.TOPUpdated==0){theToolbar.print=true;if(typeof(theToolbar.onbuttonstatechange)=='function'){theToolbar.onbuttonstatechange(-1,'print',true);}
}
}else{if(theFrames.TOPUpdated==0){theToolbar.print=false;if(typeof(theToolbar.onbuttonstatechange)=='function'){theToolbar.onbuttonstatechange(-1,'print',false);}
}
}
o=TDC.XMLDocument.selectSingleNode(path+'[@Name="Trove_NoPrintMessage"]');if(o){if(theFrames.NoPrintMessage==''){theFrames.NoPrintMessage=theMsgs.NoPrintMessage;}
theMsgs.NoPrintMessage=o.text;}else{if(theFrames.NoPrintMessage !=''){theMsgs.NoPrintMessage=theFrames.NoPrintMessage;theFrames.NoPrintMessage='';}
}
o=TDC.XMLDocument.selectSingleNode(path+'[@Name="Trove_NoCopyMessage"]');if(o){if(theFrames.NoCopyMessage==''){theFrames.NoCopyMessage=theMsgs.NoCopyMessage;}
theMsgs.NoCopyMessage=o.text;}else{if(theFrames.NoCopyMessage !=''){theMsgs.NoCopyMessage=theFrames.NoCopyMessage;theFrames.NoCopyMessage='';}
}
}
setContextMenu(theFrames.LH.document);doEvents('onnewdocumentdisplay',theFrames.RH.document);}
if(DI !=-1||LO==1){doEvents('ondocumentdisplay',theFrames.RH.document);}
}
function NAV_onreadystatechange(frm,doc){if(dbg5){debug('NAV_onreadystatechange('+frm+') amBusy='+theFrames.amBusy+' refresh= '+theFrames.refresh);}
if(typeof(theFrames.NAV.location)=='undefined'){return;}
if(!theFrames.NAVUpdated){if(debugging){debug(' -- unsolicited frame update.');}
theFrames.refresh++;return;}
theFrames.NAVUpdated--;if(frm=='NAV'){alert('NAV_onreadystatechange() Illegal presentation of NAV frame');debugger;}
if(debugging){debug(' -- NAVDI = '+theFrames.NAVDI);}
theFrames.NAVSearchClear=false;if(usingJoust){theTree.onreadystatechange(frm,doc)
}else{setContextMenu(doc);}
amBusyMinusOne();if(dbg4){var dbs='NAV_onreadystatechange(EXIT) theFrames.amBusy:'+theFrames.amBusy
dbs+=(usingJoust)?' theMenu.amBusy:'+theMenuisBusy():'';debug(dbs);}
}
function nextprev_onclick(){amBusyPlusOne();theFrames.RHUpdated++;var ev=theFrames.RH.event;UpdateFrame('RH',ev.srcElement.parentElement.href);ev.cancelBubble=true;ev.returnValue=false;}
function parsePage(obj,i){++i;if(obj.children.length>0){var j;for(j=0;j<obj.children.length;j++){var s='';s+=' ----------'.substr(0,i+1)+obj.children(j).tagName;s+=' ----------'.substr(0,11-obj.children(j).tagName.length-i);s+=' offsetTop: '+obj.children(j).offsetTop;s+=' offsetLeft: '+obj.children(j).offsetLeft;s+=' offsetHeight: '+obj.children(j).offsetHeight;s+=' scrollTop '+obj.children(j).scrollTop;s+=' scrollHeight '+obj.children(j).scrollHeight;debug(s);parsePage(obj.children(j),i);}
}
}
function PleaseWait(){var mD=theFrames.LH.document.all.menuDIV;if(mD){bFLTActive=false;var theJDoc=theFrames.LH.document;theJDoc.clear();theJDoc.writeln('<HTML>');theJDoc.writeln('<HEAD>');theJDoc.writeln('<LINK ID=JoustStyles REL=STYLESHEET HREF="'+theFrames.StyleSheetsFolder+'TroveTree.css" TYPE=text/css MEDIA=SCREEN>');theJDoc.writeln('<BODY>'+theMenu.loadingMsg+'');theJDoc.close();}
}
function popupSource_onclick(){if(isBusy()){return false;}
var e=theFrames.RH.event.srcElement;while(e.tagName !='A' && e.tagName !='AREA'){e=e.parentElement;}
theFrames.RH_SrcElement=e;loadCPforEvent('onbeforepopup','loadCP_document');if(!doEvents('onbeforepopup',e)){var ev=theFrames.RH.event;ev.returnValue=false;ev.cancelBubble=true;return;}
}
function PopupWindowLink(prevLink,popupWindowRef){this.previous=prevLink;this.window=popupWindowRef;}
function PushPopupWindowList(popupWindowRef){var tF=theFrames;var newPopup=new PopupWindowLink(tF.popupWindowHead,popupWindowRef);tF.popupWindowHead=newPopup;}
function PostFrameUpdate(){if(!theFrames.NAVUpdated && !jousting){theFrames.NAV.parent.document.all.FSETTOOLBAR.rows=theFrames.TOPheight+',0,'+theFrames.TRCTLheight+',0,*';}else{theFrames.NAV.parent.document.all.FSETTOOLBAR.rows=theFrames.TOPheight+','+theFrames.NAVheight+','+theFrames.TRCTLheight+',0,*';}
}
function pushBackTrack(e){theFrames.JS.pushBackTrack(e);}
function RemoveUrlParam(url,tok){var rurl=url;var rtok=GetUrlParam(rurl,tok);rurl=(rtok !=-1)?URLSplit(rurl,tok+rtok):rurl;return rurl;}
function resetContextMenu(doc){doc.body.oncontextmenu='';doc.body.oncopy='';doc.body.onbeforeprint='';doc.body.onafterprint='';}
function resetTextAutoView(){if(textAutoView && theFrames.textAutoViewing){theFrames.textAutoViewing=false;theFrames.splitterMode=0;theFrames.NAV.parent.document.all.LHRH.cols=theFrames.SplitterPos+',*';}
}
function RH_FRAME_onreadystatechange(frm,doc){if(dbg5){debug('('+frm+') amBusy='+theFrames.amBusy+' refresh= '+theFrames.refresh+' Updated='+theFrames.RHUpdated);}
if(typeof(theFrames.RH.location)=='undefined'){return;}
if(theFrames.RHUpdated==0){if(GetUrlParam(theFrames.RH.location.href,'/AC=')=='BW'){RH_FRAME_showAll();setTimeout('document.all.RIGHT_CTRL.rows = "0,*";',50);}
if(debugging){debug(' -- unsolicited frame update.');}
theFrames.refresh++;return;}
theFrames.RHUpdated--;theFrames.haveSelection=false;theFrames.delayRHframe=theFrames.firstSearch=false;var hr=theFrames.RH_href;var AC=GetUrlParam(hr,'/AC=');if(AC !='BW'){loadCPforEvent('ondocumentdisplay','loadCP_document');theFrames.RHLO=GetUrlParam(hr,'/LO=');if(theFrames.RHLO==0){var o=(IE55)?theFrames.RH.document.body:theFrames.RH.window;o.onscroll=RH_FRAME_onscroll;}
var LA=GetUrlParam(hr,'/LA=');if(jousting){if(LA !=-1){theTree.noRevisions(hr);}
}
var areas=doc.all.tags('AREA')
if(areas.length>0){var j;for(j=0;j<areas.length;j++){var ac=GetUrlParam(areas[j].href,'/AC=');debug(ac+' '+areas[j].href);if(ac==-1){areas[j].onclick=hypertextSourceExternal_onclick;areas[j].target='_blank';}else{areas[j].target='TRCTL'
areas[j].onclick=areas_onclick;}
}
}
var Inlns=doc.all.item('INLINEIMAGE');if(Inlns !=null){if(typeof(Inlns.length)=='undefined'){var Inln=Inlns;var Inlns=new Array;Inlns[0]=Inln;}
var j;for(j=0;j<Inlns.length;j++){var alt=Inlns[j].alt;alt+='\nHold down Ctrl and click to zoom this image.';Inlns[j].alt=alt;}
}
var As=doc.all.tags('A');var j;for(j=0;j<As.length;j++){var A=As[j];if(typeof(A.href) !='undefined' && A.href.toUpperCase().indexOf('JAVASCRIPT:') !=0){var ac=GetUrlParam(A.href,'/AC=');if(ac==-1){A.target='_blank';}
switch(ac){case 'AD':case 'AE':case 'CV':A.onclick=nextprev_onclick;break;case 'BA':case 'CC':A.onclick=hypertextSource_onclick;break;case 'AZ':A.onclick=popupSource_onclick;break;default:A.onclick=hypertextSourceExternal_onclick;}
}
}
if(usingJoust){var pa=GetUrlParam(hr,'/PA=');if(AC=='CV'||AC=='AE'||pa==-1 ){var Ps=theFrames.RH.document.all.tags('P');if(AC=='CA'){pa=Ps[0].id.substr(1);}else{pa=(Ps.length>0)?Ps[Ps.length-1].id.substr(1):pa;}
}
if(debugging){debug(' RH href PA='+pa+' theFrames.RHSync='+theFrames.RHSync);}
if(theFrames.RHSync){if(theFrames.NAVUpdated==0 && jousting){var di=(theTree.docCount==1 && Number(GetUrlParam(hr,'/DS=')) !=-1)?Number(GetUrlParam(hr,'/DS=')):Number(GetUrlParam(hr,'/DI='));if(di==-1 && theTree.docCount>1){di=Number(GetUrlParam(hr,'/DS='));}
if(di!=-1){if(timeout[eJoustRHSync]==0){theTree.RHSync(Number(di),Number(pa));}
}
}else{di=GetUrlParam(hr,'/DI=');if(di==-1){di=GetUrlParam(hr,'/DS=');}
if(debugging){debug(' -- set delayedRHSync = this.RHSync('+di+','+pa+')');}
if(theTree){theTree.delayedRHSync='theTree.RHSync('+di+','+pa+');';}else{theFrames.delayedRHSync='theTree.RHSync('+di+','+pa+');';}
}
}
theFrames.RHSync=true;}
ondocumentdisplay();}else{if(doc.all.showAll){doc.all.showAll.parentElement.innerHTML+=theMsgs.SHOW_ALL_FOLDERS
}
theFrames.RHI.RH_INFO_showTitle();RH_FRAME_showAll();}
var t=theToolbar.backTrackPath;var s=theFrames.RHscrollTo;if(t){var Ls=theFrames.RH.document.all.tags(t.tag)
var j;for(j=0;j<Ls.length;j++){Ls[j].name=t.tag+j;if(j==t.linkNum){break;}
}
s=Ls[t.linkNum];theToolbar.backTrackPath=false;}
if(s){var cn=s.className;if(cn=='node'||cn=='nodeUnread'||cn=='FOLDERNAMES'||cn=='REVISION' ){var As=doc.all.tags('A');var j;for(j=0;j<As.length;j++){if(As[j].title==s.title){As[j].scrollIntoView(true);theFrames.RH.document.body.scrollLeft=0;break;}
}
}else{if(s.tagName !='P'){s.scrollIntoView(true);theFrames.RH.document.body.scrollLeft=0;}else{if(theFrames.RH.document.all.item(s.id)){if(GetUrlParam(theFrames.TRCTL_href,'/AC=')=='BK'){scrollToPreviousHit(doc,s);}
else{theFrames.RH.document.all.item(s.id).scrollIntoView(true);}
}
theFrames.RH.document.body.scrollLeft=0;}
theFrames.RHscrollTo=false;}
}
var hr=theFrames.RH_href;var AC=GetUrlParam(hr,'/AC=');if(AC=="AE"||AC=="CV"){var n=doc.all.tags('DIV');if(n.length>0){n(n.length-1).scrollIntoView(false);}
}
setContextMenu(doc);amBusyMinusOne();if(dbg4){debug('(EXIT) amBusy='+theFrames.amBusy);}
}
function RH_FRAME_onscroll(){TRCTL_requestUrl(changeUrlParam(theFrames.RH_href,'/AC=','CP'));var o=(IE55)?theFrames.RH.document.body:theFrames.RH.window;o.onscroll=null;}
var btest4ShowAll=true;var bdivShowAll=false;function RH_FRAME_showAll(){if(btest4ShowAll){var styles=theFrames.RH.document.styleSheets;var s,s1,i;for(s=0;s<styles.length && styles[s].href !='';s++){s1=styles[s];for(i=0;i<s1.rules.length;i++){if(s1.rules[i].selectorText=='#divShowAll'){bdivShowAll=true;}
}
}
btest4ShowAll=false;}
var styles=theFrames.RH.document.all.hitsStyles;var hit=styles.styleSheet.rules[0];var nohit=styles.styleSheet.rules[1];var divShowall=styles.styleSheet.rules[2];if(bdivShowAll){if(theToolbar.search.value !='' && !theFrames.searchinError){divShowall.style.display='block';if(theFrames.bShowAll){hit.style.display=nohit.style.display='block';var showAll=theFrames.RH.document.all.showAll;if(showAll){showAll.checked=true;}
}else{nohit.style.display='none';hit.style.display='block';}
}else{if(theFrames.searchinError){hit.style.display=nohit.style.display='block';}
}
}else{hit.style.display=nohit.style.display='block';}
}
function RH_INFO_setHeight(){var AC=GetUrlParam(theFrames.RH_href,'/AC=');if(AC !='BW' && AC !='BZ' && jousting){var b=theFrames.RHI.document.body;var h=b.scrollHeight;var oT=Number(b.topMargin)+Number(b.bottomMargin);theFrames.RHIh=h+=oT;if(theFrames.RHIvisible){document.all.RIGHT_CTRL.rows=h+',*';}else{document.all.RIGHT_CTRL.rows=theFrames.RHIch+',*';}
}else{document.all.RIGHT_CTRL.rows=0+',*';theFrames.RHItitle="";}
}
function ScrollIntoView(obj){var d=frames('RH_FRAME').document;var viewX1=d.body.scrollLeft;var viewY1=d.body.scrollTop;var viewX2=viewX1+d.body.offsetWidth;var viewY2=viewY1+d.body.offsetHeight;var objX1=obj.offsetLeft;var objY1=obj.offsetTop;var o=obj;while(o.parentElement.tagName !='BODY'){o=o.parentElement;objY1+=o.offsetTop;}
var objX2=objX1+obj.offsetWidth;var objY2=objY1+obj.offsetHeight;if((objX1>=viewX1) &&(objY1>=viewY1)){if((objX2>=viewX2)||(objY2>=viewY2)){obj.scrollIntoView(false);}
}
else{obj.scrollIntoView(true);}
}
function scrollToPreviousHit(doc,s){var As=doc.all.tags('A');var j;var lastO;for(j=0;j<As.length;j++){var A=As[j];if(A.name.indexOf("SH")>=0){var o=findParentP(A);if(o.id>=s.id){break;}
else{lastO=o;}
}
}
if(lastO !=null)
lastO.scrollIntoView(true);}
function search_onfocus(){if(GetUrlParam(theFrames.RH_href,'/AC=')!='BW'){loadCPforEvent('onsearchfocus','loadCP_document');}
doEvents('onsearchfocus',theToolbar.search);}
var rEsearchEscape=/%20/g;var rEplus=/\+/g;var rEfsl=/\x2F/g;var rEuro=/%u20AC/g;function search_escape(s){var t=escape(s).replace(rEplus,'%2b');t=t.replace(rEfsl,'%2f');t=t.replace(rEsearchEscape,'+');return t.replace(rEuro,'%80');}
function search_onsubmit(){if(dbg5){debug('() Search="'+theToolbar.search.input.value+'"');}
if(GetUrlParam(theFrames.RH_href,'/AC=')!='BW'){loadCPforEvent('onbeforesearch','loadCP_document');}
doEvents('onbeforesearch',theToolbar.search.input);theToolbar.search.value=theToolbar.search.input.value;theFrames.keep_TOP_FRAME=false;theFrames.stemphase=0;if(usingJoust){theFrames.searchinError=theToolbar.cancellingSearch=false;theFrames.searching=true;}
if(usingJoust && jousting){if(theToolbar.search.input.value.length==0){return false;}
theFrames.bShowAllDocs=false;theFrames.RHI.RHDI=theTree.lastRHSync="";var tT=theTree;var u;var _url=u=theToolbar.search.form.action;if(GetUrlParam(_url,'/DS=')==-1){var di=GetUrlParam(_url,'/DI=');if(di !=-1){u=addToUrl(u,'/DS='+di);}
}
u=changeUrlParam(u,'/AC=','AP');u=changeUrlParam(u,'/ST=','ag');u=addToUrl(u,'/SC='+search_escape(theToolbar.search.input.value));u=RemoveUrlParam(u,'/DI=');theFrames.SearchFromPA=GetUrlParam(u,'/PA=')-1;u=RemoveUrlParam(u,'/PA=');u=RemoveUrlParam(u,'/HL=');u=RemoveUrlParam(u,'/PS=');u=RemoveUrlParam(u,'/XD=');theToolbar.search.form.action=u;theFrames.LHAPonly=theFrames.firstSearch=true;theFrames.bFolderHasHits=false;PleaseWait();var JS=theFrames.JS;jousting=JS.theTree=theTree=JS.theMenu=theMenu=false;}
else{var u=theToolbar.search.form.action;u=RemoveUrlParam(u,'/FI=');theToolbar.search.form.action=u;}
theFrames.TRCTL_href=theToolbar.search.form.action;amBusyPlusOne();theFrames.TRCTLUpdated++;return true;}
function search_onkeyup(obj){var iN=typeof(obj)=='undefined'?this:obj;if(iN.value.length>0){var T=iN.value.split(' ')
if(T.length>1){if(iN.value.substr(iN.value.length-1,1) !=' '){return;}
var S=T[0]+' ';var j;for(j=1;j<T.length;j++){switch(T[j].toLowerCase()){case '':break;case 'and':S+=(T.length==1)?'AND':'AND ';break;case 'or':S+=(T.length==1)?'OR':'OR ';break;case 'revision':S+=(T.length==1)?'REVISION':'REVISION ';break;case 'unread':S+=(T.length==1)?'UNREAD':'UNREAD ';break;case 'near':S+=(T.length==1)?'NEAR':'NEAR ';break;default:S+=T[j]+' ';}
}
iN.value=S;}
}
}
function SearchFreeURL(){var sfu=sfURL;var tok=GetUrlParam(sfu,'/SC=');if(tok==-1){return sfu;}
var sfu=(tok !=-1)?URLSplit(sfu,'/SC='+tok):sfu;tok=GetUrlParam(sfu,'/SF=');sfu=(tok !=-1)?URLSplit(sfu,'/SF='+tok):sfu;tok=GetUrlParam(sfu,'/SD=');sfu=(tok !=-1)?URLSplit(sfu,'/SD='+tok):sfu;tok=GetUrlParam(sfu,'/SP=');sfu=(tok !=-1)?URLSplit(sfu,'/SP='+tok):sfu;tok=GetUrlParam(sfu,'/SH=');sfu=(tok !=-1)?URLSplit(sfu,'/SH='+tok):sfu;tok=GetUrlParam(sfu,'/FH=');sfu=(tok !=-1)?URLSplit(sfu,'/FH='+tok):sfu;tok=GetUrlParam(sfu,'/LH=');sfu=(tok !=-1)?URLSplit(sfu,'/LH='+tok):sfu;tok=GetUrlParam(sfu,'/SB=');sfu=(tok !=-1)?URLSplit(sfu,'/SB='+tok):sfu;tok=GetUrlParam(sfu,'/EN=');sfu=(tok !=-1)?URLSplit(sfu,'/EN='+tok):sfu;return sfu;}
function searchNextDocument(obj,fwd){if(!jousting){return true;}
if(theTree.firstHasHits==theTree.lastHasHits){if(theMenu.entry[theTree.firstHasHits].TRVNoSearchUnread){alert(theMsgs.LHS_UNREAD_NOHITS);return false;}
return true;}
if(theFrames.onclickWindowName=='RH_FRAME'){var PA=theFrames.RHscrollTo.id.substr(1);}else{var PA=Number(GetUrlParam(obj.href,'/PA='));}
var xH=(fwd)?'/LH=':'/FH=';var nH=Number(GetUrlParam(obj.href,xH).split(':')[0]);if(fwd){if((PA<nH)||((PA==nH) &&(obj.target=='_self'))){return true;}
}else{if((PA>nH)||((PA==nH) &&(obj.target=='_self'))){return true;}
}
var URL=obj.href;var di=Number(GetUrlParam(URL,'/DI='));if(di==-1){di=Number(GetUrlParam(URL,'/DS='));}
var id=theMenu.findEntry(di,'TRVDI','exact',0);if(!findNextSearchDocument(obj,fwd)){return true;}
var nextMsg='End of document.\n\nChoose OK to move to next document.';var prevMsg='Beginning of document.\n\n Choose OK to move to previous document.';var msg=(fwd)?nextMsg:prevMsg;if(!confirm(msg)){return true;}
var nurl=theMenu.entry[theTree.nid].TRVUrl;obj.href=nurl;theFrames.ToolbarOnly=true;theFrames.TBSearchNext=fwd?'first':'last';theTree.CloseTree(id);if(debugging){debug('Posting Toolbar '+theFrames.TBSearchNext);}
return true;}
function setButtonCanAdd(e,images,buttonName){var canAdd=(images.src.substring(e-2,e-1)=='w')?true:false;eval('theToolbar.'+buttonName+'CanAdd='+canAdd);return canAdd;}
function setContextMenu(doc){if((ControlledWebAccess||!theFrames.usersCanPrint) && !dbg5){doc.body.oncontextmenu=function(){return false;}
doc.body.oncopy=document_oncopy;doc.body.onbeforeprint=document_onbeforeprint;doc.body.onafterprint=document_onafterprint;}
}
function setRHscrollTo(o){var r=new Object;r.id=o.id;r.title=o.title;r.tagName=o.tagName;r.className=o.className;theFrames.RHscrollTo=r;}
var gLockoutTimer=null;var bLockedout=false;function setLockoutTimer(){if(gLockoutTimer !=null){clearTimeout(gLockoutTimer);}
gLockoutTimer=setTimeout('bLockedout = true',this.lockoutPeriod*1000);}
function setupLockout(){var oXINI=GetTROVESYSINI();var lockoutperiod='';var l=false;try{lockoutperiod=oXINI.selectSingleNode('Trovesysini/Libraries[@Name="'+this.libname.replace(/\x20/g,'_')+'"]/Entry[@Name="lockoutperiod"]/@Value').value
l=true;}
catch(e){try{lockoutperiod=oXINI.selectSingleNode('Trovesysini/Trove_webserver/Entry[@Name="lockoutperiod"]/@Value').value
}
catch(e){}
}
if(lockoutperiod !=''){var hosts=lockoutperiod.split(',');var bLockoutHost=false;if(hosts.length>1){for(var i=1;i<hosts.length;i++){if(hosts[i].toUpperCase()==this.host.toUpperCase()){if(isNaN(Number(hosts[0]))){var s=l?'[Libraries\\'+this.libname+']':'[TROVE WEBSERVER]';var m='WARNING: TROVESYS.INI '+s+' LockoutPeriod='+hosts[0]+' is not numeric and has been ignored.';alert(m);}else{bLockoutHost=true;this.lockoutPeriod=hosts[0];}
break;}
}
}
}
}
function stemthesearch(s){var stemming=false;var rEPhrases=/(["])[^"]*\1/g;var w=s.split(rEPhrases);var p=s.match(rEPhrases);var andOrNearSkipped=false;var search='';var wi=0;var pi=0;var w2i=999999;var w2=new Array();var ss=s;if(w==null){w=new Array();}
if(p==null){p=new Array();}
while(wi<w.length||w2i<w2.length||pi<p.length){if(wi<w.length &&(w2i>=w2.length)){var we=w[wi];if(we.substr(0,1)==' '){we=we.substr(1);}
if(we.substr(we.length-1,1)==' '){we=we.substr(0,we.length-1);}
w2=we.split(' ');w2i=0;wi++;}
if(w2i<w2.length &&(ss.substr(0,w2[w2i].length)==w2[w2i]||ss.substr(0,4)=='&&& ')){var fordebugging=w2[w2i];switch(w2[w2i].toLowerCase()){case 'and':case 'or':case 'near':search+=' '+w2[w2i].toUpperCase()+' ';break;default:var ws=stemWord(w2[w2i]);if(ws !=w2[w2i]){stemming=true;search+=ws+'* ';}else{search+=w2[w2i]+' ';}
}
ss=ss.substr(w2[w2i].length);if(ss.substring(0,1)==' '){ss=ss.substr(1);}
w2i++;}else{if(pi<p.length && ss.substr(0,p[pi].length)==p[pi]){var fordebugging=p[pi];search+=p[pi];ss=ss.substr(p[pi].length);if(ss.substring(0,1)==' '){ss=ss.substr(1);}
pi++;}else{alert('STOP error has occurred in search stemming conversion.');return s;}
}
}
if(stemming){return search.substr(0,search.length-1);}
return s;}
function sizeDialogWindow(win,doc,sb){var b=doc.body;var scrWidth=screen.availWidth;var scrHeight=screen.availHeight;var diaWidth=(b.offsetWidth>b.scrollWidth)?b.offsetWidth:b.scrollWidth;diaWidth+=Number(b.leftMargin)+Number(b.rightMargin);var diaHeight=(b.offsetHeight>b.scrollHeight)?b.offsetHeight:b.scrollHeight;diaHeight+=Number(b.topMargin)+Number(b.bottomMargin)+10;if(debugging){debug(' BODY '+win.name);debug(' scroll w:h '+b.scrollWidth+':'+b.scrollHeight);debug(' scroll left:top '+b.scrollLeft+':'+b.scrollTop);debug(' offset w:h '+b.offsetWidth+':'+b.offsetHeight);debug(' offset left:top '+b.offsetLeft+':'+b.offsetTop);debug(' XBODY style l:b:p '+b.style.left+':'+b.style.border+':'+b.style.padding);debug(' BODY client l:t '+b.clientLeft+':'+b.clientTop);debug(' BODY.child(0) offset l:t '+b.children(0).tagName+' '+b.children(0).offsetLeft+':'+b.children(0).offsetTop);debug(' BODY margin l:t r:b '+b.leftMargin+':'+b.topMargin+' '+b.rightMargin+':'+b.bottomMargin);debug(' screen w,h: '+scrWidth+','+scrHeight);debug(' dialog w,h: '+diaWidth+','+diaHeight);debug(' position x,y: '+theFrames.modalX+','+theFrames.modalY);}
switch(sb){case 0:if(diaWidth>scrWidth){diaWidth=scrWidth;}
win.resizeTo(diaWidth,diaHeight);if(debugging){debug(' width resized: '+String(diaWidth));}
break;case 1:if(diaHeight>scrHeight){diaHeight=scrHeight;}
win.resizeTo(diaWidth,diaHeight);if(debugging){debug(' height resized: '+String(diaHeight));}
var diaX;var diaY;if(win.name.toUpperCase().indexOf("POPUP")==-1){diaX=(scrWidth-diaWidth)/2;diaY=(scrHeight-diaHeight)/2;}else{var mX=scrWidth-(diaWidth+theFrames.modalX);var mY=scrHeight-(diaHeight+theFrames.modalY);mX=(mX<0)?mX:0;mY=(mY<0)?mY:0;diaX=theFrames.modalX+mX;diaY=theFrames.modalY+mY;}
if(diaX>=0 && diaX<scrWidth && diaY>=0 && diaY<scrHeight){win.moveTo(diaX,diaY);if(debugging){debug(' moved to: '+String(diaX)+","+String(diaY));}
}else{win.moveTo(0,0);if(debugging){debug(' moved to 0,0 due to invalid: '+String(diaX)+","+String(diaY));}
}
break;default:}
}
function theMenuisBusy(e){if(!theMenu){return false;}
var t=0;if(e=='undefined'){var i;for(i=0;i<timeout.length;i++){t+=timeout[i];}
}else{var i;for(i=0;i<timeout.length;i++){if(i !=e){t=+timeout[i]}
}
}
if(theMenu.amBusy||t>0){return true;}
return false;}
function TOP_onreadystatechange(frm,doc){if(dbg5){debug('('+frm+')'+' amBusy='+theFrames.amBusy+' refresh= '+theFrames.refresh);}
if(typeof(theFrames.TOP.location)=='undefined'){return;}
var forms=doc.all.tags('FORM');forms[0].target='TRCTL';forms[0].onsubmit=search_onsubmit;theToolbar.search.form=forms[0];var inputs=doc.all.tags('INPUT');theToolbar.search.input=inputs[0];inputs[0].onfocus=search_onfocus;if(jousting && theFrames.searchinError){theToolbar.search.input.value=theToolbar.search.value;}else{theToolbar.search.value=theToolbar.search.input.value;}
if(searchANDOR){inputs[0].onkeyup=search_onkeyup;}
if(!theFrames.TOPUpdated){theFrames.refresh++;if(debugging){debug(' -- unsolicited frame update.');}
return;}
if(theFrames.customToolbar){var U=addToUrl(theFrames.TOP_href,'/CT=xml');U=addASPSessionID(U);if(debugging){debug('XMLTB.load('+U+')');}
XMLTB.load(U);return;}
var images=doc.all.tags('IMG');theFrames.TOPdoc=doc;if(frm=='TOPFSU'){alert('error TOP received FSU?');}
var j;for(j=0;j<images.length;j++){var buttonName=images[j].id;var e=String(images[j].src).indexOf('.gif');var active=(String(images[j].src).substring(e-1,e)=='a')?true:false;if(active){var canAdd=setButtonCanAdd(e,images[j],buttonName);}
if(buttonName !='backTrack'){eval('theToolbar.'+buttonName+'_img = images[j]');}
switch(eval('theToolbar.'+buttonName)){case true:if(active==false){eval('theToolbar.'+buttonName+'= false');}
break;case false:if(active==true){eval('theToolbar.'+buttonName+'= true');}
break;case-2:theToolbar.initByIMG=true;if(images[j].style.visibility=='hidden'){eval('theToolbar.'+buttonName+'= -3');break;}
if(buttonName=='backTrack'){active=false;theToolbar.backTrack_i=j;}else{eval('theToolbar.'+buttonName+'_img = images[j]');}
eval('theToolbar.'+buttonName+'= '+active);break;}
}
setContextMenu(doc);if(theFrames.onclickWindowName=="RH_FRAME"){var i;for(i=0;i<images.length;i++){images[i].OrigAlt=images[i].alt;images[i].alt=theMsgs.TOP_BTN_WAIT_MSG;}
}
theFrames.TOPUpdated--;theFrames.TOPdoc=doc;amBusyMinusOne();if(dbg4){debug('(EXIT)'+' amBusy='+theFrames.amBusy);}
}
function TRCTL_onreadystatechange(frm,doc){if(dbg5){debug('('+frm+') amBusy='+theFrames.amBusy+' refresh= '+theFrames.refresh);debug(' url '+theFrames.TRCTL_href);debug('theFrames.TRCTLUpdated='+theFrames.TRCTLUpdated+' theFrames.TRCTLUsed='+theFrames.TRCTLUsed);}
if(typeof(theFrames.TRCTL.location)=='undefined'){return;}
if(theFrames.TRCTLUpdated<=0){if(theFrames.TRCTLUpdated<0){alert('theFrames.TRCTLUpdated -ve');debugger;}
var As=doc.all.tags('A');if(As.length>0 && As[0].target.toUpperCase()=='POPUPTEXT'){UpdateFrameset(As);return;}
if(theFrames.TRCTLUsed==0){if(debugging){debug(' -- unsolicited frame update - Refressh');}
theFrames.refresh++;theFrames.TRCTLUpdated++;return;}else{if(theFrames.amBusy !=0){if(debugging){debug(' -- unsolicited frame update - B/F while processing - ignored');}
return;}
theFrames.TRCTLUpdated++;amBusyPlusOne();}
}
if(theFrames.TRCTLUpdated>0){theFrames.TRCTLUpdated--;}
var href=theFrames.TRCTL_href;if(href.indexOf('/AC=AZ')==-1 && href.indexOf('/AC=BJ')==-1 ){if(debugging){debug(' -- TRCTLBackTrackhref '+GetUrlParam(href,'/AC='));}
theFrames.TRCTLBackTrackhref=href;}
retries=0;if(frm=='TRCTLFSU'){var As=doc.all.tags('A');if(As.length<2){if(As.length>0){switch(As[0].target){case 'LIBRARY_STATUS':alert(As[0].innerText);return;break;case 'LOGGED_OPEN':if(debugging){debug('LOGGED_OPEN response received');}
var hr=As[0].href;if(jousting && GetUrlParam(hr,'/LA') !=-1){theTree.noRevisions(hr);}
amBusyMinusOne();theFrames.refresh=false;theFrames.RHLO=-1;theFrames.TRCTLUsed++;var e=theFrames.RHHypertextSource;if(e !=null){pushBackTrack(e);TRCTL_requestUrl(e);theFrames.RHHypertextSource=null;}
ondocumentdisplay(hr);return;break;case 'LH_FRAME':var hr=As[0].href;if(GetUrlParam(hr,'/AC=')=='CN'){break;}
default:amBusyMinusOne();document.all.FSETTOOLBAR.rows='0,0,100,0,0';return;}
}else{document.all.FSETTOOLBAR.rows='0,0,100,0,0';return;}
}
if(doc.all.tags('FONT').length>0){document.all.FSETTOOLBAR.rows='0,0,100,0,0';return;}
if(GetUrlParam(As[0].href,'/XD=')==-1){theFrames.XferDoc=0;}
else{theFrames.XferDoc=GetUrlParam(As[0].href,'/XD=');}
var sc=GetUrlParam(theFrames.TRCTL_href,'/SC=');var ac=GetUrlParam(theFrames.TRCTL_href,'/AC=');theFrames.folderOpenning=(ac=='AP')?true:false;if(theFrames.LHAPonly && !theFrames.pendingFolderOpen){theFrames.pendingFolderOpen=true;switch(ac){case 'AP':var lh=-1;var j;for(j=0;j<As.length;j++){switch(As[j].target){case 'LH_FRAME':lh=j;break;default:}
}
default:}
if(lh>-1){var newAs=new Array;newAs[0]=As[lh];}else{debugger;}
UpdateFrameset(newAs);}else{theFrames.pendingFolderOpen=false;if(theFrames.ToolbarOnly){theFrames.ToolbarOnly=false;var tb=-1;var j;for(j=0;j<As.length;j++){switch(As[j].target){case 'TOOLBAR_FRAME':tb=j;break;default:}
}
if(tb>-1){var newAs=new Array;newAs[0]=As[tb];}else{debugger;}
UpdateFrameset(newAs);}else{UpdateFrameset(As);}
}
theFrames.folderOpenning=false;amBusyMinusOne();theFrames.refresh=false;if(theFrames.TRCTLUsed++==0){setTimeout('theFrames.JS.location.href = "'+path2statics+'Trove2.asp?P2S='+escape(path2statics)+'"',50);}
if(dbg4){debug('(EXIT) '+frm+' amBusy='+theFrames.amBusy+' refresh='+theFrames.refresh);}
return;}
switch(GetUrlParam(theFrames.TRCTL_href,'/AC=')){case 'AZ':case 'BA':case 'CC':theFrames.ModalTextSRC=theFrames.TRCTL_href;displayPopupWindow();amBusyMinusOne();if(dbg4){debug('(EXIT "ambiguous")'+frm+' amBusy='+theFrames.amBusy);}
return;default:}
alert('Error: TRCTL recevied non FSU data, you will now be shown the hidden control frame');document.all.FSETTOOLBAR.rows='0,0,100,0,0';}
function TRCTL_requestUrl(obj){switch(typeof(obj)){case 'object':if(obj.target=='TRCTL'){var href=obj.href;if(dbg5){debug(' obj.target TRCTL href:'+href);}
}else{if(obj.parentElement.target=='TRCTL'){var href=obj.parentElement.href;if(dbg5){debug(' obj.parentElement.target TRCTL href:'+href);}
}
}
break;case 'string':var href=obj;}
if(typeof(href)=='undefined'){switch(obj.id.toUpperCase()){case 'GO':theFrames.TRCTLUpdated++;return;default:return true;}
}
theFrames.TRCTLUpdated++;amBusyPlusOne();if(debugging){debug('set TRCTL href');}
if(theFrames.XferDoc>0 && GetUrlParam(href,'/XD=')>0){href=changeUrlParam(href,'/XD=',theFrames.XferDoc);}
UpdateFrame('TRCTL',href);return false;}
function Toolbar(){this.initByIMG=false;this.library=-2;this.library_img;this.library_Element;this.topLevel=-2;this.upLevel=-2;this.previousSection=-2;this.nextSection=-2;this.split=-2;this.first=-2;this.first=-2;this.previous=-2;this.endSearch=-2;this.next=-2;this.last=-2;this.bookmark=-2;this.bookmarkCanAdd;this.goingToBookmark=false;this.annotation=-2;this.annotationCanAdd;this.print=-2;this.backTrack=-2;this.backtrackHead=false;this.backTrack_img;this.backTrack_i=-1;this.backTrackPath=false;this.friendlyURL=-2;this.help=-2;this.home=-2;this.search;this.cancellingSearch=false;this.onbuttonstatechange;}
function Toolbar_init(usersAdviser){if(dbg5){debug('()');}
if(typeof(usersAdviser)!='function'){var s='Toolbar cannot be intialised, you did not pass me a function.';alert(s);return s;}
if(theFrames.initialised==false ){return false;}
XMLTB=XTB.XMLDocument;XMLTB.async=true;XMLTB.onreadystatechange=xToolbar_onreadystatechange;theToolbar.onbuttonstatechange=usersAdviser;theFrames.customToolbar=true;if(typeof(theFrames.TOPdoc)=='object'){theFrames.TOPUpdated++;amBusyPlusOne();TOP_onreadystatechange('Toolbar_init',theFrames.TOPdoc);}
theFrames.TOPheight=0;if(theFrames.TRCTLUsed>0){PostFrameUpdate();}
if(theFrames.TRCTLUsed>0 && theFrames.RHUpdated==0){if(GetUrlParam(theFrames.RH_href,'/AC=') !='BW'){ondocumentdisplay();}
}
return true;}
function Toolbar_buttonClick(btn){if(dbg5){debug('('+btn+') amBusy='+theFrames.amBusy);}
if(btn=='backTrack' && theToolbar.backTrack==false){return;}
if(isBusy()){return false;}
if(!eval('theToolbar.'+btn)){if(debugging && arguments.length>1 && !theFrames.searchinError){alert('POSSIBLE ERROR: Toolbar button '+btn+' clicked programatically when inactive.');debugger;}
return;}
if(btn !='backTrack' && theFrames.customToolbar){eval('LHRH_onclick(theToolbar.'+btn+'_img,"TOP")')
}else{eval('theToolbar.'+btn+'_img.click()');}
}
function Toolbar_getObject(btn){if(theFrames.customToolbar){return eval('theToolbar.'+btn+'_img');}else{return eval('theFrames.TOP.document.all.item("'+btn+'")');}
}
function ToolbarSearchobj(){this.value='';this.form;this.input;}
function ToolbarSearchobj_Go(){if(isBusy()){return false;}
this.input.value=this.value;this.form.onsubmit();this.form.submit();}
ToolbarSearchobj.prototype.go=ToolbarSearchobj_Go;Toolbar.prototype.init=Toolbar_init;Toolbar.prototype.buttonClick=Toolbar_buttonClick;Toolbar.prototype.backTrack_img=false;Toolbar.prototype.getObject=Toolbar_getObject;Toolbar.prototype.search=new ToolbarSearchobj;function TroveOptions(){this.clearSearch=false;}
function UpdateFrame(f,u){var url=addASPSessionID(u);var o=new Object;o.url=url;o.frame=f
if(theFrames.onupdateframe(o)){url=o.url;eval('theFrames.'+f+'.location.replace("'+url+'");');}
u=(u.toUpperCase().substr(0,4)=='HTTP')?u:theFrames.protocol+'//'+theFrames.host+u;eval('theFrames.'+f+'_href = "'+u+'";');}
function UpdateFrameset(As){if(theFrames.TRCTLUsed==0){var fs=GetUrlParam(As[0].href,'/FS=');theFrames.WV=Number(GetUrlParam(As[0].href,'/WV='));if((fs==-1 && theFrames.WV<6)||(fs !=-1 && theFrames.WV<7)){alert('STOP: TROVE.JS(v'+theFrames.jsLevel+') and TROVEIIS.DLL(wv'+theFrames.WV+') are incompatable with each other.');return;}
if(typeof(theFrames.RHI.RH_INFO_showTitle)=='undefined'){alert('STOP: TROVETTL.ASP is not loaded?');return;}
var sync=typeof(theFrames.RHI.SyncLevel)=='undefined';if(sync||theFrames.RHI.SyncLevel.innerText !=theFrames.TROVETTLASPLevel){var msg='STOP: TROVE.JS and TROVETTL.ASP are incompatible with each other.\n\n';msg+='TROVEJS.JS requires TROVETTL.ASP at '+theFrames.TROVETTLASPLevel+',\n';msg+='found TROVETTL.ASP at '+((sync)?'undefinded':theFrames.RHI.SyncLevel.innerText);alert(msg);return;}
theFrames.setLockoutTimer();}
amBusyPlusOne();var j;for(j=0;j<As.length;j++){switch(As[j].target){case '':break;case 'TOOLBAR_FRAME':if(dbg5){debug(' TOP: '+As[j].href);}
if(theFrames.TOP_href==As[j].href && !theFrames.refresh){if(debugging){debug('*** TOP duplicate frame request supressed*** ');}
break;}
if(theFrames.keep_TOP_FRAME){theFrames.keep_TOP_FRAME=false;if(debugging){debug('*** TOP update suppressed ***');}
break;}
var t=theFrames.TRCTL_href;var uBT=Number(GetUrlParam(t,'/BT='));var tBT=Number(GetUrlParam(theFrames.TOP_href,'/BT='));var st=GetUrlParam(t,'/ST=');var ac=GetUrlParam(t,'/AC=');if(st !=-1 && ac !='BF' &&(theToolbar.goingToBookmark||(tBT>0 && uBT !=0)||theToolbar.backtrackHead)){As[j].href=addToUrl(As[j].href,'/BT=1');theToolbar.goingToBookmark=false;}
var U=As[j].href;if(usingJoust){U=addToUrl(U,theFrames.treelevel);if(theFrames.searchinError){U=addToUrl(U,'/SC='+search_escape(theToolbar.search.value));}
}
theFrames.TOPUpdated++;amBusyPlusOne();if(theFrames.customToolbar){U=addToUrl(U,'/CT=xml');U=addASPSessionID(U);XMLTB.load(U);if(debugging){debug('XMLTB.load('+U+')');}
}
else{UpdateFrame('TOP',U);}
break;case 'TITLE_FRAME':if(usingJoust){break;}
if(dbg5){debug(' NAV: '+As[j].href);}
theFrames.NAVUpdated++;amBusyPlusOne();UpdateFrame('NAV',As[j].href);break;case 'LH_FRAME':if(dbg5){debug(' LH: '+As[j].href);}
if(theFrames.modalClose){CloseAllPopupWindows();theFrames.modalClose=false;theFrames.modalPopupJump=false;}
var libv=GetUrlParam(As[j].href,'/ID=');var ahtm=(libv !=-1)?'troveano2.htm':'troveano.htm';var bhtm=(libv !=-1)?'trovebkm2.htm':'trovebkm.htm';var action=GetUrlParam(As[j].href,'/AC=');if(action !=-1){x=1;switch(action){case 'AW':case 'BI':theFrames.ModalTextSRC=As[j].href;if(isModal()){if(debugging){debug('LH_FRAME AC=AW/BI already modal');}
theFrames.popupWindowHead.window.update();}else{theFrames.modalX=anoX;theFrames.modalY=anoY;window_open(path2statics+ahtm,null,annoParams);}
break;case 'AX':theFrames.ModalTextSRC=As[j].href;if(usingJoust){theFrames.ModalTextSRC=addToUrl(theFrames.ModalTextSRC,theFrames.treelevel);}
var display='DISP'+theFrames.TRCTLUsed;if(isModal() && theFrames.popupWindowHead.window.name.substr(0,4)=='DISP'){if(debugging){debug('LH_FRAME AC=AX already modal');}
theFrames.popupWindowHead.window.Update();}else{theFrames.modalX=bkmX;theFrames.modalY=bkmY;window_open(path2statics+bhtm,display,bookmarkParams);}
break;case 'CN':theFrames.ModalTextSRC=As[j].href;if(usingJoust){theFrames.ModalTextSRC=addToUrl(theFrames.ModalTextSRC,theFrames.treelevel);}
if(isModal() && theFrames.popupWindowHead.window.name=='XFER'){alert('ERROR: LH_FRAME AC=CN already modal');debugger;}
theFrames.modalX=xferX;theFrames.modalY=xferY;window_open(path2statics+'TroveXfer.htm','XFER',xferParams);break;case 'AK':case 'AL':var en=Number(GetUrlParam(As[j].href,'/EN='));if(en>1 && en<9){var doc=GetUrlParam(startURL,'/DI=');if(doc !=-1){doc=doc.replace(/\+/g,' ');doc=unescape(doc);}
switch(en){case 2:theFrames.ModalTextSRC=theMsgs.LHS_ERR_NODOCS;break;case 3:theFrames.ModalTextSRC=theMsgs.LHS_ERR_NOANNOS;break;case 4:theFrames.ModalTextSRC=theMsgs.LHS_ERR_NOBOOKS;break;case 5:theFrames.ModalTextSRC="This document does not exist:\n\n"+doc;break;case 6:theFrames.ModalTextSRC="This document has been deleted:\n\n"+doc;break;case 7:theFrames.ModalTextSRC="You do not have access to this document:\n\n"+doc;break;case 8:var hdng=GetUrlParam(startURL,'/PS=').replace(/\+/g,' ');hdng=unescape(hdng);theFrames.ModalTextSRC="This heading was not found in the document version currently available to you:\n\n"+hdng;break;}
if(en==5||en==6||en==7||en==8){As[j].href=RemoveUrlParam(As[j].href,'/EN=');As[j].href=changeUrlParam(As[j].href,'/AC=','BZ');JoustActivate(As[j].href);}
break;}
if(usingJoust &&(en==1||en==9)){theFrames.searchinError=true;var t=theFrames.TRCTL_href;var di=GetUrlParam(t,'/DS=');if(di==-1){di=GetUrlParam(t,'/DI=');}
if(!theFrames.firstSearch && di==-1){sfURL=As[j].href;var U=SearchFreeURL();U=changeUrlParam(U,'/AC=','BV');U=addToUrl(U,'/SC='+GetUrlParam(As[j].href,'/SC='));amBusyPlusOne();theFrames.LHUpdated++;UpdateFrame('LH',U);}else{sfURL=As[j].href;var U=SearchFreeURL();U=changeUrlParam(U,'/AC=','BZ');U=addToUrl(U,'/SC='+GetUrlParam(As[j].href,'/SC='));if(!jousting){JoustActivate(U);}else{var di=GetUrlParam(theToolbar.search.form.action,'/DI=')
var sv=theToolbar.search.value;if(!(typeof(theTree.currentSearch)=='string' && theTree.currentSearch.toUpperCase()=='UNREAD') && theTree.docCount>1 && di !=-1){if(debugging){alert('As of T40441 and the change to search_onsubmit this code should now never be executed!');}
theFrames.RHSync=false;U=RemoveUrlParam(theToolbar.search.form.action,'/DI=');U=changeUrlParam(U,'/DS=',theMenu.entry[theMenu.firstEntry].TRVDI);U=URLtoURLforSearch(U,sv);theTree.currentSearch=theTree.tgtMenuEntry=0;theTree.toplevelPopulation=theTree.toplevelData=true;theFrames.searchinError=false;debug('Search failed for document performing folder level search: '+U);theFrames.NAVUpdated++;amBusyPlusOne();theFrames.JS.CancelTimeouts(-1);UpdateFrame('NAV',U);}else{if(theTree.docCount>1 && theTree.scrollToId !=-1){theFrames.NAVUpdated++;amBusyPlusOne();theFrames.JS.CancelTimeouts(-1);theFrames.JS.XMLNAVLoad(U);}
}
}
}
}
var ac=GetUrlParam(theFrames.TRCTL_href,'/AC=');var st=GetUrlParam(theFrames.TRCTL_href,'/ST=');if(usingJoust && typeof(theTree.currentSearch)=='string' &&
theTree.currentSearch.toUpperCase()=='UNREAD' && ac !='AP' && st !='ag'){if(debugging){debug('UNREAD not found supressed');}
theFrames.searchinError=false;var di=GetUrlParam(As[j].href,'/DI=');if(di==-1){di=GetUrlParam(As[j].href,'/DS=');}
if(di !=-1){var e=theMenu.findEntry(di,'TRVDI','exact',0);theMenu.entry[e].TRVNoSearchUnread=true;if(debugging){debug('TRVNoSearchUnread = true for '+theMenu.entry[e].text+' ['+e+']');}
}else{debugger;}
break;}
theFrames.ModalTextSRC=(en==1)?theMsgs.LHS_ERR_NOHITS1+theToolbar.search.input.value+theMsgs.LHS_ERR_NOHITS2:theMsgs.LHS_ERR_INVPHRASE;if(GetUrlParam(theFrames.RH_href,'/AC=')=='BW'){btest4ShowAll=true;bdivShowAll=false;}
break;case 'AY':TRCTL_requestUrl(As[j].href);break;case 'BA':if(debugging){debug('TO:'+As[j].href+' FROM:'+theFrames.TRCTL.history.previous);}
break;case 'BV':if(bFLT){JoustActivate(As[j].href);break;}
if(usingJoust){As[j].href=addToUrl(As[j].href,theFrames.treelevel);}
x=-1;break;case 'BY':case 'BZ':if(usingJoust){var fHit=GetUrlParam(As[j].href,'/FH=');if(theFrames.firstSearch && fHit !=-1 && fHit !='0:0' && GetUrlParam(theFrames.TRCTL_href,'/DI=') !=-1){theFrames.TBSearchNext='first';if(debugging){debug('LH frame supressed pending TBSearchNext='+theFrames.TBSearchNext);}
break;}
if(!jousting){JoustActivate(As[j].href);}else{if(!theTree.onLHchange(action,As[j].href)){break;}
if(bFLTActive && action !='BY'){JoustActivate(As[j].href);}
}
}else{x=-1;}
break;default:if(usingJoust && jousting){if(debugging){debug(' *** Killing theTree and theMenu ***')}
PleaseWait();var JS=theFrames.JS;jousting=JS.theTree=theTree=JS.theMenu=theMenu=false;}
x=-1;}
if(x!=-1){break;}
}
if(debugging){debug('LH_FRAME being updated '+x)}
amBusyPlusOne();theFrames.LHUpdated++;;UpdateFrame('LH',As[j].href);break;case 'RH_FRAME':if(dbg5){debug(' RH: '+As[j].href+' refresh='+theFrames.refresh);}
if(theFrames.keep_RH_FRAME){if(typeof(theFrames.haveSelection)=='object'){ScrollIntoView(theFrames.haveSelection);}
theFrames.keep_RH_FRAME=false;if(debugging){debug(' -- RH update suppressed');}
break;}
if(theFrames.RH_href==As[j].href && !theFrames.refresh){if(debugging){debug(' RH: duplicate frame request supressed.');}
doAlert();break;}
var U=As[j].href;if(usingJoust){if(GetUrlParam(U,'/AC=')!='BW'){if(theFrames.LHAPonly){theFrames.LHAPonly=false;if(theTree.docHitCount>0){theFrames.RH_href="";theFrames.TBSearchNext='next';theFrames.ModalTextSRC='';theFrames.firstSearch=false;if(debugging){debug('RH frame supressed pending TBSearchNext='+theFrames.TBSearchNext);}
break;}
}
}
U=addToUrl(U,theFrames.treelevel);}
theFrames.delayRHframe=false;theFrames.RHUpdated++;amBusyPlusOne();UpdateFrame('RH',U);break;case 'PopupText':if(dbg5){debug('PopupText: '+As[j].href);}
theFrames.ModalTextSRC=As[j].href;break;case 'PopupButton':if(dbg5){debug('PopupButton: '+As[j].href);}
theFrames.ModalButtonSRC=As[j].href;displayPopupWindow();break;case 'HelpText':if(dbg5){debug('HelpText: '+As[j].href);}
theFrames.ModalTextSRC=As[j].href;break;case 'HelpButton':if(dbg5){debug('HelpButton: '+As[j].href);}
theFrames.ModalButtonSRC=As[j].href
if(theFrames.modal){if(debugging){debug(' already modal');}
theFrames.modal.Update();}else{sfURL=theFrames.ModalTextSRC;window.showHelp(SearchFreeURL());}
break;default:alert('Unexpected frame in TRCTLFSU: '+As[j].target);}
}
theFrames.searching=theFrames.folderOpenning=false;PostFrameUpdate();amBusyMinusOne();}
function URLSplit(sfu,tok){var u=sfu.split(tok)
return u[0]+u[1];}
function URLtoURLforSearch(url,search){sfURL=url;url=SearchFreeURL();ds=Number(GetUrlParam(url,'/DS='));if(ds !=-1){di=Number(GetUrlParam(url,'/DI='));if(di !=-1){var tok=GetUrlParam(url,'/PA=');url=(tok !=-1)?URLSplit(url,'/PA='+tok):url;url=changeUrlParam(url,'/DS=',di);}
}
var u=changeUrlParam(url,'/ST=','ac');u=changeUrlParam(u,'/AC=','AG');return(search=='')?u:addToUrl(u,'/SC='+search_escape(search));}
function window_open(){var w=false;switch(arguments.length){case 1:w=window.open(arguments[0]);break;case 2:w=window.open(arguments[0],arguments[1]);break;case 3:w=window.open(arguments[0],arguments[1],arguments[2]);break;case 4:w=window.open(arguments[0],arguments[1],arguments[2],arguments[3]);break;default:alert('window_open() incorrent number of arguments passed');debugger;}
if(w==null){alert(theMsgs.POPUPBLOCKER_MSG);}
if((arguments.length>1) &&(arguments[1]=="TroveDebug")){return w;}
PushPopupWindowList(w);return w;}
function xToolbar_button(){this.href;this.id;this.tagName='IMG';this.parentElement=new Object;}
var XMLTB;var XToolbar=false;var XTBHTML='<HTML><BODY>';XTBHTML+='<FORM TARGET=TRCTL METHOD=POST ACTION="" id=XTBfrm name=XTBfrm>';XTBHTML+='<INPUT TYPE=TEXT NAME=searchinput SIZE=25 MAXLENGTH=255>';XTBHTML+='</FORM>';function xToolbar_onreadystatechange(){if(dbg5){debug(XMLTB.readyState);}
if(XMLTB.readyState==4){if(XMLTB.parseError.errorCode !=0){var msg='Toobar XML Parse error: ';msg+=XMLTB.parseError.errorCode+'\n\n';msg+=XMLTB.parseError.reason+'\n';msg+=XMLTB.parseError.srcText;alert(msg);debugger;}
var yesnoAttValue=(theFrames.WV>=4)?'true':'Y';var oButtons=XMLTB.selectNodes('/Toolbar/Element[@Type="Button"]');if(theToolbar.initByIMG==true){theToolbar.initByIMG=false;var j;for(j=0;j<oButtons.length;j++){var oButton=oButtons.item(j);if(typeof(eval('theToolbar.'+oButton.getAttribute('Id'))=='boolean')){eval('theToolbar.'+oButton.getAttribute('Id')+'= -2');}
}
}
if(!XToolbar){XToolbar=true;var doc=theFrames.TOP.document;doc.close();doc.open();doc.write(XTBHTML);var forms=doc.all.tags('FORM');forms[0].onsubmit=search_onsubmit;theToolbar.search.form=forms[0];var inputs=doc.all.tags('INPUT');theToolbar.search.input=inputs[0];inputs[0].onfocus=search_onfocus;if(searchANDOR){inputs[0].onkeyup=search_onkeyup;}
}
var s=XMLTB.selectSingleNode('/Toolbar');theToolbar.search.input.value=s.getAttribute('ActiveSearch');if(jousting && theFrames.searchinError){theToolbar.search.input.value=theToolbar.search.value;}else{theToolbar.search.value=theToolbar.search.input.value;}
var f=XMLTB.selectSingleNode('/Toolbar/Element[@Type="Form"]');theToolbar.search.form.action=f.getAttribute('HRef');var j;for(j=0;j<oButtons.length;j++){var oButton=oButtons.item(j);var buttonName=oButton.getAttribute('Id');var active=(eval('oButton.getAttribute("Active")')==yesnoAttValue)?true:false;if(debugging){debug(buttonName+' Active='+active+'('+oButton.getAttribute('Active')+')');}
var attribName='';switch(buttonName){case 'annotation':attribName='CreateAnno';break;case 'bookmark':attribName='CreateBookmark';break;case 'print':attribName='UserCanPrint';break;default:}
if(attribName !=''){if(debugging){debug(buttonName+' '+attribName+' '+eval('oButton.getAttribute("'+attribName+'")'));}
var canAdd=eval('oButton.getAttribute("'+attribName+'") == yesnoAttValue')?true:false;eval('theToolbar.'+buttonName+'CanAdd = '+canAdd);}
switch(buttonName){case 'backTrack':break;default:if(typeof(eval('theToolbar.'+buttonName))=='boolean'){var btn=eval('theToolbar.'+buttonName+'_img');btn.parentElement.href=btn.href=oButton.getAttribute("HRef");}
}
switch(eval('theToolbar.'+buttonName)){case true:if(active==false||(buttonName=='print' && !theFrames.usersCanPrint)){eval('theToolbar.'+buttonName+'= false');theToolbar.onbuttonstatechange(j,buttonName,false);}else{if(theFrames.ToolbarInitalStatus){theToolbar.onbuttonstatechange(j,buttonName,true);}
if(buttonName=='friendlyURL'||buttonName=='endSearch'){theToolbar.onbuttonstatechange(j,buttonName,true);}
}
break;case false:if(active==true){var a=true;if(buttonName=='print' && !theFrames.usersCanPrint){a=false;}
eval('theToolbar.'+buttonName+'= '+a);if(theFrames.customToolbar){theToolbar.onbuttonstatechange(j,buttonName,a);}
}else{if(theFrames.ToolbarInitalStatus){theToolbar.onbuttonstatechange(j,buttonName,false);}
}
break;case-2:if(typeof(eval('theToolbar.'+buttonName+'CanAdd'))=='boolean'){if(buttonName=='print' && eval('theToolbar.'+buttonName+'CanAdd == false')){theToolbar.onbuttonstatechange(j,buttonName,-2);eval('theToolbar.'+buttonName+'= -3');}
}
switch(buttonName){case 'backTrack':active=false;theToolbar.backTrack_i=j;theToolbar.backTrack=active;theToolbar.onbuttonstatechange(j,'backTrack',active);break;case 'print':if(!theFrames.usersCanPrint){active=theFrames.usersCanPrint;}
default:eval('theToolbar.'+buttonName+'= '+active);var btn=eval('theToolbar.'+buttonName+'_img = new xToolbar_button;');btn.id=buttonName;btn.parentElement.href=btn.href=oButton.getAttribute('HRef');btn.parentElement.target='TRCTL';theToolbar.onbuttonstatechange(j,buttonName,active);}
break;}
}
theFrames.TOPUpdated--;theFrames.TOPdoc=doc;amBusyMinusOne();}
}
var step2list=new Array();step2list["ational"]="ate";step2list["tional"]="tion";step2list["enci"]="ence";step2list["anci"]="ance";step2list["iser"]="ise";step2list["izer"]="ize";step2list["bli"]="ble";step2list["alli"]="al";step2list["entli"]="ent";step2list["eli"]="e";step2list["ousli"]="ous";step2list["ization"]="ize";step2list["isation"]="ise";step2list["ation"]="ate";step2list["ator"]="ate";step2list["alism"]="al";step2list["iveness"]="ive";step2list["fulness"]="ful";step2list["ousness"]="ous";step2list["aliti"]="al";step2list["iviti"]="ive";step2list["biliti"]="ble";step2list["logi"]="log";var step3list=new Array();step3list["icate"]="ic";step3list["ative"]="";step3list["alize"]="al";step3list["alise"]="al";step3list["iciti"]="ic";step3list["ical"]="ic";step3list["ful"]="";step3list["ness"]="";var c="[^aeiou]";var v="[aeiouy]";var C=c+"[^aeiouy]*";var V=v+"[aeiou]*";var mgr0="^("+C+")?"+V+C;var meq1="^("+C+")?"+V+C+"("+V+")?$";var mgr1="^("+C+")?"+V+C+V+C;var s_v="^("+C+")?"+v;function stemWord(w){var stem;var suffix;var firstch;var origword=w;if(w.length<3){return w;}
var re;var re2;var re3;var re4;firstch=w.substr(0,1);if(firstch=="y"){w=firstch.toUpperCase()+w.substr(1);}
re=/^(.+)(ss|i)es$/;re2=/^(.+)([^s])s$/;if(re.test(w)){w=w.replace(re,"$1$2");}
else if(re2.test(w)){w=w.replace(re2,"$1$2");}
re=/^(.+)eed$/;re2=/^(.+)(ed|ing)$/;if(re.test(w)){var fp=re.exec(w);re=new RegExp(mgr0);if(re.test(fp[1])){re=/.$/;w=w.replace(re,"");}
}else if(re2.test(w)){var fp=re2.exec(w);stem=fp[1];re2=new RegExp(s_v);if(re2.test(stem)){w=stem;re2=/(at|bl|iz|is)$/;re3=new RegExp("([^aeiouylsz])\\1$");re4=new RegExp("^"+C+v+"[^aeiouwxy]$");if(re2.test(w)){w=w+"e";}
else if(re3.test(w)){re=/.$/;w=w.replace(re,"");}
else if(re4.test(w)){w=w+"e";}
}
}
re=/^(.+)y$/;if(re.test(w)){var fp=re.exec(w);stem=fp[1];re=new RegExp(s_v);if(re.test(stem)){w=stem+"i";}
}
re=/^(.+)(ational|tional|enci|anci|iser|izer|bli|alli|entli|eli|ousli|isation|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;if(re.test(w)){var fp=re.exec(w);stem=fp[1];suffix=fp[2];re=new RegExp(mgr0);if(re.test(stem)){w=stem+step2list[suffix];}
}
re=/^(.+)(icate|ative|alise|alize|iciti|ical|ful|ness)$/;if(re.test(w)){var fp=re.exec(w);stem=fp[1];suffix=fp[2];re=new RegExp(mgr0);if(re.test(stem)){w=stem+step3list[suffix];}
}
re=/^(.+)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ise|ize)$/;re2=/^(.+)(s|t)(ion)$/;if(re.test(w)){var fp=re.exec(w);stem=fp[1];re=new RegExp(mgr1);if(re.test(stem)){w=stem;}
}else if(re2.test(w)){var fp=re2.exec(w);stem=fp[1]+fp[2];re2=new RegExp(mgr1);if(re2.test(stem)){w=stem;}
}
re=/^(.+)e$/;if(re.test(w)){var fp=re.exec(w);stem=fp[1];re=new RegExp(mgr1);re2=new RegExp(meq1);re3=new RegExp("^"+C+v+"[^aeiouwxy]$");if(re.test(stem)||(re2.test(stem) && !(re3.test(stem)))){w=stem;}
}
re=/ll$/;re2=new RegExp(mgr1);if(re.test(w) && re2.test(w)){re=/.$/;w=w.replace(re,"");}
if(firstch=="y"){w=firstch.toLowerCase()+w.substr(1);}
return w;}