function mainMenuObject(name) {this.name = name;this.cmdHeight = 25;this.cmdWidth = 125;this.cmdPixelsBetween = 20;this.cmdOffsetLeft = 0;this.cmdOffsetTop = 0;this.mainHeight = 25;this.mainWidth = 125;this.mainPixelsBetween = this.cmdPixelsBetween;this.mainOffsetLeft = 0;this.mainOffsetTop = 0;this.mainOffsetStart = 0;this.bgBar = true;this.bgBarLeft = 0;this.bgBarTop = 0;this.bgBarHeight = this.cmdHeight;this.bgBarWidth = "100%";this.bgBarColor = "#ffffff";this.bgBarOrientation = "Top";this.aMasterMenus = new Array();this.aActiveMenus = new Array();this.menusoff = "mouse";this.menusoffTimer = 1;this.menusChunk = 10;this.menusUnfoldTime = .75;this.menusDelay = (this.menusUnfoldTime * 1000) / (100 / parseInt(this.menusChunk));this.menusUnfold = 1;this.page = new PageCoords();this.posBgBar = posBgBar;this.makeMasterMenu = makeMasterMenu;this.showSubmenu = showSubmenu;this.hideSubmenu = hideSubmenu;this.hideAll = hideAll;this.hideLastMenu = hideLastMenu;this.findMenu = findMenu;this.is_TopMost = is_TopMost;this.initMenus = initMenus;this.doPercent = doPercent;this.resized = resized;this.unFoldMenu = unFoldMenu;this.MenuOff = MenuOff;this.MakeInt = MakeInt;}function MakeInt() {this.cmdHeight=parseInt(this.cmdHeight);this.cmdWidth=parseInt(this.cmdWidth);this.cmdPixelsBetween=parseInt(this.cmdPixelsBetween);this.cmdOffsetLeft=parseInt(this.cmdOffsetLeft);this.cmdOffsetTop=parseInt(this.cmdOffsetTop);this.mainHeight=parseInt(this.mainHeight);this.mainWidth=parseInt(this.mainWidth);this.mainOffsetLeft=parseInt(this.mainOffsetLeft);this.mainOffsetTop=parseInt(this.mainOffsetTop);this.mainOffsetStart=parseInt(this.mainOffsetStart);this.bgBarLeft=parseInt(this.bgBarLeft);this.bgBarTop=parseInt(this.bgBarTop);this.menusoffTimer=parseInt(this.menusoffTimer);this.menusChunk=parseInt(this.menusChunk);this.menusUnfoldTime=parseFloat(this.menusUnfoldTime);this.menusUnfold=parseInt(this.menusUnfold);}function initMenus(menu) {this.MakeInt();this.posBgBar();explorerev = '';var sTemp = this.name + ".resized();";fFunc = new Function(sTemp);window.onresize=fFunc;this.MenuOff();return;}function MenuOff() {var sTemp = "";if (this.menusoff == "timer") {sTemp = "setTimeout(\"";}sTemp += this.name + ".hideAll();";if (this.menusoff == "timer") {sTemp += "\"," + (this.menusoffTimer * 1000) + ");";}var Trans = thenamedgrp[this.name + 'Trans'];fFunc = new Function(sTemp);if(this.menusoff == "mouse" || this.menusoff == "timer") {Trans.onmouseover(fFunc);Trans.onclick("");} else {Trans.onclick(fFunc);Trans.onmouseover("");}Trans.set_zindex(25);Trans.visible();return;}function resized(page) {var page2 = new PageCoords();if(page2.x2 != this.page.x2 || page2.y2 != this.page.y2) {location.reload();this.page = new PageCoords();}}function findMenu(name) {for ( i = 0 ; i < this.aActiveMenus.length; i++ ) {if(this.aActiveMenus[i].indexOf(name) != -1) return i;}return -1;}function is_TopMost(name) {for ( i = 0 ; i < this.aMasterMenus.length; i++ ) {if(this.aMasterMenus[i] == name) return true;}return false;}function showSubmenu(cmdShow,cmdName,cmdNumber) {this.MakeInt();var oShow = thenamedgrp[cmdShow];var oName = thenamedgrp[cmdName];if(typeof(oShow) == "undefined") { return; }if(typeof(oName) == "undefined") { return; }var x=0,i=0, j=0, k=0;var cmdNameLeft = parseInt(oName.get_left());var cmdNameTop = parseInt(oName.get_top());var TopMost = this.is_TopMost(cmdName);x = this.aActiveMenus.length;for( i = this.aActiveMenus.length-1 ; i != -1 ; i--) {if(this.aActiveMenus[i] == cmdName){ break; }if(this.aActiveMenus[i] != cmdName) {k = thenamedgrp[this.aActiveMenus[i]].get_size();for(j = 0; j < k; j++) {thenamedgrp[this.aActiveMenus[i] + "_" + j].hide();}thenamedgrp[this.aActiveMenus[i]].hide();--x;}}this.aActiveMenus.length = x;if(!TopMost) {if(cmdShow == this.aActiveMenus[this.aActiveMenus.length-1]) {return; }oShow.move((this.cmdWidth + cmdNameLeft)+ this.cmdOffsetLeft,((this.cmdHeight * cmdNumber)+ cmdNameTop)+ parseInt(this.cmdOffsetTop));} else {this.hideAll();var Trans = thenamedgrp[this.name + 'Trans'];Trans.set_left(0);Trans.set_top(0);Trans.set_width(this.page.x2);Trans.set_height(this.page.y2);Trans.move(0,0);if(this.bgBarOrientation == "Top") {oShow.move(cmdNameLeft + this.mainOffsetLeft,this.bgBarTop + this.mainHeight + this.mainOffsetTop);} else {oShow.move(this.mainWidth + this.mainOffsetLeft + cmdNameLeft,cmdNameTop + this.mainOffsetTop );}}this.aActiveMenus[this.aActiveMenus.length] = cmdShow;oShow.set_width(this.cmdWidth);oShow.set_height(this.cmdHeight * oShow.get_size());oShow.set_zindex(oName.get_zindex()+2);x = oShow.get_size();for(i = 0; i < x; i++) {thenamedgrp[cmdShow + "_" + i].set_width(this.cmdWidth);thenamedgrp[cmdShow + "_" + i].set_height(this.cmdHeight);thenamedgrp[cmdShow + "_" + i].set_top(i * this.cmdHeight);var sOnColor = eval(cmdShow + '.onColor;');var sOffColor = eval(cmdShow + '.offColor;');var sMouseOver = new Function("thenamedgrp['" + cmdShow + "_" + i + "'].set_bgColor('" + sOnColor + "')");var sMouseOut = new Function("thenamedgrp['" + cmdShow + "_" + i + "'].set_bgColor('" + sOffColor + "')");thenamedgrp[cmdShow + "_" + i].onmouseover(sMouseOver);thenamedgrp[cmdShow + "_" + i].onmouseout(sMouseOut);thenamedgrp[cmdShow + "_" + i].set_bgColor(sOffColor);thenamedgrp[cmdShow + "_" + i].visible();}if (oBrowser.ns5) {thenamedgrp[cmdShow].clip_obj(0,0,(this.cmdHeight * oShow.get_size())+10,parseInt(this.cmdWidth)+10,true);thenamedgrp[cmdShow].visible();} else {thenamedgrp[cmdShow].clip_obj(0,0,0,0);thenamedgrp[cmdShow].visible();this.unFoldMenu(cmdShow,this.menusChunk,this.menusChunk,(this.menusUnfoldTime * 1000) / (100 / parseInt(this.menusChunk)),this.menusUnfold);}}function hideLastMenu(name) {var x=0, j=0, i=0;i = this.aActiveMenus.length-1;if(this.aActiveMenus[i] == name) { return; }x = thenamedgrp[this.aActiveMenus[i]].get_size();for(j = 0; j < x; j++) {thenamedgrp[this.aActiveMenus[i] + "_" + j].hide();}thenamedgrp[this.aActiveMenus[i]].hide();this.aActiveMenus.length = i;}function hideSubmenu(name) {thenamedgrp[name].hide();}function hideAll() {var x=0, j=0, i=0;for ( i = this.aActiveMenus.length-1 ; i != -1; i--) {x = thenamedgrp[this.aActiveMenus[i]].get_size();for(j = 0; j < x; j++) {thenamedgrp[this.aActiveMenus[i] + "_" + j].hide();}thenamedgrp[this.aActiveMenus[i]].hide();}this.aActiveMenus.length = 0;var Trans = thenamedgrp[this.name + 'Trans'];Trans.set_left(0);Trans.set_top(0);Trans.set_width(0);Trans.set_height(0);}function makeMasterMenu(name,visible) {this.MakeInt();var MMenu = thenamedgrp[name];if(this.bgBarOrientation == "Top") {iSpace = this.mainOffsetStart + this.bgBarLeft + (this.aMasterMenus.length* this.mainWidth);this.aMasterMenus.length > 0 ? iSpace += this.mainPixelsBetween : iSpace;MMenu.move(iSpace,parseInt(this.bgBarTop));} else {if(this.aMasterMenus.length) {iSpace = this.aMasterMenus.length * this.mainPixelsBetween + (this.aMasterMenus.length * this.mainHeight);} else {iSpace = this.aMasterMenus.length* this.mainHeight;}MMenu.move(this.bgBarLeft,iSpace);}MMenu.set_width(this.mainWidth);MMenu.set_zindex(50);if(visible) { MMenu.visible(); }this.aMasterMenus[this.aMasterMenus.length] = name;}function posBgBar() {this.MakeInt();var oPage = new PageCoords();var bgBar = thenamedgrp[this.name + "bgBar"];bgBar.hide();if(this.bgBarOrientation == "Top") {bgBar.set_width(doPercent(this.bgBarWidth,oPage.x2));bgBar.set_height(doPercent(this.bgBarHeight,oPage.y2));} else {bgBar.set_width(doPercent(this.bgBarWidth,this.mainWidth));bgBar.set_height(doPercent(this.bgBarHeight,oPage.y2));}bgBar.set_top(this.bgBarTop);bgBar.set_left(this.bgBarLeft);bgBar.move(this.bgBarLeft,this.bgBarTop);bgBar.set_bgColor(this.bgBarColor);if(this.bgBar) {bgBar.visible();}var aSaveMenus = new Array();for(i = 0; i < this.aMasterMenus.length; i++) {aSaveMenus[i] = this.aMasterMenus[i];}this.aMasterMenus.length = 0;for(i=0; i < aSaveMenus.length; i++) {this.makeMasterMenu(aSaveMenus[i],true);}}function doPercent(num,of) {if(num) {if(num.toString().indexOf("%") != -1) {iPercent = parseFloat(num)/100;return ( of * iPercent);} else {return parseFloat(num);}} else {return 0;}}function unFoldMenu(name,nChunk,step,delay,type) {nWidth = parseInt(thenamedgrp[name].get_width());nHeight = parseInt(thenamedgrp[name].get_height());nWidthPercent = this.doPercent(nChunk + "%",nWidth);nHeightPercent = this.doPercent(nChunk + "%",nHeight);if(type == 0) {thenamedgrp[name].clip_obj(0,0,nHeight,nWidth,false);} else if(type == 1) {thenamedgrp[name].clip_obj(0,0,nHeightPercent,nWidthPercent,false);    } else if(type == 2) {thenamedgrp[name].clip_obj(0,0,nHeightPercent,nWidth,false);} else if(type == 3) {thenamedgrp[name].clip_obj(0,0,nHeight,nWidthPercent,false);}nChunk += step;if ((nChunk+step) <= 100) {window.setTimeout("unFoldMenu('" + name + "'," + nChunk + "," + step + "," + delay + "," + type + ")",delay);} else {thenamedgrp[name].clip_obj(0,0,nHeight,nWidth,false);}}