// ポップアップウィンドウ オープン
function MM_openBrWindow(theURL,winName,features){ window.open(theURL,winName,features); }

// ポップアップウィンドウ クローズ
function CloseWin(){ window.close(); }

//グローバルナビ ローカルナビ active時
$(document).ready(function(){
	var url = location.pathname;
	var paths = url.split("/");
	//alert(paths[1]);
	switch ( paths[1] ) {
		case 'concept':
			$("#globalNav_aqua img").each(function(){
				var txt = $(this).attr("src").replace("_off", "_ov");
				$(this).attr('src', txt);
			});
			break;
		case 'about':
			$("#globalNav_facility img").each(function(){
				var txt = $(this).attr("src").replace("_off", "_ov");
				$(this).attr('src', txt);
			});
			break;
		case 'program':
			$("#globalNav_program img").each(function(){
				var txt = $(this).attr("src").replace("_off", "_ov");
				$(this).attr('src', txt);
			});
			break;
		case 'dayservice':
			$("#globalNav_dayservice img").each(function(){
				var txt = $(this).attr("src").replace("_off", "_ov");
				$(this).attr('src', txt);
			});
			break;
		case 'voice':
			$("#globalNav_voice img").each(function(){
				var txt = $(this).attr("src").replace("_off", "_ov");
				$(this).attr('src', txt);
			});
			break;
		case 'access':
			$("#globalNav_access img").each(function(){
				var txt = $(this).attr("src").replace("_off", "_ov");
				$(this).attr('src', txt);
			});
			break;
		default:
			break;
	}
});

// go to pagetop
function backToTop() {
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	if (document.documentElement) {
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
	}
	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;
	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));
	window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
	if (x > 0 || y > 0) {
		window.setTimeout("backToTop()", 35); //set speed
	}
}

/*
// クリック領域をブロック全体に
$(function() {
	$('ul.typee li.link, ul.typee dt.link, ul.typee dd.link, ul#typea li, #memberList div.outer, #topPickup div.pickupBox').click(function () {
		var boxLink = $(this).find('a');
		if (boxLink.attr('target') == '_blank') {
			window.open(boxLink.attr('href'));
		} else {
			window.location = boxLink.attr('href');
		}
		return false;
	});
	$('ul.typee li.link, ul.typee li dt.link, ul.typee li dd.link, ul#typea li, #memberList div.outer, #topPickup div.pickupBox').hover(function () {
		$(this).addClass('hover');
	}, function () {
		$(this).removeClass('hover');
	});
});

// フォントサイズ変更
$(function(){
	var cookieName = "fontSize";
	var history = $.cookie(cookieName);
	var elm = $('body');
	if(!history) {
		elm.addClass('fontM');
		$.cookie(cookieName, 'fontM', { path: '/'});
	} else {
		elm.addClass(history);
	}
	$('dl#fontsize dd').click(function() {
		var setFontSize = this.id;
		$.cookie(cookieName, setFontSize, { path: '/'});
		elm.removeClass().addClass(setFontSize);
	});
});
*/

