window.onload = function() {
	var inputs = document.getElementsByTagName('input');
	var hoverPattern = /\bhover\b/;
	var addHover = function() {
		if(!this.className.match(hoverPattern))
			this.className = this.className + " hover";
	}
	var removeHover = function() {
		this.className = this.className.replace(hoverPattern, "");
	}
	for (var i = 0; i < inputs.length; i++) {
		var input = inputs[i];
		if(input.type == 'submit' || input.type == 'button') {
			input.onmouseover = addHover;
			input.onmouseout = removeHover;	   
		}
	}
};

