<table name="tblTemplates" cellspacing="0" border="0" cellpadding="6" width="740" class="WhiteBackgroundColor" summary="This page displays a list of all templates. If the use is an Admin, then all templates in the application are displayed. If the user has Create permission, then only the templates that this user owns are displayed.">
If rsTemplates("allow_use_yn") = SUR_BOOLEAN_POSITIVE Then
%>
<%=SUR_BOOLEAN_POSITIVE_DISPLAY%>
<%
Else
%>
<%=SUR_BOOLEAN_NEGATIVE_DISPLAY%>
<%
End If
%>
</td>
<td align="center" class="Normal">
<a target="_blank" href="PreviewTemplate.asp?TemplateID=<%=lngTemplateID%>"><img alt="Preview the look and feel of this template" src="Resources/Icons/Preview.gif" border="0" onMouseOver="this.style.cursor='hand'"></a>
</td>
<td align="center" class="Normal">
<a href="Template.asp?State=Edit&TemplateID=<%=lngTemplateID%>"><img alt="Edit this template" src="Resources/Icons/Edit.gif" border="0" onMouseOver="this.style.cursor='hand'"></a>
</td>
<td align="center" class="Normal">
<%
'Only allow delete if the user is the survey owner or if the user is an admin, and there are no surveys
'using the template, and the template ID is not equal to 1 (the permanent default)
If (lngCurrentUserID = rsTemplates("user_id") Or lngUserSecurityLevel = SUR_SECURITY_LEVEL_ADMIN) And GetTemplateUsageCount(lngTemplateID) = 0 And lngTemplateID <> SUR_DEFAULT_TEMPLATE_ID Then
%>
<a href="javascript:deleteTemplate('<%=lngTemplateID%>');"><img alt="Delete this template" src="Resources/Icons/Delete.gif" border="0" onMouseOver="this.style.cursor='hand'"></a>