ESRI.ADF.UI.MapIdentifyTool = function(element) {
ESRI.ADF.UI.MapIdentifyTool.initializeBase(this);
this.selectedIndex = 0;
this.selectedValue = "";
this._lastExpanded = false;
this._addToResultsLink = "";
this._layerInfo = "";
this._dropDownList = "";
this._identifyIcon = null;
this._waitIcon = null;
this._processing = false;
this._onIdentify = Function.createDelegate(this,function(geom) {
// don't continue if previous call is not finished
if (!this._processing) {
var map = $find("Map1");
this._processing = true;
// remove callout if it already exists
var dropdown = $get("dropdown_" + this.get_id());
if (dropdown!=null) dropdown.style.display = "none";
if (this.identifyMapTips) this.identifyMapTips.dispose();
if(this.identifyMapCallout) {
map.removeGraphic(this.identifyMapCallout);
this.identifyMapCallout.dispose();
}
// put the ajax activity indicator at cursor click and make visible
var mappnt = new ESRI.ADF.Geometries.Point(geom.get_x(), geom.get_y());
scrnpnt = this._map.toScreenPoint(mappnt);
var wicon = $find(this.get_id()+'_waiticon');
if(wicon==null) {
this.waitIcon = $create(ESRI.ADF.Graphics.GraphicFeature,
{"id":this.get_id()+'_waiticon',"geometry":geom,"symbol":new ESRI.ADF.Graphics.MarkerSymbol(this._waitIcon,8,8)
});
this.waitIcon.get_symbol().set_imageFormat("gif");
this.waitIcon.get_symbol().set_width(16);
this.waitIcon.get_symbol().set_height(16);
}
else
this.waitIcon.set_geometry(geom);
map.addGraphic(this.waitIcon);
// make callback for identify
var argument = "mode=identify&coords=" + geom.get_x() + ":" + geom.get_y();
        if (document.documentElement.dir=="rtl") argument += "&dir=rtl";
this.doCallback(argument,this);
}
});
arcgisIdentifyTool = this;
};
ESRI.ADF.UI.MapIdentifyTool.prototype = {
startIdentify : function() {
arcgisIdentifyTool = this;
this._processing = false;
this._map.getGeometry(ESRI.ADF.Graphics.ShapeType.Point,this._onIdentify,null,'black','gray','pointer',true);
},
processCallbackResult : function(action,params) {
if(action=="mappoint") {
this.identifyLocation(this._map.get_id(), params[0], params[1], params[2]); 
}
else if(action=='error') {
if(this.waitIcon) { map.removeGraphic(this.waitIcon); }
alert("Error: " + params[0]);
Sys.Debug.trace ('Error: '+params[0])
}
},
doCallback : function(argument, context) { ESRI.ADF.System._doCallback(this._callbackFunctionString, this.get_uniqueID(), this.get_id(), argument, context);
}
};
ESRI.ADF.UI.MapIdentifyTool.registerClass('ESRI.ADF.UI.MapIdentifyTool', Sys.Component);