Your proggie isn't working coz it shouldn't work!
Here are my 2 cents:
[list=1][*]Go and read about the cookies, because if you want them to stay in the clients computer, you have to define the expires
value for each cookie and giving it a future date in GMT. So, the general syntax would look like this:
document.cookie = "newCookie=myVal; expires=a date in GMT"
after doing this, then you could be sure that the cookie stays in the clients computer till the time expires or you delete it yourself ( by reseting the expires date)[*]Getting the cookies in this way ( using the indexOf function ) is a real torture! I would have recommend the split
function. You could use it in this way:
myCookies = document.cookie.split("; "); // Note the space that I added after the semicolon in the split function, it SHOULD be there and you SHOULD put that space when you want to register a new cookie ( See the previous code, you see a space between the ; and the expires property
cookieJar = new Array();
for ( i=0; i<myCookies.length; i++)
cookieJar[i] = new Array();
cookieJar[i]["name"] = myCookies[i].split("=");
cookieJar[i]["value"] = myCookies[i].split("=");