function processLogout( )
{
   var url   = '/system_ajax.php?class=system&function=logoff&'+ajaxRand;
   var myReq = loadXMLDocSync( url, 'processLogoffResponse' );
}

function processLogoffResponse( reqId )
{
   if ( req[reqId].readyState == 4 )
	{
		// only if "OK"
		if ( req[reqId].status == 200 )
		{
			//if ( inForums == true )
			//{
			   setTimeout( 'processForumLogout( )', 100 );
			//}
			//else
			//{
			//   window.location.replace( '/login' );
			//}
      }
	}
}

function processForumLogout( )
{
  var url = '/forums/api/user_interface.php';
  var myReq = postXMLDocSync( url, 'logoffForm', 'processForumLogoffResponse' );
}

function processForumLogoffResponse( reqId )
{
   if ( req[reqId].readyState == 4 )
	{
		// only if "OK"
		if ( req[reqId].status == 200 )
		{
		   window.location.replace( '/login' );
      }
	}
}

// start search handler   
function runSearch( )
{
   if ( getObjectFormat( 'search_string' ).value.trim( ) == '' )
   {
      addError( 'you must tell us what you are looking for.' );
   }
   
   if ( parseErrors( ) )
   {
      getObjectFormat( 'searchForm' ).submit( );
   }
}
// end search handler
