google.load("search", "1");

function OnLoad() {
	// Create a search control
	var searchControl = new GSearchControl();

	// Set the link target of links embedded in search results 
	searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF); 
	
	searchControl.setResultSetSize(GSearch.SMALL_RESULTSET); 

	
	// site restricted web search with custom label
	// and class suffix
	var siteSearch = new GwebSearch();

	siteSearch.setUserDefinedLabel("公開日記");
	siteSearch.setUserDefinedClassSuffix("siteSearch");
	siteSearch.setSiteRestriction("http://sns.fujideco.com/diary/"); 
	
    options = new GsearcherOptions();
	options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
	
	searchControl.addSearcher(siteSearch, options);

	// Tell the searcher to draw itself and tell it where to attach
	searchControl.draw(document.getElementById("searchcontrol"));
}

google.setOnLoadCallback(OnLoad);