function google_map(ido, keido, mode){
	this.mode = mode;
	this.ido = ido;
	this.keido = keido;
	this.markers = new Array();
	this.all_tabs = new Array();
	this.div = document.getElementById("map");
	this.streetObj = new GStreetviewPanorama(document.getElementById("street"));

	this.map=new GMap2(this.div), {size:new GSize(800,600)};
	this.geocoder = new GClientGeocoder();
	this.map.enableContinuousZoom();
	if (!this.ido && !this.keido){
		this.ido = 33.5525090;
		this.keido = 130.4364570;
		//alert("検索結果がありません");
	}
	this.init_point = new GLatLng(this.ido, this.keido);
	this.map.setCenter(this.init_point);
	
	//var screenXY = new GScreenPoint(0.5, 0.5, "fraction", "fraction");
    //var overlayXY = new GScreenPoint(0.5, 0.5, "fraction", "fraction");
    //var size = new GScreenSize(10, 10);
    //var soverlay = new GScreenOverlay("http://www.google.com/intl/en_ALL/mapfiles/dir_0.png", screenXY, overlayXY, size);
    //this.map.addOverlay(soverlay);
	
	//ストリートビューオーバーレイ（青紫の線）
	//streetview = new GStreetviewOverlay();
	//this.map.addOverlay(streetview);

	
	this.setYaw = 90 - Math.atan2(this.ido, this.keido) * 180 / Math.PI;
	if(this.setYaw < 0){
		this.setYaw += 360;
	}
	this.setPitch = 10;
	this.streetObj.setLocationAndPOV(this.init_point, {pitch:this.setPitch});
	
	
		
	if (document.URL.match(/bukken/i)) {
		//物件登録・編集画面
	    this.map.setZoom(20);
	}else{
		//物件詳細画面
		this.map.setZoom(15);
	}

	this.map.addControl(new GSmallMapControl());
	//this.map.addControl(new GLargeMapControl());
	if (document.getElementById("map_mode")) {
		if (document.getElementById("map_mode").innerHTML == 'search' || document.getElementById("map_mode").innerHTML == 'view') {
			this.map.addControl(new GMapTypeControl());
		}
		//else alert(document.getElementById("map_mode").innerHTML);
	}
	//賃貸物件に使うアイコン
	//アパート
	this.icon = new GIcon();
	this.icon.image = "/images/pin_apart.png";
	//this.icon.shadow = "/images/pin_shade_bukken.png";
	//this.icon.iconSize = new GSize(34, 32);
	this.icon.iconSize = new GSize(48, 37);
	//this.icon.shadowSize = new GSize(45, 32);
	//this.icon.iconAnchor = new GPoint(15, 36);
	this.icon.iconAnchor = new GPoint(8, 34);
	this.icon.infoWindowAnchor = new GPoint(15, 0);

	//マンション
	this.icon2 = new GIcon();
	this.icon2.image = "/images/pin_mansion.png";
	this.icon2.iconSize = new GSize(48, 37);
	this.icon2.iconAnchor = new GPoint(8, 34);
	this.icon2.infoWindowAnchor = new GPoint(15, 0);

	//一戸建て
	this.icon3 = new GIcon();
	this.icon3.image = "/images/pin_kodate.png";
	this.icon3.iconSize = new GSize(48, 37);
	this.icon3.iconAnchor = new GPoint(8, 34);
	this.icon3.infoWindowAnchor = new GPoint(15, 0);

	//SOHO
	this.icon4 = new GIcon();
	this.icon4.image = "/images/pin_soho.png";
	this.icon4.iconSize = new GSize(48, 37);
	this.icon4.iconAnchor = new GPoint(8, 34);
	this.icon4.infoWindowAnchor = new GPoint(15, 0);


	//不動産に使うアイコン
	/*
	this.icon2 = new GIcon();
	this.icon2.image = "/images/pin_fudosan.png";
	this.icon2.shadow = "/images/pin_shade_fudosan.png";
	this.icon2.iconSize = new GSize(32, 45);
	this.icon2.shadowSize = new GSize(61, 45);
	this.icon2.iconAnchor = new GPoint(15, 36);
	this.icon2.infoWindowAnchor = new GPoint(15, 0);

	//売買物件に使うアイコン
	this.icon3 = new GIcon();
	this.icon3.image = "/images/pin_sale.png";
	this.icon3.shadow = "/images/pin_shade_bukken.png";
	this.icon3.iconSize = new GSize(32, 38);
	this.icon3.shadowSize = new GSize(61, 38);
	this.icon3.iconAnchor = new GPoint(15, 36);
	this.icon3.infoWindowAnchor = new GPoint(15, 0);
	*/
		
	//マップを目的地までずらす関数
	this.center_map = function(center) {
		this.map.panTo(center);
		//alert("ok "+center.toString());
		if (this.mode == "edit") {
			this.markers[this.markers.length-1].setPoint(center);
		}
	};

	//登録時の「ズレ過ぎ」の計算に使用されるマップの中心を更新。
	this.set_hardcenter = function(center) {
		this.ido=center.lat();
		this.keido=center.lng();
	};

	this.center_map2 = function(point){
		
		this.map.setCenter(point);
	}
	
	this.autozoom = function() {
		//bounds = new GBounds(this.markers);
		var bounds = new GLatLngBounds();
		for (var i = 0; i < this.markers.length; i+=1) {
			bounds.extend(this.markers[i].getPoint());
		}
		var sw = bounds.getSouthWest();
		var ne = bounds.getNorthEast();
		var y2 = ne.lat();
		var x2 = ne.lng();
		var y1 = sw.lat();
		var x1 = sw.lng();
		var percent = 20;
		x1 -= (x2 - x1)*percent/100;
		x2 += (x2 - x1)*percent/100;
		y1 -= (y2 - y1)*percent/100;
		y2 += (y2 - y1)*percent/100;
		bounds.extend(new GLatLng(y1,x1));
		bounds.extend(new GLatLng(y2,x2));
		bounds.extend(new GLatLng(y1,x2));
		bounds.extend(new GLatLng(y2,x1));
		//alert(sw.lat()+','+sw.lng()+' / '+ne.lat()+','+ne.lng()+' /// '+y1+','+x1+' / '+y2+','+x2);
		var zoom = this.map.getBoundsZoomLevel(bounds);
		var bounds_center = bounds.getCenter();
		if (this.markers.length<1){
			//alert(this.markers.length);
			zoom = 11;
			bounds_center = new GLatLng(33.606578,130.417972);
		}
		//alert(zoom+" "+bounds.getCenter().toString());
		this.center_map(bounds_center);
		//this.add_marker(bounds_center);
		this.map.setZoom(zoom);
	};

	this.get_results_data = function() {
		if (document.getElementById("map_mode")) {
			this.map_mode=document.getElementById("map_mode").innerHTML;
		}
		if (document.getElementById("map_search")) {
			this.map_search=document.getElementById("map_search").innerHTML;
		}
		if (document.getElementById("map_ido")) {
			this.map_ido=document.getElementById("map_ido").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_ido.pop(); }
		}
		if (document.getElementById("map_keido")) {
			this.map_keido=document.getElementById("map_keido").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_keido.pop(); }
		}
		if (document.getElementById("map_name")) {
			this.map_name=document.getElementById("map_name").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_name.pop(); }
		}
		if (document.getElementById("map_jusho")) {
			this.map_jusho=document.getElementById("map_jusho").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_jusho.pop(); }
		}
		if (document.getElementById("map_madori")) {
			this.map_madori=document.getElementById("map_madori").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_madori.pop(); }
		}
		if (document.getElementById("map_chinryo")) {
			this.map_chinryo=document.getElementById("map_chinryo").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_chinryo.pop(); }
		}
		if (document.getElementById("map_shubetsu")) {
			this.map_shubetsu=document.getElementById("map_shubetsu").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_shubetsu.pop(); }
		}
		if (document.getElementById("map_kakaku")) {
			this.map_kakaku=document.getElementById("map_kakaku").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_kakaku.pop(); }
		}
		if (document.getElementById("map_id")) {
			this.map_id=document.getElementById("map_id").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_id.pop(); }
		}
		if (document.getElementById("map_chintaibaibai")) {
			this.map_chintaibaibai=document.getElementById("map_chintaibaibai").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_chintaibaibai.pop(); }
		}
		if (document.getElementById("map_fudosan_id")) {
			this.map_fudosan_id=document.getElementById("map_fudosan_id").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_fudosan_id.pop(); }
		}
		if (document.getElementById("map_fudosan_user")) {
			this.map_fudosan_user=document.getElementById("map_fudosan_user").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_fudosan_user.pop(); }
		}
		if (document.getElementById("map_fudosan_name")) {
			this.map_fudosan_name=document.getElementById("map_fudosan_name").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_fudosan_name.pop(); }
		}
		if (document.getElementById("map_fudosan_jusho")) {
			this.map_fudosan_jusho=document.getElementById("map_fudosan_jusho").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_fudosan_jusho.pop(); }
		}
		if (document.getElementById("map_fudosan_phone")) {
			this.map_fudosan_phone=document.getElementById("map_fudosan_phone").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_fudosan_phone.pop(); }
		}
		if (document.getElementById("map_fudosan_mail")) {
			this.map_fudosan_mail=document.getElementById("map_fudosan_mail").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_fudosan_mail.pop(); }
		}
		if (document.getElementById("map_pictures")) {
			this.map_pictures=document.getElementById("map_pictures").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_pictures.pop(); }
		}
		if (document.getElementById("map_logos")) {
			this.map_logos=document.getElementById("map_logos").innerHTML.split("|");
			if (this.map_mode == "search") { this.map_logos.pop(); }
		}
	};

	this.attach_click = function(pointer) {
		this.idokeido_listener = GEvent.addListener(this.map, "click", function(click_overlay, click_point) {
			if ( click_overlay !== null ) { return; }
			map1.center_map(click_point);
			var field_ido = document.getElementById("ido");
			if(field_ido) {
				field_ido.value = click_point.lat();
			}
			var field_keido = document.getElementById("keido");
			if(field_keido) {
				field_keido.value = click_point.lng();
			}
			if(map1.markers[map1.markers.length-1]) {
				var point_backup = new GLatLng(map1.ido,map1.keido);
				if (click_point.distanceFrom(point_backup)>1000) {
					//document.getElementById("idokeido_msg").innerHTML = "計算した緯度経度から１キロも外れるが、いいですか？";
					//alert(document.getElementById("idokeido_msg"));
					my_form.idokeido_msg.id.innerHTML = "計算した緯度経度から１キロも外れるが、いいですか？";
				} else { document.getElementById("idokeido_msg").innerHTML = ""; }
			}
		});
	};

	this.add_marker = function(point,i) {
		if (this.map_search == 'mixed') {
			if (this.markers.length === 0) {
				this.add_marker_fudosan(point);
			} else if (this.map_chintaibaibai[this.markers.length] == '売買') {
				this.add_marker_sale(point);
			} else {
				this.add_marker_rental(point);
			}
		}else if (this.map_search == 'fudosan') {
			this.add_marker_fudosan(point);
		}else if (this.map_mode == 'kakunin') {
			if (this.map_search == '賃貸') {
				this.add_marker_rental(point);
			}else if (this.map_search == '売買') {
				this.add_marker_sale(point);
			}else if (this.map_search == 'user') {
				this.add_marker_fudosan(point);
			}
		}else if (this.map_mode == 'home') {
			this.add_marker_fudosan(point);
		} else if (this.map_chintaibaibai) {
			//alert(this.map_id[this.markers.length]);
			if (this.map_chintaibaibai[this.markers.length] == '売買') {
				this.add_marker_sale(point);
			} else {
				if(this.map_shubetsu){
					if (this.map_shubetsu[i] == 'マンション') {
						this.add_marker_mansion(point);
					}else if (this.map_shubetsu[i] == '一戸建て') {
						this.add_marker_kodate(point);
					}else if (this.map_shubetsu[i] == 'SOHO') {
						this.add_marker_soho(point);
					}else{
						this.add_marker_rental(point);
					}
				} else {
						this.add_marker_rental(point);
				}
			}
		}else if (this.map_mode == 'edit') {
			if (this.map_search == 'user') {
				this.add_marker_fudosan(point);
			} else {
				this.add_marker_rental(point);
			}
		}else if (this.map_shubetsu[i] == 'マンション') {
			this.add_marker_mansion(point);
		}else if (this.map_shubetsu[i] == '一戸建て') {
			this.add_marker_kodate(point);
		}else if (this.map_shubetsu[i] == 'SOHO') {
			this.add_marker_soho(point);
		} else {
			this.add_marker_rental(point);
		}
	};

	this.add_marker_rental = function(point) {
		this.markers.push(new GMarker(point, this.icon));
		this.map.addOverlay(this.markers[this.markers.length-1]);
	};
	this.add_marker_mansion = function(point) {
		this.markers.push(new GMarker(point, this.icon2));
		this.map.addOverlay(this.markers[this.markers.length-1]);
	};
	this.add_marker_kodate = function(point) {
		this.markers.push(new GMarker(point, this.icon3));
		this.map.addOverlay(this.markers[this.markers.length-1]);
	};
	this.add_marker_soho = function(point) {
		this.markers.push(new GMarker(point, this.icon4));
		this.map.addOverlay(this.markers[this.markers.length-1]);
	};

/*
	this.add_marker_sale = function(point) {
		this.markers.push(new GMarker(point, this.icon3));
		this.map.addOverlay(this.markers[this.markers.length-1]);
	};

	this.add_marker_fudosan = function(point) {
		this.markers.push(new GMarker(point, this.icon2));
		this.map.addOverlay(this.markers[this.markers.length-1]);
	};
*/
	this.change_marker = function(rentalsale) {
		var latlng = this.markers[this.markers.length-1].getPoint();
		/*var old_rentalsale;
		if(this.markers[this.markers.length-1].getIcon().image.indexOf('rental')) {
			old_rentalsale = 'rental';
		} else {//if(this.markers[this.markers.length-1].getIcon().image.indexOf('sale')) {
			old_rentalsale = 'sale';
		}
		if(rentalsale != old_rentalsale){*/
			//alert("old_rentalsale="+old_rentalsale+" rentalsale="+rentalsale+" len="+this.markers.length)
			GEvent.removeListener(this.idokeido_listener);
			this.map.removeOverlay(this.markers[this.markers.length-1]);
			if(rentalsale=='sale') {
				this.add_marker_sale(latlng);
			} else {
				this.add_marker_rental(latlng);
			}
		//}
		if (this.map_mode == "edit") {
			map1.attach_click(map1.markers[this.markers.length-1], 0);
			var marker = map1.markers[this.markers.length-1];
		}
	};

	this.tabbed_info = function() {
		if (this.map_jusho.length != this.markers.length) {
			alert ("インフォウィンドーのデータは正しく読み込む事が出来ませんでした");
			return 1;
		}
		this.tabs = new Array();
		var i = 0;
		var logo_size;
		var bukken_info = "";
		var fudosan_info = "";
		if (this.map_search == 'fudosan') {
			for (i = 0; i < this.map_jusho.length; i+=1) {
				if (this.map_logos[i]) {
					logo_size = resize_image("http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i], 80, 60);
				}
				fudosan_info  = "<div class=\"balloon\">";
				if (this.map_logos[i]) {
					fudosan_info += "<div class=\"balloon_img\"><img src=\"http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i] + "\" alt=\"" + this.map_fudosan_name[i] + "ロゴ\" width=\"" + logo_size[0] + "\" height=\"" + logo_size[1] + "\" /></div>";
				}
				fudosan_info += "<div class=\"balloon_right\">";
				fudosan_info += "<h2>" + this.map_fudosan_name[i] + "</h2>";
				fudosan_info += "<h3>" + this.map_jusho[i] + "</h3>";
				fudosan_info += "<p class=\"balloon_tel\">TEL " + this.map_fudosan_phone[i] + "</p>";
				fudosan_info += "<p class=\"balloon_detail\"><a href=\"http://www.fukuoka-chintai.com/" + this.map_fudosan_user[i] + "\">会社の詳細</a></p>";
				fudosan_info += "<p class=\"balloon_contact\"><a href=\"http://www.fukuoka-chintai.com/contact/fudosan/" + this.map_id[i] + "\">お問合せ</a></p>";
				fudosan_info += "<br class=\"close\" /></div><br class=\"close\" /></div>";
				this.tabs.push(fudosan_info);
				this.add_window(i);
			}
		} else if (this.map_search == 'mixed') {
			for (i = 0; i < 1; i+=1) {
				if (this.map_logos[i]) {
					logo_size = resize_image("http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i], 80, 60);
				}
				fudosan_info  = "<div class=\"balloon\">";
				if (this.map_logos[i]) {
					fudosan_info += "<div class=\"balloon_img\"><img src=\"http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i] + "\" alt=\"" + this.map_fudosan_name[i] + "ロゴ\" width=\"" + logo_size[0] + "\" height=\"" + logo_size[1] + "\" /></div>";
				}
				fudosan_info += "<div class=\"balloon_right\">";
				fudosan_info += "<h2>" + this.map_fudosan_name[i] + "</h2>";
				fudosan_info += "<h3>" + this.map_jusho[i] + "</h3>";
				fudosan_info += "<p class=\"balloon_tel\">TEL " + this.map_fudosan_phone[i] + "</p>";
				fudosan_info += "<p class=\"balloon_detail\"><a href=\"http://www.fukuoka-chintai.com/" + this.map_fudosan_user[i] + "\">会社の詳細</a></p>";
				fudosan_info += "<p class=\"balloon_contact\"><a href=\"http://www.fukuoka-chintai.com/contact/fudosan/" + this.map_id[i] + "\">お問合せ</a></p>";
				fudosan_info += "<br class=\"close\" /></div><br class=\"close\" /></div>";
				this.tabs.push(fudosan_info);
				this.add_window(i);
			}
			for (i = 1; i < this.map_jusho.length; i+=1) {
				if (this.map_logos[i]) {
					logo_size = resize_image("http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i], 80, 60);
				}
				bukken_info  = "<div class=\"balloon\">";
				if (this.map_pictures[i]) {
					bukken_info += "<div class=\"balloon_img\"><img src=\"http://www.fukuoka-chintai.com/thumbs/" + this.map_pictures[i] + "\" alt=\"" + this.map_name[i] + "\" width=\"80\" height=\"60\" /></div>";
				}
				bukken_info += "<div class=\"balloon_right\">";
				bukken_info += "<h2>" + this.map_name[i] + "</h2>";
				//bukken_info += "<h3>" + this.map_jusho[i] + "</h3>";
				if (this.map_chintaibaibai[i]=="賃貸") {
					bukken_info += "<p class=\"balloon_tel\">間取り：" + this.map_madori[i] + "｜賃料：￥" + this.map_chinryo[i] + "</p>";
					bukken_info += "<p class=\"balloon_bukken_detail\"><a href=\"www.fukuoka-chintai.com/" + this.map_id[i] + "\">物件の詳細</a></p>";
				} else if (this.map_chintaibaibai[i]=="売買") {
					bukken_info += "<p class=\"balloon_tel\">間取り：" + this.map_madori[i] + "｜価格：" + this.map_kakaku[i] + "</p>";
					bukken_info += "<p class=\"balloon_bukken_detail\"><a href=\"www.fukuoka-chintai.com/" + this.map_id[i] + "\">物件の詳細</a></p>";
				}
				/*bukken_info += "<p class=\"balloon_contact\"><a href=\"http://www.fukuoka-chintai.com/contact/bukken/" + this.map_id[i] + "\">お問合せ</a></p>";
				bukken_info += "<br class=\"close\" /></div><br class=\"close\" /></div>";*/
				fudosan_info  = "<div class=\"balloon\">";
				if (this.map_logos[i]) {
				fudosan_info += "<div class=\"balloon_img\"><img src=\"http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i] + "\" alt=\"" + this.map_fudosan_name[i] + "ロゴ\" width=\"" + logo_size[0] + "\" height=\"" + logo_size[1] + "\" /></div>";
				}
				fudosan_info += "<div class=\"balloon_right\">";
				fudosan_info += "<h2>" + this.map_fudosan_name[i] + "</h2>";
				fudosan_info += "<h3>" + this.map_jusho[i] + "</h3>";
				fudosan_info += "<p class=\"balloon_tel\">TEL " + this.map_fudosan_phone[i] + "</p>";
				fudosan_info += "<p class=\"balloon_detail\"><a href=\"http://www.fukuoka-chintai.com/" + this.map_fudosan_user[i] + "\">会社の詳細</a></p>";
				fudosan_info += "<p class=\"balloon_contact\"><a href=\"http://www.fukuoka-chintai.com/contact/fudosan/" + this.map_fudosan_id[i] + "\">お問合せ</a></p>";
				fudosan_info += "<br class=\"close\" /></div><br class=\"close\" /></div>";
				this.tabs.push(new info_tabs("物件",	bukken_info, "不動産", fudosan_info ));
				this.add_tabs(i);
			}
		} else {
			for (i = 0; i < this.map_jusho.length; i+=1) {
				if (this.map_logos[i]) {
					logo_size = resize_image("http://www.fukuoka-chintai.com/pictures/" + this.map_logos[i], 80, 60);
				}
				bukken_info  = "<div class=\"balloon\">";
				/*if (this.map_pictures[i]) {
					bukken_info += "<div class=\"balloon_img\"><img src=\"http://www.fukuoka-chintai.com/thumbs/" + this.map_pictures[i] + "\" alt=\"" + this.map_name[i] + "\" width=\"80\" height=\"60\" /></div>";
				}
				*/
				//bukken_info += "<div class=\"balloon_right\">";
				bukken_info += "<h2>" + this.map_name[i] + "</h2>";
				bukken_info += "<p class=\"balloon_tel\">間取り：" + this.map_madori[i] + "｜賃料：￥" + this.map_chinryo[i] + "</p>";
				bukken_info += "<p class=\"balloon_bukken_detail\"><a href=\"http://www.fukuoka-chintai.com/" + this.map_id[i] + "\" target=\"_blank\">物件の詳細</a>";
				bukken_info += "</div>";
				/*
				this.tabs.push(new info_tabs2("物件",bukken_info));
				this.add_tabs(i);
				*/
				this.tabs.push(bukken_info);
				this.add_window(i);
			}
		}
	};

	this.add_tabs = function(index) {
		GEvent.addListener(this.markers[index], "click", function() {
			this.openInfoWindowTabsHtml(map1.tabs[index].tabs);
			for (i=0; i<results.length; i=i+1) {
				if (i != index){
					//results[i].className = 'results';
					//results[i].className = 'clickable_list_item';
				}
			}
			//return this.className = 'results_selected';
			//divから変更したので不具合
			//results[index].className = 'clickable_list_item_selected';
			//return results[index].className;
		});
	};

	this.add_window = function(index) {
		GEvent.addListener(this.markers[index], "click", function() {
			this.openInfoWindowHtml(map1.tabs[index]);
			
			/*
			for (i=0; i<results.length; i=i+1) {
				if (i != index) {
					//results[i].className = 'results';
					//results[i].className = 'clickable_list_item';
				}
			}
			*/
			//return this.className = 'results_selected';
			//results[index].className = 'clickable_list_item_selected';
			return results[index].className;
		});
	};

	this.attach_click_to_result = function(element, counter) {
		element.style.cursor = 'pointer';
		//element.onmouseover = function(){ return this.className = 'results_over'; };
		//element.onmouseout = function(){ return this.className = 'results'; };
		//element.onclick = function(counter){ 
		
		/*
		element.onmouseover = function(counter){ 
			for (i=0; i<results.length; i=i+1) {
				if (i != counter) {
					//results[i].className = 'results';
					results[i].className = 'clickable_list_item';
				}
			}
			//return this.className = 'results_selected';
			this.className = 'clickable_list_item_selected';
			return this.className;
		};
		*/
			
		//element.className = 'results_selected';
		//GEvent.addDomListener(element, "click", function() {
		GEvent.addDomListener(element, "mouseover", function() {
			//map1.center_map(map1.markers[counter].getPoint());
			/*
			if (map1.map_search == 'fudosan') {
				map1.markers[counter].openInfoWindowHtml(map1.tabs[counter]);
			} else if (map1.map_search == 'mixed') {
				if (counter === 0) {
					map1.markers[counter].openInfoWindowHtml(map1.tabs[counter]);
				} else {
					map1.markers[counter].openInfoWindowTabsHtml(map1.tabs[counter].tabs);
				}
			} else {
				map1.markers[counter].openInfoWindowTabsHtml(map1.tabs[counter].tabs);
			}
			*/
			map1.markers[counter].openInfoWindowHtml(map1.tabs[counter]);
		});
	};

	return true;
}

function info_tabs(label1, body1, label2, body2){
	this.label1 = label1;
	this.label2 = label2;
	this.body1 = body1;
	this.body2 = body2;
	this.tab1 = new GInfoWindowTab(this.label1,this.body1);
	this.tab2 = new GInfoWindowTab(this.label2,this.body2);
	this.tabs = [ this.tab1, this.tab2 ];

	return true;
}

function info_tabs2(label1, body1){
	this.label1 = label1;
	this.body1 = body1;
	this.tab1 = new GInfoWindowTab(this.label1,this.body1);
	this.tabs = [ this.tab1];

	return true;
}

function form(){
	//take names（フィールドなどの使えるidをオブジェクトで登録）

	//if (typeof map1 != "undefined") { this.map = map1; }
	this.form = new form_field(document.getElementById('form1'));
	this.msgid = new form_field(document.getElementById('form_msg'));
	this.todofuken = new form_field(document.getElementById('todofuken'));
	this.todofuken.msgid = new form_field(document.getElementById('todofuken_msg'));
	this.shikuchoson = new form_field(document.getElementById('shikuchoson'));
	this.shikuchoson.msgid = new form_field(document.getElementById('shikuchoson_msg'));
	this.ooazamachichome = new form_field(document.getElementById('ooazamachichome'));
	this.ooazamachichome.msgid = new form_field(document.getElementById('ooazamachichome_msg'));
	this.gaikufugochiban = new form_field(document.getElementById('gaikufugochiban'));
	this.gaikufugochiban.msgid = new form_field(document.getElementById('gaikufugochiban_msg'));
	this.jusho = new form_field(document.getElementById('jusho'));
	this.jusho.msgid = new form_field(document.getElementById('jusho_msg'));
	this.get_idokeido = new form_field(document.getElementById('get_idokeido'));
	this.chintaibaibai = new form_field(document.getElementById('chintaibaibai'));
	this.chintaibaibai.msgid = new form_field(document.getElementById('chintaibaibai_msg'));
	this.kakaku = new form_field(document.getElementById('kakaku'));
	this.kakaku.msgid = new form_field(document.getElementById('kakaku_msg'));
	this.chinryo = new form_field(document.getElementById('chinryo'));
	this.chinryo.msgid = new form_field(document.getElementById('chinryo_msg'));
	this.kyouekihi = new form_field(document.getElementById('kyouekihi'));
	this.kyouekihi.msgid = new form_field(document.getElementById('kyouekihi_msg'));
	this.reikin = new form_field(document.getElementById('reikin'));
	this.reikin.msgid = new form_field(document.getElementById('reikin_msg'));
	this.shikikin = new form_field(document.getElementById('shikikin'));
	this.shikikin.msgid = new form_field(document.getElementById('shikikin_msg'));
	this.kakaku_tr = new form_field(document.getElementById('kakaku_tr'));
	this.chinryo_tr = new form_field(document.getElementById('chinryo_tr'));
	this.kyouekihi_tr = new form_field(document.getElementById('kyouekihi_tr'));
	this.reikin_tr = new form_field(document.getElementById('reikin_tr'));
	this.shikikin_tr = new form_field(document.getElementById('shikikin_tr'));
	this.shikikin_tr = new form_field(document.getElementById('shikikin_tr'));

	this.hokenryou_tr = new form_field(document.getElementById('hokenryou_tr'));
	this.keiyakukikan_tr = new form_field(document.getElementById('keiyakukikan_tr'));

	this.kanrihi_tr = new form_field(document.getElementById('kanrihi_tr'));
	this.kanrikeitai_tr = new form_field(document.getElementById('kanrikeitai_tr'));
	this.shuuzenkin_tr = new form_field(document.getElementById('shuuzenkin_tr'));
	this.tochikenri_tr = new form_field(document.getElementById('tochikenri_tr'));
	this.youtochiiki_tr = new form_field(document.getElementById('youtochiiki_tr'));
	this.shidoumenseki_tr = new form_field(document.getElementById('shidoumenseki_tr'));
	this.setsudou_tr = new form_field(document.getElementById('setsudou_tr'));
	this.yousekiritsu_tr = new form_field(document.getElementById('yousekiritsu_tr'));
	this.kenpeiritsu_tr = new form_field(document.getElementById('kenpeiritsu_tr'));
	this.kokudouhou_tr = new form_field(document.getElementById('kokudouhou_tr'));
	this.shitokeikaku_tr = new form_field(document.getElementById('shitokeikaku_tr'));
	this.chisei_tr = new form_field(document.getElementById('chisei_tr'));
	this.chimoku_tr = new form_field(document.getElementById('chimoku_tr'));
	this.tochimenseki_tr = new form_field(document.getElementById('tochimenseki_tr'));
	this.tatemonomenseki_tr = new form_field(document.getElementById('tatemonomenseki_tr'));
	this.balcony_tr = new form_field(document.getElementById('balcony_tr'));
	this.hanbaikosuu_tr = new form_field(document.getElementById('hanbaikosuu_tr'));
	this.shougakkou_tr = new form_field(document.getElementById('shougakkou_tr'));
	this.chuugakkou_tr = new form_field(document.getElementById('chuugakkou_tr'));

	this.ct_shinchikubukken = new form_field(document.getElementById('ct_shinchikubukken'));
	this.ct_tsuujoobukken = new form_field(document.getElementById('ct_tsuujoobukken'));
	this.ct_shinchikumansion = new form_field(document.getElementById('ct_shinchikumansion'));
	this.ct_chuukomansion = new form_field(document.getElementById('ct_chuukomansion'));
	this.ct_shinchikuikkodate = new form_field(document.getElementById('ct_shinchikuikkodate'));
	this.ct_chuukoikkodate = new form_field(document.getElementById('ct_chuukoikkodate'));
	this.ct_uritochi = new form_field(document.getElementById('ct_uritochi'));
	this.ct_jigyouyoubukken = new form_field(document.getElementById('ct_jigyouyoubukken'));
	this.ct_sonota = new form_field(document.getElementById('ct_sonota'));

	this.kanseiyotei_tr = new form_field(document.getElementById('kanseiyotei_tr'));
	this.genjou_tr = new form_field(document.getElementById('genjou_tr'));

	this.chikunentype = new form_field(document.getElementById('chikunentype'));
	this.kouzou_tr = new form_field(document.getElementById('kouzou_tr'));
	this.tatemonokaisuu_tr = new form_field(document.getElementById('tatemonokaisuu_tr'));
	this.chikakaisuu_tr = new form_field(document.getElementById('chikakaisuu_tr'));
	this.shozaikaisuu_tr = new form_field(document.getElementById('shozaikaisuu_tr'));
	this.senyuumenseki_tr = new form_field(document.getElementById('senyuumenseki_tr'));
	this.madorishousai_tr = new form_field(document.getElementById('madorishousai_tr'));
	this.chuushajo_tr = new form_field(document.getElementById('chuushajo_tr'));
	this.soukosuu_tr = new form_field(document.getElementById('soukosuu_tr'));

	this.kanrihi_tr = new form_field(document.getElementById('kanrihi_tr'));
	this.kanrikeitai_tr = new form_field(document.getElementById('kanrikeitai_tr'));
	this.shuuzenkin_tr = new form_field(document.getElementById('shuuzenkin_tr'));
	this.youtochiiki_tr = new form_field(document.getElementById('youtochiiki_tr'));
	this.shidoumenseki_tr = new form_field(document.getElementById('shidoumenseki_tr'));
	this.setsudou_tr = new form_field(document.getElementById('setsudou_tr'));
	this.yousekiritsu_tr = new form_field(document.getElementById('yousekiritsu_tr'));
	this.kenpeiritsu_tr = new form_field(document.getElementById('kenpeiritsu_tr'));
	this.kokudouhou_tr = new form_field(document.getElementById('kokudouhou_tr'));
	this.shitokeikaku_tr = new form_field(document.getElementById('shitokeikaku_tr'));
	this.chisei_tr = new form_field(document.getElementById('chisei_tr'));
	this.chimoku_tr = new form_field(document.getElementById('chimoku_tr'));
	this.tochimenseki_tr = new form_field(document.getElementById('tochimenseki_tr'));
	this.tatemonomenseki_tr = new form_field(document.getElementById('tatemonomenseki_tr'));
	this.balcony_tr = new form_field(document.getElementById('balcony_tr'));
	this.hanbaikosuu_tr = new form_field(document.getElementById('hanbaikosuu_tr'));
	this.shougakkou_tr = new form_field(document.getElementById('shougakkou_tr'));
	this.chuugakkou_tr = new form_field(document.getElementById('chuugakkou_tr'));
	this.shunkounen_tr = new form_field(document.getElementById('shunkounen_tr'));
	this.madori_tr = new form_field(document.getElementById('madori_tr'));

	this.bukken_option = new form_field(document.getElementById('bukken_option'));
	this.idokeido_msg = new form_field(document.getElementById('idokeido_msg'));
	this.ido = new form_field(document.getElementById('ido'));
	this.keido = new form_field(document.getElementById('keido'));
	this.input_fields = new Array();
	this.input_array = document.getElementsByTagName('input');
	for (i=0; i<this.input_array.length; i=i+1) {
		this.input_fields.push(new form_field(this.input_array[i]));
	}
	this.select_boxes = new Array();
	this.select_array = document.getElementsByTagName('select');
	for (i=0; i<this.select_array.length; i=i+1) {
		this.select_boxes.push(new form_field(this.select_array[i]));
	}
	this.textarea_items = new Array();
	this.textareas_array = document.getElementsByTagName('textarea');
	for (i=0; i<this.textareas_array.length; i=i+1) {
		this.textarea_items.push(new form_field(this.textareas_array[i]));
	}
	this.table_tds = new Array();
	this.td_array = document.getElementsByTagName('td');
	for (i=0; i<this.td_array.length; i=i+1) {
		this.table_tds.push(new form_field(this.td_array[i]));
	}
	this.sample_text = new Array();
	this.sample_text_array = document.getElementsByTagName('input');
	for (i=0; i<this.sample_text_array.length; i=i+1) {
		if (this.sample_text_array[i].className == 'sample_text') {
			this.sample_text.push(new form_field(this.sample_text_array[i]));
		}
	}
	this.form_error_table = document.getElementById('form_error_table');
	if (this.form_error_table) {
		if (this.form_error_table.rows.length < 1) {
			this.form_error_table.className = "invisible";
		}
	}
	//物件フォームの築年タイプのオプションのHTML中身を変数に保管
	if(this.ct_shinchikubukken.id) { this.ct_shinchikubukken_html = '<option label="'+this.ct_shinchikubukken.id.innerHTML+'" id="ct_shinchikubukken" value="'+this.ct_shinchikubukken.id.innerHTML+'">'+this.ct_shinchikubukken.id.innerHTML+'</option>'; }
	if(this.ct_tsuujoobukken.id) { this.ct_tsuujoobukken_html = '<option label="'+this.ct_tsuujoobukken.id.innerHTML+'" id="ct_tsuujoobukken" value="'+this.ct_tsuujoobukken.id.innerHTML+'">'+this.ct_tsuujoobukken.id.innerHTML+'</option>'; }
	if(this.ct_shinchikumansion.id) { this.ct_shinchikumansion_html = '<option label="'+this.ct_shinchikumansion.id.innerHTML+'" id="ct_shinchikumansion" value="'+this.ct_shinchikumansion.id.innerHTML+'">'+this.ct_shinchikumansion.id.innerHTML+'</option>'; }
	if(this.ct_chuukomansion.id) { this.ct_chuukomansion_html = '<option label="'+this.ct_chuukomansion.id.innerHTML+'" id="ct_chuukomansion" value="'+this.ct_chuukomansion.id.innerHTML+'">'+this.ct_chuukomansion.id.innerHTML+'</option>'; }
	if(this.ct_shinchikuikkodate.id) { this.ct_shinchikuikkodate_html = '<option label="'+this.ct_shinchikuikkodate.id.innerHTML+'" id="ct_shinchikuikkodate" value="'+this.ct_shinchikuikkodate.id.innerHTML+'">'+this.ct_shinchikuikkodate.id.innerHTML+'</option>'; }
	if(this.ct_chuukoikkodate.id) { this.ct_chuukoikkodate_html = '<option label="'+this.ct_chuukoikkodate.id.innerHTML+'" id="ct_chuukoikkodate" value="'+this.ct_chuukoikkodate.id.innerHTML+'">'+this.ct_chuukoikkodate.id.innerHTML+'</option>'; }
	if(this.ct_uritochi.id) { this.ct_uritochi_html = '<option label="'+this.ct_uritochi.id.innerHTML+'" id="ct_uritochi" value="'+this.ct_uritochi.id.innerHTML+'">'+this.ct_uritochi.id.innerHTML+'</option>'; }
	if(this.ct_jigyouyoubukken.id) { this.ct_jigyouyoubukken_html = '<option label="'+this.ct_jigyouyoubukken.id.innerHTML+'" id="ct_jigyouyoubukken" value="'+this.ct_jigyouyoubukken.id.innerHTML+'">'+this.ct_jigyouyoubukken.id.innerHTML+'</option>'; }
	//alert('<option label="'+this.ct_jigyouyoubukken_html+'" id="'+this.ct_jigyouyoubukken_name+'" value="'+this.ct_jigyouyoubukken_html+'">'+this.ct_jigyouyoubukken_html+'</option>');
	//alert("LOL "+this.chikunentype.id.options.item(2).text);

	//築年タイプのプルダウンメニューのid文字列から、そのテキストを出力
	this.ct_option_id2text = function(option) {
		if(option == 'ct_shinchikubukken') { return '新築物件'; }
		else if(option == 'ct_tsuujoobukken') { return '通常物件'; }
		else if(option == 'ct_shinchikumansion') { return '新築マンション'; }
		else if(option == 'ct_chuukomansion') { return '中古マンション'; }
		else if(option == 'ct_shinchikuikkodate') { return '新築一戸建'; }
		else if(option == 'ct_chuukoikkodate') { return '中古一戸建'; }
		else if(option == 'ct_uritochi') { return '売土地'; }
		else if(option == 'ct_jigyouyoubukken') { return '事業用物件'; }
		else if(option == 'ct_test') { return 'テスト'; }
		else { return false; }
	};
	//this.ct_option_id2text('ct_uritochi');

	//築年タイプのプルダウンメニューから項目を削除
	this.ct_option_remove = function(option) {
		for(var j = 0; j < this.chikunentype.id.options.length; j += 1) {
			if(this.chikunentype.id.options.item(j).text == this.ct_option_id2text(option)) {
				this.chikunentype.id.remove(j);
			}
		}
	};
	//this.ct_option_remove('ct_sonota');

	//築年タイプのプルダウンメニューに項目を追加
	this.ct_option_add = function(option) {
		element = document.createElement('option');
		element.text = this.ct_option_id2text(option);
		element.value = this.ct_option_id2text(option);
		element.id = option;
		element.label = this.ct_option_id2text(option);
		
		// HTMLSelectElement.add()でのIEのバグ対策
		try { // これは標準じゃないけどIEで動くコード
			this.chikunentype.id.add(element, 1);
		} catch( e ) { // これは普通というか標準です
			this.chikunentype.id.add(element, null);
		}
	};
	//this.ct_option_add('ct_test');

	//築年タイプのプルダウンメニューの項目の配列の中のインデックス番号を確認
	this.ct_option_find = function(option) {
		for(var k = 0; k < this.chikunentype.id.options.length; k += 1) {
			if(this.chikunentype.id.options.item(k).text == this.ct_option_id2text(option)) {
				return k;
			}
		}
		return false;
	};
	//alert(this.ct_option_find('ct_uritochi'));


	//路線選択
	//JR鹿児島本線
	this.JR_kagoshima = new Array();
	this.JR_kagoshima[0] = "教育大前";
	this.JR_kagoshima[1] = "赤間";
	this.JR_kagoshima[2] = "東郷";
	this.JR_kagoshima[3] = "東福間";
	this.JR_kagoshima[4] = "福間";
	this.JR_kagoshima[5] = "千鳥";
	this.JR_kagoshima[6] = "古賀";
	//this.JR_kagoshima[7] = "筑前新宮";
	this.JR_kagoshima[7] = "福工大前";
	this.JR_kagoshima[8] = "九産大前";
	this.JR_kagoshima[9] = "香椎";
	this.JR_kagoshima[10] = "千早";
	this.JR_kagoshima[11] = "箱崎";
	this.JR_kagoshima[12] = "吉塚";
	this.JR_kagoshima[13] = "博多";
	this.JR_kagoshima[14] = "竹下";
	this.JR_kagoshima[15] = "笹原";
	this.JR_kagoshima[16] = "南福岡";
	this.JR_kagoshima[17] = "春日";
	this.JR_kagoshima[18] = "大野城";
	this.JR_kagoshima[19] = "水城";
	this.JR_kagoshima[20] = "都府桜南";
	this.JR_kagoshima[21] = "二日市";
	this.JR_kagoshima[22] = "天拝山";
	this.JR_kagoshima[23] = "原田";
	this.JR_kagoshima[24] = "けやき台";
	this.JR_kagoshima[25] = "基山";
	//JR香椎線
	this.JR_kashii = new Array();
	this.JR_kashii[0] = "西戸崎";
	this.JR_kashii[1] = "海ノ中道";
	this.JR_kashii[2] = "雁ノ巣";
	this.JR_kashii[3] = "奈多";
	this.JR_kashii[4] = "和白";
	this.JR_kashii[5] = "香椎";
	this.JR_kashii[6] = "香椎神宮";
	this.JR_kashii[7] = "舞松原";
	this.JR_kashii[8] = "土井";
	this.JR_kashii[9] = "伊賀";
	this.JR_kashii[10] = "長者原";
	this.JR_kashii[11] = "酒殿";
	this.JR_kashii[12] = "須恵";
	this.JR_kashii[13] = "須恵中央";
	this.JR_kashii[14] = "新原";
	this.JR_kashii[15] = "宇美";
	//JR筑肥線
	this.JR_chikuhi = new Array();
	this.JR_chikuhi[0] = "姪浜";
	this.JR_chikuhi[1] = "下山門";
	this.JR_chikuhi[2] = "今宿";
	this.JR_chikuhi[3] = "九大学研都市";
	this.JR_chikuhi[4] = "周船寺";
	this.JR_chikuhi[5] = "波多江";
	this.JR_chikuhi[6] = "筑前前原";
	this.JR_chikuhi[7] = "美咲が丘";
	this.JR_chikuhi[8] = "加布里";
	this.JR_chikuhi[9] = "一貴山";
	this.JR_chikuhi[10] = "筑前深江";
	this.JR_chikuhi[11] = "大入";
	this.JR_chikuhi[12] = "福吉";
	//JR篠栗線
	this.JR_sasaguri = new Array();
	this.JR_sasaguri[0] = "博多";
	this.JR_sasaguri[1] = "吉塚";
	this.JR_sasaguri[2] = "柚須";
	this.JR_sasaguri[3] = "原町";
	this.JR_sasaguri[4] = "長者原";
	this.JR_sasaguri[5] = "門松";
	this.JR_sasaguri[6] = "篠栗";
	//JR博多南線
	this.JR_hakataminami = new Array();
	this.JR_hakataminami[0] = "博多";
	this.JR_hakataminami[1] = "博多南";
	//西鉄天神大牟田線
	this.NISHI_tenjinoomuta = new Array();
	this.NISHI_tenjinoomuta[0] = "福岡(天神)";
	this.NISHI_tenjinoomuta[1] = "薬院";
	this.NISHI_tenjinoomuta[2] = "平尾";
	this.NISHI_tenjinoomuta[3] = "高宮";
	this.NISHI_tenjinoomuta[4] = "大橋";
	this.NISHI_tenjinoomuta[5] = "井尻";
	this.NISHI_tenjinoomuta[6] = "雑餉隈";
	this.NISHI_tenjinoomuta[7] = "春日原";
	this.NISHI_tenjinoomuta[8] = "白木原";
	this.NISHI_tenjinoomuta[9] = "下大利";
	this.NISHI_tenjinoomuta[10] = "都府楼前";
	this.NISHI_tenjinoomuta[11] = "二日市";
	this.NISHI_tenjinoomuta[12] = "朝倉街道";
	this.NISHI_tenjinoomuta[13] = "桜台";
	this.NISHI_tenjinoomuta[14] = "筑紫";
	this.NISHI_tenjinoomuta[15] = "津古";
	this.NISHI_tenjinoomuta[16] = "三国が丘";
	this.NISHI_tenjinoomuta[17] = "三沢";
	this.NISHI_tenjinoomuta[18] = "大保";
	this.NISHI_tenjinoomuta[19] = "小郡";
	this.NISHI_tenjinoomuta[20] = "端間";
	this.NISHI_tenjinoomuta[21] = "味坂";
	this.NISHI_tenjinoomuta[22] = "宮の陣";
	//西鉄貝塚線
	this.NISHI_kaiduka = new Array();
	this.NISHI_kaiduka[0] = "貝塚";
	this.NISHI_kaiduka[1] = "名島";
	this.NISHI_kaiduka[2] = "西鉄千早";
	this.NISHI_kaiduka[3] = "香椎宮前";
	this.NISHI_kaiduka[4] = "西鉄香椎";
	this.NISHI_kaiduka[5] = "香椎花園前";
	this.NISHI_kaiduka[6] = "唐の原";
	this.NISHI_kaiduka[7] = "和白";
	this.NISHI_kaiduka[8] = "三苫";
	this.NISHI_kaiduka[9] = "西鉄新宮";
	//西鉄太宰府線
	this.NISHI_dazaifu = new Array();
	this.NISHI_dazaifu[0] = "二日市";
	this.NISHI_dazaifu[1] = "五条";
	this.NISHI_dazaifu[2] = "大宰府";
	//福岡市営地下鉄空港線
	this.CHIKA_kuko = new Array();
	this.CHIKA_kuko[0] = "姪浜";
	this.CHIKA_kuko[1] = "室見";
	this.CHIKA_kuko[2] = "藤崎";
	this.CHIKA_kuko[3] = "西新";
	this.CHIKA_kuko[4] = "唐人町";
	this.CHIKA_kuko[5] = "大濠公園";
	this.CHIKA_kuko[6] = "赤坂"; 
	this.CHIKA_kuko[7] = "天神";
	this.CHIKA_kuko[8] = "中洲川端";
	this.CHIKA_kuko[9] = "祇園";
	this.CHIKA_kuko[10] = "博多";
	this.CHIKA_kuko[11] = "東比恵";
	this.CHIKA_kuko[12] = "福岡空港";
	//福岡市営地下鉄箱崎線
	this.CHIKA_hakozaki = new Array();
	this.CHIKA_hakozaki[0] = "中洲川端";
	this.CHIKA_hakozaki[1] = "呉服町";
	this.CHIKA_hakozaki[2] = "千代県庁口";
	this.CHIKA_hakozaki[3] = "馬出九大病院前";
	this.CHIKA_hakozaki[4] = "箱崎宮前";
	this.CHIKA_hakozaki[5] = "箱崎九大前";
	this.CHIKA_hakozaki[6] = "貝塚";
	//福岡市営地下鉄七隈線
	this.CHIKA_nanakuma = new Array();
	this.CHIKA_nanakuma[0] = "天神南";
	this.CHIKA_nanakuma[1] = "渡辺通";
	this.CHIKA_nanakuma[2] = "薬院";
	this.CHIKA_nanakuma[3] = "薬院大通";
	this.CHIKA_nanakuma[4] = "桜坂";
	this.CHIKA_nanakuma[5] = "六本松";
	this.CHIKA_nanakuma[6] = "別府";
	this.CHIKA_nanakuma[7] = "茶山";
	this.CHIKA_nanakuma[8] = "金山";
	this.CHIKA_nanakuma[9] = "七隈";
	this.CHIKA_nanakuma[10] = "福大前";
	this.CHIKA_nanakuma[11] = "梅林";
	this.CHIKA_nanakuma[12] = "野芥";
	this.CHIKA_nanakuma[13] = "賀茂";
	this.CHIKA_nanakuma[14] = "次郎丸";
	this.CHIKA_nanakuma[15] = "橋本";
	

	this.eki_select = new Array();
	this.eki_select[1] = this.JR_kagoshima;
	this.eki_select[2] = this.JR_kashii;
	this.eki_select[3] = this.JR_chikuhi;
	this.eki_select[4] = this.JR_sasaguri;
	this.eki_select[5] = this.JR_hakataminami;
	this.eki_select[6] = this.NISHI_tenjinoomuta;
	this.eki_select[7] = this.NISHI_kaiduka;
	this.eki_select[8] = this.NISHI_dazaifu;
	this.eki_select[9] = this.CHIKA_kuko;
	this.eki_select[10] = this.CHIKA_hakozaki;
	this.eki_select[11] = this.CHIKA_nanakuma;
	
	
	this.rosen = new form_field(document.getElementById('rosen'));
	this.eki = new form_field(document.getElementById('eki'));
	//駅情報の保持
	this.eki_save = new form_field(document.getElementById('eki_save'));

	this.rosen2 = new form_field(document.getElementById('rosen2'));
	this.eki2 = new form_field(document.getElementById('eki2'));
	this.ekitohofun2 = new form_field(document.getElementById('ekitohofun2'));
	//駅情報の保持
	this.eki2_save = new form_field(document.getElementById('eki2_save'));

	this.dai2kotsu = new form_field(document.getElementsByName('dai2kotsu'));

	//バス
	this.bus = new form_field(document.getElementById('bus'));
	this.bustohofun = new form_field(document.getElementById('bustohofun'));
	

	//路線のプルダウンメニューに項目を追加
	this.rosen_change = function() {
		if(this.eki.id){
			this.eki.id.length=0;
			var index = this.rosen.id.selectedIndex;
			if(index){
				for(var i=0; i < this.eki_select[index].length; i++){
					this.eki.id.options[i] = new Option(this.eki_select[index][i],this.eki_select[index][i]);
					
					//選択済みの値保持
					if(this.eki_save.id.value == this.eki_select[index][i]){
						this.eki.id.selectedIndex=i;
					}
				}
			}
		}
	
	};
	//this.rosen_change();
	//路線のプルダウンメニューに項目を追加
	this.rosen2_change = function() {
		if(this.eki2.id){
			this.eki2.id.length=0;
			var index = this.rosen2.id.selectedIndex;
			if(index){
				for(var i=0; i < this.eki_select[index].length; i++){
					this.eki2.id.options[i] = new Option(this.eki_select[index][i],this.eki_select[index][i]);
					
					//選択済みの値保持
					if(this.eki2_save.id.value == this.eki_select[index][i]){
						this.eki2.id.selectedIndex=i;
					}
				}
			}
		}
	
	};	
	
	
	//第2交通の選択
	this.dai2kotsu_change = function() {
		
		if(document.getElementsByName('dai2kotsu')[0].checked){
		//バスにチェック
			this.rosen2.id.disabled = true;
			this.eki2.id.disabled = true;
			this.ekitohofun2.id.disabled = true;
			
			this.bus.id.disabled = false;
			this.bustohofun.id.disabled = false;
		}else{
		//バスにチェックなし
			this.rosen2.id.disabled = false;
			this.eki2.id.disabled = false;
			this.ekitohofun2.id.disabled = false;
		
			this.bus.id.disabled = true;
			this.bustohofun.id.disabled = true;
		}
	
	};	
	
	
	this.daigaku_tbl = new form_field(document.getElementById('daigaku_tbl'));
	this.senmongakkou_tbl = new form_field(document.getElementById('senmongakkou_tbl'));
	//this.daigaku = new form_field(document.getElementById('daigaku'));
	//this.senmongakkou = new form_field(document.getElementById('senmongakkou'));
	
	this.daigaku = new form_field(document.getElementById('daigaku'));
	
	this.daigaku_open = new form_field(document.getElementById('daigaku_open'));
	this.senmongakkou_open = new form_field(document.getElementById('senmongakkou_open'));
	//大学・専門学校のメニュー表示・非表示
	this.gakkou_open_close = function(ele,textele) {
		if(ele.id.className == ""){
			ele.id.className = "invisible";
			textele.id.innerHTML = '<img src="http://www.fukuoka-chintai.com/images/open.gif" width="66" height="22" />';
		}else{
			ele.id.className = "";
			textele.id.innerHTML = '<img src="http://www.fukuoka-chintai.com/images/close.gif" width="66" height="22" />';
		}
		
	}
	//学校の入力チェック（入力してればオープン）
	this.gakkou_open_check = function() {
		var daigaku_open_flg;
		var senmongakkou_open_flg;
		for (i = 0; i < this.input_fields.length; i=i+1) {
			if (this.input_fields[i].id.name.indexOf("daigaku[") >= 0) {
				if(this.input_fields[i].id.checked){
					daigaku_open_flg = 1;
				}
			}
			if (this.input_fields[i].id.name.indexOf("senmongakkou[") >= 0) {
				if(this.input_fields[i].id.checked){
					senmongakkou_open_flg = 1;
				}
			}
		}
		
		if(daigaku_open_flg) my_form.gakkou_open_close(my_form.daigaku_tbl,my_form.daigaku_open);
		if(senmongakkou_open_flg) my_form.gakkou_open_close(my_form.senmongakkou_tbl,my_form.senmongakkou_open);
		//alert(document.getElementName.['daigaku[]'].length);
	}


	//住所をまとめるメソッド
	this.concat_jusho=function() {
		if(this.jusho.id) {	
			this.jusho.id.value = this.todofuken.id.value+this.shikuchoson.id.value+this.ooazamachichome.id.value+this.gaikufugochiban.id.value;
		}
		if(this.jusho.msgid.id) {
			this.jusho.msgid.id.innerHTML = this.jusho.id.value;
		}
	};


	this.ekibus = document.getElementsByName('ekibus');
	//色々とイベント・ハンドラーを付ける
	this.attach_events=function() {

		//for (var i=0; i<this.ekibus.length; i++){
			//this.ekibus[i].onchange = function(){ return ekibus_change()}
			//this.ekibus[i].onclick = function(){ return ekibus_change()}
		//}
		if(this.daigaku_open.id){
			this.daigaku_open.id.onclick = function(){ return my_form.gakkou_open_close(my_form.daigaku_tbl,my_form.daigaku_open);}
		}
		if(this.senmongakkou_open.id){
			this.senmongakkou_open.id.onclick = function(){ return my_form.gakkou_open_close(my_form.senmongakkou_tbl,my_form.senmongakkou_open);}
		}
		
			
		for (i = 0; i < this.input_fields.length; i=i+1) {
			if (this.input_fields[i].id.name != "get_idokeido") {
				this.input_fields[i].id.onkeyup = function(){ return validate_input(this); };
				this.input_fields[i].id.onblur  = function(){ return validate_input(this); };
				this.input_fields[i].id.onclick = function(){ return validate_input(this); };
			}
		}
		for (i = 0; i < this.select_boxes.length; i=i+1) {
			//alert(this.select_boxes[i].id);
			this.select_boxes[i].id.onkeyup = function(){ return validate_input(this); };
			//this.select_boxes[i].id.onblur  = function(){ return validate_input(this); };
			this.select_boxes[i].id.onclick = function(){ return validate_input(this); };
			this.select_boxes[i].id.onchange = function(){ return validate_input(this); };
		}
		for (i = 0; i < this.textarea_items.length; i=i+1) {
			//alert(this.textarea_items[i].id);
			this.textarea_items[i].id.onkeyup = function(){ return charsleft(this); };
			this.textarea_items[i].id.onblur  = function(){ return charsleft(this); };
			this.textarea_items[i].id.onclick = function(){ return charsleft(this); };
			//this.textarea_items[i].id.onkeyup = function(){ return validate_input(this); };
			//this.textarea_items[i].id.onblur  = function(){ return validate_input(this); };
			//this.textarea_items[i].id.onclick = function(){ return validate_input(this); };
		}
		if(this.form.id) {
			this.form.id.onsubmit = function(){
				if(my_form.msgid.id) {
					my_form.msgid.id.innerHTML = "";
					my_form.msgid.id.innerHTML = "ご入力を確認中・・・";
					my_form.msgid.id.style.color = '#e60012';
				}
			};
		}
		if (this.get_idokeido.id) {
			this.get_idokeido.id.style.cursor = 'pointer';
			this.get_idokeido.id.onclick = function(){ 
				return my_form.get_idokeido_by_jusho(this);
			};
		}
		for (i = 0; i < this.sample_text.length; i=i+1) {
			this.sample_text[i].id.onfocus = function (){ 
				this.value = "";
				this.onfocus = function(){ return; };
			};
		}
	};

	//ジュウショから緯度経度を計算
	this.get_idokeido_by_jusho = function(the_input) {
		//バリデーションではなく住所から緯度経度を調べる
		//引数名が解りにくくて申し訳ないです
		var input_value = this.todofuken.id.value;
		var input_required = this.shikuchoson.id.value;
		var input_type = this.ooazamachichome.id.value;
		var input_error_id = 'idokeido';
		this.idokeido_msg.id.innerHTML = "";
		var address = this.todofuken.id.value+this.shikuchoson.id.value+this.ooazamachichome.id.value+this.gaikufugochiban.id.value;
		//make_request(input_value, input_required, input_type, input_error_id);
		map1.geocoder.getLatLng(
			address,
			function(point) {
				if (!point) {
					my_form.idokeido_msg.id.innerHTML = "「" + address + "」は認識出来ませんでした。";
					//alert("「" + address + "」は認識出来ませんでした。");
				} else {
// 					map.setCenter(point, 13);
// 					var marker = new GMarker(point);
// 					map.addOverlay(marker);
// 					marker.openInfoWindowHtml(address);
					if (map1) {
						map1.center_map(point);
						map1.set_hardcenter(point);
					}
					my_form.ido.id.value = point.y;
					my_form.keido.id.value = point.x;
				}
			}
		);
	};

	this.switch_chintaibaibai = function() {
		if(this.chintaibaibai.id.value =="賃貸") {
			
			if(map1) { map1.change_marker('rental'); }
			if(!this.ct_option_find('ct_shinchikubukken')) { this.ct_option_add('ct_shinchikubukken'); }
			if(!this.ct_option_find('ct_tsuujoobukken')) { this.ct_option_add('ct_tsuujoobukken'); }
			if(this.ct_shinchikumansion.id) { this.ct_option_remove('ct_shinchikumansion'); }
			if(this.ct_chuukomansion.id) { this.ct_option_remove('ct_chuukomansion'); }
			if(this.ct_shinchikuikkodate.id) { this.ct_option_remove('ct_shinchikuikkodate'); }
			if(this.ct_chuukoikkodate.id) { this.ct_option_remove('ct_chuukoikkodate'); }
			if(this.ct_uritochi.id) { this.ct_option_remove('ct_uritochi'); }
			if(this.ct_jigyouyoubukken.id) { this.ct_option_remove('ct_jigyouyoubukken'); }
			if(this.ct_shinchikubukken.id) { this.ct_shinchikubukken.id.disabled = false; }
			if(this.ct_tsuujoobukken.id) { this.ct_tsuujoobukken.id.disabled = false; }
			if(this.ct_shinchikumansion.id) { this.ct_shinchikumansion.id.disabled = true; }
			if(this.ct_chuukomansion.id) { this.ct_chuukomansion.id.disabled = true; }
			if(this.ct_shinchikuikkodate.id) { this.ct_shinchikuikkodate.id.disabled = true; }
			if(this.ct_chuukoikkodate.id) { this.ct_chuukoikkodate.id.disabled = true; }
			if(this.ct_uritochi.id) { this.ct_uritochi.id.disabled = true; }
			if(this.ct_jigyouyoubukken.id) { this.ct_jigyouyoubukken.id.disabled = true; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = ""; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = ""; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = ""; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = ""; }
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = ""; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = ""; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = ""; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = "invisible"; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = "invisible"; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = "invisible"; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = "invisible"; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = "invisible"; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = "invisible"; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
			//if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			//if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			//if(this.kakaku.id) { this.kakaku.id.value = ""; }
		} else if(this.chintaibaibai.id.value =="売買") {
			if(map1) { map1.change_marker('sale'); }
			if(this.ct_shinchikubukken.id) { this.ct_option_remove('ct_shinchikubukken'); }
			if(this.ct_tsuujoobukken.id) { this.ct_option_remove('ct_tsuujoobukken'); }
			if(!this.ct_option_find('ct_shinchikumansion')) { this.ct_option_add('ct_shinchikumansion'); }
			if(!this.ct_option_find('ct_chuukomansion')) { this.ct_option_add('ct_chuukomansion'); }
			if(!this.ct_option_find('ct_shinchikuikkodate')) { this.ct_option_add('ct_shinchikuikkodate'); }
			if(!this.ct_option_find('ct_chuukoikkodate')) { this.ct_option_add('ct_chuukoikkodate'); }
			if(!this.ct_option_find('ct_uritochi')) { this.ct_option_add('ct_uritochi'); }
			if(!this.ct_option_find('ct_jigyouyoubukken')) { this.ct_option_add('ct_jigyouyoubukken'); }
			if(this.ct_shinchikubukken.id) { this.ct_shinchikubukken.id.disabled = true; }
			if(this.ct_tsuujoobukken.id) { this.ct_tsuujoobukken.id.disabled = true; }
			if(this.ct_shinchikumansion.id) { this.ct_shinchikumansion.id.disabled = false; }
			if(this.ct_chuukomansion.id) { this.ct_chuukomansion.id.disabled = false; }
			if(this.ct_shinchikuikkodate.id) { this.ct_shinchikuikkodate.id.disabled = false; }
			if(this.ct_chuukoikkodate.id) { this.ct_chuukoikkodate.id.disabled = false; }
			if(this.ct_uritochi.id) { this.ct_uritochi.id.disabled = false; }
			if(this.ct_jigyouyoubukken.id) { this.ct_jigyouyoubukken.id.disabled = false; }
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = ""; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = ""; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = ""; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = ""; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = ""; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = ""; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = ""; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = ""; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = ""; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = ""; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = ""; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
			//if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			//if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			//if(this.chinryo.id) { this.chinryo.id.value = ""; }
			//if(this.kyouekihi.id) { this.kyouekihi.id.value = ""; }
			//if(this.reikin.id) { this.reikin.id.value = ""; }
			//if(this.shikikin.id) { this.shikikin.id.value = ""; }
		} else {
			if(!this.ct_option_find('ct_shinchikubukken')) { this.ct_option_add('ct_shinchikubukken'); }
			if(!this.ct_option_find('ct_tsuujoobukken')) { this.ct_option_add('ct_tsuujoobukken'); }
			if(!this.ct_option_find('ct_shinchikumansion')) { this.ct_option_add('ct_shinchikumansion'); }
			if(!this.ct_option_find('ct_chuukomansion')) { this.ct_option_add('ct_chuukomansion'); }
			if(!this.ct_option_find('ct_shinchikuikkodate')) { this.ct_option_add('ct_shinchikuikkodate'); }
			if(!this.ct_option_find('ct_chuukoikkodate')) { this.ct_option_add('ct_chuukoikkodate'); }
			if(!this.ct_option_find('ct_uritochi')) { this.ct_option_add('ct_uritochi'); }
			if(!this.ct_option_find('ct_jigyouyoubukken')) { this.ct_option_add('ct_jigyouyoubukken'); }
			if(this.ct_shinchikubukken.id) { this.ct_shinchikubukken.id.disabled = false; }
			if(this.ct_tsuujoobukken.id) { this.ct_tsuujoobukken.id.disabled = false; }
			if(this.ct_shinchikumansion.id) { this.ct_shinchikumansion.id.disabled = false; }
			if(this.ct_chuukomansion.id) { this.ct_chuukomansion.id.disabled = false; }
			if(this.ct_shinchikuikkodate.id) { this.ct_shinchikuikkodate.id.disabled = false; }
			if(this.ct_chuukoikkodate.id) { this.ct_chuukoikkodate.id.disabled = false; }
			if(this.ct_uritochi.id) { this.ct_uritochi.id.disabled = false; }
			if(this.ct_jigyouyoubukken.id) { this.ct_jigyouyoubukken.id.disabled = false; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = ""; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = ""; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = ""; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = ""; }
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.bukken_option.id) { this.bukken_option.id.className = ""; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = ""; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = ""; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = ""; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = ""; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = ""; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = ""; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = ""; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = ""; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = ""; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = ""; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = ""; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = ""; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = ""; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = ""; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		}
	};

	this.switch_chikunentype = function() {
		if(this.chikunentype.id.value =="新築物件") {
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = ""; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = ""; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = ""; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = ""; }
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = ""; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = ""; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = ""; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = "invisible"; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = ""; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = ""; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = ""; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = ""; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = "invisible"; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = "invisible"; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = "invisible"; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = "invisible"; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = "invisible"; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = "invisible"; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else if(this.chikunentype.id.value =="通常物件") {
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = ""; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = ""; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = ""; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = ""; }
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = ""; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = ""; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = ""; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = "invisible"; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = ""; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = ""; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = ""; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = "invisible"; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = "invisible"; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = "invisible"; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = "invisible"; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = "invisible"; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = "invisible"; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else if(this.chikunentype.id.value =="新築マンション") {
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = ""; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = ""; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = ""; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = ""; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = ""; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = ""; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = ""; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = "invisible"; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = "invisible"; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = "invisible"; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = "invisible"; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = "invisible"; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = "invisible"; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = ""; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = ""; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else if(this.chikunentype.id.value =="中古マンション") {
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = ""; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = ""; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = ""; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = ""; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = ""; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = ""; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = "invisible"; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = "invisible"; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = "invisible"; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = "invisible"; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = "invisible"; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = "invisible"; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = ""; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else if(this.chikunentype.id.value =="新築一戸建") {
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = "invisible"; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = "invisible"; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = "invisible"; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = ""; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = "invisible"; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = ""; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else if(this.chikunentype.id.value =="中古一戸建") {
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = "invisible"; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = "invisible"; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = "invisible"; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = "invisible"; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = "invisible"; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = "invisible"; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = "invisible"; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = ""; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else if(this.chikunentype.id.value =="売土地") {
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = "invisible"; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = "invisible"; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = "invisible"; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = "invisible"; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = "invisible"; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = "invisible"; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = "invisible"; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = "invisible"; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = "invisible"; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = ""; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = ""; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = ""; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = ""; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = ""; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = ""; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = "invisible"; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = "invisible"; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = "invisible"; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = "invisible"; }
			if(this.madori_tr.id) { this.madori_tr.id.className = "invisible"; }
		} else if(this.chikunentype.id.value =="事業用物件") {
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = "invisible"; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = "invisible"; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = "invisible"; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = "invisible"; }
			if(this.bukken_option.id) { this.bukken_option.id.className = "invisible"; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = "invisible"; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = "invisible"; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = "invisible"; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = "invisible"; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = "invisible"; }
			if(this.tochikenri_tr.id) { this.tochikenri_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = "invisible"; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = "invisible"; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = ""; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = "invisible"; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = ""; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = ""; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = "invisible"; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = "invisible"; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = "invisible"; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = ""; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = ""; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = "invisible"; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = "invisible"; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = "invisible"; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		} else {
			if(this.chinryo_tr.id) { this.chinryo_tr.id.className = ""; }
			if(this.kyouekihi_tr.id) { this.kyouekihi_tr.id.className = ""; }
			if(this.reikin_tr.id) { this.reikin_tr.id.className = ""; }
			if(this.shikikin_tr.id) { this.shikikin_tr.id.className = ""; }
			if(this.kakaku_tr.id) { this.kakaku_tr.id.className = ""; }
			if(this.bukken_option.id) { this.bukken_option.id.className = ""; }
			if(this.hokenryou_tr.id) { this.hokenryou_tr.id.className = ""; }
			if(this.keiyakukikan_tr.id) { this.keiyakukikan_tr.id.className = ""; }
			if(this.kanrihi_tr.id) { this.kanrihi_tr.id.className = ""; }
			if(this.kanrikeitai_tr.id) { this.kanrikeitai_tr.id.className = ""; }
			if(this.shuuzenkin_tr.id) { this.shuuzenkin_tr.id.className = ""; }
			if(this.kouzou_tr.id) { this.kouzou_tr.id.className = ""; }
			if(this.tatemonokaisuu_tr.id) { this.tatemonokaisuu_tr.id.className = ""; }
			if(this.chikakaisuu_tr.id) { this.chikakaisuu_tr.id.className = ""; }
			if(this.shozaikaisuu_tr.id) { this.shozaikaisuu_tr.id.className = ""; }
			if(this.senyuumenseki_tr.id) { this.senyuumenseki_tr.id.className = ""; }
			if(this.madorishousai_tr.id) { this.madorishousai_tr.id.className = ""; }
			if(this.chuushajo_tr.id) { this.chuushajo_tr.id.className = ""; }
			if(this.soukosuu_tr.id) { this.soukosuu_tr.id.className = ""; }
			if(this.kanseiyotei_tr.id) { this.kanseiyotei_tr.id.className = ""; }
			//if(this.genjou_tr.id) { this.genjou_tr.id.className = ""; }
			if(this.youtochiiki_tr.id) { this.youtochiiki_tr.id.className = ""; }
			if(this.shidoumenseki_tr.id) { this.shidoumenseki_tr.id.className = ""; }
			if(this.setsudou_tr.id) { this.setsudou_tr.id.className = ""; }
			if(this.yousekiritsu_tr.id) { this.yousekiritsu_tr.id.className = ""; }
			if(this.kenpeiritsu_tr.id) { this.kenpeiritsu_tr.id.className = ""; }
			if(this.kokudouhou_tr.id) { this.kokudouhou_tr.id.className = ""; }
			if(this.shitokeikaku_tr.id) { this.shitokeikaku_tr.id.className = ""; }
			if(this.chisei_tr.id) { this.chisei_tr.id.className = ""; }
			if(this.chimoku_tr.id) { this.chimoku_tr.id.className = ""; }
			if(this.tochimenseki_tr.id) { this.tochimenseki_tr.id.className = ""; }
			if(this.tatemonomenseki_tr.id) { this.tatemonomenseki_tr.id.className = ""; }
			if(this.balcony_tr.id) { this.balcony_tr.id.className = ""; }
			if(this.hanbaikosuu_tr.id) { this.hanbaikosuu_tr.id.className = ""; }
			if(this.shougakkou_tr.id) { this.shougakkou_tr.id.className = ""; }
			if(this.chuugakkou_tr.id) { this.chuugakkou_tr.id.className = ""; }
			if(this.shunkounen_tr.id) { this.shunkounen_tr.id.className = ""; }
			if(this.madori_tr.id) { this.madori_tr.id.className = ""; }
		}
	};

	this.validate_all = function() {
		alert("validate all");
		var number_of_errors = 0;
		for (table_td in this.table_tds) {
			if (table_td.id.className == "rules"){
				if (table_td.id.innerHTML == '確認済み' || table_td.id.innerHTML === '' ) {
					table_td.id.style.color = '#000000';
				} else {
					number_of_errors = number_of_errors + 1; 
					table_td.id.style.color = '#e60012';
				}
			}
		}
		if (number_of_errors > 0) {
			form_error = "入力された項目を全て再確認下さい。受け取れない値のとなりに赤字の警告が出ています";
			if(this.msgid.id) {
				this.msgid.id.innerHTML = "";
				this.msgid.id.innerHTML = form_error;
				this.msgid.id.style.color = '#e60012';
			}
			number_of_errors = 0;
			return false;
		} else {
			return true;
		}
	};

	return true;
}

function form_field(id) {
	this.id = id;
	this.msgid = null;
	//触ったら１回消えるフィールド用のカウンター
	this.delete_count = 0;
	
	return true;
}

function charsleft(the_input) {
	var input_value = "";
	var input_class = "";
	var input_required = "";
	var input_type = "";
	var input_error_id = "";
	//alert("validating input");
	input_value = the_input.value;
	input_class = the_input.className.split(' ');
	input_required = input_class[1];
	input_type = input_class[2];
	input_error_id = input_class[3];
	var current_chars = input_value.length;
	var chars_left = input_type - current_chars;
	var chars_over = - chars_left;
	if (chars_left>=0) {
		var reply_text = "文字残数： "+chars_left;
	} else {
		var reply_text = "入力が"+chars_over+"文字長過ぎます。";
	}
	if(input_type){
		document.getElementById(input_error_id).innerHTML = reply_text;
	}
}

function validate_input(the_input) {
	var input_value = "";
	var input_class = "";
	var input_required = "";
	var input_type = "";
	var input_error_id = "";
	//alert("validating input");
	if(the_input.name=="todofuken" || the_input.name=="shikuchoson" || the_input.name=="ooazamachichome" || the_input.name=="gaikufugochiban"){
		my_form.concat_jusho();
	} else if(the_input.name=="chintaibaibai") {
		my_form.switch_chintaibaibai();
	} else if(the_input.name=="chikunentype") {
		my_form.switch_chikunentype();
	} else if(the_input.name=="yuubin") {
		//バリデーションではなく郵便番号から住所を調べましょう
		//引数名が解りにくくて申し訳ないです
		input_value = the_input.value;
		input_class = "";
		input_required = "";
		input_type = "";
		input_error_id = "jusho";
		//alert(input_value.length);
		//郵便番号７桁未満の場合、作動しない
		if(input_value.length == 7){
			make_request(input_value, input_required, input_type, input_error_id);

			//緯度経度取得
			/*
			var input_error_id = 'idokeido';
			var input_value = my_form.todofuken.id.value;
			var input_required = my_form.shikuchoson.id.value;
			var input_type = my_form.ooazamachichome.id.value;
			make_request(input_value, input_required, input_type, input_error_id);
			*/
			/*
			input_value = my_form.todofuken.id.value;
			input_required = my_form.shikuchoson.id.value;
			input_type = my_form.ooazamachichome.id.value;
			input_error_id = 'idokeido';
			*/
			var address = my_form.todofuken.id.value+my_form.shikuchoson.id.value+my_form.ooazamachichome.id.value+my_form.gaikufugochiban.id.value;
			my_form.idokeido_msg.id.innerHTML = "";
			//make_request(input_value, input_required, input_type, input_error_id);
			map1.geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
						my_form.idokeido_msg.id.innerHTML = "「" + address + "」は認識出来ませんでした。";
						//alert("「" + address + "」は認識出来ませんでした。");
					} else {
	// 					map.setCenter(point, 13);
	// 					var marker = new GMarker(point);
	// 					map.addOverlay(marker);
	// 					marker.openInfoWindowHtml(address);
						if (map1) {
							map1.center_map(point);
							map1.set_hardcenter(point);
						}
						my_form.ido.id.value = point.y;
						my_form.keido.id.value = point.x;
					}
				}
			);
		}

	} else if(the_input.name=="rosen") {
		my_form.rosen_change();
	} else if(the_input.name=="rosen2") {
		my_form.rosen2_change();
	} else if(the_input.name=="dai2kotsu") {
		my_form.dai2kotsu_change();
	}
	var error=0;
	input_value = the_input.value;
	input_class = the_input.className.split(' ');
	input_required = input_class[1];
	input_type = input_class[2];
	input_error_id = input_class[3];
	if(input_error_id=="password2_msg" && document.getElementById("password")){
		if(the_input.value!=document.getElementById("password").value) {
			reply_text = "パスワードが一致していません";
			document.getElementById(input_error_id).innerHTML = "";
			document.getElementById(input_error_id).innerHTML = reply_text;
			//document.getElementById(input_error_id).appendChild(document.createTextNode(reply_text));
			error=1;
			//alert(the_input.value+document.getElementById("password").value);
		} else {
			document.getElementById(input_error_id).innerHTML = "";
		}
	}
	if(input_error_id=="mail2_msg" && document.getElementById("mail")){
		if(the_input.value!=document.getElementById("mail").value) {
			reply_text = "メールアドレスが一致していません";
			document.getElementById(input_error_id).innerHTML = "";
			document.getElementById(input_error_id).innerHTML = reply_text;
			//document.getElementById(input_error_id).appendChild(document.createTextNode(reply_text));
			error=1;
			//alert(the_input.value+document.getElementById("mail").value);
		} else {
			//alert("mail2 ok");
			document.getElementById(input_error_id).innerHTML = "";
		}
	}
	if(error!=1) {
		make_request(input_value, input_required, input_type, input_error_id);
	}
}

function make_request(input_value, input_required, input_type, input_error_id) {
	var http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		alert('XMLHTTPインスタンスを作成出来なかった為、AJAXを諦めます。');
		return false;
	}
	http_request.onreadystatechange = function() {
		handle_validation_response(http_request, input_required, input_type, input_error_id);
	};
	//alert(input_error_id);
	if (input_error_id =="jusho") {
		url = "/?action=get_jusho_by_yuubin&input_value=";
	}else if (input_error_id =="idokeido") {
		url = "/?action=get_idokeido_by_jusho&input_value=";
	}else{
		url = "/?action=validate_ajax&input_value=";
	}
	url = encodeURI(url+input_value+"&input_required="+input_required+"&input_type="+input_type+"&input_error_id="+input_error_id);
	//my_form.idokeido_msg.id.innerHTML = encodeURI(url);
	//alert(url);
	//if (input_error_id == 'idokeido') alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
}

function handle_validation_response(http_request, input_required, input_type, input_error_id) {
	if (http_request.readyState == 4) {
		//alert("handle_validation_response");
		if (http_request.status == 200) {
			var response_hairetsu = http_request.responseText.split("|");
			var reply = response_hairetsu[1];
			var reply_text = "";
			//my_form.idokeido_msg.id.innerHTML = "input_error_id:"+input_error_id+" | "+response_hairetsu[1]+" | "+response_hairetsu[2];
			//my_form.idokeido_msg.id.innerHTML = "input_error_id:"+input_error_id+" | http_request.responseText="+http_request.responseText;
			//alert("input_error_id:"+input_error_id+" | http_request.responseText="+http_request.responseText);
			if (input_error_id =="jusho") {
				if(typeof response_hairetsu[1] =="undefined") { response_hairetsu[1] = ""; }
				if(typeof response_hairetsu[2] =="undefined") { response_hairetsu[2] = ""; }
				if(typeof response_hairetsu[3] =="undefined") { response_hairetsu[3] = ""; }
				//alert(http_request.responseText);
				my_form.todofuken.id.value = response_hairetsu[1];
				my_form.shikuchoson.id.value = response_hairetsu[2];
				my_form.ooazamachichome.id.value = response_hairetsu[3];
				var gaikufugochiban = my_form.gaikufugochiban.id.value;
				my_form.jusho.value = response_hairetsu[1]+response_hairetsu[2]+response_hairetsu[3]+gaikufugochiban;
			} else if (input_error_id =="idokeido" && typeof response_hairetsu[1] != "undefined" && typeof response_hairetsu[2] != "undefined") {
					//alert(response_hairetsu[1]+" "+response_hairetsu[2]);
					//alert(http_request.responseText);
					my_form.ido.id.value = response_hairetsu[1];
					my_form.keido.id.value = response_hairetsu[2];
					if (map1) {
						var point_backup = new GLatLng(response_hairetsu[1], response_hairetsu[2]);
						map1.center_map(point_backup);
						map1.set_hardcenter(point_backup);
					}
			}else{
				if(document.getElementById(input_error_id)) {

					document.getElementById(input_error_id).innerHTML = "";
					switch(reply) {
					case "ok":
						//reply_text = "確認済み";
						reply_text = '<img src="/images/ok_mark.gif" align="absmiddle" width="17" height="17" />';
						break;
					case "required":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 必須';
						break;
					case "7figures":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角７桁をハイフン無しで入力下さい';
						break;
					case "badmail":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 入力されたメールアドレスを再確認下さい';
						break;
					case "badphone":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角の数字とハイフンのみでご入力下さい';
						break;
					case "badnumber":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角数字とドット一つでご入力下さい';
						break;
					case "not_int":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角数字でご入力下さい';
						break;
					case "low_kakaku":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 10000以上の価格を入力下さい';
						break;
					case "headtail0-9a-zA-Z":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 頭と尻は半角英数か数字にして下さい';
						break;
					case "2symbol":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 連続記号はご入力しないで下さい';
						break;
					case "^a-zA-Z":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 頭は半角英数にして下さい';
						break;
					case "0-9a-zA-Z-._":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角英数、数字、「_-」記号でご入力下さい';
						break;
					case "2-64":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角２〜６４文字でご入力下さい';
						break;
					case "6-64":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角６〜６４文字でご入力下さい';
						break;
					case "10-16":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 半角１０〜１６文字でご入力下さい';
						break;
					case "no_http":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 「http://」からURLをご入力下さい';
						break;
					case "bad_url":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> 正しいURLをご入力下さい';
						break;
					case "kanjichoume":
						reply_text = '<img src="/images/bad_mark.gif" align="absmiddle" width="17" height="17" /> ◯丁目は漢字でご入力下さい';
						break;
					default:
						reply_text = reply;
					}
					//document.getElementById(input_error_id).appendChild(document.createTextNode(reply_text));
					document.getElementById(input_error_id).innerHTML = reply_text;
				}
			}
		//} else {
		//	alert('AJAXリクエストで問題がありました。');
		}
	}
}

function show_embed_video(embed_div) {
	if (document.getElementById("video_url")) {
		//var video_url="http://www.unitedrooms.tv/0078/0078_000001_8100022.wmv";
		var video_url=document.getElementById("video_url").innerHTML;
	}
	object = '<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="320" height="280" ';
	object += 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';
	object += 'id="WinMediPlay" type="application/x-oleobject">';
	object += '<param name="src" value="' + video_url + '" />';
	object += '<param name="autoStart" value="false" />';
	object += '<param name="showControls" value="true" />';
	object += '<embed type="video/x-ms-asf-plugin" ';
	object += 'pluginspace="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" ';
	object += 'src="' + video_url + '" name="mediaplayer" showcontrols=2 showdisplay=0 showstatusbar=0 autostart=0 width="320" height="280"></embed>';
	object += '</object>';
	embed_div.innerHTML = object;
	embed_div.onclick = function(){ 
		return;
	};
}

function resize_image(src, max_width, max_height) {
	picture = new Image();
	picture.src = src;
	//alert("picture.src="+src+" picture.width="+picture.width+" picture.height="+picture.width);
	var width;
	var height;
	if (picture.width / picture.height >= max_width / max_height) {
		width = max_width;
		height = picture.height * (max_width / picture.width);
	} else {
		height = max_height;
		width = picture.width * (max_height / picture.height);
	}
	var size = new Array();
	size.push(width);
	size.push(height);
	//alert("picture.width="+picture.width+" picture.height="+picture.width+" width="+width+" height="+height);
	return size;
}

function start_slideshow() {
	this.id_current = 0;
	this.slideshow_width = 340;
	this.slideshow_height = 255;
	this.slideshow_delay = 5000;
	this.pictures = new Array();
	if (document.getElementById("slideshow_urls")) {
		this.slideshow_urls=document.getElementById("slideshow_urls").innerHTML.split("|");
		this.slideshow_urls.pop();
	}
	this.movie_div = document.getElementById("slideshow");
	if (this.slideshow_urls.length > 0) {
		//this.movie_div.innerHTML = '<div style="width:320px; height:280px; background-color:#000;" align="center"><img src="" alt="スライドショー" id="imageDiaporama" /></div>';
		//this.movie_div.innerHTML = '<div style="width:320px; height:280px; background-color:#000;" align="center"><table width="320" height="280" cellpadding="0" cellspacing="0" bgcolor="#000000"><tr><th><img src="" alt="スライドショー" id="imageDiaporama" /></th></tr></table></div>';
		this.movie_div.innerHTML = '<div class="slidebox" align="center"><img src="" alt="スライドショー" id="imageDiaporama" /></div>';
	}
	for (counter=0; counter<this.slideshow_urls.length; counter+=1) {
		this.pictures.push(new Image());
	}
	for (counter=0; counter<this.slideshow_urls.length; counter+=1) {
		this.pictures[counter].src = "http://www.fukuoka-chintai.com/pictures/" + this.slideshow_urls[counter];
		//this.pictures[counter].src = "http://www.fukuoka-chintai.com/test_pictures/" + this.slideshow_urls[counter];
	}
/*	if (this.pictures.length == 1) {
		this.pictures.push(new Image());
		this.pictures[this.pictures.length-1].src = "http://www.fukuoka-chintai.com/pictures/" + this.slideshow_urls[counter-1];
	}*/
/*	if (this.pictures.length > 1) {
		this.pictures.push(new Image());
		this.pictures[this.pictures.length-1].src = "http://www.fukuoka-chintai.com/images/no_movie.jpg";
	}*/

	this.next_slide = function() {
		var img = $('imageDiaporama');
		img.src = this.pictures[this.id_current].src;
		Element.hide('imageDiaporama');
		img.src = this.pictures[this.id_current].src;
		new Effect.Appear('imageDiaporama');
		//alert("before resizing: "+img.width+"x"+img.height);
		if (this.pictures[this.id_current].width / this.pictures[this.id_current].height >= this.slideshow_width / this.slideshow_height) {
			img.width = slideshow_width;
			img.height = this.pictures[this.id_current].height * (this.slideshow_width / this.pictures[this.id_current].width);
		} else {
			img.height = slideshow_height;
			img.width = this.pictures[this.id_current].width * (this.slideshow_height / this.pictures[this.id_current].height);
		}
		//alert("after resizing: "+img.width+"x"+img.height);
		if (this.pictures.length > 1) {
			window.setTimeout("this.next_slide()",this.slideshow_delay);
		}
		if (this.id_current < (this.pictures.length-1)) this.id_current++;
		else this.id_current = 0;
	};

	if (this.pictures.length > 0) {
		this.next_slide();
	}
}

function start_slideshow2() {
	this.pictures = new Array();
	if (document.getElementById("slideshow_urls")) {
		this.slideshow_urls=document.getElementById("slideshow_urls").innerHTML.split("|");
		this.slideshow_urls.pop();
	}
	myShow = new Slideshow('slideshow', { type: 'pan', duration: [2000, 4000], width: 340, height: 255, images: this.slideshow_urls, hu: 'http://www.fukuoka-chintai.com/pictures/' });
	
}

function img_resize(){
	//width: 340, height: 255　にリサイズ。縦横比保持
	var width_size=340;
	var height_size=255;
	
	var picture_url = document.getElementById("picture_url").innerHTML;
	
	if(picture_url != ""){
		newPic = new Image();
		newPic.src = 'http://www.fukuoka-chintai.com/pictures/' + picture_url;
	
		var w = newPic.width;
		var h = newPic.height;

		if(w/4 > h/3){
			//横長の場合
			scale = width_size/newPic.width;
			newPic.width = width_size;
			newPic.height = h*scale;
		}else{
			//縦長の場合
			scale = height_size/newPic.height;
			newPic.width = w*scale;
			newPic.height = height_size;
		}
		document.getElementById("slideshow").innerHTML = '<img src="http://www.fukuoka-chintai.com/pictures/' + picture_url + '" width="'+ newPic.width + ' height="' + newPic.height +'">';
	}
}

function detailed_search_toggle() {
	var on = document.getElementById("detailed_search_on");
	var off = document.getElementById("detailed_search_off");
	on.style.cursor = 'pointer';
	on.onclick = function(){ 
		new Effect.toggle('detailed_search_box','appear');
		new Effect.toggle(this);
	};
	off.style.cursor = 'pointer';
	off.onclick = function(){ 
		new Effect.toggle('detailed_search_box','appear');
		new Effect.toggle('detailed_search_on');
	};
}

function bksearch() {
	//get data from xhtml
	var map_ido = new Array();
	var map_keido = new Array();
	var map_mode = "";
	if (document.getElementById("map_mode")) {
		map_mode=document.getElementById("map_mode").innerHTML;
	}
	if (document.getElementById("map_ido")) {
		map_ido=document.getElementById("map_ido").innerHTML.split("|");
		if (map_mode == "search") { map_ido.pop(); }
	}
	if (document.getElementById("map_keido")) {
		map_keido=document.getElementById("map_keido").innerHTML.split("|");
		if (map_mode == "search") { map_keido.pop(); }
	}
	//create map
	//if (GBrowserIsCompatible() && typeof map_ido!='undefined' && typeof map_keido!='undefined' && typeof map_mode!='undefined') {
	if ('function' == typeof GBrowserIsCompatible) {
		if (GBrowserIsCompatible() && map_ido && map_keido && map_mode) {
			map1 = new google_map(map_ido[0], map_keido[0], map_mode);
			if (map_mode == "search" || map_mode == "kakunin" || map_mode == "home" || map_mode == "edit" || document.getElementById("map_chintaibaibai")) {
				map1.get_results_data();
			}
			if (map_ido.length>0) {
				// 逆にする？まだ何かが足りない
				//for (var i = map_ido.length - 1; i >= 0; i-=1) {
				for (var i = 0; i < map_ido.length; i+=1) {
					var point = new GLatLng(map_ido[i],map_keido[i]);
					map1.add_marker(point,i);
				}
			}
			
			if (map_mode == "search") {
				map1.autozoom();
				map1.tabbed_info();
				
			}
			if (map_mode == "edit") {
				map1.attach_click(map1.markers[map1.markers.length-1], 0);
				var marker = map1.markers[map1.markers.length-1];
			}
		}
	}
	//validate form
	if(document.getElementById("form1")) {
		my_form = new form();
		if (my_form.jusho.id) {
			my_form.concat_jusho();
		}
		//my_form.rosen_option_add();
		if (my_form.chintaibaibai.id && map_mode) {
			my_form.switch_chintaibaibai();
			my_form.switch_chikunentype();
		}
		if (my_form.input_fields.length>0) {
			my_form.attach_events();
		}
		my_form.rosen_change();
		my_form.rosen2_change();
		//学校入力チェック　入力していれば入力フィールドオープン
		my_form.gakkou_open_check();
		
		my_form.dai2kotsu_change();
	}
	if(document.getElementById("embed_video")) {
		document.getElementById("embed_video").style.cursor = 'pointer';
		document.getElementById("embed_video").onclick = function(){ 
			return show_embed_video(this);
		};
	} else if (document.getElementById("movie") && document.getElementById("slideshow_urls")) {
		//start_slideshow();
		start_slideshow2();
	} else if (document.getElementById("picture_url")) {
		img_resize();
	}
	if (document.getElementById("detailed_search_box") 
		&& document.getElementById("detailed_search_on") 
		&& document.getElementById("detailed_search_off")) {
			detailed_search_toggle();
	}

	//map_showsに変更から未使用？
	divs = document.getElementsByTagName('div');
	if (divs) {
		results = new Array();
		for (i=0; i<divs.length; i=i+1) {
			//if (divs[i].className == 'results') {
			if (divs[i].className == 'clickable_list_item') {
				results.push(divs[i]);
			}
		}
		for (i=0; i<results.length; i=i+1) {
			map1.attach_click_to_result(results[i], i);
		}
	}

	if(document.getElementById('map_mode_sub')){
		//var mapsClass = new Array("ap","ma","ho","so")
		var mapsClass = "maps_mover";
		mapshows = getElementsByClassName(mapsClass);
		if (mapshows) {
			results = new Array();
			
			for (i=0; i<mapshows.length; i=i+1) {
				//if (divs[i].className == 'clickable_list_item') {
					results.push(mapshows[i]);
				//}
			}
			
			for (i=0; i<results.length; i=i+1) {
				map1.attach_click_to_result(results[i], i);
			}
		}
	}

	if(document.getElementById('ekibus')){
		ekibus_change();
	}
	
	if(document.getElementById('change_detail_view')){
		var change_detail_view = document.getElementById('change_detail_view');
		//var setphoto1 = document.getElementById('setphoto1');
		var setphoto2 = document.getElementById('setphoto2');

		change_detail_view.style.cursor = 'pointer';
		//setphoto1.style.display = 'block';
		//setphoto2.style.display = 'none';
		setphoto2.style.display = 'block';
		change_detail_view.onclick =  function(){
			//if(setphoto1.style.display == 'none'){
			if(setphoto2.style.display == 'block'){
				//setphoto1.style.display = 'block';
				setphoto2.style.display = 'none';
				
				change_detail_view.innerHTML = '<img src="../imgs/button_changemap2.gif" width="251" height="34" alt="マップ表示モードに切替え" />';
				
			}else{
				//setphoto1.style.display = 'none';
				setphoto2.style.display = 'block';

				change_detail_view.innerHTML = '<img src="../imgs/button_changeimage2.gif" width="251" height="34" alt="地図表示モードに切替え" />';

				//センターがずれる
				//map1.center_map2(new GLatLng(map_ido[0], map_keido[0]))
			}
		}
	}

	//グラフィカル検索
	if(document.getElementById('flashcontents')){
		var so = new SWFObject("./map.swf", "top", "830", "290", "8","#ffffff");
		so.addParam("wmode", "transparent");
		//so.write("flashcontents");
		if( ! so.write( "flashcontents" ) ){
			//document.getElementById( "flashcontents" ).innerHTML = "<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<福岡賃貸ドットコムをご利用するには、Flash Playerが必要になります。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ahref='http://www.adobe.com/go/getflashplayer_jp'>&nbsp;こちらをクリック&nbsp;</a>して最新のFlashPlayerをインストールして下さい。";
			document.getElementById( "flashcontents" ).innerHTML = "<p>この部分を正しく表示するには、Flash Playerが必要になります。<br /><a href='http://www.adobe.com/go/getflashplayer_jp'>&nbsp;こちらをクリック</a>し、FlashPlayerをインストールしてお楽しみ下さい。</p>Flash Playerをご使用になられない場合は、下記で地域を選択することができます。<br />[ <a href='http://www.fukuoka-chintai.com/hakata'>福岡市博多区</a> ] [<a href='http://www.fukuoka-chintai.com/chuou'>福岡市中央区</a> ] [<a href='http://www.fukuoka-chintai.com/jounan'>福岡市城南区</a> ] [ <a href='http://www.fukuoka-chintai.com/sawara'>福岡市早良区</a> ]<br />[ <a href='http://www.fukuoka-chintai.com/nishi'>福岡市西区</a> ] [ <a href='http://www.fukuoka-chintai.com/higashi'>福岡市東区</a> ] [ <a href='http://www.fukuoka-chintai.com/minami'>福岡市南区</a> ]<br />[ <a href='http://www.fukuoka-chintai.com/kasuga'>春日市</a> ] [ <a href='http://www.fukuoka-chintai.com/onojou'>大野城市</a> ] [ <a href='http://www.fukuoka-chintai.com/chikushino'>筑紫野市</a> ] [ <a href='http://www.fukuoka-chintai.com/dazaifu'>太宰府市</a> ] [ <a href='http://www.fukuoka-chintai.com/kasuya'>糟屋郡</a> ]";
    	}
	}
	
    
	//top
	//if(document.getElementById('topflash')){
		//var so = new SWFObject("/topflash/base.swf", "top", "800", "327", "8","#ffffff");
		//so.addParam("wmode", "transparent");
		//so.write("topflash");
		//if( ! so.write( "topflash" ) ){
			//document.getElementById( "topflash" ).innerHTML = "<span>この部分を正しく表示するには、Flash Playerが必要になります。<br /><a href='http://www.adobe.com/go/getflashplayer_jp'>&nbsp;こちらをクリック</a>し、FlashPlayerをインストールしてお楽しみ下さい。<br />Flash Playerをご使用になられない場合は、下記からあらかじめ地域を選択してください。<br />[ <a href='http://www.fukuoka-chintai.com/hakata'>福岡市博多区</a> ] [<a href='http://www.fukuoka-chintai.com/chuou'>福岡市中央区</a> ] [<a href='http://www.fukuoka-chintai.com/jounan'>福岡市城南区</a> ] [ <a href='http://www.fukuoka-chintai.com/sawara'>福岡市早良区</a> ]<br />[ <a href='http://www.fukuoka-chintai.com/nishi'>福岡市西区</a> ] [ <a href='http://www.fukuoka-chintai.com/higashi'>福岡市東区</a> ] [ <a href='http://www.fukuoka-chintai.com/minami'>福岡市南区</a> ]<br />[ <a href='http://www.fukuoka-chintai.com/kasuga'>春日市</a> ] [ <a href='http://www.fukuoka-chintai.com/onojou'>大野城市</a> ] [ <a href='http://www.fukuoka-chintai.com/chikushino'>筑紫野市</a> ] [ <a href='http://www.fukuoka-chintai.com/dazaifu'>太宰府市</a> ] [ <a href='http://www.fukuoka-chintai.com/kasuya'>糟屋郡</a> ]</span>";
    	//}
	//}
	
	//imgタグで右クリック禁止
	var ImgObj = document.getElementsByTagName("img");
	for (i = 0; i < ImgObj.length; i++) {
		ImgObj[i].oncontextmenu = function(){
			return false;
		}
	}
	
	//オールチェック
	var all_check = document.getElementById("all_check");
	if(all_check){
		all_check.onclick = function(){
			var CheckObj = document.getElementsByTagName("input");
			for (i = 0; i < CheckObj.length; i++) {
				if(CheckObj[i].type=='checkbox'){
					CheckObj[i].checked = this.checked;
				}
			}
		}
	}
	
	//オールチェック(アンカーVer)
	var check_all = document.getElementById("check_all");
	if(check_all){
		check_all.onclick = function(){
			var CheckObj = document.getElementsByTagName("input");
			for (i = 0; i < CheckObj.length; i++) {
				if(CheckObj[i].type=='checkbox'){
					CheckObj[i].checked = true;
				}
			}
		}
	}
	//オールクリアー(アンカーVer)
	var check_clear = document.getElementById("check_clear");
	if(check_clear){
		check_clear.onclick = function(){
			var CheckObj = document.getElementsByTagName("input");
			for (i = 0; i < CheckObj.length; i++) {
				if(CheckObj[i].type=='checkbox'){
					CheckObj[i].checked = false;
				}
			}
		}
	}
	var contacts_bukken = document.getElementById("contacts_bukken");
	if(contacts_bukken){
		contacts_bukken.onclick =  function(){
			var all_check = document.getElementsByName("showmap[]");
			if(all_check){
				var show_form = document.getElementById("bk_form");
				var form_action = document.getElementById("form_action");
				var refresh = document.getElementById("refresh");
				form_action.value="contacts_bukken";
				refresh.value=document.URL;
				show_form.method="get";
				show_form.submit();
			}
		}
	}

	//お気に入りリストからジャンプ
	var bookmark_show = document.getElementById('bookmark_show');
	if(bookmark_show){
		bookmark_show.onclick = function(){
			var bookmark_list = document.getElementById("bookmark_list");
			if(bookmark_list.options[bookmark_list.selectedIndex].value != ''){
				//location.href = bookmark_list.options[bookmark_list.selectedIndex].value;
				window.open(bookmark_list.options[bookmark_list.selectedIndex].value);
			}
		}
		bookmark_show.onmouseover = function(){
			bookmark_show.style.backgroundPosition = "0px -23px";
		}
		bookmark_show.onmouseout = function(){
			bookmark_show.style.backgroundPosition = "0px 0px";
		}
	}

	//複数画像削除
	var pic_multi_delete = document.getElementById("pic_multi_delete");
	if(pic_multi_delete){
		pic_multi_delete.onclick =  function(){
			var multi_del_id_all = document.getElementsByName("multi_del_id[]");
			var chk_flg = false;
			for (i = 0; i < multi_del_id_all.length; i=i+1) {
				if (multi_del_id_all[i].checked) {
					chk_flg = true;
				}
			}
			
			if(chk_flg){
				var del_form = document.getElementById("form3");
				var action = document.getElementById("action");
				var refresh = document.getElementById("refresh");
				action="bukken_picture_multi_delete";
				document.getElementById("action").value="bukken_picture_multi_delete";
				//refresh.value=document.URL;
				del_form.method="get";
				del_form.submit();
			}else{
				alert("削除対象物件を選択してください。");
			}
		}
	}
	//画像入れ替え
	var pic_multi_swap = document.getElementById("pic_multi_swap");
	if(pic_multi_swap){
		pic_multi_swap.onclick =  function(){
			var swap_all = document.getElementsByName("swap[]");
			var chk_flg = true;
			for (i = 0; i < swap_all.length-1; i=i+1) {
				for (j = i+1; j < swap_all.length; j=j+1) {
					i_val = swap_all[i].value.split("_");
					j_val = swap_all[j].value.split("_");
					if (i_val[0] == j_val[0]) {
						chk_flg = false;
					}
				}
			}
			if(chk_flg){
				var swap_form = document.getElementById("form3");
				var action = document.getElementById("action");
				action="picture_multi_swap";
				document.getElementById("action").value="picture_multi_swap";
				swap_form.method="post";
				swap_form.submit();
			}else{
				alert("番号が重複しています。");
			}
		}

	}
}

//クラス検索取得(配列)
function getElementsByClassName3(classNameArray) {
    var i, j, eltClass;
    var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
    var objCN = new Array();
    for (i = 0; i < objAll.length; i++) {
        eltClass = objAll[i].className.split(/\s+/);
        for (j = 0; j < eltClass.length; j++) {
        	for (k = 0; k < classNameArray.length; k++) {
				if(objAll[i].className == classNameArray[k]){
	                objCN.push(objAll[i]);
  		  	 	    break;
          		}
           	}
        }
    }
    return objCN;
}
//クラス曖昧検索取得
function getElementsByClassName2(className) {
    var i, j, eltClass;
    var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
    var objCN = new Array();
    for (i = 0; i < objAll.length; i++) {
        eltClass = objAll[i].className.split(/\s+/);
        for (j = 0; j < eltClass.length; j++) {
            if (eltClass[j] == className+"1" || eltClass[j] == className+"2") {
                objCN.push(objAll[i]);
                break;
            }
        }
    }
    return objCN;
}
function getElementsByClassName(className) {
    var i, j, eltClass;
    var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
    var objCN = new Array();
    for (i = 0; i < objAll.length; i++) {
        eltClass = objAll[i].className.split(/\s+/);
        for (j = 0; j < eltClass.length; j++) {
            if (eltClass[j] == className) {
                objCN.push(objAll[i]);
                break;
            }
        }
    }
    return objCN;
}


function ekibus_change(){
	//var ekibus = document.getElementsByName('ekibus');
	var ekibus = document.getElementById('ekibus');

	
	if(ekibus.selectedIndex=="0"){
		document.getElementById("eki_input").style.display = "block";
		document.getElementById("bus_input").style.display = "none";
	}else{
		document.getElementById("eki_input").style.display = "none";
		document.getElementById("bus_input").style.display = "block";
	}


/*
	for (var i=0; i<ekibus.length; i++){
		if(ekibus[i].checked){
			if(ekibus[i].value=="bus"){
				document.getElementById("eki_input").style.display = "none";
				document.getElementById("bus_input").style.display = "block";
			}else{
				document.getElementById("eki_input").style.display = "block";
				document.getElementById("bus_input").style.display = "none";
			}
		}
	}
	*/
	
	return true;
}

window.onload = function() {
	bksearch();
};
