    function OnLoad() {
      var controlRoot = document.getElementById("searchResults");
      // Create a search control
      var searchControl = new GSearchControl();
      searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF);
      searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);

      // Tell the searcher to draw itself and tell it where to attach
       
      var searchFormElement = document.getElementById("searchcontrol");
      var drawOptions = new GdrawOptions();
      drawOptions.setSearchFormRoot(searchFormElement);
      drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
      
        // This Blog
      var searcher = new GwebSearch();
      searcher.setSiteRestriction("http://www.thinkagain.cn/");
      searcher.setUserDefinedLabel("ThinkAgain站内搜索");
      searchControl.addSearcher(searcher);

      // the web
      searcher = new GwebSearch();
      searchControl.addSearcher(searcher);

      // all blogs
      searcher = new GblogSearch();
      searchControl.addSearcher(searcher);

      // news
      searcher = new GnewsSearch();
      searchControl.addSearcher(searcher);

      // images
      searcher = new GimageSearch();
      searchControl.addSearcher(searcher);
      // videos
      searcher = new GvideoSearch();
      searchControl.addSearcher(searcher);

      // Books
      searcher = new GbookSearch();
      searchControl.addSearcher(searcher);

      // draw it
      searchControl.draw(controlRoot, drawOptions);
    }

    var scratchpad_loaded = false;
    function toggleScratchPad() {
      var container = document.getElementById("scratchpad-container");
      var link = document.getElementById("scratchpad-link");
      if (container.style.display != "block") {
        if (!scratchpad_loaded) {
          container.innerHTML = [
            '<div style="text-align:right;">[<a onclick="toggleScratchPad();" href="javascript:void(0);">close</a>]</div>',
            '<iframe style="width:100%; height:435px;" frameborder="0" scrolling="no" src="http://gmodules.com/ig/ifr?url=scratchpad.xml&amp;synd=open&amp;output=html"></iframe>'
          ].join("");
          scratchpad_loaded = true;
        }  
        container.style.display = "block";
      } else {  
        container.style.display = "none";
      }
    }
