// preload the images
if (document.images)
{
	arrowRight = new Image();
	arrowRight.alt = "";
	arrowRight.src = "/images/bullet_square_grey.gif";
	arrowDown = new Image();
	arrowDown = "";
	arrowDown.src = "/images/bullet_square_red.gif";
}

var dispStatus = Array();
var halfTone = "#666666";
var fullTone = "#CA0018";

function expandItem(intItem) {
	// change it's properties and swap the image
	for (i=0; i < dispStatus.length; i++) {
		if (dispStatus[i] == "on") {
			dispStatus[i] = "off";
			setIdProperty("subnav"+i, "display", "none");
			setIdProperty("titleText"+i, "color", halfTone);
			document.images["titleArrow"+i].src = "/images/bullet_square_grey.gif";
		}
	}

	dispStatus[intItem] = "on";
	setIdProperty("subnav"+intItem, "display", "block");
//setIdProperty("subnav"+intItem, "left", "10");
	setIdProperty("titleText"+intItem, "color", fullTone);
	document.images["titleArrow"+intItem].src = "/images/bullet_square_red.gif";

}

function CexpandItem(intItem) {
//	dispStatus[intItem] = "on";

	setIdProperty("xx", "display", "block");
        var styleObject = document.getElementById( "xx" );
//alert(styleObject.style["display"])
//alert('gg')
//setIdProperty("subnav"+intItem, "left", "10");
//	setIdProperty("titleText"+intItem, "color", fullTone);
//	document.images["titleArrow"+intItem].src = "/images/bullet_square_red.gif";
}

function closeAllItems() {
	for (i=0; i < dispStatus.length; i++) {
		if (dispStatus[i] == "on") {
			dispStatus[i] = "off";
			setIdProperty("subnav"+i, "display", "none");
			setIdProperty("titleText"+i, "color", halfTone);
			document.images["titleArrow"+i].src = "/images/bullet_square_grey.gif";
		}
	}
}

function setIdProperty( id, property, value )
{
    if (document.getElementById)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            styleObject[ property ] = value;
        }

    }
    else {
        alert("incompatible browser--need to handle this");
		// error - incompatible browser
    }
}


var autoHidePass = 1;
var autoHideTime = 100;
var autoHideVar = null;
function subMenuOut()
{
    autoHideVar = setInterval("autoHide()", 10);
}
function autoHide()
{
	if (autoHidePass > autoHideTime)
	{
	    closeAllItems();
	}
	else
    {
	    autoHidePass++;
	}
}
function subMenuOver()
{
    clearInterval(autoHideVar);
	autoHidePass = 1;
}

function hOn(Element) { Element.className = "HOn"; }
function hOff(Element) { Element.className = "HOff"; }