/* Search Functions */

function doSearch() {				/* Data Store for Google Search */
    var queryString = dojo.byId("searchText").value;
    
    var store = new dojox.data.GoogleWebSearchStore();
    var list = dojo.byId("searchOutput");
    
    //Clean up any previous searches
    while(list.firstChild){
      list.removeChild(list.firstChild);
    }
    
    store.fetch({
      query:{text: queryString},
    count: 30,
      onComplete: function(items, request) {
        //Print out the search results as an unordered 
    //list
        var delay = 0;
        dojo.forEach(items, function(item){
          var li = document.createElement("li");
          li.innerHTML = 
            "<a href=\"" +
            store.getValue(item, "url")  + 
            "\">" +
            store.getValue(item, "title") +
            "</a>";
          dojo.style(li, "opacity", "0");
          list.appendChild(li);
          
          //Fade in the results.
          delay += 200;
          dojo.fadeIn({node:li}).play(delay);          
        });
      }
    });
  }
  
function initialize() {					/* Initialize Google Map Search */
        var map;
        if (GBrowserIsCompatible()) {
          var mapOptions = {
            googleBarOptions : {
              style : "new",
            }
          }
          map = new GMap2(document.getElementById("map_canvas"), mapOptions);
          map.setCenter(new GLatLng(38.254,-85.759), 13);			/* default = map.setCenter(new GLatLng(33.956461,-118.396225), 13); */
          map.setUIToDefault();
          map.enableGoogleBar();
        }
      }