function ClientBalance(client_id,client_name,store){
	var some = Math.random();
	var ClientBalance = new Ext.FormPanel({
		frame: true,
		region: 'center',
        bodyStyle: 'padding:4px 4px 0',
        items: [{
			xtype: 'fieldset',
            collapsible: false,
            autoHeight: true,
            collapsed: false,
            bodyStyle: 'margin:4px;',
            items: [
			    {xtype: 'hidden', disabled: true, name: 'id', cls:'x-form-check-group-label', hideLabel: true, anchor:'100%',emptyText:'ID'},
			    {xtype: 'label', text: 'Логин:', cls:'x-form-check-group-label', hideLabel: true, anchor:'100%'},
			    {xtype: 'textfield', disabled: true, name: 'client_name', cls:'x-form-check-group-label', hideLabel: true, anchor:'100%',emptyText: client_name},
			    {xtype:'label', text: 'Сумма:', cls:'x-form-check-group-label', hideLabel: true, anchor:'100%'},
			    {xtype: 'textfield', disabled: false, name: 'balance', cls:'x-form-check-group-label', hideLabel: true, anchor:'100%',emptyText:'Введите сумму'}
			]
        }],
        buttons:[{
			text: 'Пополнить',
			handler: function(){
                ClientBalance.getForm().submit({
                    url: 'wrapper.php?mod=clients&sub=balance&act=pay&client_id='+client_id,
                    waitMsg: 'Выполнение запроса...',
                    success: function(p, o){
						if (o.result.success) {
							window.close();
							store.reload();
						} else {
							Ext.Msg.alert("Ошибка!",o.result.errors);
						}
                    },
					failure: function(form, o) {
						Ext.Msg.alert("Ошибка!",o.result.errors);
					}
                });
		      }
        	},{
        	text:'Закрыть',
        	handler: function(){
        		window.close();
        	}
        }
      ]
    });
    	
	var window = new Ext.Window({
		title: 'Пополнение баланса клиента',
		width: 400,
		height: 220,
		minWidth: 300,
		minHeight: 100,
		layout: 'fit',
		plain: true,
		bodyStyle: 'padding:4px;',
		buttonAlign: 'center',
		items: ClientBalance
	});
	
	var conn = new Ext.data.Connection();
	conn.request({
		url: "wrapper.php?mod=clients&act=get",
		method: 'POST',
		params: {
			"client_id": client_id,
			"client_name" : client_name
		},
		success: function(req){
			var data = Ext.decode(req.responseText);
			window.show();
			
		},
		failure: function(){
			Ext.Msg.alert('Status', 'Ошибка');
		}
	});		
	
}