var domainForCookie = "erdokovesd.hu";

function getFontSize() {
	switch (navigator.appName) {
		case "Netscape": 
		case "Konqueror":
										var propName = "font-size";
										break;
		//case "Opera":
		//case "Microsoft Internet Explorer":
		default:
										var propName = "fontSize";
	}
	if (document.body.currentStyle)
		return document.body.currentStyle[propName];
	else if (window.getComputedStyle)
		return document.defaultView.getComputedStyle(document.body,"").getPropertyValue(propName);
	return false;
}

function setFontSize(fontSize) {
	if (navigator.appName == "Opera") {
		var tagNames = [ "p", "ul", "a" ];
		ratio = Number(fontSize) / getFontSize();
	}
	document.body.style.fontSize = fontSize;
	if (navigator.appName == "Opera") {
		for (var tagName in tagNames) {
			var tags = document.getElementsByTagName(tagName);
			for (var tag in tags) {
				tag.fontSize *= ratio;
			}
		}
	}
	setCookie("fontsize", fontSize, "1", "/", domainForCookie);
}

function increaseFontSize() {
	var s;
	if (s = getFontSize())
		setFontSize((Number(s.replace("px", "")) + 1) + "px");
	//alert(document.body.style.fontSize);
}

function decreaseFontSize() {
	var s;
	if (s = getFontSize()) {
		s = Number(s.replace("px", ""));
		if (s > 8)
			setFontSize(--s + "px");
	}
	//alert(document.body.style.fontSize);
}

