	/** 
	 * Function to set a browser cookie with the name of cookieName, a value of
	 * cookieVal, and valid for the specified number of days.
	 */
	function setCookie(cookieName, cookieVal, days) {
		if (!days) days = 1;
		var expDate = new Date();
		expDate.setTime(expDate.getTime() + days*24*60*60*1000);
		var expDateString = expDate.toGMTString();

		document.cookie = cookieName + "="+escape(cookieVal) + ";expires="+expDateString;

	}
	
	/** 
	 * Function to get a browser cookie with the name of cookieName.
	 */
	function getCookie(cookieName) {
		cookieName = cookieName+"=";
		var allCookies = document.cookie;
		if (allCookies.length > 0) {
			var start = allCookies.indexOf(cookieName);
			if (start != -1) {
				start = start + cookieName.length;
				var end = allCookies.indexOf(";",start);
				if (end == -1) end = allCookies.length;
				return unescape(allCookies.substring(start,end));
			}
		}
		return null;		
	}
