var standardsize="100%";
init();

function addSize(add){
	var i;
	for(i=0; i<document.getElementsByTagName("font").length; i++) {		
		doc=document.getElementsByTagName("font").item(i);
		size=parseInt(doc.style.fontSize)+add;
		doc.style.fontSize=size+"%";
		storeSize();
	}
}

function init(){
	var i;
	for(i=0; i<document.getElementsByTagName("font").length; i++) {		
		
		doc= document.getElementsByTagName("font").item(i).style.fontSize = standardsize;
		size=getCookie("fonte");
		if (size!=null){
			c=size.split(":");
			document.getElementsByTagName("font").item(i).style.fontSize=c[0];
		}
		storeSize();
	}
}		

function drawform(){
	document.write("<a href=\"javascript:;\" onclick=\"addSize(10)\"><img name=\"larger\" src=\"../images/larger.gif\" width=\"26\" height=\"26\" border=\"0\" alt=\"aumente a letra\"></a>&nbsp;");
   	document.write("<a href=\"javascript:;\" onclick=\"addSize(-10)\"><img name=\"smaller\" src=\"../images/smaller.gif\" width=\"26\" height=\"26\" border=\"0\" alt=\"diminua a letra\"></a>");

}

function storeSize(){
		var exp = new Date();
		exp.setTime(exp.getTime() + 24*60*60*90*1000);
		size=document.getElementsByTagName("font").item(0).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 
} 

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)) 
}  