﻿//**************************
//  CONSTRUCTOR
//**************************
function UI() {

    //**************************
    //  PROPERTIES
    //**************************
    var _oScope = this;
    
    //ELEMENTS
    var _oTarget = new Object();
    var _oButtonListener = new Object();
    
    //EVENT CALL BACKS
    var onPressEvent = new Function();

    //**************************
    // GETTER / SETTERS 
    //**************************
    
    this.addTargetButton = function(oTarget) {
        _oTarget = oTarget
        initiateListenerEvents();
    };
    
    this.targetButton = function() {return _oTarget};
    

    //**************************
    //  PRIVATE
    //**************************
    
    //***************************
    //  EVENTS LISTENERS
    //***************************
    function initiateListenerEvents() {
        _oButtonListener.bDown = _oScope.targetButton().AddEventListener("MouseLeftButtonDown", onMouseDown);
    }
    
    
    
    //****************************
    //  EVENTS
    //****************************
    
    function onMouseDown() {
        _oScope.onPressEvent();
    }
    
    

    //**************************
    //  PUBLIC
    //**************************
    
    
}