function setCookie(cookie) {
	var expdate = new Date();
	var cookieExpires = new Date();
	cookieExpires.setTime (expdate.getTime() + 365 * (24 * 60 * 60 * 1000)) //+365 days
    document.cookie = cookie + "; expires=" + cookieExpires.toGMTString();
}

function readTheCookie(the_info) {
	var name = "provinciegroningenintranet.nl";
	if (document.cookie == '') { // there's no cookie, so go no further
 		return false;
	} 
	else {	   // there is a cookie
		var firstChar, lastChar;
		var theBigCookie = document.cookie;
		firstChar = theBigCookie.indexOf(name);
		// find the start of 'name'
		if(firstChar != -1)  {
			// if you found the cookie
			firstChar += name.length + 1;

			// skip 'name' and '='
			lastChar = theBigCookie.indexOf(';', firstChar);

			// Find the end of the value string (i.e. the next ';').
			if(lastChar == -1) lastChar = theBigCookie.length;
	    	
	    	var the_cookie = unescape(theBigCookie.substring(firstChar, lastChar));

			// separate the values from the cookie name
			var broken_cookie = the_cookie.split("=");
			var the_values = broken_cookie[1];
	
			// break each name:value pair into an array
			var separated_values = the_values.split("&");
	
			// loop through the list of name:values and load
			// up the associate array
			var property_value = "";
			for (var loop = 0; loop < separated_values.length; loop++) {
				property_value = separated_values[loop];
				var broken_info = property_value.split(":");
				var the_property = broken_info[0];
				var the_value = broken_info[1];
				the_info[the_property] = the_value;
			}
		} 
		else {
		   	// If there was no cookie of that name, return false.
			return false;
		}
	}
}