var PopUpWin


// WindowsXP SP2かを判断
function browserVersion()
{
	if (navigator.userAgent.indexOf("SV1") == -1)
	{
		return "Not_XPSP2";
	}else{
		return "XPSP2";
	}
}



// ポップアップウインドウの表示
//
// 関数：PopUpWin_Open()
// 引数：
// PWX = 横幅
// PWY = 縦幅
// Pop_URL = インラインフレーム内のURL
// 
function PopUpWin_Open(PWX, PWY, Pop_URL){

	var shape;
	var path;
	var x;
	var y;

	if (browserVersion() == "XPSP2")
	{
//		PWY = PWY + 40;
	}

	x = (screen.width  - PWX) / 2;
	y = (screen.height - PWY) / 2;


	shape  = "left="+x+",top="+y+",width=" + PWX + ",height=" + PWY + ",";
	shape += "toolbar=no,location=no,directories=no,status=no,";
	shape += "menubar=no,scrollbars=no,resizable=yes";

	path   = Pop_URL;

	PopUpWin = window.open(path, "popupwin", shape);

}


// ポップアップのリサイズ
// 関数：PopUpWin_resizeTo()
// 引数：
// PWX = 横幅
// PWY = 縦幅
function PopUpWin_resizeTo(PWX, PWY){

	var x, y;

	if (browserVersion() == "XPSP2")
	{
		PWY = PWY + 40;
	}

	PopUpWin.resizeTo(PWX, PWY)

	x = (screen.width  - PWX) / 2;
	y = (screen.height - PWY) / 2;

	PopUpWin.moveTo(x,y);

}


// ポップアップウインドウのURL変更
//
// 関数：PopUpWin_URL()
// 引数：
// Pop_URL = POPUpWinのURL
// 
function PopUpWin_URL(Pop_URL){

	var x, y;
	var winW, winH;

	PopUpWin.location.href = Pop_URL;

	winW = PopUpWin.document.body.clientWidth;
	winH = PopUpWin.document.body.clientHeight;

	x = (screen.width  - winW) / 2;
	y = (screen.height - winH) / 2;

	PopUpWin.moveTo(x,y);
}


// ポップアップウインドウを閉じる
//
// 関数：PopUpWin_URL()
// 引数：
function PopUpWin_Close(){

	PopUpWin.close();
}


