 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *            cookies.js (c) 2003 Netvlies Webdesign & Internetcommunicatie          *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  Functies:
  setCookie(name,value,expirationdate,path)  Schrijft een cookie weg
  GetCookie(name)                            Haalt een cookie op
  DelCookie(name)                            Verwijdert een cookie

  Geschiedenis:
  26/05/2003: Stefan Thoolen: Begonnen aan dit script

  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *                    Daadwerkelijke functies/code begint hier                       *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function setCookie(cookieName, cookieValue, cookieExpires, cookiePath) {
	cookieValue = escape(cookieValue);
	if (cookieExpires == "") {
		var nowDate = new Date();
		nowDate.setMonth(nowDate.getMonth() + 6);
		cookieExpires = nowDate.toGMTString();
	}
	if (cookiePath == "") {
		cookiePath = ";Path=/";
	}
	document.cookie = cookieName + "=" + cookieValue + ";expires=" + cookieExpires + ";Path=" + cookiePath; 
}

function GetCookie(cookieName) {
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++) {
		var aCrumb = aCookie[i].split("=");
		if (cookieName == aCrumb[0]) { return unescape(aCrumb[1]); }
	}
	return null;
}

function DelCookie(cookieName) {
	document.cookie = cookieName + "=empty; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}
