/*------------------------------
	jqscript.js
	2009/07/14
------------------------------*/

/* サイト内検索のフォーム値 */
$(function() {
	$("#serchtxt").val("Powered by Google");

	$("#serchtxt").focus(function() {
		if (this.value == "Powered by Google") {
			$(this).val("");
		}
	});

	$("#serchtxt").blur(function() {
		if (this.value == "") {
			$(this).val("Powered by Google");
		}
	});
});

/* トップのタブボックス切り替え */
$(function() {
	$("#topics").css("display", "none");
	$("#tab_btn01,#tab_btn02").css("cursor","pointer");	
});

$(function () {
	$("#tab_btn02").click(function() {
		if ($("#topics").css('display','none').length) {
			$("#topics").css('display','block');
			$("#seminar").css('display','none');
			$("#tab_btn01")[0].src = "img/btn_seminar.gif";
			$("#tab_btn02")[0].src = "img/btn_topics_ov.gif";
		}
	});
	
	$("#tab_btn01").click(function() {
		if ($("#seminar").css('display','none').length) {
			$("#seminar").css('display','block');
			$("#topics").css('display','none');	
			$("#tab_btn01")[0].src = "img/btn_seminar_ov.gif";
			$("#tab_btn02")[0].src = "img/btn_topics.gif";
		}
	});
});

/* div要素の子のp要素を5個ずつ高さを揃える。 */
$(function(){
   var sets = [], temp = [];
   $("#contents-top .container div > p").each(function(i) {
       temp.push(this);
	   if (i % 5 == 4) {
           sets.push(temp);
           temp = [];
       }
   });
   if (temp.length) sets.push(temp);
   $.each(sets, function() {
       $(this).flatHeights();
   });
});

