var aktywna;
var aktywnyobrazek;
var menuover;
var interwal;

function go() {
	document.location.href = 'pl/index.html'
}

function hidelayer() {
	if (aktywna && !(menuover)) {
		showhide(aktywna,"hidden");
		if (aktywna == "menu" + aktywnyobrazek) picoff(aktywnyobrazek);
		clearInterval(interwal);
	}
}

function picoff(obrazek)	{
	plik = obrazek + "1";
//	document[obrazek].src = window[plik].src; 	
}

function off(obrazek)	{
	if (!(aktywna == "menu" + obrazek)) picoff(obrazek);
	if (menuover) interwal = setInterval("hidelayer()",500);
}

function on(obrazek)	{
	if (aktywna) {
		picoff(aktywnyobrazek);
		showhide(aktywna,"hidden");
	}
	plik = obrazek + "2";
//	document[obrazek].src = window[plik].src; 	
	aktywnyobrazek = obrazek;
}


function showhide(warstwa,funkcja) {
	if (funkcja == "visible") aktywna = warstwa;
	if (document.all) eval('document.all["' + warstwa + '"].style.visibility="' + funkcja + '"');
	if (document.getElementById) eval('document.getElementById("' + warstwa + '").style.visibility="' + funkcja + '"');
	if (document.layers) eval('document.layers["' + warstwa + '"].visibility="' + funkcja + '"');
}


function tree(id)
{
  this.id = id;

  this.click = function ()
  {
    for (var i = 0, el_node; i < this.parentNode.childNodes.length; i++)
    {
      el_node = this.parentNode.childNodes.item(i)
      if (el_node.nodeName.toLowerCase() == 'ul')
      {
        el_node.style.display = el_node.style.display == 'none' ? 'block' : 'none';
        this.parentNode.style.backgroundImage = 'url("' + (el_node.style.display == 'none' ? 'closed' : 'opened') + '.gif")';
        return;
      }
    }
  }

  this.start = function (el)
  {
    for (var i = 0, el_node; i < el.childNodes.length; i++)
    {
      el_node = el.childNodes.item(i);
      if (el_node.nodeName.toLowerCase() == 'a')
      {
        el_node.onclick = this.click;
        for (var j = 0; j < el_node.parentNode.childNodes.length; j++)
        {
          if (el_node.parentNode.childNodes.item(j).nodeName.toLowerCase() == 'ul')
          {
            el_node.parentNode.style.backgroundImage = 'url("closed.gif")';
            el_node.className = (el_node.className ? el_node.className + ' ' : '') + 'folder';
            break;
          }
          if (el_node.parentNode.childNodes.item(j).nodeName.toLowerCase() == 'li') break;
        }
        if (el_node.href && unescape(el_node.href) == unescape(window.location.href))
        {
          el_node.className = 'active';
          var el_parentNode = el_node;
          do
          {
            el_parentNode = el_parentNode.parentNode;
            if (el_parentNode.nodeName.toLowerCase() == 'ul')
            {
              el_parentNode.style.display = 'block';
              if (document.getElementById(this.id) != el_parentNode) el_parentNode.parentNode.style.backgroundImage = 'url("opened.gif")';
            }
          }
          while (document.getElementById(this.id) != el_parentNode)
        }
      }
      else if (el_node.nodeName.toLowerCase() == 'ul') el_node.style.display = 'none';
      this.start(el_node);
    }
  }

  if (document.getElementById && document.childNodes)
  {
    if (document.images)
    {
      new Image().src = 'opened.gif';
      new Image().src = 'document.gif';
    }
    this.start(document.getElementById(this.id));
  }
}

function insertFlashmain(lang) {
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="770" HEIGHT="190" id="main-espefa" ALIGN=""> ');
document.write(' <PARAM NAME=movie VALUE="/flash/main-espefa_'+lang+'.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
document.write('<EMBED src="/flash/main-espefa_'+lang+'.swf" quality=high bgcolor=#FFFFFF  WIDTH="770" HEIGHT="190" NAME="main-espefa" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
document.write('</OBJECT>');
}
