<div class="row required clear">
  <label for="Title" class="name">Title: <span>*</span></label>
  <div class="value">
    <input type="text" id="Title" name="Title" value="<%if Title%><%escape_html Title%><%endif%>" class="text" />
  </div>
</div>
<div class="row required clear">
  <label for="URL" class="name">URL: <span>*</span></label>
  <div class="value">
    <input type="text" id="URL" name="URL" value="<%if URL%><%escape_html URL%><%else%>http://<%endif%>" class="text" />
  </div>
</div>
<div class="row<%unless category_loop_selected%> required<%endunless%> clear">
  <label class="name">Category:<%unless category_loop_selected%> <span>*</span><%endunless%></label>
  <div class="value wrappedtext">
  <%~if config.db_gen_category_list == 2%>
    <script type="text/javascript" src="<%config.build_static_url%>/treecats.js"></script>
    <%~set selected_cats = Links::Tools::category_list_selected%>
    <%~loop selected_cats%>
    <input type="hidden" name="CatLinks.CategoryID" value="<%escape_html ID%>" />
    <%~endloop%>
    <noscript>
      <ul class="categories">
      <%~loop selected_cats%>
        <li><%Full_Name%></li>
      <%~endloop%>
      <%~if not selected_cats.length%>
        <li><%Links::language('ADD_SELCAT')%></li>
      <%~endif%>
      </ul>
    </noscript>
    <div id="treecats"></div>
    <script type="text/javascript">
      var tc = new treecats({ <%-- selectionMode : 'multiple', --%> cgiURL : '<%config.db_cgi_url%>', cgiQueryString : '<%url_hidden%>', imageURL : '<%config.build_static_url%>/<%t%>/images' });
      tc.load();
    </script>
  <%~elsif category_loop_selected%>
    <%~if category_loop.length > 1%>
    <ul class="categories"><%loop category_loop%><li><%Full_Name%><input type="hidden" name="CatLinks.CategoryID" value="<%escape_html ID%>" /></li><%endloop%></ul>
    <%~else%>
    <%loop category_loop%><%Full_Name%><input type="hidden" name="CatLinks.CategoryID" value="<%escape_html ID%>" /><%endloop%>
    <%~endif%>
  <%~else%>
    <select id="CatLinks.CategoryID" name="CatLinks.CategoryID">
      <%~loop category_loop%>
      <option value="<%escape_html ID%>"<%if selected%> selected="selected"<%endif%>><%'&nbsp;&nbsp;' x $CatDepth%><%Name%></option>
      <%~endloop%>
    </select>
  <%~endif%>
  </div>
</div>
<div class="row clear">
  <label for="Description" class="name">Description:</label>
  <div class="value">
    <textarea id="Description" name="Description" rows="3" cols="42"><%if Description%><%escape_html Description%><%endif%></textarea>
  </div>
</div>
<div class="row clear">
  <label for="Contact_Name" class="name">Contact Name:</label>
  <div class="value">
    <input type="text" id="Contact_Name" name="Contact_Name" value="<%if Contact_Name%><%escape_html Contact_Name%><%endif%>" class="text" />
  </div>
</div>
<div class="row clear">
  <label for="Contact_Email" class="name">Contact E-mail:</label>
  <div class="value">
    <input type="text" id="Contact_Email" name="Contact_Email" value="<%if Contact_Email%><%escape_html Contact_Email%><%endif%>" class="text" />
  </div>
</div>
