//------------------------------
// Tab
//------------------------------
$(function(){
	$("div#Schedule div").hide();
	$("div#Schedule div:eq(0)").show();
	$("ul.month a:eq(0)").addClass("selected");
	
	$("ul.month a").click(function(){
	$("#Schedule div").hide();
	$($(this).attr("href")).fadeIn(150);
	$("ul.month a").removeClass("selected");
	$(this).addClass("selected");
	return false;
	});
});

//------------------------------
// Menu
//------------------------------


$(function(){
	var ContentHeight = $("div#Content").height();
	$("div#SubContent").css("height",ContentHeight-245);
});
/*
$( document ).ready( function (){
	$('#Menu').scrollFollow({});
});
*/

//オプション
$( document ).ready( function () {
	$( '#Menu' ).scrollFollow( {
		//アニメーションの速度の設定。0 にするとアニメーションなしになります。
		speed: 1000,
		//ブラウザの領域とフロート要素との余白。0にするとぴったりくっつきます。
		offset: 0,
		container: 'SubContent'
	} );
} );

//------------------------------
// scroll
//------------------------------
$(function(){
	$("a[href*='#']").filter(function(){
	return !$(this).parent().parent().hasClass("tab");
	}).slideScroll();
});

//------------------------------
// rollover
//------------------------------
$( document ).ready( function () {
	var postfix = '_on';
	$('#Menu li a img').not('[src*="'+ postfix +'."]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.'))
		           + postfix
		           + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(
			function() {
				img.attr('src', src_on);
			},
			function() {
				img.attr('src', src);
			}
		);
	});
	$('#Pastlive a img').not('[src*="'+ postfix +'."]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.'))
		           + postfix
		           + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(
			function() {
				img.attr('src', src_on);
			},
			function() {
				img.attr('src', src);
			}
		);
	});
});
