//---------------------------------------------------------------------------
// トップページ地域検索用
//---------------------------------------------------------------------------
function form_area_post(apoint) {
	if (document.area_form.select_type[0].checked) {
		window.location.href="../digest/?mode=lease&amp;area="+apoint;
	} else if (document.area_form.select_type[1].checked) {
		window.location.href="../digest/?mode=buy&amp;area="+apoint;
	}
}

//---------------------------------------------------------------------------
// サイドメニュー検索用
//---------------------------------------------------------------------------
function form_word_post() {
	if (document.word_form.select_type[0].checked) {
		window.location.href="../digest/?mode=lease&keyword="+encodeURI(document.word_form.keyword.value);
	} else if (document.word_form.select_type[1].checked) {
		window.location.href="../digest/?mode=buy&keyword="+encodeURI(document.word_form.keyword.value);
	}
}

//---------------------------------------------------------------------------
// 画像表示ウィンドウ生成
//---------------------------------------------------------------------------
/*ZOOMPhoto*/
if (document.all && !window.opera){  // IE4以上
  myMarginX = 20; // マージン横幅
  myMarginY = 20; // マージン縦幅
}else if (document.getElementById || document.layers){ // NS4以上(OP)
  myMarginX = 16; // マージン横幅
  myMarginY = 16; // マージン縦幅
}else{  // IE3.02とする
  myMarginX = 22; // マージン横幅
  myMarginY = 6;  // マージン縦幅
}
function myGo(myJpeg,myTitle,myWidth,myHeight){
 myXX=myWidth + myMarginX;	// ウィンドウ横幅
 myYY=myHeight + myMarginY;	// ウィンドウ縦幅
 myWinName = "Win";					// ウィンドウ名
 myWinSize = "status=no,resizable=no,scrollbars=no"+",width=" + myXX + ",height=" + myYY; // ウィンドウオプション
 myWin = window.open("" , myWinName , myWinSize); // ウィンドウを開く
 myWin.document.open();
 myWin.document.write('<html>');
 myWin.document.write('<head>');
 myWin.document.write('<title>'+myTitle+'<','/title>');
 myWin.document.write('<','/head>');
 myWin.document.write('<body topmargin=0 leftmargin=0>');
 myWin.document.write('<div align=\"center\">');
 myWin.document.write('<a href=\"javascript:window.close();\">');
 myWin.document.write('<img src=\"'+myJpeg+'\" border=\"0\" alt=\"'+myTitle+'\">');
 myWin.document.write('</a>');
 myWin.document.write('</div>');
 myWin.document.write('<' , '/body>');
 myWin.document.write('<' , '/html>');
 myWin.document.close();
}

//---------------------------------------------------------------------------
// GoogleMap 詳細ページ用
//---------------------------------------------------------------------------
//<![CDATA[
	function load_map(ido, keido, s_name, r_scale) {
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map"));
			map.addControl(new GSmallMapControl());
			map.addControl(new GScaleControl());
			//緯度経度を入力する。
			map.setCenter(new GLatLng(ido, keido), r_scale);
			// ポップアップテキスト（名称、電話番号など）
			var infoText = "<b>"+s_name+"</b>";
			var marker = new GMarker(map.getCenter());
			GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(infoText);});
			map.addOverlay(marker);
		}
	}
//]]>


//---------------------------------------------------------------------------
// PAGE TOP
//---------------------------------------------------------------------------
var scrj = 1;
	function softScrollBack() {
	if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {
	var scdist = document.body.parentNode.scrollTop;
	} else {
	var scdist = document.body.scrollTop;
	}
	if(scrj<50 && scdist) {
	scdist = (scdist>2) ? Math.ceil(scdist*.2) : 1;
	scrj++;
	scrollBy(0,-scdist);
	setTimeout("softScrollBack()",20);
	} else {
	scrollTo(0,0);
	scrj = 1;
	}
}

//---------------------------------------------------------------------------
// 画像ロールオーバー
//---------------------------------------------------------------------------
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


