function duplicate_field(parent) { // Create input boxes
	if (parent.value != '') {
		number = parseInt(parent.id.replace(/[^\d]+(\d+)/,'$1'));
		// Disable the trigger ...
		parent.onblur = null;
		// Check what I’m making.
		if (parent.id.match(/^alias\d+$/)) { // Start with the easiest: alias.
			newAlias = parent.parentNode.cloneNode(1);
			newAlias.lastChild.previousSibling.name = newAlias.lastChild.previousSibling.id = parent.id.replace(/\d+/,(number + 1));
			newAlias.lastChild.previousSibling.value = "";
			newAlias.lastChild.previousSibling.onblur = 'duplicate_field(this);';
			parent.parentNode.parentNode.appendChild(newAlias);
		} else if (parent.id.match(/^uri[^\d]+\d+$/)) { // Then URI-nate.
			newUri = parent.parentNode.cloneNode(1);
			newDesc = document.getElementById(parent.id.replace(/(\d+)/,'desc$1')).parentNode.cloneNode(1);
			newUri.lastChild.previousSibling.name = newUri.lastChild.previousSibling.id = parent.id.replace(/\d+$/,number + 1);
			newDesc.lastChild.previousSibling.name = newDesc.lastChild.previousSibling.id = parent.id.replace(/\d+$/,"desc" + (number + 1));
			newUri.lastChild.previousSibling.value = newDesc.lastChild.previousSibling.value = "";
			newUri.lastChild.previousSibling.onblur = 'duplicate_field(this);';
			parent.parentNode.parentNode.appendChild(newUri);
			parent.parentNode.parentNode.appendChild(newDesc);
		} else if (parent.id.match(/^postaldesc\d+$/)) { // Then go postal.
			newDesc = parent.parentNode.cloneNode(1);
			newAddress = document.getElementById('address' + number).cloneNode(1);
			newCity = document.getElementById('city' + number).cloneNode(1);
			newRegion = document.getElementById('region' + number).cloneNode(1);
			newZip = document.getElementById('zip' + number).cloneNode(1);
			newCountry = document.getElementById('country' + number).cloneNode(1);
			newDesc.lastChild.previousSibling.name = newDesc.lastChild.previousSibling.id = "postaldesc" + (number + 1);
			newDesc.lastChild.previousSibling.value = '';
			newDesc.lastChild.previousSibling.onblur = 'duplicate_field(this);'
			newAddress.lastChild.previousSibling.name = newAddress.lastChild.previousSibling.id = "address" + (number + 1);
			newAddress.value = '';
			newCity.lastChild.previousSibling.name = newCity.lastChild.previousSibling.id = "city" + (number + 1);
			newCity.value = '';
			newRegion.lastChild.previousSibling.name = newRegion.lastChild.previousSibling.id = "region" + (number + 1);
			newRegion.value = '';
			newZip.lastChild.previousSibling.name = newZip.lastChild.previousSibling.id = "zip" + (number + 1);
			newZip.value = '';
			newCountry.lastChild.previousSibling.name = newCountry.lastChild.previousSibling.id = "country" + (number + 1);
			newCountry.value = '';
			parent.parentNode.parentNode.appendChild(newDesc);
			parent.parentNode.parentNode.appendChild(newAddress);
			parent.parentNode.parentNode.appendChild(newCity);
			parent.parentNode.parentNode.appendChild(newRegion);
			parent.parentNode.parentNode.appendChild(newZip);
			parent.parentNode.parentNode.appendChild(newCountry);
		}
		return false;
	} else {
		return true;
	}
}

