Index: main/trunk/model-sites-dev/mozarts-laptop/collect/digital-music-stand/etc/collectionConfig.xml
===================================================================
--- main/trunk/model-sites-dev/mozarts-laptop/collect/digital-music-stand/etc/collectionConfig.xml	(revision 30446)
+++ main/trunk/model-sites-dev/mozarts-laptop/collect/digital-music-stand/etc/collectionConfig.xml	(revision 30457)
@@ -47,7 +47,10 @@
 					</xsl:variable>
 					<xsl:variable name="httpCollection">
-						<xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
-					</xsl:variable>
-					<xsl:variable name="httpCollectionExternal">http://www.nzdl.org/greenstone3-nema/sites/localsite/collect/<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:variable>
+					  <xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>					  
+					</xsl:variable>
+					<xsl:variable name="httpCollectionImages">
+					  <xsl:value-of select="{$httpCollection}"/>/images
+					</xsl:variable>
+					  
 					<xsl:variable name="assocFilePath">
 						<gsf:metadata name="assocfilepath"/>
@@ -130,4 +133,5 @@
 					</xsl:variable>
 					<xsl:variable name="httpCollectionExternal">http://www.nzdl.org/greenstone3-nema/sites/localsite/collect/<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:variable>
+
 					<xsl:variable name="assocFilePath">
 						<gsf:metadata name="assocfilepath"/>
@@ -157,5 +161,5 @@
 					</gsf:link>
 				</td>
-				<td valign="top"><gsf:choose-metadata><gsf:metadata name="mp.title"/><gsf:metadata name="dc.Title"/><gsf:metadata name="exp.Title"/><gsf:metadata name="Title"/><gsf:default>Untitled</gsf:default></gsf:choose-metadata>by<gsf:metadata name="mp.composer"/><gsf:switch><gsf:metadata name="Source"/><gsf:when test="exists"><br/><i>(<gsf:metadata name="Source"/>)</i></gsf:when></gsf:switch></td>
+				<td valign="top"><gsf:choose-metadata><gsf:metadata name="mp.title"/><gsf:metadata name="dc.Title"/><gsf:metadata name="exp.Title"/><gsf:metadata name="Title"/><gsf:default>Untitled</gsf:default></gsf:choose-metadata> by <gsf:metadata name="mp.composer"/><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">
@@ -194,20 +198,8 @@
 				</gsf:link>
 			</gsf:template>
-<!--			
-			<xsl:template name="create-html-headerXXXX">
-				<title><xsl:call-template name="pageTitle"/> ::<xsl:call-template name="siteName"/></title>
-				<link href="interfaces/{$interface_name}/style/core.css" rel="stylesheet" type="text/css"/>
-				<link href="favicon.ico" rel="shortcut icon"/>
-				<xsl:call-template name="setup-gs-variable"/>
-				<script src="sites/{$site_name}/collect/digital-music-stand/script/musicstand-util.js" type="text/javascript">
-					<xsl:text>					</xsl:text>				</script>
-				<script src="sites/{$site_name}/collect/digital-music-stand/script/musicstand-open.js" type="text/javascript">
-					<xsl:text>					</xsl:text>				</script>
-			</xsl:template>
--->
 			
 			<xsl:template name="additionalHeaderContent-collection">
-			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand-util.js" type="text/javascript"/>
-			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand-open.js" type="text/javascript"/>
+			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand-util.js" />
+			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand-open.js" />
 			</xsl:template>
 
@@ -233,5 +225,7 @@
 					<xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
 				</xsl:variable>
-				<xsl:variable name="httpCollectionExternal">http://www.nzdl.org/greenstone3-nema/sites/localsite/collect/<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:variable>
+
+				<gsf:variable name="httpCollectionImages"><xsl:value-of select="$httpCollection"/>/images</gsf:variable>
+				
 				<gsf:variable name="cgiParamPageWidth">
 					<xsl:value-of select="/page/pageRequest/paramList/param[@name = 'pageWidth']/@value"/>
@@ -240,5 +234,38 @@
 					<xsl:value-of select="/page/pageRequest/paramList/param[@name = 'pageHeight']/@value"/>
 				</gsf:variable>
-				<style>#nextpagediv {
+
+				
+				<gsf:variable name="postitBgCol">
+				  <xsl:choose>
+				    <xsl:when test="/page/pageRequest/userContext/@uid = '1'">rgba(255,200,200,0.7)</xsl:when>
+				    <xsl:otherwise>rgba(250,250,200,0.7)</xsl:otherwise>
+				  </xsl:choose>
+				</gsf:variable>
+
+				<gsf:variable name="postitSelCol">
+				  <xsl:choose>
+				    <xsl:when test="/page/pageRequest/userContext/@uid = '1'">rgba(128,0,0,0.7)</xsl:when>
+				    <xsl:otherwise>rgba(150,110,0,0.7)</xsl:otherwise>
+				  </xsl:choose>
+				</gsf:variable>
+
+				<xsl:call-template name="init-direct-edit"/>
+
+
+				<!--
+				<xsl:if test="/page/pageRequest/userContext/@uid = '1'">
+				  <script type="text/javascript">
+				    // User is logged in
+				    gs.username
+				    <xsl:text disable-output-escaping="yes"> = "</xsl:text>
+				    <xsl:value-of select="/page/pageRequest/userContext/@username"/>
+				    <xsl:text disable-output-escaping="yes">";</xsl:text>
+				  </script>
+				</xsl:if>
+				-->
+				
+				
+<style>
+#nextpagediv {
   position: absolute; 
   top:0px; left:0px; 
@@ -291,168 +318,30 @@
   top:0px; left:-8px; 
   z-index:5; 
-}</style>
-				<script src="sites/{$site_name}/collect/digital-music-stand/script/musicstand-util.js" type="text/javascript">
-					<xsl:text>					</xsl:text>				</script>
-				<script src="sites/{$site_name}/collect/digital-music-stand/script/musicstand.js" type="text/javascript">
-					<xsl:text>					</xsl:text>				</script>
-				<script src="sites/{$site_name}/collect/digital-music-stand/script/musicstand-main.js" type="text/javascript">
-					<xsl:text>					</xsl:text>				</script>
+  }
+
+
+div.annotationNote { 
+  position: absolute; 
+  visibility: visible;
+  z-index: 2;
+  background: <xsl:value-of select="$postitBgCol"/>;  
+  font-size: 10pt;
+}
+  
+
+</style>
+
+			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/yui/yahoo/yahoo.js" />
+			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/yui/event/event.js" />
+			  <gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/yui/dom/dom.js" />
+
+
+				<gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand-util.js" />
+				<gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand.js" />
+				<gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/annotate.js" />
+				<gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/musicstand-main.js" />
+				<gsf:script src="sites/{$site_name}/collect/{$collNameChecked}/script/annotate-main.js" />
 			</xsl:template>
-<!--
-This template is used to display the document content
--->
-<!--
-    <xsl:template name="documentNodeText" >
--->
-
-  <!--
-      <xsl:template match="documentNode" mode="document">
-  -->
-  <!--
-      <xsl:template name="documentNodeTextXXX" >
-  -->
-
-                         <xsl:template name="wrappedDocument">
-				<div id="gs-document">
-					<xsl:call-template name="documentPre"/>
-					<div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
-<!--					  
-    <div><gsf:metadata name="mp.title"/> by <gsf:metadata name="mp.composer"/></div>
-    -->
-					  <xsl:call-template name="create-html-header"/>
-
-
-
-
-
-				<xsl:variable name="httpCollection">
-					<xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
-				</xsl:variable>
-				<xsl:variable name="httpCollectionExternal">http://www.nzdl.org/greenstone3-nema/sites/localsite/collect/<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:variable>
-				<gsf:variable name="cgiParamPageWidth">
-					<xsl:value-of select="/page/pageRequest/paramList/param[@name = 'pageWidth']/@value"/>
-				</gsf:variable>
-				<gsf:variable name="cgiParamPageHeight">
-					<xsl:value-of select="/page/pageRequest/paramList/param[@name = 'pageHeight']/@value"/>
-				</gsf:variable>
-				<table align="center" width="{$cgiParamPageWidth}">
-					<tr>
-						<td align="left" width="20%">
-							<a href="javascript:prevPageAnim(gs.cgiParams['d'],'.png')">
-								<span id="prevpagespan" style="display: inline;">_iconprev_<span id="prevpageval"><script language="javascript" type="text/javascript">musicStand.docwritePrevPageNum()</script></span></span>
-							</a>
-							<script language="javascript" type="text/javascript">musicStand.activatePrevPageNum();</script>
-						</td>
-						<td align="center" width="60%">_document:gotoform_</td>
-						<td align="right" width="20%">
-							<a href="javascript:musicStand.nextPageAnim(gs.cgiParams['d'],'.png')">
-								<span id="nextpagespan" style="display: inline"><span id="nextpageval"><script language="javascript" type="text/javascript">musicStand.docwriteNextPageNum()</script></span>_iconnext_</span>
-							</a>
-						</td>
-						<script language="javascript" type="text/javascript">musicStand.activateNextPageNum();</script>
-					</tr>
-				</table>
-				<table width="100%">
-					<tr>
-						<td/>
-						<td>
-							<div id="thispage" style="cursor: e-resize; background: white;        position: relative; left: 0px; top: 0px;        width: {$cgiParamPageWidth}px; height: {gs.cgiparam.PageHeight}px;">
-								<a onClick="return false;" onContextMenu="return false;" onMouseDown="return musicStand.nextOrPrevPageEvent(event,gs.cgiParams['d'],'.png')" onMouseUp="return false;">
-									<img border="0" height="{$cgiParamPageHeight}" id="thispageimg" src="{$httpCollection}/images/blank.gif" width="{$cgiParamPageWidth}"/>
-								</a>
-								<div id="nextpagediv" style="clip : rect(0px, {$cgiParamPageWidth}px, {$cgiParamPageHeight}px, {$cgiParamPageWidth}px);">
-									<img border="0" id="nextpageimg" src=""/>
-								</div>
-								<div id="prevpagediv" style="clip : rect(0px, {$cgiParamPageWidth}px, {$cgiParamPageHeight}px, {$cgiParamPageWidth}px);">
-									<img border="0" id="prevpageimg" src=""/>
-								</div>
-								<div id="animedgebleed" style="clip : rect(0px, {$cgiParamPageWidth}px, {$cgiParamPageHeight}px, {$cgiParamPageWidth}px);">								</div>								<div id="loading">
-									<table height="100%" width="100%">
-										<tr>
-											<td width="45%">											</td>											<td align="left">
-												<span id="loadingdots">loading</span>
-											</td>
-										</tr>
-									</table>
-								</div>
-							</div>
-							<style>div.postit    {background-color: rgba(250,250,200,0.7);  color: black; }
-			a.postit:link   {background-color: rgba(250,250,200,0.7); color: black; text-decoration: none; }
-			a.postit:visited {background-color: rgba(250,250,200,0.7); color: black; text-decoration: none; }
-
-			a.postit:hover   {color: rgba(150,110 ,0,0.7); }
-
-			div.pagemenu    { background-color: rgba(250,250,200,0.7); color: black; }</style>
-							<div class="editable-menu" id="pagemenu" onmouseout="javascript:return musicStand.hidePageMenu(this,event);" style="position: absolute; right: 4px; bottom: 2px;        z-index: 10; visibility: hidden;">
-								<font size="-1">
-									<div class="pagemenu" id="pagemenu1">Cancel turn</div>
-									<div class="pagemenu" id="pagemenu2">Next page</div>
-									<div class="pagemenu" id="pagemenu3">Previous page</div>
-								</font>
-							</div>
-							<div id="annotateCanvas" style="position: absolute;             left: 0px; top: 0px;             visibility: visible;             z-index: 2;"/>
-						</td>
-						<td>
-							<div id="slidercontainer" style="background: white; position: relative; left: 0px; top: 0px; width: 40px; height: {$cgiParamPageHeight}px;">
-								<div id="sliderbg">
-									<div id="slidertrackabove" style="position: absolute; left: 8px; top: 0px; width: 4px; height: 500px; z-index:4; background-color:#606060;">									</div>									<div id="slidertrackbelow" style="position: absolute;                         left: 10px; top: 500px;                        width: 1px; height: 100px;          z-index:4;           background-color:#606060;">									</div>								</div>
-								<div id="sliderpos" style="width:30px; height:11px;">
-									<img height="11" src="{$httpCollection}/images/brown2-slider.png" width="30"/>
-								</div>
-								<script language="javascript" type="text/javascript">
-									<xsl:text disable-output-escaping="yes">var username = musicStand.getUsername();
-	  var metaval;
-
-	  if (username != null) {
-	      var metaname = username + "-sliderposTop";
-	      metaval = 700; // ***** major hack ****
-	      //metaval  = gsapi.getLiveMetadata(gs.cgiParams["d"],metaname);
-	      //if (metaval == "") {
-	      //    // fallback to looking up non-user specific one
-	      //    metaval  = gsapi.getLiveMetadata(gs.cgiParams["d"],"sliderposTop");
-	      //}
-	  }
-	  else {
-	      //metaval  = gsapi.getLiveMetadata(gs.cgiParams["d"],"sliderposTop");
-	      metaval = 700; // ***** major hack ****
-	  }
-	  var sliderposTop = parseInt(metaval);
-
-	  var speedBreak = musicStand.getSpeedBreak();
-
-	  if (sliderposTop &gt; 0) {
-	      sliderposTop *= musicStand.getScaleFactor();
-	      speedBreak = sliderposTop;
-	      musicStand.setSpeedBreak(speedBreak);
-	  }
-
-	  var sliderpos = document.getElementById('sliderpos');
-	  sliderpos.style.top = speedBreak + "px";
-          sliderpos.style.left = "-8px";
-	  sliderpos.onmousedown = dragSlider;
-	  var sliderbg = document.getElementById('sliderbg');
-	  sliderbg.onmousedown = dragSlider;
-
-
-	  var trackabove = document.getElementById('slidertrackabove');
-	  trackabove.style.height = speedBreak + "px";
-
-	  var trackbelow = document.getElementById('slidertrackbelow');
-	  trackbelow.style.top = speedBreak + "px";
-	  trackbelow.style.height = (gs.cgiParams["pageHeight"] - speedBreak) + "px";</xsl:text>
-								</script>
-							</div>
-						</td>
-					</tr>
-				</table>
-				<script type="text/javascript">bodyLoaded();</script>
-
-					  
-					  
-					</div>
-				</div>
-
-			
-			</xsl:template>
+
 		</format>
 	      </display>
