var $$ = function(arg){ return document.getElementById(arg); }

var iLastAddedField = 0;

function addFileField(sId, sText){
	if(sText == undefined)
		sText = "Foto";
	
	iLastAddedField = iLastAddedField + 1;
	
	oDiv = document.createElement("div");
	/*oSpan = document.createElement("span");
	oInput = document.createElement("input");
	
	oDiv.appendChild(oSpan);
	oDiv.appendChild(oInput);
	
	oSpan.innerHTML = sText + " " + iLastAddedField;
	
	oInput.type = "file";
	oInput.name = "photo[]";
	oInput.id = "photoFileInput" + iLastAddedField;
	oInput.style.marginLeft = "10px";*/
	
	oDiv.innerHTML = "<span>" + sText + " " + iLastAddedField + "</span><input type='file' name='photo[]' id='photoFileInput" + iLastAddedField + "' style='margin-left: 10px;'/>";
	
	$$(sId).appendChild(oDiv);
}