﻿function Menu(b,i,h,e,g,c,a,f,d){this.version="990702 [Menu; menu.js]";this.type="Menu";this.menuWidth=i;this.menuItemHeight=h;this.fontSize=g||12;this.fontWeight="plain";this.fontFamily=e||"arial,helvetica,verdana,sans-serif";this.fontColor=c||"#000000";this.fontColorHilite=a||"#ffffff";this.bgColor="#ffffff";this.menuBorder=0;this.menuItemBorder=1;this.menuItemBgColor=f||"#cccccc";this.menuLiteBgColor="#ffffff";this.menuBorderBgColor="#ffffff";this.menuHiliteBgColor=d||"#000084";this.menuContainerBgColor="#cccccc";this.childMenuIcon="arrows.gif";this.items=[];this.actions=[];this.childMenus=[];this.hideOnMouseOut=true;this.addMenuItem=addMenuItem;this.addMenuSeparator=addMenuSeparator;this.writeMenus=writeMenus;this.FW_showMenu=FW_showMenu;this.onMenuItemOver=onMenuItemOver;this.onMenuItemAction=onMenuItemAction;this.hideMenu=hideMenu;this.hideChildMenu=hideChildMenu;if(!window.menus)window.menus=[];this.label=b||"menuLabel"+window.menus.length;window.menus[this.label]=this;window.menus[window.menus.length]=this;if(!window.activeMenus)window.activeMenus=[]}function addMenuItem(b,a){this.items[this.items.length]=b;this.actions[this.actions.length]=a}function addMenuSeparator(){this.items[this.items.length]="separator";this.actions[this.actions.length]="";this.menuItemBorder=0}function FIND(a){if(document.all)return document.all[a];if(document.getElementById)return document.getElementById(a);return false}function writeMenus(c){if(window.triedToWriteMenus)return;if(!c&&document.layers){window.delayWriteMenus=this.writeMenus;var E=setTimeout("delayWriteMenus()",250);c=new Layer(100);clearTimeout(E)}else if(document.all||document.hasChildNodes){document.writeln('<SPAN ID="menuContainer"></SPAN>');c=FIND("menuContainer")}window.fwHideMenuTimer=null;if(!c)return;window.triedToWriteMenus=true;c.isContainer=true;c.menus=[];for(var d=0;d<window.menus.length;d++)c.menus[d]=window.menus[d];window.menus.length=0;var u=0,j=0,t=0,h="",s=false,y="",z=0;if(document.layers)s=true;for(var d=0;d<c.menus.length;d++,u++){var a=c.menus[d];if(a.bgImageUp){a.menuBorder=0;a.menuItemBorder=0}if(s){var n=new Layer(100,c),o=new Layer(100,n);o.top=a.menuBorder;o.left=a.menuBorder;var e=new Layer(100,o);e.top=a.menuBorder;e.left=a.menuBorder}else h+='<DIV ID="menuLayer'+u+'" STYLE="position:absolute;z-index:1;left:10;top:'+d*100+';visibility:hidden;">\n'+'  <DIV ID="menuLite'+u+'" STYLE="position:absolute;z-index:1;left:'+a.menuBorder+";top:"+a.menuBorder+';visibility:hide;" onMouseOut="mouseoutMenu();">\n'+'\t <DIV ID="menuFg'+u+'" STYLE="position:absolute;left:'+a.menuBorder+";top:"+a.menuBorder+';visibility:hide;">\n'+"";var g=d;for(var d=0;d<a.items.length;d++){var r=a.items[d],A=false,C=a.fontSize+6,D=a.fontSize;if(r.label){r=r.label;A=true}a.menuItemHeight=a.menuItemHeight||C;a.menuItemIndent=a.menuItemIndent||D;var m="font-family:"+a.fontFamily+";font-weight:"+a.fontWeight+";fontSize:"+a.fontSize+";";if(a.fontStyle)m+="font-style:"+a.fontStyle+";";if(document.all)m+="font-size:"+a.fontSize+';" onMouseOver="onMenuItemOver(null,this);" onClick="onMenuItemAction(null,this);';else if(!document.layers)m+="font-size:"+a.fontSize+"px;";var b;if(s)b=new Layer(800,e);var q='<DIV ID="menuItem'+j+'" STYLE="position:absolute;left:0;top:'+d*a.menuItemHeight+";"+m+'">',w="</DIV>";if(a.bgImageUp){a.menuBorder=0;a.menuItemBorder=0;q='<DIV ID="menuItem'+j+'" STYLE="background:url('+a.bgImageUp+");position:absolute;left:0;top:"+d*a.menuItemHeight+";"+m+'">';if(document.layers){q='<LAYER BACKGROUND="'+a.bgImageUp+'" ID="menuItem'+j+'" TOP="'+d*a.menuItemHeight+'" style="'+m+'">';w="</LAYER>"}}var x="position:absolute;left:"+a.menuItemIndent+";top:1;";if(s){x+=m;q="";w=""}var B='<DIV ID="menuItemText'+j+'" STYLE="'+x+"color:"+a.fontColor+';">'+r+'&nbsp</DIV>\n<DIV ID="menuItemHilite'+j+'" STYLE="'+x+"top:1;color:"+a.fontColorHilite+';visibility:hidden;">'+r+"&nbsp</DIV>";if(r=="separator")h+=q+'<DIV ID="menuSeparator'+j+'" STYLE="position:absolute;left:1;top:2;"></DIV>\n<DIV ID="menuSeparatorLite'+j+'" STYLE="position:absolute;left:1;top:2;"></DIV>\n'+w;else if(A)h+=q+B+'<DIV ID="childMenu'+j+'" STYLE="position:absolute;left:0;top:3;"><IMG SRC="'+a.childMenuIcon+'"></DIV>\n'+w;else h+=q+B+w;if(s){b.document.open("text/html");b.document.writeln(h);b.document.close();h="";y+="-";z++;if(z>50){z=0;y=""}status=y}j++}if(s){var k=new Layer(100,e);k.visiblity="hidden";k.document.open("text/html");k.document.writeln("&nbsp;");k.document.close()}else{h+='\t  <DIV ID="focusItem'+u+'" STYLE="position:absolute;left:0;top:0;visibility:hide;" onClick="onMenuItemAction(null,this);">&nbsp;</DIV>\n';h+="   </DIV>\n  </DIV>\n</DIV>\n"}d=g}if(document.layers){c.clip.width=window.innerWidth;c.clip.height=window.innerHeight;c.onmouseout=mouseoutMenu;c.menuContainerBgColor=this.menuContainerBgColor;for(var d=0;d<c.document.layers.length;d++){proto=c.menus[d];var a=c.document.layers[d];c.menus[d].menuLayer=a;c.menus[d].menuLayer.Menu=c.menus[d];c.menus[d].menuLayer.Menu.container=c;var e=a.document.layers[0].document.layers[0];e.clip.width=proto.menuWidth||e.clip.width;e.clip.height=proto.menuHeight||e.clip.height;for(var l=0;l<e.document.layers.length-1;l++){var b=e.document.layers[l];b.Menu=c.menus[d];b.menuHiliteBgColor=proto.menuHiliteBgColor;b.document.bgColor=proto.menuItemBgColor;b.saveColor=proto.menuItemBgColor;b.onmouseover=proto.onMenuItemOver;b.onclick=proto.onMenuItemAction;b.action=c.menus[d].actions[l];b.focusItem=e.document.layers[e.document.layers.length-1];b.clip.width=proto.menuWidth||e.clip.width+proto.menuItemIndent;b.clip.height=proto.menuItemHeight||b.clip.height;if(l>0)b.top=e.document.layers[l-1].top+e.document.layers[l-1].clip.height+proto.menuItemBorder;b.hilite=b.document.layers[1];if(proto.bgImageUp)b.background.src=proto.bgImageUp;b.document.layers[1].isHilite=true;if(b.document.layers[0].id.indexOf("menuSeparator")!=-1){b.hilite=null;b.clip.height-=b.clip.height/2;b.document.layers[0].document.bgColor=proto.bgColor;b.document.layers[0].clip.width=b.clip.width-2;b.document.layers[0].clip.height=1;b.document.layers[1].document.bgColor=proto.menuLiteBgColor;b.document.layers[1].clip.width=b.clip.width-2;b.document.layers[1].clip.height=1;b.document.layers[1].top=b.document.layers[0].top+1}else if(b.document.layers.length>2){b.childMenu=c.menus[d].items[l].menuLayer;b.document.layers[2].left=b.clip.width-13;b.document.layers[2].top=b.clip.height/2-4;b.document.layers[2].clip.left+=3;b.Menu.childMenus[b.Menu.childMenus.length]=b.childMenu}}e.document.bgColor=proto.bgColor;e.clip.width=b.clip.width+proto.menuBorder;e.clip.height=b.top+b.clip.height+proto.menuBorder;var k=e.document.layers[l];k.clip.width=e.clip.width;k.Menu=b.Menu;k.top=-30;k.captureEvents(Event.MOUSEDOWN);k.onmousedown=onMenuItemDown;a.document.bgColor=proto.menuBorderBgColor;var o=a.document.layers[0];o.document.bgColor=proto.menuLiteBgColor;o.clip.width=e.clip.width+1;o.clip.height=e.clip.height+1;a.clip.width=e.clip.width+proto.menuBorder*3;a.clip.height=e.clip.height+proto.menuBorder*3}}else{if(!document.all&&c.hasChildNodes)c.innerHTML=h;else{c.document.open("text/html");c.document.writeln(h);c.document.close()}if(!FIND("menuLayer0"))return;var p=0;for(var g=0;g<c.menus.length;g++){var n=FIND("menuLayer"+g);c.menus[g].menuLayer="menuLayer"+g;n.Menu=c.menus[g];n.Menu.container="menuLayer"+g;n.style.zIndex=1;var f=n.style;f.top=f.pixelTop=-300;f.left=f.pixelLeft=-300;var a=c.menus[g];a.menuItemWidth=a.menuWidth||a.menuIEWidth||140;n.style.backgroundColor=a.menuBorderBgColor;var t=0;for(var d=0;d<c.menus[g].items.length;d++){var b=FIND("menuItem"+p);b.Menu=c.menus[g];if(b.addEventListener){b.style.width=a.menuItemWidth;b.style.height=a.menuItemHeight;b.style.top=t;b.addEventListener("mouseover",onMenuItemOver,false);b.addEventListener("click",onMenuItemAction,false);b.addEventListener("mouseout",mouseoutMenu,false)}else{b.style.pixelWidth=a.menuItemWidth;b.style.pixelHeight=a.menuItemHeight;b.style.pixelTop=t}t=t+a.menuItemHeight+a.menuItemBorder;b.style.fontSize=a.fontSize;b.style.backgroundColor=a.menuItemBgColor;b.style.visibility="inherit";b.saveColor=a.menuItemBgColor;b.menuHiliteBgColor=a.menuHiliteBgColor;b.action=c.menus[g].actions[d];b.hilite=FIND("menuItemHilite"+p);b.focusItem=FIND("focusItem"+g);b.focusItem.style.pixelTop=b.focusItem.style.top=-30;var v=FIND("childMenu"+p);if(v){b.childMenu=c.menus[g].items[d].menuLayer;v.style.pixelLeft=v.style.left=a.menuItemWidth-11;v.style.pixelTop=v.style.top=a.menuItemHeight/2-4;b.Menu.childMenus[b.Menu.childMenus.length]=b.childMenu}var i=FIND("menuSeparator"+p);if(i){i.style.clip="rect(0 "+(a.menuItemWidth-3)+" 1 0)";i.style.width=i.style.pixelWidth=a.menuItemWidth;i.style.backgroundColor=a.bgColor;i=FIND("menuSeparatorLite"+p);i.style.clip="rect(1 "+(a.menuItemWidth-3)+" 2 0)";i.style.width=i.style.pixelWidth=a.menuItemWidth;i.style.backgroundColor=a.menuLiteBgColor;b.style.height=b.style.pixelHeight=a.menuItemHeight/2;b.isSeparator=true;t-=a.menuItemHeight-b.style.pixelHeight}else b.style.cursor="hand";p++}a.menuHeight=t-1;var o=FIND("menuLite"+g),f=o.style;f.height=f.pixelHeight=a.menuHeight+a.menuBorder*2;f.width=f.pixelWidth=a.menuItemWidth+a.menuBorder*2;f.backgroundColor=a.menuLiteBgColor;var e=FIND("menuFg"+g);f=e.style;f.height=f.pixelHeight=a.menuHeight+a.menuBorder;f.width=f.pixelWidth=a.menuItemWidth+a.menuBorder;f.backgroundColor=a.bgColor;f=n.style;f.width=f.pixelWidth=a.menuItemWidth+a.menuBorder*4;f.height=f.pixelHeight=a.menuHeight+a.menuBorder*4}}if(document.captureEvents)document.captureEvents(Event.MOUSEUP);if(document.addEventListener)document.addEventListener("mouseup",onMenuItemOver,false);if(document.layers&&window.innerWidth){window.onresize=NS4resize;window.NS4sIW=window.innerWidth;window.NS4sIH=window.innerHeight}document.onmouseup=mouseupMenu;window.fwWroteMenu=true;status=""}function NS4resize(){if(NS4sIW<window.innerWidth||NS4sIW>window.innerWidth||NS4sIH>window.innerHeight||NS4sIH<window.innerHeight)window.location.reload()}function onMenuItemOver(c,b){FW_clearTimeout();b=b||this;a=window.ActiveMenuItem;if(document.layers){if(a){a.document.bgColor=a.saveColor;if(a.hilite)a.hilite.visibility="hidden";if(a.Menu.bgImageOver)a.background.src=a.Menu.bgImageUp;a.focusItem.top=-100;a.clicked=false}if(b.hilite){b.document.bgColor=b.menuHiliteBgColor;b.zIndex=1;b.hilite.visibility="inherit";b.hilite.zIndex=2;b.document.layers[1].zIndex=1;b.focusItem.zIndex=this.zIndex+2}if(b.Menu.bgImageOver)b.background.src=b.Menu.bgImageOver;b.focusItem.top=this.top;b.Menu.hideChildMenu(b)}else if(b.style&&b.Menu){if(a){a.style.backgroundColor=a.saveColor;if(a.hilite)a.hilite.style.visibility="hidden";if(a.Menu.bgImageUp)a.style.background="url("+a.Menu.bgImageUp+")"}if(b.isSeparator)return;b.style.backgroundColor=b.menuHiliteBgColor;b.zIndex=1;if(b.Menu.bgImageOver)b.style.background="url("+b.Menu.bgImageOver+")";if(b.hilite){b.style.backgroundColor=b.menuHiliteBgColor;b.hilite.style.visibility="inherit"}b.focusItem.style.top=b.focusItem.style.pixelTop=b.style.pixelTop;b.focusItem.style.zIndex=b.zIndex+1;b.Menu.hideChildMenu(b)}else return;window.ActiveMenuItem=b}function onMenuItemAction(e,l){l=window.ActiveMenuItem;if(!l)return;hideActiveMenus();if(l.action)eval(""+l.action);window.ActiveMenuItem=0}function FW_clearTimeout(){if(fwHideMenuTimer)clearTimeout(fwHideMenuTimer);fwHideMenuTimer=null;fwDHFlag=false}function FW_startTimeout(){fwStart=new Date;fwDHFlag=true;fwHideMenuTimer=setTimeout("fwDoHide()",1e3)}function fwDoHide(){if(!fwDHFlag)return;var a=new Date-fwStart;if(a<1e3){fwHideMenuTimer=setTimeout("fwDoHide()",1100-a);return}fwDHFlag=false;hideActiveMenus();window.ActiveMenuItem=0}function FW_showMenu(b,e,f,g){if(!window.fwWroteMenu)return;FW_clearTimeout();if(document.layers){if(b){var a=b.menuLayer||b;a.left=1;a.top=1;hideActiveMenus();if(this.visibility)a=this;window.ActiveMenu=a}else var a=g;if(!a)return;for(var c=0;c<a.layers.length;c++){if(!a.layers[c].isHilite)a.layers[c].visibility="inherit";if(a.layers[c].document.layers.length>0)FW_showMenu(null,"relative","relative",a.layers[c])}if(a.parentLayer){if(e!="relative")a.parentLayer.left=e||window.pageX||0;if(a.parentLayer.left+a.clip.width>window.innerWidth)a.parentLayer.left-=a.parentLayer.left+a.clip.width-window.innerWidth;if(f!="relative")a.parentLayer.top=f||window.pageY||0;if(a.parentLayer.isContainer){a.Menu.xOffset=window.pageXOffset;a.Menu.yOffset=window.pageYOffset;a.parentLayer.clip.width=window.ActiveMenu.clip.width+2;a.parentLayer.clip.height=window.ActiveMenu.clip.height+2;if(a.parentLayer.menuContainerBgColor)a.parentLayer.document.bgColor=a.parentLayer.menuContainerBgColor}}a.visibility="inherit";if(a.Menu)a.Menu.container.visibility="inherit"}else if(FIND("menuItem0")){var a=b.menuLayer||b;hideActiveMenus();if(typeof a=="string")a=FIND(a);window.ActiveMenu=a;var d=a.style;d.visibility="inherit";if(e!="relative")d.left=d.pixelLeft=e||window.pageX+document.body.scrollLeft||0;if(f!="relative")d.top=d.pixelTop=f||window.pageY+document.body.scrollTop||0;a.Menu.xOffset=document.body.scrollLeft;a.Menu.yOffset=document.body.scrollTop}if(b)window.activeMenus[window.activeMenus.length]=a}function onMenuItemDown(b){var a=window.ActiveMenuItem;if(document.layers)if(a){a.eX=b.pageX;a.eY=b.pageY;a.clicked=true}}function mouseupMenu(a){hideMenu(true,a);hideActiveMenus();return true}function mouseoutMenu(){hideMenu(false,false);return true}function hideMenu(c,b){var a=window.ActiveMenuItem;if(a&&document.layers){a.document.bgColor=a.saveColor;a.focusItem.top=-30;if(a.hilite)a.hilite.visibility="hidden";if(c&&a.action&&a.clicked&&window.ActiveMenu)if(a.eX<=b.pageX+15&&a.eX>=b.pageX-15&&a.eY<=b.pageY+10&&a.eY>=b.pageY-10)setTimeout("window.ActiveMenu.Menu.onMenuItemAction();",2);a.clicked=false;if(a.Menu.bgImageOver)a.background.src=a.Menu.bgImageUp}else if(window.ActiveMenu&&FIND("menuItem0"))if(a){a.style.backgroundColor=a.saveColor;if(a.hilite)a.hilite.style.visibility="hidden";if(a.Menu.bgImageUp)a.style.background="url("+a.Menu.bgImageUp+")"}if(!c&&window.ActiveMenu)if(window.ActiveMenu.Menu){if(window.ActiveMenu.Menu.hideOnMouseOut)FW_startTimeout();return true}return true}function PxToNum(a){if(a.length>2){n=Number(a.substr(0,a.length-2));return n}return 0}function hideChildMenu(i){FW_clearTimeout();var a=i;for(var f=0;f<a.Menu.childMenus.length;f++){var d=a.Menu.childMenus[f];if(document.layers)d.visibility="hidden";else{d=FIND(d);d.style.visibility="hidden"}d.Menu.hideChildMenu(d)}if(a.childMenu){var b=a.childMenu;if(document.layers){a.Menu.FW_showMenu(null,null,null,b.layers[0]);b.zIndex=a.parentLayer.zIndex+1;b.top=a.top+a.parentLayer.top+a.Menu.menuLayer.top+a.Menu.menuItemHeight/3;if(b.left+b.clip.width>window.innerWidth){b.left=a.parentLayer.left-b.clip.width+a.Menu.menuLayer.left+15;a.Menu.container.clip.left-=b.clip.width}else b.left=a.parentLayer.left+a.parentLayer.clip.width+a.Menu.menuLayer.left-5;var h=b.clip.width+b.left-a.Menu.container.clip.left;if(h>a.Menu.container.clip.width)a.Menu.container.clip.width=h;var g=b.clip.height+b.top-a.Menu.container.clip.top;if(g>a.Menu.container.clip.height)a.Menu.container.clip.height=g;a.document.layers[1].zIndex=0;b.visibility="inherit"}else if(FIND("menuItem0")){b=FIND(a.childMenu);var c=FIND(a.Menu.menuLayer),e=b.style;e.zIndex=c.style.zIndex+1;if(document.all){e.pixelTop=a.style.pixelTop+c.style.pixelTop+a.Menu.menuItemHeight/3;e.left=e.pixelLeft=c.style.pixelWidth+c.style.pixelLeft-5}else{var k=PxToNum(a.style.top)+PxToNum(c.style.top)+a.Menu.menuItemHeight/3,j=PxToNum(c.style.width)+PxToNum(c.style.left)-5;e.top=k;e.left=j}b.style.visibility="inherit"}else return;window.activeMenus[window.activeMenus.length]=b}}function hideActiveMenus(){if(!window.activeMenus)return;for(var a=0;a<window.activeMenus.length;a++){if(!activeMenus[a])continue;if(activeMenus[a].visibility&&activeMenus[a].Menu){activeMenus[a].visibility="hidden";activeMenus[a].Menu.container.visibility="hidden";activeMenus[a].Menu.container.clip.left=0}else if(activeMenus[a].style){var b=activeMenus[a].style;b.visibility="hidden";b.left=-200;b.top=-200}}if(window.ActiveMenuItem)hideMenu(false,false);window.activeMenus.length=0}