/* functions to allow for the expansion and collapse of elements */
function getElementsByClassName(className, tag, elm){
	var testClass = new RegExp("(^|\\\\s)" + className + "(\\\\s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i];
		if(testClass.test(current.className)){
			returnElements.push(current);
		}
	}
	return returnElements;
}

/*function expand(node)
{
	var toShowTbody=node.parentNode;
	if(toShowTbody.className == 'show')
	{
		toShowTbody.className="";
		return;
	}
	var toHideTbody = getElementsByClassName('show', 'tbody', document);
	if(toHideTbody.length != 0)
	{
		toHideTbody.className="";
	}
	toShowTbody.className="";
}*/
function expand(node)
{
	//var toShowTbody=node.parentNode;
	var toShowTbody=node;
	if(toShowTbody.className == 'expand')
	{
		DOMhelp.cssjs('remove', toShowTbody, 'expand');
		return;
	}
	var toHideTbody = getElementsByClassName('expand', 'li', document);
	if(toHideTbody.length != 0)
	{
		DOMhelp.cssjs('remove', toHideTbody[0], 'expand');
	}
	DOMhelp.cssjs('add', toShowTbody, 'expand');
}