Du kan da få det af mig -- det har jeg jo stadig:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><HTML>
<HEAD>
<TITLE>Cookie-test</TITLE>
<META NAME="Generator" CONTENT="Stone's WebWriter 3.5">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="javascript" TYPE="text/javascript">
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ie5 =(document.getElementById)? true:false
ns6 = (document.getElementById && !document.all)?true:false;
function ShowHide(id){
var act = "0";
var styleObj = (ns4)? document.layers[id] : (ie4)? document.all[id].style : document.getElementById(id).style;
if(styleObj.display == "none"){
styleObj.display = "";
act = "1";
}else{
styleObj.display = "none"
}
updateCookie(id,act);
}
function updateCookie(id,act){
var found = false;
if(document.cookie){
var oldCook = document.cookie;
var tmp = oldCook.split(";");
for (i=0;tmp.length>i;i++){
if (tmp[i].indexOf("ShowHide=")!=-1){
newCook = tmp[i].substring(9+tmp[i].indexOf("ShowHide=")).split(":");
found = true;
break;
}
}
var updated = false;
if (found){
for (i=0;newCook.length>i;i++){
if (newCook[i].indexOf(id+"-")==0){
newCook[i] = id+"-"+act;
updated = true;
break;
}
}
}else{newCook = new Array();}
if(!updated){
newCook[newCook.length] = id+"-"+act;
}
}else{
newCook = new Array();
newCook[0] = id+"-"+act;
}
var exp = new Date();
exp.setYear(exp.getFullYear()+1);//cookien gælder et år
var txt = "ShowHide="+newCook.join(":")+"; expires="+exp.toGMTString()+"; path=/; domain=.surfersinfo.dk";
document.cookie = txt;
}
function updateShowHide(){
if (document.cookie){
var tmp = document.cookie.split(";");
var cook = false;
for (i=0;tmp.length>i;i++){
if (tmp[i].indexOf("ShowHide=")!=-1){
newCook = tmp[i].substring(9+tmp[i].indexOf("ShowHide=")).split(":");
cook = true;
break;
}
}
if(cook){
for (i=0;newCook.length>i;i++){
id = newCook[i].substring(0,newCook[i].indexOf("-"));
act = newCook[i].charAt(newCook[i].length-1);
var styleObj = null;
if(ns4){
styleObj = document.layers[id];
}else if(ie4){
if (document.all[id]){styleObj = document.all[id].style;}
}else{
if (document.getElementById(id)){styleObj = document.getElementById(id).style;}
}
if (styleObj){
if(act==0){
styleObj.display = "none";
}else{
styleObj.display = "";
}
}
}
}
}
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" ONLOAD="updateShowHide()">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD ONCLICK="java script:ShowHide('menu_box_1')" CLASS=menu_box_0 TITLE="vis / gem" BGCOLOR="#999999">klik
her </TD>
</TR>
<TR>
<TD ONCLICK="java script:ShowHide('menu_box_2')" CLASS=menu_box_0 TITLE="vis / gem" BGCOLOR="#999999">klik
her (2)</TD>
</TR>
</TABLE>
<DIV NAME="menu_box_1" ID="menu_box_1" STYLE="display:block;">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD BGCOLOR="#FF6600">OLAV1</TD>
</TR>
</TABLE>
</DIV>
<DIV NAME="menu_box_0" ID="menu_box_0" STYLE="display:block;">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD BGCOLOR="#FF6600">OLAV2</TD>
</TR>
</TABLE>
</DIV>
</BODY>
</HTML>
Som helt html-dokument ...
-- du skal selvfølgelig tilpasse navne m.m.