function dropFile(btn){
	if(document.getElementById) {
		tr = btn;
		while (tr.tagName != 'TR') tr = tr.parentNode;
		tr.parentNode.removeChild(tr);
		checkForLast();
	}
}
function addFile(btn){
	if(document.getElementById) {
		tr = btn;
		while (tr.tagName != 'TR') tr = tr.parentNode;
		var idSuffix = Math.round(Math.random()*1000);
		var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.nextSibling);
		thisChilds = newTr.getElementsByTagName('td');
		for (var i = 0; i < thisChilds.length; i++){
			if (thisChilds[i].className == 'header') thisChilds[i].innerHTML = '';
			if (thisChilds[i].className == 'files') thisChilds[i].innerHTML = '<input size="32" name="foto[]" class="wideFile" type="file" value = "">';
		}
		checkForLast();
	}
}
function checkForLast(){
	btns = document.getElementsByName('drop');
	for (i = 0; i < btns.length; i++){
		btns[i].disabled = (btns.length == 1) ? true : false;
	}
}

