
/** Instantiate namespace object */
var Func = {};

/** Comment
* @param mixed Comment
* @returns void */
Func.EnableFauxHover = function(root, nodeName)
{
	nodeName = String(nodeName).toUpperCase();
	for (var i=0; i<root.childNodes.length; ++i)
	{
		node = root.childNodes[i];
		if (node.nodeName == nodeName)
		{
			node.onmouseover = function() { this.className += " hover"; };
			node.onmouseout = function() { this.className = this.className.replace(" hover", ""); };
			node.onclick = function() { this.className = this.className.replace(" hover", ""); return true; };
		}
	}
};

/** Comment
* @param mixed Comment
* @returns void */
Func.ForEachChildNode = function(root, nodeName, func)
{
	if (!root)
		return;
	var found = root.getElementsByTagName( String(nodeName).toUpperCase() );
	for (var i=0; i<found.length; ++i)
	{
		func(found[i]);
	}
}

/** Search DOM for a specified parent of the given node
* @param Element Begin searching from this node
* @param string Tag name to match
* @returns Element */
Func.FindParentByTag = function(using, findTag)
{
	findTag = String(findTag).toUpperCase();
	var found = using.parentNode;
	while (found && (found.tagName != findTag))
		{found = found.parentNode;}
	return found;
};

