// 町田家ホームページ用JavaScript
var wc, wr;
function open_window(url, n, w, h, t, l, s) {
  var hh;
// if (navigator.appName == "Netscape") {
// 	return (false);
// } else {
  return window.open(url,n,"width=" + w + ",height=" + h + ",top=" + t + ",left=" + l + "screenX=" + l + ",screenY=" + t + ",resizable=no,scrollbars=" + s);
// }
}

// ウィンドウを中央に表示
function open_window_center(url, w, h) {
  var l = (screen.width - w) / 2;
  var t = (screen.height - h) / 2;
  wc = open_window(url, h, w, h, t, l, "yes");
  // wc.window.focus();
  // wc.moveTo(l, t);
  // wc.resizeTo(w + 10, h);

}

// 掲示板用暫定
function open_window_center2 (url, w, h) {
  var l = (screen.width - w) / 2;
  var t = (screen.height - h) / 2;
  wd = open_window(url, "wBBS", w, h, t, l, "yes");
/* 
  wd.window.focus();
  wd.moveTo(l, t);
  wd.resizeTo(w + 10, h);
 */
}

// ウィンドウを右端に表示
function open_window_right(url, w, h) {
  var l = (screen.width - w - 10);
  wr = open_window(url, "wRight", w, h, 0, l, "no");
  wr.window.focus();
}

function close_window_all() {
  if (wr) wr.close();
  if (wc) wc.close();
}

