function add(node)
{
    //showModalDialog('/admin/addnode/' + node + '/', null,
    //    'dialogHeight:100px; dialogWidth:400px; resizable:no; status:no');
    newWindow = window.open('/admin/addnode/' + node + '/', "subWind", "WIDTH=375, HEIGHT=375");
    newWindow.focus();
}

function rem(node)
{
    if(confirm('Вы уверены?'))
    {
        newWindow = window.open("/admin/removenode/" + node + '/', "subWind", "WIDTH=375, HEIGHT=375");
        newWindow.focus();
    }
}

function chg(node)
{
    //showModalDialog('/admin/editnode/' + node + '/', null,
    //    'dialogHeight:100px; dialogWidth:400px; resizable:no; status:no');
    newWindow = window.open('/admin/editnode/' + node + '/', "subWind", "WIDTH=375, HEIGHT=375");
    newWindow.focus();
}

function go(url)
{
    event.cancelBubble = true;
    document.location = url;
}


function show(item)
{
  var sub = document.getElementById(item.id + '_sub');
  if(sub == null)
      return;
  var parent = item.parentNode;
  if(parent == null)
      return;
  var a = 0;
  for(var i = 0; i < parent.children.length; i++)
      if(parent.children[i].id != item.id)
      {
          a += parent.children[i].style.pixelHeight;
      }
      else
          break;
  sub.style.visibility = 'visible';
  sub.style.display = 'block';
}

function hide(item)
{
  item.style.visibility = 'hidden';
  item.style.display = 'none';
}

function hide_sub(item)
{
  var sub = document.getElementById(item.id + '_sub');
  if(sub != null)
      sub.onmouseout();
}
