var borderWidth=2;var menuHold=300;var shadowOffset=5;var shadowOpacity=40;var offsetX=15;var offsetY=0;var minwidth=130;var topminwidth=125;var fading=true;var fadeStep=15;var fadeSpeed=2;var growing=true;var growStep=7;var growSpeed=2;var bump=false;var bumpDist=100;var bumpStep=10;var bumpSpeed=5;var scrolling=false;var scrollStep=7;var scrollSpeed=10;var direction="right";var menus=new Array;var shadow;var menu;var shadows=new Array;var timeoutVar=0;var clearMenus=-1;var lastLevel=0;var eventsDefined=false;var fadeTimeout=-1;var menuopacity=new Array;var shadowopacity=new Array;var fadeStepShadow=Math.round(fadeStep*(shadowOpacity/100));var lastObj=new Array;var objToChange=new Array;var menuwidth=new Array;var menuheight=new Array;var menuleft=new Array;var menutop=new Array;var curmenuwidth=new Array;var curmenuheight=new Array;var menupro=new Array;var growingObj=new Array;var grows=new Array;var curDirection=direction;var docWidth=0;var realOffsetX=0;var realOffsetY=0;var countMenus=0;var bumper=new Array;var scroller=new Array;var menuBorder=0;var tempObj=0;var initFinished=false;var menusNotIE6=true;function findPos(a){var b=curtop=0;if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){b+=a.offsetLeft;curtop+=a.offsetTop}}return[b-realOffsetX,curtop-realOffsetY]}function showMenu(f,b,c){b=parseInt(b);var e=document.getElementById("drop_"+c);if(f=="temp"){f=tempObj}if((c!=""&&!e)||!initFinished||(scrolling&&(b!=0)&&scroller[b-1])){tempObj=f;setTimeout("showMenu('temp',"+b+",'"+c+"')",2);return}var a=f.className+"H";if(a.indexOf("HH")==-1){f.className=a}if(lastObj[b]==f){return}if(e&&e.style.visibility=="visible"){return}resetTimeout();for(var g in lastObj){if(g>b){lastObj[g]=0}}lastObj[b]=f;growingObj[b]=f;var m=findPos(f);var k=m[0];var h=m[1];if(b==0){curDirection=direction;h+=f.offsetHeight+offsetY;k+=offsetX;for(var g in menus){if(menus[g]){menus[g].style.visibility="hidden";var n=menus[g].id.replace("drop_","");if(objToChange[n]){if(objToChange[n]["obj"]!=f){objToChange[n]["obj"].className=objToChange[n]["classtmp"]}delete objToChange[n]}delete menus[g]}if(shadows[g]){shadows[g].style.visibility="hidden";delete shadows[g]}}}else{var d=k;var l=0;if(menuwidth["drop_"+c]){l=menuwidth["drop_"+c]}if(curDirection=="right"){d+=f.offsetWidth+menuBorder}else{d-=l}if((d+realOffsetX)<=0){d=k;curDirection="right";d+=f.offsetWidth+menuBorder}if((d+l-realOffsetX)>docWidth){d=k;curDirection="left";d-=l}k=d;for(var g in menus){if(parseInt(g)>=b){if(menus[g]){menus[g].style.visibility="hidden";var n=menus[g].id.replace("drop_","");if(objToChange[n]){if(objToChange[n]["obj"]!=f){objToChange[n]["obj"].className=objToChange[n]["classtmp"]}delete objToChange[n]}delete menus[g]}if(shadows[g]){shadows[g].style.visibility="hidden";delete shadows[g]}}}}if(c!=""){if(!menus[b]){e.style.left=k+"px";e.style.top=h+"px";menus[b]=e;menuleft[b]=k;menutop[b]=h;lastLevel=b;var o=document.getElementById("dropShadow_"+c);if(o){o.style.left=k+shadowOffset+"px";o.style.top=h+shadowOffset+"px";o.style.width=e.offsetWidth+"px";o.style.height=e.offsetHeight+"px";if(o.childNodes[0].src){o.childNodes[0].width=e.offsetWidth;o.childNodes[0].height=e.offsetHeight}shadows[b]=o;setOpacity(o,0)}displayMenu(b)}}}function changeClass(b,d,a){var c=document.getElementById("drop_"+d);if(c){objToChange[d]=new Array;objToChange[d]["obj"]=b;objToChange[d]["classtmp"]=a.replace("dropButtonHaveSubN","dropButtonHaveSub_"+direction);setTimeout("changeClassById('"+d+"')",20)}else{b.className=a}}function changeClassById(b){var a=document.getElementById("drop_"+b);if(a){if(a.style.visibility!="visible"){if(objToChange[b]){objToChange[b]["obj"].className=objToChange[b]["classtmp"];delete objToChange[b]}}}}function resetTimeout(){if(clearMenus!=-1){clearTimeout(clearMenus);clearMenus=-1}}function hideLastMenu(){var a=menus[lastLevel];if(a){a.style.visibility="hidden";var b=menus[lastLevel].id.replace("drop_","");if(objToChange[b]){objToChange[b]["obj"].className=objToChange[b]["classtmp"];delete objToChange[b]}delete menus[lastLevel];if(shadows[lastLevel]){shadows[lastLevel].style.visibility="hidden";delete shadows[lastLevel]}lastObj[lastLevel]=0;lastLevel--;clearMenus=-1;mouseOutMenu()}}function menuClicked(a){window.location.href=a}function docClicked(){for(var b in menus){if(menus[b]){menus[b].style.visibility="hidden";var a=menus[b].id.replace("drop_","");if(objToChange[a]){objToChange[a]["obj"].className=objToChange[a]["classtmp"];delete objToChange[a]}delete menus[b]}if(shadows[b]){shadows[b].style.visibility="hidden";delete shadows[b]}}lastLevel=0;resetTimeout()}function mouseOutMenu(){if(clearMenus==-1){clearMenus=setTimeout("hideLastMenu()",menuHold)}}function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,false);return true}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b}else{return false}}}function displayMenu(a){a=parseInt(a);menu=menus[a];shadow=shadows[a];if(shadow){setOpacity(shadow,shadowOpacity)}if(scrolling){menu.childNodes[0].style.position="absolute";if(shadow){shadow.childNodes[0].style.position="absolute"}if(a==0){menu.childNodes[0].style.top="-"+menuheight[menu.id]+"px";if(shadow){shadow.childNodes[0].style.top="-"+menuheight[menu.id]+"px"}}else{if(curDirection=="right"){menu.childNodes[0].style.left="-"+menuwidth[menu.id]+"px";if(shadow){shadow.childNodes[0].style.left="-"+menuwidth[menu.id]+"px"}}else{menu.childNodes[0].style.left=(menuwidth[menu.id]*2)+"px";if(shadow){shadow.childNodes[0].style.left=(menuwidth[menu.id]*2)+"px"}}}menu.style.visibility="visible";if(shadow){shadow.style.visibility="visible"}scroller[a]=0;setTimeout("scrollin("+a+")",scrollSpeed);return}if(bump){setTimeout("bumpin("+a+")",bumpSpeed);return}if(growing){grows[menu.id]=1;growin(a)}if(fading){setTimeout("fadein("+a+")",(fadeSpeed*2))}if(!fading&&!growing){if(menu){menu.style.visibility="visible"}if(shadow){shadow.style.visibility="visible"}}}function startFader(a){if(menus[a]){setOpacity(menus[a],0);menuopacity[a]=0;menus[a].style.visibility="visible";if(shadows[a]){setOpacity(shadows[a],0);shadowopacity[a]=0;shadows[a].style.visibility="visible"}}}function fadein(a){a=parseInt(a);if(menus[a]){if(menus[a].style.visibility!="visible"){startFader(a);setTimeout("fadein("+a+")",fadeSpeed);return}menuopacity[a]+=fadeStep;if(menuopacity[a]>100){menuopacity[a]=100}setOpacity(menus[a],menuopacity[a]);if(shadows[a]){if(menuopacity[a]>=shadowOpacity){if(shadowopacity[a]>shadowOpacity){shadowopacity[a]=shadowOpacity}setOpacity(shadows[a],shadowopacity[a]);shadowopacity[a]+=fadeStepShadow}}if(shadows[a]){if(menuopacity[a]!=100||shadowopacity[a]!=shadowOpacity){setTimeout("fadein("+a+")",fadeSpeed)}}else{if(menuopacity[a]!=100){setTimeout("fadein("+a+")",fadeSpeed)}}}}function setOpacity(b,a){b.style.KHTMLOpacity=a/100;b.style.MozOpacity=a/100;b.style.opacity=a/100;b.style.filter="alpha(opacity:"+a+")";if(b.childNodes[0]&&b.childNodes[0].src){b=b.childNodes[0];b.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=25)"}}function growin(a){a=parseInt(a);if(menus[a]){var b=menus[a].id;if(menus[a].style.visibility!="visible"){menus[a].style.width="0px";menus[a].style.height="0px";curmenuheight[a]=0;curmenuwidth[a]=0;if(shadows[a]){shadows[a].style.width="0px";shadows[a].style.height="0px";if(shadows[a].childNodes[0].src){shadows[a].childNodes[0].width=0;shadows[a].childNodes[0].height=0}}if(fading){startFader()}else{shadows[a].style.visibility="visible";menus[a].style.visibility="visible"}setTimeout("growin("+a+")",growSpeed);return}var e=growingObj[a];if(a!=0&&e){var k=findPos(e);var g=k[0];var f=k[1];var c=g;var h=0;h=curmenuwidth[a];if(curDirection=="right"){c+=e.offsetWidth+menuBorder}else{c-=h}if((c+realOffsetX)<=0){c=g;curDirection="right";c+=e.offsetWidth}if((c+h-realOffsetX)>docWidth){c=g;curDirection="left";c-=h}g=c;menus[a].style.left=g+"px";menus[a].style.top=f+"px";if(shadows[a]){shadows[a].style.left=g+shadowOffset+"px";shadows[a].style.top=f+shadowOffset+"px"}}curmenuheight[a]+=growStep;if(curmenuheight[a]>menuheight[b]){curmenuheight[a]=menuheight[b]}curmenuwidth[a]+=menupro[b];curmenuwidth[a]=Math.round(curmenuwidth[a]);if(curmenuwidth[a]>menuwidth[b]){curmenuwidth[a]=menuwidth[b]}menus[a].style.width=curmenuwidth[a]+"px";menus[a].style.height=curmenuheight[a]+"px";if(shadows[a]){shadows[a].style.width=curmenuwidth[a]+"px";shadows[a].style.height=curmenuheight[a]+"px";if(shadows[a].childNodes[0].src){shadows[a].childNodes[0].width=curmenuwidth[a];shadows[a].childNodes[0].height=curmenuheight[a]}}var l=false;for(var d in grows){if(grows[d]==1){l=true;break}}if(l||curmenuheight[a]<menuheight[b]||curmenuwidth[a]<menuwidth[b]){setTimeout("growin("+a+")",growSpeed)}else{grows[b]=0}}}function getElementsByClass(g,e,a){var d=new Array();if(e==null){e=document}if(a==null){a="*"}var c=e.getElementsByTagName(a);var b=c.length;var f=new RegExp("(^|\\s)"+g+"(\\s|$)");for(i=0,j=0;i<b;i++){if(f.test(c[i].className)){d[j]=c[i];j++}}return d}function getDocWidth(){realOffsetX=0;realOffsetY=0;if(document.body.offsetWidth){docWidth=document.body.offsetWidth}var b=document.getElementById("Topbar");if(b){if(!eventsDefined){addEvent(b,"mouseover",resetTimeout);addEvent(b,"mouseout",mouseOutMenu)}b=b.parentNode;var a=getPos(b);if(a=="absolute"){var c=findPos(b);realOffsetX=c[0];realOffsetY=c[1]}}}function setTopWidth(k){if(document.getElementById("Topbar")){if(!menusNotIE6&&document.getElementById("Topbar").parentNode.tagName=="TD"){document.getElementById("Topbar").style.position="static"}if(typeof(k)=="undefined"||k==3){var f=(typeof(k)=="undefined");var g=getElementsByClass("menuSpacer");g=g[0];var e=getElementsByClass("Topnavibuttonfolder");for(var d=0;d<e.length;d++){if(!f&&g&&d==e.length-1){topminwidth+=g.offsetWidth}if(menusNotIE6){if(e[d].childNodes[0]){var b=document.createElement("div");b.innerHTML=e[d].innerHTML;b.style.visibility="hidden";b.style.position="absolute";b.style.left="0";b.style.top="0";document.body.appendChild(b);if((b.offsetWidth<topminwidth)&&(b.childNodes[0]&&(b.childNodes[0].offsetWidth<topminwidth))){if(f){e[d].style.width=topminwidth+"px"}if(!f){e[d].childNodes[0].style.width=topminwidth+"px"}}else{if(b.offsetWidth>b.childNodes[0].offsetWidth){if(f){e[d].style.width=b.offsetWidth+"px"}if(!f){e[d].childNodes[0].style.width=b.offsetWidth+"px"}}else{if(f){e[d].style.width=b.childNodes[0].offsetWidth+"px"}if(!f){e[d].childNodes[0].style.width=b.childNodes[0].offsetWidth+"px"}}}document.body.removeChild(b);delete b}}else{if((e[d].offsetWidth<topminwidth)&&(e[d].childNodes[0]&&(e[d].childNodes[0].offsetWidth<topminwidth))){if(f){e[d].style.width=topminwidth+"px"}if(!f){e[d].childNodes[0].style.width=topminwidth+"px"}}else{if(e[d].offsetWidth>e[d].childNodes[0].offsetWidth){if(f){e[d].style.width=e[d].offsetWidth+"px"}if(!f){e[d].childNodes[0].style.width=e[d].offsetWidth+"px"}}else{if(f){e[d].style.width=e[d].childNodes[0].offsetWidth+"px"}if(!f){e[d].childNodes[0].style.width=e[d].childNodes[0].offsetWidth+"px"}}}}}if(typeof(k)=="undefined"){setTimeout("setTopWidth(3)",100)}else{document.getElementById("Topbar").style.visibility="visible";if(!eventsDefined){var a=getElementsByClass("menuDrop");for(var d=0;d<a.length;d++){addEvent(a[d],"mouseover",resetTimeout);addEvent(a[d],"mouseout",mouseOutMenu);var c=a[d].id;menuheight[c]=a[d].offsetHeight;menuwidth[c]=a[d].offsetWidth+12;if(a[d].offsetWidth<(minwidth-12)){menuwidth[c]=minwidth+12}a[d].style.overflow="hidden";a[d].childNodes[0].style.width=(menuwidth[c]-borderWidth)+"px";a[d].childNodes[0].style.height=(menuheight[c]-borderWidth)+"px";a[d].style.width=menuwidth[c]+"px";a[d].style.height=menuheight[c]+"px";menupro[c]=(growStep*menuwidth[c])/menuheight[c]}var m=getElementsByClass("dropButtonHaveSubN");for(var d=0;d<m.length;d++){m[d].className=m[d].className.replace("dropButtonHaveSubN","dropButtonHaveSub_"+direction)}addEvent(document,"click",docClicked);addEvent(window,"resize",getDocWidth);getDocWidth();eventsDefined=true}}}var l=getElementsByClass("menuDropShadow");if(l[0]){if(!l[0].childNodes[0]){setTimeout("setTopWidth(2)",10);return}if(l[0].childNodes[0].src){var h=new Image;h.src=l[0].childNodes[0].src}}initFinished=true}else{setTimeout("setTopWidth()",100)}}function bumpin(f){if(!menus[f]){return}var e=true;if(bumper[f]){bumper[f]-=bumpStep;if(bumper[f]<=0){bumper[f]=0;e=false}}else{bumper[f]=bumpDist}var c=menuleft[f];var a=menutop[f];if(f==0){a+=bumper[f]}else{var b=c;var d=0;d=menuwidth[menus[f].id];if(curDirection=="right"){b+=bumper[f]}else{b-=bumper[f]-menuBorder}if((b+realOffsetX)<=0){b=c;curDirection="right";b+=bumper[f]}if((b+d-realOffsetX)>docWidth){b=c;curDirection="left";b-=bumper[f]-menuBorder}c=b}if(menus[f]){menus[f].style.left=c+"px";menus[f].style.top=a+"px";if(shadows[f]){shadows[f].style.left=c+shadowOffset+"px";shadows[f].style.top=a+shadowOffset+"px"}if(menus[f].style.visibility!="visible"){menus[f].style.visibility="visible";if(shadows[f]){shadows[f].style.visibility="visible"}}}if(e){setTimeout("bumpin("+f+")",bumpSpeed)}}function scrollin(d){if(!scroller[d]){scroller[d]=0}var a=true;var b=menus[d];if(!b){return}var c=shadows[d];if(d==0){if(scroller[d]>=menuheight[b.id]){scroller[d]=menuheight[b.id];a=false}b.childNodes[0].style.top="-"+(menuheight[b.id]-scroller[d])+"px";if(c){c.childNodes[0].style.top="-"+(menuheight[b.id]-scroller[d])+"px"}}else{if(scroller[d]>=menuwidth[b.id]){scroller[d]=menuwidth[b.id];a=false}if(curDirection=="right"){b.childNodes[0].style.left="-"+(menuwidth[b.id]-scroller[d])+"px";if(c){c.childNodes[0].style.left="-"+(menuwidth[b.id]-scroller[d])+"px"}}else{b.childNodes[0].style.left=(menuwidth[b.id]-scroller[d])+"px";if(c){c.childNodes[0].style.left=(menuwidth[b.id]-scroller[d])+"px"}}}if(a){scroller[d]+=scrollStep;setTimeout("scrollin("+d+")",scrollSpeed)}else{delete scroller[d]}}function getPos(a){if(a.style.position!=""){return a.style.position}if(a.currentStyle){return a.currentStyle.position}if(document.defaultView){return document.defaultView.getComputedStyle(a,"").getPropertyValue("position")}return""}function fix_width(){var a=document.getElementById("Topbar");a.childNodes[10].style.width="144px";a.childNodes[10].childNodes[0].style.width="144px"};
