
/*　ウィンドウを制御するJS
-------------------------------*/
var win = false;


/*　ポップアップウィンドウ　popnew(url,n,w,h,scr,x,y)
-----------------------------------------------------
	url …… ウィンドウのURL
	n　 …… ウィンドウの名称
	w　 …… ウィンドウの幅
	h　 …… ウィンドウの高さ
	src …… スクロールバーの有無（yes/no）
	x　 …… 表示位置 X軸
	y　 …… 表示位置 Y軸
----------------------------------------------------*/
function popnew(url,n,w,h,scr,x,y){

	var scrWidth = screen.availWidth;
	var scrHeight = screen.availHeight;

	if(scr){ w += 18};
	if(w>scrWidth){w = scrWidth;}
	if(h>scrHeight){h = scrHeight*0.95;}

	if(win){win.close();}
	win = window.open(url, n, "width="+w+",height="+h+",toolbar=no, status=no, menubar=no, scrollbars="+scr+", resizable=no, location=no");	
	
	if((x!=null) && (y!=null)){	
		win.moveTo(x,y);
	}
	win.focus();	
}

/*　ウィンドウをとじる
---------------------------*/
function winCls(){
	window.opener = window;
	var myWin = window.open(location.href,"_self");
	myWin.close();
	return false;
}

/*　ウィンドウのリサイズ(ウィンドウ枠)
---------------------------------------*/
function winResize(n,w,h){
	win.resizeTo(w1,h1);
	win.focus();
	return false;
}

/*　親ウィンドウの遷移
---------------------------------------*/
function openerChg(u){
	window.opener.location.href = u;
}

/*　Flash ExternalInterfaceの起動
---------------------------------------*/
/*ASを呼び出す　☆☆その時々で編集☆☆*/
function callAS(id){
	swfTarget(id).runAS();
}

/*埋め込まれた SWFのidの選択*/

function swfTarget(str) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[str];
	} else {
		return document[str];
	}
}

