     
var onloadFunctions = new Array();


function registerOnloadFunction(func) {
	onloadFunctions[onloadFunctions.length] = func;
}


function initializePage() {
	for (var i = 0; i < onloadFunctions.length; i++) {
		onloadFunctions[i]();
	}
}


function initializeAds() {}

registerOnloadFunction(initializeAds);



function getCookie(nameOfCookie) {
	if (document.cookie.length > 0){
		var begin = document.cookie.indexOf(nameOfCookie+"=");
		if (begin != -1){
			begin += nameOfCookie.length+1;
			var end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));
		}
	}
	return null;
}

function setCookie(nameOfCookie, value, expiredays) {
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = nameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString() + ";path=/");
}


function initializeFontSize() {
	var sparadStorlek = getCookie('BorealisFontSize');
	if (sparadStorlek) {
		updateDocumentFontSize(sparadStorlek);
	}
}

registerOnloadFunction(initializeFontSize);

function changeFontSize(nyStorlek) {
	updateDocumentFontSize(nyStorlek);
	setCookie('BorealisFontSize',nyStorlek,1000);
}
function updateDocumentFontSize(storlek) {
	if (storlek == "S") {
		documentFontSize = "10px";
	}
	if (storlek == "M") {
		documentFontSize = "12px";
	}
	if (storlek == "L") {
		documentFontSize = "16px";
	}
	var artArea = document.getElementById("contentLeft");
	var newsArea = document.getElementById("news_body");
	var newsHeader = document.getElementById("news_header");
	var desc1 = document.getElementById("ind_description1");
	var desc2 = document.getElementById("ind_description2");
	var desc3 = document.getElementById("ind_description3");
	var desc4 = document.getElementById("ind_description4");
	var section_body = document.getElementById("section_body");
	var section_body_1 = document.getElementById("section_body_1");
	var sitemap_content = document.getElementById("sitemap_content");
	if (artArea) {
		artArea.style.fontSize = documentFontSize;
	}
	if (newsArea) {
		newsArea.style.fontSize = documentFontSize;
	}
	if (newsHeader) {
		newsHeader.style.fontSize = documentFontSize;
	}
	if (desc1) {
		desc1.style.fontSize = documentFontSize;
	}
	if (desc2) {
		desc2.style.fontSize = documentFontSize;
	}
	if (desc3) {
		desc3.style.fontSize = documentFontSize;
	}
	if (desc4) {
		desc4.style.fontSize = documentFontSize;
	}
	if (section_body) {
		section_body.style.fontSize = documentFontSize;
	}
	if (section_body_1) {
		section_body_1.style.fontSize = documentFontSize;
	}	
	if (sitemap_content) {
		sitemap_content.style.fontSize = documentFontSize;
	}
}

