     //browser     var ua = navigator.userAgent.toLowerCase()     var ie = MAC = 0     ie  = (ua.indexOf("msie") != -1)     MAC = (ua.indexOf('mac') != -1)function setVisibility(obj, state){     var sb = document.getElementById(obj).style     sb.visibility = state}function getVisibility(obj){     var sb = document.getElementById(obj).style     return (sb.visibility)}function setDisabled(obj, state){     document.getElementById(obj).disabled=state}function setClass(id,c){     document.getElementById(id).className=c}function focusElement(elem){     try {          elem.focus()     }     catch (e) {}}function selectElement(elem){     elem.select()}function findPos(objstr) {     // returns an array     obj = document.getElementById(objstr)     var curleft = curtop = 0     if (obj.offsetParent) {          curleft = obj.offsetLeft          curtop = obj.offsetTop          while (obj = obj.offsetParent) {               curleft += obj.offsetLeft               curtop += obj.offsetTop          }     }     return [curleft,curtop]}function objTouching(rd, rt) {     // determine if:     // top of rd is within rt, or     // bottom of rd is within rt     // return values:     // T - top within     // B - bottom within     // A - all within     // null - not touching     var ret = ""     // start by making sure left or right edge of rd is within rt     if (((rd.right >= rt.left) && (rd.right <= rt.right)) || ((rd.left >= rt.left) && (rd.left <= rt.right))) {          if ((rd.top >= rt.top) && (rd.top <= rt.bottom)) {               if ((rd.bottom >= rt.top) && (rd.bottom <= rt.bottom)) {                    ret = "A"               }               else {                    ret = "T"               }          }          else {               if ((rd.bottom >= rt.top) && (rd.bottom <= rt.bottom)) {                    ret = "B"               }          }     }     return (ret)}function getRect(obj) {     var rect = new Object();     rect.top = rect.left = 0;     var parentObj = obj;     while (parentObj != null) {          rect.top  += parentObj.offsetTop;          rect.left += parentObj.offsetLeft;          parentObj = parentObj.offsetParent;     }     rect.bottom = rect.top  + obj.offsetHeight;     rect.right  = rect.left + obj.offsetWidth;     return rect;}function getX(e) {     var x = 0;     if (ie) {          x = e.clientX;          if (!Mac) {               x += document.documentElement.scrollLeft;               x += document.body.scrollLeft;          }      }      else {          x = e.pageX + window.scrollX;      }      return x}function getY(e) {     var y = 0;     if (ie) {          y = e.clientY;          if (!Mac) {               y += document.documentElement.scrollTop;               y += document.body.scrollTop;          }     }     else     {          y = e.pageY + window.scrollY;     }     return y;}function centerObject(win,w,h) {     // center an object on screen taking into account the scroll region     if (document.body) {          w1 = (document.body.clientWidth-w)/2          h1 = (document.body.clientHeight-h)/2          w1 = w1+document.body.scrollLeft          h1 = h1+document.body.scrollTop     }     else {          var w1 = (win.innerWidth-w)/2          var h1 = (win.innerHeight-h)/2          w1 = w1+win.pageXOffset          h1 = h1+win.pageYOffset     }     if (w1 < 1 )          w1 = 1     if (h1 < 1)          h1 = 1     return[w1,h1]}function sleep(msec) {     var sd = new Date().getTime()     var ed = new Date().getTime()     while (sd+msec > ed) {          ed = new Date().getTime()     }}function winLoadCheck(id,msec,max,cnt,func) {     cnt++     if (cnt==max) {          alert(id+" Failed to Load")          return     }     if (!document.getElementById(id))          setTimeout("winLoadCheck('"+id+"',"+msec+","+max+","+cnt+","+func+")",msec)     else          func()}