
function FormatarCep(campo,e) {
	var cod="";
	if(document.all) {cod=event.keyCode;} else {cod=e.which;}
	if(cod == 08) return;
	if(cod == 0) return;
	if (cod < 48 || cod > 57) {
		if (cod < 45 || cod > 57) 
			alert("Digite somente caracteres numéricos!");
			cod=0;
		campo.focus(); return false;
	}
	tam=campo.value.length; 
	if(tam > 8) return false;
	var caract = String.fromCharCode(cod);
	if(tam == 5) {
		campo.value+="-"+caract; return false;
	}
	campo.value+=caract; return false;
}

