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

    function OnLoadGooleSearcWeb() {
    
    $('search_results').setStyle('display','block');
    
      // Create a search control
      var searchControl = new google.search.SearchControl();

	options = new google.search.SearcherOptions();
        //EXPAND_MODE_PARTIAL / EXPAND_MODE_OPEN /EXPAND_MODE_CLOSED
	options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); 

	// set result to root element instead of default 'searchControl'
	// element provided at the time of draw()
	options.setRoot(document.getElementById("search_results")); 

      	// Two searcher - web search and Imagesearch
      	var siteSearch = new google.search.WebSearch();
      	var siteImgsearch   = new google.search.ImageSearch();

	//siteSearch.setUserDefinedLabel("Label");
	siteSearch.setSiteRestriction("www.complex.com.pl");
	searchControl.addSearcher(siteSearch, options);

        siteImgsearch.setSiteRestriction("www.complex.com.pl");
	//searchControl.addSearcher(siteImgsearch, options);

        //SMALL_RESULTSET, LARGE_RESULTSET
	searchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
        siteImgsearch.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);

      // Tell the searcher to draw itself and tell it where to attach
      searchControl.draw(document.getElementById("searchcontrol"));

      // Execute an inital search
     searchControl.execute('internet'); // can be blank
     
     
     
      
    }
    
	if($('mysearchcontrol')){
    google.setOnLoadCallback(OnLoadGooleSearcWeb);
	}