JS Hidden Menu...with Cookies

He has: 1,380 posts

Joined: Feb 2002

Hey...I basically took the following from DynamicDrive:

var head="display:''"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
}
else{
foldercontent.style.display="none"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained
'

But now...my client wants the menu to reopen itself on different pages. For example, you click and open "Programs" and then you click a subitem. When the page reopens...the "Programs" menu is still open.

I know this has to be done with cookies and such...but I'm dumb with JS. You can see the page at terrifictots.com and see what I'm talking about. Any help is appreciated. (BTW...I tried myself, and the menu refused to even open...so, yea)

Thanks