// JavaScript Document
var RolloverButtons = {
	
	init: function(){
		var list_of_input = document.getElementsByTagName("input");
		for(var i=0; i<list_of_input.length; i++){
			var input_type = list_of_input[i].getAttribute("type");
			if(input_type == "submit" || input_type == "reset" || input_type == "button"){ 
				// Event: onmouseover
				Core.addEventListener(list_of_input[i],"mouseover",RolloverButtons.changeBackgroundOverListener);
				// Event: onmouseout
				Core.addEventListener(list_of_input[i],"mouseout",RolloverButtons.changeBackgroundOutListener);
			}
		}
	},
	
	changeBackgroundOverListener: function(event){
		RolloverButtons.changeBackgroundOver(this);
		Core.preventDefault(event);
	},
	
	changeBackgroundOutListener: function(event){
		RolloverButtons.changeBackgroundOut(this);
		Core.preventDefault(event);
	},
	
	changeBackgroundOver: function(button){
		if(window.ActiveXObject){
     		button.style.backgroundPosition = '0 -22px';
		}else{
    		button.setStyle('background-position', '0px -22px');
		}
	},
	
	changeBackgroundOut: function(button){
		if(window.ActiveXObject){
     		button.style.backgroundPosition = 'top left';
		}else{
    		button.setStyle('background-position', '0px 0px');
		}
	}
	
};

Core.start(RolloverButtons);
