//$Id: fontsizer.js 1081 2007-07-26 09:59:11Z ingvig $
//(c) Siminn.is
//create cookie for fontsize
var cookieNameTextSize = "TextSizeSiminnR3";

function setTextSizeCookie(size) {
	eraseCookie(cookieNameTextSize);
	createCookie(cookieNameTextSize, size, 365);
}

//font-size
function hugeText() {
	var bodyElement = document.getElementsByTagName('body')[0];
	bodyElement.style.fontSize = '4em';
	setTextSizeCookie("huge");
}

function bigText() {
	var bodyElement = document.getElementsByTagName('body')[0];
	bodyElement.style.fontSize = '2em';
	setTextSizeCookie("big");
}

function mediumText() {
	var bodyElement = document.getElementsByTagName('body')[0];
	bodyElement.style.fontSize = '.9em';
	setTextSizeCookie("medium");
}

function smallText() {
	var bodyElement = document.getElementsByTagName('body')[0];
	bodyElement.style.fontSize = '.7em';
	setTextSizeCookie("small");
}

function textResize() {
	var textSize = readCookie(cookieNameTextSize);
	if (textSize != null) {
		eval(textSize + "Text()");
	}
}
Event.observe(window, 'load', textResize, false);