the problem is a user should be able to hide/display a certain div which is located on the index and viewable from the entire site.
I found a very helpful code online but it still has one problem, as soon as a internal link or button is clicked it resets the hidden div to it's default status (for example, a user hides the div, then clicks a other button and then the div just reapers because display is it's current default status).
var e = document.getElementById(id);
e.style.display = ((e.style.display!='none') ? 'none' : 'block');
<span onclick="toggle_visibility('divname');"> hide/display </span>
<div id="divname" >
I hope somebody has the time & experience to help me.