Open Source Ecology:GoogleSearch/test

  google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function {   var customSearchOptions = {};    var imageSearchOptions = {};    imageSearchOptions['layout'] = google.search.ImageSearch.LAYOUT_POPUP;    customSearchOptions['enableImageSearch'] = true;    customSearchOptions['imageSearchOptions'] = imageSearchOptions;

var customSearchControl = new google.search.CustomSearchControl(     '010823241464583136657:h3lzpyuunqm', customSearchOptions); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);

var options = new google.search.DrawOptions; options.setAutoComplete(true); options.enableSearchboxOnly("http://opensourceecology.org/wiki/Open_Source_Ecology:GoogleSearch"); customSearchControl.draw('cse', options);

function parseParamsFromUrl { var params = {}; var parts = window.location.search.substr(1).split('\x26'); for (var i = 0; i < parts.length; i++) { var keyValuePair = parts[i].split('='); var key = decodeURIComponent(keyValuePair[0]); params[key] = keyValuePair[1] ? decodeURIComponent(keyValuePair[1].replace(/\+/g, ' ')) : keyValuePair[1]; }     return params; }

var urlParams = parseParamsFromUrl; var queryParamName = "q"; if (urlParams[queryParamName]) { customSearchControl.execute(urlParams[queryParamName]); } }, true); 