Index: /main/trunk/model-cols-dev/peijones/etc/collectionConfig.xml
===================================================================
--- /main/trunk/model-cols-dev/peijones/etc/collectionConfig.xml	(revision 25067)
+++ /main/trunk/model-cols-dev/peijones/etc/collectionConfig.xml	(revision 25068)
@@ -34,4 +34,5 @@
         </td>
         <td valign="top">
+		<gsf:link type="document">
           <gsf:choose-metadata>
             <gsf:metadata name="dc.Title"/>
@@ -40,4 +41,5 @@
             <gsf:default>Untitled</gsf:default>
           </gsf:choose-metadata>
+		  </gsf:link>
           <gsf:switch>
             <gsf:metadata name="Source"/>
@@ -87,8 +89,76 @@
       <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="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.css"/>
+		
+		<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/jquery.iframe-transport.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="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"><xsl:text> </xsl:text></script>
+		<script src="http://blueimp.github.com/JavaScript-Load-Image/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">
-          <xsl:text> </xsl:text>
-        </script>
+       <!-- <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
@@ -135,7 +205,8 @@
           <xsl:text disable-output-escaping="yes">
 						_zoomEnabled = true;
+						
 						function readyImagesForZoom()      
 						{ 
-							var noZoom = document.getElementById("noZoom");
+							var noZoom = document.getElementById("noZoomImage");
 							var wrap = document.getElementById("wrap");
 							if(!noZoom || !wrap)
@@ -143,4 +214,5 @@
 								return;
 							}
+							
 							var smallImageDiv = document.getElementById("small");
 							var smallImage = smallImageDiv.getElementsByTagName("img")[0];
@@ -148,12 +220,13 @@
 							smallImageDiv.style.height = smallImageHeight + "px";
 							var multiplier = largeImageHeight / smallImageHeight;
+
 							$("#wrap").anythingZoomer({        
 								expansionSize:50,  
 								speedMultiplier:multiplier   
 							});   	
-
-							noZoom.onclick = function(){addZoom();}
-							document.getElementById("overlay").onclick = function(){removeZoom();}							
-							
+							
+							noZoom.onclick = addZoom;
+							document.getElementById("overlay").onclick = removeZoom;							
+
 							removeZoom();
 						}            
@@ -332,5 +405,6 @@
 						function AddNote()
 						{
-							var newNote = new PhotoNote('Add note text here...',_posCount+1,new PhotoNoteRect(10,10,50,50));
+							var photoPos = $("#noZoom").offset();
+							var newNote = new PhotoNote('Add note text here...',_posCount+1,new PhotoNoteRect(20,20,50,50));
 							newNote.onsave = saveFunction;
 							newNote.ondelete = deleteFunction;
@@ -355,5 +429,20 @@
 						}
 						
-						window.onload = function(){initNotes(); readyImagesForZoom(); initAnnotator();};
+						function addStatusBar()
+						{
+							var textDiv = document.getElementById("gs-document");
+							var buildStatusBar = document.createElement("div");
+							buildStatusBar.setAttribute("id", "buildStatusBar");
+							buildStatusBar.setAttribute("class", "ui-state-default ui-corner-all");
+							buildStatusBar.setAttribute("style", "visibility:hidden; width:100%");
+							var buildingMessage = document.createElement("div");
+							buildingMessage.setAttribute("id", "buildMessage");
+							buildingMessage.setAttribute("style", "width:50%; padding:3px; margin:5px auto; text-align:center;");
+							buildStatusBar.appendChild(buildingMessage);
+
+							textDiv.insertBefore(buildStatusBar, textDiv.firstChild);
+						}
+						
+						$(window).load(function(){readyImagesForZoom(); initAnnotator(); addStatusBar(); initNotes();});
 					</xsl:text>
         </script>
@@ -442,6 +531,6 @@
 												var updateCallback = 
 												{
-													success: function(response){},
-													failed: function(reponse){ alert("Failed in saveFunction() to re-read config files");}
+													success: function(response){document.getElementById("buildStatusBar").style.visibility = "hidden";},
+													failed: function(reponse){ alert("Failed in saveFunction() to re-read config files"); document.getElementById("buildStatusBar").style.visibility = "hidden";}
 												};
 												YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=s&amp;sa=c", updateCallback);
@@ -451,4 +540,5 @@
 									failed: function(response)
 									{
+										document.getElementById("buildStatusBar").style.visibility = "hidden";
 										console.log("Failed to get response from activate collection request");
 									}
@@ -458,8 +548,9 @@
 						}
 					},
-					failed: function(){console.log("Failed to get build collection response")}
+					failed: function(){console.log("Failed to get build collection response"); document.getElementById("buildStatusBar").style.visibility = "hidden";}
 				}
 				
 				YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&amp;rt=r&amp;ro=1&amp;s=BuildCollection&amp;s1.collection=" + collection, buildCallback);
+				showBuildingMessage();
 			}
 			
@@ -521,5 +612,5 @@
 				gs.toDeleteArray.keys = new Array();
 				
-				if(gs.annotationArray.keys.length > 0)
+				if(gs.annotationArray.keys.length &gt; 0)
 				{
 					var json = "[";
@@ -578,4 +669,25 @@
 				gs.annotationArray.keys = new Array();
 			}
+			
+			function showRebuildOption()
+			{
+				var buildStatusBar = document.getElementById("buildStatusBar");
+				buildStatusBar.style.visibility = "visible";
+				
+				var buildMessage = document.getElementById("buildMessage");
+				buildMessage.innerHTML = 'Please rebuild to index annotations (make annotations searchable): &lt;span id="rebuildButton" style="cursor:pointer; padding:2px;" class="ui-state-default ui-corner-all"&gt;Rebuild&lt;/span&gt;';
+				
+				var rebuildButton = document.getElementById("rebuildButton");
+				rebuildButton.onclick = function(){saveAndBuildCollection("peijones");}
+			}
+			
+			function showBuildingMessage()
+			{
+				var buildStatusBar = document.getElementById("buildStatusBar");
+				buildStatusBar.style.visibility = "visible";
+				
+				var buildMessage = document.getElementById("buildMessage");
+				buildMessage.innerHTML = '&lt;img src="' + gs.imageURLs.loading + '"/&gt; Building...';
+			}
 					
 			function initAnnotator()
@@ -588,31 +700,32 @@
 				
 				var elem = document.getElementById("gs-document-text");
-				elem.innerHTML = '&lt;button id="saveButton"&gt;Save annotations&lt;/button&gt;&lt;br/&gt;' + elem.innerHTML;
+				elem.innerHTML = '&lt;div&gt;&lt;span style="visibility:hidden; padding: 3px;" class="ui-state-default ui-corner-all" id="saveButton"&gt;Reindex annotations&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;' + elem.innerHTML;
 				
-				var button = document.getElementById("saveButton");
-				button.onclick = function(){saveAndBuildCollection(gs.cgiParams.c);};
-				
-				jQuery(function ($) {
-					if (typeof $.fn.annotator !== 'function') {
-						alert("Ooops! it looks like you haven't built the Annotator concatenation file. " + "Either download a tagged release from GitHub, or modify the Cakefile to point " + "at your copy of the YUI compressor and run `cake package`.");
-					} else {
-						jQuery(function ($) {
-							// Include AnnotateIt credentials to load the store plugin.
-							$('#gs-document-text').annotator().annotator('setupPlugins', {
-								userId:    'papitha',
-								userName:  'Papitha',
-								accountId: '39fc339cf058bd22176771b3e33c5dac',
-								authToken: '852b7fc25396d2aedf9aeb44dd58518faa679dbf027892164bfb81900bd09741',	
-							}, {
-								Store: 
-								{
-									prefix: 'http://localhost:5000',
-									annotationData: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d},
-									loadFromSearch: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d}
-								}
-							});
-						});
-					}
-				});
+				if (typeof $.fn.annotator !== 'function') 
+				{
+					alert("Ooops! it looks like you haven't built the Annotator concatenation file. " + "Either download a tagged release from GitHub, or modify the Cakefile to point " + "at your copy of the YUI compressor and run `cake package`.");
+				} 
+				else 
+				{
+					// 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',	
+					}, {
+						Store: 
+						{
+							prefix: 'http://localhost:5000',
+							annotationData: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d},
+							loadFromSearch: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d}
+						}
+					});
+				}
 			}
 		</xsl:text>
@@ -669,6 +782,7 @@
 			<xsl:text>;</xsl:text>
         </script>
+		<span style="font-size:90%; padding: 3px; cursor:pointer;" class="ui-state-default ui-corner-top" onclick="AddNote();">New photo annotation</span>
         <div id="noZoom" style="display:block;">
-			<img style="width: {$screenImageWidth}; height: {$screenImageHeight};">
+			<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>
@@ -678,10 +792,10 @@
         </div>
         <!--<xsl:if test="$imageHeight != -1">-->
-        <div id="wrap" style="display:none; width: {$screenImageWidth}; height: {$screenImageHeight};">
-			<div id="small" style="width: {$screenImageWidth}; height: {$screenImageHeight};">
+        <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 style="width: {$screenImageWidth}; height: {$screenImageHeight};">
+				<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>
@@ -691,17 +805,18 @@
 					<xsl:text> </xsl:text>
 				</div>
-				<div id="large">
-					<img style="width: {$imageWidth}; height: {$imageHeight};">
+				<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>
-        <input onclick="AddNote();" style="margin-left:30px;" type="button" value="Tag Photo!"/>	
-		
-		<form action="dev" enctype="multipart/form-data" method="post">
-			<input type="hidden" name="fl">
-				<xsl:attribute name="value">
-					<xsl:text>/sites/localsite/collect/</xsl:text>
+        </div>		
+			
+		<div>
+			<a style="text-decoration:underline;">
+				<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>
@@ -709,28 +824,189 @@
 					<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>
-				Upload replacement file:<br/>
-				<input type="file" name="datafile" size="40"/><br/>
-				<input type="submit" value="Send"/>	
-			</div>
-		</form>
-
+				<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: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>
+						Upload replacement file:<br/>
+						<input name="datafile" size="40" type="file"/><br/>
+						<input type="submit" value="Send"/>	
+					</div>
+				</form>
+			</xsl:when>
+			<xsl:otherwise>
+				<script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"><xsl:text> </xsl:text></script>
+				<script src="http://blueimp.github.com/JavaScript-Load-Image/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="http://blueimp.github.com/cdn/js/bootstrap.min.js"><xsl:text> </xsl:text></script>
+				<script src="http://blueimp.github.com/Bootstrap-Image-Gallery/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="http://blueimp.github.com/cdn/css/bootstrap.min.css" rel="stylesheet"/>
+				<link href="http://blueimp.github.com/cdn/css/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="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css" rel="stylesheet"/>
+
+				<script type="text/javascript">
+					<xsl:text disable-output-escaping="yes">
+						$(window).load(function()
+						{
+							$('#fileupload').fileupload();
+							$('#fileupload').bind('fileuploaddone', function (e, data) 
+							{
+								var nzImg = document.getElementById("noZoomImage");
+								nzImg.setAttribute("src", nzImg.getAttribute("src") + "?" + (new Date()).getTime());
+								
+								var smallImg = document.getElementById("smallImage");
+								smallImg.setAttribute("src", smallImg.getAttribute("src") + "?" + (new Date()).getTime());
+								
+								var largeImg = document.getElementById("largeImage");
+								largeImg.setAttribute("src", largeImg.getAttribute("src") + "?" + (new Date()).getTime());
+								
+								readyImagesForZoom();
+							});
+						});
+					</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;
+				&lt;td class="name"&gt;{%=file.name%}&lt;/td&gt;
+				&lt;td class="size"&gt;{%=o.formatFileSize(file.size)%}&lt;/td&gt;
+											   {% if (file.error) { %}
+				&lt;td class="error" colspan="2"&gt;&lt;span class="label label-important"&gt;Error&lt;/span&gt; {%=fileUploadErrors[file.error] || file.error%}&lt;/td&gt;
+											   {% } else if (o.files.valid &amp;&amp; !i) { %}
+				&lt;td&gt;
+				&lt;div class="progress progress-success progress-striped active"&gt;&lt;div class="bar" style="width:0%;"&gt;&lt;/div&gt;&lt;/div&gt;
+				&lt;/td&gt;
+				&lt;td class="start"&gt;{% if (!o.options.autoUpload) { %}
+				&lt;button class="btn btn-primary"&gt;
+				&lt;i class="icon-upload icon-white"&gt;&lt;/i&gt; Start
+				&lt;/button&gt;
+												   {% } %}&lt;/td&gt;
+											   {% } else { %}
+				&lt;td colspan="2"&gt;&lt;/td&gt;
+											   {% } %}
+				&lt;td class="cancel"&gt;{% if (!i) { %}
+				&lt;button class="btn btn-warning"&gt;
+				&lt;i class="icon-ban-circle icon-white"&gt;&lt;/i&gt; Cancel
+				&lt;/button&gt;
+											   {% } %}&lt;/td&gt;
+				&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]) { %}
+				&lt;tr class="template-download fade"&gt;
+											   {% if (file.error) { %}
+				&lt;td&gt;&lt;/td&gt;
+				&lt;td class="name"&gt;{%=file.name%}&lt;/td&gt;
+				&lt;td class="size"&gt;{%=o.formatFileSize(file.size)%}&lt;/td&gt;
+				&lt;td class="error" colspan="2"&gt;&lt;span class="label label-important"&gt;Error&lt;/span&gt; {%=fileUploadErrors[file.error] || file.error%}&lt;/td&gt;
+											   {% } else { %}
+				&lt;td class="preview"&gt;{% if (file.thumbnail_url) { %}
+				&lt;a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"&gt;&lt;img src="{%=file.thumbnail_url%}" style="height:100px;"/&gt;&lt;/a&gt;
+												   {% } %}&lt;/td&gt;
+				&lt;td class="name"&gt;
+				&lt;a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&amp;&amp;'gallery'%}"&gt;{%=file.name%}&lt;/a&gt;
+				&lt;/td&gt;
+				&lt;td class="size"&gt;{%=o.formatFileSize(file.size)%}&lt;/td&gt;
+				&lt;td colspan="2"&gt;&lt;/td&gt;
+											   {% } %}
+				&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>
+							</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>
