PHP beginner |
|
Dat heb ik allemaal ook wel maar hij set telkens een nieuwe. Dit is m'n script:
imagedirurl = "http://www.domein.nl/images/";
function SetCookie(cookieName,cookieValue,nDays)
{
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}
function ReadCookie(cookieName)
{
var theCookie=""+document.cookie;
var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName=="") return "";
var ind1=theCookie.indexOf(';',ind);
if (ind1==-1) ind1=theCookie.length;
alert(unescape(theCookie.substring(ind+cookieName.length+1,ind1)));
return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function show(name,number) {
elem = document.getElementById(name);
var x=document.images;
if (elem.style.display == 'none') {
elem.style.display = 'block';
SetCookie(name,1,365);
} else {
elem.style.display = 'none';
SetCookie(name,0,365);
}
if (x[number].src == imagedirurl+'plus.gif') {
x[number].src=imagedirurl+'min.gif';
} else if (x[number].src == imagedirurl+'min.gif') {
x[number].src=imagedirurl+'plus.gif';
}
}
function show2(name,img) {
elem = document.getElementById(name);
elem.style.display = 'block';
var x=document.images;
x[img].src=imagedirurl+"min.gif";
}
function openMenu()
{
if (ReadCookie('rapporten') == 1)
{
show2('rapporten',1);
}
if (ReadCookie('wie') == 1)
{
show2('wie',2);
}
if (ReadCookie('navigatie') == 1)
{
show2('navigatie',3);
}
if (ReadCookie('systeem_info') == 1)
{
show2('systeem_info',4);
}
}
imagedirurl = "http://www.domein.nl/images/"; function SetCookie(cookieName ,cookieValue ,nDays ) { if (nDays==null || nDays==0) nDays=1; expire.setTime(today.getTime() + 3600000*24*nDays); document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString(); } function ReadCookie(cookieName) { var theCookie=""+document.cookie; var ind=theCookie.indexOf(cookieName); if (ind==-1 || cookieName=="") return ""; var ind1=theCookie.indexOf(';',ind); if (ind1==-1) ind1=theCookie.length; alert(unescape(theCookie.substring(ind+cookieName.length+1,ind1))); return unescape(theCookie.substring(ind+cookieName.length+1,ind1)); } function show(name,number) { elem = document.getElementById(name); var x=document.images; if (elem.style.display == 'none') { elem.style.display = 'block'; } else { elem.style.display = 'none'; } if (x[number].src == imagedirurl+'plus.gif') { x[number].src=imagedirurl+'min.gif'; } else if (x[number].src == imagedirurl+'min.gif') { x[number].src=imagedirurl+'plus.gif'; } } function show2(name,img) { elem = document.getElementById(name); elem.style.display = 'block'; var x=document.images; x[img].src=imagedirurl+"min.gif"; } function openMenu() { if (ReadCookie('rapporten') == 1) { show2('rapporten',1); } if (ReadCookie('wie') == 1) { show2('wie',2); } if (ReadCookie('navigatie') == 1) { show2('navigatie',3); } if (ReadCookie('systeem_info') == 1) { show2('systeem_info',4); } }
|