
bhajs.defineClass("BHA.Web.UI.Ags", "MapViewTool", 
    function (id, mapViewId, createWindowBehavior) {
        this.$id = id;
        this.$classInfo = bhajs.getClassInfo("BHA.Web.UI.Ags.MapViewTool");
        this.$classInfo.registerObject(this.$id, this);
        this.$mapViewId = mapViewId;
        //alert(createWindowBehavior);
        this.$createWindowBehavior = new Function(createWindowBehavior);
        //alert(this.$createWindowBehavior);
        this.$windowBehavior = null;
        
        this.$initialize = function () {
            //alert("initialize");
            this.$windowBehavior = this.$createWindowBehavior();
            //alert(this.$windowBehavior);
            delete this.$createWindowBehavior;
            delete this.$initialize;
        }
        
        this.$getToolbarButton = function() {
            return bhajs.getObject("BHA.Web.UI.ClientControls.ToolbarButton", this.$id);
        }
        this.$getMapView = function() {
            return bhajs.getObject("BHA.Web.UI.Ags.MapView", this.$mapViewId);
        }
        
        this.setChecked = function(value) {
            this.$getToolbarButton().setChecked(value);
        };
        
        
        //this.$onClick = new Function ('e', this.$clickScript);
        this.$onClick = function(e) {
            //alert("HA HA");
            this.$getMapView().setMapViewTool(this);
        }
      
        this.$initialize();
    }
);


