Replace these two functions:
Code:
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}
With these:
Code:
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
var date = new Date();
date.setTime(date.getTime()+(10*86400000));
var expires = "; expires="+date.toGMTString();
document.cookie=window.location.pathname+"="+selectedItem+expires;
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
var date = new Date();
date.setTime(date.getTime()+(10*86400000));
var expires = "; expires="+date.toGMTString();
document.cookie=(get_cookie(uniqueidn)==""? uniqueidn+"=1" : uniqueidn+"=0")+expires;
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
Notice the two red 10's in the above new functions. These set the two cookies (the script already required two cookies) for 10 days. Increase or decrease as desired. Both values should be set to the same number though.
Bookmarks