// JavaScript Document

//---- 親ウインドウロケーション変更・子ウインドウクロス -----//
function ParentLocation(LocationStr){
	if ((navigator.userAgent.indexOf("Mac") > -1)){
		if (window.opener){
			window.opener.location.href=LocationStr;
			window.opener.focus();
		}else{
			cwin=window.open(LocationStr,"Main");
		}
	}else{
		if (window.opener){
			if (!window.opener.closed){
				window.opener.location.href=LocationStr;
				window.opener.focus();
			}else{
				cwin=window.open(LocationStr,"Main");
			}
		}else{
			cwin=window.open(LocationStr,"Main");			
		}
	}
//	window.close();
}

//---- 詳細ウィンドウオープン -----//
function OpenSyousai(path){
	var op="location=0,resizable=1,scrollbars=1";
	cwin=window.open(path,"Non",op);
	cwin.focus();
//	Title="有限会社 湖西住研/物件詳細情報";
//	cwin.document.title=Title;
}

//---- 画像ウィンドウオープン -----//
function OpenWinGazou(ImagePath){
	var html0="";

	html0 +='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"';
	html0 += '"http://www.w3.org/TR/html4/loose.dtd">';
	html0 +='<html>';
	html0 +='<head>';
	html0 +='<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">';
	html0 +='<title>画像</title>';
	
	html0 +='<script type="text/javascript">';
	html0 +='function WinClose(){';
		html0 +='window.opener="myself";';
		html0 +='window.close();';
	html0 +='}';
	html0 +='</script>';
	
	html0 +='</head>';
	html0 +='<body style="background-color:#FFFFDF">';

	html0 +='<div style="margin:auto; text-align:center;">';
		html0 +='<div style="padding:5px 5px 5px 5px; display:block; float:left; clear:left;">';
			html0 +='<div style="margin:10px 10px 10px 10px; padding:5px 5px 5px 5px; border:1px solid #FFCCDD; display:block; float:left;" id="divgazou">';
				html0 +='<a href="javascript:void(WinClose());"><img src="';
				html0 +=ImagePath;
				html0 +='" id="gazou" border="0" /></a>';
			html0 +='</div>';
			html0 +='<div style="clear:left;">';
				html0 +='<button type="button" onClick="javascript:void(window.close());">閉じる</button>';
			html0 +='</div>';
		html0 +='</div>';
	html0 +='</div>';

	html0 +='</body>';
	html0 +='</html>';

	var op="location=0,resizable=1,scrollbars=1";
	
	obj=window.open("","Test",op);
	obj.document.open();
	obj.document.write(html0);
	obj.document.close();
	
//	obj.document.getElementById('gazou').src="./img/bukken_g_201.jpg";
}

function OpenWinTest(HtmlStr){
	html0="";
	
	html0='<link rel="stylesheet" href="css/chizu.css" type="text/css" media="all" />';
	html0 +='<div style="margin:auto; text-align:center;">';
	html0 +='<div style="padding:5px 5px 5px 5px; display:block; float:left; clear:left;">';
	html0 +='<div class="chizuwaku">';
	html0 += HtmlStr;
	html0 +='</div>';
	html0 +='<div style="clear:left; ">';
	html0 +='<button type="button" onClick="javascript:void(window.close());">閉じる</button>';
	html0 +='</div>';
	html0 +='</div>';
	html0 +='</div>';
	
	path="./chizu.htm";
	cwin=window.open(path,"Non","location=0, directories = 1");
	cwin.focus();
	cwin.document.open();
	cwin.document.write(html0);
	cwin.document.close();
}

