Hide and show div

hello,
this is a function to hide and show div

function ToggleMaktoba (titleImg){
		// the id of the content element from the id of the title element
	var contentID = titleImg.id.replace (/title/, "content");
	var contentDiv = document.getElementById (contentID);
	
	if (contentDiv.style.display == "none") {
		titleImg.src = "images/collapse.gif";
		contentDiv.style.display = "block";
	}
	else {
		titleImg.src = "images/expand.gif";
		contentDiv.style.display = "none";
	}

	return false;
}

the problem that i have is that this div is viewed on every page on the site,
so if i hide it i want it to stay hidden even when navigating threw pages. if i choose to hide it, it stays hidden, and if i chose to show it, it stays shown. any help would be wonderful.
thanks

You’ll have to set a cookie to remember that it’s hidden, and read that cookie when each page loads to see if you need to hide the div again.

http://www.quirksmode.org/js/cookies.html