
function maxCaracteres(campo, total) {
	tam = campo.value.length;
	str=0;
	str=str+tam;
	document.getElementById('caracteres_restantes').innerHTML = total - str;
	if (tam > total){
		aux = campo.value;
		campo.value = aux.substring(0,total);
		document.getElementById('caracteres_restantes').innerHTML = 0;
	}
}

function maxCaracteres2(campo, total) {
	tam = campo.value.length;
	str=0;
	str=str+tam;
	document.getElementById('cr_textarea').innerHTML = total - str;
	if (tam > total){
		aux = campo.value;
		campo.value = aux.substring(0,total);
		document.getElementById('cr_textarea').innerHTML = 0;
	}
}
