// UDMv4.45 // Keyboard Navigation Help extension v1.12 //
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.45 by Brothercake
  http://www.udm4.com/
  
\***************************************************************/

/***************************************************************\
 * Set help text: must be plain-text only, no entitites or HTML 
 * Do not change where it says "<hotkey>"
\***************************************************************/

var helpText = ''
             + 'The "<hotkey>" key sends focus to the navigation bar. '
             + 'You can move around the menus with the Arrow Keys,  '
             + 'activate a link by pressing "Enter", '
             + 'or jump back onto the page with "<hotkey>" again. '
             + '';
		
/***************************************************************\
 * Show a permanent hotkey icon ("yes")
 * Or only show it until instructions have been displayed ("no")
\***************************************************************/

var permanentIcon = 'yes';

/***************************************************************\
\***************************************************************/
var kn=new Object;kn.hlp=null;um.addReceiver(addButton,'010');um.addReceiver(showHelp,'040');function addButton(navbar){if(um.kb){kn.mod={'metaKey':'Cmd-','altKey':'Alt-','ctrlKey':'Ctrl-','shiftKey':'Shft-','none':''};kn.txt=kn.mod[um.keys[5]]+'F'+(um.keys[4]-111);if(um.m.cookie&&/udmKeyPrefs/.test(um.m.cookie)){kn.ck=um.m.cookie.split('udmKeyPrefs=');kn.ck=kn.ck[1].split(';');kn.ck=kn.ck[0].split(',');kn.txt=kn.mod[kn.ck[1]]+'F'+(parseInt(kn.ck[0],10)-111);}if(!um.m.cookie ||!/udmKeyHelp=done/.test(um.m.cookie)||permanentIcon!='no'){kn.fl=navbar.getElementsByTagName('a')[0];kn.at={'text':kn.txt};kn.but=um.createElement('kbd',kn.at);kn.fl.appendChild(kn.but);}}};function showHelp(link){if(um.kb&&link==um.gc(umTree)){if(!um.m.cookie||!/udmKeyHelp=done/.test(um.m.cookie)){kn.at={'id':'udmKeyHelp'};kn.hlp=um.createElement('p',kn.at);helpText=helpText.replace(/<hotkey>/g,kn.txt);kn.hlp.appendChild(um.m.createTextNode(helpText));um.m.getElementsByTagName('body')[0].appendChild(kn.hlp);kn.hlp.style.left=(um.getRealPosition(umTree,'x')+((um.h)?0:((um.a)?(0-kn.hlp.offsetWidth):umTree.offsetWidth)))+'px';kn.hlp.style.top=(um.getRealPosition(umTree,'y')+((um.h)?umTree.offsetHeight:0))+'px';kn.dd=new Date();kn.dd.setTime(kn.dd.getTime()+(30*24*60*60*1000));um.m.cookie='udmKeyHelp=done; expires='+kn.dd.toGMTString()+'; path=/';}}else{removeHelp();}};um.addReceiver(checkRemoval,'');function checkRemoval(eobj,eco){if(kn.hlp!=null){eco=parseInt(eco,10);if((eco>=100&&eco<=103)||eco==90||eco==20){removeHelp();}}};if(typeof um.m.addEventListener!=um.un){um.m.addEventListener('mousedown',removeHelp,false);}else if(typeof um.m.attachEvent!=um.un){um.m.attachEvent('onmousedown',removeHelp);}function removeHelp(){if(kn.hlp!=null){um.m.getElementsByTagName('body')[0].removeChild(kn.hlp);if(permanentIcon=='no'){kn.fl.removeChild(kn.but);}kn.hlp=null;}};
