
 //
 // Copyright @ Aug 2002. All rights reserved. Do not copy or adapt from this
 // code without getting permission from me...
 // I sweated for days to get this working, the least you can do it ask before
 // you take it.
 //    Gordon Russell <Dr_G_Russell@hotmail.com>

 // ----
 // Browser control librar
 // ----
 var isNS4;
 var isIE4;
 var isIE5;
 var isNS6;
 var boxVisible=0;
 var whatVisible;

 function browser() {
   isNS4 = (document.layers) ? true : false;
   isIE4 = (document.all && !document.getElementById) ? true : false;
   isIE5 = (document.all && document.getElementById) ? true : false;
   isNS6 = (!document.all && document.getElementById) ? true : false;
   //
   setTimeout("KeepToTop()",300);
 }
 function wclose() {
   if (boxVisible==1) {
     setHidden(whatVisible);
   }
   boxVisible=0;
   whatVisible="";
   return false;
 }
 function eventTarget(evt) {
    var elem
    if (evt) {
        if (evt.target) {
            elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target
        } else {
            elem = evt.srcElement
        }
        if (elem) {
            // process event here
        }
    }
    return elem;
 }

 function bpress(e) {
   e = (e) ? e : ((window.event) ? window.event : "")
   etarget = eventTarget(e);
   bname = "none";
   if (etarget.id == "a") {bname = "boxa"}
   if (etarget.id == "b") {bname = "boxb"}
   if (etarget.id == "c") {bname = "boxc"}
   if (etarget.id == "d") {bname = "boxd"}
   if (etarget.id == "e") {bname = "boxe"}
   if (etarget.id == "tm-a") {bname = "boxa"}
   if (etarget.id == "tm-b") {bname = "boxb"}
   if (etarget.id == "tm-c") {bname = "boxc"}
   if (etarget.id == "tm-d") {bname = "boxd"}
   if (etarget.id == "tm-e") {bname = "boxe"}
   if (boxVisible==1) {
     setHidden(whatVisible);
     boxVisible=0;
   }
   if (whatVisible != document.getElementById(bname)) {
     if (bname != "none") {
       whatVisible = document.getElementById(bname);
       setVisible(whatVisible);
       boxVisible=1;
       updatePos();
     }
   } else {
     whatVisible="";
   }
 }
 function updatePos() {
   //e = (e) ? e : ((window.event) ? window.event : "")
   x = 0;
   y = 0;
   ob = document.getElementById("topmenu");
   if (window.innerHeight) {
     y = window.pageYOffset
     x = window.pageXOffset
   } else if (document.documentElement && document.documentElement.scrollTop) {
     y = document.documentElement.scrollTop
     x = document.documentElement.scrollLeft
   } else if (document.body) {
     y = document.body.scrollTop
     x = document.body.scrollLeft
   }

   if (boxVisible==1) {
     setLeft(whatVisible,x+20);
     setTop(whatVisible,y+140);
   }
   setLeft(ob,x+20);
   setTop(ob,y+100);
 }
 function KeepToTop() {
   updatePos();
   setTimeout("KeepToTop()",300);
 }
 function setHidden(ob) {
   if (isIE4 || isIE5 || isNS6) { ob.style.visibility="hidden"; }
   if (isNS4) { ob="hide"; }
 }
 function setVisible(ob) {
   if (isIE4 || isIE5 || isNS6) { ob.style.visibility="visible"; }
   if (isNS4) { ob="show"; }
 }
 function getElement(name) {
   if (isNS4) { return document.layer[name]; }
   if (isIE4) { return document.all[name]; }
   if (isIE5 || isNS6) { return document.getElementById(name); }
 }
 function setStyle(ob) {
   if (isIE4 || isIE5 || isNS6) { return ob.style; }
   if (isNS4) { return ob ; }
 }
 function setBGC(ob,x) {
   if (isIE4 || isIE5) { ob.style.backgroundColor = x; }
   if (isNS4 ) { ob.bgColor= x; }
   if (isNS6 ) { ob.style.backgroundColor  = x; }
 }
 function setLeft(ob,x) {
   if (isIE4 || isIE5 ) { ob.style.left= x; }
   if (isNS6 ) { ob.style.left= x + "px"; }
   if (isNS4) { ob.left= x; }
 }
 function setTop(ob,x) {
   if (isIE4 || isIE5 ) { ob.style.top= x; }
   if (isNS6 ) { ob.style.top= x + "px"; }
   if (isNS4) { ob.top = x; }
 }
 function setZindex(ob,zi) {
   if (isIE4 || isIE5 || isNS6 ) { ob.style.zIndex = zi; }
   if (isNS4) { ob.zIndex = zi; }
 }

