var standardsize='90%';
onload = init;

function addSize(add){

	doc=document.getElementById( 'miolo' );
	size=parseInt(doc.style.fontSize)+add;

	doc.style.fontSize=size+"%";

	storeSize();


}

function init(){

	size=getCookie("fonte");

	if (size!=null){
 		document.getElementById( 'miolo' ).style.fontSize=size;
	}else{
 		document.getElementById( 'miolo' ).style.fontSize = standardsize;
	}

	storeSize();
}

function drawform10(){
	document.write("Letras: <a href=\"#\" onclick=\"addSize(10)\"><img name=\"mais\" hspace=\"0\" vspace=\"0\" src=\"/img/2006/icone_letra_mais.jpg\" width=\"25\" height=\"22\" border=\"0\" alt=\"aumente a letra\"></a>");
   	document.write("<a href=\"#\" onclick=\"addSize(-10)\"><img name=\"menos\" hspace=\"0\" vspace=\"0\" src=\"/img/2006/icone_letra_menos.jpg\" width=\"25\" height=\"22\" border=\"0\" alt=\"diminua a letra\"></a>");

}

function storeSize(){
	var exp = new Date();
	exp.setTime(exp.getTime() + 24*60*60*90*1000);
	size=document.getElementById( 'miolo' ).style.fontSize;
	setCookie("fonte",size,exp);
}

function setCookie(name, value, expires, path, domain, secure) {
	var curCookie = name + "=" + escape(value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "")
	//document.cookie = curCookie
	document.cookie = curCookie
	//window.cookie = curCookie
}

function getCookie(name) {

	var prefix = name + "="
	var cookieStartIndex = document.cookie.indexOf(prefix)
	if (cookieStartIndex == -1)
	return null
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex +
	prefix.length)
	if (cookieEndIndex == -1)
	cookieEndIndex = document.cookie.length
	return unescape(document.cookie.substring(cookieStartIndex +
	prefix.length,
	cookieEndIndex))
/*
	text = window.cookie;
	nam = "fonte=";
	fim = window.cookie.indexOf(";", nam.length );
	return unescape(text.substring( nam.length, fim ))
*/

}