<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<iman:stringtable bundle="FwResources"/>
<iman:stringtable bundle="DevResources"/>

<html>
<head>
   <iman:stylesheet/>
   <iman:eMFrameScripts/>
   <iman:mvedScripts/>

   <script>
      function onNo()
      {
         document.form.fw_authState.value = "dontChangePwd";
         document.form.submit();
      }

      function onYes()
      {
         if(document.form.password1.value == "" || document.form.password1.value != document.form.password2.value)
         {
            alert("<iman:string key="SetPassword.PasswordsDontMatch"/>");
            return false;
         }

         document.form.submit();
      }

      function doInit()
      {
      }
   </script>
</head>

<body onLoad="doInit()">
<form name="form" method="post">
   <input type="hidden" name="fw_authState" value="doChangePasswordState">

   <iman:taskHeader titleKey="ChangePassword.title" /><BR>
	<iman:messagebar/>
   <div class=""><c:out value="${AuthMsg}"/></div><br/>

   <table>
      <tr>
         <td><iman:string key="ChangePassword.newPassword"/></td>
         <td><input name="password1" type="password" style="width: <iman:string key="UI.textboxPixel"/>"/></td>
      </tr>
      <tr>
         <td><iman:string key="ChangePassword.newPasswordVerify"/></td>
         <td><input name="password2" type="password" style="width: <iman:string key="UI.textboxPixel"/>"/></td>
      </tr>
   </table>

   <br/>
   <iman:bar/>

   <c:choose>
      <c:when test="${ChangePassword_forceChange=='true'}">
         <iman:button key="OK" onClick="onYes()"/>
      </c:when>
      <c:otherwise>
         <iman:button key="Yes" onClick="onYes()"/>
         <iman:button key="No" onClick="onNo()"/>
      </c:otherwise>
   </c:choose>

</form>
</body>
</html>
