    var geocoder;
  
    $(function() {
        geocoder = new google.maps.Geocoder();
    });

  function codeAddress(address, onResponse) {
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var location = results[0].geometry.location;
        alert("Location: " + location);
        onResponse.apply(this, [location]);
        /*
        var marker = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location
        });
        */
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    });
  }

$(function() {
    $('[filter-trigger]').click(function() {
        var f = $(this).toggleClass('expanded').attr('filter-trigger');
        $('[filter-type=' + f + ']').toggle();
    });
    
    $('#searchAddress').click(function() {
        $('#refineSearchForm').submit();
    });
});

function paginate(pageNumber) {
    $('#refineSearchForm input[name=page]').val(pageNumber);
    $('#refineSearchForm').submit();
}

