Thermooptical switching in a one-dimensional photonic crystal