//                               ajax.js
// debugging routines
//_____________________________________________________________________________
function
   elucidate( o )
{
var
   e,
   html = "";

for( e in o )
   {
   html += "" + e + " = " + o[ e ] + "<br >" + "\n";
   }
return html;
}
//_____________________________________________________________________________
function
   show_this( s )
{
var
   d,
   w;

w = window.open( "" );
d = w.document;
d.open( );
d.write( s );
d.close( );
}
//_____________________________________________________________________________

var
   xml_is_live = false;
//_____________________________________________________________________________
function
   makeHttpRequest( url, callback_function, return_xml, send_this_query )
{
var
   READY_STATE_UNINITIALIZED = 0,
   READY_STATE_LOADING = 1,
   READY_STATE_LOADED = 2,
   READY_STATE_INTERACTIVE = 3,
   READY_STATE_COMPLETE = 4,
   e,
   http_request = null;          // local object

//alert( "makeHttpRequest ing!" );
if( window.XMLHttpRequest )
   {                             // Mozilla, Safari,...
   try{
      http_request = new XMLHttpRequest();
      }
   catch( e )
      {
      }
   if( http_request.overrideMimeType )
      http_request.overrideMimeType( 'text/xml' );
   //else
   //   {
   //   }
   }
else
   if( window.ActiveXObject )
      {                          // IE
      try{
         http_request = new ActiveXObject( "Msxml2.XMLHTTP" );
         }
      catch( e )
         {
         try{
            http_request = new ActiveXObject( "Microsoft.XMLHTTP" );
            }
         catch( e )
            {
            }
         }
      }
if( !http_request )
   {
   alert( 'Unfortunatelly you browser doesn\'t support this feature.' );
   return false;
   }
http_request.onreadystatechange = function() // an anonymous function just for here!
   {
   switch( http_request.readyState )
      {
      case READY_STATE_COMPLETE:     // 4
         //alert( "ajax ready state: " + http_request.readyState + " good!" );
         switch( http_request.status )
            {
            case 200:   // OK
               //alert( "calling: " + callback_function + " good!" );
               //alert( "with text: " + http_request.responseXML + " good!" );
               //alert( "with text: " + http_request.responseText + " good!" );
               eval(
                    callback_function +
                    '( return_xml? http_request.responseXML: http_request.responseText, return_xml )'
                   );
               break;
            case 404:   // -> URL doesn't exist!
            case 500:
            default:    // more codes could be added here...
               alert(
                     'There was a problem with the request.(Code: ' +
                      http_request.status + ')'
                    );
               break;
            }
         break;
      case READY_STATE_UNINITIALIZED:  // 0
         //alert( "ajax ready state: " + http_request.readyState );
         break;
      case READY_STATE_LOADING:        // 1
         //alert( "ajax ready state: " + http_request.readyState );
         break;
      case READY_STATE_LOADED:         // 2
         //alert( "ajax ready state: " + http_request.readyState );
         break;
      case READY_STATE_INTERACTIVE:    // 3
         //alert( "ajax ready state: " + http_request.readyState );
         break;
      default:    // one could do something with this information?
         //alert( "ajax ready state: " + http_request.readyState );
         break;
      }
   }
if( "" == send_this_query )
   {                          //alert( "ajaxing a get..." );
   http_request.open( 'GET', url, true );
   http_request.send( null );
   }
else
   {                          //alert( "ajaxing a post..." );
   http_request.open( 'POST', url, true );
   http_request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
   http_request.send( send_this_query );
   }
return true;
}
//_____________________________________________________________________________
function
  do_onmouseover( t )
{
document.getElementById( t ).onmouseover =
   function
      onmouseover( event )
      {
      do_rollover( this );
      }
}
//_____________________________________________________________________________

