
function changeMenuClass(divName,className)
        {

            var div = document.getElementById(divName);
             div.className = className;
        }
function switchMenu(divName,classNameShow,classNameHidden)
{
var div = document.getElementById(divName);
if (div.className == classNameShow)
{
	div.className = classNameHidden;
}
else if (div.className == classNameHidden)
{
	div.className = classNameShow;
}
}
function hideMenu(divName)
{
var div = document.getElementById(divName);
	div.className = "hidden";
}
function changeClass(divName,className)
{
var div = document.getElementById(divName);
	div.className = className;
}
function showOnlyOneCopper(showme,showmeclass,hide1,hide2,hide3)
{
	document.getElementById(showme).className = showmeclass;
	document.getElementById(hide1).className = "hidden";
	document.getElementById(hide2).className = "hidden";
	document.getElementById(hide3).className = "hidden";
}
function hideAllCopper(hide1,hide2,hide3,hide4)
{
	document.getElementById(hide1).className = "hidden";
	document.getElementById(hide2).className = "hidden";
	document.getElementById(hide3).className = "hidden";
	document.getElementById(hide4).className = "hidden";
}
function hideAllCB(hide1,hide2)
{
	document.getElementById(hide1).className = "hidden";
	document.getElementById(hide2).className = "hidden";
}
function showOnlyOneCB(showme,showmeclass,hide1)
{
	document.getElementById(showme).className = showmeclass;
	document.getElementById(hide1).className = "hidden";
}
function showOnlyOneAF(showme,showmeclass,hide1,hide2)
{
	document.getElementById(showme).className = showmeclass;
	document.getElementById(hide1).className = "hidden";
	document.getElementById(hide2).className = "hidden";
}
function hideAllAF(hide1,hide2,hide3)
{
	document.getElementById(hide1).className = "hidden";
	document.getElementById(hide2).className = "hidden";
	document.getElementById(hide3).className = "hidden";
}

<!-- Original:  Angus Turnbull -->

<!-- Web Site:  http://gusnz.cjb.net -->

 

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->

 

<!-- Begin

var isDOM = (document.getElementById ? true : false); 

var isIE4 = ((document.all && !isDOM) ? true : false);

var isNS4 = (document.layers ? true : false);

function getRef(id) {

if (isDOM) return document.getElementById(id);

if (isIE4) return document.all[id];

if (isNS4) return document.layers[id];

}

function getSty(id) {

return (isNS4 ? getRef(id) : getRef(id).style);

} 

// Hide timeout.

var popTimer = 0;

// Array showing highlighted menu items.

var litNow = new Array();

function popOver(menuNum, itemNum) {

clearTimeout(popTimer);

hideAllBut(menuNum);

litNow = getTree(menuNum, itemNum);

changeCol(litNow, true);

targetNum = menu[menuNum][itemNum].target;

if (targetNum > 0) {

thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);

thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);

with (menu[targetNum][0].ref) {

left = parseInt(thisX + menu[targetNum][0].x);

top = parseInt(thisY + menu[targetNum][0].y);

visibility = 'visible';

      }

   }

}

function popOut(menuNum, itemNum) {

if ((menuNum == 0) && !menu[menuNum][itemNum].target)

hideAllBut(0)

else

popTimer = setTimeout('hideAllBut(0)', 500);

}

function getTree(menuNum, itemNum) {

 

// Array index is the menu number. The contents are null (if that menu is not a parent)

// or the item number in that menu that is an ancestor (to light it up).

itemArray = new Array(menu.length);

 

while(1) {

itemArray[menuNum] = itemNum;

// If we've reached the top of the hierarchy, return.

if (menuNum == 0) return itemArray;

itemNum = menu[menuNum][0].parentItem;

menuNum = menu[menuNum][0].parentMenu;

   }

}

 

// Pass an array and a boolean to specify colour change, true = over colour.

function changeCol(changeArray, isOver) {

for (menuCount = 0; menuCount < changeArray.length; menuCount++) {

if (changeArray[menuCount]) {

newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;

// Change the colours of the div/layer background.

with (menu[menuCount][changeArray[menuCount]].ref) {

if (isNS4) bgColor = newCol;

else backgroundColor = newCol;

         }

      }

   }

}

function hideAllBut(menuNum) {

var keepMenus = getTree(menuNum, 1);

for (count = 0; count < menu.length; count++)

if (!keepMenus[count])

menu[count][0].ref.visibility = 'hidden';

changeCol(litNow, false);

}

 

// *** MENU CONSTRUCTION FUNCTIONS ***

 

function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {

// True or false - a vertical menu?

this.isVert = isVert;

// The popout indicator used (if any) for this menu.

this.popInd = popInd

// Position and size settings.

this.x = x;

this.y = y;

this.width = width;

// Colours of menu and items.

this.overCol = overCol;

this.backCol = backCol;

// The stylesheet class used for item borders and the text within items.

this.borderClass = borderClass;

this.textClass = textClass;

// Parent menu and item numbers, indexed later.

this.parentMenu = null;

this.parentItem = null;

// Reference to the object's style properties (set later).

this.ref = null;

}

 

function Item(text, href, frame, length, spacing, target) {

this.text = text;

this.href = href;

this.frame = frame;

this.length = length;

this.spacing = spacing;

this.target = target;

// Reference to the object's style properties (set later).

this.ref = null;

}

 

function writeMenus() {
return;



}

 
function clickHandle(evt)

{

 if (isNS4) document.routeEvent(evt);

 hideAllBut(0);

}

 

 

// This is just the moving command for the example.

 

function moveRoot()

{

 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);

}



