function PopImgWindow($IMG,$IMG_W,$IMG_H){


$HEIGHT_MOVE=840;	
$HEIGHT_SCROLLBAR=840;	
$WIDTH_MOVE=900;	
$WIDTH_SCROLLBAR=900;

$WIN_TOP="";
$WIN_LEFT="";
$WIN_BAR="";
$WIN_W=$IMG_W;
$WIN_H=$IMG_H;
if ($WIN_H>=$HEIGHT_MOVE) {
	$WIN_TOP=',top=0';
		if ($WIN_H>=$HEIGHT_SCROLLBAR) {
			$WIN_W=$WIN_W+16;
			$WIN_H=$HEIGHT_SCROLLBAR;
			$WIN_BAR='scrollbars=yes,';
		}
}
if ($WIN_W>=$WIDTH_MOVE) {
	$WIN_LEFT=',left=0';
	if ($IMG_W>=$WIDTH_SCROLLBAR) {
		$WIN_H=$WIN_H+16;
		$WIN_W=$WIDTH_SCROLLBAR;
		$WIN_BAR='scrollbars=yes,';
	}
}
	ResultWin=window.open('','Result',''+$WIN_BAR+'resizable=yes,fullscreen=yes');
	ResultWin.focus();


	if (navigator.userAgent.indexOf('MSIE')!=-1) {
		ResultWin.resizeTo($WIN_W+12,$WIN_H+31);
	}
	else{
		ResultWin.resizeTo($WIN_W,$WIN_H);
	}

	ResultWin.document.write('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">');
	ResultWin.document.write('<SCRIPT language="JavaScript">');
	ResultWin.document.write('function ResultClose(){window.close()}');
	ResultWin.document.write('</SCRIPT></head>');


	ResultWin.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" ><table height="100%" width="100%"  align="center" border="0" cellpadding="0" cellspacing="0"><tr align="center">	<td align="center" width="45%"> </td><td align="center" width="10%"><table align="center" border="0" cellpadding="0" cellspacing="0"><tr align="center"><td align="right"><IMG SRC="images/promo/blup.gif"  BORDER=0 ALT=""></td><td align="center" style="background-image: url(images/promo/bup.gif);"></td><td align="left"><IMG SRC="images/promo/brup.gif"  BORDER=0 ALT=""></td>	</tr>	<tr >	<td style="background-image: url(images/promo/bleft.gif);background-repeat: repeat-y;background-position: right;" align="right"></td>	<td width="5%" style="border-right: 1px solid #D4E9DE;" align="center" valign="middle" bgcolor="white">');
	ResultWin.document.write('<A href="#" onClick="ResultClose()"><img src="images/promo/'+$IMG+'" border="0"></A>');
	ResultWin.document.write('</td><td style="background-image: url(images/promo/bright.gif);background-repeat: repeat-y;"></td></tr><tr><td align="right"><IMG SRC="images/promo/bldown.gif"  BORDER=0 ALT=""></td><td align="center" style="background-image: url(images/promo/bdown.gif);background-repeat: repeat-x;"></td><td align="left"><IMG SRC="images/promo/brdown.gif"  BORDER=0 ALT=""></td></tr></table></td><td align="center" width="45%"> </td></tr></table>');

ResultWin.document.write('</body></html>');
ResultWin.document.close();

}

