         
var winExport;
var exportRecords;

function exportWindow(TabelleID, TabelleName, records) {

	exportRecords = records;
	if (!winExport) {
	     winExport = new Ext.Window({
	        layout:'fit',
	        width:500,
	        autoHeight:true,
	        closeAction:'hide',
	        plain: true,
			modal: true,
			title:text_42,                      
		      
			items: new Ext.FormPanel({
		        frame:true,
		        bodyStyle:'padding:10px 10px 0', 
				labelWidth:150,
		        width: 350,
		        autoHeight:true,
		        defaults: {width: 230},
		        defaultType: 'textfield',
	
		         items: [new Ext.form.ComboBox({
		            id: 'ExportFormat',
		            fieldLabel: text_13,
		            hiddenName:'ID',
					store: new Ext.data.Store({
						reader: new Ext.data.JsonReader({fields: ['ID', 'Typ']}),
					  	proxy: new Ext.data.HttpProxy({url:'exportformat.php'})
					}),
		            valueField:'ID',
		            displayField:'Typ',
		            typeAhead: false,
		            triggerAction: 'all',
		            emptyText:text_14,
		            selectOnFocus:true,
		            width:190,   
					listWidth:190,
					allowBlank: false,
					editable: false,
					listeners:{
				         'select': function() {
						 	Ext.getCmp('ButtonExportieren').enable();				
						}
				    }
		         })],
		         buttons: [{
		             id:'ButtonExportieren',
		             text:text_43,
		             disabled:true,                                      
					 handler: function () {
		               	var redirect = 'export.php?TabelleID='+currentColumnDefinitions.data.tab_id+
		  										  '&Name='+TabelleName+
		  										  '&Filter='+currentFilter+
												  '&Typ='+Ext.getCmp('ExportFormat').getValue()+
	  										      '&records='+exportRecords;											    
					    winExport.hide();
		               	window.location = redirect;  
					}
		         },{
		             text: text_15,
		             handler: function() {
		                 winExport.hide();
		             }
		         }]
			 })
	     });
	}
	Ext.getCmp('ExportFormat').store.reload();
 	winExport.show();
 	winExport.center();
}

