var btnName;
var TID = null;
var sTID = null;
var parts = '';
var pathFlg;
var POPCON, sPOPCON;

function popUpMenuSet(e,btnName) {

  if (POPCON) { POPCON.style.visibility = "hidden"; }
  if (sPOPCON) { sPOPCON.style.visibility = "hidden"; }

  if (document.all) { POPCON = document.all.item(btnName); }
  else { POPCON = document.getElementById(btnName); }

  // メニュー項目
  menuList(e,btnName);

  POPCON.innerHTML = parts;
  parts = '';

  if (TID) {
    clearTimeout(TID);
    TID = null;
  }
  popUpShow(e);
}

function popUpShow(e) {
  if (document.all) {
    POPCON.style.top = (document.body.scrollTop + event.clientY) - event.offsetY;
    event.srcElement.onmouseout = popUpDelay;
  }
  else {
    e.target.onmouseout = popUpDelay;
  }
  POPCON.style.visibility = "visible";
  POPCON.onmouseover  = onPopUpMouseIn;
  POPCON.onmouseout = popUpDelay;
}

function onPopUpMouseIn() {
  if (TID) {
    clearTimeout(TID);
    TID = null;
  }
}

function popUpDelay() {
  TID = setTimeout("popUpClose()", 100);
}

function popUpClose() {
  if (POPCON) { POPCON.style.visibility = "hidden"; }
  if (sPOPCON) { sPOPCON.style.visibility = "hidden"; }
  TID = null;
}

function subPopUpMenuSet(e,btnName) {

  if (document.all) { sPOPCON = document.all.item('sPOPCON'); }
  else { sPOPCON = document.getElementById('sPOPCON'); }

  // メニュー項目
  menuList(e,btnName);

  sPOPCON.innerHTML = parts;
  parts = '';

  if (sTID) {
    clearTimeout(sTID);
    sTID = null;
  } else {
    subPopUpShow();
  }
}

function subPopUpShow() {
  sPOPCON.style.visibility = "visible";
  sPOPCON.onmouseover  = subOnPopUpMouseIn;
  sPOPCON.onmouseout = subPopUpDelay;
}

function subOnPopUpMouseIn() {
  if (sTID) {
    clearTimeout(sTID);
    sTID = null;
  }
}

function subPopUpDelay() {
  sTID = setTimeout("subPopUpClose()", 100);
}

function subPopUpClose() {
  if (sPOPCON) { sPOPCON.style.visibility = "hidden"; }
  sTID = null;
}

function colorOn(ID) {
  if (document.all) { document.all.item(ID).style.backgroundColor = "#ffffff"; }
  else { document.getElementById(ID).style.backgroundColor = "#ffffff"; }
}

function colorOff(ID) {
  if (document.all) { document.all.item(ID).style.backgroundColor = "#E6E6D7"; }
  else { document.getElementById(ID).style.backgroundColor = "#E6E6D7"; }
}

