
function toolbox_nodes_getActiveLink(root,url) {
			root=document.getElementById(root);
			var refList = root.getElementsByTagName("a");
			var i = 0;
			while(refList[i]) {
			if (refList[i].href == url) {
			return refList[i];
			}
			i++;
			}
			
			}
			
function activateMenu(root,url) {
	
	hnode = toolbox_nodes_getActiveLink(root,url);
	hnode.className = "active";
	
}

function pb_changeActSubmit(formName,actValue,message) {
	if (message) {
		if (confirm(message)) {		
			document.forms[formName].elements['_action'].value=actValue;
			document.forms[formName].submit();
		}
	} else {
			document.forms[formName].elements['_action'].value=actValue;
			document.forms[formName].submit();
	}
}


function toggleLayer(layerID) {

layer = document.getElementById(layerID);
if (layer.style.display!='block') {
	layer.style.display='block';
} else {
	layer.style.display='none';
}

}







function  toolbox_listmenu(rootID) {
			this.rootID = rootID;
			this.rootElement = document.getElementById(rootID);
			this.init = toolbox_listmenu_init;
			this.expandParents = toolbox_listmenu_expandParents;
			this.expandSubElements = toolbox_listmenu_expandSubElements
			this.collapseSubElements = toolbox_listmenu_collapseSubElements
			this.activateLink = toolbox_listmenu_activateLink
			}
			
			function toolbox_listmenu_activateLink() {
				var active = toolbox_nodes_getActiveLink(this.rootElement,document.location);
				if (active) {
				active.className = "active";
				this.expandParents(active);
				this.expandSubElements(active.parentNode,"ul");
				}
			}
			
			
			
			function toolbox_listmenu_collapseSubElements(obj,coltype) {
			var i=0;
			var checkName = new String(coltype);
			var colObj = obj.childNodes;
			while(colObj[i]) {
			colName = new String(colObj[i].nodeName);
			if (colName.toLowerCase() == checkName.toLowerCase()) {
			colObj[i].style.display="none";
			}
			i++;
			}
			}
			
			function toolbox_listmenu_expandSubElements(obj,coltype) {
			var i=0;
			var checkName = new String(coltype);
			var colObj = obj.childNodes;
			while(colObj[i]) {
			colName = new String(colObj[i].nodeName);
			if (colName.toLowerCase() == checkName.toLowerCase()) {
			colObj[i].style.display="";
			}
			i++;
			}
			}
			
			function toolbox_listmenu_toggleSubElements(obj,coltype) {
			var i=0;
			var checkName = new String(coltype);
			var colObj = obj.childNodes;
			while(colObj[i]) {
			colName = new String(colObj[i].nodeName);
			if (colName.toLowerCase() == checkName.toLowerCase()) {
			toolbox_style_toggleDisplay(colObj[i]);
			}
			i++;
			}
			}
			
			function toolbox_listmenu_expandParents(obj) {
			while(obj.parentNode) {
			if (obj.parentNode.id == this.rootID) { 
			return; 
			} else {
			obj.parentNode.style.display='';
			obj = obj.parentNode;
			}
			}
			
			}
			
			function toolbox_listmenu_init() {
			ulObj = this.rootElement;
			liObj = ulObj.getElementsByTagName("li");
			var i=0
			while(liObj[i]) {
			this.collapseSubElements(liObj[i],"ul");
			myLink = toolbox_nodes_getFirstOf(liObj[i],"a");
			toolbox_listmenu_attachEvent(myLink);
			i++;
			}
			
			this.activateLink();
			
			}
			

			
			function toolbox_listmenu_attachEvent(obj) {
			if (obj){
			var p =  toolbox_nodes_getFirstParentByType(obj,'LI');
			//alert(p.nodeName);
			obj.onclick = function() { toolbox_listmenu_toggleSubElements(p,"ul") }
			}
			}
			
			
			
			
			
			
			
			
			
			
			
			function toolbox_style_toggleDisplay(obj) {
			if (obj.style.display=='none') {
			obj.style.display = '';
			} else {
			obj.style.display='none';
			}
			}
			
//# DOM
			
			function toolbox_nodes_getFirstOf(obj,ntype) {
			chElements = obj.getElementsByTagName(ntype);
			return chElements[0];
			}
			
			function toolbox_nodes_getFirstParentByType(root,ntype) {
				var p = root.parentNode;
				while(p.nodeName!=ntype) {
					
					p = p.parentNode;
				}
				return p;
		
			}

			
			
			function toolbox_nodes_getActiveLink(root,url) {
			var refList = root.getElementsByTagName("a");
			var i = 0;
			while(refList[i]) {
			if (refList[i].href == url) {
			return refList[i];
			}
			i++;
			}
			
			}