google.load("search", "1");

    function initGoogleSearch() {
		var searchString = document.location.search;
		searchString = searchString.substring(1);
		var nvPair = searchString.split("=");
		var parsedSearchString = nvPair[1];
		var searchControl = new google.search.SearchControl();
		options = new google.search.SearcherOptions();
		options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
		var allSearch = new google.search.WebSearch();
		allSearch.setUserDefinedLabel("Wszystkie");
		allSearch.setSiteRestriction("ngo.net.pl");
		allSearch.setUserDefinedClassSuffix("allSearch");
		searchControl.addSearcher(allSearch, options);
		var news = new google.search.WebSearch();
		news.setUserDefinedLabel("Wydarzenia");
		news.setSiteRestriction("ngo.net.pl/index.php?/ngo/Wydarzenia");
		news.setUserDefinedClassSuffix("news");
		searchControl.addSearcher(news, options);
		var announcements = new google.search.WebSearch();
		announcements.setUserDefinedLabel("Ogłoszenia");
		announcements.setSiteRestriction("ngo.net.pl/index.php?/ngo/Ogloszenia");
		announcements.setUserDefinedClassSuffix("announcements");
		searchControl.addSearcher(announcements, options);
		var projects = new google.search.WebSearch();
		projects.setUserDefinedLabel("Konkursy i projekty");
		projects.setSiteRestriction("ngo.net.pl/index.php?/ngo/Konkursy-i-projekty");
		projects.setUserDefinedClassSuffix("projects");
		searchControl.addSearcher(projects, options);
		var catalogue = new google.search.WebSearch();
		catalogue.setUserDefinedLabel("Organizacje");
		catalogue.setSiteRestriction("ngo.net.pl/index.php?/ngo/Organizacje");
		catalogue.setUserDefinedClassSuffix("catalogue");
		searchControl.addSearcher(catalogue, options);
		var drawOptions = new google.search.DrawOptions();
		drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
		searchControl.draw(document.getElementById("searchcontrol"), drawOptions);
		searchControl.execute(parsedSearchString);
    }
    
google.setOnLoadCallback(initGoogleSearch);