Index: main/trunk/model-cols-dev/peijones/transform/pages/about-flip.xsl
===================================================================
--- main/trunk/model-cols-dev/peijones/transform/pages/about-flip.xsl	(revision 24616)
+++ main/trunk/model-cols-dev/peijones/transform/pages/about-flip.xsl	(revision 24616)
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:java="http://xml.apache.org/xslt/java"
+	xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+	xmlns:gslib="http://www.greenstone.org/skinning"
+	extension-element-prefixes="java util"
+	exclude-result-prefixes="java util">
+
+	<!-- the page content -->
+	<xsl:template match="/page">
+  
+		<!--Display the description text of the current collection,
+		and if some services are available then create a list
+		of links for each service within a <ul id="servicelist"> element.-->
+	<table><tbody><tr><td style="width:60%;"><gslib:collectionDescriptionTextAndServicesLinks/></td>
+	<td>
+	<div id="Book" style="position:relative;">
+		<img src="placeholder.png" width="404"><xsl:text> </xsl:text></img>
+	</div>
+	</td></tr></tbody></table>
+
+	<script type="text/javascript">
+<xsl:text disable-output-escaping="yes">
+// 7 variables to control behavior
+	var Book_Image_Width=200;
+	var Book_Image_Height=280;
+	var Book_Border=true;
+	var Book_Border_Color="gray";
+	var Book_Speed=15;
+	var Book_NextPage_Delay=1500; //1 second=1000
+	var Book_Vertical_Turn=0;
+	var Book_Image_Sources = new Array();
+
+
+function getImages()
+{ 
+    var url = "?a=g&amp;s=GetAllImagesInCollection&amp;rt=r&amp;s1.extregex=(jpg|png)&amp;s1.c=" + gs.cgiParams.c + "&amp;o=xml";   
+	var callback = {
+		success: function(data)
+		{
+			var xml = data.responseXML;
+
+			var imageList = xml.getElementsByTagName("image");
+	
+			for(var i = 0; i &lt; imageList.length; i++)
+			{
+				var imageURL = imageList[i].firstChild.nodeValue;
+				
+				imageURL = imageURL.replace(/\\/gi, "/");
+				imageURL = imageURL.replace(/%5C/gi, "/");
+				imageURL = imageURL.substring(imageURL.indexOf("sites"));
+				
+				Book_Image_Sources.push(imageURL);
+				Book_Image_Sources.push(imageURL);
+			}
+			
+			if(Book_Image_Sources.length &gt; 0)
+			{
+				ImageBook();
+			}
+		},
+		failed: function(data){alert("FAILED");}
+	};
+	
+	YAHOO.util.Connect.asyncRequest("GET", url , callback);
+}
+
+/***************** DO NOT EDIT BELOW **********************************/
+	var B_LI,B_MI,B_RI,B_TI,B_Angle=0,B_CrImg=6,B_MaxW,B_Direction=1;
+	var B_MSz,B_Stppd=false;B_Pre_Img=new Array(Book_Image_Sources.length);
+
+	function ImageBook()
+	{
+		if(document.getElementById)
+		{
+			for(i=0;i&lt;Book_Image_Sources.length;i+=2)
+			{
+				B_Pre_Img[i]=new Image();B_Pre_Img[i].src=Book_Image_Sources[i]
+			}
+			
+			Book_Div=document.getElementById("Book");
+			B_LI=document.createElement("img");Book_Div.appendChild(B_LI);	
+			B_RI=document.createElement("img");Book_Div.appendChild(B_RI);
+			B_MI=document.createElement("img");Book_Div.appendChild(B_MI);	
+			
+			B_LI.style.position = B_MI.style.position = B_RI.style.position = "absolute";
+			
+			B_LI.style.zIndex=B_RI.style.zIndex=0;B_MI.style.zIndex=1;
+			
+			B_LI.style.top=(Book_Vertical_Turn?Book_Image_Height+1:-Book_Image_Height/3)+"px";
+			B_LI.style.left=0+"px";
+			B_MI.style.top=-Book_Image_Height/3+"px";
+			B_MI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px";
+			B_RI.style.top=-Book_Image_Height/3+"px";
+			B_RI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px";
+			
+			B_LI.style.height=Book_Image_Height+"px";
+			B_MI.style.height=Book_Image_Height+"px";
+			B_RI.style.height=Book_Image_Height+"px";
+			B_LI.style.width=Book_Image_Width+"px";
+			B_MI.style.width=Book_Image_Width+"px";
+			B_RI.style.width=Book_Image_Width+"px";
+			
+			if(Book_Border)
+			{
+				B_LI.style.borderStyle=B_MI.style.borderStyle=B_RI.style.borderStyle="solid";
+				B_LI.style.borderWidth=1+"px";
+				B_MI.style.borderWidth=1+"px";
+				B_RI.style.borderWidth=1+"px";
+				B_LI.style.borderColor=B_MI.style.borderColor=B_RI.style.borderColor=Book_Border_Color
+			}
+			
+			B_LI.src=B_Pre_Img[0].src;
+			B_LI.lnk=Book_Image_Sources[1];
+			B_MI.src=B_Pre_Img[2].src;
+			B_MI.lnk=Book_Image_Sources[3];
+			B_RI.src=B_Pre_Img[4].src;
+			B_RI.lnk=Book_Image_Sources[5];
+			B_LI.onclick=B_MI.onclick=B_RI.onclick=B_LdLnk;
+			B_LI.onmouseover=B_MI.onmouseover=B_RI.onmouseover=B_Stp;
+			B_LI.onmouseout=B_MI.onmouseout=B_RI.onmouseout=B_Rstrt;
+			BookImages()
+		}
+	}
+
+	function BookImages(){
+		if(!B_Stppd)
+		{
+			if(Book_Vertical_Turn)
+			{
+				B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Height));
+				MidOffset=!B_Direction?Book_Image_Height+1:Book_Image_Height-B_MSz;
+				B_MI.style.top=MidOffset+"px";
+				B_MI.style.height=B_MSz+"px"
+			}
+			else
+			{	
+				B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Width));
+				MidOffset=B_Direction?Book_Image_Width+1:Book_Image_Width-B_MSz;
+				B_MI.style.left=MidOffset+"px";
+				B_MI.style.width=B_MSz+"px"
+			}
+			B_Angle+=Book_Speed/720*Math.PI;
+			if(B_Angle&gt;=Math.PI/2&amp;&amp;B_Direction)
+			{
+				B_Direction=0;
+				if(B_CrImg==Book_Image_Sources.length)B_CrImg=0;
+				B_MI.src=B_Pre_Img[B_CrImg].src;
+				B_MI.lnk=Book_Image_Sources[B_CrImg+1];
+				B_CrImg+=2
+			}
+			if(B_Angle&gt;=Math.PI)
+			{
+				B_Direction=1;
+				B_TI=B_LI;
+				B_LI=B_MI;
+				B_MI=B_TI;
+				if(Book_Vertical_Turn)B_MI.style.top=0+"px";
+				else B_MI.style.left=Book_Image_Width+1+"px";			
+				B_MI.src=B_RI.src;
+				B_MI.lnk=B_RI.lnk;
+
+				setTimeout("Book_Next_Delay()",Book_NextPage_Delay)
+			}
+			else 
+			{
+				setTimeout("BookImages()",50)
+			}
+		}
+		else 
+		{
+			setTimeout("BookImages()",50)
+		}
+	}
+
+	function Book_Next_Delay()
+	{
+		if(B_CrImg==Book_Image_Sources.length)
+		{
+			B_CrImg=0;
+		}
+		
+		B_RI.src=B_Pre_Img[B_CrImg].src;
+		B_RI.lnk=Book_Image_Sources[B_CrImg+1];
+		B_MI.style.zIndex=2;
+		B_LI.style.zIndex=1;
+		B_Angle=0;
+		B_CrImg+=2;
+		
+		setTimeout("BookImages()",50)
+	}
+
+	function B_LdLnk()
+	{
+		if(this.lnk)
+		{
+			window.location.href=this.lnk
+		}
+	}
+	
+	function B_Stp()
+	{
+		B_Stppd=true;
+		this.style.cursor=this.lnk?"pointer":"default"
+	}
+	
+	function B_Rstrt()
+	{
+		B_Stppd=false
+	}
+	
+	window.onload=getImages;
+	</xsl:text>
+</script>
+	
+	</xsl:template>
+
+
+</xsl:stylesheet>  
+
Index: main/trunk/model-cols-dev/peijones/transform/pages/about.xsl
===================================================================
--- main/trunk/model-cols-dev/peijones/transform/pages/about.xsl	(revision 24616)
+++ main/trunk/model-cols-dev/peijones/transform/pages/about.xsl	(revision 24616)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:java="http://xml.apache.org/xslt/java"
+	xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+	xmlns:gslib="http://www.greenstone.org/skinning"
+	extension-element-prefixes="java util"
+	exclude-result-prefixes="java util">
+
+	<!-- the page content -->
+	<xsl:template match="/page">
+  
+		<!--Display the description text of the current collection,
+		and if some services are available then create a list
+		of links for each service within a <ul id="servicelist"> element.-->
+	<table><tbody><tr><td style="width:60%;"><gslib:collectionDescriptionTextAndServicesLinks/></td>
+	<td>
+	
+	<xsl:variable name="httpPath"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/></xsl:variable>
+	<script language="javascript" src="{$httpPath}/script/collage.js"><xsl:text> </xsl:text></script>
+
+<script language="javascript" type="text/javascript">
+<xsl:text disable-output-escaping="yes">
+
+
+
+  var collageDelayMsec = 2000;
+
+  var numCollageImages;
+
+  function collageNextImage(collageFrameNum)
+  {
+    var totalNumKeyframes = Book_Image_Sources.length;
+   
+    //var archiveDir = "twso2008.dir";
+  
+    var colframeNum = (collageFrameNum-1) % numCollageImages;
+
+    var collageCanvas = document.getElementById("collagewrapper");
+
+    var collagelet = collageCanvas.getElementsByTagName('div');
+
+    var imgs = collagelet[colframeNum].getElementsByTagName('img');
+    var img = imgs[0];
+
+    var i;
+    for (i=0; i &lt; numCollageImages-1; i++) {
+        var j = (colframeNum+1+i) % numCollageImages;
+
+		console.log("j = " + j);
+        var zindex = collagelet[j].style.zIndex;
+		if (zindex &gt; 0) {
+			zindex--;
+			collagelet[j].style.zIndex = zindex;
+			var alphaVal = Math.round((zindex/numCollageImages)*100);
+            setAlphaVal(collagelet[j],alphaVal);
+        }
+    }
+
+    img.src = Book_Image_Sources[collageFrameNum-1];
+	img.width = 300;
+    img.collageFrameNum = collageFrameNum;
+
+    img.onclick = function () { document.location = Book_Image_Sources[collageFrameNum-1]; };
+
+    collagelet[colframeNum].style.zIndex = numCollageImages;
+    setAlphaVal(collagelet[colframeNum],100);
+
+    nextcollageFrameNum = (collageFrameNum % totalNumKeyframes) + 1;
+
+    setTimeout('collageNextImage('+nextcollageFrameNum+')',collageDelayMsec);
+
+
+ }
+
+ 
+ 
+function initCollage()
+{
+ 
+  
+  var collageCanvas = document.getElementById('collagewrapper');
+
+  // var spacediv = 5;
+
+  // var numXCols = spacediv;
+  // var numYRows = numCollageImages / spacediv;
+
+  var collageWidth = 400;
+  var collageHeight = 300;
+
+  var numXCols = 4;
+  var numYRows =3;
+
+  numCollageImages = numXCols * numYRows;
+
+
+  var placement = new Array(numCollageImages);
+
+  var i;
+  for (i=0; i &lt; numCollageImages; i++) {
+      var x = i % numXCols;
+      var y = Math.floor(i / numXCols);
+
+
+      var xypos = new Object();
+      xypos.x = (x/numXCols) * collageWidth;
+      xypos.y = (y/numYRows) * collageHeight;
+
+      placement[i] = xypos;
+  }
+
+  // now mix them up
+
+  for (i=0; i &lt; numCollageImages; i++) {
+
+      var swapi = Math.floor(Math.random()*numCollageImages);
+      var tmp = placement[i];
+      placement[i] = placement[swapi];
+      placement[swapi] = tmp;
+  }
+
+  for (i=0; i &lt; numCollageImages; i++) {
+      var img = document.createElement('img');
+      img.id = "fadingimg" + i;
+      img.src = gs.collectionMetadata["httpPath"] + "/images/blank.gif" 
+      img.border= 0;
+
+      var divImg = document.createElement('div');
+      divImg.id = "fadingcanvas" + i;
+
+      var posStyle = "position: absolute; ";
+      posStyle += "top: " + placement[i].y +"px; ";
+      posStyle += "left: " + placement[i].x + "px; "; 
+
+
+      visStyle = "visibility: inherit; ";
+      zindexStyle = " z-index: " + numCollageImages + "; ";
+
+      var style = posStyle + visStyle + zindexStyle;
+
+      divImg.setAttribute("style",style);
+
+      divImg.appendChild(img);
+
+      collageCanvas.appendChild(divImg);
+  }
+
+}
+
+
+</xsl:text>
+</script>
+
+
+	<div id="collagewrapper"  
+		style="background: #ffffd0; 
+			width: 600px;
+			height: 500px;
+            position: relative; left: 0px; top: 0px;">
+	</div>
+		
+	
+	</td></tr></tbody></table>
+
+	<script type="text/javascript">
+<xsl:text disable-output-escaping="yes">
+
+	var Book_Image_Sources = new Array();
+
+
+function getImages()
+{ 
+    var url = "?a=g&amp;s=GetAllImagesInCollection&amp;rt=r&amp;s1.extregex=Photo.*(jpg|png)&amp;s1.c=" + gs.cgiParams.c + "&amp;o=xml";   
+	var callback = {
+		success: function(data)
+		{
+			var xml = data.responseXML;
+
+			var imageList = xml.getElementsByTagName("image");
+	
+			for(var i = 0; i &lt; imageList.length; i++)
+			{
+				var imageURL = imageList[i].firstChild.nodeValue;
+				
+				imageURL = imageURL.replace(/\\/gi, "/");
+				imageURL = imageURL.replace(/%5C/gi, "/");
+				imageURL = imageURL.substring(imageURL.indexOf("sites"));
+				
+				Book_Image_Sources.push(imageURL);
+			}
+			
+			if(Book_Image_Sources.length &gt; 0)
+			{
+				initCollage();
+				collageNextImage(1);
+			}
+		},
+		failed: function(data){alert("FAILED");}
+	};
+	
+	YAHOO.util.Connect.asyncRequest("GET", url , callback);
+}
+
+	
+	window.onload=getImages;
+	</xsl:text>
+</script>
+	
+	</xsl:template>
+
+
+</xsl:stylesheet>  
+
Index: main/trunk/model-cols-dev/peijones/transform/pages/classifier.xsl
===================================================================
--- main/trunk/model-cols-dev/peijones/transform/pages/classifier.xsl	(revision 24616)
+++ main/trunk/model-cols-dev/peijones/transform/pages/classifier.xsl	(revision 24616)
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:java="http://xml.apache.org/xslt/java"
+	xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+	xmlns:gslib="http://www.greenstone.org/skinning"
+	extension-element-prefixes="java util"
+	exclude-result-prefixes="java util">
+	
+	<!-- use the 'main' layout -->
+	<xsl:include href="layouts/main.xsl"/>
+	<xsl:include href="classifiertools.xsl"/>
+
+	<!-- set page title -->
+	<xsl:template name="pageTitle"><gslib:serviceName/></xsl:template>
+
+	<!-- set page breadcrumbs -->
+	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/> <gslib:collectionNameLinked/><gslib:rightArrow/></xsl:template>
+
+	<!-- the page content -->
+	<xsl:template match="/page/pageResponse">
+		<xsl:call-template name="classifierLoadScript"/>
+		<!-- this right sidebar -->
+
+		  <xsl:if test="$berryBasketOn or $documentBasketOn">
+	            <div id="rightSidebar">
+
+		    <xsl:if test="$berryBasketOn">
+				<!-- show the berry basket if it's turned on -->
+				<gslib:berryBasket/>
+				<xsl:text> </xsl:text>
+
+  		    </xsl:if>
+
+                    <!-- Document Maker -->
+ 		    <xsl:if test="$documentBasketOn">
+				<gslib:documentBasket/>
+				<xsl:text> </xsl:text>
+		   </xsl:if>
+                   <!-- /Document Maker -->
+
+
+	            </div>
+		  </xsl:if>
+
+	
+		<!--
+			show the clasifier results - 
+			you can change the appearance of the results by editing
+			the two templates at the bottom of this file
+		-->
+		<table id="results">
+			<xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+			<xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
+
+			<xsl:apply-templates select="classifier">
+				<xsl:with-param name="collName" select="$collName"/>
+				<xsl:with-param name="serviceName" select="$serviceName"/>
+			</xsl:apply-templates>
+		</table>
+		<div class="clear"><xsl:text> </xsl:text></div>
+	</xsl:template>
+
+
+	<!--
+	TEMPLATE FOR DOCUMENTS
+	-->
+
+    <!--<xsl:template match="documentNode" priority="3">-->
+        <!-- show the document details -->
+        <!--<li class="document">
+            <a>
+                <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@nodeID"/>&amp;dt=<xsl:value-of select="@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;ed=1</xsl:attribute><xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
+            </a>
+        </li>
+    </xsl:template>-->
+			<!--<img id="dmbook{/page/pageResponse/collection/@name}:{@nodeID}" src="interfaces/oran/images/book.png"/>-->
+		<xsl:template match="documentNode"><!-- priority="3"-->
+		<!-- The book icon -->
+		<td>
+			<img id="dmbook{/page/pageResponse/collection/@name}:{@nodeID}">			
+				<xsl:attribute name="src">
+					<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'book_image')"/>
+				</xsl:attribute>
+			</img>
+		</td>
+		<!-- The document link -->
+		<td>
+			<a>
+				<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@nodeID"/>&amp;dt=<xsl:value-of select="@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;ed=1</xsl:attribute>
+				<xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
+			</a>
+		</td>
+		<!-- The berry (optional) -->
+		<td>
+			<xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
+		</td>
+	</xsl:template>
+
+
+	<!--
+	TEMPLATE FOR GROUPS OF DOCUMENTS
+	-->
+	<xsl:template match="classifierNode"><!-- priority="3"-->
+
+		<table id="title{@nodeID}"><tr>
+			<!-- Expand/collapse button -->
+			<td class="headerTD">
+				<img id="toggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">			
+					<xsl:attribute name="src">
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
+					</xsl:attribute>
+				</img>
+			</td>
+			<!-- Bookshelf icon -->
+			<td>
+				<img>
+					<xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/></xsl:attribute>
+				</img>
+			</td>
+			<!-- Link title -->
+			<td>
+				<a href="javascript:toggleSection('{@nodeID}');">
+					<xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
+				</a>
+			</td>
+		</tr></table>
+		
+		<!-- Show any documents or sub-groups in this group -->
+		<xsl:if test="documentNode|classifierNode">
+			<div id="div{@nodeID}" class="classifierContainer">
+				<table>
+					<xsl:for-each select="documentNode|classifierNode">
+						<tr>
+							<xsl:apply-templates select="."/>
+						</tr>
+					</xsl:for-each>
+				</table>
+			</div>
+		</xsl:if>
+	</xsl:template>
+	
+	<xsl:template name="classifierLoadScript">
+		<script type="text/javascript">
+			<xsl:text disable-output-escaping="yes">
+			
+				var collapseImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/><xsl:text disable-output-escaping="yes">";
+				var expandImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/><xsl:text disable-output-escaping="yes">";
+				var loadingImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'loading_image')"/><xsl:text disable-output-escaping="yes">";
+				var berryBaskets = "</xsl:text><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/><xsl:text disable-output-escaping="yes">";
+				var inProgress = new Array();
+			
+				function isExpanded(sectionID)
+				{
+					var divElem = document.getElementById("div" + sectionID);
+					if(!divElem.style.display || divElem.style.display == "block")
+					{
+						return true;
+					}
+					return false;
+				}
+			
+				function toggleSection(sectionID)
+				{
+					var section = document.getElementById("div" + sectionID);
+					var sectionToggle = document.getElementById("toggle" + sectionID);
+					
+					if(section)
+					{
+						if(isExpanded(sectionID))
+						{
+							section.style.display = "none";
+							sectionToggle.setAttribute("src", expandImageURL);
+						}
+						else
+						{
+							section.style.display = "block";
+							sectionToggle.setAttribute("src", collapseImageURL);
+						}
+					}
+					else
+					{
+						httpRequest(sectionID);
+					}
+				}
+				
+				function httpRequest(sectionID)
+				{
+					if(!inProgress[sectionID])
+					{
+						inProgress[sectionID] = true;
+						var httpRequest;
+						if (window.XMLHttpRequest) {
+							httpRequest = new XMLHttpRequest();
+						}
+						else if (window.ActiveXObject) {
+							httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+						}
+						
+						var sectionToggle = document.getElementById("toggle" + sectionID);
+						sectionToggle.setAttribute("src", loadingImageURL);
+
+						var url = document.URL;
+						url = url.replace(/(&amp;|\?)cl=[a-z\.0-9]+/gi, "$1cl=" + sectionID + "&amp;excerptid=div" + sectionID);
+			
+						if(berryBaskets == "on")
+						{
+							url = url + "&amp;berrybasket=on";
+						}
+
+						httpRequest.open('GET', url, true);
+						httpRequest.onreadystatechange = function() 
+						{
+							if (httpRequest.readyState == 4) 
+							{
+								if (httpRequest.status == 200) 
+								{
+									var newDiv = document.createElement("div");			
+									var sibling = document.getElementById("title" + sectionID);
+									var parent = sibling.parentNode;
+									
+									if(sibling.nextSibling)
+									{
+										parent.insertBefore(newDiv, sibling.nextSibling);
+									}
+									else
+									{
+										parent.appendChild(newDiv);
+									}
+									
+									newDiv.innerHTML = httpRequest.responseText;
+									sectionToggle.setAttribute("src", collapseImageURL);
+									
+									if(berryBaskets == "on")
+									{
+										checkout();
+									}
+								}
+								else
+								{
+									sectionToggle.setAttribute("src", expandImageURL);
+								}
+								inProgress[sectionID] = false;
+							}
+						}
+						httpRequest.send();
+					}
+				}
+			</xsl:text>
+		</script>
+	</xsl:template>
+
+</xsl:stylesheet>
+
Index: main/trunk/model-cols-dev/peijones/transform/pages/document.xsl
===================================================================
--- main/trunk/model-cols-dev/peijones/transform/pages/document.xsl	(revision 24616)
+++ main/trunk/model-cols-dev/peijones/transform/pages/document.xsl	(revision 24616)
@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:java="http://xml.apache.org/xslt/java"
+	xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+	xmlns:gslib="http://www.greenstone.org/skinning"
+	xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+	extension-element-prefixes="java util"
+	exclude-result-prefixes="java util gsf">
+
+	<!-- use the 'main' layout -->
+	<xsl:import href="layouts/main.xsl"/>
+	
+	<!-- style includes global params interface_name, library_name -->
+	<xsl:include href=".old/berrytools.xsl"/>
+	
+	<xsl:variable name="bookswitch">
+		<xsl:choose>
+			<xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
+				<xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
+			</xsl:when>
+			<xsl:otherwise>off</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
+	<!-- set page title -->
+	<xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
+
+	<!-- set page breadcrumbs -->
+	<xsl:template name="breadcrumbs">
+		<gslib:siteLink/><gslib:rightArrow/> 
+		<gslib:collectionNameLinked/><gslib:rightArrow/> 
+		<a>
+			<xsl:attribute name="href">
+				<xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>&amp;dt=<xsl:value-of select="/page/pageResponse/document/documentNode/@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>
+			</xsl:attribute>
+			<xsl:variable name="documentTitleVar">
+				<gslib:documentTitle/>
+			</xsl:variable>
+			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
+		</a>
+	</xsl:template>
+	
+	<xsl:template match="/">
+		<xsl:choose>
+			<!-- if this is the realistic books version of the page -->
+			<xsl:when test="$bookswitch = 'flashxml'">
+				<html>
+					<body>
+						<xsl:apply-templates select="/page/pageResponse/document"/>
+					</body>
+				</html>
+			</xsl:when>
+			<!-- if this is the regular version of the page -->
+			<xsl:otherwise>
+				<xsl:apply-imports/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- the page content -->
+	<xsl:template match="/page/pageResponse/document">
+	
+		<xsl:if test="$bookswitch = 'off'">
+			<div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
+		
+			<script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
+			
+		<script type="text/javascript" src="sites/localsite/collect/peijones/js/documentmaker/BrowserDetect.js"><xsl:text> </xsl:text></script>
+		<script type="text/javascript" src="sites/localsite/collect/peijones/js/documentmaker/PhotoNotes-1.5.js"><xsl:text> </xsl:text></script>
+		<link rel="stylesheet" type="text/css" href="sites/localsite/collect/peijones/style/PhotoNotes-1.5.css"/>
+		<div class="Photo fn-container" id="PhotoContainer">
+			<img src="sites/localsite/collect/peijones/images/photo/0_PAColl-0671-01korokijones.jpg" />
+		</div>
+
+		<input type="button" value="Add a Note!" style="margin-left:30px;" onclick="AddNote();" />
+		<script type="text/javascript">
+			<xsl:text disable-output-escaping="yes">
+				/* create the Photo Note Container */
+                var notes = new PhotoNoteContainer(document.getElementById('PhotoContainer'));
+                var posCount = 0;
+				
+				function deleteFunction(note)
+				{
+					var callback =
+					{
+						success: function(response){},
+						failed: function(){},
+						timeout: 5000
+					};
+					
+					var url = gs.siteMetadata.siteURL.replace("8080","9090") + "cgi-bin/metadata-server.pl?a=remove-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=dc.Creator&amp;metapos=" + note.id;
+					YAHOO.util.Connect.asyncRequest("GET", url, callback);
+					return true;
+				}
+				
+                function saveFunction(note)
+				{
+					var callback = 
+					{
+						success: function(response){},
+						failed: function(){},
+						timeout: 5000
+					};
+					
+					var jsonVal = '{"caption":"' + note.text + '", "area":{"x":' + note.rect.left + ', "y":' + note.rect.top + ', "width":' + note.rect.width + ', "height":' + note.rect.height + '}}';
+					var url = gs.siteMetadata.siteURL.replace("8080","9090") + "cgi-bin/metadata-server.pl?a=set-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=dc.Creator&amp;metavalue=" + jsonVal + "&amp;metapos=" + note.id;
+					YAHOO.util.Connect.asyncRequest("GET", url, callback);
+					return 1;
+				}				
+				
+				function getNotes(count)
+				{
+					var callback = 
+					{
+						success: function(response)
+						{
+							if(response.responseText.search(/\w/) == -1)
+							{
+								return;
+							}
+							posCount++;
+							
+							var jsonObj = eval("(" + response.responseText + ")");
+							var newNote = new PhotoNote(jsonObj.caption, this.count, new PhotoNoteRect(jsonObj.area.x,jsonObj.area.y,jsonObj.area.width,jsonObj.area.height));
+							newNote.onsave = saveFunction;
+							newNote.ondelete = deleteFunction;
+							notes.AddNote(newNote);
+							getNotes(this.count + 1);
+						},
+						failed: function(){},
+						timeout: 5000
+					};
+					
+					var url = gs.siteMetadata.siteURL.replace("8080","9090") + "cgi-bin/metadata-server.pl?a=get-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=dc.Creator&amp;metapos=" + count;
+					//var url = gs.siteMetadata.siteURL.replace("8080","9090") + "cgi-bin/metadata-server.pl?a=get-metadata&amp;site=localsite&amp;c=" + gs.cgiParams.c + "&amp;d=" + gs.cgiParams.d + "&amp;metaname=[dc.Title]";
+					callback.count = count;
+					YAHOO.util.Connect.asyncRequest("GET", url, callback);
+				}
+                
+                function AddNote()
+                {
+                    var newNote = new PhotoNote('Add note text here...',posCount++,new PhotoNoteRect(10,10,50,50));
+					newNote.onsave = saveFunction;
+                    newNote.ondelete = deleteFunction;
+                    notes.AddNote(newNote);
+                    newNote.Select();
+                }
+				getNotes(0);
+			</xsl:text>
+		</script>
+			
+			<!-- Adds the realistic books javascript if necessary ( *** in document-scripts.xsl *** ) -->
+			<xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
+				<script type="text/javascript">
+					<xsl:text disable-output-escaping="yes">
+						if(document.URL.indexOf("book=on") != -1)
+						{
+							loadBook();
+						}
+					</xsl:text>
+				</script>
+			</xsl:if>
+		
+			<!-- show the little berries for this document -->
+			<xsl:call-template name="documentBerryForDocumentPage"/>
+
+			<table id="rightSidebar"> 
+				<tr><td>
+					<xsl:call-template name="viewOptions"/>
+				</td></tr>
+				<tr><td>
+					<!-- the sidebar -->
+					<div id="contentsArea">				
+						<!-- show the berry basket if it's turned on -->
+						<gslib:berryBasket/>
+
+						<!-- the book's cover image -->
+                        <xsl:choose>
+                            <xsl:when test="/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">
+        						<div id="coverImage" class="visible"><gslib:coverImage/></div>
+                            </xsl:when>
+                            <xsl:otherwise>
+        						<div id="coverImage" class="hidden"><gslib:coverImage/></div>
+                            </xsl:otherwise>    
+                        </xsl:choose>
+
+						<!-- the contents (if enabled) -->
+                        <xsl:choose>
+                            <xsl:when test="/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
+    						    <div id="tableOfContents" class="visible">
+							        <xsl:apply-templates select="documentNode" mode="TOC"/>
+                                </div>
+                            </xsl:when>    
+                            <xsl:otherwise>
+                                <div id="tableOfContents" class="hidden">
+                                    <xsl:apply-templates select="documentNode" mode="TOC"/>
+                                </div>
+                            </xsl:otherwise>    
+                        </xsl:choose>
+					</div>
+				</td></tr>
+			</table>
+		</xsl:if>
+		
+		<!-- display the document -->
+		<xsl:choose>
+			<xsl:when test="@external != ''">
+				<xsl:call-template name="externalPage">
+					<xsl:with-param name="external" select="@external"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$bookswitch = 'flashxml'">
+				<xsl:apply-templates mode="flashxml"/>
+			</xsl:when>
+			<xsl:when test="$bookswitch = 'on'">
+				<!-- *** in document-scripts.xsl *** -->
+				<div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
+				<script type="text/javascript">
+					<xsl:text disable-output-escaping="yes">
+						if(document.URL.indexOf("book=on") != -1)
+						{
+							loadBook();
+						}
+					</xsl:text>
+				</script>
+			</xsl:when>
+			<xsl:otherwise>
+				<div id="gs-document-text" class="documenttext"> 
+					<xsl:apply-templates select="documentNode" mode="document"/>
+				</div>	
+			</xsl:otherwise>
+		</xsl:choose>
+
+		<div class="clear"><xsl:text> </xsl:text></div>
+	</xsl:template>
+	
+	<!-- Highlight annotations if requested -->
+	<xsl:template match="annotation">
+		<xsl:choose>
+			<xsl:when test="/page/pageRequest/paramList/param[@name='hl' and @value='on']">
+				<span class="termHighlight"><xsl:value-of select="."/></span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="noTermHighlight"><xsl:value-of select="."/></span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	
+	<!-- This template is used to display the document content -->
+	<xsl:template match="documentNode" mode="document">
+		<a name="{@nodeID}"><xsl:text> </xsl:text></a>
+		<!-- Section header -->
+		<table class="sectionHeader"><tr>
+			<!-- Expand/collapse button -->
+			<td class="headerTD">
+				<img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">			
+					<xsl:attribute name="src">
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
+					</xsl:attribute>
+				</img>
+			</td>
+			
+			<!-- Automatic section number -->
+			<td class="headerTD">
+				<p>
+					<xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
+					
+					<xsl:if test="util:hashToSectionId(@nodeID)">
+						<span class="sectionNumberSpan">
+							<xsl:value-of select="util:hashToSectionId(@nodeID)"/>
+							<xsl:text> </xsl:text>
+						</span>
+					</xsl:if>
+                    <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
+					<span class="sectionTitle"><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/></span>
+				</p>
+			</td>
+			
+			<!-- "back to top" link -->
+			<xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
+				<td class="backToTop headerTD">
+					<a href="#top">
+						<xsl:text disable-output-escaping="yes">&#9650;</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
+					</a>
+				</td>
+			</xsl:if>
+		</tr></table>
+		
+		<!-- Section text -->
+		<div id="doc{@nodeID}" class="sectionContainer" style="display:block;">		
+			<xsl:for-each select="nodeContent">
+				<xsl:for-each select="node()">
+					<xsl:choose>
+						<xsl:when test="not(name())">
+							<xsl:value-of select="." disable-output-escaping="yes"/>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates select="."/>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:for-each>
+			<xsl:if test="documentNode">
+				<xsl:apply-templates select="documentNode" mode="document"/>
+			</xsl:if>
+		</div>	
+
+	</xsl:template>
+
+	<!-- This template is used to display the table of contents -->
+	<xsl:template match="documentNode" mode="TOC">
+
+		<!-- check if this is the currently selected table of contents item -->
+		<xsl:variable name="isCurrent" select="nodeContent"/>
+
+		<!-- formulate the link -->
+		<xsl:variable name="contentsLink">
+			<xsl:value-of select='$library_name'/>?a=d&amp;c=<gslib:collectionNameShort/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1
+		</xsl:variable>
+
+		<ul>
+			<table><tr>
+				<!-- The expand/collapse button (not displayed for the top level node) -->
+				<xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
+					<td>
+						<xsl:choose>
+							<xsl:when test="not(nodeContent and not(documentNode))">
+								<img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
+									<xsl:attribute name="src">
+										<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
+									</xsl:attribute>
+								</img>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:attribute name="class">emptyIcon</xsl:attribute>
+							</xsl:otherwise>
+						</xsl:choose>
+					</td>
+				</xsl:if>
+				
+				<!-- The chapter/page icon -->
+				<td>
+					<img>
+						<xsl:if test="nodeContent and not(documentNode)">
+							<xsl:attribute name="class">leafNode</xsl:attribute>
+						</xsl:if>
+						
+						<xsl:attribute name="src">
+							<xsl:choose>
+								<xsl:when test="nodeContent and not(documentNode)">
+									<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/> 
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:attribute>
+					</img>
+				</td>
+				
+				<!-- The section name, links to the section in the document -->
+				<td>				
+					<a>
+						<xsl:attribute name="href">#<xsl:value-of select="@nodeID"/></xsl:attribute>
+						<xsl:if test="util:hashToSectionId(@nodeID)">
+							<xsl:value-of select="util:hashToSectionId(@nodeID)"/>
+							<xsl:text> </xsl:text>
+						</xsl:if>
+						<xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
+					</a>
+				</td>
+			</tr></table>
+		
+			<!-- display any child items -->		
+			<xsl:if test="documentNode">
+				<li id="toc{@nodeID}" style="display:block;">
+					<xsl:apply-templates select="documentNode" mode="TOC"/>
+				</li>
+			</xsl:if>
+			
+		</ul>
+	</xsl:template>
+	
+	<!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
+	<xsl:template match="documentNode" mode="flashxml">
+		<xsl:text disable-output-escaping="yes">
+			&lt;Section&gt;
+			&lt;Description&gt;
+			&lt;Metadata name="Title"&gt;
+		</xsl:text>
+		<xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
+		<xsl:text disable-output-escaping="yes">
+			&lt;/Metadata&gt;
+			&lt;/Description&gt;
+		</xsl:text>
+		
+		<xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
+				
+		<xsl:if test="documentNode">
+			<xsl:apply-templates select="documentNode" mode="flashxml"/>
+		</xsl:if>
+				
+		<xsl:text disable-output-escaping="yes">
+			&lt;/Section&gt;
+		</xsl:text>
+	</xsl:template>
+	
+	<xsl:template name="externalPage">
+		<xsl:param name="external"/>
+		<xsl:variable name="go_forward_link">
+			<a>
+				<xsl:attribute name="href">
+					<xsl:value-of select="$external"/>
+				</xsl:attribute>
+				<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
+			</a>
+		</xsl:variable>
+		<h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
+		<p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
+	</xsl:template>
+
+	<xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
+	
+	<xsl:template name="viewOptions">
+		<table class="viewOptions"><tr>
+			<!-- Realistic books link -->
+			<xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
+				<td>
+					<img>
+						<xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/></xsl:attribute>
+					</img>
+					<input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/>
+				</td>
+			</xsl:if>
+			
+			<!-- Highlight on/off button -->
+			<xsl:if test="/page/pageRequest/paramList/param[@name = 'p.a']/@value = 'q' and count(//annotation) > 0">
+				<td>
+					<img>
+						<xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute>
+					</img>
+					<input id="highlightOption" type="checkbox" class="optionCheckBox">
+						<xsl:choose>
+							<xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
+								<xsl:attribute name="onclick">
+									<xsl:text>removeHighlight();</xsl:text>
+								</xsl:attribute>
+								<xsl:attribute name="checked">true</xsl:attribute>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:attribute name="onclick">
+									<xsl:text>addHighlight();</xsl:text>
+								</xsl:attribute>
+							</xsl:otherwise>
+						</xsl:choose>
+					</input>
+				</td>
+			</xsl:if>
+		</tr></table>	
+	</xsl:template>
+</xsl:stylesheet>
+
