function UploadFiles()
{
	this.MaxUploadsPerPage 		= 10;
	this.AllowedFilesCounter	= new Array(this.MaxUploadsPerPage);	//-- How many Files are allowed with an Upload
	this.UploadedFilesCounter 	= new Array(this.MaxUploadsPerPage);	//-- Counter how many Files are uploaded
	this.AllowedFileTypes		= new Array(this.MaxUploadsPerPage);	//-- Allowed Filetypes (picture, office, executable, etc.)
	this.UploadedFiles			= new Array(this.MaxUploadsPerPage);	//-- file_ids from the uploaded files
	this.DivIds					= new Array(this.MaxUploadsPerPage);	//-- ID from the Div, where the list is shown
	this.IFrameIds				= new Array(this.MaxUploadsPerPage);	//-- ID from the Iframe, where file upload is
	this.Style					= new Array(this.MaxUploadsPerPage);	//-- Style of the List : list, picture
		
	this.getUploadedFileString = function(frameName)
	{
		var i 	= 0;
		var str = '';
		var id	= 0;
		for(i=0;i<this.IFrameIds.length;i++)
		{
			str = this.IFrameIds[i];
			if(str!=null && str == frameName)
				id = i;
		}
		return this.UploadedFiles[id];
	}
	
	//----------------------------------------------------------------------
	//- Files anzeigen
	//----------------------------------------------------------------------
	this.ShowFiles = function(id)
	{
		var s_files = this.UploadedFiles[id];
		xajax_fileupload_show_files(s_files, this.DivIds[id], this.Style[id]);
	}	

	//----------------------------------------------------------------------
	//- File löschen
	//----------------------------------------------------------------------	
	this.DeleteFile = function (file_id)
	{
		var str = "";
		var id	= 0;
		var IFrameName = "";
		
		for(i=0;i<this.UploadedFiles.length;i++)
		{
			str = this.UploadedFiles[i];
			if(str!=null && str.indexOf(file_id)!=-1)
			{
				id = i;
				str = str.replace(',' + file_id, '');
				str = str.replace(file_id, '');
				if(str.indexOf(',') == 0)
					str = str.substr(1);
				this.UploadedFiles[i] = str;
			}
		}
		this.UploadedFilesCounter[id] = this.UploadedFilesCounter[id] - 1;		
		if(this.UploadedFilesCounter[id] < this.AllowedFilesCounter[id])
		{
			IFrameName = document.getElementById(this.IFrameIds[id]).name;
			parent.frames[IFrameName].document.getElementById('maximum_reached').style.visibility = 'hidden';
			parent.frames[IFrameName].document.getElementById('maximum_reached').style.display 	= 'none';
			parent.frames[IFrameName].document.getElementById('upload').style.visibility 	= '';
			parent.frames[IFrameName].document.getElementById('upload').style.display 		= 'block';		
		}
		xajax_fileupload_delete_file(file_id,this.UploadedFiles[id], this.DivIds[id], this.Style[id]);
	}

}