/***********************************************************************

	(c) bxlab 2007
	==============


	some functions to toggle the visibility of blocks

***********************************************************************/
function GetObj(id){

	if (document.getElementById){  // mozilla
		return document.getElementById(id);
	}else if (document.all)	{ // iexplorer
		return document.all[id];
	}

}

function toggleInfo(){
	var x=GetObj('tableinfo');
	if(x.style.display=='block')
		x.style.display='none'
	else
		x.style.display='block';
}

function dupform(el,target){
	var x1=GetObj(el);
	var x2=GetObj(el);
	x2.innerHTML+=x1.innerHTML;
}

function toggle(el){
	var x=GetObj(el);
	if(x.style.display=='block') {
		x.style.display='none';
		return false;
	} else {
		x.style.display='block';
		return true;
	}
}

/*
	toggle element , use this in combination with a href
		el 	 - element to toggle
		obj	- obj of href
		aplus	 - class for visible content
		amin	 - class for hidden  content
*/
function tc(el,obj,type){
	if(type==null) type=0;
	var types=Array(Array('amin','aplus'),Array('ahide','ashow'));
	if(toggle(el)){
		obj.className=types[type][0];//'amin';
	} else {
		obj.className=types[type][1];
	}
}

function setTrans(el,trans){
	var x=GetObj(el);
	x.className=x.className.replace('trans','trans');
}

/***********************************************************************

	FIX internet explorers lack of "hover". Hover might actually
	work in IE7..hurray..

***********************************************************************/
function doElements(node){
	if (node.nodeName=="LI") {
		node.onmouseover=function() {
			this.className+=" over";
		}
		node.onmouseout=function() {
			this.className=this.className.replace(" over", "");
		}
	}

	if(node.childNodes){
		for (var i=0; i<node.childNodes.length; i++) {
			doElements(node.childNodes[i]);
		}
	}
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("mainmenu");
		if (navRoot) {
			for (var i=0; i<navRoot.childNodes.length; i++) {
				doElements(navRoot.childNodes[i]);
			}
		}
		navRoot = document.getElementById("topmenu");
		for (var i=0; i<navRoot.childNodes.length; i++) {
			doElements(navRoot.childNodes[i]);
		}
	}
}
window.onload=startList;

