/* ロード完了時の処理 */
addEvent(window, "load", function() {
	for (var i = 0; i < document.getElementsByTagName("a").length; i++) {(function(){
		var theA = document.getElementsByTagName("a")[i];
		var theAs = new Array();
		for (var j = 0; j < document.getElementsByTagName("a").length; j++) {
			if (theA.href == document.getElementsByTagName("a")[j].href) {
				theAs[theAs.length] = document.getElementsByTagName("a")[j];
			}
		}
		if (theA.href == location.href) {
			theA.className = "current";
		}
		var theInterval;
		var animating = false;
		addEvent(theA, "mouseover", function() {
			if (theA.className != "current") {
				clearInterval(theInterval);
				var theDate = new Date();
				var theTime = theDate.getTime();
				if (animating) {
					var n = 0.5;
				} else {
					var n = 0;
				}
				var theDuration = 0.25;
				animating = true;
				theInterval = setInterval(function() {
					if (theA.className == "current") {
						clearInterval(theInterval);
						return;
					}
					theDate = new Date();
					n = n + ((theDate.getTime() - theTime) / 1000 / theDuration);
					if (n < 1) {
						for (var i = 0; i < theAs.length; i++) {
							if (theAs[i].className == "flip") {
								setOpacity(theAs[i], 0.6 + 0.4 * n);
							} else {
								setOpacity(theAs[i], 1 - 0.4 * n);
							}
						}
					} else {
						for (var i = 0; i < theAs.length; i++) {
							if (theAs[i].className == "flip") {
								setOpacity(theAs[i], 1);
							} else {
								setOpacity(theAs[i], 0.6);
							}
						}
						animating = false;
						clearInterval(theInterval);
					}
					theTime = theDate.getTime();
				}, 100);
			}
		});
		addEvent(theA, "mouseout", function() {
			if (theA.className != "current") {
				clearInterval(theInterval);
				var theDate = new Date();
				var theTime = theDate.getTime();
				if (animating) {
					var n = 0.5;
				} else {
					var n = 0;
				}
				var theDuration = 0.25;
				animating = true;
				theInterval = setInterval(function() {
					if (theA.className == "current") {
						clearInterval(theInterval);
						return;
					}
					theDate = new Date();
					n = n + ((theDate.getTime() - theTime) / 1000 / theDuration);
					if (n < 1) {
						for (var i = 0; i < theAs.length; i++) {
							if (theAs[i].className == "flip") {
								setOpacity(theAs[i], 1 - 0.4 * n);
							} else {
								setOpacity(theAs[i], 0.6 + 0.4 * n);
							}
						}
					} else {
						for (var i = 0; i < theAs.length; i++) {
							if (theAs[i].className == "flip") {
								setOpacity(theAs[i], 0.6);
							} else {
								setOpacity(theAs[i], 1);
							}
						}
						animating = false;
						clearInterval(theInterval);
					}
					theTime = theDate.getTime();
				}, 100);
			}
		});
	})();}
});
