/*//////////// フルスクリ−ン幅get用指定用関数   UseFree
========================================================
 Win  n4 n6 moz e4 e5 e6,
 Mac  n4 n6 moz e4.5 e5,
 Linux n4 n6 moz         
========================================================
 ルスクリ−ン幅をピクセル単位で取得する
 Support http://game.gr.jp/js/
=======================================================*/
function getScreenWIDTH(){
	if(!!window.screen)
		return screen.width        //N4,N6,Moz,IE,共用
	else
		return null                //上記以外
}
function getScreenHEIGHT(){
	if(!!window.screen)
		return screen.height       //N4,N6,Moz,IE,共用
	else
		return null                //上記以外
}
/*//////////// フルスクリ−ン幅get用指定用関数ここまで */
var sw1; var sw2; var pitch1; var pitch2; var str;
function PopWindow(Aurl,Aname,Awidth,Aheight){
	sw1 = 0; sw2 = 0; pitch1 = 13; pitch2 = 32; pitch3 = 24;
	if(getScreenWIDTH() < (Awidth - 0) + (pitch1 * 2)){
		Pwidth = getScreenWIDTH() - pitch1; sw1 = 1;
	} else {
		Pwidth = (Awidth - 0) + pitch3 ;
	}
	if(getScreenHEIGHT() < (Aheight - 0) + (pitch2 * 2)){
		Pheight = getScreenHEIGHT() - pitch2; sw2 = 1;
	} else {
		Pheight = (Aheight - 0) + pitch3 ;
	}
	if(sw1 && !sw2){ Pheight = (Pheight - 0) + pitch2; }
	if(!sw1 && sw2){ Pwidth = (Pwidth - 0) + pitch1; }
	if(sw1 || sw2){
		str = ",left=0,top=0,screenX=0,screenY=0,scrollbars,resizable";
	} else {
		str = ",resizable";
	}
	if(Pwidth < 40){Pwidth = 40}
	if(Pheight < 80){Pheight = 80}
	Astr = "width=" + Pwidth + ",height=" + Pheight + str;
	subwin = window.open(Aurl,'',Astr);
	if(sw1 || sw2){
		subwin.window.scrollTo(0, 0);
	}
}

