var jsmenu=[];var ctrlobjclassName;jsmenu.active=[];jsmenu.timer=[];jsmenu.iframe=[];function initCtrl(c,b,f,d,a){if(c&&!c.initialized){c.initialized=true;c.unselectable=true;c.outfunc=typeof c.onmouseout=="function"?c.onmouseout:null;c.onmouseout=function(){if(this.outfunc){this.outfunc()}if(f<3){jsmenu.timer[c.id]=setTimeout("hideMenu("+a+")",d)}};if(b&&f){c.clickfunc=typeof c.onclick=="function"?c.onclick:null;c.onclick=function(g){doane(g);if(jsmenu.active[a]==null||jsmenu.active[a].ctrlkey!=this.id){if(this.clickfunc){this.clickfunc()}else{showMenu(this.id,true)}}else{hideMenu(a)}}}c.overfunc=typeof c.onmouseover=="function"?c.onmouseover:null;c.onmouseover=function(g){doane(g);if(this.overfunc){this.overfunc()}if(b){clearTimeout(jsmenu.timer[this.id])}else{for(var h in jsmenu.timer){if(jsmenu.timer[h]){clearTimeout(jsmenu.timer[h])}}}}}}function initMenu(a,f,d,c,b){if(f&&!f.initialized){f.initialized=true;f.ctrlkey=a;f.onclick=ebygum;f.style.position="absolute";if(d<3){if(d>1){f.onmouseover=function(){clearTimeout(jsmenu.timer[a])}}if(d!=1){f.onmouseout=function(){jsmenu.timer[a]=setTimeout("hideMenu("+b+")",c)}}}f.style.zIndex=50}}function showMenu(b,n,g,d,l,j,c,h){e=window.event||showMenu.caller["arguments"][0];var k=$(b);if(!k){return}if(isUndefined(n)){n=false}if(isUndefined(g)){g=0}if(isUndefined(d)){d=2}if(isUndefined(l)){l=500}if(isUndefined(j)){j=0}if(isUndefined(c)){c=b}var m=$(c);var i=$(c+"_menu");if(!m||!i){return}if(isUndefined(h)){h=400}hideMenu(j);for(var a in jsmenu.timer){if(jsmenu.timer[a]){clearTimeout(jsmenu.timer[a])}}initCtrl(k,n,d,l,j);ctrlobjclassName=k.className;k.className+=" hover";initMenu(b,i,d,l,j);i.style.display="";if(!is_opera){i.style.clip="rect(auto, auto, auto, auto)"}setMenuPosition(c,g);if(is_ie&&is_ie<7){if(!jsmenu.iframe[j]){var f=document.createElement("iframe");f.style.display="none";f.style.position="absolute";f.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";if($("append_parent")){$("append_parent").appendChild(f)}else{i.parentNode.appendChild(f)}jsmenu.iframe[j]=f}jsmenu.iframe[j].style.top=i.style.top;jsmenu.iframe[j].style.left=i.style.left;jsmenu.iframe[j].style.width=i.w;jsmenu.iframe[j].style.height=i.h;jsmenu.iframe[j].style.display="block"}if(h&&i.scrollHeight>h){i.style.height=h+"px";if(is_opera){i.style.overflow="auto"}else{i.style.overflowY="auto"}}if(!d){setTimeout("hideMenu("+j+")",l)}jsmenu.active[j]=i}function setMenuPosition(d,c){var a=$(d);var b=$(d+"_menu");if(isUndefined(c)){c=0}if(a){a.pos=fetchOffset(a);a.X=a.pos.left;a.Y=a.pos.top;a.w=a.offsetWidth;a.h=a.offsetHeight;b.w=b.offsetWidth;b.h=b.offsetHeight;b.style.left=(a.X+b.w>document.body.clientWidth)&&(a.X+a.w-b.w>=0)?a.X+a.w-b.w+"px":a.X+"px";b.style.top=c==1?a.Y+"px":(c==2||((a.Y+a.h+b.h>document.documentElement.scrollTop+document.documentElement.clientHeight)&&(a.Y-b.h>=0))?(a.Y-b.h)+"px":a.Y+a.h+"px");if(b.style.clip&&!is_opera){b.style.clip="rect(auto, auto, auto, auto)"}}}function hideMenu(a){if(isUndefined(a)){a=0}if(jsmenu.active[a]){try{$(jsmenu.active[a].ctrlkey).className=ctrlobjclassName}catch(b){}clearTimeout(jsmenu.timer[jsmenu.active[a].ctrlkey]);jsmenu.active[a].style.display="none";if(is_ie&&is_ie<7&&jsmenu.iframe[a]){jsmenu.iframe[a].style.display="none"}jsmenu.active[a]=null}}function fetchOffset(c){var b=c.offsetLeft;var a=c.offsetTop;while((c=c.offsetParent)!=null){b+=c.offsetLeft;a+=c.offsetTop}return{left:b,top:a}}function ebygum(a){if(!a||is_ie){window.event.cancelBubble=true;return window.event}else{if(a.target.type=="submit"){a.target.form.submit()}a.stopPropagation();return a}}function menuoption_onclick_function(a){this.clickfunc();hideMenu()}function menuoption_onclick_link(a){choose(a,this)}function menuoption_onmouseover(a){this.className="popupmenu_highlight"}function menuoption_onmouseout(a){this.className="popupmenu_option"}function choose(c,b){var a=b.getElementsByTagName("a");if(a[0]){if(is_ie){a[0].click();window.event.cancelBubble=true}else{if(c.shiftKey){window.open(a[0].href);c.stopPropagation();c.preventDefault()}else{window.location=a[0].href;c.stopPropagation();c.preventDefault()}}hideMenu()}};
