

$(document).ready(function() {
	$('.button_common').mouseover(function(){
		$(this).addClass('button_common_over');
	}).mouseout(function(){
		$(this).removeClass('button_common_over');
	});
	$('.page_link p').hide();
	$('.page_link').mouseover(function(){
		$(this).find('p').show();
	});
	$('.page_link').mouseout(function(){
		$(this).find('p').hide();
	});
});





var last_windowtop_pos;
var initial_sidebar_top;
var initial_middle_top;
var position_type;

$(document).ready(function() {
	initial_middle_top  = $('#content').offset().top;
	position_type       = $('#sidebar_content').css( 'position' );
	offset = 0;

	$(window).scroll(function () {
		var windowtop_pos = $(window).scrollTop();
		if( windowtop_pos == last_windowtop_pos) {
			return;
		}
		last_windowtop_pos = windowtop_pos;
		if( position_type == 'fixed' ){
			windowtop_pos = initial_middle_top - windowtop_pos + offset;
			if( windowtop_pos < offset ){
				windowtop_pos = offset;
			}
		} else if( windowtop_pos > initial_middle_top ){
			windowtop_pos = initial_middle_top + windowtop_pos - initial_middle_top + offset;
		} else {
			return;
		}
		$('#sidebar_content').css( 'top', windowtop_pos );
	});
});


