google.load("search", "1");
var searchControl;
function OnLoad() {
  // Create a search control
	searchControl = new google.search.SearchControl();
	var webSearch = new google.search.WebSearch();
	var drawoptions = new google.search.DrawOptions();
	var searchoptions = new google.search.SearcherOptions();

	drawoptions.setSearchFormRoot(document.getElementById("finder"));
	searchoptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	//searchoptions.setRoot(document.getElementById("content"));
	searchoptions.setNoResultsString(":-( Ничего не найдено");

	webSearch.setSiteRestriction('www.fontan.su');

	searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
	searchControl.setResultSetSize(google.search.Search.SMALL_RESULTSET);
	searchControl.addSearcher(webSearch, searchoptions);
	// Tell the searcher to draw itself and tell it where to attach
	searchControl.draw(document.getElementById("findresults"), drawoptions);
    /*
      var container = document.getElementById("searchFormContainer");
this.searchForm = new google.search.SearchForm(false, container);
this.searchForm.setOnSubmitCallback(this, App.prototype.newSearch);

// called on form submit
App.prototype.newSearch = function(form) {
  if (form.input.value) {
    this.searchControl.execute(form.input.value);
  }
  return false;
}
      */


	// Execute an inital search
	//searchControl.execute("фонтан");
}
google.setOnLoadCallback(OnLoad);
