﻿// JavaScript Document


function Eval(identifier)
{ var i, obj;

  for (i=0;  obj = document.all(i);  i++)
      if (obj.id == identifier) return obj;
  return null;
}


function  ToggleC(demo,n)
{
  var obj1 = eval('menu' + demo + n),
      obj2 = Eval('br'   + demo + n),
      img  = Eval('img'  + demo + n),
      i, m;

  if (obj1.style.display == '')
         { obj1.style.display = 'none';
           if (img) img.SRC="images/birsdup.gif"
           if (obj2)  obj2.style.display = ''; }
    else { obj1.style.display = '';
           if (img) img.src = "images/birsdown.gif"
           if (obj2)  obj2.style.display = 'none'; }

   // lines needed for single-branch TreeMenu

   if (!(m = Math.floor(n/10)))  m = '';
   for (i = 1;  i < 10;  i++)
      if (i != n%10)
      { if (obj1 = Eval('menu'+demo+m+i))  obj1.style.display = 'none';
                                else  break;
       if ((obj2 = Eval('br'+demo+m + i))) obj2.style.display = '';
       if (img  = Eval('img'+demo+m +i))   img.src = 'images/birsdup.gif';
      }
}

function  ToggleD(demo,n)
{
  var obj1 = eval('menu' + demo + n),
      obj2 = Eval('br'   + demo + n),
      img  = Eval('img'  + demo + n),
      i, m;

  if (obj1.style.display == '')
         { obj1.style.display = 'none';
           if (img) img.SRC="images/birsdup.gif"
           if (obj2)  obj2.style.display = ''; }
    else { obj1.style.display = '';
           if (img) img.src = "images/birsdown.gif"
           if (obj2)  obj2.style.display = 'none'; }

   // lines needed for single-branch TreeMenu

   if (!(m = Math.floor(n/10)))  m = '';
   for (i = 1;  i < 10;  i++)
      if (i != n%10)
      { if (obj1 = Eval('menu'+demo+m+i))  obj1.style.display = 'none';
                                else  break;
       if ((obj2 = Eval('br'+demo+m + i))) obj2.style.display = '';
       if (img  = Eval('img'+demo+m +i))   img.src = 'images/birsdup.gif';
      }
}



