function getETarget(b){b=b||window.event;var a=(b.target)?b.target:((b.srcElement)?b.srcElement:null);if(a.nodeType==3){a=a.parentNode}return a}function fromOldMainmenuFormat(a){var c={},b;for(var d=0;d<a.length;d++){b=a[d];if(b.items){b.items=fromOldMainmenuFormat(b.items)}c[b.id]=b}return c}function MenuHandler(a){this.structure=fromOldMainmenuFormat(a);this.activeLevel1="";this.activeLevel2="";this.activeLevel3="";this.hideTimeout=1300;this.hideHandle=null;this.cache=new Array();this.layer1=null;
this.layer2=null;this.layer3=null;this.currentLevel1="";this.currentLevel2="";this.currentLevel3="";this.isMouseOverMenu=false;this.baseUrl=""}MenuHandler.prototype.hide=function(b){if(this.hideHandle){clearTimeout(this.hideHandle);this.hideHandle=null;if(b){var a=this.activeLevel1;this.expandLevel(a,this,true);if(this.activeLevel2){a+="/"+this.activeLevel2;this.expandLevel(a,this,true)}if(this.activeLevel3){a+="/"+this.activeLevel3;this.expandLevel(a,this,true)}}}};MenuHandler.prototype.setCurrentLevels=function(c,b,a){this.activeLevel1=c;
this.activeLevel2=b;this.activeLevel3=a};MenuHandler.prototype.setLevelLayers=function(c,b,a){this.layer1=c;this.layer2=b;this.layer3=a};MenuHandler.prototype.getLevel=function(a){if(a[2]){return 3}else{if(a[1]){return 2}else{return 1}}};MenuHandler.prototype.getStructureNode=function(b){var a;if(b[2]){a=this.structure[b[0]]["items"][b[1]]["items"]}else{if(b[1]){a=this.structure[b[0]]["items"]}else{a=this.structure}}return a};MenuHandler.prototype.splitPath=function(b){var c=["","",""];var a,d=b.split("/");
for(a=0;a<d.length;a++){c[a]=d[a]}return c};MenuHandler.prototype.setActive=function(d,f,e){var c,b=d.getElementsByTagName("a");for(c=0;c<b.length;c++){if(f[e]&&f[e]["name"]&&(b[c].firstChild.nodeValue==f[e]["name"])){b[c].parentNode.className="active"}else{b[c].parentNode.className=""}}};MenuHandler.prototype.getObject=function(n){var e=this.splitPath(n);var w=this;var s=this.getLevel(e);var y,x,v;var m;if(s==1){y=e[0];v=e[0];x=this.layer1;m=n}else{if(s==2){v=e[0]+"_submenu";y=e[1];x=this.layer2;
m=e[0]}else{y=e[2];v=e[0]+"_"+e[1]+"_submenu";x=this.layer3;m=e[0]+"/"+e[1]}}if(typeof this.cache[v]=="undefined"){var g=document.getElementById(x);var d=this.getStructureNode(e);if(s==1){var o,t=g.getElementsByTagName("table")[0];o=t.cloneNode("true");var r=0,b,f,c=o.getElementsByTagName("td");for(;r<c.length;r++){if(c[r].className){if(c[r].className=="menuitem active"){c[r].className="menuitem"}else{if(c[r].className.substr(c[r].className.length-2)=="_a"){c[r].className=c[r].className.substr(0,c[r].className.length-2)
}}if(c[r].className=="menuitem"){tmp=c[r].getElementsByTagName("a")[0];for(b in this.structure){if(tmp.firstChild.nodeValue==this.structure[b]["name"]){break}}f=tmp;f.itemPath=b;f.href=(this.structure[b]["url"].substr(0,1)=="/"?this.baseUrl:"")+this.structure[b]["url"];f.onmouseover=function(i){var a=getETarget(i);if(a.nodeName.toLowerCase()=="a"){w.expandLevel(a.itemPath,w,false)}};f.onmouseout=function(a){if(getETarget(a).nodeName.toLowerCase()=="a"){w.release(w)}};if(tmp.firstChild.nodeValue==d[y]["name"]){c[r-1].className="m_left_a";
c[r].className="menuitem active";c[r+1].className="m_right_a";r++}}}}this.cache[v]=o}else{var u,k,l,j,h=document.createElement("ul");var p=0;var q="";for(u in d){k=document.createElement("li");k.className="";l=document.createElement("a");j=document.createTextNode(d[u]["name"]);q=(d[u]["url"].substr(0,1)=="/"?this.baseUrl:"")+d[u]["url"];l.setAttribute("href",q);l.setAttribute("title",d[u]["title"]);l.appendChild(j);l.itemPath=m+"/"+u;l.onmouseover=function(i){var a=getETarget(i);if(a.nodeName.toLowerCase()=="a"){w.expandLevel(a.itemPath,w,false)
}};l.onmouseout=function(i){var a=getETarget(i);if(a.nodeName.toLowerCase()=="a"){w.release(w)}};k.appendChild(l);h.appendChild(k)}h.id=v;this.cache[v]=h}}return this.cache[v]};MenuHandler.prototype.init=function(){var a=this.activeLevel1;this.expandLevel(a,this,true);if(this.activeLevel2){a+="/"+this.activeLevel2;this.expandLevel(a,this,true)}if(this.activeLevel3){a+="/"+this.activeLevel3;this.expandLevel(a,this,true)}};MenuHandler.prototype.expandLevel=function(f,j,g){if(j.hideHandle){j.hide(false)
}if(!g){j.isMouseOverMenu=true}var b=j.splitPath(f);var n,a,i,d=j.getLevel(b);var c=j.getStructureNode(b);if(b[2]){n=b[2]}else{if(b[1]){n=b[1]}else{n=b[0]}}if(d==1){if(j.currentLevel1!=b[0]){j.currentLevel1=n;var h=document.getElementById(j.layer1);var e=h.getElementsByTagName("table")[0];var o=j.getObject(f);h.replaceChild(o,e)}document.getElementById(j.layer2).style.display="none";document.getElementById(j.layer3).style.display="none"}else{if(d==2){var h=document.getElementById(j.layer2);var m=h.getElementsByTagName("ul")[0];
var l=m;if(m.id!=b[0]+"_submenu"){var k=j.getObject(f);l=k;h.replaceChild(k,m)}if(j.currentLevel2!=n){j.setActive(l,c,n);j.currentLevel2=n}document.getElementById(j.layer2).style.display="";document.getElementById(j.layer3).style.display="none"}else{var h=document.getElementById(j.layer3);var m=h.getElementsByTagName("ul")[0];var l=m;if(m.id!=b[0]+"_"+b[1]+"_submenu"){var k=j.getObject(f);l=k;h.replaceChild(k,m)}if(j.currentLevel3!=n){j.setActive(l,c,n);j.currentLevel3=n}document.getElementById(j.layer3).style.display=""
}}if(!c[n]||typeof c[n]["items"]=="undefined"){return}for(i in c[n]["items"]){nextNode=f+"/"+i;break}if(g){return}j.expandLevel(nextNode,j,g)};MenuHandler.prototype.release=function(a){if(a.hideHandle){a.hide(false)}a.hideHandle=window.setTimeout(function(){a.hide(true)},a.hideTimeout)};MenuHandler.prototype.setBaseUrl=function(a){this.baseUrl=a};
