google.load('search', '1');
function cse() {
  this.Control = new google.search.SearchControl();
  this.Control.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
  this.Control.setNoResultsString(google.search.SearchControl.NO_RESULTS_DEFAULT_STRING);
  var drawOptions = new google.search.DrawOptions();
  drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
  if(document.getElementById("searchResults")) {
    var scDiv = document.getElementById("searchResults");
    drawOptions.setSearchFormRoot('searchForm');
    this.Control.setResultSetSize(google.search.Search.LARGE_RESULTSET);
  } else {
    var scDiv = document.getElementById("searchForm");
    this.Control.setResultSetSize(google.search.Search.SMALL_RESULTSET);
  }
  var searcher;
  searcher = new google.search.WebSearch();
  searcher.setSiteRestriction("006107244075861899220:alzwcnhh6wk","technical_reports_english");
  searcher.setUserDefinedLabel("Search Results");
  this.Control.addSearcher(searcher);
  this.Control.draw(scDiv, drawOptions);
}
cse.prototype.onSubmit = function(form) {
  var q = form.input.value;
  if (q && q!= "") {
    this.Control.execute(q);
  }
  return false;
}
cse.prototype.onClear = function(form) {
  this.Control.clearAllResults();
  form.input.value = "";
  return false;
}
function OnLoad() {
  new cse();
  $("div#searchForm").before("<h2>Search Articles</h2>");
}
google.setOnLoadCallback(OnLoad, true);

