/*
 * This sample shows how to create a Custom Search Control.  By default, it
 * will allow you to add a search box to your page that searches your site.
 * Optionally, you can give it a CSE ID (http://www.google.com/coop/cse/) to
 * have it search sites you specify
*/

google.load('search', '1');

function gcseSearch( queryW, divContainerID, codigoGcse ) {
  // Create a custom search control that uses a CSE restricted to code.google.com
  var customSearchControl = new google.search.CustomSearchControl( codigoGcse );

  // Draw the control in content div
  customSearchControl.draw(divContainerID);
  
  // run a query
  customSearchControl.execute(queryW);
}