function closeNav()
{
	var x = document.getElementsByTagName("div");
	for (var i=0; i < x.length; i++)
	{
		if (x[i].className == "content")
		{
			x[i].style.display = "none";
			
			var img = getObj("imgNav" + x[i].id.substring(1, x[i].id.length));
			img.src = "images/expand.gif";
		}
	}
}

function highlightCurrent()
{
	var p = location.protocol + "//" + location.host + location.pathname;
	//if (p.substring(p.length - 1, p.length) == "/")
	//	p += "default.aspx";
	var pq = p + location.search;
	
	var isSingle = false;

	try
	{
	    if (hlSuiteID) isSingle = true;
	}
	catch (err) {}
	
	if (isSingle)
        p = pq = 
            location.protocol + "//" + location.host + 
            "/suite2.aspx?id=" + hlSuiteID;

	var x = document.getElementsByTagName("a");
	for (var i = 0; i < x.length; i++)
	{
		if (x[i].className.indexOf("link") > -1 &&
			(x[i].href == p ||
			x[i].href == pq)
			)
		{
		    if (isSingle)
		    {
		        var tbl = x[i].parentNode.parentNode.parentNode;
		        var index = x[i].parentNode.parentNode.rowIndex;
		        
		        var newTR = tbl.insertRow(index + 1);
                var newTD1 = newTR.insertCell(0);
                var newTD2 = newTR.insertCell(1);

                newTD1.innerHTML = "&nbsp;";
                newTD1.width = "8";
                               
                //newTD2.align = "top"
                newTD2.className = "ContentCellSel";
                newTD2.innerHTML = 
                    "<img style=\"vertical-align: middle\" alt=\"\" src=\"images/tree_bare.png\" />" + 
                    "<img style=\"vertical-align: middle\" alt=\"\" src=\"images/tree_half.png\" />" + 
                    hlToonName;

  			    var tg = x[i];
			    while (tg.nodeName.toUpperCase() != "DIV")
				    tg = tg.parentNode;
			    tg.style.display = "block";
                
                break;
		    }
		    else
		    {
			    var tg = x[i];
			    while (tg.nodeName.toUpperCase() != "DIV")
				    tg = tg.parentNode;
			    tg.style.display = "block";

			    do
			        tg = tg.previousSibling;
			    while (tg && tg.nodeType != 1)
                
			    var img = getObj("n" + tg.id.substring(1, tg.id.length));
			    img.src = img.src.replace("closed", "open");

			    x[i].parentNode.className = x[i].parentNode.className + "Sel";
			    x[i].href = "javascript:doNothing();";
			    
			    break;
			}
		}
	}	
}

function clickNav(src)
{
	closeNav();

    var tg = src;
	
	while (tg.nodeName.toUpperCase() != "DIV")
		tg = tg.parentNode;
	var nextSib = tg.nextSibling;
	
	while (nextSib.nodeType != 1)
		nextSib = nextSib.nextSibling;
	var nextSibStatus = (nextSib.style.display == "none") ? "block" : "none";
	nextSib.style.display = nextSibStatus;
	
	var img = getObj("n" + tg.id.substring(1, tg.id.length));
	if (img.src.indexOf("open") > -1)
	    img.src = img.src.replace("open", "closed");
	else
	    img.src = img.src.replace("closed", "open");
}

function highlightCell(obj)
{
    var highlightColor = "#ccccff";
    var highlightColorFF = "rgb(204, 204, 255)";

    if (obj.nodeName == "TABLE")
    {
        if (obj.style.backgroundColor == highlightColor || obj.style.backgroundColor == highlightColorFF)
            obj.style.backgroundColor = "#ececec";
        else
            obj.style.backgroundColor = highlightColor;
        /*
        if (obj.style.backgroundImage.indexOf("over") > -1)
            obj.style.backgroundImage = "url('images/navsection_bg.jpg')";
        else
            obj.style.backgroundImage = "url('images/navsection_bg_over.jpg')";
        */
    }
    else if (obj.className != "ContentCellSel" && obj.className != "SubSectionCellSel")
    {
        if (obj.style.backgroundColor == highlightColor || obj.style.backgroundColor == highlightColorFF)
            obj.style.backgroundColor = "#ffffff";
        else
            obj.style.backgroundColor = highlightColor;
    }
}