//******************************************************************************/
//*                                                                            */
//*         Internet Computer Software - Java Script library.                  */
//*                                                                            */
//*         Program:                     DisplayDocket.                        */
//*         Programmer :                 John  S.  Parry.                      */
//*         Date :                       October 2008.                         */
//*         Language :                   JavaScript.                           */
//*                                                                            */
//*         Copyright (C) 2008,   Internet Computer Software Pty Ltd.          */
//*                               PO Box 279                                   */
//*                               Sandy Bay  7006                              */
//*                               Tasmania  Australia                          */
//*                                                                            */
//******************************************************************************/
//*                                                                            */
//* This software is distributed under a shareware license, you are free to    */
//* distribute this software without obtaining a license to use                */
//*                                                                            */
//*                                                                            */
//******************************************************************************/

  var DocketObj ;
  var EnableDocket = false ;

  document.write( "<Div Id='Docket' Class='DocketBox'>" ) ;
  document.write( "</Div>" );

  if ( document.all )
    { DocketObj = document.all[ 'Docket' ] ; }
  else
    { DocketObj = document.getElementById( 'Docket' ) ; }

  function DocketBody()
    {
      return (( document.compatMode && document.compatMode != 'BackCompat' ) ? document.documentElement : document.body ) ;
    }

  function DisplayDocket ( Text )
    {
      if (( document.getElementById ) || ( document.all ))
        { DocketObj.innerHTML        = Text ;
          DocketObj.style.visibility = 'visible' ;                     //* Make the pop up box and appropriate arrow visible
          EnableDocket = true ;
          PositionDocket( null ) ;
          return ( false ) ;
        }
    }

  function HideDocket ()
    {
      if (( document.getElementById ) || ( document.all ))
        { EnableDocket = false ;
          DocketObj.style.position   = 'Absolute' ;
          DocketObj.style.visibility = 'hidden' ;
        }
    }

  function UpdateDocket()
    {
      if ( XMLhttp.readyState == 4 )                                   //* 4 means loaded
        { if ( XMLhttp.status == 200 )                                 //* 200 means OK
            { ReturnString = XMLhttp.responseText ;
              DisplayDocket ( ReturnString ) ;
            }
        }
    }

  function PositionDocket ( Evt )
    {

      if ( EnableDocket )
        { var WinSize = GetWindowSize( ) ;
          NewBoxY = WinSize[ 1 ] + 30 ;
          NewBoxX = 720 ;
          if ( WinSize[ 2 ] > ( WinSize[ 0 ] + 1024 ))
            { NewBoxX = Math.round(( WinSize[ 2 ] - WinSize[ 0 ] - 1024 ) / 2 + 720 ) ; }
          DocketObj.style.top  = NewBoxY + 'px' ;                      //* Move the pop up box and arrow
          DocketObj.style.left = NewBoxX + 'px' ;
        }
    }

  document.onscroll = PositionDocket ;                                 //* Move the popup box with the mouse
  document.onresize = PositionDocket ;
  window.onresize   = PositionDocket ;

