//~ pcTMsync.js - sychronise tree menu with content page.
//~ Copyright 2002 Philip Chalmers, all rights reserved
//~ (web site www.benefit-from-it.co.uk):
function _TMsyncRefresh(){if(parent.theMenu.amBusy){setTimeout('_TMsyncRefresh()',100);}else{parent.theMenu.refresh();}}function TMsync(){if(!parent.theMenu||parent.theMenu.amBusy)setTimeout('TMsync()',100);else if(parent.theBrowser.canTM){var searchVal=parent.fixPath(location.pathname);var entryID=parent.theMenu.findEntry(searchVal,'url','right',0);if(entryID>=0){parent.theMenu.selectEntry(entryID);parent.theMenu.currDoc=entryID;if(parent.theMenu.setEntry(entryID,true))_TMsyncRefresh();}else{var protocolSplit=searchVal.split('://');var pathSplit=protocolSplit[protocolSplit.length-1].split('/');var lowDir=(pathSplit.length>1)?pathSplit[pathSplit.length-2]:'';var newURL='';switch(parent.theFrames.FSid){case 'bfitwdu01':newURL='../../dyn_menus/wdu01'+lowDir+'.htm';break;case 'bfituk':newURL='../dyn_menus/main'+lowDir+'.htm';break;default:break;}if(newURL !=''){var oFrDyn=eval('parent.'+parent.theFrames.dynFrName);newURL+='?syncpage='+escape(parent.fixPath(location.pathname));if(document.images){oFrDyn.location.replace(newURL);}else{oFrDyn.location.href=newURL;}}}}}TMsync();
