
    google.load("search", "1");

    function OnLoad() {
      // Create a search control
      var searchControl = new google.search.SearchControl();

      // Add in a full set of searchers
//      var localSearch = new google.search.LocalSearch();
//      searchControl.addSearcher(localSearch);
      var options = new GsearcherOptions();
      options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);

      options.setRoot(document.getElementById("search_results"));


      var webSearch = new google.search.WebSearch();
      webSearch.setSiteRestriction("http://tv.shimano.co.jp/");
      webSearch.setUserDefinedLabel("<h2>SHIMANO TV</h2>");
      searchControl.setResultSetSize(GSearch.SMALL_RESULTSET)
      searchControl.addSearcher(webSearch, options);

          
//     searchControl.addSearcher(new google.search.VideoSearch());
//      searchControl.addSearcher(new google.search.BlogSearch());

      // Set the Local Search center point
//      localSearch.setCenterPoint("New York, NY");

      // Tell the searcher to draw itself and tell it where to attach
      var drawOptions = new GdrawOptions();
      drawOptions.setInput(document.getElementById('search_window'));
      searchControl.draw(document.getElementById("search_inner"), drawOptions);
      
      $('#search_form').submit(function(){return false;});

      searchControl.setSearchCompleteCallback(this, function(sc, searcher){
//      console.log([sc,searcher]);
      
        if (!$('#clear-button').size()) {
            $('#search_results').append('<div id="search_msg"></div>')
		    $('#search_results').append('<div id="clear-button" title="検索結果を閉じる">検索結果を閉じる</div>')
		    $('#clear-button').click(function(){searchControl.clearAllResults.call(searchControl)});
	    }
	    $('.gsc-resultsHeader').css("border", "none");
	    $('.gsc-cursor-page').css("color", "#00ccff");
	    $('.gsc-cursor-current-page').css("color", "#A90A08");
	    
//	    console.log(searcher.results.length);
        if (!searcher.results.length){
	        var div = document.createElement('div');
	        var txt=document.createTextNode(sc.input.value);
	        div.appendChild(txt);
            $('#search_msg').html('「' + div.innerHTML + '」の検索結果は見つかりませんでした。')
        } else {
            $('#search_msg').html('')
        }
	    
        $('#search_results').slideDown(2000);
        $(document.body).css('cursor', 'default');

      });

      //loading and tracking
      searchControl.setSearchStartingCallback(this, function(sc, searcher){
        $(document.body).css('cursor', 'progress');
        if (typeof urchinTracker !== 'undefined') {
            urchinTracker("/Analytics/search/" + encodeURIComponent(sc.input.value));
        }
      });      
      
      // Execute an inital search
//      searchControl.execute("default");
    }
    google.setOnLoadCallback(OnLoad);
    

    