// opens a search results for a string, given in a search
// results popup window. If it is not open - opens a new window
// takes the input tag ID as the parameter
function openSearchResultsWindow( inputId )
{
  var searchText = obtainElementById( inputId ).value;
  
  // checking to have something to do
  if ( searchText == "" || searchText == defaultSearchText )
  {
    alert( "Введите поисковый запрос" );
    return;
  };
 
        
  // building the list of params
  var params = new Array();
  params[PARAM_LANGUAGE] = LANGUAGE;
  params[PARAM_SEARCH_REQUEST] = searchText;
  
  // sending the request
  sendUrlResponseTextToFunction
  ( 
    getSearchUrlRequestUrl, 
    function( response )
    {
      if ( isValidUrl( response ) )
      {
        window.open( response );
      }
      else
        alert( response );
    },
    params
  );
}