jQuery(function($) {
	$("img").pngfix();
	
	$('.photo_list a').each(function(){
		var imgsrc = this.href;
		var imgtitle = this.title;
		$(this.rel).append('<img src="' + imgsrc + '" style="display:none;" />');
		$(this).click(function(){
			$(this.rel + ' img').attr("src", imgsrc);
			$(this.rel + ' img').attr("alt", imgtitle);
			return false;
		});
	});

	
	//Odd Even Set
	$('ul').each(function(){
		$(this).find('li:first').addClass('first');
		$(this).find('li:odd').addClass('odd');
		$(this).find('li:even').addClass('even');
		$(this).find('li:last').addClass('last');
	});
	$('table').each(function(){
		$(this).find('tr:first').addClass('first');
		$(this).find('tr:odd').addClass('odd');
		$(this).find('tr:even').addClass('even');
		$(this).find('tr:last').addClass('last');
	});

});


//
$(function(){
	$('#condition_person_label').click(
		function(){

			at = $("#condition_person").attr("checked");
		
			if ( $("#condition_person").attr("checked") ) {
				$("#vacant_search_condition_price").attr("class", "vacant_search_condition_price_active");
				$("#condition_price_row").attr("disabled", false);
				$("#condition_price_high").attr("disabled", false);
			} else {
				$("#vacant_search_condition_price").attr("class", "vacant_search_condition_price_disabled");
				$("#condition_price_row").attr("disabled", "disabled");
				$("#condition_price_high").attr("disabled", "disabled");
			}
		


			$(".debug_message").text(at);
		}
	);
});


MJL.event.add(window, "load", function(event) {

	MJL.enable.flash("flash", {version:8});
	MJL.enable.rollover("roll", {disable:"unroll", active:"active"});
	MJL.enable.styleSwitcher("styleSwitcher", {active:"active"});
	MJL.enable.tab("tabs");

}, false);


/* 空室検索 */
$(function(){
	$('#valid_people_label').click(
		function(){ // クリック

			if ( $("#valid_people").attr("checked") ) { // 人数が選択されたとき
				$("#plan_search_price").attr("class", "plan_search_condition_price_active");
				$("#condition_price_low").attr("disabled", false);
				$("#condition_price_high").attr("disabled", false);
			} else {
				$("#plan_search_price").attr("class", "plan_search_condition_price_disabled");
				$("#condition_price_low").attr("disabled", "disabled");
				$("#condition_price_high").attr("disabled", "disabled");
			}

		}
	);
});

