// Еще будет перерабатываться !!!

function SetLang (Lang)
{
  var dt = new Date ()
  dt.setYear (dt.getYear () + 1)
  document.cookie = "LNG=" + Lang + ";expires=" + dt.toGMTString () + ";path=/"
  window.location.reload ()
}

function ExpandLI (obj)
{
  var id = obj.id.substr (2)
  var li = document.getElementById ("li" + id)
  var ul = document.getElementById ("ul" + id)

  if (ul.style.display == "")
  {
    obj.src = "/images/tree/c.gif"
    obj.alt = "Розгорнути"
    ul.style.display = "none"
  }
  else
  {
    obj.src = "/images/tree/o.gif"
    obj.alt = "Згорнути"
    ul.style.display = ""
  }
}

function InitTree (pre, id)
{
  var ul, li, aa
  if (id)
  {
    li = document.getElementById ("li" + pre + id)
    if (li)
      for (ul = li.parentNode ; ul && ul.tagName == "UL" ; ul = ul.parentNode.parentNode)
      {
        if (ul.style.display == "none")
        {
          aa = document.getElementById ("aa" + pre + ul.id.substr (2 + pre.length))
          aa.src = "/images/tree/o.gif"
          aa.alt = "Згорнути"
          ul.style.display = ""
        }
      }
  }
}

function UserLogoff ()
{
  window.location = "/forum/user.asp?Act=Logoff&Ref=" + escape (window.location)
}