dewboy3d,

One thing that you could do is move your redundant code into functions. For example, you could have a function called `setButtons', which sets the enabled state of the buttons as is...