//Requer: evento_tecla_numero.js
//onKeyPress="return FormataCEP(this,event);"
function FormataCEP(Campo, teclapres){
	if(!evento_tecla_numero(teclapres))return false;
	if (document.all) {
		tecla = teclapres.keyCode;
	} else {
		tecla = teclapres.which;
	}
	var vr = new String(Campo.value);
	vr = vr.replace("-", "");
	tam = vr.length + 1;
	if (tam>8 && tecla != 9 && tecla !=8 && tecla!=0){
		tam=8;
		return false;
	}
	if(tecla != 9 && tecla !=8){
		if(tam > 5)
		Campo.value = vr.substr(0, 5) + '-' + vr.substr(5, tam);
	}
}