﻿function searchGoogle(sText) {
  // Create a search control
  var searchControl = new GSearchControl();
  var options = new GsearcherOptions();
  var myWebSearch = new GwebSearch(); // pietsch-companion.com からのみの検索
  var allWebSearch = new GwebSearch();
  var allBlogSearch = new GblogSearch();

　options.setExpandMode(GSearchControl.EXPAND_MODE_CLOSED);
  myWebSearch.setSiteRestriction("pietsch-companion.com");
  myWebSearch.setUserDefinedLabel("PietschCompanion 内");
  allWebSearch.setUserDefinedLabel("Web 全体");
  allBlogSearch.setUserDefinedLabel("Google Blog 検索");
  
  searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);
  searchControl.addSearcher(myWebSearch, options);
  searchControl.addSearcher(allWebSearch, options);
  searchControl.addSearcher(allBlogSearch, options);

  // Tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("searchcontrol"));

  // Execute an inital search
  searchControl.execute(sText);
}
