// imanja共通スクリプト
// 作成日：	2007/05/03
// 更新日：
// 作成者：	T.H
//
var popupWin = null;

// 親ウィンドウから写真情報を取得
function PopupInfoSet()
{
	var image = new Image();
	image.src = opener.document.info.photo.value;
// alert("PopupInfoSet() : " + image.src);
	document.photo.src = image.src;

	return;
}

// ウィンドウを開く
function PopupOpen(p_popup, p_photo, p_width, p_height)
{
	document.info.photo.value = p_photo;

	// すでにウィンドウが開いていたら閉じる
	PopupClose();
	// ウィンドウを開く
	popupWin = window.open(p_popup, "popup", "width=" + p_width  + ",height=" + p_height + ",status=no");

	popupWin.focus();

	return;
}

// ウィンドウを閉じる
function PopupClose()
{
	if(popupWin != null && popupWin.closed == false)
	{
		popupWin.close();
	}

	return;
}

// HTMLを表示
function OutputLayer(layName, html)
{
	if(document.getElementById)
	{                 							 //n6,n7,m1,e5,e6
		document.getElementById(layName).innerHTML=html;
	}
	else if(document.all)
	{											//e4
		document.all(layName).innerHTML=html;
	}
	else if(document.layers)
	{                 							 //n4
		with(document.layers[layName].document);
		{
			open();
			write(html);
			close();
		}
	}
}

// サーバーのURLを取得
function GetMyUrl()
{
	if(location.hostname == "imanja.jp")
	{
		return "http://imanja.jp/";
	}
	else
	{
		return "http://" + location.hostname + "/";
	}
}
