var NodeElement = function(o)
{
	if(typeof(o) == "string") o = document.getElementById(o);
	
	// get next no-whitespace node for Gecko-based browsers (IE, Mozilla)
	o.getNextSibling = function()
	{
		var el = this.nextSibling;
		while(el && el.nodeName == "#text") el = el.nextSibling;
		return new NodeElement(el);
	}

	// get the first child no-whitespace node
	o.getFirstChild = function()
	{
		var el = this.firstChild;
		while(el && el.nodeName == "#text") el = el.nextSibling;
		return new NodeElement(el);
	}
	
	// return an array with the object's child nodes without whitespace nodes
	o.getChildNodes = function()
	{
		var arr = new Array();
		for(var i=0; (oNode = this.childNodes[i]); i++)
		{
			if(oNode && oNode.nodeName != "#text") arr.push(new NodeElement(oNode));
		}
		return arr;
	}
	
	// return the value of the node
	o.getNodeValue = function()
	{
		return this.firstChild.nodeValue;
	}
	
	// return an array with all the child nodes matching the class name
	o.getChildByClassName = function(classname)
	{
		for(var i=0; (oNode = this.getChildNodes(this)[i]); i++)
		{
			if(oNode.className == classname)
			{
				if(!arr) var arr = new Array();
				arr.push(new NodeElement(oNode));
			}
		}
		return arr;
	}
	
	// return an array with all the child nodes matching the tag name
	o.getChildByTagName = function(tagname)
	{
		for(var i=0; (oNode = this.getChildNodes(this)[i]); i++)
		{
			if(oNode.nodeName == tagname)
			{
				if(!arr) var arr = new Array();
				arr.push(new NodeElement(oNode));
			}
		}
		return arr;
	}

	return o;
}