function addEvent(elm, evType, func, useCapture) {
	if (elm.addEventListener) {
		elm.addEventListener(evType, func, useCapture);
		return true;
	} else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, func);
		return r;
	} else {
		elm['on' + evType] = func;
	}
}

function changeContainerSize(__w,__h){
		document.getElementById("flashcontent").style.width = __w + "px";
		document.getElementById("flashcontent").style.height = __h + "px";
	}
	
function getBodySize(){
		//ウィンドウの表示領域を調べる
		var w = document.body.clientWidth;
		var h = document.body.clientHeight;
		
		w = (w<1000) ? 1000 : w;
		h = (h<650) ? 650 : h;
		
		if(w > 650 || h > 650) {
			changeContainerSize(w,h);
		}
	}

addEvent(window,'resize', getBodySize, false);
addEvent(window,'load', getBodySize, false);

function popupManual(){
	window.open("manual.html", "_blank", "width=520,height=500,resizable=yes,scrollbars=yes");
}
function openCenteredPopup(url, win, width, height, params){
	if(!win) win = "_blank";
	if(!width) width = 520;
	if(!height) height = 500;
	params += ",left=" + (screen.availWidth - width) * .5;
	params += ",top=" + (screen.availHeight - height) * .5;
	params += ",width=" + width + ",height=" + height;

	window.open(url, win, params);
}