Не робит
код теперь выглядит так, может что-то не так.
CODE://Cookie
function setCookie(name, value, lifedays) {
var expdate = new Date();
expdate.setTime(expdate.getTime() + (86400000 * lifedays));
var curCookie=name+"="+escape(value)+((lifedays)?"":";expires="+expdate.toGMTString());
document.cookie=curCookie;
}
function getAllCookies() {
var allcookies = new Array();
var cookregexp = /(?:; ?|^)([^=]+)(?:=([^;]*))?/g;
var st = document.cookie;
var cookie = cookregexp.exec(st);
while (cookie)
{
allcookies.push([cookie[1],cookie[2]]);
cookie = cookregexp.exec(st);
}
return allcookies;
}
function Restore()
{
var cookarr = getAllCookies();
for (var c in cookarr)
{
var match;
if (match=/(.+)_(.+)show/.exec(c[0]))
{
if (c[1]=="1")
Show(match[1],match[2]);
else
Hide(match[1],match[2]);
}
}
}
//End cookie
function Whos(id,idi) {
if (document.getElementById(id).style.display == "none"||document.all[id].visibility == "hidden"){
Show(id,idi)
}
else{Hide(id,idi)}
}
function Show(id,idi) {
//Cookie
setCookie(id+"_"+idi+"show","1",30);
// End Cookie
if (document.getElementById) {
itm = document.getElementById(id);
itm.style.display = "block";
}
if (document.all){
itm = document.all[id];
itm.visibility = "show";
}
document[idi].src = "./templates/ForumTblock.org.ru/im/hide_f.gif";
}
function Hide(id,idi) {
//Cookie
setCookie(id+"_"+idi+"show","0",30);
// end cookie
if (document.getElementById) {
itm = document.getElementById(id);
itm.style.display = "none";
}
if (document.all){
itm = document.all[id];
itm.visibility = "hidden";
}
document[idi].src = "./templates/ForumTblock.org.ru/im/show_f.gif";
} |