var A_MENUS=[];function menu(b,c){if(!document.body||!document.body.style)return;this.a_config=b;this.a_tpl=c;this.n_id=A_MENUS.length;this.a_index=[];this.a_children=[];this.expand=menu_expand;this.collapse=menu_collapse;this.onclick=menu_onclick;this.onmouseout=menu_onmouseout;this.onmouseover=menu_onmouseover;this.onmousedown=menu_onmousedown;this.a_tpl_def={block_top:16,block_left:16,top:20,left:4,width:140,height:22,hide_delay:0,expd_delay:0,css:{inner:"",outer:""}};this.getprop=function(a){return this.a_tpl_def[a]};this.o_root=this;this.n_depth=-1;this.n_x=0;this.n_y=0;for(a=0;a<b.length;a++)new menu_item(this,a);A_MENUS[this.n_id]=this;for(var a=0;a<this.a_children.length;a++)this.a_children[a].e_oelement.style.visibility="visible"}function menu_collapse(a){clearTimeout(this.o_showtimer);var c=a?this.a_index[a].n_depth:0;for(a=0;a<this.a_index.length;a++){var b=this.a_index[a];if(b.n_depth>c&&b.b_visible){b.e_oelement.style.visibility="hidden";b.b_visible=false}}if(!a)this.o_current=null}function menu_expand(d){if(this.o_hidetimer)return;var a=this.a_index[d];this.o_current&&this.o_current.n_depth>=a.n_depth&&this.collapse(a.n_id);this.o_current=a;if(!a.a_children)return;for(var b=0;b<a.a_children.length;b++){var c=a.a_children[b];c.e_oelement.style.visibility="visible";c.b_visible=true}}function menu_onclick(a){return Boolean(this.a_index[a].a_config[1])}function menu_onmouseout(b){var a=this.a_index[b];a.e_oelement.className=a.getstyle(0,0);a.e_ielement.className=a.getstyle(1,0);a.upstatus(7);this.o_hidetimer=setTimeout("A_MENUS["+this.n_id+"].collapse();",a.getprop("hide_delay"))}function menu_onmouseover(b){clearTimeout(this.o_hidetimer);this.o_hidetimer=null;clearTimeout(this.o_showtimer);var a=this.a_index[b];a.upstatus();a.e_oelement.className=a.getstyle(0,1);a.e_ielement.className=a.getstyle(1,1);if(a.getprop("expd_delay")<0)return;this.o_showtimer=setTimeout("A_MENUS["+this.n_id+"].expand("+b+");",a.getprop("expd_delay"))}function menu_onmousedown(b){var a=this.a_index[b];a.e_oelement.className=a.getstyle(0,2);a.e_ielement.className=a.getstyle(1,2);this.expand(b)}function menu_item(b,a){this.n_depth=b.n_depth+1;this.a_config=b.a_config[a+(this.n_depth?3:0)];if(!this.a_config)return;this.o_root=b.o_root;this.o_parent=b;this.n_order=a;this.n_id=this.o_root.a_index.length;this.o_root.a_index[this.n_id]=this;b.a_children[a]=this;var c=this.o_root,d=this.o_root.a_tpl;this.getprop=mitem_getprop;this.getstyle=mitem_getstyle;this.upstatus=mitem_upstatus;this.n_x=a?b.a_children[a-1].n_x+this.getprop("left"):b.n_x+this.getprop("block_left");this.n_y=a?b.a_children[a-1].n_y+this.getprop("top"):b.n_y+this.getprop("block_top");document.write('<a id="e'+c.n_id+"_"+this.n_id+'o" class="'+this.getstyle(0,0)+'" href="'+this.a_config[1]+'"'+(this.a_config[2]&&this.a_config[2].tw?' target="'+this.a_config[2].tw+'"':"")+' style="position: absolute; top: '+this.n_y+"px; left: "+this.n_x+"px; width: "+this.getprop("width")+"px; height: "+this.getprop("height")+"px; visibility: hidden;z-index:"+(this.n_depth+this.getprop("z-order"))+';"onclick="return A_MENUS['+c.n_id+"].onclick("+this.n_id+');" onmouseout="A_MENUS['+c.n_id+"].onmouseout("+this.n_id+');" onmouseover="A_MENUS['+c.n_id+"].onmouseover("+this.n_id+');" onmousedown="A_MENUS['+c.n_id+"].onmousedown("+this.n_id+');"><div  id="e'+c.n_id+"_"+this.n_id+'i" class="'+this.getstyle(1,0)+'">'+this.a_config[0]+"</div></a>\n");this.e_ielement=document.getElementById("e"+c.n_id+"_"+this.n_id+"i");this.e_oelement=document.getElementById("e"+c.n_id+"_"+this.n_id+"o");this.b_visible=!this.n_depth;if(this.a_config.length<4)return;this.a_children=[];for(var a=0;a<this.a_config.length-3;a++)new menu_item(this,a)}function mitem_getprop(c){var a=null,b=this.o_root.a_tpl[this.n_depth];if(b)a=b[c];return a==null?this.o_parent.getprop(c):a}function mitem_getstyle(e,c){var d=this.getprop("css"),a=d[e?"inner":"outer"];if(typeof a=="string")return a;for(var b=c;b>=0;b--)if(a[b])return a[b]}function mitem_upstatus(a){window.setTimeout("window.status=unescape('"+(a?"":this.a_config[2]&&this.a_config[2].sb?escape(this.a_config[2].sb):escape(this.a_config[0])+(this.a_config[1]?" ("+escape(this.a_config[1])+")":""))+"')",10)};
