//ドロップダウンメニュー
$(function(){
	$("#menu").droppy();
});


//サブナビ現在地
$(function(){
	$("#sNavi li a").each(function(){
		var current = $(this).attr("href");
		if(current == location.pathname){
			$(this).parent().addClass("active");
		}
	});
});

//ロールオーバー
$(function(){
	$("img.rollover").mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	})
})


//スムーズスクロール
$(function(){
	$("a[href*='#']").easingScroll({
	easing: "easeInOutExpo",duration: 800
	});
});

//外部ウィンドウ

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
((anchor.getAttribute("rel") == "external nofollow") || (anchor.getAttribute("rel") == "nofollow external") || (anchor.getAttribute("rel") == "external")))
anchor.target = "_blank";
}
}
window.onload = externalLinks;
