anchor.diff:  		</tr>
   		</c:if>
   		</c:if>
  -		<tr>
  -			<td colspan="2"><br/>
  -				<table cellpadding="0" cellspacing="0" align="left">
  -       				<tr>
  -       					<td><input type="submit" value='<spring:message code="general.save" />' /></td>
  -       					<td width="15px"></td>
  -       					<td>
  -       						<c:set var="cancelUrl" value="${pageContext.request.contextPath}/admin" scope="page"></c:set>
  -       						<c:if test="${not empty param.patientId}">
  -       						<c:set var="cancelUrl" value="${pageContext.request.contextPath}/patientDashboard.form?patientId=${param.patientId}" />
  -       						</c:if>
  -       						<input type="button" value='<spring:message code="general.cancel" />' onclick='javascript:window.location="${cancelUrl}"' />
  -       					</td>
  -       				</tr>
  -    				</table>
  +</table>	
  +</div>
  +
  +<br/>
  +
  +<b class="boxHeader"><spring:message code="Visit.encounters"/></b>
  +<div class="box">
  +	<table id="encountersTable" cellpadding="3" cellspacing="3">
  +		<tr>
  +			<th><spring:message code="Encounter.datetime"/></th>
  +			<th><spring:message code="Encounter.type"/></th>
  +			<th><spring:message code="Encounter.location"/></th>
  +			<th><spring:message code="Encounter.provider"/></th>
  +			<th></th>
  +		</tr>
  +		<c:forEach items="${visitEncounters}" var="enc" varStatus="encStatus">
  +		<tr id="encounter-${enc.encounterId}" style='background-color: whitesmoke'>
  +			<td><openmrs:formatDate date="${enc.encounterDatetime}" type="small" /></td>
  +			<td><openmrs:format encounterType="${enc.encounterType}" /></td>
  +			<td><openmrs:format location="${enc.location}" /></td>
  +			<td><openmrs:format person="${enc.provider}" /></td>
  +			<td class="removeButtonColumn">
  +				<input type="button" value='<spring:message code="general.remove"/>' class="smallButton" onclick="removeEncounter(this)" />
  +				<input type="hidden" name="encounterIds" value="${enc.encounterId}" />
  +			</td>
  +		</tr>
  +		</c:forEach>
  +		<tr id="newEncounterRow" style="display:none;">
  +			<td colspan="4">
  +				<%-- make sure the text field is wide enough to show the placeholder message --%>
  +				<input type="text" id="visitEncounters[x]-display" size="62" />
  +				<input type="hidden" id="visitEncounters[x]" name="encounterIds" />
  +			</td>
  +			<td class="removeButtonColumn">
  +				<input type="button" value='<spring:message code="general.remove"/>' class="smallButton" onclick="removeEncounter(this)" />
   			</td>
   		</tr>
   	</table>
  +	<input type="button" value='<spring:message code="Visit.addEncounter"/>' class="smallButton" onclick='addEncounter()' />
  +</div>
  +
  +<br/>
  +
  +<input type="submit" value='<spring:message code="general.save" />' /></td>
  +<c:set var="cancelUrl" value="${pageContext.request.contextPath}/admin" scope="page"></c:set>
  +<c:if test="${not empty param.patientId}">
  +	<c:set var="cancelUrl" value="${pageContext.request.contextPath}/patientDashboard.form?patientId=${param.patientId}" />
  +</c:if>
  +<input type="button" style="margin-left: 15px" value='<spring:message code="general.cancel" />' onclick='javascript:window.location="${cancelUrl}"' />
  +
   </form:form>
   
  -
  -<c:if test="${visit.visitId != null}">
  -<br/>
  -<table cellpadding="3" cellspacing="3" style="float: right;">
  -	<tr>
  -		<td>
  -			<openmrs:hasPrivilege privilege="Delete Visits">
  -			<c:if test="${visit.voided == false }">
  -			<input type="submit" value='<spring:message code="general.void"/>' onclick="javascript:$j('#delete-dialog').dialog('open')"/>
  -			<div id="delete-dialog" title="<spring:message code="general.void"/> <spring:message code="Visit"/>">
  -			<form:form action="voidVisit.htm" method="post" modelAttribute="visit">
  -			<c:if test="${param.visitId != null}">
  -				<input type="hidden" name="visitId" value="${param.visitId}"/>
  -			</c:if>
  -			<c:if test="${param.patientId != null}">
  -				<input type="hidden" name="patientId" value="${param.patientId}"/>
  -			</c:if>
  +<c:if test="${ canDelete }">
  +	<div id="delete-dialog" title="<spring:message code="general.void"/> <spring:message code="Visit"/>">
  +		<form action="voidVisit.htm" method="post">
  +			<input type="hidden" name="visitId" value="${visit.visitId}"/>
  +			<input type="hidden" name="patientId" value="${visit.patient.patientId}"/>
   			<p><spring:message code="Visit.delete.info" arguments="${encounterCount}, ${observationCount}"/></p>
   			<table cellpadding="3" cellspacing="3" align="center">
   				<tr>
  
positive.code: 				<tr height="20"></tr>
  				<tr>
  					<td colspan="2" style="text-align: center">
  						<input type="submit" value="<spring:message code="general.void"/>" /> &nbsp; <input type="button" value="<spring:message code="general.cancel"/>" 
  						onclick="javascript:$j('#delete-dialog').dialog('close')" /></td>
  				</tr>
  			</table>
  			</form:form>
  			</div>
  			</c:if>
  			</openmrs:hasPrivilege>
  		</td>
  		<td>
  			<openmrs:hasPrivilege privilege="Purge Visits">
  			<input type="button" value='<spring:message code="general.purge"/>' onclick="javascript:$j('#purge-dialog').dialog('open')" 
  				<c:if test="${!canPurgeVisit}"> disabled="disabled" title="<spring:message code="Visit.cannotPurgeVisitWithEncounters"/>"</c:if> />
  			<div id="purge-dialog" title="<spring:message code="Visit.confirm.purge"/>">
  				<form:form action="purgeVisit.htm" method="post" modelAttribute="visit">
  				<c:if test="${param.visitId != null}">
  					<input type="hidden" name="visitId" value="${param.visitId}"/>
  				</c:if>
  				<c:if test="${param.patientId != null}">
  					<input type="hidden" name="patientId" value="${param.patientId}"/>
  				</c:if>
  				<br/>
  				<spring:message code="Visit.confirm.purgeMessage"/>
  				<br/>
  				<table cellpadding="3" cellspacing="30" align="center">
  					<tr>
  						<td>
  							<input type="submit" value='<spring:message code="general.yes"/>' /> &nbsp; <input type="button" value="<spring:message code="general.no"/>"
  							onclick="javascript:$j('#purge-dialog').dialog('close')" />
  						</td>
  					</tr>
  				</table>
  				</form:form>
  			</div>
  			</openmrs:hasPrivilege>
  		</td>
  	</tr>
  </table>
  </c:if>
  </div>
  <%@ include file="/WEB-INF/template/footer.jsp" %>
  
negative.code: 		<c:forEach var="attrType" items="${ attributeTypes }">
  			<openmrs_tag:attributesForType attributeType="${ attrType }" customizable="${ visit }" formFieldNamePrefix="attribute.${ attrType.id }"/>
  		</c:forEach>
  		<c:if test="${visit.visitId != null}">
  		<c:if test="${visit.creator != null}">
  		<tr>
  