

// UDMv4.5 // You Are Here extension v1.13 //
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake
  http://www.udm4.com/

\***************************************************************/

/***************************************************************\
 * Set you are here parameters
\***************************************************************/

var youAreHere=[
	"home",		// default page name [eg "index.php", "default.html" etc]
	"none",	// add text to here-page title ["text"|"none"]
	"none", // add text to here-branch title ["text"|"none"]
	"before",		// where to add title text ["before"|"after"]
	"no",			// open here-branch menus automatically ["yes"|"no"]
	];

/***************************************************************\
\***************************************************************/
var yah=new Object;yah.addToTitle=function(titleNode,titleText){yah.iText='';yah.nodes=titleNode.childNodes;yah.nodesLen=yah.nodes.length;for(i=0; i<yah.nodesLen; i++){if(yah.nodes[i].nodeType==3){yah.iText=yah.nodes[i].nodeValue;break;}}yah.title=(titleNode.title=='') ? yah.iText : titleNode.title;yah.title=(youAreHere[3]=='before') ? titleText + yah.title : yah.title + titleText;titleNode.title=yah.title;};function compareNumbers(a,b){return b[0]-a[0];};if(typeof window.onload=='function'){um.yon=onload;window.onload=function(){um.yon();findHere();};}else{window.onload=findHere;}function findHere(){var tree=document.getElementById('udm');if(!tree){return false;}yah.uri=top.document.location.href.replace('https://','http://');yah.uri=yah.uri.replace(youAreHere[0],'');yah.uri=yah.uri.replace(/,/g,'%2C');yah.matches=[];yah.links=tree.getElementsByTagName('a');yah.linksLen=yah.links.length;for(var i=0; i<yah.linksLen; i++){yah.href=yah.links[i].href.replace('https://','http://');if(yah.href&&yah.href!=um.jv&&!/[a-z]+\:\/\//.test(yah.href)){yah.matches=[];break;}yah.href=yah.href.replace(youAreHere[0],'');yah.href=yah.href.replace(/,/g,'%2C');if(yah.href!=''&&yah.href!=um.jv&&yah.uri.indexOf(yah.href)!=-1){yah.matches[yah.matches.length]=yah.links[i];}}yah.matchesLen=yah.matches.length;if(yah.matchesLen < 1) { return false; }yah.probs=[];for(i=0; i<yah.matchesLen; i++){yah.href=yah.matches[i].href.replace('https://','http://');yah.hrefLen=yah.href.length;yah.probs[i]=[0,yah.href];for(var j=0; j<yah.hrefLen; j++){if(yah.href.charAt(j)==yah.uri.charAt(j)){yah.probs[i][0]++;}}}yah.probs.sort(compareNumbers);yah.href=yah.probs[0][1];for(i=0; i<yah.linksLen; i++){yah.linkref=yah.links[i].href.replace('https://','http://');if(yah.linkref==yah.href){if(youAreHere[1]!='none'){yah.addToTitle(yah.links[i],youAreHere[1]);}applyHereClass(yah.links[i]);}}return true;};function applyHereClass(link){link.style.zIndex=um.e[6]+=2;yah.cname=um.es(link.className);(yah.cname=='')?link.className='udmY':link.className+=' udmY';if(youAreHere[2]!='none'){if(link.title.indexOf(youAreHere[1])==-1){yah.addToTitle(link,youAreHere[2]);}}yah.ppc=um.es(um.gp(link).parentNode.className);yah.isNav=yah.ppc=='udm';if(youAreHere[4]=='yes'&&!yah.isNav){yah.pm=um.gp(link).parentNode;yah.pm.style.height='auto';yah.pm.style.overflow='visible';yah.pm.style.left='auto';yah.pm.style.top='0';if(um.ep){yah.pm.style.position='static';}um.xd(yah.pm);if(!um.mie&&um.e[89]!='none'){um.kl=yah.pm.childNodes.length;i=0;do{um.tn=yah.pm.childNodes.item(i);um.nn=um.vn(um.tn.nodeName).toLowerCase();if(um.nn=='li'){um.ar=um.n.ga(um.gc(um.tn));if(um.ar!=null){um.n.wp(um.ar,um.tn,um.e[70],0,0);}}i++;}while(i<um.kl);}um.sh=null;if(!um.ns&&um.e[58]!='none'){um.n.hl(yah.pm);um.xd(um.sh);}if(um.wie55&&(um.e[13]=='default'||um.e[13]=='iframe')){um.n.il(yah.pm);}if(um.hz){um.n.ts('hidden');}um.xv(yah.pm);}yah.arrow=(!um.mie&&typeof um.n.ga=='function')?um.n.ga(link):null;if(yah.arrow!=null){if(um.s||um.k){yah.arrow=yah.arrow.firstChild;}if((yah.isNav&&um.ni)||(!yah.isNav&&um.mi)){yah.pic=um.es(um.gp(link).className);yah.arrow.src=um.baseSRC+((yah.isNav)?um.e[46]:(typeof um.w[yah.pic]!=um.un)?um.w[yah.pic][24]:um.e[90]);}}if(!yah.isNav){yah.link=um.gc(um.gp(link).parentNode.parentNode);applyHereClass(yah.link);}};

// UDMv4.5 // Active Styles extension v1.01 //
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake
  http://www.udm4.com/
  
\***************************************************************/
um.addReceiver(function(link){if(link!=''&&link!=um.jv){if(link.className==null){link.className='';}(link.className=='')?link.className='active':link.className+=' active';}link.blur();link.style.MozUserFocus='none';},'030');um.addReceiver(removeActiveClass,'035');um.addReceiver(removeActiveClass,'025');function removeActiveClass(link){link.className=link.className.replace(/[ ]?active/g,'');link.blur();link.style.MozUserFocus='';}

// UDMv4.5 // Auto-Sizing Menus extension v1.0 //
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake
  http://www.udm4.com/
  
\***************************************************************/

/***************************************************************\
* Set autosizing parameters
\***************************************************************/

um.autosizing = [
	'0', 		// leeway space ["n" pixels]
	'auto', 	// max-width ["px"|"auto"]
	'auto', 	// min-width ["px"|"auto"]
	'no', 		// size first-level submenus to parent link ["yes"|"no"]
	];

/***************************************************************\
\***************************************************************/
var ats=new Object;um.addReceiver(autoSizeMenu,'058');ats.compare=function(a,b){return b-a;};ats.getRelatedLayer=function(menuNode,menuClass){ats.node=menuNode.parentNode.lastChild;if((um.wie55&&(um.e[13]=='default'||um.e[13]=='iframe')&&menuClass=='udmS')||ats.node.nodeName=='#text'){ats.node=ats.node.previousSibling;}ats.noc=um.es(ats.node.className);if(ats.noc!=''){if(ats.noc.indexOf(menuClass)!=-1){return ats.node;}else{return null;}}else{return null;}};function autoSizeMenu(menu){menu.style.visibility='hidden';menu.layer=ats.getRelatedLayer(menu,'udmS');if(menu.layer!=null){menu.layer.style.visibility='hidden';}ats.nodes=menu.childNodes;ats.nodesLen=ats.nodes.length;ats.boxdiff=um.e[51]*2+um.e[55]*2;ats.ppc=um.es(menu.parentNode.parentNode.className);if(um.autosizing[3]=='yes'&&ats.ppc=='udm'){ats.longest=menu.parentNode.offsetWidth+um.pi(um.autosizing[0])-((um.q&&!um.mie)?0:ats.boxdiff);}else{ats.widths=[];for(var i=0;i<ats.nodesLen;i++){if(ats.nodes[i].nodeName!='#text') {ats.link=um.gc(ats.nodes[i]);if(um.wie50){ats.link.style.width='1em';ats.html=ats.link.innerHTML;ats.link.innerHTML='<nobr style="letter-spacing:0;">'+ats.html+'</nobr>';ats.widths[ats.widths.length]=ats.link.offsetWidth;ats.link.innerHTML=ats.html;ats.link.style.width='100%';}else{ats.link.style.display='inline';ats.link.style.whiteSpace='nowrap';ats.widths[ats.widths.length]=ats.link.offsetWidth;ats.link.style.display='block';ats.link.style.whiteSpace='normal';}}}ats.widths=ats.widths.sort(ats.compare);ats.longest=ats.widths[0]+um.pi(um.autosizing[0])+(um.q?ats.boxdiff:0)+um.e[61]*2+(um.e[89]!='none'?um.e[91]:0);if(um.autosizing[1]!='auto'&&(ats.longest-(um.q?0:ats.boxdiff))>um.pi(um.autosizing[1])){ats.longest=um.pi(um.autosizing[1])-(um.q?0:ats.boxdiff);}if(um.autosizing[2]!='auto'&&(ats.longest-(um.q?0:ats.boxdiff))<um.pi(um.autosizing[2])){ats.longest=um.pi(um.autosizing[2])-(um.q?0:ats.boxdiff);}}menu.style.width=ats.longest+'px';for(i=0;i<ats.nodesLen;i++){if(ats.nodes[i].nodeName!='#text') {ats.ar=(!um.mie&&typeof um.n.ga=='function')?um.n.ga(um.gc(ats.nodes[i])):null;if(ats.ar!=null){um.n.wp(ats.ar,ats.nodes[i],um.e[70],um.e[62],0);}}}menu.layers=['udmS','udmC'];for(i=0;i<2;i++){menu.layer=ats.getRelatedLayer(menu,menu.layers[i]);if(menu.layer!=null){menu.layer.style.width=menu.offsetWidth+'px';menu.layer.style.height=menu.offsetHeight+'px';menu.layer.style.visibility='visible';}}menu.style.visibility='visible';};

// UDMv4.5 //
///////////////////////////////////////////////////////////////////
//                                                               //
//  ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake          //
//  http://www.udm4.com/                                         //
//                                                               //
//  This script may not be used or distributed without license   //
//                                                               //
///////////////////////////////////////////////////////////////////
function umKM(){um.kbm=this;um.ha=0;um.fkd=0;um.tf=null;um.mt=[um.e[10],um.e[11]];if(um.kb&&um.m.cookie){var f=[um.gd('hotkeySelector'),um.gd('modifierSelector')];var c=um.m.cookie.split(';');var n=c.length;i=0;do{if(/udmKeyPrefs/.test(c[i])){var a=c[i].split('=')[1].split(',');j=0;do{um.keys[j+4]=a[j];if(f[j]){var z=f[j].options;var l=z.length;var k=0;do{if(z[k].value==a[j]){z[k].selected=1;break;}k++;}while(k<l);}j++;}while(j<2);break;}i++;}while(i<n);}};um.keyPrefs=function(){if(!(um.kb&&um.d)){alert('Sorry, this feature is not supported in your browser.');return false;}var d=new Date();d.setTime(d.getTime()+(365*24*60*60*1000));um.m.cookie='udmKeyPrefs=test; expires='+d.toGMTString()+'; path=/';if(!um.m.cookie){alert('Sorry, your browser didn\'t accept the cookie.\nWe cannot save your settings.');}else{var f=[um.gd('hotkeySelector'),um.gd('modifierSelector')];i=0;do{um.keys[i+4]=f[i].options[f[i].options.selectedIndex].value;i++;}while(i<2);um.m.cookie='udmKeyPrefs='+um.keys[4]+','+um.keys[5]+'; expires='+d.toGMTString()+'; path=/';alert('Save successful!');}return true;};umKM.prototype.bdh=function(){if(typeof document.addEventListener!=um.un){if(um.s){var self=this;document.addEventListener('keydown',function(e){if(um.fkd){return;}um.fkd=1;self.kha(e);},0);document.addEventListener('keyup',function(){um.fkd=0;},0);}else{document.addEventListener('keypress',this.kha,0);}}else{document.attachEvent('onkeydown',this.kha);}};umKM.prototype.bfh=function(){document.addEventListener('mouseover',function(e){if(um.ha&&um.kdf&&!umTree.contains(e.target)){um.cm(e);um.ha=0;}},0);};umKM.prototype.bth=function(l){var a=um.gc(l);var c=um.es(a.className);if(/nohref/i.test(c)){um.kbm.cdl(a);}if(um.ie) { return false; }a.addEventListener('focus',function(e){if((!um.o7&&!um.lf)||(um.o7&&um.kdf)){um.bub=0;l.over(1,e.target);}},0);return true;};umKM.prototype.cu=function(m,l,t){var v=[null,null,null];if((m!=null&&m.style.visibility!='visible')||m==null){if(l.previousSibling){v[0]=l.previousSibling;}if(l.nextSibling){v[1]=l.nextSibling;}}m=(um.gu(um.gp(t)).length>0)?um.gu(um.gp(t))[0]:null;if(m!=null&&typeof m.style!=um.un&&m.style.visibility=='visible'){var r=m.getElementsByTagName('li');var n=r.length;j=0;do{v[v.length]=r[j++];}while(j<n);}if(um.tf!=null){r=um.gp(um.tf).parentNode.lastChild;if(um.gp(um.tf)==r){um.n.lr(um.gc(r),0);}}n=v.length;i=0;do{if(v[i]!=null){if(um.gu(v[i]).length>0){um.n.cp(um.gu(v[i])[0],v[i]);}else{um.n.cp(null,v[i]);}}i++;}while(i<n);};umKM.prototype.cdl=function(l){l.href=um.jv;l.style.cursor='default';};umKM.prototype.mkc=function(k){for(i=1;i<4;i+=2){if(k==um.keys[i]){k=um.keys[4-i];break;}}return k;};umKM.prototype.kha=function(e){if(!e){e=window.event;}k=e.keyCode;if(!um.kb&&k!=9){return false;}if(k==um.keys[6]){um.ha=1;}if((k==um.keys[4]&&((um.keys[5]=='none'&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey)||e[um.keys[5]]))||(k==um.keys[6])){um.e[10]=1;um.e[11]=1;if(!um.ha){um.cm(e);um.fl.focus();um.ha=1;um.ap('080',um.tr);}else{if(um.sp){um.sapi.voice.Speak(um.vocab[8],2);}um.cm(e);if(um.wie50&&um.e[13]=='yes'){um.n.ts('visible');}eval(um.keys[7]).focus();um.e[10]=um.mt[0];um.e[11]=um.mt[1];um.ha=0;um.ap('090',um.tr);}}var a=(e.target)?e.target:e.srcElement;if(um.tr.contains(a)){um.e[10]=1;um.e[11]=1;var c=um.es(um.gp(a).parentNode.className);if((um.h&&c=='udm')||typeof um.hmx=='boolean'){if(um.nm&&(k==um.keys[0]||k==um.keys[2])){return false;}i=0;do{if(k==um.keys[i]){k=um.keys[um.rtl?(i-1):(3-i)];break;}i++;}while(i<4);}else{if(um.nm&&(k==um.keys[1]||k==um.keys[3])){return false;}var t=um.gp(a).parentNode;if(um.a||um.e[12]=='yes'){c=um.es(t.className);if(um.gu(um.gp(a))[0]){um.xm=um.gu(um.gp(a))[0];if(um.getRealPosition(um.xm,'x')<um.getRealPosition(t,'x')){k=um.kbm.mkc(k);}}else if(c!='udm'){um.pm=um.gp(t).parentNode;if(um.getRealPosition(um.pm,'x')>um.getRealPosition(t,'x')){k=um.kbm.mkc(k);}}}}um.tf=null;var l=umTree.getElementsByTagName('li');var n=l.length;switch(k){case 9 :i=0;do{if(l[i]==um.gp(a)){um.tf=a;if(e.shiftKey){var p=(i==0)?-1:i-1;}else{p=((i+1)==n)?-1:i+1;}if(p<=-1){setTimeout('um.closeAllMenus()',55);}break;}i++;}while(i<n);break;case um.keys[0] :if(um.gp(a).previousSibling){var s=um.gp(a).previousSibling;if(s){t=um.gc(s);var f=(typeof t!=um.un)?t:null;if(f){f.focus();}}}else if(um.gp(a).parentNode.childNodes.length>1){um.n.cp(um.gu(um.gp(a))[0],um.gp(a));t=um.gc(um.gp(a).parentNode.lastChild);f=(um.gp(a).parentNode.className!='udm');if(f&&um.h&&um.gp(um.gp(a).parentNode).parentNode.className=='udm'){t=um.gc(um.gp(um.gp(a).parentNode));}t.focus();}um.ap('100',a);if(um.ie){return false;}else if(e){e.preventDefault();}break;case um.keys[1] :if(um.gu(um.gp(a))[0]){t=um.gu(um.gp(a))[0];f=(t)?um.gc(t):null;if(f){f.focus();}}um.ap('101',a);if(um.ie){return false;}else if(e){e.preventDefault();}break;case um.keys[2] :if(um.gp(a).nextSibling){s=um.gp(a).nextSibling;if(s){t=um.gc(s);f=(typeof t!=um.un)?t:null;if(f){f.focus();}}}else if(um.gp(a).parentNode.childNodes.length>1){um.n.cp(um.gu(um.gp(a))[0],um.gp(a));um.gc(um.gp(a).parentNode.firstChild).focus();}um.ap('102',a);if(um.ie){return false;}else if(e){e.preventDefault();}break;case um.keys[3] :if(um.gp(a).parentNode.parentNode){t=um.gp(a).parentNode;f=(t.className=='udm')?null:um.gc(um.gp(t));if(f&&(typeof f.focus=='function'||typeof f.focus=='object')){f.focus();}}um.ap('103',a);if(um.ie){return false;}else if(e){e.preventDefault();}break;}}return true;};umKM.prototype.cws=function(n){if(um.mie){return false;}for(var x=0;x<n.childNodes.length;x++){var k=n.childNodes[x];if((k.nodeType==3)&&(!/\S/.test(k.nodeValue))){n.removeChild(n.childNodes[x]);x--;}if(k.nodeType==1){this.cws(k);}}return n;};

// UDMv4.5 // Keyboard Navigation Help extension v1.12 //
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.5 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;}};