
var initCalled = false;

function initMenus()
{
	var menuBar = menuBars[0];
	// menuBar location
	var img = getImage("menuPlaceHolder0");
	if (img)
		menuBar.setPosition(getImagePageLeft(img), getImagePageTop(img));

	menuBar.create();

	menuBar.setzIndex(500);
}

/////////////////////////////////////////////////////////////////////
//var menuBorderColor = getAccessory("hsh:menuSeparatorColor","#ff0000");
var menuBgColor = getAccessory("hsh:pageMainColor","#ffda01");
var menuFgColor = getAccessory("hsh:menuFgColor","#ff0000");
var menuHiBgColor = getAccessory("hsh:menuHoverBgColor","#00ff00");
var menuHiFgColor = getAccessory("hsh:menuHoverFgColor","#ffda01");

var fontFamily = "Verdana, Arial, Helvetica";
var fontWeight = "normal";
var fontSize = "11px";
var textDecoration = "none";
var hiTextDecoration = "none";
/////////////////////////////////////////////////////////////////////

function customMenu()
{
	// add call to 'initMenus the first time
	// customMenu is called
	if(!initCalled)
	{
		addLoadAction(initMenus);
		initCalled = true;
	}

	// place holder image
	document.write("<img NAME='menuPlaceHolder0' ID='menuPlaceHolder0' SRC='./iso_icons/empty.gif' WIDTH='1' HEIGHT='1'>");

	// In this theme, only one menuBar
	var menuBar = menuBars[0];

	// menuBar Options
	menuBar.setOrientation("horizontal");

	// levels Options
	var group = menuBar.childGroup;

	setGroupOptions(group, true);
}

function setGroupOptions(group, bFirst)
{
	group.setSizes (1,5,1);
	//borderColor, fgColor, bgColor, hiFgColor, hiBgColor
	group.setColors ("#000000", menuFgColor, menuBgColor, menuHiFgColor, menuHiBgColor);

	//fontFamily, fontWeight, fontSize, textDecoration, hiTextDecoration
	group.setFonts (fontFamily, fontWeight, fontSize, textDecoration, hiTextDecoration);
	
	if (bFirst != true)
		//decoration, hiDecoration, nextImg, hiNextImg
		group.setDecoration("", "", "<img src='./iso_icons/img_next.png'>", "<img src='./iso_icons/hi_img_next.png'>")

	var i;
	for (i=0 ; i<group.items.length ; i++)
	{
		var item = group.items[i];
		if (item.childGroup != null)
			setGroupOptions(item.childGroup, false);
	}
}


