// JavaScript Document
// File: light_bulb.js
// Purpose: Use getElementById to toggle a 'light switch' on and off
// Author: Steven Grindle
// Created: 1 Mar 2008

function toggle_switch(){ //If the light is on the switch is enabled to turn it off and vice versa
	if(document.getElementById("light_switch").value=="Turn the lights on"){
		document.getElementById("bulb").src="images/LightBulb.gif";
		//"bulb" is the ID of the image of the light bulb
		document.getElementById("body_list").style.backgroundColor = "#eeeeee"
		//"body_list" is the ID of the <body> tag
		document.getElementById("light_switch").value="Turn the lights off";
		document.getElementById("cheshire").src = "images/CheshireCatAnimated.gif"; 
		document.getElementById("pi_squared").src = "images/pi_squared.gif"; 	
		document.getElementById("w3c_xhtml10").src = "images/valid-xhtml10-blue.gif"; 			
		//"light_switch" is the ID of the <input type="button" ... />
	}else{
		document.getElementById("bulb").src="images/LightBulbOffV2.gif";
		document.getElementById("body_list").style.backgroundColor = "#666666"
		document.getElementById("light_switch").value="Turn the lights on";
		document.getElementById("cheshire").src = "images/cheshire_cat_animated_off.gif";
		document.getElementById("pi_squared").src = "images/pi_squared_off.gif";
		document.getElementById("w3c_xhtml10").src = "images/valid-xhtml10-blue_off.gif"; 			
	}
}
