var lastItem = null;
hideLast = function()
{
  if (!lastItem) return;
  lastItem.className=lastItem.className.replace(" over", "");
  lastItem = null;
}
startList = function()
{
  if (document.all&&document.getElementById)
  {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++)
    {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI")
      {
        node.onmouseover=function()
        {
          hideLast();
          this.className+=" over";
        }
        node.onmouseout=function()
        {
          lastItem = this;
          setTimeout(hideLast, 400);
          //this.className=this.className.replace(" over", "");
        }
      }
    }
  }
}
window.onload=startList;
function openPreview(src, w, h)
{
  tmpWindow = window.open("", "_popup", "width="+w+",height="+h+",status=no,toolbar=no,menubar=no");
  tmpWindow.document.open();  
  tmpWindow.document.write('<html><head><title>Veloman</title></head><body style="background:#FFFFFF; margin:0px; padding:0px;"><img src=' + src + ' border="0" /></body></html>');
  tmpWindow.document.close();
}
function getPos(el)
{
  var r = { x: el.offsetLeft, y: el.offsetTop };
  if (el.offsetParent)
  {
    var tmp = getPos(el.offsetParent);
    r.x += tmp.x;
    r.y += tmp.y;
  }
  return r;
}
var imgPos = null;
var last_Khmelnitsky = null;
function fetch_Khmelnitsky(id)
{
  div = document.getElementById('main_Khmelnitsky');
  if (last_Khmelnitsky) document.getElementById('Khmelnitsky' + last_Khmelnitsky).style.display = 'none';
  last_Khmelnitsky = id;
  document.getElementById('Khmelnitsky' + last_Khmelnitsky).style.display = '';
  try {
  imgPos = getPos(document.getElementById('map'));
  div.style.left = (510) + 'px';
  div.style.top = (imgPos.y - 0) + 'px';
  }
  catch (e) {}
  div.style.display = '';

}
function close_Khmelnitsky()
{
  div = document.getElementById('main_Khmelnitsky');
  if (last_info) document.getElementById('Khmelnitsky' + last_Khmelnitsky).style.display = 'none';
  last_Khmelnitsky = null;
  div.style.display = 'none';

}