//■読込チェック■//
function checkResponse() {
	alert("読み込まれています");
}
//■ウィンドウを開く■//
function openWindow(theURL, theName, bStatus, theX, theY, theWidth, theHeight) {

    //％
	if (theWidth.indexOf("%", 0) != -1) {
		theWidth = screen.availWidth*(parseInt(theWidth, 10)/100);
	}
	if (theHeight.indexOf("%", 0) != -1) {
		theHeight = screen.availHeight*(parseInt(theHeight, 10)/100);
	}

   //中央
	if (theX == "center" || theX == "") {
		theX = (screen.availWidth-theWidth)/2;
	}
	if (theY == "center" || theY == "") {
		theY = (screen.availHeight-theHeight)/2;
	}

  //画面より大きければ100％に
	if(theX > screen.availWidth){
	   theX = screen.availWidth;
	}
	if(theY > screen.availHeight){
	   theY = screen.availHeight;
	}

	theStatus = bStatus+",left="+theX+",top="+theY+",width="+theWidth+",height="+theHeight;
	//theStatus = "resizable=0,width=100,height=100";
	newWin = window.open(theURL, theName, theStatus);
	newWin.focus();
	newWin.resizeTo(theWidth, theHeight);
	newWin.moveTo(theX, theY);
}
//■フルスクリーンウィンドウを開く■//
function openFullWindow(theURL, theName, theStatus) {
	if (navigator.appVersion.substr(0, 1)>=4 && navigator.appVersion.indexOf("MSIE")>=0 && navigator.appVersion.indexOf("Windows")>=0) {
		var newWin = window.open(theURL, theName, theStatus+",fullscreen=1");
	} else {
		var newWin = window.open(theURL, theName, theStatus+",width="+screen.availWidth+",height="+screen.availHeight+",top=0,left=0");
	}
}
//■ウィンドウを閉じる■//
function closeWindow() {
    newWin.close();
}
//■ウィンドウサイズの変更■//
function resizeWindow(theWidth, theHeight) {
	newWin.resizeTo(theWidth, theHeight);
}
//■ウィンドウの移動■//
function moveWindow(theX, theY) {
	window.moveTo(theX, theY);
}
//■ウィンドウのサイズ変更＆移動■//
function setWindow(theX, theY, theWidth, theHeight) {
	if (theWidth.indexOf("%", 0) != -1) {
		theWidth = screen.availWidth*(parseInt(theWidth, 10)/100);
	}
	if (theHeight.indexOf("%", 0) != -1) {
		theHeight = screen.availHeight*(parseInt(theHeight, 10)/100);
	}
	if (theX == "center") {
		theX = (screen.availWidth-theWidth)/2;
	}
	if (theY == "center") {
		theY = (screen.availHeight-theHeight)/2;
	}
	window.moveTo(theX, theY);
	window.resizeTo(theWidth, theHeight);
}
//■元のウィンドウの更新＆自分自身は閉じる■//
function reloadOpener(){
opener.window.location.reload();
window.close();
}