
function getElementsByAttribute(attribute, attributeValue)
{
	var elementArray = new Array();
	var matchedArray = new Array();

	if (document.all)
	{
		elementArray = document.all;
	}
	else
	{
		elementArray = document.getElementsByTagName("*");
	}

	for (var i = 0; i < elementArray.length; i++)
	{
		if ((attribute == "class" && elementArray[i].className == attributeValue) || (elementArray[i].getAttribute(attribute) == attributeValue))
		{
			matchedArray[matchedArray.length] = elementArray[i];
		}
	}
	
	return matchedArray;
}




function getChildrenByTagName(target, tagName)
{
	var children = target.childNodes;
	var matching = new Array();
	
	if (children != null)
	{
		for (var i = 0; i < children.length; i++)
		{
			if (children[i].nodeName.toLowerCase() == tagName)
			{
				matching[matching.length] = children[i];
			}
		}
	}
	
	return matching;
}




function getChildrenByClass(target, classValue)
{
	var children = target.childNodes;
	var matching = new Array();

	for (var i = 0; i < children.length; i++)
	{
		if (typeof children[i].className != "undefined" && children[i].className.classExists(classValue))
		{
			matching[matching.length] = children[i];
		}
	}
	
	return matching;
}