var TSWDomUtils = new Object; //object for static method calls

//Returns an array of children of element with name tagName; as opposed to getElementsByTagName
//which returns any descendant.
TSWDomUtils.getChildrenWithTagName = function(element, tagName)
{
	tagName = tagName.toUpperCase();
	var results = new Array();
	var children = element.childNodes;
	for(var i=0; i<children.length; i++)
	{
		var child = children[i];
		if(child.tagName != null && child.tagName.toUpperCase() == tagName)
		{
			results.push(child);
		}
	}
	return results;
};

//Get the first child of element with a particular class name.
TSWDomUtils.getChildWithClassName = function(element, className)
{
	var children = element.childNodes;
	for(var i=0; i<children.length; i++)
	{
		var child = children[i];
		if(child.tagName != null && child.className == className)
		{
			return child;
		}
	}
	return null;
};
