var minFontSize = 1;
var maxFontSize = 5;
var curFontSize = 1;

function increaseFontSize(inc) {
	if( curFontSize <= maxFontSize ) {
		var p = document.getElementsByTagName('p');
		//var p = document.getElementsByTagName('body');
		for(i=0;i<p.length;i++) {
			if(p[i].style.fontSize) {
				var s = parseFloat(p[i].style.fontSize.replace("em",""));
			} else {
				var s = 1.0;
			}
			s += 0.2;
			p[i].style.fontSize = s+"em"
		}
		if (inc) {
			curFontSize++;
			YAHOO.util.Cookie.set("fontSize", curFontSize); 
		}
	}
}

function decreaseFontSize(inc) {
	if( curFontSize >= minFontSize) {
		var p = document.getElementsByTagName('p');
		//var p = document.getElementsByTagName('body');
		for(i=0;i<p.length;i++) {
			if(p[i].style.fontSize) {
				var s = parseFloat(p[i].style.fontSize.replace("em",""));
			} else {
				var s = 1.0;
			}
			s -= 0.2;
			p[i].style.fontSize = s+"em"
		}
		if (inc) {
			curFontSize--;
			YAHOO.util.Cookie.set("fontSize", curFontSize);
		}
	}
}


function setDefaultFontSize() {
	var dflt = YAHOO.util.Cookie.get("fontSize");
	if (dflt) {
		curFontSize = dflt;
		for ( var i = curFontSize; i >= minFontSize; i--) {
			increaseFontSize(0);
		}
	}
}
