/*
	Function Name: AttachEvent
	Arguments: OBJ,EVT,FNCT
	Action: cross browser: attaches event to passed in object.  FNCT will be the event's callback function.
	Returns: true on success
*/
function AttachEvent(OBJ,EVT,FNCT)
{
	if (OBJ.addEventListener)
	{
		OBJ.addEventListener(EVT,FNCT,true);
		return true;
	} 
	else if (OBJ.attachEvent) 
	{
		return OBJ.attachEvent("on"+EVT,FNCT);
	}
}

/*
	Function Name: RemoveElement
	Arguments: ELEM
	Action: Removes passed-in element
	Returns: true on success, false on failure
*/
function RemoveElement(ELEM)
{
	if (ELEM.parentNode.removeChild(ELEM))
		return true;
	else
		return false;
}

/*
	Function Name: RemoveAllChildren
	Arguments: PARENT
	Action: Removes all of an element's children
	Returns: nothing
*/
function RemoveAllChildren(PARENT)
{	
	while (PARENT.hasChildNodes())
	{
		PARENT.removeChild(PARENT.childNodes[0]);
	}
}