function MM_preloadimg() { //v3.0
  var d=document; if(d.img){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadimg.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function setImage() {
var x, a = setImage.arguments;
if ((x = MM_findObj(a[0])) != null){
	x.src = a[1];
}}

function MM_findObj(n, d){
var i, x;
if (!d) {
	d = document;
}
if (!(x = d[n]) && d.all){
	x = d.all[n];
}
for (i = 0; !x && i < d.forms.length; i++){
	x = d.forms[i][n];
}
return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function detail(){ //v1.0
window.open("/house/01/edit/invitation/privacy_forrent.html",'compinfo','width=550,height=550,toolbar=no,scrollbars=yes,resizable=yes'); 
}

function town_detail(url){ 
window.open(url,'towninfo','width=550,height=550,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes'); 
}


//候補リスト表示
function open_kh(url) {
	if (navigator.cookieEnabled != true) {
		window.alert('Cookieを有効にしてください');
	} else if (url != null) {
		window.name = 'parent';
                var win = window.open('', 'kh', 'toolbar=yes,scrollbars=yes,menubar=yes,width=440,height=600');
		win.document.open(); 
		win.document.write("<P>"); 
		win.document.close(); 
                win.focus();
                win.location.href=url;
	}
}

//候補リストの使い方を表示
function open_kh_use() {
	window.open('/house/fr/edit/kouho/list_tsukaikata.html', 'kouho', 'toolbar=no,location=no,scrollbars=yes,menubar=yes,width=604,height=550');
}

//カウント取得（候補リストを見る）
function get_kh_count() {
	if ((cookie_value = get_cookie('FRSESSCNT')) != false) {
		document.write('(' + cookie_value + ')');
	}
}

//Cookieからカウント取得
function get_cookie(key) {
	if (key != null) {
		cookie_data = document.cookie + ";";
		key = escape(key);
		start_point1	= cookie_data.indexOf(key);
		start_point2	= cookie_data.indexOf("=", start_point1) + 1;
		end_point		= cookie_data.indexOf(";", start_point1);
		if (start_point2 < end_point && start_point1 > -1 && start_point2 - start_point1 == key.length + 1) {
			cookie_data = cookie_data.substring(start_point2, end_point);
			cookie_data = unescape(cookie_data);
			return cookie_data;
		}
	}
	return false;
}

//候補リスト件数表示（候補リストに○○件の情報が入っています）
function get_kh_count_message() {
	tag1 = '<span class="red-result">';
	tag2 = '</span>';
	mongon1 = '候補リストに';
	mongon2 = '件の情報が入っています';
	if ((cookie_value= get_cookie('FRSESSCNT')) != false) {
		document.write(mongon1 + tag1 + cookie_value + tag2 + mongon2);
	}
}

//物件削除確認
function remove_kh(url){
	if (url != null) {
		res = confirm("この物件を削除してよろしいですか？");
		if (res == true) {
			window.location.replace(url);
		}
	}
}

//問合せ
function toiawase_kh() {
	window.opener.focus();
	document.testForm.target = 'parent';
	document.testForm.submit();
}

//Flash対応
function writeFlash( swf , width , height )
{
	var htm = ""
	htm+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"
	htm+="        codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'"
	htm+="        width   = " + width
	htm+="        height  = " + height
	htm+="        align   = left>"
	htm+="<param  name    = movie value=" + swf + ">"
	htm+="<param  name    = quality value=high>"
	htm+="<param  name    = LOOP value=false>"
	htm+="<embed  src     = " + swf + " "
	htm+="        width   = "+ width
	htm+="        height  = " + height
	htm+="        loop    = " + false
	htm+="        align   = left "
	htm+="        quality = high  "
	htm+="        pluginspage='http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'"
	htm+="        type    = 'application/x-shockwave-flash'>"
	htm+="</embed>"
	htm+="</object>"

  document.write(htm)
}

//フォレントスタイル候補リスト件数表示（候補リストに○○件の情報が入っています）
function get_kh_count_message_style() {
	tag1 = '<span class="red-result-s">';
	tag2 = '</span>';
	mongon1 = '候補リストに　';
	mongon2 = '件の情報が入っています';
	if ((cookie_value= get_cookie('FRSESSCNT')) != false) {
		document.write(mongon1 + tag1 + cookie_value + tag2 + mongon2);
	}
}

//フォレントスタイル候補リスト表示
function open_kh_style(url) {
	if (navigator.cookieEnabled != true) {
		window.alert('Cookieを有効にしてください');
	} else if (url != null) {
		window.name = 'parent';
                var win = window.open('', 'kh', 'toolbar=yes,scrollbars=yes,menubar=yes,width=460,height=475');
		win.document.open(); 
		win.document.write("<P>"); 
		win.document.close(); 
                win.focus();
                win.location.href=url;
	}
}

//フォレントスタイル候補リストの使い方を表示
function open_kh_use_style() {
	window.open('/house/fs/edit/mikata/koho.html', 'kouho', 'toolbar=no,location=no,scrollbars=yes,menubar=yes,width=620,height=550');
}

//フォレブラお気に入り物件の使い方を表示
function open_kh_use_bridal() {
	window.open('/house/fr/bridal/edit/mikata/okiniiri_tsukaikata.html', 'kouho', 'toolbar=no,location=no,scrollbars=yes,menubar=yes,width=604,height=550');
}

//物件詳細の周辺地図表示
function map_disp(isizeAreaCd, bukkenCd){
	window.open("/house/fr/" + isizeAreaCd + "/" + bukkenCd + "/", "map", "WIDTH=670, HEIGHT=600, toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,location=yes")
}
