Index: lib/style/common/templates/nceasFooter.tmpl
===================================================================
--- lib/style/common/templates/nceasFooter.tmpl	(revision 3914)
+++ lib/style/common/templates/nceasFooter.tmpl	(revision 3915)
@@ -1,14 +1,14 @@
   <div id="footer">
       <div id="footer_logos">
         <a href="http://www.msi.ucsb.edu/">
-          <img src="@systemidserver@@style-skins-path@/nceas/images/logo_msi.jpg"
+          <img src="[% styleSkinsPath %]/nceas/images/logo_msi.jpg"
             alt="MSI: Marine Science Institute" height="66" width="132"/></a>
         <a href="http://www.nsf.gov/">
-          <img src="@systemidserver@@style-skins-path@/nceas/images/logo_nsf.jpg"
+          <img src="[% styleSkinsPath %]/nceas/images/logo_nsf.jpg"
             alt="NSF: National Science Foundation" height="66"
             width="70"/></a>
         <a href="http://www.ucsb.edu/">
-          <img src="@systemidserver@@style-skins-path@/nceas/images/logo_ucsb.jpg"
+          <img src="[% styleSkinsPath %]/nceas/images/logo_ucsb.jpg"
             alt="UCSB: University of California at Santa Barbara"
             height="66" width="132"/></a>
       </div><!-- footer_logos -->
Index: lib/style/common/templates/ldapResetPass.tmpl
===================================================================
--- lib/style/common/templates/ldapResetPass.tmpl	(revision 3914)
+++ lib/style/common/templates/ldapResetPass.tmpl	(revision 3915)
@@ -12,7 +12,7 @@
     
     
     <table class="intro" cellpadding="3" cellspacing="0"><tr><td>
-    <form name="passwdForm" action="@cgiurl@" method="post">
+    <form name="passwdForm" action="[% cgiurl %]" method="post">
       <input type="hidden" name="stage" value="[% stage %]"/>
       <input type="hidden" name="cfg" value="[% cfg %]"/>
           
Index: lib/style/common/templates/ldapChangePass.tmpl
===================================================================
--- lib/style/common/templates/ldapChangePass.tmpl	(revision 3914)
+++ lib/style/common/templates/ldapChangePass.tmpl	(revision 3915)
@@ -4,7 +4,7 @@
     <tr><td align="left"><span class="regtext">Enter the required information below to change your KNB password.  
     You will need to know your username and your old password, and choose a new password (which is entered twice for confirmation). 
     Required fields are denoted by an asterisk (*).</span></td></tr>
-    <tr><td align="left"><a href="@cgiurl@?stage=initresetpass&cfg=[% cfg %]">Forgot your old password?</a></td></tr>
+    <tr><td align="left"><a href="[% cgiurl %]?stage=initresetpass&cfg=[% cfg %]">Forgot your old password?</a></td></tr>
     <tr><td align="left"> <span class="label">[% errorMessage %]</span></td></tr>
   </table>
     
@@ -11,7 +11,7 @@
     
     
    <table class="intro" cellpadding="3" cellspacing="0"><tr><td>
-    <form name="passwdForm" action="@cgiurl@" method="post">
+    <form name="passwdForm" action="[% cgiurl %]" method="post">
       <input type="hidden" name="stage" value="[% stage %]"/>
       <input type="hidden" name="cfg" value="[% cfg %]"/>
       
Index: lib/style/common/templates/esaModNotification.tmpl
===================================================================
--- lib/style/common/templates/esaModNotification.tmpl	(revision 3914)
+++ lib/style/common/templates/esaModNotification.tmpl	(revision 3915)
@@ -2,7 +2,7 @@
 Ecological Society of America moderator notice:
 [% IF stage == 'mod_accept' %]
 
-You have accepted the metadata entry for [%contactName%]'s article, [%dpTitle%].  This part of the article's submission process is now complete.  You can see the metadata entry as it currently stands at @servlet-path@?action=read&cfg=esa&docid=[%docid%].  Once published, the entry will be available at @servlet-path@?action=read&cfg=esa&docid=[%docid%].
+You have accepted the metadata entry for [%contactName%]'s article, [%dpTitle%].  This part of the article's submission process is now complete.  You can see the metadata entry as it currently stands at [% servletPath %]?action=read&cfg=esa&docid=[%docid%].  Once published, the entry will be available at [% servletPath %]?action=read&cfg=esa&docid=[%docid%].
 
 [% ELSIF stage == 'mod_decline' %]		
 
@@ -13,7 +13,7 @@
 
 [% ELSIF stage == 'mod_revise' %]
 
-You have sent back for review the metadata entry for [%contactName%]'s article, [%dpTitle%].  Your comments on the areas that could be improved are noted below. You can edit the metadata entry as it currently stands at @cgi-prefix@/register-dataset.cgi?stage=modify&cfg=esa&docid=[%docid%].
+You have sent back for review the metadata entry for [%contactName%]'s article, [%dpTitle%].  Your comments on the areas that could be improved are noted below. You can edit the metadata entry as it currently stands at [% cgiPrefix %]/register-dataset.cgi?stage=modify&cfg=esa&docid=[%docid%].
 
 Your Comments:
 [%comment%]
@@ -27,7 +27,7 @@
 We are happy to inform you that the metadata entry for your article submission,
 [%dpTitle%], has been accepted.  This part of the submission process is now
 complete.  Your metadata entry can be cited in the future as <LSID>, and will be
-viewable online at @servlet-path@?action=read&cfg=esa&docid=[%docid%] after publication.  Thank you for your cooperation.
+viewable online at [% servletPath %]?action=read&cfg=esa&docid=[%docid%] after publication.  Thank you for your cooperation.
 
 The Ecological Society of America
  		
@@ -62,7 +62,7 @@
 [%dpTitle%], is still missing some relevant information.  Please read the
 reviewer's comments below for any suggested additions and changes.  You are strongly
 encouraged to go back and address these issues with your entry.  You can login,
-edit, and resubmit your entry at @cgi-prefix@/register-dataset.cgi?stage=modify&cfg=esa&docid=[%docid%]. 
+edit, and resubmit your entry at [% cgiPrefix %]/register-dataset.cgi?stage=modify&cfg=esa&docid=[%docid%]. 
 
 The Ecological Society of America
 
Index: lib/style/common/templates/getReviews.tmpl
===================================================================
--- lib/style/common/templates/getReviews.tmpl	(revision 3914)
+++ lib/style/common/templates/getReviews.tmpl	(revision 3915)
@@ -4,10 +4,10 @@
   <title>Reviews</title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 
-  <script src="@systemidserver@@style-common-path@/prototype.js"></script>
-  <script src="@systemidserver@@style-common-path@/accordion.js"></script>
-  <script src="@systemidserver@@style-common-path@/review_behaviors.js"></script>
-  <link href="@systemidserver@@style-common-path@/reviews.css" media="all" rel="Stylesheet" type="text/css" />
+  <script src="[% styleCommonPath %]/prototype.js"></script>
+  <script src="[% styleCommonPath %]/accordion.js"></script>
+  <script src="[% styleCommonPath %]/review_behaviors.js"></script>
+  <link href="[% styleCommonPath %]/reviews.css" media="all" rel="Stylesheet" type="text/css" />
 
 </head>
 
@@ -16,7 +16,7 @@
 [% IF isModerator == 'true' %]
 	<div class="comment_form">
 	<p class="sectionnames">Moderator Actions</p>
-	<form target="_top" id="reviewForm" method="POST" action="@cgi-prefix@/register-dataset.cgi">
+	<form target="_top" id="reviewForm" method="POST" action="[% cgiPrefix %]/register-dataset.cgi">
 		<input value="mod_accept" id="stage" name="stage" type="hidden">
 		<input value="esa" name="cfg" type="hidden">
 		<input name="docid" type="hidden" value="[%docid%]">
@@ -36,7 +36,7 @@
 [% IF reviewdocid != '' %]
 	<h3 style="margin-top:-8px" class="review_emphasis">
 	Reviews 
-	<img id="busy" src="@systemidserver@@html-path@/style/images/spinner.gif" style="display:none; margin-bottom: -3px;"/>
+	<img id="busy" src="[% baseUrl %]/style/images/spinner.gif" style="display:none; margin-bottom: -3px;"/>
 	</h3>
 
 	<!-- ajax will populate this node -->
Index: lib/style/common/templates/entryForm.js
===================================================================
--- lib/style/common/templates/entryForm.js	(revision 3914)
+++ lib/style/common/templates/entryForm.js	(revision 3915)
@@ -1068,6 +1068,19 @@
         new_row_button.type = 'button';
         new_row_button.value = 'Delete';
 
+        // Permissions check boxes
+        var radio_value_a = 'public';
+        var radio_value_b = 'private';
+        var new_radio_a = document.createElement('input');
+        var new_radio_b = document.createElement('input');
+        new_radio_a.type = new_radio_b.type = 'radio';
+        // get the file upload name, use the number to keep track of the file we're setting permissions on
+        new_radio_a.name = new_radio_b.name = 'uploadperm_' + element.name.split("_")[1];
+        new_radio_a.value = radio_value_a;
+        new_radio_b.value = radio_value_b;
+        new_radio_a.checked = false;
+        new_radio_b.checked = true; // when adding new files, default is private
+         
         // References
         new_row.element = element;
 
@@ -1089,10 +1102,19 @@
             //    which nixes your already queued uploads
             return false;
         };
+       
+        // filename may include path, show only file name itself
+        var name_pattern = element.value.replace(/.*[\/\\](.*)/, "$1");
 
         // Set row value
-        new_row.innerHTML = element.value + " ";
-  
+        new_row.appendChild( document.createTextNode(name_pattern + " ") );
+        
+        // Add in radio buttons and their text
+        new_row.appendChild( new_radio_a );
+        new_row.appendChild( document.createTextNode(capitalize(radio_value_a) + " ") );
+        new_row.appendChild( new_radio_b );
+        new_row.appendChild( document.createTextNode(capitalize(radio_value_b) + " ") );
+
         // Add button
         new_row.appendChild( new_row_button );
 
@@ -1127,3 +1149,7 @@
         }
     }
 }
+
+function capitalize(word) {
+    return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase();
+}
Index: lib/style/common/templates/entryForm.tmpl
===================================================================
--- lib/style/common/templates/entryForm.tmpl	(revision 3914)
+++ lib/style/common/templates/entryForm.tmpl	(revision 3915)
@@ -1,10 +1,6 @@
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasHeader.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericHeader.tmpl" %]
-[% END %]
+[% INCLUDE $templates.header %]
 
-  <script language="JavaScript" type="text/javascript" src="@systemidserver@@style-common-path@/templates/entryForm.js">
+  <script language="JavaScript" type="text/javascript" src="[% styleCommonPath %]/templates/entryForm.js">
   </script>
 
       [% IF form != 're_entry' %]	
@@ -12,9 +8,9 @@
       
       <table class="intro" cellpadding="3" cellspacing="0">
       
-      <tr><td align="left"><span class="emphasis">Data [%IF cfg =='nceas'%] Repository [% ELSE %] Registry [% END %] Form</td></tr>
+      <tr><td align="left"><span class="emphasis">[% config.type %] Form</span></td></tr>
       <tr><td align="left"><span class="regtext">Use this form to submit a new data set description for
-         inclusion in the [%IF cfg =='nceas'%] repository [% ELSE %] registry [% END %].</span>
+         inclusion in the [% config.type | lower %].</span>
 		 [%IF cfg =='esa' %]<span class="redbold">This metadata registry is ONLY for entries associated with articles for ESA publications.</span>
 		 		<span class="regtext">  For those wishing to make public metadata entries not associated with 
 					ESA, <a href="http://knb.ecoinformatics.org">The Knowledge Network for Biocomplexity</a> runs a
@@ -24,8 +20,8 @@
 		 </td></tr>
       <tr><td></td></tr>
       <tr><td align="left"><span class="regtext">Please have a look at the 
-      <a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide" target="guide">
-        <span class="boldlink">Guide for Completing the Data [%IF cfg =='nceas'%] Repository [% ELSE %] Registry [% END %] Form</span></a> 
+      <a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide" target="guide">
+        <span class="boldlink">Guide for Completing the Data [% config.type %] Form</span></a> 
         before you start filling in this form. Also, use your browser's 
         Reload/Refresh function to make sure you see the latest version of this 
         page.</span></td></tr>
@@ -39,27 +35,26 @@
 	  [% END %]
 	  
       <tr><td align="left"><span class="regtext">If you have any questions, comments or problems 
-      regarding this form, please contact [% adminname %] at 
-      <a href="mailto:[% recipient %]"><span class="boldlink">[% recipient %]</span></a></span>.      
+      regarding this form, please contact [% email.admin %] at 
+      <a href="mailto:[% email.recipient %]"><span class="boldlink">[% email.recipient %]</span></a></span>.      
       </td></tr><tr><td></td></tr>
       [% ELSE %]
       
       
       <table class="intro" cellpadding="3" cellspacing="0">
-      <tr><td align="left"><span class="regtext">Use this page to edit the data set description that you submitted earlier to the [%IF cfg =='nceas'%] 
-      repository [% ELSE %] registry [% END %].
+      <tr><td align="left"><span class="regtext">Use this page to edit the data set description that you submitted earlier to the [% config.type | lower %].
       [%IF docid !=''%]
-      <br>The ID of this data set is: <span class="boldlink"><a href="@servlet-path@?action=read&qformat=[% cfg %]&docid=[% docid %]">[% docid %]</a>
+      <br>The ID of this data set is: <span class="boldlink"><a href="[% servletPath %]?action=read&qformat=[% cfg %]&docid=[% docid %]">[% docid %]</a>
       </span>
       [%END%]
       </span></td></tr>
-      <a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide" target="guide">
-        <span class="boldlink">Guide for Completing the Data [%IF cfg =='nceas'%] Repository [% ELSE %] Registry [% END %] Form</span></a> 
+      <a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide" target="guide">
+        <span class="boldlink">Guide for Completing the Data [% config.type %] Form</span></a> 
         for help with filling in this form.</span></td</tr>
       <tr><td></td></tr>
       <tr><td align="left"><span class="regtext">If you have any questions, comments or problems 
-      regarding this form, please contact [% adminname %] at 
-      <a href="mailto:[% recipient %]"><span class="boldling">[% recipient %]</span></a>.</span>
+      regarding this form, please contact [% email.admin %] at 
+      <a href="mailto:[% email.recipient %]"><span class="boldling">[% email.recipient %]</span></a>.</span>
       </td></tr><tr><td></td></tr>
       [% END %]
       
@@ -72,7 +67,7 @@
       </table>
 
 
-<form action="@cgi-prefix@/register-dataset.cgi" enctype="multipart/form-data" method="post">
+<form action="[% cgiPrefix %]/register-dataset.cgi" enctype="multipart/form-data" method="post">
   <input type="hidden" name="cfg" value="[% cfg %]">
   <input type="hidden" name="docid" value="[% docid %]">
   <input type="hidden" name="stage" value="insert">
@@ -79,8 +74,7 @@
   <input type="hidden" name="showSiteList" value="[% showSiteList %]">
   <input type="hidden" name="showWgList" value="[% showWgList %]">
   <input type="hidden" name="showOrganization" value="[% showOrganization %]">
-  <input type="hidden" name="lsite" value="[% lsite %]">
-  <input type="hidden" name="usite" value="[% usite %]">
+  <input type="hidden" name="lsite" value="[% config.site %]">
   <input type="hidden" name="hasKeyword" value="[% hasKeyword %]">
   <input type="hidden" name="hasTemporal" value="[% hasTemporal %]">
   <input type="hidden" name="hasSpatial" value="[% hasSpatial %]">
@@ -93,7 +87,7 @@
   
         <table class="tables" cellpadding="5" cellspacing="0">
         <tr class="sectheader"><td colspan="5" align="left"><span class="label">NAME OF SUBMITTER&nbsp;
-	<a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#Submitter" target="guide">
+	<a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#Submitter" target="guide"></span>
         <span class="smalltext">(What's this?)</span></a></td>
         <td class="rightCol"><span><a onClick="submitterBit=swap(event, 'submitterTable', submitterBit)" style="cursor:pointer">Hide</a></span></td>
         </tr>
@@ -109,7 +103,7 @@
 	
         <table class="tables" cellpadding="5" cellspacing="0">
         <tr class="sectheader"><td colspan="5" align="left"><span class="label">BASIC INFORMATION&nbsp;
-	<a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#BasicInformation" target="guide">
+	<a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#BasicInformation" target="guide">
         <span class="smalltext">(What's this?)</span></a></td>
         <td class="rightCol"><span><a onClick="basicInfoBit=swap(event, 'basicInfoTable', basicInfoBit)" style="cursor:pointer">Hide</a></span></td>
         </tr>
@@ -120,12 +114,12 @@
         </td></tr>
 		
 	[% IF showSiteList == 'true' %]
-        <tr class="sectbody" id="sitelist"><td class="rightCol"><span class="label">*[% usite %] Name</span></td>
+        <tr class="sectbody" id="sitelist"><td class="rightCol"><span class="label">*[% config.site | ucfirst %] Name</span></td>
 	  <td colspan="5"><select name="site" class="longwidth">
 	    [% IF form == 're_entry' %]
 	    	<option selected>[%site%]</option>
 	    [% ELSE %]
-	        <option>Select your [% lsite %] here.</option>
+	        <option>Select your [% config.site %] here.</option>
 	    [% END %]
             [% FOREACH site = siteList %]
               <option>[% site %]</option>
@@ -161,7 +155,7 @@
        
     <table class="tables" cellpadding="5" cellspacing="0">
         <tr class="sectheader"><td colspan="5" align="left"><span class="label">PRINCIPAL DATA SET OWNER&nbsp;</span>
-	<a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetOriginator" 
+	<a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetOriginator" 
 	target="guide"><span class="smalltext">(What's this?)</span></a></td>
         <td class="rightCol"><span><a onClick="dsoBit=swap(event, 'dsoTable', dsoBit)" style="cursor:pointer">Hide</a></span></td>
         </tr>
@@ -261,7 +255,7 @@
     </table>
    
     <table class="tables" cellpadding="5" cellspacing="0">
-    <tr class="sectheader"><td colspan="5" align="left"><span class="label">ASSOCIATED PARTIES&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#AdditionalOriginators"
+    <tr class="sectheader"><td colspan="5" align="left"><span class="label">ASSOCIATED PARTIES&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#AdditionalOriginators"
          target="guide"><span class="smalltext">(What's this?)</span></a></td>
          <td class="rightCol"><span><a onClick="apBit=swap(event, 'apTable', apBit)" style="cursor:pointer">Hide</a></span></td>
     </tr>
@@ -312,16 +306,16 @@
             <td class="rightCol">
                 <a style="cursor:pointer">
                     <img onClick="cleanTextNodes('aoHRRow', 'addaorow');moveUpRow(event)"
-                    src="@systemidserver@@html-path@/style/images/previous.gif"
+                    src="[% baseUrl %]/style/images/previous.gif"
                     alt="Move Up" border="0"/>
                 </a>
                 <a style="cursor:pointer">
                     <img onClick="cleanTextNodes('aoHRRow', 'addaorow');moveDownRow(event, 'addaorow')"
-                    src="@systemidserver@@html-path@/style/images/next.gif"
+                    src="[% baseUrl %]/style/images/next.gif"
                     alt="Move Down" border="0"/>
                 </a>
                 <a style="cursor:pointer">
-                    <img src="@systemidserver@@html-path@/style/images/delete.gif"
+                    <img src="[% baseUrl %]/style/images/delete.gif"
                     onClick="delRow(event)" alt="Delete" border="0"/>
                 </a>
             </td>
@@ -340,7 +334,7 @@
     </table>
    
     <table class="tables" cellpadding="5" cellspacing="0">  		    
-  <tr class="sectheader"><td colspan="5" align="left"><span class="label">DATA SET ABSTRACT&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetAbstract"
+  <tr class="sectheader"><td colspan="5" align="left"><span class="label">DATA SET ABSTRACT&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetAbstract"
           target="guide"><span class="smalltext">(What's this?)</span></td>
           <td class="rightCol"><span><a onClick="abstractBit=swap(event, 'abstractTable', abstractBit)" style="cursor:pointer">Hide</a></span></td>        
   </tr>  
@@ -353,7 +347,7 @@
    
   [% IF hasKeyword == 'true' %]
     <table class="tables" cellpadding="5" cellspacing="0">
-  <tr class="sectheader"><td colspan="5" align="left"><span class="label">KEYWORD INFORMATION <span class="label">&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#KeywordInformation"
+  <tr class="sectheader"><td colspan="5" align="left"><span class="label">KEYWORD INFORMATION <span class="label">&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#KeywordInformation"
         target="guide"><span class="smalltext">(What's this?)</span></a></td>
         <td class="rightCol"><span><a onClick="keywordBit=swap(event, 'keywordTable', keywordBit)" style="cursor:pointer">Hide</a></span></td>
         </tr>
@@ -422,16 +416,16 @@
             <td class="rightCol">
                 <a style="cursor:pointer">
                     <img onClick="cleanTextNodes('keywordHRRow', 'addkeyrow');moveUpRow(event)"
-                    src="@systemidserver@@html-path@/style/images/previous.gif"
+                    src="[% baseUrl %]/style/images/previous.gif"
                     alt="Move Up" border="0"/>
                 </a>
                 <a style="cursor:pointer">
                     <img onClick="cleanTextNodes('keywordHRRow', 'addkeyrow');moveDownRow(event, 'addkeyrow')"
-                    src="@systemidserver@@html-path@/style/images/next.gif"
+                    src="[% baseUrl %]/style/images/next.gif"
                     alt="Move Down" border="0"/>
                 </a>
                 <a style="cursor:pointer">
-                    <img src="@systemidserver@@html-path@/style/images/delete.gif"
+                    <img src="[% baseUrl %]/style/images/delete.gif"
                     onClick="delRow(event)" alt="Delete" border="0"/>
                 </a>
             </td>
@@ -456,9 +450,9 @@
    
   <table class="tables" cellpadding="5" cellspacing="0">   
   <tr class="sectheader"><td colspan="5" align="left"><span class="label">
-  TEMPORAL COVERAGE OF DATA&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#TemporalCoverageOfData"
+  TEMPORAL COVERAGE OF DATA&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#TemporalCoverageOfData"
    target="guide"><span class="smalltext">(What's this?)</span></a></td>
-   <td class="rightCol"e<span><a onClick="temporalBit=swap(event, 'temporalTable', temporalBit)" style="cursor:pointer">Hide</a></span></td>
+   <td class="rightCol"><span><a onClick="temporalBit=swap(event, 'temporalTable', temporalBit)" style="cursor:pointer">Hide</a></span></td>
    </tr>
    </table>
    
@@ -566,7 +560,7 @@
 
   <table class="tables" cellpadding="5" cellspacing="0">  
 
-  <tr class="sectheader"><td colspan="5" align="left"><span class="label">SPATIAL COVERAGE OF DATA&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#SpatialCoverageOfData" 
+  <tr class="sectheader"><td colspan="5" align="left"><span class="label">SPATIAL COVERAGE OF DATA&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#SpatialCoverageOfData" 
   target="guide"><span class="smalltext">(What's this?)</span></a>
  </td>
  <td class="rightCol"><span><a onClick="spatialBit=swap(event, 'spatialTable', spatialBit)" style="cursor:pointer">Hide</a></span></td>
@@ -591,8 +585,8 @@
   [% IF showSiteList == 'true' %]
     <tr class="sectbody"><td align="left" valign="top" colspan="6">
         <input class="label" type="CHECKBOX" name="useSiteCoord" [%useSiteCoord%]>
-        <span class="regtext">Use [% lsite %] coordinates. (This indicates that the data were
-        collected at the [% lsite %]. If you check this box, you don't need
+        <span class="regtext">Use [% config.site %] coordinates. (This indicates that the data were
+        collected at the [% config.site %]. If you check this box, you don't need
         to fill in the lat./long. fields below).</span>
         </td>
     </tr>
@@ -713,7 +707,7 @@
    <table class="tables" cellpadding="5" cellspacing="0">  
 
         <tr class="sectheader"><td colspan="5" align="left">
-        <span class="label">TAXONOMIC COVERAGE OF DATA&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#TaxonomicCoverage" 
+        <span class="label">TAXONOMIC COVERAGE OF DATA&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#TaxonomicCoverage" 
 	target="guide"><span class="smalltext">(What's this?)</span></a> </td>
         <td class="rightCol"><span><a onClick="taxonomicBit=swap(event, 'taxonomicTable', taxonomicBit)" style="cursor:pointer">Hide</a></span></td>
         </tr>
@@ -763,16 +757,16 @@
                 <td class="rightCol">
                     <a style="cursor:pointer">
                         <img onClick="cleanTextNodes('taxonHRRow', 'addtaxarow');moveUpRow(event)"
-                        src="@systemidserver@@html-path@/style/images/previous.gif"
+                        src="[% baseUrl %]/style/images/previous.gif"
                         alt="Move Up" border="0"/>
                     </a>
                     <a style="cursor:pointer">
                         <img onClick="cleanTextNodes('taxonHRRow', 'addtaxarow');moveDownRow(event, 'addtaxarow')"
-                        src="@systemidserver@@html-path@/style/images/next.gif"
+                        src="[% baseUrl %]/style/images/next.gif"
                         alt="Move Down" border="0"/>
                     </a>
                     <a style="cursor:pointer">
-                        <img src="@systemidserver@@html-path@/style/images/delete.gif"
+                        <img src="[% baseUrl %]/style/images/delete.gif"
                         onClick="delRow(event)" alt="Delete" border="0"/>
                     </a>
                 </td>
@@ -803,7 +797,7 @@
    <table class="tables" cellpadding="5" cellspacing="0">  
   <tr class="sectheader"><td colspan="5" align="left">
   <span class="label">DATA COLLECTION METHODS&nbsp;</span>
-  <a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#Methods" target="guide"><span class="smalltext">(What's this?)</span></a></td>
+  <a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#Methods" target="guide"><span class="smalltext">(What's this?)</span></a></td>
   <td class="rightCol"><span><a onClick="methodBit=swap(event, 'methodTable', methodBit)" style="cursor:pointer">Hide</a></span></td>
   </tr>
      </table>
@@ -862,7 +856,7 @@
  
    <table class="tables" cellpadding="5" cellspacing="0">    
   <tr class="sectheader"><td colspan="5" align="left">
-  <span class="label">DATA SET CONTACT&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetContactAddress" target="guide"><span class="smalltext">(What's this?)</span></a></td>
+  <span class="label">DATA SET CONTACT&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetContactAddress" target="guide"><span class="smalltext">(What's this?)</span></a></td>
   <td class="rightCol"><span><a onClick="dscBit=swap(event, 'dscTable', dscBit)" style="cursor:pointer">Hide</a></span></td>
   </tr>
      </table>
@@ -976,7 +970,7 @@
    
    <table class="tables" cellpadding="5" cellspacing="0">  
   <tr class="sectheader"><td colspan="5" align="left">
-  <span class="label">DISTRIBUTION INFORMATION&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DistributionIinformation" 
+  <span class="label">DISTRIBUTION INFORMATION&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DistributionIinformation" 
   target="guide"><span class="smalltext">(What's this?)</span></a></td>
   <td class="rightCol"><span><a onClick="distBit=swap(event, 'distTable', distBit)" style="cursor:pointer">Hide</a></span></td>
   </tr>
@@ -1056,9 +1050,9 @@
   <!-- Associated Data -->
   <table class="tables" cellpadding="5" cellspacing="0">
   <tr class="sectheader"><td colspan="5" align="left">
-  <span class="label">UPLOAD DATA&nbsp;</span><a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#XXX" 
+  <span class="label">UPLOAD DATA&nbsp;</span><a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#XXX" 
   target="guide"><span class="smalltext">(What's this?)</span></a></td>
-  <td class="rightCol"><span><a onClick="distBit=swap(event, 'uploadTable', uploadBit)" style="cursor:pointer">Hide</a></span></td>
+  <td class="rightCol"><span><a onClick="uploadBit=swap(event, 'uploadTable', uploadBit)" style="cursor:pointer">Hide</a></span></td>
   </tr>
    </table>
   <table class="tables" cellpadding="5" cellspacing="0" id="uploadTable">
@@ -1072,7 +1066,7 @@
            [% WHILE cnt < upCount %]
                 [% SET fileSum = "upload_${cnt}" %]
                 [% SET fileName = "uploadname_${cnt}" %]
-                [% SET fileType = "uploadtype_${cnt}" %] 
+                [% SET fileType = "uploadtype_${cnt}" %]
                 [% IF fileSum %]
                     <input type="hidden" name="[%fileSum%]" value="[% $fileSum %]"> 
                     <input type="hidden" name="[%fileName%]" value="[% $fileName %]"> 
@@ -1087,7 +1081,7 @@
   </tr>
   <tr class="sectbody">
     <td class="rightCol" valign="top"><span class="label">Attached Files:</span></td>
-    <td colspan="5">
+    <td colspan="5" class="regtext">
     [% IF !upCount %]
         <div id="file_comment">
             (<i>None currently attached</i>)
@@ -1095,9 +1089,23 @@
     [% END %]
     <div id="files_list">[% IF form == 're_entry' && upCount %]
     [% cnt = 0 %]
+
     [% WHILE cnt < upCount %]
         [% SET fileName = "uploadname_${cnt}" %]
-        [% IF fileName %]<div>[% $fileName %] <input type="button" value="Delete" onclick="deleteFile(event, [%fileName%]);"/></div>[% END %]
+        [% SET filePerm = "uploadperm_${cnt}" %]
+        [% IF $filePerm == 'public' %]
+          [% SET perm_a = "checked" %]
+          [% SET perm_b = "" %]
+        [% ELSE %]
+          [% SET perm_a = "" %]
+          [% SET perm_b = "checked" %]
+        [% END %]
+        [% IF fileName %]<div>
+          [% $fileName %]
+          <input type="radio" name="[% filePerm %]" value="public" [% perm_a %]> Public
+          <input type="radio" name="[% filePerm %]" value="private" [% perm_b %]> Private
+
+          <input type="button" value="Delete" onclick="deleteFile(event, [%fileName%]);"/></div>[% END %]
         [% cnt = cnt + 1 %]
     [% END %]
     [% END %]</div></td>
@@ -1120,8 +1128,4 @@
    
 </form>
 
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasFooter.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericFooter.tmpl" %]
-[% END %]
+[% INCLUDE $templates.footer %]
Index: lib/style/common/templates/genericHeader.tmpl
===================================================================
--- lib/style/common/templates/genericHeader.tmpl	(revision 3914)
+++ lib/style/common/templates/genericHeader.tmpl	(revision 3915)
@@ -25,16 +25,16 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-  <title>[%IF cfg =='account'%]Account Management[% ELSE %] [% orgabbrev %] Data [%IF cfg =='nceas'%] Repository [% ELSE %] Registry [% END %] [% END %]</title>
+  <title>[% config.abbrev %] Data [% config.type %]</title>
   <link rel="stylesheet" type="text/css" 
-        href="@systemidserver@@style-skins-path@/[%cfg%]/[%cfg%].css">
+        href="[% styleSkinsPath %]/[% cfg %]/[% cfg %].css">
   <script language="JavaScript" type="text/JavaScript"
-          src="@systemidserver@@style-skins-path@/[%cfg%]/[%cfg%].js"></script>
+          src="[% styleSkinsPath %]/[% cfg %]/[% cfg %].js"></script>
   <script language="JavaScript" type="text/JavaScript"
-          src="@systemidserver@@style-common-path@/branding.js"></script>
+          src="[% styleCommonPath %]/branding.js"></script>
 </head>
 
 <body>
       <script language="JavaScript" type="text/javascript">
-          insertTemplateOpening();
+          insertTemplateOpening("[% baseUrl %]");
       </script>
Index: lib/style/common/templates/ldapRegister.tmpl
===================================================================
--- lib/style/common/templates/ldapRegister.tmpl	(revision 3914)
+++ lib/style/common/templates/ldapRegister.tmpl	(revision 3915)
@@ -55,7 +55,7 @@
     // -->
     </script>
 
-    <form name="loginForm" action="@cgiurl@" method="post">
+    <form name="loginForm" action="[% cgiurl %]" method="post">
       <input type="hidden" name="stage" value="[% stage %]"/>
       <input type="hidden" name="cfg" value="[% cfg %]"/>
       <table hspace="20" border="0">
@@ -93,13 +93,6 @@
                    value="[% allParams.o %]"/>
             [% ELSE %]
             <select name="o">
-	      <!--[% FOREACH org = orgList %]
-		[% IF allParams.o == org %]
-                  <option value="[% org %]" selected>[% org %]</option>
-                [% ELSE %]
-                  <option value="[% org %]">[% org %]</option>
-                [% END %]
-              [% END %]-->
                   <option value="unaffiliated">unaffiliated</option>
             </select>
             [% END %]
Index: lib/style/common/templates/confirmData.tmpl
===================================================================
--- lib/style/common/templates/confirmData.tmpl	(revision 3914)
+++ lib/style/common/templates/confirmData.tmpl	(revision 3915)
@@ -22,27 +22,13 @@
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -->
 
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasHeader.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericHeader.tmpl" %]
-[% END %]
+[% INCLUDE $templates.header %]
 
-[% IF cfg == 'nrs' %]
-  [% lsite = 'reserve' %]
-  [% usite = 'Reserve' %]
-[% ELSE %]
-  [% lsite = 'station' %]
-  [% usite = 'Station' %]
-[% END %]
-
 <table class="intro" cellpadding="3" cellspacing="0">
 <tr><td align="left"><span class="regtext">
-Please review the information that you entered in the [% orgabbrev %] 
- Data Registry Form. If the information below is correct, provide your username, organization, and password at the bottom of this page, and submit the information. 
-If you need to edit something, click on the edit button that is provided at the bottom of this page.<span></td></tr>
+Please review the information that you've entered.  To make changes, click on the edit button <a href="#buttons">at the bottom of the page</a>.<span></td></tr>
 
-<tr><td align="left"><span class="regtext">You can print this page for your record.<span></td></tr> 
+<tr><td align="left"><span class="regtext">Print this page to keep a copy for your records.<span></td></tr> 
 </table>
 
 <table class="intro" cellpadding="3" cellspacing="0">
@@ -68,7 +54,7 @@
     [% IF cfg == 'esa' %]
       <p><span class="label">Organization Name:</span>  [%site%]</p>
     [% ELSE %]
-      <p><span class="label">[% usite %] Name:</span>  [%site%]</p>
+      <p><span class="label">[% config.site | ucfirst %] Name:</span>  [%site%]</p>
     [% END %]
 [% END %]
 
@@ -356,9 +342,10 @@
     [% cnt = 0 %]
     [% WHILE cnt < upCount %]
         [% SET fileName = "uploadname_${cnt}" %]
+        [% SET filePerm = "uploadperm_${cnt}" %]
         [% cnt = cnt + 1 %]
 
-        <p><span class="label">File #[% cnt %]:</span> [% $fileName %] </p>
+        <p><span class="label">File #[% cnt %]:</span> [% $fileName %], [% $filePerm %] access</p>
     [% END %]
 [% END %]
 <hr>
@@ -425,7 +412,7 @@
 </p>
 <hr>
 
-<form action="@cgi-prefix@/register-dataset.cgi" method="post">
+<form action="[% cgiPrefix %]/register-dataset.cgi" method="post">
   <input type="hidden" name="cfg" value="[% cfg %]">
   <input type="hidden" name="docid" value="[% docid %]">
   <input type="hidden" name="stage" value="confirmed">
@@ -432,8 +419,7 @@
   <input type="hidden" name="showSiteList" value="[% showSiteList %]">
   <input type="hidden" name="showWgList" value="[% showWgList %]">
   <input type="hidden" name="showOrganization" value="[% showOrganization %]">
-  <input type="hidden" name="lsite" value="[% lsite %]">
-  <input type="hidden" name="usite" value="[% usite %]">
+  <input type="hidden" name="lsite" value="[% config.site %]">
   <input type="hidden" name="hasKeyword" value="[% hasKeyword %]">
   <input type="hidden" name="hasSpatial" value="[% hasSpatial %]">
   <input type="hidden" name="hasTemporal" value="[% hasTemporal %]">
@@ -550,7 +536,6 @@
   [% END %]
   <input type="hidden" name="studyExtentDescription" value="[%studyExtentDescription%]">
   <input type="hidden" name="samplingDescription" value="[%samplingDescription%]">
-  <input type="hidden" name="fileCount" value="[%fileCount%]">
   <input type="hidden" name="upCount" value="[%upCount%]">
   [% fCount = 0 %]
   [% IF upCount > 0 %]
@@ -562,11 +547,13 @@
       [% SET fileSum = "upload_${cnt}" %]
       [% SET fileName = "uploadname_${cnt}" %]
       [% SET fileType = "uploadtype_${cnt}" %] 
+      [% SET filePerm = "uploadperm_${cnt}" %]
 
       [% IF fileSum %]
         <input type="hidden" name="[% fileSum %]" value="[% $fileSum %]">
         <input type="hidden" name="[% fileName %]" value="[% $fileName %]">
         <input type="hidden" name="[% fileType %]" value="[% $fileType %]">
+        <input type="hidden" name="[% filePerm %]" value="[% $filePerm %]">
       [% END %]
       [% cnt = cnt + 1 %]
   [% END %]
@@ -579,12 +566,12 @@
       and password. This is for the protection of your metadata. The
       username and password will prevent any unauthorized person from
       modifying your metadata. If you do not have an account, click <a
-      target="ldap" href="@cgi-prefix@/ldapweb.cgi?cfg=[% cfg %]">here</a>. 
+      target="ldap" href="[% cgiPrefix %]/ldapweb.cgi?cfg=[% cfg %]">here</a>. 
       If you don't remember your password, you can
       have it reset and e-mailed to you by clicking <a target="ldap"
-      href="@cgi-prefix@/ldapweb.cgi?stage=initresetpass&cfg=[% cfg %]">here</a>. If you want to 
+      href="[% cgiPrefix %]/ldapweb.cgi?stage=initresetpass&cfg=[% cfg %]">here</a>. If you want to 
       change your password, click <a target="ldap"
-      href="@cgi-prefix@/ldapweb.cgi?stage=initchangepass&cfg=[% cfg %]">here</a>.
+      href="[% cgiPrefix %]/ldapweb.cgi?stage=initchangepass&cfg=[% cfg %]">here</a>.
       </span>
       <table cellspacing="0" border="0" cellpadding="9" width="360" align="left">
         <tr>
@@ -624,6 +611,7 @@
 <p>&nbsp;</p>
 [% END %]
 
+<a name="buttons"></a>
 <table class="intro" cellspacing="0" cellpadding="3" >
   <tr><td align="left">
   <p><span class="label">Is the information above correct?</span></p> 
@@ -635,8 +623,4 @@
 </table>
 </form>
 <p>&nbsp;</p>
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasFooter.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericFooter.tmpl" %]
-[% END %]
+[% INCLUDE $templates.footer %]
Index: lib/style/common/templates/genericGuide.tmpl
===================================================================
--- lib/style/common/templates/genericGuide.tmpl	(revision 3914)
+++ lib/style/common/templates/genericGuide.tmpl	(revision 3915)
@@ -23,25 +23,12 @@
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -->
 
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasHeader.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericHeader.tmpl" %]
-[% END %]
+[% INCLUDE $templates.header %]
 
-[% IF cfg == 'nrs' %]
-  [% lsite = 'reserve' %]
-  [% usite = 'Reserve' %]
-[% ELSE %]
-  [% lsite = 'station' %]
-  [% usite = 'Station' %]
-[% END %]
-
 <table class="intro" cellpadding="8" cellspacing="0">
 
-<tr><td align="left"><span class="emphasis">Guide for Completing the Data [%IF cfg =='nceas'%] Repository [% ELSE %] Registry [% END %] Form</td></tr>
-<tr><td align="left"><span class="regtext">This guide provides information on how to fill in the online [% orgabbrev %] Data [%IF cfg =='nceas'%] Repository [% ELSE %] 
-Registry [% END %] Form. 
+<tr><td align="left"><span class="emphasis">Guide for Completing the Data [% config.type %] Form</td></tr>
+<tr><td align="left"><span class="regtext">This guide provides information on how to fill in the online [% config.abbrev %] Data [% config.type %] Form. 
 There are 11 sections to the form; some fields are required (denoted by an asterisk *),
 while others are optional. When you are done completing a section, you have the option of clicking on "<span class="colorbold">Hide</span>" 
 (on the right side of each section header) to hide the information you just entered. Information on individual fields and examples for their content are provided below.
@@ -110,18 +97,18 @@
 
 [% IF cfg == 'obfs' || cfg == 'nrs' || cfg == 'specnet'%]
 
-<tr><td colspan="2" align="left"><span class="label">*[% usite %] Name:</span>
-<span class="regtext">Select a [% lsite %] from the drop-down list to indicate that the data set is
-affiliated with the [% lsite %]. We use "affiliation" in a rather
+<tr><td colspan="2" align="left"><span class="label">*[% config.site | ucfirst %] Name:</span>
+<span class="regtext">Select a [% config.site %] from the drop-down list to indicate that the data set is
+affiliated with the [% config.site %]. We use "affiliation" in a rather
 permissive sense to mean, for example, that the data set was or has
-been generated at the [% lsite %]; that the owner is affiliated
-with the [% lsite %] or was affiliated with the [% lsite %] when the data
-set was generated; or that the data set is owned by the [% lsite %]; etc.
+been generated at the [% config.site %]; that the owner is affiliated
+with the [% config.site %] or was affiliated with the [% config.site %] when the data
+set was generated; or that the data set is owned by the [% config.site %]; etc.
 </td></tr>
 
 <tr><td colspan="2" align="left"><span class="regtext"><u>Note:</u>
 If the data were collected at a site other than a
-[% lsite %] listed in the drop-down menu, you can indicate so in the
+[% config.site %] listed in the drop-down menu, you can indicate so in the
 abstract and/or title. You can also indicate this in the keywords
 with a locality keyword.</span></td></tr> 
 
@@ -344,7 +331,7 @@
 
 <tr><td colspan="2" align="left"><span class="regtext">Contact information of the person to be contacted for more information on the data
 set or to obtain the data set itself. This is analogous to the Principal Data Set Owner information above. Please 
-<a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetOriginator" target="_self">see that section</a> for more information on filling out the 
+<a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]&amp;stage=guide#DataSetOriginator" target="_self">see that section</a> for more information on filling out the 
 individual fields. If the Data Set Contact and the Principal Data Set Owner are the same, check the box provided.</span></td></tr>
 
 
@@ -359,7 +346,7 @@
 
 [% IF cfg == 'obfs' || cfg == 'nrs' || cfg == 'specnet'%]
 Keep in mind that this information, although not required, can be extremely useful
-for locating the data set at a [% lsite %].
+for locating the data set at a [% config.site %].
 [%END%]
 </span></td></tr>
 <tr><td colspan="2" align="left"><span class="label">*Data Medium</font>:</span><span class="regtext"> Specify whether the data medium is 
@@ -379,8 +366,4 @@
 </table>
 <p></p>
 
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasFooter.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericFooter.tmpl" %]
-[% END %]
+[% INCLUDE $templates.footer %]
Index: lib/style/common/templates/genericResponse.tmpl
===================================================================
--- lib/style/common/templates/genericResponse.tmpl	(revision 3914)
+++ lib/style/common/templates/genericResponse.tmpl	(revision 3915)
@@ -1,8 +1,4 @@
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasHeader.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericHeader.tmpl" %]
-[% END %]
+[% INCLUDE $templates.header %]
 
     [% IF status == 'success' %]
         
@@ -14,7 +10,7 @@
         [%ELSE%]
 	    <tr><td align="left"><span class="regtext">Your data set description has been [% function  %].  Thank you.</span></td></tr>
             <tr><td align="left"><span class="regtext">You can see the data set description by clicking 
-	    <a href="@servlet-path@?action=read&qformat=[% cfg %]&docid=[% docid %]">here</a>.</span></td></tr> 	   
+	    <a href="[% servletPath %]?action=read&qformat=[% cfg %]&docid=[% docid %]">here</a>.</span></td></tr> 	   
         [%END%]
       </table>
     [% ELSE %]
@@ -52,7 +48,7 @@
             <tr><td align="left"><span class="regtext">Click <a href = "javascript:history.back()">here</a> to return
             to the previous page, and enter the correct username, organization, and password.</td></tr> 
             [%ELSE%]
-                <tr><td align="left"><span class="regtext">To register a new data set, click <a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]" target="_top">here</a>.
+                <tr><td align="left"><span class="regtext">To register a new data set, click <a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]" target="_top">here</a>.
 		Otherwise, use the toolbar links above to navigate.</span></td></tr>
             [%END%]
             </table>
@@ -59,12 +55,12 @@
         [% ELSE %]
             [% IF status == 'success' %]
                 <table class="intro" cellpadding="8" cellspacing="0">
-                    <tr><td align="left"><span class="regtext">To register a new data set, click <a href="@cgi-prefix@/register-dataset.cgi?cfg=[%cfg%]" target="_top">here</a>.
+                    <tr><td align="left"><span class="regtext">To register a new data set, click <a href="[% cgiPrefix %]/register-dataset.cgi?cfg=[%cfg%]" target="_top">here</a>.
                     Otherwise, use the toolbar links above to navigate.</span></td></tr>
                 </table>
             [% ELSE %]
                 [% IF status != 'failure_no_resubmit' %]
-                    <form name="editForm" action="@cgi-prefix@/register-dataset.cgi" method="post">
+                    <form name="editForm" action="[% cgiPrefix %]/register-dataset.cgi" method="post">
                         <input type="hidden" name="cfg" value="[% cfg %]">
                         <input type="hidden" name="docid" value="[% docid %]">
                         <input type="hidden" name="stage" value="confirmed">
@@ -215,6 +211,7 @@
                             [% SET fileSum = "upload_${cnt}" %]
                             [% SET fileName = "uploadname_${cnt}" %]
                             [% SET fileType = "uploadtype_${cnt}" %]
+                            [% SET filePerm = "uploadperm_${cnt}" %]
 
                             [% IF fileSum %]
 
@@ -221,6 +218,7 @@
                                 <input type="hidden" name="[% fileSum %]" value="[% $fileSum %]">
                                 <input type="hidden" name="[% fileName %]" value="[% $fileName %]">
                                 <input type="hidden" name="[% fileType %]" value="[% $fileType %]">
+                                <input type="hidden" name="[% filePerm %]" value="[% $filePerm %]">
                             [% END %]
                             [% cnt = cnt + 1 %]
                         [% END %]
@@ -243,8 +241,4 @@
             [% END %]
         [% END %]
     [% END %]
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasFooter.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericFooter.tmpl" %]
-[% END %]
+[% INCLUDE $templates.footer %]
Index: lib/style/common/templates/genericFooter.tmpl
===================================================================
--- lib/style/common/templates/genericFooter.tmpl	(revision 3914)
+++ lib/style/common/templates/genericFooter.tmpl	(revision 3915)
@@ -1,5 +1,5 @@
 <script language="JavaScript" type="text/javascript">
-    insertTemplateClosing();
+    insertTemplateClosing("[% baseUrl %]");
 </script>
 </body>
 </html>
Index: lib/style/common/templates/deleteData.tmpl
===================================================================
--- lib/style/common/templates/deleteData.tmpl	(revision 3914)
+++ lib/style/common/templates/deleteData.tmpl	(revision 3915)
@@ -22,26 +22,13 @@
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -->
 
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasHeader.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericHeader.tmpl" %]
-[% END %]
+[% INCLUDE $templates.header %]
 
-[% IF cfg == 'nrs' %]
-  [% lsite = 'reserve' %]
-  [% usite = 'Reserve' %]
-[% ELSE %]
-  [% lsite = 'station' %]
-  [% usite = 'Station' %]
-[% END %]
-
-
 <table class="intro" cellpadding="3" cellspacing="0">
-<tr><td align="left"><span class="regtext">You have requested deletion of a data set description entered in the [% orgabbrev %] Data Registry Form. 
+<tr><td align="left"><span class="regtext">You have requested deletion of a data set description entered in the [% config.abbrev %] Data Registry Form. 
 Please enter your username, organization, and password to delete this document.</span><p>&nbsp;</p>
 
-<form action="@cgi-prefix@/register-dataset.cgi" method="post">
+<form action="[% cgiPrefix %]/register-dataset.cgi" method="post">
   <input type="hidden" name="cfg" value="[% cfg %]">
   <input type="hidden" name="docid" value="[% docid %]">
   <input type="hidden" name="stage" value="delete_confirm"> 
@@ -96,9 +83,5 @@
   </tr>
 </table>
 </form>
-<p>&nbsp;</p>
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasFooter.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericFooter.tmpl" %]
-[% END %]
+<p></p>
+[% INCLUDE $templates.footer %]
Index: lib/style/common/templates/loginForm.tmpl
===================================================================
--- lib/style/common/templates/loginForm.tmpl	(revision 3914)
+++ lib/style/common/templates/loginForm.tmpl	(revision 3915)
@@ -1,8 +1,4 @@
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasHeader.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericHeader.tmpl" %]
-[% END %]
+[% INCLUDE $templates.header %]
       <script language="JavaScript">
 function submitform(formObj) {
 
@@ -48,7 +44,7 @@
           
         
 				<p><span class="greenbold">Step 1: Create an Account</span> <br>
-		   			Create an account by registering with the <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]">KNB</a>.
+		   			Create an account by registering with the <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]">KNB</a>.
 
 					Many scientists will already have accounts in the KNB, especially those 
 					from institutions like NCEAS and LTER. If you already have an account 
@@ -65,8 +61,7 @@
 		[% END %]
 	  
       [% END %]
-  <menu>
-<form method="post" action="@cgi-prefix@/register-dataset.cgi" onsubmit="return submitform(this);" >
+<form method="post" action="[% cgiPrefix %]/register-dataset.cgi" onsubmit="return submitform(this);" >
     <input type="hidden" name="stage" value="login"> 
     <input type="hidden" name="username" value=""> 
     <input type="hidden" name="cfg" value="[%cfg%]"> 
@@ -128,20 +123,10 @@
       </tr>
     </table>
   </form>
-  </menu>
-  
-[% IF cfg == 'nceas' %]
-	Dont have an account yet? <a href="@cgi-prefix@/ldapweb.cgi">Create a new account</a>
-	 <br />
-	Forgot your password? <a href="@cgi-prefix@/ldapweb.cgi?stage=resetpass">Reset your password</a>
-[% ELSE %]
-  Dont have an account yet? <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]">Create a new account</a>
+
+  <p>  
+  Dont have an account yet? <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]">Create a new account</a>
   <br />
-  Forgot your password? <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]&amp;stage=resetpass">Reset your password</a>
-[% END %]
-
-[% IF cfg == 'nceas' %]
-  [% INCLUDE "nceasFooter.tmpl" %]
-[% ELSE %]
-  [% INCLUDE "genericFooter.tmpl" %]
-[% END %]  
+  Forgot your password? <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]&amp;stage=resetpass">Reset your password</a>
+  </p>
+[% INCLUDE $templtes.footer %]
Index: lib/style/common/templates/nceasHeader.tmpl
===================================================================
--- lib/style/common/templates/nceasHeader.tmpl	(revision 3914)
+++ lib/style/common/templates/nceasHeader.tmpl	(revision 3915)
@@ -4,17 +4,17 @@
   <title>NCEAS Data Repository</title>
 
   <link rel="stylesheet" type="text/css"
-    href="@systemidserver@@style-skins-path@/nceas/nceas.css">
+    href="[% styleSkinsPath %]/nceas/nceas.css">
   <script language="Javascript" type="text/JavaScript"
-    src="@systemidserver@@style-skins-path@/nceas/nceas.js"></script>
+    src="[% styleSkinsPath %]/nceas/nceas.js"></script>
   <script language="Javascript" type="text/JavaScript"
-    src="@systemidserver@@style-common-path@/branding.js"></script>
+    src="[% styleCommonPath %]/branding.js"></script>
   <script language="Javascript" type="text/javascript"
-    src="@systemidserver@@style-skins-path@/nceas/navigation.js"></script>
+    src="[% styleSkinsPath %]/nceas/navigation.js"></script>
   <link rel="stylesheet" type="text/css"
-    href="@systemidserver@@style-skins-path@/nceas/nceas.css">
+    href="[% styleSkinsPath %]/nceas/nceas.css">
 </head>
-<body id="Overview" onload="loginStatus();">
+<body id="Overview" onload="loginStatus('[% metacatUrl %]', '[% cgiPrefix %]');">
   <div id="main_wrapper">
 
   <div id="header">
@@ -42,7 +42,7 @@
           </a>
         </li>
         <li class="collapsed">
-          <a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas">
+          <a href="[% cgiPrefix %]/register-dataset.cgi?cfg=nceas">
             Register
           </a>
         </li>
Index: lib/style/common/templates/esaModResultTemplate.tmpl
===================================================================
--- lib/style/common/templates/esaModResultTemplate.tmpl	(revision 3914)
+++ lib/style/common/templates/esaModResultTemplate.tmpl	(revision 3915)
@@ -13,7 +13,7 @@
 </script>
 
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="timerID=setTimeout('search()',20)">
-          <form id="search-form" action="@servlet-path@" method="post">
+          <form id="search-form" action="[% servletPath %]" method="post">
                 <input type="hidden" name="action" value="squery"/>
                 <input type="hidden" name="qformat" value="esa"/>
                 <input type="hidden" name="enableediting" value="true"/>
