If you want to toggle the the visibility for two layers, you could try using a visible flag and have each layer use that flag to toggle their visible property. Please note that this will work fine for two layers, but if you need to toggle the visibility for more than two layers, you might need something similar to the 'Switching Basemaps' sample.
I have modified your file and attached it to show you what I mean.