/*
Modified version based on XP Style Sliding Menu Bar v1.0 by Eric Simmons at http://www.jswitch.com
For the full original copyright notice please access jscopyright.txt, located in the same directory this script file is in.
*/
var XPM={version:1,build:3,menus:[],IE:IE,timer:null,fate:null,locked:null,activeMenu:-1,stayTime:750,slideDelay:25,slideStep:18,itemHeight:24,doFade:true,doSlide:true,log:""};XPM.log="XPM v"+XPM.version+" b"+XPM.build+" log:\n\n";XPM.load=function(B){var A,C,D=[];XPM.log+="XPM.load("+typeof (B)+" "+String(B)+") > Loading...\n";B=getObj(B);C=B?B.childNodes:document.getElementsByTagName("DIV");for(A=0;A<C.length;A++){if(String(C.item(A).className).indexOf("placeholder")!=-1){D.push(XPM.setup(C.item(A).getElementsByTagName("DIV").item(0)))}}XPM.log+="XPM.load("+typeof (B)+" "+String(B)+") > Loaded "+D.length+" menu(s) ["+D+"]\n\n";return D};XPM.setup=function(F){var D,C,E,B,A;if(!isNaN(F.xpmIndex)){return F.xpmIndex}D=XPM.menus.length;XPM.menus.push(F);F.xpmIndex=D;F.xpmState=false;F.xpmFocused=false;F.xpmClass="Menu";F.xpmLabel=F.getElementsByTagName("DIV").item(0);F.xpmLabel.xpmParent=F;F.xpmLabel.xpmClass="Label";F.xpmLabel.onmouseover=XPM.setSlide;F.xpmLabel.onmouseout=XPM.hover;F.xpmLabel.className+=" xpmClosed";F.xpmSubMenu=F.getElementsByTagName("DIV").item(1);if(!F.xpmSubMenu){XPM.log+="XPM.setup("+typeof (F)+" "+String(F)+") > Setup empty menu ["+D+"]\n";return D}F.xpmSubContainer=F.xpmSubMenu.getElementsByTagName("DIV").item(0);F.xpmSubMenu.xpmParent=F;F.xpmSubMenu.xpmClass="SubMenu";F.xpmSubMenu.style.height=0+"px";F.xpmSubContainer.xpmParent=F;F.xpmSubContainer.xpmClass="SubContainer";F.xpmSubContainer.style.display="none";F.xpmSubItems=[];if(XPM.doFade){XPM.fade(D,0)}B=F.xpmSubContainer.childNodes;C=function(){XPM.check(true);XPM.hover(this)};E=function(){XPM.check(false);XPM.hover(this)};for(A=0;A<B.length;A++){if(B.item(A).tagName=="DIV"){B.item(A).xpmSubIndex=F.xpmSubItems.length;F.xpmSubItems.push(B.item(A));B.item(A).onmouseover=XPM.hover;B.item(A).onmouseout=XPM.hover;B.item(A).xpmParent=F;B.item(A).xpmClass="SubItem"}}F.xpmCurrentHeight=0;F.xpmMaxHeight=F.xpmSubItems.length*XPM.itemHeight;F.xpmFadeStep=F.xpmMaxHeight/XPM.slideStep;XPM.log+="XPM.setup("+typeof (F)+" "+String(F)+") > Setup "+F.xpmSubItems.length+"-item menu ["+D+"]\n";return D};XPM.hover=function(A){var B;if(!A){A=this}if(typeof A.className=="undefined"){A=this}B=String(A.className);if(B.indexOf("xpmOver")!=-1){if(XPM.activeMenu!=-1&&!XPM.locked){XPM.setFate()}A.className=B.replace("xpmOver","");A.xpmParent.xpmFocused=false}else{clearTimeout(XPM.fate);A.className+=" xpmOver";A.xpmParent.xpmFocused=true}XPM.log+="XPM.hover() > "+A.xpmClass+" ["+A.xpmParent.xpmIndex+(A.xpmClass=="SubItem"?"-"+A.xpmSubIndex:"")+"] = "+A.className+" ("+(B.indexOf(" xpmOver")!=-1?"out":"over")+")\n"};XPM.fade=function(A,C,B){XPM.log+="XPM.fade("+A+", "+(Math.round(C*100)/100)+", "+(B?B:0)+") > "+(XPM.IE?"filters.alpha":"style")+".opacity = "+(B?(XPM.IE?(Math.round(XPM.menus[A].xpmSubMenu.filters.alpha.opacity*100)/100)+" + "+(Math.round(C*B*100)/100):(parseInt(XPM.menus[A].xpmSubMenu.style.opacity*100)/100)+" + "+(Math.round(C*B)/100)):(XPM.IE?C:(C/100)))+"\n";A=XPM.menus[A].xpmSubMenu;if(XPM.IE){return A.filters.alpha.opacity=B?A.filters.alpha.opacity+(C*B):C}else{return A.style.opacity=B?parseFloat(A.style.opacity)+((C*B)/100):C/100}};XPM.setFate=function(){XPM.fate=setTimeout("XPM.timer = setInterval('XPM.slide()', XPM.slideDelay);",XPM.stayTime)};XPM.clear=function(){if(XPM.activeMenu==-1){XPM.log+="XPM.clear() > No menu active [-1]\n";return false}clearInterval(XPM.timer);clearTimeout(XPM.fate);var A=XPM.menus[XPM.activeMenu];A.xpmSubContainer.style.display="none";A.xpmCurrentHeight=0;A.xpmSubMenu.style.height="0px";A.xpmLabel.className=A.xpmLabel.className.replace("xpmOpen","xpmClosed");if(XPM.doFade){XPM.fade(XPM.activeMenu,0)}XPM.locked=null;A.xpmState=false;XPM.log+="XPM.clear() > Cleared ["+XPM.activeMenu+"]\n";XPM.activeMenu=-1;return true};XPM.setSlide=function(){var A=this.xpmParent.xpmState;if(XPM.activeMenu!=-1&&XPM.activeMenu!=this.xpmParent.xpmIndex){XPM.clear()}else{if(XPM.activeMenu==this.xpmParent.xpmIndex){return XPM.hover(this)}}XPM.hover(this);if(!this.xpmParent.xpmSubMenu){return false}XPM.activeMenu=this.parentNode.xpmIndex;this.className=this.className.replace("xpmClosed","xpmOpen");XPM.log+="XPM.setSlide() > Operating ["+this.xpmParent.xpmIndex+"], state "+this.xpmParent.xpmState+", locked "+(XPM.locked?"["+XPM.locked.xpmIndex+"]":"null")+"\n";XPM.timer=setInterval("XPM.slide()",XPM.slideDelay);return true};XPM.slide=function(){var B,A=XPM.activeMenu;B=XPM.menus[A];if(!B){clearInterval(XPM.timer);clearTimeout(XPM.fate);return XPM.log+="XPM.slide() > No active menu [-1]\n"}if(XPM.locked&&XPM.locked!=B){clearInterval(XPM.timer);clearTimeout(XPM.fate);return XPM.log+="XPM.slide() > Another menu is locked ["+A+"x"+XPM.locked.xpmIndex+"]\n"}XPM.locked=B;if(B.xpmState){if(XPM.doFade){XPM.fade(A,100/(B.xpmFadeStep+1),-1)}B.xpmSubContainer.style.display="none";B.xpmCurrentHeight-=XPM.slideStep;if(B.xpmCurrentHeight>0){B.xpmSubMenu.style.height=B.xpmCurrentHeight+"px"}else{if(XPM.doFade){XPM.fade(A,0)}B.xpmLabel.className=B.xpmLabel.className.replace("xpmOpen","xpmClosed");B.xpmCurrentHeight=0;B.xpmSubMenu.style.height="0px";clearInterval(XPM.timer);XPM.timer=null;clearTimeout(XPM.fate);XPM.fate=null;XPM.locked=null;B.xpmState=false;XPM.activeMenu=-1;XPM.log+="XPM.slide() > Closed ["+A+"]\n"}}else{if(XPM.doFade){XPM.fade(A,100/(B.xpmFadeStep+1),1)}B.xpmCurrentHeight+=XPM.slideStep;if(B.xpmCurrentHeight<B.xpmMaxHeight){B.xpmSubMenu.style.height=B.xpmCurrentHeight+"px"}else{if(XPM.doFade){XPM.fade(A,100)}B.xpmCurrentHeight=B.xpmMaxHeight;B.xpmSubMenu.style.height=B.xpmMaxHeight+"px";B.xpmSubContainer.style.display="inline";clearInterval(XPM.timer);XPM.timer=null;clearTimeout(XPM.fate);XPM.fate=null;XPM.locked=null;B.xpmState=true;if(!B.xpmFocused){XPM.setFate()}XPM.log+="XPM.slide() > Opened ["+A+"]\n"}}return B.xpmState};XPM.load("topmenu");