function manageContent(divId, imgElement) 
{
//    alert("sidebar visibility: " + window.name);
    
    if (window.name == "invisible") {
//        alert("onload toggling-check ...");
        toggleSidebar(divId, imgElement);
    }
}

/**
 * Manages the popoutSidebar toggling
 * 
 * @param   string  divId   id of the div that will be toggled from visible to invisible and vice versa
 * @param   object  imgElement  image-element that is used as toggler-graphic
 */
function toggleSidebar(divId, imgElement)
{
//    alert("toggling sidebar ...");
    
	var divsuffix 	=	"_show";
	var imgDown		= 	"images/arrow-l.gif";
	var imgUp		= 	"images/arrow-r.gif";
	
	div = document.getElementById(divId);

	if(div.className.indexOf(divsuffix) == -1)
	{
		div.className = div.className + divsuffix;
		imgElement.src = imgUp;
		window.name = 'visible';
	} 
	else 
	{
		div.className = div.className.replace(divsuffix,"");
		imgElement.src = imgDown;
		window.name = 'invisible';
	}
}

