      
   	var xmlGruppe = new Ext.FormPanel({
	    title:text_44,
	    id:'xmlGruppe',
	    labelAlign: 'right',
	    labelWidth: 140,
	    height:220,
	    waitMsgTarget: true,
		trackResetOnLoad: true,
		hideMode: 'offsets', 

	    reader : new Ext.data.XmlReader({
	        record : 'Gruppe',
	        success: '@success'
	    }, [
	        'GruppeID', 'Name', 'Beschreibung' , 'UploadAllgemein', 'UploadGruppe', 'UploadPrivat'
	    ]),

		defaultType: 'textfield',
        items: [{
            	name: 'GruppeID',
            	id: 'GruppeID',
				hidden:true,
                height:0,
                width:190
            }, {
                fieldLabel: text_45,   
				id: 'G_Name',
                name: 'Name',
                tabindex:1,
				allowBlank: false,
                width:190
            }, {
				xtype: 'textarea',
				height:80,
                fieldLabel: text_46,
                name: 'Beschreibung',
                tabindex:2,
                width:300   
            }, {
				xtype: 'checkbox',
				id:'group_forms_cb_allgemein',
                fieldLabel: text_115,
                tabindex:3,
                name: 'UploadAllgemein'
            }, {
				xtype: 'checkbox',
				id:'group_forms_cb_gruppe',
                fieldLabel: text_116,
                tabindex:4,
                name: 'UploadGruppe'
            }, {
				xtype: 'checkbox',
				id:'group_forms_cb_privat',
                fieldLabel: text_117,
                tabindex:5,
                name: 'UploadPrivat'
            }
        ]
	});
	
    function storeGruppe(selectNewNode) {
		xmlGruppe.getForm().submit({
		    clientValidation: true,   
			url:'group_data.php?action=save', 
			waitMsg:text_39,             
		    success: function(form, action) {
		       	var group_id = action.result.msg; 
    		  	if (Ext.getCmp('GruppeID').getValue() == -1) {
	    		  	node = Ext.getCmp('treeEinstellungen').getNodeById('adminG').appendChild(new Ext.tree.TreeNode({
	                   	id:'adminG'+group_id, text: Ext.getCmp('G_Name').getValue(), iconCls:'group', leaf:true 
					}));                   
	    		  	if (selectNewNode) {
						Ext.getCmp('treeEinstellungen').fireEvent('click', node);
	    		  		Ext.getCmp('treeEinstellungen').selectPath(node);
	    		  	}
				}
				else {                                           
					treeEinstellungen.getLoader().load(treeEinstellungen.root);					
				}

			   	// TODO Funktioniert nicht nicht 
				// treeTabellen.getLoader().load(treeTabellen.getNodeById("gridD")); 
				
				var s = "";
				var r = 0;
                for (var i = 0; i < storeGruppenBerechtigungen.getCount(); i++) {
                	var rec = storeGruppenBerechtigungen.getAt(i);
			   	   	s = s + '&t' + r + '=' + rec.get("TabelleID") + 
		               '&r' + r + '=' + rec.get("Lesen") +  
		               '&w' + r + '=' + rec.get("Schreiben")+  
		               '&e' + r + '=' + rec.get("EMail")+  
		               '&s' + r + '=' + rec.get("SMS");
		  			r++;
				}
				var s = "action=saveData&GruppeID=" + group_id + "&count=" + r + s;

				new Ext.data.Connection().request({
				    url: 'berechtigungen.php', 
				 	params: s,
					failure: function(response, opts) {
					      Ext.MessageBox.alert(text_29, Ext.decode(response.responseText).msg);
					},
				    success: function(response, opts) {                                            
				      	var obj = Ext.decode(response.responseText);
						if (!obj.success) {
				     	 	Ext.MessageBox.alert(text_29, obj.msg);
				     	}
				    	else {
				        }
					}
				});					
		    },
		    failure: function(form, action) {
		        switch (action.failureType) {
		            case Ext.form.Action.CLIENT_INVALID:
		                Ext.Msg.alert(text_29, text_30);
		                break;
		            case Ext.form.Action.CONNECT_FAILURE:
		                Ext.Msg.alert(text_29, text_30);
		                break;
		            default:
		               Ext.Msg.alert(text_29, action.result.msg);
		       }
		    }
		});
    
    }

	var submitGruppe = xmlGruppe.addButton({
	    text: text_47,
	    disabled:true,
	    handler: function(){
		    storeGruppe(true);
	    }
	});

	var loeschenGruppe = xmlGruppe.addButton({
	    text: text_48,
	    disabled:true,
	    handler: function(){  
		
	     Ext.MessageBox.show({
	           title:text_49,
	           msg: text_50,
	           buttons: Ext.MessageBox.YESNO,
	           icon: Ext.MessageBox.QUESTION,
	           fn: function(btn) {
					if (btn == 'yes') {
						new Ext.data.Connection().request({
							    url: 'group_data.php',  
								params: {GruppeID: Ext.getCmp('GruppeID').getValue(), action:"delete"},
								failure: function(response, opts) {
								      Ext.MessageBox.alert(text_29, Ext.decode(response.responseText).msg);
								},
							    success: function(response, opts) {                                            
							      	var obj = Ext.decode(response.responseText);
									if (!obj.success) {
							     	 	Ext.MessageBox.alert(text_29, obj.msg);
							     	}
							    	else {
						    		  	Ext.getCmp('treeEinstellungen').getNodeById('adminG'+Ext.getCmp('GruppeID').getValue()).remove();
						    		  	Ext.getCmp('GruppeID').setValue(-1);  
						    		  	Ext.getCmp('treeEinstellungen').selectPath((Ext.getCmp('treeEinstellungen').getNodeById('adminGNeu').getPath()));
								    	xmlGruppe.getForm().load({url:'group_data.php?action=read&GruppeID=-1', 
								                                    waitMsg:text_41});
							        }
								}
							});					
					}
			    }
			});
	    }
	});   
	
	xmlGruppe.on({
	    actioncomplete: function(form, action){
	        if(action.type == 'load'){
	            submitGruppe.enable();
	        }
	    }
	});

	var FeldGruppenBerechtigungen = Ext.data.Record.create([ 
		{ name: 'TabelleID', type: 'string'},
		{ name: 'Name', type: 'string'},
		{ name: 'Lesen', type: 'bool'},
		{ name: 'Schreiben', type: 'bool'},
		{ name: 'EMail', type: 'bool'},
		{ name: 'SMS', type: 'bool'}]);
	
	 var storeGruppenBerechtigungen = new Ext.data.Store({
	  	reader: new Ext.data.JsonReader({fields: FeldGruppenBerechtigungen}),
	  	proxy: new Ext.data.HttpProxy({url: 'berechtigungen.php?GruppeID=-1&action=showData'})
	 }); 
       
	 var colSchreiben = new Ext.grid.CheckColumn({
			header: text_51,
			dataIndex: 'Schreiben',
			width: 55
	    });
	        
	 var colLesen = new Ext.grid.CheckColumn({
			header: text_52,
			dataIndex: 'Lesen',
			width: 55
	    });

	 var colEMail = new Ext.grid.CheckColumn({
			header: text_53,
			dataIndex: 'EMail',
			width: 55
	    });

	 var colSMS = new Ext.grid.CheckColumn({
			header: text_53a,
			dataIndex: 'SMS',
			width: 55
	    });

    var gridGruppenBerechtigungen = new Ext.grid.EditorGridPanel({
        store: storeGruppenBerechtigungen,            
        cm: new Ext.grid.ColumnModel({
	        defaults: { 
				sortable: false
	        },
	        columns: [
	            {   id: 'gruppe',
	                header: text_54,
	                dataIndex: 'Name',
	                width: 220
	            }, colLesen, colSchreiben, colEMail, colSMS
	        ]
	    }),
        flex:1,
        autoExpandColumn: 'gruppe',
        title: text_55,
        plugins: [colLesen, colSchreiben, colEMail, colSMS],
        clicksToEdit: 1
    });

	var editGruppe = {
	    id: 'editGruppe',
		region: 'center',
	    layout: {
	        type: 'vbox',
	        pack: 'start',
	        align: 'stretch'
	    },
	    defaults: {
	        frame: true,
	        border:false
	    },
	    items: [xmlGruppe, gridGruppenBerechtigungen]
	};
