// This document was created at 02/22/07, 16:26:37 by Aditor

// get element of page by id (cross-browser)
function elementById(Name) {
  if(navigator.appName.indexOf("Microsoft")!=-1) {
  // IE
    if(!eval('document.all("'+Name+'")')) return 0; else return document.all(Name);
    }
    else {
  // NN & others
        if(!eval('document.'+Name))  {
      if (document.getElementById) {
        return eval('document.getElementById("'+Name+'")');
      } else
      return 0;
        }
        else
    return eval('document.'+Name);
  }
}
// set element property (cross-browser)
function setProp(Name, Param, Val) {
  if(navigator.appName.indexOf("Microsoft")!=-1) {
  // IE
    if(!eval('document.all("'+Name+'")')) return 0; else eval('document.all("'+Name+'").style.'+Param+'='+Val);
    }
    else {
  // NN & others
        if(!eval('document.'+Name))  {
      if (document.getElementById) {
        eval('document.getElementById("'+Name+'").style.'+Param+'='+Val);
      } else
      return 0;
        }
        else
    eval('document.'+Name+'.'+Param+'='+Val);
  }
}
// get element property (cross-browser)
function getProp(Name, Param) {
  if(navigator.appName.indexOf("Microsoft")!=-1) {
  // IE
    if(!eval('document.all("'+Name+'")'))
      return 0;
    else
      return eval('document.all("'+Name+'").style.'+Param);
    }
    else {
  // NN & others
        if(!eval('document.'+Name))  {
      if (document.getElementById) {
        return eval('document.getElementById("'+Name+'").style.'+Param);
      } else
      return 0;
        }
        else
    return eval('document.'+Name+'.'+Param);
  }
}
function toggle(s)
{
    var layer = 'p'+s;
    var a = 'a'+s;
  if (getProp(layer, "display")!="none")
  {
    setProp(layer, "display", "'none'");
    setProp(a, "background",  "'url(plus.gif) 0 4px no-repeat'");
  }
  else
  {
    setProp(layer, "display",  "''");
    setProp(a, "background",  "'url(minus.gif) 0 4px no-repeat'");
  }
}
function toggleAll(num)
{
    var a = 'toggleall';
  if (getProp(a, "background").search('plus')==-1)
  {
    setProp(a, "background",  "'url(plus.gif) 0 4px no-repeat'");
    for(var i=1; i<num+1; i++)
    {
        var layer = 'p'+i;
        var a = 'a'+i;
      if (elementById(a)) {setProp(a, "background",  "'url(plus.gif) 0 4px no-repeat'");setProp(layer, "display", "'none'");}
    }
  }
  else
  {
    setProp(a, "background",  "'url(minus.gif) 0 4px no-repeat'");
    for(var i=1; i<num+1; i++)
    {
        var layer = 'p'+i;
        var a = 'a'+i;
      if (elementById(a)) {setProp(a, "background",  "'url(minus.gif) 0 4px no-repeat'");setProp(layer, "display",  "''");}
    }

  }
}
