var current_id = null;
var close_val = null;
jQuery.noConflict();
var $j=jQuery;

function toggleVisibility(id,bool)
{
	// 0 close | 1 open
	if(bool)
	{
		// within a submenu the submenu must not close
		if(current_id == id)
		{	
			window.clearTimeout(close_val) 
		}
		else if(current_id!=null)
		{
			document.getElementById('head_'+current_id).style.visibility = "hidden"; 
			document.getElementById('menutitle_' + current_id).style.backgroundImage = "";
		}
		document.getElementById('head_'+id).style.visibility = "visible";  
		current_id = id;


}
	else 
	{	
		document.getElementById('head_'+id).style.visibility = "hidden";  
		document.getElementById('menutitle_' + id).style.backgroundImage = "";
	}
}


function setVisibility(id,bool)
{
	if(!bool)
	{	
		close_val = window.setTimeout("toggleVisibility("+id+","+bool+")", 100); 
	}
	else 
	{ 
		toggleVisibility(id,bool) 
	}
}


	function einblenden(div) 
	{
		document.getElementById(div).style.display="block";
		var divinfo = div + 'info';
		document.getElementById(divinfo).firstChild.nodeValue="(Normalansicht)";
		document.getElementById(divinfo).setAttribute("href",'javascript:ausblenden(\''+div+'\');');
	}

	function ausblenden(div) 
	{

			document.getElementById(div).style.display="none";
			var divinfo = div + 'info';
			document.getElementById(divinfo).firstChild.nodeValue="(...mehr Infos...)";
			document.getElementById(divinfo).setAttribute("href",'javascript:einblenden(\''+div+'\');');

	}



