function addFile(id_border){
	divFiles = document.getElementById("divFiles_"+id_border);
	countFiles++;
	divFile = document.createElement('DIV');
	inputFile = document.createElement("INPUT");
	inputFile.type = 'file';
	inputFile.size = 50;
	inputFile.maxLength = 1;
	inputFile.name='file_'+countFiles;
	divFile.appendChild(inputFile);
	linkFile = document.createElement("A");
	linkFile.id = "linkFile_"+id_border+countFiles;
	linkFile.href='javascript:void(0)';
	linkFile.onclick=function () {removeFile(this.id.replace("link","div"));};
	linkFile.innerHTML="Remover";
	divFile.appendChild(linkFile);
	divFile.id = "divFile_"+id_border+countFiles;	
	divFiles.appendChild(divFile);
}
//	Remove Input File Dynamically.
function removeFile(id){
	el = document.getElementById(id);
	el.parentNode.removeChild(el);
}

function Element(element){
	return document.getElementById(element);
}

function trim(inputString) {
   if (typeof inputString != "string") 
   	return inputString;
      
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { 
	  retValue = retValue.substring(1, retValue.length);
	  ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { 
	  retValue = retValue.substring(0, retValue.length-1);
	  ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { 
	  retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
   }
   return retValue; 
}
