/* ロード完了時の処理 */
addEvent(window, "load", function() {
	for (var i = 0; i < document.getElementById("button").getElementsByTagName("input").length; i++) {(function(){
		var theButton = document.getElementById("button").getElementsByTagName("input")[i];
		var theInterval;
		addEvent(theButton, "mouseover", function() {
			clearInterval(theInterval);
			var theDate = new Date();
			var theTime = theDate.getTime();
			var n = 0;
			var theDuration = 0.3;
			theInterval = setInterval(function() {
				theDate = new Date();
				n = n + ((theDate.getTime() - theTime) / 1000 / theDuration);
				if (n < 1) {
					setOpacity(theButton, 1 - 0.5 * (1 - Math.pow(n - 1, 2)));
				} else {
					setOpacity(theButton, 0.5);
					clearInterval(theInterval);
				}
				theTime = theDate.getTime();
			}, 100);
		});
		addEvent(theButton, "mouseout", function() {
			clearInterval(theInterval);
			var theDate = new Date();
			var theTime = theDate.getTime();
			var n = 0;
			var theDuration = 0.2;
			theInterval = setInterval(function() {
				theDate = new Date();
				n = n + ((theDate.getTime() - theTime) / 1000 / theDuration);
				if (n < 1) {
					setOpacity(theButton, 0.5 + 0.5 * Math.pow(n, 2));
				} else {
					setOpacity(theButton, 1);
					clearInterval(theInterval);
				}
				theTime = theDate.getTime();
			}, 100);
		});
	})();}
});
