Index: /main/trunk/model-cols-dev/peijones/etc/collectionConfig.xml
===================================================================
--- /main/trunk/model-cols-dev/peijones/etc/collectionConfig.xml	(revision 25218)
+++ /main/trunk/model-cols-dev/peijones/etc/collectionConfig.xml	(revision 25219)
@@ -1,98 +1,194 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CollectionConfig xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<metadataList><metadata lang="en" name="creator"></metadata><metadata lang="en" name="maintainer"></metadata><metadata lang="en" name="public">true</metadata></metadataList><displayItemList><displayItem assigned="true" lang="en" name="name">Pei-Jones-Flat</displayItem></displayItemList><search type="mgpp"><level name="document"><displayItem lang="en" name="name">document</displayItem></level><level name="section"><displayItem lang="en" name="name">section</displayItem></level><defaultLevel name="document"/><index name="text"><displayItem lang="en" name="name">text</displayItem></index><index name="Title"><displayItem lang="en" name="name">titles</displayItem></index><index name="Source"><displayItem lang="en" name="name">filenames</displayItem></index><index name="Plugin"/><index name="gsimg.photoNote"><displayItem lang="en" name="name">photo annotations</displayItem></index><index name="gstext.tags"><displayItem lang="en" name="name">text annotations (tags)</displayItem></index><index name="gstext.text"><displayItem lang="en" name="name">text annotations (text)</displayItem></index><index name="gstext.user"><displayItem lang="en" name="name">text annotations (user)</displayItem></index><defaultIndex name="text"/><indexOption><option name="accentfold"/><option name="casefold"/><option name="stem"/></indexOption><searchType name="plain"/><searchType name="simpleform"/><searchType name="advancedform"/><format>
-      <gsf:template match="documentNode">
-        <td valign="top">
-          <gsf:link type="document">
-            <gsf:icon type="document"/>
-          </gsf:link>
-        </td>
-        <td>
-          <gsf:switch>
-            <gsf:metadata name="Title" select="ancestors" separator=": "/>
-            <gsf:when test="exists"><gsf:metadata name="Title" select="ancestors" separator=": "/>:</gsf:when>
-          </gsf:switch>
-          <gsf:link type="document">
-            <gsf:metadata name="Title"/>
-          </gsf:link>
-        </td>
-      </gsf:template>
-    </format></search><infodb type="gdbm"/><import><pluginList><plugin name="ZIPPlugin"/><plugin name="GreenstoneXMLPlugin"/><plugin name="TextPlugin"/><plugin name="HTMLPlugin"><option name="-process_exp" value="(timeglider.*)(?i)(\.html?)$"/><option name="-block_exp" value="(timeglider.*)(?i)(\.jpe?g|\.png|\.gif)$"/><option name="-keep_head"/></plugin><plugin name="EmailPlugin"/><plugin name="PDFPlugin"/><plugin name="RTFPlugin"/><plugin name="WordPlugin"/><plugin name="PostScriptPlugin"/><plugin name="PowerPointPlugin"/><plugin name="ExcelPlugin"/><plugin name="PagedImagePlugin"/><plugin name="ImagePlugin"/><plugin name="ISISPlugin"/><plugin name="NulPlugin"/><plugin name="OAIPlugin"/><plugin name="HTMLImagePlugin"/><plugin name="MetadataXMLPlugin"/><plugin name="ArchivesInfPlugin"/><plugin name="DirectoryPlugin"/></pluginList></import><browse><classifier name="List"><option name="-metadata" value="dc.Title;Title"/><option name="-partition_type_within_level" value="approximate_size"/><option name="-bookshelf_type" value="never"/></classifier><classifier name="AZCompactList"><option name="-metadata" value="Source"/><option name="-removesuffix" value="(?i)\\..*"/><option name="-buttonname" value="Source"/></classifier><format>
-      <gsf:template match="documentNode">
-        <td valign="top">
-          <gsf:link type="document">
-            <gsf:icon type="document"/>
-          </gsf:link>
-        </td>
-        <td valign="top">
-          <gsf:link type="source">
-            <gsf:choose-metadata>
-              <gsf:metadata name="thumbicon"/>
-              <gsf:metadata name="srcicon"/>
-            </gsf:choose-metadata>
-          </gsf:link>
-        </td>
-        <td valign="top">
-		<gsf:link type="document">
-          <gsf:choose-metadata>
-            <gsf:metadata name="dc.Title"/>
-            <gsf:metadata name="exp.Title"/>
-            <gsf:metadata name="Title"/>
-            <gsf:default>Untitled</gsf:default>
-          </gsf:choose-metadata>
-		  </gsf:link>
-          <gsf:switch>
-            <gsf:metadata name="Source"/>
-            <gsf:when test="exists">
-              <br/>
-              <i>(<gsf:metadata name="Source"/>)</i>
-            </gsf:when>
-          </gsf:switch>
-        </td>
-      </gsf:template>
-      <gsf:template match="classifierNode">
-        <td valign="top">
-          <gsf:link type="classifier">
-            <gsf:icon type="classifier"/>
-          </gsf:link>
-        </td>
-        <td valign="top">
-          <gsf:metadata name="srclink"/>
-          <gsf:choose-metadata>
-            <gsf:metadata name="thumbicon"/>
-            <gsf:metadata name="srcicon"/>
-          </gsf:choose-metadata>
-          <gsf:metadata name="/srclink"/>
-        </td>
-        <td valign="top">
-          <gsf:choose-metadata>
-            <gsf:metadata name="dc.Title"/>
-            <gsf:metadata name="exp.Title"/>
-            <gsf:metadata name="Title"/>
-            <gsf:default>Untitled</gsf:default>
-          </gsf:choose-metadata>
-          <gsf:switch>
-            <gsf:metadata name="Source"/>
-            <gsf:when test="exists">
-              <br/>
-              <i>(<gsf:metadata name="Source"/>)</i>
-            </gsf:when>
-          </gsf:switch>
-        </td>
-      </gsf:template>
-      <gsf:template match="classifierNode" mode="horizontal">
-        <gsf:link type="horizontal">
-          <gsf:metadata name="Title"/>
-        </gsf:link>
-      </gsf:template>
-    </format></browse><display><format>
-      <gsf:option name="sideBar" value="false"/>
-      <xsl:template name="additionalHeaderContent">
-	  
-		<!--
+
+	<metadataList>
+		<metadata lang="en" name="creator"></metadata>
+		<metadata lang="en" name="maintainer"></metadata>
+		<metadata lang="en" name="public">true</metadata>
+	</metadataList>
+	<displayItemList>
+		<displayItem assigned="true" lang="en" name="name">Pei-Jones-Flat</displayItem>
+	</displayItemList>
+	<search type="mgpp">
+		<level name="document">
+			<displayItem lang="en" name="name">document</displayItem>
+		</level>
+		<level name="section">
+			<displayItem lang="en" name="name">section</displayItem>
+		</level>
+		<defaultLevel name="document"/>
+		<index name="text">
+			<displayItem lang="en" name="name">text</displayItem>
+		</index>
+		<index name="Title">
+			<displayItem lang="en" name="name">titles</displayItem>
+		</index>
+		<index name="Source">
+			<displayItem lang="en" name="name">filenames</displayItem>
+		</index>
+		<index name="Plugin"/>
+		<index name="gsimg.photoNote">
+			<displayItem lang="en" name="name">photo annotations</displayItem>
+		</index>
+		<index name="gstext.tags">
+			<displayItem lang="en" name="name">text annotations (tags)</displayItem>
+		</index>
+		<index name="gstext.text">
+			<displayItem lang="en" name="name">text annotations (text)</displayItem>
+		</index>
+		<index name="gstext.user">
+			<displayItem lang="en" name="name">text annotations (user)</displayItem>
+		</index>
+		<index name="SourceFile"/>
+		<defaultIndex name="text"/>
+		<indexOption>
+			<option name="accentfold"/>
+			<option name="casefold"/>
+			<option name="stem"/>
+		</indexOption>
+		<searchType name="plain"/>
+		<searchType name="simpleform"/>
+		<searchType name="advancedform"/>
+		<format>
+			<gsf:template match="documentNode">
+				<td valign="top">
+					<gsf:link type="document">
+						<gsf:icon type="document"/>
+					</gsf:link>
+				</td>
+				<td>
+					<gsf:switch>
+						<gsf:metadata name="Title" select="ancestors" separator=": "/>
+						<gsf:when test="exists"><gsf:metadata name="Title" select="ancestors" separator=": "/>:</gsf:when>
+					</gsf:switch>
+					<gsf:link type="document">
+						<gsf:metadata name="Title"/>
+					</gsf:link>
+				</td>
+			</gsf:template>
+		</format>
+	</search>
+	<infodb type="gdbm"/>
+	<import>
+		<pluginList>
+			<plugin name="ZIPPlugin"/>
+			<plugin name="GreenstoneXMLPlugin"/>
+			<plugin name="TextPlugin">
+				<option name="-extract_language"/>
+				<option name="-default_language" value="undefined"/>
+			</plugin>
+			<plugin name="HTMLPlugin">
+				<option name="-process_exp" value="(timeglider.*)(?i)(\.html?)$"/>
+				<option name="-block_exp" value="(timeglider.*)(?i)(\.jpe?g|\.png|\.gif)$"/>
+				<option name="-keep_head"/>
+				<option name="-extract_language"/>
+				<option name="-default_language" value="undefined"/>
+			</plugin>
+			<plugin name="EmailPlugin"/>
+			<plugin name="PDFPlugin"/>
+			<plugin name="RTFPlugin"/>
+			<plugin name="WordPlugin"/>
+			<plugin name="PostScriptPlugin"/>
+			<plugin name="PowerPointPlugin"/>
+			<plugin name="ExcelPlugin"/>
+			<plugin name="PagedImagePlugin"/>
+			<plugin name="ImagePlugin"/>
+			<plugin name="ISISPlugin"/>
+			<plugin name="NulPlugin"/>
+			<plugin name="OAIPlugin"/>
+			<plugin name="HTMLImagePlugin"/>
+			<plugin name="MetadataXMLPlugin"/>
+			<plugin name="ArchivesInfPlugin"/>
+			<plugin name="DirectoryPlugin"/>
+		</pluginList>
+	</import>
+	<browse>
+		<classifier name="List">
+			<option name="-metadata" value="dc.Title;Title"/>
+			<option name="-partition_type_within_level" value="approximate_size"/>
+			<option name="-bookshelf_type" value="never"/>
+		</classifier>
+		<classifier name="AZCompactList">
+			<option name="-metadata" value="Source"/>
+			<option name="-removesuffix" value="(?i)\\..*"/>
+			<option name="-buttonname" value="Source"/>
+		</classifier>
+		<format>
+			<gsf:template match="documentNode">
+				<td valign="top">
+					<gsf:link type="document">
+						<gsf:icon type="document"/>
+					</gsf:link>
+				</td>
+				<td valign="top">
+					<gsf:link type="source">
+						<gsf:choose-metadata>
+							<gsf:metadata name="thumbicon"/>
+							<gsf:metadata name="srcicon"/>
+						</gsf:choose-metadata>
+					</gsf:link>
+				</td>
+				<td valign="top">
+					<gsf:link type="document">
+						<gsf:choose-metadata>
+							<gsf:metadata name="dc.Title"/>
+							<gsf:metadata name="exp.Title"/>
+							<gsf:metadata name="Title"/>
+							<gsf:default>Untitled</gsf:default>
+						</gsf:choose-metadata>
+					</gsf:link>
+					<gsf:switch>
+						<gsf:metadata name="Source"/>
+						<gsf:when test="exists">
+							<br/>
+							<i>(<gsf:metadata name="Source"/>)</i>
+						</gsf:when>
+					</gsf:switch>
+				</td>
+			</gsf:template>
+			<gsf:template match="classifierNode">
+				<td valign="top">
+					<gsf:link type="classifier">
+						<gsf:icon type="classifier"/>
+					</gsf:link>
+				</td>
+				<td valign="top">
+					<gsf:metadata name="srclink"/>
+					<gsf:choose-metadata>
+						<gsf:metadata name="thumbicon"/>
+						<gsf:metadata name="srcicon"/>
+					</gsf:choose-metadata>
+					<gsf:metadata name="/srclink"/>
+				</td>
+				<td valign="top">
+					<gsf:choose-metadata>
+						<gsf:metadata name="dc.Title"/>
+						<gsf:metadata name="exp.Title"/>
+						<gsf:metadata name="Title"/>
+						<gsf:default>Untitled</gsf:default>
+					</gsf:choose-metadata>
+					<gsf:switch>
+						<gsf:metadata name="Source"/>
+						<gsf:when test="exists">
+							<br/>
+							<i>(<gsf:metadata name="Source"/>)</i>
+						</gsf:when>
+					</gsf:switch>
+				</td>
+			</gsf:template>
+			<gsf:template match="classifierNode" mode="horizontal">
+				<gsf:link type="horizontal">
+					<gsf:metadata name="Title"/>
+				</gsf:link>
+			</gsf:template>
+		</format>
+	</browse>
+	<display>
+		<format>
+			<gsf:option name="sideBar" value="false"/>
+			<xsl:template name="additionalHeaderContent">
+<!--
 		<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"/>
-		<link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css"/> -->
-		<!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-ie6.min.css"><![endif]-->
-		<!--
+		<link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css"/> --><!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-ie6.min.css"><![endif]--><!--
 		<link rel="stylesheet" href="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.css"/>
 		
@@ -112,96 +208,27 @@
 		<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/tmpl.min.js"><xsl:text> </xsl:text></script>
 		<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/load-image.min.js"><xsl:text> </xsl:text></script>
-		-->
-		<!--<script id="template-upload" type="text/html">
-			{% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
-				<tr class="template-upload fade">
-					<td class="preview"><span class="fade"></span></td>
-					<td class="name">{%=file.name%}</td>
-					<td class="size">{%=o.formatFileSize(file.size)%}</td>
-					{% if (file.error) { %}
-						<td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
-					{% } else if (o.files.valid &amp;&amp; !i) { %}
-						<td class="progress"><div class="progressbar"><div style="width:0%;"></div></div></td>
-						<td class="start">{% if (!o.options.autoUpload) { %}<button class="btn primary">Start</button>{% } %}</td>
-					{% } else { %}
-						<td colspan="2"></td>
-					{% } %}
-					<td class="cancel">{% if (!i) { %}<button class="btn info">Cancel</button>{% } %}</td>
-				</tr>
-			{% } %}
-		</script>
-		<script id="template-download" type="text/html">
-			{% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
-				<tr class="template-download fade">
-					{% if (file.error) { %}
-						<td></td>
-						<td class="name">{%=file.name%}</td>
-						<td class="size">{%=o.formatFileSize(file.size)%}</td>
-						<td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
-					{% } else { %}
-						<td class="preview">{% if (file.thumbnail_url) { %}
-							<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"><img src="{%=file.thumbnail_url%}"/></a>
-						{% } %}</td>
-						<td class="name">
-							<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&amp;&amp;'gallery'%}">{%=file.name%}</a>
-						</td>
-						<td class="size">{%=o.formatFileSize(file.size)%}</td>
-						<td colspan="2"></td>
-					{% } %}
-					<td class="delete">
-						<button class="btn danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">Delete</button>
-						<input type="checkbox" name="delete" value="1"/>
-					</td>
-				</tr>
-			{% } %}
-		</script>-->
-	  
-        <!-- jQuery must be included before Annotator -->
-       <!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/jquery.js">-->
-	   <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>-->
-        <!-- If you're sure your users will only be using browsers modern
+	  --><!-- jQuery must be included before Annotator --><!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/jquery.js">--><!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>--><!-- If you're sure your users will only be using browsers modern
 					 enough to have their own JSON.parse and JSON.stringify
-					 implementations you can skip this -->
-        <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/json2.js">
-          <xsl:text> </xsl:text>
-        </script>
-        <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator-full.min.js">
-          <xsl:text> </xsl:text>
-        </script>
-        <!-- The main Annotator script -->
-        <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.js"><xsl:text> </xsl:text></script> -->
-        <!-- Annotator's styling and images -->
-        <link href="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.css" rel="stylesheet" type="text/css"/>
-        <!-- The following plugins are entirely optional -->
-        <!-- The Store plugin. Saves annotations to a remote backend -->
-        <!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.store.min.js"><xsl:text> </xsl:text></script> -->
-        <!-- The Auth plugin. Allows users of Annotator to authenticate themselves
-					 to the remote backend -->
-        <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.auth.min.js"><xsl:text> </xsl:text></script> -->
-        <!-- The Permissions plugin. See who created which annotation and create
-					 annotations as a specified user -->
-        <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.permissions.min.js"><xsl:text> </xsl:text></script> -->
-        <!-- The Tags plugin. Edit and display tag keywords on annotations -->
-        <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.tags.min.js"><xsl:text> </xsl:text></script> -->
-        <!-- The Markdown plugin. Treat annotation text as Markdown -->
-        <!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/showdown.js"><xsl:text> </xsl:text></script> -->
-        <!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.markdown.min.js"><xsl:text> </xsl:text></script> -->
-        <!-- Photo note scripts -->
-        <script src="sites/localsite/collect/peijones/js/documentmaker/BrowserDetect.js" type="text/javascript">
-          <xsl:text> </xsl:text>
-        </script>
-        <script src="sites/localsite/collect/peijones/js/documentmaker/PhotoNotes-1.5.js" type="text/javascript">
-          <xsl:text> </xsl:text>
-        </script>
-        <link href="sites/localsite/collect/peijones/style/PhotoNotes-1.5.css" rel="stylesheet" type="text/css"/>
-        <!-- Zoom scripts -->
-        <!--<script src="interfaces/{$interface_name}/js/jquery-1.4.2.js" type="text/javascript"><xsl:text> </xsl:text></script>-->
-        <script src="sites/localsite/collect/peijones/js/documentmaker/zoomer.jquery.js" type="text/javascript">
-          <xsl:text> </xsl:text>
-        </script>
-        <link href="sites/localsite/collect/peijones/style/style.css" rel="stylesheet" type="text/css"/>
-        <script type="text/javascript">
-          <xsl:text disable-output-escaping="yes">
-						_zoomEnabled = true;
+					 implementations you can skip this -->				<xsl:if test="not(/page/pageRequest/paramList/param[@name ='p.docEdit'])">
+					<script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/json2.js">
+						<xsl:text>						</xsl:text>					</script>
+					<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator-full.min.js">
+						<xsl:text>						</xsl:text>					</script>
+					<link href="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.css" rel="stylesheet" type="text/css"/>
+				</xsl:if>
+<!-- The main Annotator script --><!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.js"><xsl:text> </xsl:text></script> --><!-- Annotator's styling and images --><!-- The following plugins are entirely optional --><!-- The Store plugin. Saves annotations to a remote backend --><!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.store.min.js"><xsl:text> </xsl:text></script> --><!-- The Auth plugin. Allows users of Annotator to authenticate themselves
+					 to the remote backend --><!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.auth.min.js"><xsl:text> </xsl:text></script> --><!-- The Permissions plugin. See who created which annotation and create
+					 annotations as a specified user --><!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.permissions.min.js"><xsl:text> </xsl:text></script> --><!-- The Tags plugin. Edit and display tag keywords on annotations --><!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.tags.min.js"><xsl:text> </xsl:text></script> --><!-- The Markdown plugin. Treat annotation text as Markdown --><!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/showdown.js"><xsl:text> </xsl:text></script> --><!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.markdown.min.js"><xsl:text> </xsl:text></script> --><!-- Photo note scripts -->				<xsl:if test="not(/page/pageRequest/paramList/param[@name ='p.docEdit'])">
+					<script src="sites/localsite/collect/peijones/js/documentmaker/BrowserDetect.js" type="text/javascript">
+						<xsl:text>						</xsl:text>					</script>
+					<script src="sites/localsite/collect/peijones/js/documentmaker/PhotoNotes-1.5.js" type="text/javascript">
+						<xsl:text>						</xsl:text>					</script>
+					<link href="sites/localsite/collect/peijones/style/PhotoNotes-1.5.css" rel="stylesheet" type="text/css"/>
+				</xsl:if>
+<!-- Zoom scripts --><!--<script src="interfaces/{$interface_name}/js/jquery-1.4.2.js" type="text/javascript"><xsl:text> </xsl:text></script>-->				<script src="sites/localsite/collect/peijones/js/documentmaker/zoomer.jquery.js" type="text/javascript">
+					<xsl:text>					</xsl:text>				</script>
+				<link href="sites/localsite/collect/peijones/style/style.css" rel="stylesheet" type="text/css"/>
+				<script type="text/javascript">
+					<xsl:text disable-output-escaping="yes">_zoomEnabled = true;
 						
 						function readyImagesForZoom()      
@@ -276,10 +303,7 @@
 							}
 						}    
-					</xsl:text>
-        </script>
-        <script text="text/javascript">
-			<xsl:text disable-output-escaping="yes">
-						
-						var _posCount = 0;
+										</xsl:text>				</script>
+				<script text="text/javascript">
+					<xsl:text disable-output-escaping="yes">var _posCount = 0;
 						var _notes;
 						function initNotes()
@@ -367,7 +391,7 @@
 							var metaposStr = (note &amp;&amp; note.id &amp;&amp; note.id &gt; 0) ? note.id - 1 : _posCount;
 							
-							var saveIndexURL = "cgi-bin/metadata-server.pl?a=set-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=gsimg.photoNote&amp;metavalue=" + jsonVal + "&amp;metapos=" + metaposStr;
-							var saveArchivesURL = "cgi-bin/metadata-server.pl?a=set-archives-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=gsimg.photoNote&amp;metavalue=" + jsonVal + "&amp;metapos=" + metaposStr;
-							var saveImportURL = "cgi-bin/metadata-server.pl?a=set-import-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=gsimg.photoNote&amp;metavalue=" + jsonVal + "&amp;metapos=" + metaposStr;
+							var saveIndexURL = "cgi-bin/metadata-server.pl?a=set-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=gsimg.photoNote&amp;metamode=override&amp;metavalue=" + jsonVal + "&amp;metapos=" + metaposStr;
+							var saveArchivesURL = "cgi-bin/metadata-server.pl?a=set-archives-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=gsimg.photoNote&amp;metamode=override&amp;metavalue=" + jsonVal + "&amp;metapos=" + metaposStr;
+							var saveImportURL = "cgi-bin/metadata-server.pl?a=set-import-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=gsimg.photoNote&amp;metamode=override&amp;metavalue=" + jsonVal + "&amp;metapos=" + metaposStr;
 							YAHOO.util.Connect.asyncRequest("GET", saveIndexURL, saveIndexCallback);
 							YAHOO.util.Connect.asyncRequest("GET", saveArchivesURL, saveArchivesCallback);
@@ -443,11 +467,175 @@
 						}
 						
-						$(window).load(function(){readyImagesForZoom(); initAnnotator(); addStatusBar(); initNotes();});
-					</xsl:text>
-        </script>
-        <script text="text/javascript">
-			<xsl:text disable-output-escaping="yes">
-			
-			function checkLoop(pid, serverFunction, callback)
+						function prepopulateAnnotatorSearchBar()
+						{
+							if(gs.cgiParams.s1_query &amp;&amp; gs.cgiParams.s1_index == "GE")
+							{
+								$("#annotator-filter-text").val(gs.cgiParams.s1_query).keyup().blur(); 
+								console.log("AAA");
+							}
+							
+							if(gs.cgiParams.s1_query &amp;&amp; gs.cgiParams.s1_index == "GT")
+							{
+								$("#annotator-filter-tags").val(gs.cgiParams.s1_query).keyup().blur(); 
+								console.log("BBB");
+							}
+							
+							if(gs.cgiParams.s1_query &amp;&amp; gs.cgiParams.s1_index == "GX")
+							{
+								$("#annotator-filter-user").val(gs.cgiParams.s1_query).keyup().blur(); 
+								console.log("CCC");
+							}
+						}
+						
+						function addPrevNextPageButtons()
+						{
+							var buttonDiv = document.createElement("DIV");
+							var buttonTable = document.createElement("TABLE");
+							var buttonRow = document.createElement("TR");
+							var buttonPrevCell = document.createElement("TD");
+							var buttonNextCell = document.createElement("TD");
+							buttonRow.appendChild(buttonPrevCell);
+							buttonRow.appendChild(buttonNextCell);
+							buttonTable.appendChild(buttonRow);
+							buttonDiv.appendChild(buttonTable);
+
+							buttonDiv.setAttribute("style", "width:100%");
+							buttonTable.setAttribute("style", "margin:auto;");
+							buttonPrevCell.setAttribute("style", "padding:10px;");
+							buttonNextCell.setAttribute("style", "padding:10px;");
+
+							document.getElementById("gs-document-text").appendChild(buttonDiv);
+							
+							gs.functions.getArchivesMetadata(gs.cgiParams.c, "localsite", gs.cgiParams.d, "SourceFile", null, function(meta)
+							{
+								var sourceFilename = meta.getValue();
+								var fileNameSegments = sourceFilename.split("-");
+								var finalSegment = fileNameSegments[fileNameSegments.length-1];
+
+								var extIndex = finalSegment.indexOf(".");
+								var ext = "";
+								if(extIndex != -1)
+								{
+									ext = finalSegment.substring(extIndex);
+									finalSegment = finalSegment.substring(0, extIndex);
+								}
+								var finalNumber = parseInt(finalSegment);
+
+								var prevFilename = "";
+								var nextFilename = "";
+								for(var i = 0; i &lt; fileNameSegments.length - 1; i++)
+								{
+									prevFilename += fileNameSegments[i] + "-";
+									nextFilename += fileNameSegments[i] + "-";
+								}
+								
+								if(finalNumber - 1 >= 0)
+								{
+									var prevFinalNumber = "" + (finalNumber - 1);
+									while(prevFinalNumber.length &lt; finalSegment.length)
+									{
+										prevFinalNumber = "0" + prevFinalNumber;
+									}
+									prevFilename += prevFinalNumber + ext;
+									
+									prevButtonCallback = 
+									{
+										success:function(response)
+										{
+											var text = response.responseText;
+											var startIndex = text.indexOf("nodeID=\"");
+											if(startIndex == -1)
+											{
+												return;
+											}
+											startIndex += 8;
+											endIndex = text.indexOf("\"", startIndex + 1);
+											
+											var id = text.substring(startIndex, endIndex);
+											
+											var prevLink = document.createElement("A");
+											prevLink.innerHTML = "Previous Page";
+											prevLink.setAttribute("href", gs.xsltParams.library_name + "?a=d&amp;d=" + id + "&amp;c=" + gs.cgiParams.c + "&amp;dt=hierarchy&amp;ed=1");
+											buttonPrevCell.appendChild(prevLink);
+										},
+										failed:function(response){console.log("Search for previous document failed");}
+									}
+									YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=q&amp;sa=&amp;rt=rd&amp;s=TextQuery&amp;c=peijones&amp;startPage=1&amp;s1.query=" + prevFilename.replace(/-/g, " ") + "&amp;s1.index=SO&amp;o=xml", prevButtonCallback);
+								}
+								
+								var nextFinalNumber = "" + (finalNumber + 1);
+								while(nextFinalNumber.length &lt; finalSegment.length)
+								{
+									nextFinalNumber = "0" + nextFinalNumber;
+								}
+								nextFilename += nextFinalNumber + ext;
+								
+								nextButtonCallback = 
+								{
+									success:function(response)
+									{
+										var text = response.responseText;
+										var startIndex = text.indexOf("nodeID=\"");
+										if(startIndex == -1)
+										{
+											return;
+										}
+										startIndex += 8;
+										endIndex = text.indexOf("\"", startIndex + 1);
+										
+										var id = text.substring(startIndex, endIndex);
+										
+										var nextLink = document.createElement("A");
+										nextLink.innerHTML = "Next Page";
+										nextLink.setAttribute("href", gs.xsltParams.library_name + "?a=d&amp;d=" + id + "&amp;c=" + gs.cgiParams.c + "&amp;dt=hierarchy&amp;ed=1");
+										buttonNextCell.appendChild(nextLink);
+									},
+									failed:function(response){console.log("Search for next document failed");}
+								}
+								
+								YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=q&amp;sa=&amp;rt=rd&amp;s=TextQuery&amp;c=peijones&amp;startPage=1&amp;s1.query=" + nextFilename.replace(/-/g, " ") + "&amp;s1.index=SO&amp;o=xml", nextButtonCallback);
+							});
+						}
+						
+						function addSocialLinks()
+						{
+							var socialLinksDiv = document.createElement("DIV");
+							socialLinksDiv.setAttribute("class", "addthis_toolbox addthis_default_style");
+							
+							var facebookLink = document.createElement("A");
+							facebookLink.setAttribute("class", "addthis_button_facebook_like");
+							facebookLink.setAttribute("fb:like:layout", "button_count");
+							socialLinksDiv.appendChild(facebookLink);
+							
+							var twitterLink = document.createElement("A");
+							twitterLink.setAttribute("class", "addthis_button_tweet");
+							socialLinksDiv.appendChild(twitterLink);
+							
+							var gplusLink = document.createElement("A");
+							gplusLink.setAttribute("class", "addthis_button_google_plusone");
+							gplusLink.setAttribute("g:plusone:size", "medium");
+							socialLinksDiv.appendChild(gplusLink);
+							
+							var addThisLink = document.createElement("A");
+							addThisLink.setAttribute("class", "addthis_counter addthis_pill_style");
+							socialLinksDiv.appendChild(addThisLink);
+							
+							var script = document.createElement("SCRIPT");
+							script.setAttribute("type", "text/javascript");
+							script.setAttribute("src", "http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f5fe0cf41940d54");
+							socialLinksDiv.appendChild(script);
+
+							document.getElementById("gs-document-text").appendChild(socialLinksDiv);
+						}
+
+						</xsl:text>
+						<xsl:if test="not(/page/pageRequest/paramList/param[@name ='p.docEdit'])">
+							<xsl:text disable-output-escaping="yes">
+								$(window).load(function(){readyImagesForZoom(); initAnnotator(); addStatusBar(); initNotes(); addPrevNextPageButtons(); addSocialLinks(); });
+							</xsl:text>
+						</xsl:if>
+				</script>
+				<script text="text/javascript">
+					<xsl:text disable-output-escaping="yes">function checkLoop(pid, serverFunction, callback)
 			{
 				var startLoop = function()
@@ -708,14 +896,14 @@
 				{
 					// Include AnnotateIt credentials to load the store plugin.
-				//	$('#gs-document-text').annotator().annotator('setupPlugins', {
-					//	userId:    'papitha',
-					//	userName:  'Papitha',
-					//	accountId: '39fc339cf058bd22176771b3e33c5dac',
-					//	authToken: '852b7fc25396d2aedf9aeb44dd58518faa679dbf027892164bfb81900bd09741',	
-					 $('#gs-document-text').annotator().annotator('setupPlugins', {
-						userId:    'david',
-						userName:  'David',
-						accountId: 'eb096fae65f6377160ffc0eb6c000951',
-						authToken: '92b3279a6b6edbaa2ed7bc4d895ef55c8f1368877bb69987985aa47195d517e7',	
+					$('#gs-document-text').annotator().annotator('setupPlugins', {
+						userId:    'papitha',
+						userName:  'Papitha',
+						accountId: '39fc339cf058bd22176771b3e33c5dac',
+						authToken: '852b7fc25396d2aedf9aeb44dd58518faa679dbf027892164bfb81900bd09741',	
+					// $('#gs-document-text').annotator().annotator('setupPlugins', {
+					//	userId:    'david',
+					//	userName:  'David',
+					//	accountId: 'eb096fae65f6377160ffc0eb6c000951',
+					//	authToken: '92b3279a6b6edbaa2ed7bc4d895ef55c8f1368877bb69987985aa47195d517e7',	
 					}, {
 						Store: 
@@ -728,108 +916,92 @@
 				}
 			}
-		</xsl:text>
-        </script>
-	</xsl:template>
-	<xsl:template name="documentImage">
-        <!-- Get the photo notes for this document node -->
-        <gsf:variable-struct name="photoNotes">
-			<gsf:metadata multiple="true" name="gsimg.photoNote" separator=", "/>
-        </gsf:variable-struct>
-        <!-- Get details about the image for zooming -->
-        <h3>
-			<gsf:choose-metadata>
-				<gsf:metadata name="dc.Title"/>
-				<gsf:metadata name="ex.Title"/>
-			</gsf:choose-metadata>
-        </h3>
-        <xsl:variable name="imageWidth">
-			<gsf:choose-metadata>
-				<gsf:metadata name="ImageWidth"/>
-				<gsf:default>-1</gsf:default>
-			</gsf:choose-metadata>
-        </xsl:variable>
-        <xsl:variable name="imageHeight">
-			<gsf:choose-metadata>
-				<gsf:metadata name="ImageHeight"/>
-				<gsf:default>-1</gsf:default>
-			</gsf:choose-metadata>
-        </xsl:variable>
-        <xsl:variable name="screenImageWidth">
-			<gsf:choose-metadata>
-				<gsf:metadata name="ScreenWidth"/>
-				<gsf:default>-1</gsf:default>
-			</gsf:choose-metadata>
-        </xsl:variable>
-        <xsl:variable name="screenImageHeight">
-			<gsf:choose-metadata>
-				<gsf:metadata name="ScreenHeight"/>
-				<gsf:default>-1</gsf:default>
-			</gsf:choose-metadata>
-        </xsl:variable>
-        <script type="text/javascript">
-			<xsl:text>largeImageHeight =</xsl:text>
-			<xsl:value-of select="$imageHeight"/>
-			<xsl:text>;</xsl:text>
-			<xsl:text>largeImageWidth =</xsl:text>
-			<xsl:value-of select="$imageWidth"/>
-			<xsl:text>;</xsl:text>
-			<xsl:text>smallImageHeight =</xsl:text>
-			<xsl:value-of select="$screenImageHeight"/>
-			<xsl:text>;</xsl:text>
-			<xsl:text>smallImageWidth =</xsl:text>
-			<xsl:value-of select="$screenImageWidth"/>
-			<xsl:text>;</xsl:text>
-        </script>
-		<span class="ui-state-default ui-corner-top" onclick="AddNote();" style="font-size:90%; padding: 3px; cursor:pointer;">New photo annotation</span>
-        <div id="noZoom" style="display:block;">
-			<img id="noZoomImage" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
-				<xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="Screen"/></xsl:attribute>
-			</img>
-			<!--		
+							</xsl:text>				</script>
+			</xsl:template>
+			<xsl:template name="documentImage">
+<!-- Get the photo notes for this document node -->				<gsf:variable-struct name="photoNotes">
+					<gsf:metadata multiple="true" name="gsimg.photoNote" separator=", "/>
+				</gsf:variable-struct>
+<!-- Get details about the image for zooming -->				<h3>
+					<gsf:choose-metadata>
+						<gsf:metadata name="dc.Title"/>
+						<gsf:metadata name="ex.Title"/>
+					</gsf:choose-metadata>
+				</h3>
+				<xsl:variable name="imageWidth">
+					<gsf:choose-metadata>
+						<gsf:metadata name="ImageWidth"/>
+						<gsf:default>-1</gsf:default>
+					</gsf:choose-metadata>
+				</xsl:variable>
+				<xsl:variable name="imageHeight">
+					<gsf:choose-metadata>
+						<gsf:metadata name="ImageHeight"/>
+						<gsf:default>-1</gsf:default>
+					</gsf:choose-metadata>
+				</xsl:variable>
+				<xsl:variable name="screenImageWidth">
+					<gsf:choose-metadata>
+						<gsf:metadata name="ScreenWidth"/>
+						<gsf:default>-1</gsf:default>
+					</gsf:choose-metadata>
+				</xsl:variable>
+				<xsl:variable name="screenImageHeight">
+					<gsf:choose-metadata>
+						<gsf:metadata name="ScreenHeight"/>
+						<gsf:default>-1</gsf:default>
+					</gsf:choose-metadata>
+				</xsl:variable>
+				<script type="text/javascript">
+					<xsl:text>largeImageHeight =					</xsl:text>					<xsl:value-of select="$imageHeight"/>
+					<xsl:text>;</xsl:text>
+					<xsl:text>largeImageWidth =					</xsl:text>					<xsl:value-of select="$imageWidth"/>
+					<xsl:text>;</xsl:text>
+					<xsl:text>smallImageHeight =					</xsl:text>					<xsl:value-of select="$screenImageHeight"/>
+					<xsl:text>;</xsl:text>
+					<xsl:text>smallImageWidth =					</xsl:text>					<xsl:value-of select="$screenImageWidth"/>
+					<xsl:text>;</xsl:text>
+				</script>
+				<span class="ui-state-default ui-corner-top" onclick="AddNote();" style="font-size:90%; padding: 3px; cursor:pointer;">New Image Annotation				</span>				<div id="noZoom" style="display:block;">
+					<img id="noZoomImage" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
+						<xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="Screen"/></xsl:attribute>
+					</img>
+<!--		
 			<gsf:metadata name="screenicon"/>
-			-->
-        </div>
-        <!--<xsl:if test="$imageHeight != -1">-->
-        <div id="wrap" style="display:none; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
-			<div id="small" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
-				<!--
+			-->				</div>
+<!--<xsl:if test="$imageHeight != -1">-->				<div id="wrap" style="display:none; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
+					<div id="small" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
+<!--
 				<gsf:metadata name="screenicon"/>
-				-->
-				<img id="smallImage" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
-					<xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="Screen"/></xsl:attribute>
-				</img>
-			</div>
-			<div id="mover">
-				<div id="overlay">
-					<xsl:text> </xsl:text>
+				-->						<img id="smallImage" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
+							<xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="Screen"/></xsl:attribute>
+						</img>
+					</div>
+					<div id="mover">
+						<div id="overlay">
+							<xsl:text>							</xsl:text>						</div>
+						<div id="large" style="width: {$imageWidth}px; height: {$imageHeight}px;">
+							<img id="largeImage" style="width: {$imageWidth}px; height: {$imageHeight}px;">
+								<xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="srclinkFile"/></xsl:attribute>
+							</img>
+						</div>
+					</div>
 				</div>
-				<div id="large" style="width: {$imageWidth}px; height: {$imageHeight}px;">
-					<img id="largeImage" style="width: {$imageWidth}px; height: {$imageHeight}px;">
-						<xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="srclinkFile"/></xsl:attribute>
-					</img>
+				<div class="btn btn-primary start" style="margin-bottom:5px;">
+					<a style="color:white;">
+						<xsl:attribute name="href">
+							<xsl:value-of select="$library_name"/>
+							<xsl:text>?downloadFile=</xsl:text>
+							<xsl:text>sites/localsite/collect/</xsl:text>
+							<xsl:value-of select="/page/pageResponse/collection/@name"/>
+							<xsl:text>/index/assoc/</xsl:text>
+							<gsf:metadata name="assocfilepath"/>
+							<xsl:text>/</xsl:text>
+							<gsf:metadata name="SourceFile"/>
+						</xsl:attribute>
+						<xsl:text>Download Image						</xsl:text>					</a>
 				</div>
-			</div>
-        </div>		
-			
-		<div class="btn btn-primary start" style="margin-bottom:5px;">
-			<a style="color:white;">
-				<xsl:attribute name="href">
-					<xsl:value-of select="$library_name"/>
-					<xsl:text>?downloadFile=</xsl:text>
-					<xsl:text>sites/localsite/collect/</xsl:text>
-					<xsl:value-of select="/page/pageResponse/collection/@name"/>
-					<xsl:text>/index/assoc/</xsl:text>
-					<gsf:metadata name="assocfilepath"/>
-					<xsl:text>/</xsl:text>
-					<gsf:metadata name="SourceFile"/>
-				</xsl:attribute>
-				<xsl:text>Download Image</xsl:text>
-			</a>
-		</div>
-
-		<xsl:choose>
-			<xsl:when test="/page/pageRequest/paramList/param[@name = 'p.oldUpload']/@value = 'true'">
-				<form action="dev?a=d&amp;c={/page/pageResponse/collection/@name}&amp;d={/page/pageResponse/document/documentNode/@nodeID}&amp;dt=simple&amp;ed=1" enctype="multipart/form-data" method="post">
-					<input name="fl" type="hidden">
+				<xsl:choose>
+					<xsl:when test="/page/pageRequest/paramList/param[@name = 'p.oldUpload']/@value = 'true'"><!--	<form action="dev?a=d&c={/page/pageResponse/collection/@name}&d={/page/pageResponse/document/documentNode/@nodeID}&dt=simple&ed=1" enctype="multipart/form-data" method="post">
+     			<input name="fl" type="hidden">
 						<xsl:attribute name="value">
 							<xsl:text>/sites/localsite/collect/</xsl:text>
@@ -861,27 +1033,25 @@
 						<input type="submit" value="Send"/>	
 					</div>
-				</form>
-			</xsl:when>
-			<xsl:otherwise>
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/tmpl.min.js"><xsl:text> </xsl:text></script>
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/load-image.min.js"><xsl:text> </xsl:text></script>
-
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.iframe-transport.js"><xsl:text> </xsl:text></script>
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload.js"><xsl:text> </xsl:text></script>
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.js"><xsl:text> </xsl:text></script>
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/application.js"><xsl:text> </xsl:text></script>
-
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap.min.js"><xsl:text> </xsl:text></script>
-				<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap-image-gallery.min.js"><xsl:text> </xsl:text></script>
-
-				<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.css" rel="stylesheet"/>
-				<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap.min.css" rel="stylesheet"/>
-				<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap-responsive.min.css" rel="stylesheet"/>
-				<!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]-->
-				<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/cors/bootstrap-image-gallery.min.css" rel="stylesheet"/>
-
-				<script type="text/javascript">
-					<xsl:text disable-output-escaping="yes">
-						$(window).load(function()
+				</form>-->					</xsl:when>					<xsl:otherwise>
+						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/tmpl.min.js">
+							<xsl:text>							</xsl:text>						</script>
+						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/load-image.min.js">
+							<xsl:text>							</xsl:text>						</script>
+						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.iframe-transport.js">
+							<xsl:text>							</xsl:text>						</script>
+						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload.js">
+							<xsl:text>							</xsl:text>						</script>
+						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.js">
+							<xsl:text>							</xsl:text>						</script>
+<!--<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/application.js"><xsl:text> </xsl:text></script>-->						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap.min.js">
+							<xsl:text>							</xsl:text>						</script>
+						<script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap-image-gallery.min.js">
+							<xsl:text>							</xsl:text>						</script>
+						<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.css" rel="stylesheet"/>
+						<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap.min.css" rel="stylesheet"/>
+						<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/bootstrap-responsive.min.css" rel="stylesheet"/>
+<!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]-->						<link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/cors/bootstrap-image-gallery.min.css" rel="stylesheet"/>
+						<script type="text/javascript">
+							<xsl:text disable-output-escaping="yes">$(window).load(function()
 						{
 							$('#fileupload').fileupload();
@@ -900,10 +1070,7 @@
 							});
 						});
-					</xsl:text>
-				</script>
-				
-				<script id="template-upload" type="text/html">
-				<xsl:text disable-output-escaping="yes">
-									   {% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
+												</xsl:text>						</script>
+						<script id="template-upload" type="text/html">
+							<xsl:text disable-output-escaping="yes">{% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
 				&lt;tr class="template-upload fade"&gt;
 				&lt;td class="preview"&gt;&lt;span class="fade"&gt;&lt;/span&gt;&lt;/td&gt;
@@ -931,10 +1098,7 @@
 				&lt;/tr&gt;
 									   {% } %}
-				</xsl:text>
-				</script>
-
-				<script id="template-download" type="text/html">
-				<xsl:text disable-output-escaping="yes">
-									   {% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
+											</xsl:text>						</script>
+						<script id="template-download" type="text/html">
+							<xsl:text disable-output-escaping="yes">{% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
 				&lt;tr class="template-download fade"&gt;
 											   {% if (file.error) { %}
@@ -955,73 +1119,92 @@
 				&lt;/tr&gt;
 									   {% } %}
-				</xsl:text>
-				</script>
-
-				<form action="dev" enctype="multipart/form-data" id="fileupload" method="POST">
-					<input name="ajaxUpload" type="hidden" value="true"/>
-					<input name="fl" type="hidden">
-						<xsl:attribute name="value">
-							<xsl:text>/sites/localsite/collect/</xsl:text>
-							<xsl:value-of select="/page/pageResponse/collection/@name"/>
-							<xsl:text>/index/assoc/</xsl:text>
-							<gsf:metadata name="assocfilepath"/>
-							<xsl:text>/</xsl:text>
-							<gsf:metadata name="SourceFile"/>
-							<xsl:text>:</xsl:text>
-							<xsl:text>/sites/localsite/collect/</xsl:text>
-							<xsl:value-of select="/page/pageResponse/collection/@name"/>
-							<xsl:text>/index/assoc/</xsl:text>
-							<gsf:metadata name="assocfilepath"/>
-							<xsl:text>/</xsl:text>
-							<gsf:metadata name="Screen"/>
-							<xsl:text>:</xsl:text>
-							<xsl:text>/sites/localsite/collect/</xsl:text>
-							<xsl:value-of select="/page/pageResponse/collection/@name"/>
-							<xsl:text>/index/assoc/</xsl:text>
-							<gsf:metadata name="assocfilepath"/>
-							<xsl:text>/</xsl:text>
-							<gsf:metadata name="Thumb"/>
-						</xsl:attribute>
-					</input>
-					<div class="row fileupload-buttonbar">
-						<div class="span6" style="margin-left:30px;">
-							<span class="btn btn-success fileinput-button">
-								<span><i class="icon-plus icon-white"><xsl:text> </xsl:text></i> Add files...</span>
-								<input multiple="" name="files[]" type="file"/>
-							</span>
-							<button class="btn btn-primary start" type="submit">
-								<i class="icon-upload icon-white"><xsl:text> </xsl:text></i> Start upload
-							</button>
-							<button class="btn btn-warning cancel" type="reset">
-								<i class="icon-ban-circle icon-white"><xsl:text> </xsl:text></i> Cancel upload
-							</button>
-						</div>
-						<div class="span6">
-							<div class="progress progress-success progress-striped active fade">
-								<div class="bar" style="width:0%;"><xsl:text> </xsl:text></div>
+											</xsl:text>						</script>
+						<form action="dev" enctype="multipart/form-data" id="fileupload" method="POST">
+							<input name="ajaxUpload" type="hidden" value="true"/>
+							<input name="fl" type="hidden">
+								<xsl:attribute name="value">
+									<xsl:text>/sites/localsite/collect/</xsl:text>
+									<xsl:value-of select="/page/pageResponse/collection/@name"/>
+									<xsl:text>/index/assoc/</xsl:text>
+									<gsf:metadata name="assocfilepath"/>
+									<xsl:text>/</xsl:text>
+									<gsf:metadata name="SourceFile"/>
+									<xsl:text>:</xsl:text>
+									<xsl:text>/sites/localsite/collect/</xsl:text>
+									<xsl:value-of select="/page/pageResponse/collection/@name"/>
+									<xsl:text>/index/assoc/</xsl:text>
+									<gsf:metadata name="assocfilepath"/>
+									<xsl:text>/</xsl:text>
+									<gsf:metadata name="Screen"/>
+									<xsl:text>:</xsl:text>
+									<xsl:text>/sites/localsite/collect/</xsl:text>
+									<xsl:value-of select="/page/pageResponse/collection/@name"/>
+									<xsl:text>/index/assoc/</xsl:text>
+									<gsf:metadata name="assocfilepath"/>
+									<xsl:text>/</xsl:text>
+									<gsf:metadata name="Thumb"/>
+								</xsl:attribute>
+							</input>
+							<div class="row fileupload-buttonbar">
+								<div class="span6" style="margin-left:30px;">
+									<span class="btn btn-success fileinput-button">
+										<span>
+											<i class="icon-plus icon-white">
+												<xsl:text>												</xsl:text>											</i>
+Add files...										</span>
+										<input multiple="" name="files[]" type="file"/>
+									</span>
+									<button class="btn btn-primary start" type="submit">
+										<i class="icon-upload icon-white">
+											<xsl:text>											</xsl:text>										</i>
+Start upload
+																</button>
+									<button class="btn btn-warning cancel" type="reset">
+										<i class="icon-ban-circle icon-white">
+											<xsl:text>											</xsl:text>										</i>
+Cancel upload
+																</button>
+								</div>
+								<div class="span6">
+									<div class="progress progress-success progress-striped active fade">
+										<div class="bar" style="width:0%;">
+											<xsl:text>											</xsl:text>										</div>
+									</div>
+								</div>
 							</div>
-						</div>
-					</div>
-					<br/>
-					<table class="table table-striped"><tbody class="files" data-target="#modal-gallery" data-toggle="modal-gallery"><xsl:text> </xsl:text></tbody></table>
-				</form>
-			</xsl:otherwise>
-		</xsl:choose>
-        <!--</xsl:if>-->
-      </xsl:template>
-    </format></display><replaceListRef id="gs2-standard"/><replaceListRef id="gs2-image"/><serviceRackList>
+							<br/>
+							<table class="table table-striped">
+								<tbody class="files" data-target="#modal-gallery" data-toggle="modal-gallery">
+									<xsl:text>									</xsl:text>								</tbody>
+							</table>
+						</form>
+					</xsl:otherwise>
+				</xsl:choose>
+<!--</xsl:if>-->			</xsl:template>
+		</format>
+	</display>
+	<replaceListRef id="gs2-standard"/>
+	<replaceListRef id="gs2-image"/>
+	<serviceRackList>
     <!-- comment out the following serviceRack if you want to disable OAI for this collection -->
-    <serviceRack name="OAIPMH">
-      <ListMetadataFormats>
+    
+		<serviceRack name="OAIPMH">
+      
+			<ListMetadataFormats>
         <!--What metadata sets to support is collection specific. To support other metadata schema, simply add a metadataFormat element here.
 	The support of unqualified Dublin Core metadata set is mandatory in the oai specification.
 	-->
-        <metadataFormat metadataPrefix="oai_dc">
-          <metadataPrefix>oai_dc</metadataPrefix>
-          <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>
-          <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace>
+        
+				<metadataFormat metadataPrefix="oai_dc">
+          
+					<metadataPrefix>oai_dc</metadataPrefix>
+          
+					<schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>
+          
+					<metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace>
           <!--<metadataElements>dc.Title,dc.Creator,dc.Subject,dc.Description,dc.Publisher,dc.Contributor,dc.Date,dc.Type,dc.Format,dc.Identifier,dc.Source,dc.Language,dc.Relation,dc.Coverage,dc.Rights</metadataElements>              
 	  -->
-          <mappingList>
+          
+					<mappingList>
             <!-- 
 	    The mapping is in the form: <publicly supported metadata name>,<mapped metadata name>, short as <A>,<B> 
@@ -1035,9 +1218,16 @@
 	    **The only case when this mapping is not present is that: 1. this metadata format is oai_dc; 2. the metadata is also stored in the database by Dublin Core's names.
 	    -->
-            <mapping>dc.Title,Title</mapping>
+            
+						<mapping>dc.Title,Title</mapping>
             <!-- This mapping example means that the dc.Title is requested and the value of the metadata Title, which is used in this repository, is returned as response. -->
-          </mappingList>
-        </metadataFormat>
-      </ListMetadataFormats>
-    </serviceRack>
-  </serviceRackList></CollectionConfig>
+          
+					</mappingList>
+        
+				</metadataFormat>
+      
+			</ListMetadataFormats>
+    
+		</serviceRack>
+  
+	</serviceRackList>
+</CollectionConfig>
