CaptureFlashClick = function(aFlashObjectID, aContainerID) {
    this.FlashObjectID = aFlashObjectID;
    this.FlashContainerID = aContainerID;
    
    this.init();
}

CaptureFlashClick.prototype = {
init: function() {
        // NO escuchar clicks para chrome. Se hace correctamente desde el cviewerbasePage
        var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
        if (is_chrome)
            return;
        //debugger;
        var self = this;
        this.Cache = this.FlashObjectID;
        if (window.addEventListener) {  // Caso FireFox:
            window.addEventListener("mousedown", function(ev) {
                if (ev.button == 0) {
                    //self.killEvents(ev);
                    var fooTarget = ev.target.id === "" ? ev.target.parentNode : ev.target;
                    if (fooTarget.id == self.FlashObjectID) {
                        window.top.lHeatMap.doRegisterClick(fooTarget, fooTarget.tagName, ev.layerX, ev.layerY);
                        self.call();
                    }
                }
            }, true);
        }
    },
    /**
    * GECKO / WEBKIT event overkill
    * @param {Object} eventObject
    */
    killEvents: function(eventObject) {
        if (eventObject) {
            if (eventObject.stopPropagation) eventObject.stopPropagation();
            if (eventObject.preventDefault) eventObject.preventDefault();
            if (eventObject.preventCapture) eventObject.preventCapture();
            if (eventObject.preventBubble) eventObject.preventBubble();
        }
    },
    
    /**
    * Main call to Flash External Interface
    */
    call: function() {
        //document.getElementById(this.FlashObjectID).this();	
        //alert('Leftclick');
        return true;
    }
}
