// JavaScript Document
$(document).ready(function() {
	 //まずトップに戻るを消しておきます。
	$("#back-top").hide();

	 //スクロールされたら	
	$(window).scroll(function () {
		//100pxいったら
		if ($(this).scrollTop() > 100) {
			//トップに戻るをフェードイン
			$('#back-top').fadeIn();
		//100pxいかなかったら
		} else {
			//隠す
			$('#back-top').fadeOut();
		}
	});

	 //トップに戻るをクリックしたら	
	$('#back-top a').click(function () {
		//スムーズに上に戻る
		$('body,html').animate({
			scrollTop: 0
		}, 800);
		return false;
	});
});


function open_subwin(url, width, height, scrollbars, window_name, front) {
	var opt = '';
	if (width) { opt = opt + 'width=' + width + ','; }
	if (height) { opt = opt + 'height=' + height + ','; }
	if (scrollbars) { opt = opt + 'scrollbars=' + scrollbars + ','; }
	else { opt = opt + 'scrollbars=yes,'; }
	if (!window_name) { window_name = 'subwin' }
	var w = window.open(url, window_name, opt + 'menubar=no,toolbar=no');
	w.focus();
	return false;
}

function scrollTo(x, y) {
	$('body,html').animate({
		scrollTop: 0
	}, 800);
}
function pageTop() {
	$('body,html').animate({
		scrollTop: 0
	}, 800);
}


