//navigation
function cpmenuover(that) {
	that.parentNode.className = 'cpmenuover';
}
function cpmenuout(that) {
	that.parentNode.className = 'cpmenu';
}

function getMenuItems(menuid) {
	if(!window.allMenuItems) {
		window.allMenuItems = new Array();
		var allitems = document.getElementsByTagName('td');
		for(var i=0; i<allitems.length; ++i) {
			if(allitems[i].id.indexOf('menuitem.') == 0) {
				window.allMenuItems[window.allMenuItems.length] = allitems[i];
			}
		}
	}

	if(!menuid) return window.allMenuItems;
	else {
		var theseitems = new Array();

		for(var i=0; i<window.allMenuItems.length; ++i) {
			if(window.allMenuItems[i].id.indexOf('menuitem.'+menuid+'.') == 0) theseitems[theseitems.length] = window.allMenuItems[i];
		}
		return theseitems;
	}
}
function expandmenu(menuid) {
	var items = getMenuItems(menuid);
	if(items.length == 0) return;

	var display = (items[0].style.display == 'none');
	var displayval = (display) ? '' : 'none';

	var toi = tov = 50;
	for(var i=0; i<items.length; ++i) {
		setTimeout('showitem(\''+items[i].id+'\', \''+displayval+'\')', tov);
		tov += toi;
	}

}

function showitem(itemid, displayval) {
	document.getElementById(itemid).style.display = displayval;
}
//hide/show
function show(that, k) {
	var what = document.getElementById('class'+k);
	var link = document.getElementById('show'+k);
	if(what.style.display == 'none') {
		what.style.display = '';

		link.innerHTML = 'hide details';
	}
	else {
		what.style.display = 'none';
		link.innerHTML = 'show details';
	}

}

