var a,Spry;Spry||(Spry={});if(!Spry.Widget)Spry.Widget={};Spry.Widget.MenuBar=function(b,c){this.init(b,c)};a=Spry.Widget.MenuBar.prototype;
a.init=function(b,c){this.element=this.getElement(b);this.currMenu=null;var g=typeof document.all!="undefined"&&typeof window.opera=="undefined"&&navigator.vendor!="KDE";if(!(typeof document.getElementById=="undefined"||navigator.vendor=="Apple Computer, Inc."&&typeof window.XMLHttpRequest=="undefined"||g&&typeof document.uniqueID=="undefined")){if(c)for(var d in c){var i=new Image;i.src=c[d]}if(this.element){this.currMenu=this.element;d=this.element.getElementsByTagName("li");for(c=0;c<d.length;c++){this.initialize(d[c],
b,g);if(g){this.addClassName(d[c],"MenuBarItemIE");d[c].style.position="static"}}if(g){if(this.hasClassName(this.element,"MenuBarVertical"))this.element.style.position="relative";b=this.element.getElementsByTagName("a");for(c=0;c<b.length;c++)b[c].style.position="relative"}}}};a.getElement=function(b){if(b&&typeof b=="string")return document.getElementById(b);return b};a.hasClassName=function(b,c){if(!b||!c||!b.className||b.className.search(new RegExp("\\b"+c+"\\b"))==-1)return false;return true};
a.addClassName=function(b,c){!b||!c||this.hasClassName(b,c)||(b.className+=(b.className?" ":"")+c)};a.removeClassName=function(b,c){if(!(!b||!c||!this.hasClassName(b,c)))b.className=b.className.replace(new RegExp("\\s*\\b"+c+"\\b","g"),"")};a.addEventListener=function(b,c,g,d){try{if(b.addEventListener)b.addEventListener(c,g,d);else b.attachEvent&&b.attachEvent("on"+c,g)}catch(i){}};
a.createIframeLayer=function(b){var c=document.createElement("iframe");c.tabIndex="-1";c.src="javascript:false;";b.parentNode.appendChild(c);c.style.left=b.offsetLeft+"px";c.style.top=b.offsetTop+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight+"px"};a.removeIframeLayer=function(b){for(b=b.parentNode.getElementsByTagName("iframe");b.length>0;)b[0].parentNode.removeChild(b[0])};
a.clearMenus=function(b){b=b.getElementsByTagName("ul");for(var c=0;c<b.length;c++)this.hideSubmenu(b[c]);this.removeClassName(this.element,"MenuBarActive")};a.bubbledTextEvent=function(){return navigator.vendor=="Apple Computer, Inc."&&(event.target==event.relatedTarget.parentNode||event.eventPhase==3&&event.target.parentNode==event.relatedTarget)};
a.showSubmenu=function(b){if(this.currMenu){this.clearMenus(this.currMenu);this.currMenu=null}if(b){this.addClassName(b,"MenuBarSubmenuVisible");if(typeof document.all!="undefined"&&typeof window.opera=="undefined"&&navigator.vendor!="KDE")if(!this.hasClassName(this.element,"MenuBarHorizontal")||b.parentNode.parentNode!=this.element)b.style.top=b.parentNode.offsetTop+"px"}this.addClassName(this.element,"MenuBarActive")};
a.hideSubmenu=function(b){if(b){this.removeClassName(b,"MenuBarSubmenuVisible");if(typeof document.all!="undefined"&&typeof window.opera=="undefined"&&navigator.vendor!="KDE"){b.style.top="";b.style.left=""}this.removeIframeLayer(b)}};
a.initialize=function(b,c,g){var d,i,j=b.getElementsByTagName("a")[0];c=b.getElementsByTagName("ul");var h=c.length>0?c[0]:null,k=false;if(h){this.addClassName(j,"MenuBarItemSubmenu");k=true}if(!g)b.contains=function(e){if(e==null)return false;return e==this?true:this.contains(e.parentNode)};var f=this;this.addEventListener(b,"mouseover",function(e){if(!f.bubbledTextEvent()){clearTimeout(i);if(f.currMenu==b)f.currMenu=null;f.addClassName(j,k?"MenuBarItemSubmenuHover":"MenuBarItemHover");if(h&&!f.hasClassName(h,
"MenuBarSubmenuVisible"))d=window.setTimeout(function(){f.showSubmenu(h)},250)}},false);this.addEventListener(b,"mouseout",function(e){if(!f.bubbledTextEvent()){e=typeof e.relatedTarget!="undefined"?e.relatedTarget:e.toElement;if(!b.contains(e)){clearTimeout(d);f.currMenu=b;f.removeClassName(j,k?"MenuBarItemSubmenuHover":"MenuBarItemHover");if(h)i=window.setTimeout(function(){f.hideSubmenu(h)},600)}}},false)};
