Index: main/branches/64_bit_Greenstone/greenstone3/Client-side Overview.txt
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/Client-side Overview.txt	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/Client-side Overview.txt	(revision 24007)
@@ -0,0 +1,14 @@
+This version of Greenstone 3 has been optimised as part of the Summer Research Scholarship I undertook. This version, however, also contains support for client-side XSLT.
+
+The main modifications include:
+* The use of Apache Commons StringUtils class for text replacement and splitting;
+* The use of StringUtils.contains over the *.text.* regular expression;
+* Plus: client-side XSLT support.
+
+Note that the XML Texts collection had to be modified in certain areas due to it using four XSL overrides in its transform directory. This may or may not be necessary depending on the XSL overrides in place for other collections. For an example of this, see the about-clientside.xsl file in the gberg collection.
+
+Steven McTainsh
+February 2011
+
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/README.txt
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/README.txt	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/README.txt	(revision 24007)
@@ -273,5 +273,5 @@
 See greenstone3/docs/manual/manual.pdf for more details about the software and installation etc.
 
-Output is logged to web/logs. usage.log is a usage log, while greenstone.log is the error/message log. To change the level of logging, edit the web/WEB-INF/classes/log4j.properties file, and change the log4j.disable property. Valid values are TRACE, DEBUG, INFO, WARN, ERROR and FATAL.
+Output is logged to web/logs. usage.log is a usage log, while greenstone.log is the error/message log. To change the level of logging, edit the web/WEB-INF/classes/log4j.properties file, and change the log4j.disable and log4j.rootCategory properties. Valid values are TRACE, DEBUG, INFO, WARN, ERROR and FATAL.
 
 To prevent Tomcat showing directory listings, edit Tomcat's conf/web.xml file and set the value of the "listings" servlet parameter to false.
Index: main/branches/64_bit_Greenstone/greenstone3/WITHOUT-JNI.sh
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/WITHOUT-JNI.sh	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/WITHOUT-JNI.sh	(revision 24007)
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+echo "Renaming MG and GDBM related source code to 'java..tmp' file names"
+
+pushd src/java/org/greenstone/gsdl3
+
+cd service
+echo "  Processing 'service' directory"
+
+for f in *MG*java PhindPhraseBrowse.java ; do
+  if [ -e $f ] ; then
+    echo "    $f -> $f.tmp"
+    /bin/mv $f $f.tmp
+  fi
+done
+
+cd ..
+
+
+cd util
+echo "  Processing 'util' directory"
+
+for f in *GDBM*java ; do
+  if [ -e $f ] ; then
+    echo "    $f -> $f.tmp"
+    /bin/mv $f  $f.tmp
+  fi
+done
+cd ..
+
+popd
+
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/build.properties.in
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/build.properties.in	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/build.properties.in	(revision 24007)
@@ -19,4 +19,7 @@
 # uncomment if you don't want to have collection building enabled
 #disable.collection.building=true
+#
+# uncomment (and edit) if you want to control where perl is found
+#perl.path=/usr/bin
 
 ## Greenstone 3 server program options
@@ -57,8 +60,14 @@
 with.jni=true
 
+## Controls whether or not we want GLI and GEMS to be checked out and compiled
+with.gli.and.gems=true
+
 ## Control if compilation of gs2 is static or not. Used, for example, for distributions
 # Same issue as 'with.jni' for how this gets used in ant 1.7.1 and before
 #compile.static=true
 
+## Uncomment this line to enable compilation with the gnome-lib extension
+## The gnome-lib extension should be in the [gsdl3home]/ext directory
+#use.support.lib=true
 
 ## windows c++ compilation
Index: main/branches/64_bit_Greenstone/greenstone3/build.xml
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/build.xml	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/build.xml	(revision 24007)
@@ -23,5 +23,6 @@
   <!--<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>-->
   <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
-  <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
+  <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpathref="project.classpath"/>
+
  
   <!-- ===================== Property Definitions =========================== -->
@@ -128,5 +129,5 @@
   <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
   <property name="app.version" value="trunk"/>
-  <property name="branch.path" value="trunk"/>
+  <property name="branch.path" value="branches/64_bit_Greenstone"/>
   <property name="branch.revision" value="HEAD"/>
 
@@ -225,4 +226,5 @@
 	<property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
 
+	<!-- CFLAGS -->
 	<if><bool><isset property="env.CFLAGS"/></bool>
 		<property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CFLAGS}&quot;"/>
@@ -232,4 +234,5 @@
 	</if>
 
+	<!-- CPPFLAGS -->
 	<if><bool><isset property="env.CPPFLAGS"/></bool>
 		<property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CPPFLAGS}&quot;"/>
@@ -239,4 +242,5 @@
 	</if>
 
+	<!-- CXXFLAGS -->
 	<if><bool><isset property="env.CXXFLAGS"/></bool>
 		<property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CXXFLAGS}&quot;"/>
@@ -246,4 +250,5 @@
 	</if>
 
+	<!-- LDFLAGS -->
 	<if><bool><isset property="env.LDFLAGS"/></bool>
 		<property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
@@ -253,4 +258,5 @@
 	</if>
 
+	<!-- PATH -->
 	<if><bool><isset property="env.PATH"/></bool>
 		<property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
@@ -260,4 +266,5 @@
 	</if>
 
+	<!-- PKG_CONFIG_PATH  -->
 	<if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
 		<property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
@@ -267,4 +274,5 @@
 	</if>
 
+	<!-- LD_LIBRARY_PATH / DYLD_LIBRARY_PATH -->
 	<if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
 		<if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
@@ -284,66 +292,10 @@
 	</if>
 
-	<else>
-		<if><bool><isset property="env.CFLAGS"/></bool>
-			<property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
-        	<else>
-			<property name="cflags.arg" value=" "/>
-		</else>
-		</if>
-
-		<if><bool><isset property="env.CPPFLAGS"/></bool>
-        		<property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
-        	<else>
-			<property name="cppflags.arg" value=" "/>
-		</else>
-		</if>
-
-		<if><bool><isset property="env.CXXFLAGS"/></bool>
-			<property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
-		<else>
-			<property name="cxxflags.arg" value=" "/>
-		</else>
-		</if>
-
-		<if><bool><isset property="env.LDFLAGS"/></bool>
-			<property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
-		<else>
-			<property name="ldflags.arg" value=" "/>
-		</else>
-		</if>
-
-		<if><bool><isset property="env.PATH"/></bool>
-			<property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
-		<else>
-			<property name="path.arg" value=" "/>
-		</else>
-		</if>
-
-		<if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
-			<property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
-		<else>
-			<property name="pcpath.arg" value=" "/>
-		</else>
-		</if>
-
-		<if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
-			<if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
-				<property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
-			<else>
-				<property name="ldlpath.arg" value=" "/>
-			</else>
-			</if>
-		<else>
-			<if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
-				<property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
-			<else>
-				<property name="ldlpath.arg" value=" "/>
-			</else>
-			</if>
-		</else>	 
-		</if>
-	</else>
+	<!-- Combine all arguments into one string -->
+  	<property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
   </if>
-  <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
+
+  <!-- Set this to nothing if we are not using the support lib -->
+  <property name="allargs" value=""/>
 
   <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
@@ -542,5 +494,5 @@
   
   <target name="configure" depends="init,configure-tomcat,configure-web"
-    description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file."/>
+    description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file, including if you change the port number."/>
 
   <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
@@ -553,10 +505,81 @@
     description="Update (thru Subversion) all the source (including common-src or collection-building, and runtime), then clean, and re-install. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
 
-  <target name="start" depends="init,start-tomcat"
+
+  <target name="perl-for-building" depends="init">
+    <!-- uses perl.path if set in build.properties, otherwise try for
+         environment variable PERLPATH, and failing that assumes 'perl' 
+         is on environment PATH -->
+    <!-- if, outside build.properties, we only set perl.path if we have gs2build/build-src (collection building), then we won't set perl.path in a (flax) binary, since it doesn't have build-src -->
+    <if><bool><available file="${gs2build.home}"/></bool>
+
+      <if><bool><not><isset property="perl.path"/></not></bool>
+
+        <if>
+          <bool>
+            <and>
+              <isset property="env.PERLPATH"/>
+              <not><equals arg1="${env.PERLPATH}" arg2=""/></not>
+            </and>
+          </bool>
+          <property name="perl.path" value="${env.PERLPATH}"/>
+          <else>
+            <echo>
+  Using PATH environment variable to locate Perl.
+            </echo>
+            <exec executable="which" os="${os.unix}" spawn="false" outputproperty="full.perl.path">
+              <arg value="perl" />
+            </exec>
+
+			<exec executable="${gs2build.home}/bin/windows/which" os="${os.windows}" spawn="false" outputproperty="full.perl.path">
+              <arg value="perl" />
+            </exec>
+
+            <stringutil string="${full.perl.path}" property="perl.path">
+                <replace regex="\/[^\/]*$" replacement="" />
+            </stringutil>
+            <if><bool><istrue value="${current.os.isunix}"/></bool>
+
+              <if><bool><not><equals arg1="${full.perl.path}" arg2="/usr/bin/perl"/></not></bool>
+                <echo>
+    Non-standard location of Perl found: ${full.perl.path}
+    Set the environment variable PERLPATH or the perl.path property in
+      build.properties to explicitly control the version of Perl used.
+                </echo>
+              </if>
+            </if>
+          </else>
+        </if>
+      </if>
+
+      <!-- full.perl.path is for pretty-printing only, e.g. used in target "start" -->
+      <if><bool><isset property="perl.path"/></bool>
+        <property name="full.perl.path" value="${perl.path}${file.separator}perl"/>
+        <else>
+          <property name="full.perl.path" value="perl (will use the enviroment variable PATH to find this executable)"/>
+        </else>
+      </if>
+
+      <!-- gs2build not available, perl.path -->
+      <else>
+	<property name="perl.path" value=""/>
+      </else>
+    </if>
+  </target>
+
+  <target name="start" depends="init,configure-web,start-tomcat"
     description="Startup the Tomcat server." >
     <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo> 
     <echo>Tomcat: ${catalina.home}</echo> 
     <echo>Java  : ${java.home}</echo>
-    <echo>URL   : http://${tomcat.server}:${tomcat.port}${app.path}/</echo>
+    <if><bool><available file="${build.src.home}"/></bool>
+      <echo>Perl  : ${full.perl.path}</echo>
+    </if>
+    <if><bool><isset property="install.flax"/></bool>
+        <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/flax"/>
+    <else>
+        <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/"/>
+    </else>
+    </if>
+    <echo>URL   : ${url}</echo>
     <!-- assuming that index.html is not needed here -->   
   </target>
@@ -575,8 +598,13 @@
     <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
     <echo message="  Execute 'ant -help' for Ant help."/>
-    <echo>To install Greenstone3, run '${install-command}'. 
-      There are properties defined in build.properties. The install process will ask you if these properties are set correctly. To avoid this prompt, use the '-Dproperties.accepted=yes' option.
-      To log the output, use the '-logfile build.log' option.
-      The README.txt file has more information about the ant targets and install process.
+    <echo>
+  To install Greenstone3, run '${install-command}'. 
+    There are properties defined in build.properties. The install 
+      process will ask you if these properties are set correctly. 
+      To avoid this prompt, use the '-Dproperties.accepted=yes' 
+      option.
+    To log the output, use the '-logfile build.log' option.
+  The README.txt file has more information about the ant targets
+    and install process.
     </echo>
   </target>
@@ -799,5 +827,5 @@
   </target>
 
-  <target name="configure-web" depends="init"
+  <target name="configure-web" depends="init,perl-for-building"
     description="Configure only the web app config files">
     <!-- we want a unix path in the global.properties file -->
@@ -809,4 +837,5 @@
     <filter token="tomcat.server" value="${tomcat.server}"/>
     <filter token="tomcat.port" value="${tomcat.port}"/>
+    <filter token="perlpath" value="${perl.path}"/>
     <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
     <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
@@ -953,4 +982,6 @@
   </target>
  
+  
+
 <!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
   <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
@@ -1253,13 +1284,34 @@
     description="Compile only the Greenstone core">
     <mkdir dir="${build.home}"/>
-    <javac srcdir="${src.home}"
-      destdir="${build.home}"
-      debug="${compile.debug}"
-      deprecation="${compile.deprecation}"
-      optimize="${compile.optimize}">
-      <classpath>
-        <path refid="compile.classpath"/>
-      </classpath>
-    </javac>
+    <if><bool><isset property="with.jni"/></bool>
+	<javac srcdir="${src.home}"
+	       destdir="${build.home}"
+	       debug="${compile.debug}"
+	       deprecation="${compile.deprecation}"
+	       optimize="${compile.optimize}">
+	  <classpath>
+            <path refid="compile.classpath"/>
+	  </classpath>
+	</javac>
+	<else>
+	  <property name="gsprefix" value=""/>	  
+	  <javac srcdir="${src.home}"
+	       destdir="${build.home}"
+	       debug="${compile.debug}"
+	       deprecation="${compile.deprecation}"
+	       optimize="${compile.optimize}">
+	    <classpath>
+              <path refid="compile.classpath"/>
+	    </classpath>
+	    <exclude name="org/greenstone/gsdl3/service/GS2MGPPRetrieve.java"/>
+	    <exclude name="org/greenstone/gsdl3/service/GS2MGPPSearch.java"/>
+	    <exclude name="org/greenstone/gsdl3/service/GS2MGSearch.java"/>
+	    <exclude name="org/greenstone/gsdl3/service/GS2MGRetrieve.java"/>
+	    <exclude name="org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java"/>
+	    <exclude name="org/greenstone/gsdl3/service/PhindPhraseBrowse.java"/>
+	    <exclude name="org/greenstone/gsdl3/util/GDBMWrapper.java"/>
+	  </javac>
+	</else>
+    </if>
     <jar destfile="${build.home}/gsdl3.jar">
       <fileset dir="${build.home}">
@@ -1414,13 +1466,19 @@
     </exec>
 
-    <!-- windows: just the java stuff. -->
-    <echo>Windows: compile javagdbm (java only)</echo>
+    <!-- windows: Calling without the "compile" argument first will run winMake.bat with 
+         "all" which will then perform both the compile AND link targets in jni/win32.mak 
+         (thereby also generating gdbmjava.dll). Then we run the same command with 
+         the "install" argument to copy the gdbmjava.dll into the correct location. -->
+    <echo>Windows: compile javagdbm</echo>
     <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
-      <arg value="compile"/>
-      <arg value="javaonly"/>
+      <env key="GSDLHOME" path="${gs2build.home}"/>
+    </exec>
+    <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
+      <env key="GSDLHOME" path="${gs2build.home}"/>
+      <arg value="install"/>
     </exec>
 
     <!-- install the jar file -->
-    <echo>Install the javagdbm jar file</echo>
+    <echo>Install the javagdbm jar file ${javagdbm.home}/javagdbm.jar ${lib.jni}</echo>
     <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
   </target>
@@ -1630,6 +1688,13 @@
       <arg value="win32.mak"/>
       <arg value="install"/>
+	  <arg value="GSDLHOME=${gs2build.home}"/>
       <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
-      <arg value="USE_SQLITE=0"/> <!-- why is this not on by default? -->
+      <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
+      <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
+      <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
+      <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
+	  <!--
+      <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
+      <arg value="USE_SQLITE=0"/>--> <!-- why is this not on by default? -->
     </exec>
 
@@ -1674,5 +1739,5 @@
   <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
     <!-- checkout -->
-    <if><bool><not><istrue value="${nosvn.mode}"/></not></bool>
+    <if><bool><and><not><istrue value="${nosvn.mode}"/></not><isset property="with.gli.and.gems"/></and></bool>
 
     <exec executable="svn">
@@ -1708,18 +1773,20 @@
  
   <target name="compile-gli" depends="init" if="collection.building.enabled">
-    <!-- gli -->
-    <property name="gli.home" value="${basedir}/gli"/>
-
-    <!-- linux -->
-    <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
-    <!--remote gli-->
-    <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
-      resolveExecutable="true" failonerror="true"/>
-    <!-- windows -->
-    <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
-    <!--remote gli-->
-    <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
-      resolveExecutable="true" failonerror="true"/> 
-    <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
+    <if><bool><isset property="with.gli.and.gems"/></bool>
+      <!-- gli -->
+      <property name="gli.home" value="${basedir}/gli"/>
+
+      <!-- linux -->
+      <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
+      <!--remote gli-->
+      <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
+	    resolveExecutable="true" failonerror="true"/>
+      <!-- windows -->
+      <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
+      <!--remote gli-->
+      <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
+	    resolveExecutable="true" failonerror="true"/> 
+      <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
+    </if>
   </target>
 
@@ -1955,10 +2022,5 @@
     <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
     <!-- A static web service wsdl file which is queried by soap client. The reason this file is used (instead of the dynamically generated version) is in case any redirects are used in the Apache configuration (e.g., flax.nzdl.org:80 redirects to harakeke:8080) -->
-    <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" filtering="true" overwrite="true">
-    	<filterset>
-            <filter token="flaxpublicserver" value="${tomcat.server}"/>
-            <filter token="flaxpublicport" value="${tomcat.port}"/>
-    	</filterset>	
-    </copy>
+    <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" overwrite="true"/>
     <copy todir="${web.home}/WEB-INF/lib">
     	<fileset dir="${basedir}/flax-lib">
@@ -1966,4 +2028,9 @@
     	</fileset>	
     </copy>
+  </target>
+  <target name="configure-flax-wsdl" description="Configure flax webservice with tomcat server/port">
+    <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" overwrite="true"/>
+    <rsr file="${web.home}/FlaxWebService.wsdl" pattern="@flaxpublicserver@:@flaxpublicport@" replacement="${tomcat.server}:${tomcat.port}"/>
+    <echo>FLAX server for Moodle module is configured to: http://${tomcat.server}:${tomcat.port}.</echo>
   </target>
 
@@ -2003,4 +2070,5 @@
 <!-- ========== Some distribution targets ======================== -->
   <target name="remove-source">
+    <if><bool><isset property="with.gli.and.gems"/></bool>
     <delete includeEmptyDirs="true">
       <fileset dir="." defaultexcludes="false">
@@ -2008,4 +2076,13 @@
      </fileset>
     </delete>
+    
+    <else>
+    <delete includeEmptyDirs="true">
+      <fileset dir="." defaultexcludes="false">
+        <patternset refid="greenstone3.source.no.gli.component"/>
+     </fileset>
+    </delete>
+    </else>
+    </if>
   </target>
 
@@ -2030,5 +2107,7 @@
     <if><bool><istrue value="${current.os.isunix}"/></bool>
       <delete><fileset dir="." includes="*.bat"/></delete>
-      <delete><fileset dir="gli" includes="*.bat"/></delete>
+      <if><bool><isset property="with.gli.and.gems"/></bool>
+	<delete><fileset dir="gli" includes="*.bat"/></delete>
+      </if>
       <delete><fileset dir="gs2build" includes="*.bat"/></delete>
       <delete><fileset dir="bin/script" includes="*.bat"/></delete>
@@ -2041,5 +2120,7 @@
     <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
       <delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>
-      <delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
+      <if><bool><isset property="with.gli.and.gems"/></bool>
+	<delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
+      </if>
       <delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>
       <delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>
Index: main/branches/64_bit_Greenstone/greenstone3/gs3-setup.sh
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/gs3-setup.sh	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/gs3-setup.sh	(revision 24007)
@@ -269,14 +269,16 @@
 fi
 
-if test -e ext ; then
-  for gsdl_ext in ext/* ; do
-    if [ -d $gsdl_ext ] ; then 
-      cd $gsdl_ext > /dev/null
-      if test -e setup.bash ; then 
-        source ./setup.bash 
-      fi 
-      cd ../..  
-    fi
-  done
+if test "x$gsopt_noexts" != "x1" ; then
+    if test -e ext ; then
+	for gsdl_ext in ext/* ; do
+	    if [ -d $gsdl_ext ] ; then 
+		cd $gsdl_ext > /dev/null
+		if test -e setup.bash ; then 
+		    source ./setup.bash 
+		fi 
+		cd ../..  
+	    fi
+	done
+    fi
 fi
 
Index: main/branches/64_bit_Greenstone/greenstone3/resources/java/global.properties.in
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/resources/java/global.properties.in	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/resources/java/global.properties.in	(revision 24007)
@@ -1,5 +1,11 @@
+## Do not edit. This file is automatically generated from 
+##   <gsdlhome>/resources/java/global.properties.in
+
 ## greenstone home
 gsdl3.home=@gsdl3home@
 gsdl3.version=@gsdl3version@
+
+# for collection building
+perl.path=@perlpath@
 
 # tomcat info
Index: main/branches/64_bit_Greenstone/greenstone3/resources/tomcat/server_tomcat6.xml
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/resources/tomcat/server_tomcat6.xml	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/resources/tomcat/server_tomcat6.xml	(revision 24007)
@@ -65,7 +65,13 @@
          Define a non-SSL HTTP/1.1 Connector on port 8080
     -->
+	<!-- compressionMinSize is in bytes -->
     <Connector port="@port@" protocol="HTTP/1.1" 
                connectionTimeout="20000" 
-               redirectPort="8443" />
+               redirectPort="8443"
+			   compression="on"
+			   compressionMinSize="524288"
+			   compressableMimeType="text/html,text/xml,text/css,text/xsl,text/javascript"
+			   noCompressionUserAgents="gozilla, traviata"
+			   />
     <!-- A "Connector" using the shared thread pool-->
     <!--
Index: main/branches/64_bit_Greenstone/greenstone3/resources/xml/components.xml
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/resources/xml/components.xml	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/resources/xml/components.xml	(revision 24007)
@@ -6,4 +6,26 @@
 		<include name="gli/src"/>
 		<include name="gli/src/**/*"/>
+		<include name="src"/>
+		<include name="src/**/*"/>
+		<include name="gs2build/common-src"/>
+		<include name="gs2build/common-src/**/*"/>
+		<include name="gs2build/build-src"/>
+		<include name="gs2build/build-src/**/*"/>
+		<include name="gs2build/runtime-src"/>
+		<include name="gs2build/runtime-src/**/*"/>
+		<include name="gs2build/aclocal.m4"/>
+		<include name="gs2build/config.guess"/>
+		<include name="gs2build/config.h.in"/>
+		<include name="gs2build/config.sub"/>
+		<include name="gs2build/configure"/>
+		<include name="gs2build/configure.in"/>
+		<include name="gs2build/install-sh"/>
+		<include name="gs2build/Makefile.in"/>
+		<include name="gs2build/win32.mak"/>
+		<include name="gs2build/win32cfg.h"/>
+	</patternset>
+
+	<!-- source component without gli- files that get compiled and could be safely removed from a binary distribution -->
+	<patternset id="greenstone3.source.no.gli.component">
 		<include name="src"/>
 		<include name="src/**/*"/>
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/ClientSideServlet.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/ClientSideServlet.java	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/ClientSideServlet.java	(revision 24007)
@@ -0,0 +1,149 @@
+package org.greenstone.gsdl3;
+
+import org.apache.log4j.*; // Actually add logging?
+import org.apache.commons.lang3.StringUtils;
+import org.greenstone.gsdl3.util.XSLTUtil;
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+import org.greenstone.gsdl3.util.Dictionary;
+import java.util.Enumeration;
+
+public class ClientSideServlet extends HttpServlet {
+	
+public void init(ServletConfig config) throws ServletException {
+	super.init(config);	
+}	
+	
+public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {   
+   
+   String query_string = request.getQueryString();
+   PrintWriter w = response.getWriter();
+
+	if(query_string == null)
+		displayParamError(response);
+	
+		String[] parts = StringUtils.split(query_string, "&");
+	
+		String[] keys = null; // Array of keys to look up
+		String lang = "";
+		String interface_name = "";	
+		String command = "";	
+		String params = "";
+		
+		for(String part : parts) {		
+		
+			String[] nameval = StringUtils.split(part, '=');
+
+			if(nameval.length != 2) {
+				displayParamError(response);
+				return;
+			}			
+			
+			String name = nameval[0];
+			String value = nameval[1];
+			
+			if(name.equals("k"))
+				keys = StringUtils.split(value, ",");
+			else if(name.equals("l"))
+				lang = value;
+			else if(name.equals("i"))
+				interface_name = value;
+			else if(name.equals("c"))
+				// Alternative commands
+				command = value;
+			else if(name.equals("p"))
+				params = value;
+		}
+		
+		if(keys == null && command.equals("") && params.equals("")) {
+			// Not satisfiable
+			displayParamError(response);
+			return;	
+		}
+		
+		String bundle = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\r\n<textBundle>\r\n";
+		
+		if(!command.equals("") && !params.equals("")) {
+		
+			// Alternative commands other than dictionary lookup
+			String[] parameters = StringUtils.split(params, "|");			
+			String result = null;		
+			
+			if(command.equals("getNumberedItem") && parameters.length == 2) {
+				result = XSLTUtil.getNumberedItem(parameters[0], Integer.parseInt(parameters[1]));
+			} else if(command.equals("exists") && parameters.length == 2) {
+				result = XSLTUtil.exists(parameters[0], parameters[1]) ? "true" : "false";
+			} else if(command.equals("isImage") && parameters.length == 1) {
+				result = (XSLTUtil.isImage(parameters[0])) ? "true" : "false";	
+			}
+			
+			if(result != null) {
+				bundle += "	<method name=\"" + command + "\" parameters=\"" + params + "\" return=\"" + result + "\" />\r\n";
+			} else { displayParamError(response); return; }
+		} else {
+		
+		for(String key : keys) {
+		
+			String original_key = key;
+			String[] theParts = StringUtils.split(key, "|");
+			String[] args = null;
+			
+			if(theParts.length > 1)
+				args = StringUtils.split(theParts[1], ";");
+		
+			key = theParts[0];
+		
+			// Straight from XSLTUtils.java (src), with some modifications
+			if(key.equals("null")) {
+				bundle += "	<item key=\"" + key + "\" value=\"\" />\r\n";
+				continue;
+			}
+				
+			Dictionary dict = new Dictionary("interface_"+interface_name, lang);
+			String result = dict.get(key, args);
+			
+			if (result == null) {
+				String sep_interface_dir = interface_name + File.separatorChar + lang + File.separatorChar + "interface"; 
+				dict = new Dictionary(sep_interface_dir, lang);
+				result = dict.get(key, args);  
+			 }
+
+			if (result == null && !interface_name.equals("default")) { // not found, try the default interface
+			    dict = new Dictionary("interface_default", lang);
+			    result = dict.get(key, args);
+			}
+			    
+		    if (result == null) { // not found
+			    result = "_" + original_key + "_";
+		    } 
+
+			bundle += "	<item key=\"" + encode(original_key) + "\" value=\"" + encode(result) + "\" />\r\n";
+		} }
+		
+		bundle += "</textBundle>";
+		
+		response.setContentType("text/xml");   			
+
+		w.print(bundle);
+		w.close();
+}
+
+private String encode(String s) {
+	s = StringUtils.replace(s, "&", "&amp;");
+	s = StringUtils.replace(s, "<", "&lt;");
+	s = StringUtils.replace(s, ">", "&gt;");
+	return s;
+}
+
+private void displayParamError(HttpServletResponse response) {
+
+	try {
+	PrintWriter w = response.getWriter();
+	w.write("Invalid parameters supplied! Need key (k=), interface name (i=) and language (l=). If you specified a method call, it must be on the list of supported method calls, and you must specify a command (c=) and parameters (p=).");
+	w.close();
+	} catch (Exception ex) { /* Should log here */ }
+	
+}
+	
+}
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 24007)
@@ -19,4 +19,6 @@
 import org.apache.log4j.*;
 
+// Apache Commons
+import org.apache.commons.lang3.*;
 
 /** a servlet to serve the greenstone library - we are using servlets instead
@@ -43,4 +45,7 @@
    * otherwise DEFAULT_LANG is used*/
   protected String default_lang= null;
+  
+  /** Whether or not client-side XSLT support should be exposed */
+  protected boolean supports_client_xslt = false;
 
   /** The default default - used if a default lang is not specified
@@ -87,6 +92,11 @@
     String gsdl3_home = config.getInitParameter(GSConstants.GSDL3_HOME);
     String interface_name = config.getInitParameter(GSConstants.INTERFACE_NAME);
+	
+	String allowXslt = (String)config.getInitParameter(GSConstants.ALLOW_CLIENT_SIDE_XSLT);
+	supports_client_xslt = allowXslt != null && allowXslt.equals("true");
+	
     this.default_lang = config.getInitParameter(GSConstants.DEFAULT_LANG);
     String sess_expire = config.getInitParameter(GSXML.SESSION_EXPIRATION);
+	
     if (sess_expire != null && !sess_expire.equals("")) {
       this.session_expiration = Integer.parseInt(sess_expire);
@@ -125,5 +135,7 @@
     
     config_params.put(GSConstants.LIBRARY_NAME, library_name);
-    config_params.put(GSConstants.INTERFACE_NAME, interface_name);
+    config_params.put(GSConstants.INTERFACE_NAME, interface_name);	
+	config_params.put(GSConstants.ALLOW_CLIENT_SIDE_XSLT, supports_client_xslt);
+	
     if (site_name != null) {
       config_params.put(GSConstants.SITE_NAME, site_name);
@@ -281,9 +293,12 @@
     String query_string = request.getQueryString();
     if (query_string!=null){
-      String[] query_arr = query_string.split("&");
+      String[] query_arr = StringUtils.split(query_string, "&");
       boolean redirect = false;
       String href = null;
       String rl = null;
+      String[] nameval = new String[2]; // Reuse it for memory efficiency purposes	
+
       for (int i=0;i<query_arr.length;i++){
+
         if (query_arr[i].startsWith("el=")){
           if (query_arr[i].substring(query_arr[i].indexOf("=")+1,query_arr[i].length()).equals("direct")){
@@ -292,12 +307,13 @@
         }else if(query_arr[i].startsWith("href=")){
           href = query_arr[i].substring(query_arr[i].indexOf("=")+1,query_arr[i].length());
-          href = href.replaceAll("%2f", "/");
-          href = href.replaceAll("%7e", "~");
-          href = href.replaceAll("%3f", "?");
-          href = href.replaceAll("%3A", "\\:");
+          href = StringUtils.replace(href, "%2f", "/");
+          href = StringUtils.replace(href, "%7e", "~");
+          href = StringUtils.replace(href, "%3f", "?");
+          href = StringUtils.replace(href, "%3A", "\\:");
         }else if(query_arr[i].startsWith("rl=")){
           rl = query_arr[i].substring(query_arr[i].indexOf("=")+1,query_arr[i].length());
         }
       }
+
       //if query_string contains "el=", the web page will be redirected to the external URl, otherwise a greenstone page with an external URL will be displayed
       //"rl=0" this is an external link
@@ -308,6 +324,6 @@
       }
     }
+	
     // Nested Diagnostic Configurator to identify the client for
-    
     HttpSession session = request.getSession (true);
     session.setMaxInactiveInterval(session_expiration);
@@ -338,9 +354,32 @@
       output = "html"; // uses html by default
     }
-    
+	
+	// If server output, force a switch to traditional interface
+	//output = (output.equals("server")) ? "html" : output;
+	
+	// Force change the output mode if client-side XSLT is supported - server vs. client
+	// BUT only if the library allows client-side transforms	
+	if(supports_client_xslt) {
+		// MUST be done before the xml_message is built
+		Cookie[] cookies = request.getCookies();
+		Cookie xsltCookie = null;
+		
+		// The client has cookies enabled and a value set - use it!
+		if(cookies != null) {
+			for(Cookie c : cookies) {
+				if(c.getName().equals("supportsXSLT")) {
+					xsltCookie = c;
+					break;
+				}
+			}
+			output = (xsltCookie != null && xsltCookie.getValue().equals("true") && output.equals("html")) ? "xsltclient" : output;
+		}
+	}
+	
     // the request to the receptionist
     Element xml_message = this.doc.createElement (GSXML.MESSAGE_ELEM);
     Element xml_request = GSXML.createBasicRequest (this.doc, GSXML.REQUEST_TYPE_PAGE, "", lang, uid);
     xml_request.setAttribute (GSXML.OUTPUT_ATT, output);
+    
     xml_message.appendChild (xml_request);
     
@@ -464,5 +503,5 @@
           && !name.equals (GSParams.LANGUAGE) 
           && !name.equals (GSParams.OUTPUT)) {// we have already dealt with these
-
+		  
           String value="";
           String [] values = request.getParameterValues (name);
@@ -509,5 +548,5 @@
 
           // ugly hack to undo : escaping
-          value = value.replaceAll ("%3A", "\\:");
+          value = StringUtils.replace(value, "%3A", "\\:");
           param.setAttribute (GSXML.VALUE_ATT,value);
           xml_param_list.appendChild (param);
@@ -516,5 +555,5 @@
     }
       
-    if (!output.equals ("html")) {
+    if (!output.equals("html") && !output.equals("server") && !output.equals("xsltclient")) {
       response.setContentType ("text/xml"); // for now use text
     }
@@ -584,5 +623,8 @@
 		// get all the <a> elements
 		NodeList hrefs = data.getElementsByTagName("a");
-		for (int i=0; hrefs!=null && i<hrefs.getLength(); i++) {
+		// Instead of calculating each iteration...
+		int hrefscount = hrefs.getLength();
+
+		for (int i=0; hrefs!=null && i < hrefscount; i++) {
 		  Element a = (Element)hrefs.item(i);
 		  // ugly hack to get rid of : in the args - interferes with session handling
@@ -590,7 +632,16 @@
 		  if (!href.equals("")) {
 		    if (href.indexOf("?")!=-1) {
-		      String[] parts = href.split("\\?", -1);
-		      parts[1]=parts[1].replaceAll(":", "%3A");
-		      href = parts[0]+"?"+parts[1];
+		      String[] parts = StringUtils.split(href, "\\?", -1);
+			  if (parts.length == 1)
+			  {
+				parts[0] = StringUtils.replace(parts[0], ":", "%3A");
+				href = "?"+parts[0];
+			  }
+			  else
+			  {
+				parts[1] = StringUtils.replace(parts[1], ":", "%3A");
+				href = parts[0]+"?"+parts[1];
+			  }
+		      
 		    }
 		    a.setAttribute("href", response.encodeURL(href));
@@ -600,5 +651,6 @@
 		// now find any submit bits - get all the <form> elements
 		NodeList forms = data.getElementsByTagName("form");
-		for (int i=0; forms!=null && i<forms.getLength(); i++) {
+		int formscount = forms.getLength();
+		for (int i=0; forms!=null && i < formscount; i++) {
 		  Element form = (Element)forms.item(i);
 		  form.setAttribute("action", response.encodeURL(form.getAttribute("action")));
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java	(revision 24007)
@@ -29,4 +29,7 @@
 import java.util.Enumeration;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.io.File;
 
@@ -78,4 +81,8 @@
   protected String oai_stylesheet = "interfaces/oai/oai2.xsl";
 
+    // there is no getQueryString() method in the HttpServletRequest returned from doPost, 
+    // since that is actually of type apache RequestFacade, and doesn't define such a method
+    protected String queryString = null;
+
   static Logger logger = Logger.getLogger(org.greenstone.gsdl3.OAIServer.class.getName());
   
@@ -223,9 +230,11 @@
     String usageInfo = "";
     
+    String query = (queryString == null) ? request.getQueryString() : queryString;
+
     //logged info = general-info + session-info
     usageInfo =
       request.getContextPath()+" "+ //session id
       request.getServletPath()+" "+ //serlvet
-      "["+request.getQueryString()+"]" +" "+ //the query string
+      "["+query+"]" +" "+ //the query string
       "["+usageInfo.trim()+"]" +" "+ // params stored in a session
       request.getRemoteAddr()+" "+   //remote address
@@ -256,4 +265,5 @@
     return query.substring(verb_start_index, verb_end_index);
   }
+
   public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
@@ -276,5 +286,8 @@
     //For example, puka.cs.waikato.ac.nz vs www.greenstone.org
     //String base_url = request.getRequestURL().toString();
-    String query = request.getQueryString();
+    // if called by doPost (if this was originally a POST request), var queryString would have been set
+    String query = (queryString == null) ? request.getQueryString() : queryString;
+    queryString = null; // reset member variable, else no doGet will work as long as the server remains running
+
     String[] pairs = (query==null)? null : query.split("&");//split into key/value pairs
     String verb = getVerb(query);
@@ -377,7 +390,34 @@
     } 
   }
+
+  // For OAI version 2.0, validation tests indicated that POST needs to be supported. Some
+  // modification was required in order to ensure that the request is passed intact to doGet()
   public void doPost(HttpServletRequest request,
     HttpServletResponse response)
     throws ServletException, IOException {
+
+      // the post method returns a wrapper of type RequestFacade by apache and there
+      // is no getQueryString() method defined for it. Therefore, need to work this out
+      // manually before calling doGet(request, response) so that doGet can work as before.
+      
+      queryString = "";
+      Iterator parameter_entries = request.getParameterMap().entrySet().iterator();
+      while(parameter_entries.hasNext()) {	  
+	  Map.Entry param_entry = (Map.Entry)parameter_entries.next();
+	  String[] paramVals = (String[]) param_entry.getValue();
+	  if(paramVals != null) {
+	      if(paramVals.length > 0) {
+		  logger.error("POST request received: " + param_entry.getKey() + " - " + paramVals[0]);
+		  queryString = queryString + "&" + param_entry.getKey() + "=" + paramVals[0];
+	      }
+	  }	  
+      }
+      if(queryString.length() > 0) {
+	  queryString = queryString.substring(1);
+	  //queryString = OAIXML.oaiEncode(queryString);
+      }
+      if(queryString.equals("")) {
+	  queryString = null;
+      }
     doGet(request,response);    
   }
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 24007)
@@ -97,10 +97,11 @@
 
     try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            DocumentBuilder builder = factory.newDocumentBuilder();
+            //DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            //DocumentBuilder builder = factory.newDocumentBuilder();
             //String input = "<html><head><title></title></head><body>" + format_string + "</body></html>";
-            String input = format_string;
-            InputSource is = new InputSource( new StringReader( input ) );
-            Document d = (Document) builder.parse( is );
+            //String input = format_string;
+            //InputSource is = new InputSource( new StringReader( input ) );
+            //Document d = (Document) builder.parse( is );
+            Document d = this.converter.getDOM(format_string); //(Document) builder.parse( is );
             //Node n1 = d.getFirstChild();            
             //Document d2 = (Document) this.doc.importNode(e, true);
@@ -111,5 +112,7 @@
             XMLTransformer transformer = new XMLTransformer();
             // HOW DO I DO THIS PROPERLY?
-            Document style_doc = this.converter.getDOM(new File("/home/sam/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8");
+            //String style = stylesheetFile(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList base_interfaces, String filename);
+            //Document style_doc = this.converter.getDOM(new File(style), "UTF-8"); //"/home/sam/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8");  /*************************/
+            Document style_doc = this.converter.getDOM(new File("/home/sam/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8");  /*************************/
 
             if(style_doc == null)
@@ -117,7 +120,7 @@
 
             // not sure what to do here - some code from Transforming Receptionist
-            String transformed = transformer.transformToString(style_doc, d);
+            //String transformed = transformer.transformToString(style_doc, d);
             logger.error("About to transform");
-            //Node transformed = (Node) transformer.transform(style_doc, d);  // Failing org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. ; SystemID: file:///home/sam/greenstone3/packages/tomcat/bin/dummy.xsl
+            Node transformed = (Node) transformer.transform(style_doc, d);  // Failing org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. ; SystemID: file:///home/sam/greenstone3/packages/tomcat/bin/dummy.xsl
 
             logger.error("Transform successful?");
@@ -125,4 +128,8 @@
             if(transformed==null)  // not null
                 logger.error("TRANSFORMED IS NULL");
+
+            if(transformed.getNodeType() == Node.DOCUMENT_NODE)
+                transformed = ((Document)transformed).getDocumentElement(); 
+            logger.error("Node type: "+transformed.getNodeType());
 
             //logger.error("begin import"); 
@@ -134,6 +141,6 @@
  
             Element format = this.doc.createElement(GSXML.FORMAT_STRING_ELEM);
-            GSXML.setNodeText(format, transformed);
-            //format.appendChild(transformed);
+            //GSXML.setNodeText(format, transformed);
+            format.appendChild(this.doc.importNode(transformed,true));
             //format.setNodeValue(transformed);
             mr_request.appendChild(format); 
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java	(revision 24007)
@@ -44,4 +44,7 @@
 import org.apache.log4j.*;
 
+// Apache Commons
+import org.apache.commons.lang3.*;
+
 /**
  * Represents a collection in Greenstone. A collection is an extension of
@@ -65,5 +68,8 @@
     /** time when this collection was built */
     protected long lastmodified = 0;
-    
+    /** earliestDatestamp of this collection. Necessary for OAI */
+    protected long earliestDatestamp = 0;
+
+
     /** An element containing the serviceRackList element of buildConfig.xml, used to determine whether it contains
      *  the OAIPMH serviceRack 
@@ -130,8 +136,14 @@
 	return is_public;
     }
-    //used by the OAIReceptionist to find out the earliest datestamp amongst all oai collections in the repository
+    // Not used anymore by the OAIReceptionist to find out the earliest datestamp 
+    // amongst all oai collections in the repository. May be useful generally.
     public long getLastmodified() {
       return lastmodified;
     }
+    //used by the OAIReceptionist to find out the earliest datestamp amongst all oai collections in the repository
+    public long getEarliestDatestamp() {
+	return earliestDatestamp;
+    }
+
     /** whether the service_map in ServiceCluster.java contains the service 'OAIPMH'
      *  11/06/2007 xiao
@@ -176,5 +188,5 @@
 	    build_config_elem = build_config_doc.getDocumentElement();
 	}
-  
+
 	lastmodified = build_config_file.lastModified();
   
@@ -211,8 +223,8 @@
         addPlugins(plugin_list);
         if (plugin_list != null){
-          Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlug");
+          Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlugin");
           if (plugin_elem != null) {
             //get the option
-            Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-tidy_html");
+            Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-use_realistic_book");
             if (option_elem != null) {
               useBook = true;
@@ -261,5 +273,30 @@
       } else {
 	has_oai = true;
+	
+	// extract earliestDatestamp from the buildconfig.xml for OAI
+	Element metadata_list = (Element)GSXML.getChildByTagName(build_config_xml, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
+
+	if(metadata_list != null) {
+	    NodeList children = metadata_list.getElementsByTagName(GSXML.METADATA_ELEM); 
+	           // can't do getChildNodes(), because whitespace, such as newlines, creates Text nodes
+	    for (int i = 0; i < children.getLength(); i++) {
+		Element metadata = (Element)children.item(i);
+		if(metadata.getAttribute(GSXML.NAME_ATT).equals(OAIXML.EARLIEST_DATESTAMP)) {
+		    String earliestDatestampStr = GSXML.getValue(metadata);
+		    if(!earliestDatestampStr.equals("")) {
+			earliestDatestamp = Long.parseLong(earliestDatestampStr);
+		    }
+		    break; // found a metadata element with name=earliestDatestamp in buildconfig
+		}
+	    }
+	}
+	
+	// If at the end of this, there is no value for earliestDatestamp, print out a warning
+	logger.warn("No earliestDatestamp in buildConfig.xml for collection: " + this.cluster_name + ". Defaulting to 0.");
+
       }
+    } else { // no list of services (no ServiceRackList), so no oai_service_rack either
+	// explicitly set has_oai to false here, since it's initialised to true by default
+	has_oai = false;
     }
     return true;
@@ -275,6 +312,6 @@
 		Element d = (Element) displaynodes.item(k);
 		String text = GSXML.getNodeText(d);
-		text = text.replaceAll("_httpsite_", http_site);
-		text = text.replaceAll("_httpcollection_", http_collection);
+		text = StringUtils.replace(text, "_httpsite_", http_site);
+		text = StringUtils.replace(text, "_httpcollection_", http_collection);
 		GSXML.setNodeText(d, text);
 	    }
@@ -338,6 +375,6 @@
 
         Element format_element = (Element) GSXML.getChildByTagName(request, GSXML.FORMAT_STRING_ELEM);
-        String format_string = GSXML.getNodeText(format_element);
-        //Element format_statement = (Element) format_element.getFirstChild();
+        //String format_string = GSXML.getNodeText(format_element);
+        Element format_statement = (Element) format_element.getFirstChild();
 
         //logger.error("Format string: " + format_string);
@@ -394,5 +431,5 @@
 
                 // Write format statement
-                //String format_string = GSXML.xmlNodeToString(format_statement);
+                String format_string = this.converter.getString(format_statement); //GSXML.xmlNodeToString(format_statement);
                 writer = new BufferedWriter(new FileWriter(format_statement_filename));
                 writer.write(format_string);
@@ -416,13 +453,13 @@
 
                 // Convert format string to a document
-                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-                DocumentBuilder builder = factory.newDocumentBuilder();
+                //DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                //DocumentBuilder builder = factory.newDocumentBuilder();
                 //String input = "<html><head><title></title></head><body>" + format_string + "</body></html>";
-                String input = format_string.substring(0,format_string.length()-1)+"</xml>";
-                logger.error(input);
-                InputSource is = new InputSource( new StringReader( input ) );
-                logger.error("About to parse format string");
-                Document format_statement = (Document) builder.parse( is );
-                logger.error("Done parsing format string");
+                //String input = format_string.substring(0,format_string.length()-1)+"</xml>";
+                //logger.error(input);
+                //InputSource is = new InputSource( new StringReader( input ) );
+                //logger.error("About to parse format string");
+                //Document format_statement = (Document) builder.parse( is );
+                //logger.error("Done parsing format string");
 
                 // open collectionConfig.xml and read in to w3 Document
@@ -488,11 +525,16 @@
 
                 // append new but we have a string!
-                GSXML.setNodeText(elem, format_string);
-
-                //current_node_list = format_statement.getChildNodes();
-                //for(k=0; k<current_node_list.getLength(); k++)
-                //{
-                //    current_node = elem.appendChild(current_node_list.item(k));
-                //}
+                //GSXML.setNodeText(elem, "THIS IS A TEST");
+                //GSXML.setNodeText(elem, format_string);
+
+                current_node_list = format_statement.getChildNodes();
+                for(k=0; k<current_node_list.getLength(); k++)
+                {
+                    //if(transformed.getNodeType() == Node.DOCUMENT_NODE)
+                //transformed = ((Document)transformed).getDocumentElement();
+                    logger.error("Node type: "+current_node_list.item(k).getNodeType());
+                    if(current_node_list.item(k).getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
+                        current_node = elem.appendChild(this.doc.importNode(current_node_list.item(k),true));
+                }
 
                 //String text = GSXML.getNodeText(elem);
@@ -503,5 +545,5 @@
 
                 // Now convert config document to string for writing to file
-                String new_config = GSXML.xmlNodeToString(config);
+                String new_config = this.converter.getString(config);
     
                 // Write to file (not original! for now)
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java	(revision 24007)
@@ -17,145 +17,152 @@
 
 /** The default greenstone receptionist - needs some extra info for each page
- */
+*/
 public class DefaultReceptionist extends TransformingReceptionist {
 
-     static Logger logger = Logger.getLogger(org.greenstone.gsdl3.core.DefaultReceptionist.class.getName());
-    
-  /** add in the collection description to the page, then for each service, add in the service description */
-    protected void addExtraInfo(Element page) {
-      super.addExtraInfo(page);
+	static Logger logger = Logger.getLogger(org.greenstone.gsdl3.core.DefaultReceptionist.class.getName());
 	
-	Element page_request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM);
-	// if it is a system request, then we don't bother with this.
-	String action = page_request.getAttribute(GSXML.ACTION_ATT);
-	if (action.equals("s")) {
-	    logger.error("HACK: don't ask for coll info if system action");
-	    return;
+	/** add in the collection description to the page, then for each service, add in the service description */
+	protected void addExtraInfo(Element page) {
+		super.addExtraInfo(page);
+		
+		Element page_request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM);
+		// if it is a system request, then we don't bother with this.
+		String action = page_request.getAttribute(GSXML.ACTION_ATT);
+		if (action.equals("s")) {
+			logger.error("HACK: don't ask for coll info if system action");
+			return;
+		}
+		logger.debug("add extra info, page request="+this.converter.getString(page_request));
+		// is a collection defined?
+		Element param_list = (Element)GSXML.getChildByTagName(page_request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
+		if (param_list==null) { // must be the original home page
+			logger.debug(" no param list, assuming home page");
+			return;
+		}
+		Element coll_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, GSParams.COLLECTION);
+		if (coll_param == null) {
+			logger.debug(" coll param is null, returning");
+			return;
+		}
+
+		// see if the collection/cluster element is already there
+		String coll_name = coll_param.getAttribute(GSXML.VALUE_ATT);
+		String lang = page_request.getAttribute(GSXML.LANG_ATT);
+		String uid = page_request.getAttribute(GSXML.USER_ID_ATT);
+		
+		if (coll_name.equals("")) {
+			Element pc_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, "p.c");
+			if(pc_param != null)
+			{
+				coll_name = pc_param.getAttribute(GSXML.VALUE_ATT);
+			}
+		}
+		
+		boolean get_service_description = false;
+		Element page_response = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_RESPONSE_ELEM);
+		if (this.language_list != null) {
+			page_response.appendChild(this.language_list);
+		}
+		Element coll_description = (Element)GSXML.getChildByTagName(page_response, GSXML.COLLECTION_ELEM);
+		if (coll_description == null) {
+			// try cluster
+			coll_description = (Element)GSXML.getChildByTagName(page_response, GSXML.CLUSTER_ELEM);
+		}
+		if (coll_description == null) { 
+		
+			// we dont have one yet - get it
+			Element coll_about_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
+			Element coll_about_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE,  coll_name, lang, uid);
+			coll_about_message.appendChild(coll_about_request);
+			
+			Node coll_about_response_message = this.mr.process(coll_about_message);
+			Element coll_about_response = (Element)GSXML.getChildByTagName(coll_about_response_message, GSXML.RESPONSE_ELEM);
+			if (coll_about_response == null) {
+				return;
+			}
+			coll_description = (Element)GSXML.getChildByTagName(coll_about_response, GSXML.COLLECTION_ELEM);
+			if (coll_description==null) { // may be a cluster
+				coll_description = (Element)GSXML.getChildByTagName(coll_about_response, GSXML.CLUSTER_ELEM);
+			}
+			
+			if (coll_description == null) {
+				logger.error(" no collection description, returning");
+				return;
+			}
+			// have found one, append it to the page response
+			coll_description = (Element)this.doc.importNode(coll_description, true);
+			page_response.appendChild(coll_description);
+			get_service_description = true;
+		}
+
+		// have got a coll description
+		// now get the dispay info for the services
+		Element service_list = (Element)GSXML.getChildByTagName(coll_description, GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER);
+		if (service_list == null) {
+			logger.error(" no service list, returning");
+			// something weird has gone wrong
+			return;
+		}
+
+		NodeList services = service_list.getElementsByTagName(GSXML.SERVICE_ELEM);
+		if (services.getLength()==0) {
+			logger.error("DefaultReceoptionist: no services found for colllection/cluster "+ coll_name);
+			return;
+		}
+		// check one service for display items
+		if (!get_service_description) {
+			// we dont know yet if we need to get these
+			int i=1;
+			Element test_s = (Element)services.item(0);
+			while (i<services.getLength() && (test_s.getAttribute(GSXML.TYPE_ATT).equals(GSXML.SERVICE_TYPE_RETRIEVE) || test_s.getAttribute(GSXML.TYPE_ATT).equals(GSXML.SERVICE_TYPE_OAI))) {
+				test_s = (Element)services.item(i); i++;
+			}
+			if (i==services.getLength()) {
+				// we have only found retrieve or oai services, so dont need descripitons anyway
+				return;
+			}
+			if (GSXML.getChildByTagName(test_s, GSXML.DISPLAY_TEXT_ELEM) !=null) {
+				// have got descriptions already, 
+				return;
+			}
+		}
+
+		// if get here, we need to get the service descriptions
+		
+		// we will send all the requests in a single message
+		Element info_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
+		for (int i=0; i<services.getLength(); i++) {
+			Element c = (Element)services.item(i);
+			String name = c.getAttribute(GSXML.NAME_ATT);
+			String address = GSPath.appendLink(coll_name, name);
+			Element info_request = GSXML.createBasicRequest(this.doc,  GSXML.REQUEST_TYPE_DESCRIBE, address, lang, uid);
+			//Element req_param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
+			//req_param_list.appendChild(GSXML.createParameter(this.doc, GSXML.SUBSET_PARAM, GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER));
+			//info_request.appendChild(req_param_list);
+			info_message.appendChild(info_request);
+			
+		}
+
+		Element info_response = (Element)this.mr.process(info_message);
+
+		NodeList service_responses = info_response.getElementsByTagName(GSXML.RESPONSE_ELEM);
+		// check that have same number of responses as collections
+		if (services.getLength() != service_responses.getLength()) {
+			logger.error(" didn't get a response for each service - somethings gone wrong!");
+			// for now, dont use the metadata
+		} else {
+			for (int i=0; i<services.getLength(); i++) {
+				Element c1 = (Element)services.item(i);
+				Element c2 = (Element)GSXML.getChildByTagName((Element)service_responses.item(i), GSXML.SERVICE_ELEM);
+				if (c1 !=null && c2 !=null && c1.getAttribute(GSXML.NAME_ATT).equals(c2.getAttribute(GSXML.NAME_ATT))) {
+					//add the service data into the original response
+					GSXML.mergeElements(c1, c2);
+				} else {
+					logger.debug(" response does not correspond to request!");
+				} 
+				
+			}
+		}
 	}
-	logger.debug("add extra info, page request="+this.converter.getString(page_request));
-	// is a collection defined?
-	Element param_list = (Element)GSXML.getChildByTagName(page_request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
-	if (param_list==null) { // must be the original home page
-	    logger.debug(" no param list, assuming home page");
-	    return;
-	}
-	Element coll_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, GSParams.COLLECTION);
-	if (coll_param == null) {
-	    logger.debug(" coll param is null, returning");
-	    return;
-	}
-
-	// see if the collection/cluster element is already there
-	String coll_name = coll_param.getAttribute(GSXML.VALUE_ATT);
-	String lang = page_request.getAttribute(GSXML.LANG_ATT);
-	String uid = page_request.getAttribute(GSXML.USER_ID_ATT);
-	
-	boolean get_service_description = false;
-	Element page_response = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_RESPONSE_ELEM);
-	if (this.language_list != null) {
-	    page_response.appendChild(this.language_list);
-	}
-	Element coll_description = (Element)GSXML.getChildByTagName(page_response, GSXML.COLLECTION_ELEM);
-	if (coll_description == null) {
-	    // try cluster
-	    coll_description = (Element)GSXML.getChildByTagName(page_response, GSXML.CLUSTER_ELEM);
-	}
-	if (coll_description == null) { 
-	    // we dont have one yet - get it
-	    Element coll_about_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
-	    Element coll_about_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE,  coll_name, lang, uid);
-	    coll_about_message.appendChild(coll_about_request);
-	    
-	    Node coll_about_response_message = this.mr.process(coll_about_message);
-	    Element coll_about_response = (Element)GSXML.getChildByTagName(coll_about_response_message, GSXML.RESPONSE_ELEM);
-	    if (coll_about_response == null) {
-		return;
-	    }
-	    coll_description = (Element)GSXML.getChildByTagName(coll_about_response, GSXML.COLLECTION_ELEM);
-	    if (coll_description==null) { // may be a cluster
-		coll_description = (Element)GSXML.getChildByTagName(coll_about_response, GSXML.CLUSTER_ELEM);
-	    }
-	    
-	    if (coll_description == null) {
-		logger.error(" no collection description, returning");
-		return;
-	    }
-	    // have found one, append it to the page response
-	    coll_description = (Element)this.doc.importNode(coll_description, true);
-	    page_response.appendChild(coll_description);
-	    get_service_description = true;
-	}
-
-	// have got a coll description
-	
-	// now get the dispay info for the services
-	Element service_list = (Element)GSXML.getChildByTagName(coll_description, GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER);
-	if (service_list == null) {
-	    logger.error(" no service list, returning");
-	    // something weird has gone wrong
-	    return;
-	}
-
-	NodeList services = service_list.getElementsByTagName(GSXML.SERVICE_ELEM);
-	if (services.getLength()==0) {
-	    logger.error("DefaultReceoptionist: no services found for colllection/cluster "+ coll_name);
-	    return;
-	}
-	// check one service for display items
-	if (!get_service_description) {
-	    // we dont know yet if we need to get these
-	    int i=1;
-	    Element test_s = (Element)services.item(0);
-	    while (i<services.getLength() && (test_s.getAttribute(GSXML.TYPE_ATT).equals(GSXML.SERVICE_TYPE_RETRIEVE) || test_s.getAttribute(GSXML.TYPE_ATT).equals(GSXML.SERVICE_TYPE_OAI))) {
-		test_s = (Element)services.item(i); i++;
-	    }
-	    if (i==services.getLength()) {
-		// we have only found retrieve or oai services, so dont need descripitons anyway
-		return;
-	    }
-	    if (GSXML.getChildByTagName(test_s, GSXML.DISPLAY_TEXT_ELEM) !=null) {
-		// have got descriptions already, 
-		return;
-	    }
-	}
-
-	// if get here, we need to get the service descriptions
-	    
-	// we will send all the requests in a single message
-	Element info_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
-	for (int i=0; i<services.getLength(); i++) {
-	    Element c = (Element)services.item(i);
-	    String name = c.getAttribute(GSXML.NAME_ATT);
-	    String address = GSPath.appendLink(coll_name, name);
-	    Element info_request = GSXML.createBasicRequest(this.doc,  GSXML.REQUEST_TYPE_DESCRIBE, address, lang, uid);
-	    Element req_param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
-	    req_param_list.appendChild(GSXML.createParameter(this.doc, GSXML.SUBSET_PARAM, GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER));
-	    info_request.appendChild(req_param_list);
-	    info_message.appendChild(info_request);
-	    
-	}
-
-	Element info_response = (Element)this.mr.process(info_message);
-
-	NodeList service_responses = info_response.getElementsByTagName(GSXML.RESPONSE_ELEM);
-	// check that have same number of responses as collections
-	if (services.getLength() != service_responses.getLength()) {
-	    logger.error(" didn't get a response for each service - somethings gone wrong!");
-	    // for now, dont use the metadata
-	} else {
-	    for (int i=0; i<services.getLength(); i++) {
-		Element c1 = (Element)services.item(i);
-		Element c2 = (Element)GSXML.getChildByTagName((Element)service_responses.item(i), GSXML.SERVICE_ELEM);
-		if (c1 !=null && c2 !=null && c1.getAttribute(GSXML.NAME_ATT).equals(c2.getAttribute(GSXML.NAME_ATT))) {
-		    //add the service data into the original response
-		    GSXML.mergeElements(c1, c2);
-		} else {
-		    logger.debug(" response does not correspond to request!");
-		} 
-		
-	    }
-	}
-	
-    }
 }
 
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java	(revision 24007)
@@ -44,4 +44,6 @@
 
 import org.apache.log4j.*;
+
+import org.apache.commons.lang3.StringUtils;
 
 /**
@@ -271,5 +273,5 @@
         // be passed to multiple modules  - they will be in a comma 
         // separated list in the 'to' attribute
-        String [] modules = path.split(",");
+        String [] modules = StringUtils.split(path, ",");
         
         for (int j=0; j<modules.length; j++) {
@@ -619,6 +621,8 @@
           //The collection name is returned as site_name:coll_name, which is in fact the set specification
           ane.setAttribute(GSXML.NAME_ATT, site_name + ":" + col_name);
-          ane.setAttribute(OAIXML.LASTMODIFIED, "" + c.getLastmodified());
-          
+          ane.setAttribute(OAIXML.LASTMODIFIED, "" + c.getLastmodified()); 
+	       // lastmodified not of use anymore for OAI, perhaps useful as general information
+	  ane.setAttribute(OAIXML.EARLIEST_DATESTAMP, "" + c.getEarliestDatestamp()); // for OAI
+
           this.oai_collection_list.appendChild(ane);
           //logger.info(GSXML.xmlNodeToString(oai_collection_list));
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java	(revision 24007)
@@ -296,5 +296,5 @@
        *  Use the time value plus the current system time to get the expiration date string.
        */
-      String expiration_date = OAIXML.getTime(System.currentTimeMillis() + OAIXML.getTokenExpiration());
+	String expiration_date = OAIXML.getTime(System.currentTimeMillis() + OAIXML.getTokenExpiration()); // in milliseconds
       token.setAttribute(OAIXML.EXPIRATION_DATE, expiration_date);
     }
@@ -339,9 +339,32 @@
     
     HashMap param_map = OAIXML.getParamMap(params);    
-    if (!isValidParam(param_map, valid_strs) ||
-        !param_map.containsKey(OAIXML.METADATA_PREFIX)) {
-      logger.error("contains invalid params or no metadataPrefix");
-      return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+    if (!isValidParam(param_map, valid_strs)) {
+	logger.error("One of the params is invalid");
+	return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
     } 
+    // param keys are valid, but if there are any date params, check they're of the right format
+    String from = (String)param_map.get(OAIXML.FROM);
+    if(from != null) {	
+	Date from_date = OAIXML.getDate(from);
+	if(from_date == null) {
+	    logger.error("invalid date: " + from);
+	    return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+	}
+    }
+    String until = (String)param_map.get(OAIXML.UNTIL);
+    if(until != null) {	
+	Date until_date = OAIXML.getDate(until);
+	if(until_date == null) {
+	    logger.error("invalid date: " + until);
+	    return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+	} 
+    }    
+    if(from != null && until != null) { // check they are of the same date-time format (granularity)
+	if(from.length() != until.length()) {
+	    logger.error("The request has different granularities (date-time formats) for the From and Until date parameters.");
+	    return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+	}
+    }
+
     //ask the message router for a list of oai collections
     NodeList oai_coll = getOAICollectionList();
@@ -350,10 +373,4 @@
       logger.info("returned oai collection list is empty");
       return getMessage(OAIXML.createErrorElement(OAIXML.NO_RECORDS_MATCH, ""));
-    }
-    //Now that we got a prefix, check and see if it's supported by this repository
-    String prefix_value = (String)param_map.get(OAIXML.METADATA_PREFIX);
-    if (containsMetadataPrefix(prefix_value) == false) {
-      logger.error("requested prefix is not found in OAIConfig.xml");
-      return getMessage(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
     }
     
@@ -390,4 +407,18 @@
     }
     
+    // Custom test that expects a metadataPrefix comes here at end so that the official params can
+    // be tested first for errors and their error responses sent off. Required for OAI validation
+    if (!param_map.containsKey(OAIXML.METADATA_PREFIX)) {
+      logger.error("contains invalid params or no metadataPrefix");
+      return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+    }    
+    
+    //Now that we got a prefix, check and see if it's supported by this repository
+    String prefix_value = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    if (containsMetadataPrefix(prefix_value) == false) {
+      logger.error("requested prefix is not found in OAIConfig.xml");
+      return getMessage(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
+    }
+
     //Now that all validation has been done, I hope, we can send request to the message router
     Element result = null;
@@ -519,14 +550,32 @@
     
     HashMap param_map = OAIXML.getParamMap(params);    
-    if (!isValidParam(param_map, valid_strs) ||
-        !param_map.containsKey(OAIXML.METADATA_PREFIX)) {
-      // it must have a metadataPrefix
-      /** Here I disagree with the OAI specification: even if a resumptionToken is 
-       *  included in the request, the metadataPrefix is a must argument. Otherwise
-       *  how would we know what metadataPrefix the harvester requested in his last request?
-       */
-      logger.error("no metadataPrefix");
-      return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
-    } 
+    if (!isValidParam(param_map, valid_strs)) {
+	logger.error("One of the params is invalid");
+	return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+    }
+    // param keys are valid, but if there are any date params, check they're of the right format
+    String from = (String)param_map.get(OAIXML.FROM);
+    if(from != null) {	
+	Date from_date = OAIXML.getDate(from);
+	if(from_date == null) {
+	    logger.error("invalid date: " + from);
+	    return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+	}
+    }
+    String until = (String)param_map.get(OAIXML.UNTIL);
+    Date until_date = null;
+    if(until != null) {	
+	until_date = OAIXML.getDate(until);
+	if(until_date == null) {
+	    logger.error("invalid date: " + until);
+	    return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+	} 
+    }
+    if(from != null && until != null) { // check they are of the same date-time format (granularity)
+	if(from.length() != until.length()) {
+	    logger.error("The request has different granularities (date-time formats) for the From and Until date parameters.");
+	    return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+	}
+    }
     
     //ask the message router for a list of oai collections
@@ -536,11 +585,4 @@
       logger.info("returned oai collection list is empty");
       return getMessage(OAIXML.createErrorElement(OAIXML.NO_RECORDS_MATCH, ""));
-    }
-    
-    //Now that we got a prefix, check and see if it's supported by this repository
-    String prefix_value = (String)param_map.get(OAIXML.METADATA_PREFIX);
-    if (containsMetadataPrefix(prefix_value) == false) {
-      logger.error("requested prefix is not found in OAIConfig.xml");
-      return getMessage(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
     }
     
@@ -585,4 +627,25 @@
       }
     }
+
+    // Moved the additional custom test that mandates the metadataPrefix here, since official
+    // errors should be caught first, so that their error responses can be sent off first
+    // such that GS2's oaiserver will validate properly.
+    if (!param_map.containsKey(OAIXML.METADATA_PREFIX)) {
+      // it must have a metadataPrefix
+      /** Here I disagree with the OAI specification: even if a resumptionToken is 
+       *  included in the request, the metadataPrefix is a must argument. Otherwise
+       *  how would we know what metadataPrefix the harvester requested in his last request?
+       */
+      logger.error("no metadataPrefix");
+      return getMessage(OAIXML.createErrorElement(OAIXML.BAD_ARGUMENT, ""));
+    }
+        
+    //Now that we got a prefix, check and see if it's supported by this repository
+    String prefix_value = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    if (containsMetadataPrefix(prefix_value) == false) {
+      logger.error("requested prefix is not found in OAIConfig.xml");
+      return getMessage(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
+    }
+
     //Now that all validation has been done, I hope, we can send request to the message router
     Element result = null;
@@ -704,4 +767,7 @@
     }
     Element res_in_result = (Element)GSXML.getChildByTagName(result, OAIXML.RESPONSE);
+    if(res_in_result == null) { // return the results of all other collections accumulated so far
+	return msg;
+    }
     Element verb_elem = (Element)GSXML.getChildByTagName(res_in_result, verb);
     if(msg == null) {
@@ -787,4 +853,8 @@
         // get the names
         strs = splitNames(identifier);
+	if(strs == null || strs.length < 3) {
+	    logger.error("identifier is not in the form site:coll:id" + identifier);
+	    return getMessage(OAIXML.createErrorElement(OAIXML.ID_DOES_NOT_EXIST, ""));
+	}
         String name_of_site = strs[0];
         String coll_name = strs[1];
@@ -831,9 +901,5 @@
     //do the protocol version
     copyElement(identify, OAIXML.PROTOCOL_VERSION);
-    //do the deletedRecord
-    copyElement(identify, OAIXML.DELETED_RECORD);
-    //do the granularity
-    copyElement(identify, OAIXML.GRANULARITY);
-    
+        
     //There can be more than one admin email according to the OAI specification
     NodeList admin_emails = GSXML.getChildrenByTagName(oai_config, OAIXML.ADMIN_EMAIL);
@@ -848,22 +914,17 @@
 
     //do the earliestDatestamp
-    long lastmodified = System.currentTimeMillis();
     //send request to mr to search through the earliest datestamp amongst all oai collections in the repository.
     //ask the message router for a list of oai collections
     NodeList oai_coll = getOAICollectionList();
-    int oai_coll_size = oai_coll.getLength();
-    if (oai_coll_size == 0) {
-      logger.info("returned oai collection list is empty. Set repository earliestDatestamp to be 1970-01-01.");
-      lastmodified = 0;
-    }
-    //the collection build time is determined by the last modified time of the buildConfig.xml file
-    for(int i=0; i<oai_coll_size; i++) {
-      long coll_build_time = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.LASTMODIFIED));
-      lastmodified = (lastmodified > coll_build_time)? coll_build_time : lastmodified;
-    }
-    String earliestDatestamp_str = OAIXML.getTime(lastmodified);
+    long earliestDatestamp = getEarliestDateStamp(oai_coll);
+    String earliestDatestamp_str = OAIXML.getTime(earliestDatestamp);
     Element earliestDatestamp_elem = OAIXML.createElement(OAIXML.EARLIEST_DATESTAMP);
     GSXML.setNodeText(earliestDatestamp_elem, earliestDatestamp_str);
     identify.appendChild(earliestDatestamp_elem);
+
+    //do the deletedRecord
+    copyElement(identify, OAIXML.DELETED_RECORD);
+    //do the granularity
+    copyElement(identify, OAIXML.GRANULARITY);
         
     return getMessage(identify);
@@ -886,4 +947,7 @@
     String [] strs = new String[3];
     int first_colon = identifier.indexOf(":");
+    if(first_colon == -1) {
+	return null;
+    }
     strs[0] = identifier.substring(0, first_colon);
 
@@ -968,3 +1032,24 @@
     return converter.nodeToElement(result_node);
   }
+
+    // See OAIConfig.xml
+    // dynamically works out what the earliestDateStamp is, since it varies by collection
+    // returns this time in *milliseconds*.
+    protected long getEarliestDateStamp(NodeList oai_coll) {
+	//do the earliestDatestamp
+	long earliestDatestamp = System.currentTimeMillis();	
+	int oai_coll_size = oai_coll.getLength();
+	if (oai_coll_size == 0) {
+	    logger.info("returned oai collection list is empty. Setting repository earliestDatestamp to be 1970-01-01.");
+	    earliestDatestamp = 0;
+	}
+	// the earliestDatestamp is now stored as a metadata element in the collection's buildConfig.xml file
+	// we get the earliestDatestamp among the collections
+	for(int i=0; i<oai_coll_size; i++) {
+	    long coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.EARLIEST_DATESTAMP));
+	    earliestDatestamp = (earliestDatestamp > coll_earliestDatestamp)? coll_earliestDatestamp : earliestDatestamp;
+	}
+
+	return earliestDatestamp*1000; // converting from seconds to milliseconds
+    }
 }
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 24007)
@@ -7,7 +7,10 @@
 import org.w3c.dom.Node; 
 import org.w3c.dom.NodeList; 
+import org.w3c.dom.Comment;
+import org.w3c.dom.Text;
 import org.w3c.dom.Document; 
 import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
+import org.w3c.dom.NamedNodeMap;
 
 // other java classes
@@ -26,4 +29,6 @@
 import org.apache.xerces.dom.*;
 import org.apache.xerces.parsers.DOMParser;
+
+import org.apache.commons.lang3.StringUtils;
 
 /** A receptionist that uses xslt to transform the page_data before returning it. . Receives requests consisting
@@ -81,5 +86,5 @@
   public boolean configure() {
 	
-    if (this.config_params==null) {
+   if (this.config_params==null) {
       logger.error(" config variables must be set before calling configure");
       return false;
@@ -200,8 +205,13 @@
 	else if(excerptTag != null)
 	{
+		/*
         // define a list
         
 		Node selectedElement = modifyNodesByTagRecursive(transformed_page, excerptTag);
+		*/
+		
+		Node selectedElement = getNodeByTagRecursive(transformed_page, excerptTag);
 		return selectedElement;
+		
 	}
 	return transformed_page;
@@ -279,19 +289,128 @@
    * before transforming */
   protected Node transformPage(Element page) {
-
+  	
+	boolean allowsClientXSLT = (Boolean)config_params.get(GSConstants.ALLOW_CLIENT_SIDE_XSLT);
+	//System.out.println("Client side transforms allowed? " + allowsClientXSLT);
+
+	String currentInterface = (String)config_params.get(GSConstants.INTERFACE_NAME);
+
+	Element request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM);
+	String output = request.getAttribute(GSXML.OUTPUT_ATT);
+
+	//System.out.println("Current output mode is: " + output + ", current interface name is: " + currentInterface);
+
+	if(allowsClientXSLT) {
+		if(!currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX) && output.equals("html"))
+		{
+			System.out.println("output is html and we are not currently using a client side version, switching");
+			// Switch the interface
+			config_params.put(GSConstants.INTERFACE_NAME, currentInterface.concat(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX));
+		}
+		else if((currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX) && !output.equals("html")) || output.equals("server"))
+		{
+			// The reverse needs to happen too
+			config_params.put(GSConstants.INTERFACE_NAME, currentInterface.substring(0, currentInterface.length() - GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX.length()));
+		}
+	}
+	else if (currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX))
+	{
+		config_params.put(GSConstants.INTERFACE_NAME, currentInterface.substring(0, currentInterface.length() - GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX.length()));
+	}
+  	
+    // DocType defaults in case the skin doesn't have an "xsl:output" element
+    String qualifiedName = "html";
+    String publicID = "-//W3C//DTD HTML 4.01 Transitional//EN";
+    String systemID = "http://www.w3.org/TR/html4/loose.dtd";
+		
+    // We need to create an empty document with a predefined DocType,
+    // that will then be used for the transformation by the DOMResult
+    Document docWithDoctype = converter.newDOM(qualifiedName, publicID, systemID);		
+		
+	if(output.equals("xsltclient")) {
+	// If you're just getting the client-side transform page, why bother with the rest of this?
+	Element html = docWithDoctype.createElement("html");
+	 Element img = docWithDoctype.createElement("img");
+	 img.setAttribute("src", "interfaces/default/images/loading.gif"); // Make it dynamic
+	 img.setAttribute("alt", "Please wait...");
+	 Text title_text = docWithDoctype.createTextNode("Please wait..."); // Make this language dependent
+	 Element head = docWithDoctype.createElement("head");
+	 Element title = docWithDoctype.createElement("title");
+	 title.appendChild(title_text);
+	 Element body = docWithDoctype.createElement("body");
+	 Element script = docWithDoctype.createElement("script");
+	 Element jquery = docWithDoctype.createElement("script");
+	 jquery.setAttribute("src", "jquery.js");
+	 jquery.setAttribute("type", "text/javascript");
+	 Comment jquery_comment = docWithDoctype.createComment("jQuery");
+	 Comment script_comment = docWithDoctype.createComment("Filler for browser");
+	 script.setAttribute("src", "test.js");
+	 script.setAttribute("type", "text/javascript");
+	 Element pagevar = docWithDoctype.createElement("script");
+	 Element style = docWithDoctype.createElement("style");
+	 style.setAttribute("type", "text/css");
+	 Text style_text = docWithDoctype.createTextNode("body { text-align: center; padding: 50px; font: 14pt Arial, sans-serif; font-weight: bold; }");
+	 pagevar.setAttribute("type", "text/javascript");
+	 Text page_var_text = docWithDoctype.createTextNode("var placeholder = true;");
+	 
+	 html.appendChild(head);
+	 head.appendChild(title);
+	 head.appendChild(style);
+	 style.appendChild(style_text);
+	 html.appendChild(body);
+	 head.appendChild(pagevar);
+	 head.appendChild(jquery);
+	 head.appendChild(script);
+	 pagevar.appendChild(page_var_text);
+	 jquery.appendChild(jquery_comment);
+	 script.appendChild(script_comment);
+	 body.appendChild(img);
+	 docWithDoctype.appendChild(html);
+	 
+	 return (Node)docWithDoctype;
+	 }
+
+    // Passing in the pretty string here means it needs to be generated even when not debugging; so use custom function to return blank when debug is off
     logger.debug("page before transforming:");
-    logger.debug(this.converter.getPrettyString(page));
-
-    Element request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM);
+    logger.debug(this.converter.getPrettyStringLogger(page, logger));
+
     String action = request.getAttribute(GSXML.ACTION_ATT);
     String subaction = request.getAttribute(GSXML.SUBACTION_ATT);
-		
-    String output = request.getAttribute(GSXML.OUTPUT_ATT);
+
     // we should choose how to transform the data based on output, eg diff
     // choice for html, and wml??
     // for now, if output=xml, we don't transform the page, we just return 
     // the page xml
-    if (output.equals("xml")) {
-      return page;
+    Document theXML = null;
+    
+    if (output.equals("xml") || output.equals("clientside")) {
+      // Append some bits and pieces first...
+      theXML = converter.newDOM();
+      // Import into new document first!
+      Node newPage = theXML.importNode(page, true);
+      theXML.appendChild(newPage);
+      Element root = theXML.createElement("xsltparams");
+      newPage.appendChild(root);
+      
+      Element libname = theXML.createElement("param");
+      libname.setAttribute("name", "library_name");
+      Text libnametext = theXML.createTextNode((String)config_params.get(GSConstants.LIBRARY_NAME));
+      libname.appendChild(libnametext);
+      
+      Element intname = theXML.createElement("param");
+      intname.setAttribute("name", "interface_name");
+      Text intnametext = theXML.createTextNode((String)config_params.get(GSConstants.INTERFACE_NAME));
+      intname.appendChild(intnametext);
+	  
+	  Element filepath = theXML.createElement("param");
+	  filepath.setAttribute("name", "filepath");
+	  Text filepathtext = theXML.createTextNode(GlobalProperties.getGSDL3Home());
+	  filepath.appendChild(filepathtext);
+      
+      root.appendChild(libname);
+      root.appendChild(intname);   
+	  root.appendChild(filepath);
+      
+      if(output.equals("xml"))
+      return theXML.getDocumentElement();
     }
 		
@@ -300,5 +419,6 @@
     String collection = "";
     if (cgi_param_list != null) {
-      HashMap params = GSXML.extractParams(cgi_param_list, false);
+      // Don't waste time getting all the parameters
+      HashMap params = GSXML.extractParams(cgi_param_list, false, GSParams.COLLECTION);
       collection = (String)params.get(GSParams.COLLECTION);
       if (collection == null) collection = "";
@@ -314,6 +434,5 @@
     String errorPage = this.converter.getParseErrorMessage();
     if(errorPage != null) {
-      return XMLTransformer.constructErrorXHTMLPage(
-						    "Cannot parse the xslt file: " + xslt_file + "\n" + errorPage);
+      return XMLTransformer.constructErrorXHTMLPage("Cannot parse the xslt file: " + xslt_file + "\n" + errorPage);
     }
     if (style_doc == null) {
@@ -335,12 +454,13 @@
     if (format_elem != null) {
       //page_response.removeChild(format_elem);
-      logger.debug("format elem="+this.converter.getPrettyString(format_elem));
+      logger.debug("format elem="+this.converter.getPrettyStringLogger(format_elem, logger));
       // need to transform the format info
       String configStylesheet_file = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.SITE_NAME), collection, (String)this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces,   "config_format.xsl");
       Document configStylesheet_doc = this.converter.getDOM(new File(configStylesheet_file));
+
       if (configStylesheet_doc != null) {
 	Document format_doc = this.converter.newDOM();
 	format_doc.appendChild(format_doc.importNode(format_elem, true));
-	Node result = this.transformer.transform(configStylesheet_doc, format_doc);
+	Node result = this.transformer.transform(configStylesheet_doc, format_doc); // Needs addressing <-
 				
 	// Since we started creating documents with DocTypes, we can end up with 
@@ -353,5 +473,5 @@
 	  new_format = (Element)result;
 	}
-	logger.debug("new format elem="+this.converter.getPrettyString(new_format));
+	logger.debug("new format elem="+this.converter.getPrettyStringLogger(new_format, logger));
 	if (output.equals("newformat")) {
 	  return new_format;
@@ -370,5 +490,5 @@
       }
       logger.debug("the converted stylesheet is:");
-      logger.debug(this.converter.getPrettyString(style_doc.getDocumentElement()));
+      logger.debug(this.converter.getPrettyStringLogger(style_doc.getDocumentElement(), logger));
     }
 		
@@ -377,5 +497,5 @@
 
 
-    Document preprocessingXsl  ;
+    Document preprocessingXsl;
     try {
       preprocessingXsl = getPreprocessDoc();
@@ -537,15 +657,25 @@
       return converter.getDOM(getStringFromDocument(skinAndLibraryXsl));
     }
-    if (output.equals("skinandlibdoc")) {
-      return converter.getDOM(getStringFromDocument(skinAndLibraryDoc));
+    if (output.equals("skinandlibdoc") || output.equals("clientside")) { 	
+    	
+    	Node skinAndLib = converter.getDOM(getStringFromDocument(skinAndLibraryDoc));
+    	
+    	if(output.equals("skinandlibdoc")) {
+      return skinAndLib;
+       } else {
+       	// Send XML and skinandlibdoc down the line together
+       	Document finalDoc = converter.newDOM();
+       	Node finalDocSkin = finalDoc.importNode(skinAndLibraryDoc.getDocumentElement(), true);
+       	Node finalDocXML = finalDoc.importNode(theXML.getDocumentElement(), true);
+       	Element root = finalDoc.createElement("skinlibPlusXML");
+       	root.appendChild(finalDocSkin);
+       	root.appendChild(finalDocXML);
+       	finalDoc.appendChild(root);
+       	return (Node)finalDoc.getDocumentElement();
+       }
     }
     if (output.equals("oldskindoc")) {
       return converter.getDOM(getStringFromDocument(oldStyle_doc));
     }
-
-    // DocType defaults in case the skin doesn't have an "xsl:output" element
-    String qualifiedName = "html";
-    String publicID = "-//W3C//DTD HTML 4.01 Transitional//EN";
-    String systemID = "http://www.w3.org/TR/html4/loose.dtd";
 
     // Try to get the system and public ID from the current skin xsl document
@@ -571,22 +701,19 @@
     }
 		
-    // We need to create an empty document with a predefined DocType,
-    // that will then be used for the transformation by the DOMResult
-    Document docWithDoctype = converter.newDOM(qualifiedName, publicID, systemID);
-		
     //System.out.println(converter.getPrettyString(docWithDoctype));
     //System.out.println("Doctype vals: " + qualifiedName + " " + publicID + " " + systemID) ;
 		
+	 docWithDoctype = converter.newDOM(qualifiedName, publicID, systemID);			
 		
     //System.out.println("Generate final HTML from current skin") ;
     //Transformation of the XML message from the receptionist to HTML with doctype
-    return this.transformer.transform(skinAndLibraryDoc, doc, config_params, docWithDoctype);
-		
-		
+
+    return this.transformer.transform(skinAndLibraryDoc, doc, config_params, docWithDoctype); // The default
+	
     // The line below will do the transformation like we use to do before having Skin++ implemented,
     // it will not contain any GS-Lib statements expanded, and the result will not contain any doctype.
 
     //return (Element)this.transformer.transform(style_doc, doc, config_params);  
-
+	//return null; // For now - change later
   }
 	
@@ -606,5 +733,5 @@
 	content = writer.toString();
 	System.out.println("Change the & to &Amp; for proper debug dispay") ;
-	content = content.replaceAll("&", "&amp;");
+	content = StringUtils.replace(content, "&", "&amp;");
 	writer.flush();
       }
@@ -657,7 +784,7 @@
     String stylesheet = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.SITE_NAME), collection, (String)this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces, name);
     if (stylesheet==null) {
-      logger.info(" cant find stylesheet for "+name);
-    }
-    logger.error("stylesheet:"+stylesheet);
+      logger.info(" Can't find stylesheet for "+name);
+    }
+    logger.debug("Stylesheet: "+stylesheet);
     return stylesheet;
   }
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java	(revision 24007)
@@ -44,4 +44,7 @@
 import org.apache.log4j.*;
 
+// Apache Commons
+import org.apache.commons.lang3.*;
+
 /** Implements the generic retrieval and classifier services for GS2 
  * collections.
@@ -150,5 +153,5 @@
 	StringTokenizer st = new StringTokenizer(contains, ";");
 	while (st.hasMoreTokens()) {
-	    String child_id = st.nextToken().replaceAll("\"", node_id);
+	    String child_id = StringUtils.replace(st.nextToken(), "\"", node_id);
 	    children.add(child_id);
 	}
@@ -235,5 +238,5 @@
 	    
 	    String contains = info.getInfo("contains");
-	    contains = contains.replaceAll("\"", parent_id);
+	    contains = StringUtils.replace(contains, "\"", parent_id);
 	    String [] children = contains.split(";");
 	    for (int i=0;i<children.length;i++) {
@@ -475,5 +478,5 @@
 		} else {
 		    String contains = info.getInfo("contains");
-		    contains = contains.replaceAll("\"", parent_id);
+		    contains = StringUtils.replace(contains, "\"", parent_id);
 		    String [] children = contains.split(";");
 		    for (int i=0;i<children.length;i++) {
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java	(revision 24007)
@@ -449,5 +449,4 @@
 
     protected Element processDisplayList(Element request) {
-	// Create a new (empty) result message
      	Hashtable docsMap =  updateDocMap(request);
 
@@ -457,14 +456,14 @@
         Iterator keys = docsMap.keySet().iterator();
 	
-         while(keys.hasNext()){     
-	     String collection = (String)keys.next(); 
-             Hashtable items = (Hashtable)docsMap.get(collection);
-	     Iterator itemItr = items.values().iterator();
-
-             Element collectionNode = this.doc.createElement("collection");
-             collectionNode.setAttribute("name",collection);
-	     result.appendChild(collectionNode);
-
-	     while(itemItr.hasNext()){  
+	while(keys.hasNext()){     
+	    String collection = (String)keys.next(); 
+	    Hashtable items = (Hashtable)docsMap.get(collection);
+	    Iterator itemItr = items.values().iterator();
+	    
+	    Element collectionNode = this.doc.createElement("berryList");
+	    collectionNode.setAttribute("name",collection);
+	    result.appendChild(collectionNode);
+	    
+	    while(itemItr.hasNext()){  
                 Item item = (Item)itemItr.next();
 	        Element itemElement = this.doc.createElement("item");
@@ -476,10 +475,10 @@
 		itemElement.setAttribute("date",item.date);
                	itemElement.setAttribute("root_title",item.rootTitle);                
- 	     }	     
-	 }
+	    }	     
+	}
        
 	return result;
 
-   }
+    }
 
 
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java	(revision 24007)
@@ -33,4 +33,7 @@
 
 import org.apache.log4j.*;
+
+// Apache Commons
+import org.apache.commons.lang3.*;
 
 public class GS2MGRetrieve
@@ -134,5 +137,5 @@
         if (doc_content!=null) {
             // remove any ctrl-c or ctrl-b
-            doc_content = doc_content.replaceAll ("\u0002|\u0003", "");
+            doc_content = StringUtils.replace(doc_content, "\u0002|\u0003", "");
             // replace _httpimg_ with the correct address
             doc_content = resolveTextMacros (doc_content, doc_id, lang);
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java	(revision 24007)
@@ -253,14 +253,14 @@
 
     ArrayList keys = new ArrayList(info.getKeys());
-    String lastmodified = "";
-    if(keys.contains(OAIXML.LASTMODIFIED)) {
-      lastmodified = info.getInfo(OAIXML.LASTMODIFIED);
-    }
-    lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));
+    String oailastmodified = "";
+    if(keys.contains(OAIXML.OAI_LASTMODIFIED)) {
+      oailastmodified = info.getInfo(OAIXML.OAI_LASTMODIFIED);
+      oailastmodified = OAIXML.getTime(Long.parseLong(oailastmodified)*1000); // java wants dates in milliseconds
+    }
 
     Element get_record = OAIXML.createElement(OAIXML.GET_RECORD);
     Element record = OAIXML.createElement(OAIXML.RECORD);
     //compose the header element
-    record.appendChild(createHeaderElement(oid, lastmodified));      
+    record.appendChild(createHeaderElement(oid, oailastmodified));      
     //compose the metadata element
     record.appendChild(createMetadataElement(prefix, info, metadata_format));
@@ -332,11 +332,11 @@
       }
       ArrayList keys = new ArrayList(info.getKeys());
-      String lastmodified = "";
-      if(keys.contains(OAIXML.LASTMODIFIED)) {
-        lastmodified = info.getInfo(OAIXML.LASTMODIFIED);
-      }
-      lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));
+      String oailastmodified = "";
+      if(keys.contains(OAIXML.OAI_LASTMODIFIED)) {
+        oailastmodified = info.getInfo(OAIXML.OAI_LASTMODIFIED);
+	oailastmodified = OAIXML.getTime(Long.parseLong(oailastmodified)*1000); // java wants dates in milliseconds
+      }
       
-      Date this_date = OAIXML.getDate(lastmodified);        
+      Date this_date = OAIXML.getDate(oailastmodified);        
       if (from_date != null) {
         if(this_date.before(from_date)) {
@@ -350,5 +350,5 @@
       }      
       //compose the header element and append it
-      list_identifiers.appendChild(createHeaderElement(oid, lastmodified));      
+      list_identifiers.appendChild(createHeaderElement(oid, oailastmodified));      
     }//end of for(int i=0; i<oid_list.size(); i++) of doing thru each record
     
@@ -418,11 +418,11 @@
       }
       ArrayList keys = new ArrayList(info.getKeys());
-      String lastmodified = "";
-      if(keys.contains(OAIXML.LASTMODIFIED)) {
-        lastmodified = info.getInfo(OAIXML.LASTMODIFIED);
-      }
-      lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));
+      String oailastmodified = "";
+      if(keys.contains(OAIXML.OAI_LASTMODIFIED)) {
+        oailastmodified = info.getInfo(OAIXML.OAI_LASTMODIFIED);
+	oailastmodified = OAIXML.getTime(Long.parseLong(oailastmodified)*1000); // java wants dates in milliseconds
+      }
       
-      Date this_date = OAIXML.getDate(lastmodified);        
+      Date this_date = OAIXML.getDate(oailastmodified);        
       if (from_date != null) {
         if(this_date.before(from_date)) {
@@ -439,5 +439,5 @@
       list_records.appendChild(record);
       //compose the header element
-      record.appendChild(createHeaderElement(oid, lastmodified));      
+      record.appendChild(createHeaderElement(oid, oailastmodified));      
       //compose the metadata element
       record.appendChild(createMetadataElement(prefix, info, metadata_format));
@@ -501,5 +501,5 @@
   /** create a header element used when processing requests like ListRecords/GetRecord/ListIdentifiers
    */
-  private Element createHeaderElement(String oid, String lastmodified) {    
+  private Element createHeaderElement(String oid, String oailastmodified) {    
         Element header = OAIXML.createElement(OAIXML.HEADER);
         Element identifier = OAIXML.createElement(OAIXML.IDENTIFIER);
@@ -510,5 +510,5 @@
         header.appendChild(set_spec);
         Element datestamp = OAIXML.createElement(OAIXML.DATESTAMP);
-        GSXML.setNodeText(datestamp, lastmodified);
+        GSXML.setNodeText(datestamp, oailastmodified);
         header.appendChild(datestamp);
         return header;
@@ -656,4 +656,7 @@
 <contains>".1;".2;".3;".4;".5;".6;".7;".8;".9
 <docnum>349
+<oailastmodified>1303283795
+<lastmodifieddate>20110412
+<oailastmodifieddate>20110420
 ----------------------------------------------------------------------
      */
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java	(revision 24007)
@@ -24,4 +24,9 @@
 import java.net.URLDecoder;
 
+// Apache Commons
+import org.apache.commons.lang3.*;
+
+import java.util.Stack;
+
 public class GS2MacroResolver 
     extends MacroResolver
@@ -29,4 +34,6 @@
 
     protected SimpleCollectionDatabase coll_db = null;
+
+    private static Pattern p_back_slash = Pattern.compile("\\\"");// create a pattern "\\\"", but it matches both " and \"
     
     // need to make it not add macros if they are already present
@@ -58,13 +65,14 @@
 	} 
 
-	ArrayList macros;
+	Stack macros = new Stack();//ArrayList macros;
 	if (scope.equals(SCOPE_TEXT)) {
-	    macros = text_macros;
+	    macros.addAll(text_macros);
 	} else {
-	    macros = metadata_macros;
+	    macros.addAll(metadata_macros);
 	}
-	for (int i=0; i<macros.size(); i++) {
+	//for (int i=0; i<macros.size(); i++) {
+	while(!macros.empty()) {
 	    String new_text = null;
-	    Macro m = (Macro)macros.get(i);
+	    Macro m = (Macro)macros.pop();//.get(i);
 	    switch (m.type) {
 	    case TYPE_DICT:
@@ -76,5 +84,5 @@
 		// otherwise we can't cache the answer because it might be 
 		// document specific
-		text = text.replaceAll(m.macro, m.text);
+		text = StringUtils.replace(text, m.macro, m.text);
 		break;
 	    case TYPE_TEXT:
@@ -83,7 +91,11 @@
 		// doesn't necessarily match line breaks
 		//if (text.matches("(?s).*"+m.macro+".*")) {
-		Pattern p_text = Pattern.compile(".*" + m.macro + ".*",Pattern.DOTALL);
-		Matcher match_text = p_text.matcher(text);
-		if (match_text.matches()) {
+		
+		/*Pattern p_text = Pattern.compile(".*" + m.macro + ".*",Pattern.DOTALL);
+		Matcher match_text = p_text.matcher(text);*/
+
+		// sm252
+		// String.contains is far faster than regex!
+		if (text.contains(m.macro)) { //match_text.matches()) { //text.matches("(?s).*"+m.macro+".*")) {
 		    if (m.resolve) {
 			new_text = this.resolve(m.text, lang, scope, doc_oid);
@@ -91,7 +103,7 @@
 			new_text = m.text;
 		    }
-		    text = text.replaceAll(m.macro, new_text);
+		    text = StringUtils.replace(text, m.macro, new_text);
 		    if (m.macro.endsWith("\\\\")){ // to get rid of "\" from the string likes: "src="http://www.greenstone.org:80/.../mw.gif\">"
-			Pattern p_back_slash = Pattern.compile("\\\"");// create a pattern "\\\"", but it matches both " and \"
+			
 			Matcher m_slash = p_back_slash.matcher(text);
 			String clean_str = "";
@@ -111,7 +123,8 @@
 		break;
 	    case TYPE_META:
-		Pattern p = Pattern.compile(".*" + m.macro + ".*",Pattern.DOTALL);
-		Matcher match = p.matcher(text);
-		if (match.matches()) {
+		//Pattern p = Pattern.compile(".*" + m.macro + ".*",Pattern.DOTALL);
+		//Matcher match = p.matcher(text);
+		// sm252
+		if (text.contains(m.macro)) { //(match.matches()) { //text.matches("(?s).*"+m.macro+".*")) {
 		    if (node_info == null) {
 			node_info = coll_db.getInfo(doc_oid);
@@ -133,5 +146,5 @@
 			    new_text = this.resolve(new_text, lang, scope, doc_oid);
 			}
-			text = text.replaceAll(m.macro, new_text);
+			text =  StringUtils.replace(text, m.macro, new_text);
 		    }
 		    
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java	(revision 24007)
@@ -27,5 +27,6 @@
     public static final String LIBRARY_NAME = "library_name";
     public static final String DEFAULT_LANG = "default_lang";
-
+	public static final String ALLOW_CLIENT_SIDE_XSLT = "allow_client_side_xslt";
+	public static final String CLIENT_SIDE_XSLT_INTERFACE_SUFFIX = "-client-xslt";
 
     public static final String META_RELATION_SEP = "_";
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java	(revision 24007)
@@ -50,4 +50,5 @@
     public static final String EXPAND_DOCUMENT = "ed";
     public static final String EXPAND_CONTENTS = "ec";
+	public static final String REALISTIC_BOOK = "book";
 
   // used for filtering out a piece of the final page
@@ -80,4 +81,6 @@
 	addParameter(EXPAND_DOCUMENT, false);
 	addParameter(EXPAND_CONTENTS, false);
+	addParameter(REALISTIC_BOOK, false);	
+	
  	//addParameter();
 	// ugly hack so we don't save the extlink param
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 24007)
@@ -264,8 +264,12 @@
   }
   
+  public static HashMap extractParams(Element xml, boolean deep) {
+	return extractParams(xml, deep, null);
+  }
+
   /** takes a paramList element, and gets a HashMap of name-value pairs
    * if deep=true, extracts embedded params, otherwise just top level
    * params*/
-  public static HashMap extractParams(Element xml, boolean deep) {
+  public static HashMap extractParams(Element xml, boolean deep, String toFind) {
     
     if (!xml.getNodeName().equals(PARAM_ELEM+LIST_MODIFIER)) {
@@ -286,4 +290,13 @@
         String name=param.getAttribute(NAME_ATT);
         String value=getValue(param); //att or content
+
+	// For only one parameter
+	if(toFind != null && name.equals(toFind)) {
+		param_map.put(name, value);
+		return param_map;
+	}		
+	else if(toFind != null)
+		continue;
+
         int pos = name.indexOf('.');
         if (pos == -1) { // a base param
@@ -674,4 +687,9 @@
   public static void addParametersToList(Document owner, Element param_list,
     HashMap params) {
+	if (params == null)
+	{
+		return;
+	}
+	
     Set items = params.entrySet();
     Iterator i = items.iterator();
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java	(revision 24007)
@@ -112,4 +112,5 @@
     public static final String OAI = "OAI";
     public static final String OAI_DASH_PMH = "OAI-PMH";
+    public static final String OAI_LASTMODIFIED = "oailastmodified";
     public static final String OAIPMH = "OAIPMH";
     public static final String OAI_RESUMPTION_TOKENS = "OAIResumptionTokens";
@@ -161,4 +162,11 @@
     //stores the date format "yyyy-MM-ddTHH:mm:ssZ"
     public static String granularity = "";
+
+    // http://www.openarchives.org/OAI/openarchivesprotocol.html#DatestampsRequests 
+    // specifies that all repositories must support YYYY-MM-DD (yyyy-MM-dd in Java)
+    // this would be in addition to the other (optional) granularity of above that 
+    // a repository may additionally choose to support.
+    public static final String default_granularity = "yyyy-MM-dd";
+
     //this value is overriden in getOAIConfigXML()
     public static long token_expiration = 7200;
@@ -232,5 +240,5 @@
         Element token_elem = (Element)tokens.item(i);
         String expire_str = token_elem.getAttribute(EXPIRATION_DATE);
-        long datestamp = getTime(expire_str);
+        long datestamp = getTime(expire_str); // expire_str is in milliseconds
         if(datestamp < System.currentTimeMillis()) {
           resumption_token_elem.removeChild(token_elem);
@@ -312,4 +320,5 @@
       //initialize the granu_str which might be used by other methods (eg, getDate())
       granularity = GSXML.getNodeText(granu_elem).trim();
+
       //change "yyyy-MM-ddTHH:mm:ssZ" to "yyyy-MM-dd'T'HH:mm:ss'Z'"
       granularity = granularity.replaceAll("T", "'T'");
@@ -352,5 +361,5 @@
     
     public static long getTokenExpiration() {
-      return token_expiration*1000;
+	return token_expiration*1000; // in milliseconds
     }
 
@@ -462,6 +471,18 @@
         date = sdf.parse(pattern);
       } catch(Exception e) {
-        logger.error("invalid date format: " + pattern);
-        return null;
+	  if(!default_granularity.equals(granularity)) { // try validating against default granularity
+	      try {
+		  date = null;
+		  sdf = null;
+		  sdf = new SimpleDateFormat(default_granularity);
+		  date = sdf.parse(pattern);
+	      } catch(Exception ex) {
+		  logger.error("invalid date format: " + pattern);
+		  return null;
+	      }
+	  } else {
+	      logger.error("invalid date format: " + pattern);
+	      return null;
+	  }
       }
       return date;
@@ -481,6 +502,18 @@
         date = sdf.parse(pattern);
       } catch(Exception e) {
-        logger.error("invalid date format: " + pattern);
-        return -1;
+	  if(!default_granularity.equals(granularity)) { // try validating against default granularity
+	      try {
+		  date = null;
+		  sdf = null;
+		  sdf = new SimpleDateFormat(default_granularity);
+		  date = sdf.parse(pattern);
+	      } catch(Exception ex) {
+		  logger.error("invalid date format: " + pattern);
+		  return -1;
+	      }
+	  } else {
+	      logger.error("invalid date format: " + pattern);
+	      return -1;
+	  }        
       }
       return date.getTime();
@@ -488,6 +521,6 @@
     /** get the string representation of a time from a long value(long type)
      */
-    public static String getTime(long seconds) {
-      Date date = new Date(seconds);
+    public static String getTime(long milliseconds) {
+      Date date = new Date(milliseconds);
       SimpleDateFormat sdf = new SimpleDateFormat(granularity);
       return sdf.format(date);
@@ -504,5 +537,5 @@
         oai.setAttribute("xmlns", "http://www.openarchives.org/OAI/2.0/");
         oai.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
-        oai.setAttribute("xsi:schemaLocation", "http://www.openarchives.org/OAI/2.0 \n http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd");
+        oai.setAttribute("xsi:schemaLocation", "http://www.openarchives.org/OAI/2.0/ \n http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd");
       } else {
         oai.setAttribute("xmlns", "http://www.openarchives.com/OAI/1.1/OAI_" + verb);
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/SimpleCollectionDatabase.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/SimpleCollectionDatabase.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/SimpleCollectionDatabase.java	(revision 24007)
@@ -21,4 +21,6 @@
 import org.apache.log4j.*;
 
+import org.apache.commons.lang3.StringUtils;
+
 public class SimpleCollectionDatabase implements OID.OIDTranslatable {
   
@@ -104,5 +106,5 @@
     DBInfo info = new DBInfo();
     
-    String [] lines = key_info.split("\n");
+    String [] lines = StringUtils.split(key_info, "\n");
     String key;
     String value;
@@ -193,6 +195,6 @@
       return top;
     }
-    contains = contains.replaceAll("\"", doc_id);
-    String [] children = contains.split(";");
+    contains = StringUtils.replace(contains, "\"", doc_id);
+    String [] children = StringUtils.split(contains, ";");
     if (suff.equals("fc")) {
       return children[0];
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XMLConverter.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XMLConverter.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XMLConverter.java	(revision 24007)
@@ -41,6 +41,13 @@
 import java.io.FileInputStream;
 import java.io.FileReader;
+import java.util.regex.*;
 
 import org.apache.log4j.*;
+
+// Apache Commons
+import org.apache.commons.lang3.*;
+
+import java.util.*;
+import java.lang.reflect.*;
 
 /** XMLConverter - utility class for greenstone
@@ -59,5 +66,4 @@
 
     private static boolean outputEscaping = true;
-
 
      /** the no-args constructor */
@@ -216,4 +222,15 @@
     }
 
+    /* For the purposes of logger.debug statements, where this is called and hence outputted,
+	returns an empty string if debugging is not enabled */
+    public static String getPrettyStringLogger(Node xmlNode, Logger log) {
+
+	if(log.isDebugEnabled())
+		return getPrettyString(xmlNode);
+	
+	return "";
+
+    }
+
     private static void getString(Node xmlNode, StringBuffer xmlRepresentation, 
 			     int depth, boolean pretty)
@@ -242,5 +259,6 @@
 		String sid  = dt.getSystemId();
 		
-		String doctype_str = "<!DOCTYPE " + dt.getName() + " PUBLIC \"" + pid + "\" \"" + sid + "\">\n";
+		// Use previously assigned name, not dt.getName() again
+		String doctype_str = "<!DOCTYPE " + name + " PUBLIC \"" + pid + "\" \"" + sid + "\">\n";
 		
 		xmlRepresentation.append(doctype_str);
@@ -321,14 +339,17 @@
 
 	    // Perform output escaping, if required
+	    // Apache Commons replace method is far superior to String.replaceAll - very fast!
 	    if (outputEscaping) {
-		text = text.replaceAll("&", "&amp;");  // Must be done first!!
-		text = text.replaceAll("<", "&lt;");
-		text = text.replaceAll(">", "&gt;");
-		text = text.replaceAll("\"", "&quot;");
-		text = text.replaceAll("\'", "&apos;");
+
+		text = StringUtils.replace(text, "&", "&amp;");
+		text = StringUtils.replace(text, "<", "&lt;");
+		text = StringUtils.replace(text, ">", "&gt;");
+		text = StringUtils.replace(text, "'", "&apos;");
+		text = StringUtils.replace(text, "\"", "&quot;");
 	    }
 
 	    // Remove any control-C characters
-	    text = text.replaceAll("" + (char) 3, "");
+	    text = StringUtils.replace(text, "" + (char)3, "");
+
 	    xmlRepresentation.append(text);
 	}
Index: main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java	(revision 24007)
@@ -28,4 +28,6 @@
 import org.w3c.dom.Node; 
 
+import org.apache.commons.lang3.StringUtils;
+
 /** a class to contain various static methods that are used by the xslt
  * stylesheets
@@ -88,5 +90,5 @@
 
     public static String getNumberedItem(String list, int number) {
-	String [] items = list.split(",", -1);	
+	String [] items = StringUtils.split(list, ",", -1);	
 	if (items.length > number) {
 	    return items[number];
@@ -112,5 +114,5 @@
 	String [] args = null;
 	if (args_str!=null && !args_str.equals("")) {
-	    args = args_str.split(";");
+	    args = StringUtils.split(args_str, ";");
 	}
 	Dictionary dict = new Dictionary("interface_"+interface_name, lang);
@@ -275,4 +277,36 @@
 	}
     
+	public static String hashToSectionId(String hashString)
+	{
+		if(hashString == null || hashString.length() == 0 || !hashString.startsWith("HASH")) {return "";}
+		
+		int firstDotIndex = hashString.indexOf(".");
+		if(firstDotIndex == -1)
+		{	
+			return "";
+		}
+		
+		String sectionString = hashString.substring(firstDotIndex + 1);
+		
+		return sectionString;
+	}
+	
+	public static String hashToDepthClass(String hashString)
+	{
+		if(hashString == null || hashString.length() == 0 || !hashString.startsWith("HASH")) {return "";}
+		
+		String sectionString = hashToSectionId(hashString);
+		
+		int count = sectionString.split("\\.").length;
+		
+		if (sectionString.equals(""))
+		{
+			return "sectionHeaderDepthTitle";
+		}
+		else 
+		{
+			return "sectionHeaderDepth" + count;
+		}
+	}
 }
 
Index: main/branches/64_bit_Greenstone/greenstone3/src/packages/javagdbm/jni/win32.mak
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/src/packages/javagdbm/jni/win32.mak	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/src/packages/javagdbm/jni/win32.mak	(revision 24007)
@@ -27,6 +27,6 @@
 JAVAGDBMHOME = ..
  
-GSDLHOME= $(GSDL3HOME)\gs2build
-GDBMHOME = $(GSDLHOME)\packages\windows\gdbm\gdbm
+GSDLHOME= $(GSDL3SRCHOME)\gs2build
+GDBMHOME = $(GSDLHOME)\common-src\packages\gdbm\gdbm-1.8.3
 
 AR = lib
@@ -56,5 +56,5 @@
 
 OBJECTS = \
-    gdbmjava$o   "$(GDBMHOME)\gdbm.lib"
+    gdbmjava$o   "$(GDBMHOME)\gdbm.lib" 
  
 all : compile link
@@ -67,5 +67,5 @@
 
 install: 
-        copy gdbmjava.dll "$(GSDL3HOME)\lib\jni"
+        copy gdbmjava.dll "$(GSDL3SRCHOME)\lib\jni"
 
 clean:
Index: main/branches/64_bit_Greenstone/greenstone3/web/WEB-INF/classes/interface_default.properties
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/WEB-INF/classes/interface_default.properties	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/WEB-INF/classes/interface_default.properties	(revision 24007)
@@ -23,5 +23,5 @@
 ########################
 about.noservices=There are no services available for this collection.
-about.services=Services available:
+about.services=Extra services available:
 about.servicehelp=You can access the services by clicking on the buttons below or on the names on the navigation bar. The navigation bar is persistent across all pages in the collection.
 #about.description=Description:
@@ -54,4 +54,5 @@
 pref.encoding=Encoding:
 pref.hitsperpage=Number of hits per page:
+pref.maxDocs=Maximum documents to return:
 pref.all=all
 pref.set_prefs=Set preferences
@@ -60,5 +61,4 @@
 pref.berrybasket.off=off
 pref.book=Book viewer mode: 
-
 
 ##################
@@ -86,4 +86,125 @@
 external.text=The link you have selected is external to any of your currently selected collections. If you still wish to view this link and your browser has access to the Web, you can {0} to this page; otherwise use your browsers "back" button to return to the previous document.
 external.go_forward=go forward
+
+##################
+# help page
+##################
+help.topicstitle=<h2>Topics</h2>
+
+help.findinginformationtitle=<h2>How to find information in the {0} collection</h2>
+help.findinginformation=There are {0} ways to find information in this collection:
+help.searchdesc=search for particular words that appear in the text by clicking the Search button
+help.browsedesc=browse documents by <i>{0}</i> by clicking the <i>{0}</i> button
+
+help.readingdocstitle=<h2>How to read the documents</h2>
+help.readingdocs=<p>You can tell when you have arrived at an individual book or document because its title, \
+or an image of the front cover, appears at the top left of the page. In some collections, a table of contents appears, \
+while in others (eg. when the paged image option is used) just the page number is shown, along with a box that allows you \
+to select a new page and go forward and backward. In the table of contents, the current section heading is in bold face, \
+and the table is expandable -- click on the folders to open or close them; click on the open book at the top to close it.</p>\
+<p>Underneath is the text of the current section. When you have read through it, there are arrows at the \
+bottom to take you on to the next section or back to the previous one.</p>\
+<p>Below the title or front-cover image are some buttons. Click on <i>EXPAND DOCUMENT</i> to expand out the whole text \
+of the current section, or book. If the document is large, this could take a long time and use a lot of memory! \
+Click on <i>EXPAND CONTENTS</i> to expand out the whole table of contents so that you can see the titles of all \
+chapters and subsections. Click on <i>DETACH PAGE</i> to make a new browser window for this document. \
+(This is useful if you want to compare documents, or read two at once.)</p>
+
+help.openbookshelf=Open this bookshelf
+help.sectionarrows=Go to the previous/next section
+
+help.searchingtitle=<h2>How to search for particular words</h2>
+help.searching=<p>From the search page, you make a query in these simple steps:</p>\
+<ol><li>Specify what items you want to search</li>\
+<li>Say whether you want to search for all or just some of the words</li>\
+<li>Type in the words you want to search for</li>\
+<li>Click the <i>Begin Search</i> button</li>\
+</ol>\
+<p>When you make a query, the titles of twenty matching documents will be shown. \
+There is a button at the end to take you on to the next twenty documents.  From \
+there you will find buttons to take you on to the third twenty or back to the \
+first twenty, and so on.  Click the title of any document, or the little button \
+beside it, to see it.</p>\
+<p>A maximum of 50 is imposed on the number of \
+documents returned.  You can change this number by clicking the \
+<i>PREFERENCES</i> button at the top of the page.</p>
+
+help.querytermstitle=<h3>Search Terms</h3>
+help.queryterms=<p>Whatever you type into the query box is interpreted as a list of words or phrases \
+called "search terms."  A term is a single word containing only letters and digits, or a phrase \
+consisting of a sequence of words enclosed in double quotes ("...").  Terms are separated by white spaces. \
+If any other characters such as punctuation appear, they serve to separate terms just as though they were \
+spaces.  And then they are ignored.  You can't search for words that include punctuation.</p> \
+<p>For example, the query</p> \
+<ul><kbd>Agro-forestry in the Pacific Islands: Systems for Sustainability (1993)</kbd></ul> \
+<p>will be treated the same as</p> \
+<ul><kbd>Agro forestry in the Pacific Islands  Systems for Sustainability  1993 </kbd></ul>
+
+help.querytypetitle=<h3>Query type</h3>
+help.querytype=<p>There are two different kinds of query. </p>\
+<ul>\
+<li>Queries for <b>all</b> of the words.  These look for documents (or chapters, or titles) \
+that contain all the words you have specified. Documents that satisfy the query are displayed, in build order. </li>\
+<li>Queries for <b>some</b> of the words.  Just list some terms that are likely to appear in \
+the documents you are looking for.  Documents are displayed in order of how closely they match the query. \
+When determining the degree of match, </li>\
+<ul> \
+<li> the more search term occurrences a document contains, the closer it matches; </li>\
+<li> terms which are rare in the collection as a whole are more important than common ones; </li>\
+<li> short documents match better than long ones. </li>\
+</ul> \
+</ul> \
+<p>Use as many search terms as you like--a whole sentence, or even a whole paragraph.  If you specify only \
+one term, documents will be ordered by its frequency of occurrence.</p>
+
+help.queryscopetitle=<h3>Scope of queries</h3>
+help.queryscope=<p>In most collections you are given a choice of different indexes to search. For example, there might \
+be author or title indexes. Or there might be chapter or paragraph indexes. Generally, \
+the full matching document is returned regardless of which index you search.</p> \
+<p>If documents are books, they will be opened at the appropriate place.</p>
+
+help.changingpreferencestitle=<h2>Changing your preferences</h2>
+help.changingpreferences=<p>When you click the <i>PREFERENCES</i> button at the top of the page you will \
+be able to change some features of the interface to suit your own requirements.</p>
+
+help.collectionpreferencestitle=<h3>Collection preferences</h3>
+help.collectionpreferences=<p>Some collections comprise several subcollections, which can be searched \
+independently or together, as one unit.  If so, you can select which \
+subcollections to include in your searches on the Preferences page. </p>
+
+help.languagepreferencestitle=<h3>Language preferences</h3>
+help.languagepreferences=<p>Each collection has a default presentation language, but you can switch to \
+a different language if you like.  You can also alter the encoding scheme \
+used by Greenstone for output to the browser -- the software chooses \
+sensible defaults, but with some browsers it may be necessary to switch to \
+a different encoding scheme to ensure correct character display. \
+All collections allow you to switch from the standard graphical interface format to a textual one. This \
+is particularly useful for visually impaired users who use large screen fonts or speech synthesizers for output.</p>
+
+help.presentationpreferencestitle=<h3>Presentation preferences</h3>
+help.presentationpreferences=<p>Depending on the particular collection, \
+there may be several options you can set that control the presentation. </p> \
+<p>Collections of Web pages allow you to suppress the Greenstone navigation bar at the top of each document page, \
+so that once you have done a search you land at the exact Web page that matches without any Greenstone header. \
+To do another search you will have to use your browser's "back" button. These collections also allow you to suppress \
+Greenstone's warning message when you click a link that takes you out of the digital library collection and on to the \
+Web itself. And in some Web collections you can control whether the links on the search results page take you straight \
+to the actual URL in question, rather than to the digital library's copy of the page. </p>
+
+help.searchpreferencestitle=<h2>Search preferences</h2>
+help.searchpreferences1=<p>You can switch to an "advanced" query mode which allows you to combine terms \
+using &amp; (for "and"), | (for "or"), and ! (for "not"), using parentheses for \
+grouping if desired. This allows you to specify more precise queries. </p>\
+<p>It is possible to get a large query box, so that you can easily do paragraph-sized searching. \
+It is surprisingly quick to search for large amounts of text. </p>\
+
+help.searchpreferences2=<p>You can turn on the search history feature, which shows you your last few \
+queries.  This makes it easy to repeat slightly modified versions of previous queries.</p> \
+<p>Finally, you can control the number of hits returned, and the \
+number presented on each screenful.</p>
+
+help.mgsearchpreferences=<p>A pair of buttons controls whether upper and lower case must match when searching. \
+For example, if "ignore case differences" is selected, snail farming will be treated the same as Snail Farming and SNAIL FARMING. </p>
+
 ##################
 # authentication page
Index: main/branches/64_bit_Greenstone/greenstone3/web/WEB-INF/web.xml
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/WEB-INF/web.xml	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/WEB-INF/web.xml	(revision 24007)
@@ -9,5 +9,4 @@
 -->
 <web-app>
-
 
   <!-- General description of your web application -->
@@ -77,4 +76,11 @@
   </servlet>
   
+  <!-- For client side text fetching -->
+  <servlet>
+    <servlet-name>grabtext</servlet-name>
+    <description>Grabs text for client-side display with minimal overhead.</description>
+    <servlet-class>org.greenstone.gsdl3.ClientSideServlet</servlet-class>
+  </servlet>
+  
   
    <servlet>
@@ -104,29 +110,29 @@
   </servlet>
 
-  <servlet>^M
-    <servlet-name>Format</servlet-name>^M
-    <description>A new skin engine still in development based on the standard gsdl3 library program</description>^M
-    <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>^M
-    <init-param>^M
-      <param-name>library_name</param-name>^M
-      <param-value>format</param-value>^M
-    </init-param>^M
-    <init-param>^M
-      <param-name>site_name</param-name>^M
-      <param-value>localsite</param-value>^M
-    </init-param>^M
-    <init-param>^M
-      <param-name>interface_name</param-name>^M
-      <param-value>oran</param-value>^M
-    </init-param>^M
-    <init-param>^M
-      <param-name>receptionist_class</param-name>^M
-      <param-value>FormatReceptionist</param-value>^M
-    </init-param>^M
-    <init-param>^M
-      <param-name>default_lang</param-name>^M
-      <param-value>en</param-value>^M
-    </init-param>^M
-  </servlet>^M
+  <servlet>
+    <servlet-name>Format</servlet-name>
+    <description>A new skin engine still in development based on the standard gsdl3 library program</description>
+    <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
+    <init-param>
+      <param-name>library_name</param-name>
+      <param-value>format</param-value>
+    </init-param>
+    <init-param>
+      <param-name>site_name</param-name>
+      <param-value>localsite</param-value>
+    </init-param>
+    <init-param>
+      <param-name>interface_name</param-name>
+      <param-value>oran</param-value>
+    </init-param>
+    <init-param>
+      <param-name>receptionist_class</param-name>
+      <param-value>FormatReceptionist</param-value>
+    </init-param>
+    <init-param>
+      <param-name>default_lang</param-name>
+      <param-value>en</param-value>
+    </init-param>
+  </servlet>
 
   
@@ -233,4 +239,8 @@
       <param-value>en</param-value>
     </init-param>
+	<init-param>
+	 <param-name>allow_client_side_xslt</param-name>
+	 <param-value>true</param-value>
+	</init-param>
   </servlet>
 
@@ -345,8 +355,8 @@
   </servlet-mapping>
 
-  <servlet-mapping>^M
-    <servlet-name>Format</servlet-name>^M
-    <url-pattern>/format</url-pattern>^M
-  </servlet-mapping>^M
+  <servlet-mapping>
+    <servlet-name>Format</servlet-name>
+    <url-pattern>/format</url-pattern>
+  </servlet-mapping>
 
   <servlet-mapping>
@@ -365,4 +375,8 @@
   </servlet-mapping>
 
+	<servlet-mapping>
+		<servlet-name>grabtext</servlet-name>
+		<url-pattern>/grabtext</url-pattern>
+	</servlet-mapping>
   
   <!-- axis mappings -->
@@ -419,5 +433,5 @@
     <mime-type>text/xml</mime-type>
   </mime-mapping>
-  
+
 </web-app>
 
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/interfaceConfig.xml
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/interfaceConfig.xml	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/interfaceConfig.xml	(revision 24007)
@@ -0,0 +1,186 @@
+<interfaceConfig>
+  <actionList>
+    <action name='p' class='PageAction'>
+      <subaction name='home' xslt='home.xsl'/>
+      <subaction name='about' xslt='about.xsl'/>
+      <subaction name='help' xslt='help.xsl'/>
+      <subaction name='pref' xslt='pref.xsl'/>
+      <subaction name='gli4gs3' xslt='gli4gs3.xsl'/>
+      <subaction name='nav' xslt='nav.xsl'/><!-- used for the collection header frame -->
+      <subaction name="html" xslt="html.xsl"/> <!-- use to put an external page into a frame with a collection header-->
+    </action>
+    <action name='q' class='QueryAction' xslt='query.xsl'/>
+    <action name='b' class='GS2BrowseAction' xslt='classifier.xsl'/>
+    <action name='a' class='AppletAction' xslt='applet.xsl'/>
+    <action name='d' class='DocumentAction' xslt='document.xsl'/>
+    <action name='xd' class='XMLDocumentAction'>
+      <subaction name='toc' xslt='document-toc.xsl'/>
+      <subaction name='text' xslt='document-content.xsl'/>
+    </action>
+    <action name='pr' class='ProcessAction' xslt='process.xsl'/>
+    <action name='s' class='SystemAction' xslt='system.xsl'/>
+    <action name='g' class='GeneralAction'>
+      <subaction name="authen" xslt='authen.xsl'/>
+      <subaction name="berry" xslt='berry.xsl'/>
+    </action>
+  </actionList>
+  <languageList>
+    <language name="en">
+      <displayItem name='name'>English</displayItem>
+    </language>
+    <language name="fr">
+      <displayItem name='name'>FranÃ§ais</displayItem>
+    </language>
+    <language name='es'>
+      <displayItem name='name'>EspaÃ±ol</displayItem>
+    </language>
+    <language name="jp">
+      <displayItem name='name'>ã«ã»ãã</displayItem>
+    </language>
+    <language name="vi">
+      <displayItem name='name'>Vietnamese</displayItem>
+    </language>
+    <language name='ar'>
+      <displayItem name='name'>Arabic</displayItem>
+    </language>
+  	<language name='bg'>
+      <displayItem name='name'>Bulgarian</displayItem>
+    </language>
+  	<language name='bn'>
+      <displayItem name='name'>àŠ¬àŠŸàŠàŠ²àŠŸ (Bengali)</displayItem>
+    </language>
+  	<language name='ca'>
+      <displayItem name='name'>CatalÃ  (Catalan)</displayItem>
+    </language>
+  	<language name='cs'>
+      <displayItem name='name'>Äesky (Czech)</displayItem>
+    </language>
+  	<language name='de'>
+      <displayItem name='name'>Deutsch (German)</displayItem>
+    </language>
+  	<language name='el'>
+      <displayItem name='name'>ÎÎ»Î»Î·ÎœÎ¹ÎºÎ¬ (Greek)</displayItem>
+    </language>
+    <language name='fa'>
+      <displayItem name='name'>Farsi</displayItem>
+    </language>
+    <language name='fi'>
+      <displayItem name='name'>Finnish</displayItem>
+    </language>
+    <language name='gd'>
+      <displayItem name='name'>Gaelic (Scottish)</displayItem>
+    </language>
+    <language name='gl'>
+      <displayItem name='name'>Galician</displayItem>
+    </language>
+    <language name='he'>
+      <displayItem name='name'>Hebrew</displayItem>
+    </language>
+    <language name='hi'>
+      <displayItem name='name'>Hindi</displayItem>
+    </language>
+    <language name='hu'>
+      <displayItem name='name'>Hungarian</displayItem>
+    </language>
+    <language name='hy'>
+      <displayItem name='name'>Armenian</displayItem>
+    </language>
+    <language name='id'>
+      <displayItem name='name'>Bahasa Indonesia (Indonesian)</displayItem>
+    </language>
+    <language name='it'>
+      <displayItem name='name'>Italiano</displayItem>
+    </language>    
+    <language name='ka'>
+      <displayItem name='name'>Georgian</displayItem>
+    </language>
+    <language name='kk'>
+      <displayItem name='name'>ÒÐ°Ð·Ð°Ò (Kazakh)</displayItem>
+    </language>
+    <language name='kn'>
+      <displayItem name='name'>Kannada</displayItem>
+    </language>
+    <language name='ky'>
+      <displayItem name='name'>ÐÑÑÐ³ÑÐ·ÑÐ° (Kirghiz)</displayItem>
+    </language>    
+    <language name='lv'>
+      <displayItem name='name'>Latvian</displayItem>
+    </language>
+	<language name='mi'>
+      <displayItem name='name'>MÄori</displayItem>
+    </language>
+	<language name='ml'>
+      <displayItem name='name'>Malayalam</displayItem>
+    </language>
+	<language name='mn'>
+      <displayItem name='name'>ÐÐŸÐœÐ³ÐŸÐ» (Mongolian)</displayItem>
+    </language>
+	<language name='mr'>
+      <displayItem name='name'>Marathi</displayItem>
+    </language>
+	<language name='nl'>
+      <displayItem name='name'>Nederlands (Dutch)</displayItem>
+    </language>
+	<language name='pl'>
+      <displayItem name='name'>polski (Polish)</displayItem>
+    </language>
+	<language name='pt-br'>
+      <displayItem name='name'>portuguÃªs-BR (Brasil)</displayItem>
+    </language>
+	<language name='pt-pt'>
+      <displayItem name='name'>portuguÃªs-PT (Portugal)</displayItem>
+    </language>
+	<language name='ps'>
+      <displayItem name='name'>Pushto</displayItem>
+    </language>
+	<language name='prs'>
+      <displayItem name='name'>Dari</displayItem>
+    </language>
+	<language name='ro'>
+      <displayItem name='name'>Romanian</displayItem>
+    </language>
+	<language name='ru'>
+      <displayItem name='name'>ÑÑÑÑÐºÐžÐ¹ (Russian)</displayItem>
+    </language>
+	<language name='si'>
+      <displayItem name='name'>Sinhalese</displayItem>
+    </language>
+	<language name='sk'>
+      <displayItem name='name'>SlovenÄina (Slovak)</displayItem>
+    </language>
+	<language name='sr'>
+      <displayItem name='name'>Serbian</displayItem>
+    </language>
+	<language name='ta'>
+      <displayItem name='name'>Tamil</displayItem>
+    </language>	
+	<language name='te'>
+      <displayItem name='name'>Telugu</displayItem>
+    </language>
+	<language name='th'>
+      <displayItem name='name'>Thai</displayItem>
+    </language>
+	<language name='tr'>
+      <displayItem name='name'>Turkish</displayItem>
+    </language>
+	<language name='uk'>
+      <displayItem name='name'>Ukrainian</displayItem>
+    </language>
+	<language name='ur'>
+      <displayItem name='name'>Urdu</displayItem>
+    </language>
+	<language name='vi'>
+      <displayItem name='name'>Tiáº¿ng Viá»t</displayItem>
+    </language>
+	<language name='zh'>
+      <displayItem name='name'>ç®äœäž­æ (Simplified Chinese)</displayItem>
+    </language>
+	<language name='zh-tr'>
+      <displayItem name='name'>ç¹é«äž­æ (Traditional Chinese)</displayItem>
+    </language>
+  </languageList>
+  <optionList>
+    <option name="highlightQueryTerms" value="true"/>
+    <option name="berryBaskets" value="true"/>
+  </optionList>
+</interfaceConfig>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/YAHOO.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/YAHOO.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/YAHOO.js	(revision 24007)
@@ -0,0 +1,63 @@
+/*
+Copyright (c) 2006 Yahoo! Inc. All rights reserved.
+version 0.9.0
+*/
+
+/**
+ * @class The Yahoo global namespace
+ */
+var YAHOO = function() {
+
+    return {
+
+        /**
+         * Yahoo presentation platform utils namespace
+         */
+        util: {},
+
+        /**
+         * Yahoo presentation platform widgets namespace
+         */
+        widget: {},
+
+        /**
+         * Yahoo presentation platform examples namespace
+         */
+        example: {},
+
+        /**
+         * Returns the namespace specified and creates it if it doesn't exist
+         *
+         * YAHOO.namespace("property.package");
+         * YAHOO.namespace("YAHOO.property.package");
+         *
+         * Either of the above would create YAHOO.property, then
+         * YAHOO.property.package
+         *
+         * @param  {String} sNameSpace String representation of the desired
+         *                             namespace
+         * @return {Object}            A reference to the namespace object
+         */
+        namespace: function( sNameSpace ) {
+
+            if (!sNameSpace || !sNameSpace.length) {
+                return null;
+            }
+
+            var levels = sNameSpace.split(".");
+
+            var currentNS = YAHOO;
+
+            // YAHOO is implied, so it is ignored if it is included
+            for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
+                currentNS[levels[i]] = currentNS[levels[i]] || {};
+                currentNS = currentNS[levels[i]];
+            }
+
+            return currentNS;
+
+        }
+    };
+
+} ();
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/connection.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/connection.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/connection.js	(revision 24007)
@@ -0,0 +1,465 @@
+/*
+Copyright (c) 2006 Yahoo! Inc. All rights reserved.
+version 0.9.0
+*/
+
+/**
+ * The Connection Manager provides a simplified interface to the XMLHttpRequest
+ * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
+ * interactive states and server response returning the results to a pre-defined
+ * callback function you create.
+ * @ class
+ */
+YAHOO.util.Connect = {};
+
+YAHOO.util.Connect =
+{
+  /**
+   * Array of  MSFT ActiveX ids for XMLHttpRequest.
+   * @private
+   * @type array
+   */
+	_msxml_progid:[
+		'MSXML2.XMLHTTP.5.0',
+		'MSXML2.XMLHTTP.4.0',
+		'MSXML2.XMLHTTP.3.0',
+		'MSXML2.XMLHTTP',
+		'Microsoft.XMLHTTP'
+		],
+
+  /**
+   * Array of HTTP header(s)
+   * @private
+   * @type array
+   */
+	_http_header:[],
+
+ /**
+  * Property modified by setForm() to determine if the transaction
+  * should be processed as a HTML form POST.
+  * @private
+  * @type boolean
+  */
+	_isFormPost:false,
+
+ /**
+  * Property modified by setForm() to the HTML form POST body.
+  * @private
+  * @type string
+  */
+	_sFormData:null,
+
+  /**
+   * The polling frequency, in milliseconds, for HandleReadyState.
+   * when attempting to determine a transaction's XHR  readyState.
+   * The default is 300 milliseconds.
+   * @private
+   * @type int
+   */
+	_polling_interval:300,
+
+  /**
+   * A transaction counter that increments the transaction id for each transaction.
+   * @private
+   * @type int
+   */
+	_transaction_id:0,
+
+  /**
+   * Member to add an ActiveX id to the existing xml_progid array.
+   * In the event(unlikely) a new ActiveX id is introduced, it can be added
+   * without internal code modifications.
+   * @public
+   * @param string id The ActiveX id to be added to initialize the XHR object.
+   * @return void
+   */
+	setProgId:function(id)
+	{
+		this.msxml_progid.unshift(id);
+	},
+
+  /**
+   * Instantiates a XMLHttpRequest object and returns an object with two properties:
+   * the XMLHttpRequest instance and the transaction id.
+   * @private
+   * @param {int} transactionId Property containing the transaction id for this transaction.
+   * @return connection object
+   * @type object
+   */
+	createXhrObject:function(transactionId)
+	{
+		var obj,http;
+		try
+		{
+			// Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
+			http = new XMLHttpRequest();
+			//  Object literal with http and id properties
+			obj = { conn:http, tId:transactionId };
+		}
+		catch(e)
+		{
+			for(var i=0; i<this._msxml_progid.length; ++i){
+				try
+				{
+					// Instantiates XMLHttpRequest for IE and assign to http.
+					http = new ActiveXObject(this._msxml_progid[i]);
+					//  Object literal with http and id properties
+					obj = { conn:http, tId:transactionId };
+				}
+				catch(e){}
+			}
+		}
+		finally
+		{
+			return obj;
+		}
+	},
+
+  /**
+   * This method is called by asyncRequest and syncRequest to create a
+   * valid connection object for the transaction.  It also passes a
+   * transaction id and increments the transaction id counter.
+   * @private
+   * @return object
+   */
+	getConnectionObject:function()
+	{
+		var o;
+		var tId = this._transaction_id;
+
+		try
+		{
+			o = this.createXhrObject(tId);
+			if(o){
+				this._transaction_id++;
+			}
+		}
+		catch(e){}
+		finally
+		{
+			return o;
+		}
+	},
+
+  /**
+   * Method for initiating an asynchronous request via the XHR object.
+   * @public
+   * @param {string} method HTTP transaction method
+   * @param {string} uri Fully qualified path of resource
+   * @param callback User-defined callback function or object
+   * @param callbackArg User-defined callback arguments
+   * @param {string} postData POST body
+   * @return {object} Returns the connection object
+   */
+	asyncRequest:function(method, uri, callback, postData)
+	{
+		var errorObj;
+		var o = this.getConnectionObject();
+
+		if(!o){
+			return null;
+		}
+		else{
+			var oConn = this;
+
+			o.conn.open(method, uri, true);
+		    this.handleReadyState(o, callback);
+
+			if(this._isFormPost){
+				postData = this._sFormData;
+				this._isFormPost = false;
+			}
+			else if(postData){
+				this.initHeader('Content-Type','application/x-www-form-urlencoded');
+			}
+
+			//Verify whether the transaction has any user-defined HTTP headers
+			//and set them.
+			if(this._http_header.length>0){
+				this.setHeader(o);
+			}
+			postData?o.conn.send(postData):o.conn.send(null);
+
+			return o;
+		}
+	},
+
+  /**
+   * This method serves as a timer that polls the XHR object's readyState
+   * property during a transaction, instead of binding a callback to the
+   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse
+   * will process the response, and the timer will be cleared.
+   *
+   * @private
+   * @param {object} o The connection object
+   * @param callback User-defined callback object
+   * @param callbackArg User-defined arguments passed to the callback
+   * @return void
+   */
+	handleReadyState:function(o, callback)
+	{
+		var oConn = this;
+		var poll = window.setInterval(
+			function(){
+				if(o.conn.readyState==4){
+					oConn.handleTransactionResponse(o, callback);
+					window.clearInterval(poll);
+				}
+			}
+		,this._polling_interval);
+	},
+
+  /**
+   * This method attempts to interpret the server response and
+   * determine whether the transaction was successful, or if an error or
+   * exception was encountered.
+   *
+   * @private
+   * @param {object} o The connection object
+   * @param {function} callback - User-defined callback object
+   * @param {} callbackArg - User-defined arguments to be passed to the callback
+   * @return void
+   */
+	handleTransactionResponse:function(o, callback)
+	{
+		var httpStatus;
+		var responseObject;
+
+		try{
+			httpStatus = o.conn.status;
+		}
+		catch(e){
+			// 13030 is the custom code to indicate the condition -- in Mozilla/FF --
+			// when the o object's status and statusText properties are
+			// unavailable, and a query attempt throws an exception.
+			httpStatus = 13030;
+		}
+
+		if(httpStatus == 200){
+			responseObject = this.createResponseObject(o, callback.argument);
+			if(callback.success){
+				if(!callback.scope){
+					callback.success(responseObject);
+				}
+				else{
+					callback.success.apply(callback.scope, [responseObject]);
+				}
+			}
+		}
+		else{
+			switch(httpStatus){
+				// The following case labels are wininet.dll error codes that may be encountered.
+				// Server timeout
+				case 12002:
+				// 12029 to 12031 correspond to dropped connections.
+				case 12029:
+				case 12030:
+				case 12031:
+				// Connection closed by server.
+				case 12152:
+				// See above comments for variable status.
+				case 13030:
+					responseObject = this.createExceptionObject(o, callback.argument);
+					if(callback.failure){
+						if(!callback.scope){
+							callback.failure(responseObject);
+						}
+						else{
+							callback.failure.apply(callback.scope,[responseObject]);
+						}
+					}
+					break;
+				default:
+					responseObject = this.createResponseObject(o, callback.argument);
+					if(callback.failure){
+						if(!callback.scope){
+							callback.failure(responseObject);
+						}
+						else{
+							callback.failure.apply(callback.scope,[responseObject]);
+						}
+					}
+			}
+		}
+
+		this.releaseObject(o);
+	},
+
+  /**
+   * This method evaluates the server response, creates and returns the results via
+   * its properties.  Success and failure cases(and exceptions) will differ in their defined properties
+   * but property "type" will confirm the transaction's status.
+   * @private
+   * @param {object} o The connection object
+   * @param {} callbackArg User-defined arguments to be passed to the callback
+   * @param {boolean} isSuccess Indicates whether the transaction was successful or not.
+   * @return object
+   */
+	createResponseObject:function(o, callbackArg)
+	{
+		var obj = {};
+
+		obj.tId = o.tId;
+		obj.status = o.conn.status;
+		obj.statusText = o.conn.statusText;
+		obj.allResponseHeaders = o.conn.getAllResponseHeaders();
+		obj.responseText = o.conn.responseText;
+		obj.responseXML = o.conn.responseXML;
+		if(callbackArg){
+			obj.argument = callbackArg;
+		}
+
+		return obj;
+	},
+
+  /**
+   * If a transaction cannot be completed due to dropped or closed connections,
+   * there may be not be enough information to build a full response object.
+   * The object's property "type" value will be "failure", and two additional
+   * unique, properties are added - errorCode and errorText.
+   * @private
+   * @param {int} tId Transaction Id
+   * @param callbackArg The user-defined arguments
+   * @param {string} errorCode Error code associated with the exception.
+   * @param {string} errorText Error message describing the exception.
+   * @return object
+   */
+	createExceptionObject:function(tId, callbackArg)
+	{
+		var COMM_CODE = 0;
+		var COMM_ERROR = 'communication failure';
+
+		var obj = {};
+
+		obj.tId = tId;
+		obj.status = COMM_CODE;
+		obj.statusText = COMM_ERROR;
+		if(callbackArg){
+			obj.argument = callbackArg;
+		}
+
+		return obj;
+	},
+
+  /**
+   * Accessor that stores the HTTP headers for each transaction.
+   * @public
+   * @param {string} label The HTTP header label
+   * @param {string} value The HTTP header value
+   * @return void
+   */
+	initHeader:function(label,value)
+	{
+		var oHeader = [label,value];
+		this._http_header.push(oHeader);
+	},
+
+  /**
+   * Accessor that sets the HTTP headers for each transaction.
+   * @private
+   * @param {object} o The connection object for the transaction.
+   * @return void
+   */
+	setHeader:function(o)
+	{
+		var oHeader = this._http_header;
+		for(var i=0;i<oHeader.length;i++){
+			o.conn.setRequestHeader(oHeader[i][0],oHeader[i][1]);
+		}
+		oHeader.splice(0,oHeader.length);
+	},
+
+  /**
+   * This method assembles the form label and value pairs and
+   * constructs an encoded POST body.  Both syncRequest()
+   * and asyncRequest() will automatically initialize the
+   * transaction with a HTTP header Content-Type of
+   * application/x-www-form-urlencoded.
+   * @public
+   * @param {string} formName value of form name attribute
+   * @return void
+   */
+	setForm:function(formName)
+	{
+		this._sFormData = '';
+		var oForm = document.forms[formName];
+		var oElement, elName, elValue;
+		// iterate over the form elements collection to construct the
+		// label-value pairs.
+		for (var i=0; i<oForm.elements.length; i++){
+			oElement = oForm.elements[i];
+			elName = oForm.elements[i].name;
+			elValue = oForm.elements[i].value;
+			switch (oElement.type)
+			{
+				case 'select-multiple':
+					for(var j=0; j<oElement.options.length; j++){
+						if(oElement.options[j].selected){
+							this._sFormData += encodeURIComponent(elName) + '=' + encodeURIComponent(oElement.options[j].value) + '&';
+						}
+					}
+					break;
+				case 'radio':
+				case 'checkbox':
+					if(oElement.checked){
+						this._sFormData += encodeURIComponent(elName) + '=' + encodeURIComponent(elValue) + '&';
+					}
+					break;
+				case 'file':
+				// stub case as XMLHttpRequest will only send the file path as a string.
+					break;
+				case undefined:
+				// stub case for fieldset element which returns undefined.
+					break;
+				default:
+					this._sFormData += encodeURIComponent(elName) + '=' + encodeURIComponent(elValue) + '&';
+					break;
+			}
+		}
+		this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
+		this._isFormPost = true;
+		this.initHeader('Content-Type','application/x-www-form-urlencoded');
+	},
+
+  /**
+   * Public method to terminate a transaction, if it has not reached readyState 4.
+   * @public
+   * @param {object} o The connection object returned by asyncRequest.
+   * @return void
+   */
+	abort:function(o)
+	{
+		if(this.isCallInProgress(o)){
+			o.conn.abort();
+			this.releaseObject(o);
+		}
+	},
+
+  /**
+   * Accessor to check if the transaction associated with the connection object
+   * is still being processed.
+   * @public
+   * @param {object} o The connection object returned by asyncRequest
+   * @return boolean
+   */
+	isCallInProgress:function(o)
+	{
+		if(o){
+			return o.conn.readyState != 4 && o.conn.readyState != 0;
+		}
+	},
+
+  /**
+   * Dereference the XHR instance and the connection object after the transaction is completed.
+   * @private
+   * @param {object} o The connection object
+   * @return void
+   */
+	releaseObject:function(o)
+	{
+			//dereference the XHR instance.
+			o.conn = null;
+			//dereference the connection object.
+			o = null;
+	}
+}
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dom.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dom.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dom.js	(revision 24007)
@@ -0,0 +1,433 @@
+/*
+Copyright (c) 2006 Yahoo! Inc. All rights reserved.
+version 0.9.0
+*/
+
+/**
+ * @class Provides helper methods for DOM elements.
+ */
+YAHOO.util.Dom = new function() {
+
+   /**
+    * Returns an HTMLElement reference
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @return {HTMLElement} A DOM reference to an HTML element.
+    */
+   this.get = function(el) {
+      if (typeof el == 'string') { // accept object or id
+         el = document.getElementById(el);
+      }
+
+      return el;
+   };
+
+   /**
+    * Normalizes currentStyle and ComputedStyle.
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @param {String} property The style property whose value is returned.
+    * @return {String} The current value of the style property.
+    */
+   this.getStyle = function(el, property) {
+      var value = null;
+      var dv = document.defaultView;
+
+      el = this.get(el);
+
+      if (property == 'opacity' && el.filters) {// IE opacity
+         value = 1;
+         try {
+            value = el.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;
+         } catch(e) {
+            try {
+               value = el.filters.item('alpha').opacity / 100;
+            } catch(e) {}
+         }
+      }
+      else if (el.style[property]) {
+         value = el.style[property];
+      }
+      else if (el.currentStyle && el.currentStyle[property]) {
+         value = el.currentStyle[property];
+      }
+      else if ( dv && dv.getComputedStyle )
+      {  // convert camelCase to hyphen-case
+
+         var converted = '';
+         for(i = 0, len = property.length;i < len; ++i) {
+            if (property.charAt(i) == property.charAt(i).toUpperCase()) {
+               converted = converted + '-' + property.charAt(i).toLowerCase();
+            } else {
+               converted = converted + property.charAt(i);
+            }
+         }
+
+         if (dv.getComputedStyle(el, '').getPropertyValue(converted)) {
+            value = dv.getComputedStyle(el, '').getPropertyValue(converted);
+         }
+      }
+
+      return value;
+   };
+
+   /**
+    * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @param {String} property The style property to be set.
+    * @param {String} val The value to apply to the given property.
+    */
+   this.setStyle = function(el, property, val) {
+      el = this.get(el);
+      switch(property) {
+         case 'opacity' :
+            if (el.filters) {
+               el.style.filter = 'alpha(opacity=' + val * 100 + ')';
+
+               if (!el.currentStyle.hasLayout) {
+                  el.style.zoom = 1;
+               }
+            } else {
+               el.style.opacity = val;
+               el.style['-moz-opacity'] = val;
+               el.style['-khtml-opacity'] = val;
+            }
+            break;
+         default :
+            el.style[property] = val;
+      }
+   };
+
+   /**
+    * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    */
+   this.getXY = function(el) {
+      el = this.get(el);
+
+      // has to be part of document to have pageXY
+      if (el.parentNode === null || this.getStyle(el, 'display') == 'none') {
+         return false;
+      }
+
+      /**
+       * Position of the html element (x, y)
+       * @private
+       * @type Array
+       */
+      var parent = null;
+      var pos = [];
+      var box;
+
+      if (el.getBoundingClientRect) { // IE
+         box = el.getBoundingClientRect();
+         var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
+         var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
+
+         return [box.left + scrollLeft, box.top + scrollTop];
+      }
+      else if (document.getBoxObjectFor) { // gecko
+         box = document.getBoxObjectFor(el);
+         pos = [box.x, box.y];
+      }
+      else { // safari/opera
+         pos = [el.offsetLeft, el.offsetTop];
+         parent = el.offsetParent;
+         if (parent != el) {
+            while (parent) {
+               pos[0] += parent.offsetLeft;
+               pos[1] += parent.offsetTop;
+               parent = parent.offsetParent;
+            }
+         }
+
+         // opera & (safari absolute) incorrectly account for body offsetTop
+         var ua = navigator.userAgent.toLowerCase();
+         if (
+            ua.indexOf('opera') != -1
+            || ( ua.indexOf('safari') != -1 && this.getStyle(el, 'position') == 'absolute' )
+         ) {
+            pos[1] -= document.body.offsetTop;
+         }
+      }
+
+      if (el.parentNode) { parent = el.parentNode; }
+      else { parent = null; }
+
+      while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') {
+         pos[0] -= parent.scrollLeft;
+         pos[1] -= parent.scrollTop;
+
+         if (parent.parentNode) { parent = parent.parentNode; }
+         else { parent = null; }
+      }
+
+      return pos;
+   };
+
+   /**
+    * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    */
+   this.getX = function(el) {
+      return this.getXY(el)[0];
+   };
+
+   /**
+    * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    */
+   this.getY = function(el) {
+      return this.getXY(el)[1];
+   };
+
+   /**
+    * Set the position of an html element in page coordinates, regardless of how the element is positioned.
+    * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @param {array} pos Contains X & Y values for new position (coordinates are page-based)
+    */
+   this.setXY = function(el, pos, noRetry) {
+      el = this.get(el);
+      var pageXY = YAHOO.util.Dom.getXY(el);
+      if (pageXY === false) { return false; } // has to be part of doc to have pageXY
+
+      if (this.getStyle(el, 'position') == 'static') { // default to relative
+         this.setStyle(el, 'position', 'relative');
+      }
+
+      var delta = [
+         parseInt( YAHOO.util.Dom.getStyle(el, 'left'), 10 ),
+         parseInt( YAHOO.util.Dom.getStyle(el, 'top'), 10 )
+      ];
+
+      if ( isNaN(delta[0]) ) { delta[0] = 0; } // defalts to 'auto'
+      if ( isNaN(delta[1]) ) { delta[1] = 0; }
+
+      if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }
+      if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }
+
+      var newXY = this.getXY(el);
+
+      // if retry is true, try one more time if we miss
+      if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {
+         this.setXY(el, pos, true);
+      }
+
+      return true;
+   };
+
+   /**
+    * Set the X position of an html element in page coordinates, regardless of how the element is positioned.
+    * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @param {Int} x to use as the X coordinate.
+    */
+   this.setX = function(el, x) {
+      return this.setXY(el, [x, null]);
+   };
+
+   /**
+    * Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
+    * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @param {Int} Value to use as the Y coordinate.
+    */
+   this.setY = function(el, y) {
+      return this.setXY(el, [null, y]);
+   };
+
+   /**
+    * Returns the region position of the given element.
+    * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).
+    * @param {String | HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
+    * @return {Region} A Region instance containing "top, left, bottom, right" member data.
+    */
+   this.getRegion = function(el) {
+      el = this.get(el);
+      return new YAHOO.util.Region.getRegion(el);
+   };
+
+   /**
+    * Returns the width of the client (viewport).
+    * @return {Int} The width of the viewable area of the page.
+    */
+   this.getClientWidth = function() {
+      return (
+         document.documentElement.offsetWidth
+         || document.body.offsetWidth
+      );
+   };
+
+   /**
+    * Returns the height of the client (viewport).
+    * @return {Int} The height of the viewable area of the page.
+    */
+   this.getClientHeight = function() {
+      return (
+         self.innerHeight
+         || document.documentElement.clientHeight
+         || document.body.clientHeight
+      );
+   };
+};
+
+/**
+ * @class A region is a representation of an object on a grid.  It is defined
+ * by the top, right, bottom, left extents, so is rectangular by default.  If
+ * other shapes are required, this class could be extended to support it.
+ *
+ * @param {int} t the top extent
+ * @param {int} r the right extent
+ * @param {int} b the bottom extent
+ * @param {int} l the left extent
+ * @constructor
+ */
+YAHOO.util.Region = function(t, r, b, l) {
+
+    /**
+     * The region's top extent
+     * @type int
+     */
+    this.top = t;
+
+    /**
+     * The region's right extent
+     * @type int
+     */
+    this.right = r;
+
+    /**
+     * The region's bottom extent
+     * @type int
+     */
+    this.bottom = b;
+
+    /**
+     * The region's left extent
+     * @type int
+     */
+    this.left = l;
+};
+
+/**
+ * Returns true if this region contains the region passed in
+ *
+ * @param  {Region}  region The region to evaluate
+ * @return {boolean}        True if the region is contained with this region,
+ *                          else false
+ */
+YAHOO.util.Region.prototype.contains = function(region) {
+    return ( region.left   >= this.left   &&
+             region.right  <= this.right  &&
+             region.top    >= this.top    &&
+             region.bottom <= this.bottom    );
+};
+
+/**
+ * Returns the area of the region
+ *
+ * @return {int} the region's area
+ */
+YAHOO.util.Region.prototype.getArea = function() {
+    return ( (this.bottom - this.top) * (this.right - this.left) );
+};
+
+/**
+ * Returns the region where the passed in region overlaps with this one
+ *
+ * @param  {Region} region The region that intersects
+ * @return {Region}        The overlap region, or null if there is no overlap
+ */
+YAHOO.util.Region.prototype.intersect = function(region) {
+    var t = Math.max( this.top,    region.top    );
+    var r = Math.min( this.right,  region.right  );
+    var b = Math.min( this.bottom, region.bottom );
+    var l = Math.max( this.left,   region.left   );
+
+    if (b >= t && r >= l) {
+        return new YAHOO.util.Region(t, r, b, l);
+    } else {
+        return null;
+    }
+};
+
+/**
+ * Returns the region representing the smallest region that can contain both
+ * the passed in region and this region.
+ *
+ * @param  {Region} region The region that to create the union with
+ * @return {Region}        The union region
+ */
+YAHOO.util.Region.prototype.union = function(region) {
+    var t = Math.min( this.top,    region.top    );
+    var r = Math.max( this.right,  region.right  );
+    var b = Math.max( this.bottom, region.bottom );
+    var l = Math.min( this.left,   region.left   );
+
+    return new YAHOO.util.Region(t, r, b, l);
+};
+
+/**
+ * toString
+ * @return string the region properties
+ */
+YAHOO.util.Region.prototype.toString = function() {
+    return ( "Region {" +
+             "  t: "    + this.top    +
+             ", r: "    + this.right  +
+             ", b: "    + this.bottom +
+             ", l: "    + this.left   +
+             "}" );
+}
+
+/**
+ * Returns a region that is occupied by the DOM element
+ *
+ * @param  {HTMLElement} el The element
+ * @return {Region}         The region that the element occupies
+ * @static
+ */
+YAHOO.util.Region.getRegion = function(el) {
+    var p = YAHOO.util.Dom.getXY(el);
+
+    var t = p[1];
+    var r = p[0] + el.offsetWidth;
+    var b = p[1] + el.offsetHeight;
+    var l = p[0];
+
+    return new YAHOO.util.Region(t, r, b, l);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * @class
+ *
+ * A point is a region that is special in that it represents a single point on
+ * the grid.
+ *
+ * @param {int} x The X position of the point
+ * @param {int} y The Y position of the point
+ * @constructor
+ * @extends Region
+ */
+YAHOO.util.Point = function(x, y) {
+    /**
+     * The X position of the point
+     * @type int
+     */
+    this.x      = x;
+
+    /**
+     * The Y position of the point
+     * @type int
+     */
+    this.y      = y;
+
+    this.top    = y;
+    this.right  = x;
+    this.bottom = y;
+    this.left   = x;
+};
+
+YAHOO.util.Point.prototype = new YAHOO.util.Region();
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dragdrop-debug.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dragdrop-debug.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dragdrop-debug.js	(revision 24007)
@@ -0,0 +1,2517 @@
+/*
+Copyright (c) 2006 Yahoo! Inc. All rights reserved.
+version 0.9.0
+*/
+
+/**
+ * @class Defines the interface and base operation of items that that can be
+ * dragged or can be drop targets.  It was designed to be extended, overriding
+ * the event handlers for startDrag, onDrag, onDragOver, onDragOut.
+ * Up to three html elements can be associated with a DragDrop instance:
+ * <ul>
+ * <li>linked element: the element that is passed into the constructor.
+ * This is the element which defines the boundaries for interaction with
+ * other DragDrop objects.</li>
+ * <li>handle element(s): The drag operation only occurs if the element that
+ * was clicked matches a handle element.  By default this is the linked
+ * element, but there are times that you will want only a portion of the
+ * linked element to initiate the drag operation, and the setHandleElId()
+ * method provides a way to define this.</li>
+ * <li>drag element: this represents an the element that would be moved along
+ * with the cursor during a drag operation.  By default, this is the linked
+ * element itself as in {@link YAHOO.util.DD}.  setDragElId() lets you define
+ * a separate element that would be moved, as in {@link YAHOO.util.DDProxy}
+ * </li>
+ * </ul>
+ * This class should not be instantiated until the onload event to ensure that
+ * the associated elements are available.
+ * The following would define a DragDrop obj that would interact with any
+ * other * DragDrop obj in the "group1" group:
+ * <pre>
+ *  dd = new YAHOO.util.DragDrop("div1", "group1");
+ * </pre>
+ * Since none of the event handlers have been implemented, nothing would
+ * actually happen if you were to run the code above.  Normally you would
+ * override this class or one of the default implementations, but you can
+ * also override the methods you want on an instance of the class...
+ * <pre>
+ *  dd.onDragDrop = function(e, id) {
+ *   alert("dd was dropped on " + id);
+ *  }
+ * </pre>
+ * @constructor
+ * @param {String} id of the element that is linked to this instance
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+YAHOO.util.DragDrop = function(id, sGroup) {
+    if (id) {
+        this.init(id, sGroup);
+    }
+};
+
+YAHOO.util.DragDrop.prototype = {
+
+    /**
+     * The id of the element associated with this object.  This is what we
+     * refer to as the "linked element" because the size and position of
+     * this element is used to determine when the drag and drop objects have
+     * interacted.
+     *
+     * @type String
+     */
+    id: null,
+
+    /**
+     * The id of the element that will be dragged.  By default this is same
+     * as the linked element , but could be changed to another element. Ex:
+     * YAHOO.util.DDProxy
+     *
+     * @type String
+     * @private
+     */
+    dragElId: null,
+
+    /**
+     * the id of the element that initiates the drag operation.  By default
+     * this is the linked element, but could be changed to be a child of this
+     * element.  This lets us do things like only starting the drag when the
+     * header element within the linked html element is clicked.
+     *
+     * @type String
+     * @private
+     */
+    handleElId: null,
+
+    /**
+     * An array of HTML tags that will be ignored if clicked.
+     */
+    invalidHandleTypes: null,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     *
+     * @type int
+     * @private
+     */
+    startPageX: 0,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     *
+     * @type int
+     * @private
+     */
+    startPageY: 0,
+
+    /**
+     * The group defines a logical collection of DragDrop objects that are
+     * related.  Instances only get events when interacting with other
+     * DragDrop object in the same group.  This lets us define multiple
+     * groups using a single DragDrop subclass if we want.
+     *
+     */
+    groups: null,
+
+    /**
+     * Individual drag/drop instances can be locked.  This will prevent
+     * onmousedown start drag.
+     *
+     * @type boolean
+     * @private
+     */
+    locked: false,
+
+    /**
+     * Lock this instance
+     */
+    lock: function() { this.locked = true; },
+
+    /**
+     * Unlock this instace
+     */
+    unlock: function() { this.locked = false; },
+
+    /**
+     * By default, all insances can be a drop target.  This can be disabled by
+     * setting isTarget to false.
+     *
+     * @type boolean
+     */
+    isTarget: true,
+
+    /**
+     * The padding configured for this drag and drop object for calculating
+     * the drop zone intersection with this object.
+     */
+    padding: null,
+
+    /**
+     * @private
+     */
+    _domRef: null,
+
+    /**
+     * Internal typeof flag
+     * @private
+     */
+    __ygDragDrop: true,
+
+    /**
+     * Set to true when horizontal contraints are applied
+     *
+     * @type boolean
+     * @private
+     */
+    constrainX: false,
+
+    /**
+     * Set to true when vertical contraints are applied
+     *
+     * @type boolean
+     * @private
+     */
+    constrainY: false,
+
+    /**
+     * The left constraint
+     *
+     * @type int
+     * @private
+     */
+    minX: 0,
+
+    /**
+     * The right constraint
+     *
+     * @type int
+     * @private
+     */
+    maxX: 0,
+
+    /**
+     * The up constraint
+     *
+     * @type int
+     * @private
+     */
+    minY: 0,
+
+    /**
+     * The down constraint
+     *
+     * @type int
+     * @private
+     */
+    maxY: 0,
+
+    /**
+     * Maintain offsets when we resetconstraints.  Used to maintain the
+     * slider thumb value, and this needs to be fixed.
+     * @type boolean
+     */
+    maintainOffset: false,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a
+     * horizontal graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @type int[]
+     */
+    xTicks: null,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a
+     * vertical graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @type int[]
+     */
+    yTicks: null,
+
+    /**
+     * By default the drag and drop instance will only respond to the primary
+     * button click (left button for a right-handed mouse).  Set to true to
+     * allow drag and drop to start with any mouse click that is propogated
+     * by the browser
+     * @type boolean
+     */
+    primaryButtonOnly: true,
+
+    /**
+     * Code that executes immediately before the startDrag event
+     * @private
+     */
+    b4StartDrag: function(x, y) { },
+
+    /**
+     * Abstract method called after a drag/drop object is clicked
+     * and the drag or mousedown time thresholds have beeen met.
+     *
+     * @param {int} X click location
+     * @param {int} Y click location
+     */
+    startDrag: function(x, y) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDrag event
+     * @private
+     */
+    b4Drag: function(e) { },
+
+    /**
+     * Abstract method called during the onMouseMove event while dragging an
+     * object.
+     *
+     * @param {Event} e
+     */
+    onDrag: function(e) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragEnter event
+     * @private
+     */
+    // b4DragEnter: function(e) { },
+
+    /**
+     * Abstract method called when this element fist begins hovering over
+     * another DragDrop obj
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of one or more
+     * dragdrop items being hovered over.
+     */
+    onDragEnter: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOver event
+     * @private
+     */
+    b4DragOver: function(e) { },
+
+    /**
+     * Abstract method called when this element is hovering over another
+     * DragDrop obj
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of dd items
+     * being hovered over.
+     */
+    onDragOver: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOut event
+     * @private
+     */
+    b4DragOut: function(e) { },
+
+    /**
+     * Abstract method called when we are no longer hovering over an element
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this was hovering over.  In INTERSECT mode, an array of dd items
+     * that the mouse is no longer over.
+     */
+    onDragOut: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragDrop event
+     * @private
+     */
+    b4DragDrop: function(e) { },
+
+    /**
+     * Abstract method called when this item is dropped on another DragDrop
+     * obj
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this
+     * was dropped on.
+     */
+    onDragDrop: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the endDrag event
+     * @private
+     */
+    b4EndDrag: function(e) { },
+
+    /**
+     * Fired when we are done dragging the object
+     *
+     * @param {Event} e
+     */
+    endDrag: function(e) { /* override this */ },
+
+    /**
+     * Code executed immediately before the onMouseDown event
+
+     * @param {Event} e
+     * @private
+     */
+    b4MouseDown: function(e) {  },
+
+    /**
+     * Event handler that fires when a drag/drop obj gets a mousedown
+     * @param {Event} e
+     */
+    onMouseDown: function(e) { /* override this */ },
+
+    /**
+     * Event handler that fires when a drag/drop obj gets a mouseup
+     * @param {Event} e
+     */
+    onMouseUp: function(e) { /* override this */ },
+
+    /**
+     * Returns a reference to the linked element
+     *
+     * @return {Object} the html element
+     */
+    getEl: function() {
+        if (!this._domRef) {
+            this._domRef = this.DDM.getElement(this.id);
+        }
+
+        return this._domRef;
+    },
+
+    /**
+     * Returns a reference to the actual element to drag.  By default this is
+     * the same as the html element, but it can be assigned to another
+     * element. An example of this can be found in YAHOO.util.DDProxy
+     *
+     * @return {Object} the html element
+     */
+    getDragEl: function() {
+        return this.DDM.getElement(this.dragElId);
+    },
+
+    /**
+     * Sets up the DragDrop object.  Must be called in the constructor of any
+     * YAHOO.util.DragDrop subclass
+     *
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * element is supposed to be a target only, set to false.
+     */
+    init: function(id, sGroup) {
+        this.initTarget(id, sGroup);
+        YAHOO.util.Event.addListener(id, "mousedown",
+                                          this.handleMouseDown, this, true);
+    },
+
+    /**
+     * Initializes Targeting functionality only... the object does not
+     * get a mousedown handler.
+     *
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * element is supposed to be a target only, set to false.
+     */
+    initTarget: function(id, sGroup) {
+
+        // create a local reference to the drag and drop manager
+        this.DDM = YAHOO.util.DDM;
+
+        // create a logger instance
+        this.logger = new ygLogger("DragDrop");
+
+        // set the default padding
+        this.padding = [0, 0, 0, 0];
+
+        // initialize the groups array
+        this.groups = {};
+
+        // set the id
+        this.id = id;
+
+        // the element is a drag handle by default
+        this.setDragElId(id);
+
+        // by default, clicked anchors will not start drag operations
+        this.invalidHandleTypes = {a : "a"};
+
+        // We don't want to register this as the handle with the manager
+        // so we just set the id rather than calling the setter
+        this.handleElId = id;
+
+        // cache the position of the element if we can
+        if (document && document.body) {
+            this.setInitPosition();
+        }
+
+        // add to an interaction group
+        this.addToGroup((sGroup) ? sGroup : "default");
+
+    },
+
+    /**
+     * Configures the padding for the target zone in px.  Effectively expands
+     * (or reduces) the virtual object size for targeting calculations.
+     * Supports css-style shorthand; if only one parameter is passed, all sides
+     * will have that padding, and if only two are passed, the top and bottom
+     * will have the first param, the left and right the second.
+     * @param {int} iTop    Top pad
+     * @param {int} iRight  Right pad
+     * @param {int} iBot    Bot pad
+     * @param {int} iLeft   Left pad
+     */
+    setPadding: function(iTop, iRight, iBot, iLeft) {
+        // this.padding = [iLeft, iRight, iTop, iBot];
+        if (!iRight && 0 !== iRight) {
+            this.padding = [iTop, iTop, iTop, iTop];
+        } else if (!iBot && 0 !== iBot) {
+            this.padding = [iTop, iRight, iTop, iRight];
+        } else {
+            this.padding = [iTop, iRight, iBot, iLeft];
+        }
+    },
+
+    /**
+     * Stores the initial placement of the dd element
+     */
+    setInitPosition: function(diffX, diffY) {
+        var el = this.getEl();
+
+        if (!this.DDM.verifyEl(el)) {
+            this.logger.debug(this.id + " element is broken");
+            return;
+        }
+
+        var dx = diffX || 0;
+        var dy = diffY || 0;
+
+        var p = YAHOO.util.Dom.getXY( el );
+
+        this.initPageX = p[0] - dx;
+        this.initPageY = p[1] - dy;
+
+        this.lastPageX = p[0];
+        this.lastPageY = p[1];
+
+        this.setStartPosition(p);
+    },
+
+    /**
+     * Sets the start position of the element.  This is set when the obj
+     * is initialized, the reset when a drag is started.
+     * @param pos current position (from previous lookup)
+     * @private
+     */
+    setStartPosition: function(pos) {
+
+        var p = pos || YAHOO.util.Dom.getXY( this.getEl() );
+
+        this.startPageX = p[0];
+        this.startPageY = p[1];
+    },
+
+    /**
+     * Add this instance to a group of related drag/drop objects.  All
+     * instances belong to at least one group, and can belong to as many
+     * groups as needed.
+     *
+     * @param sGroup {string} the name of the group
+     */
+    addToGroup: function(sGroup) {
+        this.groups[sGroup] = true;
+        this.DDM.regDragDrop(this, sGroup);
+    },
+
+    /**
+     * Allows you to specify that an element other than the linked element
+     * will be moved with the cursor during a drag
+     *
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setDragElId: function(id) {
+        this.dragElId = id;
+    },
+
+    /**
+     * Allows you to specify a child of the linked element that should be
+     * used to initiate the drag operation.  An example of this would be if
+     * you have a content div with text and links.  Clicking anywhere in the
+     * content area would normally start the drag operation.  Use this method
+     * to specify that an element inside of the content div is the element
+     * that starts the drag operation.
+     *
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setHandleElId: function(id) {
+        this.handleElId = id;
+        this.DDM.regHandle(this.id, id);
+    },
+
+    /**
+     * Allows you to set an element outside of the linked element as a drag
+     * handle
+     */
+    setOuterHandleElId: function(id) {
+        this.logger.debug("Adding outer handle event: " + id);
+        YAHOO.util.Event.addListener(id, "mousedown",
+                this.handleMouseDown, this, true);
+        this.setHandleElId(id);
+    },
+
+    /**
+     * Remove all drag and drop hooks for this element
+     */
+    unreg: function() {
+        this.logger.debug("DragDrop obj cleanup " + this.id);
+        YAHOO.util.Event.removeListener(this.id, "mousedown",
+                this.handleMouseDown);
+        this._domRef = null;
+        this.DDM._remove(this);
+    },
+
+    /**
+     * Returns true if this instance is locked, or the drag drop mgr is locked
+     * (meaning that all drag/drop is disabled on the page.)
+     *
+     * @return {boolean} true if this obj or all drag/drop is locked, else
+     * false
+     */
+    isLocked: function() {
+        return (this.DDM.isLocked() || this.locked);
+    },
+
+    /**
+     * Fired when this object is clicked
+     *
+     * @param {Event} e
+     * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)
+     * @private
+     */
+    handleMouseDown: function(e, oDD) {
+
+        this.logger.debug("isLocked: " + this.isLocked());
+
+        var EU = YAHOO.util.Event;
+
+
+        var button = e.which || e.button;
+        this.logger.debug("button: " + button);
+
+        if (this.primaryButtonOnly && button > 1) {
+            this.logger.debug("Mousedown was not produced by the primary button");
+            return;
+        }
+
+        if (this.isLocked()) {
+            this.logger.debug("Drag and drop is disabled, aborting");
+            return;
+        }
+
+        this.logger.debug("mousedown " + this.id);
+
+        this.DDM.refreshCache(this.groups);
+
+        // Only process the event if we really clicked within the linked
+        // element.  The reason we make this check is that in the case that
+        // another element was moved between the clicked element and the
+        // cursor in the time between the mousedown and mouseup events. When
+        // this happens, the element gets the next mousedown event
+        // regardless of where on the screen it happened.
+        var pt = new YAHOO.util.Point(EU.getPageX(e), EU.getPageY(e));
+        if ( this.DDM.isOverTarget(pt, this) )  {
+
+            this.logger.debug("click is legit");
+
+            //  check to see if the handle was clicked
+            var srcEl = EU.getTarget(e);
+
+            if (this.isValidHandleChild(srcEl) &&
+                    (this.id == this.handleElId ||
+                     this.DDM.handleWasClicked(srcEl, this.id)) ) {
+
+                // set the initial element position
+                this.setStartPosition();
+
+                this.logger.debug("firing onMouseDown events");
+
+
+                this.b4MouseDown(e);
+                this.onMouseDown(e);
+                this.DDM.handleMouseDown(e, this);
+
+                this.DDM.stopEvent(e);
+            }
+        }
+    },
+
+    /**
+     * Allows you to specify a tag name that should not start a drag operation
+     * when clicked.  This is designed to facilitate embedding links within a
+     * drag handle that do something other than start the drag.
+     *
+     * @param {string} tagName the type of element to exclude
+     */
+    addInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = type;
+    },
+
+    /**
+     * Unsets an excluded tag name set by addInvalidHandleType
+     *
+     * @param {string} tagName the type of element to unexclude
+     */
+    removeInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = null;
+    },
+
+    /**
+     * Checks the tag exclusion list to see if this click should be ignored
+     *
+     * @param {ygNode} node
+     * @return {boolean} true if this is a valid tag type, false if not
+     */
+    isValidHandleChild: function(node) {
+        var type = node.nodeName;
+
+        if (type == "#text") {
+            // this.logger.debug("text node, getting parent node type");
+            type = node.parentNode.nodeName;
+        }
+
+        return (!this.invalidHandleTypes[type]);
+    },
+
+    /**
+     * Create the array of horizontal tick marks if an interval was specified
+     * in setXConstraint().
+     *
+     * @private
+     */
+    setXTicks: function(iStartX, iTickSize) {
+        this.xTicks = [];
+        this.xTickSize = iTickSize;
+
+        var tickMap = {};
+
+        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        this.xTicks.sort(this.DDM.numericSort) ;
+        this.logger.debug("xTicks: " + this.xTicks.join());
+    },
+
+    /**
+     * Create the array of vertical tick marks if an interval was specified in
+     * setYConstraint().
+     *
+     * @private
+     */
+    setYTicks: function(iStartY, iTickSize) {
+        this.yTicks = [];
+        this.yTickSize = iTickSize;
+
+        var tickMap = {};
+
+        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        this.yTicks.sort(this.DDM.numericSort) ;
+        this.logger.debug("yTicks: " + this.yTicks.join());
+    },
+
+    /**
+     * By default, the element can be dragged any place on the screen.  Use
+     * this method to limit the horizontal travel of the element.  Pass in
+     * 0,0 for the parameters if you want to lock the drag to the y axis.
+     *
+     * @param {int} iLeft the number of pixels the element can move to the left
+     * @param {int} iRight the number of pixels the element can move to the
+     * right
+     * @param {int} iTickSize optional parameter for specifying that the
+     * element
+     * should move iTickSize pixels at a time.
+     */
+    setXConstraint: function(iLeft, iRight, iTickSize) {
+        this.leftConstraint = iLeft;
+        this.rightConstraint = iRight;
+
+        this.minX = this.initPageX - iLeft;
+        this.maxX = this.initPageX + iRight;
+        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+
+        this.constrainX = true;
+        this.logger.debug("initPageX:" + this.initPageX + " minX:" + this.minX +
+                " maxX:" + this.maxX);
+    },
+
+    /**
+     * By default, the element can be dragged any place on the screen.  Set
+     * this to limit the vertical travel of the element.  Pass in 0,0 for the
+     * parameters if you want to lock the drag to the x axis.
+     *
+     * @param {int} iUp the number of pixels the element can move up
+     * @param {int} iDown the number of pixels the element can move down
+     * @param {int} iTickSize optional parameter for specifying that the
+     * element should move iTickSize pixels at a time.
+     */
+    setYConstraint: function(iUp, iDown, iTickSize) {
+        this.topConstraint = iUp;
+        this.bottomConstraint = iDown;
+
+        this.minY = this.initPageY - iUp;
+        this.maxY = this.initPageY + iDown;
+        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
+
+        this.constrainY = true;
+
+        this.logger.debug("initPageY:" + this.initPageY + " minY:" + this.minY +
+                " maxY:" + this.maxY);
+    },
+
+    /**
+     * resetConstraints must be called if you manually reposition a dd element.
+     * @param {boolean} maintainOffset
+     */
+    resetConstraints: function() {
+
+        // this.logger.debug("init pagexy: " + this.initPageX + ", " +
+        //      this.initPageY);
+        // this.logger.debug("last pagexy: " + this.lastPageX + ", " +
+        //      this.lastPageY);
+
+        // figure out how much this thing has moved
+        var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
+        var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
+
+        // this.logger.debug("diff: " + dx + ", " + dy);
+
+        // reset the initial location
+        this.setInitPosition(dx, dy);
+
+        if (this.constrainX) {
+            this.setXConstraint( this.leftConstraint,
+                                 this.rightConstraint,
+                                 this.xTickSize        );
+        }
+
+        if (this.constrainY) {
+            this.setYConstraint( this.topConstraint,
+                                 this.bottomConstraint,
+                                 this.yTickSize         );
+        }
+    },
+
+    /**
+     * Normally the drag element is moved pixel by pixel, but we can specify
+     * that it move a number of pixels at a time.  This method resolves the
+     * location when we have it set up like this.
+     *
+     * @param {int} val where we want to place the object
+     * @param {int[]} tickArray sorted array of valid points
+     * @return {int} the closest tick
+     * @private
+     */
+    getTick: function(val, tickArray) {
+
+        if (!tickArray) {
+            // If tick interval is not defined, it is effectively 1 pixel,
+            // so we return the value passed to us.
+            return val;
+        } else if (tickArray[0] >= val) {
+            // The value is lower than the first tick, so we return the first
+            // tick.
+            return tickArray[0];
+        } else {
+            for (var i = 0; i < tickArray.length; ++i) {
+                var next = i + 1;
+                if (tickArray[next] && tickArray[next] >= val) {
+                    var diff1 = val - tickArray[i];
+                    var diff2 = tickArray[next] - val;
+                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
+                }
+            }
+
+            // The value is larger than the last tick, so we return the last
+            // tick.
+            return tickArray[tickArray.length - 1];
+        }
+    },
+
+    /**
+     * toString method
+     * @return {string} string representation of the dd obj
+     */
+    toString: function(val, tickArray) {
+        return ("YAHOO.util.DragDrop {" + this.id + "}");
+    }
+
+};
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+// Only load the library once.  Rewriting the manager class would orphan
+// existing drag and drop instances.
+if (!YAHOO.util.DragDropMgr) {
+
+    /**
+     * @class Handles the element interaction for all DragDrop items in the
+     * window.  Generally, you will not call this class directly, but it does
+     * have helper methods that could be useful in your DragDrop
+     * implementations.  This class should not be instantiated; all methods
+     * are are static.
+     *
+     * @constructor
+     */
+    YAHOO.util.DragDropMgr = new function() {
+
+        /**
+         * utility package shorthand
+         * @private
+         */
+        var UTIL = YAHOO.util;
+
+        /**
+         * Two dimensional Array of registered DragDrop objects.  The first
+         * dimension is the DragDrop item group, the second the DragDrop
+         * object.
+         *
+         * @private
+         */
+        this.ids = {};
+
+        /**
+         * Array of element ids defined as drag handles.  Used to determine
+         * if the element that generated the mousedown event is actually the
+         * handle and not the html element itself.
+         *
+         * @private
+         */
+        this.handleIds = {};
+
+        /**
+         * the DragDrop object that is currently being dragged
+         *
+         * @type DragDrop
+         * @private
+         **/
+        this.dragCurrent = null;
+
+        /**
+         * the DragDrop object(s) that are being hovered over
+         *
+         * @type Array
+         * @private
+         */
+        this.dragOvers = {};
+
+        /**
+         * @private
+         */
+        this.logger = null;
+
+        /**
+         * the X distance between the cursor and the object being dragged
+         *
+         * @type int
+         * @private
+         */
+        this.deltaX = 0;
+
+        /**
+         * the Y distance between the cursor and the object being dragged
+         *
+         * @type int
+         * @private
+         */
+        this.deltaY = 0;
+
+        /**
+         * Flag to determine if we should prevent the default behavior of the
+         * events we define. By default this is true, but this can be set to
+         * false if you need the default behavior (not recommended)
+         *
+         * @type boolean
+         */
+        this.preventDefault = true;
+
+        /**
+         * Flag to determine if we should stop the propagation of the events
+         * we generate. This is true by default but you may want to set it to
+         * false if the html element contains other features that require the
+         * mouse click.
+         *
+         * @type boolean
+         */
+        this.stopPropagation = true;
+
+        /**
+         * @private
+         */
+        this.initalized = false;
+
+        /**
+         * All drag and drop can be disabled.
+         *
+         * @private
+         */
+        this.locked = false;
+
+        /**
+         * Called the first time an element is registered.
+         *
+         * @private
+         */
+        this.init = function() {
+            this.logger = new ygLogger("DragDropMgr");
+        };
+
+        /**
+         * In point mode, drag and drop interaction is defined by the
+         * location of the cursor during the drag/drop
+         * @type int
+         */
+        this.POINT     = 0;
+
+        /**
+         * In intersect mode, drag and drop interactio nis defined by the
+         * overlap of two or more drag and drop objects.
+         * @type int
+         */
+        this.INTERSECT = 1;
+
+        /**
+         * The current drag and drop mode.  Default it point mode
+         * @type int
+         */
+        this.mode = this.POINT;
+
+        /**
+         * Runs method on all drag and drop objects
+         * @private
+         */
+        this._execOnAll = function(sMethod, args) {
+            for (var i in this.ids) {
+                for (var j in this.ids[i]) {
+                    var oDD = this.ids[i][j];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+                    oDD[sMethod].apply(oDD, args);
+                }
+            }
+        };
+
+        /**
+         * Drag and drop initialization.  Sets up the global event handlers
+         * @private
+         */
+        this._onLoad = function() {
+
+            this._execOnAll("setInitPosition", []);
+
+            this.logger = new ygLogger("DragDropMgr");
+            this.logger.debug("DDM onload");
+
+            var EU = UTIL.Event;
+
+            EU.addListener(document, "mouseup",   this.handleMouseUp, this, true);
+            EU.addListener(document, "mousemove", this.handleMouseMove, this, true);
+            EU.addListener(window,   "unload",    this._onUnload, this, true);
+            EU.addListener(window,   "resize",    this._onResize, this, true);
+            // EU.addListener(window,   "mouseout",    this._test);
+
+            this.initalized = true;
+
+        };
+
+        /**
+         * Reset constraints on all drag and drop objs
+         * @private
+         */
+        this._onResize = function(e) {
+            this.logger.debug("window resize");
+            this._execOnAll("resetConstraints", []);
+        };
+
+        /**
+         * Lock all drag and drop functionality
+         */
+        this.lock = function() { this.locked = true; };
+
+        /**
+         * Unlock all drag and drop functionality
+         */
+        this.unlock = function() { this.locked = false; };
+
+        /**
+         * Is drag and drop locked?
+         *
+         * @return {boolean} True if drag and drop is locked, false otherwise.
+         */
+        this.isLocked = function() { return this.locked; };
+
+        /**
+         * Location cache that is set for all drag drop objects when a drag is
+         * initiated, cleared when the drag is finished.
+         *
+         * @private
+         */
+        this.locationCache = {};
+
+        /**
+         * Set useCache to false if you want to force object the lookup of each
+         * drag and drop linked element constantly during a drag.
+         * @type boolean
+         */
+        this.useCache = true;
+
+        /**
+         * The number of pixels that the mouse needs to move after the
+         * mousedown before the drag is initiated.  Default=3;
+         * @type int
+         */
+        this.clickPixelThresh = 3;
+
+        /**
+         * The number of milliseconds after the mousedown event to initiate the
+         * drag if we don't get a mouseup event. Default=1000
+         * @type int
+         */
+        this.clickTimeThresh = 1000;
+
+        /**
+         * Flag that indicates that either the drag pixel threshold or the
+         * mousdown time threshold has been met
+         * @type boolean
+         * @private
+         */
+        this.dragThreshMet = false;
+
+        /**
+         * Timeout used for the click time threshold
+         * @type Object
+         * @private
+         */
+        this.clickTimeout = null;
+
+        /**
+         * The X position of the mousedown event stored for later use when a
+         * drag threshold is met.
+         * @type int
+         * @private
+         */
+        this.startX = 0;
+
+        /**
+         * The Y position of the mousedown event stored for later use when a
+         * drag threshold is met.
+         * @type int
+         * @private
+         */
+        this.startY = 0;
+
+        /**
+         * Each DragDrop instance must be registered with the DragDropMgr.
+         * This is executed in ygDragDrop.init()
+         *
+         * @param {DragDrop} oDD the DragDrop object to register
+         * @param {String} sGroup the name of the group this element belongs to
+         */
+        this.regDragDrop = function(oDD, sGroup) {
+            if (!this.initialized) { this.init(); }
+
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
+            this.ids[sGroup][oDD.id] = oDD;
+        };
+
+        /**
+         * Unregisters a drag and drop item.  This is executed in
+         * ygDragDrop.unreg, use that method instead of calling this directly.
+         * @private
+         */
+        this._remove = function(oDD) {
+            for (var g in oDD.groups) {
+                if (g && this.ids[g][oDD.id]) {
+                    delete this.ids[g][oDD.id];
+                }
+            }
+            delete this.handleIds[oDD.id];
+        };
+
+        /**
+         * Each DragDrop handle element must be registered.  This is done
+         * automatically when executing ygDragDrop.setHandleElId()
+         *
+         * @param {String} sDDId the DragDrop id this element is a handle for
+         * @param {String} sHandleId the id of the element that is the drag
+         * handle
+         */
+        this.regHandle = function(sDDId, sHandleId) {
+            if (!this.handleIds[sDDId]) {
+                this.handleIds[sDDId] = {};
+            }
+            this.handleIds[sDDId][sHandleId] = sHandleId;
+        };
+
+        /**
+         * Utility function to determine if a given element has been
+         * registered as a drag drop item.
+         *
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop item,
+         * false otherwise
+         */
+        this.isDragDrop = function(id) {
+            return ( this.getDDById(id) ) ? true : false;
+        };
+
+        /**
+         * Returns the drag and drop instances that are in all groups the
+         * passed in instance belongs to.
+         *
+         * @param {ygDragDrop} p_oDD the obj to get related data for
+         * @param {boolean} bTargetsOnly if true, only return targetable objs
+         * @return {ygDragDrop[]} the related instances
+         */
+        this.getRelated = function(p_oDD, bTargetsOnly) {
+            var oDDs = [];
+            for (var i in p_oDD.groups) {
+                for (j in this.ids[i]) {
+                    var dd = this.ids[i][j];
+                    if (! this.isTypeOfDD(dd)) {
+                        continue;
+                    }
+                    if (!bTargetsOnly || dd.isTarget) {
+                        oDDs[oDDs.length] = dd;
+                    }
+                }
+            }
+
+            return oDDs;
+        };
+
+        /**
+         * Returns true if the specified dd target is a legal target for
+         * the specifice drag obj
+         *
+         * @param {ygDragDrop} the drag obj
+         * @param {ygDragDrop) the target
+         * @return {boolean} true if the target is a legal target for the
+         * dd obj
+         */
+        this.isLegalTarget = function (oDD, oTargetDD) {
+            var targets = this.getRelated(oDD);
+            for (var i =0;i<targets.length;++i) {
+                if (targets[i].id == oTargetDD.id) {
+                    return true;
+                }
+            }
+
+            return false;
+        };
+
+        /**
+         * My goal is to be able to transparently determine if an object is
+         * typeof ygDragDrop, and the exact subclass of ygDragDrop.  typeof
+         * returns "object", oDD.constructor.toString() always returns
+         * "ygDragDrop" and not the name of the subclass.  So for now it just
+         * evaluates a well-known variable in ygDragDrop.
+         *
+         * @param {Object} the object to evaluate
+         * @return {boolean} true if typeof oDD = ygDragDrop
+         */
+        this.isTypeOfDD = function (oDD) {
+            return (oDD && oDD.__ygDragDrop);
+        };
+
+        /**
+         * Utility function to determine if a given element has been
+         * registered as a drag drop handle for the given Drag Drop object.
+         *
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop handle, false
+         * otherwise
+         */
+        this.isHandle = function(sDDId, sHandleId) {
+            return ( this.handleIds[sDDId] &&
+                            this.handleIds[sDDId][sHandleId] );
+        };
+
+        /**
+         * Returns the DragDrop instance for a given id
+         *
+         * @param {String} id the id of the DragDrop object
+         * @return {DragDrop} the drag drop object, null if it is not found
+         */
+        this.getDDById = function(id) {
+            for (var i in this.ids) {
+                if (this.ids[i][id]) {
+                    return this.ids[i][id];
+                }
+            }
+            return null;
+        };
+
+        /**
+         * Fired after a registered DragDrop object gets the mousedown event.
+         * Sets up the events required to track the object being dragged
+         *
+         * @param {Event} e the event
+         * @param oDD the DragDrop object being dragged
+         * @private
+         */
+        this.handleMouseDown = function(e, oDD) {
+            this.logger.debug("mousedown - adding event handlers");
+            this.dragCurrent = oDD;
+
+            var el = oDD.getEl();
+
+            // track start position
+            this.startX = UTIL.Event.getPageX(e);
+            this.startY = UTIL.Event.getPageY(e);
+
+            this.deltaX = this.startX - el.offsetLeft;
+            this.deltaY = this.startY - el.offsetTop;
+
+            this.dragThreshMet = false;
+
+            this.clickTimeout = setTimeout(
+               "var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX, DDM.startY)",
+               this.clickTimeThresh );
+        };
+
+        /**
+         * Fired when either the drag pixel threshol or the mousedown hold
+         * time threshold has been met.
+         *
+         * @param x {int} the X position of the original mousedown
+         * @param y {int} the Y position of the original mousedown
+         */
+        this.startDrag = function(x, y) {
+            this.logger.debug("firing drag start events");
+            clearTimeout(this.clickTimeout);
+            if (this.dragCurrent) {
+                this.dragCurrent.b4StartDrag(x, y);
+                this.dragCurrent.startDrag(x, y);
+            }
+            this.dragThreshMet = true;
+        };
+
+        /**
+         * Internal function to handle the mouseup event.  Will be invoked
+         * from the context of the document.
+         *
+         * @param {Event} e the event
+         * @private
+         */
+        this.handleMouseUp = function(e) {
+
+            if (! this.dragCurrent) {
+                return;
+            }
+
+            clearTimeout(this.clickTimeout);
+
+            if (this.dragThreshMet) {
+                this.logger.debug("mouseup detected - completing drag");
+                this.fireEvents(e, true);
+            } else {
+                this.logger.debug("drag threshold not met");
+            }
+
+            this.stopDrag(e);
+
+            this.stopEvent(e);
+        };
+
+        /**
+         * Utility to stop event propagation and event default, if these
+         * features are turned on.
+         *
+         * @param {Event} e the event as returned by this.getEvent()
+         */
+        this.stopEvent = function(e) {
+            if (this.stopPropagation) {
+                UTIL.Event.stopPropagation(e);
+            }
+
+            if (this.preventDefault) {
+                UTIL.Event.preventDefault(e);
+            }
+        };
+
+        /**
+         * Internal function to clean up event handlers after the drag
+         * operation is complete
+         *
+         * @param {Event} e the event
+         * @private
+         */
+        this.stopDrag = function(e) {
+            // this.logger.debug("mouseup - removing event handlers");
+
+            // Fire the drag end event for the item that was dragged
+            if (this.dragCurrent) {
+                if (this.dragThreshMet) {
+                    this.logger.debug("firing endDrag events");
+                    this.dragCurrent.b4EndDrag(e);
+                    this.dragCurrent.endDrag(e);
+                }
+
+                this.logger.debug("firing onMouseUp event");
+                this.dragCurrent.onMouseUp(e);
+            }
+
+            this.dragCurrent = null;
+            this.dragOvers = {};
+        };
+
+
+        /**
+         * Internal function to handle the mousemove event.  Will be invoked
+         * from the context of the html element.
+         *
+         * @TODO figure out what we can do about mouse events lost when the
+         * user drags objects beyond the window boundary.  Currently we can
+         * detect this in internet explorer by verifying that the mouse is
+         * down during the mousemove event.  Firefox doesn't give us the
+         * button state on the mousemove event.
+         *
+         * @param {Event} e the event
+         * @private
+         */
+        this.handleMouseMove = function(e) {
+            if (! this.dragCurrent) {
+                // this.logger.debug("no current drag obj");
+                return;
+            }
+
+            // var button = e.which || e.button;
+
+            this.logger.debug("which: " + e.which + ", button: "+ e.button);
+
+
+            // check for IE mouseup outside of page boundary
+            if (UTIL.Event.isIE && !e.button) {
+                this.stopEvent(e);
+                return this.handleMouseUp(e);
+                // this.logger.debug("button failure");
+            }
+
+            if (!this.dragThreshMet) {
+                var diffX = Math.abs(this.startX - UTIL.Event.getPageX(e));
+                var diffY = Math.abs(this.startY - UTIL.Event.getPageY(e));
+                // this.logger.debug("diffX: " + diffX + "diffY: " + diffY);
+                if (diffX > this.clickPixelThresh ||
+                            diffY > this.clickPixelThresh) {
+                    this.logger.debug("pixel threshold met");
+                    this.startDrag(this.startX, this.startY);
+                }
+            }
+
+            if (this.dragThreshMet) {
+                this.dragCurrent.b4Drag(e);
+                this.dragCurrent.onDrag(e);
+                this.fireEvents(e, false);
+            }
+
+            this.stopEvent(e);
+        };
+
+        /**
+         * Iterates over all of the DragDrop elements to find ones we are
+         * hovering over or dropping on
+         *
+         * @param {Event} e the event
+         * @param {boolean} isDrop is this a drop op or a mouseover op?
+         * @private
+         */
+        this.fireEvents = function(e, isDrop) {
+            var dc = this.dragCurrent;
+
+            // If the user did the mouse up outside of the window, we could
+            // get here even though we have ended the drag.
+            if (!dc || dc.isLocked()) {
+                return;
+            }
+
+            var x = UTIL.Event.getPageX(e);
+            var y = UTIL.Event.getPageY(e);
+            var pt = new YAHOO.util.Point(x,y);
+
+            // cache the previous dragOver array
+            var oldOvers = [];
+
+            var outEvts   = [];
+            var overEvts  = [];
+            var dropEvts  = [];
+            var enterEvts = [];
+
+            // Check to see if the object we were hovering over is no longer
+            // being hovered over so we can fire the onDragOut event
+            for (var i in this.dragOvers) {
+
+                var ddo = this.dragOvers[i];
+
+                if (! this.isTypeOfDD(ddo)) {
+                    continue;
+                }
+
+                if (! this.isOverTarget(pt, ddo, this.mode)) {
+                    outEvts.push( ddo );
+                }
+
+                oldOvers[i] = true;
+                delete this.dragOvers[i];
+            }
+
+            for (var sGroup in dc.groups) {
+                // this.logger.debug("Processing group " + sGroup);
+
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+
+                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
+                        if (this.isOverTarget(pt, oDD, this.mode)) {
+                            // look for drop interactions
+                            if (isDrop) {
+                                dropEvts.push( oDD );
+                            // look for drag enter and drag over interactions
+                            } else {
+
+                                // initial drag over: dragEnter fires
+                                if (!oldOvers[oDD.id]) {
+                                    enterEvts.push( oDD );
+                                // subsequent drag overs: dragOver fires
+                                } else {
+                                    overEvts.push( oDD );
+                                }
+
+                                this.dragOvers[oDD.id] = oDD;
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (this.mode) {
+                if (outEvts.length > 0) {
+                    dc.b4DragOut(e, outEvts);
+                    dc.onDragOut(e, outEvts);
+                }
+
+                if (enterEvts.length > 0) {
+                    dc.onDragEnter(e, enterEvts);
+                }
+
+                if (overEvts.length > 0) {
+                    dc.b4DragOver(e, overEvts);
+                    dc.onDragOver(e, overEvts);
+                }
+
+                if (dropEvts.length > 0) {
+                    dc.b4DragDrop(e, dropEvts);
+                    dc.onDragDrop(e, dropEvts);
+                }
+
+            } else {
+                // fire dragout events
+                for (i=0; i < outEvts.length; ++i) {
+                    this.logger.debug(dc.id+" onDragOut: " + outEvts[i].id);
+                    dc.b4DragOut(e, outEvts[i].id);
+                    dc.onDragOut(e, outEvts[i].id);
+                }
+
+                // fire enter events
+                for (i=0; i < enterEvts.length; ++i) {
+                    this.logger.debug(dc.id + " dragEnter " + enterEvts[i].id);
+                    // dc.b4DragEnter(e, oDD.id);
+                    dc.onDragEnter(e, enterEvts[i].id);
+                }
+
+                // fire over events
+                for (i=0; i < overEvts.length; ++i) {
+                    this.logger.debug(dc.id + " dragOver " + overEvts[i].id);
+                    dc.b4DragOver(e, overEvts[i].id);
+                    dc.onDragOver(e, overEvts[i].id);
+                }
+
+                // fire drop events
+                for (i=0; i < dropEvts.length; ++i) {
+                    this.logger.debug(dc.id + " dragDrop " + dropEvts[i].id);
+                    dc.b4DragDrop(e, dropEvts[i].id);
+                    dc.onDragDrop(e, dropEvts[i].id);
+                }
+
+            }
+
+        };
+
+        /**
+         * Helper function for getting the best match from the list of drag
+         * and drop objects returned by the drag and drop events when we are
+         * in INTERSECT mode.  It returns either the first object that the
+         * cursor is over, or the object that has the greatest overlap with
+         * the dragged element.
+         *
+         * @param  {ygDragDrop[]} dds The array of drag and drop objects
+         * targeted
+         * @return {ygDragDrop}       The best single match
+         */
+        this.getBestMatch = function(dds) {
+            var winner = null;
+            // Return null if the input is not what we expect
+            //if (!dds || !dds.length || dds.length == 0) {
+               // winner = null;
+            // If there is only one item, it wins
+            //} else if (dds.length == 1) {
+
+            if (dds.length == 1) {
+                winner = dds[0];
+            } else {
+                // Loop through the targeted items
+                for (var i=0; i<dds.length; ++i) {
+                    var dd = dds[i];
+                    // If the cursor is over the object, it wins.  If the
+                    // cursor is over multiple matches, the first one we come
+                    // to wins.
+                    if (dd.cursorIsOver) {
+                        winner = dd;
+                        break;
+                    // Otherwise the object with the most overlap wins
+                    } else {
+                        if (!winner ||
+                            winner.overlap.getArea() < dd.overlap.getArea()) {
+                            winner = dd;
+                        }
+                    }
+                }
+            }
+
+            return winner;
+        };
+
+        /**
+         * Refreshes the cache of the top-left and bottom-right points of the
+         * drag and drop objects in the specified groups
+         *
+         * @param {Array} aGroups an associative array of groups to refresh
+         */
+        this.refreshCache = function(aGroups) {
+            this.logger.debug("refreshing element location cache");
+            for (sGroup in aGroups) {
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+
+                    if (this.isTypeOfDD(oDD)) {
+                        var loc = this.getLocation(oDD);
+                        if (loc) {
+                            this.locationCache[oDD.id] = loc;
+                        } else {
+                            delete this.locationCache[oDD.id];
+                            this.logger.debug("something is wrong with the element");
+                            // this will unregister the drag and drop object if
+                            // the element is not in a usable state
+                            oDD.unreg();
+                        }
+                    }
+                }
+            }
+        };
+
+        /**
+         * This checks to make sure an element exists and is in the DOM.  The
+         * main purpose is to handle cases where innerHTML is used to remove
+         * drag and drop objects from the DOM.  IE provides an 'unspecified
+         * error' when trying to access the offsetParent of such an element
+         * @param {HTMLElement} el the element to check
+         * @return {boolean} true if the element looks usable
+         */
+        this.verifyEl = function(el) {
+            try {
+                if (el) {
+                    var parent = el.offsetParent;
+                    if (parent) {
+                        return true;
+                    }
+                }
+            } catch(e) {
+                this.logger.debug("detected problem with an element");
+            }
+
+            return false;
+        };
+
+        /**
+         * Returns the an array containing the drag and drop element's position
+         * and size, including the ygDragDrop.padding configured for it
+         *
+         * @param {ygDragDrop} oDD the drag and drop object to get the
+         * location for
+         * @return array containing the top left and bottom right points of the
+         * element
+         */
+        this.getLocation = function(oDD) {
+            if (! this.isTypeOfDD(oDD)) {
+                this.logger.debug(oDD + " is not a DD obj");
+                return null;
+            }
+
+            var el = oDD.getEl();
+
+            if (!this.verifyEl(el)) {
+                this.logger.debug(oDD + " element is not usable");
+                return null;
+            }
+
+            // this.logger.debug(oDD.id + " padding: " + oDD.padding);
+
+            // var aPos = ygPos.getPos(el);
+            var aPos = YAHOO.util.Dom.getXY(el);
+
+            x1 = aPos[0];
+            x2 = x1 + el.offsetWidth;
+
+            y1 = aPos[1];
+            y2 = y1 + el.offsetHeight;
+
+            var t = y1 - oDD.padding[0];
+            var r = x2 + oDD.padding[1];
+            var b = y2 + oDD.padding[2];
+            var l = x1 - oDD.padding[3];
+
+            return new YAHOO.util.Region( t, r, b, l );
+
+        };
+
+        /**
+         * Checks the cursor location to see if it over the target
+         *
+         * @param {YAHOO.util.Point} pt The point to evaluate
+         * @param {ygDragDrop} oDDTarget the DragDrop object we are inspecting
+         * @return {boolean} true if the mouse is over the target
+         * @private
+         */
+        this.isOverTarget = function(pt, oDDTarget, intersect) {
+            // use cache if available
+            var loc = this.locationCache[oDDTarget.id];
+            if (!loc || !this.useCache) {
+                this.logger.debug("cache not populated");
+                loc = this.getLocation(oDDTarget);
+                this.locationCache[oDDTarget.id] = loc;
+
+                this.logger.debug("cache: " + loc);
+            }
+
+            // this.logger.debug("isOverTarget: " + x + "," + y + ", " + loc);
+
+            // var cursorIsOver =  (x >= loc[3] && x <= loc[1] && y >= loc[0] && y <= loc[2]);
+            //oDDTarget.cursorIsOver = loc.contains( new YAHOO.util.Point(x, y) );
+            oDDTarget.cursorIsOver = loc.contains( pt );
+            oDDTarget.overlap = null;
+
+            // if (this.INTERSECT == this.mode) {
+            if (intersect) {
+
+                var curRegion =
+                    YAHOO.util.Region.getRegion(this.dragCurrent.getDragEl());
+                var overlap = curRegion.intersect(loc);
+
+                if (overlap) {
+                    oDDTarget.overlap = overlap;
+                    return true;
+                } else {
+                    return false;
+                }
+
+            } else {
+                return oDDTarget.cursorIsOver;
+            }
+        };
+
+        /**
+         * @private
+         */
+        this._onUnload = function(e, me) {
+            this.unregAll();
+        };
+
+        /**
+         * Cleans up the drag and drop events and objects.
+         *
+         * @private
+         */
+        this.unregAll = function() {
+            this.logger.debug("unregister all");
+
+            if (this.dragCurrent) {
+                this.stopDrag();
+                this.dragCurrent = null;
+            }
+
+            this._execOnAll("unreg", []);
+
+            for (i in this.elementCache) {
+                delete this.elementCache[i];
+            }
+
+            this.elementCache = {};
+            this.ids = {};
+        };
+
+        /**
+         * A cache of DOM elements
+         *
+         * @private
+         */
+        this.elementCache = {};
+
+        /**
+         * Get the wrapper for the DOM element specified
+         *
+         * @param {String} id the id of the elment to get
+         * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element
+         * @private
+         */
+        this.getElWrapper = function(id) {
+            var oWrapper = this.elementCache[id];
+            if (!oWrapper || !oWrapper.el) {
+                // this.logger.debug("adding element cache: " + id);
+                oWrapper = this.elementCache[id] =
+                    new this.ElementWrapper(document.getElementById(id));
+            }
+            return oWrapper;
+        };
+
+        /**
+         * Returns the actual DOM element
+         *
+         * @param {String} id the id of the elment to get
+         * @return {Object} The element
+         */
+        this.getElement = function(id) {
+            // return this.getElWrapper(id).el;
+            return document.getElementById(id);
+        };
+
+        /**
+         * Returns the style property for the DOM element (i.e.,
+         * document.getElById(id).style)
+         *
+         * @param {String} id the id of the elment to get
+         * @return {Object} The style property of the element
+         */
+        this.getCss = function(id) {
+            // return this.getElWrapper(id).css;
+            var css = null;
+            var el = document.getElementById(id);
+            if (el) {
+                css = el.style;
+            }
+
+            return css;
+        };
+
+        /**
+         * Inner class for cached elements
+         */
+        this.ElementWrapper = function(el) {
+                /**
+                 * @private
+                 */
+                this.el = el || null;
+                /**
+                 * @private
+                 */
+                this.id = this.el && el.id;
+                /**
+                 * @private
+                 */
+                this.css = this.el && el.style;
+            };
+
+        /**
+         * Returns the X position of an html element
+         * @param el the element for which to get the position
+         * @return {int} the X coordinate
+         */
+        this.getPosX = function(el) {
+            return YAHOO.util.Dom.getX(el);
+        };
+
+        /**
+         * Returns the Y position of an html element
+         * @param el the element for which to get the position
+         * @return {int} the Y coordinate
+         */
+        this.getPosY = function(el) {
+            return YAHOO.util.Dom.getY(el);
+        };
+
+        /**
+         * Swap two nodes.  In IE, we use the native method, for others we
+         * emulate the IE behavior
+         *
+         * @param n1 the first node to swap
+         * @param n2 the other node to swap
+         */
+        this.swapNode = function(n1, n2) {
+            if (n1.swapNode) {
+                n1.swapNode(n2);
+            } else {
+                // the node reference order for the swap is a little tricky.
+                var p = n2.parentNode;
+                var s = n2.nextSibling;
+                n1.parentNode.replaceChild(n2,n1);
+                p.insertBefore(n1,s);
+            }
+        };
+
+        /**
+         * @private
+         */
+        this.getScroll = function () {
+            var t, l;
+            if (document.documentElement && document.documentElement.scrollTop) {
+                t = document.documentElement.scrollTop;
+                l = document.documentElement.scrollLeft;
+            } else if (document.body) {
+                t = document.body.scrollTop;
+                l = document.body.scrollLeft;
+            }
+            return { top: t, left: l };
+        };
+
+        /**
+         * Returns the specified element style property
+         * @param {HTMLElement} el          the element
+         * @param {string}      styleProp   the style property
+         * @return {string}     The value of the style property
+         */
+        this.getStyle = function(el, styleProp) {
+            if (el.style.styleProp) {
+                return el.style.styleProp;
+            } else if (el.currentStyle) {
+                return el.currentStyle[styleProp];
+            } else if (document.defaultView) {
+                return document.defaultView.getComputedStyle(el, null).
+                    getPropertyValue(styleProp);
+            }
+        };
+
+        /**
+         * Gets the scrollTop
+         *
+         * @return {int} the document's scrollTop
+         */
+        this.getScrollTop = function () { return this.getScroll().top; };
+
+        /**
+         * Gets the scrollLeft
+         *
+         * @return {int} the document's scrollTop
+         */
+        this.getScrollLeft = function () { return this.getScroll().left; };
+
+        this.moveToEl = function (moveEl, targetEl) {
+            var aCoord = YAHOO.util.Dom.getXY(targetEl);
+            this.logger.debug("moveToEl: " + aCoord);
+            YAHOO.util.Dom.setXY(moveEl, aCoord);
+        };
+
+        /**
+         * Gets the client height
+         *
+         * @return {int} client height in px
+         */
+        this.getClientHeight = function() {
+            return (window.innerHeight) ? window.innerHeight :
+                (document.documentElement && document.documentElement.clientHeight) ?
+                document.documentElement.clientHeight : document.body.offsetHeight;
+        };
+
+        /**
+         * Gets the client width
+         *
+         * @return {int} client width in px
+         */
+        this.getClientWidth = function() {
+            return (window.innerWidth) ? window.innerWidth :
+                (document.documentElement && document.documentElement.clientWidth) ?
+                document.documentElement.clientWidth : document.body.offsetWidth;
+        };
+
+        /**
+         * numeric array sort function
+         */
+        this.numericSort = function(a, b) { return (a - b); };
+
+        /**
+         * @private
+         */
+        this._timeoutCount = 0;
+
+        /**
+         * @private
+         * Trying to make the load order less important.  Without this we get
+         * an error if this file is loaded before the Event Utility.
+         */
+        this._addListeners = function() {
+            if ( UTIL.Event &&
+                 document          &&
+                 document.body        ) {
+
+                this._onLoad();
+            } else {
+                if (this._timeoutCount > 500) {
+                    this.logger.debug("DragDrop requires the Event Utility");
+                } else {
+                    setTimeout("YAHOO.util.DDM._addListeners()", 10);
+                    this._timeoutCount += 1;
+                }
+            }
+
+        };
+
+        /**
+         * Recursively searches the immediate parent and all child nodes for
+         * the handle element in order to determine wheter or not it was
+         * clicked.
+         *
+         * @param node the html element to inspect
+         */
+        this.handleWasClicked = function(node, id) {
+            if (this.isHandle(id, node.id)) {
+                this.logger.debug("clicked node is a handle");
+                return true;
+            } else {
+                // check to see if this is a text node child of the one we want
+                var p = node.parentNode;
+                // this.logger.debug("p: " + p);
+
+                while (p) {
+                    if (this.isHandle(id, p.id)) {
+                        return true;
+                    } else {
+                        this.logger.debug(p.id + " is not a handle");
+                        p = p.parentNode;
+                    }
+                }
+            }
+
+            return false;
+        };
+
+    };
+
+    // shorter alias, save a few bytes
+    YAHOO.util.DDM = YAHOO.util.DragDropMgr;
+    YAHOO.util.DDM._addListeners();
+
+}
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation where the linked element follows the
+ * mouse cursor.
+ *
+ * @extends DragDrop
+ * @constructor
+ * @param {String} id the id of the linked element
+ * @param {String} sGroup the group of related DragDrop items
+ */
+YAHOO.util.DD = function(id, sGroup) {
+    if (id) {
+        this.init(id, sGroup);
+        this.logger.setModuleName("DD");
+    }
+};
+
+YAHOO.util.DD.prototype = new YAHOO.util.DragDrop();
+
+/**
+ * Should we auto-scroll? Defaults to true
+ *
+ * @type boolean
+ */
+YAHOO.util.DD.prototype.scroll = true;
+
+/**
+ * Sets the pointer offset to the distance between the linked element's top
+ * left corner and the location the element was clicked
+ *
+ * @param {int} iPageX the X coordinate of the click
+ * @param {int} iPageY the Y coordinate of the click
+ */
+YAHOO.util.DD.prototype.autoOffset = function(iPageX, iPageY) {
+    var el = this.getEl();
+    var aCoord = YAHOO.util.Dom.getXY(el);
+    var x = iPageX - aCoord[0];
+    var y = iPageY - aCoord[1];
+    this.setDelta(x, y);
+    this.logger.debug("autoOffset el pos: " + aCoord + ", delta: " + x + "," + y);
+};
+
+/**
+ * Sets the pointer offset.  You can call this directly to force the offset to
+ * be in a particular location (e.g., pass in 0,0 to set it to the center of the
+ * object, as done in ygDDSliderBG)
+ *
+ * @param {int} iDeltaX the distance from the left
+ * @param {int} iDeltaY the distance from the top
+ */
+YAHOO.util.DD.prototype.setDelta = function(iDeltaX, iDeltaY) {
+    this.deltaX = iDeltaX;
+    this.deltaY = iDeltaY;
+    this.logger.debug("deltaX:" + this.deltaX + ", deltaY:" + this.deltaY);
+};
+
+/**
+ * Sets the drag element to the location of the mousedown or click event,
+ * maintaining the cursor location relative to the location on the element
+ * that was clicked.  Override this if you want to place the element in a
+ * location other than where the cursor is.
+ *
+ * @param {int} iPageX the X coordinate of the mousedown or drag event
+ * @param {int} iPageY the Y coordinate of the mousedown or drag event
+ */
+
+YAHOO.util.DD.prototype.setDragElPos = function(iPageX, iPageY) {
+    this.alignElWithMouse(this.getDragEl(), iPageX, iPageY);
+};
+
+/**
+ * Sets the element to the location of the mousedown or click event,
+ * maintaining the cursor location relative to the location on the element
+ * that was clicked.  Override this if you want to place the element in a
+ * location other than where the cursor is.
+ *
+ * @param {HTMLElement} el the element to move
+ * @param {int} iPageX the X coordinate of the mousedown or drag event
+ * @param {int} iPageY the Y coordinate of the mousedown or drag event
+ */
+YAHOO.util.DD.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+    var oCoord = this.getTargetCoord(iPageX, iPageY);
+    var aCoord = [oCoord.x, oCoord.y];
+    // this.logger.debug("****alignElWithMouse : " + el.id + ", " + aCoord + ", " + el.style.display);
+    YAHOO.util.Dom.setXY(el, aCoord);
+
+    this.cachePosition(oCoord.x, oCoord.y);
+
+    this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+
+/**
+ * Saves the most recent position so that we can reset the constraints and
+ * tick marks on-demand.  We need to know this so that we can calculate the
+ * number of pixels the element is offset from its original position.
+ */
+YAHOO.util.DD.prototype.cachePosition = function(iPageX, iPageY) {
+    if (iPageX) {
+        this.lastPageX = iPageX;
+        this.lastPageY = iPageY;
+    } else {
+        var aCoord = YAHOO.util.Dom.getXY(this.getEl());
+        this.lastPageX = aCoord[0];
+        this.lastPageY = aCoord[1];
+    }
+};
+
+/**
+ * Auto-scroll the window if the dragged object has been moved beyond the
+ * visible window boundary.
+ *
+ * @param {int} x the drag element's x position
+ * @param {int} y the drag element's y position
+ * @param {int} h the height of the drag element
+ * @param {int} w the width of the drag element
+ * @private
+ */
+YAHOO.util.DD.prototype.autoScroll = function(x, y, h, w) {
+
+    if (this.scroll) {
+        // The client height
+        var clientH = this.DDM.getClientHeight();
+
+        // The client width
+        var clientW = this.DDM.getClientWidth();
+
+        // The amt scrolled down
+        var st = this.DDM.getScrollTop();
+
+        // The amt scrolled right
+        var sl = this.DDM.getScrollLeft();
+
+        // Location of the bottom of the element
+        var bot = h + y;
+
+        // Location of the right of the element
+        var right = w + x;
+
+        // The distance from the cursor to the bottom of the visible area,
+        // adjusted so that we don't scroll if the cursor is beyond the
+        // element drag constraints
+        var toBot = (clientH + st - y - this.deltaY);
+
+        // The distance from the cursor to the right of the visible area
+        var toRight = (clientW + sl - x - this.deltaX);
+
+        // this.logger.debug( " x: " + x + " y: " + y + " h: " + h +
+        // " clientH: " + clientH + " clientW: " + clientW +
+        // " st: " + st + " sl: " + sl + " bot: " + bot +
+        // " right: " + right + " toBot: " + toBot + " toRight: " + toRight);
+
+        // How close to the edge the cursor must be before we scroll
+        // var thresh = (document.all) ? 100 : 40;
+        var thresh = 40;
+
+        // How many pixels to scroll per autoscroll op.  This helps to reduce
+        // clunky scrolling. IE is more sensitive about this ... it needs this
+        // value to be higher.
+        var scrAmt = (document.all) ? 80 : 30;
+
+        // Scroll down if we are near the bottom of the visible page and the
+        // obj extends below the crease
+        if ( bot > clientH && toBot < thresh ) {
+            window.scrollTo(sl, st + scrAmt);
+        }
+
+        // Scroll up if the window is scrolled down and the top of the object
+        // goes above the top border
+        if ( y < st && st > 0 && y - st < thresh ) {
+            window.scrollTo(sl, st - scrAmt);
+        }
+
+        // Scroll right if the obj is beyond the right border and the cursor is
+        // near the border.
+        if ( right > clientW && toRight < thresh ) {
+            window.scrollTo(sl + scrAmt, st);
+        }
+
+        // Scroll left if the window has been scrolled to the right and the obj
+        // extends past the left border
+        if ( x < sl && sl > 0 && x - sl < thresh ) {
+            window.scrollTo(sl - scrAmt, st);
+        }
+    }
+};
+
+/**
+ * Finds the location the element should be placed if we want to move
+ * it to where the mouse location less the click offset would place us.
+ *
+ * @param {int} iPageX the X coordinate of the click
+ * @param {int} iPageY the Y coordinate of the click
+ * @return an object that contains the coordinates (Object.x and Object.y)
+ * @private
+ */
+YAHOO.util.DD.prototype.getTargetCoord = function(iPageX, iPageY) {
+
+    // this.logger.debug("getTargetCoord: " + iPageX + ", " + iPageY);
+
+    var x = iPageX - this.deltaX;
+    var y = iPageY - this.deltaY;
+
+    if (this.constrainX) {
+        if (x < this.minX) { x = this.minX; }
+        if (x > this.maxX) { x = this.maxX; }
+    }
+
+    if (this.constrainY) {
+        if (y < this.minY) { y = this.minY; }
+        if (y > this.maxY) { y = this.maxY; }
+    }
+
+    x = this.getTick(x, this.xTicks);
+    y = this.getTick(y, this.yTicks);
+
+    // this.logger.debug("getTargetCoord " +
+            // " iPageX: " + iPageX +
+            // " iPageY: " + iPageY +
+            // " x: " + x + ", y: " + y);
+
+    return {x:x, y:y};
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DD.prototype.b4MouseDown = function(e) {
+    // this.resetConstraints();
+    this.autoOffset(YAHOO.util.Event.getPageX(e),
+                        YAHOO.util.Event.getPageY(e));
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DD.prototype.b4Drag = function(e) {
+    this.setDragElPos(YAHOO.util.Event.getPageX(e),
+                        YAHOO.util.Event.getPageY(e));
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Debugging ygDragDrop events that can be overridden
+///////////////////////////////////////////////////////////////////////////////
+/*
+YAHOO.util.DD.prototype.startDrag = function(x, y) {
+    this.logger.debug(this.id.toString()  + " startDrag");
+};
+
+YAHOO.util.DD.prototype.onDrag = function(e) {
+    this.logger.debug(this.id.toString() + " onDrag");
+};
+
+YAHOO.util.DD.prototype.onDragEnter = function(e, id) {
+    this.logger.debug(this.id.toString() + " onDragEnter: " + id);
+};
+
+YAHOO.util.DD.prototype.onDragOver = function(e, id) {
+    this.logger.debug(this.id.toString() + " onDragOver: " + id);
+};
+
+YAHOO.util.DD.prototype.onDragOut = function(e, id) {
+    this.logger.debug(this.id.toString() + " onDragOut: " + id);
+};
+
+YAHOO.util.DD.prototype.onDragDrop = function(e, id) {
+    this.logger.debug(this.id.toString() + " onDragDrop: " + id);
+};
+
+YAHOO.util.DD.prototype.endDrag = function(e) {
+    this.logger.debug(this.id.toString() + " endDrag");
+};
+*/
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation that inserts an empty, bordered div into
+ * the document that follows the cursor during drag operations.  At the time of
+ * the click, the frame div is resized to the dimensions of the linked html
+ * element, and moved to the exact location of the linked element.
+ *
+ * @extends YAHOO.util.DD
+ * @constructor
+ * @param {String} id the id of the linked html element
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+YAHOO.util.DDProxy = function(id, sGroup) {
+    if (id) {
+        this.init(id, sGroup);
+        this.initFrame();
+        this.logger.setModuleName("DDProxy");
+    }
+};
+
+YAHOO.util.DDProxy.prototype = new YAHOO.util.DD();
+
+/**
+ * A reference to the one div element we create for all instances of this class
+ *
+ * @type Object
+ */
+YAHOO.util.DDProxy.frameDiv = null;
+
+/**
+ * the drag frame div id
+ *
+ * @type String
+ */
+YAHOO.util.DDProxy.dragElId = "ygddfdiv";
+
+/**
+ * The border width of the frame.  This is used when we resize the frame to
+ * the size of the linked element.  We substract the border width to make
+ * the div the correct size.
+ *
+ * @TODO find a better way to handle this
+ *
+ * @type int
+ */
+YAHOO.util.DDProxy.prototype.borderWidth = 2;
+
+/**
+ * By default we resize the drag frame to be the same size as the element
+ * we want to drag (this is to get the frame effect).  We can turn it off
+ * if we want a different behavior (ex: ygDDMy2)
+ *
+ * @type boolean
+ */
+YAHOO.util.DDProxy.prototype.resizeFrame = true;
+
+/**
+ * By default the frame is positioned exactly where the drag element is, so
+ * we use the cursor offset provided by YAHOO.util.DD.  Another option that works only if
+ * you do not have constraints on the obj is to have the drag frame centered
+ * around the cursor.  Set centerFrame to true for this effect.  Ex:
+ * ygDDMy2
+ *
+ * @type boolean
+ */
+YAHOO.util.DDProxy.prototype.centerFrame = false;
+
+/**
+ * Create the drag frame if needed
+ */
+YAHOO.util.DDProxy.createFrame = function() {
+    var THIS = YAHOO.util.DDProxy;
+
+    if (!document || !document.body) {
+        setTimeout(THIS.createFrame, 50);
+        return;
+    }
+
+    if (!THIS.frameDiv) {
+        THIS.frameDiv = document.createElement("div");
+        THIS.frameDiv.id = THIS.dragElId;
+        var s = THIS.frameDiv.style;
+        s.position = "absolute";
+        s.visibility = "hidden";
+        s.cursor = "move";
+        s.border = "2px solid #aaa";
+        s.zIndex = 999;
+
+        document.body.appendChild(THIS.frameDiv);
+    }
+};
+
+/**
+ * Initialization for the drag frame element.  Must be called in the
+ * constructor of all subclasses
+ */
+YAHOO.util.DDProxy.prototype.initFrame = function() {
+    YAHOO.util.DDProxy.createFrame();
+    this.setDragElId(YAHOO.util.DDProxy.dragElId);
+    this.useAbsMath = true;
+};
+
+/**
+ * Resizes the drag frame to the dimensions of the clicked object, positions
+ * it over the object, and finally displays it
+ *
+ * @param {int} iPageX X click position
+ * @param {int} iPageY Y click position
+ * @private
+ */
+YAHOO.util.DDProxy.prototype.showFrame = function(iPageX, iPageY) {
+    var el = this.getEl();
+
+    var s = this.getDragEl().style;
+
+    if (this.resizeFrame) {
+        s.width = (parseInt(el.offsetWidth) - (2*this.borderWidth)) + "px";
+        s.height = (parseInt(el.offsetHeight) - (2*this.borderWidth)) + "px";
+    }
+
+    if (this.centerFrame) {
+        this.setDelta(Math.round(parseInt(s.width)/2),
+                Math.round(parseInt(s.width)/2));
+    }
+
+    this.setDragElPos(iPageX, iPageY);
+
+    s.visibility = "";
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DDProxy.prototype.b4MouseDown = function(e) {
+    var x = YAHOO.util.Event.getPageX(e);
+    var y = YAHOO.util.Event.getPageY(e);
+    this.autoOffset(x, y);
+    this.setDragElPos(x, y);
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DDProxy.prototype.b4StartDrag = function(x, y) {
+    // show the drag frame
+    this.logger.debug("start drag show frame, x: " + x + ", y: " + y);
+    this.showFrame(x, y);
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DDProxy.prototype.b4EndDrag = function(e) {
+    this.logger.debug(this.id + " b4EndDrag");
+
+    // hide the drag frame
+    var s = this.getDragEl().style;
+    s.visibility = "hidden";
+};
+
+// overrides YAHOO.util.DragDrop
+// By default we try to move the element to the last location of the frame.
+// This is so that the default behavior mirrors that of YAHOO.util.DD.
+YAHOO.util.DDProxy.prototype.endDrag = function(e) {
+    this.logger.debug(this.id + " endDrag");
+    var lel = this.getEl();
+    var del = this.getDragEl();
+
+    // Show the drag frame briefly so we can get its position
+    del.style.visibility = "";
+
+    // Hide the linked element before the move to get around a Safari
+    // rendering bug.
+    lel.style.visibility = "hidden";
+    YAHOO.util.DDM.moveToEl(lel, del);
+    del.style.visibility = "hidden";
+    lel.style.visibility = "";
+};
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation that does not move, but can be a drop
+ * target.  You would get the same result by simply omitting implementation
+ * for the event callbacks, but this way we reduce the processing cost of the
+ * event listener and the callbacks.
+ *
+ * @extends YAHOO.util.DragDrop
+ * @constructor
+ * @param {String} id the id of the element that is a drop target
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+
+YAHOO.util.DDTarget = function(id, sGroup) {
+    if (id) {
+        this.initTarget(id, sGroup);
+        this.logger.setModuleName("DDTarget");
+    }
+};
+
+YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop();
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dragdrop.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dragdrop.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/dragdrop.js	(revision 24007)
@@ -0,0 +1,2426 @@
+/*
+Copyright (c) 2006 Yahoo! Inc. All rights reserved.
+version 0.9.0
+*/
+
+/**
+ * @class Defines the interface and base operation of items that that can be
+ * dragged or can be drop targets.  It was designed to be extended, overriding
+ * the event handlers for startDrag, onDrag, onDragOver, onDragOut.
+ * Up to three html elements can be associated with a DragDrop instance:
+ * <ul>
+ * <li>linked element: the element that is passed into the constructor.
+ * This is the element which defines the boundaries for interaction with
+ * other DragDrop objects.</li>
+ * <li>handle element(s): The drag operation only occurs if the element that
+ * was clicked matches a handle element.  By default this is the linked
+ * element, but there are times that you will want only a portion of the
+ * linked element to initiate the drag operation, and the setHandleElId()
+ * method provides a way to define this.</li>
+ * <li>drag element: this represents an the element that would be moved along
+ * with the cursor during a drag operation.  By default, this is the linked
+ * element itself as in {@link YAHOO.util.DD}.  setDragElId() lets you define
+ * a separate element that would be moved, as in {@link YAHOO.util.DDProxy}
+ * </li>
+ * </ul>
+ * This class should not be instantiated until the onload event to ensure that
+ * the associated elements are available.
+ * The following would define a DragDrop obj that would interact with any
+ * other * DragDrop obj in the "group1" group:
+ * <pre>
+ *  dd = new YAHOO.util.DragDrop("div1", "group1");
+ * </pre>
+ * Since none of the event handlers have been implemented, nothing would
+ * actually happen if you were to run the code above.  Normally you would
+ * override this class or one of the default implementations, but you can
+ * also override the methods you want on an instance of the class...
+ * <pre>
+ *  dd.onDragDrop = function(e, id) {
+ *   alert("dd was dropped on " + id);
+ *  }
+ * </pre>
+ * @constructor
+ * @param {String} id of the element that is linked to this instance
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+YAHOO.util.DragDrop = function(id, sGroup) {
+    if (id) {
+        this.init(id, sGroup);
+    }
+};
+
+YAHOO.util.DragDrop.prototype = {
+
+    /**
+     * The id of the element associated with this object.  This is what we
+     * refer to as the "linked element" because the size and position of
+     * this element is used to determine when the drag and drop objects have
+     * interacted.
+     *
+     * @type String
+     */
+    id: null,
+
+    /**
+     * The id of the element that will be dragged.  By default this is same
+     * as the linked element , but could be changed to another element. Ex:
+     * YAHOO.util.DDProxy
+     *
+     * @type String
+     * @private
+     */
+    dragElId: null,
+
+    /**
+     * the id of the element that initiates the drag operation.  By default
+     * this is the linked element, but could be changed to be a child of this
+     * element.  This lets us do things like only starting the drag when the
+     * header element within the linked html element is clicked.
+     *
+     * @type String
+     * @private
+     */
+    handleElId: null,
+
+    /**
+     * An array of HTML tags that will be ignored if clicked.
+     */
+    invalidHandleTypes: null,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     *
+     * @type int
+     * @private
+     */
+    startPageX: 0,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     *
+     * @type int
+     * @private
+     */
+    startPageY: 0,
+
+    /**
+     * The group defines a logical collection of DragDrop objects that are
+     * related.  Instances only get events when interacting with other
+     * DragDrop object in the same group.  This lets us define multiple
+     * groups using a single DragDrop subclass if we want.
+     *
+     */
+    groups: null,
+
+    /**
+     * Individual drag/drop instances can be locked.  This will prevent
+     * onmousedown start drag.
+     *
+     * @type boolean
+     * @private
+     */
+    locked: false,
+
+    /**
+     * Lock this instance
+     */
+    lock: function() { this.locked = true; },
+
+    /**
+     * Unlock this instace
+     */
+    unlock: function() { this.locked = false; },
+
+    /**
+     * By default, all insances can be a drop target.  This can be disabled by
+     * setting isTarget to false.
+     *
+     * @type boolean
+     */
+    isTarget: true,
+
+    /**
+     * The padding configured for this drag and drop object for calculating
+     * the drop zone intersection with this object.
+     */
+    padding: null,
+
+    /**
+     * @private
+     */
+    _domRef: null,
+
+    /**
+     * Internal typeof flag
+     * @private
+     */
+    __ygDragDrop: true,
+
+    /**
+     * Set to true when horizontal contraints are applied
+     *
+     * @type boolean
+     * @private
+     */
+    constrainX: false,
+
+    /**
+     * Set to true when vertical contraints are applied
+     *
+     * @type boolean
+     * @private
+     */
+    constrainY: false,
+
+    /**
+     * The left constraint
+     *
+     * @type int
+     * @private
+     */
+    minX: 0,
+
+    /**
+     * The right constraint
+     *
+     * @type int
+     * @private
+     */
+    maxX: 0,
+
+    /**
+     * The up constraint
+     *
+     * @type int
+     * @private
+     */
+    minY: 0,
+
+    /**
+     * The down constraint
+     *
+     * @type int
+     * @private
+     */
+    maxY: 0,
+
+    /**
+     * Maintain offsets when we resetconstraints.  Used to maintain the
+     * slider thumb value, and this needs to be fixed.
+     * @type boolean
+     */
+    maintainOffset: false,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a
+     * horizontal graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @type int[]
+     */
+    xTicks: null,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a
+     * vertical graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @type int[]
+     */
+    yTicks: null,
+
+    /**
+     * By default the drag and drop instance will only respond to the primary
+     * button click (left button for a right-handed mouse).  Set to true to
+     * allow drag and drop to start with any mouse click that is propogated
+     * by the browser
+     * @type boolean
+     */
+    primaryButtonOnly: true,
+
+    /**
+     * Code that executes immediately before the startDrag event
+     * @private
+     */
+    b4StartDrag: function(x, y) { },
+
+    /**
+     * Abstract method called after a drag/drop object is clicked
+     * and the drag or mousedown time thresholds have beeen met.
+     *
+     * @param {int} X click location
+     * @param {int} Y click location
+     */
+    startDrag: function(x, y) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDrag event
+     * @private
+     */
+    b4Drag: function(e) { },
+
+    /**
+     * Abstract method called during the onMouseMove event while dragging an
+     * object.
+     *
+     * @param {Event} e
+     */
+    onDrag: function(e) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragEnter event
+     * @private
+     */
+    // b4DragEnter: function(e) { },
+
+    /**
+     * Abstract method called when this element fist begins hovering over
+     * another DragDrop obj
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of one or more
+     * dragdrop items being hovered over.
+     */
+    onDragEnter: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOver event
+     * @private
+     */
+    b4DragOver: function(e) { },
+
+    /**
+     * Abstract method called when this element is hovering over another
+     * DragDrop obj
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of dd items
+     * being hovered over.
+     */
+    onDragOver: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOut event
+     * @private
+     */
+    b4DragOut: function(e) { },
+
+    /**
+     * Abstract method called when we are no longer hovering over an element
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this was hovering over.  In INTERSECT mode, an array of dd items
+     * that the mouse is no longer over.
+     */
+    onDragOut: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragDrop event
+     * @private
+     */
+    b4DragDrop: function(e) { },
+
+    /**
+     * Abstract method called when this item is dropped on another DragDrop
+     * obj
+     *
+     * @param {Event} e
+     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this
+     * was dropped on.
+     */
+    onDragDrop: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the endDrag event
+     * @private
+     */
+    b4EndDrag: function(e) { },
+
+    /**
+     * Fired when we are done dragging the object
+     *
+     * @param {Event} e
+     */
+    endDrag: function(e) { /* override this */ },
+
+    /**
+     * Code executed immediately before the onMouseDown event
+
+     * @param {Event} e
+     * @private
+     */
+    b4MouseDown: function(e) {  },
+
+    /**
+     * Event handler that fires when a drag/drop obj gets a mousedown
+     * @param {Event} e
+     */
+    onMouseDown: function(e) { /* override this */ },
+
+    /**
+     * Event handler that fires when a drag/drop obj gets a mouseup
+     * @param {Event} e
+     */
+    onMouseUp: function(e) { /* override this */ },
+
+    /**
+     * Returns a reference to the linked element
+     *
+     * @return {Object} the html element
+     */
+    getEl: function() {
+        if (!this._domRef) {
+            this._domRef = this.DDM.getElement(this.id);
+        }
+
+        return this._domRef;
+    },
+
+    /**
+     * Returns a reference to the actual element to drag.  By default this is
+     * the same as the html element, but it can be assigned to another
+     * element. An example of this can be found in YAHOO.util.DDProxy
+     *
+     * @return {Object} the html element
+     */
+    getDragEl: function() {
+        return this.DDM.getElement(this.dragElId);
+    },
+
+    /**
+     * Sets up the DragDrop object.  Must be called in the constructor of any
+     * YAHOO.util.DragDrop subclass
+     *
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * element is supposed to be a target only, set to false.
+     */
+    init: function(id, sGroup) {
+        this.initTarget(id, sGroup);
+        YAHOO.util.Event.addListener(id, "mousedown",
+                                          this.handleMouseDown, this, true);
+    },
+
+    /**
+     * Initializes Targeting functionality only... the object does not
+     * get a mousedown handler.
+     *
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * element is supposed to be a target only, set to false.
+     */
+    initTarget: function(id, sGroup) {
+
+        // create a local reference to the drag and drop manager
+        this.DDM = YAHOO.util.DDM;
+
+
+        // set the default padding
+        this.padding = [0, 0, 0, 0];
+
+        // initialize the groups array
+        this.groups = {};
+
+        // set the id
+        this.id = id;
+
+        // the element is a drag handle by default
+        this.setDragElId(id);
+
+        // by default, clicked anchors will not start drag operations
+        this.invalidHandleTypes = {a : "a"};
+
+        // We don't want to register this as the handle with the manager
+        // so we just set the id rather than calling the setter
+        this.handleElId = id;
+
+        // cache the position of the element if we can
+        if (document && document.body) {
+            this.setInitPosition();
+        }
+
+        // add to an interaction group
+        this.addToGroup((sGroup) ? sGroup : "default");
+
+    },
+
+    /**
+     * Configures the padding for the target zone in px.  Effectively expands
+     * (or reduces) the virtual object size for targeting calculations.
+     * Supports css-style shorthand; if only one parameter is passed, all sides
+     * will have that padding, and if only two are passed, the top and bottom
+     * will have the first param, the left and right the second.
+     * @param {int} iTop    Top pad
+     * @param {int} iRight  Right pad
+     * @param {int} iBot    Bot pad
+     * @param {int} iLeft   Left pad
+     */
+    setPadding: function(iTop, iRight, iBot, iLeft) {
+        // this.padding = [iLeft, iRight, iTop, iBot];
+        if (!iRight && 0 !== iRight) {
+            this.padding = [iTop, iTop, iTop, iTop];
+        } else if (!iBot && 0 !== iBot) {
+            this.padding = [iTop, iRight, iTop, iRight];
+        } else {
+            this.padding = [iTop, iRight, iBot, iLeft];
+        }
+    },
+
+    /**
+     * Stores the initial placement of the dd element
+     */
+    setInitPosition: function(diffX, diffY) {
+        var el = this.getEl();
+
+        if (!this.DDM.verifyEl(el)) {
+            return;
+        }
+
+        var dx = diffX || 0;
+        var dy = diffY || 0;
+
+        var p = YAHOO.util.Dom.getXY( el );
+
+        this.initPageX = p[0] - dx;
+        this.initPageY = p[1] - dy;
+
+        this.lastPageX = p[0];
+        this.lastPageY = p[1];
+
+        this.setStartPosition(p);
+    },
+
+    /**
+     * Sets the start position of the element.  This is set when the obj
+     * is initialized, the reset when a drag is started.
+     * @param pos current position (from previous lookup)
+     * @private
+     */
+    setStartPosition: function(pos) {
+
+        var p = pos || YAHOO.util.Dom.getXY( this.getEl() );
+
+        this.startPageX = p[0];
+        this.startPageY = p[1];
+    },
+
+    /**
+     * Add this instance to a group of related drag/drop objects.  All
+     * instances belong to at least one group, and can belong to as many
+     * groups as needed.
+     *
+     * @param sGroup {string} the name of the group
+     */
+    addToGroup: function(sGroup) {
+        this.groups[sGroup] = true;
+        this.DDM.regDragDrop(this, sGroup);
+    },
+
+    /**
+     * Allows you to specify that an element other than the linked element
+     * will be moved with the cursor during a drag
+     *
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setDragElId: function(id) {
+        this.dragElId = id;
+    },
+
+    /**
+     * Allows you to specify a child of the linked element that should be
+     * used to initiate the drag operation.  An example of this would be if
+     * you have a content div with text and links.  Clicking anywhere in the
+     * content area would normally start the drag operation.  Use this method
+     * to specify that an element inside of the content div is the element
+     * that starts the drag operation.
+     *
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setHandleElId: function(id) {
+        this.handleElId = id;
+        this.DDM.regHandle(this.id, id);
+    },
+
+    /**
+     * Allows you to set an element outside of the linked element as a drag
+     * handle
+     */
+    setOuterHandleElId: function(id) {
+        YAHOO.util.Event.addListener(id, "mousedown",
+                this.handleMouseDown, this, true);
+        this.setHandleElId(id);
+    },
+
+    /**
+     * Remove all drag and drop hooks for this element
+     */
+    unreg: function() {
+        YAHOO.util.Event.removeListener(this.id, "mousedown",
+                this.handleMouseDown);
+        this._domRef = null;
+        this.DDM._remove(this);
+    },
+
+    /**
+     * Returns true if this instance is locked, or the drag drop mgr is locked
+     * (meaning that all drag/drop is disabled on the page.)
+     *
+     * @return {boolean} true if this obj or all drag/drop is locked, else
+     * false
+     */
+    isLocked: function() {
+        return (this.DDM.isLocked() || this.locked);
+    },
+
+    /**
+     * Fired when this object is clicked
+     *
+     * @param {Event} e
+     * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)
+     * @private
+     */
+    handleMouseDown: function(e, oDD) {
+
+
+        var EU = YAHOO.util.Event;
+
+
+        var button = e.which || e.button;
+
+        if (this.primaryButtonOnly && button > 1) {
+            return;
+        }
+
+        if (this.isLocked()) {
+            return;
+        }
+
+
+        this.DDM.refreshCache(this.groups);
+
+        // Only process the event if we really clicked within the linked
+        // element.  The reason we make this check is that in the case that
+        // another element was moved between the clicked element and the
+        // cursor in the time between the mousedown and mouseup events. When
+        // this happens, the element gets the next mousedown event
+        // regardless of where on the screen it happened.
+        var pt = new YAHOO.util.Point(EU.getPageX(e), EU.getPageY(e));
+        if ( this.DDM.isOverTarget(pt, this) )  {
+
+
+            //  check to see if the handle was clicked
+            var srcEl = EU.getTarget(e);
+
+            if (this.isValidHandleChild(srcEl) &&
+                    (this.id == this.handleElId ||
+                     this.DDM.handleWasClicked(srcEl, this.id)) ) {
+
+                // set the initial element position
+                this.setStartPosition();
+
+
+                this.b4MouseDown(e);
+                this.onMouseDown(e);
+                this.DDM.handleMouseDown(e, this);
+
+                this.DDM.stopEvent(e);
+            }
+        }
+    },
+
+    /**
+     * Allows you to specify a tag name that should not start a drag operation
+     * when clicked.  This is designed to facilitate embedding links within a
+     * drag handle that do something other than start the drag.
+     *
+     * @param {string} tagName the type of element to exclude
+     */
+    addInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = type;
+    },
+
+    /**
+     * Unsets an excluded tag name set by addInvalidHandleType
+     *
+     * @param {string} tagName the type of element to unexclude
+     */
+    removeInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = null;
+    },
+
+    /**
+     * Checks the tag exclusion list to see if this click should be ignored
+     *
+     * @param {ygNode} node
+     * @return {boolean} true if this is a valid tag type, false if not
+     */
+    isValidHandleChild: function(node) {
+        var type = node.nodeName;
+
+        if (type == "#text") {
+            type = node.parentNode.nodeName;
+        }
+
+        return (!this.invalidHandleTypes[type]);
+    },
+
+    /**
+     * Create the array of horizontal tick marks if an interval was specified
+     * in setXConstraint().
+     *
+     * @private
+     */
+    setXTicks: function(iStartX, iTickSize) {
+        this.xTicks = [];
+        this.xTickSize = iTickSize;
+
+        var tickMap = {};
+
+        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        this.xTicks.sort(this.DDM.numericSort) ;
+    },
+
+    /**
+     * Create the array of vertical tick marks if an interval was specified in
+     * setYConstraint().
+     *
+     * @private
+     */
+    setYTicks: function(iStartY, iTickSize) {
+        this.yTicks = [];
+        this.yTickSize = iTickSize;
+
+        var tickMap = {};
+
+        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        this.yTicks.sort(this.DDM.numericSort) ;
+    },
+
+    /**
+     * By default, the element can be dragged any place on the screen.  Use
+     * this method to limit the horizontal travel of the element.  Pass in
+     * 0,0 for the parameters if you want to lock the drag to the y axis.
+     *
+     * @param {int} iLeft the number of pixels the element can move to the left
+     * @param {int} iRight the number of pixels the element can move to the
+     * right
+     * @param {int} iTickSize optional parameter for specifying that the
+     * element
+     * should move iTickSize pixels at a time.
+     */
+    setXConstraint: function(iLeft, iRight, iTickSize) {
+        this.leftConstraint = iLeft;
+        this.rightConstraint = iRight;
+
+        this.minX = this.initPageX - iLeft;
+        this.maxX = this.initPageX + iRight;
+        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+
+        this.constrainX = true;
+    },
+
+    /**
+     * By default, the element can be dragged any place on the screen.  Set
+     * this to limit the vertical travel of the element.  Pass in 0,0 for the
+     * parameters if you want to lock the drag to the x axis.
+     *
+     * @param {int} iUp the number of pixels the element can move up
+     * @param {int} iDown the number of pixels the element can move down
+     * @param {int} iTickSize optional parameter for specifying that the
+     * element should move iTickSize pixels at a time.
+     */
+    setYConstraint: function(iUp, iDown, iTickSize) {
+        this.topConstraint = iUp;
+        this.bottomConstraint = iDown;
+
+        this.minY = this.initPageY - iUp;
+        this.maxY = this.initPageY + iDown;
+        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
+
+        this.constrainY = true;
+
+    },
+
+    /**
+     * resetConstraints must be called if you manually reposition a dd element.
+     * @param {boolean} maintainOffset
+     */
+    resetConstraints: function() {
+
+
+        // figure out how much this thing has moved
+        var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
+        var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
+
+
+        // reset the initial location
+        this.setInitPosition(dx, dy);
+
+        if (this.constrainX) {
+            this.setXConstraint( this.leftConstraint,
+                                 this.rightConstraint,
+                                 this.xTickSize        );
+        }
+
+        if (this.constrainY) {
+            this.setYConstraint( this.topConstraint,
+                                 this.bottomConstraint,
+                                 this.yTickSize         );
+        }
+    },
+
+    /**
+     * Normally the drag element is moved pixel by pixel, but we can specify
+     * that it move a number of pixels at a time.  This method resolves the
+     * location when we have it set up like this.
+     *
+     * @param {int} val where we want to place the object
+     * @param {int[]} tickArray sorted array of valid points
+     * @return {int} the closest tick
+     * @private
+     */
+    getTick: function(val, tickArray) {
+
+        if (!tickArray) {
+            // If tick interval is not defined, it is effectively 1 pixel,
+            // so we return the value passed to us.
+            return val;
+        } else if (tickArray[0] >= val) {
+            // The value is lower than the first tick, so we return the first
+            // tick.
+            return tickArray[0];
+        } else {
+            for (var i = 0; i < tickArray.length; ++i) {
+                var next = i + 1;
+                if (tickArray[next] && tickArray[next] >= val) {
+                    var diff1 = val - tickArray[i];
+                    var diff2 = tickArray[next] - val;
+                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
+                }
+            }
+
+            // The value is larger than the last tick, so we return the last
+            // tick.
+            return tickArray[tickArray.length - 1];
+        }
+    },
+
+    /**
+     * toString method
+     * @return {string} string representation of the dd obj
+     */
+    toString: function(val, tickArray) {
+        return ("YAHOO.util.DragDrop {" + this.id + "}");
+    }
+
+};
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+// Only load the library once.  Rewriting the manager class would orphan
+// existing drag and drop instances.
+if (!YAHOO.util.DragDropMgr) {
+
+    /**
+     * @class Handles the element interaction for all DragDrop items in the
+     * window.  Generally, you will not call this class directly, but it does
+     * have helper methods that could be useful in your DragDrop
+     * implementations.  This class should not be instantiated; all methods
+     * are are static.
+     *
+     * @constructor
+     */
+    YAHOO.util.DragDropMgr = new function() {
+
+        /**
+         * utility package shorthand
+         * @private
+         */
+        var UTIL = YAHOO.util;
+
+        /**
+         * Two dimensional Array of registered DragDrop objects.  The first
+         * dimension is the DragDrop item group, the second the DragDrop
+         * object.
+         *
+         * @private
+         */
+        this.ids = {};
+
+        /**
+         * Array of element ids defined as drag handles.  Used to determine
+         * if the element that generated the mousedown event is actually the
+         * handle and not the html element itself.
+         *
+         * @private
+         */
+        this.handleIds = {};
+
+        /**
+         * the DragDrop object that is currently being dragged
+         *
+         * @type DragDrop
+         * @private
+         **/
+        this.dragCurrent = null;
+
+        /**
+         * the DragDrop object(s) that are being hovered over
+         *
+         * @type Array
+         * @private
+         */
+        this.dragOvers = {};
+
+        /**
+         * @private
+         */
+
+        /**
+         * the X distance between the cursor and the object being dragged
+         *
+         * @type int
+         * @private
+         */
+        this.deltaX = 0;
+
+        /**
+         * the Y distance between the cursor and the object being dragged
+         *
+         * @type int
+         * @private
+         */
+        this.deltaY = 0;
+
+        /**
+         * Flag to determine if we should prevent the default behavior of the
+         * events we define. By default this is true, but this can be set to
+         * false if you need the default behavior (not recommended)
+         *
+         * @type boolean
+         */
+        this.preventDefault = true;
+
+        /**
+         * Flag to determine if we should stop the propagation of the events
+         * we generate. This is true by default but you may want to set it to
+         * false if the html element contains other features that require the
+         * mouse click.
+         *
+         * @type boolean
+         */
+        this.stopPropagation = true;
+
+        /**
+         * @private
+         */
+        this.initalized = false;
+
+        /**
+         * All drag and drop can be disabled.
+         *
+         * @private
+         */
+        this.locked = false;
+
+        /**
+         * Called the first time an element is registered.
+         *
+         * @private
+         */
+        this.init = function() {
+        };
+
+        /**
+         * In point mode, drag and drop interaction is defined by the
+         * location of the cursor during the drag/drop
+         * @type int
+         */
+        this.POINT     = 0;
+
+        /**
+         * In intersect mode, drag and drop interactio nis defined by the
+         * overlap of two or more drag and drop objects.
+         * @type int
+         */
+        this.INTERSECT = 1;
+
+        /**
+         * The current drag and drop mode.  Default it point mode
+         * @type int
+         */
+        this.mode = this.POINT;
+
+        /**
+         * Runs method on all drag and drop objects
+         * @private
+         */
+        this._execOnAll = function(sMethod, args) {
+            for (var i in this.ids) {
+                for (var j in this.ids[i]) {
+                    var oDD = this.ids[i][j];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+                    oDD[sMethod].apply(oDD, args);
+                }
+            }
+        };
+
+        /**
+         * Drag and drop initialization.  Sets up the global event handlers
+         * @private
+         */
+        this._onLoad = function() {
+
+            this._execOnAll("setInitPosition", []);
+
+
+            var EU = UTIL.Event;
+
+            EU.addListener(document, "mouseup",   this.handleMouseUp, this, true);
+            EU.addListener(document, "mousemove", this.handleMouseMove, this, true);
+            EU.addListener(window,   "unload",    this._onUnload, this, true);
+            EU.addListener(window,   "resize",    this._onResize, this, true);
+            // EU.addListener(window,   "mouseout",    this._test);
+
+            this.initalized = true;
+
+        };
+
+        /**
+         * Reset constraints on all drag and drop objs
+         * @private
+         */
+        this._onResize = function(e) {
+            this._execOnAll("resetConstraints", []);
+        };
+
+        /**
+         * Lock all drag and drop functionality
+         */
+        this.lock = function() { this.locked = true; };
+
+        /**
+         * Unlock all drag and drop functionality
+         */
+        this.unlock = function() { this.locked = false; };
+
+        /**
+         * Is drag and drop locked?
+         *
+         * @return {boolean} True if drag and drop is locked, false otherwise.
+         */
+        this.isLocked = function() { return this.locked; };
+
+        /**
+         * Location cache that is set for all drag drop objects when a drag is
+         * initiated, cleared when the drag is finished.
+         *
+         * @private
+         */
+        this.locationCache = {};
+
+        /**
+         * Set useCache to false if you want to force object the lookup of each
+         * drag and drop linked element constantly during a drag.
+         * @type boolean
+         */
+        this.useCache = true;
+
+        /**
+         * The number of pixels that the mouse needs to move after the
+         * mousedown before the drag is initiated.  Default=3;
+         * @type int
+         */
+        this.clickPixelThresh = 3;
+
+        /**
+         * The number of milliseconds after the mousedown event to initiate the
+         * drag if we don't get a mouseup event. Default=1000
+         * @type int
+         */
+        this.clickTimeThresh = 1000;
+
+        /**
+         * Flag that indicates that either the drag pixel threshold or the
+         * mousdown time threshold has been met
+         * @type boolean
+         * @private
+         */
+        this.dragThreshMet = false;
+
+        /**
+         * Timeout used for the click time threshold
+         * @type Object
+         * @private
+         */
+        this.clickTimeout = null;
+
+        /**
+         * The X position of the mousedown event stored for later use when a
+         * drag threshold is met.
+         * @type int
+         * @private
+         */
+        this.startX = 0;
+
+        /**
+         * The Y position of the mousedown event stored for later use when a
+         * drag threshold is met.
+         * @type int
+         * @private
+         */
+        this.startY = 0;
+
+        /**
+         * Each DragDrop instance must be registered with the DragDropMgr.
+         * This is executed in ygDragDrop.init()
+         *
+         * @param {DragDrop} oDD the DragDrop object to register
+         * @param {String} sGroup the name of the group this element belongs to
+         */
+        this.regDragDrop = function(oDD, sGroup) {
+            if (!this.initialized) { this.init(); }
+
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
+            this.ids[sGroup][oDD.id] = oDD;
+        };
+
+        /**
+         * Unregisters a drag and drop item.  This is executed in
+         * ygDragDrop.unreg, use that method instead of calling this directly.
+         * @private
+         */
+        this._remove = function(oDD) {
+            for (var g in oDD.groups) {
+                if (g && this.ids[g][oDD.id]) {
+                    delete this.ids[g][oDD.id];
+                }
+            }
+            delete this.handleIds[oDD.id];
+        };
+
+        /**
+         * Each DragDrop handle element must be registered.  This is done
+         * automatically when executing ygDragDrop.setHandleElId()
+         *
+         * @param {String} sDDId the DragDrop id this element is a handle for
+         * @param {String} sHandleId the id of the element that is the drag
+         * handle
+         */
+        this.regHandle = function(sDDId, sHandleId) {
+            if (!this.handleIds[sDDId]) {
+                this.handleIds[sDDId] = {};
+            }
+            this.handleIds[sDDId][sHandleId] = sHandleId;
+        };
+
+        /**
+         * Utility function to determine if a given element has been
+         * registered as a drag drop item.
+         *
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop item,
+         * false otherwise
+         */
+        this.isDragDrop = function(id) {
+            return ( this.getDDById(id) ) ? true : false;
+        };
+
+        /**
+         * Returns the drag and drop instances that are in all groups the
+         * passed in instance belongs to.
+         *
+         * @param {ygDragDrop} p_oDD the obj to get related data for
+         * @param {boolean} bTargetsOnly if true, only return targetable objs
+         * @return {ygDragDrop[]} the related instances
+         */
+        this.getRelated = function(p_oDD, bTargetsOnly) {
+            var oDDs = [];
+            for (var i in p_oDD.groups) {
+                for (j in this.ids[i]) {
+                    var dd = this.ids[i][j];
+                    if (! this.isTypeOfDD(dd)) {
+                        continue;
+                    }
+                    if (!bTargetsOnly || dd.isTarget) {
+                        oDDs[oDDs.length] = dd;
+                    }
+                }
+            }
+
+            return oDDs;
+        };
+
+        /**
+         * Returns true if the specified dd target is a legal target for
+         * the specifice drag obj
+         *
+         * @param {ygDragDrop} the drag obj
+         * @param {ygDragDrop) the target
+         * @return {boolean} true if the target is a legal target for the
+         * dd obj
+         */
+        this.isLegalTarget = function (oDD, oTargetDD) {
+            var targets = this.getRelated(oDD);
+            for (var i =0;i<targets.length;++i) {
+                if (targets[i].id == oTargetDD.id) {
+                    return true;
+                }
+            }
+
+            return false;
+        };
+
+        /**
+         * My goal is to be able to transparently determine if an object is
+         * typeof ygDragDrop, and the exact subclass of ygDragDrop.  typeof
+         * returns "object", oDD.constructor.toString() always returns
+         * "ygDragDrop" and not the name of the subclass.  So for now it just
+         * evaluates a well-known variable in ygDragDrop.
+         *
+         * @param {Object} the object to evaluate
+         * @return {boolean} true if typeof oDD = ygDragDrop
+         */
+        this.isTypeOfDD = function (oDD) {
+            return (oDD && oDD.__ygDragDrop);
+        };
+
+        /**
+         * Utility function to determine if a given element has been
+         * registered as a drag drop handle for the given Drag Drop object.
+         *
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop handle, false
+         * otherwise
+         */
+        this.isHandle = function(sDDId, sHandleId) {
+            return ( this.handleIds[sDDId] &&
+                            this.handleIds[sDDId][sHandleId] );
+        };
+
+        /**
+         * Returns the DragDrop instance for a given id
+         *
+         * @param {String} id the id of the DragDrop object
+         * @return {DragDrop} the drag drop object, null if it is not found
+         */
+        this.getDDById = function(id) {
+            for (var i in this.ids) {
+                if (this.ids[i][id]) {
+                    return this.ids[i][id];
+                }
+            }
+            return null;
+        };
+
+        /**
+         * Fired after a registered DragDrop object gets the mousedown event.
+         * Sets up the events required to track the object being dragged
+         *
+         * @param {Event} e the event
+         * @param oDD the DragDrop object being dragged
+         * @private
+         */
+        this.handleMouseDown = function(e, oDD) {
+            this.dragCurrent = oDD;
+
+            var el = oDD.getEl();
+
+            // track start position
+            this.startX = UTIL.Event.getPageX(e);
+            this.startY = UTIL.Event.getPageY(e);
+
+            this.deltaX = this.startX - el.offsetLeft;
+            this.deltaY = this.startY - el.offsetTop;
+
+            this.dragThreshMet = false;
+
+            this.clickTimeout = setTimeout(
+               "var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX, DDM.startY)",
+               this.clickTimeThresh );
+        };
+
+        /**
+         * Fired when either the drag pixel threshol or the mousedown hold
+         * time threshold has been met.
+         *
+         * @param x {int} the X position of the original mousedown
+         * @param y {int} the Y position of the original mousedown
+         */
+        this.startDrag = function(x, y) {
+            clearTimeout(this.clickTimeout);
+            if (this.dragCurrent) {
+                this.dragCurrent.b4StartDrag(x, y);
+                this.dragCurrent.startDrag(x, y);
+            }
+            this.dragThreshMet = true;
+        };
+
+        /**
+         * Internal function to handle the mouseup event.  Will be invoked
+         * from the context of the document.
+         *
+         * @param {Event} e the event
+         * @private
+         */
+        this.handleMouseUp = function(e) {
+
+            if (! this.dragCurrent) {
+                return;
+            }
+
+            clearTimeout(this.clickTimeout);
+
+            if (this.dragThreshMet) {
+                this.fireEvents(e, true);
+            } else {
+            }
+
+            this.stopDrag(e);
+
+            this.stopEvent(e);
+        };
+
+        /**
+         * Utility to stop event propagation and event default, if these
+         * features are turned on.
+         *
+         * @param {Event} e the event as returned by this.getEvent()
+         */
+        this.stopEvent = function(e) {
+            if (this.stopPropagation) {
+                UTIL.Event.stopPropagation(e);
+            }
+
+            if (this.preventDefault) {
+                UTIL.Event.preventDefault(e);
+            }
+        };
+
+        /**
+         * Internal function to clean up event handlers after the drag
+         * operation is complete
+         *
+         * @param {Event} e the event
+         * @private
+         */
+        this.stopDrag = function(e) {
+
+            // Fire the drag end event for the item that was dragged
+            if (this.dragCurrent) {
+                if (this.dragThreshMet) {
+                    this.dragCurrent.b4EndDrag(e);
+                    this.dragCurrent.endDrag(e);
+                }
+
+                this.dragCurrent.onMouseUp(e);
+            }
+
+            this.dragCurrent = null;
+            this.dragOvers = {};
+        };
+
+        /**
+         * Internal function to handle the mousemove event.  Will be invoked
+         * from the context of the html element.
+         *
+         * @TODO figure out what we can do about mouse events lost when the
+         * user drags objects beyond the window boundary.  Currently we can
+         * detect this in internet explorer by verifying that the mouse is
+         * down during the mousemove event.  Firefox doesn't give us the
+         * button state on the mousemove event.
+         *
+         * @param {Event} e the event
+         * @private
+         */
+        this.handleMouseMove = function(e) {
+            if (! this.dragCurrent) {
+                return;
+            }
+
+            // var button = e.which || e.button;
+
+
+            // check for IE mouseup outside of page boundary
+            if (UTIL.Event.isIE && !e.button) {
+                this.stopEvent(e);
+                return this.handleMouseUp(e);
+            }
+
+            if (!this.dragThreshMet) {
+                var diffX = Math.abs(this.startX - UTIL.Event.getPageX(e));
+                var diffY = Math.abs(this.startY - UTIL.Event.getPageY(e));
+                if (diffX > this.clickPixelThresh ||
+                            diffY > this.clickPixelThresh) {
+                    this.startDrag(this.startX, this.startY);
+                }
+            }
+
+            if (this.dragThreshMet) {
+                this.dragCurrent.b4Drag(e);
+                this.dragCurrent.onDrag(e);
+                this.fireEvents(e, false);
+            }
+
+            this.stopEvent(e);
+        };
+
+        /**
+         * Iterates over all of the DragDrop elements to find ones we are
+         * hovering over or dropping on
+         *
+         * @param {Event} e the event
+         * @param {boolean} isDrop is this a drop op or a mouseover op?
+         * @private
+         */
+        this.fireEvents = function(e, isDrop) {
+            var dc = this.dragCurrent;
+
+            // If the user did the mouse up outside of the window, we could
+            // get here even though we have ended the drag.
+            if (!dc || dc.isLocked()) {
+                return;
+            }
+
+            var x = UTIL.Event.getPageX(e);
+            var y = UTIL.Event.getPageY(e);
+            var pt = new YAHOO.util.Point(x,y);
+
+            // cache the previous dragOver array
+            var oldOvers = [];
+
+            var outEvts   = [];
+            var overEvts  = [];
+            var dropEvts  = [];
+            var enterEvts = [];
+
+            // Check to see if the object we were hovering over is no longer
+            // being hovered over so we can fire the onDragOut event
+            for (var i in this.dragOvers) {
+
+                var ddo = this.dragOvers[i];
+
+                if (! this.isTypeOfDD(ddo)) {
+                    continue;
+                }
+
+                if (! this.isOverTarget(pt, ddo, this.mode)) {
+                    outEvts.push( ddo );
+                }
+
+                oldOvers[i] = true;
+                delete this.dragOvers[i];
+            }
+
+            for (var sGroup in dc.groups) {
+
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+
+                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
+                        if (this.isOverTarget(pt, oDD, this.mode)) {
+                            // look for drop interactions
+                            if (isDrop) {
+                                dropEvts.push( oDD );
+                            // look for drag enter and drag over interactions
+                            } else {
+
+                                // initial drag over: dragEnter fires
+                                if (!oldOvers[oDD.id]) {
+                                    enterEvts.push( oDD );
+                                // subsequent drag overs: dragOver fires
+                                } else {
+                                    overEvts.push( oDD );
+                                }
+
+                                this.dragOvers[oDD.id] = oDD;
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (this.mode) {
+                if (outEvts.length > 0) {
+                    dc.b4DragOut(e, outEvts);
+                    dc.onDragOut(e, outEvts);
+                }
+
+                if (enterEvts.length > 0) {
+                    dc.onDragEnter(e, enterEvts);
+                }
+
+                if (overEvts.length > 0) {
+                    dc.b4DragOver(e, overEvts);
+                    dc.onDragOver(e, overEvts);
+                }
+
+                if (dropEvts.length > 0) {
+                    dc.b4DragDrop(e, dropEvts);
+                    dc.onDragDrop(e, dropEvts);
+                }
+
+            } else {
+                // fire dragout events
+                for (i=0; i < outEvts.length; ++i) {
+                    dc.b4DragOut(e, outEvts[i].id);
+                    dc.onDragOut(e, outEvts[i].id);
+                }
+
+                // fire enter events
+                for (i=0; i < enterEvts.length; ++i) {
+                    // dc.b4DragEnter(e, oDD.id);
+                    dc.onDragEnter(e, enterEvts[i].id);
+                }
+
+                // fire over events
+                for (i=0; i < overEvts.length; ++i) {
+                    dc.b4DragOver(e, overEvts[i].id);
+                    dc.onDragOver(e, overEvts[i].id);
+                }
+
+                // fire drop events
+                for (i=0; i < dropEvts.length; ++i) {
+                    dc.b4DragDrop(e, dropEvts[i].id);
+                    dc.onDragDrop(e, dropEvts[i].id);
+                }
+
+            }
+
+        };
+
+        /**
+         * Helper function for getting the best match from the list of drag
+         * and drop objects returned by the drag and drop events when we are
+         * in INTERSECT mode.  It returns either the first object that the
+         * cursor is over, or the object that has the greatest overlap with
+         * the dragged element.
+         *
+         * @param  {ygDragDrop[]} dds The array of drag and drop objects
+         * targeted
+         * @return {ygDragDrop}       The best single match
+         */
+        this.getBestMatch = function(dds) {
+            var winner = null;
+            // Return null if the input is not what we expect
+            //if (!dds || !dds.length || dds.length == 0) {
+               // winner = null;
+            // If there is only one item, it wins
+            //} else if (dds.length == 1) {
+
+            if (dds.length == 1) {
+                winner = dds[0];
+            } else {
+                // Loop through the targeted items
+                for (var i=0; i<dds.length; ++i) {
+                    var dd = dds[i];
+                    // If the cursor is over the object, it wins.  If the
+                    // cursor is over multiple matches, the first one we come
+                    // to wins.
+                    if (dd.cursorIsOver) {
+                        winner = dd;
+                        break;
+                    // Otherwise the object with the most overlap wins
+                    } else {
+                        if (!winner ||
+                            winner.overlap.getArea() < dd.overlap.getArea()) {
+                            winner = dd;
+                        }
+                    }
+                }
+            }
+
+            return winner;
+        };
+
+        /**
+         * Refreshes the cache of the top-left and bottom-right points of the
+         * drag and drop objects in the specified groups
+         *
+         * @param {Array} aGroups an associative array of groups to refresh
+         */
+        this.refreshCache = function(aGroups) {
+            for (sGroup in aGroups) {
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+
+                    if (this.isTypeOfDD(oDD)) {
+                        var loc = this.getLocation(oDD);
+                        if (loc) {
+                            this.locationCache[oDD.id] = loc;
+                        } else {
+                            delete this.locationCache[oDD.id];
+                            // this will unregister the drag and drop object if
+                            // the element is not in a usable state
+                            oDD.unreg();
+                        }
+                    }
+                }
+            }
+        };
+
+        /**
+         * This checks to make sure an element exists and is in the DOM.  The
+         * main purpose is to handle cases where innerHTML is used to remove
+         * drag and drop objects from the DOM.  IE provides an 'unspecified
+         * error' when trying to access the offsetParent of such an element
+         * @param {HTMLElement} el the element to check
+         * @return {boolean} true if the element looks usable
+         */
+        this.verifyEl = function(el) {
+            try {
+                if (el) {
+                    var parent = el.offsetParent;
+                    if (parent) {
+                        return true;
+                    }
+                }
+            } catch(e) {
+            }
+
+            return false;
+        };
+
+        /**
+         * Returns the an array containing the drag and drop element's position
+         * and size, including the ygDragDrop.padding configured for it
+         *
+         * @param {ygDragDrop} oDD the drag and drop object to get the
+         * location for
+         * @return array containing the top left and bottom right points of the
+         * element
+         */
+        this.getLocation = function(oDD) {
+            if (! this.isTypeOfDD(oDD)) {
+                return null;
+            }
+
+            var el = oDD.getEl();
+
+            if (!this.verifyEl(el)) {
+                return null;
+            }
+
+
+            // var aPos = ygPos.getPos(el);
+            var aPos = YAHOO.util.Dom.getXY(el);
+
+            x1 = aPos[0];
+            x2 = x1 + el.offsetWidth;
+
+            y1 = aPos[1];
+            y2 = y1 + el.offsetHeight;
+
+            var t = y1 - oDD.padding[0];
+            var r = x2 + oDD.padding[1];
+            var b = y2 + oDD.padding[2];
+            var l = x1 - oDD.padding[3];
+
+            return new YAHOO.util.Region( t, r, b, l );
+
+        };
+
+        /**
+         * Checks the cursor location to see if it over the target
+         *
+         * @param {YAHOO.util.Point} pt The point to evaluate
+         * @param {ygDragDrop} oDDTarget the DragDrop object we are inspecting
+         * @return {boolean} true if the mouse is over the target
+         * @private
+         */
+        this.isOverTarget = function(pt, oDDTarget, intersect) {
+            // use cache if available
+            var loc = this.locationCache[oDDTarget.id];
+            if (!loc || !this.useCache) {
+                loc = this.getLocation(oDDTarget);
+                this.locationCache[oDDTarget.id] = loc;
+
+            }
+
+
+            // var cursorIsOver =  (x >= loc[3] && x <= loc[1] && y >= loc[0] && y <= loc[2]);
+            //oDDTarget.cursorIsOver = loc.contains( new YAHOO.util.Point(x, y) );
+            oDDTarget.cursorIsOver = loc.contains( pt );
+            oDDTarget.overlap = null;
+
+            // if (this.INTERSECT == this.mode) {
+            if (intersect) {
+
+                var curRegion =
+                    YAHOO.util.Region.getRegion(this.dragCurrent.getDragEl());
+                var overlap = curRegion.intersect(loc);
+
+                if (overlap) {
+                    oDDTarget.overlap = overlap;
+                    return true;
+                } else {
+                    return false;
+                }
+
+            } else {
+                return oDDTarget.cursorIsOver;
+            }
+        };
+
+        /**
+         * @private
+         */
+        this._onUnload = function(e, me) {
+            this.unregAll();
+        };
+
+        /**
+         * Cleans up the drag and drop events and objects.
+         *
+         * @private
+         */
+        this.unregAll = function() {
+
+            if (this.dragCurrent) {
+                this.stopDrag();
+                this.dragCurrent = null;
+            }
+
+            this._execOnAll("unreg", []);
+
+            for (i in this.elementCache) {
+                delete this.elementCache[i];
+            }
+
+            this.elementCache = {};
+            this.ids = {};
+        };
+
+        /**
+         * A cache of DOM elements
+         *
+         * @private
+         */
+        this.elementCache = {};
+
+        /**
+         * Get the wrapper for the DOM element specified
+         *
+         * @param {String} id the id of the elment to get
+         * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element
+         * @private
+         */
+        this.getElWrapper = function(id) {
+            var oWrapper = this.elementCache[id];
+            if (!oWrapper || !oWrapper.el) {
+                oWrapper = this.elementCache[id] =
+                    new this.ElementWrapper(document.getElementById(id));
+            }
+            return oWrapper;
+        };
+
+        /**
+         * Returns the actual DOM element
+         *
+         * @param {String} id the id of the elment to get
+         * @return {Object} The element
+         */
+        this.getElement = function(id) {
+            // return this.getElWrapper(id).el;
+            return document.getElementById(id);
+        };
+
+        /**
+         * Returns the style property for the DOM element (i.e.,
+         * document.getElById(id).style)
+         *
+         * @param {String} id the id of the elment to get
+         * @return {Object} The style property of the element
+         */
+        this.getCss = function(id) {
+            // return this.getElWrapper(id).css;
+            var css = null;
+            var el = document.getElementById(id);
+            if (el) {
+                css = el.style;
+            }
+
+            return css;
+        };
+
+        /**
+         * Inner class for cached elements
+         */
+        this.ElementWrapper = function(el) {
+                /**
+                 * @private
+                 */
+                this.el = el || null;
+                /**
+                 * @private
+                 */
+                this.id = this.el && el.id;
+                /**
+                 * @private
+                 */
+                this.css = this.el && el.style;
+            };
+
+        /**
+         * Returns the X position of an html element
+         * @param el the element for which to get the position
+         * @return {int} the X coordinate
+         */
+        this.getPosX = function(el) {
+            return YAHOO.util.Dom.getX(el);
+        };
+
+        /**
+         * Returns the Y position of an html element
+         * @param el the element for which to get the position
+         * @return {int} the Y coordinate
+         */
+        this.getPosY = function(el) {
+            return YAHOO.util.Dom.getY(el);
+        };
+
+        /**
+         * Swap two nodes.  In IE, we use the native method, for others we
+         * emulate the IE behavior
+         *
+         * @param n1 the first node to swap
+         * @param n2 the other node to swap
+         */
+        this.swapNode = function(n1, n2) {
+            if (n1.swapNode) {
+                n1.swapNode(n2);
+            } else {
+                // the node reference order for the swap is a little tricky.
+                var p = n2.parentNode;
+                var s = n2.nextSibling;
+                n1.parentNode.replaceChild(n2,n1);
+                p.insertBefore(n1,s);
+            }
+        };
+
+        /**
+         * @private
+         */
+        this.getScroll = function () {
+            var t, l;
+            if (document.documentElement && document.documentElement.scrollTop) {
+                t = document.documentElement.scrollTop;
+                l = document.documentElement.scrollLeft;
+            } else if (document.body) {
+                t = document.body.scrollTop;
+                l = document.body.scrollLeft;
+            }
+            return { top: t, left: l };
+        };
+
+        /**
+         * Returns the specified element style property
+         * @param {HTMLElement} el          the element
+         * @param {string}      styleProp   the style property
+         * @return {string}     The value of the style property
+         */
+        this.getStyle = function(el, styleProp) {
+            if (el.style.styleProp) {
+                return el.style.styleProp;
+            } else if (el.currentStyle) {
+                return el.currentStyle[styleProp];
+            } else if (document.defaultView) {
+                return document.defaultView.getComputedStyle(el, null).
+                    getPropertyValue(styleProp);
+            }
+        };
+
+        /**
+         * Gets the scrollTop
+         *
+         * @return {int} the document's scrollTop
+         */
+        this.getScrollTop = function () { return this.getScroll().top; };
+
+        /**
+         * Gets the scrollLeft
+         *
+         * @return {int} the document's scrollTop
+         */
+        this.getScrollLeft = function () { return this.getScroll().left; };
+
+        this.moveToEl = function (moveEl, targetEl) {
+            var aCoord = YAHOO.util.Dom.getXY(targetEl);
+            YAHOO.util.Dom.setXY(moveEl, aCoord);
+        };
+
+        /**
+         * Gets the client height
+         *
+         * @return {int} client height in px
+         */
+        this.getClientHeight = function() {
+            return (window.innerHeight) ? window.innerHeight :
+                (document.documentElement && document.documentElement.clientHeight) ?
+                document.documentElement.clientHeight : document.body.offsetHeight;
+        };
+
+        /**
+         * Gets the client width
+         *
+         * @return {int} client width in px
+         */
+        this.getClientWidth = function() {
+            return (window.innerWidth) ? window.innerWidth :
+                (document.documentElement && document.documentElement.clientWidth) ?
+                document.documentElement.clientWidth : document.body.offsetWidth;
+        };
+
+        /**
+         * numeric array sort function
+         */
+        this.numericSort = function(a, b) { return (a - b); };
+
+        /**
+         * @private
+         */
+        this._timeoutCount = 0;
+
+        /**
+         * @private
+         * Trying to make the load order less important.  Without this we get
+         * an error if this file is loaded before the Event Utility.
+         */
+        this._addListeners = function() {
+            if ( UTIL.Event &&
+                 document          &&
+                 document.body        ) {
+
+                this._onLoad();
+            } else {
+                if (this._timeoutCount > 500) {
+                } else {
+                    setTimeout("YAHOO.util.DDM._addListeners()", 10);
+                    this._timeoutCount += 1;
+                }
+            }
+
+        };
+
+        /**
+         * Recursively searches the immediate parent and all child nodes for
+         * the handle element in order to determine wheter or not it was
+         * clicked.
+         *
+         * @param node the html element to inspect
+         */
+        this.handleWasClicked = function(node, id) {
+            if (this.isHandle(id, node.id)) {
+                return true;
+            } else {
+                // check to see if this is a text node child of the one we want
+                var p = node.parentNode;
+
+                while (p) {
+                    if (this.isHandle(id, p.id)) {
+                        return true;
+                    } else {
+                        p = p.parentNode;
+                    }
+                }
+            }
+
+            return false;
+        };
+
+    };
+
+    // shorter alias, save a few bytes
+    YAHOO.util.DDM = YAHOO.util.DragDropMgr;
+    YAHOO.util.DDM._addListeners();
+
+}
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation where the linked element follows the
+ * mouse cursor.
+ *
+ * @extends DragDrop
+ * @constructor
+ * @param {String} id the id of the linked element
+ * @param {String} sGroup the group of related DragDrop items
+ */
+YAHOO.util.DD = function(id, sGroup) {
+    if (id) {
+        this.init(id, sGroup);
+    }
+};
+
+YAHOO.util.DD.prototype = new YAHOO.util.DragDrop();
+
+/**
+ * Should we auto-scroll? Defaults to true
+ *
+ * @type boolean
+ */
+YAHOO.util.DD.prototype.scroll = true;
+
+/**
+ * Sets the pointer offset to the distance between the linked element's top
+ * left corner and the location the element was clicked
+ *
+ * @param {int} iPageX the X coordinate of the click
+ * @param {int} iPageY the Y coordinate of the click
+ */
+YAHOO.util.DD.prototype.autoOffset = function(iPageX, iPageY) {
+    var el = this.getEl();
+    var aCoord = YAHOO.util.Dom.getXY(el);
+    var x = iPageX - aCoord[0];
+    var y = iPageY - aCoord[1];
+    this.setDelta(x, y);
+};
+
+/**
+ * Sets the pointer offset.  You can call this directly to force the offset to
+ * be in a particular location (e.g., pass in 0,0 to set it to the center of the
+ * object, as done in ygDDSliderBG)
+ *
+ * @param {int} iDeltaX the distance from the left
+ * @param {int} iDeltaY the distance from the top
+ */
+YAHOO.util.DD.prototype.setDelta = function(iDeltaX, iDeltaY) {
+    this.deltaX = iDeltaX;
+    this.deltaY = iDeltaY;
+};
+
+/**
+ * Sets the drag element to the location of the mousedown or click event,
+ * maintaining the cursor location relative to the location on the element
+ * that was clicked.  Override this if you want to place the element in a
+ * location other than where the cursor is.
+ *
+ * @param {int} iPageX the X coordinate of the mousedown or drag event
+ * @param {int} iPageY the Y coordinate of the mousedown or drag event
+ */
+
+YAHOO.util.DD.prototype.setDragElPos = function(iPageX, iPageY) {
+    this.alignElWithMouse(this.getDragEl(), iPageX, iPageY);
+};
+
+/**
+ * Sets the element to the location of the mousedown or click event,
+ * maintaining the cursor location relative to the location on the element
+ * that was clicked.  Override this if you want to place the element in a
+ * location other than where the cursor is.
+ *
+ * @param {HTMLElement} el the element to move
+ * @param {int} iPageX the X coordinate of the mousedown or drag event
+ * @param {int} iPageY the Y coordinate of the mousedown or drag event
+ */
+YAHOO.util.DD.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+    var oCoord = this.getTargetCoord(iPageX, iPageY);
+    var aCoord = [oCoord.x, oCoord.y];
+    YAHOO.util.Dom.setXY(el, aCoord);
+
+    this.cachePosition(oCoord.x, oCoord.y);
+
+    this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+
+/**
+ * Saves the most recent position so that we can reset the constraints and
+ * tick marks on-demand.  We need to know this so that we can calculate the
+ * number of pixels the element is offset from its original position.
+ */
+YAHOO.util.DD.prototype.cachePosition = function(iPageX, iPageY) {
+    if (iPageX) {
+        this.lastPageX = iPageX;
+        this.lastPageY = iPageY;
+    } else {
+        var aCoord = YAHOO.util.Dom.getXY(this.getEl());
+        this.lastPageX = aCoord[0];
+        this.lastPageY = aCoord[1];
+    }
+};
+
+/**
+ * Auto-scroll the window if the dragged object has been moved beyond the
+ * visible window boundary.
+ *
+ * @param {int} x the drag element's x position
+ * @param {int} y the drag element's y position
+ * @param {int} h the height of the drag element
+ * @param {int} w the width of the drag element
+ * @private
+ */
+YAHOO.util.DD.prototype.autoScroll = function(x, y, h, w) {
+
+    if (this.scroll) {
+        // The client height
+        var clientH = this.DDM.getClientHeight();
+
+        // The client width
+        var clientW = this.DDM.getClientWidth();
+
+        // The amt scrolled down
+        var st = this.DDM.getScrollTop();
+
+        // The amt scrolled right
+        var sl = this.DDM.getScrollLeft();
+
+        // Location of the bottom of the element
+        var bot = h + y;
+
+        // Location of the right of the element
+        var right = w + x;
+
+        // The distance from the cursor to the bottom of the visible area,
+        // adjusted so that we don't scroll if the cursor is beyond the
+        // element drag constraints
+        var toBot = (clientH + st - y - this.deltaY);
+
+        // The distance from the cursor to the right of the visible area
+        var toRight = (clientW + sl - x - this.deltaX);
+
+
+        // How close to the edge the cursor must be before we scroll
+        // var thresh = (document.all) ? 100 : 40;
+        var thresh = 40;
+
+        // How many pixels to scroll per autoscroll op.  This helps to reduce
+        // clunky scrolling. IE is more sensitive about this ... it needs this
+        // value to be higher.
+        var scrAmt = (document.all) ? 80 : 30;
+
+        // Scroll down if we are near the bottom of the visible page and the
+        // obj extends below the crease
+        if ( bot > clientH && toBot < thresh ) {
+            window.scrollTo(sl, st + scrAmt);
+        }
+
+        // Scroll up if the window is scrolled down and the top of the object
+        // goes above the top border
+        if ( y < st && st > 0 && y - st < thresh ) {
+            window.scrollTo(sl, st - scrAmt);
+        }
+
+        // Scroll right if the obj is beyond the right border and the cursor is
+        // near the border.
+        if ( right > clientW && toRight < thresh ) {
+            window.scrollTo(sl + scrAmt, st);
+        }
+
+        // Scroll left if the window has been scrolled to the right and the obj
+        // extends past the left border
+        if ( x < sl && sl > 0 && x - sl < thresh ) {
+            window.scrollTo(sl - scrAmt, st);
+        }
+    }
+};
+
+/**
+ * Finds the location the element should be placed if we want to move
+ * it to where the mouse location less the click offset would place us.
+ *
+ * @param {int} iPageX the X coordinate of the click
+ * @param {int} iPageY the Y coordinate of the click
+ * @return an object that contains the coordinates (Object.x and Object.y)
+ * @private
+ */
+YAHOO.util.DD.prototype.getTargetCoord = function(iPageX, iPageY) {
+
+
+    var x = iPageX - this.deltaX;
+    var y = iPageY - this.deltaY;
+
+    if (this.constrainX) {
+        if (x < this.minX) { x = this.minX; }
+        if (x > this.maxX) { x = this.maxX; }
+    }
+
+    if (this.constrainY) {
+        if (y < this.minY) { y = this.minY; }
+        if (y > this.maxY) { y = this.maxY; }
+    }
+
+    x = this.getTick(x, this.xTicks);
+    y = this.getTick(y, this.yTicks);
+
+
+    return {x:x, y:y};
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DD.prototype.b4MouseDown = function(e) {
+    // this.resetConstraints();
+    this.autoOffset(YAHOO.util.Event.getPageX(e),
+                        YAHOO.util.Event.getPageY(e));
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DD.prototype.b4Drag = function(e) {
+    this.setDragElPos(YAHOO.util.Event.getPageX(e),
+                        YAHOO.util.Event.getPageY(e));
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Debugging ygDragDrop events that can be overridden
+///////////////////////////////////////////////////////////////////////////////
+/*
+YAHOO.util.DD.prototype.startDrag = function(x, y) {
+};
+
+YAHOO.util.DD.prototype.onDrag = function(e) {
+};
+
+YAHOO.util.DD.prototype.onDragEnter = function(e, id) {
+};
+
+YAHOO.util.DD.prototype.onDragOver = function(e, id) {
+};
+
+YAHOO.util.DD.prototype.onDragOut = function(e, id) {
+};
+
+YAHOO.util.DD.prototype.onDragDrop = function(e, id) {
+};
+
+YAHOO.util.DD.prototype.endDrag = function(e) {
+};
+*/
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation that inserts an empty, bordered div into
+ * the document that follows the cursor during drag operations.  At the time of
+ * the click, the frame div is resized to the dimensions of the linked html
+ * element, and moved to the exact location of the linked element.
+ *
+ * @extends YAHOO.util.DD
+ * @constructor
+ * @param {String} id the id of the linked html element
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+YAHOO.util.DDProxy = function(id, sGroup) {
+    if (id) {
+        this.init(id, sGroup);
+        this.initFrame();
+    }
+};
+
+YAHOO.util.DDProxy.prototype = new YAHOO.util.DD();
+
+/**
+ * A reference to the one div element we create for all instances of this class
+ *
+ * @type Object
+ */
+YAHOO.util.DDProxy.frameDiv = null;
+
+/**
+ * the drag frame div id
+ *
+ * @type String
+ */
+YAHOO.util.DDProxy.dragElId = "ygddfdiv";
+
+/**
+ * The border width of the frame.  This is used when we resize the frame to
+ * the size of the linked element.  We substract the border width to make
+ * the div the correct size.
+ *
+ * @TODO find a better way to handle this
+ *
+ * @type int
+ */
+YAHOO.util.DDProxy.prototype.borderWidth = 2;
+
+/**
+ * By default we resize the drag frame to be the same size as the element
+ * we want to drag (this is to get the frame effect).  We can turn it off
+ * if we want a different behavior (ex: ygDDMy2)
+ *
+ * @type boolean
+ */
+YAHOO.util.DDProxy.prototype.resizeFrame = true;
+
+/**
+ * By default the frame is positioned exactly where the drag element is, so
+ * we use the cursor offset provided by YAHOO.util.DD.  Another option that works only if
+ * you do not have constraints on the obj is to have the drag frame centered
+ * around the cursor.  Set centerFrame to true for this effect.  Ex:
+ * ygDDMy2
+ *
+ * @type boolean
+ */
+YAHOO.util.DDProxy.prototype.centerFrame = false;
+
+/**
+ * Create the drag frame if needed
+ */
+YAHOO.util.DDProxy.createFrame = function() {
+    var THIS = YAHOO.util.DDProxy;
+
+    if (!document || !document.body) {
+        setTimeout(THIS.createFrame, 50);
+        return;
+    }
+
+    if (!THIS.frameDiv) {
+        THIS.frameDiv = document.createElement("div");
+        THIS.frameDiv.id = THIS.dragElId;
+        var s = THIS.frameDiv.style;
+        s.position = "absolute";
+        s.visibility = "hidden";
+        s.cursor = "move";
+        s.border = "2px solid #aaa";
+        s.zIndex = 999;
+
+        document.body.appendChild(THIS.frameDiv);
+    }
+};
+
+/**
+ * Initialization for the drag frame element.  Must be called in the
+ * constructor of all subclasses
+ */
+YAHOO.util.DDProxy.prototype.initFrame = function() {
+    YAHOO.util.DDProxy.createFrame();
+    this.setDragElId(YAHOO.util.DDProxy.dragElId);
+    this.useAbsMath = true;
+};
+
+/**
+ * Resizes the drag frame to the dimensions of the clicked object, positions
+ * it over the object, and finally displays it
+ *
+ * @param {int} iPageX X click position
+ * @param {int} iPageY Y click position
+ * @private
+ */
+YAHOO.util.DDProxy.prototype.showFrame = function(iPageX, iPageY) {
+    var el = this.getEl();
+
+    var s = this.getDragEl().style;
+
+    if (this.resizeFrame) {
+        s.width = (parseInt(el.offsetWidth) - (2*this.borderWidth)) + "px";
+        s.height = (parseInt(el.offsetHeight) - (2*this.borderWidth)) + "px";
+    }
+
+    if (this.centerFrame) {
+        this.setDelta(Math.round(parseInt(s.width)/2),
+                Math.round(parseInt(s.width)/2));
+    }
+
+    this.setDragElPos(iPageX, iPageY);
+
+    s.visibility = "";
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DDProxy.prototype.b4MouseDown = function(e) {
+    var x = YAHOO.util.Event.getPageX(e);
+    var y = YAHOO.util.Event.getPageY(e);
+    this.autoOffset(x, y);
+    this.setDragElPos(x, y);
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DDProxy.prototype.b4StartDrag = function(x, y) {
+    // show the drag frame
+    this.showFrame(x, y);
+};
+
+// overrides YAHOO.util.DragDrop
+YAHOO.util.DDProxy.prototype.b4EndDrag = function(e) {
+
+    // hide the drag frame
+    var s = this.getDragEl().style;
+    s.visibility = "hidden";
+};
+
+// overrides YAHOO.util.DragDrop
+// By default we try to move the element to the last location of the frame.
+// This is so that the default behavior mirrors that of YAHOO.util.DD.
+YAHOO.util.DDProxy.prototype.endDrag = function(e) {
+    var lel = this.getEl();
+    var del = this.getDragEl();
+
+    // Show the drag frame briefly so we can get its position
+    del.style.visibility = "";
+
+    // Hide the linked element before the move to get around a Safari
+    // rendering bug.
+    lel.style.visibility = "hidden";
+    YAHOO.util.DDM.moveToEl(lel, del);
+    del.style.visibility = "hidden";
+    lel.style.visibility = "";
+};
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation that does not move, but can be a drop
+ * target.  You would get the same result by simply omitting implementation
+ * for the event callbacks, but this way we reduce the processing cost of the
+ * event listener and the callbacks.
+ *
+ * @extends YAHOO.util.DragDrop
+ * @constructor
+ * @param {String} id the id of the element that is a drop target
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+
+YAHOO.util.DDTarget = function(id, sGroup) {
+    if (id) {
+        this.initTarget(id, sGroup);
+    }
+};
+
+YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop();
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/event.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/event.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/event.js	(revision 24007)
@@ -0,0 +1,901 @@
+/*
+Copyright (c) 2006 Yahoo! Inc. All rights reserved.
+version 0.9.0
+*/
+
+/**
+ * @class The CustomEvent class lets you define events for your application
+ * that can be subscribed to by one or more independent component.
+ * @param {String} type The type of event, which is passed to the callback
+ *                 when the event fires
+ * @param {Object} oScope The context the event will fire from.  "this" will
+ *                 refer to this object in the callback.  Default value:
+ *                 the window object.  The listener can override this.
+ * @constructor
+ */
+YAHOO.util.CustomEvent = function(type, oScope) {
+    /**
+     * The type of event, returned to subscribers when the event fires
+     * @type string
+     */
+    this.type = type;
+
+    /**
+     * The scope the the event will fire from.  Defaults to the window obj
+     * @type object
+     */
+    this.scope = oScope || window;
+
+    /**
+     * The subscribers to this event
+     * @type array
+     */
+    this.subscribers = [];
+
+    // Register with the event utility for automatic cleanup.  Made optional
+    // so that CustomEvent can be used independently of pe.event
+    if (YAHOO.util["Event"]) {
+        YAHOO.util.Event.regCE(this);
+    }
+};
+
+YAHOO.util.CustomEvent.prototype = {
+    /**
+     * Subscribes the caller to this event
+     * @param {Function} fn       The function to execute
+     * @param {Object}   obj      An object to be passed along when the event fires
+     * @param {boolean}  bOverride If true, the obj passed in becomes the execution
+     *                            scope of the listener
+     */
+    subscribe: function(fn, obj, bOverride) {
+        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, bOverride) );
+    },
+
+    /**
+     * Unsubscribes the caller from this event
+     * @param {Function} fn  The function to execute
+     * @param {Object}   obj An object to be passed along when the event fires
+     * @return {boolean} True if the subscriber was found and detached.
+     */
+    unsubscribe: function(fn, obj) {
+        var found = false;
+        for (var i=0; i<this.subscribers.length; ++i) {
+            var s = this.subscribers[i];
+            if (s && s.contains(fn, obj)) {
+                this._delete(i);
+                found = true;
+            }
+        }
+
+        return found;
+    },
+
+    /**
+     * Notifies the subscribers.  The callback functions will be executed
+     * from the scope specified when the event was created, and with the following
+     * parameters:
+     *   <pre>
+     *   - The type of event
+     *   - All of the arguments fire() was executed with as an array
+     *   - The custom object (if any) that was passed into the subscribe() method
+     *   </pre>
+     *
+     * @param {Array} an arbitrary set of parameters to pass to the handler
+     */
+    fire: function() {
+        for (var i=0; i<this.subscribers.length; ++i) {
+            var s = this.subscribers[i];
+            if (s) {
+                var scope = (s.override) ? s.obj : this.scope;
+                s.fn.call(scope, this.type, arguments, s.obj);
+            }
+        }
+    },
+
+    /**
+     * Removes all listeners
+     */
+    unsubscribeAll: function() {
+        for (var i=0; i<this.subscribers.length; ++i) {
+            this._delete(i);
+        }
+    },
+
+    /**
+     * @private
+     */
+    _delete: function(index) {
+        var s = this.subscribers[index];
+        if (s) {
+            delete s.fn;
+            delete s.obj;
+        }
+
+        delete this.subscribers[index];
+    }
+};
+
+/////////////////////////////////////////////////////////////////////
+
+/**
+ * @class
+ * @param {Function} fn       The function to execute
+ * @param {Object}   obj      An object to be passed along when the event fires
+ * @param {boolean}  bOverride If true, the obj passed in becomes the execution
+ *                            scope of the listener
+ * @constructor
+ */
+YAHOO.util.Subscriber = function(fn, obj, bOverride) {
+    /**
+     * The callback that will be execute when the event fires
+     * @type function
+     */
+    this.fn = fn;
+
+    /**
+     * An optional custom object that will passed to the callback when
+     * the event fires
+     * @type object
+     */
+    this.obj = obj || null;
+
+    /**
+     * The default execution scope for the event listener is defined when the
+     * event is created (usually the object which contains the event).
+     * By setting override to true, the execution scope becomes the custom
+     * object passed in by the subscriber
+     * @type boolean
+     */
+    this.override = (bOverride);
+};
+
+/**
+ * Returns true if the fn and obj match this objects properties.
+ * Used by the unsubscribe method to match the right subscriber.
+ *
+ * @param {Function} fn the function to execute
+ * @param {Object} obj an object to be passed along when the event fires
+ * @return {boolean} true if the supplied arguments match this
+ *                   subscriber's signature.
+ */
+YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {
+    return (this.fn == fn && this.obj == obj);
+};
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+// Only load this library once.  If it is loaded a second time, existing
+// events cannot be detached.
+if (!YAHOO.util.Event) {
+
+/**
+ * The event utility provides functions to add and remove event listeners,
+ * event cleansing.  It also tries to automatically remove listeners it
+ * registers during the unload event.
+ * @class
+ * @constructor
+ */
+    YAHOO.util.Event = function() {
+
+        /**
+         * True after the onload event has fired
+         * @type boolean
+         * @private
+         */
+        var loadComplete =  false;
+
+        /**
+         * Cache of wrapped listeners
+         * @type array
+         * @private
+         */
+        var listeners = [];
+
+        /**
+         * Listeners that will be attached during the onload event
+         * @type array
+         * @private
+         */
+        var delayedListeners = [];
+
+        /**
+         * User-defined unload function that will be fired before all events
+         * are detached
+         * @type array
+         * @private
+         */
+        var unloadListeners = [];
+
+        /**
+         * Cache of the custom events that have been defined.  Used for
+         * automatic cleanup
+         * @type array
+         * @private
+         */
+        var customEvents = [];
+
+        /**
+         * Cache of DOM0 event handlers to work around issues with DOM2 events
+         * in Safari
+         * @private
+         */
+        var legacyEvents = [];
+
+        /**
+         * Listener stack for DOM0 events
+         * @private
+         */
+        var legacyHandlers = [];
+
+        return { // PREPROCESS
+
+            /**
+             * Element to bind, int constant
+             * @type int
+             */
+            EL: 0,
+
+            /**
+             * Type of event, int constant
+             * @type int
+             */
+            TYPE: 1,
+
+            /**
+             * Function to execute, int constant
+             * @type int
+             */
+            FN: 2,
+
+            /**
+             * Function wrapped for scope correction and cleanup, int constant
+             * @type int
+             */
+            WFN: 3,
+
+            /**
+             * Object passed in by the user that will be returned as a
+             * parameter to the callback, int constant
+             * @type int
+             */
+            SCOPE: 3,
+
+            /**
+             * Adjusted scope, either the element we are registering the event
+             * on or the custom object passed in by the listener, int constant
+             * @type int
+             */
+            ADJ_SCOPE: 4,
+
+            /**
+             * Safari detection is necessary to work around the preventDefault
+             * bug that makes it so you can't cancel a href click from the
+             * handler.  There is not a capabilities check we can use here.
+             * @private
+             */
+            isSafari: (navigator.userAgent.match(/safari/gi)),
+
+            /**
+             * @private
+             * IE detection needed to properly calculate pageX and pageY.
+             * capabilities checking didn't seem to work because another
+             * browser that does not provide the properties have the values
+             * calculated in a different manner than IE.
+             */
+            isIE: (!this.isSafari && navigator.userAgent.match(/msie/gi)),
+
+            /**
+             * Appends an event handler
+             *
+             * @param {Object}   el        The html element to assign the
+             *                             event to
+             * @param {String}   sType     The type of event to append
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   oScope    An arbitrary object that will be
+             *                             passed as a parameter to the handler
+             * @param {boolean}  bOverride If true, the obj passed in becomes
+             *                             the execution scope of the listener
+             * @return {boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements
+             *                        could not have the event bound to it.
+             */
+            addListener: function(el, sType, fn, oScope, bOverride) {
+
+                // The el argument can be an array of elements or element ids.
+                if ( this._isValidCollection(el)) {
+                    var ok = true;
+                    for (var i=0; i< el.length; ++i) {
+                        ok = ( this.on(el[i],
+                                       sType,
+                                       fn,
+                                       oScope,
+                                       bOverride) && ok );
+                    }
+                    return ok;
+
+                } else if (typeof el == "string") {
+                    // If the el argument is a string, we assume it is
+                    // actually the id of the element.  If the page is loaded
+                    // we convert el to the actual element, otherwise we
+                    // defer attaching the event until onload event fires
+
+                    // check to see if we need to delay hooking up the event
+                    // until after the page loads.
+                    if (loadComplete) {
+                        el = this.getEl(el);
+                    } else {
+                        // defer adding the event until onload fires
+                        delayedListeners[delayedListeners.length] =
+                            [el, sType, fn, oScope, bOverride];
+
+                        return true;
+                    }
+                }
+
+                // Element should be an html element or an array if we get
+                // here.
+                if (!el) {
+                    return false;
+                }
+
+                // we need to make sure we fire registered unload events
+                // prior to automatically unhooking them.  So we hang on to
+                // these instead of attaching them to the window and fire the
+                // handles explicitly during our one unload event.
+                if ("unload" == sType && oScope !== this) {
+                    unloadListeners[unloadListeners.length] =
+                            [el, sType, fn, oScope, bOverride];
+                    return true;
+                }
+
+
+                // if the user chooses to override the scope, we use the custom
+                // object passed in, otherwise the executing scope will be the
+                // HTML element that the event is registered on
+                var scope = (bOverride) ? oScope : el;
+
+                // wrap the function so we can return the oScope object when
+                // the event fires;
+                var wrappedFn = function(e) {
+                        return fn.call(scope, YAHOO.util.Event.getEvent(e),
+                                oScope);
+                    };
+
+                var li = [el, sType, fn, wrappedFn, scope];
+                var index = listeners.length;
+                // cache the listener so we can try to automatically unload
+                listeners[index] = li;
+
+                if (this.useLegacyEvent(el, sType)) {
+                    var legacyIndex = this.getLegacyIndex(el, sType);
+                    if (legacyIndex == -1) {
+
+                        legacyIndex = legacyEvents.length;
+                        // cache the signature for the DOM0 event, and
+                        // include the existing handler for the event, if any
+                        legacyEvents[legacyIndex] =
+                            [el, sType, el["on" + sType]];
+                        legacyHandlers[legacyIndex] = [];
+
+                        el["on" + sType] =
+                            function(e) {
+                                YAHOO.util.Event.fireLegacyEvent(
+                                    YAHOO.util.Event.getEvent(e), legacyIndex);
+                            };
+                    }
+
+                    // add a reference to the wrapped listener to our custom
+                    // stack of events
+                    legacyHandlers[legacyIndex].push(index);
+
+                // DOM2 Event model
+                } else if (el.addEventListener) {
+                    el.addEventListener(sType, wrappedFn, false);
+                // Internet Explorer abstraction
+                } else if (el.attachEvent) {
+                    el.attachEvent("on" + sType, wrappedFn);
+                }
+
+                return true;
+
+            },
+
+            /**
+             * Shorthand for YAHOO.util.Event.addListener
+             * @type function
+             */
+            // on: this.addListener,
+
+            /**
+             * When using legacy events, the handler is routed to this object
+             * so we can fire our custom listener stack.
+             * @private
+             */
+            fireLegacyEvent: function(e, legacyIndex) {
+                // alert("fireLegacyEvent " + legacyIndex);
+                var ok = true;
+
+                // var el = legacyEvents[YAHOO.util.Event.EL];
+
+                /* this is not working because the property may get populated
+                // fire the event we replaced, if it exists
+                var origHandler = legacyEvents[2];
+                alert(origHandler);
+                if (origHandler && origHandler.call) {
+                    var ret = origHandler.call(el, e);
+                    ok = (ret);
+                }
+                */
+
+                var le = legacyHandlers[legacyIndex];
+                for (i=0; i < le.length; ++i) {
+                    var index = le[i];
+                    // alert(index);
+                    if (index) {
+                        var li = listeners[index];
+                        var scope = li[this.ADJ_SCOPE];
+                        var ret = li[this.WFN].call(scope, e);
+                        ok = (ok && ret);
+                        // alert(ok);
+                    }
+                }
+
+                return ok;
+            },
+
+            /**
+             * Returns the legacy event index that matches the supplied
+             * signature
+             * @private
+             */
+            getLegacyIndex: function(el, sType) {
+                for (var i=0; i < legacyEvents.length; ++i) {
+                    var le = legacyEvents[i];
+                    if (le && le[0] == el && le[1] == sType) {
+                        return i;
+                    }
+                }
+
+                return -1;
+            },
+
+            /**
+             * Logic that determines when we should automatically use legacy
+             * events instead of DOM2 events.
+             * @private
+             */
+            useLegacyEvent: function(el, sType) {
+
+                return ( (!el.addEventListener && !el.attachEvent) ||
+                                (sType == "click" && this.isSafari) );
+            },
+
+            /**
+             * Removes an event handler
+             *
+             * @param {Object} el the html element or the id of the element to
+             * assign the event to.
+             * @param {String} sType the type of event to remove
+             * @param {Function} fn the method the event invokes
+             * @return {boolean} true if the unbind was successful, false
+             * otherwise
+             */
+            removeListener: function(el, sType, fn) {
+
+                // The el argument can be a string
+                if (typeof el == "string") {
+                    el = this.getEl(el);
+                // The el argument can be an array of elements or element ids.
+                } else if ( this._isValidCollection(el)) {
+                    var ok = true;
+                    for (var i=0; i< el.length; ++i) {
+                        ok = ( this.removeListener(el[i], sType, fn) && ok );
+                    }
+                    return ok;
+                }
+
+                var cacheItem = null;
+                var index = this._getCacheIndex(el, sType, fn);
+
+                if (index >= 0) {
+                    cacheItem = listeners[index];
+                }
+
+                if (!el || !cacheItem) {
+                    return false;
+                }
+
+
+                if (el.removeEventListener) {
+                    el.removeEventListener(sType, cacheItem[this.WFN], false);
+                    // alert("adsf");
+                } else if (el.detachEvent) {
+                    el.detachEvent("on" + sType, cacheItem[this.WFN]);
+                }
+
+                // removed the wrapped handler
+                delete listeners[index][this.WFN];
+                delete listeners[index][this.FN];
+                delete listeners[index];
+
+                return true;
+
+            },
+
+            /**
+             * Returns the event's target element
+             * @param {Event} ev the event
+             * @param {boolean} resolveTextNode when set to true the target's
+             *                  parent will be returned if the target is a
+             *                  text node
+             * @return {HTMLElement} the event's target
+             */
+            getTarget: function(ev, resolveTextNode) {
+                var t = ev.target || ev.srcElement;
+
+                if (resolveTextNode && t && "#text" == t.nodeName) {
+                    return t.parentNode;
+                } else {
+                    return t;
+                }
+            },
+
+            /**
+             * Returns the event's pageX
+             * @param {Event} ev the event
+             * @return {int} the event's pageX
+             */
+            getPageX: function(ev) {
+                var x = ev.pageX;
+                if (!x && 0 !== x) {
+                    x = ev.clientX || 0;
+
+                    if ( this.isIE ) {
+                        x += this._getScrollLeft();
+                    }
+                }
+
+                return x;
+            },
+
+            /**
+             * Returns the event's pageY
+             * @param {Event} ev the event
+             * @return {int} the event's pageY
+             */
+            getPageY: function(ev) {
+                var y = ev.pageY;
+                if (!y && 0 !== y) {
+                    y = ev.clientY || 0;
+
+                    if ( this.isIE ) {
+                        y += this._getScrollTop();
+                    }
+                }
+
+                return y;
+            },
+
+            /**
+             * Returns the event's related target
+             * @param {Event} ev the event
+             * @return {HTMLElement} the event's relatedTarget
+             */
+            getRelatedTarget: function(ev) {
+                var t = ev.relatedTarget;
+                if (!t) {
+                    if (ev.type == "mouseout") {
+                        t = ev.toElement;
+                    } else if (ev.type == "mouseover") {
+                        t = ev.fromElement;
+                    }
+                }
+
+                return t;
+            },
+
+            /**
+             * Returns the time of the event.  If the time is not included, the
+             * event is modified using the current time.
+             * @param {Event} ev the event
+             * @return {Date} the time of the event
+             */
+            getTime: function(ev) {
+                if (!ev.time) {
+                    var t = new Date().getTime();
+                    try {
+                        ev.time = t;
+                    } catch(e) {
+                        // can't set the time property
+                        return t;
+                    }
+                }
+
+                return ev.time;
+            },
+
+            /**
+             * Convenience method for stopPropagation + preventDefault
+             * @param {Event} ev the event
+             */
+            stopEvent: function(ev) {
+                this.stopPropagation(ev);
+                this.preventDefault(ev);
+            },
+
+            /**
+             * Stops event propagation
+             * @param {Event} ev the event
+             */
+            stopPropagation: function(ev) {
+                if (ev.stopPropagation) {
+                    ev.stopPropagation();
+                } else {
+                    ev.cancelBubble = true;
+                }
+            },
+
+            /**
+             * Prevents the default behavior of the event
+             * @param {Event} ev the event
+             */
+            preventDefault: function(ev) {
+                if (ev.preventDefault) {
+                    ev.preventDefault();
+                } else {
+                    ev.returnValue = false;
+                }
+            },
+
+            /**
+             * Returns the event, should not be necessary for user to call
+             * @param {Event} the event parameter from the handler
+             * @return {Event} the event
+             */
+            getEvent: function(e) {
+                var ev = e || window.event;
+
+                if (!ev) {
+                    var c = this.getEvent.caller;
+                    while (c) {
+                        ev = c.arguments[0];
+                        if (ev && Event == ev.constructor) {
+                            break;
+                        }
+                        c = c.caller;
+                    }
+                }
+
+                return ev;
+            },
+
+            /**
+             * Returns the charcode for an event
+             * @param {Event} ev the event
+             * @return {int} the event's charCode
+             */
+            getCharCode: function(ev) {
+                return ev.charCode || (ev.type == "keypress") ? ev.keyCode : 0;
+            },
+
+            /**
+             * @private
+             * Locating the saved event handler data by function ref
+             */
+            _getCacheIndex: function(el, sType, fn) {
+                for (var i=0; i< listeners.length; ++i) {
+                    var li = listeners[i];
+                    if ( li                 &&
+                         li[this.FN] == fn  &&
+                         li[this.EL] == el  &&
+                         li[this.TYPE] == sType ) {
+                        return i;
+                    }
+                }
+
+                return -1;
+            },
+
+            /**
+             * We want to be able to use getElementsByTagName as a collection
+             * to attach a group of events to.  Unfortunately, different
+             * browsers return different types of collections.  This function
+             * tests to determine if the object is array-like.  It will also
+             * fail if the object is an array, but is empty.
+             * @param o the object to test
+             * @return {boolean} true if the object is array-like and populated
+             */
+            _isValidCollection: function(o) {
+                // alert(o.constructor.toString())
+                // alert(typeof o)
+
+                return ( o                    && // o is something
+                         o.length             && // o is indexed
+                         typeof o != "string" && // o is not a string
+                         !o.tagName           && // o is not an HTML element
+                         !o.alert             && // o is not a window
+                         typeof o[0] != "undefined" );
+
+            },
+
+            /**
+             * @private
+             * DOM element cache
+             */
+            elCache: {},
+
+            /**
+             * We cache elements bound by id because when the unload event
+             * fires, we can no longer use document.getElementById
+             * @private
+             */
+            getEl: function(id) {
+                /*
+                // this is a problem when replaced via document.getElementById
+                if (! this.elCache[id]) {
+                    try {
+                        var el = document.getElementById(id);
+                        if (el) {
+                            this.elCache[id] = el;
+                        }
+                    } catch (er) {
+                    }
+                }
+                return this.elCache[id];
+                */
+
+                return document.getElementById(id);
+            },
+
+            /**
+             * Clears the element cache
+             */
+            clearCache: function() {
+                for (i in this.elCache) {
+                    delete this.elCache[i];
+                }
+            },
+
+            /**
+             * Called by CustomEvent instances to provide a handle to the
+             * event * that can be removed later on.  Should be package
+             * protected.
+             * @private
+             */
+            regCE: function(ce) {
+                customEvents.push(ce);
+            },
+
+            /**
+             * @private
+             * hook up any deferred listeners
+             */
+            _load: function(e) {
+                loadComplete = true;
+            },
+
+            /**
+             * Polling function that runs before the onload event fires,
+             * attempting * to attach to DOM Nodes as soon as they are
+             * available
+             * @private
+             */
+            _tryPreloadAttach: function() {
+
+                // keep trying until after the page is loaded.  We need to
+                // check the page load state prior to trying to bind the
+                // elements so that we can be certain all elements have been
+                // tested appropriately
+                var tryAgain = !loadComplete;
+
+                for (var i=0; i < delayedListeners.length; ++i) {
+                    var d = delayedListeners[i];
+                    // There may be a race condition here, so we need to
+                    // verify the array element is usable.
+                    if (d) {
+
+                        // el will be null if document.getElementById did not
+                        // work
+                        var el = this.getEl(d[this.EL]);
+
+                        if (el) {
+                            this.on(el, d[this.TYPE], d[this.FN],
+                                    d[this.SCOPE], d[this.ADJ_SCOPE]);
+                            delete delayedListeners[i];
+                        }
+                    }
+                }
+
+                if (tryAgain) {
+                    setTimeout("YAHOO.util.Event._tryPreloadAttach()", 50);
+                }
+            },
+
+            /**
+             * Removes all listeners registered by pe.event.  Called
+             * automatically during the unload event.
+             */
+            _unload: function(e, me) {
+                for (var i=0; i < unloadListeners.length; ++i) {
+                    var l = unloadListeners[i];
+                    if (l) {
+                        var scope = (l[this.ADJ_SCOPE]) ? l[this.SCOPE]: window;
+                        l[this.FN].call(scope, this.getEvent(e), l[this.SCOPE] );
+                    }
+                }
+
+                if (listeners && listeners.length > 0) {
+                    for (i = 0; i < listeners.length; ++i) {
+                        l = listeners[i];
+                        if (l) {
+                            this.removeListener(l[this.EL], l[this.TYPE],
+                                    l[this.FN]);
+                        }
+                    }
+
+                    this.clearCache();
+                }
+
+                for (i = 0; i < customEvents.length; ++i) {
+                    customEvents[i].unsubscribeAll();
+                    delete customEvents[i];
+                }
+
+                for (i = 0; i < legacyEvents.length; ++i) {
+                    // dereference the element
+                    delete legacyEvents[i][0];
+                    // delete the array item
+                    delete legacyEvents[i];
+                }
+            },
+
+            /**
+             * Returns scrollLeft
+             * @private
+             */
+            _getScrollLeft: function() {
+                return this._getScroll()[1];
+            },
+
+            /**
+             * Returns scrollTop
+             * @private
+             */
+            _getScrollTop: function() {
+                return this._getScroll()[0];
+            },
+
+            /**
+             * Returns the scrollTop and scrollLeft.  Used to calculate the
+             * pageX and pageY in Internet Explorer
+             * @private
+             */
+            _getScroll: function() {
+                var dd = document.documentElement; db = document.body;
+                if (dd && dd.scrollTop) {
+                    return [dd.scrollTop, dd.scrollLeft];
+                } else if (db) {
+                    return [db.scrollTop, db.scrollLeft];
+                } else {
+                    return [0, 0];
+                }
+            }
+        };
+    } ();
+
+    YAHOO.util.Event.on = YAHOO.util.Event.addListener;
+
+    if (document && document.body) {
+        YAHOO.util.Event._load();
+    } else {
+        YAHOO.util.Event.on(window, "load", YAHOO.util.Event._load,
+                YAHOO.util.Event, true);
+    }
+
+    YAHOO.util.Event.on(window, "unload", YAHOO.util.Event._unload,
+                YAHOO.util.Event, true);
+
+    YAHOO.util.Event._tryPreloadAttach();
+
+}
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/key.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/key.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/key.js	(revision 24007)
@@ -0,0 +1,34 @@
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+YAHOO.util.Key = new function() {
+	// this.logger	= new ygLogger("ygEventUtil");
+	// DOM key constants 
+	this.DOM_VK_UNDEFINED               = 0x0;
+	this.DOM_VK_RIGHT_ALT               = 0x12;
+	this.DOM_VK_LEFT_ALT                = 0x12;
+	this.DOM_VK_LEFT_CONTROL            = 0x11;
+	this.DOM_VK_RIGHT_CONTROL           = 0x11;
+	this.DOM_VK_LEFT_SHIFT              = 0x10;
+	this.DOM_VK_RIGHT_SHIFT             = 0x10;
+	this.DOM_VK_META                    = 0x9D;
+	this.DOM_VK_BACK_SPACE              = 0x08;
+	this.DOM_VK_CAPS_LOCK               = 0x14;
+	this.DOM_VK_DELETE                  = 0x7F;
+	this.DOM_VK_END                     = 0x23;
+	this.DOM_VK_ENTER                   = 0x0D;
+	this.DOM_VK_ESCAPE                  = 0x1B;
+	this.DOM_VK_HOME                    = 0x24;
+	this.DOM_VK_NUM_LOCK                = 0x90;
+	this.DOM_VK_PAUSE                   = 0x13;
+	this.DOM_VK_PRINTSCREEN             = 0x9A;
+	this.DOM_VK_SCROLL_LOCK             = 0x91;
+	this.DOM_VK_SPACE                   = 0x20;
+	this.DOM_VK_TAB                     = 0x09;
+	this.DOM_VK_LEFT                    = 0x25;
+	this.DOM_VK_RIGHT                   = 0x27;
+	this.DOM_VK_UP                      = 0x26;
+	this.DOM_VK_DOWN                    = 0x28;
+	this.DOM_VK_PAGE_DOWN               = 0x22;
+	this.DOM_VK_PAGE_UP                 = 0x21;
+};
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/ygDDOnTop.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/ygDDOnTop.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/ygDDOnTop.js	(revision 24007)
@@ -0,0 +1,46 @@
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+/**
+ * @class a DragDrop implementation that moves the object as it is being dragged,
+ * and keeps the object being dragged on top.  This is a subclass of ygDD rather
+ * than DragDrop, and inherits the implementation of most of the event listeners
+ * from that class.
+ *
+ * @extends ygDD
+ * @constructor
+ * @param {String} id the id of the linked element
+ * @param {String} sGroup the group of related DragDrop items
+ */
+function ygDDOnTop(id, sGroup) {
+	if (id) {
+		this.init(id, sGroup);
+	
+	}
+}
+
+ygDDOnTop.prototype = new YAHOO.util.DD();
+
+/**
+ * The inital z-index of the element, stored so we can restore it later
+ *
+ * @type int
+ */
+ygDDOnTop.prototype.origZ = 0;
+
+ygDDOnTop.prototype.startDrag = function(x, y) {
+
+	var style = this.getEl().style;
+
+	// store the original z-index
+	this.origZ = style.zIndex;
+
+	// The z-index needs to be set very high so the element will indeed be on top
+	style.zIndex = 999;
+}
+
+ygDDOnTop.prototype.endDrag = function(e) {
+
+	// restore the original z-index
+	this.getEl().style.zIndex = this.origZ;
+};
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/ygDDPlayer.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/ygDDPlayer.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/js/ygDDPlayer.js	(revision 24007)
@@ -0,0 +1,350 @@
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
+
+function ygDDStack(id, sGroup) {
+	if (id) {
+		this.init(id, sGroup);
+		this.initFrame();
+	}
+}
+
+ygDDStack.prototype = new YAHOO.util.DDTarget();
+
+ygDDPlayer.TYPE = "ygDDPlayer";
+
+/**
+ * @class a YAHOO.util.DDFramed implementation. During the drag over event, the
+ * dragged element is inserted before the dragged-over element.
+ *
+ * @extends YAHOO.util.DDProxy
+ * @constructor
+ * @param {String} id the id of the linked element
+ * @param {String} sGroup the group of related DragDrop objects
+ */
+function ygDDPlayer(id, sGroup,bl) {
+    this.initPlayer(id, sGroup);
+    this.berryList = bl;     
+            
+}
+
+ygDDPlayer.prototype = new YAHOO.util.DDProxy();
+
+ygDDPlayer.prototype.berryList = new Array();
+
+ygDDPlayer.prototype.initPlayer = function(id, sGroup) {
+	if (!id) { return; }
+
+    this.init(id, sGroup);
+    this.initFrame();
+    var s = this.getDragEl().style;
+    s.borderColor = "transparent";
+    // s.backgroundColor = "#cccccc";
+    s.opacity = 0.76;
+    s.filter = "alpha(opacity=76)";
+
+    // specify that this is not currently a drop target
+    this.isTarget = false;
+
+    this.originalStyles = [];
+
+    this.type = ygDDPlayer.TYPE;
+    this.slot = null;
+    this.startPos = YAHOO.util.Dom.getXY( this.getEl() );
+   
+}
+
+ygDDPlayer.prototype.startDrag = function(x, y) {
+	
+	var dragEl = this.getDragEl();
+	var clickEl = this.getEl();
+       
+       	dragEl.innerHTML = clickEl.innerHTML;
+	//dragEl.className = clickEl.className;
+    	//dragEl.style.color = clickEl.style.color;
+	//dragEl.style.backgroundColor = clickEl.style.backgroundColor;
+        //dragEl.style.visibility = clickEl.style.visibility;
+               
+ 	while (dragEl.hasChildNodes())	{
+        	 dragEl.removeChild(dragEl.firstChild);
+	}	
+       
+         var img = document.createElement('img');
+              img.src = 'interfaces/default/images/berry3.png';
+              img.height = 15;
+              img.width = 15;
+             img.border = 0;              
+          dragEl.appendChild(img);
+       
+        var added = true;
+
+      	var s = clickEl.style;
+	s.opacity = .1;
+	s.filter = "alpha(opacity=10)";
+
+	var targets = YAHOO.util.DDM.getRelated(this, true);
+	
+	for (var i=0; i<targets.length; i++) {
+		
+		var targetEl = this.getTargetDomRef(targets[i]);
+
+		if (!this.originalStyles[targetEl.id]) {
+			this.originalStyles[targetEl.id] = targetEl.className;
+		}
+
+		targetEl.className = "target";
+	}
+};
+
+ygDDPlayer.prototype.getTargetDomRef = function(oDD) {
+	if (oDD.player) {
+		return oDD.player.getEl();
+	} else {
+		return oDD.getEl();
+	}
+};
+
+ygDDPlayer.prototype.endDrag = function(e) {
+	// reset the linked element styles
+	var s = this.getEl().style;
+	s.opacity = 1;
+	s.filter = "alpha(opacity=100)";
+
+	this.resetTargets();
+};
+
+ygDDPlayer.prototype.resetTargets = function() {
+
+	// reset the target styles
+	var targets = YAHOO.util.DDM.getRelated(this, true);
+	for (var i=0; i<targets.length; i++) {
+		var targetEl = this.getTargetDomRef(targets[i]);
+		var oldStyle = this.originalStyles[targetEl.id];
+		if (oldStyle) {
+			targetEl.className = oldStyle;
+		}
+	}
+};
+
+var request_type = "GET";
+var addurlPath ="?a=pr&rt=r&ro=1&s=AddItem&c=&s1.id=2&o=XML&s1.item=";
+var delurlPath ="?a=pr&rt=r&ro=1&s=DeleteItem&c=&o=XML&s1.item=";
+var postdata = null;
+
+ygDDPlayer.prototype.onDragDrop = function(e, id) {
+	// get the drag and drop object that was targeted
+     var oDD;
+     var player = this;
+   
+    if ("string" == typeof id) {
+        oDD = YAHOO.util.DDM.getDDById(id);
+    } else {
+        oDD = YAHOO.util.DDM.getBestMatch(id);
+    }
+
+
+   var el = this.getEl();
+
+	// check if the slot has a player in it already
+	if (oDD.player) {
+		// check if the dragged player was already in a slot
+		if (this.slot) {
+	  		// check to see if the player that is already in the
+			// slot can go to the slot the dragged player is in
+			// YAHOO.util.DDM.isLegalTarget is a new method
+			if ( YAHOO.util.DDM.isLegalTarget(oDD.player, this.slot) ) {
+				YAHOO.util.DDM.moveToEl(oDD.player.getEl(), el);
+				this.slot.player = oDD.player;
+				oDD.player.slot = this.slot;
+			} else {
+				YAHOO.util.Dom.setXY(oDD.player.getEl(), oDD.player.startPos);
+				this.slot.player = null;
+				oDD.player.slot = null
+			}
+		} else {
+		        // the player in the slot will be moved to the dragged
+			// players start position
+			//oDD.player.slot = null;
+			//YAHOO.util.DDM.moveToEl(oDD.player.getEl(), el);
+		}
+	}else {
+		// Move the player into the emply slot
+		// I may be moving off a slot so I need to clear the player ref
+	   	if (this.slot) {
+			this.slot.player = null;
+		}
+	}
+
+     var  addurl = addurlPath + el.id;	
+     var addSuccess = function(o){ 
+                 var text = o.responseText;
+	         var result = o.responseXML;
+                 var items = result.getElementsByTagName('item');
+                 if (items.length > 0){
+                    var item = items[0];
+                    var berrybasket = YAHOO.util.Dom.get('berrybasket');
+        	    var berries = YAHOO.util.Dom.get('berries');
+                    player.berryList[player.berryList.length]= item;     
+                
+                    var itemID = item.getAttribute('collection')+":"+item.getAttribute('name');
+                    var parent =el.parentNode;
+                    parent.removeChild(el);
+ 	        	
+                    if (parent !=null && parent.id == "documentberries"){
+                         var root = YAHOO.util.Dom.get(itemID+":root");
+                         var section = YAHOO.util.Dom.get(itemID+":section");
+                         if(root!=null && root.id.indexOf(itemID) !=-1){
+                             parent.removeChild(root);
+                          }
+     
+	                  if(section!=null && section.id.indexOf(itemID) !=-1){
+                             parent.removeChild(section);
+        	          }                                                
+                     }
+                   
+
+                    if (!YAHOO.util.Dom.get('hideview') && player.berryList.length <13){
+                       
+                       while (berries.hasChildNodes()) {
+       	                   berries.removeChild(berries.firstChild);
+	                }
+                        
+                     for (var i =0; i < player.berryList.length; i++ ){
+                             var img = document.createElement('img');
+                              img.src = 'interfaces/default/images/berry3.png';
+                              img.height = 15;
+                              img.width = 15;
+                              img.border = 0;              
+                              berries.appendChild(img);
+                       }
+      	                                   
+	          }
+                 else{
+                      
+        
+                    if (YAHOO.util.Dom.get('hideview')){
+                      
+                        var berryBasket  = YAHOO.util.Dom.get('berrybasket');
+                        var berries  = YAHOO.util.Dom.get('berries');
+                        var doclist = YAHOO.util.Dom.get('doclist'); 
+                        var tid = el.id;                                  
+                        var berryItem; 
+                        var berryElement = document.createElement('li');
+                         for (var i in player.berryList){
+                             berryItem = player.berryList[i];
+                             var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name');
+                             if (id == tid){
+                               var title = berryItem.getAttribute('title');
+                               var root_title = berryItem.getAttribute('root_title');  
+                                if (root_title != ""){
+                                      root_title +=":";
+                                     }
+	    
+                                title = root_title+title;	
+                                if (title.length > 50){
+                                   title = title.substring(0,20)+" ... "+title.substr(title.length-35,35);
+                                }
+                                
+                               berryElement.appendChild(document.createTextNode(title));
+                               berryElement.setAttribute("class","berryitem");
+                               doclist.appendChild(berryElement);
+                               var heightStr =  berryBasket.style.height+"";
+                               var height =parseInt(heightStr.substring(0,heightStr.length-2)) +18;                             
+                               berryBasket.style.height = height;
+                               berries.style.height = height;
+                               break;
+                            }
+                         }
+                         }    
+                 
+                 }
+               }
+                
+                       
+
+         }
+
+     var addFailure = function(o){ }
+
+
+     var addcallback = {
+        	success:addSuccess,
+     	        failure:addFailure,  
+                argument:player
+                }
+    
+
+    var  delurl = delurlPath + el.id;	
+     var delSuccess = function(o){ 
+ 		 var result = o.responseXML;
+                    var parent =el.parentNode;
+                    if (parent == null) return;                   
+
+                    parent.removeChild(el);
+                     
+                    for (var i in player.berryList){
+                       var berry = player.berryList[i];
+                  
+                       var id = berry['collection']+":"+berry['name'];
+                       
+                       if (id == el.id){
+                             player.berryList.splice(i,1);
+                                    
+                             break;
+                         }
+
+                   }
+
+                   if (!parent.hasChildNodes()){
+                         var content =  YAHOO.util.Dom.get('content');
+                           while (content.hasChildNodes()) {
+		              content.removeChild(content.firstChild);
+	                }  
+                        content.appendChild(document.createTextNode('Your berry basket is empty.'));
+                     }
+                   var trashbin =  YAHOO.util.Dom.get('trashbin');
+                   if ( trashbin !=null){
+                         trashbin.style.background = 'url("interfaces/default/images/trash-full.png") 0 0 no-repeat';
+                  }
+              }                                       
+         
+
+     var delFailure = function(o){ }
+
+
+     var delcallback = {
+        	success:delSuccess,
+     	        failure:delFailure,  
+                argument:player
+                }
+    
+
+  if (id == 'berrybasket'){
+       YAHOO.util.Connect.asyncRequest(request_type , addurl , addcallback);         
+  }
+  else{
+        if (id == 'trashbin'){
+             YAHOO.util.Connect.asyncRequest(request_type , delurl , delcallback); 
+         }
+   }
+
+   this.resetTargets();  	
+   this.slot = oDD;	
+   this.slot.player = this;
+ 
+};
+
+ygDDPlayer.prototype.swap = function(el1, el2) {
+    var dom = YAHOO.util.Dom;
+	var pos1 = dom.getXY(el1);
+	var pos2 = dom.getXY(el2);
+	dom.setXY(el1, pos2);
+	dom.setXY(el2, pos1);
+};
+
+ygDDPlayer.prototype.onDragOver = function(e, id) {};
+
+ygDDPlayer.prototype.onDrag = function(e, id) {};
+
+
+
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/berry.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/berry.css	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/berry.css	(revision 24007)
@@ -0,0 +1,1 @@
+div.globalwrapper{font-family:sans-serif,arial,helvetica;margin:0 2em 0 4em;padding:0}div#content{font-family:sans-serif,arial,helvetica;margin:.5em 0 .5em 0;padding:0}div.banner{margin:0;padding:0}div.pageinfo{float:right;text-align:right;padding:0;margin:0 0 3px 0;width:50%}div.basketimage{float:left;width:45%;padding:0;margin:0}div.bannerextra{clear:both;padding:.2em 0 0 0}p.bannerlinks{font-weight:bold;margin:0;padding:0}p.bannertitle{font-family:sans-serif,arial,helvetica;font-size:24px;font-weight:bold;white-space:nowrap;margin:0;padding:.5em 0 .5em 0;background:url("../images/tile13.jpeg") 0 0 repeat-y}a.navlink{vertical-align:top;padding:.2em .5em 0 0;color:black;text-decoration:none;background-image:url("../images/bg_off.png")}a.navlink:hover{background-image:url("../images/bg_on.png")}p.navbar{text-align:center;background:url("../images/bg_green.png") 0 0 repeat-x;font-weight:bold}span.navlink{margin:0 3em 0 3em;padding:0 .5em 0 .5em;background-image:url("../images/bg_off.png");cursor:pointer}span.navlink:hover{background-image:url("../images/bg_on.png")}img#trashbin{float:right}span.berryradio{cursor:pointer;margin:0 3em 0 3em;font-weight:bold}.berrycheck{font-size:80%;cursor:pointer;font-weight:bold;margin:0 0 0 .5em}#urlcheck{float:left;padding:0;margin:0}.pick{visibility:hidden}div#berrybasket{float:right;font-family:sans-serif;height:120px;width:100px;padding:4px 5px 4px 4px;background-color:#e0f0e0;background:url("../images/berrybasket.png") 0 0 no-repeat;margin:0;font-size:100%;text-align:center;#border:1px solid #2e8b57;z-index:10;cursor:pointer}div#baskethandle{padding:0;cursor:move;height:30px;width:auto;#background-color:#eee;background:transparent;margin:0}div#berries{text-align:left;height:auto;margin:0;padding:0;overflow:hidden}p#documentberries{font-weight:bold;font-size:90%}.documentberry{margin:0 2em 0 0;padding:0;visibility:hidden}#doclist{margin:0}.content{font-family:sans-serif;text-align:left}li.berryitem{padding:0;margin:0;color:black;font-size:90%}li.berrydoc{font-size:90%;cursor:pointer;padding:0;margin:0 1em 0 0}a.expandcontract{font-size:90%;color:red}.item{font-size:90%}a.fullview:visited{color:red}a#hideview:visited{color:red}a.fullview{float:left;font-size:90%;margin:0 0 0 20px;padding:0;cursor:pointer;color:red;text-decoration:none}a#hideView{float:right;font-size:90%;margin:0 20px 0 0;padding:0;color:red;cursor:pointer;text-decoration:none}.berrydelete{font-family:sans-serif;background-color:#e0f0e0;border:1px solid #2e8b57;padding:4px 4px 4px 4px;font-weight:bold;cursor:pointer;width:6em;color:red;font-size:90%}.sendbutton{font-family:sans-serif;background-color:#e0f0e0;border:1px solid #2e8b57;padding:4px 4px 4px 4px;font-weight:bold;cursor:pointer;width:5em;font-size:90%;margin:1em 0 0 0}.berrybutton{font-family:sans-serif;background-color:#e0f0e0;border:1px solid #2e8b57;padding:4px 4px 4px 4px;font-weight:bold;cursor:pointer;width:10em;font-size:90%}.mailinput{border:1px solid #2e8b57;width:20em;height:1.5em;font-size:90%}.mailitem{text-align:left}textarea#pretextarea{font-family:sans-serif;border:1px solid #2e8b57;width:100%;height:25em;font-size:90%;margin:.5em 0 0 0;padding:0}div#trashbin{float:right;height:60px;width:55px;padding:0;background:url("../images/trash-empty.png") 0 0 no-repeat;margin:0;z-index:10}div#binhandle{height:60px;width:55px;cursor:move}span.extralink{cursor:pointer;font-size:80%;font-weight:bold;margin:0 2em 0 0;color:black}span.extralink:hover{color:#2e8b57}
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/berry_whitespace.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/berry_whitespace.css	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/berry_whitespace.css	(revision 24007)
@@ -0,0 +1,317 @@
+
+
+div.globalwrapper{
+  font-family: sans-serif, arial, helvetica;
+  margin: 0 2em 0 4em; 
+  padding:0;
+ 
+}
+
+div#content{
+  font-family: sans-serif, arial, helvetica;
+  margin: 0.5em 0 0.5em 0;
+  padding: 0; 
+
+}
+
+div.banner{
+ margin:0;
+ padding:0;
+
+}
+
+div.pageinfo{
+  float:right;
+  text-align: right;
+  padding: 0;
+  margin:0 0 3px 0;	
+  width: 50%;
+}
+
+div.basketimage{
+  float:left;
+  width: 45%;
+  padding:0;
+  margin:0;
+
+}
+
+
+div.bannerextra {
+   clear: both;
+   padding: 0.2em 0 0 0;
+}
+
+/* home, help, preferences links */
+p.bannerlinks {
+  font-weight: bold;
+  margin:0;
+  padding:0;
+}
+
+
+p.bannertitle {
+  font-family: sans-serif, arial, helvetica;
+  font-size: 24px;
+  font-weight: bold;
+  white-space: nowrap;
+  margin: 0;
+  padding: 0.5em 0 0.5em 0em;
+  background: url("../images/tile13.jpeg") 0 0 repeat-y;
+ 
+}
+
+
+a.navlink{
+  vertical-align: top;
+  padding: 0.2em 0.5em 0 0;
+  color: black;
+  text-decoration: none; 
+  background-image: url("../images/bg_off.png");
+ }
+
+a.navlink:hover {
+   background-image: url("../images/bg_on.png");
+ }
+
+p.navbar{
+  text-align: center;
+   background: url("../images/bg_green.png") 0 0 repeat-x;
+   font-weight: bold;
+}
+
+span.navlink{
+   margin:0 3em  0 3em;
+   padding:0 0.5em 0 0.5em;
+   background-image: url("../images/bg_off.png");
+   cursor: pointer;
+}
+
+span.navlink:hover {
+   background-image: url("../images/bg_on.png");
+ }
+
+img#trashbin{
+ float:right;
+}
+
+span.berryradio{
+ cursor: pointer;
+ margin:0 3em  0 3em;
+ font-weight: bold;
+}
+
+.berrycheck{
+ font-size: 80%;  
+ cursor: pointer;
+ font-weight: bold;
+ margin: 0 0 0 0.5em;
+}
+
+#urlcheck{
+ float: left;
+ padding: 0;
+ margin: 0;
+ 
+}
+
+.pick {
+  visibility:hidden;
+}
+
+div#berrybasket {
+   float:right;
+   font-family:sans-serif;
+   height:120px;
+   width: 100px;
+   padding: 4px 5px 4px 4px;
+   background-color:#E0F0E0;
+   background: url("../images/berrybasket.png") 0 0 no-repeat;
+   margin:0;
+   font-size:100%;
+   text-align:center;
+   #border:1px solid #2E8B57;	
+   z-index:10;
+   cursor: pointer;
+ }
+
+div#baskethandle {
+  padding: 0;
+  cursor:move;
+  height: 30px;
+  width:auto;
+  #background-color:#eeeeee;
+   background:transparent;
+   margin:0 ;
+  }
+
+div#berries {
+  text-align:left;
+  height: auto;
+  margin: 0;
+  padding:0;
+  overflow: hidden;   
+}
+
+
+p#documentberries {
+   font-weight: bold;
+   font-size:90%;
+}
+
+.documentberry {
+  margin:0 2em 0 0;
+  padding:0;
+  visibility:hidden;
+}
+
+
+#doclist{
+  margin: 0;
+ 
+}
+
+.content{
+ font-family:sans-serif;
+ text-align:left;
+}
+
+li.berryitem {
+   padding: 0;
+   margin: 0 ;
+   color: black;
+   font-size: 90%;
+}
+
+li.berrydoc {
+  font-size: 90%;
+  cursor: pointer;
+  padding: 0 ;
+  margin: 0 1em 0 0; 
+}
+
+a.expandcontract {
+  font-size: 90%;
+  color: red
+}
+
+
+.item {
+  font-size: 90%;
+ 
+}
+
+a.fullview:visited{
+ color:red;
+}
+
+a#hideview:visited{
+ color:red;
+}
+
+a.fullview{
+  float:left;
+  font-size: 90%;
+  margin: 0 0 0 20px;
+  padding:0;
+  cursor: pointer;
+  color:red;  
+  text-decoration:none;
+ }
+
+a#hideView{
+  float:right;
+  font-size: 90%;
+  margin:0 20px 0 0;
+  padding:0;
+  color: red;
+  cursor: pointer;
+  text-decoration:none;
+}
+
+
+.berrydelete{
+   font-family:sans-serif;
+   background-color:#E0F0E0;
+   border:1px solid #2E8B57;   
+   padding: 4px  4px 4px 4px; 
+   font-weight: bold;
+   cursor: pointer;
+   width: 6em;
+   color: red;
+   font-size: 90%;
+}
+
+.sendbutton{
+   font-family:sans-serif;
+   background-color:#E0F0E0;
+   border:1px solid #2E8B57;   
+   padding: 4px  4px 4px 4px; 
+   font-weight: bold;
+   cursor: pointer;
+   width: 5em;
+   font-size: 90%;
+   margin: 1em 0 0 0;
+}
+
+.berrybutton{
+   font-family:sans-serif;
+   background-color:#E0F0E0;
+   border:1px solid #2E8B57;   
+   padding: 4px  4px 4px 4px; 
+   font-weight: bold;
+   cursor: pointer;
+   width: 10em;
+   font-size: 90%;
+}
+
+.mailinput {
+  border:1px solid #2E8B57; 
+  width: 20em;
+  height: 1.5em;
+  font-size: 90%
+}
+
+.mailitem{
+   text-align: left;
+ }
+
+
+textarea#pretextarea {
+  font-family:sans-serif;
+  border:1px solid #2E8B57; 
+  width: 100%;
+  height: 25em;
+  font-size: 90%;
+  margin: 0.5em 0 0 0;
+  padding:0;
+}
+
+div#trashbin{
+   float: right;
+   height: 60px;
+   width:  55px;
+   padding: 0;
+   background: url("../images/trash-empty.png") 0 0 no-repeat;
+   margin:0;
+   z-index:10;
+}
+
+div#binhandle{
+ height: 60px;
+ width:  55px;
+ cursor: move;
+}
+
+span.extralink {
+  cursor:pointer;
+  font-size:80%;
+  font-weight:bold;
+  margin:0 2em 0 0;
+  color:black;
+}
+
+span.extralink:hover {
+   color: #2E8B57;
+}
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/core.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/core.css	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/core.css	(revision 24007)
@@ -0,0 +1,1 @@
+body{padding:0;margin:0;font-family:sans-serif,arial,helvetica;background:#fff url('../images/chalk.gif') scroll repeat-y left top;color:#000}#page-wrapper{margin:.5em 3em 0 5em}a:link{color:#396}a:visited{color:#066}a:hover,a:active{color:#9c3}div#banner ul,ul#resultlist,ul#tocnodes,ul#docbuttons,ul.tocnode,ul#bannerlist,ul#navbarlist,ul#collectionlist,ul#servicelist,ul#classifierlist,ul#classifiernodelist,ul#queryitemlist{list-style-type:none;margin:0;padding:0}div#banner ul li,ul#bannerlist li,ul#navbarlist li{display:inline;margin:0;padding:0}ul li>select,ul li>input{padding:0;margin-left:5px}div#banner{margin:0;padding:0;overflow:hidden}div#banner p{margin:0;padding:0;float:left;font-size:16px;text-align:left;overflow:hidden}div#banner p a{background-image:url('../images/banner_bg.png');background-repeat:repeat-y}div#banner ul{margin:0;padding:0;float:right;font-size:12px}div#banner a{text-decoration:none;color:#000}ul#bannerlist li a{padding:0 10px 0 10px;text-decoration:none}ul#bannerlist li a:link,ul#bannerlist li a:visited{background-color:#dee79c;background-image:url('../images/bg_off.png');text-decoration:none}ul#bannerlist li a:hover{background-color:#ff6;background-image:url('../images/bg_on.png');text-decoration:none}div#navbar{clear:both}ul#navbarlist{margin:0;padding:0;list-style-type:none;text-align:center;width:100%;font-size:80%;background-image:url('../images/bg_green.png');background-color:#9c9}ul#navbarlist li a{padding:0 20px 0 20px;margin:0;color:#000;text-decoration:none}ul#navbarlist li a:link,ul#navbarlist li a:visited{background-image:url('../images/bg_off.png')}ul#navbarlist li a:hover{background-image:url('../images/bg_on.png')}ul#collectionlist li,ul#servicelist li{display:block;padding:0;margin:.2em 0 0 0;overflow:hidden}ul#collectionlist img{margin:0;padding:0;width:150px;height:45px;border:1px solid black;background-image:url('../images/collectimg_bg.png');background-repeat:repeat-y;overflow:hidden}ul#collectionlist li a.noimage{display:block;margin:0;width:145px;height:40px;border:1px solid black;background-image:url('../images/collectimg_bg.png');background-repeat:repeat-y;overflow:hidden;padding-left:5px;padding-right:0;padding-top:5px;padding-bottom:0}ul#collectionlist li a{font-size:16px;color:#000;text-decoration:none;font-weight:bold}ul#servicelist li a{margin:0 .5em 0 0}ul#queryitemlist li{display:block;margin:.2em 0 .2em 0}ul#classifierlist li{list-style:none;margin:0 0 5px 0;padding:0;display:block;color:#000}ul#classifierlist li#activeclassifier{font-weight:bold;padding:0 0 0 5px;margin:0 0 5px 0}ul#classifierlist li a:link,ul#classifierlist li a:visited{display:block;margin:0;background-image:url('../images/bg_off.png');text-decoration:none;color:#000;width:100%;padding-left:5px;padding-right:0;padding-top:2px;padding-bottom:2px}ul#classifierlist li a:hover,ul#classifierlist li a:active{display:block;margin:0;background-image:url('../images/bg_on.png');text-decoration:none;padding-left:5px;padding-right:0;padding-top:2px;padding-bottom:2px}ul#classifierlist{float:left;font-size:14px;text-align:left;width:15%;margin:0;padding:0}div#classifiers{float:left;width:75%;margin:0;padding:0 0 0 10px}ul#classifiernodelist li{list-style:none;margin:0;padding:5px 0 0 0;display:block}ul.childrenlist{margin:0;padding:0 0 0 20px;display:block;width:100%}div#content{clear:both;overflow:hidden;margin:.2em 0 0 0}div.divbar{clear:both;background-image:url('../images/bg_green.png');width:100%;text-align:center;font-size:80%}div.resultnavigation{margin:0;padding:0}ul#resultlist li{display:block}div.documenttext{clear:both}div#documentheading{font-size:16pt;font-weight:bold}div#documentinfo{float:left;padding:0;margin:0;width:24%}div#toc{float:left;text-align:left;width:60%;padding:0;margin:0}ul#docbuttons li{display:block;font-size:11px;font-weight:bold;background:#f7e7c5;margin:1px;border:1px solid #edb;text-align:center;vertical-align:middle;height:30px;width:110px}ul#tocnodes li{margin:0;padding:5px 0 0 0;display:block}ul.tocnode{margin:0;padding:5px 0 0 20px}ul.tocnode a{margin:0;padding:0 5px 0 0}span.bold{font-weight:bold}div.documentarrows{clear:both;margin:0;padding:1em 0 0 0}img.lessarrow{float:left;border:none}img.morearrow{float:right;border:none}div.formheading{font-size:16pt;font-weight:bold;margin:.5em 0 0;padding:0}ul#presprefs li,ul#berrybasketprefs li,ul#searchprefs li{display:block}div.phrasebrowse{text-align:center;padding:0;margin:.5em 0 .5em 0}div.QuickSearch{float:right}
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/core_whitespace.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/core_whitespace.css	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/style/core_whitespace.css	(revision 24007)
@@ -0,0 +1,376 @@
+
+body {
+  padding:0;
+  margin:0;
+  font-family: sans-serif, arial, helvetica;   
+  background: #fff url('../images/chalk.gif') scroll repeat-y left top;
+  color: #000000 
+}
+
+/* this contains everything - all the other divs */
+#page-wrapper {
+  margin: .5em 3em 0 5em;
+}
+
+a:link
+{
+color: #339966;
+}
+
+a:visited
+{
+color: #066;
+}
+
+a:hover, a:active
+{
+color: #99CC33;
+}
+
+div#banner ul, ul#resultlist, ul#tocnodes, ul#docbuttons, ul.tocnode, ul#bannerlist, ul#navbarlist, ul#collectionlist, ul#servicelist, ul#classifierlist, ul#classifiernodelist, ul#queryitemlist{
+  list-style-type:none;
+  margin:0;
+  padding:0;
+}
+
+div#banner ul li, ul#bannerlist li, ul#navbarlist li {
+  display: inline;
+  margin:0;
+  padding:0;	
+}
+
+
+ul li>select, ul li>input {
+  padding: 0;
+  margin-left:5px;
+}
+
+
+div#banner {
+  margin: 0;
+  padding:0;
+  overflow: hidden;
+}
+
+div#banner p {
+  margin:0;
+  padding: 0;
+  float:left;
+  font-size: 16px;
+  text-align: left;
+  overflow:hidden	
+}
+
+div#banner p a {
+  background-image: url('../images/banner_bg.png');
+  background-repeat: repeat-y;
+}
+
+
+div#banner ul{
+  margin:0;
+  padding:0; 
+  float:right; 
+  font-size: 12px;  
+}
+
+div#banner a{
+  text-decoration: none;
+  color:#000000;
+}
+
+
+ul#bannerlist li a {
+  padding: 0 10px 0 10px; 
+  text-decoration: none;
+}
+
+ul#bannerlist li a:link, ul#bannerlist li a:visited
+{
+ background-color: #DEE79C;
+ background-image: url('../images/bg_off.png');
+ text-decoration: none
+}
+
+ul#bannerlist li a:hover{
+ background-color: #FFFF66;
+ background-image: url('../images/bg_on.png') ;
+ text-decoration: none
+}
+
+
+div#navbar{
+  clear:both;
+}
+
+ul#navbarlist{
+  margin:0;
+  padding:0; 
+  list-style-type: none; 
+  text-align:center;
+  width: 100%;
+  font-size: 80%;
+  background-image: url('../images/bg_green.png');	  
+  background-color: #99CC99
+ }
+
+ul#navbarlist li a {
+  padding: 0 20px 0 20px; 
+  margin: 0;
+  color: #000000; 
+  text-decoration: none;
+}
+
+ul#navbarlist li a:link, ul#navbarlist li a:visited{
+   background-image: url('../images/bg_off.png') ;
+ }
+
+ul#navbarlist li a:hover{
+  background-image: url('../images/bg_on.png') ;
+}
+
+
+ul#collectionlist li, ul#servicelist li{
+  display:block;
+  padding:0;
+  margin: .2em 0 0 0;
+  overflow:hidden;
+}
+
+
+ul#collectionlist img{
+  margin:0;
+  padding:0;
+  width: 150px;
+  height: 45px;
+  border: 1px solid black;
+  background-image: url('../images/collectimg_bg.png');
+  background-repeat: repeat-y;
+  overflow:hidden
+}
+
+ul#collectionlist li a.noimage{
+  display: block;
+  margin:0;
+  width: 145px;
+  height: 40px;
+  border: 1px solid black;
+  background-image: url('../images/collectimg_bg.png');
+  background-repeat: repeat-y;
+  overflow:hidden; padding-left:5px; padding-right:0; padding-top:5px; padding-bottom:0
+
+}
+
+ul#collectionlist li a{
+  font-size: 16px;
+  color: #000000;
+  text-decoration: none;  
+  font-weight: bold;
+}
+
+ul#servicelist li a{
+  margin:0 .5em 0 0;
+}
+
+ul#queryitemlist li{
+  display:block;
+  margin: .2em 0 .2em 0;
+}
+
+ul#classifierlist li{
+  list-style: none;
+  margin: 0 0 5px 0;
+  padding: 0;
+  display: block;
+  color:#000;
+}
+
+ul#classifierlist li#activeclassifier{
+  font-weight:bold;
+  padding: 0 0 0 5px;
+  margin:0 0 5px 0;
+}
+
+ ul#classifierlist li a:link, ul#classifierlist li a:visited  
+{
+   display:block;
+   margin:0;
+   background-image: url('../images/bg_off.png');
+   text-decoration: none; 
+   color:#000;
+   width:100%; padding-left:5px; padding-right:0; padding-top:2px; padding-bottom:2px
+ } 
+
+ul#classifierlist li a:hover, ul#classifierlist li a:active
+{
+  display:block;
+  margin:0;
+  background-image: url('../images/bg_on.png');
+  text-decoration: none; padding-left:5px; padding-right:0; padding-top:2px; padding-bottom:2px
+  
+}
+
+ul#classifierlist{
+   float:left;
+   font-size: 14px;
+   text-align: left;
+   width: 15%;
+   margin:0;
+   padding:0;
+}
+
+div#classifiers{
+  float:left;
+  width: 75%;
+  margin:0;
+  padding:0 0 0 10px;
+ }
+
+ul#classifiernodelist li{
+  list-style: none;
+  margin: 0;
+  padding: 5px 0 0 0;
+  display: block;
+ }
+
+ul.childrenlist{
+  margin: 0 0 0 0;
+  padding: 0 0 0 20px;
+  display: block;
+  width: 100%;
+}
+
+div#content{
+ clear: both;
+ overflow: hidden;
+ margin: .2em 0 0 0;
+}
+
+/* bg image set in style macro */
+div.divbar { 
+  clear: both; 
+  background-image: url('../images/bg_green.png'); 
+  width: 100%; 
+  text-align: center;
+  font-size:80%
+}
+
+
+/** query form style**/
+div#queryform{
+
+}
+
+/** search result style */
+div#terminfo{
+
+}
+
+div#matchdocs{
+
+}
+
+div.resultnavigation{
+ margin: 0;
+ padding:0;
+}
+
+ul#resultlist li{
+  display:block;
+}
+
+
+div.documenttext { clear: both; } /* come after any floating divs */
+
+div#documentheading{
+  font-size: 16pt;
+  font-weight: bold;
+}
+
+div#documentinfo { 
+  float:left;
+  padding:0;
+  margin:0;
+  width:24%;
+} 
+
+div#toc{
+  float:left;
+  text-align:left;
+  width:60%;
+  padding:0;
+  margin:0; 
+}
+
+ul#docbuttons li {
+   display: block;
+  font-size: 11px;
+  font-weight: bold;
+  background: #f7e7c5;
+  margin: 1px;
+  border: 1px solid #eeddbb;
+  text-align: center;
+  vertical-align: middle;
+  height: 30px; /* IE6 and NS4 treat width/height as min-width/min-height */
+  width: 110px;
+}
+
+
+ul#tocnodes li{
+ margin: 0;
+ padding: 5px 0 0 0;
+ display:block;
+}
+
+ul.tocnode {
+  margin:0;
+  padding:5px 0 0 20px;
+}
+
+ul.tocnode  a{
+ margin: 0;
+ padding:0 5px 0 0;
+ }
+
+span.bold{
+  font-weight: bold;	   
+}
+
+div.documentarrows{
+  clear: both; 
+  margin: 0 0 0 0;
+  padding: 1em 0 0 0;   
+}
+
+img.lessarrow{
+  float:left;
+  border: none;  
+}
+
+img.morearrow{
+  float:right;
+  border:none; 
+}
+
+div.formheading{
+  font-size: 16pt;
+  font-weight: bold;
+  margin: .5em 0 0;
+  padding:0;
+}
+
+ul#presprefs li, ul#berrybasketprefs li, ul#searchprefs li{
+  display: block;
+} 
+
+
+div.phrasebrowse{
+  text-align:center;
+  padding:0;
+  margin: .5em 0 .5em 0;   
+}
+
+div.QuickSearch {
+  float: right;
+}
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/about.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/about.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/about.xsl	(revision 24007)
@@ -0,0 +1,77 @@
+<?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">
+
+  
+  <xsl:template match="page">
+    
+    <!-- the page layout template is here -->
+    <html>
+      <head>
+	<title>
+	  <gslib:aboutCollectionPageTitle/>
+	</title>
+	<link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
+      </head>
+      
+      <body><gslib:textDirectionAttribute/>
+
+	<div id="page-wrapper">
+	  <gslib:displayErrorsIfAny/>
+
+	  <div id="banner">    
+	    <p>
+	      <gslib:collectionHomeLinkWithLogoIfAvailable/>
+	    </p>
+	    <ul id="bannerlist"> 
+	      <li><gslib:homeButtonTop/></li>
+	      <li><gslib:helpButtonTop/></li>
+	      <li><gslib:preferencesButtonTop/></li>
+	    </ul>
+	  </div>
+	  
+	  <!--If some services are available for the current collection display the navigation bar-->
+	  <xsl:choose>
+	    <xsl:when test="$this-element/serviceList/service">
+	      <div id="navbar">
+		<ul id="navbarlist">
+		  <gslib:servicesNavigationBar/>
+		</ul>
+	      </div> 
+	    </xsl:when>
+	    <!--Otherwise simply display a blank divider bar-->
+	    <xsl:otherwise>
+	      <div class="divbar"><gslib:noTextBar/></div>          
+	    </xsl:otherwise>
+	  </xsl:choose>
+	  
+	  <div id="content"> 
+	    <!--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.-->
+	    <gslib:collectionDescriptionTextAndServicesLinks/>
+	  </div>
+
+	  <div id="footer">
+	    <div class="divbar"><gslib:poweredByGS3TextBar/></div>
+	  </div>
+	</div>
+	
+		<script type="text/javascript" src="jquery.js">
+			<xsl:comment>Filler for browser</xsl:comment>
+		</script>
+		<script type="text/javascript" src="test.js">
+			<xsl:comment>Filler for browser</xsl:comment>
+		</script>
+      </body>
+    </html>
+  </xsl:template>
+
+
+</xsl:stylesheet>  
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/applet.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/applet.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/applet.xsl	(revision 24007)
@@ -0,0 +1,56 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  
+  <xsl:output method="html"/>  
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="pageResponse/service/applet"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="../pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+    <div class="phrasebrowse">
+      <xsl:copy-of select="service/applet"/>
+    </div>
+  </xsl:template>
+</xsl:stylesheet>  
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/authen.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/authen.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/authen.xsl	(revision 24007)
@@ -0,0 +1,654 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+
+  <xsl:output method="html"/> 
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/>
+  </xsl:template>
+
+  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+  <xsl:template name="pageHead">
+    <head>
+      <title>
+	<xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+      </title>
+      <xsl:call-template name="globalStyle"/>
+      <xsl:call-template name="pageStyle"/>
+    </head>
+  </xsl:template>
+
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="page">
+    <html>
+      <xsl:call-template name="pageHead" />
+      <xsl:call-template name="addGroup" />
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+ 	  <xsl:variable name="authen_service" select="/page/pageRequest/paramList/param[@name='s']/@value"/>
+	  <xsl:variable name="sub_action" select="/page/pageRequest/@subaction"/>
+	  <xsl:variable name="asn_param" select ="/page/pageRequest/paramList/param[@name='s1.asn']/@value"/>
+	  <xsl:variable name="uan" select ="/page/pageRequest/paramList/param[@name='s1.uan']/@value"/>
+	  <xsl:variable name="pro_action" select ="/page/pageResponse/authenticationNode/service/@aup"/>
+	  <xsl:variable name="au_node" select ="/page/pageResponse/authenticationNode"/>
+	  <xsl:variable name="asn" select ="/page/pageResponse/authenticationNode/service/@asn"/>
+	  <xsl:variable name="info" select ="/page/pageResponse/authenticationNode/service/@info"/>
+	  <xsl:variable name="err" select ="/page/pageResponse/authenticationNode/service/@err"/>
+	  <xsl:variable name="rt" select="/page/pageRequest/paramList/param[@name='rt']/@value"/>
+	  <xsl:variable name="un_s" select="/page/pageResponse/authenticationNode/service/@un"/>
+	  <xsl:variable name="pw_s" select="/page/pageResponse/authenticationNode/service/@pw"/>
+	  
+	  <div align="left" >
+	    <table align="left" border="0" width="100%">
+	      <tr align="left">
+		<td><h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/></h2></td>
+		<td><xsl:if test="$un_s!=''">
+		    <xsl:if test="$asn!='' and $asn!='0'">
+		      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>  :  <xsl:value-of select="$un_s"/>
+		    </xsl:if>
+		  </xsl:if></td>
+	      </tr>
+	    </table>
+	  </div>
+
+	  <div id="navbar">
+	    <ul id="navbarlist">
+	      <!--greenstone home-->
+	      <li><a href="{$library_name}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.greenstone_home')"/></a></li>
+	      
+	      <!--list users-->
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ListUsers&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose></li>
+	      
+	      <!--add a new user-->
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=AddUser&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umun=&amp;s1.umpw=&amp;s1.umgp=&amp;s1.umas=&amp;s1.umc="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a> 
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </li>
+	      
+	      <!-- change password-->
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ModifyPassword&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umpw1=&amp;s1.umpw2=&amp;s1.umpw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </li>
+
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$un_s!='' and $asn!='' and $asn!='0'">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login&amp;s1.un=&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.logout')"/></a>
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </li>
+	    </ul>
+	  </div>
+
+	  <table align="left" border="0" width="100%">
+	    <tr>
+	      <td>
+		<div id="content" align="center">
+		  <!-- login -->
+		  <xsl:if test="$pro_action='Login'">
+		    <xsl:choose>
+		      <xsl:when test="$asn!='' and $asn!='0'">
+			<p align="left"> <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_successfully')"/></p>
+		      </xsl:when>
+		      <xsl:otherwise>
+
+			<p align="left">
+			  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_3')"/><br/></p>
+			<xsl:if test="$err='un-pw-err'">
+			  <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.wrong_password_warning')"/></font></p>
+			</xsl:if>
+			<xsl:if test="$err='no-permission' and $info='Login'">
+			  <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+			</xsl:if>
+			<xsl:if test="$err='as-false'">
+			  <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status_false')"/></font></p>
+			</xsl:if>
+			<xsl:call-template name="login">
+			  <xsl:with-param name="sub_action" select="$sub_action"/>
+			  <xsl:with-param name="authen_service" select="$authen_service"/>
+			  <xsl:with-param name="pro_action" select="$pro_action"/>	
+			</xsl:call-template>
+
+		      </xsl:otherwise>
+		    </xsl:choose>
+		  </xsl:if>
+
+		  <!-- list users-->
+		  <xsl:if test="$pro_action='ListUsers'">
+		    
+		    <xsl:if test="$asn='1' and $info='all-un'">
+		      <xsl:call-template name="listusers" >
+		      </xsl:call-template>
+		    </xsl:if>
+
+		    <xsl:if test="$info='Login'">
+		      <p align="left">
+			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/></p>
+		      <xsl:if test="$err='no-permission' and $info='Login'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+		      </xsl:if>
+		    </xsl:if>
+		  </xsl:if>
+		  
+		  <!-- add a new user-->
+		  <xsl:if test="$pro_action='AddUser'"> 
+		    <xsl:if test="$err!='' and $err!='no-permission' and $err!='un-exist' and $err!='un-err' and $err!='pw-err'">
+		      <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$asn!='1'">
+		      <p align="left">
+			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/>
+		      </p>
+		      <xsl:if test="$err='no-permission'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+		      </xsl:if>
+		    </xsl:if>
+		    
+		    <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
+		      <xsl:call-template name="listusers" >
+		      </xsl:call-template>
+		    </xsl:if>
+		    
+		    <xsl:if test="$info='adduser_interface'">
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user_title')"/></h2>
+		      <xsl:if test="$err='pw-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
+		      </xsl:if>	
+		      <xsl:if test="$err='un-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
+		      </xsl:if>	
+		      <xsl:if test="$err='un-exist'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
+		      </xsl:if>
+		      <xsl:call-template name="edituser" >
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="umun_s" />
+			<xsl:with-param name="umpw_s" />
+			<xsl:with-param name="umas_s" />
+			<xsl:with-param name="umgp_s" />
+			<xsl:with-param name="umc_s" />
+			<xsl:with-param name="oumun_s" />
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="pw_s" select="$pw_s"/>
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+
+		    </xsl:if> 
+		  </xsl:if>
+		  
+		  <!-- modify the passwrod of a user-->
+		  <xsl:if test="$pro_action='ModifyPassword'">
+		    
+		    <xsl:if test="$err!='' and $err!='umpw1-err' and $err!='umpw2-err' and $err!='pw-umpw-nm-err' and $err!='umpw-null-err' and $err!='umpw1-umpw2-nm-err' and $err!='umpw1-umpw2-null-err'"><p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$err=''">
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
+		      <p align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_successed_content')"/></p>
+		    </xsl:if>
+		    
+		    <xsl:if test="$asn!='0' and $info='modify_interface'">
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
+		      <p align="left"><font color="grey"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_describe_line_1')"/></font></p>
+
+		      <xsl:if test="$err='umpw1-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password_invalid')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='umpw2-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retyped_password_invalid')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='pw-umpw-nm-err' or $err='umpw-null-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password_warning')"/></font></p>
+		      </xsl:if>  
+		      <xsl:if test="$err='umpw1-umpw2-nm-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.two_password_not_match')"/></font></p>
+		      </xsl:if> 
+		      <xsl:if test="$err='umpw1-umpw2-null-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_empty_warning')"/></font></p>
+		      </xsl:if> 
+		      
+		      <xsl:call-template name="modifypassword">
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="pw_s" select="$pw_s"/>
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+		    </xsl:if>
+		  </xsl:if> 
+
+		  <!-- delete a user -->
+		  <xsl:if test="$pro_action='DeleteUser'"> 
+		    <xsl:if test="$err!=''">
+		      <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$info='confirm'">
+		      <xsl:call-template name="deleteuser"> 
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="umun_s" select="/page/pageResponse/authenticationNode/service/@umun"/>	
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+		    </xsl:if>
+		    <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
+		      <xsl:call-template name="listusers" >
+		      </xsl:call-template>
+		    </xsl:if>
+		  </xsl:if>
+		  
+		  <!-- edit the user's info -->
+		  <xsl:if test="$pro_action='EditUser'"> 
+		    <xsl:if test="$err!='' and $err!='umpw-err' and $err!='umun-err' and $err!='ini-umpw-err' and $err!='un-exist'">
+		      <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$info='edituser-interface'"> 
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.edit_user_information')"/></h2>
+		      <xsl:if test="$err='umpw-err'"> 
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='umun-err'"> 
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='ini-umpw-err'"> 
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_initial')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='un-exist'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
+		      </xsl:if>
+		      <xsl:call-template name="edituser" >
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="umun_s" select="/page/pageResponse/authenticationNode/service/@umun"/>
+			<xsl:with-param name="umpw_s" select="/page/pageResponse/authenticationNode/service/@umpw"/>
+			<xsl:with-param name="umas_s" select="/page/pageResponse/authenticationNode/service/@umas"/>
+			<xsl:with-param name="umgp_s" select="/page/pageResponse/authenticationNode/service/@umgp"/>
+			<xsl:with-param name="umc_s" select="/page/pageResponse/authenticationNode/service/@umc"/>
+			<xsl:with-param name="oumun_s" select="/page/pageResponse/authenticationNode/service/@oumun"/>
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="pw_s" select="$pw_s"/>
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+		    </xsl:if> 
+		    <xsl:if test="$info='all-un'">
+		      <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
+			<xsl:call-template name="listusers" >
+			</xsl:call-template>
+		      </xsl:if>
+		    </xsl:if>
+		  </xsl:if>
+		  
+		</div>
+	      </td>
+	    </tr>
+	  </table>
+	  <div id="navbar">	  
+	    <xsl:call-template name="greenstoneFooter" />
+	  </div>	  
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <!--template name="login"-->
+  <xsl:template name="login">
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <div>
+      <form id="LoginForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.asn' value='0'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	<input type='hidden' name='s1.umpw1' value=''/>
+	<input type='hidden' name='s1.umpw2' value=''/>
+	<input type='hidden' name='s1.umc' value=''/>
+	<input type='hidden' name='s1.umgp' value=''/>
+	<input type='hidden' name='s1.umun' value=''/>
+	<input type='hidden' name='s1.umpw' value=''/>
+	<input type='hidden' name='s1.umas' value=''/>
+
+	<table align="center">
+	  <tr>
+	    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="string" name="s1.un" size="10" value=""/></td><td></td>
+	  </tr>
+	  <tr>
+	    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.pw" size="10" value=""/></td><td>
+	      <input type="submit" value="submit"></input></td>
+	  </tr>
+	</table>
+      </form>
+    </div>
+  </xsl:template>
+
+  <!--template name="listusers"-->
+  <xsl:template name="listusers" >
+    <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></h2>
+
+    <table id='mainTable' align="left" border="0" cellspacing="1" cellpadding="3" width="100%" >
+      <tr>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></th>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></th>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></th>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></th>
+	<th bgcolor="#d0d0d0"></th>
+      </tr>
+      <xsl:for-each select="/page/pageResponse/authenticationNode/service/userNodeList/userNode">
+	<tr>
+	  <td bgcolor="#eeeeee"><xsl:value-of select="@umun"/></td>
+	  <td id="status" bgcolor="#eeeeee">
+	    <script type="text/javascript">
+	      <xsl:text disable-output-escaping="yes">
+		var status="</xsl:text><xsl:value-of select="@umas"/><xsl:text disable-output-escaping="yes">";
+		if (status=="true"){
+		  document.getElementById("status").innerHTML="enabled";
+		}
+		if (status=="false"){
+		  document.getElementById("status").innerHTML="disabled";
+		}
+	      </xsl:text>		 
+	    </script>
+	  </td>
+	  <td id="group" bgcolor="#eeeeee">
+	    <script type="text/javascript">
+	      <xsl:text disable-output-escaping="yes">
+		var groups="</xsl:text><xsl:value-of select="@umgp"/><xsl:text disable-output-escaping="yes">";
+		var split_groups= groups.split(",");
+		var new_groups="";
+		for (j=0; j &lt; split_groups.length ; j++){
+		  new_groups+=split_groups[j]+" &lt;br /&gt; ";
+		}
+		document.getElementById('group').innerHTML=new_groups;
+	      </xsl:text>		 
+	    </script>
+	  </td>
+	  <td bgcolor="#eeeeee"><xsl:value-of select="@umc"/></td>
+	  <td bgcolor="#eeeeee">
+	    <form name="ListUsersForm" method="get" action="{$library_name}">
+	      <input type='hidden' name='a' value='g'/>
+	      <input type='hidden' name='sa' value='authen'/>
+	      <input type='hidden' name='s' value='Authentication'/>
+	      <input type='hidden' name='rt' value='r'/>
+	      <input type='hidden' name='s1.asn' value='1'/>
+	      <input type='hidden' name='s1.uan' value='1'/>
+
+	      <input type='hidden'><xsl:attribute name="name">s1.oumun</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@umun"/></xsl:attribute></input>
+	      <input type='hidden'><xsl:attribute name="name">s1.umun</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@umun"/></xsl:attribute></input>
+	      <input type='hidden' name='s1.cm' value=''/>
+
+	      <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">EditUser</xsl:attribute></input>
+	      <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">DeleteUser</xsl:attribute></input>
+	    </form>
+	  </td>
+	</tr>
+      </xsl:for-each>
+    </table>
+  </xsl:template>
+
+  <!--template name="modifypassword"-->
+  <xsl:template name="modifypassword" >
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <xsl:param name="un_s"/>
+    <xsl:param name="pw_s"/>
+    <xsl:param name="asn"/>
+    <div>
+      <form id="modifyForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.un' value='{$un_s}'/>
+	<input type='hidden' name='s1.pw' value='{$pw_s}'/>
+	<input type='hidden' name='s1.asn' value='{$asn}'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	
+	<table align="center"><tr><td align="right">
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/></td><td><input type="password" name="s1.umpw" size="10" value=""/></td></tr>
+	  <tr><td align="right">
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/></td><td><input type="password" name="s1.umpw1" size="10" value=""/></td></tr>
+	  <tr><td align="right">
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_new_password')"/></td><td><input type="password" name="s1.umpw2" size="10" value=""/></td></tr>
+	  <tr><td></td><td>
+	      <input type="submit" value="submit"></input></td>
+	  </tr>
+	</table>
+      </form>
+    </div>
+  </xsl:template>
+
+  <!--template name="deleteuser"-->
+  <xsl:template name="deleteuser">
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <xsl:param name="un_s"/>
+    <xsl:param name="umun_s"/>
+    <xsl:param name="asn"/>
+    <div >
+      <form id="deleteForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	<input type='hidden' name='s1.asn' value='{$asn}'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.umun' value='{$umun_s}'/>
+	<p><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.do_you_really_want_to_permanently_remove_user')"/> <xsl:value-of select="$umun_s"/>" ?</font></p>
+	<input type="submit" value="yes"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+	<input type="submit" value="no"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+      </form>
+    </div>
+  </xsl:template>
+  
+  <!--template name="edituser"-->
+  <xsl:template name="edituser" >
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <xsl:param name="un_s"/>
+    <xsl:param name="pw_s"/>
+    <xsl:param name="umun_s"/>
+    <xsl:param name="umpw_s"/>
+    <xsl:param name="umas_s"/>
+    <xsl:param name="umgp_s"/>
+    <xsl:param name="umc_s"/>
+    <xsl:param name="oumun_s"/>	
+    <xsl:param name="asn"/>
+    <div>
+      <form id="editForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.asn' value='{$asn}'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	<input type='hidden' name='s1.un' value='{$un_s}'/>
+	<input type='hidden' name='s1.pw' value='{$pw_s}'/>
+	
+	<table align="left" ><tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="text" name="s1.umun" size="15" value="{$umun_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username_describe')"/></font></td></tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.umpw" size="15" value="{$umpw_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_describe')"/></font></td></tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></td><td>	
+	      <select name="s1.umas">
+		<xsl:if test="$umas_s=''">
+		  <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
+		  <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		</xsl:if> 
+		<xsl:if test="$umas_s='true'">
+		  <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
+		  <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		</xsl:if> 
+		<xsl:if test="$umas_s='false'">
+		  <option value="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
+		  <option value="false" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		</xsl:if> 
+	      </select></td><td></td></tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></td><td><input type="text" id="group" name="s1.umgp" size="70" value="{$umgp_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups_describe')"/></font></td></tr>
+	  <tr>
+	    <td></td>
+	    <td  align="right"> <select id="groups" size="0">
+		<script type="text/javascript">
+		  <xsl:text disable-output-escaping="yes">
+		    var group_arr=Array("administrator","all-collections-editor","personal-collections-editor");
+		    var group_string=document.getElementById("group").value;
+		    var split_group_string=group_string.split(",");
+		    var find=0;
+		    for (i=0; i &lt; group_arr.length; i++){
+		      find=0;
+		      for (j=0; j &lt; group_arr.length; j++){
+		        if (split_group_string[j]==group_arr[i]){
+		          find=1;
+		        }
+		      }
+		      if (find==0){
+		        op = document.createElement('option');
+		        op.innerHTML = group_arr[i];
+		        op.setAttribute("value", group_arr[i]);
+		        document.getElementById("groups").appendChild(op);
+		      }
+	            }
+		    
+		  </xsl:text>		 
+		</script>
+	      </select></td><td><input type="button" name="addGroupButton" value="add" onClick="addGroup('groups')"/></td>
+	  </tr>
+	  <tr>
+	    <td></td>
+	    <td  align="right"> 
+	      <select  id="collects" size="0">
+		<xsl:for-each select="/page/pageResponse/collectionList/collection">
+		  <script type="text/javascript">
+		    <xsl:text disable-output-escaping="yes">
+		      var group="</xsl:text><xsl:value-of select="@name"/>-collection-editor<xsl:text disable-output-escaping="yes">";
+		      var group_string=document.getElementById("group").value;
+		      var split_group_string=group_string.split(",");
+		      var find=0;
+		      for (i=0; i &lt; split_group_string.length; i++){
+		        if (split_group_string[i]==group){
+		          find=1;
+		        }
+		      }
+		      if (find==0){
+		        op = document.createElement('option');
+		        op.innerHTML = group;
+		        op.setAttribute("value", group);
+		        document.getElementById("collects").appendChild(op);
+		      }
+		    </xsl:text>		 
+		  </script>
+		</xsl:for-each>
+	      </select>
+	    </td>
+	    <td><input type="button" name="addGroupButton" value="add" onClick="addGroup('collects')"/></td>
+	  </tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></td><td colspan="2"><div><textarea cols="40" rows="5" name="s1.umc"><xsl:value-of select="$umc_s"/>
+
+		</textarea></div></td></tr> 
+	  <tr>
+
+	    <td></td><td>
+	      <input type="submit" value="submit"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+	      <xsl:if test="$pro_action!='AddUser'">
+		<input type="submit" value="cancel"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+	      </xsl:if>
+	    </td><td></td></tr>
+	</table>
+	<input type='hidden' name='s1.oumun' value='{$oumun_s}'/>
+      </form>
+    </div>
+  </xsl:template>
+
+  <!-- addGroup() javascript -->
+  <xsl:template name="addGroup">
+    <script type="text/javascript">
+      <xsl:text disable-output-escaping="yes">
+	function addGroup(g){
+	  var itemSelected;
+	  var splitGroup;
+	  var groupExit;
+
+	  if (document.getElementById("editForm")!=null){
+	    //itemSelected=document.getElementById("editForm").groups.options.selectedIndex;
+	    itemSelected=document.getElementById(g).options.selectedIndex;
+	    if (document.getElementById(g).options[itemSelected].text!=""){
+	      if (document.getElementById("group").value==""){
+	        document.getElementById("group").value=document.getElementById("group").value+document.getElementById(g).options[itemSelected].text;
+	      }else{
+	        splitGroup=document.getElementById("group").value.split(",");
+	        for (var i=0; i &lt; splitGroup.length; i++){
+	          if (splitGroup[i]==document.getElementById(g).options[itemSelected].text){
+	            alert(document.getElementById(g).options[itemSelected].text + " has been added.");
+	            groupExit=1;
+	            break;
+	          }
+	        }
+	        if (groupExit!=1) {
+	          document.getElementById("group").value=document.getElementById("group").value+","+document.getElementById(g).options[itemSelected].text;
+	        }
+	      }
+	      document.getElementById(g).options[itemSelected]=new Option("",itemSelected);
+	    }
+	  }
+	}
+      </xsl:text>
+    </script>    
+  </xsl:template>
+  
+</xsl:stylesheet>  
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/berry.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/berry.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/berry.xsl	(revision 24007)
@@ -0,0 +1,748 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!--<xsl:include href="style.xsl"/>-->
+  <xsl:include href="service-params.xsl"/>
+  <xsl:include href="berrytools.xsl"/>
+
+  <xsl:output method="html"/>  
+
+  <xsl:param name="library_name"/>
+  
+   <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <xsl:call-template name="pageHead"/>	 
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:apply-templates select="pageResponse"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+  <xsl:template name="pageHead">
+    <head>
+      <title>
+	<xsl:call-template name="pageTitle"/>
+      </title>
+      <xsl:call-template name="pageStyle"/>
+    </head>
+  </xsl:template>
+  
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="/page/pageResponse/serviceCluster/metadataList/metadata[@name='Title']"/>
+    Berry Basket
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle" >
+    <xsl:call-template name="styleSheet" />
+    <xsl:call-template name="loadLibrary" />
+    <xsl:call-template name="buildContent" />   
+    <!-- <xsl:call-template name="showMailBox" />-->
+  </xsl:template>    
+  
+  <xsl:template match="pageResponse">
+    <xsl:variable name="clusterName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:call-template name="berryPageBanner" />
+    <xsl:apply-templates select="paramList"/>
+    <div id="content" ><span></span></div> 
+    <xsl:call-template name="footBanner" />
+  </xsl:template>
+  
+
+  <xsl:template match="collection">
+    <xsl:for-each select="item">
+      <xsl:text disable-output-escaping="yes">
+	var  doc = new Array();             
+      </xsl:text>
+      <xsl:for-each select="@*">
+	<xsl:text disable-output-escaping="yes">
+	  doc["</xsl:text><xsl:value-of select="name()" /><xsl:text disable-output-escaping="yes">"]='</xsl:text><xsl:value-of select="." /><xsl:text disable-output-escaping="yes">'; </xsl:text>   
+      </xsl:for-each>
+      <xsl:text disable-output-escaping="yes"> 
+	docList[docList.length] = doc; 
+      </xsl:text>  
+    </xsl:for-each>     
+  </xsl:template>
+  
+  
+  <xsl:template name="buildContent">
+    <script type="text/javascript">
+      <xsl:text disable-output-escaping="yes">
+	var previousView;
+	var docList = new Array();
+	var urlonly = false;
+	var mailinfo = new Array();
+	mailinfo['address'] = "To: ";
+	mailinfo['cc'] = "CC: ";
+	mailinfo['bcc'] = "Bcc: ";
+	mailinfo['subject'] = "Subject: "; 
+	var textwin;
+	var mailwin;
+      </xsl:text>
+      <xsl:apply-templates select="/page/pageResponse/collection" />       
+      
+      <xsl:text disable-output-escaping="yes">
+    
+       function navigate(e){   
+             var target = e.target;
+       
+	     if (target.id.toLowerCase() == 'fullview'){  
+                  showFullView();
+              }
+
+             if (target.id.toLowerCase() == 'textview'){       
+               showTextView();
+             }
+
+             if (target.id.toLowerCase() == 'email'){       
+               showEmail();
+            }
+
+            if (target.id.toLowerCase() == 'sendmail'){       
+               sendMail();
+            }
+            
+           
+
+            if (target.id.toLowerCase() == 'urlcheck' &amp;&amp; urlonly){
+               var urlcheck = YAHOO.util.Dom.get('urlcheck');
+               urlcheck.src = 'interfaces/default/images/check3.gif';              
+               var parea  =YAHOO.util.Dom.get('pretextarea');       
+               urlonly = false;
+               populateUrlsAndMetadata(parea);
+               return;
+               
+            }
+
+            if (target.id.toLowerCase() == 'urlcheck' &amp;&amp; !urlonly ){ 
+                var urlcheck = YAHOO.util.Dom.get('urlcheck');
+                urlcheck.src = 'interfaces/default/images/check4.gif';                       
+                var parea  =YAHOO.util.Dom.get('pretextarea');
+                populateUrls(parea);        
+                urlonly = true;
+                return;
+             } 
+
+            if (target.id.toLowerCase() == 'extextview' ){
+               if (textwin != null){
+                   textwin.close();
+               }
+
+               textwin = window.open("","Berry basket plain text view","status=1,width=450,height=300");
+               textwin.moveTo(0,0);
+               var content = document.createElement('div');
+                buildPreview(content);
+                var body = textwin.document.getElementsByTagName('body')[0]; 
+                body.appendChild(content);
+                var prearea =  textwin.document.getElementsByTagName('textarea')[0];
+                prearea.cols = '55';
+                prearea.rows = '15';        
+             }
+
+             if (target.id.toLowerCase() == 'exemail' ){
+               if (mailwin != null){
+                   mailwin.close();
+               }
+               mailwin = window.open("","Berry basket mail to a friend","status=1,width=450,height=350");
+               mailwin.moveTo(0,0);
+               var content = document.createElement('div');
+               getEmailContent(content);
+               var body = mailwin.document.getElementsByTagName('body')[0]; 
+               body.appendChild(content);           
+                var prearea =  mailwin.document.getElementsByTagName('textarea')[0];
+                prearea.cols = '50';
+                prearea.rows = '11'; 
+             }
+              
+        }
+
+        function showFullView(){
+          
+             var content =  YAHOO.util.Dom.get('content'); 
+             var fullview =  YAHOO.util.Dom.get('fullview');
+
+              if (previousView != null){
+                 previousView.style.backgroundImage =  'url("interfaces/default/images/bg_on.png")'; 
+              } 
+              previousView = fullview;
+              previousView.style.backgroundImage =  'url("interfaces/default/images/bg_green.png")';
+
+               while (content.hasChildNodes()) {
+		 content.removeChild(content.firstChild);
+	       }                        
+           
+             if (docList.length == 0){
+                 content.appendChild(document.createTextNode("Your berry basket is empty."));
+                 return;
+              }
+
+ 
+            var trashbin = document.createElement('div');
+            trashbin.id ='trashbin';   
+            var binhandle = document.createElement('div');
+            binhandle.id = 'binhandle';   
+            binhandle.appendChild(document.createElement('span'));          
+            trashbin.appendChild(binhandle) 
+
+            content.appendChild(trashbin);
+
+            var dd = new ygDDOnTop('trashbin');
+            dd.setHandleElId('binhandle');      
+            new YAHOO.util.DDTarget('trashbin','trash');
+        
+            var dlist = document.createElement('div');
+            content.appendChild(dlist);                          
+            var ol =   document.createElement('ol');            
+            dlist.appendChild(ol); 
+
+             for (var i in docList){
+               var doc = docList[i];
+               var li = document.createElement('li'); 
+               var a = document.createElement('a'); 
+               var text ="";
+               a.href ="?a=d&amp;c="+doc['collection']+"&amp;d="+doc['name'];
+               a.appendChild(document.createTextNode(doc['title'])); 
+                if (doc['root_title'] != ""){
+                     li.appendChild(document.createTextNode(doc['root_title']+": ")); 
+                   }               
+               li.appendChild(a);
+               var metadata = "";
+               for (var metaItem in doc &amp;&amp; metaItem != 'title'){
+                    metadata = "\n"+metaItem+": "+ doc[metaItem]+"\n";
+               }
+               text +=metadata+"\n";
+               li.appendChild(document.createTextNode(text));
+               li.id = doc['collection']+":"+ doc['name']; 
+               li.className = 'berrydoc';
+               ol.appendChild(li);
+                new ygDDPlayer(li.id,'trash',docList); 
+         }
+
+         /**          
+           var extra = document.createElement('div');
+           var textview =  document.createElement('span'); 
+           textview.id = 'extextview';
+           textview.className = 'extralink';   
+           textview.appendChild(document.createTextNode("plain text version"));                   
+           var email =  document.createElement('span');
+           email.appendChild(document.createTextNode("email to a friend"));
+           email.id = 'exemail';      
+           email.className = 'extralink';    
+           extra.appendChild(textview);
+           extra.appendChild(email);
+           content.appendChild(extra);
+         **/ 
+        }
+
+       function showTextView(){
+             var content =  YAHOO.util.Dom.get('content'); 
+             var textview =  YAHOO.util.Dom.get('textview');
+
+              if (previousView != null &amp;&amp; textview !=null){
+                 previousView.style.backgroundImage =  'url("interfaces/default/images/bg_on.png")'; 
+              } 
+
+             if (textview !=null){
+               previousView = textview;
+               previousView.style.backgroundImage =  'url("interfaces/default/images/bg_green.png")';
+             }
+
+               while (content.hasChildNodes()) {
+		 content.removeChild(content.firstChild);
+	       }                        
+           
+             if (docList.length == 0){
+                content.appendChild(document.createTextNode("Your berry basket is empty."));
+                return;
+              }
+
+             buildPreview(content);   
+
+        
+       }
+
+       function getEmailContent(content){
+           var item ;
+           var tr;
+           var td;
+           var input;
+           
+           table = document.createElement('table');
+           table.setAttribute("class","mailtable");          
+
+          for (item in mailinfo){
+  	   tr = document.createElement('tr');       
+           td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           td.appendChild(document.createTextNode(mailinfo[item]));
+           tr.appendChild(td);
+ 
+           td = document.createElement('td');
+           input = document.createElement('input'); 
+           input.setAttribute("id", item);
+           input.setAttribute("class", "mailinput");
+           input.setAttribute("type", "text");
+           td.appendChild(input);
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+          
+          }
+
+ 	   // an empty line
+           tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.appendChild(document.createElement('br'));
+	   tr.appendChild(td);
+  	   table.appendChild(tr);
+
+	   content.appendChild(table);
+          
+           buildPreview(content);   
+
+           //send button
+	   input = document.createElement('input'); 
+           input.setAttribute("id", 'sendmail');
+           input.setAttribute("class", "sendbutton");
+           input.setAttribute("type", "button");
+           input.setAttribute("value", "send");        
+           content.appendChild(input);
+           
+        }
+
+      
+        function showEmail(){
+          
+             var content =  YAHOO.util.Dom.get('content'); 
+             var email =  YAHOO.util.Dom.get('email');
+
+              if (previousView != null &amp;&amp; email !=null ){
+                 previousView.style.backgroundImage =  'url("interfaces/default/images/bg_on.png")'; 
+              } 
+              
+              if (email != null){
+                previousView = email;
+               previousView.style.backgroundImage =  'url("interfaces/default/images/bg_green.png")';
+             }
+               while (content.hasChildNodes()) {
+		 content.removeChild(content.firstChild);
+	       }                        
+           
+             if (docList.length == 0){
+                content.appendChild(document.createTextNode("Your berry basket is empty."));
+                return;
+              }
+
+                   
+           var item ;
+           var tr;
+           var td;
+           var input;
+           
+           table = document.createElement('table');
+           table.setAttribute("class","mailtable");          
+
+          for (item in mailinfo){
+  	   tr = document.createElement('tr');       
+           td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           td.appendChild(document.createTextNode(mailinfo[item]));
+           tr.appendChild(td);
+ 
+           td = document.createElement('td');
+           input = document.createElement('input'); 
+           input.setAttribute("id", item);
+           input.setAttribute("class", "mailinput");
+           input.setAttribute("type", "text");
+           td.appendChild(input);
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+          
+          }
+
+ 	   // an empty line
+           tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.appendChild(document.createElement('br'));
+	   tr.appendChild(td);
+  	   table.appendChild(tr);
+
+	   content.appendChild(table);
+          
+           buildPreview(content);   
+
+           //send button
+	   input = document.createElement('input'); 
+           input.setAttribute("id", 'sendmail');
+           input.setAttribute("class", "sendbutton");
+           input.setAttribute("type", "button");
+           input.setAttribute("value", "send");        
+           content.appendChild(input);
+
+         }
+
+
+         function buildPreview(parent){
+             var div = document.createElement('div');
+         
+         
+             var img =  document.createElement('img');
+             img.src = 'interfaces/default/images/check3.gif';
+             img.id = 'urlcheck'; 
+             div.appendChild(img);
+       
+             var urls = document.createElement('span');
+             urls.id = 'urls';
+             urls.className = 'berrycheck';
+             urls.appendChild(document.createTextNode('URL only'));
+             div.appendChild(urls);
+
+            // var urlsmetadata = document.createElement('span');
+            // urlsmetadata.id = 'urlsmetadata'
+            // urlsmetadata.className = 'berryradio';
+            // urlsmetadata.appendChild(document.createTextNode('URLs and Metadata'));
+              
+            // div.appendChild(urlsmetadata);
+          
+          
+             parent.appendChild(div);
+
+                       
+             var parea  = document.createElement('textarea');
+             parea.id = 'pretextarea';                        
+
+             parent.appendChild(parea);        
+          
+         
+             populateUrlsAndMetadata(parea);	    
+               
+                       	
+         }
+
+        
+       function populateUrls(parea){
+          var urls="";
+          var doc_url = document.URL;
+          var root_url = doc_url.substring(0,doc_url.indexOf('?'));
+           
+          for (var i in docList){
+              var doc = docList[i];
+              urls +=root_url+"?a=d&amp;c="+doc["collection"]+"&amp;d="+doc["name"]+"\n\n";  
+                     
+          }
+
+           parea.value = urls;
+            
+         }
+
+	 function populateUrlsAndMetadata(parea){
+                       
+              var doc_url = document.URL;
+              var root_url = doc_url.substring(0,doc_url.indexOf('?'));
+              var fulltext="";
+
+              for (var i in docList){
+                   var doc = docList[i];
+                   var url =root_url+"?a=d&amp;c="+doc['collection']+"&amp;d="+doc['name']+"\n";  
+                    for (var metaItem in doc){
+                        var metadata = metaItem+": "+ doc[metaItem]+"\n";
+                      }
+                     fulltext +=url+metadata+"\n";
+                 
+              }
+
+               parea.value = fulltext;
+                  
+           }                                                    	    		 
+	                     
+          function sendMail(){
+              var  url = "?a=pr&amp;rt=r&amp;ro=1&amp;s=SendMail&amp;c=";
+                     var request_type = "POST";
+                     var postdata = ""; 
+ 	             var i;	     
+                     //get checked items
+                      for (i in mailinfo)
+			{ 
+                         
+                          var input = YAHOO.util.Dom.get(i);  
+                          var value = input.value;  
+			  postdata +="&amp;s1."+i+"="+value;	
+			}                                   
+
+
+                       var content = YAHOO.util.Dom.get('pretextarea').value;
+                       
+                       content = content.replace(/&amp;/g,'-------');  
+                       postdata +="&amp;s1.content="+content;
+                                                                
+                      
+                        var callback = {
+     			   success:function(o){
+                                    var result = o.responseText;
+                                    alert(result);     
+	 			                                                                      
+                                	} ,
+     			    failure:function(o){
+                                        alert("Sending mail falied");    
+ 				     }    
+  			 }
+                                               
+ 	               
+   			YAHOO.util.Connect.asyncRequest(request_type , url , callback, postdata);         
+         }	
+
+        YAHOO.util.Event.addListener(window,'click', navigate);
+        YAHOO.util.Event.addListener(window,'load', showFullView);
+      </xsl:text>
+    </script>    
+  </xsl:template>
+
+  <xsl:template name="styleSheet">
+    <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>  
+    <link rel="stylesheet" href="interfaces/default/style/berry.css" type="text/css"/>  
+  </xsl:template>
+  
+  <xsl:template name="showMailBox">
+    <script type="text/javascript">
+      <xsl:text disable-output-escaping="yes">
+	var show = false;	
+	var table;
+	var mailserver  = new Array();     
+	mailserver['host'] = "Mail Server: ";
+	mailserver['user'] = "User Name: ";
+	mailserver['password'] = "Password: ";
+	
+	var mailinfo = new Array();
+	mailinfo['address'] = "To: ";
+	mailinfo['cc'] = "CC: ";
+	mailinfo['bcc'] = "Bcc: ";
+	mailinfo['subject'] = "Subject: "; 
+	
+	function mailBoxUpdate(e) {
+		var target = e.target;
+		if (target.id.toLowerCase() == 'sendasemail' &amp;&amp; !show){
+	       	    showMailBox();
+                    show = true;
+                }
+                else{
+                    if (target.id.toLowerCase() == 'sendasemail' &amp;&amp; show){
+                       hideMailBox();
+                       show = false;
+                    }
+
+                     if (target.id.toLowerCase() == 'sendmail'){
+                      sendMail();
+                    }
+                }
+
+
+                	
+        }
+
+       function showMailBox(){
+           var mailbox = YAHOO.util.Dom.get('mailbox');  
+           if (table != null &amp;&amp; !show){
+               mailbox.appendChild(table);
+              return;
+           }
+                        
+           var item ;
+           var tr;
+           var td;
+           var input;
+           
+           table = document.createElement('table');
+           table.setAttribute("class","mailtable");          
+
+           // mail server
+           tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           td.appendChild(document.createTextNode(mailserver['host']));
+           tr.appendChild(td);
+ 
+           td = document.createElement('td');
+           input = document.createElement('input'); 
+           input.setAttribute("id", 'host');
+           input.setAttribute("class", "mailinput");
+           input.setAttribute("type", "text");
+           td.appendChild(input);
+           td.appendChild(document.createTextNode(' e.g. webmail.cs.waikato.ac.nz'));
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+         
+           //user name 
+	   tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           td.appendChild(document.createTextNode(mailserver['user']));
+           tr.appendChild(td);
+           td = document.createElement('td');
+           input = document.createElement('input'); 
+           input.setAttribute("id", 'user');
+           input.setAttribute("class", "mailinput");
+           input.setAttribute("type", "text");
+           td.appendChild(input);
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+
+           //password 	
+	   tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           td.appendChild(document.createTextNode(mailserver['password']));
+           tr.appendChild(td);
+           td = document.createElement('td');
+           input = document.createElement('input'); 
+           input.setAttribute("id", 'password');
+           input.setAttribute("class", "mailinput");
+           input.setAttribute("type", "password");
+           td.appendChild(input);
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+
+           // an empty line
+           tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.appendChild(document.createElement('br'));
+	   tr.appendChild(td);
+  	   table.appendChild(tr);
+
+          for (item in mailinfo){
+  	   tr = document.createElement('tr');       
+           td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           td.appendChild(document.createTextNode(mailinfo[item]));
+           tr.appendChild(td);
+ 
+           td = document.createElement('td');
+           input = document.createElement('input'); 
+           input.setAttribute("id", item);
+           input.setAttribute("class", "mailinput");
+           input.setAttribute("type", "text");
+           td.appendChild(input);
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+          
+          }
+
+ 	// an empty line
+           tr = document.createElement('tr');
+           td = document.createElement('td');
+           td.appendChild(document.createElement('br'));
+	   tr.appendChild(td);
+  	   table.appendChild(tr);
+
+	//send button
+	   tr = document.createElement('tr');
+       	   td = document.createElement('td');
+           td.setAttribute("class","mailitem");
+           input = document.createElement('input'); 
+           input.setAttribute("id", 'sendmail');
+           input.setAttribute("class", "sendbutton");
+           input.setAttribute("type", "button");
+           input.setAttribute("value", "send");
+           td.appendChild(input);
+           tr.appendChild(td);	        
+           table.appendChild(tr);
+
+           
+          mailbox.appendChild(table);
+         }            
+     
+
+       function hideMailBox(){
+          var mailbox = YAHOO.util.Dom.get('mailbox');	
+          while (mailbox.hasChildNodes()) {
+		mailbox.removeChild(mailbox.firstChild);
+	   }
+         }
+      
+         function sendMail(){
+              var  url = "?a=pr&amp;rt=r&amp;ro=1&amp;s=SendMail&amp;c=";
+                     var request_type = "POST";
+                     var postdata = ""; 
+ 	             var i;	     
+                     //get checked items
+                      for (i in mailinfo)
+			{ 
+                         
+                          var input = YAHOO.util.Dom.get(i);  
+                          var value = input.value;  
+			  postdata +="&amp;s1."+i+"="+value;	
+			}                                   
+
+
+                       for (i in mailserver){
+                          var input = YAHOO.util.Dom.get(i);  
+                          var value = input.value; 
+                           postdata +="&amp;s1."+i+"="+value;
+                        }
+
+                       var content = YAHOO.util.Dom.get('pretextarea').value;
+                       
+                       content = content.replace(/&amp;/g,'-------');  
+                       postdata +="&amp;s1.content="+content;
+                                                                
+                      
+                        var callback = {
+     			   success:function(o){
+                                    var response = o.responseXML;
+            	                       
+	 			         alert(response.getAttribute('status'));                                                               
+                                	} ,
+     			    failure:function(o){
+                                        alert("Sending mail falied");    
+ 				     }    
+  			 }
+                                               
+ 	               
+   			YAHOO.util.Connect.asyncRequest(request_type , url , callback, postdata);         
+                 }	
+
+              
+            YAHOO.util.Event.addListener(window,'click',mailBoxUpdate );
+
+      </xsl:text> 
+    </script>
+  </xsl:template>
+  
+  <xsl:template name="berryPageBanner">
+    <div class='banner'>
+      <div class='pageinfo'>
+	<p class='bannerlinks'>
+	  <a class='navlink' href='{$library_name}?a=p&amp;sa=home' title='Library home page' >HOME</a>
+	  <a class='navlink' href='{$library_name}?a=p&amp;sa=help&amp;c='  title='Help pages' >HELP</a>
+	  <a class='navlink' href='{$library_name}?a=p&amp;sa=pref&amp;c=' title='Change your interface preferences'>PREFERENCES</a>
+	</p>      
+      </div>
+      <div class='basketimage'><p class='bannertitle'>Berry Basket</p></div>        
+    </div>
+    <div class="bannerextra"></div>
+    
+    <div >
+      <p class='navbar'><span id='fullview' class='navlink'>full view</span><span id='textview' class='navlink'>plain text version</span><span id='email' class='navlink'>email to a friend</span></p>
+    </div> 
+  </xsl:template>
+  
+  <xsl:template name="footBanner">
+    <div >
+      <p class='navbar'><span >powered by greenstone3</span></p>
+    </div> 
+  </xsl:template>
+  
+  <xsl:template name="direction">
+    <xsl:if test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>  
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/berrytools.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/berrytools.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/berrytools.xsl	(revision 24007)
@@ -0,0 +1,402 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <xsl:param name="berryBaskets"/>
+  
+  <xsl:template name="berrybasket">
+    <div id="berrybasket" class="hide" >
+      <div id="baskethandle"><span></span></div>
+      <div id ="berries"><span></span></div>
+    </div>
+  </xsl:template>
+  
+  <xsl:template name="documentBerryBasket">
+    <xsl:param name="collName"/>
+    <xsl:param name="selectedNode"/>
+    <xsl:param name="rootNode"/>
+    <xsl:param name="docType" />
+    <div id="berrybasket" class="hide" >
+      <div id="baskethandle"><span></span></div>
+      <div id ="berries" ><span></span></div>
+    </div>
+    <xsl:choose>
+      <xsl:when test="$selectedNode = $rootNode">
+	<p id="documentberries">    
+	  <img class='pick'  id="{$collName}:{$rootNode}" src="interfaces/default/images/berry3.png" alt="in basket" width="15" height="15" border="0"/><span id="{$collName}:{$rootNode}:root" class="documentberry">the whole document</span></p>       
+      </xsl:when>
+      <xsl:otherwise>
+	<p id="documentberries">    
+	  <img class='pick'  id="{$collName}:{$rootNode}" src="interfaces/default/images/berry3.png" alt="in basket" width="15" height="15" border="0"/><span id="{$collName}:{$rootNode}:root" class="documentberry">the whole document</span><img class='pick'  id="{$collName}:{$selectedNode}" src="interfaces/default/images/berry3.png" alt="in basket" width="15" height="15" border="0"/><span id="{$collName}:{$selectedNode}:section" class="documentberry">the current section</span></p>
+      </xsl:otherwise> 
+    </xsl:choose>
+  </xsl:template>
+
+  
+  <xsl:template name="loadLibrary">
+    <script type="text/javascript" src="interfaces/default/js/YAHOO.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/default/js/event.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/default/js/connection.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/default/js/dom.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/default/js/dragdrop.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/default/js/ygDDPlayer.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/default/js/ygDDOnTop.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    
+  </xsl:template>
+  
+  <xsl:template name="js-library">
+    <xsl:call-template name="loadLibrary" />	
+    <xsl:call-template name="basketCheckout" />
+  </xsl:template> 
+  
+  <!-- should be called for a documentNode -->
+  <xsl:template name="addBerry">
+    <xsl:param name="collName"/>
+    <td valign="top"><img class='pick' id="{$collName}:{@nodeID}" src="interfaces/default/images/berry3.png" alt="in basket" width="15" height="15" border="0"/></td>
+  </xsl:template>
+  
+  <xsl:template name="basketCheckout">
+    <script type="text/javascript">
+      <xsl:text disable-output-escaping="yes">
+      //used to stored the current items in berrybasket, including collection name, document id and dodument title 
+      //in the format of collection:id:[title], it is updated when the page is loaded (reloaded) or the user adds
+      // new items in the berry basket (see ygDDplayer.js). It is used to show the contents of the berry basket. 
+     var berryList =  new Array();
+     var show = false;    
+ 
+     // the default width and height of the berry basket
+     var oldHeight=90;
+     var oldWidth=140;
+     var oldBg;
+
+     var dd = new ygDDOnTop('berrybasket');
+     dd.setHandleElId('baskethandle');
+
+     var checkout = function(){
+       var request_type = "GET";
+       var url = "?a=pr&amp;rt=r&amp;ro=1&amp;s=ItemNum&amp;o=XML&amp;c="; 
+ 
+         var responseSuccess = function(o){
+	     var response = o.responseXML;
+             var size = response.getElementsByTagName('size').item(0).getAttribute('value');       
+           
+             var items = response.getElementsByTagName('item');
+             
+             for (var i=0;i &lt; items.length ; i++ ){
+ 
+                 // remove berries images from if the berry basket has already contains this item  
+                
+                 var itemID = items[i].getAttribute('collection')+":"+items[i].getAttribute('name');
+                 var item =  YAHOO.util.Dom.get(itemID);
+                 if (item != null){
+                    var parent = item.parentNode;
+                    parent.removeChild(item);
+                   
+                   if (parent !=null &amp;&amp; parent.id == "documentberries"){
+                         var root = YAHOO.util.Dom.get(itemID+":root");
+                         var section = YAHOO.util.Dom.get(itemID+":section");
+                         if(root!=null &amp;&amp; root.id.indexOf(itemID) !=-1){
+                             parent.removeChild(root);
+                          }
+     
+	                  if(section!=null &amp;&amp; section.id.indexOf(itemID) !=-1){
+                             parent.removeChild(section);
+        	          }
+                      
+                          
+                     }
+                 }
+                                
+                  berryList[berryList.length] = items[i];                   	
+	      }
+
+               //add berryimage into the berry basket
+                updateBerryImages();         
+             
+                // set berries images visible
+             // they are set to be invisible to prevent flickering when first loaded (see berry.css) 
+            
+             var berries =document.getElementsByTagName('img');
+	     var berrybasket = new YAHOO.util.DDTarget('berrybasket','basket');
+           
+             for (var j=0; j &lt; berries.length; j++){
+          
+                  var berry = berries[j]; 
+                   var parent = berry.parentNode;
+                   
+                   
+                   if (parent !=null &amp;&amp; parent.id == "documentberries"){
+                         var root = YAHOO.util.Dom.get(berry.id+":root");
+                         var section = YAHOO.util.Dom.get(berry.id+":section");
+                         if(root!=null &amp;&amp; root.id.indexOf(berry.id) !=-1){
+                             root.style.visibility ="visible" ;
+                          }
+     
+	                  if(section!=null &amp;&amp; section.id.indexOf(berry.id) !=-1){
+                             section.style.visibility ="visible" ;
+        	          }
+                      
+                          
+                     }  
+
+               if (berry.className  &amp;&amp;  berry.className  == 'pick')
+                  { 
+                    berry.style.visibility = "visible";
+                    new ygDDPlayer(berry.id,'basket',berryList); 
+                  }   
+     	      
+             }
+           
+           }
+
+         var responseFailure = function(o){
+             
+          }  
+
+        var callback = {
+        success: responseSuccess,
+        failure: responseFailure 
+      }
+
+      YAHOO.util.Connect.asyncRequest(request_type , url , callback);
+   }
+
+    function updateBerryImages(){
+     
+      for (var i =0;i &lt; berryList.length &amp;&amp; i &lt;12 ; i++ ){
+               var berries = YAHOO.util.Dom.get('berries');
+               var img = document.createElement('img');
+               img.src = 'interfaces/default/images/berry3.png';
+               img.height = 15;
+               img.width = 15;
+               img.border = 0;              
+               berries.appendChild(img);
+          }
+
+    }
+
+    function basketUpdate(e) {
+		var target = e.target;
+               
+		if ((target.id.toLowerCase() == 'berrybasket' || target.id.toLowerCase() == 'berries')  &amp;&amp; !show){
+	       	    showBasket();
+                    show = true;
+                }
+                else{
+                    if (target.id.toLowerCase() == 'hideview' &amp;&amp; show){
+                       hideBasket();
+                       show = false;
+                    }
+                }
+           
+            if (target.className == 'pick'){
+              addBerry(target);
+            }
+            
+        }
+
+     function showBasket() {
+        var berryBasket  = YAHOO.util.Dom.get('berrybasket');  
+        var basketHandle = YAHOO.util.Dom.get('baskethandle'); 
+        var berries = YAHOO.util.Dom.get('berries');   
+        var div = document.createElement('div');
+        var list = document.createElement('ol');
+        var width = 500;
+        var height = 40;
+        var i=0;
+ 
+        list.id = 'doclist';
+      
+       //remove berryImages in the berry basket 
+       while (berries.hasChildNodes()) {
+       	  berries.removeChild(berries.firstChild);
+	}
+
+       while (basketHandle.hasChildNodes()) {
+       	  basketHandle.removeChild(basketHandle.firstChild);
+	}
+
+       for (i in berryList){
+            var berryItem = berryList[i];
+            var berryElement = document.createElement('li');
+            var title = berryItem.getAttribute('title');
+            var root_title = berryItem.getAttribute('root_title'); 
+            var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name'); 
+
+            if (root_title != ""){
+              root_title +=":";
+            }
+	    
+            title = root_title+title;	
+            if (title.length > 50){
+               title = title.substring(0,20)+" ... "+title.substr(title.length-35,35);
+             }
+  
+            berryElement.appendChild(document.createTextNode(title));
+            berryElement.setAttribute("class","berryitem");
+            list.appendChild(berryElement);
+            height +=18;
+          } 
+      	   
+        oldHeight = berryBasket.style.height;
+        oldWidth = berryBasket.style.width;
+        oldBg = berryBasket.style.background; 
+        berryBasket.style.height = height;
+        berryBasket.style.width = width;
+        berryBasket.style.background ='url("interfaces/default/images/kete2.png") 0 0 repeat';
+        berryBasket.style.cursor = "default";         
+        berryBasket.className = "show";
+        div.appendChild(list); 	
+        berries.appendChild(div);  
+        berries.style.height = height - 40;
+
+        var links = document.createElement('div');
+        var hideView = document.createElement('a');
+        var fullView = document.createElement('a');
+        links.appendChild(hideView);
+        links.appendChild(fullView);
+        basketHandle.appendChild(links);
+        hideView.appendChild(document.createTextNode("Hide"));
+        fullView.appendChild(document.createTextNode("Full View"));
+        hideView.setAttribute("id","hideview");
+        fullView.setAttribute("href","?a=g&amp;sa=berry&amp;c=&amp;s=DisplayList&amp;rt=r");
+        fullView.setAttribute("class","fullview");
+
+        }
+
+      function hideBasket() {
+          var i = 0;
+          var berryBasket  = YAHOO.util.Dom.get('berrybasket');  
+          var basketHandle  = YAHOO.util.Dom.get('baskethandle'); 
+          var berries = YAHOO.util.Dom.get('berries'); 
+          berryBasket.style.height = oldHeight;
+          berryBasket.style.width = oldWidth;
+          berryBasket.style.background = oldBg;
+          berryBasket.style.cursor = "pointer";
+          berryBasket.className = "hide";
+
+          while (berries.hasChildNodes()) {
+		berries.removeChild(berries.firstChild);
+	}
+         
+        while (basketHandle.hasChildNodes()) {
+		basketHandle.removeChild(basketHandle.firstChild);
+	}
+         
+        updateBerryImages();
+      }    
+
+
+     function addBerry(el){
+      var  addurl = "?a=pr&amp;rt=r&amp;ro=1&amp;s=AddItem&amp;c=&amp;s1.id=2&amp;o=XML&amp;s1.item=" + el.id;	   
+      var addSuccess = function(o){ 
+ 		 var result = o.responseXML;
+                 var items = result.getElementsByTagName('item');
+                 if (items.length &gt; 0){
+                    var item = items[0];
+                    var berrybasket = YAHOO.util.Dom.get('berrybasket');
+        	    var berries = YAHOO.util.Dom.get('berries');
+                    berryList[berryList.length]= item;   
+                    var parent =el.parentNode;
+                    if (parent == null) return;     
+                    parent.removeChild(el);
+               
+                     var itemID = item.getAttribute('collection')+":"+item.getAttribute('name'); 
+                    if (parent !=null  &amp;&amp; parent.id == "documentberries"){
+                         var root = YAHOO.util.Dom.get(itemID+":root");
+                         var section = YAHOO.util.Dom.get(itemID+":section");
+                         if(root!=null  &amp;&amp; root.id.indexOf(itemID) !=-1){
+                             parent.removeChild(root);
+                          }
+     
+	                  if(section!=null  &amp;&amp; section.id.indexOf(itemID) !=-1){
+                             parent.removeChild(section);
+        	          }                                                
+                     }
+
+                    if (!YAHOO.util.Dom.get('hideview') &amp;&amp;  berryList.length &lt; 13){
+                      while (berries.hasChildNodes()) {
+       	                   berries.removeChild(berries.firstChild);
+	                }
+                        
+                     for (var i =0; i &lt; berryList.length; i++ ){
+                             var img = document.createElement('img');
+                              img.src = 'interfaces/default/images/berry3.png';
+                              img.height = 15;
+                              img.width = 15;
+                              img.border = 0;              
+                              berries.appendChild(img);
+                       }
+      	            
+                                                     
+	          }
+                 else{
+           
+                  if (YAHOO.util.Dom.get('hideview')){
+                        var berryBasket  = YAHOO.util.Dom.get('berrybasket');
+                        var berries  = YAHOO.util.Dom.get('berries');
+                        var doclist = YAHOO.util.Dom.get('doclist'); 
+                        var tid = el.id;                                  
+                        var berryItem; 
+                        var berryElement = document.createElement('li');
+                         for (var i in berryList){
+                             berryItem = berryList[i];
+                             var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name');
+                             if (id == tid){
+                               var title = berryItem.getAttribute('title');
+                               var root_title = berryItem.getAttribute('root_title');  
+                                if (root_title != ""){
+                                      root_title +=":";
+                                     }
+	    
+                                title = root_title+title;	
+                                if (title.length > 50){
+                                   title = title.substring(0,20)+" ... "+title.substr(title.length-35,35);
+                                }
+            
+                               berryElement.appendChild(document.createTextNode(title));
+                               berryElement.setAttribute("class","berryitem");
+                               doclist.appendChild(berryElement);
+                               var heightStr =  berryBasket.style.height+"";
+                               var height =parseInt(heightStr.substring(0,heightStr.length-2)) +18;                             
+                               berryBasket.style.height = height;
+                               berries.style.height = height;
+                               break;
+                            }
+                         }
+                             
+                      }
+                    
+                 }
+               }
+                                       
+             }
+
+           var addFailure = function(o){ }
+
+           var addcallback = {
+        	   success:addSuccess,
+     	           failure:addFailure
+                }
+
+            YAHOO.util.Connect.asyncRequest(request_type , addurl , addcallback);    
+
+         }
+
+  
+      
+     YAHOO.util.Event.addListener(window,'load', checkout); 
+     YAHOO.util.Event.addListener(window,'click', basketUpdate); 
+      </xsl:text>
+    </script>
+  </xsl:template>
+
+  <xsl:template name="berryStyleSheet">
+    <link rel="stylesheet" href="interfaces/default/style/berry.css" type="text/css"/>  
+  </xsl:template>
+  
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/classifier.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/classifier.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/classifier.xsl	(revision 24007)
@@ -0,0 +1,126 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="classifiertools.xsl"/>
+  <xsl:include href="berrytools.xsl"/>
+
+  <xsl:output method="html"/> 
+
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle">
+    <xsl:if test="$berrybasketswitch = 'on'">
+      <xsl:call-template name="berryStyleSheet"/>  
+      <xsl:call-template name="js-library"/>
+    </xsl:if>
+  </xsl:template>
+
+
+  <xsl:template match="pageResponse">
+    <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:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+  
+    <!-- Sam's div code -->
+
+    <!-- <xsl:if test="/page/pageRequest[@name='output']='debug'"> -->
+
+    <xsl:variable name="fmt">
+	<xsl:call-template name="xml-to-string">
+            <xsl:with-param name="node-set" select="//format[@type='browse']"/>
+          </xsl:call-template>
+    </xsl:variable>
+
+    <!-- <xsl:variable name="tok" select="fn:tokenize($fmt,'/s+')"/> -->
+
+      <div id="format">
+        <p>
+	  <b>Format string here</b>
+	  <i>
+	      <xsl:value-of select="$fmt"/>
+	      <!-- <xsl:value-of select="$tok"/> -->
+	  </i>
+        </p>
+      </div>
+    <!-- </xsl:if> -->
+
+  
+    <div id="content">
+      <xsl:apply-templates select="service/classifierList">
+        <xsl:with-param name="collName" select="$collName"/>
+        <xsl:with-param name="serviceName" select="$serviceName"/>
+      </xsl:apply-templates>
+      
+      <xsl:if test="$berrybasketswitch = 'on'">
+	<xsl:call-template name="berrybasket" />
+      </xsl:if>  
+      <xsl:apply-templates select="classifier">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="serviceName" select="$serviceName"/>
+      </xsl:apply-templates>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="classifierList">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <xsl:variable name="selected" select="/page/pageResponse/classifier/@name"/>
+    <ul id="classifierlist">
+      <xsl:for-each select="classifier">
+	<xsl:choose>
+	  <xsl:when test="@name=$selected">
+	    <li id="activeclassifier"><xsl:value-of select="displayItem[@name='name']"/></li>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <li><a href="{$library_name}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></li></xsl:otherwise></xsl:choose>
+	
+      </xsl:for-each>
+    </ul>
+  </xsl:template>
+
+</xsl:stylesheet>
+
+
+
+
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/classifiertools.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/classifiertools.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/classifiertools.xsl	(revision 24007)
@@ -0,0 +1,167 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <xsl:template match="classifier">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <div id="classifiers">
+      <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable>
+      <xsl:choose>
+	<xsl:when test="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@horizontalAtTop">
+	  <xsl:apply-templates select="." mode="horizontal-at-top">
+	    <xsl:with-param name="collName" select="$collName"/>
+	    <xsl:with-param name="serviceName" select="$serviceName"/>
+	  </xsl:apply-templates>
+	</xsl:when>
+	<xsl:otherwise>
+	  <xsl:apply-templates select="." mode="default">
+	    <xsl:with-param name="collName" select="$collName"/>
+	    <xsl:with-param name="serviceName" select="$serviceName"/>
+	  </xsl:apply-templates>
+	</xsl:otherwise>
+      </xsl:choose>
+    </div>
+  </xsl:template>
+  
+
+  <xsl:template match="classifier" mode="horizontal-at-top">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <xsl:choose>
+      <xsl:when test="classifierNode">
+	<ul id="classifiernodelist-horizontal">
+	  <xsl:for-each select='classifierNode'>
+	    <xsl:apply-templates select='.' mode="horizontal"><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>
+	  </xsl:for-each>
+	</ul>
+	<ul id="childrenlist">
+	  <li>
+            <table><tr>
+		<xsl:for-each select='classifierNode'>
+		  <xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>
+		</xsl:for-each>
+	      </tr></table>
+	  </li>
+	</ul>
+      </xsl:when>
+      <xsl:otherwise>
+	<!-- there were no classifier nodes -->
+	<ul id="childrenlist">
+          <xsl:for-each select='documentNode'>
+	    <li><table><tr><xsl:call-template name="documentNodeWrapper">
+		    <xsl:with-param name='collName' select='$collName'/>
+		    <xsl:with-param name='serviceName' select='$serviceName'/>
+		  </xsl:call-template></tr></table></li>
+	  </xsl:for-each>
+	</ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="classifier" mode="default"> <!-- the default -->
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <ul id="classifiernodelist">
+      <xsl:call-template name="processNodeChildren">
+	<xsl:with-param name='collName' select='$collName'/>
+	<xsl:with-param name='serviceName' select='$serviceName'/>
+      </xsl:call-template>
+    </ul>
+  </xsl:template>
+  
+  <!-- this is a wrapper node, which the interface can use to add stuff into the query results that isn't part of and doesn't depend on the documentNode template which may come from the collection -->
+  <xsl:template name="documentNodeWrapper">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/> 
+    <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 
+    <!--<xsl:if test="$berryBaskets = 'true'">-->
+    <xsl:if test="$berrybasketswitch = 'on'">
+      <xsl:call-template name="addBerry">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template> 
+    </xsl:if>
+    <xsl:apply-templates select=".">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="serviceName" select="$serviceName"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="documentNode">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}&amp;dt={@docType}&amp;p.a=b&amp;p.s={$serviceName}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a><xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
+  </xsl:template>
+
+  
+  
+  <!-- icon + title template-->
+  <xsl:template match="classifierNode">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:call-template name="bookshelfimg"/></a><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
+  </xsl:template>
+  
+  <!-- the title is a link: an alternative template -->
+  <xsl:template match="classifierNode" mode="horizontal">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <li><xsl:choose>
+	<xsl:when test="classifierNode|documentNode"><b><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/><xsl:text> </xsl:text></b></xsl:when>
+	<xsl:otherwise>
+	  <a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></a><xsl:text> </xsl:text></xsl:otherwise>
+      </xsl:choose>
+    </li>
+  </xsl:template>
+  
+
+  <!-- processing for the recursive bit -->
+  <xsl:template match="classifierNode" mode="process-all-children">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <xsl:call-template name="processNodeChildren">
+      <xsl:with-param name='collName' select='$collName'/>
+      <xsl:with-param name='serviceName' select='$serviceName'/>
+    </xsl:call-template>
+  </xsl:template>
+  
+  <xsl:template name="processNodeChildren">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <xsl:for-each select='classifierNode|documentNode'>
+      <xsl:choose><xsl:when test="name()='documentNode'">
+	  <li><table><tr>
+		<xsl:call-template name="documentNodeWrapper">
+		  <xsl:with-param name='collName' select='$collName'/>
+		  <xsl:with-param name='serviceName' select='$serviceName'/>
+		</xsl:call-template>
+	      </tr></table>
+	  </li>
+	</xsl:when>
+	<xsl:otherwise>
+	  <li><table><tr>
+		<xsl:apply-templates select='.'>
+		  <xsl:with-param name='collName' select='$collName'/>
+		  <xsl:with-param name='serviceName' select='$serviceName'/>
+		</xsl:apply-templates>
+	      </tr></table>
+	  </li>
+	  <xsl:if test="child::classifierNode or child::documentNode">
+	    <!--recurse into the children-->
+	    <li><ul class="childrenlist">
+		<xsl:apply-templates select='.' mode='process-all-children'>
+		  <xsl:with-param name='collName' select='$collName'/>
+		  <xsl:with-param name='serviceName' select='$serviceName'/>
+		</xsl:apply-templates>
+	      </ul>
+	    </li>
+	  </xsl:if>
+	</xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/config_format.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/config_format.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/config_format.xsl	(revision 24007)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xslt="output.xsl"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+  extension-element-prefixes="java">
+  
+  <xsl:output method="xml"/>
+  <xsl:namespace-alias
+    stylesheet-prefix="xslt" result-prefix="xsl"/>
+
+  <xsl:template match="format">
+    <format>
+      <xsl:apply-templates/>
+    </format>
+  </xsl:template>
+  
+  <xsl:template match="gsf:template">
+    <xslt:template>
+      <xsl:copy-of select="@*"/>
+      <xsl:attribute name="priority">2</xsl:attribute> 
+      <xsl:if test=".//gsf:link">
+	<xslt:param name="serviceName"/>
+	<xslt:param name="collName"/>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </xslt:template>
+  </xsl:template>
+  
+  <xsl:template match="gsf:link">
+    <xsl:choose>
+      <xsl:when test="@type='classifier'">
+	<a><xslt:attribute name='href'><xslt:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</xslt:if></xslt:attribute>
+	  <xsl:apply-templates/>
+	</a>
+      </xsl:when>
+      <xsl:otherwise> <!-- a document link -->
+	<xslt:variable name="bookswitch"><xslt:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xslt:variable>
+	<xslt:choose>
+	  <xslt:when test="$bookswitch = 'on' or $bookswitch = 'flashxml'">
+	    <a><xslt:attribute name="href"><xslt:value-of select='$library_name'/>?a=d&amp;ed=1&amp;book=on&amp;c=<xslt:value-of select='$collName'/>&amp;d=<xslt:value-of select='@nodeID'/>&amp;dt=<xslt:value-of select='@docType'/><xslt:if test="@nodeType='leaf'">&amp;sib=1</xslt:if>&amp;p.a=<xslt:value-of select="/page/pageRequest/@action"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&amp;p.s=<xslt:value-of select="$serviceName"/></xslt:attribute><xsl:apply-templates/></a>
+	  </xslt:when>
+	  <xslt:otherwise>
+	    <a><xslt:attribute name="href"><xslt:value-of select='$library_name'/>?a=d&amp;book=off&amp;c=<xslt:value-of select='$collName'/>&amp;d=<xslt:value-of select='@nodeID'/>&amp;dt=<xslt:value-of select='@docType'/><xslt:if test="@nodeType='leaf'">&amp;sib=1</xslt:if>&amp;p.a=<xslt:value-of select="/page/pageRequest/@action"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&amp;p.s=<xslt:value-of select="$serviceName"/></xslt:attribute><xsl:apply-templates/></a>
+	  </xslt:otherwise>
+	</xslt:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="gsf:icon">
+    <xsl:choose>
+      <xsl:when test="@type='classifier'">
+	<xslt:call-template name="bookshelfimg"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xslt:apply-templates select="." mode="displayNodeIcon"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="gsf:metadata[@format]">
+    <xslt:value-of disable-output-escaping="yes"><xsl:attribute name="select">java:org.greenstone.gsdl3.util.XSLTUtil.<xsl:value-of select="@format"/>(metadataList/metadata[@name='<xsl:apply-templates select="." mode="get-metadata-name"/>'], /page/@lang )</xsl:attribute></xslt:value-of>
+  </xsl:template>
+
+  <xsl:template match="gsf:metadata">
+    <xslt:value-of disable-output-escaping="yes"><xsl:attribute name="select">metadataList/metadata[@name='<xsl:apply-templates select="." mode="get-metadata-name"/>']</xsl:attribute></xslt:value-of>
+  </xsl:template>
+
+  <xsl:template match="gsf:metadata" mode="get-metadata-name">
+    <xsl:if test="@multiple='true'">all_</xsl:if><xsl:if test='@select'><xsl:value-of select='@select'/>_</xsl:if><xsl:if test="@separator">*<xsl:value-of select='@separator'/>*_</xsl:if><xsl:value-of select="@name"/>
+  </xsl:template>
+  
+  <xsl:template match="gsf:metadata-old">
+    <xslt:value-of disable-output-escaping="yes"><xsl:attribute name="select">metadataList/metadata[@name="<xsl:choose><xsl:when test="@select='parent'">parent_</xsl:when><xsl:when test="@select='root'">root_</xsl:when><xsl:when test="@select='ancestors'">ancestors'<xsl:value-of select='@separator'/>'_</xsl:when><xsl:when test="@select='siblings'">siblings_'<xsl:value-of select='@separator'/>'_</xsl:when></xsl:choose><xsl:value-of select="@name"/>"]</xsl:attribute></xslt:value-of>
+  </xsl:template>
+  
+  <xsl:template match="gsf:text">
+    <xslt:apply-templates select="nodeContent"/>
+  </xsl:template>
+  
+  <xsl:template match="gsf:choose-metadata">
+    <xslt:choose>
+      <xsl:for-each select="gsf:metadata">
+	<xslt:when><xsl:attribute name="test">metadataList/metadata[@name='<xsl:apply-templates select="." mode="get-metadata-name"/>']</xsl:attribute>
+	  <xsl:apply-templates select="."/>
+	</xslt:when>
+      </xsl:for-each>
+      <xsl:if test="gsf:default">
+	<xslt:otherwise><xsl:apply-templates select="gsf:default"/></xslt:otherwise>
+      </xsl:if>
+    </xslt:choose>
+  </xsl:template>
+  
+  <xsl:template match="gsf:switch">
+    <xsl:variable name="meta-name"><xsl:apply-templates select="gsf:metadata" mode="get-metadata-name"/></xsl:variable>
+    <xslt:variable name="meta"><xsl:choose><xsl:when test="@preprocess"><xslt:value-of select="util:{@preprocess}(metadataList/metadata[@name='{$meta-name}'])"/></xsl:when><xsl:otherwise><xslt:value-of select="metadataList/metadata[@name='{$meta-name}']"/></xsl:otherwise></xsl:choose></xslt:variable>
+    <xslt:choose>
+      <xsl:for-each select="gsf:when">
+	<xslt:when test="util:{@test}($meta, '{@test-value}')">
+	  <xsl:apply-templates/>
+	</xslt:when>
+      </xsl:for-each>
+      <xsl:if test="gsf:otherwise">
+	<xslt:otherwise>
+	  <xsl:apply-templates select="gsf:otherwise/node()"/>
+	</xslt:otherwise>
+      </xsl:if>
+    </xslt:choose>
+  </xsl:template>
+  
+  <xsl:template match="*">
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/document.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/document.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/document.xsl	(revision 24007)
@@ -0,0 +1,629 @@
+<?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:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util gsf">
+
+
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+  <xsl:include href="berrytools.xsl"/>
+
+  <xsl:output method="html"/>
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable>
+    <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable>
+
+    <xsl:choose> 
+      <xsl:when test="$bookswitch = 'flashxml' and $a = 'd'">
+	<html>
+	  <xsl:call-template name="response" />
+        </html>
+      </xsl:when>
+
+      <xsl:otherwise>    
+        <html>
+	  <head>
+	    <title>
+	      <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	      <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	    </title>
+	    <xsl:call-template name="globalStyle"/>
+	    <xsl:call-template name="pageStyle"/>
+	  </head>
+          <body>
+	    <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	    <div id="page-wrapper">
+	      <xsl:call-template name="response" />
+	      <xsl:call-template name="greenstoneFooter"/>
+	    </div>
+          </body>
+        </html>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  
+  <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 
+  <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable>
+  
+  <xsl:template name="pageTitle">
+    <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
+    <xsl:for-each select='/page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each>
+  </xsl:template>
+
+  <!-- this is hard coded for GATE, should somehow do it dynamically-->
+  <xsl:template name="pageStyle">
+    <style type="text/css">
+      <xsl:text disable-output-escaping="yes">
+	span.Location {  display:inline; color : red }
+	span.Person {  display:inline; color : green }
+	span.Organization {  display:inline; color : yellow }
+	span.Date {  display:inline; color : blue }
+	span.query_term {display: inline; background-color : yellow }
+      </xsl:text>
+    </style>
+
+    <!--TODO: add berry basket switch-->
+    <!--<xsl:if test="$berryBaskets = 'true'">-->
+    <xsl:if test="$berrybasketswitch = 'on'">
+      <xsl:call-template name="berryStyleSheet"/>  
+      <xsl:call-template name="js-library"/>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$bookswitch = 'on' or $bookswitch = 'off'">
+        <xsl:call-template name="standardPageBanner">
+	  <xsl:with-param name="collName" select="$collName"/>
+        </xsl:call-template>
+        <xsl:call-template name="navigationBar">
+	  <xsl:with-param name="collName" select="$collName"/>
+        </xsl:call-template>
+	
+        <!--<xsl:if test="$berryBaskets = 'true'">-->
+        <xsl:if test="$berrybasketswitch = 'on'">
+          <xsl:call-template name="documentBerryBasket">
+	    <xsl:with-param name="collName" select="$collName"/>
+	    <xsl:with-param name="selectedNode" select="/page/pageResponse/document/@selectedNode"/>
+	    <xsl:with-param name="rootNode" select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
+	    <xsl:with-param name="docType" select="/page/pageResponse/document/@docType"/>
+          </xsl:call-template>
+        </xsl:if>
+      </xsl:when>
+    </xsl:choose>	
+
+    <!-- display the document -->
+    <xsl:if test="$bookswitch != 'flashxml'">
+      <xsl:text disable-output-escaping="yes">&lt;div id="content"&gt;</xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="document">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+    <xsl:if test="$bookswitch != 'flashxml'">
+      <xsl:text disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="document">
+    <xsl:param name="collName"/>
+    <xsl:variable name="external"><xsl:value-of select="/page/pageResponse/document/@external"/></xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$external != ''">
+	<xsl:call-template name="externalPage">
+	  <xsl:with-param name="external" select="$external"/>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:choose>
+	<xsl:when test="$bookswitch = 'flashxml'">
+	  <xsl:call-template name="xmldocumentContentPeeling">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>
+	</xsl:when>
+	
+	<xsl:when test="$bookswitch = 'on'">
+	  <xsl:call-template name="documentHeading">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>
+	  <div id="bookdiv"></div>
+	  <script type="text/javascript">
+	    <xsl:text disable-output-escaping="yes">
+	      var doc_url = document.URL; 
+	      doc_url = doc_url.replace(/(&amp;|\?)book=[a-z]+/gi,'');
+	      doc_url += '&amp;book=flashxml';
+
+	      var flash_plug_html = ""
+	      flash_plug_html += '&lt;OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n';
+	      flash_plug_html += '  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n';
+	      flash_plug_html += '  height="800" id="Book" swLiveConnect="true" \n';
+	      flash_plug_html += '  width="100%"&gt;\n';
+	      flash_plug_html += '    &lt;PARAM name="allowScriptAccess" value="always" /&gt;\n';
+	      flash_plug_html += '    &lt;PARAM name="movie" value="Book.swf';
+	      flash_plug_html += '?src_image=' + escape(img_cover);
+	      flash_plug_html += '&amp;doc_url=' + escape(doc_url)
+	      flash_plug_html += '" /&gt;\n';
+	      flash_plug_html += '    &lt;PARAM name="quality" value="high" /&gt;\n';
+	      flash_plug_html += '    &lt;PARAM name="bgcolor" value="#FFFFFF" /&gt;\n';
+	      flash_plug_html += '    &lt;EMBED align="middle" \n';
+	      flash_plug_html += '      allowScriptAccess="always" swLiveConnect="true" \n';
+	      flash_plug_html += '      bgcolor="#FFFFFF" height="800" name="Book" \n';
+	      flash_plug_html += '      pluginspage="http://www.macromedia.com/go/getflashplayer" \n';
+	      flash_plug_html += '      quality="high" \n';
+	      flash_plug_html += '      src="Book.swf';
+	      flash_plug_html += '?src_image=' + escape(img_cover);
+	      flash_plug_html += '&amp;doc_url=' + escape(doc_url);
+	      flash_plug_html += '"\n'; 
+	      flash_plug_html += '      type="application/x-shockwave-flash" width="100%" /&gt;\n';
+	      flash_plug_html += '&lt;/OBJECT&gt;\n';
+	      var flash_div = document.getElementById("bookdiv");
+	      flash_div.innerHTML = flash_plug_html;
+	    </xsl:text>
+	  </script>
+	</xsl:when> 
+	<xsl:otherwise>
+	  <xsl:call-template name="documentHeading">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>
+	  <xsl:call-template name="documentArrows">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>         
+	  <xsl:call-template name="documentContent">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>
+	  <xsl:call-template name="documentArrows">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>   
+	</xsl:otherwise>
+	</xsl:choose>
+	
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="documentHeading">
+    <xsl:param name="collName"/>
+    <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
+    <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
+    <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
+    <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
+    <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
+    <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
+    <div id="documentheading">
+      <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param>
+	</xsl:call-template></a>
+      <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
+    </div>
+    
+    <div id="docheadwrapper">
+      <div id="documentinfo">
+	
+	<xsl:choose>
+	  <xsl:when test="$bookswitch = 'on'">
+	    <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
+	      <div id="headingimage">
+		<xsl:call-template name="coverImage"/> 
+	      </div>
+	    </xsl:if>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
+	      <div id="headingimage">
+		<xsl:call-template name="coverImage"/> 
+	      </div>
+	    </xsl:if>
+	    
+	    <ul id="docbuttons" >
+	      <xsl:call-template name="documentButtons">
+		<xsl:with-param name="collName" select="$collName"/>
+	      </xsl:call-template>
+	    </ul>
+	  </xsl:otherwise>
+	</xsl:choose>     
+      </div>
+      <!--<div><xsl:call-template name="enrichServices">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template></div>-->
+      <xsl:if test="$bookswitch = 'off'">
+	<xsl:if test="string($doTOC) != 'false'">
+	  <div id="toc">
+	    <xsl:call-template name="TOC">
+	      <xsl:with-param name="collName" select="$collName"/>
+	    </xsl:call-template>
+	  </div>
+	</xsl:if>
+      </xsl:if>  
+    </div>
+  </xsl:template>
+
+  <xsl:template name="coverImage">
+    <xsl:choose>
+      <xsl:when test="$bookswitch = 'on'">
+	<script type="text/javascript">
+	  <xsl:text disable-output-escaping="yes">var img_cover = '</xsl:text><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg<xsl:text disable-output-escaping="yes">';</xsl:text>
+	</script>
+      </xsl:when>
+      <xsl:otherwise>
+	<img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="documentButtons">
+    <xsl:param name="collName"/>
+    <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
+    <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
+    <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
+    
+    
+    <!-- expand document -->
+    <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">
+      <li>
+        <xsl:choose><xsl:when test="string($ed)='1'">
+	    <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
+	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
+	    </a>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
+	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
+	    </a>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </li>
+    </xsl:if> 
+    
+    <!-- expand contents -->
+    <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'">
+      <li>
+	<xsl:choose><xsl:when test="string($ec)='1'">
+	    <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
+	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/></a>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <a  href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
+	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
+	    </a>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </li>
+    </xsl:if>
+
+    <!-- detach page -->
+    <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
+    <li>
+      <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;d=<xsl:value-of select="$docID"/>&amp;c=<xsl:value-of select="$collName"/>&amp;sib=<xsl:value-of select="$sib"/>&amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_tip')"/></xsl:attribute>
+	<xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
+      </a></li>
+  </xsl:template>
+
+  <xsl:template name="TOC">
+    <xsl:param name="collName"/>
+    <xsl:choose>
+      <xsl:when test="@docType='hierarchy'">
+	<xsl:call-template name="hierarchicalContents">
+	  <xsl:with-param name="collName" select="$collName"/>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@docType='paged'">
+	<xsl:call-template name="pagedContents">
+	  <xsl:with-param name="collName" select="$collName"/>
+	</xsl:call-template>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="hierarchicalContents">
+    <xsl:param name="collName"/>
+    <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/>
+    <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
+    <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
+    <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
+    <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
+    <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
+    <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:if test="documentNode[@nodeID]">
+      <ul id="tocnodes">
+	<li>
+	  <xsl:choose><xsl:when test="string($oc)='0'">
+	      <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.open_toc')"/></xsl:with-param></xsl:call-template></a>
+	    </xsl:when>
+	    <xsl:otherwise><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="openfolderimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.close_toc')"/></xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.table_of_contents')"/>
+	  <xsl:if test="string($oc)!='0'">
+	    <ul class="tocnode">
+	      <xsl:for-each select="documentNode/documentNode[@nodeID]">
+		<xsl:apply-templates select='.'><xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/><xsl:with-param name="p.a" select="$p.a"/><xsl:with-param name="p.s" select="$p.s"/><xsl:with-param name="p.sa" select="$p.sa"/><xsl:with-param name="p.c" select="$p.c"/></xsl:apply-templates>
+	      </xsl:for-each>
+            </ul>
+	  </xsl:if>
+        </li> 
+      </ul>
+    </xsl:if>
+  </xsl:template>
+  
+  <!-- each icon-title pair is a row in a table. children go in a table in another row -->
+  <xsl:template match="documentNode">
+    <xsl:param name="collName"/>
+    <xsl:param name="ec"/>
+    <xsl:param name="p.a"/>
+    <xsl:param name="p.s"/>
+    <xsl:param name="p.sa"/>
+    <xsl:param name="p.c"/>
+    <!-- Display the appropriate image, depending on the node type -->
+    <li>
+      <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='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1<xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if>&amp;p.a=<xsl:value-of select="$p.a"/>&amp;p.sa=<xsl:value-of select="$p.sa"/>&amp;p.s=<xsl:value-of select="$p.s"/>&amp;p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
+	<xsl:apply-templates select="." mode="displayNodeIcon"/>
+      </a>
+      
+      <!-- Display associated title, bolded if the node has content -->
+      <xsl:choose>
+	<xsl:when test="nodeContent">
+	  <span class="bold"><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
+	</xsl:when>
+	<xsl:otherwise>
+	  <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
+	</xsl:otherwise>
+      </xsl:choose>
+      <!-- Apply recursively to the children of this node -->
+      <xsl:if test="documentNode[@nodeID]">
+	<ul class="tocnode"> <xsl:apply-templates select="documentNode[@nodeID]">
+	    <xsl:with-param name="collName" select="$collName"/>
+	    <xsl:with-param name="ec" select="$ec"/>
+	    <xsl:with-param name="p.a" select="$p.a"/><xsl:with-param name="p.s" select="$p.s"/><xsl:with-param name="p.sa" select="$p.sa"/><xsl:with-param name="p.c" select="$p.c"/>
+	    <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
+	  </xsl:apply-templates>
+	</ul>
+      </xsl:if>
+    </li>
+  </xsl:template>
+  
+  <!-- default content is to print the title and content of any documentNodes that have nodeContent -->
+  <xsl:template name="documentContent">
+    <div class="documenttext"> 
+      <xsl:choose>
+	<xsl:when test="@docType='simple'"><xsl:apply-templates select="nodeContent"/></xsl:when>
+	<xsl:otherwise>
+	  <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>
+	</xsl:otherwise>
+      </xsl:choose>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="documentNode" mode="content">
+    <xsl:if test="nodeContent">
+      <xsl:if test="metadataList/metadata[@name='Title']">
+	<h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3>
+      </xsl:if>
+      <xsl:apply-templates select="nodeContent"/>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- the actual text/content -->
+  <xsl:template match="nodeContent">
+    <p/>
+    <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:template>
+  
+  <xsl:template name="xmldocumentContentPeeling">
+    <xsl:choose>
+      <xsl:when test="@docType='simple'">
+	<xsl:apply-templates select="nodeContent"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:call-template name="xmlpeelingContents" />
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="xmlpeelingContents">
+    <xsl:if test="documentNode">
+      <xsl:apply-templates select="documentNode" mode="xmlpeeling" />
+    </xsl:if>
+  </xsl:template>
+
+  	<xsl:template match="documentNode" mode="xmlpeeling">
+		<!-- get title -->
+		<xsl:if test="nodeContent">
+			<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>
+
+		<!-- recurse to the children -->
+		<xsl:if test="documentNode">
+			<xsl:apply-templates select="documentNode" mode="xmlpeeling" />
+		</xsl:if>
+	
+		<!-- end the section -->
+		<xsl:if test="nodeContent">
+			<xsl:text disable-output-escaping="yes">
+				&lt;/Section&gt;
+			</xsl:text>
+		</xsl:if>
+  </xsl:template>
+  
+  <!-- match any file nodes -->
+  <xsl:template match="file">
+    <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
+    <xsl:choose>
+      <xsl:when test="util:isImage(@mimeType)">
+	<img src="{$httpPath}/{@href}"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- match any link nodes -->
+  <xsl:template match="link">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 
+    <xsl:variable name="actionargs">
+      <xsl:choose>
+	<xsl:when test="@type='document'">a=d</xsl:when>
+	<xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=rd</xsl:when>
+	<xsl:otherwise>
+	p
+	</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="serviceargs">
+      <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
+    </xsl:variable>
+    <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
+  </xsl:template>
+
+  <!-- match any annotations and make them span elements -->
+  <xsl:template match="annotation">
+    <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
+  </xsl:template>
+  
+  <!-- paged naviagtion : INCOMPLETE!!-->
+  <xsl:template name="pagedContents">
+    <xsl:param name="collName"/>
+    <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
+    <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
+    <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
+    <table>
+      <xsl:choose>
+	<xsl:when test="$pos=-1"><!-- a doc -->
+	  <tr valign="top">
+	    <td align="left">
+	    </td>
+	    <td align="center"><center>
+		<b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.pages', $children)"/></b>
+	      </center></td>
+	    <td align="right">
+	      <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
+	    </td>
+	  </tr>
+	</xsl:when>
+	
+	<xsl:otherwise> <!-- an internal node -->	  
+	  <tr valign="top">
+	    <td align="left">
+	      <xsl:if test=" not ( $pos = 1 )">
+		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a>
+	      </xsl:if>
+	    </td>
+	    <td align="center"><center>
+		<b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.pageof', concat($pos, ';', $length))"/></b>
+	      </center></td>
+	    <td align="right">
+	      <xsl:if test=" not($pos = $length)">
+		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
+	      </xsl:if>
+	    </td>
+	  </tr>
+	</xsl:otherwise>
+      </xsl:choose>
+      <tr valign="middle">
+	<td align='center' valign='top' colspan='3'>
+	  <form name="GotoForm" method="get" action="{$library_name}">
+	    <input type='hidden' name='a' value='d'/>
+	    <input type='hidden' name='c' value='{$collName}'/>
+	    <input type='hidden' name='d' value='{@selectedNode}'/>
+	    <input type="text" name="gp" size="3" maxlength="4"/>
+	    <input type="submit"><xsl:attribute name='value'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.gotopage')"/></xsl:attribute></input>
+	  </form>
+	</td>
+      </tr>
+    </table>
+  </xsl:template>
+  
+  <xsl:template name="enrichServices">
+    <xsl:param name="collName"/>
+    <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
+    <xsl:for-each select="../serviceList/service">
+      <table border='1' cellspacing='0'>
+	<tr><td>
+	    <p /><xsl:value-of select="displayItem[@name='name']"/><p/>
+	    <form name="EnrichForm" method="get" action="{$library_name}">
+	      <xsl:apply-templates select="paramList"/>
+	      <input type='hidden' name='a' value='d'/>
+	      <input type='hidden' name='d' value='{$docID}'/>
+	      <input type='hidden' name='c' value='{$collName}'/>
+	      <xsl:if test='$request-params/param[@name="sib"]'>
+		<input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
+	      <input type='hidden' name='s' value='{@name}'/>
+	      <input type='hidden' name='p.a'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.a"]'/></xsl:attribute></input>
+	      <input type='hidden' name='p.sa'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.sa"]'/></xsl:attribute></input>
+	      <input type='hidden' name='p.s'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.s"]'/></xsl:attribute></input>
+	      <input type='hidden' name='end' value='1'/>
+	      <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
+	    </form>
+	  </td></tr>
+      </table>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="paramList" mode="hidden">
+    <xsl:for-each select="param">
+      <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
+      </xsl:text>
+    </xsl:for-each>
+  </xsl:template>
+  
+  <xsl:template name="documentArrows">
+    <xsl:param name="collName"/>
+    <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
+    
+    <div class="documentarrows">
+      <xsl:if test="not(string($ed)='1')">
+	<xsl:call-template name="documentArrow">
+	  <xsl:with-param name="collName" select="$collName"/>
+	  <xsl:with-param name="direction">back</xsl:with-param>
+	</xsl:call-template>
+	<xsl:call-template name="documentArrow">
+	  <xsl:with-param name="collName" select="$collName"/>
+	  <xsl:with-param name="direction">forward</xsl:with-param>
+	</xsl:call-template>
+      </xsl:if>
+    </div>
+    
+  </xsl:template>
+  
+  <xsl:template name="documentArrow">
+    <xsl:param name="collName"/>
+    <xsl:param name="direction"/>
+    <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
+    <xsl:if test='$request-params/param[@name="dt"]/@value != "simple"'>  
+      <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="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
+    </xsl:if> 
+  </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:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/gli4gs3.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/gli4gs3.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/gli4gs3.xsl	(revision 24007)
@@ -0,0 +1,57 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  
+  <xsl:output method="html"/>  
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="pageResponse/service/applet"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="../pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+    <div >
+      <xsl:copy-of select="Applet"/>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>  
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/help.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/help.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/help.xsl	(revision 24007)
@@ -0,0 +1,56 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+
+  <xsl:output method="html"/>  
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:template name="pageTitle">
+    <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"><xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/></xsl:when><xsl:otherwise><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:otherwise></xsl:choose>: <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_t')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="pageType">help</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+    
+    some help text goes here
+  </xsl:template>
+  
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/home.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/home.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/home.xsl	(revision 24007)
@@ -0,0 +1,92 @@
+<?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">
+
+  
+  <xsl:template match="page/pageResponse">
+    
+    <!-- the page layout template is here -->
+    <html>
+      
+      <head>
+	<title>
+	  <gslib:siteHomePageTitle/>
+	</title>
+	<link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
+      </head>
+      
+      <body><gslib:textDirectionAttribute/>
+	
+	<div id="page-wrapper">
+	  <gslib:displayErrorsIfAny/>
+	  
+	  
+	  <div id="banner">
+	    <p>
+	      <img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><gslib:greenstoneLogoAlternateText/></xsl:attribute>
+	      </img>
+	    </p>
+	  </div>
+	  
+	  <div id="content">
+	    
+	    <div class="divbar"><gslib:selectACollectionTextBar/></div>
+	    
+	    <div class="QuickSearch">
+	      <gslib:crossCollectionQuickSearchForm/>
+	    </div>
+	    
+	    
+	    <ul id="collectionlist">
+	      <xsl:for-each select="collectionList/collection"> 
+		<li>
+		  <gslib:collectionLinkWithImage/>
+		</li>
+	      </xsl:for-each> 
+	    </ul>
+	    
+	    <gslib:serviceClusterList/>
+	    
+	    <div class="divbar"><gslib:noTextBar/></div>
+	    
+	    <ul id="servicelist">
+	      <xsl:for-each select="serviceList/service[@type='query']">
+		<li><gslib:serviceLink/></li>
+	      </xsl:for-each>
+	      
+	      <xsl:for-each select="serviceList/service[@type='authen']">
+		<li><gslib:authenticationLink/></li>
+	      </xsl:for-each>
+	      <!--uncomment the line below to display a library interface link inside a <li>-->
+	      <!--<gslib:libraryInterfaceLink/>-->
+	    </ul>
+	    
+	  </div>
+
+	  
+	  <div id="footer">
+	    <div class="divbar"><gslib:poweredByGS3TextBar/></div>
+	  </div>
+	  
+	</div>
+	
+		<script type="text/javascript" src="jquery.js">
+			<xsl:comment>Filler for browser</xsl:comment>
+		</script>
+		<script type="text/javascript" src="test.js">
+			<xsl:comment>Filler for browser</xsl:comment>
+		</script>
+	
+      </body>
+    </html>
+    
+    
+  </xsl:template>
+</xsl:stylesheet>  
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/html.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/html.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/html.xsl	(revision 24007)
@@ -0,0 +1,24 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <xsl:output method="html"/>  
+
+  <xsl:template match="page">
+    <html>
+      <head></head>
+      <frameset rows="68,*" noresize="" border="0">
+	<frame frameborder="0"><xsl:attribute name="src">?a=p&amp;sa=nav&amp;c=<xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value" /></xsl:attribute></frame>
+	<frame frameborder="0"><xsl:attribute name="src"><xsl:value-of select="/page/pageRequest/paramList/param[@name='url']/@value"/></xsl:attribute></frame>
+	<noframes>
+	  <p><xsl:value-of select="util:getInterfaceText('default', /page/@lang, 'textframebrowser')"/></p>
+	</noframes>
+      </frameset>
+    </html>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/icons.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/icons.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/icons.xsl	(revision 24007)
@@ -0,0 +1,122 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+ 
+  <!-- some global parameters - these are set by whoever is invoking the transformation -->
+  <xsl:param name="interface_name"/>
+
+  <!-- Display the appropriate image, depending on the node type -->
+  <xsl:template match="documentNode" mode="displayNodeIcon">
+    
+    <!-- Root node: book icon (open or closed) -->
+    <xsl:choose>
+      <xsl:when test="@nodeType='root'">
+	<xsl:choose>
+	  <xsl:when test="documentNode">
+	    <xsl:call-template name="openbookimg">
+	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:call-template name="closedbookimg">
+	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_book')"/></xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:when>
+      
+      <!-- Internal node: folder icon (open or closed) -->
+      <xsl:when test="@nodeType='internal'">
+	<xsl:choose>
+	  <xsl:when test="documentNode">
+	    <xsl:call-template name="openfolderimg">
+	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_folder')"/></xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:call-template name="closedfolderimg">
+	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_folder')"/></xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:when>
+      
+      <!-- Leaf node: page icon, and this is the default -->
+      <xsl:otherwise>
+	<xsl:call-template name="textpageimg">
+	  <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'view_document')"/></xsl:with-param>
+	</xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="openbookimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img  border="0" width="28" height="23"
+      src="interfaces/default/images/openbook.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="closedbookimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="18" height="11"
+      src="interfaces/default/images/book.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="openfolderimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="23" height="15"
+      src="interfaces/default/images/openfldr.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="closedfolderimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img  border="0" width="23" height="15"
+      src="interfaces/default/images/clsdfldr.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="textpageimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img  border="0" width="16" height="21"
+      src="interfaces/default/images/itext.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="bookshelfimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img  border="0" width="20" height="16"
+      src="interfaces/default/images/bshelf.gif"  
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="iconpdf">
+    <xsl:param name="alt">PDF</xsl:param>
+    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonpdf')"/></xsl:param>
+    <img border="0" width='26' height='26' 
+      src='interfaces/default/images/ipdf.gif' 
+      alt='{$alt}' title='{$title}'/>
+  </xsl:template>
+  
+  <xsl:template name="icondoc">
+    <xsl:param name="alt">Word</xsl:param>
+    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonmsword')"/></xsl:param>
+    <img border="0" width='26' height='26' 
+      src='interfaces/default/images/imsword.gif' 
+      alt='{$alt}' title='{$title}'/>
+  </xsl:template>
+
+</xsl:stylesheet>
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/library.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/library.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/library.xsl	(revision 24007)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:gslib="http://www.greenstone.org/XSL/Library"
+  exclude-result-prefixes="util xalan gslib gsf xslt gs3">
+  
+  
+  <xsl:output
+    method="html" 
+    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" 
+    doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
+  
+  
+  <!--Load the Greenstone Utility file that contains all the code needed to expand all GSLib elements-->
+  <xsl:include href="util.xsl"/>
+  
+</xsl:stylesheet>
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/nav.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/nav.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/nav.xsl	(revision 24007)
@@ -0,0 +1,46 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+
+  <xsl:output method="html"/>  
+  
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<base target="_top"/>
+      </head>
+      <body style="background-image: none;">
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<xsl:apply-templates select="pageResponse"/>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/>
+  </xsl:template>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+    <div align="right">
+      <xsl:call-template name="top-buttons">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+    </div>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+  </xsl:template>
+
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/pref.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/pref.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/pref.xsl	(revision 24007)
@@ -0,0 +1,121 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+
+  <xsl:output method="html"/>  
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:template name="pageTitle">
+    <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"><xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/></xsl:when><xsl:otherwise><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:otherwise></xsl:choose>: <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_t')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+    
+    <xsl:variable name="tidyoption"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='tidyoption']"/></xsl:variable>
+    
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="pageType">pref</xsl:with-param>
+    </xsl:call-template>
+
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+    <div id="qureyform">
+      <form name="PrefForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='p'/>
+	<input type='hidden' name='sa' value='pref'/>
+	<input type='hidden' name='c' value="{$collName}"/>
+	<div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></div>
+	<ul id="presprefs"><xsl:call-template name="pres-prefs"/></ul>
+	<ul id="berrybasketprefs" ><xsl:call-template name="berrybasket-prefs"/></ul>
+	
+	<xsl:if test="$tidyoption='tidy'">
+	  <ul id="bookprefs"><xsl:call-template name="book-prefs"/></ul>
+	</xsl:if>
+	
+	<div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></div>
+	<ul id="searchprefs"><xsl:call-template name="search-prefs"/></ul>
+	<input type='submit'><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs')"/></xsl:attribute></input>
+      </form>
+    </div>
+  </xsl:template>
+  
+  <xsl:template name="pres-prefs">
+    <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/> <xsl:call-template name="lang-list"/></li>
+    <li><span class="rightspace"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></span>x</li>
+  </xsl:template>
+  
+  <xsl:template name="lang-list">
+    <xsl:variable name="current" select="/page/@lang"/>
+    <select name="l">
+      <xsl:for-each select="/page/pageResponse/languageList/language">
+	<option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
+      </xsl:for-each>
+    </select>
+  </xsl:template>
+  
+  <xsl:template name="search-prefs">
+    <xsl:variable name="hits"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable> 
+    <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.hitsperpage')"/> 
+      <select name="hitsPerPage">
+	<option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option> 
+	<option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
+	<option value="100"><xsl:if test="$hits=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
+	<option value="-1"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.all')"/></option>
+      </select>
+    </li>
+  </xsl:template>
+
+  <xsl:template name="berrybasket-prefs">
+    <xsl:variable name="berrybasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='berrybasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
+    
+    <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket')"/> <select name="berrybasket">
+        <option value="on"><xsl:if test="$berrybasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option> 
+	<option value="off"><xsl:if test="$berrybasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option>
+      </select>
+    </li>
+  </xsl:template>
+
+  <xsl:template name="book-prefs">
+    <xsl:variable name="book"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='book']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
+    
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.book')"/> <select name="book">
+      <option value="on"><xsl:if test="$book='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option> 
+      <option value="off"><xsl:if test="$book='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option>
+    </select>
+    
+  </xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/process.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/process.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/process.xsl	(revision 24007)
@@ -0,0 +1,93 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+
+  <xsl:output method="html"/>  
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="/page/pageResponse/serviceCluster/metadataList/metadata[@name='Title']"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="clusterName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <center>
+      <xsl:call-template name="standardPageBanner">
+	<xsl:with-param name="collName" select="$clusterName"/>
+      </xsl:call-template>
+      <xsl:call-template name="navigationBar">
+	<xsl:with-param name="collName" select="$clusterName"/>
+      </xsl:call-template>      
+      <xsl:apply-templates select="service">
+	<xsl:with-param name="clusterName" select="$clusterName"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="status">
+	<xsl:with-param name="clusterName" select="$clusterName"/>
+      </xsl:apply-templates>
+    </center>
+  </xsl:template>
+
+  <xsl:template match="service">
+    <xsl:param name="clusterName"/>
+    <xsl:variable name='subaction' select="/page/pageRequest/@subaction"/>
+    <xsl:variable name='action' select="/page/pageRequest/@action"/>
+    <xsl:variable name='lang' select="/page/@lang"/>
+    <p/>
+    <form name="BuildForm" method="get" action="{$library_name}">
+      <xsl:apply-templates select="paramList"/>
+      <input type="hidden" name="a" value="{$action}"/>
+      <input type="hidden" name="c" value="{$clusterName}"/>
+      <input type="hidden" name="sa" value="p"/>
+      <input type="hidden" name='l' value='{$lang}'/>
+      <input type="hidden" name="s" value="{@name}"/>
+      <input type="hidden" name="rt" value="r"/>
+      <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
+    </form>
+    <xsl:call-template name="dividerBar"/>
+  </xsl:template>
+  
+  <xsl:template match="status">
+    <xsl:param name="clusterName"/>
+    <center/>
+    <applet code="org.greenstone.gsdl3.build.StatusDisplay.class" codebase='lib' archive='gsdl3.jar, xercesImpl.jar, xml-apis.jar' width='600' height='150'>The status display applet.
+      <param name='library'><xsl:attribute name="value"><xsl:value-of select='$library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='/page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='/page/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="/page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
+      <param name='initial_text'><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></param>
+      <param name='initial_code'><xsl:attribute name="value"><xsl:value-of  select="@code"/></xsl:attribute></param></applet>
+    <xsl:call-template name="dividerBar"/>
+  </xsl:template>
+
+  
+</xsl:stylesheet>  
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/query.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/query.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/query.xsl	(revision 24007)
@@ -0,0 +1,134 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+  <xsl:include href="querytools.xsl"/>
+  <xsl:include href="berrytools.xsl"/>
+
+  <xsl:output method="html"/>
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle">     	
+    <xsl:if test="$berrybasketswitch = 'on'">
+      <xsl:call-template name="berryStyleSheet"/>
+      <xsl:call-template name="js-library"/>
+    </xsl:if>
+  </xsl:template>
+  
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 
+    <xsl:variable name="requesttype"><xsl:value-of select="/page/pageRequest/paramList/param[@name='rt']/@value"/></xsl:variable> 
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template> 
+    <div id="content">
+      <xsl:apply-templates select="service">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:apply-templates>
+      
+      <xsl:if test="$berrybasketswitch = 'on'">
+	<xsl:call-template name="berrybasket"/>
+      </xsl:if>
+      <xsl:if test="contains($requesttype, 'r')">
+	<xsl:call-template name="query-response">
+	  <xsl:with-param name="collName" select="$collName"/>
+	</xsl:call-template>
+      </xsl:if>
+      
+    </div>
+  </xsl:template>
+
+
+  <!-- layout the response -->
+  <xsl:template name="query-response">
+    <xsl:param name="collName"/>
+    <xsl:call-template name="dividerBar"><xsl:with-param name='text'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results')"/></xsl:with-param></xsl:call-template>
+    
+    <!-- If query term information is available, display it -->
+    <xsl:call-template name="termInfo"/>
+    <xsl:call-template name="matchDocs"/>
+    
+    <xsl:if test="documentNodeList">
+
+      <!-- next and prev links at top of results-->     
+      <xsl:call-template name="resultNavigation">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+      
+      <!-- Display the matching documents -->        
+      <xsl:call-template name="resultList">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+      
+      <!-- next and prev links at bottom of page -->
+      <xsl:call-template name="resultNavigation">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+  
+
+  <xsl:template match="service">
+    <xsl:param name="collName"/>
+    <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
+    <div id="queryform">
+      <form name="QueryForm" method="get" action="{$library_name}">
+	<input type="hidden" name="a" value="q"/>
+	<input type="hidden" name="sa" value="{$subaction}"/>
+	<input type="hidden" name="rt" value="rd"/>
+	<input type="hidden" name="s" value="{@name}"/>
+	<input type="hidden" name="c" value="{$collName}"/>
+	<xsl:if test="not(paramList/param[@name='startPage'])">
+	  <input type="hidden" name="startPage" value="1"/>
+	</xsl:if>
+	<xsl:apply-templates select="paramList"/>
+	<input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
+      </form>
+    </div>
+  </xsl:template>
+  
+</xsl:stylesheet>  
+
+
+
+
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/querytools.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/querytools.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/querytools.xsl	(revision 24007)
@@ -0,0 +1,157 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!-- have changed this so it uses service hitsPerPage and startPage if the service description has a param called hitsPerPage,  otherwise uses interface ones -->
+  <xsl:template name="resultNavigation">
+    <xsl:param name="collName"/>
+    <div class="resultnavigation">  
+      <!-- hits type -->
+      <xsl:variable name='ht'>
+	<xsl:choose>
+	  <xsl:when test="/page/pageResponse/service/paramList/param[@name='hitsPerPage']">s</xsl:when>
+	  <xsl:otherwise>i</xsl:otherwise>
+	</xsl:choose>
+      </xsl:variable>
+      
+      <xsl:variable name="param-list" select="/page/pageRequest/paramList"/>
+      <!-- hits per page -->
+      <xsl:variable name="hpp">
+	<xsl:choose>
+	  <xsl:when test="$ht='s'"><xsl:value-of select="$param-list/param[@name='s1.hitsPerPage']/@value"/></xsl:when>
+	  <xsl:when test="$param-list/param[@name='hitsPerPage']"><xsl:value-of select="$param-list/param[@name='hitsPerPage']/@value"/></xsl:when>
+	  <xsl:otherwise>20</xsl:otherwise>
+	</xsl:choose>
+      </xsl:variable>
+      <!-- total docs - this may be in numDocsMatched or numDocsReturned metadata -->
+      <xsl:variable name="td">
+	<xsl:choose>
+	  <xsl:when test="/page/pageResponse/metadataList/metadata[@name='numDocsReturned']">
+	    <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='numDocsReturned']"/>
+	  </xsl:when>
+	  <xsl:when test="/page/pageResponse/metadataList/metadata[@name='numDocsMatched']">
+	    <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='numDocsMatched']"/>
+	  </xsl:when>
+	  <xsl:otherwise> <!-- this is just a fall back - should always have the metadata -->
+	    <xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/>
+	  </xsl:otherwise>	
+	</xsl:choose>
+      </xsl:variable>
+
+      <!-- only continue if hpp != -1 and td > hpp -->
+      <xsl:if test="not($hpp=-1) and $td &gt; $hpp">
+	<!-- start page -->
+	<xsl:variable name="here">
+	  <xsl:choose>
+	    <xsl:when test="$ht='s'"><xsl:value-of select="$param-list/param[@name='s1.startPage']/@value"/></xsl:when>
+	    <xsl:when test="$param-list/param[@name='startPage']"><xsl:value-of select="$param-list/param[@name='startPage']/@value"/></xsl:when>
+	    <xsl:otherwise>1</xsl:otherwise>
+	  </xsl:choose>
+	</xsl:variable>
+	<xsl:variable name="sa" select="/page/pageRequest/@subaction"/>
+	<xsl:variable name="service" select="$param-list/param[@name='s']/@value"/>
+	<xsl:variable name="prev" select="$here - 1"/>
+	<xsl:variable name="next" select="$here + 1"/>
+	<xsl:variable name="page-param"><xsl:if test="$ht='s'">s1.</xsl:if>startPage</xsl:variable>
+	
+	<div>   
+	  <div>
+	    <xsl:if test="$here &gt; 1"><a href="{$library_name}?a=q&amp;sa={$sa}&amp;c={$collName}&amp;s={$service}&amp;rt=rd&amp;{$page-param}={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hpp + 1)"/> - <xsl:value-of select="number(($prev * $hpp))"/></a></xsl:if>
+	    
+	    
+	    <xsl:if test="(($here * $hpp) + 1)  &lt; $td">
+	      <xsl:variable name='m' select="number($next * $hpp)"/>
+	      <xsl:variable name='mm'><xsl:choose><xsl:when test="$m &lt; $td"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$td'/></xsl:otherwise></xsl:choose></xsl:variable>
+	      <a href="{$library_name}?a=q&amp;sa={$sa}&amp;c={$collName}&amp;s={$service}&amp;rt=rd&amp;{$page-param}={$next}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hpp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></div>
+	</div>
+      </xsl:if>
+    </div>
+  </xsl:template>
+  
+  <xsl:template name="matchDocs">
+    <!-- If the number of matching documents is known, display it -->
+    <div id="matchdocs">
+      <xsl:variable name="numDocsMatched" select="metadataList/metadata[@name='numDocsMatched']"/>
+      <xsl:variable name="numDocsReturned" select="metadataList/metadata[@name='numDocsReturned']"/>
+      <xsl:choose>
+	<xsl:when test="$numDocsMatched='0' or $numDocsReturned='0'">
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
+	</xsl:when>
+	<xsl:when test="$numDocsMatched='1' or $numDocsReturned='1'">
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
+	</xsl:when>
+	<xsl:when test="$numDocsMatched">
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
+	  <xsl:if test="$numDocsReturned"> (<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.docsreturned', $numDocsReturned)"/>)</xsl:if>
+	</xsl:when>
+	<xsl:when test="$numDocsReturned">
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.atleastdocsmatch', $numDocsReturned)"/>
+	</xsl:when>
+      </xsl:choose>
+    </div>
+  </xsl:template>
+
+  <!-- paging is now done by the query action, so here we just print out all the docs that we have -->
+  <xsl:template name="resultList">
+    <xsl:param name="collName"/>
+    <ul id="resultlist"> 
+      <xsl:for-each select="documentNodeList/documentNode">
+	<li><table>
+	    <xsl:call-template name="documentNodeWrapper">
+	      <xsl:with-param name="collName" select="$collName"/>
+	      <xsl:with-param name="serviceName" select="/page/pageResponse/service/@name"/>
+	    </xsl:call-template>
+	  </table>
+	</li>	    
+      </xsl:for-each>  
+    </ul>
+  </xsl:template>
+  
+  <!-- this is a wrapper node, which the interface can use to add stuff into the query results that isn't part of and doesn't depend on the documentNode template which may come from the collection -->
+  <xsl:template name="documentNodeWrapper">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable>
+    <!--<xsl:if test="$berryBaskets = 'true'">-->
+    <xsl:if test="$berrybasketswitch = 'on'">
+      <xsl:call-template name="addBerry">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:apply-templates select=".">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="serviceName" select="$serviceName"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  
+  <!-- the default doc node template for the query results -->
+  <!-- eventually shouldn't need sib arg here -->
+  <xsl:template match="documentNode">
+    <xsl:param name="collName"/>
+    <xsl:param name="serviceName"/>
+    <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='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@docType'/>&amp;p.a=q&amp;&amp;p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&amp;p.s=<xsl:value-of select="$serviceName"/></xsl:attribute>
+      <xsl:apply-templates select="." mode="displayNodeIcon"/>
+    </a>
+    <span><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
+  </xsl:template>
+
+  <xsl:template name="termInfo">
+    <div class="terminfo">
+      <xsl:if test="count(termList/term) > 0">
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
+	<xsl:for-each select="termList/term">
+	  <xsl:if test="position() > 1">, </xsl:if>
+	  <xsl:value-of select="@name"/>: <xsl:value-of select="@freq"/> 
+	</xsl:for-each>
+      </xsl:if>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/service-params.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/service-params.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/service-params.xsl	(revision 24007)
@@ -0,0 +1,188 @@
+<?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"
+  extension-element-prefixes="java">
+
+  <!-- handling of the different types of params on a service form 
+  - these now only output the selection box/text box etc, not the name -->
+
+  <!-- the default param list handling -->
+  <xsl:template match="paramList">
+    <xsl:param name="ns">s1.</xsl:param>
+    <ul id="queryitemlist">
+      <xsl:for-each select="param">
+	<xsl:choose>
+	  <xsl:when test="@type='multi'">
+	    <li><xsl:apply-templates select='.'><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></li>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:variable name="pvalue"><xsl:apply-templates select="." mode="calculate-default"><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></xsl:variable>
+	    <li><xsl:value-of select="displayItem[@name='name']"/><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></li>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:for-each>
+    </ul>
+  </xsl:template>
+  
+  <!-- puts all the params into a=p&p=h type form - need to change this if use 
+  multi params  -->
+  <xsl:template match="paramList" mode="cgi">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:for-each select="param">
+      <xsl:variable name='pname' select="@name"/>
+      <xsl:text>&amp;</xsl:text><xsl:value-of select="$ns"/><xsl:value-of select="@name"/>=<xsl:apply-templates select="." mode="calculate-default"><xsl:with-param name='ns' select='$ns'/></xsl:apply-templates>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="param" mode="calculate-default">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:variable name="pname"><xsl:value-of select="$ns"/><xsl:value-of select="@name"/></xsl:variable>
+    <xsl:choose>
+      <xsl:when test="/page/pageRequest/paramList/param[@name=$pname]">
+	<xsl:choose>
+	  <xsl:when test="@type='enum_multi'"><xsl:text>,</xsl:text>
+	    <xsl:for-each select="/page/pageRequest/paramList/param[@name=$pname]">
+	      <xsl:value-of select="@value"/>,
+	    </xsl:for-each>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="@default"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- invisible params - used by other stuff. in the query form, we set to teh default -->
+  <xsl:template match="param[@type='invisible']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <input type='hidden' name='{$ns}{@name}' value='{@default}'/>
+  </xsl:template>
+  <!-- boolean params -->
+  <xsl:template match="param[@type='boolean']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="default"/>
+    <select name='{$ns}{@name}'>
+      <option value="0"><xsl:if test="$default='0'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="option[@name='0']/displayItem[@name='name']"/></option>
+      <option value="1"><xsl:if test="$default='1'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="option[@name='1']/displayItem[@name='name']"/></option>
+    </select>
+  </xsl:template>
+  
+  <!-- integer params -->
+  <xsl:template match="param[@type='integer']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="default"/>
+    <input type="text" name="{$ns}{@name}" size="3" value="{$default}"/>
+  </xsl:template>
+
+  <!-- single selection enum params -->
+  <xsl:template match="param[@type='enum_single']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="default"/>
+    <xsl:choose>
+      <xsl:when test="count(option) = 1">
+	<xsl:text> </xsl:text><xsl:value-of select="option/displayItem[@name='name']"/>
+	<input type='hidden' name='{$ns}{@name}'><xsl:attribute name='value'><xsl:value-of  select='option/@name'/></xsl:attribute></input>
+      </xsl:when>
+      <xsl:otherwise>
+	<select name="{$ns}{@name}">
+	  <xsl:for-each select="option">
+	    <option value="{@name}"><xsl:if test="@name=$default"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
+	  </xsl:for-each>
+	</select>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <!-- multiple selection enum params -->
+  <!-- how to do defaults for this?? -->
+  <xsl:template match="param[@type='enum_multi']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="default"/>
+    <select name="{$ns}{@name}" size='2'><xsl:attribute name="multiple"></xsl:attribute>
+      <xsl:for-each select="option">
+	<option value="{@name}"><xsl:if test="contains($default, concat(',', @name, ','))"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
+      </xsl:for-each>
+    </select>
+  </xsl:template>
+  
+  <!-- string params -->
+  <xsl:template match="param[@type='string']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="default"/>
+    <input type="text" name="{$ns}{@name}" size="50" value="{$default}"/>
+  </xsl:template>
+  
+  <!-- large string  params -->
+  <xsl:template match="param[@type='text']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="default"/>
+    <textarea name="{$ns}{@name}" cols="50" rows="3"><xsl:value-of select='$default'/></textarea>
+  </xsl:template>
+
+  <!-- multi params - params that are combinations of other params -->
+  <xsl:template match="param[@type='multi']">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:variable name="parent" select="@name"/>
+    <table>
+      <tr class="queryfieldheading"><xsl:value-of select="displayItem[@name='name']"/>
+      	<xsl:for-each select="param">
+	  <td class="queryfieldname"><xsl:value-of select="displayItem[@name='name']"/></td>
+	</xsl:for-each>
+      </tr>
+      
+      <xsl:apply-templates select="." mode="contents"><xsl:with-param name="occurs" select="@occurs"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
+    </table>
+  </xsl:template>
+
+  <xsl:template match="param[@type='multi']" mode="contents">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="occurs">1</xsl:param>
+    <xsl:variable name="pos" select="@occurs - $occurs"/>	
+    <tr class="queryfieldrow"><xsl:for-each select="param">
+	<xsl:variable name="pname" select="@name"/>
+	<xsl:variable name="values" select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
+	<td class="queryfieldcell"><xsl:choose>
+	    <xsl:when test="not(@ignore) or  @ignore != $pos">      
+	      <xsl:apply-templates select='.'><xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($values, $pos)"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
+	    </xsl:when>
+	    <xsl:otherwise><!-- put in a hidden placeholder -->
+	      <input type="hidden" name='{$ns}{@name}' value=''/>
+	    </xsl:otherwise>
+	  </xsl:choose></td>
+      </xsl:for-each></tr>
+    <!-- recursively call this template to get multiple entries -->
+    <xsl:if test="$occurs &gt; 1">
+      <xsl:apply-templates select="." mode="contents"><xsl:with-param name="occurs" select="$occurs - 1"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  
+</xsl:stylesheet>  
+
+  <!-- a param list that puts params in pairs- wont work as is with new
+  param handling stuff -->
+  <!--
+  <xsl:template match="paramList">
+    <p/><table width="537">
+      <xsl:choose>
+        <xsl:when test='count(param)>4'>
+          <xsl:for-each select="param[position() mod 2 = 1]"> 
+            <tr><xsl:apply-templates select="."/>
+              <xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr>
+          </xsl:for-each>
+        </xsl:when>
+	<xsl:otherwise>
+	  <xsl:for-each select="param">
+	    <tr><xsl:apply-templates select='.'/></tr>
+	  </xsl:for-each>
+	</xsl:otherwise>
+      </xsl:choose>
+    </table>
+  </xsl:template>
+  -->
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/style.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/style.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/style.xsl	(revision 24007)
@@ -0,0 +1,193 @@
+<?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"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <xsl:include href="icons.xsl"/>
+
+  <!-- some global parameters - these are set by whoever is invoking the transformation -->
+  <xsl:param name="interface_name"/>
+  <xsl:param name="library_name"/>
+
+  <!-- global style info goes here  -->
+  <xsl:template name="globalStyle">
+    <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
+  </xsl:template>
+
+  <xsl:template name="response">
+    <xsl:apply-templates select="pageResponse"/>
+    <xsl:if test="descendant::error">
+      <script language="Javascript">
+	<xsl:text disable-output-escaping="yes">
+	  function removeAllChildren(node) {
+	    while (node.hasChildNodes()) {
+	      node.removeChild(node.firstChild);
+	    }
+	  }
+
+	  function toggleHideError(obj) {
+	    if (obj.style.display == "none") {
+	      obj.style.display = "";
+	      hide_link = document.getElementById("hide");
+	      removeAllChildren(hide_link);
+	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/><xsl:text disable-output-escaping="yes">"));
+	    } else {
+	      obj.style.display = "none";
+	      hide_link = document.getElementById("hide");
+	      removeAllChildren(hide_link);
+	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
+	    } 
+	  }
+	</xsl:text>
+      </script>
+      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/></a></p>
+      <div id="error" style="display: none;">
+	<xsl:apply-templates select="descendant::error"/>
+      </div>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="greenstoneFooter">
+    <div id="footer">
+      <xsl:call-template name="dividerBar">
+	<xsl:with-param name="text" select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 
+      </xsl:call-template>
+    </div>
+		<script type="text/javascript" src="jquery.js">
+		<xsl:comment>Filler for browser</xsl:comment>
+	</script>
+	<script type="text/javascript" src="test.js">
+		<xsl:comment>Filler for browser</xsl:comment>
+	</script>
+  </xsl:template>
+  
+  <xsl:template match="error">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'error')"/> <xsl:value-of select="."/>
+  </xsl:template>
+
+  <xsl:template name="standardPageBanner">
+    <xsl:param name="collName"/>
+    <xsl:param name="pageType"/>
+    <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
+    <div  id="banner">    
+      <p>
+	<a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
+	  <xsl:choose>
+	    <xsl:when test="$this-element/displayItem[@name='icon']">
+	      <img border="0">
+		<xsl:attribute name="src">
+		  <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
+		</xsl:attribute>	
+		<xsl:attribute name="alt">
+		  <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+		</xsl:attribute>
+		<xsl:attribute name="title">
+		  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
+		</xsl:attribute>
+	      </img>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</a>
+      </p>
+      <ul id="bannerlist"> 
+	<xsl:call-template name="top-buttons">
+	  <xsl:with-param name="collName" select="$collName"/>
+	  <xsl:with-param name="pageType" select="$pageType"/>
+	</xsl:call-template>
+      </ul>
+    </div>
+  </xsl:template>
+  
+  <xsl:template name="top-buttons">
+    <xsl:param name="collName"/>
+    <xsl:param name="pageType"/>
+    <li><a  href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
+      </a></li>
+    <xsl:choose>
+      <xsl:when test="$pageType='help'">
+	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
+	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+	  </a></li>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:choose>
+      <xsl:when test="$pageType='pref'">
+	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
+	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+	  </a></li>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="navigationBar">
+    <xsl:param name="collName"/>
+    <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
+    <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
+    <xsl:choose>
+      <xsl:when test="$this-element/serviceList/service">
+	<div id="navbar">
+	  <ul id="navbarlist">
+	    <xsl:for-each select="$this-element/serviceList/service">
+	      <xsl:variable name="action"><xsl:choose>
+		  <xsl:when test="@hidden='true'">DO_NOT_DISPLAY</xsl:when>
+		  <xsl:when test="@name=$this-service">CURRENT</xsl:when>
+		  <xsl:when test="@type='query'">q</xsl:when>
+		  <xsl:when test="@type='browse'">b</xsl:when>
+		  <xsl:when test="@type='process'">pr</xsl:when>
+		  <xsl:when test="@type='applet'">a</xsl:when>
+		  <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+		</xsl:choose></xsl:variable>
+	      <xsl:choose>
+		<xsl:when test="$action='CURRENT'">
+		  <li><a ><xsl:value-of select="displayItem[@name='name']"/></a></li>
+		</xsl:when>
+		<xsl:when test="$action !='DO_NOT_DISPLAY'">
+		  <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
+		</xsl:when>
+	      </xsl:choose>
+	    </xsl:for-each>
+	  </ul>
+	</div> 
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="dividerBar">
+	  <xsl:with-param name="text" select="'&#160;'"/> 
+        </xsl:call-template>            
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  
+  <xsl:template name="dividerBar">
+    <xsl:param name='text'/>
+    <xsl:choose>
+      <xsl:when test="$text">
+	<div class="divbar"><xsl:value-of select="$text"/></div>
+      </xsl:when>
+      <xsl:otherwise>
+	<div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
+      </xsl:otherwise>
+    </xsl:choose> 
+  </xsl:template>
+
+
+  <xsl:template name="direction">
+    <xsl:if test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>  
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/system.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/system.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/system.xsl	(revision 24007)
@@ -0,0 +1,42 @@
+<?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"
+  extension-element-prefixes="java">
+  
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<xsl:call-template name="pageStyle"/>
+      </head>
+      <body>
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page-wrapper">
+	  <xsl:call-template name="response" />
+	  <xsl:call-template name="greenstoneFooter"/>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+  </xsl:template>
+  
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+  
+  <xsl:template match="pageResponse">
+    <xsl:value-of select="status"/>
+  </xsl:template>
+  
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/util.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/util.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/util.xsl	(revision 24007)
@@ -0,0 +1,312 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:gslib="http://www.greenstone.org/XSL/Library"
+  xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+  xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
+  exclude-result-prefixes="util gslib gsf">
+  
+  <!-- some global parameters - these are set by whoever is invoking the transformation -->
+  <xsl:param name="interface_name"/>
+  <xsl:param name="library_name"/>
+
+  <xsl:include href="xml-to-string.xsl"/>
+  
+  <!-- every pages ................................................. -->
+  
+  <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable>
+  <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
+  
+  
+  <xsl:template name="textDirectionAttribute">
+    <xsl:attribute name="dir">
+      <xsl:choose>
+	<xsl:when test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:when>
+	<xsl:otherwise>ltr</xsl:otherwise>
+      </xsl:choose> 
+    </xsl:attribute>
+  </xsl:template>
+  
+  
+  <xsl:template name="defaultDividerBar">
+    <xsl:param name='text'/>
+    <xsl:choose>
+      <xsl:when test="$text">
+	<div class="divbar"><xsl:value-of select="$text"/></div>
+      </xsl:when>
+      <xsl:otherwise>
+	<div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
+      </xsl:otherwise>
+    </xsl:choose> 
+  </xsl:template>
+  
+  
+  <xsl:template match="error">
+    Error: <xsl:value-of select="."/>
+  </xsl:template>
+  
+  
+  <xsl:template name="displayErrorsIfAny">
+    <xsl:if test="descendant::error">
+      <script language="Javascript">
+	<xsl:text disable-output-escaping="yes">
+	  function removeAllChildren(node) {
+	  while (node.hasChildNodes()) {
+	  node.removeChild(node.firstChild);
+	  }
+	  }
+
+	  function toggleHideError(obj) {
+	  if (obj.style.display == "none") {
+	  obj.style.display = "";
+	  hide_link = document.getElementById("hide");
+	  removeAllChildren(hide_link);
+	  hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/><xsl:text disable-output-escaping="yes">"));
+	  } else {
+	  obj.style.display = "none";
+	  hide_link = document.getElementById("hide");
+	  removeAllChildren(hide_link);
+	  hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
+	  } 
+	  }
+	</xsl:text>
+      </script>
+      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/></a></p>
+      <div id="error" style="display: none;">
+	<xsl:apply-templates select="descendant::error"/>
+      </div>
+    </xsl:if>
+  </xsl:template>
+
+
+  <xsl:template name="noTextBar">
+    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
+  </xsl:template>
+  
+  
+  <xsl:template name="poweredByGS3TextBar">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 
+  </xsl:template>
+  
+  
+  <!-- site home ...................................................... -->
+
+  <xsl:template name="siteHomePageTitle">
+    <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
+  </xsl:template>
+
+
+  <xsl:template name="selectACollectionTextBar">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
+  </xsl:template>
+  
+  
+  <xsl:template name="crossCollectionQuickSearchForm">
+    <xsl:apply-templates select="serviceList/service[@name='TextQuery']" mode="quicksearch"/>
+  </xsl:template> 
+  
+  <xsl:template match="service[@name='TextQuery']" mode="quicksearch">
+    <form name="QuickSearch" method="get" action="{$library_name}">
+      <input type="hidden" name="a" value="q"/>
+      <input type="hidden" name="rt" value="rd"/>
+      <input type="hidden" name="s" value="{@name}"/>
+      <input type="hidden" name="s1.collection" value="all"/>
+      <input type="text" name="s1.query" size="20"/>
+      <input type="submit"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/></xsl:attribute></input>
+    </form>
+  </xsl:template>
+  
+  <xsl:template name="collectionLinkWithImage">
+    <xsl:choose>
+      <xsl:when test="displayItem[@name='icon']">
+	<a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
+	  <img>
+	    <xsl:attribute name="src">
+	      <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
+	    </xsl:attribute>
+	    <xsl:attribute name="alt">
+	      <xsl:value-of select="displayItem[@name='name']"/>
+	    </xsl:attribute>
+	  </img> 
+	</a>  
+      </xsl:when>
+      <xsl:otherwise>
+	<a class="noimage" href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">  
+	  <xsl:value-of select="displayItem[@name='name']"/>
+	</a>
+      </xsl:otherwise>
+    </xsl:choose> 
+  </xsl:template>
+  
+  
+  <xsl:template name="serviceClusterList">
+    <xsl:apply-templates select="serviceClusterList"/>
+  </xsl:template> 
+  
+  <xsl:template match="serviceClusterList">
+    <xsl:for-each select="serviceCluster"> 
+      <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
+    </xsl:for-each>
+  </xsl:template>
+
+  
+  <xsl:template name="serviceLink">
+    <a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
+  </xsl:template>
+
+  
+  <xsl:template name="authenticationLink">
+    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s={@name}&amp;s1.aup=Login&amp;s1.un=&amp;s1.asn="><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
+  </xsl:template> 
+  
+  
+  <xsl:template name="libraryInterfaceLink">
+    <li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li>
+  </xsl:template> 
+  
+  
+  <xsl:template name="greenstoneLogoAlternateText">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+  </xsl:template>
+
+  <!-- about page - collection home ......................... -->
+  <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+  <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+  <xsl:param name="pageType"/>
+  <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
+  <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
+
+
+  <xsl:template name="aboutCollectionPageTitle">
+    <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+    <xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/><xsl:text> </xsl:text>
+  </xsl:template>
+
+  
+  <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
+    <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
+      <xsl:choose>
+	<xsl:when test="$this-element/displayItem[@name='icon']">
+	  <img border="0">
+	    <xsl:attribute name="src">
+	      <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
+	    </xsl:attribute>	
+	    <xsl:attribute name="alt">
+	      <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+	    </xsl:attribute>
+	    <xsl:attribute name="title">
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
+	    </xsl:attribute>
+	  </img>
+	</xsl:when>
+	<xsl:otherwise>
+	  <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+	</xsl:otherwise>
+      </xsl:choose>
+    </a>
+  </xsl:template>
+
+
+  <xsl:template name="homeButtonTop">
+    <a href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
+      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></a>
+  </xsl:template>
+
+
+  <xsl:template name="helpButtonTop">
+    <xsl:choose>
+      <xsl:when test="$pageType='help'">
+	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
+	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+	  </a></li>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <xsl:template name="preferencesButtonTop">
+    <xsl:choose>
+      <xsl:when test="$pageType='pref'">
+	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
+	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+	  </a></li>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="servicesNavigationBar">
+    <xsl:for-each select="$this-element/serviceList/service">
+      <xsl:variable name="action"><xsl:choose>
+	  <xsl:when test="@hidden='true'">DO_NOT_DISPLAY</xsl:when>
+	  <xsl:when test="@name=$this-service">CURRENT</xsl:when>
+	  <xsl:when test="@type='query'">q</xsl:when>
+	  <xsl:when test="@type='browse'">b</xsl:when>
+	  <xsl:when test="@type='process'">pr</xsl:when>
+	  <xsl:when test="@type='applet'">a</xsl:when>
+	  <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+	</xsl:choose></xsl:variable>
+      <xsl:choose>
+	<xsl:when test="$action='CURRENT'">
+	  <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li>
+	</xsl:when>
+	<xsl:when test="$action !='DO_NOT_DISPLAY'">
+	  <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
+	</xsl:when>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:template>
+
+
+  <xsl:template name="collectionDescriptionTextAndServicesLinks">
+    <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
+  </xsl:template>
+
+  <xsl:template match="collection|serviceCluster">
+    <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
+    
+    <xsl:apply-templates select="serviceList">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+
+  <xsl:template match="serviceList">
+    <xsl:param name="collName"/>
+    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>
+    <xsl:choose>
+      <xsl:when test="service">
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    
+    
+    <xsl:if test="service">
+      <ul id="servicelist">  	
+	<xsl:for-each select="service">
+	  <xsl:variable name="action"><xsl:choose>
+	      <xsl:when test="@hidden='true'">DO_NOT_DISPLAY</xsl:when>
+	      <xsl:when test="@type='query'">q</xsl:when>
+	      <xsl:when test="@type='browse'">b</xsl:when>
+	      <xsl:when test="@type='process'">pr</xsl:when>
+	      <xsl:when test="@type='applet'">a</xsl:when>
+	      <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+	    </xsl:choose></xsl:variable>
+	  <xsl:if test="$action !='DO_NOT_DISPLAY'">
+	    <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li>
+	  </xsl:if>
+  	</xsl:for-each>
+      </ul> 
+    </xsl:if> 
+  </xsl:template>
+
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/xml-to-string.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/xml-to-string.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/xml-to-string.xsl	(revision 24007)
@@ -0,0 +1,319 @@
+<!--
+Copyright (c) 2001-2009, Evan Lenz
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of Lenz Consulting Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+	    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Recent changes:
+
+2010-06-10: Added the $force-exclude-all-namespaces parameter
+2009-10-19: Added the $exclude-these-namespaces parameter 
+2009-10-08: Added $att-value parameter and template name to template rule for attributes.
+
+-->
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:output omit-xml-declaration="yes"/>
+
+  <xsl:param name="use-empty-syntax" select="true()"/>
+  <xsl:param name="exclude-unused-prefixes" select="true()"/>
+
+  <xsl:param name="force-exclude-all-namespaces" select="false()"/>
+
+  <!-- a node-set; each node's string-value
+       will be interpreted as a namespace URI to be
+       excluded from the serialization. -->
+  <xsl:param name="namespaces-to-exclude" select="/.."/>
+                                          <!-- initialized to empty node-set -->
+
+  <xsl:param name="start-tag-start"     select="'&lt;'"/>
+  <xsl:param name="start-tag-end"       select="'>'"/>
+  <xsl:param name="empty-tag-end"       select="'/>'"/>
+  <xsl:param name="end-tag-start"       select="'&lt;/'"/>
+  <xsl:param name="end-tag-end"         select="'>'"/>
+  <xsl:param name="space"               select="' '"/>
+  <xsl:param name="ns-decl"             select="'xmlns'"/>
+  <xsl:param name="colon"               select="':'"/>
+  <xsl:param name="equals"              select="'='"/>
+  <xsl:param name="attribute-delimiter" select="'&quot;'"/>
+  <xsl:param name="comment-start"       select="'&lt;!--'"/>
+  <xsl:param name="comment-end"         select="'-->'"/>
+  <xsl:param name="pi-start"            select="'&lt;?'"/>
+  <xsl:param name="pi-end"              select="'?>'"/>
+
+  <xsl:template name="xml-to-string">
+    <xsl:param name="node-set" select="."/>
+    <xsl:apply-templates select="$node-set" mode="xml-to-string">
+      <xsl:with-param name="depth" select="1"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+<!--
+  <xsl:template match="/" name="xml-to-string-root-rule">
+    <xsl:call-template name="xml-to-string"/>
+  </xsl:template>
+-->
+
+  <xsl:template match="/" mode="xml-to-string">
+    <xsl:param name="depth"/>
+    <xsl:apply-templates mode="xml-to-string">
+      <xsl:with-param name="depth" select="$depth"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="*" mode="xml-to-string">
+    <xsl:param name="depth"/>
+    <xsl:variable name="element" select="."/>
+    <xsl:value-of select="$start-tag-start"/>
+    <xsl:call-template name="element-name">
+      <xsl:with-param name="text" select="name()"/>
+    </xsl:call-template>
+    <xsl:apply-templates select="@*" mode="xml-to-string"/>
+    <xsl:if test="not($force-exclude-all-namespaces)">
+      <xsl:for-each select="namespace::*">
+        <xsl:call-template name="process-namespace-node">
+          <xsl:with-param name="element" select="$element"/>
+          <xsl:with-param name="depth" select="$depth"/>
+        </xsl:call-template>
+      </xsl:for-each>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="node() or not($use-empty-syntax)">
+        <xsl:value-of select="$start-tag-end"/>
+        <xsl:apply-templates mode="xml-to-string">
+          <xsl:with-param name="depth" select="$depth + 1"/>
+        </xsl:apply-templates>
+        <xsl:value-of select="$end-tag-start"/>
+        <xsl:call-template name="element-name">
+          <xsl:with-param name="text" select="name()"/>
+        </xsl:call-template>
+        <xsl:value-of select="$end-tag-end"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$empty-tag-end"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="process-namespace-node">
+    <xsl:param name="element"/>
+    <xsl:param name="depth"/>
+    <xsl:variable name="declaredAbove">
+      <xsl:call-template name="isDeclaredAbove">
+        <xsl:with-param name="depth" select="$depth - 1"/>
+        <xsl:with-param name="element" select="$element/.."/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="is-used-on-this-element" select="($element    | $element/@*) [namespace-uri() = current()]"/>
+    <xsl:variable name="is-used-on-a-descendant" select="($element//* | $element//@*)[namespace-uri() = current()]"/>          
+    <xsl:variable name="is-unused" select="not($is-used-on-this-element) and
+                                           not($is-used-on-a-descendant)"/>
+    <xsl:variable name="exclude-ns" select="($is-unused and $exclude-unused-prefixes) or
+                                            (. = $namespaces-to-exclude)"/>
+
+    <xsl:variable name="force-include" select="$is-used-on-this-element and (. = $namespaces-to-exclude)"/>
+
+    <xsl:if test="(name() != 'xml') and ($force-include or (not($exclude-ns) and not(string($declaredAbove))))">
+      <xsl:value-of select="$space"/>
+      <xsl:value-of select="$ns-decl"/>
+      <xsl:if test="name()">
+        <xsl:value-of select="$colon"/>
+        <xsl:call-template name="ns-prefix">
+          <xsl:with-param name="text" select="name()"/>
+        </xsl:call-template>
+      </xsl:if>
+      <xsl:value-of select="$equals"/>
+      <xsl:value-of select="$attribute-delimiter"/>
+      <xsl:call-template name="ns-uri">
+        <xsl:with-param name="text" select="string(.)"/>
+      </xsl:call-template>
+      <xsl:value-of select="$attribute-delimiter"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="isDeclaredAbove">
+    <xsl:param name="element"/>
+    <xsl:param name="depth"/>
+    <xsl:if test="$depth > 0">
+      <xsl:choose>
+        <xsl:when test="$element/namespace::*[name(.)=name(current()) and .=current()]">1</xsl:when>
+        <xsl:when test="$element/namespace::*[name(.)=name(current())]"/>
+        <xsl:otherwise>
+          <xsl:call-template name="isDeclaredAbove">
+            <xsl:with-param name="depth" select="$depth - 1"/>
+            <xsl:with-param name="element" select="$element/.."/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="@*" mode="xml-to-string" name="serialize-attribute">
+    <xsl:param name="att-value" select="string(.)"/>
+    <xsl:value-of select="$space"/>
+    <xsl:call-template name="attribute-name">
+      <xsl:with-param name="text" select="name()"/>
+    </xsl:call-template>
+    <xsl:value-of select="$equals"/>
+    <xsl:value-of select="$attribute-delimiter"/>
+    <xsl:call-template name="attribute-value">
+      <xsl:with-param name="text" select="$att-value"/>
+    </xsl:call-template>
+    <xsl:value-of select="$attribute-delimiter"/>
+  </xsl:template>
+
+  <xsl:template match="comment()" mode="xml-to-string">
+    <xsl:value-of select="$comment-start"/>
+    <xsl:call-template name="comment-text">
+      <xsl:with-param name="text" select="string(.)"/>
+    </xsl:call-template>
+    <xsl:value-of select="$comment-end"/>
+  </xsl:template>
+
+  <xsl:template match="processing-instruction()" mode="xml-to-string">
+    <xsl:value-of select="$pi-start"/>
+    <xsl:call-template name="pi-target">
+      <xsl:with-param name="text" select="name()"/>
+    </xsl:call-template>
+    <xsl:value-of select="$space"/>
+    <xsl:call-template name="pi-text">
+      <xsl:with-param name="text" select="string(.)"/>
+    </xsl:call-template>
+    <xsl:value-of select="$pi-end"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="xml-to-string">
+    <xsl:call-template name="text-content">
+      <xsl:with-param name="text" select="string(.)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="element-name">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="attribute-name">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="attribute-value">
+    <xsl:param name="text"/>
+    <xsl:variable name="escaped-markup">
+      <xsl:call-template name="escape-markup-characters">
+        <xsl:with-param name="text" select="$text"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$attribute-delimiter = &quot;'&quot;">
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="$escaped-markup"/>
+          <xsl:with-param name="replace" select="&quot;'&quot;"/>
+          <xsl:with-param name="with" select="'&amp;apos;'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$attribute-delimiter = '&quot;'">
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="$escaped-markup"/>
+          <xsl:with-param name="replace" select="'&quot;'"/>
+          <xsl:with-param name="with" select="'&amp;quot;'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="$escaped-markup"/>
+          <xsl:with-param name="replace" select="$attribute-delimiter"/>
+          <xsl:with-param name="with" select="''"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="ns-prefix">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="ns-uri">
+    <xsl:param name="text"/>
+    <xsl:call-template name="attribute-value">
+      <xsl:with-param name="text" select="$text"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="text-content">
+    <xsl:param name="text"/>
+    <xsl:call-template name="escape-markup-characters">
+      <xsl:with-param name="text" select="$text"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="pi-target">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="pi-text">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="comment-text">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="escape-markup-characters">
+    <xsl:param name="text"/>
+    <xsl:variable name="ampEscaped">
+      <xsl:call-template name="replace-string">
+        <xsl:with-param name="text" select="$text"/>
+        <xsl:with-param name="replace" select="'&amp;'"/>
+        <xsl:with-param name="with" select="'&amp;amp;'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:variable name="ltEscaped">
+      <xsl:call-template name="replace-string">
+        <xsl:with-param name="text" select="$ampEscaped"/>
+        <xsl:with-param name="replace" select="'&lt;'"/>
+        <xsl:with-param name="with" select="'&amp;lt;'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:call-template name="replace-string">
+      <xsl:with-param name="text" select="$ltEscaped"/>
+      <xsl:with-param name="replace" select="']]>'"/>
+      <xsl:with-param name="with" select="']]&amp;gt;'"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="replace-string">
+    <xsl:param name="text"/>
+    <xsl:param name="replace"/>
+    <xsl:param name="with"/>
+    <xsl:variable name="stringText" select="string($text)"/>
+    <xsl:choose>
+      <xsl:when test="contains($stringText,$replace)">
+        <xsl:value-of select="substring-before($stringText,$replace)"/>
+        <xsl:value-of select="$with"/>
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="substring-after($stringText,$replace)"/>
+          <xsl:with-param name="replace" select="$replace"/>
+          <xsl:with-param name="with" select="$with"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$stringText"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/berry.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/berry.css	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/berry.css	(revision 24007)
@@ -1,317 +1,1 @@
-
-
-div.globalwrapper{
-  font-family: sans-serif, arial, helvetica;
-  margin: 0 2em 0 4em; 
-  padding:0;
- 
-}
-
-div#content{
-  font-family: sans-serif, arial, helvetica;
-  margin: 0.5em 0 0.5em 0;
-  padding: 0; 
-
-}
-
-div.banner{
- margin:0;
- padding:0;
-
-}
-
-div.pageinfo{
-  float:right;
-  text-align: right;
-  padding: 0;
-  margin:0 0 3px 0;	
-  width: 50%;
-}
-
-div.basketimage{
-  float:left;
-  width: 45%;
-  padding:0;
-  margin:0;
-
-}
-
-
-div.bannerextra {
-   clear: both;
-   padding: 0.2em 0 0 0;
-}
-
-/* home, help, preferences links */
-p.bannerlinks {
-  font-weight: bold;
-  margin:0;
-  padding:0;
-}
-
-
-p.bannertitle {
-  font-family: sans-serif, arial, helvetica;
-  font-size: 24px;
-  font-weight: bold;
-  white-space: nowrap;
-  margin: 0;
-  padding: 0.5em 0 0.5em 0em;
-  background: url("../images/tile13.jpeg") 0 0 repeat-y;
- 
-}
-
-
-a.navlink{
-  vertical-align: top;
-  padding: 0.2em 0.5em 0 0;
-  color: black;
-  text-decoration: none; 
-  background-image: url("../images/bg_off.png");
- }
-
-a.navlink:hover {
-   background-image: url("../images/bg_on.png");
- }
-
-p.navbar{
-  text-align: center;
-   background: url("../images/bg_green.png") 0 0 repeat-x;
-   font-weight: bold;
-}
-
-span.navlink{
-   margin:0 3em  0 3em;
-   padding:0 0.5em 0 0.5em;
-   background-image: url("../images/bg_off.png");
-   cursor: pointer;
-}
-
-span.navlink:hover {
-   background-image: url("../images/bg_on.png");
- }
-
-img#trashbin{
- float:right;
-}
-
-span.berryradio{
- cursor: pointer;
- margin:0 3em  0 3em;
- font-weight: bold;
-}
-
-.berrycheck{
- font-size: 80%;  
- cursor: pointer;
- font-weight: bold;
- margin: 0 0 0 0.5em;
-}
-
-#urlcheck{
- float: left;
- padding: 0;
- margin: 0;
- 
-}
-
-.pick {
-  visibility:hidden;
-}
-
-div#berrybasket {
-   float:right;
-   font-family:sans-serif;
-   height:120px;
-   width: 100px;
-   padding: 4px 5px 4px 4px;
-   background-color:#E0F0E0;
-   background: url("../images/berrybasket.png") 0 0 no-repeat;
-   margin:0;
-   font-size:100%;
-   text-align:center;
-   #border:1px solid #2E8B57;	
-   z-index:10;
-   cursor: pointer;
- }
-
-div#baskethandle {
-  padding: 0;
-  cursor:move;
-  height: 30px;
-  width:auto;
-  #background-color:#eeeeee;
-   background:transparent;
-   margin:0 ;
-  }
-
-div#berries {
-  text-align:left;
-  height: auto;
-  margin: 0;
-  padding:0;
-  overflow: hidden;   
-}
-
-
-p#documentberries {
-   font-weight: bold;
-   font-size:90%;
-}
-
-.documentberry {
-  margin:0 2em 0 0;
-  padding:0;
-  visibility:hidden;
-}
-
-
-#doclist{
-  margin: 0;
- 
-}
-
-.content{
- font-family:sans-serif;
- text-align:left;
-}
-
-li.berryitem {
-   padding: 0;
-   margin: 0 ;
-   color: black;
-   font-size: 90%;
-}
-
-li.berrydoc {
-  font-size: 90%;
-  cursor: pointer;
-  padding: 0 ;
-  margin: 0 1em 0 0; 
-}
-
-a.expandcontract {
-  font-size: 90%;
-  color: red
-}
-
-
-.item {
-  font-size: 90%;
- 
-}
-
-a.fullview:visited{
- color:red;
-}
-
-a#hideview:visited{
- color:red;
-}
-
-a.fullview{
-  float:left;
-  font-size: 90%;
-  margin: 0 0 0 20px;
-  padding:0;
-  cursor: pointer;
-  color:red;  
-  text-decoration:none;
- }
-
-a#hideView{
-  float:right;
-  font-size: 90%;
-  margin:0 20px 0 0;
-  padding:0;
-  color: red;
-  cursor: pointer;
-  text-decoration:none;
-}
-
-
-.berrydelete{
-   font-family:sans-serif;
-   background-color:#E0F0E0;
-   border:1px solid #2E8B57;   
-   padding: 4px  4px 4px 4px; 
-   font-weight: bold;
-   cursor: pointer;
-   width: 6em;
-   color: red;
-   font-size: 90%;
-}
-
-.sendbutton{
-   font-family:sans-serif;
-   background-color:#E0F0E0;
-   border:1px solid #2E8B57;   
-   padding: 4px  4px 4px 4px; 
-   font-weight: bold;
-   cursor: pointer;
-   width: 5em;
-   font-size: 90%;
-   margin: 1em 0 0 0;
-}
-
-.berrybutton{
-   font-family:sans-serif;
-   background-color:#E0F0E0;
-   border:1px solid #2E8B57;   
-   padding: 4px  4px 4px 4px; 
-   font-weight: bold;
-   cursor: pointer;
-   width: 10em;
-   font-size: 90%;
-}
-
-.mailinput {
-  border:1px solid #2E8B57; 
-  width: 20em;
-  height: 1.5em;
-  font-size: 90%
-}
-
-.mailitem{
-   text-align: left;
- }
-
-
-textarea#pretextarea {
-  font-family:sans-serif;
-  border:1px solid #2E8B57; 
-  width: 100%;
-  height: 25em;
-  font-size: 90%;
-  margin: 0.5em 0 0 0;
-  padding:0;
-}
-
-div#trashbin{
-   float: right;
-   height: 60px;
-   width:  55px;
-   padding: 0;
-   background: url("../images/trash-empty.png") 0 0 no-repeat;
-   margin:0;
-   z-index:10;
-}
-
-div#binhandle{
- height: 60px;
- width:  55px;
- cursor: move;
-}
-
-span.extralink {
-  cursor:pointer;
-  font-size:80%;
-  font-weight:bold;
-  margin:0 2em 0 0;
-  color:black;
-}
-
-span.extralink:hover {
-   color: #2E8B57;
-}
-
+div.globalwrapper{font-family:sans-serif,arial,helvetica;margin:0 2em 0 4em;padding:0}div#content{font-family:sans-serif,arial,helvetica;margin:.5em 0 .5em 0;padding:0}div.banner{margin:0;padding:0}div.pageinfo{float:right;text-align:right;padding:0;margin:0 0 3px 0;width:50%}div.basketimage{float:left;width:45%;padding:0;margin:0}div.bannerextra{clear:both;padding:.2em 0 0 0}p.bannerlinks{font-weight:bold;margin:0;padding:0}p.bannertitle{font-family:sans-serif,arial,helvetica;font-size:24px;font-weight:bold;white-space:nowrap;margin:0;padding:.5em 0 .5em 0;background:url("../images/tile13.jpeg") 0 0 repeat-y}a.navlink{vertical-align:top;padding:.2em .5em 0 0;color:black;text-decoration:none;background-image:url("../images/bg_off.png")}a.navlink:hover{background-image:url("../images/bg_on.png")}p.navbar{text-align:center;background:url("../images/bg_green.png") 0 0 repeat-x;font-weight:bold}span.navlink{margin:0 3em 0 3em;padding:0 .5em 0 .5em;background-image:url("../images/bg_off.png");cursor:pointer}span.navlink:hover{background-image:url("../images/bg_on.png")}img#trashbin{float:right}span.berryradio{cursor:pointer;margin:0 3em 0 3em;font-weight:bold}.berrycheck{font-size:80%;cursor:pointer;font-weight:bold;margin:0 0 0 .5em}#urlcheck{float:left;padding:0;margin:0}.pick{visibility:hidden}div#berrybasket{float:right;font-family:sans-serif;height:120px;width:100px;padding:4px 5px 4px 4px;background-color:#e0f0e0;background:url("../images/berrybasket.png") 0 0 no-repeat;margin:0;font-size:100%;text-align:center;#border:1px solid #2e8b57;z-index:10;cursor:pointer}div#baskethandle{padding:0;cursor:move;height:30px;width:auto;#background-color:#eee;background:transparent;margin:0}div#berries{text-align:left;height:auto;margin:0;padding:0;overflow:hidden}p#documentberries{font-weight:bold;font-size:90%}.documentberry{margin:0 2em 0 0;padding:0;visibility:hidden}#doclist{margin:0}.content{font-family:sans-serif;text-align:left}li.berryitem{padding:0;margin:0;color:black;font-size:90%}li.berrydoc{font-size:90%;cursor:pointer;padding:0;margin:0 1em 0 0}a.expandcontract{font-size:90%;color:red}.item{font-size:90%}a.fullview:visited{color:red}a#hideview:visited{color:red}a.fullview{float:left;font-size:90%;margin:0 0 0 20px;padding:0;cursor:pointer;color:red;text-decoration:none}a#hideView{float:right;font-size:90%;margin:0 20px 0 0;padding:0;color:red;cursor:pointer;text-decoration:none}.berrydelete{font-family:sans-serif;background-color:#e0f0e0;border:1px solid #2e8b57;padding:4px 4px 4px 4px;font-weight:bold;cursor:pointer;width:6em;color:red;font-size:90%}.sendbutton{font-family:sans-serif;background-color:#e0f0e0;border:1px solid #2e8b57;padding:4px 4px 4px 4px;font-weight:bold;cursor:pointer;width:5em;font-size:90%;margin:1em 0 0 0}.berrybutton{font-family:sans-serif;background-color:#e0f0e0;border:1px solid #2e8b57;padding:4px 4px 4px 4px;font-weight:bold;cursor:pointer;width:10em;font-size:90%}.mailinput{border:1px solid #2e8b57;width:20em;height:1.5em;font-size:90%}.mailitem{text-align:left}textarea#pretextarea{font-family:sans-serif;border:1px solid #2e8b57;width:100%;height:25em;font-size:90%;margin:.5em 0 0 0;padding:0}div#trashbin{float:right;height:60px;width:55px;padding:0;background:url("../images/trash-empty.png") 0 0 no-repeat;margin:0;z-index:10}div#binhandle{height:60px;width:55px;cursor:move}span.extralink{cursor:pointer;font-size:80%;font-weight:bold;margin:0 2em 0 0;color:black}span.extralink:hover{color:#2e8b57}
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/berry_whitespace.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/berry_whitespace.css	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/berry_whitespace.css	(revision 24007)
@@ -0,0 +1,317 @@
+
+
+div.globalwrapper{
+  font-family: sans-serif, arial, helvetica;
+  margin: 0 2em 0 4em; 
+  padding:0;
+ 
+}
+
+div#content{
+  font-family: sans-serif, arial, helvetica;
+  margin: 0.5em 0 0.5em 0;
+  padding: 0; 
+
+}
+
+div.banner{
+ margin:0;
+ padding:0;
+
+}
+
+div.pageinfo{
+  float:right;
+  text-align: right;
+  padding: 0;
+  margin:0 0 3px 0;	
+  width: 50%;
+}
+
+div.basketimage{
+  float:left;
+  width: 45%;
+  padding:0;
+  margin:0;
+
+}
+
+
+div.bannerextra {
+   clear: both;
+   padding: 0.2em 0 0 0;
+}
+
+/* home, help, preferences links */
+p.bannerlinks {
+  font-weight: bold;
+  margin:0;
+  padding:0;
+}
+
+
+p.bannertitle {
+  font-family: sans-serif, arial, helvetica;
+  font-size: 24px;
+  font-weight: bold;
+  white-space: nowrap;
+  margin: 0;
+  padding: 0.5em 0 0.5em 0em;
+  background: url("../images/tile13.jpeg") 0 0 repeat-y;
+ 
+}
+
+
+a.navlink{
+  vertical-align: top;
+  padding: 0.2em 0.5em 0 0;
+  color: black;
+  text-decoration: none; 
+  background-image: url("../images/bg_off.png");
+ }
+
+a.navlink:hover {
+   background-image: url("../images/bg_on.png");
+ }
+
+p.navbar{
+  text-align: center;
+   background: url("../images/bg_green.png") 0 0 repeat-x;
+   font-weight: bold;
+}
+
+span.navlink{
+   margin:0 3em  0 3em;
+   padding:0 0.5em 0 0.5em;
+   background-image: url("../images/bg_off.png");
+   cursor: pointer;
+}
+
+span.navlink:hover {
+   background-image: url("../images/bg_on.png");
+ }
+
+img#trashbin{
+ float:right;
+}
+
+span.berryradio{
+ cursor: pointer;
+ margin:0 3em  0 3em;
+ font-weight: bold;
+}
+
+.berrycheck{
+ font-size: 80%;  
+ cursor: pointer;
+ font-weight: bold;
+ margin: 0 0 0 0.5em;
+}
+
+#urlcheck{
+ float: left;
+ padding: 0;
+ margin: 0;
+ 
+}
+
+.pick {
+  visibility:hidden;
+}
+
+div#berrybasket {
+   float:right;
+   font-family:sans-serif;
+   height:120px;
+   width: 100px;
+   padding: 4px 5px 4px 4px;
+   background-color:#E0F0E0;
+   background: url("../images/berrybasket.png") 0 0 no-repeat;
+   margin:0;
+   font-size:100%;
+   text-align:center;
+   #border:1px solid #2E8B57;	
+   z-index:10;
+   cursor: pointer;
+ }
+
+div#baskethandle {
+  padding: 0;
+  cursor:move;
+  height: 30px;
+  width:auto;
+  #background-color:#eeeeee;
+   background:transparent;
+   margin:0 ;
+  }
+
+div#berries {
+  text-align:left;
+  height: auto;
+  margin: 0;
+  padding:0;
+  overflow: hidden;   
+}
+
+
+p#documentberries {
+   font-weight: bold;
+   font-size:90%;
+}
+
+.documentberry {
+  margin:0 2em 0 0;
+  padding:0;
+  visibility:hidden;
+}
+
+
+#doclist{
+  margin: 0;
+ 
+}
+
+.content{
+ font-family:sans-serif;
+ text-align:left;
+}
+
+li.berryitem {
+   padding: 0;
+   margin: 0 ;
+   color: black;
+   font-size: 90%;
+}
+
+li.berrydoc {
+  font-size: 90%;
+  cursor: pointer;
+  padding: 0 ;
+  margin: 0 1em 0 0; 
+}
+
+a.expandcontract {
+  font-size: 90%;
+  color: red
+}
+
+
+.item {
+  font-size: 90%;
+ 
+}
+
+a.fullview:visited{
+ color:red;
+}
+
+a#hideview:visited{
+ color:red;
+}
+
+a.fullview{
+  float:left;
+  font-size: 90%;
+  margin: 0 0 0 20px;
+  padding:0;
+  cursor: pointer;
+  color:red;  
+  text-decoration:none;
+ }
+
+a#hideView{
+  float:right;
+  font-size: 90%;
+  margin:0 20px 0 0;
+  padding:0;
+  color: red;
+  cursor: pointer;
+  text-decoration:none;
+}
+
+
+.berrydelete{
+   font-family:sans-serif;
+   background-color:#E0F0E0;
+   border:1px solid #2E8B57;   
+   padding: 4px  4px 4px 4px; 
+   font-weight: bold;
+   cursor: pointer;
+   width: 6em;
+   color: red;
+   font-size: 90%;
+}
+
+.sendbutton{
+   font-family:sans-serif;
+   background-color:#E0F0E0;
+   border:1px solid #2E8B57;   
+   padding: 4px  4px 4px 4px; 
+   font-weight: bold;
+   cursor: pointer;
+   width: 5em;
+   font-size: 90%;
+   margin: 1em 0 0 0;
+}
+
+.berrybutton{
+   font-family:sans-serif;
+   background-color:#E0F0E0;
+   border:1px solid #2E8B57;   
+   padding: 4px  4px 4px 4px; 
+   font-weight: bold;
+   cursor: pointer;
+   width: 10em;
+   font-size: 90%;
+}
+
+.mailinput {
+  border:1px solid #2E8B57; 
+  width: 20em;
+  height: 1.5em;
+  font-size: 90%
+}
+
+.mailitem{
+   text-align: left;
+ }
+
+
+textarea#pretextarea {
+  font-family:sans-serif;
+  border:1px solid #2E8B57; 
+  width: 100%;
+  height: 25em;
+  font-size: 90%;
+  margin: 0.5em 0 0 0;
+  padding:0;
+}
+
+div#trashbin{
+   float: right;
+   height: 60px;
+   width:  55px;
+   padding: 0;
+   background: url("../images/trash-empty.png") 0 0 no-repeat;
+   margin:0;
+   z-index:10;
+}
+
+div#binhandle{
+ height: 60px;
+ width:  55px;
+ cursor: move;
+}
+
+span.extralink {
+  cursor:pointer;
+  font-size:80%;
+  font-weight:bold;
+  margin:0 2em 0 0;
+  color:black;
+}
+
+span.extralink:hover {
+   color: #2E8B57;
+}
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/core.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/core.css	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/core.css	(revision 24007)
@@ -1,376 +1,1 @@
-
-body {
-  padding:0;
-  margin:0;
-  font-family: sans-serif, arial, helvetica;   
-  background: #fff url('../images/chalk.gif') scroll repeat-y left top;
-  color: #000000 
-}
-
-/* this contains everything - all the other divs */
-#page-wrapper {
-  margin: .5em 3em 0 5em;
-}
-
-a:link
-{
-color: #339966;
-}
-
-a:visited
-{
-color: #066;
-}
-
-a:hover, a:active
-{
-color: #99CC33;
-}
-
-div#banner ul, ul#resultlist, ul#tocnodes, ul#docbuttons, ul.tocnode, ul#bannerlist, ul#navbarlist, ul#collectionlist, ul#servicelist, ul#classifierlist, ul#classifiernodelist, ul#queryitemlist{
-  list-style-type:none;
-  margin:0;
-  padding:0;
-}
-
-div#banner ul li, ul#bannerlist li, ul#navbarlist li {
-  display: inline;
-  margin:0;
-  padding:0;	
-}
-
-
-ul li>select, ul li>input {
-  padding: 0;
-  margin-left:5px;
-}
-
-
-div#banner {
-  margin: 0;
-  padding:0;
-  overflow: hidden;
-}
-
-div#banner p {
-  margin:0;
-  padding: 0;
-  float:left;
-  font-size: 16px;
-  text-align: left;
-  overflow:hidden	
-}
-
-div#banner p a {
-  background-image: url('../images/banner_bg.png');
-  background-repeat: repeat-y;
-}
-
-
-div#banner ul{
-  margin:0;
-  padding:0; 
-  float:right; 
-  font-size: 12px;  
-}
-
-div#banner a{
-  text-decoration: none;
-  color:#000000;
-}
-
-
-ul#bannerlist li a {
-  padding: 0 10px 0 10px; 
-  text-decoration: none;
-}
-
-ul#bannerlist li a:link, ul#bannerlist li a:visited
-{
- background-color: #DEE79C;
- background-image: url('../images/bg_off.png');
- text-decoration: none
-}
-
-ul#bannerlist li a:hover{
- background-color: #FFFF66;
- background-image: url('../images/bg_on.png') ;
- text-decoration: none
-}
-
-
-div#navbar{
-  clear:both;
-}
-
-ul#navbarlist{
-  margin:0;
-  padding:0; 
-  list-style-type: none; 
-  text-align:center;
-  width: 100%;
-  font-size: 80%;
-  background-image: url('../images/bg_green.png');	  
-  background-color: #99CC99
- }
-
-ul#navbarlist li a {
-  padding: 0 20px 0 20px; 
-  margin: 0;
-  color: #000000; 
-  text-decoration: none;
-}
-
-ul#navbarlist li a:link, ul#navbarlist li a:visited{
-   background-image: url('../images/bg_off.png') ;
- }
-
-ul#navbarlist li a:hover{
-  background-image: url('../images/bg_on.png') ;
-}
-
-
-ul#collectionlist li, ul#servicelist li{
-  display:block;
-  padding:0;
-  margin: .2em 0 0 0;
-  overflow:hidden;
-}
-
-
-ul#collectionlist img{
-  margin:0;
-  padding:0;
-  width: 150px;
-  height: 45px;
-  border: 1px solid black;
-  background-image: url('../images/collectimg_bg.png');
-  background-repeat: repeat-y;
-  overflow:hidden
-}
-
-ul#collectionlist li a.noimage{
-  display: block;
-  margin:0;
-  width: 145px;
-  height: 40px;
-  border: 1px solid black;
-  background-image: url('../images/collectimg_bg.png');
-  background-repeat: repeat-y;
-  overflow:hidden; padding-left:5px; padding-right:0; padding-top:5px; padding-bottom:0
-
-}
-
-ul#collectionlist li a{
-  font-size: 16px;
-  color: #000000;
-  text-decoration: none;  
-  font-weight: bold;
-}
-
-ul#servicelist li a{
-  margin:0 .5em 0 0;
-}
-
-ul#queryitemlist li{
-  display:block;
-  margin: .2em 0 .2em 0;
-}
-
-ul#classifierlist li{
-  list-style: none;
-  margin: 0 0 5px 0;
-  padding: 0;
-  display: block;
-  color:#000;
-}
-
-ul#classifierlist li#activeclassifier{
-  font-weight:bold;
-  padding: 0 0 0 5px;
-  margin:0 0 5px 0;
-}
-
- ul#classifierlist li a:link, ul#classifierlist li a:visited  
-{
-   display:block;
-   margin:0;
-   background-image: url('../images/bg_off.png');
-   text-decoration: none; 
-   color:#000;
-   width:100%; padding-left:5px; padding-right:0; padding-top:2px; padding-bottom:2px
- } 
-
-ul#classifierlist li a:hover, ul#classifierlist li a:active
-{
-  display:block;
-  margin:0;
-  background-image: url('../images/bg_on.png');
-  text-decoration: none; padding-left:5px; padding-right:0; padding-top:2px; padding-bottom:2px
-  
-}
-
-ul#classifierlist{
-   float:left;
-   font-size: 14px;
-   text-align: left;
-   width: 15%;
-   margin:0;
-   padding:0;
-}
-
-div#classifiers{
-  float:left;
-  width: 75%;
-  margin:0;
-  padding:0 0 0 10px;
- }
-
-ul#classifiernodelist li{
-  list-style: none;
-  margin: 0;
-  padding: 5px 0 0 0;
-  display: block;
- }
-
-ul.childrenlist{
-  margin: 0 0 0 0;
-  padding: 0 0 0 20px;
-  display: block;
-  width: 100%;
-}
-
-div#content{
- clear: both;
- overflow: hidden;
- margin: .2em 0 0 0;
-}
-
-/* bg image set in style macro */
-div.divbar { 
-  clear: both; 
-  background-image: url('../images/bg_green.png'); 
-  width: 100%; 
-  text-align: center;
-  font-size:80%
-}
-
-
-/** query form style**/
-div#queryform{
-
-}
-
-/** search result style */
-div#terminfo{
-
-}
-
-div#matchdocs{
-
-}
-
-div.resultnavigation{
- margin: 0;
- padding:0;
-}
-
-ul#resultlist li{
-  display:block;
-}
-
-
-div.documenttext { clear: both; } /* come after any floating divs */
-
-div#documentheading{
-  font-size: 16pt;
-  font-weight: bold;
-}
-
-div#documentinfo { 
-  float:left;
-  padding:0;
-  margin:0;
-  width:24%;
-} 
-
-div#toc{
-  float:left;
-  text-align:left;
-  width:60%;
-  padding:0;
-  margin:0; 
-}
-
-ul#docbuttons li {
-   display: block;
-  font-size: 11px;
-  font-weight: bold;
-  background: #f7e7c5;
-  margin: 1px;
-  border: 1px solid #eeddbb;
-  text-align: center;
-  vertical-align: middle;
-  height: 30px; /* IE6 and NS4 treat width/height as min-width/min-height */
-  width: 110px;
-}
-
-
-ul#tocnodes li{
- margin: 0;
- padding: 5px 0 0 0;
- display:block;
-}
-
-ul.tocnode {
-  margin:0;
-  padding:5px 0 0 20px;
-}
-
-ul.tocnode  a{
- margin: 0;
- padding:0 5px 0 0;
- }
-
-span.bold{
-  font-weight: bold;	   
-}
-
-div.documentarrows{
-  clear: both; 
-  margin: 0 0 0 0;
-  padding: 1em 0 0 0;   
-}
-
-img.lessarrow{
-  float:left;
-  border: none;  
-}
-
-img.morearrow{
-  float:right;
-  border:none; 
-}
-
-div.formheading{
-  font-size: 16pt;
-  font-weight: bold;
-  margin: .5em 0 0;
-  padding:0;
-}
-
-ul#presprefs li, ul#berrybasketprefs li, ul#searchprefs li{
-  display: block;
-} 
-
-
-div.phrasebrowse{
-  text-align:center;
-  padding:0;
-  margin: .5em 0 .5em 0;   
-}
-
-div.QuickSearch {
-  float: right;
-}
-
+body{padding:0;margin:0;font-family:sans-serif,arial,helvetica;background:#fff url('../images/chalk.gif') scroll repeat-y left top;color:#000}#page-wrapper{margin:.5em 3em 0 5em}a:link{color:#396}a:visited{color:#066}a:hover,a:active{color:#9c3}div#banner ul,ul#resultlist,ul#tocnodes,ul#docbuttons,ul.tocnode,ul#bannerlist,ul#navbarlist,ul#collectionlist,ul#servicelist,ul#classifierlist,ul#classifiernodelist,ul#queryitemlist{list-style-type:none;margin:0;padding:0}div#banner ul li,ul#bannerlist li,ul#navbarlist li{display:inline;margin:0;padding:0}ul li>select,ul li>input{padding:0;margin-left:5px}div#banner{margin:0;padding:0;overflow:hidden}div#banner p{margin:0;padding:0;float:left;font-size:16px;text-align:left;overflow:hidden}div#banner p a{background-image:url('../images/banner_bg.png');background-repeat:repeat-y}div#banner ul{margin:0;padding:0;float:right;font-size:12px}div#banner a{text-decoration:none;color:#000}ul#bannerlist li a{padding:0 10px 0 10px;text-decoration:none}ul#bannerlist li a:link,ul#bannerlist li a:visited{background-color:#dee79c;background-image:url('../images/bg_off.png');text-decoration:none}ul#bannerlist li a:hover{background-color:#ff6;background-image:url('../images/bg_on.png');text-decoration:none}div#navbar{clear:both}ul#navbarlist{margin:0;padding:0;list-style-type:none;text-align:center;width:100%;font-size:80%;background-image:url('../images/bg_green.png');background-color:#9c9}ul#navbarlist li a{padding:0 20px 0 20px;margin:0;color:#000;text-decoration:none}ul#navbarlist li a:link,ul#navbarlist li a:visited{background-image:url('../images/bg_off.png')}ul#navbarlist li a:hover{background-image:url('../images/bg_on.png')}ul#collectionlist li,ul#servicelist li{display:block;padding:0;margin:.2em 0 0 0;overflow:hidden}ul#collectionlist img{margin:0;padding:0;width:150px;height:45px;border:1px solid black;background-image:url('../images/collectimg_bg.png');background-repeat:repeat-y;overflow:hidden}ul#collectionlist li a.noimage{display:block;margin:0;width:145px;height:40px;border:1px solid black;background-image:url('../images/collectimg_bg.png');background-repeat:repeat-y;overflow:hidden;padding-left:5px;padding-right:0;padding-top:5px;padding-bottom:0}ul#collectionlist li a{font-size:16px;color:#000;text-decoration:none;font-weight:bold}ul#servicelist li a{margin:0 .5em 0 0}ul#queryitemlist li{display:block;margin:.2em 0 .2em 0}ul#classifierlist li{list-style:none;margin:0 0 5px 0;padding:0;display:block;color:#000}ul#classifierlist li#activeclassifier{font-weight:bold;padding:0 0 0 5px;margin:0 0 5px 0}ul#classifierlist li a:link,ul#classifierlist li a:visited{display:block;margin:0;background-image:url('../images/bg_off.png');text-decoration:none;color:#000;width:100%;padding-left:5px;padding-right:0;padding-top:2px;padding-bottom:2px}ul#classifierlist li a:hover,ul#classifierlist li a:active{display:block;margin:0;background-image:url('../images/bg_on.png');text-decoration:none;padding-left:5px;padding-right:0;padding-top:2px;padding-bottom:2px}ul#classifierlist{float:left;font-size:14px;text-align:left;width:15%;margin:0;padding:0}div#classifiers{float:left;width:75%;margin:0;padding:0 0 0 10px}ul#classifiernodelist li{list-style:none;margin:0;padding:5px 0 0 0;display:block}ul.childrenlist{margin:0;padding:0 0 0 20px;display:block;width:100%}div#content{clear:both;overflow:hidden;margin:.2em 0 0 0}div.divbar{clear:both;background-image:url('../images/bg_green.png');width:100%;text-align:center;font-size:80%}div.resultnavigation{margin:0;padding:0}ul#resultlist li{display:block}div.documenttext{clear:both}div#documentheading{font-size:16pt;font-weight:bold}div#documentinfo{float:left;padding:0;margin:0;width:24%}div#toc{float:left;text-align:left;width:60%;padding:0;margin:0}ul#docbuttons li{display:block;font-size:11px;font-weight:bold;background:#f7e7c5;margin:1px;border:1px solid #edb;text-align:center;vertical-align:middle;height:30px;width:110px}ul#tocnodes li{margin:0;padding:5px 0 0 0;display:block}ul.tocnode{margin:0;padding:5px 0 0 20px}ul.tocnode a{margin:0;padding:0 5px 0 0}span.bold{font-weight:bold}div.documentarrows{clear:both;margin:0;padding:1em 0 0 0}img.lessarrow{float:left;border:none}img.morearrow{float:right;border:none}div.formheading{font-size:16pt;font-weight:bold;margin:.5em 0 0;padding:0}ul#presprefs li,ul#berrybasketprefs li,ul#searchprefs li{display:block}div.phrasebrowse{text-align:center;padding:0;margin:.5em 0 .5em 0}div.QuickSearch{float:right}
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/core_whitespace.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/core_whitespace.css	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/style/core_whitespace.css	(revision 24007)
@@ -0,0 +1,376 @@
+
+body {
+  padding:0;
+  margin:0;
+  font-family: sans-serif, arial, helvetica;   
+  background: #fff url('../images/chalk.gif') scroll repeat-y left top;
+  color: #000000 
+}
+
+/* this contains everything - all the other divs */
+#page-wrapper {
+  margin: .5em 3em 0 5em;
+}
+
+a:link
+{
+color: #339966;
+}
+
+a:visited
+{
+color: #066;
+}
+
+a:hover, a:active
+{
+color: #99CC33;
+}
+
+div#banner ul, ul#resultlist, ul#tocnodes, ul#docbuttons, ul.tocnode, ul#bannerlist, ul#navbarlist, ul#collectionlist, ul#servicelist, ul#classifierlist, ul#classifiernodelist, ul#queryitemlist{
+  list-style-type:none;
+  margin:0;
+  padding:0;
+}
+
+div#banner ul li, ul#bannerlist li, ul#navbarlist li {
+  display: inline;
+  margin:0;
+  padding:0;	
+}
+
+
+ul li>select, ul li>input {
+  padding: 0;
+  margin-left:5px;
+}
+
+
+div#banner {
+  margin: 0;
+  padding:0;
+  overflow: hidden;
+}
+
+div#banner p {
+  margin:0;
+  padding: 0;
+  float:left;
+  font-size: 16px;
+  text-align: left;
+  overflow:hidden	
+}
+
+div#banner p a {
+  background-image: url('../images/banner_bg.png');
+  background-repeat: repeat-y;
+}
+
+
+div#banner ul{
+  margin:0;
+  padding:0; 
+  float:right; 
+  font-size: 12px;  
+}
+
+div#banner a{
+  text-decoration: none;
+  color:#000000;
+}
+
+
+ul#bannerlist li a {
+  padding: 0 10px 0 10px; 
+  text-decoration: none;
+}
+
+ul#bannerlist li a:link, ul#bannerlist li a:visited
+{
+ background-color: #DEE79C;
+ background-image: url('../images/bg_off.png');
+ text-decoration: none
+}
+
+ul#bannerlist li a:hover{
+ background-color: #FFFF66;
+ background-image: url('../images/bg_on.png') ;
+ text-decoration: none
+}
+
+
+div#navbar{
+  clear:both;
+}
+
+ul#navbarlist{
+  margin:0;
+  padding:0; 
+  list-style-type: none; 
+  text-align:center;
+  width: 100%;
+  font-size: 80%;
+  background-image: url('../images/bg_green.png');	  
+  background-color: #99CC99
+ }
+
+ul#navbarlist li a {
+  padding: 0 20px 0 20px; 
+  margin: 0;
+  color: #000000; 
+  text-decoration: none;
+}
+
+ul#navbarlist li a:link, ul#navbarlist li a:visited{
+   background-image: url('../images/bg_off.png') ;
+ }
+
+ul#navbarlist li a:hover{
+  background-image: url('../images/bg_on.png') ;
+}
+
+
+ul#collectionlist li, ul#servicelist li{
+  display:block;
+  padding:0;
+  margin: .2em 0 0 0;
+  overflow:hidden;
+}
+
+
+ul#collectionlist img{
+  margin:0;
+  padding:0;
+  width: 150px;
+  height: 45px;
+  border: 1px solid black;
+  background-image: url('../images/collectimg_bg.png');
+  background-repeat: repeat-y;
+  overflow:hidden
+}
+
+ul#collectionlist li a.noimage{
+  display: block;
+  margin:0;
+  width: 145px;
+  height: 40px;
+  border: 1px solid black;
+  background-image: url('../images/collectimg_bg.png');
+  background-repeat: repeat-y;
+  overflow:hidden; padding-left:5px; padding-right:0; padding-top:5px; padding-bottom:0
+
+}
+
+ul#collectionlist li a{
+  font-size: 16px;
+  color: #000000;
+  text-decoration: none;  
+  font-weight: bold;
+}
+
+ul#servicelist li a{
+  margin:0 .5em 0 0;
+}
+
+ul#queryitemlist li{
+  display:block;
+  margin: .2em 0 .2em 0;
+}
+
+ul#classifierlist li{
+  list-style: none;
+  margin: 0 0 5px 0;
+  padding: 0;
+  display: block;
+  color:#000;
+}
+
+ul#classifierlist li#activeclassifier{
+  font-weight:bold;
+  padding: 0 0 0 5px;
+  margin:0 0 5px 0;
+}
+
+ ul#classifierlist li a:link, ul#classifierlist li a:visited  
+{
+   display:block;
+   margin:0;
+   background-image: url('../images/bg_off.png');
+   text-decoration: none; 
+   color:#000;
+   width:100%; padding-left:5px; padding-right:0; padding-top:2px; padding-bottom:2px
+ } 
+
+ul#classifierlist li a:hover, ul#classifierlist li a:active
+{
+  display:block;
+  margin:0;
+  background-image: url('../images/bg_on.png');
+  text-decoration: none; padding-left:5px; padding-right:0; padding-top:2px; padding-bottom:2px
+  
+}
+
+ul#classifierlist{
+   float:left;
+   font-size: 14px;
+   text-align: left;
+   width: 15%;
+   margin:0;
+   padding:0;
+}
+
+div#classifiers{
+  float:left;
+  width: 75%;
+  margin:0;
+  padding:0 0 0 10px;
+ }
+
+ul#classifiernodelist li{
+  list-style: none;
+  margin: 0;
+  padding: 5px 0 0 0;
+  display: block;
+ }
+
+ul.childrenlist{
+  margin: 0 0 0 0;
+  padding: 0 0 0 20px;
+  display: block;
+  width: 100%;
+}
+
+div#content{
+ clear: both;
+ overflow: hidden;
+ margin: .2em 0 0 0;
+}
+
+/* bg image set in style macro */
+div.divbar { 
+  clear: both; 
+  background-image: url('../images/bg_green.png'); 
+  width: 100%; 
+  text-align: center;
+  font-size:80%
+}
+
+
+/** query form style**/
+div#queryform{
+
+}
+
+/** search result style */
+div#terminfo{
+
+}
+
+div#matchdocs{
+
+}
+
+div.resultnavigation{
+ margin: 0;
+ padding:0;
+}
+
+ul#resultlist li{
+  display:block;
+}
+
+
+div.documenttext { clear: both; } /* come after any floating divs */
+
+div#documentheading{
+  font-size: 16pt;
+  font-weight: bold;
+}
+
+div#documentinfo { 
+  float:left;
+  padding:0;
+  margin:0;
+  width:24%;
+} 
+
+div#toc{
+  float:left;
+  text-align:left;
+  width:60%;
+  padding:0;
+  margin:0; 
+}
+
+ul#docbuttons li {
+   display: block;
+  font-size: 11px;
+  font-weight: bold;
+  background: #f7e7c5;
+  margin: 1px;
+  border: 1px solid #eeddbb;
+  text-align: center;
+  vertical-align: middle;
+  height: 30px; /* IE6 and NS4 treat width/height as min-width/min-height */
+  width: 110px;
+}
+
+
+ul#tocnodes li{
+ margin: 0;
+ padding: 5px 0 0 0;
+ display:block;
+}
+
+ul.tocnode {
+  margin:0;
+  padding:5px 0 0 20px;
+}
+
+ul.tocnode  a{
+ margin: 0;
+ padding:0 5px 0 0;
+ }
+
+span.bold{
+  font-weight: bold;	   
+}
+
+div.documentarrows{
+  clear: both; 
+  margin: 0 0 0 0;
+  padding: 1em 0 0 0;   
+}
+
+img.lessarrow{
+  float:left;
+  border: none;  
+}
+
+img.morearrow{
+  float:right;
+  border:none; 
+}
+
+div.formheading{
+  font-size: 16pt;
+  font-weight: bold;
+  margin: .5em 0 0;
+  padding:0;
+}
+
+ul#presprefs li, ul#berrybasketprefs li, ul#searchprefs li{
+  display: block;
+} 
+
+
+div.phrasebrowse{
+  text-align:center;
+  padding:0;
+  margin: .5em 0 .5em 0;   
+}
+
+div.QuickSearch {
+  float: right;
+}
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/about.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/about.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/about.xsl	(revision 24007)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
+  xmlns="http://www.w3.org/1999/xhtml"
   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">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   
@@ -51,5 +51,5 @@
 	  </xsl:choose>
 	  
-	  <div id="content"> 
+	  <div id="content" class="moz-output-escape"> 
 	    <!--Display the description text of the current collection,
 	    and if some services are available then create a list
@@ -62,4 +62,11 @@
 	  </div>
 	</div>
+      	<span id="language" style="display: none;"><xsl:value-of select="/page/@lang" /></span>
+      	<span id="interface" style="display: none;"><xsl:value-of select="$interface_name" /></span>
+      	
+		<script type="text/javascript"><xsl:text>var placeholder = false;</xsl:text></script>
+		<script type="text/javascript" src="jquery.js"><xsl:comment>jQuery</xsl:comment></script>
+		<script type="text/javascript" src="test.js"><xsl:comment>Client side transforms</xsl:comment></script>
+		
       </body>
     </html>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/applet.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/applet.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/applet.xsl	(revision 24007)
@@ -3,12 +3,11 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
   <xsl:include href="style.xsl"/>
   
-  <xsl:output method="html"/>  
+  <xsl:output method="html"/>
   
   <!-- the main page layout template is here -->
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/authen.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/authen.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/authen.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   <!-- style includes global params interface_name, library_name -->
@@ -14,5 +13,5 @@
 
   <xsl:template name="pageTitle">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/>
+    <!-- differred for page title --> <span class="getTextFor null document.title.authen.authentication"></span>
   </xsl:template>
 
@@ -21,5 +20,5 @@
     <head>
       <title>
-	<xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+		<xsl:text> </xsl:text>
       </title>
       <xsl:call-template name="globalStyle"/>
@@ -35,4 +34,6 @@
       <xsl:call-template name="addGroup" />
       <body>
+   
+   	<xsl:call-template name="pageTitle"/>
 	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
 	<div id="page-wrapper">
@@ -53,8 +54,8 @@
 	    <table align="left" border="0" width="100%">
 	      <tr align="left">
-		<td><h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/></h2></td>
+		<td><h2 class="getTextFor authen.authentication"></h2></td>
 		<td><xsl:if test="$un_s!=''">
 		    <xsl:if test="$asn!='' and $asn!='0'">
-		      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>  :  <xsl:value-of select="$un_s"/>
+		      <span class="getTextFor authen.username"></span>  :  <xsl:value-of select="$un_s"/>
 		    </xsl:if>
 		  </xsl:if></td>
@@ -66,5 +67,5 @@
 	    <ul id="navbarlist">
 	      <!--greenstone home-->
-	      <li><a href="{$library_name}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.greenstone_home')"/></a></li>
+	      <li><a href="{$library_name}"><span class="getTextFor authen.greenstone_home"></span></a></li>
 	      
 	      <!--list users-->
@@ -72,8 +73,8 @@
 		<xsl:choose>
 		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ListUsers&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.aup=ListUsers&amp;amp;s1.asn={$asn}&amp;amp;s1.uan=1&amp;amp;s1.un={$un_s}&amp;amp;s1.pw="><span class="getTextFor authen.list_users"></span></a>
 		  </xsl:when>
 		  <xsl:otherwise>
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.asn=&amp;amp;s1.aup=Login"><span class="getTextFor authen.list_users"></span></a>
 		  </xsl:otherwise>
 		</xsl:choose></li>
@@ -83,8 +84,8 @@
 		<xsl:choose>
 		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=AddUser&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umun=&amp;s1.umpw=&amp;s1.umgp=&amp;s1.umas=&amp;s1.umc="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a> 
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.aup=AddUser&amp;amp;s1.asn={$asn}&amp;amp;s1.uan=1&amp;amp;s1.un={$un_s}&amp;amp;s1.pw=&amp;amp;s1.umun=&amp;amp;s1.umpw=&amp;amp;s1.umgp=&amp;amp;s1.umas=&amp;amp;s1.umc="><span class="getTextFor authen.add_a_new_user"></span></a> 
 		  </xsl:when>
 		  <xsl:otherwise>
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.asn=&amp;amp;s1.aup=Login"><span class="getTextFor authen.add_a_new_user"></span></a>
 		  </xsl:otherwise>
 		</xsl:choose>
@@ -95,8 +96,8 @@
 		<xsl:choose>
 		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ModifyPassword&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umpw1=&amp;s1.umpw2=&amp;s1.umpw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.aup=ModifyPassword&amp;amp;s1.asn={$asn}&amp;amp;s1.uan=1&amp;amp;s1.un={$un_s}&amp;amp;s1.pw=&amp;amp;s1.umpw1=&amp;amp;s1.umpw2=&amp;amp;s1.umpw="><span class="getTextFor authen.change_password"></span></a>
 		  </xsl:when>
 		  <xsl:otherwise>
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.asn=&amp;amp;s1.aup=Login"><span class="getTextFor authen.change_password"></span></a>
 		  </xsl:otherwise>
 		</xsl:choose>
@@ -106,8 +107,8 @@
 		<xsl:choose>
 		  <xsl:when test="$un_s!='' and $asn!='' and $asn!='0'">
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login&amp;s1.un=&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.logout')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.asn=&amp;amp;s1.aup=Login&amp;amp;s1.un=&amp;amp;s1.pw="><span class="getTextFor authen.logout"></span></a>
 		  </xsl:when>
 		  <xsl:otherwise>
-		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login')"/></a>
+		    <a href="{$library_name}?a=g&amp;amp;rt=r&amp;amp;sa=authen&amp;amp;s=Authentication&amp;amp;s1.asn=&amp;amp;s1.aup=Login"><span class="getTextFor authen.login"></span></a>
 		  </xsl:otherwise>
 		</xsl:choose>
@@ -124,18 +125,18 @@
 		    <xsl:choose>
 		      <xsl:when test="$asn!='' and $asn!='0'">
-			<p align="left"> <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_successfully')"/></p>
+			<p align="left"> <span class="getTextFor authen.login_successfully"></span></p>
 		      </xsl:when>
 		      <xsl:otherwise>
 
 			<p align="left">
-			  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_3')"/><br/></p>
+			  <span class="getTextFor authen.login_describe_line_3"></span><br/></p>
 			<xsl:if test="$err='un-pw-err'">
-			  <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.wrong_password_warning')"/></font></p>
+			  <p align="left"><font color='red'><span class="getTextFor authen.wrong_password_warning"></span></font></p>
 			</xsl:if>
 			<xsl:if test="$err='no-permission' and $info='Login'">
-			  <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+			  <p align="left"><font color='red'><span class="getTextFor authen.no_permission"></span></font></p>
 			</xsl:if>
 			<xsl:if test="$err='as-false'">
-			  <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status_false')"/></font></p>
+			  <p align="left"><font color='red'><span class="getTextFor authen.account_status_false"></span></font></p>
 			</xsl:if>
 			<xsl:call-template name="login">
@@ -159,7 +160,7 @@
 		    <xsl:if test="$info='Login'">
 		      <p align="left">
-			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/></p>
+			<span class="getTextFor authen.login_describe_line_2"></span><br/></p>
 		      <xsl:if test="$err='no-permission' and $info='Login'">
-			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+			<p align="left"><font color='red'><span class="getTextFor authen.no_permission"></span></font></p>
 		      </xsl:if>
 		    </xsl:if>
@@ -174,8 +175,8 @@
 		    <xsl:if test="$asn!='1'">
 		      <p align="left">
-			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/>
+			<span class="getTextFor authen.login_describe_line_2"></span><br/>
 		      </p>
 		      <xsl:if test="$err='no-permission'">
-			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+			<p align="left"><font color='red'><span class="getTextFor authen.no_permission"></span></font></p>
 		      </xsl:if>
 		    </xsl:if>
@@ -187,13 +188,14 @@
 		    
 		    <xsl:if test="$info='adduser_interface'">
-		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user_title')"/></h2>
+		      <h2 align="left"><span class="getTextFor authen.add_a_new_user_title"></span></h2>
 		      <xsl:if test="$err='pw-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.password_err"></span></font></p>
 		      </xsl:if>	
 		      <xsl:if test="$err='un-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
+		      <!-- not sure if this is meant to be unsername_err; if it is, disregard -->
+			<p align="left"><font color="red"><span class="getTextFor authen.unsername_err"></span></font></p>
 		      </xsl:if>	
 		      <xsl:if test="$err='un-exist'">
-			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
+			<p align="left"><font color='red'><span class="getTextFor authen.user_has_existed"></span></font></p>
 		      </xsl:if>
 		      <xsl:call-template name="edituser" >
@@ -222,26 +224,26 @@
 
 		    <xsl:if test="$err=''">
-		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
-		      <p align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_successed_content')"/></p>
+		      <h2 align="left"><span class="getTextFor authen.change_password_title"></span></h2>
+		      <p align="left"><span class="getTextFor authen.change_password_successed_content"></span></p>
 		    </xsl:if>
 		    
 		    <xsl:if test="$asn!='0' and $info='modify_interface'">
-		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
-		      <p align="left"><font color="grey"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_describe_line_1')"/></font></p>
+		      <h2 align="left"><span class="getTextFor authen.change_password_title"></span></h2>
+		      <p align="left"><font color="grey"><span class="getTextFor authen.change_password_describe_line_1"></span></font></p>
 
 		      <xsl:if test="$err='umpw1-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password_invalid')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.new_password_invalid"></span></font></p>
 		      </xsl:if>
 		      <xsl:if test="$err='umpw2-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retyped_password_invalid')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.retyped_password_invalid"></span>></font></p>
 		      </xsl:if>
 		      <xsl:if test="$err='pw-umpw-nm-err' or $err='umpw-null-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password_warning')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.old_password_warning"></span></font></p>
 		      </xsl:if>  
 		      <xsl:if test="$err='umpw1-umpw2-nm-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.two_password_not_match')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.two_password_not_match"></span></font></p>
 		      </xsl:if> 
 		      <xsl:if test="$err='umpw1-umpw2-null-err'">
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_empty_warning')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.password_empty_warning"></span></font></p>
 		      </xsl:if> 
 		      
@@ -286,16 +288,16 @@
 
 		    <xsl:if test="$info='edituser-interface'"> 
-		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.edit_user_information')"/></h2>
+		      <h2 align="left"><span class="getTextFor authen.edit_user_information"></span></h2>
 		      <xsl:if test="$err='umpw-err'"> 
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.password_err"></span></font></p>
 		      </xsl:if>
 		      <xsl:if test="$err='umun-err'"> 
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.username_err"></span></font></p>
 		      </xsl:if>
 		      <xsl:if test="$err='ini-umpw-err'"> 
-			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_initial')"/></font></p>
+			<p align="left"><font color="red"><span class="getTextFor authen.password_initial"></span></font></p>
 		      </xsl:if>
 		      <xsl:if test="$err='un-exist'">
-			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
+			<p align="left"><font color='red'><span class="getTextFor authen.user_has_existed"></span></font></p>
 		      </xsl:if>
 		      <xsl:call-template name="edituser" >
@@ -358,8 +360,8 @@
 	<table align="center">
 	  <tr>
-	    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="string" name="s1.un" size="10" value=""/></td><td></td>
+	    <td><span class="getTextFor authen.username"></span></td><td><input type="string" name="s1.un" size="10" value=""/></td><td></td>
 	  </tr>
 	  <tr>
-	    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.pw" size="10" value=""/></td><td>
+	    <td><span class="getTextFor authen.password"></span></td><td><input type="password" name="s1.pw" size="10" value=""/></td><td>
 	      <input type="submit" value="submit"></input></td>
 	  </tr>
@@ -371,12 +373,12 @@
   <!--template name="listusers"-->
   <xsl:template name="listusers" >
-    <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></h2>
+    <h2 align="left"><span class="getTextFor authen.list_of_current_users_title"></span></h2>
 
     <table id='mainTable' align="left" border="0" cellspacing="1" cellpadding="3" width="100%" >
       <tr>
-	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></th>
-	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></th>
-	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></th>
-	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></th>
+	<th bgcolor="#d0d0d0" class="getTextFor authen.username"></th>
+	<th bgcolor="#d0d0d0" class="getTextFor authen.account_status"></th>
+	<th bgcolor="#d0d0d0" class="getTextFor authen.groups"></th>
+	<th bgcolor="#d0d0d0" class="getTextFor authen.comment"></th>
 	<th bgcolor="#d0d0d0"></th>
       </tr>
@@ -453,10 +455,10 @@
 	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
 	
-	<table align="center"><tr><td align="right">
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/></td><td><input type="password" name="s1.umpw" size="10" value=""/></td></tr>
-	  <tr><td align="right">
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/></td><td><input type="password" name="s1.umpw1" size="10" value=""/></td></tr>
-	  <tr><td align="right">
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_new_password')"/></td><td><input type="password" name="s1.umpw2" size="10" value=""/></td></tr>
+	<table align="center"><tr><td align="right" class="getTextFor authen.old_password">
+	      </td><td><input type="password" name="s1.umpw" size="10" value=""/></td></tr>
+	  <tr><td align="right" class="getTextFor authen.new_password">
+	      </td><td><input type="password" name="s1.umpw1" size="10" value=""/></td></tr>
+	  <tr><td align="right" class="getTextFor authen.retype_new_password">
+	      </td><td><input type="password" name="s1.umpw2" size="10" value=""/></td></tr>
 	  <tr><td></td><td>
 	      <input type="submit" value="submit"></input></td>
@@ -485,5 +487,5 @@
 	<input type='hidden' name='s1.uan' value='1'/>
 	<input type='hidden' name='s1.umun' value='{$umun_s}'/>
-	<p><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.do_you_really_want_to_permanently_remove_user')"/> <xsl:value-of select="$umun_s"/>" ?</font></p>
+	<p><font color='red' class="getTextFor authen.do_you_really_want_to_permanently_remove_user"> <xsl:value-of select="$umun_s"/>" ?</font></p>
 	<input type="submit" value="yes"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
 	<input type="submit" value="no"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
@@ -518,26 +520,26 @@
 	<input type='hidden' name='s1.pw' value='{$pw_s}'/>
 	
-	<table align="left" ><tr><td>
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="text" name="s1.umun" size="15" value="{$umun_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username_describe')"/></font></td></tr>
-	  <tr><td>
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.umpw" size="15" value="{$umpw_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_describe')"/></font></td></tr>
-	  <tr><td>
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></td><td>	
+	<table align="left" ><tr><td class="getTextFor authen.username">
+	      </td><td><input type="text" name="s1.umun" size="15" value="{$umun_s}"/></td><td><font color="gray" class="getTextFor authen.username_describe"></font></td></tr>
+	  <tr><td class="getTextFor authen.password">
+	      </td><td><input type="password" name="s1.umpw" size="15" value="{$umpw_s}"/></td><td><font color="gray" class="getTextFor authen.password_describe"></font></td></tr>
+	  <tr><td class="getTextFor authen.account_status">
+	      </td><td>	
 	      <select name="s1.umas">
 		<xsl:if test="$umas_s=''">
-		  <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
-		  <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		  <option value="true" selected="selected" class="getTextFor authen.enabled"></option>
+		  <option value="false" class="getTextFor authen.disabled"></option>
 		</xsl:if> 
 		<xsl:if test="$umas_s='true'">
-		  <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
-		  <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		  <option value="true" selected="selected" class="getTextFor authen.enabled"></option>
+		  <option value="false" class="getTextFor authen.disabled"></option>
 		</xsl:if> 
 		<xsl:if test="$umas_s='false'">
-		  <option value="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
-		  <option value="false" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		  <option value="true" class="getTextFor authen.enabled"></option>
+		  <option value="false" selected="selected" class="getTextFor authen.disabled"></option>
 		</xsl:if> 
 	      </select></td><td></td></tr>
-	  <tr><td>
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></td><td><input type="text" id="group" name="s1.umgp" size="70" value="{$umgp_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups_describe')"/></font></td></tr>
+	  <tr><td class="getTextFor authen.groups">
+	      </td><td><input type="text" id="group" name="s1.umgp" size="70" value="{$umgp_s}"/></td><td><font color="gray" class="getTextFor authen.groups_describe"></font></td></tr>
 	  <tr>
 	    <td></td>
@@ -597,6 +599,6 @@
 	    <td><input type="button" name="addGroupButton" value="add" onClick="addGroup('collects')"/></td>
 	  </tr>
-	  <tr><td>
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></td><td colspan="2"><div><textarea cols="40" rows="5" name="s1.umc"><xsl:value-of select="$umc_s"/>
+	  <tr><td class="getTextFor authen.comment">
+	      </td><td colspan="2"><div><textarea cols="40" rows="5" name="s1.umc"><xsl:value-of select="$umc_s"/>
 
 		</textarea></div></td></tr> 
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/berry.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/berry.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/berry.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   <!--<xsl:include href="style.xsl"/>-->
@@ -115,5 +114,5 @@
            
 
-            if (target.id.toLowerCase() == 'urlcheck' &amp;&amp; urlonly){
+            if (target.id.toLowerCase() == 'urlcheck' &amp;amp;&amp;amp; urlonly){
                var urlcheck = YAHOO.util.Dom.get('urlcheck');
                urlcheck.src = 'interfaces/default/images/check3.gif';              
@@ -125,5 +124,5 @@
             }
 
-            if (target.id.toLowerCase() == 'urlcheck' &amp;&amp; !urlonly ){ 
+            if (target.id.toLowerCase() == 'urlcheck' &amp;amp;&amp;amp; !urlonly ){ 
                 var urlcheck = YAHOO.util.Dom.get('urlcheck');
                 urlcheck.src = 'interfaces/default/images/check4.gif';                       
@@ -211,5 +210,5 @@
                var a = document.createElement('a'); 
                var text ="";
-               a.href ="?a=d&amp;c="+doc['collection']+"&amp;d="+doc['name'];
+               a.href ="?a=d&amp;amp;c="+doc['collection']+"&amp;amp;d="+doc['name'];
                a.appendChild(document.createTextNode(doc['title'])); 
                 if (doc['root_title'] != ""){
@@ -218,5 +217,5 @@
                li.appendChild(a);
                var metadata = "";
-               for (var metaItem in doc &amp;&amp; metaItem != 'title'){
+               for (var metaItem in doc &amp;amp;&amp;amp; metaItem != 'title'){
                     metadata = "\n"+metaItem+": "+ doc[metaItem]+"\n";
                }
@@ -249,5 +248,5 @@
              var textview =  YAHOO.util.Dom.get('textview');
 
-              if (previousView != null &amp;&amp; textview !=null){
+              if (previousView != null &amp;amp;&amp;amp; textview !=null){
                  previousView.style.backgroundImage =  'url("interfaces/default/images/bg_on.png")'; 
               } 
@@ -326,5 +325,5 @@
              var email =  YAHOO.util.Dom.get('email');
 
-              if (previousView != null &amp;&amp; email !=null ){
+              if (previousView != null &amp;amp;&amp;amp; email !=null ){
                  previousView.style.backgroundImage =  'url("interfaces/default/images/bg_on.png")'; 
               } 
@@ -437,5 +436,5 @@
           for (var i in docList){
               var doc = docList[i];
-              urls +=root_url+"?a=d&amp;c="+doc["collection"]+"&amp;d="+doc["name"]+"\n\n";  
+              urls +=root_url+"?a=d&amp;amp;c="+doc["collection"]+"&amp;amp;d="+doc["name"]+"\n\n";  
                      
           }
@@ -453,5 +452,5 @@
               for (var i in docList){
                    var doc = docList[i];
-                   var url =root_url+"?a=d&amp;c="+doc['collection']+"&amp;d="+doc['name']+"\n";  
+                   var url =root_url+"?a=d&amp;amp;c="+doc['collection']+"&amp;amp;d="+doc['name']+"\n";  
                     for (var metaItem in doc){
                         var metadata = metaItem+": "+ doc[metaItem]+"\n";
@@ -466,5 +465,5 @@
 	                     
           function sendMail(){
-              var  url = "?a=pr&amp;rt=r&amp;ro=1&amp;s=SendMail&amp;c=";
+              var  url = "?a=pr&amp;amp;rt=r&amp;amp;ro=1&amp;amp;s=SendMail&amp;amp;c=";
                      var request_type = "POST";
                      var postdata = ""; 
@@ -476,5 +475,5 @@
                           var input = YAHOO.util.Dom.get(i);  
                           var value = input.value;  
-			  postdata +="&amp;s1."+i+"="+value;	
+			  postdata +="&amp;amp;s1."+i+"="+value;	
 			}                                   
 
@@ -482,6 +481,6 @@
                        var content = YAHOO.util.Dom.get('pretextarea').value;
                        
-                       content = content.replace(/&amp;/g,'-------');  
-                       postdata +="&amp;s1.content="+content;
+                       content = content.replace(/&amp;amp;/g,'-------');  
+                       postdata +="&amp;amp;s1.content="+content;
                                                                 
                       
@@ -530,10 +529,10 @@
 	function mailBoxUpdate(e) {
 		var target = e.target;
-		if (target.id.toLowerCase() == 'sendasemail' &amp;&amp; !show){
+		if (target.id.toLowerCase() == 'sendasemail' &amp;amp;&amp;amp; !show){
 	       	    showMailBox();
                     show = true;
                 }
                 else{
-                    if (target.id.toLowerCase() == 'sendasemail' &amp;&amp; show){
+                    if (target.id.toLowerCase() == 'sendasemail' &amp;amp;&amp;amp; show){
                        hideMailBox();
                        show = false;
@@ -551,5 +550,5 @@
        function showMailBox(){
            var mailbox = YAHOO.util.Dom.get('mailbox');  
-           if (table != null &amp;&amp; !show){
+           if (table != null &amp;amp;&amp;amp; !show){
                mailbox.appendChild(table);
               return;
@@ -669,5 +668,5 @@
       
          function sendMail(){
-              var  url = "?a=pr&amp;rt=r&amp;ro=1&amp;s=SendMail&amp;c=";
+              var  url = "?a=pr&amp;amp;rt=r&amp;amp;ro=1&amp;amp;s=SendMail&amp;amp;c=";
                      var request_type = "POST";
                      var postdata = ""; 
@@ -679,5 +678,5 @@
                           var input = YAHOO.util.Dom.get(i);  
                           var value = input.value;  
-			  postdata +="&amp;s1."+i+"="+value;	
+			  postdata +="&amp;amp;s1."+i+"="+value;	
 			}                                   
 
@@ -686,11 +685,11 @@
                           var input = YAHOO.util.Dom.get(i);  
                           var value = input.value; 
-                           postdata +="&amp;s1."+i+"="+value;
+                           postdata +="&amp;amp;s1."+i+"="+value;
                         }
 
                        var content = YAHOO.util.Dom.get('pretextarea').value;
                        
-                       content = content.replace(/&amp;/g,'-------');  
-                       postdata +="&amp;s1.content="+content;
+                       content = content.replace(/&amp;amp;/g,'-------');  
+                       postdata +="&amp;amp;s1.content="+content;
                                                                 
                       
@@ -721,7 +720,7 @@
       <div class='pageinfo'>
 	<p class='bannerlinks'>
-	  <a class='navlink' href='{$library_name}?a=p&amp;sa=home' title='Library home page' >HOME</a>
-	  <a class='navlink' href='{$library_name}?a=p&amp;sa=help&amp;c='  title='Help pages' >HELP</a>
-	  <a class='navlink' href='{$library_name}?a=p&amp;sa=pref&amp;c=' title='Change your interface preferences'>PREFERENCES</a>
+	  <a class='navlink' href='{$library_name}?a=p&amp;amp;sa=home' title='Library home page' >HOME</a>
+	  <a class='navlink' href='{$library_name}?a=p&amp;amp;sa=help&amp;amp;c='  title='Help pages' >HELP</a>
+	  <a class='navlink' href='{$library_name}?a=p&amp;amp;sa=pref&amp;amp;c=' title='Change your interface preferences'>PREFERENCES</a>
 	</p>      
       </div>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/berrytools.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/berrytools.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/berrytools.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   <xsl:param name="berryBaskets"/>
@@ -79,5 +78,5 @@
      var checkout = function(){
        var request_type = "GET";
-       var url = "?a=pr&amp;rt=r&amp;ro=1&amp;s=ItemNum&amp;o=XML&amp;c="; 
+       var url = "?a=pr&amp;amp;rt=r&amp;amp;ro=1&amp;amp;s=ItemNum&amp;amp;o=XML&amp;amp;c="; 
  
          var responseSuccess = function(o){
@@ -97,12 +96,12 @@
                     parent.removeChild(item);
                    
-                   if (parent !=null &amp;&amp; parent.id == "documentberries"){
+                   if (parent !=null &amp;amp;&amp;amp; parent.id == "documentberries"){
                          var root = YAHOO.util.Dom.get(itemID+":root");
                          var section = YAHOO.util.Dom.get(itemID+":section");
-                         if(root!=null &amp;&amp; root.id.indexOf(itemID) !=-1){
+                         if(root!=null &amp;amp;&amp;amp; root.id.indexOf(itemID) !=-1){
                              parent.removeChild(root);
                           }
      
-	                  if(section!=null &amp;&amp; section.id.indexOf(itemID) !=-1){
+	                  if(section!=null &amp;amp;&amp;amp; section.id.indexOf(itemID) !=-1){
                              parent.removeChild(section);
         	          }
@@ -130,12 +129,12 @@
                    
                    
-                   if (parent !=null &amp;&amp; parent.id == "documentberries"){
+                   if (parent !=null &amp;amp;&amp;amp; parent.id == "documentberries"){
                          var root = YAHOO.util.Dom.get(berry.id+":root");
                          var section = YAHOO.util.Dom.get(berry.id+":section");
-                         if(root!=null &amp;&amp; root.id.indexOf(berry.id) !=-1){
+                         if(root!=null &amp;amp;&amp;amp; root.id.indexOf(berry.id) !=-1){
                              root.style.visibility ="visible" ;
                           }
      
-	                  if(section!=null &amp;&amp; section.id.indexOf(berry.id) !=-1){
+	                  if(section!=null &amp;amp;&amp;amp; section.id.indexOf(berry.id) !=-1){
                              section.style.visibility ="visible" ;
         	          }
@@ -144,5 +143,5 @@
                      }  
 
-               if (berry.className  &amp;&amp;  berry.className  == 'pick')
+               if (berry.className  &amp;amp;&amp;amp;  berry.className  == 'pick')
                   { 
                     berry.style.visibility = "visible";
@@ -168,5 +167,5 @@
     function updateBerryImages(){
      
-      for (var i =0;i &lt; berryList.length &amp;&amp; i &lt;12 ; i++ ){
+      for (var i =0;i &lt; berryList.length &amp;amp;&amp;amp; i &lt;12 ; i++ ){
                var berries = YAHOO.util.Dom.get('berries');
                var img = document.createElement('img');
@@ -183,10 +182,10 @@
 		var target = e.target;
                
-		if ((target.id.toLowerCase() == 'berrybasket' || target.id.toLowerCase() == 'berries')  &amp;&amp; !show){
+		if ((target.id.toLowerCase() == 'berrybasket' || target.id.toLowerCase() == 'berries')  &amp;amp;&amp;amp; !show){
 	       	    showBasket();
                     show = true;
                 }
                 else{
-                    if (target.id.toLowerCase() == 'hideview' &amp;&amp; show){
+                    if (target.id.toLowerCase() == 'hideview' &amp;amp;&amp;amp; show){
                        hideBasket();
                        show = false;
@@ -264,5 +263,5 @@
         fullView.appendChild(document.createTextNode("Full View"));
         hideView.setAttribute("id","hideview");
-        fullView.setAttribute("href","?a=g&amp;sa=berry&amp;c=&amp;s=DisplayList&amp;rt=r");
+        fullView.setAttribute("href","?a=g&amp;amp;sa=berry&amp;amp;c=&amp;amp;s=DisplayList&amp;amp;rt=r");
         fullView.setAttribute("class","fullview");
 
@@ -293,5 +292,5 @@
 
      function addBerry(el){
-      var  addurl = "?a=pr&amp;rt=r&amp;ro=1&amp;s=AddItem&amp;c=&amp;s1.id=2&amp;o=XML&amp;s1.item=" + el.id;	   
+      var  addurl = "?a=pr&amp;amp;rt=r&amp;amp;ro=1&amp;amp;s=AddItem&amp;amp;c=&amp;amp;s1.id=2&amp;amp;o=XML&amp;amp;s1.item=" + el.id;	   
       var addSuccess = function(o){ 
  		 var result = o.responseXML;
@@ -307,17 +306,17 @@
                
                      var itemID = item.getAttribute('collection')+":"+item.getAttribute('name'); 
-                    if (parent !=null  &amp;&amp; parent.id == "documentberries"){
+                    if (parent !=null  &amp;amp;&amp;amp; parent.id == "documentberries"){
                          var root = YAHOO.util.Dom.get(itemID+":root");
                          var section = YAHOO.util.Dom.get(itemID+":section");
-                         if(root!=null  &amp;&amp; root.id.indexOf(itemID) !=-1){
+                         if(root!=null  &amp;amp;&amp;amp; root.id.indexOf(itemID) !=-1){
                              parent.removeChild(root);
                           }
      
-	                  if(section!=null  &amp;&amp; section.id.indexOf(itemID) !=-1){
+	                  if(section!=null  &amp;amp;&amp;amp; section.id.indexOf(itemID) !=-1){
                              parent.removeChild(section);
         	          }                                                
                      }
 
-                    if (!YAHOO.util.Dom.get('hideview') &amp;&amp;  berryList.length &lt; 13){
+                    if (!YAHOO.util.Dom.get('hideview') &amp;amp;&amp;amp;  berryList.length &lt; 13){
                       while (berries.hasChildNodes()) {
        	                   berries.removeChild(berries.firstChild);
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/classifier.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/classifier.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/classifier.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
@@ -20,5 +19,5 @@
 	<title>
 	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	  <xsl:text> </xsl:text>
 	</title>
 	<xsl:call-template name="globalStyle"/>
@@ -31,4 +30,5 @@
 	  <xsl:call-template name="greenstoneFooter"/>
 	</div>
+	<xsl:call-template name="pageTitle"/>
       </body>
     </html>
@@ -38,5 +38,5 @@
 
   <xsl:template name="pageTitle">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+    <span class="getTextFor null document.title.gsdl">&amp;amp;nbsp;</span>
   </xsl:template>
 
@@ -48,5 +48,4 @@
     </xsl:if>
   </xsl:template>
-
 
   <xsl:template match="pageResponse">
@@ -61,5 +60,5 @@
     </xsl:call-template>      
   
-    <div id="content">
+    <div id="content" class="moz-output-escape">
       <xsl:apply-templates select="service/classifierList">
         <xsl:with-param name="collName" select="$collName"/>
@@ -88,5 +87,5 @@
 	  </xsl:when>
 	  <xsl:otherwise>
-	    <li><a href="{$library_name}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></li></xsl:otherwise></xsl:choose>
+	    <li><a href="{$library_name}?a=b&amp;amp;rt=r&amp;amp;s={$serviceName}&amp;amp;c={$collName}&amp;amp;cl={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></li></xsl:otherwise></xsl:choose>
 	
       </xsl:for-each>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/classifiertools.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/classifiertools.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/classifiertools.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <xsl:template match="classifier">
@@ -95,5 +94,5 @@
     <xsl:param name="collName"/>
     <xsl:param name="serviceName"/>
-    <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}&amp;dt={@docType}&amp;p.a=b&amp;p.s={$serviceName}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a><xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
+    <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}&amp;dt={@docType}&amp;p.a=b&amp;p.s={$serviceName}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a><xsl:text>Test</xsl:text><xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
   </xsl:template>
 
@@ -105,4 +104,5 @@
     <xsl:param name="serviceName"/>
     <a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:call-template name="bookshelfimg"/></a><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
+
   </xsl:template>
   
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/document.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/document.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/document.xsl	(revision 24007)
@@ -3,9 +3,7 @@
   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:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util gsf">
-
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java gsf">
 
   <!-- style includes global params interface_name, library_name -->
@@ -56,5 +54,5 @@
   <xsl:template name="pageTitle">
     <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
-    <xsl:for-each select='/page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each>
+    <xsl:for-each select="/page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode"><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each>
   </xsl:template>
 
@@ -70,4 +68,5 @@
       </xsl:text>
     </style>
+
     <!--TODO: add berry basket switch-->
     <!--<xsl:if test="$berryBaskets = 'true'">-->
@@ -138,20 +137,20 @@
 	    <xsl:text disable-output-escaping="yes">
 	      var doc_url = document.URL; 
-	      doc_url = doc_url.replace(/(&amp;|\?)book=[a-z]+/gi,'');
-	      doc_url += '&amp;book=flashxml';
+	      doc_url = doc_url.replace(/(&amp;amp;|\?)book=[a-z]+/gi,'');
+	      doc_url += '&amp;amp;book=flashxml';
 
 	      var flash_plug_html = ""
-	      flash_plug_html += '&lt;OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n';
+	      flash_plug_html += '&amp;lt;OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n';
 	      flash_plug_html += '  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n';
 	      flash_plug_html += '  height="100%" id="Book" swLiveConnect="true" \n';
-	      flash_plug_html += '  width="100%"&gt;\n';
-	      flash_plug_html += '    &lt;PARAM name="allowScriptAccess" value="always" /&gt;\n';
-	      flash_plug_html += '    &lt;PARAM name="movie" value="Book.swf';
+	      flash_plug_html += '  width="100%"&amp;gt;\n';
+	      flash_plug_html += '    &amp;lt;PARAM name="allowScriptAccess" value="always" /&amp;gt;\n';
+	      flash_plug_html += '    &amp;lt;PARAM name="movie" value="Book.swf';
 	      flash_plug_html += '?src_image=' + escape(img_cover);
-	      flash_plug_html += '&amp;doc_url=' + escape(doc_url)
-	      flash_plug_html += '" /&gt;\n';
-	      flash_plug_html += '    &lt;PARAM name="quality" value="high" /&gt;\n';
-	      flash_plug_html += '    &lt;PARAM name="bgcolor" value="#FFFFFF" /&gt;\n';
-	      flash_plug_html += '    &lt;EMBED align="middle" \n';
+	      flash_plug_html += '&amp;amp;doc_url=' + escape(doc_url)
+	      flash_plug_html += '" /&amp;gt;\n';
+	      flash_plug_html += '    &amp;lt;PARAM name="quality" value="high" /&amp;gt;\n';
+	      flash_plug_html += '    &amp;lt;PARAM name="bgcolor" value="#FFFFFF" /&amp;gt;\n';
+	      flash_plug_html += '    &amp;lt;EMBED align="middle" \n';
 	      flash_plug_html += '      allowScriptAccess="always" swLiveConnect="true" \n';
 	      flash_plug_html += '      bgcolor="#FFFFFF" height="100%" name="Book" \n';
@@ -160,8 +159,8 @@
 	      flash_plug_html += '      src="Book.swf';
 	      flash_plug_html += '?src_image=' + escape(img_cover);
-	      flash_plug_html += '&amp;doc_url=' + escape(doc_url);
+	      flash_plug_html += '&amp;amp;doc_url=' + escape(doc_url);
 	      flash_plug_html += '"\n'; 
-	      flash_plug_html += '      type="application/x-shockwave-flash" width="100%" /&gt;\n';
-	      flash_plug_html += '&lt;/OBJECT&gt;\n';
+	      flash_plug_html += '      type="application/x-shockwave-flash" width="100%" /&amp;gt;\n';
+	      flash_plug_html += '&amp;lt;/OBJECT&amp;gt;\n';
 	      var flash_div = document.getElementById("bookdiv");
 	      flash_div.innerHTML = flash_plug_html;
@@ -199,5 +198,5 @@
     <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
     <div id="documentheading">
-      <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param>
+      <a href="{$library_name}?a={$p.a}&amp;amp;sa={$p.sa}&amp;amp;s={$p.s}&amp;amp;c={$p.c}&amp;amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title"><xsl:value-of select="'close_book'"/></xsl:with-param>
 	</xsl:call-template></a>
       <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
@@ -253,5 +252,5 @@
       </xsl:when>
       <xsl:otherwise>
-	<img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
+	<img><xsl:attribute name="src"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
       </xsl:otherwise>
     </xsl:choose>
@@ -270,12 +269,8 @@
       <li>
         <xsl:choose><xsl:when test="string($ed)='1'">
-	    <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
-	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
-	    </a>
+	    <a href="{$library_name}?a=d&amp;amp;d={$docID}&amp;amp;c={$collName}&amp;amp;sib={$sib}&amp;amp;ed=0" class="getTextFor doc.contract_doc_b this.title.doc.contract_doc_tip"></a>
 	  </xsl:when>
 	  <xsl:otherwise>
-	    <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
-	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
-	    </a>
+	    <a href="{$library_name}?a=d&amp;amp;d={$docID}&amp;amp;c={$collName}&amp;amp;sib={$sib}&amp;amp;ed=1" class="getTextFor doc.expand_doc_b this.title.doc.expand_doc_tip"></a>
 	  </xsl:otherwise>
 	</xsl:choose>
@@ -287,11 +282,8 @@
       <li>
 	<xsl:choose><xsl:when test="string($ec)='1'">
-	    <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
-	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/></a>
+	    <a href="{$library_name}?a=d&amp;amp;d={$docID}&amp;amp;c={$collName}&amp;amp;sib={$sib}&amp;amp;ec=0" class="getTextFor doc.contract_contents_b this.title.doc.contract_contents_tip"></a>
 	  </xsl:when>
 	  <xsl:otherwise>
-	    <a  href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
-	      <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
-	    </a>
+	    <a  href="{$library_name}?a=d&amp;amp;d={$docID}&amp;amp;c={$collName}&amp;amp;sib={$sib}&amp;amp;ec=1" class="getTextFor doc.expand_contents_b this.title.doc.expand_contents_tip"></a>
 	  </xsl:otherwise>
 	</xsl:choose>
@@ -302,7 +294,5 @@
     <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
     <li>
-      <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;d=<xsl:value-of select="$docID"/>&amp;c=<xsl:value-of select="$collName"/>&amp;sib=<xsl:value-of select="$sib"/>&amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_tip')"/></xsl:attribute>
-	<xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
-      </a></li>
+      <a target="_blank" class="getTextFor doc.detach_page_b this.title.doc.detach_page_tip"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;amp;d=<xsl:value-of select="$docID"/>&amp;amp;c=<xsl:value-of select="$collName"/>&amp;amp;sib=<xsl:value-of select="$sib"/>&amp;amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute></a></li>
   </xsl:template>
 
@@ -333,11 +323,18 @@
     <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
     <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
-    <xsl:if test="documentNode[@nodeID]">
+    <script type="text/javascript">
+      <xsl:text>
+        // Load up the initial document using AJAX!
+        var initialHash = '</xsl:text>
+      <xsl:value-of select="$d" /><xsl:text>';
+      </xsl:text>
+    </script>
+    <xsl:if test="documentNode[@nodeID]">      
       <ul id="tocnodes">
-	<li>
+	<li id="tocstart">
 	  <xsl:choose><xsl:when test="string($oc)='0'">
-	      <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.open_toc')"/></xsl:with-param></xsl:call-template></a>
+	      <a href="{$library_name}?a=d&amp;amp;c={$collName}&amp;amp;d={$d}&amp;amp;sib={$sib}&amp;amp;oc=1&amp;amp;p.s={$p.s}&amp;amp;p.sa={$p.sa}&amp;amp;p.a={$p.a}&amp;amp;p.c={$p.c}"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title"><xsl:value-of select="'doc.open_toc'"/></xsl:with-param></xsl:call-template></a>
 	    </xsl:when>
-	    <xsl:otherwise><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="openfolderimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.close_toc')"/></xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.table_of_contents')"/>
+	    <xsl:otherwise><a href="{$library_name}?a=d&amp;amp;c={$collName}&amp;amp;d={$d}&amp;amp;sib={$sib}&amp;amp;oc=0&amp;amp;p.s={$p.s}&amp;amp;p.sa={$p.sa}&amp;amp;p.a={$p.a}&amp;amp;p.c={$p.c}"><xsl:call-template name="openfolderimg"><xsl:with-param name="title"><xsl:value-of select="'doc.close_toc'"/></xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose><span class="getTextFor doc.table_of_contents">&amp;amp;nbsp;</span>
 	  <xsl:if test="string($oc)!='0'">
 	    <ul class="tocnode">
@@ -362,5 +359,5 @@
     <!-- Display the appropriate image, depending on the node type -->
     <li>
-      <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='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1<xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if>&amp;p.a=<xsl:value-of select="$p.a"/>&amp;p.sa=<xsl:value-of select="$p.sa"/>&amp;p.s=<xsl:value-of select="$p.s"/>&amp;p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
+      <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;amp;c=<xsl:value-of select="$collName"/>&amp;amp;d=<xsl:value-of select="@nodeID"/><xsl:if test="documentNode">.pr</xsl:if>&amp;amp;sib=1<xsl:if test="string($ec) = '1'">&amp;amp;ec=1</xsl:if>&amp;amp;p.a=<xsl:value-of select="$p.a"/>&amp;amp;p.sa=<xsl:value-of select="$p.sa"/>&amp;amp;p.s=<xsl:value-of select="$p.s"/>&amp;amp;p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
 	<xsl:apply-templates select="." mode="displayNodeIcon"/>
       </a>
@@ -372,5 +369,5 @@
 	</xsl:when>
 	<xsl:otherwise>
-	  <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
+	  <span><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
 	</xsl:otherwise>
       </xsl:choose>
@@ -394,5 +391,5 @@
 	<xsl:when test="@docType='simple'"><xsl:apply-templates select="nodeContent"/></xsl:when>
 	<xsl:otherwise>
-	  <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>
+	  <!--<xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>-->
 	</xsl:otherwise>
       </xsl:choose>
@@ -411,9 +408,8 @@
   <!-- the actual text/content -->
   <xsl:template match="nodeContent">
-    <p/>
     <xsl:for-each select="node()">
       <xsl:choose>
 	<xsl:when test="not(name())">
-	  <xsl:value-of select="." disable-output-escaping="yes"/>
+	  <xsl:value-of select="." disable-output-escaping="yes" />
 	</xsl:when>
 	<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
@@ -444,15 +440,15 @@
       <xsl:when test="nodeContent">
 	<xsl:text disable-output-escaping="yes">
-	  &lt;Section&gt;
-	  &lt;Description&gt;
-	  &lt;Metadata name="Title"&gt;
+	  &amp;lt;Section&amp;gt;
+	  &amp;lt;Description&amp;gt;
+	  &amp;lt;Metadata name="Title"&amp;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;
+	  &amp;lt;/Metadata&amp;gt;
+	  &amp;lt;/Description&amp;gt;
 	</xsl:text>
 	<xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
-	<xsl:text disable-output-escaping="yes">&lt;/Sec&gt;</xsl:text>
+	<xsl:text disable-output-escaping="yes">&amp;lt;/Sec&amp;gt;</xsl:text>
       </xsl:when>
     </xsl:choose>
@@ -465,5 +461,5 @@
     <!-- end the section -->
     <xsl:text disable-output-escaping="yes">
-      &lt;/Section&gt;
+      &amp;lt;/Section&amp;gt;
     </xsl:text>
   </xsl:template>
@@ -473,5 +469,5 @@
     <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
     <xsl:choose>
-      <xsl:when test="util:isImage(@mimeType)">
+      <xsl:when test="starts-with(@mimeType, 'image/')">
 	<img src="{$httpPath}/{@href}"/>
       </xsl:when>
@@ -488,5 +484,5 @@
       <xsl:choose>
 	<xsl:when test="@type='document'">a=d</xsl:when>
-	<xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=rd</xsl:when>
+	<xsl:when test="@type='query'">a=q&amp;amp;s=<xsl:value-of select="@service"/>&amp;amp;rt=rd</xsl:when>
 	<xsl:otherwise>
 	p
@@ -495,7 +491,7 @@
     </xsl:variable>
     <xsl:variable name="serviceargs">
-      <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
+      <xsl:for-each select="param">&amp;amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
     </xsl:variable>
-    <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
+    <a href="{$library_name}?{$actionargs}&amp;amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
   </xsl:template>
 
@@ -518,8 +514,8 @@
 	    </td>
 	    <td align="center"><center>
-		<b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.pages', $children)"/></b>
+		<b class="getTextFor doc.pages"></b>
 	      </center></td>
 	    <td align="right">
-	      <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
+	      <a href="{$library_name}?a=d&amp;amp;c={$collName}&amp;amp;d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
 	    </td>
 	  </tr>
@@ -530,13 +526,13 @@
 	    <td align="left">
 	      <xsl:if test=" not ( $pos = 1 )">
-		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a>
+		<a href="{$library_name}?a=d&amp;amp;c={$collName}&amp;amp;d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a>
 	      </xsl:if>
 	    </td>
 	    <td align="center"><center>
-		<b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.pageof', concat($pos, ';', $length))"/></b>
+		<b><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.doc.pageof|', $pos, ';', $length)"/></xsl:attribute></b>
 	      </center></td>
 	    <td align="right">
 	      <xsl:if test=" not($pos = $length)">
-		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
+		<a href="{$library_name}?a=d&amp;amp;c={$collName}&amp;amp;d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
 	      </xsl:if>
 	    </td>
@@ -551,5 +547,5 @@
 	    <input type='hidden' name='d' value='{@selectedNode}'/>
 	    <input type="text" name="gp" size="3" maxlength="4"/>
-	    <input type="submit"><xsl:attribute name='value'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.gotopage')"/></xsl:attribute></input>
+	    <input type="submit" class="getTextFor null this.value.doc.gotopage"></input>
 	  </form>
 	</td>
@@ -568,14 +564,14 @@
 	    <form name="EnrichForm" method="get" action="{$library_name}">
 	      <xsl:apply-templates select="paramList"/>
-	      <input type='hidden' name='a' value='d'/>
-	      <input type='hidden' name='d' value='{$docID}'/>
-	      <input type='hidden' name='c' value='{$collName}'/>
-	      <xsl:if test='$request-params/param[@name="sib"]'>
-		<input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
-	      <input type='hidden' name='s' value='{@name}'/>
-	      <input type='hidden' name='p.a'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.a"]'/></xsl:attribute></input>
-	      <input type='hidden' name='p.sa'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.sa"]'/></xsl:attribute></input>
-	      <input type='hidden' name='p.s'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.s"]'/></xsl:attribute></input>
-	      <input type='hidden' name='end' value='1'/>
+	      <input type="hidden" name="a" value="d"/>
+	      <input type="hidden" name="d" value="{$docID}"/>
+	      <input type="hidden" name="c" value="{$collName}"/>
+	      <xsl:if test="$request-params/param[@name='sib']">
+		<input type="hidden" name="sib"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='sib']/@value"/></xsl:attribute></input></xsl:if>
+	      <input type="hidden" name="s" value="{@name}"/>
+	      <input type="hidden" name="p.a"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.a']"/></xsl:attribute></input>
+	      <input type="hidden" name="p.sa"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.sa']"/></xsl:attribute></input>
+	      <input type="hidden" name="p.s"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.s']"/></xsl:attribute></input>
+	      <input type="hidden" name="end" value='1'/>
 	      <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
 	    </form>
@@ -615,6 +611,6 @@
     <xsl:param name="direction"/>
     <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
-    <xsl:if test='$request-params/param[@name="dt"]/@value != "simple"'>  
-      <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="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
+    <xsl:if test="$request-params/param[@name='dt']/@value != 'simple'">  
+      <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;amp;c=<xsl:value-of select="$collName"/>&amp;amp;d=<xsl:value-of select="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;amp;sib=1&amp;amp;p.s=<xsl:value-of select="$request-params/param[@name='p.s']/@value"/>&amp;amp;p.sa=<xsl:value-of select="$request-params/param[@name='p.sa']/@value"/>&amp;amp;p.a=<xsl:value-of select="$request-params/param[@name='p.a']/@value"/></xsl:attribute><xsl:choose><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
     </xsl:if> 
   </xsl:template>
@@ -622,13 +618,9 @@
   <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"/>
+    <xsl:variable name="go_forward_link"><a class="getTextfor external.go_forward"><xsl:attribute name="href"><xsl:value-of select="$external"/></xsl:attribute></a></xsl:variable>
+    <h2 class="getTextFor external.title"></h2>
+    <p><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.external.text|', $go_forward_link)" /></xsl:attribute>
     </p>
   </xsl:template>
 
 </xsl:stylesheet>
-
-
-
-
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/document_text.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/document_text.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/document_text.xsl	(revision 24007)
@@ -0,0 +1,22 @@
+<?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:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+    extension-element-prefixes="java"
+    exclude-result-prefixes="java gsf">
+    
+    <xsl:output method="html" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />
+    
+    <xsl:template match="page">
+        <xsl:for-each select="//documentNode">
+            <xsl:if test="nodeContent">
+            <xsl:if test="metadataList/metadata[@name='Title']">
+                <h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3>
+            </xsl:if>
+            <xsl:value-of select="nodeContent" />
+            </xsl:if>
+        </xsl:for-each>
+    </xsl:template>
+    
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/gli4gs3.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/gli4gs3.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/gli4gs3.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/help.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/help.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/help.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
@@ -18,5 +17,5 @@
 	<title>
 	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	  <xsl:text> </xsl:text>
 	</title>
 	<xsl:call-template name="globalStyle"/>
@@ -29,4 +28,5 @@
 	  <xsl:call-template name="greenstoneFooter"/>
 	</div>
+		<xsl:call-template name="pageTitle"/>
       </body>
     </html>
@@ -34,5 +34,19 @@
   
   <xsl:template name="pageTitle">
-    <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"><xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/></xsl:when><xsl:otherwise><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:otherwise></xsl:choose>: <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_t')"/>
+    <xsl:choose>
+    	<xsl:when test="/page/pageResponse/*/displayItem[@name='name']">
+    		<span>
+    			<xsl:attribute name="class">
+					<xsl:text>getTextFor null document.title.text:'</xsl:text>
+    				<xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/>
+					<xsl:text>'</xsl:text>
+    			</xsl:attribute>
+    		</span>
+    	</xsl:when>
+    	<xsl:otherwise>
+    		<span class="getTextFor null document.title.gsdl">&amp;amp;nbsp;</span>
+    	</xsl:otherwise>
+    </xsl:choose>
+    <span class="getTextFor null document.title.text:'&#160;:&#160;'[a],document.title.help_t[a]">&amp;amp;nbsp;</span>
   </xsl:template>
 
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/home.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/home.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/home.xsl	(revision 24007)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
+xmlns="http://www.w3.org/1999/xhtml"
   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">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   
@@ -16,10 +16,10 @@
       <head>
 	<title>
-	  <gslib:siteHomePageTitle/>
+	  <xsl:text> </xsl:text>
 	</title>
 	<link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
       </head>
       
-      <body><gslib:textDirectionAttribute/>
+      <body>
 	
 	<div id="page-wrapper">
@@ -29,10 +29,9 @@
 	  <div id="banner">
 	    <p>
-	      <img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><gslib:greenstoneLogoAlternateText/></xsl:attribute>
-	      </img>
+	      <img src="interfaces/default/images/gsdlhead.gif" class="getTextFor null this.alt.gsdl" />
 	    </p>
 	  </div>
 	  
-	  <div id="content">
+	  <div id="content" class="moz-output-escape">
 	    
 	    <div class="divbar"><gslib:selectACollectionTextBar/></div>
@@ -63,6 +62,4 @@
 		<li><gslib:authenticationLink/></li>
 	      </xsl:for-each>
-	      <!--uncomment the line below to display a library interface link inside a <li>-->
-	      <!--<gslib:libraryInterfaceLink/>-->
 	    </ul>
 	    
@@ -71,8 +68,23 @@
 	  
 	  <div id="footer">
-	    <div class="divbar"><gslib:poweredByGS3TextBar/></div>
+	    <div class="divbar">
+	    	<span class="getTextFor gs3power">&amp;nbsp;</span>	
+	    </div>
 	  </div>
 	  
 	</div>
+	
+	<span class="getTextFor null document.title.gsdl">&amp;nbsp;</span>
+	
+      	<span id="language" style="display: none;"><xsl:value-of select="/page/@lang" /></span>
+      	<span id="interface" style="display: none;"><xsl:value-of select="$interface_name" /></span>
+	
+		<script type="text/javascript">var placeholder = false;</script>
+		<script type="text/javascript" src="jquery.js">
+			<xsl:comment>Filler for browser</xsl:comment>
+		</script>
+		<script type="text/javascript" src="test.js">
+			<xsl:comment>Filler for browser</xsl:comment>
+		</script>
 	
       </body>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/html.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/html.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/html.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <xsl:output method="html"/>  
@@ -11,12 +10,18 @@
   <xsl:template match="page">
     <html>
-      <head></head>
+      <head>
+      	
+      </head>
+	  <body>
       <frameset rows="68,*" noresize="" border="0">
-	<frame frameborder="0"><xsl:attribute name="src">?a=p&amp;sa=nav&amp;c=<xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value" /></xsl:attribute></frame>
+	<frame frameborder="0"><xsl:attribute name="src">?a=p&amp;amp;sa=nav&amp;amp;c=<xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value" /></xsl:attribute></frame>
 	<frame frameborder="0"><xsl:attribute name="src"><xsl:value-of select="/page/pageRequest/paramList/param[@name='url']/@value"/></xsl:attribute></frame>
 	<noframes>
-	  <p><xsl:value-of select="util:getInterfaceText('default', /page/@lang, 'textframebrowser')"/></p>
+	  <p class="getTextFor textframebrowser">&amp;amp;nbsp;</p>
 	</noframes>
       </frameset>
+		<script type="text/javascript" src="jquery.js"><!-- jQuery --></script>
+		<script type="text/javascript" src="test.js"><!-- Scripts for client side XSL transformations --></script>
+	  </body>
     </html>
   </xsl:template>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/icons.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/icons.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/icons.xsl	(revision 24007)
@@ -1,9 +1,5 @@
 <?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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <!-- some global parameters - these are set by whoever is invoking the transformation -->
@@ -19,10 +15,8 @@
 	  <xsl:when test="documentNode">
 	    <xsl:call-template name="openbookimg">
-	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param>
 	    </xsl:call-template>
 	  </xsl:when>
 	  <xsl:otherwise>
 	    <xsl:call-template name="closedbookimg">
-	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_book')"/></xsl:with-param>
 	    </xsl:call-template>
 	  </xsl:otherwise>
@@ -35,10 +29,8 @@
 	  <xsl:when test="documentNode">
 	    <xsl:call-template name="openfolderimg">
-	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_folder')"/></xsl:with-param>
 	    </xsl:call-template>
 	  </xsl:when>
 	  <xsl:otherwise>
 	    <xsl:call-template name="closedfolderimg">
-	      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_folder')"/></xsl:with-param>
 	    </xsl:call-template>
 	  </xsl:otherwise>
@@ -49,5 +41,4 @@
       <xsl:otherwise>
 	<xsl:call-template name="textpageimg">
-	  <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'view_document')"/></xsl:with-param>
 	</xsl:call-template>
       </xsl:otherwise>
@@ -56,41 +47,40 @@
 
   <xsl:template name="openbookimg">
+  	<xsl:param name="title"/>
     <xsl:param name="alt"/>
-    <xsl:param name="title"/>
     <img  border="0" width="28" height="23"
       src="interfaces/default/images/openbook.gif"
-      alt="{$alt}" title="{$title}"/>
+      alt="{$alt}" class="getTextFor null this.title.{$title}" />
   </xsl:template>
 
   <xsl:template name="closedbookimg">
     <xsl:param name="alt"/>
-    <xsl:param name="title"/>
     <img border="0" width="18" height="11"
       src="interfaces/default/images/book.gif"
-      alt="{$alt}" title="{$title}"/>
+      alt="{$alt}" class="getTextFor null this.title.open_book" />
   </xsl:template>
 
   <xsl:template name="openfolderimg">
+  	<xsl:param name="title"/>
     <xsl:param name="alt"/>
-    <xsl:param name="title"/>
     <img border="0" width="23" height="15"
       src="interfaces/default/images/openfldr.gif"
-      alt="{$alt}" title="{$title}"/>
+      alt="{$alt}" class="getTextFor null this.title.{$title}" />
   </xsl:template>
 
   <xsl:template name="closedfolderimg">
+  	<xsl:param name="title"/>
     <xsl:param name="alt"/>
-    <xsl:param name="title"/>
     <img  border="0" width="23" height="15"
       src="interfaces/default/images/clsdfldr.gif"
-      alt="{$alt}" title="{$title}"/>
+      alt="{$alt}" class="getTextFor null this.title.{$title}" />
   </xsl:template>
 
   <xsl:template name="textpageimg">
     <xsl:param name="alt"/>
-    <xsl:param name="title"/>
     <img  border="0" width="16" height="21"
       src="interfaces/default/images/itext.gif"
-      alt="{$alt}" title="{$title}"/>
+      alt="{$alt}" class="getTextFor null this.title.view_document,parent.class.text:'clientDocView'" />
+    <span><xsl:value-of select="$alt" /></span>
   </xsl:template>
 
@@ -105,16 +95,14 @@
   <xsl:template name="iconpdf">
     <xsl:param name="alt">PDF</xsl:param>
-    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonpdf')"/></xsl:param>
     <img border="0" width='26' height='26' 
       src='interfaces/default/images/ipdf.gif' 
-      alt='{$alt}' title='{$title}'/>
+      alt='{$alt}' class="getTextFor null this.title.texticonpdf" />
   </xsl:template>
   
   <xsl:template name="icondoc">
     <xsl:param name="alt">Word</xsl:param>
-    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonmsword')"/></xsl:param>
     <img border="0" width='26' height='26' 
       src='interfaces/default/images/imsword.gif' 
-      alt='{$alt}' title='{$title}'/>
+      alt='{$alt}' class="getTextFor null this.title.texticonmsword" />
   </xsl:template>
 
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/library.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/library.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/library.xsl	(revision 24007)
@@ -4,6 +4,5 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
   xmlns:gslib="http://www.greenstone.org/XSL/Library"
-  exclude-result-prefixes="util xalan gslib gsf xslt gs3">
-  
+  exclude-result-prefixes="gslib">
   
   <xsl:output
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/nav.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/nav.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/nav.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/pref.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/pref.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/pref.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
@@ -29,4 +28,5 @@
 	  <xsl:call-template name="greenstoneFooter"/>
 	</div>
+		<xsl:call-template name="pageTitleDeferred" />
       </body>
     </html>
@@ -34,5 +34,9 @@
   
   <xsl:template name="pageTitle">
-    <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"><xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/></xsl:when><xsl:otherwise><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:otherwise></xsl:choose>: <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_t')"/>
+    <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"><xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="pageTitleDeferred">
+  	    <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"></xsl:when><xsl:otherwise><span class="getTextFor null document.title.gsdl,document.title.text:' : '[a],document.title.pref_t[a]"></span>:</xsl:otherwise></xsl:choose>
   </xsl:template>
 
@@ -59,5 +63,5 @@
 	<input type='hidden' name='sa' value='pref'/>
 	<input type='hidden' name='c' value="{$collName}"/>
-	<div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></div>
+	<div class="formheading"><span class="getTextFor pref.prespref"></span></div>
 	<ul id="presprefs"><xsl:call-template name="pres-prefs"/></ul>
 	<ul id="berrybasketprefs" ><xsl:call-template name="berrybasket-prefs"/></ul>
@@ -67,7 +71,7 @@
 	</xsl:if>
 	
-	<div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></div>
+	<div class="formheading"><span class="getTextFor pref.searchpref"></span></div>
 	<ul id="searchprefs"><xsl:call-template name="search-prefs"/></ul>
-	<input type='submit'><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs')"/></xsl:attribute></input>
+	<input type='submit' class="getTextFor null this.value.pref.set_prefs" id="test"></input>
       </form>
     </div>
@@ -75,6 +79,7 @@
   
   <xsl:template name="pres-prefs">
-    <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/> <xsl:call-template name="lang-list"/></li>
-    <li><span class="rightspace"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></span>x</li>
+  	<li><span class="getTextFor pref.interfacelang"></span></li>
+    <li><xsl:call-template name="lang-list"/></li>
+    <li><span class="rightspace"><span class="getTextFor pref.encoding"></span></span>x</li>
   </xsl:template>
   
@@ -90,10 +95,10 @@
   <xsl:template name="search-prefs">
     <xsl:variable name="hits"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable> 
-    <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.hitsperpage')"/> 
+    <li><span class="getTextFor pref.hitsperpage">&amp;amp;nbsp;</span> 
       <select name="hitsPerPage">
 	<option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option> 
 	<option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
 	<option value="100"><xsl:if test="$hits=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
-	<option value="-1"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.all')"/></option>
+	<option value="-1" class="getTextFor pref.all"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if></option>
       </select>
     </li>
@@ -103,7 +108,7 @@
     <xsl:variable name="berrybasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='berrybasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
     
-    <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket')"/> <select name="berrybasket">
-        <option value="on"><xsl:if test="$berrybasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option> 
-	<option value="off"><xsl:if test="$berrybasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option>
+    <li><span class="getTextFor pref.berrybasket">&amp;amp;nbsp;</span> <select name="berrybasket">
+        <option value="on" class="getTextFor pref.berrybasket.on"><xsl:if test="$berrybasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if></option> 
+	<option value="off" class="getTextFor pref.berrybasket.off"><xsl:if test="$berrybasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if></option>
       </select>
     </li>
@@ -113,7 +118,7 @@
     <xsl:variable name="book"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='book']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
     
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.book')"/> <select name="book">
-      <option value="on"><xsl:if test="$book='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option> 
-      <option value="off"><xsl:if test="$book='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option>
+    <span class="getTextFor pref.book">&amp;amp;nbsp;</span> <select name="book">
+      <option value="on" class="getTextFor pref.berrybasket.on"><xsl:if test="$book='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if></option> 
+      <option value="off" class="getTextFor pref.berrybasket.off"><xsl:if test="$book='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if></option>
     </select>
     
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/process.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/process.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/process.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   <!-- style includes global params interface_name, library_name -->
@@ -83,5 +82,5 @@
     <center/>
     <applet code="org.greenstone.gsdl3.build.StatusDisplay.class" codebase='lib' archive='gsdl3.jar, xercesImpl.jar, xml-apis.jar' width='600' height='150'>The status display applet.
-      <param name='library'><xsl:attribute name="value"><xsl:value-of select='$library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='/page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='/page/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="/page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
+      <param name='library'><xsl:attribute name="value"><xsl:value-of select='$library_name'/>?a=pr&amp;amp;rt=s&amp;amp;c=<xsl:value-of select='$clusterName'/>&amp;amp;s=<xsl:value-of select='/page/pageResponse/service/@name'/>&amp;amp;o=xml&amp;amp;ro=1&amp;amp;l=<xsl:value-of select='/page/@lang'/>&amp;amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="/page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
       <param name='initial_text'><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></param>
       <param name='initial_code'><xsl:attribute name="value"><xsl:value-of  select="@code"/></xsl:attribute></param></applet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/query.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/query.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/query.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
   
   <!-- style includes global params interface_name, library_name -->
@@ -21,5 +20,5 @@
 	<title>
 	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	  <xsl:text> </xsl:text>
 	</title>
 	<xsl:call-template name="globalStyle"/>
@@ -27,4 +26,5 @@
       </head>
       <body>
+    
 	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
 	<div id="page-wrapper">
@@ -32,4 +32,5 @@
 	  <xsl:call-template name="greenstoneFooter"/>
 	</div>
+	<xsl:call-template name="pageTitle"/>
       </body>
     </html>
@@ -39,5 +40,5 @@
 
   <xsl:template name="pageTitle">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+    <span class="getTextFor null document.title.gsdl"></span>
   </xsl:template>
 
@@ -81,5 +82,5 @@
   <xsl:template name="query-response">
     <xsl:param name="collName"/>
-    <xsl:call-template name="dividerBar"><xsl:with-param name='text'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results')"/></xsl:with-param></xsl:call-template>
+    <xsl:call-template name="dividerBar"><xsl:with-param name='text'>query.results</xsl:with-param></xsl:call-template>
     
     <!-- If query term information is available, display it -->
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/querytools.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/querytools.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/querytools.xsl	(revision 24007)
@@ -3,7 +3,6 @@
   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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  extension-element-prefixes="java"
+  exclude-result-prefixes="java">
 
   <!-- have changed this so it uses service hitsPerPage and startPage if the service description has a param called hitsPerPage,  otherwise uses interface ones -->
@@ -61,5 +60,5 @@
 	<div>   
 	  <div>
-	    <xsl:if test="$here &gt; 1"><a href="{$library_name}?a=q&amp;sa={$sa}&amp;c={$collName}&amp;s={$service}&amp;rt=rd&amp;{$page-param}={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hpp + 1)"/> - <xsl:value-of select="number(($prev * $hpp))"/></a></xsl:if>
+	    <xsl:if test="$here &gt; 1"><a href="{$library_name}?a=q&amp;sa={$sa}&amp;c={$collName}&amp;s={$service}&amp;rt=rd&amp;{$page-param}={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><span class="getTextFor query.matches"></span><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hpp + 1)"/> - <xsl:value-of select="number(($prev * $hpp))"/></a></xsl:if>
 	    
 	    
@@ -67,5 +66,5 @@
 	      <xsl:variable name='m' select="number($next * $hpp)"/>
 	      <xsl:variable name='mm'><xsl:choose><xsl:when test="$m &lt; $td"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$td'/></xsl:otherwise></xsl:choose></xsl:variable>
-	      <a href="{$library_name}?a=q&amp;sa={$sa}&amp;c={$collName}&amp;s={$service}&amp;rt=rd&amp;{$page-param}={$next}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hpp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></div>
+	      <a href="{$library_name}?a=q&amp;sa={$sa}&amp;c={$collName}&amp;s={$service}&amp;rt=rd&amp;{$page-param}={$next}"><span class="getTextFor query.matches"></span><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hpp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></div>
 	</div>
       </xsl:if>
@@ -80,15 +79,15 @@
       <xsl:choose>
 	<xsl:when test="$numDocsMatched='0' or $numDocsReturned='0'">
-	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
+		<span class="getTextFor query.nodocsmatch"></span>
 	</xsl:when>
 	<xsl:when test="$numDocsMatched='1' or $numDocsReturned='1'">
-	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
+		<span class="getTextFor query.onedocsmatch"></span>
 	</xsl:when>
 	<xsl:when test="$numDocsMatched">
-	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
-	  <xsl:if test="$numDocsReturned"> (<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.docsreturned', $numDocsReturned)"/>)</xsl:if>
+	  <span><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.query.manydocsmatch|', $numDocsMatched)"/></xsl:attribute></span>
+	  <xsl:if test="$numDocsReturned"> (<span><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.query.docsreturned|', $numDocsReturned)" /></xsl:attribute></span>)</xsl:if>
 	</xsl:when>
 	<xsl:when test="$numDocsReturned">
-	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.atleastdocsmatch', $numDocsReturned)"/>
+	  <span><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.query.atleastdocsmatch|', $numDocsReturned)" /></xsl:attribute></span>
 	</xsl:when>
       </xsl:choose>
@@ -136,7 +135,7 @@
     <xsl:param name="serviceName"/>
     <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='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@docType'/>&amp;p.a=q&amp;&amp;p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&amp;p.s=<xsl:value-of select="$serviceName"/></xsl:attribute>
-      <xsl:apply-templates select="." mode="displayNodeIcon"/>
+      <xsl:apply-templates select="." mode="displayNodeIcon"/><xsl:text>sample</xsl:text>
     </a>
-    <span><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
+    <span><xsl:text>Testing</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
   </xsl:template>
 
@@ -144,5 +143,5 @@
     <div class="terminfo">
       <xsl:if test="count(termList/term) > 0">
-	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
+      <span class="getTextFor query.wordcount">&amp;nbsp;</span>
 	<xsl:for-each select="termList/term">
 	  <xsl:if test="position() > 1">, </xsl:if>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/service-params.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/service-params.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/service-params.xsl	(revision 24007)
@@ -4,8 +4,8 @@
   xmlns:java="http://xml.apache.org/xslt/java"
   extension-element-prefixes="java">
-
+  
   <!-- handling of the different types of params on a service form 
-  - these now only output the selection box/text box etc, not the name -->
-
+    - these now only output the selection box/text box etc, not the name -->
+  
   <!-- the default param list handling -->
   <xsl:template match="paramList">
@@ -13,13 +13,13 @@
     <ul id="queryitemlist">
       <xsl:for-each select="param">
-	<xsl:choose>
-	  <xsl:when test="@type='multi'">
-	    <li><xsl:apply-templates select='.'><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></li>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:variable name="pvalue"><xsl:apply-templates select="." mode="calculate-default"><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></xsl:variable>
-	    <li><xsl:value-of select="displayItem[@name='name']"/><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></li>
-	  </xsl:otherwise>
-	</xsl:choose>
+        <xsl:choose>
+          <xsl:when test="@type='multi'">
+            <li><xsl:apply-templates select='.'><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></li>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:variable name="pvalue"><xsl:apply-templates select="." mode="calculate-default"><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></xsl:variable>
+            <li><xsl:value-of select="displayItem[@name='name']"/><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></li>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:for-each>
     </ul>
@@ -27,5 +27,5 @@
   
   <!-- puts all the params into a=p&p=h type form - need to change this if use 
-  multi params  -->
+    multi params  -->
   <xsl:template match="paramList" mode="cgi">
     <xsl:param name="ns">s1.</xsl:param>
@@ -35,5 +35,5 @@
     </xsl:for-each>
   </xsl:template>
-
+  
   <xsl:template match="param" mode="calculate-default">
     <xsl:param name="ns">s1.</xsl:param>
@@ -41,25 +41,25 @@
     <xsl:choose>
       <xsl:when test="/page/pageRequest/paramList/param[@name=$pname]">
-	<xsl:choose>
-	  <xsl:when test="@type='enum_multi'"><xsl:text>,</xsl:text>
-	    <xsl:for-each select="/page/pageRequest/paramList/param[@name=$pname]">
-	      <xsl:value-of select="@value"/>,
-	    </xsl:for-each>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
-	  </xsl:otherwise>
-	</xsl:choose>
+        <xsl:choose>
+          <xsl:when test="@type='enum_multi'"><xsl:text>,</xsl:text>
+            <xsl:for-each select="/page/pageRequest/paramList/param[@name=$pname]">
+              <xsl:value-of select="@value"/>,
+            </xsl:for-each>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:when>
       <xsl:otherwise>
-	<xsl:value-of select="@default"/>
+        <xsl:value-of select="@default"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-
+  
   <!-- invisible params - used by other stuff. in the query form, we set to teh default -->
   <xsl:template match="param[@type='invisible']">
     <xsl:param name="ns">s1.</xsl:param>
-    <input type='hidden' name='{$ns}{@name}' value='{@default}'/>
+    <input type='hidden' name='concat($ns, @name)' value='{@default}'/>
   </xsl:template>
   <!-- boolean params -->
@@ -67,4 +67,5 @@
     <xsl:param name="ns">s1.</xsl:param>
     <xsl:param name="default"/>
+    
     <select name='{$ns}{@name}'>
       <option value="0"><xsl:if test="$default='0'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="option[@name='0']/displayItem[@name='name']"/></option>
@@ -76,30 +77,34 @@
   <xsl:template match="param[@type='integer']">
     <xsl:param name="ns">s1.</xsl:param>
-    <xsl:param name="default"/>
+    <xsl:param name="default"/> 
+    
     <input type="text" name="{$ns}{@name}" size="3" value="{$default}"/>
   </xsl:template>
-
+  
   <!-- single selection enum params -->
   <xsl:template match="param[@type='enum_single']">
     <xsl:param name="ns">s1.</xsl:param>
     <xsl:param name="default"/>
+    
     <xsl:choose>
       <xsl:when test="count(option) = 1">
-	<xsl:text> </xsl:text><xsl:value-of select="option/displayItem[@name='name']"/>
-	<input type='hidden' name='{$ns}{@name}'><xsl:attribute name='value'><xsl:value-of  select='option/@name'/></xsl:attribute></input>
+        <xsl:text> </xsl:text><xsl:value-of select="option/displayItem[@name='name']"/>
+        <input type='hidden' name='{$ns}{@name}'><xsl:attribute name='value'><xsl:value-of  select='option/@name'/></xsl:attribute></input>
       </xsl:when>
       <xsl:otherwise>
-	<select name="{$ns}{@name}">
-	  <xsl:for-each select="option">
-	    <option value="{@name}"><xsl:if test="@name=$default"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
-	  </xsl:for-each>
-	</select>
+        
+        <select name="{$ns}{@name}">
+          <xsl:for-each select="option">
+            <option value="{@name}"><!--<xsl:if test="@name=$default"><xsl:attribute name="selected"></xsl:attribute></xsl:if>--><xsl:value-of select="displayItem[@name='name']"/></option>
+          </xsl:for-each>
+        </select>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-
-
+  
+  
   <!-- multiple selection enum params -->
   <!-- how to do defaults for this?? -->
+  <!-- Don't need to do anything here, handled automatically in the list -->
   <xsl:template match="param[@type='enum_multi']">
     <xsl:param name="ns">s1.</xsl:param>
@@ -107,5 +112,5 @@
     <select name="{$ns}{@name}" size='2'><xsl:attribute name="multiple"></xsl:attribute>
       <xsl:for-each select="option">
-	<option value="{@name}"><xsl:if test="contains($default, concat(',', @name, ','))"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
+        <option value="{@name}"><xsl:if test="contains($default, concat(',', @name, ','))"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
       </xsl:for-each>
     </select>
@@ -116,4 +121,5 @@
     <xsl:param name="ns">s1.</xsl:param>
     <xsl:param name="default"/>
+    
     <input type="text" name="{$ns}{@name}" size="50" value="{$default}"/>
   </xsl:template>
@@ -122,8 +128,9 @@
   <xsl:template match="param[@type='text']">
     <xsl:param name="ns">s1.</xsl:param>
-    <xsl:param name="default"/>
+    <xsl:param name="default"/>    
+    
     <textarea name="{$ns}{@name}" cols="50" rows="3"><xsl:value-of select='$default'/></textarea>
   </xsl:template>
-
+  
   <!-- multi params - params that are combinations of other params -->
   <xsl:template match="param[@type='multi']">
@@ -132,7 +139,7 @@
     <table>
       <tr class="queryfieldheading"><xsl:value-of select="displayItem[@name='name']"/>
-      	<xsl:for-each select="param">
-	  <td class="queryfieldname"><xsl:value-of select="displayItem[@name='name']"/></td>
-	</xsl:for-each>
+        <xsl:for-each select="param">
+          <td class="queryfieldname"><xsl:value-of select="displayItem[@name='name']"/></td>
+        </xsl:for-each>
       </tr>
       
@@ -140,5 +147,5 @@
     </table>
   </xsl:template>
-
+  
   <xsl:template match="param[@type='multi']" mode="contents">
     <xsl:param name="ns">s1.</xsl:param>
@@ -146,15 +153,15 @@
     <xsl:variable name="pos" select="@occurs - $occurs"/>	
     <tr class="queryfieldrow"><xsl:for-each select="param">
-	<xsl:variable name="pname" select="@name"/>
-	<xsl:variable name="values" select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
-	<td class="queryfieldcell"><xsl:choose>
-	    <xsl:when test="not(@ignore) or  @ignore != $pos">      
-	      <xsl:apply-templates select='.'><xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($values, $pos)"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
-	    </xsl:when>
-	    <xsl:otherwise><!-- put in a hidden placeholder -->
-	      <input type="hidden" name='{$ns}{@name}' value=''/>
-	    </xsl:otherwise>
-	  </xsl:choose></td>
-      </xsl:for-each></tr>
+      <xsl:variable name="pname" select="@name"/>
+      <xsl:variable name="values" select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
+      <td class="queryfieldcell"><xsl:choose>
+        <xsl:when test="not(@ignore) or  @ignore != $pos">      
+          <xsl:apply-templates select='.'><xsl:with-param name="default" select="$values|$pos"/><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise><!-- put in a hidden placeholder -->
+          <input type="hidden" name='{$ns}{@name}' value=''/>
+        </xsl:otherwise>
+      </xsl:choose></td>
+    </xsl:for-each></tr>
     <!-- recursively call this template to get multiple entries -->
     <xsl:if test="$occurs &gt; 1">
@@ -162,27 +169,27 @@
     </xsl:if>
   </xsl:template>
-
+  
   
 </xsl:stylesheet>  
 
-  <!-- a param list that puts params in pairs- wont work as is with new
+<!-- a param list that puts params in pairs- wont work as is with new
   param handling stuff -->
-  <!--
+<!--
   <xsl:template match="paramList">
-    <p/><table width="537">
-      <xsl:choose>
-        <xsl:when test='count(param)>4'>
-          <xsl:for-each select="param[position() mod 2 = 1]"> 
-            <tr><xsl:apply-templates select="."/>
-              <xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr>
-          </xsl:for-each>
-        </xsl:when>
-	<xsl:otherwise>
-	  <xsl:for-each select="param">
-	    <tr><xsl:apply-templates select='.'/></tr>
-	  </xsl:for-each>
-	</xsl:otherwise>
-      </xsl:choose>
-    </table>
+  <p/><table width="537">
+  <xsl:choose>
+  <xsl:when test='count(param)>4'>
+  <xsl:for-each select="param[position() mod 2 = 1]"> 
+  <tr><xsl:apply-templates select="."/>
+  <xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr>
+  </xsl:for-each>
+  </xsl:when>
+  <xsl:otherwise>
+  <xsl:for-each select="param">
+  <tr><xsl:apply-templates select='.'/></tr>
+  </xsl:for-each>
+  </xsl:otherwise>
+  </xsl:choose>
+  </table>
   </xsl:template>
-  -->
+-->
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/style.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/style.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/style.xsl	(revision 24007)
@@ -1,9 +1,5 @@
 <?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"
-  extension-element-prefixes="java util"
-  exclude-result-prefixes="java util">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
   <xsl:include href="icons.xsl"/>
@@ -23,26 +19,32 @@
       <script language="Javascript">
 	<xsl:text disable-output-escaping="yes">
-	  function removeAllChildren(node) {
-	    while (node.hasChildNodes()) {
-	      node.removeChild(node.firstChild);
-	    }
+	  	  function removeAllChildren(node) {
+	  while (node.hasChildNodes()) {
+	  node.removeChild(node.firstChild);
 	  }
+	  }
 
 	  function toggleHideError(obj) {
-	    if (obj.style.display == "none") {
-	      obj.style.display = "";
-	      hide_link = document.getElementById("hide");
-	      removeAllChildren(hide_link);
-	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/><xsl:text disable-output-escaping="yes">"));
-	    } else {
-	      obj.style.display = "none";
-	      hide_link = document.getElementById("hide");
-	      removeAllChildren(hide_link);
-	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
-	    } 
+	  if (obj.style.display == "none") {
+	  obj.style.display = "";
+	  hide_link = document.getElementById("hide");
+	  removeAllChildren(hide_link);
+	  var theText = getText('hide_error', null);
+	  alert(theText);
+	  var hide_text = document.createTextNode(theText);
+	  hide_link.appendChild(hide_text));
+	  } else {
+	  obj.style.display = "none";
+	  hide_link = document.getElementById("hide");
+	  removeAllChildren(hide_link);
+	  var theText = getText('show_error', null);
+	  alert(theText);
+	  var show_text = document.createTextNode(theText);
+	  hide_link.appendChild(show_text);
+	  } 
 	  }
 	</xsl:text>
       </script>
-      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/></a></p>
+      <p align='right'><a id="hide" href="javascript:toggleHideError($('#error'));"><xsl:call-template name="getTextFor"><xsl:with-param name="key" select="'show_error'" /><xsl:with-param name="affect" select="''" /></xsl:call-template></a></p>
       <div id="error" style="display: none;">
 	<xsl:apply-templates select="descendant::error"/>
@@ -54,11 +56,18 @@
     <div id="footer">
       <xsl:call-template name="dividerBar">
-	<xsl:with-param name="text" select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 
+      	<xsl:with-param name="text"><xsl:text>powered-by</xsl:text></xsl:with-param>
       </xsl:call-template>
+	  	<script type="text/javascript">var placeholder = false;</script>
+	<script type="text/javascript" src="jquery.js">
+		<xsl:comment>Filler for browser</xsl:comment>
+	</script>
+	<script type="text/javascript" src="test.js">
+		<xsl:comment>Filler for browser</xsl:comment>
+	</script>
     </div>
   </xsl:template>
   
   <xsl:template match="error">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'error')"/> <xsl:value-of select="."/>
+    <span class="getTextFor error"></span> <xsl:value-of select="."/>
   </xsl:template>
 
@@ -67,5 +76,8 @@
     <xsl:param name="pageType"/>
     <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
-    <div  id="banner">    
+    <div id="loading" style="display: none; position: fixed; top: 0; right: 0; padding: 10px;"><img src="interfaces/default/images/loading.gif" alt="Loading interface..." /></div>
+  	<span id="language" style="display: none;"><xsl:value-of select="/page/@lang" /></span>
+  	<span id="interface" style="display: none;"><xsl:value-of select="$interface_name" /></span>   
+  	<div id="banner">    
       <p>
 	<a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
@@ -78,9 +90,5 @@
 		<xsl:attribute name="alt">
 		  <xsl:value-of select="$this-element/displayItem[@name='name']"/>
-		</xsl:attribute>
-		<xsl:attribute name="title">
-		  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
-		</xsl:attribute>
-	      </img>
+		</xsl:attribute></img>
 	    </xsl:when>
 	    <xsl:otherwise>
@@ -90,4 +98,9 @@
 	</a>
       </p>
+	  	<xsl:call-template name="getTextFor">
+			<xsl:with-param name="key" select="'null'" />
+			<xsl:with-param name="affect" select="'parent.title.aboutpage'" />
+			<xsl:with-param name="display" select="'none'" />
+		</xsl:call-template>
       <ul id="bannerlist"> 
 	<xsl:call-template name="top-buttons">
@@ -102,14 +115,25 @@
     <xsl:param name="collName"/>
     <xsl:param name="pageType"/>
-    <li><a  href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
-	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
+    <li><a href="{$library_name}?a=p&amp;sa=home">
+	  	<xsl:call-template name="getTextFor">
+  			<xsl:with-param name="key" select="'home_b'" />
+  			<xsl:with-param name="parentTip" select="'home_tip'" />
+  		</xsl:call-template>
       </a></li>
     <xsl:choose>
       <xsl:when test="$pageType='help'">
-	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li>
-      </xsl:when>
-      <xsl:otherwise>
-	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
-	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+	<li><a>
+		  <xsl:call-template name="getTextFor">
+  			  <xsl:with-param name="key" select="'help_b'" />
+  			  <xsl:with-param name="affect" select="'parent.title.help_tip'" />
+  		  </xsl:call-template>	
+	</a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
+	      <xsl:call-template name="getTextFor">
+  				<xsl:with-param name="key" select="'help_b'" />
+  				<xsl:with-param name="affect" select="'parent.title.help_tip'" />
+  			</xsl:call-template>
 	  </a></li>
       </xsl:otherwise>
@@ -117,12 +141,32 @@
     <xsl:choose>
       <xsl:when test="$pageType='pref'">
-	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
-      </xsl:when>
-      <xsl:otherwise>
-	<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
-	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+	<li><a><xsl:call-template name="getTextFor"><xsl:with-param name="key" select="'pref_b'" /><xsl:with-param name="affect" select="''" /></xsl:call-template></a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
+	      <xsl:call-template name="getTextFor"><xsl:with-param name="key" select="'pref_b'" /><xsl:with-param name="affect" select="'parent.title.pref_tip'" /></xsl:call-template>
 	  </a></li>
       </xsl:otherwise>
     </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="getTextFor">
+  	<xsl:param name="key" />
+  	<xsl:param name="affect" />
+  	<xsl:param name="display" select="'yes'" />
+
+	<xsl:variable name="extra">
+	<xsl:choose>
+	<xsl:when test="$affect!=''">
+		<xsl:text> </xsl:text>
+		<xsl:value-of select="$affect" />  	
+	</xsl:when>  	
+  	<xsl:otherwise>
+		<xsl:value-of select="' '" />  	
+  	</xsl:otherwise>
+  	</xsl:choose>
+  	</xsl:variable>
+
+  	<span class="getTextFor {$key}{$extra}"><xsl:if test="$display='none'"><xsl:attribute name="style"><xsl:text>display: </xsl:text><xsl:value-of select="$display" /><xsl:text>;</xsl:text></xsl:attribute></xsl:if><xsl:value-of select="$key" /></span>
   </xsl:template>
 
@@ -170,13 +214,12 @@
     <xsl:choose>
       <xsl:when test="$text">
-	<div class="divbar"><xsl:value-of select="$text"/></div>
-      </xsl:when>
-      <xsl:otherwise>
-	<div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
+		<div class="divbar"><xsl:choose><xsl:when test="$text='powered-by'"><span class="getTextFor gs3power">&amp;nbsp;</span></xsl:when><xsl:when test="$text='query.results'"><span class="getTextFor query.results">&amp;nbsp;</span></xsl:when><xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise></xsl:choose></div>
+      </xsl:when>
+      <xsl:otherwise>
+	<div class="divbar"><xsl:text disable-output-escaping="yes">&#160;</xsl:text></div>
       </xsl:otherwise>
     </xsl:choose> 
   </xsl:template>
-
-
+	
   <xsl:template name="direction">
     <xsl:if test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:if>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/system.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/system.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/system.xsl	(revision 24007)
@@ -14,5 +14,5 @@
 	<title>
 	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	  <xsl:text> </xsl:text>
 	</title>
 	<xsl:call-template name="globalStyle"/>
@@ -24,4 +24,5 @@
 	  <xsl:call-template name="response" />
 	  <xsl:call-template name="greenstoneFooter"/>
+	  <xsl:call-template name="pageTitle"/>
 	</div>
       </body>
@@ -30,5 +31,5 @@
   
   <xsl:template name="pageTitle">
-    <xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+    <span class="getTextFor null document.title.gsdl">&amp;nbsp;</span>
   </xsl:template>
   
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/util.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/util.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/util.xsl	(revision 24007)
@@ -4,6 +4,5 @@
   xmlns:gslib="http://www.greenstone.org/XSL/Library"
   xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
-  xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
-  exclude-result-prefixes="util gslib gsf">
+  exclude-result-prefixes="gslib gsf">
   
   <!-- some global parameters - these are set by whoever is invoking the transformation -->
@@ -11,4 +10,9 @@
   <xsl:param name="library_name"/>
 
+  <!-- Get rid of XSLT parameters from view -->
+  <xsl:template match="xsltparams/param">
+    <xsl:text></xsl:text>
+  </xsl:template>
+  
   <!-- every pages ................................................. -->
   
@@ -60,15 +64,19 @@
 	  hide_link = document.getElementById("hide");
 	  removeAllChildren(hide_link);
-	  hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/><xsl:text disable-output-escaping="yes">"));
+	  var theText = getText('hide_error', null);
+	  var hide_text = document.createTextNode(theText);
+	  hide_link.appendChild(hide_text));
 	  } else {
 	  obj.style.display = "none";
 	  hide_link = document.getElementById("hide");
 	  removeAllChildren(hide_link);
-	  hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
+	  var theText = getText('show_error', null);
+	  var show_text = document.createTextNode(theText);
+	  hide_link.appendChild(show_text);
 	  } 
 	  }
 	</xsl:text>
       </script>
-      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/></a></p>
+      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"></a></p>
       <div id="error" style="display: none;">
 	<xsl:apply-templates select="descendant::error"/>
@@ -84,5 +92,5 @@
   
   <xsl:template name="poweredByGS3TextBar">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 
+    <span class="getTextFor gs3power">&amp;nbsp;</span>
   </xsl:template>
   
@@ -92,10 +100,10 @@
   <xsl:template name="siteHomePageTitle">
     <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
+    <span class="getTextFor gsdl">&amp;nbsp;</span><xsl:text> </xsl:text>
   </xsl:template>
 
 
   <xsl:template name="selectACollectionTextBar">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
+  	<span class="getTextFor home.select_a_collection">&amp;nbsp;</span>
   </xsl:template>
   
@@ -112,5 +120,5 @@
       <input type="hidden" name="s1.collection" value="all"/>
       <input type="text" name="s1.query" size="20"/>
-      <input type="submit"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/></xsl:attribute></input>
+      <input type="submit" class="getTextFor null this.value.home.quick_search" />
     </form>
   </xsl:template>
@@ -162,11 +170,6 @@
   
   <xsl:template name="libraryInterfaceLink">
-    <li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li>
+    <li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><span class="getTextFor home.librarian_interface">&amp;nbsp;</span></a></li>
   </xsl:template> 
-  
-  
-  <xsl:template name="greenstoneLogoAlternateText">
-    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
-  </xsl:template>
 
   <!-- about page - collection home ......................... -->
@@ -177,5 +180,4 @@
   <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
 
-
   <xsl:template name="aboutCollectionPageTitle">
     <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
@@ -188,5 +190,5 @@
       <xsl:choose>
 	<xsl:when test="$this-element/displayItem[@name='icon']">
-	  <img border="0">
+	  <img border="0" class="getTextFor null this.title.aboutpage">
 	    <xsl:attribute name="src">
 	      <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
@@ -194,7 +196,4 @@
 	    <xsl:attribute name="alt">
 	      <xsl:value-of select="$this-element/displayItem[@name='name']"/>
-	    </xsl:attribute>
-	    <xsl:attribute name="title">
-	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
 	    </xsl:attribute>
 	  </img>
@@ -209,6 +208,5 @@
 
   <xsl:template name="homeButtonTop">
-    <a href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
-      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></a>
+    <a href="{$library_name}?a=p&amp;sa=home" class="getTextFor home_b this.title.home_tip">&amp;nbsp;</a>
   </xsl:template>
 
@@ -217,10 +215,8 @@
     <xsl:choose>
       <xsl:when test="$pageType='help'">
-	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li>
-      </xsl:when>
-      <xsl:otherwise>
-	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
-	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
-	  </a></li>
+	<li><a class="getTextFor help_b"></a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}" class="getTextFor help_b this.title.help_tip">&amp;nbsp;</a></li>
       </xsl:otherwise>
     </xsl:choose>
@@ -231,10 +227,8 @@
     <xsl:choose>
       <xsl:when test="$pageType='pref'">
-	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
-      </xsl:when>
-      <xsl:otherwise>
-	<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
-	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
-	  </a></li>
+	<li><a class="getTextFor pref_b">&amp;nbsp;</a></li>
+      </xsl:when>
+      <xsl:otherwise>
+	<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}" class="getTextFor pref_b this.title.pref_tip">&amp;nbsp;</a></li>
       </xsl:otherwise>
     </xsl:choose>
@@ -279,11 +273,11 @@
   <xsl:template match="serviceList">
     <xsl:param name="collName"/>
-    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>
+    <h3 class="getTextFor about.services">&amp;nbsp;</h3>
     <xsl:choose>
       <xsl:when test="service">
-	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
+		<span class="getTextFor about.servicehelp">&amp;nbsp;</span>
+      </xsl:when>
+      <xsl:otherwise>
+		<span class="getTextFor about.noservices">&amp;nbsp;</span>
       </xsl:otherwise>
     </xsl:choose>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/xml-to-string.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/xml-to-string.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default/transform/xml-to-string.xsl	(revision 24007)
@@ -0,0 +1,319 @@
+<!--
+Copyright (c) 2001-2009, Evan Lenz
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of Lenz Consulting Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+	    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Recent changes:
+
+2010-06-10: Added the $force-exclude-all-namespaces parameter
+2009-10-19: Added the $exclude-these-namespaces parameter 
+2009-10-08: Added $att-value parameter and template name to template rule for attributes.
+
+-->
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:output omit-xml-declaration="yes"/>
+
+  <xsl:param name="use-empty-syntax" select="true()"/>
+  <xsl:param name="exclude-unused-prefixes" select="true()"/>
+
+  <xsl:param name="force-exclude-all-namespaces" select="false()"/>
+
+  <!-- a node-set; each node's string-value
+       will be interpreted as a namespace URI to be
+       excluded from the serialization. -->
+  <xsl:param name="namespaces-to-exclude" select="/.."/>
+                                          <!-- initialized to empty node-set -->
+
+  <xsl:param name="start-tag-start"     select="'&lt;'"/>
+  <xsl:param name="start-tag-end"       select="'>'"/>
+  <xsl:param name="empty-tag-end"       select="'/>'"/>
+  <xsl:param name="end-tag-start"       select="'&lt;/'"/>
+  <xsl:param name="end-tag-end"         select="'>'"/>
+  <xsl:param name="space"               select="' '"/>
+  <xsl:param name="ns-decl"             select="'xmlns'"/>
+  <xsl:param name="colon"               select="':'"/>
+  <xsl:param name="equals"              select="'='"/>
+  <xsl:param name="attribute-delimiter" select="'&quot;'"/>
+  <xsl:param name="comment-start"       select="'&lt;!--'"/>
+  <xsl:param name="comment-end"         select="'-->'"/>
+  <xsl:param name="pi-start"            select="'&lt;?'"/>
+  <xsl:param name="pi-end"              select="'?>'"/>
+
+  <xsl:template name="xml-to-string">
+    <xsl:param name="node-set" select="."/>
+    <xsl:apply-templates select="$node-set" mode="xml-to-string">
+      <xsl:with-param name="depth" select="1"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+<!--
+  <xsl:template match="/" name="xml-to-string-root-rule">
+    <xsl:call-template name="xml-to-string"/>
+  </xsl:template>
+-->
+
+  <xsl:template match="/" mode="xml-to-string">
+    <xsl:param name="depth"/>
+    <xsl:apply-templates mode="xml-to-string">
+      <xsl:with-param name="depth" select="$depth"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="*" mode="xml-to-string">
+    <xsl:param name="depth"/>
+    <xsl:variable name="element" select="."/>
+    <xsl:value-of select="$start-tag-start"/>
+    <xsl:call-template name="element-name">
+      <xsl:with-param name="text" select="name()"/>
+    </xsl:call-template>
+    <xsl:apply-templates select="@*" mode="xml-to-string"/>
+    <xsl:if test="not($force-exclude-all-namespaces)">
+      <xsl:for-each select="namespace::*">
+        <xsl:call-template name="process-namespace-node">
+          <xsl:with-param name="element" select="$element"/>
+          <xsl:with-param name="depth" select="$depth"/>
+        </xsl:call-template>
+      </xsl:for-each>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="node() or not($use-empty-syntax)">
+        <xsl:value-of select="$start-tag-end"/>
+        <xsl:apply-templates mode="xml-to-string">
+          <xsl:with-param name="depth" select="$depth + 1"/>
+        </xsl:apply-templates>
+        <xsl:value-of select="$end-tag-start"/>
+        <xsl:call-template name="element-name">
+          <xsl:with-param name="text" select="name()"/>
+        </xsl:call-template>
+        <xsl:value-of select="$end-tag-end"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$empty-tag-end"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="process-namespace-node">
+    <xsl:param name="element"/>
+    <xsl:param name="depth"/>
+    <xsl:variable name="declaredAbove">
+      <xsl:call-template name="isDeclaredAbove">
+        <xsl:with-param name="depth" select="$depth - 1"/>
+        <xsl:with-param name="element" select="$element/.."/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="is-used-on-this-element" select="($element    | $element/@*) [namespace-uri() = current()]"/>
+    <xsl:variable name="is-used-on-a-descendant" select="($element//* | $element//@*)[namespace-uri() = current()]"/>          
+    <xsl:variable name="is-unused" select="not($is-used-on-this-element) and
+                                           not($is-used-on-a-descendant)"/>
+    <xsl:variable name="exclude-ns" select="($is-unused and $exclude-unused-prefixes) or
+                                            (. = $namespaces-to-exclude)"/>
+
+    <xsl:variable name="force-include" select="$is-used-on-this-element and (. = $namespaces-to-exclude)"/>
+
+    <xsl:if test="(name() != 'xml') and ($force-include or (not($exclude-ns) and not(string($declaredAbove))))">
+      <xsl:value-of select="$space"/>
+      <xsl:value-of select="$ns-decl"/>
+      <xsl:if test="name()">
+        <xsl:value-of select="$colon"/>
+        <xsl:call-template name="ns-prefix">
+          <xsl:with-param name="text" select="name()"/>
+        </xsl:call-template>
+      </xsl:if>
+      <xsl:value-of select="$equals"/>
+      <xsl:value-of select="$attribute-delimiter"/>
+      <xsl:call-template name="ns-uri">
+        <xsl:with-param name="text" select="string(.)"/>
+      </xsl:call-template>
+      <xsl:value-of select="$attribute-delimiter"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="isDeclaredAbove">
+    <xsl:param name="element"/>
+    <xsl:param name="depth"/>
+    <xsl:if test="$depth > 0">
+      <xsl:choose>
+        <xsl:when test="$element/namespace::*[name(.)=name(current()) and .=current()]">1</xsl:when>
+        <xsl:when test="$element/namespace::*[name(.)=name(current())]"/>
+        <xsl:otherwise>
+          <xsl:call-template name="isDeclaredAbove">
+            <xsl:with-param name="depth" select="$depth - 1"/>
+            <xsl:with-param name="element" select="$element/.."/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="@*" mode="xml-to-string" name="serialize-attribute">
+    <xsl:param name="att-value" select="string(.)"/>
+    <xsl:value-of select="$space"/>
+    <xsl:call-template name="attribute-name">
+      <xsl:with-param name="text" select="name()"/>
+    </xsl:call-template>
+    <xsl:value-of select="$equals"/>
+    <xsl:value-of select="$attribute-delimiter"/>
+    <xsl:call-template name="attribute-value">
+      <xsl:with-param name="text" select="$att-value"/>
+    </xsl:call-template>
+    <xsl:value-of select="$attribute-delimiter"/>
+  </xsl:template>
+
+  <xsl:template match="comment()" mode="xml-to-string">
+    <xsl:value-of select="$comment-start"/>
+    <xsl:call-template name="comment-text">
+      <xsl:with-param name="text" select="string(.)"/>
+    </xsl:call-template>
+    <xsl:value-of select="$comment-end"/>
+  </xsl:template>
+
+  <xsl:template match="processing-instruction()" mode="xml-to-string">
+    <xsl:value-of select="$pi-start"/>
+    <xsl:call-template name="pi-target">
+      <xsl:with-param name="text" select="name()"/>
+    </xsl:call-template>
+    <xsl:value-of select="$space"/>
+    <xsl:call-template name="pi-text">
+      <xsl:with-param name="text" select="string(.)"/>
+    </xsl:call-template>
+    <xsl:value-of select="$pi-end"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="xml-to-string">
+    <xsl:call-template name="text-content">
+      <xsl:with-param name="text" select="string(.)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="element-name">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="attribute-name">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="attribute-value">
+    <xsl:param name="text"/>
+    <xsl:variable name="escaped-markup">
+      <xsl:call-template name="escape-markup-characters">
+        <xsl:with-param name="text" select="$text"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$attribute-delimiter = &quot;'&quot;">
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="$escaped-markup"/>
+          <xsl:with-param name="replace" select="&quot;'&quot;"/>
+          <xsl:with-param name="with" select="'&amp;amp;apos;'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$attribute-delimiter = '&quot;'">
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="$escaped-markup"/>
+          <xsl:with-param name="replace" select="'&quot;'"/>
+          <xsl:with-param name="with" select="'&amp;amp;quot;'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="$escaped-markup"/>
+          <xsl:with-param name="replace" select="$attribute-delimiter"/>
+          <xsl:with-param name="with" select="''"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="ns-prefix">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="ns-uri">
+    <xsl:param name="text"/>
+    <xsl:call-template name="attribute-value">
+      <xsl:with-param name="text" select="$text"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="text-content">
+    <xsl:param name="text"/>
+    <xsl:call-template name="escape-markup-characters">
+      <xsl:with-param name="text" select="$text"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="pi-target">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="pi-text">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="comment-text">
+    <xsl:param name="text"/>
+    <xsl:value-of select="$text"/>
+  </xsl:template>
+
+  <xsl:template name="escape-markup-characters">
+    <xsl:param name="text"/>
+    <xsl:variable name="ampEscaped">
+      <xsl:call-template name="replace-string">
+        <xsl:with-param name="text" select="$text"/>
+        <xsl:with-param name="replace" select="'&amp;amp;'"/>
+        <xsl:with-param name="with" select="'&amp;amp;amp;'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:variable name="ltEscaped">
+      <xsl:call-template name="replace-string">
+        <xsl:with-param name="text" select="$ampEscaped"/>
+        <xsl:with-param name="replace" select="'&lt;'"/>
+        <xsl:with-param name="with" select="'&amp;amp;lt;'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:call-template name="replace-string">
+      <xsl:with-param name="text" select="$ltEscaped"/>
+      <xsl:with-param name="replace" select="']]>'"/>
+      <xsl:with-param name="with" select="']]&amp;amp;gt;'"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="replace-string">
+    <xsl:param name="text"/>
+    <xsl:param name="replace"/>
+    <xsl:param name="with"/>
+    <xsl:variable name="stringText" select="string($text)"/>
+    <xsl:choose>
+      <xsl:when test="contains($stringText,$replace)">
+        <xsl:value-of select="substring-before($stringText,$replace)"/>
+        <xsl:value-of select="$with"/>
+        <xsl:call-template name="replace-string">
+          <xsl:with-param name="text" select="substring-after($stringText,$replace)"/>
+          <xsl:with-param name="replace" select="$replace"/>
+          <xsl:with-param name="with" select="$with"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$stringText"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oai/oai2.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oai/oai2.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oai/oai2.xsl	(revision 24007)
@@ -0,0 +1,693 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+  XSL Transform to convert OAI 2.0 responses into XHTML
+
+  By Christopher Gutteridge, University of Southampton
+
+-->
+
+<!-- 
+  
+Copyright (c) 2000-2004 University of Southampton, UK. SO17 1BJ.
+
+EPrints 2 is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+EPrints 2 is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with EPrints 2; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+-->
+   
+<!--
+  
+  All the elements really needed for EPrints are done but if
+  you want to use this XSL for other OAI archive you may want
+  to make some minor changes or additions.
+
+  Not Done
+    The 'about' section of 'record'
+    The 'compession' part of 'identify'
+    The optional attributes of 'resumptionToken'
+    The optional 'setDescription' container of 'set'
+
+  All the links just link to oai_dc versions of records.
+
+-->
+
+<!-- Modified for the Greenstone OAI server 
+
+  * Rules for Qualified Dublin Core added (gsdl_qdc)
+  * EPrints specific stuff removed
+-->
+
+
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:oai="http://www.openarchives.org/OAI/2.0/"
+>
+
+<xsl:output method="html"/>
+
+
+
+<xsl:template name="style">
+td.value {
+	vertical-align: top;
+	padding-left: 1em;
+	padding: 3px;
+}
+td.key {
+	background-color: #e0e0ff;
+	padding: 3px;
+	text-align: right;
+	border: 1px solid #c0c0c0;
+	white-space: nowrap;
+	font-weight: bold;
+	vertical-align: top;
+}
+.dcdata td.key {
+	background-color: #ffffe0;
+}
+body { 
+	margin: 1em 2em 1em 2em;
+}
+h1, h2, h3 {
+	font-family: sans-serif;
+	clear: left;
+}
+h1 {
+	padding-bottom: 4px;
+	margin-bottom: 0px;
+}
+h2 {
+	margin-bottom: 0.5em;
+}
+h3 {
+	margin-bottom: 0.3em;
+	font-size: medium;
+}
+.link {
+	border: 1px outset #88f;
+	background-color: #c0c0ff;
+	padding: 1px 4px 1px 4px;
+	font-size: 80%;
+	text-decoration: none;
+	font-weight: bold;
+	font-family: sans-serif;
+	color: black;
+}
+.link:hover {
+	color: red;
+}
+.link:active {
+	color: red;
+	border: 1px inset #88f;
+	background-color: #a0a0df;
+}
+.oaiRecord, .oaiRecordTitle {
+	background-color: #f0f0ff;
+	border-style: solid;
+	border-color: #d0d0d0;
+}
+h2.oaiRecordTitle {
+	background-color: #e0e0ff;
+	font-size: medium;
+	font-weight: bold;
+	padding: 10px;
+	border-width: 2px 2px 0px 2px;
+	margin: 0px;
+}
+.oaiRecord {
+	margin-bottom: 3em;
+	border-width: 2px;
+	padding: 10px;
+}
+
+.results {
+	margin-bottom: 1.5em;
+}
+ul.quicklinks {
+	margin-top: 2px;
+	padding: 4px;
+	text-align: left;
+	border-bottom: 2px solid #ccc;
+	border-top: 2px solid #ccc;
+	clear: left;
+}
+ul.quicklinks li {
+	font-size: 80%;
+	display: inline;
+	list-stlye: none;
+	font-family: sans-serif;
+}
+p.intro {
+	font-size: 80%;
+}
+<xsl:call-template name='xmlstyle' />
+</xsl:template>
+
+<xsl:variable name='identifier' select="substring-before(concat(substring-after(/oai:OAI-PMH/oai:request,'identifier='),'&amp;'),'&amp;')" />
+
+<xsl:template match="/">
+<html>
+  <head>
+    <title>OAI 2.0 Request Results</title>
+    <style><xsl:call-template name="style"/></style>
+  </head>
+  <body>
+    <h1>OAI 2.0 Request Results</h1>
+    <xsl:call-template name="quicklinks"/>
+    <p class="intro">You are viewing an HTML version of the XML OAI response. To see the underlying XML use your web browsers view source option. More information about this XSLT is at the <a href="#moreinfo">bottom of the page</a>.</p>
+    <xsl:apply-templates select="/oai:OAI-PMH" />
+    <xsl:call-template name="quicklinks"/>
+    <h2><a name="moreinfo">About the XSLT</a></h2>
+    <p>An XSLT file has converted the <a href="http://www.openarchives.org">OAI-PMH 2.0</a> responses into XHTML which looks nice in a browser which supports XSLT such as Mozilla, Firebird and Internet Explorer. The XSLT file was created by <a href="http://www.ecs.soton.ac.uk/people/cjg">Christopher Gutteridge</a> at the University of Southampton as part of the <a href="http://software.eprints.org">GNU EPrints system</a>, and modified by the NZDL Project for use with the Greenstone OAI server. It is freely redistributable under the <a href="http://www.gnu.org">GPL</a>.</p><p>If you want to use the XSL file on your own OAI interface you may but due to the way XSLT works you must install the XSL file on the same server as the OAI script, you can't just link to this copy.</p><p>For more information or to download the XSL file please see the <a href="http://software.eprints.org/xslt.php">OAI to XHTML XSLT homepage</a>.</p>
+
+  </body>
+</html>
+</xsl:template>
+
+<xsl:template name="quicklinks">
+    <ul class="quicklinks">
+      <li><a href="?verb=Identify">Identify</a> | </li> 
+      <li><a href="?verb=ListRecords&amp;metadataPrefix=oai_dc">ListRecords (oai_dc)</a> | </li>
+      <li><a href="?verb=ListSets">ListSets</a> | </li>
+      <li><a href="?verb=ListMetadataFormats">ListMetadataFormats</a> | </li>
+      <li><a href="?verb=ListIdentifiers&amp;metadataPrefix=oai_dc">ListIdentifiers (oai_dc)</a></li>
+    </ul>
+</xsl:template>
+
+
+<xsl:template match="/oai:OAI-PMH">
+  <table class="values">
+    <tr><td class="key">Datestamp of response</td>
+    <td class="value"><xsl:value-of select="oai:responseDate"/></td></tr>
+    <tr><td class="key">Request URL</td>
+    <td class="value"><xsl:value-of select="oai:request"/></td></tr>
+  </table>
+<!--  verb: [<xsl:value-of select="oai:request/@verb" />]<br /> -->
+  <xsl:choose>
+    <xsl:when test="oai:error">
+      <h2>OAI Error(s)</h2>
+      <p>The request could not be completed due to the following error or errors.</p>
+      <div class="results">
+        <xsl:apply-templates select="oai:error"/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>Request was of type <xsl:value-of select="oai:request/@verb"/>.</p>
+      <div class="results">
+        <xsl:apply-templates select="oai:Identify" />
+        <xsl:apply-templates select="oai:GetRecord"/>
+        <xsl:apply-templates select="oai:ListRecords"/>
+        <xsl:apply-templates select="oai:ListSets"/>
+        <xsl:apply-templates select="oai:ListMetadataFormats"/>
+        <xsl:apply-templates select="oai:ListIdentifiers"/>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- ERROR -->
+
+<xsl:template match="/oai:OAI-PMH/oai:error">
+  <table class="values">
+    <tr><td class="key">Error Code</td>
+    <td class="value"><xsl:value-of select="@code"/></td></tr>
+  </table>
+  <p class="error"><xsl:value-of select="." /></p>
+</xsl:template>
+
+<!-- IDENTIFY -->
+
+<xsl:template match="/oai:OAI-PMH/oai:Identify">
+  <table class="values">
+    <tr><td class="key">Repository Name</td>
+    <td class="value"><xsl:value-of select="oai:repositoryName"/></td></tr>
+    <tr><td class="key">Base URL</td>
+    <td class="value"><xsl:value-of select="oai:baseURL"/></td></tr>
+    <tr><td class="key">Protocol Version</td>
+    <td class="value"><xsl:value-of select="oai:protocolVersion"/></td></tr>
+    <tr><td class="key">Earliest Datestamp</td>
+    <td class="value"><xsl:value-of select="oai:earliestDatestamp"/></td></tr>
+    <tr><td class="key">Deleted Record Policy</td>
+    <td class="value"><xsl:value-of select="oai:deletedRecord"/></td></tr>
+    <tr><td class="key">Granularity</td>
+    <td class="value"><xsl:value-of select="oai:granularity"/></td></tr>
+    <xsl:apply-templates select="oai:adminEmail"/>
+  </table>
+  <xsl:apply-templates select="oai:description"/>
+<!--no warning about unsupported descriptions -->
+</xsl:template>
+
+<xsl:template match="/oai:OAI-PMH/oai:Identify/oai:adminEmail">
+    <tr><td class="key">Admin Email</td>
+    <td class="value"><xsl:value-of select="."/></td></tr>
+</xsl:template>
+
+<!--
+   Identify / Unsupported Description
+-->
+
+<xsl:template match="oai:description/*" priority="-100">
+  <h2>Unsupported Description Type</h2>
+  <p>The XSL currently does not support this type of description.</p>
+  <div class="xmlSource">
+    <xsl:apply-templates select="." mode='xmlMarkup' />
+  </div>
+</xsl:template>
+
+
+<!--
+   Identify / OAI-Identifier
+-->
+
+<xsl:template match="id:oai-identifier" xmlns:id="http://www.openarchives.org/OAI/2.0/oai-identifier">
+  <h2>OAI-Identifier</h2>
+  <table class="values">
+    <tr><td class="key">Scheme</td>
+    <td class="value"><xsl:value-of select="id:scheme"/></td></tr>
+    <tr><td class="key">Repository Identifier</td>
+    <td class="value"><xsl:value-of select="id:repositoryIdentifier"/></td></tr>
+    <tr><td class="key">Delimiter</td>
+    <td class="value"><xsl:value-of select="id:delimiter"/></td></tr>
+    <tr><td class="key">Sample OAI Identifier</td>
+    <td class="value"><xsl:value-of select="id:sampleIdentifier"/></td></tr>
+  </table>
+</xsl:template>
+
+<xsl:template match="id:oai-identifier" xmlns:id="http://www.openarchives.org/OAI/1.1/oai-identifier">
+  <h2>OAI-Identifier</h2>
+  <table class="values">
+    <tr><td class="key">Scheme</td>
+    <td class="value"><xsl:value-of select="id:scheme"/></td></tr>
+    <tr><td class="key">Repository Identifier</td>
+    <td class="value"><xsl:value-of select="id:repositoryIdentifier"/></td></tr>
+    <tr><td class="key">Delimiter</td>
+    <td class="value"><xsl:value-of select="id:delimiter"/></td></tr>
+    <tr><td class="key">Sample OAI Identifier</td>
+    <td class="value"><xsl:value-of select="id:sampleIdentifier"/></td></tr>
+  </table>
+</xsl:template>
+
+<!-- Identify / GSDL Info -->
+  <xsl:template match="id:gsdl" xmlns:id="http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo">
+    <h2> Description </h2>
+    <table class="values">
+      <xsl:apply-templates select="id:Metadata"/>
+    </table>
+  </xsl:template>
+
+  <xsl:template match="id:Metadata" xmlns:id="http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo">
+    <tr><td class="key"><xsl:value-of select="@name"/></td>
+      <td class="value"><xsl:value-of select="."/></td></tr>
+  </xsl:template>
+<!-- GetRecord -->
+
+<xsl:template match="oai:GetRecord">
+  <xsl:apply-templates select="oai:record" />
+</xsl:template>
+
+<!-- ListRecords -->
+
+<xsl:template match="oai:ListRecords">
+  <xsl:apply-templates select="oai:record" />
+  <xsl:apply-templates select="oai:resumptionToken" />
+</xsl:template>
+
+<!-- ListIdentifiers -->
+
+<xsl:template match="oai:ListIdentifiers">
+  <xsl:apply-templates select="oai:header" />
+  <xsl:apply-templates select="oai:resumptionToken" />
+</xsl:template>
+
+<!-- ListSets -->
+
+<xsl:template match="oai:ListSets">
+  <xsl:apply-templates select="oai:set" />
+  <xsl:apply-templates select="oai:resumptionToken" />
+</xsl:template>
+
+<xsl:template match="oai:set">
+  <h2>Set</h2>
+  <table class="values">
+    <tr><td class="key">setName</td>
+    <td class="value"><xsl:value-of select="oai:setName"/></td></tr>
+    <tr><td class="key">setDescription</td>
+    <td class="value"><xsl:value-of select="oai:setDescription"/></td></tr>
+    <xsl:apply-templates select="oai:setSpec" />
+  </table>
+</xsl:template>
+
+<!-- ListMetadataFormats -->
+
+<xsl:template match="oai:ListMetadataFormats">
+  <xsl:choose>
+    <xsl:when test="$identifier">
+      <p>This is a list of metadata formats available for the record "<xsl:value-of select='$identifier' />". Use these links to view the metadata: <xsl:apply-templates select="oai:metadataFormat/oai:metadataPrefix" /></p>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>This is a list of metadata formats available from this archive.</p>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates select="oai:metadataFormat" />
+</xsl:template>
+
+<xsl:template match="oai:metadataFormat">
+  <h2>Metadata Format</h2>
+  <table class="values">
+    <tr><td class="key">metadataPrefix</td>
+    <td class="value"><xsl:value-of select="oai:metadataPrefix"/></td></tr>
+    <tr><td class="key">metadataNamespace</td>
+    <td class="value"><xsl:value-of select="oai:metadataNamespace"/></td></tr>
+    <tr><td class="key">schema</td>
+    <td class="value"><a href="{oai:schema}"><xsl:value-of select="oai:schema"/></a></td></tr>
+  </table>
+</xsl:template>
+
+<xsl:template match="oai:metadataPrefix">
+      <xsl:text> </xsl:text><a class="link" href="?verb=GetRecord&amp;metadataPrefix={.}&amp;identifier={$identifier}"><xsl:value-of select='.' /></a>
+</xsl:template>
+
+<!-- record object -->
+
+<xsl:template match="oai:record">
+  <h2 class="oaiRecordTitle">OAI Record: <xsl:value-of select="oai:header/oai:identifier"/></h2>
+  <div class="oaiRecord">
+    <xsl:apply-templates select="oai:header" />
+    <xsl:apply-templates select="oai:metadata" />
+    <xsl:apply-templates select="oai:about" />
+  </div>
+</xsl:template>
+
+<xsl:template match="oai:header">
+  <h3>OAI Record Header</h3>
+  <table class="values">
+    <tr><td class="key">OAI Identifier</td>
+    <td class="value">
+      <xsl:value-of select="oai:identifier"/>
+      <xsl:text> </xsl:text><a class="link" href="?verb=GetRecord&amp;metadataPrefix=oai_dc&amp;identifier={oai:identifier}">oai_dc</a>
+      <xsl:text> </xsl:text><a class="link" href="?verb=ListMetadataFormats&amp;identifier={oai:identifier}">formats</a>
+    </td></tr>
+    <tr><td class="key">Datestamp</td>
+    <td class="value"><xsl:value-of select="oai:datestamp"/></td></tr>
+  <xsl:apply-templates select="oai:setSpec" />
+  </table>
+  <xsl:if test="@status='deleted'">
+    <p>This record has been deleted.</p>
+  </xsl:if>
+</xsl:template>
+
+
+<xsl:template match="oai:about">
+  <p>"about" part of record container not supported by the XSL</p>
+</xsl:template>
+
+<xsl:template match="oai:metadata">
+  &#160;
+  <div class="metadata">
+    <xsl:apply-templates select="*" />
+  </div>
+</xsl:template>
+
+
+
+
+<!-- oai setSpec object -->
+
+<xsl:template match="oai:setSpec">
+  <tr><td class="key">setSpec</td>
+  <td class="value"><xsl:value-of select="."/>
+    <xsl:text> </xsl:text><a class="link" href="?verb=ListIdentifiers&amp;metadataPrefix=oai_dc&amp;set={.}">Identifiers</a>
+    <xsl:text> </xsl:text><a class="link" href="?verb=ListRecords&amp;metadataPrefix=oai_dc&amp;set={.}">Records</a>
+  </td></tr>
+</xsl:template>
+
+
+
+<!-- oai resumptionToken -->
+
+<xsl:template match="oai:resumptionToken">
+   <p>There are more results.</p>
+   <table class="values">
+     <tr><td class="key">resumptionToken:</td>
+     <td class="value"><xsl:value-of select="."/>
+<xsl:text> </xsl:text>
+<a class="link" href="?verb={/oai:OAI-PMH/oai:request/@verb}&amp;resumptionToken={.}">Resume</a></td></tr>
+   </table>
+</xsl:template>
+
+<!-- unknown metadata format -->
+
+<xsl:template match="oai:metadata/*" priority='-100'>
+  <h3>Unknown Metadata Format</h3>
+  <div class="xmlSource">
+    <xsl:apply-templates select="." mode='xmlMarkup' />
+  </div>
+</xsl:template>
+
+<!-- oai_dc record -->
+
+<xsl:template match="oai_dc:dc"  xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" >
+  <div class="dcdata">
+    <h3>Dublin Core Metadata (oai_dc)</h3>
+    <table class="dcdata">
+      <xsl:apply-templates select="*" />
+    </table>
+  </div>
+</xsl:template>
+
+<xsl:template match="dc:title" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Title</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:creator" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Author or Creator</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:subject" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Subject and Keywords</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:description" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Description</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:publisher" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Publisher</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:contributor" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Other Contributor</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:date" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Date</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:type" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Resource Type</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:format" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Format</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:identifier" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Resource Identifier</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:source" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Source</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:language" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Language</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:relation" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Relation</td><td class="value">
+  <xsl:choose>
+    <xsl:when test='starts-with(.,"http" )'>
+      <xsl:choose>
+        <xsl:when test='string-length(.) &gt; 50'>
+          <a class="link" href="{.}">URL</a>
+          <i> URL not shown as it is very long.</i>
+        </xsl:when>
+        <xsl:otherwise>
+          <a href="{.}"><xsl:value-of select="."/></a>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="."/>
+    </xsl:otherwise>
+  </xsl:choose>
+</td></tr></xsl:template>
+
+<xsl:template match="dc:coverage" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Coverage</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:rights" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Rights Management</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<!-- gsdl_qdc record -->
+<xsl:template match="gsdl_qdc:gsdl_qdc"  xmlns:gsdl_qdc="http://greenstone.org/namespace/gsdl_qdc/1.0/" >
+  <div class="dcdata">
+    <h3>Qualified Dublin Core Metadata (gsdl_qdc)</h3>
+    <table class="dcdata">
+      <xsl:apply-templates select="*" />
+    </table>
+  </div>
+</xsl:template>
+
+<xsl:template match="dc:title" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Title</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:creator" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Creator</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:subject" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Subject</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:description" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Description</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:publisher" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Publisher</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:contributor" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Contributor</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:date" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:type" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Type</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:format" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Format</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:identifier" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Identifier</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:source" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Source</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:language" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Language</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:relation" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Relation</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:coverage" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Coverage</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:rights" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Rights</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:alternative" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Alternative Title</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:tableOfContents" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Table Of Contents</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:abstract" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Abstract</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:created" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Created</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:valid" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Valid</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:available" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Available</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:issued" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Issued</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:modified" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Modified</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:dateAccepted" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Accepted</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:dateCopyrighted" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Copyrighted</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:dateSubmitted" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Date Submitted</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:extent" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Extent</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:medium" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Medium</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:isVersionOf" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Is Version Of</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:hasVersion" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Has Version</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:isReplacedBy" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Is Replaced By</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:replaces" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Replaces</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:isRequiredBy" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Is Required By</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:requires" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Requires</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:isPartOf" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Is Part Of</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:hasPart" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Has Part</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:isReferencedBy" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Is Referenced By</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:references" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">References</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:isFormatOf" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Is Format Of</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:hasFormat" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Has Format</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:conformsTo" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Conforms To</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:spatial" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Spatial Coverage</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:temporal" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Temporal Coverage</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:audience" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Audience</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:accrualMethod" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Accrual Method</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:accrualPeriodicity" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Accrual Periodicity</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:accrualPolicy" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Accrual Policy</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:instructionalMethod" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Instructional Method</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:provenance" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Provenance</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:rightsHolder" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Rights Holder</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:mediator" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Mediator</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:educationLevel" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Audience Education Level</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:accessRights" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Access Rights</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:license" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">License</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+<xsl:template match="dc:bibliographicCitation" xmlns:dc="http://purl.org/dc/terms/">
+<tr><td class="key">Bibliographic Citation</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<!-- XML Pretty Maker -->
+
+<xsl:template match="node()" mode='xmlMarkup'>
+  <div class="xmlBlock">
+    &lt;<span class="xmlTagName"><xsl:value-of select='name(.)' /></span><xsl:apply-templates select="@*" mode='xmlMarkup'/>&gt;<xsl:apply-templates select="node()" mode='xmlMarkup' />&lt;/<span class="xmlTagName"><xsl:value-of select='name(.)' /></span>&gt;
+  </div>
+</xsl:template>
+
+<xsl:template match="text()" mode='xmlMarkup'><span class="xmlText"><xsl:value-of select='.' /></span></xsl:template>
+
+<xsl:template match="@*" mode='xmlMarkup'>
+  <xsl:text> </xsl:text><span class="xmlAttrName"><xsl:value-of select='name()' /></span>="<span class="xmlAttrValue"><xsl:value-of select='.' /></span>"
+</xsl:template>
+
+<xsl:template name="xmlstyle">
+.xmlSource {
+	font-size: 70%;
+	border: solid #c0c0a0 1px;
+	background-color: #ffffe0;
+	padding: 2em 2em 2em 0em;
+}
+.xmlBlock {
+	padding-left: 2em;
+}
+.xmlTagName {
+	color: #800000;
+	font-weight: bold;
+}
+.xmlAttrName {
+	font-weight: bold;
+}
+.xmlAttrValue {
+	color: #0000c0;
+}
+</xsl:template>
+
+</xsl:stylesheet>
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/js/berrybasket.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/js/berrybasket.js	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/js/berrybasket.js	(revision 24007)
@@ -59,5 +59,5 @@
 		// they are set to be invisible to prevent flickering when first loaded (see berry.css)
 
-		var berries = $('img');
+		var berries = document.getElementsByTagName('img');
 		var berrybasket = new YAHOO.util.DDTarget('berrybasket','basket');
 
@@ -87,4 +87,5 @@
 
 	var responseFailure = function(o){
+		alert("CHECKOUT FAILED");
 //alert( arguments.callee );
 	}
@@ -165,12 +166,8 @@
 	var basketHandle = YAHOO.util.Dom.get('baskethandle');
 	var berries = YAHOO.util.Dom.get('berries');
-	var div = document.createElement('div');
-	var list = document.createElement('ol');
 	var width = 500;
 	var height = 40;
 	var i=0;
 
-	list.id = 'doclist';
-
 	//remove berryImages in the berry basket
 	while (berries.hasChildNodes()) {
@@ -180,12 +177,20 @@
 		basketHandle.removeChild(basketHandle.firstChild);
 	}
+	
+	var div = document.createElement('div');
+	berries.appendChild(div);
+	var list = document.createElement('ol');
+	div.appendChild(list);
+	
+	list.id = 'doclist';
 
 	//put the berries in
-	for (i in berryList){
+	for (i; i < berryList.length; i++){
 		var berryItem = berryList[i];
 		var berryElement = document.createElement('li');
+		list.appendChild(berryElement);
 		var title = berryItem.getAttribute('title');
 		var root_title = berryItem.getAttribute('root_title');
-		var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name');
+		//var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name');
 
 		if (root_title != ""){
@@ -197,9 +202,9 @@
 			title = title.substring(0,20)+" ... "+title.substr(title.length-35,35);
 		}
-
-		berryElement.appendChild(document.createTextNode(title));
+		
 		berryElement.setAttribute("class","berryitem");
-		list.appendChild(berryElement);
-		height +=18;
+		berryElement.setAttribute("title",title);
+		berryElement.innerHTML = title;
+		height +=40;
 	}
 
@@ -207,20 +212,32 @@
 	oldWidth = berryBasket.style.width;
 	oldBg = berryBasket.style.background;
-	berryBasket.style.height = height;
-	berryBasket.style.width = width;
+	//berryBasket.style.height = height;
+	//berryBasket.style.width = width;
 	berryBasket.style.background ='url("interfaces/default/images/kete2.png") 0 0 repeat';
 	berryBasket.style.cursor = "default";
 	berryBasket.className = "show";
-	div.appendChild(list);
-	berries.appendChild(div);
-	berries.style.height = height - 40;
+	//berries.style.height = height - 40;
 
 	//put the full view link in
 	var fullView = document.createElement('a');
 	berries.appendChild(fullView);
+	
+	//Find the collection in the cgi parameters
+	var url = window.location.href;
+	var colstart = url.indexOf("&c=");
+	var collectionName = "";
+	if (colstart != -1)
+	{
+		var colend = url.indexOf("&", (colstart + 1));
+		if (colend == -1)
+		{
+			colend = url.length - 1;
+		}
+		collectionName = url.substring(colstart + 3, colend);
+	}
+	
 	fullView.appendChild(document.createTextNode('Full View Â»'));
-	fullView.setAttribute("href","?a=g&sa=berry&c=&s=DisplayList&rt=r");
+	fullView.setAttribute("href","?a=g&sa=berry&c=&s=DisplayList&rt=r&p.c=" + collectionName);
 	fullView.setAttribute("id","berryFullViewLink");
-
 
 	//toggle expand/collapse links
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/js/berrycheckout.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/js/berrycheckout.js	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/js/berrycheckout.js	(revision 24007)
@@ -15,6 +15,6 @@
 
 function navigate(e){
-
-	var target = e.target;
+	
+	var target = this;
 
 	if ( target.id.toLowerCase() == '' ) {
@@ -46,4 +46,7 @@
 		var parea =YAHOO.util.Dom.get('pretextarea');
 		urlonly = false;
+		
+		this.value='URL only view';
+		
 		populateUrlsAndMetadata(parea);
 		return;
@@ -56,4 +59,7 @@
 		populateUrls(parea);
 		urlonly = true;
+		
+		this.value='URL and Metadata view';
+		
 		return;
 	}
@@ -91,4 +97,14 @@
 }
 
+function pageLoad(){
+	for(var j = 0; j < options.length; j++)
+	{
+		var ele = document.getElementById(options[j]);
+		YAHOO.util.Event.addListener(ele, 'click', navigate);
+	}
+	
+	showFullView();
+}
+
 function showFullView(){
 
@@ -101,5 +117,4 @@
 		return;
 	}
-
 
 	var trashbin = document.createElement('div');
@@ -277,7 +292,7 @@
 	input.setAttribute("value", "send");
 	content.appendChild(input);
-
-}
-
+	
+	YAHOO.util.Event.addListener(input, 'click', navigate);
+}
 
 function buildPreview(parent){
@@ -285,6 +300,18 @@
 	var div = document.createElement('div');
 	var cb = document.createElement('input');
-	cb.type = 'checkbox';
-
+	cb.setAttribute('class', 'sendbutton');
+	cb.type = 'button';
+	cb.id = 'urlcheck';
+	if (urlonly)
+	{
+		cb.value='URL and Metadata view';
+	}
+	else
+	{
+		cb.value='URL only view';
+	}
+
+	YAHOO.util.Event.addListener(cb, 'click', navigate);
+	
 	var img = document.createElement('img');
 	img.src = 'interfaces/default/images/check3.gif';
@@ -296,5 +323,5 @@
 	urls.id = 'urls';
 	urls.className = 'berrycheck';
-	urls.appendChild(document.createTextNode('URL only'));
+	//urls.appendChild(document.createTextNode('URL only'));
 	div.appendChild(urls);
 
@@ -312,7 +339,12 @@
 	parent.appendChild(parea);
 
-	populateUrlsAndMetadata(parea);
-
-
+	if(urlonly)
+	{
+		populateUrls(parea);
+	}
+	else
+	{
+		populateUrlsAndMetadata(parea);
+	}
 }
 
@@ -406,6 +438,5 @@
 }
 
-YAHOO.util.Event.addListener(window,'click', navigate);
-YAHOO.util.Event.addListener(window,'load', showFullView);
-
-
+YAHOO.util.Event.addListener(window,'load', pageLoad);
+
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/style/berry.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/style/berry.css	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/style/berry.css	(revision 24007)
@@ -11,4 +11,20 @@
 }
 
+#berrybasket_new {
+	min-height: 22px;
+	padding: 5px;
+	/* background: #E0F0E0 url("../images/berrybasket.png") scroll no-repeat 0 0; */
+	background: transparent url("../images/kete2.png") scroll repeat 0 0;
+	z-index:10;
+	/*cursor: pointer;*/
+	font-size: 80%;
+	min-height: 2em;
+	top:120px;
+	right:0;
+	position:fixed;
+	height:500px;
+	width:9.5%;
+}
+
 #baskethandle {
 	cursor: move;
@@ -39,5 +55,5 @@
 	display:block;
 	cursor: pointer;
-	text-align: right;
+	text-align: left;
 	padding: .5em;
 }
@@ -142,5 +158,5 @@
    font-weight: bold;
    cursor: pointer;
-   width: 5em;
+   /*width: 5em;*/
    font-size: 90%;
    margin: 1em 0 0 0;
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/style/core.css
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/style/core.css	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/style/core.css	(revision 24007)
@@ -11,4 +11,105 @@
 }
 
+h3 {
+	margin-top:2px;
+	margin-bottom:2px;
+}
+
+p {
+	margin-top:0px;
+	margin-bottom:0.75em;
+}
+
+.sectionHeader {
+	margin-top:0px;
+	margin-bottom:0px;
+}
+
+.headerTD {
+	vertical-align: middle;
+}
+
+/* Styles for the different depths */
+.sectionHeaderDepthTitle{
+	font-size:1.8em;
+	line-height:1em;
+	font-weight:bold;
+}
+
+.sectionHeaderDepth1{
+	font-size:1.6em;
+	line-height:1em;
+	font-weight:bold;
+}
+
+.sectionHeaderDepth2{
+	font-size:1.4em;
+	line-height:1em;
+	font-weight:bold;
+	font-style:italic;
+}
+
+.sectionHeaderDepth3{
+	font-size:1.2em;
+	line-height:1em;
+	font-style:italic;
+}
+
+.sectionHeaderDepth4{
+	font-size:1em;
+	line-height:1em;
+	font-weight:italic;
+}
+
+.sectionNumberSpan{
+	/*Uncomment this line to disable automatic section numbering*/
+	/*display:none;*/
+}
+
+.sectionContainer{
+	padding-top:1em;
+	padding-bottom:1em;
+	padding-left:1.5em;
+}
+
+.icon{
+	background-repeat: no-repeat;
+	height:16px;
+	width:16px;
+	cursor:pointer;
+}
+
+.toggleImageExpand {
+	background-image: url('../images/expand.png');
+	background-position: 2px 2px;
+}
+
+.toggleImageCollapse {
+	background-image: url('../images/collapse.png');
+	background-position: 2px 2px;
+}
+
+.toggleImagePage {
+	background-image: url('../images/page.png');
+	background-position: 2px 2px;
+}
+
+.toggleImageChapter {
+	background-image: url('../images/chapter.png');
+}
+
+.realisticBookIcon {
+	background-repeat: no-repeat;
+	background-image: url('../images/rbook.png');
+	height: 32px;
+	width: 32px;
+}
+
+.backToTop {
+	font-size:0.7em;
+	padding-left: 2em;
+	text-align:center;
+}
+
 #container {
 	position: relative;
@@ -16,27 +117,14 @@
 	max-width: 1000px;
 	padding: 0;
-	line-height: 160%;
-/*	background: url('../images/layout/containerLeft.png') scroll repeat-y left top;*/
+	line-height: 120%;
 	background-color: #fff;
 	border: 1px solid #c8c3b9;
 }
-#container2 {
-	/* background: url('../images/layout/containerRight.png') scroll repeat-y right top; */
-}
-/*
-#container3 {
-	background: url('../images/layout/containerTop.png') scroll repeat-x left top;
-}
-#container4 {
-	background: url('../images/layout/containerBottom.png') scroll repeat-x left bottom;
-	padding: 10px;
-}
-*/
 
 #gs_banner {
-	background: transparent url('../images/gsdlhead.gif') scroll no-repeat left top;
+	/*background: transparent url('../images/gsdlhead.gif') scroll no-repeat left top;*/
+	background-color: #008800;
 	padding: 10px 20px 30px 20px;
 	min-height: 80px;
-	max-height: 110px;
 	position: relative;
 }
@@ -44,11 +132,40 @@
 #gs_content {
 	padding: 1em;
+	padding-right: 2em;
 	min-height: 300px;
 	/* background-color: #ff0; */
 }
 
+.termList {
+	font-size:12px;
+	line-height:14px;
+}
+
+.noTermHighlight{
+
+}
+
+.termHighlight{
+	background:yellow;
+}
+
+.viewOptions {
+	width: 100%;
+	text-align:center;
+	background:#008800;
+}
+
+.viewOptions td {
+	padding-top:4px;
+	padding-bottom:4px;
+}
+
+.viewOptions a:link, .viewOptions a:hover, .viewOptions a:active, .viewOptions a:visited {
+	color:white;
+	text-decoration:none;
+}
+
 #rightSidebar {
 	border: 1px solid #cdc;
-	padding: 10px;
 	width: 25%;
 	min-width: 180px;
@@ -58,4 +175,8 @@
 }
 
+#contentsArea {
+	padding:10px;
+}
+
 #quickSearch {
 }
@@ -68,6 +189,4 @@
 .collectionLink {
 	display: block;
-	width: 140px;
-	height: 100px;
 	float: left;
 	border: 1px solid #888;
@@ -108,45 +227,76 @@
 body.dAction #gs_banner h2 {
 	max-width: 600px;
-	font-size: 100%;
+	font-size: 100;
+}
+
+#titlearea {
+	padding-left: 1em;
+	padding-right: 1em;
+	height:60px;
+	background-color: #007200;
+	width:40%;
+}
+
+#titlesearchcontainer {
+	width:100%;
+	margin: 5px 0 5px;
+}
+
+#quicksearcharea {
+	width:60%;
+	text-align:right;
+	padding: 0.4em;
+	color:white;
+	background-color:#007200;
+}
+
+#quicksearcharea table{
+	font-size:10px; 
+	margin:0; 
+	float: right;
+}
+
+#quicksearcharea a{
+	font-size: 11px;
+	color:white; 
+	text-transform:lowercase;
+	padding-left:10px; 
 }
 
 #breadcrumbs {
-	margin: 0 0 10px 0;
-	height: 30px;
-	line-height: 30px;
-}
-#gs_banner h2 {
-	margin: 0 0 10px 1em;
-}
-
+	/*margin: 0 0 10px 0;*/
+	height: 25px;
+	line-height: 15px;
+}
 
 /* css to make the tabs work */
 #nav {
-	position: absolute;
+	position:absolute;
 	width: auto;
 	bottom: 0;
-	right: 0;
+	left: 0;
 	list-style: none;
 	margin:0;
-	padding: 0 15px 0 0;
+	padding: 0 0 0 20px;
 	font-size: 14px;
 }
 
 #nav li {
-	float: right;
+	float: left;
 	color: #fff;
 	background: transparent url('../images/tab-right.png') scroll no-repeat 100% -100px;
 	margin: 0 5px 0 0;
 	padding: 0 8px 0 0;
-}
-
-#nav a {
+	text-transform: capitalize;
+}
+
+#nav a{
+
 	display: block;
-	float: left;
-
+	float:left;
 	background: transparent url('../images/tab-left.png') no-repeat scroll 0 -100px;
 	margin:0;
 	padding: 5px 4px 3px 10px;
-	font-weight: normal;
+	font-weight: bold;
 	color: #fff;
 	text-decoration: none;
@@ -164,5 +314,5 @@
 	list-style: none;
 	margin:0;
-	top: 15px;
+	top: 7px;
 	right: 0;
 	padding: 0 15px 0 0;
@@ -240,4 +390,5 @@
 /* style the search and classifier results */
 #results {
+	line-height: 160%;
 	margin: 0;
 	padding: 0;
@@ -654,5 +805,5 @@
 	margin: 0;
 	padding: 0;
-	font-size: 80%;
+	font-size: 70%;
 }
 
@@ -684,5 +835,13 @@
 
 #tableOfContents ul {
-	padding: 0 0 0 20px;
+	padding: 0 0 0 0;
+}
+
+#tableOfContents ul ul{
+	padding: 0 0 0 0;
+}
+
+#tableOfContents ul ul ul{
+	padding: 0 0 0 16px;
 }
 
@@ -698,5 +857,6 @@
 
 table{
-	border-collapse:collapse;border-spacing:0;
-}
-
+	border-collapse:collapse;
+	border-spacing:0;
+}
+
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/document-scripts.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/document-scripts.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/document-scripts.xsl	(revision 24007)
@@ -0,0 +1,219 @@
+<?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:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util gsf">
+
+	<xsl:template name="expansionScript">
+		<script type="text/javascript">
+			<xsl:text disable-output-escaping="yes">
+				function toggleSection(sectionID)
+				{
+					var docElem = document.getElementById("doc" + sectionID);
+					var tocElem = document.getElementById("toc" + sectionID);
+					
+					var tocToggleElem = document.getElementById("ttoggle" + sectionID);
+					var docToggleElem = document.getElementById("dtoggle" + sectionID);
+					
+					if(docElem.style.display == "none")
+					{
+						var imageClass = (docToggleElem.getAttribute("class").indexOf("leafNode") != -1) ? "icon toggleImageCollapse leafNode" : "icon toggleImageCollapse";
+						
+						docElem.style.display = "block";
+						docToggleElem.setAttribute("class", imageClass);
+						
+						if(tocToggleElem)
+						{
+							tocToggleElem.setAttribute("class", imageClass);
+						}
+						
+						if(tocElem)
+						{
+							tocElem.style.display = "block";
+						}
+					}
+					else
+					{
+						docElem.style.display = "none";
+						
+						//Use the page image if this is a leaf node and the chapter image if it not
+						//var imageClass = (docToggleElem.getAttribute("class").indexOf("leafNode") != -1) ? "icon toggleImagePage leafNode" : "icon toggleImageChapter";
+						var imageClass = (docToggleElem.getAttribute("class").indexOf("leafNode") != -1) ? "icon toggleImageExpand leafNode" : "icon toggleImageExpand";
+						docToggleElem.setAttribute("class", imageClass);
+						
+						if(tocToggleElem)
+						{
+							tocToggleElem.setAttribute("class", imageClass);
+						}
+						
+						if(tocElem)
+						{
+							tocElem.style.display = "none";
+						}
+					}
+				}
+				
+				function isExpanded(sectionID)
+				{
+					var docElem = document.getElementById("doc" + sectionID);
+					if(docElem.style.display == "block")
+					{
+						return true;
+					}
+					return false;
+				}
+				
+				function isParentOf(parent, child)
+				{
+					if(child.indexOf(parent) != -1 &amp;&amp; child.length > parent.length &amp;&amp; child[parent.length] == '.')
+					{
+						return true;
+					}
+					return false;
+				}
+				
+				function focusSection(sectionID)
+				{
+					var tableOfContentsDiv = document.getElementById("tableOfContents");
+					var images = tableOfContentsDiv.getElementsByTagName("img");
+					var nodeArray = new Array();
+					
+					for(var i = 0; i &lt; images.length; i++)
+					{	
+						nodeArray[i] = images[i].getAttribute("id").substring(7);
+					}
+					
+					for(var j = 0; j &lt; nodeArray.length; j++)
+					{
+						//If this is the node that was clicked and it is not expanded then expand it
+						if(nodeArray[j] == sectionID)
+						{
+							if(!isExpanded(nodeArray[j]))
+							{
+								toggleSection(nodeArray[j]);
+							}
+							
+							continue;
+						}
+						
+						//If the node is a parent or child of the node that is clicked and is not expanded then expand it
+						if((isParentOf(nodeArray[j], sectionID) || isParentOf(sectionID, nodeArray[j])) &amp;&amp; !isExpanded(nodeArray[j]))
+						{
+							toggleSection(nodeArray[j]);
+						}
+						//If the node is not a parent or child and is expanded then collapse it
+						else if(!(isParentOf(nodeArray[j], sectionID) || isParentOf(sectionID, nodeArray[j])) &amp;&amp; isExpanded(nodeArray[j]))
+						{
+							toggleSection(nodeArray[j]);
+						}
+					}
+				}
+			</xsl:text>
+		</script>
+	</xsl:template>
+	
+	<xsl:template name="highlightingScript">
+		<script type="text/javascript">
+			<xsl:text disable-output-escaping="yes">
+				function addHighlight()
+				{
+					var spans = document.getElementsByTagName("span");
+					for(var i = 0; i &lt; spans.length; i++)
+					{
+						var currentSpan = spans[i];
+						if(currentSpan.getAttribute("class") == "noTermHighlight")
+						{
+							currentSpan.setAttribute("class", "termHighlight");
+						}
+					}
+					
+					var option = document.getElementById("highlightOption");
+					option.innerHTML = "No Highlighting";
+					option.setAttribute("href", "javascript:removeHighlight();");
+				}
+				
+				function removeHighlight()
+				{
+					var spans = document.getElementsByTagName("span");
+					for(var i = 0; i &lt; spans.length; i++)
+					{
+						var currentSpan = spans[i];
+						if(currentSpan.getAttribute("class") == "termHighlight")
+						{
+							currentSpan.setAttribute("class", "noTermHighlight");
+						}
+					}
+					
+					var option = document.getElementById("highlightOption");
+					option.innerHTML = "Highlighting";
+					option.setAttribute("href", "javascript:addHighlight();");
+				}
+			</xsl:text>
+		</script>
+	</xsl:template>
+	
+	<xsl:template name="realisticBooksScript">
+		<div id="bookdiv"/>
+		<script type="text/javascript">
+			<xsl:text disable-output-escaping="yes">
+				
+				//Helper function to create param elements
+				function createParam(name, value)
+				{
+					var param = document.createElement("PARAM");
+					param.setAttribute("name", name);
+					param.setAttribute("value", value);
+					return param;
+				}
+				
+				//Work out the URL to the cover image and the document
+				var img_cover = '</xsl:text><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg<xsl:text disable-output-escaping="yes">';
+				var doc_url = document.URL; 
+				doc_url = doc_url.replace(/(&amp;|\?)book=[a-z]+/gi,'');
+				doc_url += '&amp;book=flashxml';	
+				
+				//The outer OBJECT element
+				var objectElem = document.createElement("OBJECT");
+				objectElem.setAttribute("align", "middle");
+				objectElem.setAttribute("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
+				objectElem.setAttribute("codebase", "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0");
+				objectElem.setAttribute("height", "600px");
+				objectElem.setAttribute("width", "100%");
+				
+				//Parameter list
+				var params = new Array();
+				params[0] = createParam("allowScriptAccess", "always");
+				params[1] = createParam("movie", "Book.swf?src_image=" + escape(img_cover) + "&amp;doc_url=" + escape(doc_url));
+				params[2] = createParam("quality", "high");
+				params[3] = createParam("bgcolor", "#FFFFFF");
+				
+				//The embed element that goes into the object element
+				var embedElem = document.createElement("EMBED");
+				embedElem.setAttribute("allowScriptAccess", "always");
+				embedElem.setAttribute("swLiveConnect", "true");
+				embedElem.setAttribute("bgcolor", "#FFFFFF");
+				embedElem.setAttribute("height", "600px");
+				embedElem.setAttribute("name", "Book");
+				embedElem.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
+				embedElem.setAttribute("quality", "high");
+				embedElem.setAttribute("src", "Book.swf?src_image=" + escape(img_cover) + "&amp;doc_url=" + escape(doc_url));
+				embedElem.setAttribute("type", "application/x-shockwave-flash");
+				embedElem.setAttribute("width", "100%");
+				
+				//Append the param and embed elements to the object element
+				for(var i = 0; i &lt; params.length; i++)
+				{
+					objectElem.appendChild(params[i]);
+				}
+				objectElem.appendChild(embedElem);
+				
+				//Append the object element to the page
+				var flashDiv = document.getElementById("bookdiv");
+				flashDiv.appendChild(objectElem);
+			</xsl:text>
+		</script>
+	</xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/formatString.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/formatString.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/formatString.xsl	(revision 24007)
@@ -256,7 +256,9 @@
         <h2> This should be the format string (unmodified and html version) </h2> -->
         <!-- <xsl:value-of select="/page/pageResponse" disable-output-escaping="yes"/> -->
+        <format xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat">
         <xsl:call-template name="xml">
             <xsl:with-param name="fmt" select="."/>
         </xsl:call-template><xsl:text> </xsl:text>
+        </format>
         <!-- <xsl:apply-templates select="/page/pageResponse" mode="xml"/> -->
       <!-- </body>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/formatmanager.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/formatmanager.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/formatmanager.xsl	(revision 24007)
@@ -0,0 +1,151 @@
+<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">
+
+	<xsl:template name="formatmanagerpre">
+	
+    <!-- <xsl:variable name="foo"> -->
+    <!-- <xsl:value-of select="/page/pageRequest/paramList[@name='formatedit']"/> -->
+
+    <xsl:if test="/page/pageRequest/paramList/param[(@name='formatedit') and (@value='1')]">
+
+	<!-- Sam2's div code -->
+
+		<script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
+		<script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
+	   
+		<xsl:call-template name="xml-to-gui-templates">
+			<xsl:with-param name="node-set" select="test"/>
+			<xsl:with-param name="metadataSets" select="//metadataSetList"/>
+		</xsl:call-template>
+
+		<xsl:variable name="fmt1">
+			<xsl:call-template name="xml-to-string">
+				<xsl:with-param name="node-set" select="//format[@type='browse']"/>
+			  </xsl:call-template>
+		</xsl:variable>
+
+		<xsl:variable name="meta">
+			<xsl:call-template name="xml-to-string">
+				<xsl:with-param name="node-set" select="//metadataSetList"/>
+			  </xsl:call-template>
+		</xsl:variable>
+
+		<style type="text/css">
+			.placeholder{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; height:20px; }
+
+			.placeholder_td{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; width:20px; }
+
+			.header { background-color: #AFCCAF; border: solid 1px #117711; padding: 5px; padding-left: 10px;}
+
+			.resizable { width: 150px; height: 150px; padding: 0.5em; } 
+			
+			.block { margin-left: 15px; border-left: dashed 1px black;}
+
+			.droppable { background-color: #99dd99;}
+			.droppable_hl { border: dashed 1px #ccc; background-color:#FFFFCC; }
+
+			<!-- .gsf_metadata { border: solid 2px #0000BB; background-color: #440077; } -->
+
+			<!-- .gsf_choose_metadata { border: solid 1px #000000; background-color: #223344; } -->
+		</style>
+
+		<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/> 
+
+		<table width="100%" border="1"> 
+
+		<td width="75%">
+
+		<button id="updateFormatStatement" type="button" onclick="updateFormatStatement()">Update Format Statement</button>
+		<button id="saveFormatStatement" type="button" onclick="saveFormatStatement()">Save Format Statement</button>
+
+		<div id="formatStatement">
+			<div id="formatRoot">
+		
+		<xsl:call-template name="xml-to-gui">
+			<xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/>  -->
+			<xsl:with-param name="metadataSets" select="//metadataSetList"/> 
+		</xsl:call-template> 
+			</div>
+		</div>
+		</td>    
+
+
+		<td width="25%" valign="top">
+			<h2> Elements to add </h2>
+			<!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
+			<div class="draggable_gsf_template css_gsf_template block" title="gsf:template"><table class="header"><tbody><tr><td class="header">MATCH=<input type="text" name="rawtextinput" size="10"/></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table><table border="1"><tr class="tr"><td class="droppable" width="10px"></td></tr></table></div><br/>
+
+			<div class="draggable_gsf_choose_metadata css_gsf_choose_metadata block" title="gsf:choose-metadata"><table class="header"><tbody><tr><td class="header">CHOOSE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
+
+			<div class="draggable_gsf_metadata css_gsf_metadata block" title="gsf:metadata"><table class="header"><tbody><tr><td class="header"><xsl:call-template name="meta-to-combo">
+							<xsl:with-param name="metadataSets" select="//metadataSetList"/>
+							<xsl:with-param name="current" select="ex.Title"/>
+						 </xsl:call-template></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
+
+			<div class="draggable_gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
+								<option value = "document" selected = "document">Document</option>
+								<option value = "classifier">Classifier</option>
+								<option value = "source">Source</option>
+								<option value = "horizontal">Horizontal</option>
+					</select></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
+
+			<div class="draggable_gsf_switch css_gsf_switch block" title="gsf:switch"><table class="header"><tbody><tr><td class="header">SWITCH</td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
+
+			<div class="draggable_gsf_when css_gsf_when block" title="gsf:when"><table class="header"><tbody><tr><td class="header">WHEN<xsl:value-of select="@test"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
+
+			<div class="draggable_gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise"><table class="header"><tbody><tr><td class="header">OTHERWISE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
+
+			<div class="draggable_gsf_icon css_gsf_icon block" title="gsf:icon"><table class="header"><tbody><tr><td class="header">ICON<select><option value = "document" selected = "document">Document</option><option value = "classifier">Classifier</option><option value = "source">Source</option></select></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
+			<br/>
+			<div class="draggable_gsf_text css_text" title="text"><table class="header"><tbody><tr><td class="header"><input type="text" name="rawtextinput" size="10" value=""/></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
+			<div class="draggable_table css_table" title="gsf:table">NEW TABLE</div>
+			<div class="draggable_tr css_tr" title="gsf:row">NEW TABLE ROW</div>
+			<div class="draggable_td css_td" title="gsf:column">NEW TABLE COLUMN</div>
+
+		</td>
+		</table>
+
+		<!--
+		<div id="format">
+			<p>
+			  <b>Format string here</b>
+			  <i>
+				  <xsl:value-of select="$fmt1"/>
+			  </i>
+			</p>
+		</div> -->
+		<!--    <p>
+			  <i>
+				  <xsl:value-of select="$meta"/>
+			  </i>
+			</p>
+		  </div> -->
+      </xsl:if>
+
+<!--<H2>Preview</H2>
+
+                    <div id="my_categories"><xsl:text> </xsl:text></div>
+
+                    <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe> 
+
+                    <xsl:variable name="preview"> -->
+                    <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
+	</xsl:template>
+	
+	<xsl:template name="formatmanagerpost">
+		   <!--                 </xsl:variable>
+
+                    <script type="text/javascript">
+                        preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
+                    </script>
+
+                    <div id="result">
+                    Here
+                    </div>-->
+	</xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/header.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/header.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/header.xsl	(revision 24007)
@@ -0,0 +1,228 @@
+<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">
+		
+	<xsl:include href="../query-common.xsl"/>
+	
+	<!-- If the c parameter is empty then use the p.c parameter for the collection name-->
+	<xsl:variable name="collNameChecked">
+		<xsl:choose>
+		<xsl:when test="$collName = '' and /page/pageRequest/paramList/param[@name='p.c']/@value">
+			<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:value-of select="$collName"/>
+		</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	
+	<!-- Creates a header for -->
+	<xsl:template name="create-html-header">
+		<title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
+		<link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
+		<link rel="shortcut icon" href="favicon.ico"/> 
+	</xsl:template>
+		
+	<!-- ***** HEADER LAYOUT TEMPLATE ***** -->
+	<xsl:template name="create-banner">
+		<div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div>
+		<table id="titlesearchcontainer">
+			<tr>
+				<xsl:call-template name="page-title-area"/>
+				<xsl:call-template name="quick-search-area"/>
+			</tr>
+		</table>
+		<xsl:call-template name="home-help-preferences"/>
+		<xsl:call-template name="browsing-tabs"/>
+	</xsl:template>
+	
+	<!-- ***** BROWSING TABS ***** -->
+	<xsl:template name="browsing-tabs">
+		<xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service">
+			<ul id="nav">
+				<!-- If this collection has a ClassifierBrowse service then add a tab for each classifier-->
+				<xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='browse' and @name='ClassifierBrowse']">
+					<!-- Loop through each classifier -->
+					<xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
+						<xsl:element name="li">
+							<!-- If this tab is selected then colour it differently (right part) -->
+							<xsl:if test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
+								<xsl:attribute name='style'>background: transparent url('interfaces/oran/images/tab-right-selected.png') scroll no-repeat 100% -100px;</xsl:attribute>
+							</xsl:if>
+							
+							<xsl:element name="a">
+								<!-- If this tab is selected then colour it differently (left part) -->
+								<xsl:if test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
+									<xsl:attribute name='style'>background: transparent url('interfaces/oran/images/tab-left-selected.png') no-repeat scroll 0 -100px;</xsl:attribute>
+								</xsl:if>
+								
+								<!-- Add a title element to the <a> tag if a description exists for this classifier -->
+								<xsl:if test="displayItem[@name='description']">
+									<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
+								</xsl:if>
+								
+								<!-- Add the href element to the <a> tag -->
+								<xsl:choose>
+									<xsl:when test="@name">
+										<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=b&amp;rt=s&amp;s=ClassifierBrowse&amp;c=<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>&amp;cl=<xsl:value-of select="@name"/></xsl:attribute>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=b&amp;rt=d&amp;s=ClassifierBrowse&amp;c=<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/></xsl:attribute>
+									</xsl:otherwise>
+								</xsl:choose>
+								
+								<!-- Add the actual text of the <a> tag -->
+								<xsl:value-of select="displayItem[@name='name']"/>
+							</xsl:element>
+						</xsl:element>
+					</xsl:for-each>
+				</xsl:if>
+
+				<!-- all other services -->
+				<xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[not(@type='query') and not(@type='browse')]">
+					<xsl:call-template name="navigationTab"/>
+				</xsl:for-each>
+			</ul>
+		</xsl:if>
+	</xsl:template>
+	
+	<!-- ***** HOME HELP PREFERENCES ***** -->
+	<xsl:template name="home-help-preferences">
+		<xsl:if test="/page/pageResponse/collection">
+			<ul id="bannerLinks">
+
+				<!-- preferences -->
+				<li>
+					<a href="{$library_name}?a=p&amp;amp;sa=pref&amp;amp;c={$collNameChecked}">
+						<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+					</a>
+				</li>
+
+				<!-- help -->
+				<li>
+					<a href="{$library_name}?a=p&amp;amp;sa=help&amp;amp;c={$collNameChecked}">
+						<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+					</a>
+				</li>
+
+				<!-- home -->
+				<li>
+					<a href="{$library_name}?a=p&amp;amp;sa=home">
+						<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
+					</a>
+				</li>
+			</ul>
+		</xsl:if>
+	</xsl:template>
+	
+	<!-- ***** PAGE TITLE ***** -->
+	<xsl:template name="page-title-area">
+		<xsl:variable name="pageTitleVar"><xsl:call-template name="pageTitle"/></xsl:variable>
+		<td id="titlearea">
+			<h2>
+				<!-- Resize the title based on how long it is -->
+				<xsl:attribute name="style">
+					<xsl:choose>
+						<xsl:when test="string-length($pageTitleVar) &lt; 20">
+							font-size: 24px; line-height: 26px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 30">
+							font-size: 22px; line-height: 24px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 40">
+							font-size: 20px; line-height: 22px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 50">
+							font-size: 18px; line-height: 20px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 60">
+							font-size: 16px; line-height: 18px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 70">
+							font-size: 15px; line-height: 17px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 80">
+							font-size: 14px; line-height: 16px;
+						</xsl:when>
+						<xsl:when test="string-length($pageTitleVar) &lt; 90">
+							font-size: 13px; line-height: 15px;
+						</xsl:when>
+						<xsl:otherwise>
+							font-size: 12px; line-height: 14px;
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:attribute>
+				<!--<xsl:value-of select="string-length($pageTitleVar)" />-->
+				<xsl:value-of select="$pageTitleVar" />
+			</h2>
+		</td>
+	</xsl:template>
+	
+	
+	<!-- ***** QUICK SEARCH AREA ***** -->
+	<xsl:template name="quick-search-area">
+		<xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
+			<xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
+			<td id="quicksearcharea">
+				<form>
+					<input type="hidden" name="a" value="q"/>
+					<input type="hidden" name="sa" value="{$subaction}"/>
+					<input type="hidden" name="rt" value="rd"/>
+					<input type="hidden" name="s" value="TextQuery"/>
+					<input type="hidden" name="c" value="{$collNameChecked}"/>
+					<input type="hidden" name="startPage" value="1"/>
+					<!-- The query text box -->
+					<span class="querybox">
+						<xsl:variable name="qs">
+							<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
+						</xsl:variable>
+						<nobr>
+							<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
+								<xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs)"/>
+							</xsl:apply-templates>
+						</nobr>
+					</span>
+					<!-- The index selection list -->
+					<xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
+						<span class="textselect">
+							<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
+								<xsl:with-param name="default">
+									<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
+								</xsl:with-param>
+							</xsl:apply-templates>
+						</span>
+					</xsl:if>
+					<!-- The submit button -->
+					<input type="submit">
+						<xsl:attribute name="value">
+							<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
+						</xsl:attribute>
+					</input>
+					<br/>
+					<!-- The list of other search types -->
+					<table>
+						<tr>
+							<xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
+								<td>
+									<a>
+										<xsl:attribute name="href">
+											?a=q&amp;rt=d&amp;c=<xsl:value-of select="$collNameChecked"/>&amp;s=<xsl:value-of select="@name"/>
+										</xsl:attribute>
+										<xsl:value-of select="displayItem[@name='name']"/>
+									</a>
+								</td>
+							</xsl:for-each>
+						</tr>
+					</table>
+				</form>
+			</td>
+		</xsl:if>
+	</xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/main.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/main.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/main.xsl	(revision 24007)
@@ -15,4 +15,7 @@
 	exclude-result-prefixes="util java util">
 
+	<xsl:include href="header.xsl"/>
+	<!--<xsl:include href="formatmanager.xsl"/>-->
+	
 	<xsl:include href="xml-to-gui.xsl"/>
 	<xsl:include href="xml-to-gui-templates.xsl"/>
@@ -33,224 +36,24 @@
 
 			<head>
-				<title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
-				<link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
-				<!-- <script type="text/javascript" src="interfaces/oran/js/jquery.js"><xsl:text> </xsl:text></script> --> 
-                <script type="text/javascript" src="interfaces/oran/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>
-                <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8.2.custom.min.js"><xsl:text> </xsl:text></script> -->
-                <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/ui/jquery-ui.js"><xsl:text> </xsl:text></script>
-                <script type="text/javascript" src="interfaces/oran/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script>
-                <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"><xsl:text> </xsl:text></script> -->
-                <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"><xsl:text> </xsl:text></script> -->
-                <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/jquery-1.4.1.js"><xsl:text> </xsl:text></script> -->
-
+				<!-- ***** in header.xsl ***** -->
+				<xsl:call-template name="create-html-header"/>
 				<xsl:call-template name="berryBasketHeadTags"/>
 			</head>
 			
 			<body><xsl:call-template name="textDirectionAttribute"/><xsl:call-template name="actionClass"/>
-
+				
 				<xsl:call-template name="displayErrorsIfAny"/>
-
-				<div id="container"><div id="container2"><div id="container3"><div id="container4">
+				<a name="top"><xsl:text> </xsl:text></a>
+				<div id="container">
 
 					<div id="gs_banner">
 
-						<!-- show the title -->
-						<div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div>
-						<h2><xsl:call-template name="pageTitle"/></h2>
-
-						<xsl:if test="/page/pageResponse/collection">
-							<!-- show home, help, preferences links -->
-							<ul id="bannerLinks">
-
-								<!-- preferences -->
-								<li>
-									<a href="{$library_name}?a=p&amp;amp;sa=pref&amp;amp;c={$collName}">
-										<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
-										<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
-									</a>
-								</li>
-
-								<!-- help -->
-								<li>
-									<a href="{$library_name}?a=p&amp;amp;sa=help&amp;amp;c={$collName}">
-										<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
-										<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
-									</a>
-								</li>
-
-								<li>
-									<a href="{$library_name}?a=p&amp;amp;sa=home">
-										<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
-										<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
-									</a>
-								</li>
-
-							</ul>
-						</xsl:if>
-
-						<!-- show the available 'services' (browse, search, etc.) -->
-						<xsl:if test="/page/pageResponse/collection/serviceList/service">
-							<ul id="nav">
-								<!-- show browse service, if it exists -->
-								<xsl:if test="/page/pageResponse/collection/serviceList/service[@type='browse']">
-									<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='browse']">
-										<xsl:call-template name="navigationTab"/>
-									</xsl:for-each>
-								</xsl:if>
-
-								<!-- show search services (collapsed) if they exist -->
-								<xsl:if test="/page/pageResponse/collection/serviceList/service[@type='query']">
-									<xsl:for-each select="/page/pageResponse/collection/serviceList">
-
-										<!--
-											using collapsedNavigationTab instead of navigationTab collapses
-											all the services of the given type onto one tab
-										-->
-										<xsl:call-template name="collapsedNavigationTab">
-											<xsl:with-param name="type">query</xsl:with-param>
-										</xsl:call-template>
-									</xsl:for-each>
-								</xsl:if>
-
-								<!-- all other services -->
-								<xsl:for-each select="/page/pageResponse/collection/serviceList/service[not(@type='query') and not(@type='browse')]">
-									<xsl:call-template name="navigationTab"/>
-								</xsl:for-each>
-
-							</ul>
-						</xsl:if>
+						<!-- ***** in header.xsl ***** -->
+						<xsl:call-template name="create-banner"/>
 
 					</div>
+					
+					<!--<xsl:call-template name="formatmanagerpre"/>-->
 
-<!-- *************************************************************************************** -->
-
-    <!-- <xsl:variable name="foo"> -->
-    <!-- <xsl:value-of select="/page/pageRequest/paramList[@name='formatedit']"/> -->
-
-    <xsl:if test="/page/pageRequest/paramList/param[(@name='formatedit') and (@value='1')]">
-
-<!-- Sam2's div code -->
-
-    <script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
-    <script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
-   
-    <xsl:call-template name="xml-to-gui-templates">
-        <xsl:with-param name="node-set" select="test"/>
-        <xsl:with-param name="metadataSets" select="//metadataSetList"/>
-    </xsl:call-template>
-
-    <xsl:variable name="fmt1">
-        <xsl:call-template name="xml-to-string">
-            <xsl:with-param name="node-set" select="//format[@type='browse']"/>
-          </xsl:call-template>
-    </xsl:variable>
-
-    <xsl:variable name="meta">
-        <xsl:call-template name="xml-to-string">
-            <xsl:with-param name="node-set" select="//metadataSetList"/>
-          </xsl:call-template>
-    </xsl:variable>
-
-    <style type="text/css">
-        .placeholder{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; height:20px; }
-
-        .placeholder_td{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; width:20px; }
-
-        .header { background-color: #AFCCAF; border: solid 1px #117711; padding: 5px; padding-left: 10px;}
-
-        .resizable { width: 150px; height: 150px; padding: 0.5em; } 
-        
-        .block { margin-left: 15px; border-left: dashed 1px black;}
-
-        .droppable { background-color: #99dd99;}
-        .droppable_hl { border: dashed 1px #ccc; background-color:#FFFFCC; }
-
-        <!-- .gsf_metadata { border: solid 2px #0000BB; background-color: #440077; } -->
-
-        <!-- .gsf_choose_metadata { border: solid 1px #000000; background-color: #223344; } -->
-    </style>
-
-    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/> 
-
-    <table width="100%" border="1"> 
-
-    <td width="75%">
-
-    <button id="updateFormatStatement" type="button" onclick="updateFormatStatement()">Update Format Statement</button>
-    <button id="saveFormatStatement" type="button" onclick="saveFormatStatement()">Save Format Statement</button>
-
-    <div id="formatStatement">
-        <div id="formatRoot">
-    
-    <xsl:call-template name="xml-to-gui">
-        <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/>  -->
-        <xsl:with-param name="metadataSets" select="//metadataSetList"/> 
-    </xsl:call-template> 
-        </div>
-    </div>
-    </td>    
-
-
-    <td width="25%" valign="top">
-        <h2> Elements to add </h2>
-        <!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
-        <div class="draggable_gsf_template css_gsf_template block" title="gsf:template"><table class="header"><tbody><tr><td class="header">MATCH=<input type="text" name="rawtextinput" size="10"/></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table><table border="1"><tr class="tr"><td class="droppable" width="10px"></td></tr></table></div><br/>
-
-        <div class="draggable_gsf_choose_metadata css_gsf_choose_metadata block" title="gsf:choose-metadata"><table class="header"><tbody><tr><td class="header">CHOOSE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
-
-        <div class="draggable_gsf_metadata css_gsf_metadata block" title="gsf:metadata"><table class="header"><tbody><tr><td class="header"><xsl:call-template name="meta-to-combo">
-                        <xsl:with-param name="metadataSets" select="//metadataSetList"/>
-                        <xsl:with-param name="current" select="ex.Title"/>
-                     </xsl:call-template></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
-
-        <div class="draggable_gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
-                            <option value = "document" selected = "document">Document</option>
-                            <option value = "classifier">Classifier</option>
-                            <option value = "source">Source</option>
-                            <option value = "horizontal">Horizontal</option>
-                </select></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
-
-        <div class="draggable_gsf_switch css_gsf_switch block" title="gsf:switch"><table class="header"><tbody><tr><td class="header">SWITCH</td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
-
-        <div class="draggable_gsf_when css_gsf_when block" title="gsf:when"><table class="header"><tbody><tr><td class="header">WHEN<xsl:value-of select="@test"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
-
-        <div class="draggable_gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise"><table class="header"><tbody><tr><td class="header">OTHERWISE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
-
-        <div class="draggable_gsf_icon css_gsf_icon block" title="gsf:icon"><table class="header"><tbody><tr><td class="header">ICON<select><option value = "document" selected = "document">Document</option><option value = "classifier">Classifier</option><option value = "source">Source</option></select></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
-        <br/>
-        <div class="draggable_gsf_text css_text" title="text"><table class="header"><tbody><tr><td class="header"><input type="text" name="rawtextinput" size="10" value=""/></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
-        <div class="draggable_table css_table" title="gsf:table">NEW TABLE</div>
-        <div class="draggable_tr css_tr" title="gsf:row">NEW TABLE ROW</div>
-        <div class="draggable_td css_td" title="gsf:column">NEW TABLE COLUMN</div>
-
-    </td>
-    </table>
-
-    <!--
-    <div id="format">
-        <p>
-          <b>Format string here</b>
-          <i>
-              <xsl:value-of select="$fmt1"/>
-          </i>
-        </p>
-    </div> -->
-    <!--    <p>
-          <i>
-              <xsl:value-of select="$meta"/>
-          </i>
-        </p>
-      </div> -->
-      </xsl:if>
-
-<!-- *************************************************************************************** -->
-<!--<H2>Preview</H2>
-
-                    <div id="my_categories"><xsl:text> </xsl:text></div>
-
-                    <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe> 
-
-                    <xsl:variable name="preview"> -->
-                    <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
 					<div id="gs_content">
 						<!--
@@ -261,13 +64,6 @@
 
 					</div>
-   <!--                 </xsl:variable>
-
-                    <script type="text/javascript">
-                        preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
-                    </script>
-
-                    <div id="result">
-                    Here
-                    </div>-->
+					
+					<!--<xsl:call-template name="formatmanagerpost"/>-->
 
 					<div id="gs_footer">
@@ -280,10 +76,9 @@
 					<div class="corner" id="cornerBottomRight"><xsl:text> </xsl:text></div>
 
-				</div></div></div></div>
+				</div>
 
 			</body>
 		</html>
 	</xsl:template>
-
 </xsl:stylesheet>
 
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/berry.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/berry.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/berry.xsl	(revision 24007)
@@ -10,10 +10,10 @@
 	<!-- use the 'main' layout -->
 	<xsl:include href="layouts/main.xsl"/>
-
+	
 	<!-- set page title -->
 	<xsl:template name="pageTitle"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket')"/></xsl:template>
 
 	<!-- set page breadcrumbs -->
-	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>
+	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/> <gslib:collectionNameLinked/><gslib:rightArrow/></xsl:template>
 
 	<!-- the page content -->
@@ -24,16 +24,16 @@
 			var doc;
 			var docList = new Array();
-			<xsl:for-each select="/page/pageResponse/collection/item">
-				<xsl:text disable-output-escaping="yes">
-			doc = new Array();</xsl:text>
+			<xsl:for-each select="/page/pageResponse/berryList/item">
+				<xsl:text disable-output-escaping="yes">doc = new Array();</xsl:text>
 				<xsl:for-each select="@*">
-					<xsl:text disable-output-escaping="yes">
-			doc["</xsl:text><xsl:value-of select="name()" /><xsl:text disable-output-escaping="yes">"]='</xsl:text><xsl:value-of select="." /><xsl:text disable-output-escaping="yes">';</xsl:text>
+					<xsl:text disable-output-escaping="yes">doc["</xsl:text>
+					<xsl:value-of select="name()" />
+					<xsl:text disable-output-escaping="yes">"]='</xsl:text>
+					<xsl:value-of select="." />
+					<xsl:text disable-output-escaping="yes">';</xsl:text>
 				</xsl:for-each>
-				<xsl:text disable-output-escaping="yes">
-			docList[</xsl:text>
+				<xsl:text disable-output-escaping="yes">docList[</xsl:text>
 				<xsl:value-of select="position()-1"/>
-				<xsl:text>] = doc;
-</xsl:text>
+				<xsl:text>] = doc;</xsl:text>
 			</xsl:for-each>
 		</script>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl	(revision 24007)
@@ -21,5 +21,5 @@
 
 		<!-- show the classifiers if more than one (title, subject, etc.) -->
-		<xsl:if test="service/classifierList/classifier[2]">
+		<!--<xsl:if test="service/classifierList/classifier[2]">
 			<div id="classifierList" class="navList">
 				<ul>
@@ -30,12 +30,14 @@
 				<div class="clear"><xsl:text> </xsl:text></div>
 			</div>
-		</xsl:if>
+		</xsl:if>-->
 
 		<!-- this right sidebar -->
-		<div id="rightSidebar">
-			<!-- show the berry basket if it's turned on -->
-			<gslib:berryBasket/>
-			<xsl:text> </xsl:text>
-		</div>
+		<xsl:if test="$berryBasketOn">
+			<div id="rightSidebar">
+				<!-- show the berry basket if it's turned on -->
+				<gslib:berryBasket/>
+				<xsl:text> </xsl:text>
+			</div>
+		</xsl:if>
 	
 		<!--
@@ -61,5 +63,5 @@
 
 			<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"/></xsl:attribute>
+				<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>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/document.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/document.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/document.xsl	(revision 24007)
@@ -9,9 +9,19 @@
 	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"/>
-
-	<!-- use the 'main' layout -->
-	<xsl:include href="layouts/main.xsl"/>
+	<xsl:include href="document-scripts.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 -->
@@ -19,32 +29,71 @@
 
 	<!-- set page breadcrumbs -->
-	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>
+	<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>
+			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">
-
-		<!-- show the little berries for this document -->
-		<xsl:call-template name="documentBerryForDocumentPage"/>
-
-		<!-- the sidebar -->
-		<div id="rightSidebar">
-
-			<!-- show the berry basket if it's turned on -->
-			<gslib:berryBasket/>
-
-			<!-- the book's cover image -->
-			<div id="coverImage"><gslib:coverImage/></div>
-			<br/>
-
-			<!-- the contents -->
-			<ul id="tableOfContents">
-				<xsl:apply-templates select="documentNode/documentNode"/>
-			</ul>
-
-		</div>
-
+		<xsl:if test="$bookswitch = 'off'">
+			<!-- Add the Javascript that adds and removes highlighting ( *** in document-scripts.xsl *** ) -->
+			<xsl:call-template name="highlightingScript"/>
+			
+			<!-- Add the Javascript that expands and collapses sections ( *** in document-scripts.xsl *** ) -->
+			<xsl:call-template name="expansionScript"/>
+		
+			<!-- 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 -->
+						<div id="coverImage"><gslib:coverImage/></div>
+
+						<!-- the contents -->
+						<div id="tableOfContents">
+							<xsl:apply-templates select="documentNode" mode="TOC"/>
+						</div>
+					</div>
+				</td></tr>
+			</table>
+		</xsl:if>
+		
 		<!-- display the document -->
-                <xsl:choose>
-
+		<xsl:choose>
 			<xsl:when test="@external != ''">
 				<xsl:call-template name="externalPage">
@@ -52,95 +101,238 @@
 				</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 *** -->
+				<xsl:call-template name="realisticBooksScript"/>
+			</xsl:when>
 			<xsl:otherwise>
-				<!-- document heading -->
-				<xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
-				<xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
-				<xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
-				<xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
-				<xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
-				<xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
-
-				<!--
-				<div id="documentheading">
-
-					<!- -<a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param></xsl:call-template></a>- ->
-
+				<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><tr>
+			<!-- Expand/collapse button -->
+			<td class="headerTD">
+				<div id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');">			
+					<xsl:attribute name="class">
 					<xsl:choose>
-						<xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when>
-						<xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise>
+						<xsl:when test="nodeContent and not(documentNode)">icon leafNode toggleImageCollapse</xsl:when>
+						<xsl:otherwise>icon toggleImageCollapse</xsl:otherwise>
 					</xsl:choose>
-
+					</xsl:attribute>
 				</div>
-				-->
-
-				<div id="gs-document-text" class="documenttext"> 
-					<xsl:for-each select="descendant-or-self::node()/nodeContent">
-						<h3><xsl:value-of disable-output-escaping="yes" select="../metadataList/metadata[@name='Title']"/></h3>
-						<xsl:for-each select="node()">
+			</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>
+					<xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/> 
+				</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;back to top</xsl:text>
+					</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))">
+								<div id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon toggleImageCollapse"/>
+							</xsl:when>
+							<xsl:otherwise>
+								<div class="icon"/>
+							</xsl:otherwise>
+						</xsl:choose>
+					</td>
+				</xsl:if>
+				
+				<!-- The chapter/page icon -->
+				<td>
+					<div>
+						<xsl:attribute name="class">
 							<xsl:choose>
-								<xsl:when test="not(name())">
-									<xsl:value-of select="." disable-output-escaping="yes"/>
+								<xsl:when test="nodeContent and not(documentNode)">
+									icon leafNode toggleImagePage
 								</xsl:when>
 								<xsl:otherwise>
-									<xsl:apply-templates select="."/>
+									icon toggleImageChapter
 								</xsl:otherwise>
 							</xsl:choose>
-						</xsl:for-each>
-					</xsl:for-each>
-				</div>
-
-				<gslib:previousNextButtons/>
-
-			</xsl:otherwise>
-		</xsl:choose>
-
-		<div class="clear"><xsl:text> </xsl:text></div>
-
-	</xsl:template>
-
-	<xsl:template match="documentNode">
-
-		<!-- 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<!--&amp;<xsl:if test="string($ec) = '1'">ec=1&amp;</xsl:if>
-			p.a=<xsl:value-of select="$p.a"/>&amp;
-			p.sa=<xsl:value-of select="$p.sa"/>&amp;
-			p.s=<xsl:value-of select="$p.s"/>&amp;
-			p.c=<xsl:value-of select="$p.c"/>-->
+						</xsl:attribute>
+					</div>
+				</td>
+				
+				<!-- The section name, links to the section in the document -->
+				<td>				
+					<!-- display this item from the table of contents -->
+					<xsl:if test="$isCurrent"><xsl:attribute name="class">current</xsl:attribute></xsl:if>
+					<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>
-
-		<li>
-			<!-- display this item from the table of contents -->
-			<xsl:if test="$isCurrent"><xsl:attribute name="class">current</xsl:attribute></xsl:if>
-			<a>
-				<xsl:attribute name="href"><xsl:value-of select="translate( $contentsLink , ' ', '' )"/></xsl:attribute>
-				<xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
-			</a>
-
-			<!-- display any child items -->			
-			<xsl:if test="documentNode">
-				<ul>
-					<xsl:apply-templates select="documentNode"/>
-				</ul>
-			</xsl:if>
-
-		</li>
-
-	</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>
-
+		<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>
+			<!-- Highlight on/off button -->
+			<xsl:if test="/page/pageRequest/paramList/param[@name = 'p.a']/@value = 'q'">
+				<td>
+					<a id="highlightOption">
+						<xsl:choose>
+							<xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
+								<xsl:attribute name="href">
+									<xsl:text>javascript:removeHighlight();</xsl:text>
+								</xsl:attribute>
+								<xsl:text>No Highlighting</xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:attribute name="href">
+									<xsl:text>javascript:addHighlight();</xsl:text>
+								</xsl:attribute>
+								<xsl:text>Highlighting</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</a>
+				</td>
+			</xsl:if>
+			
+			<!-- Realistic books link -->
+			<xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
+				<td>
+					<a title="Realistic book view" href="{$library_name}?a=d&amp;c={$collName}&amp;d={/page/pageResponse/document/documentNode[1]/@nodeID}&amp;dt={/page/pageResponse/document/documentNode/@docType}&amp;p.a=b&amp;p.s={/page/pageResponse/service/@name}&amp;book=on&amp;ed=1">
+						<img src="interfaces/oran/images/rbook.png"/>
+					</a>
+				</td>
+			</xsl:if>
+		</tr></table>	
+	</xsl:template>
 </xsl:stylesheet>
 
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/help.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/help.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/help.xsl	(revision 24007)
@@ -15,9 +15,100 @@
 
 	<!-- set page breadcrumbs -->
-	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>
+	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/> <gslib:collectionNameLinked/><gslib:rightArrow/></xsl:template>
 
 	<!-- the page content -->
 	<xsl:template match="page">
-		Help text goes here
+		<xsl:call-template name="helpTopics"/>
+		<xsl:call-template name="findingInformationHelp"/>
+		<xsl:call-template name="readingDocsHelp"/>
+		<xsl:call-template name="searchingHelp"/>
+		<xsl:call-template name="preferencesHelp"/>
+	</xsl:template>
+	
+	<xsl:template name="helpTopics">
+		
+	</xsl:template>
+
+	<xsl:template name="findingInformationHelp">
+		<xsl:variable name="searchEnabled">
+			<xsl:choose>
+				<xsl:when test="/page/pageResponse/collection[@name=$collName]/serviceList/service[@type='query']">1</xsl:when>
+				<xsl:otherwise>0</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		
+		<xsl:variable name="numClassifiers">
+			<xsl:value-of select="count(/page/pageResponse/collection[@name=$collName]/serviceList/service[@name = 'ClassifierBrowse']/classifierList/classifier)"/>
+		</xsl:variable>
+
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.findinginformationtitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.findinginformation', $searchEnabled + $numClassifiers)"/>
+		
+		<!-- using actual <ul> and <li> tags here would cause the XML parser to break -->
+		<xsl:text disable-output-escaping="yes">&lt;ul&gt;</xsl:text>
+		<xsl:if test="$searchEnabled = 1">
+			<xsl:text disable-output-escaping="yes">&lt;li&gt;</xsl:text>
+			<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.searchdesc')"/>
+			<xsl:text disable-output-escaping="yes">&lt;/li&gt;</xsl:text>
+		</xsl:if>
+		
+		<xsl:for-each select="/page/pageResponse/collection[@name=$collName]/serviceList/service[@name = 'ClassifierBrowse']/classifierList/classifier">
+			<xsl:text disable-output-escaping="yes">&lt;li&gt;</xsl:text>
+			<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.browsedesc', ./displayItem[@name = 'name'])"/>
+			<xsl:text disable-output-escaping="yes">&lt;/li&gt;</xsl:text>
+		</xsl:for-each>
+		<xsl:text disable-output-escaping="yes">&lt;/ul&gt;</xsl:text>
+	</xsl:template>
+	
+	<xsl:template name="readingDocsHelp">
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.readingdocstitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.readingdocs')"/>
+		
+		<table>
+			<tr>
+				<td colspan="2"><img src="interfaces/oran/images/bookshelf.png"/></td>
+				<td><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.openbookshelf')"/></td>
+			</tr>
+			<tr>
+				<td><img src="interfaces/oran/images/previous.png"/></td>
+				<td><img src="interfaces/oran/images/next.png"/></td>
+				<td><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.sectionarrows')"/></td>
+			</tr>
+		</table>
+	</xsl:template>
+	
+	<xsl:template name="searchingHelp">
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.searchingtitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.searching')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.querytermstitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.queryterms')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.querytypetitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.querytype')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.queryscopetitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.queryscope')"/>
+	</xsl:template>
+	
+	<xsl:template name="preferencesHelp">
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.changingpreferencestitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.changingpreferences')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.collectionpreferencestitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.collectionpreferences')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.languagepreferencestitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.languagepreferences')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.presentationpreferencestitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.presentationpreferences')"/>
+		
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.searchpreferencestitle')"/>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.searchpreferences1')"/>
+		<xsl:if test="/page/pageResponse/collection[@name=$collName and (@type='mgpp' or @type='mg')]">
+			<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.mgsearchpreferences')"/>
+		</xsl:if>
+		<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'help.searchpreferences2')"/>
 	</xsl:template>
 </xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/pref.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/pref.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/pref.xsl	(revision 24007)
@@ -19,4 +19,96 @@
 	<!-- the page content -->
 	<xsl:template match="/page">
+	
+		<!-- 
+		Add some javascript to the page that notices when a preference is changed 
+		so that, if the user tries to navigate away from the page without clicking
+		the "Set preferences" button, it asks them if they want their preferences
+		saved or not 
+		-->
+		<script type="text/javascript"><xsl:text disable-output-escaping="yes">
+			var modified = false;
+			var bypass = false;
+					
+			function assembleURLFromForm(formElem)
+			{
+				var url = "dev";
+				var selectNodes = formElem.getElementsByTagName("select");
+				var inputNodes = formElem.getElementsByTagName("input");
+
+				for (var i = 0; i &lt; selectNodes.length; i++)
+				{
+					var current = selectNodes[i];
+					url += (url == "dev") ? "?" : "&amp;";
+					url += current.name + "=";
+					url += current.options[current.selectedIndex].text;
+				}
+				
+				for (var i = 0; i &lt; inputNodes.length; i++)
+				{
+					var current = inputNodes[i];
+					if (current.type == "hidden" || current.type == "text")
+					{
+						url += (url == "dev") ? "?" : "&amp;";
+						url += current.name + "=";
+						url += current.value;
+					}
+				}
+				return url;
+			}
+					
+			function checkModified(e)
+			{
+				if (modified &amp;&amp; !bypass)
+				{
+					var ok = confirm("Would you like to save your preferences?");
+					
+					if (ok)
+					{
+						var formElem = document.getElementById("prefform");
+						formElem.submit();
+						var xmlhttp;
+						if (window.XMLHttpRequest)
+						{
+							xmlhttp=new XMLHttpRequest();
+						}
+						else
+						{
+							xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+						}
+
+						xmlhttp.open("GET",assembleURLFromForm(formElem),false);
+						xmlhttp.send();
+					}
+				}
+			}
+			
+			function changed()
+			{
+				modified = true;
+				bypass = false;
+			}
+			
+			function pageLoad()
+			{
+				var formElem = document.getElementById("prefform");
+			
+				var selectNodes = formElem.getElementsByTagName("select");
+				var inputNodes = formElem.getElementsByTagName("input");
+
+				YAHOO.util.Event.addListener(selectNodes, 'change', changed);
+				
+				for(var i = 0; i &lt; inputNodes.length; i++)
+				{
+					current = inputNodes[i];
+					if(current.getAttribute("type") == null)
+					{
+						YAHOO.util.Event.on(current, 'keyup', changed);
+					}
+				}
+			}
+			
+			YAHOO.util.Event.addListener(window, 'load', pageLoad);
+			YAHOO.util.Event.addListener(window, 'beforeunload', checkModified);
+		</xsl:text></script>
 
 		<xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
@@ -24,5 +116,5 @@
 
 		<div id="queryform">
-			<form name="PrefForm" method="get" action="{$library_name}">
+			<form name="PrefForm" method="get" action="{$library_name}" id="prefform">
 
 				<input type='hidden' name='a' value='p'/>
@@ -89,5 +181,14 @@
 				<h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></h3>
 				<div id="searchprefs">
-					<xsl:variable name="hits"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable> 
+					<xsl:variable name="hits">
+						<xsl:choose>
+							<xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']">
+								<xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value"/>
+							</xsl:when>
+							<xsl:otherwise>
+								20
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable> 
 					<div class="paramLabel">
 						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.hitsperpage')"/>
@@ -95,10 +196,48 @@
 					<div class="paramValue">
 						<select name="hitsPerPage">
-							<option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option> 
-							<option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
-							<option value="100"><xsl:if test="$hits=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
-							<option value="-1"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.all')"/></option>
-						</select>
-					</div>
+							<option value="20">
+								<xsl:if test="$hits=20">
+									<xsl:attribute name="selected" />
+								</xsl:if>
+								20
+							</option> 
+							<option value="50">
+								<xsl:if test="$hits=50">
+									<xsl:attribute name="selected" />
+								</xsl:if>
+								50
+							</option>
+							<option value="100">
+								<xsl:if test="$hits=100">
+									<xsl:attribute name="selected" />
+								</xsl:if>
+								100
+							</option>
+							<option value="-1">
+								<xsl:if test="$hits=-1">
+									<xsl:attribute name="selected" />
+								</xsl:if>
+								<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.all')"/>
+							</option>
+						</select>
+					</div>
+					
+					<br class="clear"/>
+					
+					<xsl:variable name="mdocs">
+						<xsl:choose>
+							<xsl:when test="/page/pageRequest/paramList/param[@name='maxDocs']">
+								<xsl:value-of select="/page/pageRequest/paramList/param[@name='maxDocs']/@value"/>
+							</xsl:when>
+							<xsl:otherwise>100</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable> 
+					<div class="paramLabel">
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.maxDocs')"/>
+					</div>
+					<div class="paramValue">
+						<input name="maxDocs" size="3" value="{$mdocs}" />
+					</div>
+					
 					<br class="clear"/>
 				</div>
@@ -106,5 +245,5 @@
 				<br/>
 
-				<input type='submit'><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs')"/></xsl:attribute></input>
+				<input type='submit' onclick="bypass=true;"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs')"/></xsl:attribute></input>
 
 			</form>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/query.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/query.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/pages/query.xsl	(revision 24007)
@@ -36,7 +36,10 @@
 							<xsl:for-each select="paramList/param">
 								<xsl:choose>
+									<xsl:when test="@name='case' or @name='stem' or @name='accent'">
+									</xsl:when>
 									<xsl:when test="@type='multi'">
 										<xsl:apply-templates select="."><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
 									</xsl:when>
+									<xsl:when test="@name = 'sortBy' or @name = 'maxDocs'"></xsl:when>
 									<xsl:otherwise>
 										<xsl:variable name="pvalue"><xsl:apply-templates select="." mode="calculate-default"><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates></xsl:variable>
@@ -64,4 +67,18 @@
 
 			<xsl:otherwise>
+				<p class="termList">
+					<xsl:choose>
+						<xsl:when test="count(/page/pageResponse/termList/term) &lt; 3">
+							<xsl:for-each select="/page/pageResponse/termList/term">
+								<span style="font-style:italic;"><xsl:value-of select="@name"/></span> occurs <xsl:value-of select="@freq"/> times in <xsl:value-of select="@numDocsMatch"/> document(s) <br />
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="/page/pageResponse/termList/term">
+								<span style="font-style:italic;"><xsl:value-of select="@name"/></span> (<xsl:value-of select="@freq"/>);
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+				</p>
 				
 				<ul id="results">
@@ -69,7 +86,25 @@
 						<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"/></xsl:attribute>
-								<xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
+								<xsl:choose>
+									<xsl:when test="/page/pageResponse/collection/@name">
+										<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=q&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;hl=on&amp;ed=1#<xsl:value-of select="@nodeID"/></xsl:attribute>
+									</xsl:when>
+									<xsl:when test="@collection">
+										<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="@collection"/>&amp;d=<xsl:value-of select="@nodeID"/>&amp;dt=<xsl:value-of select="@docType"/>&amp;p.a=q&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;hl=on&amp;ed=1#<xsl:value-of select="@nodeID"/></xsl:attribute>
+									</xsl:when>
+								</xsl:choose>
+								
+								<xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/> 
 							</a>
+							
+							<!-- If this is results from a cross collection search then add a link to the collection that it is from -->
+							<xsl:if test="@collection">
+								(<a style="background-image:none; padding:3px;">
+									<xsl:attribute name="href">
+										<xsl:value-of select="$library_name"/>?a=p&amp;sa=about&amp;c=<xsl:value-of select="@collection"/>
+									</xsl:attribute>
+									<xsl:value-of select="@collection"/>
+								</a>)
+							</xsl:if>
 							<xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
 						</li>
@@ -115,5 +150,5 @@
 	</xsl:template>
 
-	<!-- invisible params - used by other stuff. in the query form, we set to teh default -->
+	<!-- invisible params - used by other stuff. in the query form, we set to the default -->
 	<xsl:template match="param[@type='invisible']">
 		<xsl:param name="ns">s1.</xsl:param>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/query-common.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/query-common.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/query-common.xsl	(revision 24007)
@@ -0,0 +1,55 @@
+<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">
+	
+	<xsl:template match="param" mode="calculate-default">
+		<xsl:param name="ns">s1.</xsl:param>
+		<xsl:variable name="pname"><xsl:value-of select="$ns"/><xsl:value-of select="@name"/></xsl:variable>
+		<xsl:choose>
+			<xsl:when test="/page/pageRequest/paramList/param[@name=$pname]">
+				<xsl:choose>
+					<xsl:when test="@type='enum_multi'"><xsl:text>,</xsl:text>
+						<xsl:for-each select="/page/pageRequest/paramList/param[@name=$pname]">
+							<xsl:value-of select="@value"/>,
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="@default"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	
+	<!-- single selection enum params -->
+	<xsl:template match="param[@type='enum_single']">
+		<xsl:param name="ns">s1.</xsl:param>
+		<xsl:param name="default"/>
+		<xsl:choose>
+			<xsl:when test="count(option) = 1">
+				<xsl:value-of select="option/displayItem[@name='name']"/>
+				<input type='hidden' name='{$ns}{@name}'><xsl:attribute name='value'><xsl:value-of  select='option/@name'/></xsl:attribute></input>
+			</xsl:when>
+			<xsl:otherwise>
+				<select name="{$ns}{@name}">
+					<xsl:for-each select="option">
+						<option value="{@name}"><xsl:if test="@name=$default"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
+					</xsl:for-each>
+				</select>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	
+	<xsl:template match="param[@type='string']">
+		<xsl:param name="ns">s1.</xsl:param>
+		<xsl:param name="default"/>
+		<input type="text" name="{$ns}{@name}" size="30" value="{$default}"/>
+	</xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/util.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/util.xsl	(revision 23632)
+++ main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/util.xsl	(revision 24007)
@@ -1,68 +1,63 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
-	xmlns:gslib="http://www.greenstone.org/XSL/Library"
-	xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
-	xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
-	exclude-result-prefixes="util gslib gsf xslt">
-
-	<!-- some global parameters - these are set by whoever is invoking the transformation -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslt="http://www.w3.org/1999/XSL/Transform" xmlns:gslib="http://www.greenstone.org/XSL/Library" xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil" version="1.0" exclude-result-prefixes="util gslib gsf xslt">
+  <!-- some global parameters - these are set by whoever is invoking the transformation -->
   <xsl:param name="interface_name"/>
   <xsl:param name="library_name"/>
-
   <xsl:include href="xml-to-string.xsl"/>
-
   <!-- every pages ....................................................................... -->
-	<xsl:template name="siteName"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteName']"/></xsl:template>
-	<xsl:template name="siteLink"><a href="./{$library_name}"><xsl:call-template name="siteName"/><xsl:text> </xsl:text></a></xsl:template>
-
-  	<xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>		</xsl:variable>
-	<xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
-
-	<xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable>
-	<xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
-
-	<!-- template to get the name of the current collection -->
-	<xsl:template name="collectionName">
-		<xsl:choose>
-			<xsl:when test="/page/pageResponse/collection"><xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/></xsl:when>
-			<xsl:otherwise>All Collections</xsl:otherwise>
-		</xsl:choose>
-	</xsl:template>
-
-	<xsl:template name="collectionNameShort">
-		<xsl:value-of select="/page/pageResponse/collection/@name"/>
-	</xsl:template>
-
-	<xsl:template name="collectionNameLinked">
-		<xsl:if test="/page/pageResponse/collection">
-			<a>
-				<xsl:attribute name="href">./<xsl:value-of select="$library_name"/>?a=p&amp;sa=about&amp;c=<xsl:call-template name="collectionNameShort"/></xsl:attribute>
-				<xsl:call-template name="collectionName"/>
-			</a>
-		</xsl:if>
-	</xsl:template>
-
-	<!-- text to get the name of the current service ("Browse","Search" etc) -->
-	<xsl:template name="serviceName">
-		<xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
-	</xsl:template>
-
-	<xsl:template name="textDirectionAttribute">
-		<xsl:attribute name="dir">
-			<xsl:choose>
-				<xsl:when test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:when>
-				<xsl:otherwise>ltr</xsl:otherwise>
-			</xsl:choose>
-		</xsl:attribute>
-	</xsl:template>
-
-	<xsl:template name="actionClass">
-		<xsl:attribute name="class"><xsl:value-of select="/page/pageRequest/@action"/>Action <xsl:if test="/page/pageRequest/@subaction"><xsl:value-of select="/page/pageRequest/@subaction"/>Subaction</xsl:if></xsl:attribute>
-	</xsl:template>
-
-	<!-- username, if logged in -->
-	<!--
+  <xsl:template name="siteName">
+    <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteName']"/>
+  </xsl:template>
+  <xsl:template name="siteLink">
+    <a href="./{$library_name}">
+      <xsl:call-template name="siteName"/>
+      <xsl:text> </xsl:text>
+    </a>
+  </xsl:template>
+  <xsl:variable name="a">
+    <xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>
+  </xsl:variable>
+  <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
+  <xsl:variable name="berrybasketswitch">
+    <xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/>
+  </xsl:variable>
+  <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
+  <!-- template to get the name of the current collection -->
+  <xsl:template name="collectionName">
+    <xsl:choose>
+      <xsl:when test="/page/pageResponse/collection">
+        <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
+      </xsl:when>
+      <xsl:otherwise>All Collections</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template name="collectionNameShort">
+    <xsl:value-of select="/page/pageResponse/collection/@name"/>
+  </xsl:template>
+  <xsl:template name="collectionNameLinked">
+    <xsl:if test="/page/pageResponse/collection">
+      <a>
+        <xsl:attribute name="href">./<xsl:value-of select="$library_name"/>?a=p&amp;sa=about&amp;c=<xsl:call-template name="collectionNameShort"/></xsl:attribute>
+        <xsl:call-template name="collectionName"/>
+      </a>
+    </xsl:if>
+  </xsl:template>
+  <!-- text to get the name of the current service ("Browse","Search" etc) -->
+  <xsl:template name="serviceName">
+    <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
+  </xsl:template>
+  <xsl:template name="textDirectionAttribute">
+    <xsl:attribute name="dir">
+      <xsl:choose>
+        <xsl:when test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:when>
+        <xsl:otherwise>ltr</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+  </xsl:template>
+  <xsl:template name="actionClass">
+    <xsl:attribute name="class"><xsl:value-of select="/page/pageRequest/@action"/>Action <xsl:if test="/page/pageRequest/@subaction"><xsl:value-of select="/page/pageRequest/@subaction"/>Subaction</xsl:if></xsl:attribute>
+  </xsl:template>
+  <!-- username, if logged in -->
+  <!--
 	<xsl:template name="username">
 		<xsl:if test="$un_s!=''">
@@ -73,27 +68,26 @@
 	</xsl:template>
 	-->
-
-    <xsl:template name="defaultDividerBar">
-   <xsl:param name='text'/>
-      <xsl:choose>
+  <xsl:template name="defaultDividerBar">
+    <xsl:param name="text"/>
+    <xsl:choose>
       <xsl:when test="$text">
-	 <div class="divbar"><xsl:value-of select="$text"/></div>
+        <div class="divbar">
+          <xsl:value-of select="$text"/>
+        </div>
       </xsl:when>
       <xsl:otherwise>
-	 <div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
+        <div class="divbar">
+          <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
+        </div>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-
-
-    <xsl:template match="error">
+  <xsl:template match="error">
     Error: <xsl:value-of select="."/>
   </xsl:template>
-
-
-<xsl:template name="displayErrorsIfAny">
-      <xsl:if test="descendant::error">
+  <xsl:template name="displayErrorsIfAny">
+    <xsl:if test="descendant::error">
       <script language="Javascript">
-	<xsl:text disable-output-escaping="yes">
+        <xsl:text disable-output-escaping="yes">
 	  function removeAllChildren(node) {
 	    while (node.hasChildNodes()) {
@@ -107,70 +101,72 @@
 	      hide_link = document.getElementById("hide");
 	      removeAllChildren(hide_link);
-	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/><xsl:text disable-output-escaping="yes">"));
+	      hide_link.appendChild(document.createTextNode("</xsl:text>
+        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/>
+        <xsl:text disable-output-escaping="yes">"));
 	    } else {
 	      obj.style.display = "none";
 	      hide_link = document.getElementById("hide");
 	      removeAllChildren(hide_link);
-	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
+	      hide_link.appendChild(document.createTextNode("</xsl:text>
+        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/>
+        <xsl:text disable-output-escaping="yes">"));
 	    }
 	  }
 	</xsl:text>
       </script>
-      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/></a></p>
+      <p align="right">
+        <a id="hide" href="javascript:toggleHideError(error);">
+          <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/>
+        </a>
+      </p>
       <div id="error" style="display: none;">
-	<xsl:apply-templates select="descendant::error"/>
+        <xsl:apply-templates select="descendant::error"/>
       </div>
     </xsl:if>
-</xsl:template>
-
-
-	<xsl:template name="noTextBar">
-		<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
-	</xsl:template>
-	
-	
-	<xsl:template name="poweredByGS3TextBar">
-		<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
-	</xsl:template>
-
-	<xsl:template name="rightArrow"><xsl:text disable-output-escaping="yes"> &amp;raquo; </xsl:text></xsl:template>
-
-
-
-	<!-- site home ....................................................................... -->
-
-<xsl:template name="siteHomePageTitle">
- <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
-</xsl:template>
-
-
-    <xsl:template name="selectACollectionTextBar">
-  	 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
-  </xsl:template>
-	<xsl:template name="crossCollectionQuickSearchForm">
-		<xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
-	</xsl:template>
-	
-	<xsl:template match="service[@name='TextQuery']">
-		<form name="QuickSearch" method="get" action="{$library_name}">
-			<input type="hidden" name="a" value="q"/>
-			<input type="hidden" name="rt" value="rd"/>
-			<input type="hidden" name="s" value="{@name}"/>
-			<input type="hidden" name="s1.collection" value="all"/>
-			<input type="text" name="s1.query" size="20"/>
-			<input type="submit"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/></xsl:attribute></input>
-		</form>
-	</xsl:template>
-
-	<xsl:template name="collectionLinkWithImage">
-		<xsl:choose>
-			<xsl:when test="displayItem[@name='icon']">
-				<a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
-					<img class="collectionLinkImage">
-						<xsl:attribute name="alt"></xsl:attribute>
-						<xsl:attribute name="src">sites/localsite/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItem[@name='icon']"/></xsl:attribute>
-					</img>
-<!--
+  </xsl:template>
+  <xsl:template name="noTextBar">
+    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
+  </xsl:template>
+  <xsl:template name="poweredByGS3TextBar">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
+  </xsl:template>
+  <xsl:template name="rightArrow">
+    <xsl:text disable-output-escaping="yes"> &amp;raquo; </xsl:text>
+  </xsl:template>
+  <!-- site home ....................................................................... -->
+  <xsl:template name="siteHomePageTitle">
+    <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+    <xsl:text> </xsl:text>
+  </xsl:template>
+  <xsl:template name="selectACollectionTextBar">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
+  </xsl:template>
+  <xsl:template name="crossCollectionQuickSearchForm">
+    <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
+  </xsl:template>
+  <xsl:template match="service[@name='TextQuery']">
+    <form name="QuickSearch" method="get" action="{$library_name}">
+      <input type="hidden" name="a" value="q"/>
+      <input type="hidden" name="rt" value="rd"/>
+      <input type="hidden" name="s" value="{@name}"/>
+      <input type="hidden" name="s1.collection" value="all"/>
+      <input type="text" name="s1.query" size="20"/>
+      <input type="submit">
+        <xsl:attribute name="value">
+          <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/>
+        </xsl:attribute>
+      </input>
+    </form>
+  </xsl:template>
+  <xsl:template name="collectionLinkWithImage">
+    <xsl:choose>
+      <xsl:when test="displayItem[@name='icon']">
+        <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
+          <img class="collectionLinkImage">
+            <xsl:attribute name="alt"/>
+            <xsl:attribute name="src">sites/localsite/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItem[@name='icon']"/></xsl:attribute>
+          </img>
+          <!--
 					<div class="collectionLink">
 						<xsl:attribute name="style">background-image: url(/sites/localsite/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>);</xsl:attribute>
@@ -178,357 +174,393 @@
 					</div>
 -->
-				</a>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
+          <div class="collectionLink">
+            <xsl:value-of select="displayItem[@name='name']"/>
+          </div>
+        </a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template name="serviceClusterList">
+    <xsl:apply-templates select="serviceClusterList"/>
+  </xsl:template>
+  <xsl:template match="serviceClusterList">
+    <xsl:for-each select="serviceCluster">
+      <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
+        <xsl:value-of select="@name"/>
+        <xsl:value-of select="displayItem[@name='name']"/>
+      </a>
+    </xsl:for-each>
+  </xsl:template>
+  <xsl:template name="serviceLink">
+    <div class="paramLabel">
+      <a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}">
+        <xsl:value-of select="displayItem[@name='name']"/>
+      </a>
+    </div>
+    <div class="paramValue">
+      <xsl:value-of select="displayItem[@name='description']"/>
+    </div>
+    <br class="clear"/>
+  </xsl:template>
+  <xsl:template name="authenticationLink">
+    <xsl:for-each select="serviceList/service[@type='authen']">
+      <li>
+        <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s={@name}&amp;s1.aup=Login&amp;s1.un=&amp;s1.asn=">
+          <xsl:value-of select="displayItem[@name='name']"/>
+        </a>
+        <xsl:value-of select="displayItem[@name='description']"/>
+      </li>
+    </xsl:for-each>
+  </xsl:template>
+  <xsl:template name="libraryInterfaceLink">
+    <li>
+      <a href="{$library_name}?a=p&amp;sa=gli4gs3">
+        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/>
+      </a>
+    </li>
+  </xsl:template>
+  <xsl:template name="greenstoneLogoAlternateText">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+  </xsl:template>
+  <!-- about page - collection home ....................................................................... -->
+  <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+  <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+  <xsl:param name="pageType"/>
+  <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
+  <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
+  <xsl:template name="aboutCollectionPageTitle">
+    <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+    <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
+    <xsl:text> </xsl:text>
+  </xsl:template>
+  <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
+    <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
+      <xsl:choose>
+        <xsl:when test="$this-element/displayItem[@name='icon']">
+          <img border="0">
+            <xsl:attribute name="src"><xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/></xsl:attribute>
+            <xsl:attribute name="alt">
+              <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+            </xsl:attribute>
+            <xsl:attribute name="title">
+              <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
+            </xsl:attribute>
+          </img>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </a>
+  </xsl:template>
+  <xsl:template name="homeButtonTop">
+    <a href="{$library_name}?a=p&amp;sa=home">
+      <xsl:attribute name="title">
+        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/>
+      </xsl:attribute>
+      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
+    </a>
+  </xsl:template>
+  <xsl:template name="helpButtonTop">
+    <xsl:choose>
+      <xsl:when test="$pageType='help'">
+        <li>
+          <a>
+            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+          </a>
+        </li>
+      </xsl:when>
+      <xsl:otherwise>
+        <li>
+          <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
+            <xsl:attribute name="title">
+              <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/>
+            </xsl:attribute>
+            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+          </a>
+        </li>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template name="preferencesButtonTop">
+    <xsl:choose>
+      <xsl:when test="$pageType='pref'">
+        <li>
+          <a>
+            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+          </a>
+        </li>
+      </xsl:when>
+      <xsl:otherwise>
+        <li>
+          <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
+            <xsl:attribute name="title">
+              <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
+            </xsl:attribute>
+            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+          </a>
+        </li>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template name="servicesNavigationBar">
+    <xsl:for-each select="$this-element/serviceList/service">
+      <xsl:variable name="action">
+        <xsl:choose>
+          <xsl:when test="@name=$this-service">CURRENT</xsl:when>
+          <xsl:when test="@type='query'">q</xsl:when>
+          <xsl:when test="@type='browse'">b</xsl:when>
+          <xsl:when test="@type='process'">pr</xsl:when>
+          <xsl:when test="@type='applet'">a</xsl:when>
+          <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$action='CURRENT'">
+          <li>
+            <a>
+              <xsl:value-of select="displayItem[@name='name']"/>
+            </a>
+          </li>
+        </xsl:when>
+        <xsl:when test="$action !='DO_NOT_DISPLAY'">
+          <li>
+            <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
+              <xsl:if test="displayItem[@name='description']">
+                <xsl:attribute name="title">
+                  <xsl:value-of select="displayItem[@name='description']"/>
+                </xsl:attribute>
+              </xsl:if>
+              <xsl:value-of select="displayItem[@name='name']"/>
+            </a>
+          </li>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:template>
+  <xsl:template name="collectionDescriptionTextAndServicesLinks">
+    <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
+  </xsl:template>
+  <xsl:template match="collection|serviceCluster">
+    <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
+    <xsl:apply-templates select="serviceList">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+  </xsl:template>
+  <xsl:template match="serviceList">	
+	<xsl:param name="collName"/>
+	<xsl:if test="service[not(@type = 'query' or @type = 'browse' or @type = 'retrieve')]">
+		<h3>
+		  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/>
+		</h3>
+		<p>
+		  <xsl:choose>
+			<xsl:when test="service">
+			  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
 			</xsl:when>
 			<xsl:otherwise>
-				<a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
-					<div class="collectionLink">
-						<xsl:value-of select="displayItem[@name='name']"/>
-					</div>
-				</a>
+			  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
 			</xsl:otherwise>
-		</xsl:choose>
-	</xsl:template>
-
-
-	<xsl:template name="serviceClusterList">
-		<xsl:apply-templates select="serviceClusterList"/>
-	</xsl:template>
-	
-	  <xsl:template match="serviceClusterList">
-	    <xsl:for-each select="serviceCluster">
-	      <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
-	    </xsl:for-each>
-	  </xsl:template>
-
-	
-	<xsl:template name="serviceLink">
-		<div class="paramLabel"><a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></div>
-		<div class="paramValue"><xsl:value-of select="displayItem[@name='description']"/></div>
-		<br class="clear"/>
-	</xsl:template>
-
-
-   <xsl:template name="authenticationLink">
-   <xsl:for-each select="serviceList/service[@type='authen']">
-      <li><a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s={@name}&amp;s1.aup=Login&amp;s1.un=&amp;s1.asn="><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li></xsl:for-each>
-  </xsl:template>
-   <xsl:template name="libraryInterfaceLink">
-   <li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li>
-  </xsl:template>
-<xsl:template name="greenstoneLogoAlternateText">
-<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
-</xsl:template>
-
-<!-- about page - collection home ....................................................................... -->
-<xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
-<xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
-<xsl:param name="pageType"/>
-<xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
-<xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
-
-
-<xsl:template name="aboutCollectionPageTitle">
- <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-<xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/><xsl:text> </xsl:text>
-</xsl:template>
-
-	
-<xsl:template name="collectionHomeLinkWithLogoIfAvailable">
-<a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
-	  <xsl:choose>
-	    <xsl:when test="$this-element/displayItem[@name='icon']">
-	      <img border="0">
-		<xsl:attribute name="src">
-		  <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
-		</xsl:attribute>	
-		<xsl:attribute name="alt">
-		  <xsl:value-of select="$this-element/displayItem[@name='name']"/>
-		</xsl:attribute>
-		<xsl:attribute name="title">
-		  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
-		</xsl:attribute>
-	      </img>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:value-of select="$this-element/displayItem[@name='name']"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</a>
-</xsl:template>
-
-
-<xsl:template name="homeButtonTop">
-<a href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
-<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></a>
-</xsl:template>
-
-
-<xsl:template name="helpButtonTop">
+		  </xsl:choose>
+		</p>
+		<xsl:if test="service">
+		  <div id="servicelist">
+			<xsl:for-each select="service">
+			  <xsl:sort select="position()" order="descending" data-type="number"/>
+			  <xsl:variable name="action">
+				<xsl:choose>
+				  <xsl:when test="@type='query'">q</xsl:when>
+				  <xsl:when test="@type='browse'">b</xsl:when>
+				  <xsl:when test="@type='process'">pr</xsl:when>
+				  <xsl:when test="@type='applet'">a</xsl:when>
+				  <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+				</xsl:choose>
+			  </xsl:variable>
+			  <xsl:if test="$action != 'DO_NOT_DISPLAY'">
+				<div class="paramLabel">
+				  <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
+					<xsl:value-of select="displayItem[@name='name']"/>
+				  </a>
+				</div>
+				<div class="paramLabel">
+				  <xsl:value-of select="displayItem[@name='description']"/>
+				</div>
+				<br class="clear"/>
+			  </xsl:if>
+			</xsl:for-each>
+		  </div>
+		</xsl:if>
+	</xsl:if>
+  </xsl:template>
+  <!-- classifier page ............................................................................ -->
+  <xsl:template name="collapsedNavigationTab">
+    <xsl:param name="type"/>
+    <xsl:variable name="isCurrent" select="/page/pageResponse/service[@type=$type]"/>
+    <li>
+      <xsl:if test="$isCurrent">
+        <xsl:attribute name="class">current</xsl:attribute>
+      </xsl:if>
+      <a>
+        <xsl:if test="service[@name=$type]/displayItem[@name='description']">
+          <xsl:attribute name="title">
+            <xsl:value-of select="service[@name=$type]/displayItem[@name='description']"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=q&amp;rt=d&amp;s=<xsl:value-of select="service[@type=$type]/@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
+        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $type)"/>
+      </a>
+    </li>
+  </xsl:template>
+  <xsl:template name="navigationTab">
+    <xsl:variable name="isCurrent" select="@name=/page/pageResponse/service/@name"/>
+    <xsl:variable name="action">
+      <xsl:choose>
+        <xsl:when test="@type='query'">q</xsl:when>
+        <xsl:when test="@type='browse'">b</xsl:when>
+        <xsl:when test="@type='process'">pr</xsl:when>
+        <xsl:when test="@type='applet'">a</xsl:when>
+        <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="$action!='DO_NOT_DISPLAY'">
+      <li>
+        <xsl:if test="$isCurrent">
+          <xsl:attribute name="class">current</xsl:attribute>
+        </xsl:if>
+        <a>
+          <xsl:if test="displayItem[@name='description']">
+            <xsl:attribute name="title">
+              <xsl:value-of select="displayItem[@name='description']"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:choose>
+            <xsl:when test="classifierList/classifier/@name">
+              <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&amp;rt=s&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;cl=<xsl:value-of select="classifierList/classifier/@name"/></xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&amp;rt=d&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
+            </xsl:otherwise>
+          </xsl:choose>
+          <xsl:value-of select="displayItem[@name='name']"/>
+        </a>
+      </li>
+    </xsl:if>
+  </xsl:template>
+  <xsl:template name="classifierLink">
+    <xsl:if test="@name=/page/pageResponse/classifier/@name">
+      <xsl:attribute name="class">current</xsl:attribute>
+    </xsl:if>
+    <a href="{$library_name}?a=b&amp;rt=r&amp;s={/page/pageResponse/service/@name}&amp;c={/page/pageResponse/collection/@name}&amp;cl={@name}">
+      <xsl:value-of select="displayItem[@name='description']"/>
+    </a>
+  </xsl:template>
+  <!-- query page ............................................................................ -->
+  <xsl:template name="indexName">
+    <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
+  </xsl:template>
+  <xsl:template name="queryPageCollectionName">
     <xsl:choose>
-      <xsl:when test="$pageType='help'">
-	<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li>
+      <xsl:when test="/page/pageResponse/collection">
+        <gslib:aboutCollectionPageTitle/>
       </xsl:when>
-      <xsl:otherwise>
-	<li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
-	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
-	  </a></li>
-      </xsl:otherwise>
+      <xsl:otherwise>Cross-Collection</xsl:otherwise>
     </xsl:choose>
-</xsl:template>
-
-
-	<xsl:template name="preferencesButtonTop">
-		<xsl:choose>
-			<xsl:when test="$pageType='pref'">
-				<li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
-			</xsl:when>
-			<xsl:otherwise>
-				<li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
-					<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
-				</a></li>
-			</xsl:otherwise>
-		</xsl:choose>
-	</xsl:template>
-
-	<xsl:template name="servicesNavigationBar">
-		<xsl:for-each select="$this-element/serviceList/service">
-			<xsl:variable name="action"><xsl:choose>
-				<xsl:when test="@name=$this-service">CURRENT</xsl:when>
-				<xsl:when test="@type='query'">q</xsl:when>
-				<xsl:when test="@type='browse'">b</xsl:when>
-				<xsl:when test="@type='process'">pr</xsl:when>
-				<xsl:when test="@type='applet'">a</xsl:when>
-				<xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
-			</xsl:choose></xsl:variable>
-			<xsl:choose>
-				<xsl:when test="$action='CURRENT'">
-					<li><a><xsl:value-of select="displayItem[@name='name']"/></a></li>
-				</xsl:when>
-				<xsl:when test="$action !='DO_NOT_DISPLAY'">
-					<li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
-				</xsl:when>
-			</xsl:choose>
-		</xsl:for-each>
-	</xsl:template>
-
-
-	<xsl:template name="collectionDescriptionTextAndServicesLinks">
-		<xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
-	</xsl:template>
-
-	<xsl:template match="collection|serviceCluster">
-		<xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
-		<xsl:apply-templates select="serviceList">
-			<xsl:with-param name="collName" select="$collName"/>
-		</xsl:apply-templates>
-	</xsl:template>
-
-
-	<xsl:template match="serviceList">
-		<xsl:param name="collName"/>
-		<h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>
-		<p>
-			<xsl:choose>
-				<xsl:when test="service">
-					<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
-				</xsl:when>
-				<xsl:otherwise>
-					<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
-				</xsl:otherwise>
-			</xsl:choose>
-		</p>
-
-		<xsl:if test="service">
-			<div id="servicelist">
-				<xsl:for-each select="service">
-					<xsl:sort select="position()" order="descending" data-type="number"/>
-
-					<xsl:variable name="action"><xsl:choose>
-						<xsl:when test="@type='query'">q</xsl:when>
-						<xsl:when test="@type='browse'">b</xsl:when>
-						<xsl:when test="@type='process'">pr</xsl:when>
-						<xsl:when test="@type='applet'">a</xsl:when>
-						<xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
-					</xsl:choose></xsl:variable>
-					<xsl:if test="$action != 'DO_NOT_DISPLAY'">
-						<div class="paramLabel"><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a></div>
-						<div class="paramLabel"><xsl:value-of select="displayItem[@name='description']"/></div>
-						<br class="clear"/>
-					</xsl:if>
-				</xsl:for-each>
-			</div>
-		</xsl:if>
-	</xsl:template>
-
-
-
-<!-- classifier page ............................................................................ -->
-
-<xsl:template name="collapsedNavigationTab">
-	<xsl:param name="type"/>
-	<xsl:variable name="isCurrent" select="/page/pageResponse/service[@type=$type]"/>
-	<li>
-		<xsl:if test="$isCurrent">
-			<xsl:attribute name="class">current</xsl:attribute>
-		</xsl:if>
-		<a>
-			<xsl:if test="service[@name=$type]/displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="service[@name=$type]/displayItem[@name='description']"/></xsl:attribute></xsl:if>
-			<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=q&amp;rt=d&amp;s=<xsl:value-of select="service[@type=$type]/@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
-			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $type)"/>
-		</a>
-	</li>
-</xsl:template>
-
-<xsl:template name="navigationTab">
-
-	<xsl:variable name="isCurrent" select="@name=/page/pageResponse/service/@name"/>
-
-	<xsl:variable name="action"><xsl:choose>
-		<xsl:when test="@type='query'">q</xsl:when>
-		<xsl:when test="@type='browse'">b</xsl:when>
-		<xsl:when test="@type='process'">pr</xsl:when>
-		<xsl:when test="@type='applet'">a</xsl:when>
-		<xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
-	</xsl:choose></xsl:variable>
-
-	<xsl:if test="$action!='DO_NOT_DISPLAY'">
-		<li>
-			<xsl:if test="$isCurrent">
-				<xsl:attribute name="class">current</xsl:attribute>
-			</xsl:if>
-			<a>
-				<xsl:if test="displayItem[@name='description']">
-					<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
-				</xsl:if>
-				<xsl:choose>
-					<xsl:when test="classifierList/classifier/@name">
-						<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&amp;rt=s&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;cl=<xsl:value-of select="classifierList/classifier/@name"/></xsl:attribute>
-					</xsl:when>
-					<xsl:otherwise>
-						<xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&amp;rt=d&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
-					</xsl:otherwise>
-				</xsl:choose>
-				<xsl:value-of select="displayItem[@name='name']"/>
-			</a>
-		</li>
-	</xsl:if>
-
-</xsl:template>
-
-
-<xsl:template name="classifierLink">
-	<xsl:if test="@name=/page/pageResponse/classifier/@name"><xsl:attribute name="class">current</xsl:attribute></xsl:if>
-	<a href="{$library_name}?a=b&amp;rt=r&amp;s={/page/pageResponse/service/@name}&amp;c={/page/pageResponse/collection/@name}&amp;cl={@name}">
-		<xsl:value-of select="displayItem[@name='description']"/>
-	</a>
-</xsl:template>
-
-<!-- query page ............................................................................ -->
-
-	<xsl:template name="indexName">
-		<xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
-	</xsl:template>
-
-<xsl:template name="queryPageCollectionName">
-	<xsl:choose><xsl:when test="/page/pageResponse/collection"><gslib:aboutCollectionPageTitle/></xsl:when><xsl:otherwise>Cross-Collection</xsl:otherwise></xsl:choose>
-</xsl:template>
-
-
-
-
-
-<!--
+  </xsl:template>
+  <!--
 BERRY BASKET TEMPLATES
 These get used on many different pages to add the
 berry basket function to the site
 -->
-
-<!-- put the drag&drop berry basket on the page -->
-<xsl:template name="berryBasket">
-	<xsl:if test="$berryBasketOn">
-		<div id="berrybasket" class="hide">
-			<span>Berry Basket</span>
-			<span id="berryBasketExpandCollapseLinks" style="display: none;">
-				<a id="berryBasketExpandLink" href="javascript:showBasket()">Expand</a>
-				<a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()">Collapse</a>
-			</span>
-			<div id="baskethandle"><span><xsl:text> </xsl:text></span></div>
-			<div id ="berries"><span><xsl:text> </xsl:text></span></div>
-		</div>
-	</xsl:if>
-</xsl:template>
-
-<!-- include the required javascript and css for berry baskets -->
-<xsl:template name="berryBasketHeadTags">
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/YAHOO.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/event.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/connection.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/dom.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/dragdrop.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDPlayer.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDOnTop.js"><xsl:text> </xsl:text></script>
-	<script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket.js"><xsl:text> </xsl:text></script>
-	<link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
-</xsl:template>
-
-<!--
+  <!-- put the drag&drop berry basket on the page -->
+  <xsl:template name="berryBasket">
+    <xsl:if test="$berryBasketOn">
+      <div id="berrybasket" class="hide">
+        <span>Berry Basket</span>
+        <span id="berryBasketExpandCollapseLinks" style="display: none;">
+          <a id="berryBasketExpandLink" href="javascript:showBasket()">Expand</a>
+          <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()">Collapse</a>
+        </span>
+        <div id="baskethandle">
+          <span>
+            <xsl:text> </xsl:text>
+          </span>
+        </div>
+        <div id="berries">
+          <span>
+            <xsl:text> </xsl:text>
+          </span>
+        </div>
+      </div>
+    </xsl:if>
+  </xsl:template>
+  <!-- include the required javascript and css for berry baskets -->
+  <xsl:template name="berryBasketHeadTags">
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/YAHOO.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/event.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/connection.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/dom.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/dragdrop.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDPlayer.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDOnTop.js"><xsl:text> </xsl:text></script>
+    <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket.js"><xsl:text> </xsl:text></script>
+    <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
+  </xsl:template>
+  <!--
 create a little berry which can be drag&dropped onto the berry basket
 used on classifier and search result pages
 -->
-<xsl:template name="documentBerryForClassifierOrSearchPage">
-	<xsl:if test="$berryBasketOn">
-		<img class="pick" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0">
-			<xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
-		</img>
-	</xsl:if>
-</xsl:template>
-
-<!--
+  <xsl:template name="documentBerryForClassifierOrSearchPage">
+    <xsl:if test="$berryBasketOn">
+      <img class="pick" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0">
+        <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
+      </img>
+    </xsl:if>
+  </xsl:template>
+  <!--
 create little berrys which can be drag&dropped onto the berry basket
 used on the document page
 -->
-<xsl:template name="documentBerryForDocumentPage">
-    <xsl:variable name="selectedNode"><xsl:value-of select="/page/pageResponse/document/@selectedNode"/></xsl:variable>
-    <xsl:variable name="rootNode"><xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/></xsl:variable>
-
-	<xsl:if test="$berryBasketOn">	
-		<div id="documentberries">
-			<img class='pick' id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
-			<span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
-
-			<xsl:if test="$selectedNode != $rootNode">
-				<img class='pick'  id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
-				<span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
-			</xsl:if>
-		</div>
-	</xsl:if>
-</xsl:template>
-
-
-<!-- document page -->
-<xsl:template name="documentTitle">
-	<xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
-</xsl:template>
-
-
-<xsl:template name="coverImage">
-	<img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
-</xsl:template>
-
-<xsl:template name="previousNextButtons">
-	<!-- prev -->
-	<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="@selectedNode"/>.pp&amp;sib=1&amp;p.s=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.a"]/@value'/></xsl:attribute>
-		<img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
-	</a>
-
-	<!-- next -->
-	<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="@selectedNode"/>.np&amp;sib=1&amp;p.s=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.a"]/@value'/></xsl:attribute>
-		<img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
-	</a>
-
-</xsl:template>
-
-
+  <xsl:template name="documentBerryForDocumentPage">
+    <xsl:variable name="selectedNode">
+      <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
+    </xsl:variable>
+    <xsl:variable name="rootNode">
+      <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
+    </xsl:variable>
+    <xsl:if test="$berryBasketOn">
+      <div id="documentberries">
+        <img class="pick" id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
+        <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
+        <!--<xsl:if test="$selectedNode != $rootNode">
+          <img class="pick" id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
+          <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
+        </xsl:if>-->
+      </div>
+    </xsl:if>
+  </xsl:template>
+  <!-- document page -->
+  <xsl:template name="documentTitle">
+    <xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
+  </xsl:template>
+  <xsl:template name="coverImage">
+    <img>
+      <xsl:attribute name="src"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg</xsl:attribute>
+    </img>
+  </xsl:template>
+  <xsl:template name="previousNextButtons">
+    <!-- prev -->
+    <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="@selectedNode"/>.pp&amp;sib=1&amp;p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.s&quot;]/@value"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.sa&quot;]/@value"/>&amp;p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.a&quot;]/@value"/></xsl:attribute>
+      <img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
+    </a>
+    <!-- next -->
+    <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="@selectedNode"/>.np&amp;sib=1&amp;p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.s&quot;]/@value"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.sa&quot;]/@value"/>&amp;p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.a&quot;]/@value"/></xsl:attribute>
+      <img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
+    </a>
+  </xsl:template>
 </xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/jquery.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/jquery.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/jquery.js	(revision 24007)
@@ -0,0 +1,167 @@
+/*!
+ * jQuery JavaScript Library v1.4.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Nov 11 19:04:53 2010 -0500
+ */
+(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
+h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
+h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
+"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
+e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
+"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
+s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
+j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
+toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
+-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
+if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
+if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
+b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
+!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
+l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
+z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
+s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
+s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
+[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
+false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
+k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
+scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
+1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
+"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
+c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
+else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
+a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
+c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
+a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
+colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
+1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
+l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
+"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
+if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
+a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
+attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
+b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
+c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
+arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
+d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
+c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
+w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
+8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
+"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
+d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
+Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
+c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
+var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
+"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
+xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
+B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
+"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
+0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
+a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
+1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
+"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
+c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
+(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
+[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
+break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
+q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
+l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
+return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
+B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
+POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
+i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
+i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
+"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
+m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
+true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
+g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
+0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
+"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
+i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
+if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
+g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
+for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
+i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
+n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
+function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
+p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
+t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
+function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
+c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
+not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
+h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
+c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
+2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
+b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
+e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
+"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
+else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
+c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
+b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
+this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
+prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
+b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
+1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
+d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
+jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
+zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
+h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
+if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
+d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
+e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
+"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
+!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
+getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
+script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
+!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
+false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
+A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
+b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
+c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
+c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
+encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
+[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
+e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
+if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
+3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
+d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
+d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
+"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
+1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
+d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
+Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
+var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
+this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
+this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
+c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
+b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
+h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
+for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
+parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
+height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
+f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
+"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
+e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
+c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
+c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
+b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
Index: main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/gberg/transform/about-clientside.xsl
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/gberg/transform/about-clientside.xsl	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/gberg/transform/about-clientside.xsl	(revision 24007)
@@ -0,0 +1,142 @@
+<?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">
+
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+
+  <xsl:output method="html"/>  
+  
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <xsl:choose> 
+      <!-- if we are using the classic GS2 look and feel use this template otherwise use the default GS3 look and feel template -->
+      <xsl:when test="$interface_name = 'gs2'">
+	<html>
+	  <head>
+	    <title>
+	      <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+	      <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	    </title>
+	    <xsl:call-template name="globalStyle"/>
+	    <xsl:call-template name="pageStyle"/>
+	  </head>
+	  <body>
+	    <div id="page-wrapper">
+	      <xsl:apply-templates select="pageResponse"/>
+	      <xsl:call-template name="greenstoneFooter"/>                	   
+	    </div>
+	  </body>
+	</html>
+      </xsl:when>
+      <!-- default gs3 mode -->
+      <xsl:otherwise> 
+	<html>
+	  <head>
+	    <title>
+	      <gslib:aboutCollectionPageTitle/>
+	    </title>
+	    <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
+	  </head>
+	  
+	  <body><gslib:textDirectionAttribute/>
+
+	    <div id="page-wrapper">
+	      <gslib:displayErrorsIfAny/>
+
+	      <div id="banner">    
+		<p>
+		  <gslib:collectionHomeLinkWithLogoIfAvailable/>
+		</p>
+		<ul id="bannerlist"> 
+		  <li><gslib:homeButtonTop/></li>
+		  <li><gslib:helpButtonTop/></li>
+		  <li><gslib:preferencesButtonTop/></li>
+		</ul>
+	      </div>
+	      
+	      <!--If some services are available for the current collection display the navigation bar-->
+	      <xsl:choose>
+		<xsl:when test="$this-element/serviceList/service">
+		  <div id="navbar">
+		    <ul id="navbarlist">
+		      <gslib:servicesNavigationBar/>
+		    </ul>
+		  </div> 
+		</xsl:when>
+		<!--Otherwise simply display a blank divider bar-->
+		<xsl:otherwise>
+		  <div class="divbar"><gslib:noTextBar/></div>          
+		</xsl:otherwise>
+	      </xsl:choose>
+	      
+	      <div id="content"> 
+		<!--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.-->
+		<gslib:collectionDescriptionTextAndServicesLinks/>
+	      </div>
+
+	      <div id="footer">
+		<div class="divbar"><gslib:poweredByGS3TextBar/></div>
+	      </div>
+	    </div>
+		
+		<span id="language" style="display: none;"><xsl:value-of select="/page/@lang" /></span>
+      	<span id="interface" style="display: none;"><xsl:value-of select="$interface_name" /></span>
+      	
+		<script type="text/javascript"><xsl:text>var placeholder = false;</xsl:text></script>
+		<script type="text/javascript" src="jquery.js"><xsl:comment>jQuery</xsl:comment></script>
+		<script type="text/javascript" src="test.js"><xsl:comment>Client side transforms</xsl:comment></script>
+	  </body>
+	</html>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+   
+
+
+
+  <xsl:template name="pageTitle">
+    Sample XML Texts Collection
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:apply-templates select="collection"/>
+  </xsl:template>
+
+  <!-- this is for gs2 mode -->
+  <xsl:template match="collection" priority="5">
+    <xsl:if test="$interface_name = 'gs2'">
+    <xsl:variable name="collName" select="@name"/>
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="pageType">about</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>   
+    </xsl:if>   
+    <p/><xsl:value-of select="displayItem[@name='description']" disable-output-escaping='yes'/>
+    <p/><xsl:apply-templates select="documentList">
+      <xsl:with-param name="collName" select="@name"/>
+    </xsl:apply-templates>
+  </xsl:template>
+  
+  <xsl:template match="documentList">
+    <xsl:param name="collName"/>
+    <ul>
+      <xsl:for-each select="document">
+	<li><a href="{$library_name}?a=xd&amp;sa=toc&amp;sc=full&amp;c={$collName}&amp;d={@name}"><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></li>
+      </xsl:for-each>
+    </ul>
+  </xsl:template>
+</xsl:stylesheet>
Index: main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/lucene-jdbm-demo/etc/collectionConfig.xml
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/lucene-jdbm-demo/etc/collectionConfig.xml	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/lucene-jdbm-demo/etc/collectionConfig.xml	(revision 24007)
@@ -0,0 +1,85 @@
+<?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 lang="en" name="maintainer"/>
+        <metadata lang="en" name="public">true</metadata>
+    </metadataList>
+    <displayItemList>
+        <displayItem assigned="true" lang="en" name="description">This is a demonstration collection for the Greenstone3 digital library software. It contains a small subset (11 books) of the Humanitarian and Development Libraries. It is the Greenstone 3 equivalent of the Greenstone 2 demo collection, built with Lucene for indexing and JDBM as the database for metadata.</displayItem>
+        <displayItem assigned="true" lang="en" name="name">Lucene/JDBM demo</displayItem>
+    </displayItemList>
+    <search type="lucene">
+        <level name="section">
+            <displayItem lang="en" name="name">chapter</displayItem>
+        </level>
+        <level name="document">
+            <displayItem lang="en" name="name">book</displayItem>
+        </level>
+        <defaultLevel name="section"/>
+        <index name="allfields">
+            <displayItem lang="en" name="name">all fields</displayItem>
+        </index>
+        <index name="text">
+            <displayItem lang="en" name="name">text</displayItem>
+        </index>
+        <index name="dls.Title,Title">
+            <displayItem lang="en" name="name">titles</displayItem>
+        </index>
+        <index name="dls.Subject">
+            <displayItem lang="en" name="name">subjects</displayItem>
+        </index>
+        <index name="dls.Organization">
+            <displayItem lang="en" name="name">organisations</displayItem>
+        </index>
+        <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="jdbm"/>
+    <import>
+        <pluginList>
+            <plugin name="GreenstoneXMLPlugin"/>
+            <plugin name="HTMLPlugin">
+                <option name="-description_tags"/>
+            </plugin>
+            <plugin name="MetadataXMLPlugin"/>
+            <plugin name="ArchivesInfPlugin"/>
+            <plugin name="DirectoryPlugin"/>
+        </pluginList>
+    </import>
+    <browse>
+        <classifier name="List">
+            <option name="-metadata" value="dls.Title"/>
+            <option name="-partition_type_within_level" value="constant_size"/>
+        </classifier>
+        <classifier name="Hierarchy">
+            <option name="-metadata" value="dls.Subject"/>
+            <option name="-sort" value="dls.Title"/>
+        </classifier>
+        <classifier name="List">
+            <option name="-metadata" value="dls.Organization"/>
+            <option name="-sort_leaf_nodes_using" value="dls.Title"/>
+            <option name="-partition_type_within_level" value="constant_size"/>
+            <option name="-bookshelf_type" value="always"/>
+            <option name="-buttonname" value="Organization"/>
+        </classifier>
+        <classifier name="List">
+            <option name="-metadata" value="dls.Keyword"/>
+            <option name="-buttonname" value="Howto"/>
+            <option name="-partition_type_within_level" value="constant_size"/>
+            <format><gsf:template match="documentNode"><td><gsf:link type="document"><gsf:metadata name="dls.Keyword"/></gsf:link></td></gsf:template><gsf:template match="classifierNode"><td><gsf:link type="classifier"><gsf:metadata name="Title"/></gsf:link></td></gsf:template></format>
+        </classifier>
+        <format><gsf:template match="documentNode"><td valign="top"><gsf:link type="document"><gsf:icon type="document"/></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"><td valign="top"><gsf:link type="classifier"><gsf:icon type="classifier"/></gsf:link></td><td><gsf:metadata name="Title"/></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="TOC" value="true"/></format>
+    </display>
+    <replaceListRef id="gs2-standard"/>
+</CollectionConfig>
Index: main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/lucene-jdbm-demo/lucene-jdbm-demo.col
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/lucene-jdbm-demo/lucene-jdbm-demo.col	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/sites/localsite/collect/lucene-jdbm-demo/lucene-jdbm-demo.col	(revision 24007)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE GathererCollection [
+  <!ELEMENT GathererCollection (Argument*, GathererConfig, BuildConfig)>
+  <!ELEMENT GathererConfig    (Arguments*)>
+  <!ELEMENT BuildConfig       (Build, Import)>
+  <!ELEMENT Build             (Arguments*)>
+  <!ELEMENT Import            (Arguments*)>
+  <!ELEMENT Argument          (#PCDATA)>
+  <!ATTLIST Argument
+            name              CDATA #REQUIRED
+				enabled           CDATA "true">
+]>
+<GathererCollection>
+    <Argument name="built">false</Argument>
+    <Argument name="imported">false</Argument>
+    <GathererConfig/>
+    <BuildConfig>
+        <Build>
+            <Argument enabled="false" name="sections_index_document_metadata">never</Argument>
+            <Argument enabled="false" name="faillog"/>
+            <Argument enabled="false" name="index"/>
+            <Argument enabled="false" name="language"/>
+            <Argument enabled="false" name="maxnumeric">4</Argument>
+            <Argument enabled="false" name="mode">all</Argument>
+            <Argument enabled="false" name="verbosity">0</Argument>
+        </Build>
+        <Import>
+            <Argument enabled="false" name="maxdocs">1</Argument>
+            <Argument enabled="false" name="OIDtype">hash</Argument>
+            <Argument enabled="false" name="OIDmetadata"/>
+            <Argument enabled="false" name="sortmeta"/>
+            <Argument enabled="false" name="groupsize">1</Argument>
+            <Argument enabled="false" name="saveas">GreenstoneXML</Argument>
+            <Argument enabled="false" name="faillog"/>
+            <Argument enabled="false" name="removeprefix"/>
+            <Argument enabled="false" name="removesuffix"/>
+            <Argument enabled="false" name="verbosity">0</Argument>
+        </Import>
+    </BuildConfig>
+</GathererCollection>
Index: main/branches/64_bit_Greenstone/greenstone3/web/test.js
===================================================================
--- main/branches/64_bit_Greenstone/greenstone3/web/test.js	(revision 24007)
+++ main/branches/64_bit_Greenstone/greenstone3/web/test.js	(revision 24007)
@@ -0,0 +1,521 @@
+/*
+
+Greenstone 3 'Client-side transformer'
+Performs client-side transformations of XSLT, using HTML5 local storage (simulated if the browser doesn't support it).
+
+Currently only supports Firefox 3 and greater, since it's the only browser (at the time of writing) that can do this properly.
+
+@author		Steven McTainsh
+@date		14/02/2011
+
+*/
+
+/* These URLs and file paths are fetched dynamically */
+var gsweb = ""; // The file path to the Greenstone 3 web directory
+var gsurl = ""; // The root URL for this Greenstone 3 installation
+
+/* Misc. switches and paths */
+var keyUrl = ''; // Used across methods to build up query string for text retrieval (client-side transformed version)
+var on = true; // Set to false to disable operation
+
+var index = 0; // Used for query array (to keep track of number of elements)
+var deferredEls = new Array(); // Elements to defer text retrieval for until later
+var queryArr = new Array(); // Text to query for (the text for the corresponding deferred element)
+
+/* Methods */
+// This is generally only called from in-line JS in the head (i.e. var text = getText(...);)
+function getText(key, el) {
+	if(localStorage.getItem(key) != null)
+		return localStorage.getItem(key);
+	else {
+		push(deferredEls, el);
+		queryArr[el] = key; // Have it queried for too
+		return "";
+	}
+}
+
+function processEl(el, attr, key, append, isText, theText) {	
+	// Assumes all necessary text has been loaded from the servlet
+	var displayText = (isText) ? theText : localStorage.getItem(key);
+			
+	if(el == document && attr == 'title') {
+		// Handle document titles
+		if(append)
+			document.title += displayText;
+		else
+			document.title = displayText;
+	} else if(attr == 'innerText') {
+		// Handle element 'inner text'
+		if(append)
+			$(el).html($(el).html() + displayText);
+		else
+			$(el).html(displayText);	
+	} else if(attr == 'value') {
+		// Handle value attribute
+		if(append)
+			$(el).val($el.val() + displayText);
+		else
+			$(el).val(displayText);						
+	} else {
+		// All other cases (generic attributes)
+		if(append)
+			$(el).attr(attr, $(el).attr(attr) + displayText);
+		else
+			$(el).attr(attr, displayText);
+	}		
+}	
+
+function notSupported() {
+	// Set not supported cookie here
+	document.cookie = 'supportsXSLT=false; expires=0; path=/';
+	// Fall back to server version
+	var location = window.location.search.substring(1);
+	if(location == '') {
+		// Start with a question mark
+		location = window.location + "?o=server";
+	} else {
+		// Start with an ampersand
+		location = window.location + "&o=server";
+	}		
+	window.location = location;
+}
+
+$(document).ready(function() {	
+	if(on && isSupported()) {		
+		if(placeholder) {
+			// Need to prepare page placeholders
+			transform(false);
+		}
+		else {
+			// Need to place text into the page (placeholders ready)
+			applyText(false);
+		}
+	}
+});
+
+function applyText(trial) {
+
+	try {
+	// Wait for document to be ready before propogating this URL (otherwise undefined)
+	keyUrl = 'grabtext?i='+$('#interface').html()+'&l='+$('#language').html()+'&k='	
+	
+	// First, see if the local storage should be emptied for a new language...
+	if(localStorage.getItem("_activeLanguage") != $('#language').html()) {
+	   // Languages are different, clear existing strings
+	   localStorage.clear();
+	   localStorage.setItem("_activeLanguage", $('#language').html());
+	}
+	
+	$('#loading').show();
+
+	var query = '';
+
+	$('.getTextFor').each(function() {
+
+		// Build up query
+		// Get the three parts to the class - 'getTextFor' 'element inner text to affect' 'attributes to affect'
+		// Proper splitting on spaces
+		var parts = parseAction($(this).attr('class'), ' ')
+		// parts[1] is this element's innerText key, parts[2] may or may not contain keys
+		// Can add null to the array
+		if(!contains(queryArr, parts[1]) && localStorage.getItem(parts[1]) == null)
+			// If the key has not already been queried for and is not in local storage...
+			// NO duplicates!
+			queryArr[index++] = parts[1];
+		
+		if(parts.length == 3 && parts[2] != '') {
+			var affected = parts[2].split(',');
+		
+			for(var j = 0; j < affected.length; j++) {
+				var els = parseAction(affected[j], ".");
+				// els[2] will contain key
+				// Ignore text, and those elements with text already in local storage and that will already be queried for
+				if(els[2].indexOf('text:') != 0 && !contains(queryArr, els[2]) && localStorage.getItem(els[2]) == null)
+					queryArr[index++] = els[2].replace("[a]", "");
+			}
+		}
+	});
+	
+	query = queryArr.join(",");
+
+	// Fetch!
+	if(query != '') { // There is something to query for
+	
+	$.get(keyUrl + query, function(data) {
+
+		// Process dictionary, load into local storage
+		$(data).find("item").each(function() {
+			localStorage.setItem($(this).attr('key'), $(this).attr('value'));
+		});
+		
+		assignText();
+	
+	}, 'xml');	
+	
+	} else { assignText(trial); }
+	} catch (e) { if(trial) notSupportedCookie(); else notSupported(); }
+}
+
+function assignText(trial) {
+
+try {
+$('.getTextFor').each(function() { 
+
+	var parts = parseAction($(this).attr('class'), " ");
+	var me = parts[1];
+
+	// Process it's own inner text first
+	processEl($(this), 'innerText', me);
+
+	if(parts.length >= 3 && parts[2] != '') { // Otherwise 'x y ' mucks it up
+
+		// Affecting elements are listed
+		var affectees = parts[2];	
+
+		var all = affectees.split(',');
+
+		for(var i = 0; i < all.length; i++) {
+			var parts = parseAction(all[i], ".");			
+		
+			var append = false;
+			var isText = false;
+			var theText = '';
+
+			if(parts[2].indexOf("[a]") != -1) {
+				parts[2] = parts[2].replace("[a]", "");
+				append = true;
+			}
+			
+			if(parts[2].indexOf("text:'") != -1) {
+				// This action is plain text
+				isText = true;
+				theText = parts[2].substring(6, parts[2].length - 1);
+			}
+
+			if(parts[0] == 'parent') {
+				// Affects the parent
+				processEl($(this).parent(), parts[1], parts[2], append, isText, theText);
+			} else if(parts[0] == 'this') {
+				// Affects this element	
+				processEl($(this), parts[1], parts[2], append, isText, theText);
+			} else if(parts[0] == 'document') {
+				// Affects document itself
+				processEl(document, parts[1], parts[2], append, isText, theText);
+			}
+
+			
+		}
+	}	
+	
+	// Process deferred elements now
+	for(var def in deferredEls) {
+		$(def).html(localStorage[deferredEls[def]]); //dict[deferredEls[def]]);
+	}
+
+});
+
+var xsltClientCapable = document.cookie.indexOf('supportsXSLT') != -1;
+
+// At this point, the browser has proven itself capable of XSL transformations
+// So, modify all document links into JavaScript links that use AJAX to get content
+if(xsltClientCapable) {
+    // Could set cookie here too?
+    $('.clientDocView').each(function() {
+         var link = $(this).attr('href');
+         var startIndex = link.indexOf("&amp;d=");
+         var endIndex = link.indexOf('&amp;', startIndex + 7);
+         // If the endIndex == -1, end not found; just use end index
+         endIndex = (endIndex == -1) ? link.length : endIndex;
+         var docID = link.substring(startIndex, endIndex);
+         docID = docID.replace("&amp;d=", "");
+         $(this).attr('id', docID);
+         $(this).attr('onclick', "getNodeContent(this); return false;"); // .bind doesn't work for dynamically added HTML!
+         
+         if(typeof initialHash != 'undefined') // Prevent errors when searching
+         if(docID == initialHash) {
+            // Load it!
+            getNodeContent($(this).get()[0]); // Talk about round the houses! This was the only way that produced something!
+         }
+    });
+	
+	document.cookie = 'supportsXSLT=true; expires=0; path=/';
+}
+
+// Also undo escaping of necessary entities
+$('body').each(function() {
+	
+	var text = $(this).html();
+	text = text.replace(/&lt;/g, "<");
+	text = text.replace(/&gt;/g, ">");
+	text = text.replace(/&amp;/g, "&");
+	$(this).html(text);
+	
+});
+
+// Remove dead elements
+$('[xmlns]').each(function() {
+     if($(this).get(0).tagName.toLowerCase() != "html") {
+         // use toLower() in case of browser inconsistencies
+         $(this).hide();
+     }
+});
+
+//alert('Language is: ' + $('#language').html() + ', interface is: ' + $('#interface').html());
+
+$('#loading').fadeOut();
+
+} catch (e) { if(trial) notSupportedCookie(); else notSupported(); }
+
+}
+
+function transform(trial) {
+
+	try {
+	var queryStr = window.location.search.substring(1);
+	var rooturl = window.location;
+	//var absolute = gsurl;
+	var lead = queryStr == '' ? '?' : '&';
+	var skinurl = rooturl+lead+"o=skinandlibdoc";
+	var xmlurl = rooturl+lead+"o=xml";
+	
+	var skindoc = "";
+	var xmldoc = "";	
+	
+	$.get(rooturl + lead + "o=clientside", function(data) {
+		
+		data = data.replace(/gs3:id/g, "gs3id");
+		data = parseFromString(data, "text/xml");
+		
+		// data contains the XML and the stylesheet too!
+		var skindoc = $(data).find("xslt\\:stylesheet")[0];
+		var xmldoc = $(data).find("page")[0];
+		
+		gsurl = $($(xmldoc).find("metadata[name=siteURL]")[0]).text();
+		gsweb = new RegExp($($(xmldoc).find("param[name=filepath]")[0]).text().replace(/\\/g, "\\\\"), "g");
+		
+		// Find xsl:include elements and update hrefs accordingly
+		$(skindoc).find("xsl\\:include").each(function() {
+			$(this).attr('href', $(this).attr('href').replace(gsweb, gsurl).replace(/\\/g, "/"));
+		});
+		
+		$(xmldoc).find("xsl\\:include").each(function() {
+			$(this).attr('href', $(this).attr('href').replace(gsweb, gsurl).replace(/\\/g, "/"));
+		});
+		
+		// Convert temporarily to text here		
+		skindoc = convertToString(skindoc);
+		xmldoc = convertToString(xmldoc);
+		
+		// This could just be done on the server (later)
+		//data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" /*+ "<?xml-stylesheet type=\"text/xsl\" href=\"" + skinurl + "\"?>\r\n"*/ + data;
+		// replace all!
+		// Be careful with regex syntax and the use of special characters!
+		skindoc = skindoc.replace(/util\:exists\(\$meta, ''\)/g, "$meta!=''"); // For now - use regex instead
+		skindoc = skindoc.replace(/%3A/g, ":"); // undo colon escaping
+		
+		// Convert to XML
+		xmldoc = parseFromString(xmldoc, "text/xml");			
+			skindoc = parseFromString(skindoc, "text/xml");
+			
+			var output = '';
+			var library_name = $('/page/xsltparams/param[name=library_name]', xmldoc).text();
+			var interface_name = $('/page/xsltparams/param[name=interface_name]', xmldoc).text();
+			
+			// And post-process...			
+			if(window.ActiveXObject) {
+				// IE
+				var procFactory = new ActiveXObject("MSXML2.XSLTemplate");
+				procFactory.stylesheet = skindoc;
+				var proc = procFactory.createProcessor();
+				proc.input = xmldoc;
+				
+				proc.addParameter('library_name', library_name);
+				proc.addParameter('interface_name', interface_name);
+				
+				proc.transform();
+				output = proc.output;
+			} else {			
+				// Fx
+				xsltProc = new XSLTProcessor();
+				// The leading slash is oh-so important here
+				xsltProc.setParameter(null, 'library_name', library_name);
+				xsltProc.setParameter(null, 'interface_name', interface_name);
+				xsltProc.importStylesheet(skindoc);
+				result = xsltProc.transformToDocument(xmldoc);
+				output = (new XMLSerializer()).serializeToString(result);
+			}
+			
+			//output = output.replace('var placeholder = false;', 'var placeholder = false; var xsltClientCapable = true;');
+			
+			var doc = document.open();
+			doc.write(output);
+			doc.close();
+			
+			document.cookie = 'supportsXSLT=true; expires=0; path=/';
+		
+	}, 'html');
+	} catch (e) { if(trial) notSupportedCookie(); else notSupported(); }
+}
+
+function notSupportedCookie() {
+	document.cookie = 'supportsXSLT=false; expires=0; path=/';
+}
+
+function getNodeContent(node) {
+    var hash = $(node).attr('id');
+	
+	// Some document titles appear within spans, some do not, so these adjustments are necessary
+	$('.clientDocView').next().css('font-weight', 'normal');
+	$('.clientDocView').parent().css('font-weight', 'normal');
+	$(node).parent().css('font-weight', 'bold');
+	$(node).next().css('font-weight', 'bold');
+	
+	var loadingimg = '<img src="interfaces/default/images/loading.gif" alt="Loading" />';
+	
+	// Fetch me some fresh XML
+	$('.documenttext').html(loadingimg);
+	var url = $(node).attr('href') + "&o=xml";
+	url = url.replace('&amp;', '&');
+	$.get(url, function(data) {
+	
+	   gsurl = $($(data).find("metadata[name=siteURL]")[0]).text();
+	
+	   $.get(gsurl + '/interfaces/default/transform/document_text.xsl', function(text) {
+	   
+	   var output = '';
+	   var result = '';
+	
+	   try {
+	       // FF only
+	       xsltProc = new XSLTProcessor();
+			// The leading slash is oh-so important here
+			xsltProc.setParameter(null, 'library_name', $('/page/xsltparams/param[name=library_name]', data).text());
+			xsltProc.setParameter(null, 'interface_name', $('/page/xsltparams/param[name=interface_name]', data).text());
+			xsltProc.importStylesheet(text);
+			result = xsltProc.transformToDocument(data);
+			output = (new XMLSerializer()).serializeToString(result);
+	   } catch(e) { window.location = $(node).attr('href'); } // will naturally cascade to client-side, then if necessary, server-side
+	   
+	       // Get the book name
+	       var book = $('#documentheading').text();
+	       var title_arr = new Array();
+	       var temp_arr = new Array();
+	       
+	       title_arr.push(book);
+	       
+	       // Go up the tree, until you reach the 'Table of Contents' node
+	       $(node).parentsUntil('#tocstart').each(function() {
+	           if($(this).get()[0].tagName == 'LI') {
+	               // Only list elements...
+	               // next child = a, next sibling = text node
+	               temp_arr.push($(this).children('span').text());
+	           }
+	       });
+	       
+	       // Store these temporarily to reverse them and get it right
+	       temp_arr = temp_arr.reverse();
+	       title_arr = title_arr.concat(temp_arr);
+	       document.title = title_arr.join('::');
+	   
+	       // Fix up entity encoding first
+           output = output.replace(/&amp;/g, '&');
+           output = output.replace(/&lt;/g, '<');
+           output = output.replace(/&gt;/g, '>');
+	   	   $('.documenttext').html(output);
+	   
+	   }, 'xml');
+	   
+	}, 'xml');
+}
+
+function parseAction(str, chr) {
+
+	// Problem with split - seems to discard the rest of string if it encounters splitable characters but doesn't split on them
+	// But, then all the split characters are missing from the array! So, need to slice the substring out.
+	// Get additional text
+	var parts = str.split(chr, 3);				
+
+	var trimIndex = parts[0].length + parts[1].length + 2;
+	parts[2] = str.substring(trimIndex);
+	
+	return parts;
+
+}
+
+// Method equivalent to PHP's in_array method
+function contains(array, value) {
+
+	for(var val in array)
+		if(array[val] == value)
+			return true;
+	
+	return false;
+}
+
+// Method equivalent to PHP's own
+function print_r(arr) {
+	
+	var result = "";
+	
+	for(var a in arr) {
+		result += a + " => " + arr[a] + "\r\n";
+	}
+	
+	return result;
+}
+
+function convertToString(content) {
+	try {
+		// If this fails, it's another indication that the browser doesn't have the support we need
+		if(typeof XMLSerializer != 'undefined') {
+			return (new XMLSerializer()).serializeToString(content);
+		} else {
+			return content.xml;
+		}		
+	} catch (e) { notSupported(); }
+}
+
+function parseFromString(content, contentType) {
+	 try {
+		var retobj;
+		
+		if(typeof window.DOMParser != 'undefined') {
+			// Fx
+			retobj = (new DOMParser()).parseFromString(content, contentType);
+		} else {
+			// IE
+			var retobj = new ActiveXObject("Microsoft.XMLDOM");
+			retobj.async = "false";
+			retobj.loadXML(content);
+		}
+		
+	 	return retobj;
+	 } catch(e) { var obj = new ActiveXObject('MSXML.DomDocument'); obj.async = false; obj.loadXML(content); return obj; }
+}
+
+function isSupported() {
+	// Are cookies enabled?
+	if(navigator.cookieEnabled && typeof navigator.cookieEnabled != 'undefined') {	
+		// Is there a cookie?
+		if(document.cookie.indexOf('supportsXSLT=') > -1) {
+			// Cookie exists - don't try the transformation, as the server will
+			// read the cookie and determine which version to serve up.
+			// If it happens to be client-side, allow transformation to proceed
+			return (document.cookie.indexOf('supportsXSLT=true') > -1);
+		} else {
+			// Cookie doesn't exist - test!
+			transform(true);
+			applyText(true);
+			return (document.cookie.indexOf('supportsXSLT=true') > -1);
+		}
+	} else {
+		return false;
+	}
+}
+
+/* Simulating web storage for browsers that don't support it */
+/* Credit: http://www.thewojogroup.com/2010/01/simulating-html5-local-storage/ */
+(function(){var k=this;if(!k.localStorage&&navigator.cookieEnabled){var x="storageData_",y="++",z="::",l=function(a,c,b){var e=new Date;e.setTime(e.getTime()+b);b="; expires="+e.toGMTString();document.cookie=a+"="+c+b+"; path=/"},h=function(a){a=a+"=";for(var c=document.cookie.split(";"),b=0,e=c.length;b<e;b++){for(var d=c[b];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)===0)return d.substring(a.length,d.length)}return null},m=function(a){l(a,"",-1)},i=function(){for(var a="",c=0;h(y+c)!==null;)a+=h(y+
+c++);return a==""?[]:a.split(y)},n=function(a){for(var c=Math.ceil(a.length/4E3),b=0;b<c||h(y+b)!==null;){b<c?l(y+b,a.substr(b*4E3,(b+1)*4E3>a.length?a.length-b*4E3:4E3),2592E3):m(y+b);b++}},f=k.localStorage={length:0,setItem:function(a,c){var b=i(),e=0,d=b.length,g=false;for(e=0;e<d;e++){var j=b[e].split(z);if(j[0]==a){j[1]=c;g=true;b[e]=j.join(z);e=d}}if(!g){b.push(a+z+c.replace(/::/g,": :").replace(/\+\+/g,"+ +"));this.a.push(a);this.length++}n(b.join(y))},
+getItem:function(a){var c=i(),b=0,e=c.length;for(b=0;b<e;b++){var d=c[b].split(z);if(d[0]==a&&d[1])return d[1]}return null},removeItem:function(a){var c=i(),b=0,e=c.length,d=false,g=[];for(b=0;b<e;b++)if(c[b].split(z)[0]!=a)g.push(c[b]);else d=true;if(d){n(g.join(y));o()}},clear:function(){for(var a=0;h(y+a)!==null;)m(y+a++);this.a=[];this.length=0},key:function(a){return a<this.length?this.a[a]:null},a:[]},o=function(){f.a=i();for(var a=0;f.a[a];)f.a[a]=f.a[a++].split(z)[0];
+f.length=f.a.length};o()}})();
