bqc.CircuitMarker = Class.create(bqc.Marker, {

    clickHandler: function() {
        var that = this;
        bqc.circuits.stopListeningMap();
        this.searchManager.stopListeningMap();
        var listener = GEvent.addListener(this.marker, 'infowindowclose', function() {
            bqc.circuits.listenMap();
            if (!that.isProximitySearching) {
                bqc.circuits.remark();
            }
            that.isProximitySearching = false;
            GEvent.removeListener(listener);
        });
        bqc.tooltipManager.setCircuit(this);
        bqc.tooltipManager.open(this, 'getCircuitPanel.do', {
            circuitId: this.json.id
        });

        // *** Nombre total de mini-fiches affichées ventilé par  fiche :
        bqc.gaLogger.log(bqc.params.p_mode_org, bqc.GAnalyticsStrings.level2.miniFichesShowCount, this.json.name);
    },

    close: function() {
        if (this.marker != null) {
            this.marker.closeInfoWindow();
        }
    },

    proximitySearching: function() {
        this.isProximitySearching = true;
    },

    manageTooltip: function() {},

    getIcon: function() {
        var icon = new GIcon();
        icon.image = this.json.img;
        icon.transparent='images/marker_circuit_trans.png';
        icon.imageMap=[4,4, 34,4, 34,44, 4,44];

        icon.shadow = '';
        icon.iconSize = new GSize(38, 48);
        icon.shadowSize = new GSize(0, 0);
        icon.iconAnchor = bqc.circuitMarkerAnchor;
        icon.infoWindowAnchor = new GPoint(19, 5);
        icon.dragCrossSize = GSize(1, 1);
        icon.maxHeight = 1;
        return icon;
    }
});

bqc.circuitMarkerAnchor = new GPoint(19, 48);
