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


