    function OnLoad() {
      // Create a search control
      var searchControl = new GSearchControl();
      var localSearch = new GlocalSearch();
      
      // set target
      searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF);
      
      // set onSearch callback
      searchControl.setSearchStartingCallback(document, prepareForGoogleSearch)
      function prepareForGoogleSearch(sc, searcher) {
        // hide page content
        document.getElementById("contentMain").innerHTML = '';
        document.getElementById("preSearchResults").innerHTML = '<h1>Search Results</h1>The following is the results of your search. To refine your search further use the <a href="/search.php">Advanced Search</a>.<br><br><hr><br>';
      }
      
      // add sites to search
      
       // search GLW
      siteSearch = new GwebSearch();
      siteSearch.setUserDefinedLabel("Green Left Weekly");
      siteSearch.setSiteRestriction("greenleft.org.au");
      
      // res books
      siteSearch2 = new GwebSearch();
      siteSearch2.setUserDefinedLabel("Resistance Books");
      siteSearch2.setSiteRestriction("resistancebooks.com");
      
      // DSP
      siteSearch3 = new GwebSearch();
      siteSearch3.setUserDefinedLabel("Democratic Socialist Perspective");
      siteSearch3.setSiteRestriction("dsp.org.au");
      
      // RES
      siteSearch4 = new GwebSearch();
      siteSearch4.setUserDefinedLabel("Resistance - socialist youth organisation");
      siteSearch4.setSiteRestriction("resistance.org.au");
      
       // SA
      siteSearch5 = new GwebSearch();
      siteSearch5.setUserDefinedLabel("Socialist Alliance");
      siteSearch5.setSiteRestriction("socialist-alliance.org");
      
     
      
      var options = new GsearcherOptions();
      options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
      searchControl.addSearcher(siteSearch, options);
      searchControl.addSearcher(siteSearch2);
      searchControl.addSearcher(siteSearch3);
      searchControl.addSearcher(siteSearch4);
      searchControl.addSearcher(siteSearch5);
      
      // create a drawOptions object
        var drawOptions = new GdrawOptions();
        drawOptions.setSearchFormRoot(document.getElementById("googleSearch"));

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

      // Execute an inital search
      //searchControl.execute("Google");
    }
    GSearch.setOnLoadCallback(OnLoad);