/**

 *	@filename		home.js

 *	@charset		utf-8

 *	@created		October 28, 2009

 *	@lastmodified	October 28, 2009

 *	@description	トップページ専用js

 */

(function(){





////////////////////////////////////////////////////////////////////////////////////////////////////

//

//	DOMツリー構築完了後に実行（onload前）

//

////////////////////////////////////////////////////////////////////////////////////////////////////

$(function(){





//

//	div#sectionBuiltとdiv#sectionCustomの高さを揃える

//

if($("div#sectionBuilt").length!=0&&$("div#sectionCustom").length!=0){

	ajustSectionHeight();

	

	var prevHeight = $("#mainContent").height();

	

	setInterval(ajustSectionHeight,50);

	

	$(window).unload(function(){

		clearInterval(ajustSectionHeight);

	});

	

}



function ajustSectionHeight(){

	curHeight = $("#mainContent").height();

	

	if(curHeight != prevHeight){

		var prev = $("div#sectionBuilt");

		var next = $("div#sectionCustom");

		

		$("div.sectionContent",prev).height("auto");

		$("div.sectionContent",next).height("auto");

		

		var height1 = $("div.sectionContent",prev).height();

		var height2 = $("div.sectionContent",next).height();

		

		var maxHeight = function(){

			if(height1 > height2){

				return height1;	

			}else{

				return height2;

			}

		}();

		

		var b = jQuery.browser;

		var v = jQuery.browser.version;

		var padding = function(){

			if(b.msie&&v=="6.0"){

				return 0;

			}else if(b.msie&&v=="7.0"){

				return 0;

			}else{

				return 0;

			}

		}();

		

		$("div.sectionContent",prev).height(maxHeight - padding);

		$("div.sectionContent",next).height(maxHeight - padding);

	}

	prevHeight = curHeight;

}







});

////////////////////////////////////////////////////////////////////////////////////////////////////





})();
