$(function() {
	// ギャラリーの画像とキャプションの表示
	$('a.thumb_noselect').click(function(){
		$('a.thumb_select').attr('class', 'thumb_noselect');
		var picture = $(this).attr('class', 'thumb_select').children().clone();
		var target = $('div.floor_plan');
		var width = target.children('img').width();
		var height = target.children('img').height();
		picture.filter('img').width(width).height(height);
 		//picture.filter('p').show();
 		picture.filter('p').css('display', 'block'); // 上のやり方ではIEで表示されない
		target.empty().append(picture);
		return false;
	    }).eq(0).click();

	// テーブルの「設備・特徴」項目の表示
	var tr =  $('tr.equipment_and_specialty');
	var rowspan = tr.size();
	tr.children('th').attr('rowspan', rowspan);
	var hidden_th_count = tr.children('td').each(function(){
		if (!$.trim($(this).html())) {$(this).hide();}
		$(this).css('border-top', ''); // IEで線が上下のセルで重なるため
	    }).filter(':hidden').size();
	if (rowspan == hidden_th_count) {tr.hide();} // すべてのセルが空なら行ごと非表示に
    });

