	/*
		TEXT SIZE FUNCTIONS
	*/
	function setCookie(cookieName,cookieValue,nDays) {
		var today = new Date();
		var expire = new Date();
		if (nDays==null || nDays==0) nDays=1;
		expire.setTime(today.getTime() + 3600000*24*nDays);
		document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
	}
	function eraseCookie(name) 	{
		setCookie(name,"",-1);
	}

	function setNormalTextSize(){
		eraseCookie("basefontsize");
		bodyelem.style.fontSize = "76%";
	}
	function scaleText(percentage, set_cookie){
		/* scale text only if percentage is not equal to default font size */
		defaultfontsize = "76"; /* set to font-size on body element */
		bodyelem = document.getElementsByTagName("body")[0];

		if (percentage != defaultfontsize){
			bodyelem.style.fontSize = percentage + "%";
		}
		if ((percentage == defaultfontsize)&&(set_cookie)){
			bodyelem.style.fontSize = percentage + "%";
		}
		if (set_cookie){
			setCookie("basefontsize", percentage, 365);
		}

	}
	function inspectFontSizeCookie(){
		value = readCookie("basefontsize");
		if (value){
			scaleText(value, set_cookie=false);
		}
	}

	function readCookie(name){
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++){
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}