// JavaScript Document

window.onload = function(){
	//$("#link").load("body_link.php");
	ImgResize();
	$("#footer_2").height($("#footer_1").height());
}

$(window).unload(function(){
});

$(document).ready(function(){
	//テーブルの背景色変更
	// 偶数行の色を設定
	$('table tr:even').css('background-color', '#FFFFFF');
	// 奇数行の色を設定
	$('table tr:odd').css('background-color', '#EEEEEE');
	
	//h2メニュー開閉
//	$('h2').dblclick( function(){
//		$(this).next().slideToggle('slow');
//	});
	//h3メニュー開閉
	$('h3').click( function(){
		$(this).next().slideToggle('slow');
	});
	//h4メニュー開閉
	$('h4').click( function(){
		$(this).next().slideToggle('slow');
	});

});


//Light Box
//$(function() {
//	$(".pic a").lightBox({fixedNavigation:true});
//});

//Mainの画像サイズの動的変更
function ImgResize(){
	var main_width = $("#container").width() - 30;
	$("#container img").each( function(){
		var g_width = $(this).width();
		if(g_width > main_width){
			var g_height = $(this).height() * (main_width / g_width);
			$(this).height(g_height).width(main_width);
		}
	 });
}

//すべての記事を隠す
function hideall(){
	$("h3").next().slideUp();
	$("h2").next().slideUp();
}

//すべての記事を展開
function showall(){
	$("h3").next().slideDown();
	$("h2").next().slideDown();
}

