	/**
     * ...function newwindow(タイトルバーに表示する名前,画像のURL,画像幅,画像高)...
     */

function newwindow(name,filename,widthsize,heightsize) {
browser = navigator.userAgent;
var w = widthsize;
var h = heightsize;
var ow = widthsize; 
var oh = heightsize; 
//表サイズ
var tw = widthsize + 10; 
var dw = widthsize; 
var dh = heightsize; 
//表示領域のサイズ
var sw = screen.availWidth; 
var sh = screen.availHeight; 

//IEでの設定
if (browser.match(/MSIE (\d\.\d+)/)){
if (w>sw-63) {w = sw-35;if (h<(sh-55)) {h = h + 16}} else {w = w + 28};
if (w<196) {w = 196};
if (h>sh-115) {h = sh-55} else {h = h + 60};} else {
//IE以外の設定
if (w>sw-40) {w = sw-30;if (h<(sh-70)) {h = h + 16}} else {w = w + 10};
if (w<180) {w = 180};
if (h>sh-130) {h = sh-70;if (w<(sw-30)) {w = w + 16}} else {h = h + 60};}

//Safariの設定
if (browser.indexOf("Safari")>-0){
if (w>sw-40) {w = sw-30;if (h<(sh-70)) {h = h + 0}} else {w = w + 0};
if (w<180) {w = 180};
if (h>sh-115) {h = sh-66;if (w<(sw-30)) {w = w + 0}} else {h = h + 12};}
 else {}

//Operaの設定
if (browser.indexOf("NT 5.0")<0){
if (ow>(sw-210)) {ow = sw-190;if (oh<(sh-210)) {oh = oh+16}} else {ow = ow + 20};
if (ow<190) {ow = 190};
if (oh>(sh-306)) {oh = sh-210;if (ow<(sw-190)) {ow = ow+15}} else {oh = oh + 96};
} else {
if (ow>(sw-210)) {ow = sw-190;if (oh<(sh-210)) {oh = oh+16}} else {ow = ow + 20};
if (ow<190) {ow = 190};
if (oh>(sh-299)) {oh = sh-210;if (ow<(sw-190)) {ow = ow+15}} else {oh = oh + 89};
}

if ( browser.match( /Opera[^0-9a-zA-Z]*([0-9.]+)[^;]/ ) ){} else {if ( typeof nwin == 'object' && !nwin.closed ) {nwin.close()}}; 

if ( browser.match( /Opera[^0-9a-zA-Z]*([0-9.]+)[^;]/ ) ){nwin = window.open("","Newwindow","width="+ow+"px,height="+oh+"px,screenX=10,screenY=10,top=10,left=10,status=no,resizable=yes,scrollbars=yes,fullscreen=no,TOOLBAR=no");
nwin.window.moveTo(10,10)} else {nwin = window.open("","Newwindow","width="+w+"px,height="+h+"px,screenX=10,screenY=10,top=10,left=10,status=no,resizable=yes,scrollbars=yes,fullscreen=no,TOOLBAR=no");
nwin.window.moveTo(10,10)}; 



nwin.document.open();
nwin.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'");
nwin.document.write("'http://www.w3.org/TR/html4/loose.dtd'>");
nwin.document.write("<html><head>");
nwin.document.write("<title>大弘ホームページ --- "+name+"の画像 ---</title>");
nwin.document.write("<link href='http://www.daiko-web.co.jp/gazo_open.css' rel='stylesheet' type='text/css'>");
nwin.document.write("</head>");
nwin.document.write("<body>");
nwin.document.write("<table width='100%' height='100%'>")
nwin.document.write("<tr><td style='vertical-align:top'>")


//表サイズの選択
if (dw<170) {nwin.document.write("<table width='180px' height='"+(dh+60)+"px'>");} else {
nwin.document.write("<table width='"+tw+"px'>");}

nwin.document.write("<tr><td height='30px' width='5px' class='side'>");
nwin.document.write("<img src='http://www.daiko-web.co.jp/whitespace_5_30.gif' alt='余白'></td>");
nwin.document.write("<td height='30px' class='header'>");
nwin.document.write("--- "+name+" ---");
nwin.document.write("</td><td height='30px' width='5px' class='side'>");
nwin.document.write("<img src='http://www.daiko-web.co.jp/whitespace_5_30.gif' alt='余白'></td>");
nwin.document.write("</tr>");

nwin.document.write("<tr><td width='5px' class='side'>");
nwin.document.write("<img src='http://www.daiko-web.co.jp/whitespace_5_5.gif' alt='余白'>");

//画像表示セルのサイズの選択
if (dw<170) {nwin.document.write("</td><td width='170px' height='"+dh+"px' class='photo'>");} else {
nwin.document.write("</td><td width='"+dw+"px' height='"+dh+"px' class='photo'>");}

nwin.document.write("<A HREF='javascript:window.close()' onClick='window.close();return false'>")
nwin.document.write("<img src="+filename+" alt='"+name+"の画像'>");
nwin.document.write("</a>")

nwin.document.write("</td><td width='5px' class='side'>");
nwin.document.write("<img src='http://www.daiko-web.co.jp/whitespace_5_5.gif' alt='余白'>");
nwin.document.write("</td></tr>");

nwin.document.write("<tr><td height='30px' width='5px' class='side'>");
nwin.document.write("<img src='http://www.daiko-web.co.jp/whitespace_5_30.gif' alt='余白'></td>");
nwin.document.write("<td height='30px' class='footer'>");
nwin.document.write("<A HREF='javascript:window.close()' onClick='window.close();return false'>")
nwin.document.write("<img src='http://www.daiko-web.co.jp/nwin_close.gif' alt='このウィンドウを閉じる'>");
nwin.document.write("</a>")
nwin.document.write("</td>");
nwin.document.write("<td height='30px' width='5px' class='side'>");
nwin.document.write("<img src='http://www.daiko-web.co.jp/whitespace_5_30.gif' alt='余白'></td>");
nwin.document.write("</tr>");

nwin.document.write("</table>");

nwin.document.write("</td></tr></table>");
nwin.document.write("</body></html>");

if ( browser.match( /Opera[^0-9a-zA-Z]*([0-9.]+)[^;]/ ) ) {
if ( browser.indexOf("8")>0){oh = oh + 15;nwin.resizeTo(ow,oh)}  else{
if ( browser.indexOf("9")>0){oh = oh + 15;nwin.resizeTo(ow,oh)} else{nwin.resizeTo(ow,oh)}}};

nwin.window.focus();
nwin.document.close();
}
