// JavaScript Document

$(function(){
	//$('.pngfix').pngfix();
	
	//トップページのスライド
	
	time1 = 3000;
	time2 = 5000;
	ftime = 2000;
	
	timerID = setTimeout("showHeadline()", 1000);
	timerID = setTimeout("hideHeadline_1()", time1);
	
	//$('#home #headline li#headline_1').fadeOut(10000);
	//$('#home #headline li#headline_2').fadeIn(10000);
	
	
	
	//お知らせを非同期で表示。
	$.get('./info.html',{},result);
		
	//トップベージのcss調整
	$('#home #top_index li:even').css('margin-right','15px');
	
	var h_0 = $('#home #top_index li:eq(0)').height();
	var h_1 = $('#home #top_index li:eq(1)').height();
	var h_2 = $('#home #top_index li:eq(2)').height();
	var h_3 = $('#home #top_index li:eq(3)').height();
	var h_4 = $('#home #top_index li:eq(4)').height();
	var h_5 = $('#home #top_index li:eq(5)').height();
	var h_6 = $('#home #top_index li:eq(6)').height();
	var h_7 = $('#home #top_index li:eq(7)').height();
	
	if (typeof document.documentElement.style.maxHeight != "undefined") {
		// IE 7.0 も含む新ブラウザ
		var h_0 = $('#home #top_index li:eq(0)').height();
		var h_1 = $('#home #top_index li:eq(1)').height();
		var h_2 = $('#home #top_index li:eq(2)').height();
		var h_3 = $('#home #top_index li:eq(3)').height();
		var h_4 = $('#home #top_index li:eq(4)').height();
		var h_5 = $('#home #top_index li:eq(5)').height();
		var h_6 = $('#home #top_index li:eq(6)').height();
		var h_7 = $('#home #top_index li:eq(7)').height();
	}
	else {
		// IE 6.0		
		var h_0 = $('#home #top_index li:eq(0)').height() + 16;
		var h_1 = $('#home #top_index li:eq(1)').height() + 16;
		var h_2 = $('#home #top_index li:eq(2)').height() + 16;
		var h_3 = $('#home #top_index li:eq(3)').height() + 16;
		var h_4 = $('#home #top_index li:eq(4)').height() + 16;
		var h_5 = $('#home #top_index li:eq(5)').height() + 16;
		var h_6 = $('#home #top_index li:eq(6)').height() + 16;
		var h_7 = $('#home #top_index li:eq(7)').height() + 16;
	}
	
	
	if(h_0 < h_1) {
		$('#home #top_index li:eq(0)').css('height',h_1+'px');
	}  else {
		$('#home #top_index li:eq(1)').css('height',h_0+'px');
	}
	
	if(h_2 < h_3) {
		$('#home #top_index li:eq(2)').css('height',h_3+'px');
	}  else {
		$('#home #top_index li:eq(3)').css('height',h_2+'px');
	}
	
	if(h_4 < h_5) {
		$('#home #top_index li:eq(4)').css('height',h_5+'px');
	}  else {
		$('#home #top_index li:eq(5)').css('height',h_4+'px');
	}
	
	if(h_6 < h_7) {
		$('#home #top_index li:eq(6)').css('height',h_7+'px');
	}  else {
		$('#home #top_index li:eq(7)').css('height',h_6+'px');
	}
		
});

function result(gData) {
	jQuery('#home #information').html(gData);
}

function hideHeadline_1() {
	$('#home #headline li#headline_1').fadeOut(ftime);
	timerID = setTimeout("hideHeadline_2()", time2);
	
}

function hideHeadline_2() {
	$('#home #headline li#headline_2').fadeOut(ftime);
}

function showHeadline() {
	$('#home #headline li#headline_2').css('display','block');
	$('#home #headline li#headline_3').css('display','block');
}
