
//指定の大きさでpopup
function openWin(theURL,winName,w,h) {
	x=(screen.width-w)/2;
	y=(screen.height-h)/2;
	features="toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+w+",height="+h+",left="+x+",top="+y;
	window.open(theURL,winName,features);
}



//##################################################


var tar;
var mw = 800;
var mh = 600;

function setTar()
{
	tar = document.getElementById("flash");
	checkWin();
}


function setTimer()
{
	var _timer = setTimeout("checkWin()", 100);
}



function checkWin()
{
	var size = getWinsize();
	tar.style.width = (size.w > mw)? "100%": mw + "px";
	tar.style.height = (size.h > mh)? "100%": mh + "px";
	setTimer();
}


function getWinsize()
{
	var _obj = new Object();
	if(window.innerHeight)
	{
		_obj.w = window.innerWidth;
		_obj.h = window.innerHeight;
	}
	else if (document.all && document.getElementById && (document.compatMode=='CSS1Compat'))
	{
		_obj.w = window.clientWidth;
		_obj.h = document.documentElement.clientHeight;
	}
	else if(document.body.clientHeight)
	{
		_obj.w = document.body.clientWidth;
		_obj.h = document.body.clientHeight;
	}
	else
	{
		_obj.w = 0;
		_obj.h = 0;
	}
	return _obj;
}


//open new window
function popup(url,w,h,target)
{
	sw=screen.availWidth/2-w/2;
	sh=screen.availHeight/2-h/2;
	window.open(url,target,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+',top='+sh+',screenY='+sh+',left='+sw+',screenX'+sw);
}

function popup2(url,_w,target)
{
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		w = _w+17;
	}
	else
	{
		w = _w+9;
	}

	sw=screen.availWidth/2-w/2;
	window.open(url,target,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width='+w+',left='+sw+',screenX'+sw);
}

function openHowToSet(url)
{
	popup2(url,609,'_howToSet')
}