function GoogleSearch() {
    // create a search control
    this.searchControl = new google.search.SearchControl();
}

GoogleSearch.prototype.searchPatents = function(resultsControl, searchValues) {
    // patents
    this.searchControl.addSearcher(new google.search.PatentSearch());

    this.searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);

    // create a drawOptions object
    this.drawOptions = new google.search.DrawOptions();

    // tell the searcher to draw itself in linear mode
    this.drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);

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

    // execute an inital search
    this.searchControl.execute(searchValues);
}

GoogleSearch.prototype.searchBooks = function(resultsControl, searchValues) {
    // books
    this.searchControl.addSearcher(new google.search.BookSearch());

    this.searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);

    // create a drawOptions object
    this.drawOptions = new google.search.DrawOptions();

    // tell the searcher to draw itself in linear mode
    this.drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);

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

    // execute an inital search
    this.searchControl.execute(searchValues);
}

