function showPosition(a){position=document.getElementById(a);if(position.tagName=="TD"){position.style.display="table-cell"}else{position.style.display="block"}}var menuIndex=-1;var menus=new Array();function createMenu(a){if(!currentMenuId){return}else{menus[++menuIndex]=new DynamicMenu("menu_"+currentMenuId,menuIndex,a);delete currentMenuId}}function DynamicMenu(g,e,b){var a=null;var e=e;this.menu=document.getElementById(g);this.menu.id="menu_"+e;this.buttons=this.menu.childNodes;var d=new Array();var f=new Array();for(var c=0;c<this.buttons.length;c++){if(!isNaN(this.buttons[c].id)&&this.buttons[c].id>0){d.push(this.buttons[c])}}this.showSubMenu=function(){var j=new Array();var h=true;clearTimeout(a);this.hideAll(this.menuLevel);var n=0;for(var k=0;k<d.length;k++){if(d[k].getAttribute("parent_id")==this.id){d[k].style.display="block";d[k].originalWidth=d[k].offsetWidth;j.push(d[k])}}this.regulateWidths(j);for(var k=0;k<d.length;k++){if(d[k].getAttribute("parent_id")==this.id){d[k].menuLevel=this.menuLevel+1;var m=this.offsetLeft;var l=this.offsetTop;if(!this.getAttribute("parent_id")>0&&document.all&&getIEVersion()<8){m=getOffsetPropertyInIE(this,"offsetLeft");l=getOffsetPropertyInIE(this,"offsetTop")}if(this.getAttribute("parent_id")>0||b){d[k].style.left=(m+this.offsetWidth)+"px";d[k].style.top=(l+n)+"px"}else{d[k].style.left=m-d[k].offsetWidth+this.offsetWidth+"px";d[k].style.top=(l+this.offsetHeight+n)+"px"}n+=d[k].offsetHeight}}};this.regulateWidths=function(h){if(h.length<=0){return}if(h[0].regulated){return}var k=0;for(var j=0;j<h.length;j++){if(k<h[j].originalWidth){k=h[j].originalWidth}}if(k<100){k=100}for(var j=0;j<h.length;j++){h[j].style.width=k+"px";h[j].regulated=true}};this.hideAll=function(j){for(var h=0;h<d.length;h++){if(d[h].menuLevel>j){d[h].style.display="none"}}};this.hideSubMenu=function(){a=setTimeout("menus["+e+"].hideAll(0)",1000)};for(var c=0;c<d.length;c++){d[c].menuLevel=0;d[c].style.zIndex=1000000+c;d[c].hideAll=this.hideAll;d[c].regulateWidths=this.regulateWidths;d[c].onmouseover=this.showSubMenu;d[c].onmouseout=this.hideSubMenu}}function getOffsetPropertyInIE(a,b){var d=a;var c=d[b];while(d.parentNode){d=d.parentNode;if(!isNaN(d[b])){c+=d[b]}}return c}function getIEVersion(){var c=-1;if(navigator.appName=="Microsoft Internet Explorer"){var a=navigator.userAgent;var b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(b.exec(a)!=null){c=parseFloat(RegExp.$1)}}return c};
