var Just={path:"justmenu/",debug_window:false,all_menus:[],menu_events_on:false,preload_imgs:[],AppendPreloadImg:function AppendPreloadImg(B){var A;for(A=0;A<Just.preload_imgs.length;A++){if(Just.preload_imgs[A]==B){return }}Just.preload_imgs[Just.preload_imgs.length]=B},ClientAreaHorizVertScrolls:function ClientAreaHorizVertScrolls(){var B=window.pageXOffset;var A=window.pageYOffset;if(document.documentElement){B=B||document.documentElement.scrollLeft;A=A||document.documentElement.scrollTop}if(document.body){B=B||document.body.scrollLeft;A=A||document.body.scrollTop}if(typeof A!="number"){alert("Call to function Just.ClientAreaHorizVertScrolls() failed!\nUnable to detect!");B=0;A=0}return[B,A]},ClientAreaWxH:function ClientAreaWxH(){var A=window.innerWidth;var B=window.innerHeight;if(document.documentElement){A=A||document.documentElement.clientWidth;B=B||document.documentElement.clientHeight}if(document.body){A=A||document.body.clientWidth;B=B||document.body.clientHeight}if(typeof A!="number"){alert("Call to function Just.ClientAreaWxH() failed!\nUnable to detect!");A=0;B=0}return[A,B]},GetElementXY:function GetElementXY(C){var A=y=0;var B;if(C&&C.offsetParent){A=C.offsetLeft;y=C.offsetTop;while(C.offsetParent){C=C.offsetParent;A+=C.offsetLeft;y+=C.offsetTop;if((C.style.position=="absolute")||(C.style.position=="relative")){if(document.defaultView){A+=parseInt(document.defaultView.getComputedStyle(C,null).getPropertyValue("border-left-width"));y+=parseInt(document.defaultView.getComputedStyle(C,null).getPropertyValue("border-top-width"))}else{if((C.style.position=="absolute")&&(typeof C.clientLeft=="number")){A+=C.clientLeft;y+=C.clientTop}}}}}return[A,y]},GetSubmenuItemXY:function GetSubmenuItemXY(B){var A=y=0;if(B){while(B.tagName!="DIV"){A+=B.offsetLeft;y+=B.offsetTop;B=B.offsetParent}A+=B.offsetLeft;y+=B.offsetTop}return[A,y]},AppendEvent:function AppendEvent(A,C,B){if(A){if(A.attachEvent){A.attachEvent("on"+C,B)}else{if(A.addEventListener){A.addEventListener(C,B,false)}}}},StopEventPropagation:function StopEventPropagation(A){if(window.event){window.event.cancelBubble=true}else{A.stopPropagation()}},Memory:{Node:function Node(){this.name="";this.vertical=false;this.parent=null;this.parent_item_index=0;this.items=[]},isNodeNameInTree:function isNodeNameInTree(B,A){if(A){if(A.name==B){return true}else{for(var C=0;C<A.length;C++){if(typeof A.items[C].show_submenu!="string"){if(Just.Memory.isNodeNameInTree(B,A.items[C].show_submenu)){return true}}}}}return false},AddTreeNode:function AddTreeNode(D,B){var A=0;if(B){for(var C=0;C<B.items.length;C++){if(typeof B.items[C].show_submenu=="string"){if(B.items[C].show_submenu==D.name){D.parent=B;D.parent_item_index=C;B.items[C].show_submenu=D;A+=1}}else{A+=AddTreeNode(D,B.items[C].show_submenu)}}}return A},CheckTree:function CheckTree(C){if(C){for(var B=0;B<C.items.length;B++){if(typeof C.items[B].show_submenu=="string"){if(C.items[B].show_submenu!=""){var A=C.items[B].show_submenu.substr(C.items[B].show_submenu.indexOf("submenu_")+8);alert("SISTEMARE LA CONFIGURAZIONE DEL MENU\n\nIl submenu: '"+C.name.substr(C.name.indexOf("submenu_")+8)+"' ha un item che contiene la dicitura\n\nshow_submenu : '"+A+"'\n\nma non esiste alcun submenu avente name : '"+A+"'.\n\nSe esiste un submenu avente name : '"+A+"' allora controllare che non sia stato aggiunto con la funzione AddSubmenu() prima del submenu avente name : '"+C.name.substr(C.name.indexOf("submenu_")+8)+"'.");return false}}else{if(!Just.Memory.CheckTree(C.items[B].show_submenu)){return false}}}}return true},DumpHashTable:function DumpHashTable(B){var A="null";if(B){A="";for(var C=0;C<B.length;C++){A+=C+") node object = "+B[C].name+"\n"}}return A},DumpTree:function DumpTree(B){var A="null";if(B){A="------------------------------------\n";A+="name='"+B.name+"'\n";A+="vertical="+B.vertical+"\n";A+="parent="+(B.parent?(B.parent.name+" (node object)"):"null")+"\n";A+="parent_item_index="+B.parent_item_index+"\n";A+"items=\n";for(var C=0;C<B.items.length;C++){A+=("ID='"+B.items[C].id+"', ");A+="SHOW_SUBMENU="+((typeof B.items[C].show_submenu=="string")?("'"+B.items[C].show_submenu+"' (string)"):(B.items[C].show_submenu.name+" (node object)"));A+=", STATUS_ON="+B.items[C].status_on;A+=", STYLES={";for(property in B.items[C].styles){A+=(property+"="+((typeof B.items[C].styles[property]=="string")?("'"+B.items[C].styles[property]+"'"):B.items[C].styles[property])+", ")}A+="}";A+="\n"}A+="------------------------------------\n\n\n";for(var C=0;C<B.items.length;C++){if(typeof B.items[C].show_submenu!="string"){A+=Just.Memory.DumpTree(B.items[C].show_submenu)}}}return A}},SubmenuStyle:function SubenuStyle(B){var A=B||Just.DefaultStyle;for(property in A){this[property]=A[property]}},DefaultStyle:{submenu_border_left:"1px solid #FF0000",submenu_border_top:"1px solid #FF0000",submenu_border_right:"1px solid #FF0000",submenu_border_bottom:"1px solid #FF0000",submenu_background:"#CCCCCC",submenu_border_padding:10,submenu_separator_size:1,submenu_separator_color:"#000000",submenu_separator_space:3,submenu_horizontal_separator_width:100,submenu_vertical_separtor_height:8,submenu_separator_align:0,allitems_border_left_width:1,allitems_border_top_width:1,allitems_border_right_width:1,allitems_border_bottom_width:1,off_item_border_left_style:"solid",off_item_border_top_style:"solid",off_item_border_right_style:"solid",off_item_border_bottom_style:"solid",off_item_border_left_color:"#FF0000",off_item_border_top_color:"#FF0000",off_item_border_right_color:"#FF0000",off_item_border_bottom_color:"#FF0000",off_item_background_color:"#999999",off_item_background_image:"none",item_background_repeat:"no-repeat",allitems_text_font:"Tahoma, Arial",allitems_text_size:11,off_item_text_underline:"none",item_text_bold:"normal",off_item_text_color:"#000000",item_text_indent:25,allitems_text_padding:10,off_item_arrow:"url(arrow1off.gif)",allitems_arrow_area_width:23,off_item_icon:"url(icon1off.gif)",item_icon_left_top:"2px 50%",on_item_border_left_style:"solid",on_item_border_top_style:"solid",on_item_border_right_style:"solid",on_item_border_bottom_style:"solid",on_item_border_left_color:"#00FF00",on_item_border_top_color:"#00FF00",on_item_border_right_color:"#00FF00",on_item_border_bottom_color:"#00FF00",on_item_background_color:"#0000FF",on_item_background_image:"none",on_item_text_color:"#FFFFFF",on_item_text_underline:"underline",on_item_arrow:"url(menuarrow-anim.gif)",on_item_icon:"url(icon1on.gif)"},GetCssImg:function GetCssImg(B){var A="none";if(typeof B=="string"){B=B.replace(/^[\s]+|[\s]+$/g,"");if(B&&(B!="none")){A="url("+B.replace(/url\(|\)/gi,"")+")"}}return A},DocumentMouseOver:function DocumentMouseOver(){var B,A;for(A=0;A<Just.all_menus.length;A++){B=Just.all_menus[A];if(B.last_activated_node_item){if(B.timer_beta){window.clearTimeout(B.timer_beta)}if(!(B.last_activated_node_item.show_submenu&&(document.getElementById(B.last_activated_node_item.show_submenu.name).style.visibility=="visible"))){B.ToggleItemStyles(B.last_activated_node_item,false)}B.last_activated_node_item=null}}},MouseMovedOutOfBrowser:function MouseMovedOutOfBrowser(B){var A=B||window.event;if(!(A.relatedTarget||A.toElement)){Just.DocumentMouseOver()}},DocumentMouseClick:function DocumentMouseClick(){for(var A=0;A<Just.all_menus.length;A++){Just.all_menus[A].Reset()}},TimerAlpha:function TimerAlpha(){alert("Timer works!")},TimerBeta:function TimerBeta(A,E,D){var F=Just.all_menus[A];var C=F.itemid2node_hashtable[D];for(var B=0;B<C.items.length;B++){if(C.items[B].show_submenu){if(C.items[B].id!=E){if(C.items[B].show_submenu&&(document.getElementById(C.items[B].show_submenu.name).style.visibility=="visible")){F.ToggleItemStyles(C.items[B],false)}F.HideSubmenus(C.items[B].show_submenu)}else{F.ShowSubmenu(C.items[B].show_submenu)}}}},Menu:function Menu(Z,T,M,A,V,R){var W=Just.all_menus.length;var Z=((typeof Z=="string")?Z.toLowerCase().replace(/[^a-z0-9_]/g,"_"):"noname");this.itemid2node_hashtable=[];this.menu_tree=null;var a=!T;var Q=false;var I=A||5;var Y=V||0;var C=!R;var F="";this.timer_alpha=null;this.timer_beta=null;var N=250;if(typeof M=="number"){N=M}this.last_activated_node_item=null;var P=false;var S=false;this.AddSubmenu=function U(g){if(!P){var j="menu"+W+"_";if(typeof g.name!="string"){alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nUn submenu è privo dell'attributo 'name', oppure name non è una stringa.");P=true;return }if(!g.style){alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nIl submenu: '"+g.name+"' è privo dell'attributo 'style'.");P=true;return }if(!g.items||!g.items.length||g.items.length==0){alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nIl submenu: '"+g.name+"' è privo di items.\nNon ha senso aggiungere un submenu privo di items.");P=true;return }var f=new Just.Memory.Node();f.name=j+"submenu_"+g.name.toLowerCase().replace(/[^a-z0-9_]/g,"_");if(Just.Memory.isNodeNameInTree(f.name,this.menu_tree)){alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nE' già stato dichiarato il submenu: '"+g.name+"'.\nNon si possono aggiungere più submenu aventi il medesimo name.\n\nNOTA: i name dei submenu non sono case sensitive, quindi 2 name che si differenziano solo per l'uso dell maiusole/minuscole sono considerati identici.");P=true;return }f.vertical=g.vertical;for(var e=0;e<g.items.length;e++){if(!g.items[e]){alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nIl submenu: '"+g.name+"' contiene un item nullo.\nProbabilmente è stata aggiunta una virgola di troppo dopo la parentesi graffa '}' dell'ultimo item.");P=true;return }var d=this.itemid2node_hashtable.length;this.itemid2node_hashtable[d]=f;f.items[e]={id:j+d,status_on:false,styles:null,show_submenu:""};f.items[e].styles={};var h;for(property in Just.DefaultStyle){if(property.indexOf("on_")==0){h="off_"+property.substr(3);f.items[e].styles[property]=(typeof g.items[e][property]!="undefined")?g.items[e][property]:g.style[property];f.items[e].styles[h]=(typeof g.items[e][h]!="undefined")?g.items[e][h]:g.style[h]}}if(g.style.allitems_text_size==0){f.items[e].styles.off_item_text_underline=f.items[e].styles.on_item_text_underline="none"}if(g.items[e].show_submenu){f.items[e].show_submenu=j+"submenu_"+g.items[e].show_submenu.toLowerCase().replace(/[^a-z0-9_]/g,"_")}else{f.items[e].styles.on_item_arrow=f.items[e].styles.off_item_arrow="none"}f.items[e].styles.off_item_background_image=Just.GetCssImg(f.items[e].styles.off_item_background_image);f.items[e].styles.off_item_arrow=Just.GetCssImg(f.items[e].styles.off_item_arrow);f.items[e].styles.off_item_icon=Just.GetCssImg(f.items[e].styles.off_item_icon);f.items[e].styles.on_item_background_image=Just.GetCssImg(f.items[e].styles.on_item_background_image);f.items[e].styles.on_item_arrow=Just.GetCssImg(f.items[e].styles.on_item_arrow);f.items[e].styles.on_item_icon=Just.GetCssImg(f.items[e].styles.on_item_icon);if(f.items[e].styles.on_item_icon.indexOf("url(")==0){Just.AppendPreloadImg(f.items[e].styles.on_item_icon.substr(4).replace(")",""))}if(f.items[e].styles.on_item_arrow.indexOf("url(")==0){Just.AppendPreloadImg(f.items[e].styles.on_item_arrow.substr(4).replace(")",""))}if(f.items[e].styles.on_item_background_image.indexOf("url(")==0){Just.AppendPreloadImg(f.items[e].styles.on_item_background_image.substr(4).replace(")",""))}}if(!this.menu_tree){this.menu_tree=f}else{switch(Just.Memory.AddTreeNode(f,this.menu_tree)){case 0:alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nNon è possibile aggiungere il submenu: '"+g.name+"', perchè non è stato prima dichiarato un submenu contenente un item con la dicitura:\n\nshow_submenu : '"+g.name+"'");P=true;return ;case 1:break;default:alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nNon è possibile aggiungere il submenu: '"+g.name+"', perchè sono stati dichiarati più item con la dicitura:\n\nshow_submenu : '"+g.name+"'\n\nNon è ammesso che un submenu abbia più di un item che lo attiva.");P=true;return }}F+=L(g,f)}};function L(x,o){var l=x.style;var g="<div id='"+o.name+"' style='position: absolute; left: 0px; top: 0px; visibility: hidden; border-left: "+l.submenu_border_left+"; border-top: "+l.submenu_border_top+"; border-right: "+l.submenu_border_right+"; border-bottom: "+l.submenu_border_bottom+"; background: "+l.submenu_background+"; padding: "+l.submenu_border_padding+"px;' onmouseover='Just.StopEventPropagation(event);' onclick='Just.StopEventPropagation(event);' onmouseout='Just.MouseMovedOutOfBrowser(event);'>\n";Q=true;g+="<div>\n";g+="<table cellspacing='0' cellpadding='0'>\n\n";for(var t=0,h=o.items.length;t<h;t++){var v=((typeof x.items[t].item_width=="number")?(x.items[t].item_width+"px"):"100%");var k=((typeof x.items[t].item_height=="number")?(x.items[t].item_height+"px"):"100%");var r=((typeof x.items[t].item_background_repeat!="undefined")?x.items[t].item_background_repeat:l.item_background_repeat);var z=((typeof x.items[t].item_text_bold!="undefined")?x.items[t].item_text_bold:l.item_text_bold);var s=((typeof x.items[t].item_text_indent!="undefined")?x.items[t].item_text_indent:l.item_text_indent);var p=((typeof x.items[t].item_icon_left_top!="undefined")?x.items[t].item_icon_left_top:l.item_icon_left_top);var w=x.items[t].text;var q=x.items[t].link;if(typeof x.items[t].fill_from_html=="string"){var m=document.getElementById(x.items[t].fill_from_html);if(m&&(m.tagName=="A")){if(!x.items[t].no_text){w=m.innerHTML}q=m.getAttribute("href",2);m.style.display="none"}else{alert("SISTEMARE LA CONFIGURAZIONE DEL MENU "+Z+"\n\nIl submenu '"+x.name+"' ha un item che dichiara fill_from_html:'"+x.items[t].fill_from_html+"', ma nel codice html della pagina non è stato trovato alcun tag <A> avente id='"+x.items[t].fill_from_html+"'.\nSe il tag <A> esiste, controllare che sia stato dichiarato prima di: <script type='text/javascript' src='menu-config.js'><\/script>.");P=true;return }}if(l.allitems_text_size==0){w=""}if((typeof q=="string")&&q){if(q.indexOf("javascript:")==0){q=q.substr(11)+";"}else{q="document.location.href = '"+q+"';"}if(C){q="Just.all_menus["+W+"].Reset(); "+q}}else{q=""}var n="width: "+v+";";n+=" height: "+k+";";var f="";f+=" border-left-width: "+l.allitems_border_left_width+"px; border-left-style: "+o.items[t].styles.off_item_border_left_style+"; border-left-color: "+o.items[t].styles.off_item_border_left_color+";";f+=" border-top-width: "+l.allitems_border_top_width+"px; border-top-style: "+o.items[t].styles.off_item_border_top_style+"; border-top-color: "+o.items[t].styles.off_item_border_top_color+";";f+=" border-right-width: "+l.allitems_border_right_width+"px; border-right-style: "+o.items[t].styles.off_item_border_right_style+"; border-right-color: "+o.items[t].styles.off_item_border_right_color+";";f+=" border-bottom-width: "+l.allitems_border_bottom_width+"px; border-bottom-style: "+o.items[t].styles.off_item_border_bottom_style+"; border-bottom-color: "+o.items[t].styles.off_item_border_bottom_color+";";var j="background-color: "+o.items[t].styles.off_item_background_color+";";j+=" background-image: "+o.items[t].styles.off_item_background_image+";";j+=" background-repeat: "+r+";";var u="width: 100%; vertical-align: middle; text-align: left; border-width: 0px; padding-left: "+s+"px; padding-top: "+l.allitems_text_padding+"px; padding-bottom: "+l.allitems_text_padding+"px; background-repeat: no-repeat; background-position: "+p+"; background-image: "+o.items[t].styles.off_item_icon+";";var e="border-width: 0px; font-size: "+l.allitems_text_size+"px; ";if(l.allitems_text_size>0){e+=" font-family: "+l.allitems_text_font+"; text-align: left; font-weight: "+z+";"}else{e+=" font-weight: normal;"}e+=" text-decoration: "+o.items[t].styles.off_item_text_underline+"; color: "+o.items[t].styles.off_item_text_color+";";item_arrow_css="width: 100%; border-width: 0px; padding: 0px;";if(o.items[t].styles.off_item_arrow!="none"){item_arrow_css+=" background-repeat: no-repeat; background-position: 50% 50%;"}item_arrow_css+=" background-image: "+o.items[t].styles.off_item_arrow+";";var d=(q?"cursor: pointer; cursor: hand;":"cursor: default;");g+=(((t==0)||o.vertical)?"<tr><td>":"<td>")+"\n";g+='<table id="'+o.items[t].id+'" cellspacing="0" cellpadding="0" style="'+n+" "+j+" "+f+" "+d+'" onmouseover="Just.all_menus['+W+'].ItemMouseOver(this.id);"';if(q){g+=' onclick="'+q+'"'}g+=">\n";g+="<tr>";g+="<td nowrap='nowrap' style='"+u+"'>";g+="<div style='"+e+"'>"+(w?w:"&nbsp;")+"</div>";g+="</td>";g+="<td style='"+item_arrow_css+"'><div style='width: "+l.allitems_arrow_area_width+"px; font-size: 0px; border-width: 0px;'></div></td>";g+="</tr>\n";g+="</table>\n";g+=(((t==(h-1))||o.vertical)?"</td></tr>":"</td>")+"\n\n"}g+="</table>\n</div>\n</div>\n\n\n\n\n";return g}this.Create=function c(){if(!S){if(Just.debug_window){var d="**********************************************************************************************************";d+="\n\nITEM ID 2 NODE HASHTABLE\n\n"+Just.Memory.DumpHashTable(this.itemid2node_hashtable);d+="\n\n\n\nMENU TREE\n\n"+Just.Memory.DumpTree(this.menu_tree);Just.debug_window.document.getElementById("debug_text").value+=d}if(P||!Just.Memory.CheckTree(this.menu_tree)){alert("Impossibile creare il menu!")}else{var g="<div id='menu"+W+"_debugname_"+Z+"' style='position: absolute; left: 0px; top: 0px;'>\n\n";var f="</div>\n\n";F=g+F+f;for(var e=0;e<Just.preload_imgs.length;e++){F+="<img style='display: none; position: absolute; top: 0px; left: 0px;' src='"+Just.preload_imgs[e]+"'>\n"}document.write(F);S=true;Just.all_menus[W]=this;if(!Just.menu_events_on){Just.AppendEvent(window.document,"mouseover",Just.DocumentMouseOver);Just.AppendEvent(window.document,"click",Just.DocumentMouseClick);Just.menu_events_on=true}}if(Just.debug_window){Just.debug_window.document.getElementById("debug_text").value+="\n\n\n\nMENU_HTML\n\n"+F+"\n\n\n\n\n\n\n\n\n\n\n\n\n\n"}}};this.ShowAt=function G(d,f){var e=document.getElementById("menu"+W+"_debugname_"+Z);e.style.left=(d||0)+"px";e.style.top=(f||0)+"px";this.ShowSubmenu(null,0,0)};this.Show=function D(e){var d=e||window.event;this.ShowSubmenu(null,d.clientX,d.clientY)};this.ItemMouseOver=function H(g){if(this.timer_alpha){window.clearTimeout(this.timer_alpha)}var f=g.substr(g.indexOf("_")+1);var e=this.itemid2node_hashtable[f];for(var d=0;d<e.items.length;d++){if(e.items[d].show_submenu&&(document.getElementById(e.items[d].show_submenu.name).style.visibility=="visible")){this.DeactivateChildrenItems(e.items[d].show_submenu)}if(e.items[d].id!=g){if(!(e.items[d].show_submenu&&(document.getElementById(e.items[d].show_submenu.name).style.visibility=="visible"))){this.ToggleItemStyles(e.items[d],false)}}else{if(this.last_activated_node_item!=e.items[d]){this.last_activated_node_item=e.items[d];if(this.timer_beta){window.clearTimeout(this.timer_beta)}this.ToggleItemStyles(e.items[d],true);this.ActivateParentItem(e);if(!(e.items[d].show_submenu&&(document.getElementById(e.items[d].show_submenu.name).style.visibility=="visible"))){if(N>60){this.timer_beta=window.setTimeout("Just.TimerBeta("+W+", '"+g+"', "+f+")",N)}else{Just.TimerBeta(W,g,f)}}}}}};this.DeactivateChildrenItems=function K(e){for(var d=0;d<e.items.length;d++){if(e.items[d].show_submenu&&(document.getElementById(e.items[d].show_submenu.name).style.visibility=="visible")){this.DeactivateChildrenItems(e.items[d].show_submenu)}else{this.ToggleItemStyles(e.items[d],false)}}};this.ActivateParentItem=function X(f){var e=f.parent;if(e){for(var d=0;d<e.items.length;d++){if(d!=f.parent_item_index){this.ToggleItemStyles(e.items[d],false)}else{this.ToggleItemStyles(e.items[d],true)}}this.ActivateParentItem(e)}};this.ToggleItemStyles=function b(h,e){if(h.status_on!=e){var g=document.getElementById(h.id);var d=e?"on_":"off_";g.style.borderLeftStyle=h.styles[d+"item_border_left_style"];g.style.borderTopStyle=h.styles[d+"item_border_top_style"];g.style.borderRightStyle=h.styles[d+"item_border_right_style"];g.style.borderBottomStyle=h.styles[d+"item_border_bottom_style"];g.style.borderLeftColor=h.styles[d+"item_border_left_color"];g.style.borderTopColor=h.styles[d+"item_border_top_color"];g.style.borderRightColor=h.styles[d+"item_border_right_color"];g.style.borderBottomColor=h.styles[d+"item_border_bottom_color"];g.style.backgroundColor=h.styles[d+"item_background_color"];g.style.backgroundImage=h.styles[d+"item_background_image"];var j=g.getElementsByTagName("TD");var i=j[0];var f=j[1];var k=(i.getElementsByTagName("DIV"))[0];k.style.color=h.styles[d+"item_text_color"];k.style.textDecoration=h.styles[d+"item_text_underline"];i.style.backgroundImage=h.styles[d+"item_icon"];f.style.backgroundImage=h.styles[d+"item_arrow"];h.status_on=e}};this.ShowSubmenu=function B(f){var g=[0,0];if(f){g=this.CalculateNewSubmenuPosition(f.parent,f.parent_item_index)}else{f=this.menu_tree}for(var d=0;d<f.items.length;d++){this.ToggleItemStyles(f.items[d],false)}var e=document.getElementById(f.name);e.style.left=g[0]+"px";e.style.top=g[1]+"px";e.style.visibility="visible"};this.CalculateNewSubmenuPosition=function J(t,j){var u=t.items[j];var r=document.getElementById(u.id);var m=Just.GetSubmenuItemXY(r);var l=m[0];var k=m[1];var n=r.offsetHeight;var AC=r.offsetWidth;var p=0;var o=0;var e=document.getElementById(u.show_submenu.name);var w=Just.GetElementXY(document.getElementById(t.name));var x=w[0];var v=w[1];var i=e.offsetWidth;var AB=e.offsetHeight;var s=Just.ClientAreaWxH();var g=Just.ClientAreaHorizVertScrolls();var d=s[0];var q=s[1];var h=g[0];var f=g[1];if(!t.vertical){p=l;o=k+n-Y}else{p=l+AC-I;o=k}if(!t.vertical){if((o+v-f+AB)>q){var z=o;o=k-AB+Y;if((o+v-f)<0){o=z}}if((p+x-h+i)>d){var AA=p;p=(d+h-i)-x;if(p+x<0){p=AA}}}else{if((o+v-f+AB)>q){var z=o;o=(q+f-AB)-v;if(o+v<0){o=z}}if((p+x-h+i)>d){var AA=p;p=l-i+I;if((p+x-h)<0){p=AA}}}return[p,o]};this.HideSubmenus=function O(f){var e=document.getElementById(f.name);if(e.style.visibility!="hidden"){e.style.visibility="hidden";for(var d=0;d<f.items.length;d++){if(f.items[d].show_submenu){this.HideSubmenus(f.items[d].show_submenu)}}}};this.Reset=function E(){if(this.timer_beta){window.clearTimeout(this.timer_beta)}this.last_activated_node_item=null;if(a){for(var d=0;d<this.menu_tree.items.length;d++){this.ToggleItemStyles(this.menu_tree.items[d],false);if(this.menu_tree.items[d].show_submenu){this.HideSubmenus(this.menu_tree.items[d].show_submenu)}}}else{this.HideSubmenus(this.menu_tree)}}}};if(Just.debug_window){Just.debug_window=window.open(Just.path+"justmenu-debug.html","justmenudebug");alert("MENU DEBUG ACTIVE\n\nPlease wait for debug window to load, then press OK...")}document.write("<style type='text/css'>div.justmenuconfig {display:none;}</style>");