 /* Now we'll add the ability to type anywhere on the page 
 and get the search field updated. */

    var query = null;
document.onkeydown = function(event) { kd(event); };
function kd(e) {
    // make it work on FF and IE
    if (!e) e = event;
    // use ESC to clear the search results
    if (e.keyCode == 27)
        searchControl.clearAllResults();
    // get the input field
    if (query == null)
        query = document.getElementById('query');
    // and move the focus in there
    query.focus();
}
    
    function OnLoad() {
      // Create a search control
   //   var searchControl = new GSearchControl();
   searchControl = new GSearchControl();

// I don't need all these
      // Add in a full set of searchers
       /*   
       searchControl.addSearcher(new GvideoSearch());
       searchControl.addSearcher(new GblogSearch());
       searchControl.addSearcher(new GnewsSearch());
       searchControl.addSearcher(new GbookSearch());
       searchControl.addSearcher(new GwebSearch());*/
     
    // add a site-limited web search, with a custom label
    var siteSearch = new GwebSearch();
    siteSearch.setUserDefinedLabel("My Gali");
    siteSearch.setSiteRestriction("galiwood.com");
    searchControl.addSearcher(siteSearch);  
    
    // add a site-limited web search, with a custom label
    var siteSearch2 = new GwebSearch();
    siteSearch2.setUserDefinedLabel("My ASP");
    siteSearch2.setSiteRestriction("www.development.ccs.neu.edu/home/gali");
    searchControl.addSearcher(siteSearch2); 
    
    
    // add a blog search, with a custom label
    var blogsSearch = new GblogSearch();
    blogsSearch.setUserDefinedLabel("My Blog");
    blogsSearch.setSiteRestriction("galiwood.blogspot.com");
    searchControl.addSearcher(blogsSearch);
    
    
    // add a regular web search, with a custom label 'web'
    var webSearch = new GwebSearch();
    webSearch.setUserDefinedLabel("WWW");
    searchControl.addSearcher(webSearch);

  
    // add a site-limited web search, for videos
    var videoSearch = new GvideoSearch();//new image search
    videoSearch.setUserDefinedLabel("Videos");
    
   // videoSearch.setSiteRestriction("galiwood.com");
    searchControl.addSearcher(videoSearch); 
      
    // setting the draw mode for the Google search
    var drawOptions = new GdrawOptions();    
    drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);// tell the searcher to draw itself in tabbed mode
         
    searchControl.draw(document.getElementById("searchcontrol"), drawOptions);
     // set the input field (instead of the default one)
    drawOptions.setInput(document.getElementById('query'));
    // actually write the needed markup to the page
    searchControl.draw(document.getElementById("searchcontrol"), drawOptions);
 
    GSearch.getBranding(document.getElementById("branding"));// attach "powered by Google" branding
      
      // execute an inital search-this sets default search to gali
     // searchControl.execute("gali");
      
    }  
    
    GSearch.setOnLoadCallback(OnLoad);












