<!-- 
function newwin(url)
{
  window.open(url,"_blank","WIDTH=600,resizable=YES,scrollbars=YES,menubar=YES,toolbar=YES,status=YES");
}
'HELP'
function help_newwin(url)
{
  window.open(url,"_blank","WIDTH=780,HEIGHT=610,resizable=YES,scrollbars=YES,menubar=YES,toolbar=YES,status=YES");
}
'HELP'
//エリアが全チェックの場合＝全OFFへ
function all_area_check(){
	var i;
	var all_check=1;
//	alert("="+document.search_form.cs_area.length);
    for(i =0; i< document.search_form.cs_area.length;i++){
//		alert("="+document.search_form.cs_area[i].value+"="+document.search_form.cs_area[i].checked);
        if(document.search_form.cs_area[i].checked==false){	//チェックなしあり
			all_check=0;
//			alert("="+all_check);
		}
    }
    if(all_check==1){	//オールチェック
	    for(i =0; i< document.search_form.cs_area.length;i++){
	        document.search_form.cs_area[i].checked=false;	//全てチェックなしに
	    }
	}else{
	}
	return(false);
}
//検索の最終チェック
function input_check(){
var w_str

//	if(document.search_form.parea.value == ""){
//		alert("エリアは必ず選んでください。");
//		document.search_form.parea.focus();
//		return(false);
//	}
	all_area_check();
	document.search_form.submit();
}


function allclear_kg_nodata(){
	var i;
    for(i =0; i< document.search_form.kg_nodata.length;i++){
        if(document.search_form.kg_nodata[i].checked==true){
			document.search_form.kg_nodata[i].checked=false;
		}
    }
	return(false);
}

function allclear_kodawari(){
	var i;
    for(i =0; i< document.search_form.cs_kodawari_m.length;i++){
        if(document.search_form.cs_kodawari_m[i].checked==true){
			document.search_form.cs_kodawari_m[i].checked=false;
		}
    }
	return(false);
}

function allclear_expert(){
	var i;
    for(i =0; i< document.search_form.cs_expert.length;i++){
        if(document.search_form.cs_expert[i].checked==true){
			document.search_form.cs_expert[i].checked=false;
		}
    }
	option_all_off_check();
	return(false);
}

function allclear_area(){
	// チェックボックスが1個の場合、配列にならないので、if文追加（200803TN）
	var i;
	if(document.search_form.cs_area.length>1){
    for(i =0; i< document.search_form.cs_area.length;i++){
        if(document.search_form.cs_area[i].checked==true){
			document.search_form.cs_area[i].checked=false;
		}
   }
	return(false);
	}else{
	document.search_form.cs_area.checked=false;
	}
}

function allclear_ensen(){
	// チェックボックスが1個の場合、配列にならないので、if文追加（200803TN）
	var i;
	if(document.search_form.cs_ensen.length>1){
    for(i =0; i< document.search_form.cs_ensen.length;i++){
        if(document.search_form.cs_ensen[i].checked==true){
			document.search_form.cs_ensen[i].checked=false;
		}
    }
	return(false);
	}else{
	document.search_form.cs_ensen.checked=false;
	}
}


function allclear_art_type(){
	// チェックボックスが1個の場合、配列にならないので、if文追加（200803TN）
	var i;
	if(document.search_form.cs_art_type.length>1){
    for(i =0; i< document.search_form.cs_art_type.length;i++){
        if(document.search_form.cs_art_type[i].checked==true){
			document.search_form.cs_art_type[i].checked=false;
		}
    }
	return(false);
	}else{
	document.search_form.cs_art_type.checked=false;
	}
}

function allclear_size(){
	// チェックボックスが1個の場合、配列にならないので、if文追加（200803TN）
	var i;
	if(document.search_form.cs_size.length>1){
    for(i =0; i< document.search_form.cs_size.length;i++){
        if(document.search_form.cs_size[i].checked==true){
			document.search_form.cs_size[i].checked=false;
		}
    }
	return(false);
	}else{
	document.search_form.cs_size.checked=false;
	}
}

//オプション設定の全クリア
function option_all_set_check(){
//	alert("test");
	var i;
	if(document.search_form.option_all_set.checked==true){
//		alert("test2");
	    for(i =0; i< document.search_form.cs_expert.length;i++){
	        if(document.search_form.cs_expert[i].checked==true){
				document.search_form.cs_expert[i].checked=false;
			}
	    }
		document.search_form.cs_parking[0].checked=true;
	    document.search_form.cs_keyword.value="";
		document.search_form.cs_sort[0].checked=true;
	}
	return(false);
}

//オプション設定のチェックOFF
function option_all_off_check(){
	var i;
	var check_off;
	check_off=0;
    for(i =0; i< document.search_form.cs_expert.length;i++){
//		alert("["+document.search_form.cs_expert[i].checked+"]");
        if(document.search_form.cs_expert[i].checked==true){
			check_off=1;
		}
    }
	if(document.search_form.cs_parking[0].checked!=true){
		check_off=1;
	}
    if((document.search_form.cs_keyword.value!="") && (document.search_form.cs_keyword.value!=null)){
		check_off=1;
    }
	if(document.search_form.cs_sort[0].checked!=true){
		check_off=1;
	}

	if(check_off==1){
		document.search_form.option_all_set.checked=false;
	}else{
		document.search_form.option_all_set.checked=true;
	}
//		alert("["+check_off+"]");

	return(false);
}

/*
function option_all_set_off_check(check_this){
	if(check_this==true){
//		alert("test*"+check_this);
		if(document.search_form.option_all_set.checked==true){
			document.search_form.option_all_set.checked=false;
		}else{
		}
	}else{
//		alert("test2*"+check_this);
	}
	return(false);
}
*/

//詳細一覧の全選択
function option_all_detail_set_check(){
//	alert("test");
	var i;
//	alert("test2");
	if(document.detail_list_form.SEL_DETAIL_LIST.length>1){
	    for(i =0; i< document.detail_list_form.SEL_DETAIL_LIST.length;i++){
			if(document.detail_list_form.ALL_SEL_DETAIL_LIST.checked==true){
		        if(document.detail_list_form.SEL_DETAIL_LIST[i].checked==false){
					document.detail_list_form.SEL_DETAIL_LIST[i].checked=true;
				}
			}else{
		        if(document.detail_list_form.SEL_DETAIL_LIST[i].checked==true){
					document.detail_list_form.SEL_DETAIL_LIST[i].checked=false;
				}
			}
	    }
	}else{
		if(document.detail_list_form.ALL_SEL_DETAIL_LIST.checked==true){
	        if(document.detail_list_form.SEL_DETAIL_LIST.checked==false){
				document.detail_list_form.SEL_DETAIL_LIST.checked=true;
			}
		}else{
	        if(document.detail_list_form.SEL_DETAIL_LIST.checked==true){
				document.detail_list_form.SEL_DETAIL_LIST.checked=false;
			}
		}
	}
	return(false);
}

//詳細一覧の全解除
function option_all_detail_off_check(){
	var i;
	var check_off;
	check_off=0;
	if(document.detail_list_form.SEL_DETAIL_LIST.length>1){
		for(i =0; i< document.detail_list_form.SEL_DETAIL_LIST.length;i++){
	        if(document.detail_list_form.SEL_DETAIL_LIST[i].checked==true){
			}else{
				check_off=1;
			}
	    }
	}else{
        if(document.detail_list_form.SEL_DETAIL_LIST.checked==true){
		}else{
			check_off=1;
		}
	}

	if(check_off==1){
		document.detail_list_form.ALL_SEL_DETAIL_LIST.checked=false;
	}else{
		document.detail_list_form.ALL_SEL_DETAIL_LIST.checked=true;
	}

	return(false);
}






//問い合わせ一覧の全選択
function option_all_call_set_check(){
//	alert("test");
	var i;
	var w_dcode;
//	alert("test2");
//	alert(js_pf_path);

	if(document.detail_list_form.SEL_CALL_LIST.length>1){
		for(i =0; i< document.detail_list_form.SEL_CALL_LIST.length;i++){
			if(document.detail_list_form.ALL_SEL_CALL_LIST.checked==true){
		        if(document.detail_list_form.SEL_CALL_LIST[i].checked==false){
					document.detail_list_form.SEL_CALL_LIST[i].checked=true;
//					document.detail_list_form.SEL_CALL_LIST[i].click();
//		        	alert(document.detail_list_form.SEL_CALL_LIST[i].value);


//					w_dcode=document.detail_list_form.SEL_CALL_LIST[i]
//					alert(w_dcode.substr(19))

		        	save_id_check(document.detail_list_form.SEL_CALL_LIST[i].value,js_pf_path,document.detail_list_form.SEL_CALL_LIST[i]);
		        }
			}else{
		        if(document.detail_list_form.SEL_CALL_LIST[i].checked==true){
					document.detail_list_form.SEL_CALL_LIST[i].checked=false;
//					document.detail_list_form.SEL_CALL_LIST[i].click();
//		        	alert(document.detail_list_form.SEL_CALL_LIST[i].value);

//					w_dcode=document.detail_list_form.SEL_CALL_LIST[i]
//					alert(w_dcode.substr(19))


		        	save_id_check(document.detail_list_form.SEL_CALL_LIST[i].value,js_pf_path,document.detail_list_form.SEL_CALL_LIST[i]);
				}
			}
	    }
	}else{
			if(document.detail_list_form.ALL_SEL_CALL_LIST.checked==true){
		        if(document.detail_list_form.SEL_CALL_LIST.checked==false){
					document.detail_list_form.SEL_CALL_LIST.checked=true;
//					document.detail_list_form.SEL_CALL_LIST.click();

//					w_dcode=document.detail_list_form.SEL_CALL_LIST
//					alert(w_dcode.substr(19))


		        	save_id_check(document.detail_list_form.SEL_CALL_LIST.value,js_pf_path,document.detail_list_form.SEL_CALL_LIST);
		        }
			}else{
		        if(document.detail_list_form.SEL_CALL_LIST.checked==true){
					document.detail_list_form.SEL_CALL_LIST.checked=false;
//		        	document.detail_list_form.SEL_CALL_LIST.click();


//					w_dcode=document.detail_list_form.SEL_CALL_LIST
//					alert(w_dcode.substr(19))

		        	save_id_check(document.detail_list_form.SEL_CALL_LIST.value,js_pf_path,document.detail_list_form.SEL_CALL_LIST);
				}
			}
	}
	return(false);
}

//問い合わせ一覧の全解除
function option_all_call_off_check(){
	var i;
	var check_off;
	check_off=0;
	if(document.detail_list_form.SEL_CALL_LIST.length>1){
		for(i =0; i< document.detail_list_form.SEL_CALL_LIST.length;i++){
	        if(document.detail_list_form.SEL_CALL_LIST[i].checked==true){
			}else{
				check_off=1;
			}
	    }
	}else{
        if(document.detail_list_form.SEL_CALL_LIST.checked==true){
		}else{
			check_off=1;
		}
	}
	if(check_off==1){
		document.detail_list_form.ALL_SEL_CALL_LIST.checked=false;
	}else{
		document.detail_list_form.ALL_SEL_CALL_LIST.checked=true;
	}

	return(false);
}



function ph_size_change(this_ph){
	if(this_ph!=null){
//		alert("この画像の横幅は"+this_ph.width+"高さは"+this_ph.height);
		if(this_ph.width>240){
			this_ph.width=240;
		}
	}
}

function match_start_check(){
var w_str
	if(document.match_form.area.value == ""){
		alert("エリアを選んでください。");
		document.match_form.area.focus();
		return(false);
	}
	if((document.match_form.thing1.checked == false)&&(document.match_form.thing2.checked == false)){
		alert("物件種別を選択してください。");
		document.match_form.thing1.focus();
		return(false);
	}
	document.match_form.submit();
}


//クッキー

//Cookieから読み出し 
function getCookie(key) {
//alert("getCookie="+key);
	tmp = document.cookie+";";
//alert("tmp="+tmp);
	tmp1 = tmp.indexOf(key, 0);
//alert("tmp1="+tmp1);

	if (tmp1 != -1) {
		tmp = tmp.substring(tmp1,tmp.length);
		start = tmp.indexOf("=",0)+1;
		end = tmp.indexOf(";",start);
		return(unescape(tmp.substring(start,end)));
	}

	return("");
}

//Cookieに保存 
function setCookie(key,val) {
	exp=new Date();	//新規Dateオブジェクトexpを作成。デフォルトでは現在時間を持つ。
	exp.setTime(exp.getTime()+1000*60*60*24*30);	//現在時間に、30日分（JavaScriptの時間単位は1/1000秒）足したものを、Dateオブジェクトexpに設定する。

	
	tmp = key+"="+escape(val)+";";	//escape1Byte化
	tmp += "path=/;";
//	tmp += "domain=192.168.12.23";

//	tmp += "expires=Fri, 31-Dec-2030 23:59:59;";
//	tmp += "expires=Fri, 31-Dec-2030 23:59:59;";
	tmp += "expires="+exp.toGMTString();	//expires=で、cookieの賞味期限を設定している。ここではさっきexpに設定した現在の1日後になる。標準形式に変換する必要があるのでtoGMTstring()を用いている。

	document.cookie = tmp;
}

//Cookieに保存 
function setCookie_baibai(key,val) {
	exp=new Date();	//新規Dateオブジェクトexpを作成。デフォルトでは現在時間を持つ。
	exp.setTime(exp.getTime()+1000*60*60*24*90);	//現在時間に、90日分（JavaScriptの時間単位は1/1000秒）足したものを、Dateオブジェクトexpに設定する。

	
	tmp = key+"="+escape(val)+";";	//escape1Byte化
	tmp += "path=/;";
//	tmp += "domain=192.168.12.23";

//	tmp += "expires=Fri, 31-Dec-2030 23:59:59;";
//	tmp += "expires=Fri, 31-Dec-2030 23:59:59;";
	tmp += "expires="+exp.toGMTString();	//expires=で、cookieの賞味期限を設定している。ここではさっきexpに設定した現在の1日後になる。標準形式に変換する必要があるのでtoGMTstring()を用いている。

	document.cookie = tmp;
}

/*
xDay = new Date;
xDay.setHours(xDay.getHours() + 1); //一時間後に削除
xDay = xDay.toGMTString(); //GMT形式の文字列に変換
document.cookie = "value0=" +  + ";expires=" + xDay;
*/

//Cookieを初期化
function Start() {
	if (document.cookie == "") {
		alert("このサーバによるCookieはありません。")
	} else {
		tmp = document.cookie.split(";");
		acDate = new Date();
		acDate.setYear(acDate.getYear()-1);
		for (i = 0; i < tmp.length; i++) {
			temp1 = tmp[i].split("=")[0];
			document.cookie = temp1 + "=;acDate=" + acDate.toGMTString();
		}
		alert ("このサーバによるCookieを削除しました。");
	}
}


//各物件のIDをCookieに追加保存
function save_id(bukken_id,pref){
	var i;
//	alert("1");
	var keep_id="";
	var keep_box="";
//	alert("2");
	keep_id=getCookie("KanriBukken_"+pref);
	var new_keep_id="";

//	alert("3"+keep_id);
//	alert("3"+pref);

	var check_id="";
	check_id=0;
	if(keep_id==""){
		new_keep_id=bukken_id;
	}else{
		keep_box=keep_id.split(",")
	    for(i =0; i< keep_box.length;i++){
//			alert(keep_box[i]);
			if(keep_box[i]==bukken_id){
				//既にアリ
				check_id=1;
//	    	}else if(isNaN(keep_box[i])==false){
				//数字である
			}else{
				if(new_keep_id==""){
					new_keep_id=keep_box[i]
	    		}else{
					new_keep_id=new_keep_id+","+keep_box[i]
	    		}
	    	}
		}
		if(check_id==0){
			//追加
			new_keep_id=new_keep_id+","+bukken_id;
		}
	}
	//	alert("4");
	setCookie("KanriBukken_"+pref,new_keep_id);
//	setCookie("KanriBukken_"+pref,bukken_id);

//	alert("【save_id】KanriBukken_"+pref+"は"+keep_id);
//	alert("【new_save_id】KanriBukken_"+pref+"は"+new_keep_id);

}

//各物件のIDをCookieから削除
function del_id(bukken_id,pref){
	var i;
//	alert("1");
	var keep_id="";
	var keep_box="";
//	alert("2");
	keep_id=getCookie("KanriBukken_"+pref);
//	alert("3");

	var new_id="";

	var check_id="";
	check_id=0;
	if(keep_id==""){
//		keep_id=bukken_id;
	}else{
		keep_box=keep_id.split(",")
	    for(i =0; i< keep_box.length;i++){
			if(keep_box[i]==bukken_id){
				check_id=1;
//	    	}else if(keep_box[i]="KOILECAAOFHKLEBLCPDBKAFN"){
			}else{
//				if(isNaN(keep_box[i])==false){
					//数字である
					if(new_id==""){
						new_id=new_id+keep_box[i];
					}else{
						new_id=new_id+","+keep_box[i];
					}
//				}
			}
		}
		if(check_id==1){
			keep_id=new_id;
		}
	}
//	alert("4");

	setCookie("KanriBukken_"+pref,keep_id);
	//	setCookie("KanriBukken_"+pref,"189811");

	//	setCookie("KanriBukken_"+pref,bukken_id);
//	alert("【del_id】KanriBukken_"+pref+"は"+keep_id);

}
//物件IDのCookieをクリアー
function all_clear_id(pref){
	setCookie("KanriBukken_"+pref,"");

	var keep_id="";
	keep_id=getCookie("KanriBukken_"+pref);
	//	alert("【all_clear_id】KanriBukken_"+pref+"は"+keep_id);
//	alert(keep_id);
}


//各物件のIDをCookieから確認
function alert_id(pref){
	var keep_id="";
	keep_id=getCookie("KanriBukken_"+pref);
	alert("【alert_id】KanriBukken_"+pref+"は"+keep_id);
}

//各物件のIDをCookieで管理
function save_id_check(bukken_id,pref,obj){
//	alert(pref);
//	alert(js_pf_path);
//	alert(bukken_id);

	var w_dcode;
	var one_dcode;
	w_dcode=bukken_id.substr(19);
	one_dcode=w_dcode.split("-");
	for(i=0;i<one_dcode.length ;i++){
		if(obj.checked==true){
			save_id(bukken_id.substr(0,19)+one_dcode[i],pref);
		}else{
			del_id(bukken_id.substr(0,19)+one_dcode[i],pref);
		}
	}


}

function save_id_hidden(bukken_id,pref){
	var w_dcode;
	var one_dcode;
	w_dcode=bukken_id.substr(19);
	one_dcode=w_dcode.split("-");
	for(i=0;i<one_dcode.length ;i++){
		save_id(bukken_id.substr(0,19)+one_dcode[i],pref);
	}
}

//強制削除
//del_id("s340094-000002-000101","hiroshima");
//del_id("s340094-000002-0001003","hiroshima");
//del_id("KanriBukken_fukuyama","hiroshima");

//-->

