So far you have done the same thing with your code each time.  It is also possible to do different things depending on conditions.  For example, you used two functions to change that image but you could use one.  It will change a picture to another (or if it has already been changed it will change it back).