/*
** Project: Picky Noo
**
** File:    leftnavbar.js
** Author:  NJW James
** Date:    01.04.2004
**	
** Copyright (c) NJW James 2004
*/

var bMenuNodeOpen = false;

function onClickMenu ()
{
	if (bMenuNodeOpen)
	{
		closeMenuNode();
		bMenuNodeOpen = false;
	}
	else
	{
		openMenuNode();
		bMenuNodeOpen = true;
	}
	setContent('menu_c');
}
	
function openMenuNode ()
{
	// Build open menu HTML.
	sMenuHTML = "";

	var oXSLTemplate = new ActiveXObject("Msxml2.XSLTemplate");
	var oXSLDocument = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");

	oXSLDocument.async = false;
	oXSLDocument.resolveExternals = false;
	oXSLDocument.load("MenuSubmenu.xslt");
	
	oXSLTemplate.stylesheet = oXSLDocument;
	
	var oXMLDocument = new ActiveXObject("Msxml2.DOMDocument");
	oXMLDocument.async = false;
	oXMLDocument.resolveExternals = false;
	oXMLDocument.load("getmenusxml.aspx");

	var oXSLProcessor = oXSLTemplate.createProcessor();
	oXSLProcessor.input = oXMLDocument;

	// Perform the transformation. Note that reading oXSLProcessor.output has the
	// effect of clearing the value, so that a further transform must be done
	// before the output can be read again.
	oXSLProcessor.transform();
	window.document.all.item("menusubmenudiv").innerHTML = oXSLProcessor.output;
}

function closeMenuNode ()
{
	// Remove the submenu items HTML. Have to use outerHTML as setting innerHTML
	// (or innerText) to empty string results in <div>&nbsp;</div> for some reason.
	window.document.all.item("menusubmenudiv").outerHTML =
		'<div id="menusubmenudiv"></div>';
//	alert("[" + window.document.all.item("tempid").innerHTML + "]");
}

function focusMenuItem ()
{
}

