/*
- Concept, design and implementation by
- Geberit Verwaltungs AG
- Schachenstrasse 77
- 8645 Jona
- Switzerland
- http://www.geberit.com
-
- Creater: Rolf Zęger
- Date: 25.6.2008
-
- Title: Javascript fuctions to work with cookies
*/

// =======================================================================
// Javascript fuctions to work with cookies
// =======================================================================

// 

function SetCookie(cookieName,cookieValue,nDays) {
 	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) 
	{
		document.cookie = cookieName+"="+escape(cookieValue);
	} else {
		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; 
	 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
} 
