function PageNode(id, title, subTitle)
{	this.id= id;
	this.parentNode= null;
	this.title= title;
	this.subTitle= subTitle;
	this.children= new Array();
}

PageNode.prototype.addChild= function(childToAdd)
{	childToAdd.parentNode= this;
	this.children[this.children.length]= childToAdd;
}

function Site()
{	this.root= null;
}

Site.prototype.setRoot= function(root)
{	this.root= root;
}

Site.prototype._getById= function(subRoot, id)
{	var theNode= null;
	if (subRoot.id == id)
	{	theNode= subRoot;
	}
	else
	{	var childCnt= subRoot.children.length;
		for (var childNdx= 0;
			(childNdx < childCnt) && (theNode == null);
			childNdx++)
		{	theNode= this._getById(subRoot.children[childNdx], id);
		}
	}
	return theNode;
}

Site.prototype.getById= function(id)
{	return this._getById(this.root, id);
}

var theSite= new Site();
