Bill.Reg = Ext.extend(Ext.Panel, {
    initComponent: function() {
        Ext.apply(this, {
            items: [{
		border: false,
		layout: 'column',
		bodyStyle: 'padding: 10px 10px 10px 15px;',
		items: [{
		    id: 'bill-reg-client-types',
		    border: false,
		    xtype: 'bill-reg-client-types'
		},{
		    xtype: 'panel',
		    border: false,
		    bodyStyle: 'padding: 0px 0px 0px 100px',
		    html: '<img src="images/my-cab.jpg"></img>'
		}]
	    },{
		xtype: 'bill-reg-phis'
	    },{
                defaults: {anchor: '100%'},
                xtype: 'bill-reg-org',
                hidden: true
            },{
                defaults: {anchor: '100%'},
                xtype: 'bill-reg-ip',
                hidden: true
            },{ 
                border: false,
                xtype: 'bill-reg-common-info'
            }]
        });
        Bill.Reg.superclass.initComponent.apply(this, arguments);
        this.clientTypes = Ext.getCmp('bill-reg-client-types'); //this.items.itemAt(0);
        this.phis = this.items.itemAt(1);
        this.org = this.items.itemAt(2);
        this.ip = this.items.itemAt(3);

        this.relayEvents(this.phis, 'cancel');
        this.relayEvents(this.org, 'cancel');
        this.relayEvents(this.ip, 'cancel');
        
        this.clientTypes.on('phis', this.showPhis, this);
        this.clientTypes.on('org', this.showOrg, this);
        this.clientTypes.on('ip', this.showIp, this);
    },
        
    showPhis: function(checked) {
        if (checked) {
            this.org.hide();
            this.ip.hide();
            this.phis.show();
            this.ownerCt.center();
        }
    },

    showOrg: function(checked) {
        if (checked) {
            this.phis.hide();
            this.ip.hide();
            this.org.show();
            this.ownerCt.center();
        }
    },
    
    showIp: function(checked) {
        if (checked) {
            this.phis.hide();
            this.org.hide();
            this.ip.show();
            this.ownerCt.center();
        }
    }
});
Ext.reg('bill-reg', Bill.Reg);


