One way to do it (and likely to be how it was done) is with large html boxes (one for each background) covering the page area that will contain the background images. Apply the show/hide layer to the html boxes. Once you have that, create a CSS style for each background image and apply to each html box. Now create your selection buttons and link to the layers.
I haven’t tried this specifically, but it should work.
Just realized another option where the show/hide layer could be skipped altogether by using more than one CSS style sheet. For each button you would call up the appropriate style sheet for each background. Coding needed, but not too dificult.