var lcount;

function getprevElement(xnode) {
	pnode = xnode.previousSibling;
	if (pnode == null) {
		return null;
	} else if (pnode.nodeType != 1) { 
		return getprevElement(pnode);
	} else {
		return pnode;
	}
}

function tablistFindlevel(xnode) {
	lcount++;
	pnode = getprevElement(xnode);
	if (pnode != null) {
		return tablistFindlevel(pnode);
	}
	return lcount;
}

function tablistToggle(x) {
	//funciton to toggle - yes tablists
	//This is sorta weird and sloppy - blame IE
	
	pdiv = dojo.byId(x);
	
	activeList = dojo.query(".activeTabGroup");
	for(var i=0; i<activeList.length; i++){
		dojo.removeClass(activeList[i], "activeTabGroup");
	}
	
	dojo.addClass(pdiv, "activeTabGroup");
}
