﻿function dsp_set()
{
	map_bkn_search(1);
	$("#main_head").load("_mainHead.html");
	$("#info").load("_info.html");
}

function bukken_search(_para)
{
	var elmt = "mainContent"

	var result;
	if (document.all) {
	  // IE
	  result  = frames[elmt].document;
	} else {
	  // Mozilla
	  result = document.getElementById(elmt);
	}

	//var result = document.getElementById(elmt);
	var out = document.createElement('script');

	var para = encodeURI(_para);
	out.src="http://www.idk.jp/service/idekyo.bknsearch.php?para=" + para + "&elmt=" + elmt;

//	$("#main_head").load("_list_toti.html");
//	result.appendChild(document.createTextNode('my_text'));
//	result.appendChild(out);
$("#mainContent").html(out);
//	$("#info").load("_info.html");

}

function page(_para, _kbn)
{
	_params = _para + ";" + _kbn;
	bukken_search(_params)
}

function shousai(_para, _bknno)
{
	para = _para + ";" + _bknno;

	var elmt = "mainContent"

	var result;
	if (document.all) {
	  // IE
	  result  = frames[elmt].document;
	} else {
	  // Mozilla
	  result = document.getElementById(elmt);
	}

//	var result = document.getElementById(elmt);
	var out = document.createElement('script');

	var para = encodeURI(para);
	out.src="http://www.idk.jp/service/idekyo.meisai_uriti.php?para=" + para + "&elmt=" + elmt;

//	$("#main_head").load("_list_toti.html");
//	result.appendChild(document.createTextNode('my_text'));
	result.appendChild(out);
//	$("#info").load("_info.html");

}

function contact(_para)
{
	para = encodeURI(_para);
	location.href = "https://www.idekyo.com//mail_fudousan/contact.html?" + para;
}

function shousai_ie(_para, _bknno)
{
	para = _para + ";" + _bknno;

	var elmt = "mainContent"

	var result;
	if (document.all) {
	  // IE
	  result  = frames[elmt].document;
	} else {
	  // Mozilla
	  result = document.getElementById(elmt);
	}

//	var result = document.getElementById(elmt);
	var out = document.createElement('script');

	var para = encodeURI(para);
	out.src="http://www.idk.jp/service/idekyo.meisai_uriie.php?para=" + para + "&elmt=" + elmt;

//	$("#main_head").load("_list_toti.html");
//	result.appendChild(document.createTextNode('my_text'));
	result.appendChild(out);
//	$("#info").load("_info.html");

}


function button_search(_bknkb)
{
	$para  = _bknkb;
	$para += ";" + $("input[@name=radtiku]:checked").val();
	$para += ";";
	$para += ";" + $("select#price_str").val();
	$para += ";" + $("select#price_end").val();
	$para += ";" + $("select#area_str").val();
	$para += ";" + $("select#area_end").val();
	$para += ";0;0;0";
	bukken_search($para);
}
function map_bkn_search(num) {

	var n, d, previsit, expire;

	if(num > 10)
	{
		num = num - 10;
		d = new Date();
		previsit = d.toGMTString();
		d.setTime(d.getTime() + 2*60*60*1000);
		expire = d.toGMTString();
		setCookie("num", "" + num, expire);
	} else {
		if(document.cookie != "") {
		num = getCookie("num");
		num -= 0;
	}
}

switch(num) {
case 3:
case 4:
$bgcol = "#CE6F80";
$bkn   = "家";
$bukken   = 2;
$id    = 33;
$col   = "#CE6F80";
break;
default:
$bgcol = "#CE986D";
$bkn   = "地";
$bukken   = 1;
$id   = 23;
$col   = "#CE986D";
break;
}
//#CE6F80
$res = "<div id='main_head'></div>";
$res += "<table width='700'  border='0' cellpadding='0' cellspacing='0' bgcolor='" + $col + "'>";
$res += "<tr><td width='426'>";
switch(num) {

case 1:
$tikcd = 22210;
$res += "<img src='img_top/map_kensaku_to_fuji.gif' width='426' height='485' border='0' usemap='#tochi_fuji'>";
$res += "<map name='tochi_fuji'>";
$res += "<area shape='rect' coords='119,41,214,66' href='javascript:map_bkn_search(12)'>";
$res += "<area shape='rect' coords='215,1,419,32'  href='javascript:map_bkn_search(13)'>";
break;

case 2:
$tikcd = 22207;
$res += "<img src='img_top/map_kensaku_to_miya.gif' width='426' height='485' border='0' usemap='#tochi_miya'>";
$res += "<map name='tochi_miya'>";
$res += "<area shape='rect' coords='20,41,115,66' href='javascript:map_bkn_search(11)'>";
$res += "<area shape='rect' coords='215,1,419,32' href='javascript:map_bkn_search(13)'>";
break;
case 3:
$tikcd = 22210;
$res += "<img src='img_top/map_kensaku_ie_fuji.gif' width='426' height='485' border='0' usemap='#ie_fuji'>";
$res += "<map name='ie_fuji'>";
$res += "<area shape='rect' coords='118,40,216,66' href='javascript:map_bkn_search(14)'>";
$res += "<area shape='rect' coords='13,-1,214,32'  href='javascript:map_bkn_search(11)'>";
break;

case 4:
$tikcd = 22207;
$res += "<img src='img_top/map_kensaku_ie_miya.gif' width='426' height='485' border='0' usemap='#ie_miya'>";
$res += "<map name='ie_miya'>";
$res += "<area shape='rect' coords='19,39,117,65' href='javascript:map_bkn_search(13)'>";
$res += "<area shape='rect' coords='13,-1,214,32' href='javascript:map_bkn_search(11)'>";
break;

default:
$tikcd = 22210;
$res += "<img src='/assets/images/img_top/map_kensaku_to_fuji.gif' width='426' height='482' border='0' usemap='#tochi_fuji'>";
$res += "<map name='tochi_fuji'>";
$res += "<area shape='rect' coords='119,41,214,66' href='javascript:map_bkn_search(12)'>";
$res += "<area shape='rect' coords='215,1,419,32'  href='javascript:map_bkn_search(13)'>";
break;
}

$wk = "javascript:bukken_search(\"" +$bukken + ";" + $tikcd + ";";
$wk2 = ";0;0;0;0;0;0;0\")";

if($tikcd == 22210){
$res += "<area shape='rect' coords='208,85,278,103' href='" + $wk + "大淵第二" + $wk2 + "' alt='大淵第二'>";
$res += "<area shape='rect' coords='123,137,193,156' href='" + $wk + "大淵第一" + $wk2 + "' alt='大淵第一'>";
$res += "<area shape='rect' coords='17,161,59,180' href='" + $wk + "天間" + $wk2 + "' alt='天間'>";
$res += "<area shape='rect' coords='52,188,94,207' href='" + $wk + "鷹岡" + $wk2 + "' alt='鷹岡'>";
$res += "<area shape='rect' coords='96,202,127,221' href='" + $wk + "丘" + $wk2 + "' alt='丘'>";
$res += "<area shape='rect' coords='179,194,234,213' href='" + $wk + "青葉台" + $wk2 + "' alt='青葉台'>";
$res += "<area shape='rect' coords='290,163,361,182' href='" + $wk + "吉永第二" + $wk2 + "' alt='吉永第二'>";
$res += "<area shape='rect' coords='240,176,283,195' href='" + $wk + "神戸" + $wk2 + "' alt='神戸'>";
$res += "<area shape='rect' coords='133,220,175,239' href='" + $wk + "広見" + $wk2 + "' alt='広見'>";
$res += "<area shape='rect' coords='207,221,277,240' href='" + $wk + "富士見台" + $wk2 + "' alt='富士見台'>";
$res += "<area shape='rect' coords='221,304,263,323' href='" + $wk + "原田" + $wk2 + "' alt='原田'>";
$res += "<area shape='rect' coords='182,325,224,344' href='" + $wk + "今泉" + $wk2 + "' alt='今泉'>";
$res += "<area shape='rect' coords='251,324,321,343' href='" + $wk + "吉永第一" + $wk2 + "' alt='吉永第一'>";
$res += "<area shape='rect' coords='326,326,369,345' href='" + $wk + "須津" + $wk2 + "' alt='須津'>";
$res += "<area shape='rect' coords='33,244,89,264' href='" + $wk + "岩松北" + $wk2 + "' alt='岩松北'>";
$res += "<area shape='rect' coords='72,289,114,308' href='" + $wk + "伝法" + $wk2 + "' alt='伝法'>";
$res += "<area shape='rect' coords='13,312,56,331' href='" + $wk + "岩松小" + $wk2 + "' alt='岩松'>";
$res += "<area shape='rect' coords='60,309,129,327' href='" + $wk + "富士中央" + $wk2 + "' alt='富士中央'>";
$res += "<area shape='rect' coords='28,331,99,349' href='" + $wk + "富士第一" + $wk2 + "' alt='富士第一'>";
$res += "<area shape='rect' coords='43,364,114,382' href='" + $wk + "富士第二" + $wk2 + "' alt='富士第二'>";
$res += "<area shape='rect' coords='18,433,75,452' href='" + $wk + "富士南" + $wk2 + "' alt='富士南'>";
$res += "<area shape='rect' coords='115,403,171,422' href='" + $wk + "田子浦" + $wk2 + "' alt='田子浦'>";
$res += "<area shape='rect' coords='237,398,293,416' href='" + $wk + "元吉原" + $wk2 + "' alt='元吉原'>";
$res += "<area shape='rect' coords='140,326,182,345' href='" + $wk + "吉原" + $wk2 + "' alt='吉原'>";
$res += "<area shape='rect' coords='370,353,401,372' href='" + $wk + "東" + $wk2 + "' alt='東'>";
} else {
$res += "<area shape='rect' coords='167,99,223,128' href='" + $wk + "井之頭小根" + $wk2 + "' alt='井の頭'>";
$res += "<area shape='rect' coords='84,142,141,163' href='" + $wk + "井之頭小" + $wk2 + "' alt='井の頭'>";
$res += "<area shape='rect' coords='167,174,210,193' href='" + $wk + "人穴" + $wk2 + "' alt='人穴'>";
$res += "<area shape='rect' coords='97,220,140,239' href='" + $wk + "白糸" + $wk2 + "' alt='白糸'>";
$res += "<area shape='rect' coords='133,239,190,259' href='" + $wk + "上井出" + $wk2 + "' alt='上井出'>";
$res += "<area shape='rect' coords='148,285,191,304' href='" + $wk + "北山" + $wk2 + "' alt='北山'>";
$res += "<area shape='rect' coords='122,315,165,333' href='" + $wk + "上野" + $wk2 + "' alt='上野'>";
$res += "<area shape='rect' coords='212,327,255,346' href='" + $wk + "山宮" + $wk2 + "' alt='山宮'>";
$res += "<area shape='rect' coords='286,315,354,344' href='" + $wk + "富士根北粟"+ $wk2 + "' alt='富士根北粟倉分校'>";
$res += "<area shape='rect' coords='246,346,315,364' href='" + $wk + "富士根北" + $wk2 + "' alt='富士根北'>";
$res += "<area shape='rect' coords='150,376,193,395' href='" + $wk + "富丘" + $wk2 + "' alt='富丘'>";
$res += "<area shape='rect' coords='119,410,163,430' href='" + $wk + "貴船" + $wk2 + "' alt='貴船'>";
$res += "<area shape='rect' coords='167,410,210,428' href='" + $wk + "大宮" + $wk2 + "' alt='大宮'>";
$res += "<area shape='rect' coords='115,452,144,471' href='" + $wk + "西" + $wk2 + "' alt='西'>";
$res += "<area shape='rect' coords='211,420,237,440' href='" + $wk + "東" + $wk2 + "' alt='東'>";
$res += "<area shape='rect' coords='189,453,233,473' href='" + $wk + "黒田" + $wk2 + "' alt='黒田'>";
$res += "<area shape='rect' coords='209,364,269,384' href='" + $wk + "大富士" + $wk2 + "' alt='大富士'>";
$res += "<area shape='rect' coords='227,386,286,406' href='" + $wk + "富士見" + $wk2 + "' alt='富士見'>";
$res += "<area shape='rect' coords='261,409,333,428' href='" + $wk + "富士根南" + $wk2 + "' alt='富士根南'>";
}

$res += "</map></td>";
$res += "<td width='274' align='left' valign='top'><table width='274' border='0' cellpadding='10' cellspacing='0'>";
$res += "<tr>";
$res += "<td width='253' align='left' valign='top' nowrap bgcolor='#FFFFFF'><img src='img_top/spacer.gif' width='13' height='13'></td>";
$res += "</tr>";
$res += "<tr>";
$res += "<td align='left' valign='top' nowrap bgcolor='" + $col + "'><img src='img_top/spacer.gif' width='13' height='13'></td>";
$res += "</tr>";
$res += "<tr>";
$res += "<td align='left' valign='top' nowrap bgcolor='" + $col + "'><p class='cblack'><strong>●条件で売地を探す</strong></p>";
$res += "<p class='cblack'>";
$res += "<label>";
$res += "<input type='radio' name='radtiku' value='22210' checked>";
$res += "</label>";
$res += "富士市　";
$res += "<label>";
$res += "<input type='radio' name='radtiku' value='22207'>";
$res += "</label>";
$res += "富士宮市</p>";
$res += "<p>";
$res += "<label>";
$res += "<select id='price_str'>";
$res += "<option value='0'>指定なし";
$res += "<option value='200'>200万";
$res += "<option value='500'>500万";
$res += "<option value='1000'>1000万";
$res += "<option value='2000'>2000万";
$res += "<option value='3000'>3000万";
$res += "<option value='4000'>4000万";
$res += "<option value='5000'>5000万"
$res += "<option value='6000'>6000万";
$res += "<option value='7000'>7000万";
$res += "<option value='8000'>8000万";
$res += "<option value='9000'>9000万";
$res += "<option value='10000'>1億";
$res += "</select>";
$res += "</label>";
$res += "円以上";
$res += "<label>";
$res += "<select id='price_end'>";
$res += "<option value='0'>指定なし";
$res += "<option value='200'>200万";
$res += "<option value='500'>500万";
$res += "<option value='1000'>1000万";
$res += "<option value='2000'>2000万";
$res += "<option value='3000'>3000万";
$res += "<option value='4000'>4000万";
$res += "<option value='5000'>5000万";
$res += "<option value='6000'>6000万";
$res += "<option value='7000'>7000万";
$res += "<option value='8000'>8000万";
$res += "<option value='9000'>9000万";
$res += "<option value='10000'>1億";
$res += "</select>";
$res += "</label>";
$res += "円以内";
$res += "</p>";
$res += "<p>";
$res += "<label>";
$res += "<select id='area_str'>";
$res += "<option value='0'>指定なし</option>";
$res += "<option value='50'>50</option>";
$res += "<option value='100'>100</option>";
$res += "<option value='150'>150</option>";
$res += "<option value='200'>200</option>";
$res += "<option value='250'>250</option>";
$res += "<option value='300'>300</option>";
$res += "</select>";
$res += "m<sup>2</sup>以上";
$res += "</label>";
$res += "<label>";
$res += "<select id='area_end'>";
$res += "<option value='0'>指定なし</option>";
$res += "<option value='50'>50</option>";
$res += "<option value='100'>100</option>";
$res += "<option value='150'>150</option>";
$res += "<option value='200'>200</option>";
$res += "<option value='250'>250</option>";
$res += "<option value='300'>300</option>";
$res += "</select>";
$res += "m<sup>2</sup>以内";
$res += "</label>";
$res += "</p>";
$res += "<p>&nbsp;</p>";
$res += "<p>";
$res += "<label>";
$res += "<input type='button' onclick='button_search("+$bukken+")' value='検　索　'>";
$res += "</label>";
$res += "<label>";
$res += "<input type='button' onclick='map_bkn_search(1);' value='リセット'>";
$res += "</label>";
$res += "</p>";
$res += "<p>&nbsp;</p>";
$res += "<p>●分譲地、宅地など住宅を建てる土地を<br>";
$res += "お探しの方はぜびご利用ください。</p></td>";
$res += "</tr>";
$res += "</table></td>";
$res += "</tr>";
$res += "</table>";

$("#mainContent").html($res);
$("#main_head").load("_mainHead.html");
$("#info").load("_info.html");

}

function setCookie(item, value, d) {
    document.cookie = item + "=" + value + ";expires=" + d;
}

function getCookie(item) {
    var i, index, arr;
    arr = document.cookie.split(";");
    for(i = 0; i < arr.length; i++) {
        index = arr[i].indexOf("=");
        if(arr[i].substring(0, index) == item || 
                arr[i].substring(0, index) == " " + item)
            return arr[i].substring(index + 1);
    }
    return "1";
}
