$(function(){

	$('.menu').hover(
		function()
		{
			$(this).find('.submenu').show();
			$(this).addClass('menu_act');
		},
		function()
		{
			$(this).find('.submenu').hide();
			$(this).removeClass('menu_act');
		});

	$('.equip_table').each(
		function(index)
		{
			t = $(this);
			t.find('td:first').addClass('td_first');
			t.find('tr').not(':first').not(':last').addClass('tr_middle');
			t.find('tr').not(':first').find('td:even').addClass('td_left');
			t.find('tr').not(':first').find('td:odd').addClass('td_right');
			t.find('tr:last td').addClass('td_last');
		});

	$('.history_table tr').each(
		function (index)
		{
			t = $(this);
			t.find('td:first').addClass('first_blue');
			color = index % 2 == 0 ? 'light' : 'dark';
			t.find('td:last').addClass('second_' + color );
		});

	$('.history_table').each(
		function (index)
		{
			t = $(this);
			t.find('tr:last td:first').addClass('first_orange');
		});

	if($('#body_left').height() < 286)
	{
		$('#body_left').height(286);
	}

	$('.personnel').each(
		function (index)
		{
			t = $(this);
			t.find('tr:first td').addClass('td_first');
			t.find('tr').not(':first').addClass('td_normal');
			t.find('tr').not(':first').each(
				function (index)
				{
					tr = $(this);
					tr.find('td:first').addClass('td_left');
				});
			t.find('tr:last td').addClass('td_last');
		});

	resize();

	window.onresize = function(){ resize(); };
});

function resize()
{
	h = Math.max($('#body_left').height(), $('#body_right').height()) + $('#body_left').offset().top;
	h += $('#bottom').height();

	if(h < $('body').height())
	{
		$('#bottom').css(
			'margin-top',
			($('body').height() - h) + 'px');
	}
	else
	{
		$('#bottom').css('margin-top', '0px');
	}
}