﻿var Region = (function() {
    function fnRegionConstructor(sNewName, iNewCurrency, iNewSubsidiaryId) {
        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*           Class Level Private Variables          */
        /*                                                  */
        /*                                                  */
        /****************************************************/

        var oInstance;
        
        var sName;
        var iCurrency;
        var iSubsidiaryId;

        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*                Accessors/Mutators                */
        /*                                                  */
        /*                                                  */
        /****************************************************/
        
        this.getName = function() {
            return sName;
        }
        
        this.setName = function(sNewName) {
            sName = sNewName;
        }
        
        this.getCurrency = function() {
            return iCurrency;
        }
        
        this.setCurrency = function(iNewCurrency) {
            iCurrency = iNewCurrency;
        }
        
        this.getSubsidiaryId = function() {
            return iSubsidiaryId;
        }
        
        this.setSubsidiaryId = function(iNewSubsidiaryId) {
            iSubsidiaryId = iNewSubsidiaryId;
        }
        
        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*                Cloneable Interface               */
        /*                                                  */
        /*                                                  */
        /****************************************************/
        
        this.clone = function() {
            return new Region(this.getName(), this.getCurrency(), this.getSubsidiaryId());
        }
        
        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*                 Initialize Class                 */
        /*                                                  */
        /*                                                  */
        /****************************************************/

        oInstance = this;

        this.setName(sNewName);
        this.setCurrency(iNewCurrency);
        this.setSubsidiaryId(iNewSubsidiaryId);
    }
    
    return fnRegionConstructor;
})();