﻿/* ロールオーバー
-------------------------------------------------- */

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(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."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
} else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

/* 閉じるボタン
-------------------------------------------------- */

$(function() {
	$("#close").click(function() {
		window.close();
	});
});

/* プルダウン
-------------------------------------------------- */

$(function() {
	$("#show dl").hide();
	$("#show").hover(
		function () {
			if($.browser.msie){
				$("#show dl").show();
			}else{
				$("#show dl").fadeIn(200);
			}
		},
		function () {
			if($.browser.msie){
				$("#show dl").hide();
			}else{
				$("#show dl").fadeOut(200);
			}
		}
	);
});

/* イージングの定義
-------------------------------------------------- */
jQuery.easing.quart = function(x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

/* ページトップ
-------------------------------------------------- */
function scroll() {
		if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {
		sctop = document.body.parentNode.scrollTop;
	}
	else if(window.pageYOffset){
		sctop = window.pageYOffset;
		} else {
		sctop = document.body.scrollTop;
	}
	if(sctop){
		scup = Math.ceil(sctop*.2);
		scrollBy(0,-scup);
		if (sctop-scup) setTimeout("scroll()",15);
	}
}

