Zapatec.Menu=function(b){if(arguments.length>1){var a=arguments[1];a.source=arguments[0];b=a}Zapatec.Menu.SUPERconstructor.call(this,b)};Zapatec.Menu.id="Zapatec.Menu";Zapatec.inherit(Zapatec.Menu,Zapatec.Widget);Zapatec.Menu.prototype.init=function(a){this.config.container=null;this.config.dynamic=false;this.config.showDelay=0;this.config.hideDelay=500;this.config.onClick=false;this.config.vertical=false;this.config.scrollWithWindow=false;this.config.dropShadow=0;this.config.drag=false;this.config.slide=false;this.config.glide=false;this.config.fade=false;this.config.wipe=false;this.config.unfurl=false;this.config.animSpeed=10;this.config.defaultIcons=null;this.config.zIndex=0;this.config.rememberPath=false;this.config.pathCookie="__zp_item";this.config.triggerEvent=null;this.config.triggerKey=null;this.config.triggerObject=null;this.config.top=null;this.config.left=null;this.config.bottom=null;this.config.left=null;this.config.onInit=null;this.config.preventDoubleCall=false;this.called=false;Zapatec.Menu.SUPERclass.init.call(this,a)};Zapatec.Menu.prototype.discard=function(){Zapatec.ScrollWithWindow.unregister(this.rootMenu);Zapatec.Menu.SUPERclass.discard.call(this)};Zapatec.Menu.prototype.addStandardEventListeners=function(){Zapatec.Menu.SUPERclass.addStandardEventListeners.call(this);this.addEventListener("loadThemeEnd",function(){if(Zapatec.windowLoaded){this.onThemeLoad()}else{var a=this;Zapatec.Utils.addEvent(window,"load",function(){a.onThemeLoad()})}})};Zapatec.Menu.onTop=null;Zapatec.Menu.prototype.restoreZIndex=function(){this.top_parent.style.zIndex=this.config.zIndex;Zapatec.Menu.onTop=null};Zapatec.Menu.prototype.putOnTop=function(){var a=Zapatec.Menu.onTop;if(a){a.restoreZIndex()}this.top_parent.style.zIndex=2147483583;Zapatec.Menu.onTop=this};Zapatec.Menu.prototype.onThemeLoad=function(){this.triggerObject=null;this.triggerArgs=null;this.animations=[];this.container=Zapatec.Widget.getElementById(this.config.container);this.loadData();this.openMenus=[];this.clickDone=false;var a=this;if(this.config.triggerEvent){this.setTriggerObject(this.config.triggerObject||window.document);Zapatec.Utils.addEvent(window.document,"mouseup",function(){a.hideMenu()});Zapatec.Utils.addEvent(this.top_parent,"mouseup",function(b){return Zapatec.Utils.stopEvent(b)});Zapatec.Utils.addEvent(window.document,"keypress",function(b){b||(b=window.event);if(b.keyCode==27){for(var c=0;c<Zapatec.Menu.selectedItemsStack.length;c++){if(Zapatec.Menu.all[Zapatec.Menu.selectedItemsStack[c].__zp_tree]==a){return}}a.hideMenu()}})}else{if(this.config.scrollWithWindow&&this.rootMenu){Zapatec.ScrollWithWindow.register(this.rootMenu)}if(this.config.drag){this.dragging=false;Zapatec.Utils.addEvent(window.document,"mousedown",function(b){return Zapatec.Menu.dragStart(b,a)});Zapatec.Utils.addEvent(window.document,"mousemove",function(b){return Zapatec.Menu.dragMove(b,a)});Zapatec.Utils.addEvent(window.document,"mouseup",function(b){return Zapatec.Menu.dragEnd(b,a)})}}if(this.config.fade){this.addAnimation("fade")}if(this.config.slide){this.addAnimation("slide")}else{if(this.config.glide){this.addAnimation("glide")}else{if(this.config.wipe){this.addAnimation("wipe")}else{if(this.config.unfurl){this.addAnimation("unfurl")}}}}if(typeof this.config.onInit=="function"){setTimeout(function(){a.config.onInit()},0)}};Zapatec.Menu.prototype.loadDataHtml=function(d){if(!d){return}this.list=d;this.items={};this.trees={};this.selectedItem=null;this.lastContainerNumber=0;this.menuId=d.id||Zapatec.Utils.generateID("tree");var a=this.top_parent=Zapatec.Utils.createElement("div");a.style.display="none";a.style.textAlign="right";a.__zp_menu=Zapatec.Utils.createElement("div",a);a.__zp_menu.className="zpMenu";a.className="zpMenuContainer zpMenu-top";if(this.config.vertical){Zapatec.Utils.addClass(a,"zpMenu-vertical-mode")}else{Zapatec.Utils.addClass(a,"zpMenu-horizontal-mode")}var c=this.createTree(d,a,0);this.rootMenu=this.trees[c];var b=Zapatec.Utils.createElement("div");b.className=this.getClassName({prefix:"zpMenu"});b.appendChild(a);if(this.container){this.container.appendChild(b)}else{d.parentNode.insertBefore(b,d);d.parentNode.removeChild(d)}Zapatec.Menu.all[this.menuId]=this;if(this.selectedItem){this.sync(this.selectedItem.__zp_item)}this.path=Zapatec.Utils.getCookie(this.config.pathCookie);if(this.path){Zapatec.Utils.writeCookie(this.config.pathCookie,"")}if(!this.config.triggerEvent){this.showMenu();if(!this.config.triggerEvent&&this.config.scrollWithWindow&&this.rootMenu){Zapatec.ScrollWithWindow.register(this.rootMenu)}}};Zapatec.Menu.all={};Zapatec.Menu.prototype.createTree=function(f,b,h){b.id="zpMenu"+this.id+"Container"+this.lastContainerNumber;this.lastContainerNumber++;var g;var e=1,d=true;if(f){g=f.id}if(!g){g=Zapatec.Utils.generateID("tree.sub")}var a=this;function c(){a.creating_now=true;var m=null;var l;var k=(f?f.firstChild:null);var j=b.__zp_items=[];a.trees[g]=b;b.__zp_level=h;b.__zp_treeid=g;b.__zp_keymap={};var n;while(k){if(m){m.className+=" zpMenu-lines-c"}if(k.nodeType!=1){k=k.nextSibling}else{l=Zapatec.Utils.getNextSibling(k,"li");if(k.tagName.toLowerCase()=="li"){m=a.createItem(k,b,l,h,e);if(m){if(!/zpMenu-item-hr/i.test(m.className)){n="zpMenu-item-"+(e%2==1?"odd":"even");Zapatec.Utils.addClass(m,n);e++}if(d){d=false;Zapatec.Utils.addClass(m,"zpMenu-item-first")}j[j.length]=m.__zp_item}}k=l}}if(m){Zapatec.Utils.addClass(m,"zpMenu-item-last")}if((m.className.indexOf("zpMenu-item-first")>=0)&&(m.className.indexOf("zpMenu-item-last")>=0)){Zapatec.Utils.removeClass(m,"zpMenu-item-last");Zapatec.Utils.removeClass(m,"zpMenu-item-first");Zapatec.Utils.addClass(m,"zpMenu-item-single")}k=b.firstChild;if(k&&!h){k.className=k.className.replace(/ zpMenu-lines-./g,"");k.className+=(k===m)?" zpMenu-lines-s":" zpMenu-lines-t"}if(m&&(h||m!=k)){m.className=m.className.replace(/ zpMenu-lines-./g,"");m.className+=" zpMenu-lines-b"}a.creating_now=false}if(this.config.dynamic&&h>0){this.trees[g]=c}else{c()}return g};Zapatec.Menu.tabIndex=1000;Zapatec.Menu.prototype.createItem=function(k,u,d,a,s){if(!k.firstChild){return}var n=k.id||Zapatec.Utils.generateID("tree.item");var r=this.items[n]=Zapatec.Utils.createElement("div",u.__zp_menu);r.id=this.formElementId({prefix:"zpMenu",suffix:"Item"});var j=Zapatec.Utils.createElement("table",r);var i=Zapatec.Utils.createElement("tbody",j);var c=Zapatec.Utils.createElement("tr",i);var f=Zapatec.Utils.createElement("td",c);var p=false;if(!a){f.style.whiteSpace="nowrap"}j.className="zpMenu-table";j.cellSpacing=0;j.cellPadding=0;f.className="zpMenu-label";var w=k.getAttribute("title");if(w){f.setAttribute("title",w)}r.className="zpMenu-item"+(k.className?" "+k.className:"");Zapatec.Utils.addClass(r,"zpMenu-level-"+(a+1));r.__zp_item=n;r.__zp_tree=this.menuId;r.__zp_parent=u.__zp_treeid;r.onmouseover=new Function("Zapatec.Widget.callMethod("+this.id+',"mouseOver","'+r.id+'")');r.onmouseout=new Function("Zapatec.Widget.callMethod("+this.id+',"mouseOut","'+r.id+'")');r.onclick=Zapatec.Menu.onItemClick;Zapatec.Utils.addClass(r,"zpMenu-item-"+(s%2==1?"odd":"even"));var m,v=false,h=null;var o=function(B){var z=null;if(B.nodeType==1){if(z=B.getAttribute("accesskey")){B.removeAttribute("accesskey",false);if(/^[a-z0-1]$/i.test(z)){return z}else{z=null}}var C=B.childNodes;for(var y=0;y<C.length;y++){if(z=o(C[y])){break}}}else{if(B.nodeType==3){var x=B.data.replace(/(^\s+|\s+$)/g,"");if(/_([a-z0-1])/i.test(x)){x=x.replace(/_([a-z0-1])/i,'<span style="text-decoration:underline">$1</span>');z=RegExp.$1;var A=Zapatec.Utils.createElement("span");A.innerHTML=x;var t=B.parentNode;t.insertBefore(A,B);t.removeChild(B)}}}return z};while(m=k.firstChild){if(m.nodeType==1&&(/^[ou]l$/i.test(m.tagName.toLowerCase()))){if(!v){this.item_addIcon(r,null);var b=Zapatec.Utils.createElement("div",u);b.style.position="absolute";if(!this.config.triggerEvent){b.style.left="-1px";b.style.top="-1px"}if(this.config.dropShadow){var l=b.__zp_dropshadow=Zapatec.Utils.createElement("div");u.insertBefore(l,b);l.style.position="absolute";if(!this.config.triggerEvent){l.style.left="-1px";l.style.top="-1px"}l.style.backgroundColor="#000";if(window.opera){l.style.backgroundColor="#666"}else{l.style.filter="alpha(opacity="+this.config.dropShadow+")"}l.style.opacity=this.config.dropShadow/100}b.__zp_item=n;b.__zp_menu=Zapatec.Utils.createElement("div",b);b.__zp_menu.className="zpMenu"+(m.className?" "+m.className:"");b.className="zpMenuContainer";b.__zp_menu.onmouseover=Zapatec.Menu.onItemMouseOver;b.__zp_menu.onmouseout=Zapatec.Menu.onItemMouseOut;if(d){b.__zp_menu.className+=" zpMenu-lined"}b.__zp_icons=[];r.__zp_subtree=this.createTree(m,b,a+1);if(b.__zp_icons.length){this.alignSubMenu(b)}b.__zp_icons=null;r.className+=" zpMenu-item-collapsed";this.toggleItem(n);if(/(^|\s)selected(\s|$)/i.test(k.className)){this.selectedItem=r}v=true}k.removeChild(m)}else{k.removeChild(m);if(m.nodeType==3){var g=m.data.replace(/(^\s+|\s+$)/g,"");if(g){var e=g;if(Zapatec.Menu.onDocumentKeyDown&&!h){e=g.replace(/_([a-z0-1])/i,'<span style="text-decoration:underline">$1</span>');h=RegExp.$1}var q=Zapatec.Utils.createElement("span",f);if(e==g){q.appendChild(document.createTextNode(e))}else{q.innerHTML=e}if(w){q.setAttribute("title",w)}}}else{if(m.tagName){if(m.tagName.toLowerCase()=="img"){this.item_addIcon(r,m);p=true;if(u.__zp_icons instanceof Array){u.__zp_icons.push(m)}}else{if(m.tagName.toLowerCase()=="hr"){Zapatec.Utils.addClass(r,"zpMenu-item-hr")}else{if(m.tagName.toLowerCase()=="input"&&m.getAttribute("type")=="checkbox"){m.onmousedown=function(t){if(this.checked){this.checked=false}else{this.checked=true}return Zapatec.Utils.stopEvent(t)}}else{if(m.tagName.toLowerCase()=="input"&&m.getAttribute("type")=="radio"){m.onmousedown=function(t){this.checked=true;return Zapatec.Utils.stopEvent(t)}}else{if(m.tagName.toLowerCase()=="a"){if(Zapatec.Menu.onDocumentKeyDown&&!h){h=o(m)}m.tabIndex=++Zapatec.Menu.tabIndex;m.onfocus=Zapatec.Menu.onItemMouseOver;m.onblur=Zapatec.Menu.onItemMouseOut}}}}f.appendChild(m);if(w&&!m.getAttribute("title")){m.setAttribute("title",w)}}}}}}if(h){h=h.toUpperCase().charCodeAt(0);u.__zp_keymap[h]=r}if(!p&&!/zpMenu-item-hr/i.test(r.className)){if(this.config.defaultIcons){this.item_addDefaultIcon(r,this.config.defaultIcons)}else{this.item_addDefaultIcon(r,"zpMenu-noicon")}}return r};Zapatec.Menu.prototype.alignSubMenu=function(b){if(Zapatec.StyleSheet){this.alignSubMenuWithStyleSheet(b)}else{var a=this;Zapatec.Transport.loadJS({module:"stylesheet",onLoad:function(){a.alignSubMenuWithStyleSheet(b)}})}};Zapatec.Menu.prototype.alignSubMenuWithStyleSheet=function(c){var d=c.__zp_icons;var e=[];for(var b=0;b<d.length;b++){e.push(d[b].src)}var a=this;Zapatec.Transport.preloadImages({urls:e,onLoad:function(){var f=0;for(var g=0;g<d.length;g++){var h=d[g].width;if(h&&f<h){f=h}}if(!a.styleSheet){a.styleSheet=new Zapatec.StyleSheet()}a.styleSheet.addRule("#"+c.id+" .icon div","width:"+f+"px")},timeout:60000})};Zapatec.Menu.prototype.item_addDefaultIcon=function(c,b){if(!b){return}var a=c.firstChild.firstChild.firstChild.lastChild,d;var d=Zapatec.Utils.createElement("td");d.className="tgb icon "+b;a.parentNode.insertBefore(d,a);Zapatec.Utils.createElement("div",d)};Zapatec.Menu.prototype.item_addIcon=function(d,b){var c=d.firstChild.firstChild.firstChild;var e;c=b?c.lastChild:c.firstChild;if(!b||!d.__zp_icon){e=Zapatec.Utils.createElement("td");e.className="tgb "+(b?"icon":"minus");c.parentNode.insertBefore(e,c)}else{e=d.__zp_icon;b.style.display="none"}var a=Zapatec.Utils.createElement("div",e);if(!b){a.innerHTML="&nbsp;";d.className+=" zpMenu-item-more";d.__zp_state=true;d.__zp_expand=e}else{a.appendChild(b);d.__zp_icon=e}};Zapatec.Menu.prototype.itemClicked=function(a){this.selectedItem=this.toggleItem(a);if(this.selectedItem){Zapatec.Menu.selectItem(this.selectedItem)}this.onItemSelect(a)};Zapatec.Menu.prototype.toggleItem=function(b,h){if(!b){return null}if(this.selectedItem){Zapatec.Menu.unselectItem(this.selectedItem)}var f=this.items[b];if(typeof h=="undefined"){h=!f.__zp_state}if(h!=f.__zp_state){var g=this._getTree(f.__zp_subtree,this.creating_now);if(g){if(h){for(var d=0;d<g.__zp_items.length;d++){var e=g.__zp_items[d];Zapatec.Menu.unselectItem(this.items[e]);if(g.__zp_activeitem==e){g.__zp_activeitem=""}}}else{for(var d=0;d<g.__zp_items.length;d++){var e=g.__zp_items[d];this.toggleItem(e,h);Zapatec.Menu.unselectItem(this.items[e]);if(g.__zp_activeitem==e){g.__zp_activeitem=""}}}this.treeSetDisplay(g,h);Zapatec.Utils.removeClass(f,"zpMenu-item-expanded");Zapatec.Utils.removeClass(f,"zpMenu-item-collapsed");Zapatec.Utils.addClass(f,h?"zpMenu-item-expanded":"zpMenu-item-collapsed")}var a=f.__zp_expand;if(a){a.className="tgb "+(h?"minus":"plus")}f.__zp_state=h;if(h){var c=this._getTree(f.__zp_parent).__zp_items;for(var d=c.length;--d>=0;){if(c[d]!=b&&c[d].__zp_state){this.toggleItem(c[d],false)}}}}return f};Zapatec.Menu.prototype.collapseAll=function(){for(var a in this.trees){this.toggleItem(this._getTree(a).__zp_item,false)}};Zapatec.Menu.prototype.expandAll=function(){for(var a in this.trees){this.toggleItem(this._getTree(a).__zp_item,true)}};Zapatec.Menu.prototype.toggleAll=function(){for(var a in this.trees){this.toggleItem(this._getTree(a).__zp_item)}};Zapatec.Menu.prototype.sync=function(b){var d=this.items[b];if(d){this.collapseAll();this.selectedItem=d;var e=[];while(d.__zp_parent){e[e.length]=d;var a=this._getTree(d.__zp_parent);if(a.__zp_item){d=this.items[a.__zp_item]}else{break}}for(var c=e.length;--c>=0;){var d=e[c];var b=d.__zp_item;this.itemShow(b);var f=this._getTree(d.__zp_parent);f.__zp_activeitem=b;Zapatec.Menu.selectItem(d)}}};Zapatec.Menu.prototype.highlightPath=function(c){this.putOnTop();var e=this.items[c];if(e){var b=[];while(e.__zp_parent){b[b.length]=e;var f=this._getTree(e.__zp_parent);if(f.__zp_item){e=this.items[f.__zp_item]}else{break}}for(var d=b.length;--d>=0;){Zapatec.Utils.addClass(b[d],"zpMenuPath")}}};Zapatec.Menu.prototype.destroy=function(){var a=this.top_parent;a.parentNode.removeChild(a)};Zapatec.Menu.prototype._getTree=function(c,b){var a=this.trees[c];if(typeof a=="function"){if(b){a=null}else{a();a=this.trees[c];this.treeSetDisplay(a,false)}}return a};Zapatec.Menu.prototype.onItemSelect=function(){};Zapatec.Menu.onItemToggle=function(){var b=this;var a=document.body;while(b&&b!=a&&!/zpMenu-item/.test(b.className)){b=b.parentNode}Zapatec.Menu.all[b.__zp_tree].itemClicked(b.__zp_item)};Zapatec.Menu.prototype.setTriggerObject=function(i){if(!this.config.triggerEvent){return}var e=this.config.triggerEvent;var d=this.config.triggerKey;var h=[];if(i){if(typeof i=="string"){var j=document.getElementById(i);if(j){h.push({triggerObject:j,triggerArgs:null})}}else{if(typeof i=="object"){if(i==window.document||typeof i.length=="undefined"){h.push({triggerObject:i,triggerArgs:null})}else{for(var b=0;b<i.length;b++){var g=i[b];if(g){if(typeof g=="string"){var j=document.getElementById(g);if(j){h.push({triggerObject:j,triggerArgs:null})}}else{if(typeof g=="object"){if(typeof g.triggerObject!="undefined"&&typeof g.triggerArgs!="undefined"){if(typeof g.triggerObject=="string"){var j=document.getElementById(g.triggerObject);if(j){h.push({triggerObject:j,triggerArgs:g.triggerArgs})}}else{if(typeof g.triggerObject=="object"){h.push(g)}}}else{h.push({triggerObject:g,triggerArgs:null})}}}}}}}}}if(h.length==0){return}var f=this;if(e=="mousedown"||e=="mouseup"||e=="click"){var a=function(k){Zapatec.Utils.addEvent(k.triggerObject,"mouseup",function(l){l||(l=window.event);var n=Zapatec.Utils.getMousePos(l);var m;if(l.button){m=l.button}else{m=l.which}if(window.opera){if(m==1&&f.top_parent.style.display=="none"){setTimeout(function(){f.triggerObject=k.triggerObject;f.triggerArgs=k.triggerArgs;f.popupMenu(n.pageX,n.pageY)},100);return Zapatec.Utils.stopEvent(l)}}else{if(d=="both"||(d=="left"&&m==1)||((!d||d=="left")&&(m>1||l.metaKey))){setTimeout(function(){f.triggerObject=k.triggerObject;f.triggerArgs=k.triggerArgs;f.popupMenu(n.pageX,n.pageY)},100);Zapatec.Utils.stopEvent(l);l.returnValue=true;return false}}})};for(var c=0;c<h.length;c++){a(h[c])}window.document.oncontextmenu=function(){return false}}else{if(e=="keydown"||e=="keyup"||e=="keypress"){var a=function(k){Zapatec.Utils.addEvent(k.triggerObject,"keydown",function(l){l||(l=window.event);if(l.keyCode==d){f.triggerObject=k.triggerObject;f.triggerArgs=k.triggerArgs;f.popupMenu();return Zapatec.Utils.stopEvent(l)}})};for(var c=0;c<h.length;c++){a(h[c])}}}};Zapatec.Menu.MOUSEOUT=0;Zapatec.Menu.MOUSEOVER=1;Zapatec.Menu.CLICK=2;Zapatec.Menu.animations={};Zapatec.Menu.animations.fade=function(ref,counter){var f=ref.filters,done=(counter==100);if(f){if(!done&&ref.style.filter.indexOf("alpha")==-1){ref.style.filter+=" alpha(opacity="+counter+")"}else{if(f.length&&f.alpha){with(f.alpha){if(done){enabled=false}else{opacity=counter;enabled=true}}}}}else{ref.style.opacity=ref.style.MozOpacity=counter/100.1}};Zapatec.Menu.animations.slide=function(c,a){if(a!=100){var d=Math.pow(Math.sin(Math.PI*a/200),0.75);if(typeof c.__zp_origmargintop=="undefined"){c.__zp_origmargintop=c.style.marginTop}c.style.marginTop="-"+parseInt(c.offsetHeight*(1-d))+"px";c.style.clip="rect("+parseInt(c.offsetHeight*(1-d))+"px,"+c.offsetWidth+"px,"+c.offsetHeight+"px,0)"}else{if(typeof c.__zp_origmargintop!="undefined"){c.style.marginTop=c.__zp_origmargintop}try{c.style.clip=""}catch(b){c.style.clip="rect(auto,auto,auto,0)"}}};Zapatec.Menu.animations.glide=function(c,a){if(a!=100){var d=Math.pow(Math.sin(Math.PI*a/200),0.75);c.style.clip="rect(0,"+c.offsetWidth+"px,"+parseInt(c.offsetHeight*d)+"px,0)"}else{try{c.style.clip=""}catch(b){c.style.clip="rect(0,auto,auto,0)"}}};Zapatec.Menu.animations.wipe=function(c,a){if(a!=100){c.style.clip="rect(0,"+parseInt(c.offsetWidth*(a/100))+"px,"+parseInt(c.offsetHeight*(a/100))+"px,0)"}else{try{c.style.clip=""}catch(b){c.style.clip="rect(0,auto,auto,0)"}}};Zapatec.Menu.animations.unfurl=function(c,a){if(a<=50){c.style.clip="rect(0,"+parseInt(c.offsetWidth*(a/50))+"px,10px,0)"}else{if(a<100){c.style.clip="rect(0,"+c.offsetWidth+"px,"+parseInt(c.offsetHeight*((a-50)/50))+"px,0)"}else{try{c.style.clip=""}catch(b){c.style.clip="rect(0,auto,auto,0)"}}}};Zapatec.Menu.prototype.addAnimation=function(a){this.animations[this.animations.length]=Zapatec.Menu.animations[a]};Zapatec.Menu.prototype.treeSetDisplay=function(e,b){if(!e.__zp_initialized){e.style.visibility="hidden";e.style.left="-1px";e.style.top="-1px";if(e.__zp_dropshadow){e.__zp_dropshadow.style.visibility="hidden";e.__zp_dropshadow.style.left="-1px";e.__zp_dropshadow.style.top="-1px"}e.__zp_initialized=true;return}var d=e.__zp_tree||e.__zp_menu.firstChild.__zp_tree;var a;if(d){a=Zapatec.Menu.all[d]}if(!a){return}if(a.animations.length==0){if(b){e.style.visibility="inherit";if(e.__zp_dropshadow){e.__zp_dropshadow.style.visibility="inherit"}}else{e.style.visibility="hidden";e.style.left="-1px";e.style.top="-1px";if(e.__zp_dropshadow){e.__zp_dropshadow.style.visibility="hidden";e.__zp_dropshadow.style.left="-1px";e.__zp_dropshadow.style.top="-1px"}}return}e.__zp_anim_timer|=0;clearTimeout(e.__zp_anim_timer);e.__zp_anim_counter|=0;if(b&&!e.__zp_anim_counter){e.style.visibility="inherit";if(e.__zp_dropshadow){e.__zp_dropshadow.style.visibility="inherit"}}for(var c=0;c<a.animations.length;c++){a.animations[c](e,e.__zp_anim_counter);if(e.__zp_dropshadow&&a.animations[c]!=Zapatec.Menu.animations.fade){a.animations[c](e.__zp_dropshadow,e.__zp_anim_counter)}}if(!(b&&e.__zp_anim_counter==100)){e.__zp_anim_counter+=a.config.animSpeed*(b?1:-1);if(e.__zp_anim_counter>100){e.__zp_anim_counter=100;e.__zp_anim_timer=setTimeout(function(){a.treeSetDisplay(e,b)},50)}else{if(e.__zp_anim_counter<=0){e.__zp_anim_counter=0;e.style.visibility="hidden";e.style.left="-1px";e.style.top="-1px";if(e.__zp_dropshadow){e.__zp_dropshadow.style.visibility="hidden";e.__zp_dropshadow.style.left="-1px";e.__zp_dropshadow.style.top="-1px"}}else{e.__zp_anim_timer=setTimeout(function(){a.treeSetDisplay(e,b)},50)}}}};Zapatec.Menu.prototype.mouseOver=function(c){var b=document.getElementById(c);if(b){var a=b.__zp_tree||b.firstChild.__zp_tree;if(a){a=Zapatec.Menu.all[a];if(a){a.itemMouseHandler(b.__zp_item,Zapatec.Menu.MOUSEOVER)}}}};Zapatec.Menu.onItemMouseOver=function(){var b=this,a=null;while(b&&b!=document.body){var c=b.__zp_tree||b.firstChild.__zp_tree;if(c){a=Zapatec.Menu.all[c]}var d=b.className;if(/zpMenu-item/.test(d)&&!/zpMenu-item-hr/.test(d)){a.itemMouseHandler(b.__zp_item,Zapatec.Menu.MOUSEOVER)}b=a&&b.__zp_treeid?a.items[b.__zp_item]:b.parentNode}return true};Zapatec.Menu.prototype.mouseOut=function(c){var b=document.getElementById(c);if(b){var a=b.__zp_tree||b.firstChild.__zp_tree;if(a){a=Zapatec.Menu.all[a];if(a){a.itemMouseHandler(b.__zp_item,Zapatec.Menu.MOUSEOUT)}}}};Zapatec.Menu.onItemMouseOut=function(){var b=this,a=null;while(b&&b!=document.body){var c=b.__zp_tree||b.firstChild.__zp_tree;if(c){a=Zapatec.Menu.all[c]}var d=b.className;if(/zpMenu-item/.test(d)&&!/zpMenu-item-hr/.test(d)&&!(/zpMenu-level-1/.test(d)&&!/zpMenu-item-selected/.test(d))){a.itemMouseHandler(b.__zp_item,Zapatec.Menu.MOUSEOUT)}b=a&&b.__zp_treeid?a.items[b.__zp_item]:b.parentNode}return false};Zapatec.Menu.onItemClick=function(l){var m=this;if(!/zpMenuDisabled/.test(m.className)){while(m&&m!=document.body){if(m.nodeName&&m.nodeName.toLowerCase()=="a"){return true}if(/zpMenu-item/.test(m.className)){var i=Zapatec.Menu.all[m.__zp_tree];if(!i.config.preventDoubleCall){i.called=false}if(!i.called){if(i.config.onClick&&m.__zp_subtree&&(/zpMenu-top/.test(i.trees[m.__zp_parent].className))){i.itemMouseHandler(m.__zp_item,Zapatec.Menu.CLICK);return Zapatec.Utils.stopEvent(l)}var h=m.getElementsByTagName("a");var c=m.getElementsByTagName("input");var b=m.getElementsByTagName("select");if(h&&h.item(0)&&h.item(0).getAttribute("href")&&h.item(0).getAttribute("href")!="#"&&h.item(0).getAttribute("href")!=window.document.location.href+"#"&&h.item(0).getAttribute("href")!="javascript:void(0)"){var a=h.item(0).getAttribute("href");var g=h.item(0).getAttribute("target");if(i.config.rememberPath||i.config.pathCookie!="__zp_item"){Zapatec.Utils.writeCookie(i.config.pathCookie,m.__zp_item)}try{if(g){window.open(a,g)}else{window.location.href=a}}catch(f){}if(i.config.triggerEvent){i.hideMenu()}else{i.collapseAll();while(Zapatec.Menu.selectedItemsStack.length){var d=Zapatec.Menu.selectedItemsStack.pop();d.onmouseout()}}}else{if(c&&c.item(0)){var k=c.item(0);var j=k.getAttribute("type");if(j=="checkbox"){if(k.checked){k.checked=false}else{k.checked=true}}else{if(j=="radio"){k.checked=true}}}else{if(b&&b.item(0)){return true}else{if(m.__zp_subtree){i.itemMouseHandler(m.__zp_item,Zapatec.Menu.CLICK)}else{if(i.config.triggerEvent){i.hideMenu()}}}}}if(i.config.preventDoubleCall){i.called=true}return Zapatec.Utils.stopEvent(l)}}m=m.parentNode}}return false};Zapatec.Menu.prototype.itemMouseHandler=function(b,c){if(c){this.putOnTop()}else{this.restoreZIndex()}var e=this.items[b];if(!e){return}var f=this._getTree(e.__zp_parent);if(c<2&&window.opera&&this.config.slide){var g=this._getTree(e.__zp_subtree);if(g&&g.__zp_anim_counter&&g.__zp_anim_counter<100){return}}if(f&&f.__zp_activeitem!=b){if(f.__zp_activeitem){var d=this.items[f.__zp_activeitem];clearTimeout(d.__zp_dimtimer);clearTimeout(d.__zp_mousetimer);var a=this;setTimeout(function(){Zapatec.Menu.unselectItem(d);if(d.__zp_state){a.toggleItem(d.__zp_item,false)}Zapatec.Menu.selectItem(e)},0)}else{setTimeout(function(){Zapatec.Menu.selectItem(e)},0)}f.__zp_activeitem=b}clearTimeout(e.__zp_dimtimer);if(c==Zapatec.Menu.MOUSEOUT){e.__zp_dimtimer=setTimeout(function(){Zapatec.Menu.unselectItem(e);if(f.__zp_activeitem==b){f.__zp_activeitem=""}},this.config.hideDelay)}clearTimeout(e.__zp_mousetimer);if(this.config.onClick&&!this.clickDone){if(/zpMenu-top/.test(this.trees[e.__zp_parent].className)&&(c==Zapatec.Menu.MOUSEOVER)){return}if(c==Zapatec.Menu.CLICK){this.clickDone=true}}if(!e.__zp_state&&c){e.__zp_mousetimer=setTimeout('Zapatec.Menu.all["'+e.__zp_tree+'"].itemShow("'+e.__zp_item+'")',(this.config.showDelay||1))}else{if(e.__zp_state&&!c){e.__zp_mousetimer=setTimeout('Zapatec.Menu.all["'+e.__zp_tree+'"].itemHide("'+e.__zp_item+'")',(this.config.hideDelay||1))}}};Zapatec.Menu.prototype.itemShow=function(t){var y=this.items[t];if(/zpMenuDisabled/.test(y.className)){return}var s=this._getTree(y.__zp_subtree);if(!s){return}var c=this._getTree(y.__zp_parent);if(!s.offsetHeight){s.style.visibility="visible"}if(s.style.zIndex===""){s.style.zIndex="inherit"}var w,h;if(typeof s.clientleft!="undefined"){w=s.clientleft;h=s.clientTop}else{w=(s.offsetWidth-s.clientWidth)/2;h=(s.offsetHeight-s.clientHeight)/2}var k=s.firstChild;var i=k.offsetright;var a=k.offsetTop;var r=window.pageXOffset||document.body.scrollright||document.documentElement.scrollright||0;var p=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0;var f=Zapatec.Utils.getWindowSize();var g=f.width;var u=f.height;if(!s.style.width||!s.style.height){var o=u-7;if(s.offsetHeight>o){var b=s.offsetHeight;k.__zp_first=k.firstChild;k.__zp_last=k.lastChild;var d=Zapatec.Utils.createElement("div");d.__zp_tree=k.firstChild.__zp_tree;d.className="zpMenuScrollUpInactive";d.__zp_mouseover=false;d.__zp_timer=null;var v=function(){var B=d.parentNode;var G=B.parentNode.clientHeight;var D=B.firstChild;var A=B.lastChild;if(B.__zp_first.previousSibling!=D){if(B.__zp_first.style.height){B.__zp_first.style.height="";B.__zp_first.style.overflow=""}else{B.__zp_first=B.__zp_first.previousSibling;B.__zp_first.style.display="block"}var F=B.offsetHeight;while(F>G){B.__zp_last.style.display="none";if(B.__zp_last.style.height){B.__zp_last.style.height="";B.__zp_last.style.overflow=""}B.__zp_last=B.__zp_last.previousSibling;F=B.offsetHeight}var E=G-F;if(E>0){B.__zp_last=B.__zp_last.nextSibling;B.__zp_last.style.display="block";var C=E-(B.__zp_last.offsetHeight-B.__zp_last.clientHeight);if(C>=0){B.__zp_last.style.display="none";B.__zp_last.style.height=C+"px";B.__zp_last.style.overflow="hidden";B.__zp_last.style.display="block";F=B.offsetHeight;if(F!=G){C-=F-G;if(C>0){B.__zp_last.style.height=C+"px"}else{B.__zp_last.style.display="none";B.__zp_last.style.height="";B.__zp_last.style.overflow="";B.__zp_last=B.__zp_last.previousSibling}}}else{B.__zp_last.style.display="none";B.__zp_last=B.__zp_last.previousSibling}}A.className="zpMenuScrollDownActive";if(B.__zp_first.previousSibling==D){D.className="zpMenuScrollUpInactive"}if(d.__zp_timer){clearTimeout(d.__zp_timer)}if(d.__zp_mouseover){d.__zp_timer=setTimeout(v,50)}}return true};d.onmouseover=function(){d.__zp_mouseover=true;return v()};d.onmouseout=function(){d.__zp_mouseover=false;if(d.__zp_timer){clearTimeout(d.__zp_timer);d.__zp_timer=null}};k.insertBefore(d,k.firstChild);var z=Zapatec.Utils.createElement("div");z.__zp_tree=k.firstChild.__zp_tree;z.className="zpMenuScrollDownActive";z.__zp_mouseover=false;z.__zp_timer=null;var x=function(){var B=z.parentNode;var G=B.parentNode.clientHeight;var D=B.firstChild;var A=B.lastChild;if(B.__zp_last.nextSibling!=A){if(B.__zp_last.style.height){B.__zp_last.style.height="";B.__zp_last.style.overflow=""}else{B.__zp_last=B.__zp_last.nextSibling;B.__zp_last.style.display="block"}var F=B.offsetHeight;while(F>G){B.__zp_first.style.display="none";if(B.__zp_first.style.height){B.__zp_first.style.height="";B.__zp_first.style.overflow=""}B.__zp_first=B.__zp_first.nextSibling;F=B.offsetHeight}var E=G-F;if(E>0){B.__zp_first=B.__zp_first.previousSibling;B.__zp_first.style.display="block";var C=E-(B.__zp_first.offsetHeight-B.__zp_first.clientHeight);if(C>0){B.__zp_first.style.display="none";B.__zp_first.style.height=C+"px";B.__zp_first.style.overflow="hidden";B.__zp_first.style.display="block";F=B.offsetHeight;if(F!=G){C-=F-G;if(C>0){B.__zp_first.style.height=C+"px"}else{B.__zp_first.style.display="none";B.__zp_first.style.height="";B.__zp_first.style.overflow="";B.__zp_first=B.__zp_first.nextSibling}}}else{B.__zp_first.style.display="none";B.__zp_first=B.__zp_first.nextSibling}}D.className="zpMenuScrollUpActive";if(B.__zp_last.nextSibling==A){A.className="zpMenuScrollDownInactive"}if(z.__zp_timer){clearTimeout(z.__zp_timer)}if(z.__zp_mouseover){z.__zp_timer=setTimeout(x,50)}}return true};z.onmouseover=function(){z.__zp_mouseover=true;return x()};z.onmouseout=function(){z.__zp_mouseover=false;if(z.__zp_timer){clearTimeout(z.__zp_timer);z.__zp_timer=null}};k.appendChild(z);var n=k.__zp_last;b+=d.offsetHeight+z.offsetHeight;while(b>o){b-=n.offsetHeight;n.style.display="none";n=n.previousSibling;k.__zp_last=n}}var m=k.offsetWidth;var j=k.offsetHeight;if(typeof s.clientright!="undefined"&&!window.opera&&!(document.compatMode&&document.compatMode=="CSS1Compat")){m+=w*2+i*2;j+=h*2+a*2}s.style.width=m+"px";s.style.height=j+"px";if(s.__zp_dropshadow){s.__zp_dropshadow.style.width=s.offsetWidth+"px";s.__zp_dropshadow.style.height=s.offsetHeight+"px"}k.style.position="absolute";k.style.visibility="inherit"}var l=0,e=0;var q=Zapatec.Utils.getAbsolutePos(c);if((/zpMenu-top/.test(this.trees[y.__zp_parent].className))&&(!(this.config.vertical))){l=y.offsetright;e=y.offsetHeight;if(q.x+l+s.offsetWidth+i+7>r+g){l+=y.offsetWidth-s.offsetWidth-i;if(s.__zp_dropshadow){l-=6}}else{l-=w}if(q.y+e+s.offsetHeight+a+7>p+u){e=-s.offsetHeight;if(s.__zp_dropshadow){e-=5}}}else{l=y.offsetWidth;e=y.offsetTop;if(q.x+l+s.offsetWidth+i+7>r+g){l=-s.offsetWidth;if(s.__zp_dropshadow){l-=5}}if(q.y+e+s.offsetHeight+a+7>p+u){e-=s.offsetHeight-y.offsetHeight;if(s.__zp_dropshadow){e-=5}}else{e-=h}}if(q.x+l<0){l=0-q.x}if(q.y+e<0){e=0-q.y}s.style.right=l+"px";s.style.top=e+"px";if(s.__zp_dropshadow){s.__zp_dropshadow.style.right=l+5+"px";s.__zp_dropshadow.style.top=e+5+"px"}if(Zapatec.is_ie&&!Zapatec.is_ie5){if(!s.__zp_wch){s.__zp_wch=Zapatec.Utils.createWCH(s)}s.__zp_wch.style.zIndex=-1;if(this.config.dropShadow){Zapatec.Utils.setupWCH(s.__zp_wch,-w,-h,s.offsetWidth+6,s.offsetHeight+5)}else{Zapatec.Utils.setupWCH(s.__zp_wch,-w,-h,s.offsetWidth,s.offsetHeight)}}this.toggleItem(t,true)};Zapatec.Menu.prototype.itemHide=function(b){var d=this.items[b];var a=this._getTree(d.__zp_subtree);var e=this._getTree(d.__zp_parent);if(a){this.toggleItem(b,false);e.__zp_activeitem="";a.__zp_activeitem="";for(var c in this.items){if(this.items[c].__zp_state){return}}this.clickDone=false}};Zapatec.Menu.dragStart=function(i,d){i||(i=window.event);if(d.dragging){return true}var c=d.rootMenu;if(!(/(absolute|fixed)/).test(c.style.position)){c.style.position="absolute";var h=Zapatec.Utils.getAbsolutePos(c);c.style.right=h.x+"px";c.style.top=h.y+"px"}var f=i.srcElement||i.target;while(1){if(f==c){break}else{f=f.parentNode}if(!f){return true}}d.dragging=true;var b=i.pageX||i.clientX+window.document.body.scrollleft||0;var a=i.pageY||i.clientY+window.document.body.scrollTop||0;var g=parseInt(c.style.left)||0;var e=parseInt(c.style.top)||0;d.xOffs=(b-g);d.yOffs=(a-e);if(d.config.scrollWithWindow){Zapatec.ScrollWithWindow.unregister(d.rootMenu)}};Zapatec.Menu.dragMove=function(e,g){e||(e=window.event);var d=g.rootMenu;if(!(g&&g.dragging)){return false}var h=e.pageX||e.clientX+window.document.body.scrollleft||0;var f=e.pageY||e.clientY+window.document.body.scrollTop||0;var c=d.style,a=h-g.xOffs,b=f-g.yOffs;c.left=a+"px";c.top=b+"px";return Zapatec.Utils.stopEvent(e)};Zapatec.Menu.dragEnd=function(g,b){if(!b){return false}if(b.dragging){b.dragging=false;var a=b.rootMenu;var k=a.style,e=parseInt(k.left),c=parseInt(k.top);var j=window.pageXOffset||document.body.scrollleft||document.documentElement.scrollleft||0;var i=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0;var h=Zapatec.Utils.getWindowSize();var f=h.width;var d=h.height;if(e<0){k.left="0px"}else{if(e+a.offsetWidth>j+f){k.left=j+f-a.offsetWidth+"px"}}if(c<0){k.top="0px"}else{if(c+a.offsetHeight>i+d){k.top=i+d-a.offsetHeight+"px"}}if(b.config.scrollWithWindow){Zapatec.ScrollWithWindow.register(a)}}};Zapatec.Menu.prototype.itemDisable=function(a){var b=this.items[a];if(b){Zapatec.Utils.addClass(b,"zpMenuDisabled")}};Zapatec.Menu.prototype.itemEnable=function(a){var b=this.items[a];if(b){Zapatec.Utils.removeClass(b,"zpMenuDisabled")}};Zapatec.Menu.prototype.popupMenu=function(b,a){for(var d in Zapatec.Menu.all){if(!Zapatec.Menu.all.hasOwnProperty(d)){continue}var c=Zapatec.Menu.all[d];if(c.config.triggerEvent){c.hideMenu()}}if(arguments.length>1){this.showMenu(b,a)}else{this.showMenu()}};Zapatec.Menu.prototype.showMenu=function(f,d){var c=this.top_parent;var h=c.__zp_menu;var k=Zapatec.Utils.getWindowSize();var i=Zapatec.Utils.getPageScrollX();var g=Zapatec.Utils.getPageScrollY();if(arguments.length>1){c.style.position="absolute";c.style.left=f+"px";c.style.top=d+"px"}c.style.display="block";if(!h.style.width){if(h.childNodes){var l=0;for(var b=0;b<h.childNodes.length;b++){var e=h.childNodes[b];var a=0;if(b==0){a=e.offsetleft}if(this.config.vertical){if(e.offsetWidth>l){l=e.offsetWidth+a}}else{l+=e.offsetWidth+a}}if(typeof h.clientleft!="undefined"){l+=h.clientleft*2}else{l+=h.offsetWidth-h.clientWidth}if(h.clientWidth>l){h.style.width=h.clientWidth+"px"}else{h.style.width=l+"px"}}}if(arguments.length>1){if(f+c.offsetWidth>i+k.width){c.style.left=i+k.width-c.offsetWidth+"px"}if(d+c.offsetHeight>g+k.height){c.style.top=g+k.height-c.offsetHeight+"px"}}else{if(typeof this.config.top!="object"||typeof this.config.left!="object"||typeof this.config.bottom!="object"||typeof this.config.left!="object"){c.style.position="absolute";if(typeof this.config.top!="object"){c.style.top=parseInt(this.config.top)+"px"}else{if(typeof this.config.bottom!="object"){c.style.top=(k.height-parseInt(this.config.bottom)-h.offsetHeight-(c.offsetHeight-c.clientHeight))+"px"}}if(typeof this.config.left!="object"){c.style.left=parseInt(this.config.left)+"px"}else{if(typeof this.config.left!="object"){c.style.left=(k.width-parseInt(this.config.left)-h.offsetWidth-(c.offsetWidth-c.clientWidth))+"px"}}}else{if(window.opera&&(this.config.drag||this.config.scrollWithWindow)){c.style.position="absolute";var j=Zapatec.Utils.getElementOffset(c);c.style.left=j.left+"px";c.style.top=j.top+"px"}}}c.style.zIndex=this.config.zIndex;if((this.config.rememberPath||this.config.pathCookie!="__zp_item")&&this.path){this.highlightPath(this.path);if(this.config.rememberPath=="expand"){this.sync(this.path)}}if(Zapatec.is_ie&&!Zapatec.is_ie5){if(!c.__zp_wch){c.__zp_wch=Zapatec.Utils.createWCH(c)}c.__zp_wch.style.zIndex=-1;Zapatec.Utils.setupWCH(c.__zp_wch,-c.clientleft,-c.clientTop,c.offsetWidth,c.offsetHeight)}this.fireEvent("menuShown")};Zapatec.Menu.prototype.hideMenu=function(){this.collapseAll();this.top_parent.style.display="none";this.fireEvent("menuHidden")};Zapatec.Menu.selectedItemsStack=[];Zapatec.Menu.selectItem=function(b){Zapatec.Utils.addClass(b,"zpMenu-item-selected");if(/zpMenu-item-collapsed/i.test(b.className)){Zapatec.Utils.addClass(b,"zpMenu-item-selected-collapsed")}for(var a=Zapatec.Menu.selectedItemsStack.length-1;a>=0;a--){if(Zapatec.Menu.selectedItemsStack[a]==b){Zapatec.Menu.selectedItemsStack.splice(a,1)}}Zapatec.Menu.selectedItemsStack.push(b)};Zapatec.Menu.unselectItem=function(b){Zapatec.Utils.removeClass(b,"zpMenu-item-selected");Zapatec.Utils.removeClass(b,"zpMenu-item-selected-collapsed");for(var a=Zapatec.Menu.selectedItemsStack.length-1;a>=0;a--){if(Zapatec.Menu.selectedItemsStack[a]==b){Zapatec.Menu.selectedItemsStack.splice(a,1)}}};Zapatec.Utils.addEvent(window,"load",Zapatec.Utils.checkActivation);