/**
 *
 *
 *
 *
 *
 */
 
 
 var multiUpload = function(target, max)	{
 	/* Target list */
 	this.target 	= target;
 	/* Max number of attachments */
 	this.max 		= max;
 	/* Current attachments */
 	this.count		= 0;
 	/* Current desc */
 	this.descCount = 0;
 	
 	/* Set correct params, move the element outside the window and create a new one "onchange" */ 	
 	this.addElement = function(element)	{
 		/* It must be a INPUT with the typ file */
		if(element.tagName == "INPUT" && element.type == "file")	{
			/* Change the name */
			element.name			= "attachment_" + this.count;
			
			/* Reference to this object (else 'this' will disapear in the following function)*/
			element.multi_upload	= this;
			
			/* */			
			element.onchange = function()	{
				/* Create a new input */
				this.newElement			= document.createElement("input");
				
				/* With the type file */
				this.newElement.type	= "file";
				
				/* Insert and move the current element outside the window */
				this.parentNode.insertBefore(this.newElement, this);
				this.style.position	= "absolute";
				this.style.left		= "-2048px"
				
				/* Configure the new element */
				this.multi_upload.addElement(this.newElement);		
				
				/* Call the custom addToList function */
				this.multi_upload.addToList(element);
			};
			
			this.count++
			
			if(!(this.count <= this.max))
				element.disabled = "disabled";
				
			this.current_element = element;
			
			
		}
 	},
	 
 	/* */
 	this.addToList = function(element) {};
 };