function OnLoad() {
	// Create a search control
	var searchControl = new GSearchControl();
	searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF);
	
	var siteSearch;
	var options;
	var more = "http://www.osinka.ru/search/more.html?cof=FORID:9&cref=http://www.osinka.ru/search/cse.xml&q=__QUERY__&hl=__HL__";

	siteSearch = new GwebSearch();
	siteSearch.setUserDefinedLabel("Поиск по сайту");
	siteSearch.setSiteRestriction( { crefUrl : "http://www.osinka.ru/search/cse.xml" }, "all", more);
	options = new GsearcherOptions();
	options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
	searchControl.addSearcher(siteSearch, options);

	// draw in tabbed layout mode
	var drawOptions = new GdrawOptions();
	drawOptions.setSearchFormRoot(document.getElementById("searchcontrol"));
	drawOptions.setDrawMode(GSearchControl.DRAW_MODE_LINEAR);
	searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);
	searchControl.draw(document.getElementById("results"), drawOptions);
}
GSearch.setOnLoadCallback(OnLoad);

