var w3c=(document.getElementById)? true:false;
var agt=navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
var ie5=(w3c && ie)? true : false;
var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;

/* General function*/
function Ob(o){
 var o=document.getElementById(o)?document.getElementById(o):o;
 return o;
}
function Hd(o){
 Ob(o).className="hidden";
}
function Sw(o){
 Ob(o).className="show";
}
function ExCls(o,a,b){
 Ob(o).className=Ob(o).className==a?b:a;
}

function HitTree(e){
 var tag = ie ? e.srcElement : e.target; ExCls(tag.parentNode,"open","close");
}

function SetEvt(o,a,b){
 ie?o.attachEvent("on"+a,b):o.addEventListener(a,b, false);
}

function CNLTree(id,ClsOpen,ClsClose,ClsChild){
 this.id=id;
 this.ClassOpen=ClsOpen || "open";
 this.ClassClose=ClsClose || "close";
 this.ClassChild=ClsChild || "child";
 this.AddEvt = function () {
  var arrObj=Ob(this.id).getElementsByTagName("img");
  for (var i=0;i<arrObj.length; i++) {
   arrObj[i].className=="s"?SetEvt(arrObj[i],"click",HitTree):"";
  }
 }
}


