I have this piece of code which works great but, I would like the div to remain open if clicked on when the page is refreshed. ex. the user views a link and then returns to the previous page. The link is an image and the page(div) is a menu of images.
<div id="block1-1">
<a name="works"></a>
<a href="#block1-1" onclick="toggle_visibility('block1-1');"><h2>works</h2></a>
</div>
<script type="text/javascript">
function toggle_visibility(id){
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
</script>