// JavaScript Document

// setting varialbles
// ie5+ supports all the methods in the tree, but not the hasFeature, so...
var ie5 = (document.all && document.getElementById)? true : false;
// dom - all DOM2 compliant browsers (with MouseEvents 2 ;-)
var dom = (document.implementation && 
  document.implementation.hasFeature("MouseEvents","2.0"))? true : false;
// tree variables
// isTreeOpen
// All tree branches are open if true, closed if false.
// I've got plans to keep branch states in cookie, but it's not yet realized.
var isTreeOpen = false;
// look variables
// By this value leafs will go deep.
var leafImgWidth = 16;
// Default caption padding in the style
var leafCaptionDefPadding = 0;
// Caching leafImages
var leafImg = new Image();       leafImg.src = '/img/leaf.gif';
var leafOpenImg = new Image();   leafOpenImg.src = '/img/expand.gif';
var leafClosedImg = new Image(); leafClosedImg.src = '/img/collapse.gif';
// Fake function
function initTree(treeContainerId) { return false }

if(ie5||dom)
{
  document.write('<link rel="stylesheet" type="text/css" href="/style/tree.css">');
  document.write('<script language="JavaScript" type="text/javascript" src="/script/tree.js"><\/script>');
}
else
  document.write('<link rel="stylesheet" type="text/css" href="/style/tree_v4.css">');



if(navigator.appName=="Microsoft Internet Explorer") ie=1;

function chgcolor ( name, x )
{
  if(!ie5) return;
  if(x)
  {
    eval(name+".style.background='#ABCADF'");
    eval(name+".style.cursor='hand'");
    return;
  }
  eval(name+".style.background='#7FA2C4'");
  eval(name+".style.cursor=''");
}

var color=0, bgc=0;

function chgcolorm(name,x,bgcol)
{
  if(!ie5) return;
  if(x)
  {
    bgc=eval(name+".style.background");
    eval(name+".style.background='#ABCADF'");
    eval(name+"s"+".style.color='white'");
    eval(name+".style.cursor='hand'");
    return;
  }
  eval(name+".style.background=bgcol");
  eval(name+"s"+".style.color='black'");
  eval(name+".style.cursor=''");
}

function chgcolor1(name,x)
{
  if(!ie5) return;
  if(x)
  {
    bgc=eval(name+".style.background");
    eval(name+".style.background='#E2E8C3'");
    eval(name+".style.cursor='hand'");
    return;
  }
  eval(name+".style.background='#C3C8A7'");
  eval (name+".style.cursor=''");
}

