﻿
// DM_Validator-0.16
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(1(k){k(1(){k.9.14()});k.9={14:1(){k(".15").R(1(){k.9.S(k(8))});k(".T").m("l").R(1(){k.9.J(k(8).16(".T"))});k(".U").m("l").R(1(){k.9.V(k(8).16(".U"))});k("l[K=\'1w\'],l[K=\'1x\']").1y(1(){4 k.9.17()});k(\'#1z\').1A(\'<a 18="L" 1B="L"></a>\')},S:1(a){2(k(a).D()==""&&k(a).t()==""){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\');k(a).B("C","#M")}4 6}r{k(a).7(".5").z();k(a).B("C","#N");4 3}},J:1(a){n b=3;k(a).m("l").q(1(){2(k(8).D()==""){b=6}});2(b!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+$(a).o("y")+\'</p>\');k(a).m("l").B("C","#M")}4 6}r{k(a).7(".5").z();k(a).m("l").B("C","#N");4 3}},J:1(a){n b=3;k(a).m("l").q(1(){2(k(8).D()==""){b=6}});2(b!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\');k(a).m("l").B("C","#M")}4 6}r{k(a).7(".5").z();k(a).m("l").B("C","#N");4 3}},V:1(a){n b=6;k(a).m("l").q(1(){2(k(8).D()!=""){b=3}});2(b!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\');k(a).m("l").B("C","#M")}4 6}r{k(a).7(".5").z();k(a).m("l").B("C","#N");4 3}},19:1(a){2(k(a).o("E")!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\')}4 6}r{k(a).7(".5").z();4 3}},1a:1(a){n b=3;2(k(a).m("l[@K=\'1C\']:E").o("E")!=3){b=6}2(b!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\')}4 6}r{k(a).7(".5").z();4 3}},1b:1(a){2(k(a).m("l[@K=\'1D\']:E").o("E")!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\')}4 6}r{k(a).7(".5").z();4 3}},1c:1(a){2(k(a).D()==""){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\')}4 6}r{k(a).7(".5").z();4 3}},1d:1(a){n b=3;k(a).m("1E").q(1(){2(k(8).D()==""){b=6}});2(b!=3){2(k(a).7(".5").t()==u){k(a).v().w(\'<p x="5">\'+k(a).o("y")+\'</p>\')}4 6}r{k(a).7(".5").z();4 3}},1e:1(h){n i=(1(){n c=$.1f({1g:1h,W:1F,1i:1G,1H:\'\'},h);c.X=F.1j(1I/c.1i);n f;n g={G:0,H:0,O:0,P:0};1 Y(){2(g.G==c.W){Z.1k(10(),g.O)}r 2(g.P==11()){g.G++;Z.1k(10(),12());g.P=12();f=1l(Y,c.X)}}1 1J(a){1K.1L=a}1 11(){4 A.I.1m||A.Q.1m}1 10(){4 A.I.1n||A.Q.1n}1 1M(){4 A.Q.13||A.I.13}1 1N(){4(!$.1o.1O&&!$.1o.1P)?A.Q.1p||A.I.1p||A.I.13:Z.1Q}1 12(){4 F.1j(1q(g.H,g.O,g.G,c.W,c.1g))}1 1q(a,b,c,d,e){n s=c/d;4(b-a)*(s+e/(1h*F.1r)*F.1R(F.1r*s))+a}4{1s:1(a){8.1t();2(a.H==1S)a.H=11();g=$.1f(g,a);g.P=g.H;f=1l(Y,c.X)},1t:1(){1T(f);g.G=0}}})();n j=k(\'#L\');2(j.1u==0){j=k("a[18=\'L\']")}2(j.1u){i.1s({O:j.1U().1V,1v:8.1v});4 6}},17:1(){n a=3;n b;k(".15").q(1(){2(k.9.S(k(8))!=3){a=6}});k(".T").q(1(){2(k.9.J(k(8))!=3){a=6}});k(".U").q(1(){2(k.9.V(k(8))!=3){a=6}});k(".1W").q(1(){2(k.9.19(k(8))!=3){a=6}});k(".1X").q(1(){2(k.9.1a(k(8))!=3){a=6}});k(".1Y").q(1(){2(k.9.1b(k(8))!=3){a=6}});k(".1Z").q(1(){2(k.9.1c(k(8))!=3){a=6}});k(".20").q(1(){2(k.9.1d(k(8))!=3){a=6}});2(a!=3){4 k.9.1e()}r{4 3}}}})(21);',62,126,'|function|if|true|return|warning|false|siblings|this|validator||||||||||||input|find|var|attr||each|else||html|null|parent|append|class|title|remove|document|css|background|val|checked|Math|stepCount|startY|body|textGroupValidation|type|validatorForm_head|fee|fff|endY|lastY|documentElement|blur|textValidation|requiredGroups|requiredHasOneGroups|textGroupHasOneValidation|step|ms|move|window|getCurrentX|getCurrentY|getEasingY|scrollHeight|init|requiredText|parents|validateAll|name|chkboxValidation|chkboxGroupValidation|radioValidation|selectValidation|selectGroupValidation|scrollToTop|extend|easing|100|fps|floor|scrollTo|setTimeout|scrollTop|scrollLeft|browser|clientHeight|getEasing|PI|set|stop|length|hrefdata|submit|image|click|validatorForm|before|id|checkbox|radio|select|30|60|fragment|1000|setFragment|location|href|getDocumentHeight|getViewportHeight|safari|opera|innerHeight|sin|undefined|clearTimeout|offset|top|requiredChkbox|requiredChkboxGroups|requiredRadio|requiredSelect|requiredSelectGroup|jQuery'.split('|'),0,{}));
// リセットボタン何某
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(2(a){a(2(){a.5.6()});a.5={6:2(){a(\'.7\').8(\'3\');a(\'.c\').8(\'3\');a(\'.7\').3(2(){a(\'#0 :d\').1(\'\');a(\'#0 :e\').1(\'\');a(\'#0 :f\').9(\'b\',4);a(\'#0 :g\').9(\'b\',4);a(\'#0 h\').1(\'\');a(\'#0 :i\').1(\'\');a(\'#0 j\').1(\'\');k 4})}}})(l);',22,22,'validatorForm|val|function|click|false|clearer|init|clearerTrigger|unbind|attr||checked|backTrigger|text|password|checkbox|radio|select|file|textarea|return|jQuery'.split('|'),0,{}));


/**
 * 2011/03/17
 * マイページまとめてチェック操作
 * ifHelperが圧縮してあるのでこっちに追加
 * と思ったけどこれも圧縮してあったっていう某
 */
$(function() {
	$('.check_all_trigger').click(function() {
		var checked = false;
		$('.checkboxTarget').each(function() {
			if($(this).attr('checked')==true) {
				checked = true;
			}
		});
		
		if(checked) {
			$('.checkboxTarget').each(function() {
				$('.checkboxTarget').removeAttr('checked');
			});
			$('.check_all_box').each(function() {
				$('.check_all_box').removeAttr('checked');
			});
		} else {
			$('.checkboxTarget').each(function() {
				$('.checkboxTarget').attr('checked','checked');
			});
			$('.check_all_box').each(function() {
				$('.check_all_box').attr('checked','checked');
			});
		}
	});
});


/**
 * 2011/03/17
 * マイページまとめてお気に入り操作
 * 同上
 * 
 * 
 * 2011/03/18
 * ifHelper.srcに引っ越し
 */

//$(function() {
//	$('.favoriteAllTrigger').click(function(){
//		var item = new Array();
//		var i = 0;
//		$('.checkboxTarget').each(function() {
//			if($(this).attr('checked') == true) {
//				item[i] = $(this).val();
//				i++;
//			}
//		});
//		
//		if(i) {
//			var item_obj = new String(item);
//			imp_item = item_obj.split(',');
//			var url = '/member_json_datas/addFavorite/'+imp_item;
//			location.href = url;
//			alert('お気に入りに登録しました');
//		} else {
//			alert('物件が選択されていません');
//		}
//
//	});
//});


/**
 * 2011/03/25
 * タグの削除処理
 * いつものごとくここに追加
 */

$(function() {
	$('.delTagTrigger').click(function() {
		if(window.confirm('このタグを削除しますか？')) {
			var tagId = $(this).attr('rel');
			var url = '/admin_edit_tags/del/' + tagId;
			location.href = url;
		}
	});
});



//$(function() {
//	$('.table_clickable').click(function(){
//		var url = '/';
//		url = url + $(this).attr('alt');
//		location.href= url;
//	});
//});

$(function() {
	/*
	 * 2011/2/14追加
	 * チェックボックスのonoffでdisabled
	 * 
	 * */
	$('.trigger_mansion').click(function() {
		if($(this).attr('checked')==true){	//tgtElem.attr('checked')==ture : return true
			$('.area_mansion').removeAttr('disabled');
			$('.mansion_scr').fadeIn("fast");
		}else{
			$('.area_mansion').attr('disabled','disabled');
			$('.mansion_scr').fadeOut("fast");
		}
	});

	
	$('.trigger_land').click(function() {
		if($(this).attr('checked')==true){	//tgtElem.attr('checked')==ture : return true
			$('.area_land').removeAttr('disabled');
			$('.land_scr').fadeIn("fast");
		}else{
			$('.area_land').attr('disabled','disabled');
			$('.land_scr').fadeOut("fast");
		}
	});

	$('.trigger_house').click(function() {
		if($(this).attr('checked')==true){	//tgtElem.attr('checked')==ture : return true
			$('.area_house').removeAttr('disabled');
			$('.house_scr').fadeIn("fast");
		}else{
			$('.area_house').attr('disabled','disabled');
			$('.house_scr').fadeOut("fast");
		}
	});



	/**
	 * 3SLDK以上にまとめてチェック
	 */
	$('#over_3ldk_check_trigger').change(function(){
		if($(this).is(':checked')){
			$('.over_3ldk_check_target').each(function(){
				$(this).attr('checked','checked');
			});
		}else{
			$('.over_3ldk_check_target').each(function(){
				$(this).removeAttr('checked');
			});
		}
	});
});



$(document).ready(function() {
	if($('.trigger_mansion').attr('checked')== true) $('.area_mansion').removeAttr('disabled');
	if($('.trigger_house').attr('checked')== true) $('.area_house').removeAttr('disabled');
	if($('.trigger_land').attr('checked')== true) $('.area_land').removeAttr('disabled');

	if($('.trigger_mansion').attr('checked')== true) $('.mansion_scr').show();
	if($('.trigger_house').attr('checked')== true) $('.house_scr').show();
	if($('.trigger_land').attr('checked')== true) $('.land_scr').show();
});






/*
本登録フォームのエレメント操作

*/

(function(jQuery){		
	jQuery.validator = {
		init: function(){
			jQuery('.on_off_switch').click(function(){
				jQuery.validator.onOffSwitch(jQuery(this));
			});
		},
		onOffSwitch: function(tgtElem) {
			if(jQuery(tgtElem).val() == "マンション") {
				if(jQuery(tgtElem).attr('checked')==true){	//tgtElem.attr('checked')==ture : return true
					jQuery('#RegistYosanMansionKingaku').removeAttr('disabled');
				}else{
					jQuery('#RegistYosanMansionKingaku').attr('disabled','disabled');
				}
//				jQuery('.on_off_switch').attr('readonly', true);
			}else if(jQuery(tgtElem).val() == "一戸建て") {
				if(jQuery(tgtElem).attr('checked')==true){
					jQuery('#RegistYosanHouseKingaku').removeAttr('disabled');
				}else{
					jQuery('#RegistYosanHouseKingaku').attr('disabled','disabled');
				}
//				jQuery('.on_off_switch').attr('readonly', true);
			}else if(jQuery(tgtElem).val() == "土地") {
				if(jQuery(tgtElem).attr('checked')==true){
					jQuery('#RegistYosanLandKingaku').removeAttr('disabled');
				}else{
					jQuery('#RegistYosanLandKingaku').attr('disabled','disabled');
				}
//				jQuery('.on_off_switch').attr('readonly', true);
			}
		}
	};

	jQuery(document).ready(function(){
		jQuery.validator.init();
	});
	
	
	jQuery.changingCheck = {
			init: function() {
				jQuery('.change_check_switch').click(function() {
					jQuery.changingCheck.changeCheckAll(jQuery(this));
				});
			},
			changeCheckAll: function(tgtElem) {
				var tmp = jQuery(tgtElem).attr('rel');
				if(tmp == "add") {
					jQuery('.change_check_all').attr('checked','checked');
				} else if(tmp == "remove") {
					jQuery('.change_check_all').removeAttr('checked');
				}
			}
	};
	jQuery(document).ready(function(){
		jQuery.changingCheck.init();
	});
	
	
	jQuery.changingCaption = {
			init: function() {
				jQuery('.change_form_cap').click(function() {
					jQuery.changingCaption.changeCap(jQuery(this));
				});
			},
			changeCap: function(tgtElem) {
				if(jQuery(tgtElem).val() == "広さ") {
					$("#hirosa_madori_caption")
						.html('<div id="hirosa_madori_caption">希望する広さ・間取り等<br /><span style="font-size:10px; color:#666;">(例)　50㎡ 以上</span></div>');
				}else if(jQuery(tgtElem).val() == "間取り") {
					$("#hirosa_madori_caption")
					.html('<div id="hirosa_madori_caption">希望する広さ・間取り等<br /><span style="font-size:10px; color:#666;">(例)　2LDK 以上</span></div>');
				}
			}
	};
	jQuery(document).ready(function() {
			jQuery.changingCaption.init();
	});
})(jQuery);

/*

jQuery.validator.onOffSwitch(jQuery('.on_off_switch:checked'));



alert("test !");
}
}
*/
