//別窓で開く
function openWin(a,b,c)
{
	win=window.open(a, b, c);
	win.moveTo(0,0);
	return false;
}

//openWin_teaser(アドレス,ウインドウ名,横幅,縦幅)
function openWin_teaser(url_ad,w_name,w_width,w_height)
{
	//画面上の中央の座標を得る
	w_x = screen.width;
	w_y = screen.height;
	w_x = (w_x / 2) - (w_width / 2);
	
	if( (w_y - 200) < w_height )
	{
		w_width = w_width + 25;
		w_y = w_y - 40;	//ブラウザによっては、窓の縦をモニタ側にあわせてもはみ出すことがあるので、少し減らす
		win=window.open(url_ad, w_name, "width=" + w_width + ", height=" + w_y + ", top=0, left=" + w_x + ", menubar=no, toolbar=no, location=no, status=no, resizable=no, scrollbars=yes");
	}
	else
	{
		win=window.open(url_ad, w_name, "width=" + w_width + ", height=" + w_height + ", top=0, left=" + w_x + ", menubar=no, toolbar=no, location=no, status=no, resizable=no, scrollbars=no");
	}
	return false;
}







// 画像のみでポップアップウインドウ
// 使い方
//<a href="URL" onclick="return SubWin('URL','幅','高さ','名前')">サムネイル等</a>

function SubWin(url,x,y,na){
	x = x + 30;
	var windowFeatures = "width=" + x + ",height=" + y + ",top=0,left=0, scrollbars=yes";
	subwin=window.open("", "_blank", windowFeatures);
	subwin.document.open();
	subwin.document.writeln("<html><head>");
	subwin.document.writeln("<title>" + na + "</title>");
	subwin.document.writeln("</head><body style='margin:0;padding:0;'>");
	subwin.document.writeln("<center><img src='" + url + "' alt='" + na + "'></center>");
	subwin.document.writeln("</body></html>");
	subwin.document.close();
	return false; 
}

function SubWin_com(url,x,y,na,coment){
	var windowFeatures = "width=" + x + ",height=" + y + ",top=0,left=0";
	subwin=window.open("", "_blank", windowFeatures);
	subwin.document.open();
	subwin.document.writeln("<html><head>");
	subwin.document.writeln("<title>" + na + "</title>");
	subwin.document.writeln("</head><body style='margin:0;padding:0;'>");
	subwin.document.writeln("<img src='" + url + "' alt='" + na + "'>");
	subwin.document.writeln("<p style='margin:0px 3px;font-size:10pt;'>" + coment + "</p>");
	subwin.document.writeln("</body></html>");
	subwin.document.close();
	return false; 
}

