

function kill_caption (object_id) {

  if ( isDHTML ) {
    domStyle = findDom(object_id, 1) ;
    state    = domStyle.visibility ;
    if ( state == "visible" || state == "show" ) { domStyle.visibility = "hidden" ; }
  }

}





function show_caption (evt, object_id) {

  if ( isDHTML ) {
    var page_width = getPageWidth() ;
    domStyle = findDom(object_id, 1) ;
    dom      = findDom(object_id, 0) ;
    state    = domStyle.visibility ;

    if ( dom.offsetWidth )       { elemWidth = dom.offsetWidth ; }
    else { if ( dom.clip.width ) { elemWidth = dom.clip.width ; } }


    // Netscape 4
    if ( evt.pageY ) {
      topVal = evt.pageY + 10 ;
      leftVal = evt.pageX + 5 ;
    }

    // Other browsers
    else {
      if ( evt.y ) {
        topVal = evt.y + 10 + document.body.scrollTop ;
        leftVal=evt.x + 5 + document.body.scrollLeft ;
      }
    }

    // Keep the element within the left/right limits of the page
    if ( leftVal < 2 )                               { leftVal = 2 ; }
    else { if ( (leftVal + elemWidth) > page_width ) { leftVal = page_width - elemWidth - 5 ; } }

    domStyle.top        = topVal ;    // Positions the element from the top
    domStyle.left       = leftVal ;   // Positions the element from the left
    domStyle.visibility = "visible" ; // Makes the element visable

  }

}



function getPageWidth () {
  if ( window.innerWidth != null )         { return window.innerWidth ; }
  if ( document.body.clientWidth != null ) { return document.body.clientWidth ; }
  return (null) ;
}

