// イメージ変更
function ImgChange(aname, newsrc) {
  document.images[aname].src = newsrc;
}

// カラー変更
function ColorChange(id, col) {
  document.getElementById(id).style.background=col;
}

// Windows Vista ならメイリオフォントを使用
function onInit() {
  if (navigator.userAgent.match(/Win(dows )?NT 6\.0/)) {
    var rules = document.styleSheets[0].rules //IE
                || document.styleSheets[0].cssRules; 
    for (var i = 0; i < rules.length; i++) {
      var rule = rules[i];
      if (rule.selectorText) {
        if (rule.selectorText.toLowerCase() == "td")
          rule.style.font="9pt/14pt Meiryo";
        if (rule.selectorText.toLowerCase() == "td.submenu")
          rule.style.font="8pt/12pt Meiryo";
      }
    }
  }
}

var m_img;

// 拡大画像をポップアップで開く（実態）
function DoPopup() {
  if (!m_img.complete) {
    setTimeout(DoPopup, 30);
  } else {
    w = window.open('about:blank', '', 'width='+m_img.width+', height='+m_img.height+', left=108, top=32, titlebar=no, menubar=no, toolbar=no, status=no, location=no, directories=no, scrollbars=no, resizable=no');
    d = w.document;
    d.open();
    d.write('<html><body style="margin:0px">');
    d.write('<img src="'+m_img.src+'" />');
    d.write('</body></html>');
    d.close();
    m_img.src = "";
  }
}

// 拡大画像をポップアップで開く
function ImageOpen2(URL) {
  m_img = new Image();
  m_img.src = URL;
  DoPopup();
}

// 拡大画像をポップアップで開く旧
function ImageOpen(URL, AWidth, AHeight) {
  window.open(URL, '', 'width='+(AWidth+20)+', height='+(AHeight+30)+', left=100, top=0, titlebar=no, menubar=no, toolbar=no, status=no, location=no, directories=no, scrollbars=no, resizable=no');
}

