//------ Nomura-re Shiryo Call Code ------//
function popup(target) {
  var shiryoWin = window.open("",target,"width=750,height=600,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no");
	shiryoWin.focus();
}
//----------------------------------------//



function NewWin(url,name) {
  str = 'scrollbars=yes,resizable=yes,width=840,height=600';
  var newW = window.open(url,name,str);
  newW.focus();
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.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 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 changeDBName(dbName){
	if(dbName=="M11_SALE_TOCHI"){
		return "SALETOCHI";
	}else if(dbName=="M12_SALE_KODATE"){
		return "SALEKODATE";
	}else if(dbName=="M13_SALE_MANSION"){
		return "SALEMANSION";
	}else if(dbName=="M14_SALE_ALLBUILDING"){
		return "SALEALLBUILDING";
	}else if(dbName=="M15_SALE_PARTBUILDING"){
		return "SALEPARTBUILDING";
	}else if(dbName=="M16_RENT_RESIDENCE"){
		return "RENTRESIDENCE";
	}else if(dbName=="M17_RENT_BUSINESS"){
		return "RENTBUSINESS";
	}
}

function changePriceChinryou(dbName){
	if((dbName=="M11_SALE_TOCHI")||(dbName=="M12_SALE_KODATE")||(dbName=="M13_SALE_MANSION")||(dbName=="M14_SALE_ALLBUILDING")||(dbName=="M15_SALE_PARTBUILDING")){
		return "Price";
	}else{
		return "Chinryou";
	}
}

function changeKoumoku(dbName, chinryou, chinryou_unit, price, price_unit, shikikin, shikikin_unit, reikin, reikin_unit, madoriheyakazu, madoritype, hensai, hensai_unit){
	if((dbName=="M11_SALE_TOCHI")||(dbName=="M12_SALE_KODATE")||(dbName=="M13_SALE_MANSION")||(dbName=="M14_SALE_ALLBUILDING")||(dbName=="M15_SALE_PARTBUILDING")){
		document.write ("<div class='koumoku'><div class='koumoku_field'>価格</div><div class='koumoku_value'>"+price+" "+price_unit+"</div></div><div class='koumoku'><div class='koumoku_field'>月々の支払額</div><div class='koumoku_value'>毎月 "+hensai+" "+hensai_unit+"</div></div>");
	}else{
		document.write ("<div class='koumoku'><div class='koumoku_field'>賃料</div><div class='koumoku_value'>"+chinryou+" "+chinryou_unit+"</div></div><div class='koumoku'><div class='koumoku_field'>間取り</div><div class='koumoku_value'>"+madoriheyakazu+" "+madoritype+"</div></div>");

	}
}

function OpenWin(){
    window.open(
    //開けたいページのURL
    "http://www.dlink.co.jp/net/usr/prezen/setsumei/setsumei.html",
    //新しいウィンドウの名前
    "win",
    //新しいウィンドウのスタイル（いらない機能はnoにする。widthは横幅、heightは縦幅。※参照）
    "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=600");
}

var ZPanoramaPlayer;

// Internet Explorer and Mozilla-based browsers refer to the Flash application
// object differently.
// This function returns the appropriate reference, depending on the browser.
function getMyApp(appName)
{
        if (navigator.appName.indexOf ("Microsoft") !=-1)
        {
                return window[appName];
        }
        else
        {
                return document[appName];
        }
}

// After Flash player has constructed, this function wll be called.
function ZPanoramaPlayerInitChain()
{
        ZPanoramaPlayer = getMyApp("PanoramaPlayer");
}

function SetFileName(filename)
{
        if(ZPanoramaPlayer == null)
        {
                ZPanoramaPlayerInitChain();
        }
        ZPanoramaPlayer.SetFileName(filename);
}

function SetFileNameInFrame(iframeIndex, filename)
{
        window.frames[iframeIndex].SetFileName(filename);
}


function sub(){
	var win = 'newwin'; //ここはファイル名でなく、ウィンドウ名です。 
	window.open('about:blank', win, 'width=700,scrollbars=yes,menubar=no,toolbar=no,resizable=yes');
	document.dataform.target = win;
	document.dataform.submit();
}

function check(){

	var emEnv1 = document.getElementById("env1").innerHTML;
	var emEnv2 = document.getElementById("env2").innerHTML;
	var emEnv3 = document.getElementById("env3").innerHTML;
	var emEnv4 = document.getElementById("env4").innerHTML;
	
	var emText1 = document.getElementById("envText1").innerHTML;
	var emText2 = document.getElementById("envText2").innerHTML;
	var emText3 = document.getElementById("envText3").innerHTML;
	var emText4 = document.getElementById("envText4").innerHTML;

	if(emEnv1 == "" && emEnv2 == "" && emEnv3 == "" && emEnv4 == "" && emText1 == "" && emText2 == "" && emText3 == "" && emText4 == ""){
		document.getElementById("location").style.display  = "none";
	}

	if(emEnv1 == "" && emEnv2 == "" && emText1 == "" && emText2 == ""){
		document.getElementById("envArea1").style.display  = "none";
	}

	if(emEnv3 == "" && emEnv4 == "" && emText3 == "" && emText4 == ""){
		document.getElementById("envArea2").style.display  = "none";
	}

	if(document.getElementById("extra").innerHTML == "<EXTRAPROPERTIES width=\"920\">"){
		document.getElementById("gaiyou_table").style.display = "none";
	}
}
