/*
Nornix TreeMenu JavaScript with common routines  <http://treemenu.nornix.com/>
Version: 2.3.1 (2008-05-14) (common routines 0.5 (2008-05-14))
Build time: 2008-05-14 20:53 UTC
*/
if(!Nornix){var Nornix={events:{},cookies:{},css:{},dom:{},util:{}}}if(document.addEventListener){Nornix.events.add=function(D,C,B,A){D.addEventListener(C,B,A)};Nornix.events.remove=function(D,C,B,A){D.removeEventListener(C,B,A)}}else{if(document.attachEvent){Nornix.events.add=function(C,B,A){C["e"+B+A]=A;C[B+A]=function(){var D=window.event;D.target=window.event.srcElement;C["e"+B+A](D)};C.attachEvent("on"+B,C[B+A])};Nornix.events.remove=function(C,B,A){C.detachEvent("on"+B,C[B+A]);C[B+A]=null;C["e"+B+A]=null}}else{Nornix.events.add=Function;Nornix.events.remove=Function}}Nornix.events.cancel=function(A,B){A.returnValue=false;if(A.preventDefault){A.preventDefault()}if(B){A.cancelBubble=true;if(A.stopPropagation){A.stopPropagation()}}};Nornix.events.delayedInit=function(E,D,A){var B;if(A===undefined){A=10}var C=window.setInterval(function(){if(B=document.getElementById(E)){window.clearInterval(C);D(B)}},A)};Nornix.cookies.create=function(C,D,E){var A;if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));A="; expires="+B.toGMTString()}else{A=""}document.cookie=C+"="+D+A+"; path=/"};Nornix.cookies.read=function(B){var D=B+"=";var A=document.cookie.split(";"),C=0,E;while(E=A[C++]){E=Nornix.util.trim(E);if(E.indexOf(D)===0){return E.substring(D.length,E.length)}}return""};Nornix.cookies.erase=function(A){createCookie(A,"",-1)};Nornix.css.swap=function(D,E,F){if(!D){return }if(!D.className||D.className.length===0){D.className=F?F:"";return }var A=D.className.split(" "),C=0,B;while(B=A[C++]){if(B===E){if(F){A[C-1]=F;D.className=A.join(" ");return }else{delete A[C-1];D.className=A.join(" ");return }}else{if(B===F){D.className=A.join(" ");return }}}if(F){A[A.length]=F}D.className=A.join(" ")};Nornix.css.add=function(B,A){return Nornix.css.swap(B,null,A)};Nornix.css.remove=function(B,A){return Nornix.css.swap}();Nornix.css.contains=function(E,D){if(!E||!E.className){return false}var A=E.className.split(" "),C=0,B;while(B=A[C++]){if(B===D){return true}}return false};Nornix.css.getPos=function(A){var B={x:A.offsetLeft||0,y:A.offsetTop||0};while(A=A.offsetParent){B.x+=A.offsetLeft||0;B.y+=A.offsetTop||0}return B};Nornix.css.getProperty=function(B,A){if(window.getComputedStyle){return function(D,C){return window.getComputedStyle(D,"").getPropertyValue(C)}}return function(D,C){return D.currentStyle?D.currentStyle[Nornix.css.prop2Js(C)]:null}}();Nornix.css.prop2Js=function(E){var A=E.split("-");if(A.length>1){var D=A[0],C=1,B;while(B=A[C++]){D+=B.charAt(0).toUpperCase()+B.substr(1)}return D}return E};Nornix.dom.live2copy=function(D){var C=[],A=0,B;while(B=D[A++]){C[C.length]=B}return C};Nornix.dom.getTextContent=function(A){if(typeof A.textContent!="undefined"){return A.textContent}else{return A.innerText}};Nornix.dom.imagePreload=function(H,J,I){if(Nornix.cookies.read("preImg")){return }var D=0,E,C=[],B=0,F=H.length,A;function G(){B++;if(B===F){C=null;Nornix.cookies.create("preImg","x")}}while(E=H[D++]){A=new Image();A.onload=G;A.src=J+E+I;C[D]=A}};Nornix.dom.findChildOfType=function(B,F,C,A){var E;if(!A){var D=0;while(E=B.childNodes[D++]){if(Nornix.dom.eqNodeName(E,F)){return C(E)}}}else{var D=B.childNodes.length-1;while(E=B.childNodes[D--]){if(Nornix.dom.eqNodeName(E,F)){return C(E)}}}};Nornix.dom.eqNodeName=function(A,B){if(A&&A.nodeName&&A.nodeName.toLowerCase()===B){return true}return false};Nornix.util.trim=function(A){return A.replace(/^\s*|\s*$/g,"")};Nornix.util.isIe=document.all&&window.opera===undefined;Nornix.TreeMenu=function(O,V){var A=this;var Q=O?O:"menu";var e=(V===false)?false:true;var g="tree"+Q;var z=Nornix.cookies.read(g);var F=false;var AB=window.location+"#";var B=document.createElement("ul");var AF=document.createElement("li");var U=document.createElement("span");var Z=document.createElement("a");var y=Z.cloneNode(false);var C=[];var R={};var J=[];var n=null;var M=null;var p=null;var a=/(^| )open( |$)/;this.openAll=l;this.closeAll=T;this.openToNode=W;this.start=function(){if(!document.getElementById||!document.createElement){return }Nornix.events.delayedInit(Q,w);y.href="javascript:;";if(A.config.preloadImages&&!Nornix.util.isIeLt7){Nornix.dom.imagePreload(A.config.preloadImages,A.config.imagePath,A.config.imageExtension)}};this.preventStatusSave=function(){F=true};this.registerMenuButton=function(AG,AH){C[C.length]=AG;J[J.length]=AH};this.createNode=function(AK,AI,AJ){var AG=AF.cloneNode(false);AG.className="document";var AH=Z.cloneNode(false);if(AI){AH.href=AI}if(AJ){AH.title=AJ}AH.appendChild(document.createTextNode(AK));AG.appendChild(AH);return AG};this.appendChild=function(AK,AJ,AG,AI,AH){d(function(AO,AN,AL){var AM;Nornix.css.add(AN,"last");if(AO.nextSibling&&Nornix.dom.eqNodeName(AO.nextSibling,"ul")){AM=AO.nextSibling;Nornix.css.add(AN,"last");AA(AO.parentNode,AO,AL)}else{AM=B.cloneNode(false);var AP=AO.parentNode;AP.appendChild(AM);AA(AP,AO,AL);A.menuFolders[A.menuFolders.length]=AP}AM.appendChild(AN);if(AN.previousSibling){Nornix.css.remove(AN.previousSibling,"last")}},AK,AJ,AG,AI,AH)};this.insertBefore=function(AK,AJ,AG,AI,AH){d(function(AM,AL){AM.parentNode.parentNode.insertBefore(AL,AM.parentNode)},AK,AJ,AG,AI,AH)};this.insertAfter=function(AK,AJ,AG,AI,AH){d(function(AM,AL){if(AM.parentNode.nextSibling){AM.parentNode.parentNode.insertBefore(AL,AM.parentNode.nextSibling)}else{AM.parentNode.parentNode.appendChild(AL)}},AK,AJ,AG,AI,AH)};this.remove=function(AG){AG=Y(AG);if(!AG||!AG.parentNode||!AG.parentNode.parentNode){return }H(AG.parentNode);AG.parentNode.parentNode.removeChild(AG.parentNode);c()};this.goToFirstNode=function(){K("first")};this.goToLastNode=function(){K("last")};this.goToNextNode=function(){K("next")};this.goToPrevNode=function(){K("previous")};function w(AG){A.menu=AG;A.menuElements=Nornix.dom.live2copy(A.menu.getElementsByTagName("li"));E();G();if(A.config.openCloseAll){S()}if(A.config.navigationIcons){P()}r();if(A.config.navigationIcons){j()}}function r(){AK();function AK(){if(A.config.menuLinkElement){Nornix.events.add(document.getElementById(A.config.menuLinkElement),"click",AG);if(Nornix.util.isIe){Nornix.events.add(document.getElementById(A.config.menuLinkElement),"focus",AJ)}}if(e){N(A.menu);e=false}Nornix.events.add(A.menu,"click",AI,true);Nornix.events.add(A.menu,"keydown",AH,true);Nornix.events.add(window,"unload",X)}function AG(AL){q(A.menu);Nornix.events.cancel(AL);return false}function AJ(AL){if(AL.altKey){q(A.menu)}}function AI(AO){var AM=AO.target;if(Nornix.css.contains(AM,"menuAction")){var AL=C.length;while(AL--){if(AM===C[AL]){J[AL]();break}}Nornix.events.cancel(AO);return false}var AN=AM.parentNode;if(!AN){return true}if(Nornix.dom.eqNodeName(AM,"span")){h(AN);return }return L(AN,AM,AO)}function AH(AS){var AO,AU,AQ,AR,AP,AV,AT,AM=AS.target,AL=AM.parentNode,AN;switch(true){case Nornix.css.contains(AM,"root"):AO=true;break;case Nornix.css.contains(AM,"closeTree"):AR=true;AT=true;break;case Nornix.css.contains(AM,"openTree"):AP=true;AT=true;break;case Nornix.css.contains(AL,"folder"):AU=true;AV=true;break;case Nornix.css.contains(AL,"document"):AQ=true;AV=true;break;default:return true}var AW=AS.keyCode!==null?AS.keyCode:AS.which;if(AW===56){l()}else{if(AW===57){T(AM);if(!AM.offsetParent){Nornix.dom.findChildOfType(A.menu,"a",function(AX){s(AX)})}}else{if(AU&&(AW===32||(AW===13&&AE(AM)))){h(AL)}else{if(AO&&AW===40){Nornix.dom.findChildOfType(AL,"ul",function(AX){q(AX.firstChild)})}else{if(AO&&AW===39&&AM.nextSibling){s(AM.nextSibling)}else{if(AV&&(AW===40)){if(AQ||!D(AL)){if(AN=AL.nextSibling){q(AN)}else{if(AU&&(AN=AM.nextSibling.firstChild)){h(AL);q(AN)}else{AN=AL;while(AN&&AN!==A.menu){AN=AN.parentNode.parentNode;if(AN.nextSibling){q(AN.nextSibling);break}}}}}else{if(AN=AL.nextSibling){q(AN)}else{if(AN=AM.nextSibling.firstChild){q(AN)}}}}else{if(AV&&(AW===38)){if(AN=AL.previousSibling){q(AN)}else{if(AN=AL.parentNode.parentNode){q(AN)}}}else{if(AV&&(AW===39)){if(AQ&&(AN=AL.nextSibling)){q(AN)}else{if(AM.nextSibling&&(AN=AM.nextSibling.firstChild)){if(D(AL)){q(AN)}else{h(AL);q(AN)}}}}else{if(AV&&(AW===37)){if(AN=AL.parentNode.parentNode){q(AN)}if(AU&&D(AL)){h(AL)}}else{if(AQ&&(AW===32)){}else{if(AW===27&&A.config.contentElement){window.location.hash=A.config.contentElement}else{if(AT&&(AW===37||AW===38)){s(AM.previousSibling)}else{if(AR&&(AW===39||AW===40)){s(AM.nextSibling)}else{if(AP&&(AW===39||AW===40)){q(AM.nextSibling.firstChild)}else{return true}}}}}}}}}}}}}}Nornix.events.cancel(AS);return false}}function H(AG){if(Nornix.css.contains(AG,"last")){if(AG.previousSibling){Nornix.css.add(AG.previousSibling,"last")}else{AC(AG.parentNode.parentNode)}Nornix.css.remove(AG,"last")}}function c(){A.menuElements=Nornix.dom.live2copy(A.menu.getElementsByTagName("li"));var AG,AJ=0,AI=[],AK=false,AH=false,AL=(n&&n.parentNode)?n.parentNode:null;while(AG=A.menuElements[AJ++]){if(u(AG)){AI[AI.length]=AG}if(AG===AL){AK=true}if(AG===p){AH=true}}A.menuFolders=AI;if(!AK){n=M=null}if(!AH){p=null}i(true)}function d(AK,AL,AJ,AG,AI,AH){AL=Y(AL);if(!AL){return }if(typeof (AJ)==="string"){AJ=Y(AJ);if(!AJ||!AJ.parentNode){return }AJ=AJ.parentNode;AH=true}if(!AL.parentNode||!AL.parentNode.parentNode){return }if(AH){H(AJ)}AK(AL,AJ,AG);if(AG){W(AJ.firstChild,AI)}G();c()}function L(AG,AH,AI){if(!AE(AH)){x(AH,false,false)}if(u(AG)){if(A.hooks.dynamicFolderLinks&&!A.hooks.dynamicFolderLinks(AH)){if(A.config.navigationIcons){j()}if(AI){Nornix.events.cancel(AI)}return false}if(AE(AH)){h(AG);if(AI){Nornix.events.cancel(AI)}return false}}else{if(A.hooks.dynamicDocumentLinks&&!A.hooks.dynamicDocumentLinks(AH)){if(A.config.navigationIcons){j()}if(AI){Nornix.events.cancel(AI)}return false}}return true}function Y(AG){if(typeof (AG)==="string"){return v(AG)}return AG}function v(AI){var AG,AH=i();switch(A.config.searchNodeMode){case 0:return o(AH,AI)||k(AH,AI);case 1:return k(AH,AI)||o(AH,AI);case 2:return o(AH,AI);case 3:return k(AH,AI)}return null}function o(AJ,AI){var AH=0,AG;while(AG=AJ[AH++]){if((n&&AG===n&&Nornix.dom.getTextContent(n).indexOf(AI)!==-1)||(Nornix.dom.getTextContent(AG).indexOf(AI)!==-1)){return AG}}return null}function k(AJ,AI){var AH=0,AG;while(AG=AJ[AH++]){if((M&&AG===n&&M.indexOf(AI)!==-1)||(AG.href.indexOf(AI)!==-1)){return AG}}return null}function i(AG){if(!A.menuNodes||AG){A.menuNodes=Nornix.dom.live2copy(A.menu.getElementsByTagName("a"))}return A.menuNodes}function W(AJ,AI,AK,AM,AL){var AG,AH;AJ=Y(AJ);if(!AJ){return true}if(Nornix.dom.eqNodeName(AJ,"a")){AH=AJ;AG=AH.parentNode}else{AG=AJ;Nornix.dom.findChildOfType(AG,"a",function(AN){AH=AN})}if(!AH){return true}if(AK&&!AM){I(AH)}if(u(AG)){Nornix.css.add(AG,"folder");m(AG)}AJ=AG.parentNode.parentNode;while(AJ&&AJ!=A.menu){m(AJ);AJ=AJ.parentNode.parentNode}G();if(AI){s(AH)}if(AM){if(AH.click){AH.click();return false}if(AH.onclick&&!AH.onclick()){return false}if(!L(AG,AH,AL)){return false}if(AH.target){if(window.top.frames&&window.top.frames[AH.target]){window.top.frames[AH.target].location.href=AH.href;return false}return true}window.location.href=AH.href;return false}return true}function E(){var AG=[];var AJ,AO,AL,AP,AI;var AM=A.menuElements;var AN;var AH=0;if(A.config.dynamicClasses){var AK=window.location.href;Nornix.dom.findChildOfType(A.menu,"a",function(AQ){Nornix.css.add(AQ,"root");if(AQ.href&&AQ.href===AK){I(AQ)}});AJ=0;while(AO=AM[AJ++]){AL=AO.firstChild;AP=u(AO);if(AP){AG[AG.length]=AO;AI=z.charAt(AH++);AA(AO,AL,(AI&&AI==="-"))}else{Nornix.css.add(AO,"document")}if(e){Nornix.dom.findChildOfType(AO.parentNode,"li",function(AQ){if(AO===AQ){Nornix.css.add(AO,"last")}},true)}else{if(AO===AO.parentNode.lastChild){Nornix.css.add(AO,"last")}}if(AL&&AL.href&&AL.href===AK){W(AL,A.config.focusCurrentItem,true)}}}else{AJ=0;while(AO=AM[AJ++]){AL=AO.firstChild;AP=u(AO);if(AE(AL)){I(AL)}if(AP){AG[AG.length]=AO;AI=z.charAt(AH++);AA(AO,AL,(AI&&AI==="-"))}}AJ=0;while(AL=A.menu.childNodes[AJ++]){if(Nornix.dom.eqNodeName(AL,"a")){I(AL);break}}}A.menuFolders=AG}function AA(AG,AH,AI){span=U.cloneNode(false);AG.insertBefore(span,AH);Nornix.css.swap(AG,"document","folder");if(AI){m(AG)}else{t(AG)}}function AC(AG){AG.removeChild(AG.firstChild);if(AG.firstChild.nextSibling){AG.removeChild(AG.firstChild.nextSibling)}Nornix.css.swap(AG,"folder","document");Nornix.css.remove(AG,"open");Nornix.css.remove(AG,"closed")}function I(AG){if(A.config.dynamicClasses){x(AG,true,false)}if(!AG.href){x(AG,false,true)}}function x(AH,AG,AI){if(n){if(M){n.href=M}Nornix.css.remove(n,"current");if(A.config.markCurrentItem){n.removeChild(n.firstChild)}}M=AH.href;n=AH;Nornix.css.add(AH,"current");if(A.config.markCurrentItem){AH.insertBefore(U.cloneNode(false),AH.firstChild)}if(AG){AH.removeAttribute("href")}else{if(AI){AH.href="javascript:;"}}}function X(){var AI="";if(!F){var AH=0,AG,AJ=A.menuFolders;while(AG=AJ[AH++]){if(D(AG)){AI+="-"}else{AI+="+"}}}Nornix.cookies.create(g,AI)}function AE(AG){if(AG.href&&(AG.href==AB||AG.href==="javascript:;")){return true}return !AG.href}function G(){}if(Nornix.util.isIe&&Nornix.util.isIeLt7){G=function(AG){A.menu.style.position="absolute";A.menu.style.position="relative";try{window.event.srcElement.focus()}catch(AH){}}}else{G=function(){}}function N(AK){var AI=0,AJ;while(AJ=AK.childNodes[AI]){switch(AJ.nodeType){case 1:var AG=0,AH;while(AH=AJ.childNodes[AG]){switch(AH.nodeType){case 1:N(AH);break;case 3:if(!/\S/.test(AH.nodeValue)){AJ.removeChild(AH);continue}break;case 8:AJ.removeChild(AH);continue}AG++}break;case 3:if(!/\S/.test(AJ.nodeValue)){AK.removeChild(AJ);continue}break;case 8:AK.removeChild(AJ);continue}AI++}}function u(AG){if(e){return Nornix.dom.findChildOfType(AG,"ul",function(AH){return true})}else{return AG.childNodes.length>1}}function h(AG){if(!D(AG)){m(AG)}else{t(AG)}G()}function m(AG){Nornix.css.swap(AG,"closed","open");AG.firstChild.title=A.texts.closeFolderTitle}function t(AG){Nornix.css.swap(AG,"open","closed");AG.firstChild.title=A.texts.openFolderTitle}function T(){var AG=0,AH=A.menuFolders;while(li=AH[AG++]){t(li)}G()}function l(){var AG=0,AH=A.menuFolders;while(li=AH[AG++]){m(li)}G()}function q(AG){if(!AG||!AG.firstChild){return false}var AH=AG.firstChild;if(s(AH)){return true}if(!AH.nextSibling||AG===A.menu){return false}AH=AH.nextSibling;return s(AH)}function s(AG){if(Nornix.dom.eqNodeName(AG,"a")){AG.focus();p=AG;return true}return false}function b(){return p?p:n}function j(){var AJ=p?p:n,AH=i(),AI=0,AG;if(!AJ||Nornix.css.contains(AJ,"menuAction")){AJ=R.first=f(AH,0,1)}if(!AJ){return null}while(AG=AH[AI++]){if(AG===AJ){AI--;break}}if(AI>=AH.length){return }if(!R.first){R.first=f(AH,0,1)}R.last=f(AH,AH.length-1,-1);R.next=f(AH,AI+1,1);if(!R.next){R.next=R.first}if(AI<1){R.previous=R.last}else{R.previous=f(AH,AI-1,-1)}}function K(AG){if(!R[AG]){j()}if(!R[AG]){return }var AH=R[AG];if(!AH){return }W(AH,true,true,true)}function f(AH,AI,AJ){var AG;while((AG=AH[AI])&&(AG!==n||M==="javascript:;")&&AE(AG)){AI+=AJ}if(AI<AH.length&&AI>=0){return AH[AI]}return null}function D(AG){return AG.className.search(a)!==-1}function AD(AH,AJ,AI){var AG=y.cloneNode(false);AG.className=AH+" menuAction";AG.title=AJ;A.registerMenuButton(AG,AI);return AG}function S(){A.menu.insertBefore(AD("closeTree",A.texts.closeTreeTitle,T),A.menu.firstChild.nextSibling);A.menu.insertBefore(AD("openTree",A.texts.openTreeTitle,l),A.menu.firstChild.nextSibling.nextSibling)}function P(){A.menu.appendChild(AD("treeNavigation goFirstTree",A.texts.goFirstTitle,A.goToFirstNode));A.menu.appendChild(AD("treeNavigation goPrevTree",A.texts.goPrevTitle,A.goToPrevNode));A.menu.appendChild(AD("treeNavigation goNextTree",A.texts.goNextTitle,A.goToNextNode));A.menu.appendChild(AD("treeNavigation goLastTree",A.texts.goLastTitle,A.goToLastNode))}};Nornix.TreeMenu.prototype.config={dynamicClasses:true,openCloseAll:true,navigationIcons:true,markCurrentItem:false,focusCurrentItem:false,contentElement:false,menuLinkElement:false,preloadImages:["treemenu-sprites","treemenu-line","treemenu-corner"],imagePath:"style/nornix-",imageExtension:".png",searchNodeMode:0};Nornix.TreeMenu.prototype.hooks={dynamicDocumentLinks:false,dynamicFolderLinks:false};Nornix.TreeMenu.prototype.texts={closeTreeTitle:"close all folders",openTreeTitle:"open all folders",closeFolderTitle:"close folder",openFolderTitle:"open folder",goFirstTitle:"first page",goLastTitle:"last page",goNextTitle:"next page",goPrevTitle:"previous page"};
/*@cc_on
var temp = /MSIE (\d+\.\d+);/.test(navigator.userAgent), ieVersion = new Number(RegExp.$1);
if (ieVersion >= 7)
{ 
	Nornix.util.isIeLt7 = false;
}
else
{
	Nornix.util.isIeLt7 = true;
	try
	{
		document.execCommand("BackgroundImageCache", false ,true);
	} catch(e){}
}
@*/

var treemenu = new Nornix.TreeMenu();
treemenu.start();
