// JavaScript Document

function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
		window.onload = func;
	} else {
		window.onload = function(){
			func();
			if (oldonload) oldonload();
		}
	}
}

function contador(campo, destino, total){
	if (campo.value.length>total){
		campo.value=campo.value.substring(0, total);
	} else {
		destino.value=total-campo.value.length;
	}
}

function ini(){
	var objeto=document.getElementsByTagName("form");
	if (objeto.length){
		for (i=0; i<objeto.length; i++){
			objeto[i].setAttribute("autocomplete", "off");
		}
	}
	var objeto=document.getElementsByTagName("textarea");
	if (objeto.length){
		for (i=0; i<objeto.length; i++){
			objeto[i].style.resize="none";
		}
	}
}

addLoadEvent(ini);
