/////////////////////////////////////////////////////////////
//
// Author Scott Herbert (www.scott-herbert.com)
//
// Version History
// 1 (19-June-2011) Inital release on to Google code.
//
//
//
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i < ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
}
function displayNotification()
{
document.writeln(" Om te kunnen volgen wat u en andere bezoekers belangrijk vinden, gebruikt www.merlijn.nu cookies. Wilt u meer weten over cookies? Meer informatie ");
}
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value+ "; path=/";
// set cookiewarning to hidden.
var cw = document.getElementById("cookiewarning");
if(cw != null)
{
cw.innerHTML = "";
}
}
function checkCookie()
{
var cookieName="jsCookieCheck";
var cookieChk=getCookie(cookieName);
if (cookieChk!=null && cookieChk!="")
{
// the jsCookieCheck cookie exists so we can assume the person has read the notification within the last year
setCookie(cookieName,cookieChk,365); // set the cookie to expire in a year.
}
else
{
// No cookie exists, so display the lightbox effect notification.
displayNotification();
}
}
checkCookie();