function popupWindow(name, url, s_width, s_height) {
  if ((s_width>800) || (s_height>600))
    window.open(url, name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+s_width+',height='+s_height+',screenX=150,screenY=150,top=150,left=150');
  else
    window.open(url, name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+s_width+',height='+s_height+',screenX=150,screenY=150,top=150,left=150')
}

function cOn2(that, path)
{
  if (that.style)
   {
    //alert('in style,'+that.nodeName);
    that.savedCOutColor=that.style.backgroundColor;
    that.style.backgroundColor="FFD0A0";//CCCCCC";
   };
  if (that.hasChildNodes())
   {
    var i;
    for (i=0; i<that.childNodes.length; i++)
      if ((that.childNodes[i].nodeName) && (that.childNodes[i].nodeName!="#text"))
       {
        //alert('inningb, path='+path+', that='+that.childNodes[i].nodeName+', i='+i);
        cOn2(that.childNodes[i], path+'+'+that.childNodes[i].nodeName);
        //alert('outed, path='+path+', that='+that.childNodes[i].nodeName+', i='+i);
       }
   };
}

function plusminusRecurse(rootElem, ukaz, ename, maxdepth)
 {
  var res='';
  if ((rootElem.name) && (rootElem.name==ename))
   {
    alert('plusminusOne1 '+rootElem.name);
    if (ukaz)
      rootElem.style.display='';
    else
      rootElem.style.display='none';
   }
  else if (maxdepth>0)
   {
    if (rootElem.name)
      res='plusminusRec1 '+rootElem.name;
    for (i=0; i<rootElem.childNodes.length; i++)
      res+=plusminusRecurse(rootElem.childNodes[i], ukaz, ename, maxdepth-1);
   }
  return res;
 }

function plusminusClick(clickerId, ename)
 {
  var i, clicker, prvky;
  clicker=document.getElementById(clickerId);
  if (clicker.src.indexOf('images/layout/plus.gif')>=0)
    ukaz=1;
  else
    ukaz=0;
  prvky=document.getElementsByTagName('tr');
  for (i=0; i<prvky.length; i++)
   {
    var x=prvky[i].id;
    if (x!='')
     {
      if (x.indexOf(ename)>=0)
       {
        if (ukaz)
          prvky[i].style.display='';
        else
          prvky[i].style.display='none';
       };
     }
   }
  if (ukaz)
   {
    clicker.src='images/layout/minus.gif';
   }
  else
   {
    clicker.src='images/layout/plus.gif';
   }
 }

function cOn(that)
 {
//  cOn2(that,"root");
 }

function cOut(that)
{
/*
  if (that.style)
   {
    that.style.backgroundColor=that.savedCOutColor;
   };
  if (that.hasChildNodes())
   {
    var i;
    for (i=0; i<that.childNodes.length; i++)
      if ((that.childNodes[i].nodeName) && (that.childNodes[i].nodeName!="#text"))
       {
        cOut(that.childNodes[i]);
       }
   };
*/
}
