/**
 * Add the trim() function to the native String Object
 *
 * @author  auke@netmasters.nl
 * @version 1.0 - 2004/12/06
 */
String.prototype.trim = function( ) 
{
  return this.replace( /^\s*(\b.*\b|)\s*$/, "$1" );
}

/**
 * @author  rens@netmasters.nl
 * @version 1.0 - 2004/12/06
 */
function validateSearch()
{
  var xSearchInput = document.getElementById( 'searchbox' );

  if( !xSearchInput )
  {
    alert( 
      'Warning (for the developer):\n\nThe validation script for the search ' +
      'functionality was unable to find the text input box. As a result, ' +
      'the script can not determine if the input was valid or not.' 
    );
           
    return( false );
  }
  
  xSearchInput.value = xSearchInput.value.trim();
  xSearchInput.focus();

  return( xSearchInput.value.length > 0 );
}
