﻿var AttributePopUp = function() {
    this.eventName = arguments[0];
    var mEventName = this.eventName;
    var eventAction = new Array(0);

    this.subscribe = function(fn) {
        if (eventAction.length == 0)
            eventAction[0] = fn;
        else
            eventAction[eventAction.length] = fn;
    }

    this.fire = function(sender, eventArgs) {
        this.eventName = 'eventName2';
        if (eventAction.length > 0) {
            for (i = 0; i < eventAction.length; i++) {
                eventAction[i](sender, eventArgs);
            }
        }
    }
}

var onAttributePopUp = new AttributePopUp("AttributePopUpEventHandler");

var AttributeSelected = function() {
    this.eventName = arguments[0];
    var mEventName = this.eventName;
    var eventAction = new Array(0);

    this.subscribe = function(fn) {
        if (eventAction.length == 0)
            eventAction[0] = fn;
        else
            eventAction[eventAction.length] = fn;
    }

    this.fire = function(sender, eventArgs) {
        this.eventName = 'eventName2';
        if (eventAction.length > 0) {
            for (i = 0; i < eventAction.length; i++) {
                eventAction[i](sender, eventArgs);
            }
        }
    }
}

var onAttributeSelected = new AttributePopUp("AttributeSelectedEventHandler");