/************************************************************
 * NAME:			MenuNode - 1.00							*
 * DESCRIPTION:		Node in a menu tree						*
 * DEPENDENCIES: 	none									*
 ************************************************************/
function MenuNode( label, url )
{
// PUBLIC
	/**
	 * NAME: 			appendChild( node )
	 * DESCRIPTION:		Add a child node to the end of the array
	 * PARAMS:			node - a MenuNode
	 * RETURN:			Reference to the new node
	 */
	this.appendChild = function( node ) {
		return ( this.m_aChildren[this.m_aChildren.length] = node );
	};
	
	/**
	 * NAME: 			getChild( index )
	 * DESCRIPTION:		Get a child node by its position in the array
	 * PARAMS:			index - index of the node
	 * RETURN:			Requested node or null if none existed
	 */	
	this.getChild = function( index ) {
		return this.m_aChildren[index];
	};
	
	/**
	 * NAME: 			getChildren()
	 * DESCRIPTION:		Get the children array
	 * RETURN:			The children array
	 */
	this.getChildren = function() {
		return this.m_aChildren;
	};
	
	/**
	 * NAME: 			hasChildren()
	 * DESCRIPTION:		Returns whether or not node 
	 *					contains children
	 * RETURN:			boolean
	 */
	 this.hasChildren = function() {
	 	return this.m_aChildren.length ? true : false;
	 };
	 
	 /**
	 * NAME: 			insertChild( index, label, url, id )
	 * DESCRIPTION:		Add a child to the specified index 
	 * PARAMS:			index - index to insert at
	 * 					node - a new node
	 * RETURN:			Reference to new node
	 */
	 this.insertChild = function( index, node ) {
	 	return ( this.m_aChildren[index] = node );
	 };
	
	
// MEMBERS
	this.label = label ? label : "";
	this.url = url ? url : "";
	this.m_aChildren = new Array();
}
