You can also do this by using the basic html/text module. (I have implemented it using 2 of them, one for the search box and one for the results)
It works like this:
Add an html/text module to the page. In the module settings under advanced settings add the following code to the header box. replace yoursite.com with whatever site you want to search.
<!-- Replace with http://www.google.com/jsapi -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script language="Javascript" type="text/javascript">//<![CDATA[
google.load('search', '1');
function OnLoad() {
// create a search control
var searchControl = new google.search.SearchControl();
// web search, open, alternate root
var options = new google.search.SearcherOptions();
options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
options.setRoot(document.getElementById("cse"));
var siteSearch = new google.search.WebSearch();
siteSearch.setSiteRestriction("yoursite.com");
searchControl.addSearcher(siteSearch, options);
// tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("search_control"));
}
google.setOnLoadCallback(OnLoad);
//]]>
</script>
Now add the following to the content source area of the module:
<!-- Google Custom Search Element -->
<div id="search_control" style="width: 100%;"> </div>
Now add another instance of the html/text module to the page and add the following to the content source area of the module:
<!-- Google Custom Search Element -->
<div style="width: 100%;" id="cse">Loading</div>
You could also add the code to the skin file to get it on every page. This was an example of how to place it on an existing page.