function showDiv(elem) {
	if (document.getElementById(elem).style.display == 'none')
		document.getElementById(elem).style.display = 'block';
	else
		document.getElementById(elem).style.display = 'none'
		window.focus();
}


makeshowhidenum = 0;
function makeshowhide(id,state,visiblestate,tshow,thide) {
    var hstate;
    var sstate;
    var hidehref;
    var showhref;
    if (!thide) thide = 'Mniej';
    if (!tshow) tshow = 'Wiecej';
    if (!visiblestate) visiblestate = 'block';
    showhref = "javascript: unrolldiv('"+id+"', '"+visiblestate+"');";
    hidehref = "javascript: rolldiv('"+id+"');";
    if (!(state > 0)) {
        sstate = 'display: block;';
        hstate = 'display: none;';
    } else  {
        hstate = 'display: block;';
        sstate = 'display: none;';
    }
    document.write("<a href=\""+hidehref+"\" class='hide' style='"+hstate+"' id='"+id+"_hide'><span>"+thide+"</span></a>");
    document.write("<a href=\""+showhref+"\" class='show' style='"+sstate+"' id='"+id+"_show'><span>"+tshow+"</span></a>");
} 

/* insane */
function setSelectedMenuPosition(sObjectId) {
	var oUl = document.getElementById(sObjectId);
	var location = window.location.toString();
	for (var i = 0; i < oUl.childNodes.length; i++) {
		var href = oUl.childNodes[i].childNodes[0].href.toString();
		if (href.substring(href.lastIndexOf("/"), href.length).indexOf(location.substring(location.lastIndexOf("/"), location.length)) != -1)
			oUl.childNodes[i].className = "selected";
	}
}

