Index: main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl	(revision 32371)
+++ main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl	(revision 32372)
@@ -11,6 +11,11 @@
 	<xsl:import href="layouts/main.xsl"/>
 	<xsl:output method="html"/>
-	
-	<!-- set page title -->
+
+	<!-- add recaptcha js to the head -->
+  <xsl:template name="additionalHeaderContent-page">
+    <script src='https://www.google.com/recaptcha/api.js'><xsl:text> </xsl:text></script>
+  </xsl:template>
+
+  <!-- set page title -->
 	<xsl:template name="pageTitle">
 		<xsl:choose>
@@ -200,5 +205,5 @@
 								<xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
 									<tr>										
-										<xsl:if test="not(/page/pageResponse/error/@type = 'Incorrect Password')">
+										<xsl:if test="not(/page/pageResponse/error/@type = 'INCORRECT_PASSWORD')">
 											<td><button id="changePasswordButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/>...</button></td>
 											<script type="text/javascript">
@@ -236,5 +241,5 @@
 									
 									<xsl:choose>
-										<xsl:when test="not(/page/pageResponse/error/@type = 'Incorrect Password')">
+										<xsl:when test="not(/page/pageResponse/error/@type = 'INCORRECT_PASSWORD')">
 											<tr>
 												<td id="oldPasswordLabelCell"><xsl:text> </xsl:text></td>
@@ -372,5 +377,5 @@
 				<xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser' or /page/pageResponse/authenticationNode/service/@operation = 'Register'">
 					<div id="errorArea"><xsl:text> </xsl:text></div>
-					<form method="POST">
+					<form method="POST" id="registerForm">
 						<xsl:attribute name="action">
 							<xsl:choose>
@@ -464,55 +469,21 @@
 								</tr>
 							</xsl:if>
-							<xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'Register' and /page/pageResponse/recaptcha/@privateKey and /page/pageResponse/recaptcha/@publicKey">
-								<tr>
-									<td colspan="2" id="recaptchaArea">
-										<xsl:value-of disable-output-escaping="yes" select="util:reCAPTCHAimage(/page/pageResponse/recaptcha/@publicKey, /page/pageResponse/recaptcha/@privateKey)"/>
-									</td>
-									<script type="text/javascript">
-										<xsl:text disable-output-escaping="yes">
-											function changeParams()
-											{
-												$("#recaptcha_challenge_field").attr("name", "s1.recaptcha_challenge_field");
-												$("#recaptcha_response_field").attr("name", "s1.recaptcha_response_field");
-											}
-											$(window).load(changeParams);
-											
-											function checkreCaptchaError()
-											{
-												var html = $("#recaptchaArea").html();
-												if(html.search(/Invalid referer/g) != -1)
-												{
-													$("#recaptchaArea").html("");
-													$("#errorArea").html("The reCAPTCHA key used in the siteconfig.xml file for this site is invalid for this domain name. Please contact your collection administrator.");
-													$("#errorArea").attr("class", "ui-state-error ui-corner-all");
-												}
-											}
-											$(window).load(checkreCaptchaError);
+							<tr>
+							  <td colspan="2">
+							<div class="g-recaptcha" data-sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"><xsl:text> </xsl:text></div></td></tr>
+							<tr>
+							  <td>
+							    <!-- need to add s1. to the name of g-recaptcha-response, so that it gets passed to the service -->
+								  <script type="text/javascript">
+								    <xsl:text disable-output-escaping="yes">
+									    $( "#registerForm").submit(function( event ) {
+									    var captchaelem = $("#g-recaptcha-response");
+									    captchaelem.attr("name", "s1.g-recaptcha-response");
+									    return true;
+									    });
+									    
 										</xsl:text>
 									</script>
-								</tr>
-							</xsl:if>
-							<tr>
-								<td>
 									<input id="submitButton" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.submit')}"/>
-									<script type="text/javascript">
-										<xsl:text disable-output-escaping="yes">
-											$("#submitButton").click(function()
-											{
-												var passwordOne = $("#passwordOne");
-												var passwordTwo = $("#passwordTwo");
-												
-												if(passwordOne.val() != passwordTwo.val())
-												{
-													alert("The passwords you have entered do not match");
-													return false;
-												}
-												else
-												{
-													return true;
-												}
-											});
-										</xsl:text>
-									</script>
 								</td>
 							</tr>
@@ -535,5 +506,8 @@
 					</xsl:choose>
 				</xsl:when>
-				
+
+				<xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'Info'">
+				  <!-- do nothing -->
+				</xsl:when>
 				<xsl:otherwise>
 					<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.page_not_found')"/>
