/*	
-------------------------------------------------------
Name:
	displaySDKMenu

Description:
	Displays the left-hand menu of SDKs on a page
	Highlights the specified SDK in the left-hand menu
	By changing its style properties.

	Each element in this menu calls setSDK from its 
	Onclick event.  (Use event bubbling)
	
Parameters:
	strXML - pointer to an XML file that contains the list/hierarchy of SDKs to display
	strXSL - pointer to an XSL file that transforms strXML
	StrSDK - the name of the SDK to highlight

Return Value:	
	None.
-------------------------------------------------------		
*/
function displaySDKMenu(xmlMenu, xslMenu, strSDK)
{
	try{
		var el;
	
		//write menu
		divMenu.innerHTML = xmlMenu.transformNode(xslMenu.XMLDocument);
		
		//highlight SDK item
		if (strSDK != null)
		{
			el = document.getElementById(strSDK);
			if(el != null)
			{
				el.style.color = 'navy';
			}		
		}	
	}catch(e){
//		displayError(e.description);
//		window.status=e.description;
		setTimeout('displaySDKMenu(parent.xmlMenu, parent.xslMenu, parent.strSDK);',10);
	}	
}


/*	
-------------------------------------------------------
Name:
	divMenu::onclick

Description:
	Event handler for the SDK menu.  When a user clicks on an 
	element in the menu, the value of strSDK is set, and
	they are navigated to sdkInfo.htm.
	
Parameters:
	None

Return Value:	
	None
-------------------------------------------------------		
*/
function divMenu::onclick()
{
	//get the element that fired the event
	var el = event.srcElement;
	
	//disallow click on SDK groupings (eg: Windows SDK)
	if (el.id.length > 0 && el.id != 'divMenu')
	{
		//set the global variable
		top.strSDK = el.id.substr(5);
	
		//navigate to SDK home page
		window.navigate('SDKInfo.htm');
	}
	
	//cancel further event bubbling, not necessary
	event.cancelBubble	
}

/*	
-------------------------------------------------------
Name:
	divMenu::onmouseover

Description:
	Provides the rollover effect for the SDK menu.
	
Parameters:
	None

Return Value:	
	None
-------------------------------------------------------		
*/
function divMenu::onmouseover()
{

	//disallow rollover on SDK groupings 
	if (event.toElement.id.length > 0)
	{
		//set 'to' element to navy
		event.toElement.style.color='navy';
	}

	if(event.fromElement != null)
	{	
		//check to make sure you're not clearing the default page & that 
		//the thing you're setting to white is a menu item. (else clears other page elements.)
		if (event.fromElement.id != top.strSDK && event.fromElement.id.substr(0,5) == 'menu_')
		{
			//set 'from' element to white
			event.fromElement.style.color='white';	
		}
	}	
		
	//cancel further event bubbling, not necessary
	event.cancelBubble

	
}



