// JavaScript Document
function switchImage() {

	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("className")!="active" && images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
				images[i].onmousedown = function(){
					//resetBtnStatus();
					
					var btn_status;
					btn_status = this.getAttribute("className");
					if(btn_status==null || btn_status==""){
						this.setAttribute("className","active");
						btn_status = "active";
					}
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
			}
		}
	}
}

function resetBtnStatus(){
	if(document.getElementsByTagName){
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++){
			images[i].setAttribute("className","");
			images[i].setAttribute("class","");
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", switchImage, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", switchImage);
}