
function DeleteFiles(mappingElement, queryURL, queryField, title, deleteFunction, renderTo){
	
	/*
	var mappingElement = 'url';
	var queryURL = 'XmlGMServlet?action_type=get_info&action=get_technical_docs';
	var queryField = 'file';
	var title = "delete icon file";
	
	var deleteFunction = 
		function(file, thisScope){
			ajaxGenericCall('XmlGMServlet?action_type=file_upload&action=delete_icon_image',					
							function(conn, response, options){
								var failure = lookForXMLFailureResponse(conn.responseXML);
								if (failure != null) { //in case there was an error show it
									showErrorDialog('ERROR!!', failure);
								}else {
									var scope = response.scope;
									//update the navTree
									//scope.store.remove(scope.grid.getSelectionModel().getSelected());
									scope.store.load();
								}
							},
							thisScope,
							{
								file: file
							}
			);
		};
	*/
	
	var deleteButtonText = getLanguageForElement("deleteButtonText", selectedLangId);					
	var titleI18N = getLanguageForElement(title, selectedLangId);

	this.fileRecord = new Ext.data.Record.create([
			{name: mappingElement, mapping: mappingElement, type:'string'}
	]);
	
	this.proxy = new Ext.data.HttpProxy({url: queryURL});
    // create the Data Store
    this.store = new Ext.data.Store({
        // load using HTTP
        proxy: this.proxy,
        // the return will be XML, so lets set up a reader
        reader: new Ext.data.XmlReader({
               // records will have a "category" tag
               record: queryField
           }, this.fileRecord)
    });			

	this.store.load();


	this.grid = new Ext.grid.GridPanel({
		store: this.store,
	    columns: [
			{header: mappingElement, width: 430, sortable: true}
	    ],
	    height:150,
	    width:450,
		title: titleI18N
	});		
	
	
	//delete button
	this.edit_LanguageButtonDelete = new Ext.Button({
			text: deleteButtonText,
			xtype: 'button',
			disabled: false,
			minWidth: 100,
	        scope: this,
	        handler: function(This, e){
				var selectedFile = This.scope.grid.getSelectionModel().getSelected().get('url');
				deleteFunction(selectedFile,This.scope);
	        }	
	});
	
	this.fieldSet = null;
	
	if (Ext.isIE) {
		this.fieldSet = new Ext.form.FieldSet({
			xtype: 'fieldset',
			title: titleI18N,
			collapsible: false,
			collapsed: false,
			autoHeight: true,
			bodyStyle: 'text-align:left;',
			items: [this.grid],
			buttons: [this.edit_LanguageButtonDelete]
		});
	}else{
		this.fieldSet = new Ext.form.FieldSet({
			xtype: 'fieldset',
			title: titleI18N,
			collapsible: true,
			collapsed: true,
			autoHeight: true,
			bodyStyle: 'text-align:left;',
			items: [this.grid],
			buttons: [this.edit_LanguageButtonDelete]
		});		
	}
	
	
	
	this.fieldSet.addListener('expand',function(panel){
		this.grid.render();
		this.grid.show();
	},this);
	
	this.deletePanel = new Ext.Panel({
	        width: 505,	
			autoHeight : true,
			bodyBorder: false,
			border: false,		
			items: [this.fieldSet]
	});
		
	this.deletePanel.render(renderTo);
}


