// JavaScript Document
//別窓サイズを指定して開く
/*
[使用例]
<a href="example.html" onclick="m_win(this.href,'mywindow7',400,300); return false;">クリック１</a>
<a href="example.html" onclick="m_win(this.href,null,600,400); return false;">クリック２</a>

*/

function m_win(url,windowname,width,height) {
	var features="location=no, menubar=no, status=no, scrollbars=yes, resizable=yes, toolbar=no";
	if (width) {
		if (window.screen.width > width)
			features+=", left="+(window.screen.width-width)/2;
		else width=window.screen.width;
			features+=", width="+width;
	}
	if (height) {
		if (window.screen.height > height)
			features+=", top="+(window.screen.height-height)/2;
		else height=window.screen.height;
			features+=", height="+height;
	}
	window.open(url,windowname,features);
}

