How to enable a function only on clicking a particular condition
<p>Hi there i have 3 buttons called 1.ADD , 2.EDIT , 3.DELETE.....and a map with id=comp_map... and I am using Open Street Maps....</p>

<pre><code>function addComp() {

     $("#comp_map").click(function() {
          if (event.type !== 'mousemove') {
                var containerPoint = comp_map.mouseEventToContainerPoint(event),
                layerPoint = comp_map.containerPointToLayerPoint(containerPoint),
                latlng = comp_map.layerPointToLatLng(layerPoint)            
                alert("Marker Location: "+latlng);
            }
    });


}

   function editComp() {
        // disable the map click
    }

    function delComp() {
        // disable the map click
    }
</code></pre>

<p>My question is i want <code>$("#comp_map").click</code> to work only when add button is clicked... but when the other buttons like edit , delete are clicked this function should not work... is this the right way to do this or if my approach is wrong please correct me... Thank You...!</p>
