			function writeCookie(sStyle) {
					var datenow = new Date();
					var Expiry;
					var Path = '; path=/vereine/bsg'; 
					var Domain = '; domain=www.lampertheim.de';
					var Secure = ''; //; secure';	secure does somehow not work !!!
					if (readCookie('style') != sStyle)
					{
						//first set an expiration date in the past to delete the cookie
						document.cookie = 'style=; expires=Wed, 25 Feb 2004 20:00:00 GMT' + Path + Domain + Secure;
					}
					//set expiration date 1 day from now
					datenow.setTime(datenow.getTime() + Math.round(86400000));
					Expiry = '; expires=' + datenow.toGMTString();
					document.cookie = 'style=' + escape(sStyle) + Expiry + Path + Domain + Secure;
			}

			function readCookie(Name) {
				var cookies = document.cookie;
				if (cookies.indexOf(Name + '=') == -1) return null;
				var start = cookies.indexOf(Name + '=') + (Name.length + 1);
				var finish = cookies.substring(start,cookies.length);
				finish = (finish.indexOf(';') == -1) ? cookies.length : start + finish.indexOf(';');
				return unescape(cookies.substring(start,finish));
			}

			function setActiveStyleSheet(pTitle) {
				var vLoop, vLink;
				if (pTitle == '')
				{
					pTitle = 'style_standard';
				}
				for(vLoop=0; (vLink = document.getElementsByTagName("link")[vLoop]); vLoop++) {
					if(vLink.getAttribute("rel").indexOf("style") != -1 && vLink.getAttribute("title")) {
						vLink.disabled = true;
						if(vLink.getAttribute("title") == pTitle) {
							vLink.disabled = false;
						}
					}
				}
			}

			function selectStyle (sStyle) {
				//WRITE COOKIE
				writeCookie(sStyle);
				//activate style
				setActiveStyleSheet(sStyle)
			}
			
			if (document.cookie.indexOf('style=')!=-1) {
				css = readCookie('style');
				//ACTIVATE SELECTED STYLE SHEET
				setActiveStyleSheet(css)
			}


