
/* ------------------------------------------
 * cse.js 
 * ------------------------------------------
 *
 * Index
 *  - OnLoad()
 *  - GSearch.setOnLoadCallback()
 *
 * Update
 *  - 2008.07.03 set-up
 *
/* ------------------------------------------ */


/* ------------------------------------------
 * OnLoad()
 *  - Create a search control
 *  - Configure search control
 *  - Tell the searcher to draw itself
/* ------------------------------------------ */

function OnLoad() {
	var controlRoot = document.getElementById("results_006574255872554474476:r5npiguy3s4");
	var searchForm = new google.search.DrawOptions();
	searchForm.setSearchFormRoot(document.getElementById("searchbox_006574255872554474476:r5npiguy3s4"));

	// Create a search control
	var searchControl = new GSearchControl();
	searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);
	searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF);

	// configure search control
	var cseId = "006574255872554474476:r5npiguy3s4";
	var searcher = new google.search.WebSearch();
	searcher.setSiteRestriction(cseId);
	searcher.setUserDefinedLabel("Archiva Search");
	var options = new google.search.SearcherOptions();
	options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);

	searchControl.addSearcher(searcher, options);


	// tell the searcher to draw itself and tell it where to attach
	searchControl.draw(controlRoot,searchForm);

	// execute an inital search
//	searchControl.execute("float");
}
GSearch.setOnLoadCallback(OnLoad, true);


