Convert MC Button Code to Reusable Function?

Basically I’m using the code below to change the colour of the text in a movie clip that I’m using as a button. This works fine, but I have 8 buttons in my navigation and at the moment have to duplicate this code for each one. Can someone help me turn the colour change code into a function that I can reuse?

var up = "0xC5B9B3";
var over = "0xC6006F";

_root.nav.button_1.onRollOver = function() {
    _root.nav.button_1.dyntext_1.textColor = (over);
}
_root.nav.button_1.onRollOut = function() {
    _root.nav.button_1.dyntext_1.textColor = (up);
}