/*
 * display loading animation, and load external html, and adjust heights.
 */
$( function(){
    $("#menu"    ).html( '<p class="center"><img src="../gif/ajax-loader.gif"></p>' );
    $("#notice"  ).html( '<p class="center"><img src="../gif/ajax-loader.gif"></p>' );
    $("#notice0" ).html( '<p class="center"><img src="../gif/ajax-loader.gif"></p>' );
    $("#link"    ).html( '<p class="center"><img src="../gif/ajax-loader.gif"></p>' );
    $("#xbox360" ).html( '<p class="center"><img src="../gif/ajax-loader.gif"></p>' );
    $("#footer"  ).html( '<p class="center"><img src="../gif/ajax-loader.gif"></p>' );

    $("#menu"    ).load( "../ajax/menu1.html", null, cbf );
    $("#notice"  ).load( "../ajax/notice.html", null, cbf );
    $("#notice0" ).load( "../ajax/notice0.html", null, cbf );
    $("#link"    ).load( "../ajax/link.html", null, cbf );
    $("#xbox360" ).load( "../ajax/xbox360.html", null, cbf );
    $("#footer"  ).load( "../ajax/footer1.html", null, cbf );
});

/*
 * jQuery.load用 call back function.
 */
function cbf( text, status ){
	if( status == "success" ){
		/*
		 * .body配下のdivで最大の高さにmain/left/rightの高さを揃える.
		 */
		var maxh = 0;
    	$('.body div').each( function(){
			var h = this.offsetHeight;
			if( h > maxh ){ maxh = h; }
		});
		
		$( '.main' ).css('height', maxh + 'px');
		$( '.left' ).css('height', maxh + 'px');
		$( '.right' ).css('height', maxh + 'px');
	}
}
