//テキスト・外観・間取り図・学区・キーワード
function JU_send_layout(form,url)
{
    document.form.target = "_self";
    document.form.action = url;
    document.form.submit();
}

//リスト
function sch_list(form,city_cd,kind)
{ 
    document.form.city_cd.value = city_cd;
    if(kind ==1)
    {
        document.form.action = "/search/land/area/list.php";
    }
    else if(kind ==204)
    {
        document.form.action = "/search/house_new/area/list.php";
    }
    else if(kind ==205)
    {
        document.form.action = "/search/house_used/area/list.php";
    }
    else if(kind ==3)
    {
        document.form.action = "/search/mansion/area/list.php";
    }
    document.form.target = "_self";
    document.form.submit();
}
//ソート
function JU_send_sort(form,sort){
    document.form.sort.value = sort;
    document.form.target = "_self";
    document.form.action = "list.php";
    document.form.submit();
}
//ソート
function JU_send_selection(form,selection){
	document.form.selection.value = selection;
    document.form.target = "_self";
    document.form.action = "list.php";
    document.form.submit();
}
//物件詳細
function JU_send_detail(form,k_number,div,url){
    document.form.k_number.value = k_number;
    document.form.division.value = div;
    document.form.target = "_blank";
    document.form.action = url;
    document.form.submit();
}
//絞り込み
function JU_send_sch(form1,flg){
    document.form1.sch_flg.value = flg;
    document.form1.target = "_self";
    document.form1.action = "list.php";
    document.form1.submit();
}//絞り込み
function JU_send_sch2(form1,flg){
    document.form1.sch_flg.value = flg;
    document.form1.target = "_self";
    document.form1.action = "pictures.php";
    document.form1.submit();
}
//検索条件保存(沿線の時)
//絞り込み
function JU_send_sch_1(form,flg){
    document.form.sch_flg.value = flg;
    document.form.target = "_self";
    document.form.action = "list.php";
    document.form.submit();
}
//物件リクエスト
function JU_request(form1,kind)
{
        document.form1.kind.value = kind;
        document.form1.target = "_self";
        document.form1.action = "https://www.meiji-jisho.com/request/input.php";
        document.form1.submit();
}
//検索条件保存
function JU_keep(form1,keep_flg)
{
    if(confirm('検索条件を保存します。よろしいですか？'))
    {
        document.form1.keep_flg.value = keep_flg;
        document.form1.target = "_self";
        document.form1.action = "list.php";
        document.form1.submit();
    }
}
//検索条件保存
function JU_keep2(form1,keep_flg)
{
    if(confirm('検索条件を保存します。よろしいですか？'))
    {
        document.form1.keep_flg.value = keep_flg;
        document.form1.target = "_self";
        document.form1.action = "pictures.php";
        document.form1.submit();
    }
}

//物件リクエスト
function JU_request_1(form,kind)
{
        document.form.kind.value = kind;
        document.form.target = "_self";
        document.form.action = "https://www.meiji-jisho.com/request/input.php";
        document.form.submit();
}
//検索条件保存
function JU_keep_1(form,keep_flg)
{
    if(confirm('検索条件を保存します。よろしいですか？'))
    {
        document.form.keep_flg.value = keep_flg;
        document.form.target = "_self";
        document.form.action = "list.php";
        document.form.submit();
    }
}
//表示件数
function JU_select_change(form,url){
    document.form.target = "_self";
    document.form.action = url;
    document.form.submit();
}
//ページング
function JU_send_page(form,page,sort){
    document.form.sort.value = sort;
    document.form.page.value = page;
    document.form.target = "_self";
    document.form.action = "list.php";
    document.form.submit();
}
function JU_send_page2(form,page,sort){
    document.form.sort.value = sort;
    document.form.page.value = page;
    document.form.target = "_self";
    document.form.action = "pictures.php";
    document.form.submit();
}
function JS_send_form(form)
{
	form.target = "_self";
	form.action = "https://www.meiji-jisho.com/contact/house/input.php";
	form.submit();
}
//一括資料請求
function JU_send_form(form){
    var boxcheck;
    boxcheck=false;
    for(i=0; i<document.form.length; i++){
            if( document.form.elements[i].checked == true ){
                boxcheck=true;
        }
    }
    if(boxcheck==true){
        document.form.target = "_blank";
        document.form.method = "post";
        document.form.action    = "https://www.meiji-jisho.com/contact/house/input.php";
        document.form.submit();
    }else{
        alert('お問い合わせ候補を選択してください');
    }
}
//比較
function JU_send_compare(form){
    var boxcheck;
    var num = 0;
    boxcheck=false;
        for(i=0; i<document.form.length; i++){
                if((document.form.elements[i].name=="chk_box[]") && (document.form.elements[i].checked == true) ){
                    boxcheck=true;
                    num += 1;
            }
        }
        if(num <= 5)
        {
            if(boxcheck==true){
                document.form.target = "_self";
                document.form.method = "post";
                document.form.action    = "/support/compare.php";
                document.form.submit();
            }else{
                alert('比較候補を選択してください');
            }
        }else{
                alert('比較できる5物件までです。');
        }
}
//一覧から削除
function JU_del_form(form,url)
{
    var boxcheck;

    boxcheck=false;
    for(i=0; i<document.form.length; i++){
            if( document.form.elements[i].checked == true ){
                boxcheck=true;
            }
    }
    if(document.form.length > 6)
    {
            if(boxcheck==true){
                document.form.target = "_self";
                document.form.method = "post";
                document.form.action    = url+"?del=1";
                document.form.submit();
            }else{
                alert('一覧から削除する物件を選択してください');
            }
    }else{
                alert('物件比較は2件以上選択する必要があります。');
    }
}
//お気に登録
function JU_send_favorite(form,url){
    var boxcheck;
    boxcheck=false;
    for(i=0; i<document.form.length; i++){
            if( document.form.elements[i].checked == true ){
                boxcheck=true;
        }
    }
    if(boxcheck==true){
        document.form.target = "_blank";
        document.form.method = "post";
        document.form.action    = url;
        document.form.submit();
    }else{
        alert('お気に入りに追加する物件を選択してください');
    }
}

function CA(form){
    for (var i=0;i<form.elements.length;i++){
        var e = form.elements[i];
        if ((e.name != 'checkall') && (e.type=='checkbox')){
            e.checked = form.checkall.checked;
        }
    }
}
//その他地域リンク
function other_list(form,url){    
    document.form.sort.value       = "";
    document.form.select_num.value = "";
    document.form.sch_flg.value    = "";
    document.form.target = "_self";
    document.form.action = url;
    document.form.submit();    
}
//地域検索
function sch_area(from,city_cd){
    document.form.city_cd.value    = city_cd;
    document.form.sort.value       = "";
    document.form.select_num.value = "";
    document.form.sch_flg.value    = "";
    document.form.target = "_self";
    document.form.action = "list.php";
    document.form.submit();    
}
function sch_line(form2,ensen)
{
    document.form2.ensen.value = ensen;
    document.form2.action = "../line/list.php";
    document.form2.target = "_self";
    document.form2.submit();
    
}

// おすすめ号外
function send_extra(form,url){
    document.form.target   = "_self";
    document.form.gazo_url.value = url;
    document.form.action   = "/recommend/extra/details.php";
    document.form.submit();
}
