﻿var Subsidiary = (function() {
    function fnSubsidiaryConstructor(iNewId, sNewAddress1, sNewAddress2, sNewCity, sNewState, sNewPostalCode, sNewCountry, sNewPhone, sNewFax) {
        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*           Class Level Private Variables          */
        /*                                                  */
        /*                                                  */
        /****************************************************/
        
        var oInstance;

        var iId;
        var sAddress1;
        var sAddress2;
        var sCity;
        var sState;
        var sPostalCode;
        var sCountry;
        var sPhone;
        var sFax;

        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*                Accessors/Mutators                */
        /*                                                  */
        /*                                                  */
        /****************************************************/
        
        this.getId = function() {
            return iId;
        }
        
        this.setId = function(iNewId) {
            iId = iNewId;
        }
        
        this.getAddress1 = function() {
            return sAddress1;
        }
        
        this.setAddress1 = function(sNewAddress1) {
            sAddress1 = sNewAddress1;
        }
        
        this.getAddress2 = function() {
            return sAddress2;
        }
        
        this.setAddress2 = function(sNewAddress2) {
            sAddress2 = sNewAddress2;
        }
        
        this.getCity = function() {
            return sCity;
        }
        
        this.setCity = function(sNewCity) {
            sCity = sNewCity;
        }
        
        this.getState = function() {
            return sState;
        }
        
        this.setState = function(sNewState) {
            sState = sNewState;
        }
        
        this.getPostalCode = function() {
            return sPostalCode;
        }
        
        this.setPostalCode = function(sNewPostalCode) {
            sPostalCode = sNewPostalCode;
        }
        
        this.getCountry = function() {
            return sCountry;
        }
        
        this.setCountry = function(sNewCountry) {
            sCountry = sNewCountry;
        }
        
        this.getPhone = function() {
            return sPhone;
        }
        
        this.setPhone = function(sNewPhone) {
            sPhone = sNewPhone;
        }
        
        this.getFax = function() {
            return sFax;
        }
        
        this.setFax = function(sNewFax) {
            sFax = sNewFax;
        }
        
        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*                Cloneable Interface               */
        /*                                                  */
        /*                                                  */
        /****************************************************/
        
        this.clone = function() {
            return new Subsidiary(this.getId(), this.getAddress1(), this.getAddress2(), this.getCity(), this.getState(), this.getPostalCode(), this.getCountry(), this.getPhone(), this.getFax());
        }
        
        /****************************************************/
        /*                                                  */
        /*                                                  */
        /*                 Initialize Class                 */
        /*                                                  */
        /*                                                  */
        /****************************************************/
       
        oInstance = this;
       
        this.setId(iNewId);
        this.setAddress1(sNewAddress1);
        this.setAddress2(sNewAddress2);
        this.setCity(sNewCity);
        this.setPostalCode(sNewPostalCode);
        this.setCountry(sNewCountry);
        this.setPhone(sNewPhone);
        this.setFax(sNewFax);
    }
    
    return fnSubsidiaryConstructor;
})();