function Browser(){this.isIE=false;this.isNS=false;if(navigator.userAgent.indexOf("MSIE")>=0){this.isIE=true;return}if(navigator.userAgent.indexOf("Netscape6/")>=0||navigator.userAgent.indexOf("Gecko")>=0){this.isNS=true}}function ClientScreen(){this.width=screen.width;this.height=screen.height;if(typeof window.innerWidth!="undefined"){this.width=window.innerWidth;this.height=window.innerHeight}else{if(document.documentElement&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){this.width=document.documentElement.clientWidth;this.height=document.documentElement.clientHeight}else{if(document.body&&typeof document.body.clientWidth!="undefined"){this.width=document.body.clientWidth;this.height=document.body.clientHeight}}}}var browser=new Browser();var activeButton=null;var scrollY=0;var curXPos=0;var curYPos=0;if(browser.isIE){document.onmousedown=pageMousedown}else{window.addEventListener("mousedown",pageMousedown,true)}function pageMousedown(b){var a;if(!browser.isIE){curXPos=b.pageX;curYPos=b.pageY}if(activeButton==null){return false}if(browser.isIE){a=(window.event?window.event.srcElement:null)}else{a=(b.target.tagName?b.target:b.target.parentNode)}if(a==activeButton){return}if(getContainerWith(a,"DIV","menu")==null){resetButton(activeButton);if(gHideSelects&&!gContextMenu){SetElementVisibility("select","inherit")}activeButton=null}}function activate(command){if(command.substring(0,11).toLowerCase()=="javascript:"){var sessPos=command.indexOf("?PHPSESSID");if(sessPos>-1){command=command.substring(0,sessPos)}eval(command);setTimeout("activeButton = null",1000)}else{elements=document.body.getElementsByTagName("div");for(var index=0;index<elements.length;index++){if((elements[index].id)&&(elements[index].id.substring(0,4).toLowerCase()=="menu")){elements[index].style.visibility="hidden"}}elements=document.body.getElementsByTagName("a");for(var index=0;index<elements.length;index++){if((elements[index].id)&&(elements[index].id.substring(0,4).toLowerCase()=="menu")){elements[index].style.visibility="hidden"}}elements=document.body.getElementsByTagName("span");for(var index=0;index<elements.length;index++){if((elements[index].id)&&(elements[index].id.substring(0,4).toLowerCase()=="menu")){elements[index].style.visibility="hidden"}}document.location=command}}function returnBaseParentType(a){if(a==null){return false}if(a.className!="contextMenu"&&a.className!="menuBar"){return returnBaseParentType(browser.isIE?a.parentElement:a.parentNode)}return a.className}function resetButton(b){var a=returnBaseParentType(b);if(a=="contextMenu"){b.style.display="none";activeButton=null}else{if(a=="menuBar"){stripClass(b,"menuButtonActive");if(b.menu!=null){closeSubMenu(b.menu);b.menu.style.visibility="hidden"}}else{alert("Something is wrong, base parent neither menuBar or contextMenu!")}}}function menuMouseover(a){var b;b=(browser.isIE?getContainerWith(window.event.srcElement,"DIV","menu"):a.currentTarget);if(b.activeItem!=null){closeSubMenu(b)}}function menuItemMouseover(b,f){var i,d,h,g;i=(browser.isIE?getContainerWith(window.event.srcElement,"A","menuItem"):b.currentTarget);d=getContainerWith(i,"DIV","menu");if(d.activeItem!=null){closeSubMenu(d)}d.activeItem=i;i.className+=" menuItemHighlight";if(i.subMenu==null){i.subMenu=document.getElementById(f);menuInit(i.subMenu)}h=getPageOffset(i,"left")+i.offsetWidth;g=getPageOffset(i,"top")-scrollY;var e=new ClientScreen();var a=e.width;var c=e.height;a-=i.subMenu.offsetWidth;c-=i.subMenu.offsetHeight;if(h>a){h=Math.max(0,h-i.offsetWidth-i.subMenu.offsetWidth+(d.offsetWidth-i.offsetWidth))}g=Math.max(0,Math.min(g,c));if(i.subMenu.style.left!=h+"px"){i.subMenu.style.left=h+"px";i.subMenu.style.top=g+"px"}i.subMenu.style.visibility="visible";if(i.subMenu.originalHeight>e.height){setupScrollBars(i.subMenu,e)}if(browser.isIE){window.event.cancelBubble=true}else{b.stopPropagation()}}function setupScrollBars(f,c){var d=document.getElementById("topScroll_"+f.id);var e=document.getElementById("botScroll_"+f.id);var b=document.getElementById("outerScrollZone_"+f.id);var a=c.height-60;d.style.display="none";d.style.cursor="default";e.style.display="block";e.style.cursor="default";b.style.height=a;b.style.width=f.originalWidth+"px";b.style.overflow="hidden"}function closeSubMenu(a){if(a==null||a.activeItem==null){return}if(a.activeItem.subMenu!=null){closeSubMenu(a.activeItem.subMenu);a.activeItem.subMenu.style.visibility="hidden";a.activeItem.subMenu=null}stripClass(a.activeItem,"menuItemHighlight");a.activeItem=null}function menuInit(c){var f,b;var l,k;var g;var h,a;var e,d;itemCollection=c.getElementsByTagName("A");f=new Array();for(e=0;e<itemCollection.length;e++){f.push(itemCollection[e])}spanCollection=c.getElementsByTagName("SPAN");for(e=0;e<spanCollection.length;e++){if(browser.isIE&&containsClass(spanCollection[e],"menuItemArrow")){spanCollection[e].style.fontFamily="Webdings";spanCollection[e].firstChild.nodeValue="4"}if(containsClass(spanCollection[e],"menuItemScrollArrow")){spanCollection[e].style.paddingLeft=(c.offsetWidth/2)+"px"}if(containsClass(spanCollection[e],"menuItemInactive")){f.push(spanCollection[e])}}if(f.length>0){g=f[0].offsetWidth;for(e=0;e<f.length;e++){l=null;k=null;shortcutEl=null;b=f[e].getElementsByTagName("SPAN");for(d=0;d<b.length;d++){if(containsClass(b[d],"menuItemText")){l=b[d]}if(containsClass(b[d],"menuItemArrow")){k=b[d]}if(containsClass(b[d],"menuShortCut")){shortcutEl=b[d]}}if(l!=null&&(k!=null||shortcutEl!=null)){if(l.style.paddingRight.length==0){l.style.paddingRight=(g-(l.offsetWidth+(k!=null?k.offsetWidth:shortcutEl.offsetWidth)))+"px"}}}}if(browser.isIE){h=f[0].offsetWidth;f[0].style.width=h+"px";a=f[0].offsetWidth-h;h-=a;for(index=0;index<f.length;index++){f[index].style.width=h+"px"}}c.initialized=true}var ScrollInfoId={intervalId:null,scrollDiv:null,scrollUp:false};function startScroll(b,a){stopScroll();ScrollInfoId.scrollMenu=b;ScrollInfoId.scrollUp=a;ScrollInfoId.intervalId=setInterval("scrollMenu()",30);document.onmouseup=stopScroll}function stopScroll(){if(ScrollInfoId.intervalId!=null){clearInterval(ScrollInfoId.intervalId);ScrollInfoId.intervalId=null;ScrollInfoId.scrollDiv=null}}function scrollMenu(){outerDiv=document.getElementById("outerScrollZone_"+ScrollInfoId.scrollMenu);divToScroll=document.getElementById("innerScrollZone_"+ScrollInfoId.scrollMenu);menuToScroll=document.getElementById(ScrollInfoId.scrollMenu);botScroll=document.getElementById("botScroll_"+ScrollInfoId.scrollMenu);topScroll=document.getElementById("topScroll_"+ScrollInfoId.scrollMenu);divTop=(isNaN(parseInt(divToScroll.style.top))?0:parseInt(divToScroll.style.top));if(ScrollInfoId.scrollUp){if(divTop>=0){topScroll.style.display="none";stopScroll()}else{divToScroll.style.top=(divTop+10)+"px"}if(botScroll.style.display=="none"){botScroll.style.display="block"}}else{if((divTop+menuToScroll.originalHeight)>outerDiv.offsetHeight){divToScroll.style.top=(divTop-10)+"px"}else{botScroll.style.display="none";stopScroll()}if(topScroll.style.display=="none"){topScroll.style.display="block"}}}function getContainerWith(c,a,b){while(c!=null){if(c.tagName!=null&&c.tagName==a&&containsClass(c,b)){return c}c=c.parentNode}return c}function containsClass(c,a){var b;if(c.className==null){return false}b=new RegExp(a+"\\s*");return b.test(c.className)}function stripClass(d,b){var a,c;if(d.className==null){return}c=new RegExp("(\\s*)"+b+"(\\s*)","g");a=d.className;a=a.replace(c,"$1$2");while(a.substring(a.length-1)==" "){a=a.substring(0,a.length-1)}d.className=a}function getPageOffset(b,c){var a;a=(c=="left"?b.offsetLeft:b.offsetTop);if(b.offsetParent!=null){a+=getPageOffset(b.offsetParent,c)}return a};
