Index: main/trunk/model-cols/niupepa/resources/niupepa.properties
===================================================================
--- main/trunk/model-cols/niupepa/resources/niupepa.properties	(revision 26408)
+++ main/trunk/model-cols/niupepa/resources/niupepa.properties	(revision 26409)
@@ -17,31 +17,5 @@
 
 simple.query=Search {0-subcolllist} for {1-some/all} of the words {2-query box}
-
-about.languageswap=<div style="text-align:right;"><small><a id="replaceLink" title="View the collection in Māori">Māori</a></small></div>\
-<script type="text/javascript">\
-	<xsl:text disable-output-escaping="yes">\
-		$(window).ready(function()\
-		{\
-			var url = document.URL;\
-			if(url.indexOf("?") != -1)\
-			{\
-				if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)\
-				{\
-					url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1l=mi");\
-					$("#replaceLink").attr("href", url);\
-				}\
-				else\
-				{\
-					$("#replaceLink").attr("href", url + "&amp;l=mi");\
-				}\
-			}\
-			else\
-			{\
-				$("#replaceLink").attr("href", url + "?l=mi");\
-			}\
-		});\
-	</xsl:text>\
-</script>
-
+about.changelangtofrommaori=View the collection in Māori
 about.textxwelcome=<h2>Welcome to the Māori Niupepa Collection</h2>
 about.textxwelcome2=<p>Here we have a collection of historic newspapers published primarily for a Māori audience between 1842 and 1932. The newspapers can be <gsf:link type="query"><b>searched</b></gsf:link> (full text), <gsf:link type="classifier" nodeID="CL1"><b>browsed</b></gsf:link> (by series) or accessed by <gsf:link type="classifier" nodeID="CL2"><b>date</b></gsf:link>. This collection has been made available by the <a href="http://www.nzdl.org">New Zealand Digital Library Project</a>, at the <a href="http://www.cs.waikato.ac.nz/cs/">Department of Computer Science</a>, <a href="http://www.waikato.ac.nz">University of Waikato</a>.</p>
Index: main/trunk/model-cols/niupepa/resources/niupepa_mi.properties
===================================================================
--- main/trunk/model-cols/niupepa/resources/niupepa_mi.properties	(revision 26408)
+++ main/trunk/model-cols/niupepa/resources/niupepa_mi.properties	(revision 26409)
@@ -16,31 +16,5 @@
 
 simple.query=Tirohia ki {0-subcolllist} mÅ {1-some/all} o ngÄ kupu {2-query box}
-
-about.languageswap=<div style="text-align:right;"><small><a id="replaceLink" title="View the collection in English">English</a></small></div>\
-<script type="text/javascript">\
-	<xsl:text disable-output-escaping="yes">\
-		$(window).ready(function()\
-		{\
-			var url = document.URL;\
-			if(url.indexOf("?") != -1)\
-			{\
-				if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)\
-				{\
-					url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1l=en");\
-					$("#replaceLink").attr("href", url);\
-				}\
-				else\
-				{\
-					$("#replaceLink").attr("href", url + "&amp;l=en");\
-				}\
-			}\
-			else\
-			{\
-				$("#replaceLink").attr("href", url + "?l=en");\
-			}\
-		});\
-	</xsl:text>\
-</script>
-
+about.changelangtofrommaori=View the collection in English
 about.textxwelcome=<h2>Nau mai ki te Kohikohinga Niupepa MÄori</h2>
 about.textxwelcome2=<p>Kua whakaemitia mai ki konei he kohikohinga niupepa i tÄngia mÅ ngÄ kaipÄnui MÄori o ngÄ tau 1842-1932. E taea te pÄnui niupepa mÄ te <gsf:link type="query">rapu kupu</gsf:link>, i te <gsf:link type="classifier" nodeID="CL1">rÄrangi taitara</gsf:link>, me te rÄrangi <gsf:link type="classifier" nodeID="CL2">wÄtaka</gsf:link> hoki. He mea i whakatÅ«ria e te kaupapa <a href="http://www.nzdl.org">New Zealand Digital Library</a>, i te <a href="http://www.cs.waikato.ac.nz/cs/">Tari Rorohiko</a>, o te <a href="http://www.waikato.ac.nz">Whare WÄnanga o Waikato</a>.</p>
Index: main/trunk/model-cols/niupepa/transform/pages/about.xsl
===================================================================
--- main/trunk/model-cols/niupepa/transform/pages/about.xsl	(revision 26408)
+++ main/trunk/model-cols/niupepa/transform/pages/about.xsl	(revision 26409)
@@ -20,5 +20,5 @@
 	<!-- the page content -->
 	<xsl:template match="/page">
-		<gsf:collectionText name="about.languageswap"/>
+		<xsl:call-template name="languageswap"/>
 		<gsf:collectionText name="about.textxwelcome"/>
 		<gsf:collectionText name="about.textxwelcome2"/>
@@ -38,4 +38,35 @@
 		<gsf:collectionText name="about.textxsupporgs2"/>
 	</xsl:template> 
+
+<xsl:template name="languageswap">
+    <xsl:variable name="swaplangname"><xsl:choose><xsl:when test="/page/@lang = 'mi'">English</xsl:when><xsl:otherwise>MÄori</xsl:otherwise></xsl:choose></xsl:variable>
+<div style="text-align:right;"><small><a id="replaceLink"><xsl:attribute name="title"><gsf:collectionText name="about.changelangtofrommaori"/></xsl:attribute><xsl:value-of select="$swaplangname"/></a></small></div>
+    <xsl:variable name="langcgiarg"><xsl:choose><xsl:when test="/page/@lang = 'mi'">l=en</xsl:when><xsl:otherwise>l=mi</xsl:otherwise></xsl:choose></xsl:variable>
+<script type="text/javascript">
+	<xsl:text disable-output-escaping="yes">
+		$(window).ready(function()
+		{
+			var url = document.URL;
+			if(url.indexOf("?") != -1)
+			{
+				if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)
+				{
+					url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
+					$("#replaceLink").attr("href", url);
+				}
+				else
+				{
+					$("#replaceLink").attr("href", url + "&amp;</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
+				}
+			}
+			else
+			{
+				$("#replaceLink").attr("href", url + "?</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
+			}
+		});
+	</xsl:text>
+</script>
+
+</xsl:template>
 </xsl:stylesheet>  
 
