jQuery(document).ready(function($){

  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("property-search-map"));
    map.setCenter(new GLatLng(46.24824991289165, -119.24285888671875), 10);
    map.addControl(new GSmallMapControl());
    /* first set of options is for the visual overlay.*/
    var boxStyleOpts = {
      opacity: .5,
      border: "2px solid red"
    }

    /* second set of options is for everything else */
    var otherOpts = {
      buttonHTML: "<img src='../images/zoom-button.png' />",
      buttonZoomingHTML: "<img src='../images/zoom-button-active.png' />",
      buttonStartingStyle: {width: '40px', height: '40px'},
      stickyZoomEnabled: false
    };
    
    otherOpts.overlayRemoveTime = 1000001;

    /* third set of options specifies callbacks */
    var callbacks = {
      //buttonclick: function(){GLog.write("Looks like you activated DragZoom!")},
      dragstart: function(){map.clearOverlays()},
      /*dragging: function(x1,y1,x2,y2){GLog.write("Dragging, currently x="+x2+",y="+y2)},*/
      dragend: function(nw,ne,se,sw,nwpx,nepx,sepx,swpx){$("input.lat_long_area").val(nw+","+se)}
    };

    map.addControl(new DragZoomControl(boxStyleOpts, otherOpts, callbacks));
  }

  
  
  

});
