<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<iman:stringtable bundle="BaseResources"/>
<%
   JSPConduit c = JSPConduit.getJSPConduit(request);
   c.stringTable("DevResources");
   c.stringTable("BaseResources");
%>

<HTML>
<HEAD>
   <TITLE><%= c.string("ProductName") %></TITLE>

   <jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
   <jsp:include page='<%= c.getPath("dev/XmlScripts_inc.jsp") %>' flush="true" />
   <jsp:include page='<%= c.getPath("dev/ValidateIntegerScripts_inc.jsp") %>' flush="true" />

   <LINK rel='stylesheet' href='<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>'>
   <jsp:include page='<%= c.getPath("dev/PageScripts_inc.jsp") %>' flush="true" />
   <iman:calendarScripts/>
   <SCRIPT language="JavaScript">

      <%-- Global Variables --%>
      var ENABLED_COLOR = "white";
      var DISABLED_COLOR = "#EFEEE9";
      var initPml = null;
      var initPei = null;
      var initGla = null;
      var initRgl = null;

      var initPetDay = null;
      var initPetMonth = null;
      var initPetYear = null;
      var initFirstPass = null;


      <%-- Used to launch the set password task --%>
     /* function setPassword()
      {
         window.open("frameservice?NPService=fw.LaunchService&NPAction=Launch&launch=fw.SetPassword&launcher=fw.LaunchService&lifecycle=new&targetNames=<%= c.urlEncode(c.var("eDir$target")) %>", "", "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=400");
      }
      
      */
      
      // Ajax Code Handler for setPassword.Modification done to fix the Bug # 159018.
      // The above method is commented is the old method.
      
      //start of code fix
       
      function newXMLHttpRequest() {

  		var xmlreq = false;

  		if (window.XMLHttpRequest) {

    		// Create XMLHttpRequest object in non-Microsoft browsers
   			 xmlreq = new XMLHttpRequest();

  		} else if (window.ActiveXObject) {

    		// Create XMLHttpRequest via MS ActiveX
   			 try {
      				// Try to create XMLHttpRequest in later versions
      				// of Internet Explorer

      				xmlreq = new ActiveXObject("Msxml2.XMLHTTP");

    			} catch (e1) {

      				// Failed to create required ActiveXObject

      				try {
        				// Try version supported by older versions
        				// of Internet Explorer

       					 xmlreq = new ActiveXObject("Microsoft.XMLHTTP");

      				} catch (e2) {

        				// Unable to create an XMLHttpRequest with ActiveX
      				}			
    			}
  		}

  			return xmlreq;
	}
      
      function setPassword()
      {
			var req = newXMLHttpRequest();
			app=navigator.appName.substring(0,1);
			
      		var val = urlEncode("<%= c.var("eDir$target") %>");
      		var url = "frameservice?NPService=fw.LaunchService&NPAction=Launch&launch=fw.SetPassword&launcher=fw.LaunchService&lifecycle=new&targetNames="+val;
      		

      		if(app == 'M' && url.length > 2083){
      		  val = "<%= c.var("eDir$target") %>";
      		  url = "frameservice?NPService=fw.LaunchService&NPAction=Launch&launch=fw.SetPassword&launcher=fw.LaunchService&lifecycle=new&targetNames="+val;
      		}
      		var handlerFunction = getReadyStateHandler(req, url);
      		req.onreadystatechange = handlerFunction;
			req.open("POST", "frameservice", true);

  
  			req.setRequestHeader("Content-Type", 
                       "application/x-www-form-urlencoded");


			req.send("NPService=fw.LaunchService&NPAction=Launch&launch=fw.SetPassword&launcher=fw.LaunchService&lifecycle=new&targetNames="+val);
      }
      
      function getReadyStateHandler(req,url){
      
         
	      return function () {

		    // If the request's status is "complete"
    			if (req.readyState == 4) {
      
      				// Check that a successful server response was received
      				if (req.status == 200) {


				     	window.open(url, "", "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=400");

    	  			} else {

				        // An HTTP problem has occurred
				        alert("HTTP error: "+req.status);
      				}
    			}
  			}
      }
      
      // End of code fix for Bug # 159018

      function onInit()
      {
         with( document.forms[0] )
         {
            <%-- Password Allow Change --%>
            pac.checked = (getValueFromXml("<%= c.toScript(c.var("eDir$target$Password_Allow_Change")) %>") != "false");
            initMooMode("_pac", "<%= c.toScript(c.var("eDir$target$Password_Allow_Change")) %>");

            <%-- Password Required --%>
            pr.checked = (getValueFromXml("<%= c.toScript(c.var("eDir$target$Password_Required")) %>") == "true");
            initMooMode("_pr", "<%= c.toScript(c.var("eDir$target$Password_Required")) %>");

            <%-- Min lenght --%>
            initWidgetFromXml(pml, "<%= c.toScript(c.var("eDir$target$Password_Minimum_Length")) %>");
            initMooMode("_pml", "<%= c.toScript(c.var("eDir$target$Password_Minimum_Length")) %>");
            initPml=pml.value;

            <%-- Password Expiration Interval --%>
            var tmp=parseXml("<%= c.toScript(c.var("eDir$target$Password_Expiration_Interval")) %>"); <%-- Password Expiration Interval --%>
            if(tmp!=null)
            {
               var e = tmp.getChildren();
               if ((e != null) && (e.length > 0))
               {
                  pei.value = (e[0].getText())/86400;
                  initPei = pei.value;
               }
            }

            initMooMode("_pei", "<%= c.toScript(c.var("eDir$target$Password_Expiration_Interval")) %>");


            <%-- Password Expiration Time --%>
            secs = getValueFromXml("<%= c.toScript(c.var("eDir$target$Password_Expiration_Time")) %>");
            initMooMode("_pet", "<%= c.toScript(c.var("eDir$target$Password_Expiration_Time")) %>");

            msecs = parseInt(secs);
            if( msecs > 0 )
            {
               var date = new Date(msecs);
               initFirstPass = "true";
               petDay.value = date.getDate();
               petMonth.options[date.getMonth()].selected = true;
               petYear.value = date.getFullYear();
               form.petHour.options[date.getHours()].selected = true;
               form.petMinute.value = date.getMinutes();
               if(form.petMinute.value.length == 1)
               {
                  form.petMinute.value = "0"+form.petMinute.value;
               }

               initPetDay=petDay.value;
               initPetMonth=petMonth.selectedIndex;
               initPetYear=petYear.value;
               initPetHour=petHour.selectedIndex;
               initPetMinute=petMinute.value;
            }

            <%-- Password Unique Required --%>
            if(getValueFromXml("<%= c.toScript(c.var("eDir$target$Password_Unique_Required")) %>") == "true")
            {
               rup.checked = true;
            }
            initMooMode("_rup", "<%= c.toScript(c.var("eDir$target$Password_Unique_Required")) %>");

            <%-- Login Grace Limit --%>
            initWidgetFromXml(gla, "<%= c.toScript(c.var("eDir$target$Login_Grace_Limit")) %>");
            initMooMode("_gla", "<%= c.toScript(c.var("eDir$target$Login_Grace_Limit")) %>");
            initGla=gla.value;

            <%-- Login Grace Remaining --%>
            <% if (c.var("Book.Target.type").equals("Template") == false) { %>
               initWidgetFromXml(rgl, "<%= c.toScript(c.var("eDir$target$Login_Grace_Remaining")) %>");
               initMooMode("_rgl", "<%= c.toScript(c.var("eDir$target$Login_Grace_Remaining")) %>");
               initRgl=rgl.value;
            <% } %>


            <%-- --------------------------------- --%>
            <%-- Force remaining less than allowed --%>
            <%-- --------------------------------- --%>
            if(initGla=="") initGla = "6";
            if(initRgl=="") initRgl = "6";
            if(Number(initRgl) > Number(initGla)) initRgl = initGla;
            <% if (c.var("Book.Target.type").equals("Template") == false) { %>
               if(Number(rgl.value) > Number(gla.value)) rgl.value = gla.value;
            <% } %>


            // check for force periodic passwaord changes
            if( pei.value.length != 0 || petDay.value.length != 0 ||  petYear.value.length != 0 )
            {
               fppc.checked = true;
            }

            if( gla.value.length > 0)
            {
               lgl.checked = true;
            }
            
            checkControlsInit();
         }
      }


      function disableControl(control)
      {
         control.disabled = true;
         control.style.backgroundColor = DISABLED_COLOR;
      }

      function enableControl(control)
      {
         control.disabled = false;
         control.style.backgroundColor = ENABLED_COLOR;
      }

            <%-- ------------------------------------- --%>
            <%-- checkControls need to behave a little --%>
            <%-- differently when called from onInit-- --%>
            <%-- ------------------------------------- --%>

      function checkControlsInit()
      {
         with(document.forms[0])
         {
           if(pr.checked && pac.checked)
            {
              if( initPml == null || pml.value.length == 0 )
               {
                  pml.value = "5";
               }

               enableControl(pml);
               enableControl(fppc);

               disableControl(pei);
               disableControl(petDay);
               disableControl(petMonth);
               disableControl(petYear);
               disableControl(petHour);
               disableControl(petMinute);
               disableControl(gla);

               <% if (!c.var("Book.Target.type").equals("Template")) { %>
                  disableControl(rgl);
               <% } %>
            }
            else
            {
              disableControl(pml);
              disableControl(fppc);
              disableControl(pei);
              disableControl(petDay);
              disableControl(petMonth);
              disableControl(petYear);
              disableControl(petHour);
              disableControl(petMinute);
              disableControl(lgl);
              disableControl(rup);
              disableControl(gla);

              <% if (!c.var("Book.Target.type").equals("Template")) { %>
                 rgl.disabled=true;
                 rgl.style.background=DISABLED_COLOR;
              <% } %>
            }

            if((fppc.checked) && (!fppc.disabled))
            {
              if( initPei == null || pei.value.length == 0 )
               {
                 //need to distinguish when ONLY PasswordExpirationInterval is missing
                 //and this is the first time i.e. called from onInit()
                 
                 if(initFirstPass !=null && initFirstPass == "true")  
                 {
                  disableControl(petDay);
                  disableControl(petMonth);
                  disableControl(petYear);
                  disableControl(petHour);
                  disableControl(petMinute);
                  disableControl(pei);
                  disableControl(lgl);
                  disableControl(rup);
                  disableControl(gla);
                  
                  fppc.checked = false;
                  initFirstPass = "false";
                 }
                 else
                 { 
                   //both absent
                   
                   pei.value = 40;
                   enableControl(pei);
                   enableControl(petDay);
                   enableControl(petMonth);
                   enableControl(petYear);
                   enableControl(petHour);
                   enableControl(petMinute);
                   enableControl(lgl);
                   enableControl(rup);
                   fppc.checked = true;
                   
                   if( initPetDay == null || petDay.value.length == 0 )
                   {
                    var date = new Date();
                    
                    petDay.value = date.getDate();
                    petMonth.options[date.getMonth()].selected = true;
                    petYear.value = date.getFullYear();
                    
                    form.petHour.options[date.getHours()].selected = true;
                    form.petMinute.value = date.getMinutes();
                   
                     if(form.petMinute.value.length == 1)
                     {
                       form.petMinute.value = "0"+form.petMinute.value;
                     }
                   }
                 }
               }
            }

            if(!fppc.checked)
            {
               disableControl(petDay);
               disableControl(petMonth);
               disableControl(petYear);
               disableControl(petHour);
               disableControl(petMinute);
               disableControl(pei);
               disableControl(lgl);
               disableControl(rup);
               disableControl(gla);

               initPei = pei.value;
               initPetDay = petDay.value;
               initPetMonth = petMonth.value;
               initPetYear = petYear.value;

               <% if (!c.var("Book.Target.type").equals("Template")) { %>
                  rgl.style.background=DISABLED_COLOR;
               <% } %>
               
            }
            else
            {
              enableControl(pei);
              enableControl(petDay);
              enableControl(petMonth);
              enableControl(petYear);
              enableControl(petHour);
              enableControl(petMinute);
              enableControl(lgl);
              enableControl(rup);
            }

            if((lgl.checked) && (!lgl.disabled))
            {
               <% if (c.var("Book.Target.type").equals("Template") == false) { %>
                  if(initRgl.length  > 0)
                     rgl.value = initRgl;
                  else
                     rgl.value="6";

                  enableControl(rgl);
               <% } %>

               if(initGla.length > 0)
                  gla.value = initGla;
               else
                  gla.value="6";

               enableControl(gla);
            }

            if((!lgl.checked) && (!lgl.disabled))
            {
               initGla = gla.value;
               disableControl(gla);

               <% if (c.var("Book.Target.type").equals("Template") == false) { %>
                  initRgl = rgl.value;
                  disableControl(rgl);
               <% } %>
            }
         }
      }
      
      function checkControls()
      {
         with(document.forms[0])
         {
            // if required password is checked
            if(pr.checked && pac.checked)
            {

               if( initPml == null || pml.value.length == 0 )
               {
                  pml.value = "5";
               }

               enableControl(pml);
               enableControl(fppc);

               disableControl(pei);
               disableControl(petDay);
               disableControl(petMonth);
               disableControl(petYear);
               disableControl(petHour);
               disableControl(petMinute);
               disableControl(gla);

               <% if (!c.var("Book.Target.type").equals("Template")) { %>
                  disableControl(rgl);
               <% } %>
            }
            else
            {
               disableControl(pml);
               disableControl(fppc);
               disableControl(pei);
               disableControl(petDay);
               disableControl(petMonth);
               disableControl(petYear);
               disableControl(petHour);
               disableControl(petMinute);
               disableControl(lgl);
               disableControl(rup);
               disableControl(gla);

               <% if (!c.var("Book.Target.type").equals("Template")) { %>
                  rgl.disabled=true;
                  rgl.style.background=DISABLED_COLOR;
               <% } %>
            }

            if((fppc.checked) && (!fppc.disabled))
            {
               enableControl(pei);
               enableControl(petDay);
               enableControl(petMonth);
               enableControl(petYear);
               enableControl(petHour);
               enableControl(petMinute);
               enableControl(lgl);
               enableControl(rup);
               


               if( initPei == null || pei.value.length == 0 )
               {
                  pei.value = 40;
               }

               if( initPetDay == null || petDay.value.length == 0 )
               {
                  var date = new Date();
                  petDay.value = date.getDate();
                  petMonth.options[date.getMonth()].selected = true;
                  petYear.value = date.getFullYear();
                  form.petHour.options[date.getHours()].selected = true;
                  form.petMinute.value = date.getMinutes();
                  if(form.petMinute.value.length == 1)
                  {
                     form.petMinute.value = "0"+form.petMinute.value;
                  }
               }
            }

            if(!fppc.checked)
            {
               disableControl(petDay);
               disableControl(petMonth);
               disableControl(petYear);
               disableControl(petHour);
               disableControl(petMinute);
               disableControl(pei);
               disableControl(lgl);
               disableControl(rup);
               disableControl(gla);

               initPei = pei.value;
               initPetDay = petDay.value;
               initPetMonth = petMonth.value;
               initPetYear = petYear.value;

               <% if (!c.var("Book.Target.type").equals("Template")) { %>
                  rgl.style.background=DISABLED_COLOR;
               <% } %>
            }

            if((lgl.checked) && (!lgl.disabled))
            {
               <% if (c.var("Book.Target.type").equals("Template") == false) { %>
                  if(initRgl.length  > 0)
                     rgl.value = initRgl;
                  else
                     rgl.value="6";

                  enableControl(rgl);
               <% } %>

               if(initGla.length > 0)
                  gla.value = initGla;
               else
                  gla.value="6";

               enableControl(gla);
            }

            if((!lgl.checked) && (!lgl.disabled))
            {
               initGla = gla.value;
               disableControl(gla);

               <% if (c.var("Book.Target.type").equals("Template") == false) { %>
                  initRgl = rgl.value;
                  disableControl(rgl);
               <% } %>
            }
         }
      }

      function isPageValid()
      {
         with( document.forms[0] )
         {
            if(pr.checked && !checkMPL())
            {
               return false;
            }

            if (fppc.checked && !validateIntegerField(pei, 1, 365))
            {
               return false;
            }

            <% if (!c.var("Book.Target.type").equals("Template")) { %>
               if((!pml.value && pr.checked)|| (!pei.value && fppc.checked) || (!rgl.value && lgl.checked) || (!gla.value && lgl.checked) )
               {
                  alert("<%= c.string("PasswordRestrictionsEmptyField") %>");
                  pml.focus();
                  return false;
               }

               // Remaining Grace Logins should not be negative, but due to an NMAS bug 238068 
               // it is set negative on a new installation in some cases.  So we're fixing 
               // iManager to not flag a negative Remaining Grace Logins since it prevents you 
               // from setting anything else on the page.
               if( parseInt(rgl.value) > 0 && parseInt(rgl.value) > parseInt(gla.value))
               {
                  alert("<%= c.string("PasswordRemainingGraceLoginsErrorKey") %>");
                  rgl.focus();
                  return false;
               }
            <% } %>


            if( parseInt(gla.value) < 0 || parseInt(gla.value) > 200 )
            {
               alert("<%= c.string("PasswordGraceLoginsErrorKey") %>");
               gla.focus();
               return false;
            }

            <%-- Password Allow Change --%>
            <c:if test="${edasRights.target.Password_Allow_Change.writeable}">
               eDir$target$Password_Allow_Change.value = toXmlString(""+pac.checked <% if (c.var("Task.moo").equals("true")) { %>, _pac_mode.value<% } %>);
            </c:if>


            <%-- Password Allow Change --%>
            <c:if test="${edasRights.target.Password_Required.writeable}">
            eDir$target$Password_Required.value = toXmlString(""+pr.checked <% if (c.var("Task.moo").equals("true")) { %>, _pr_mode.value<% } %>);
            </c:if>

            <%-- Password Minimum Length --%>
            if( pml.value.length != 0 )
            {
               eDir$target$Password_Minimum_Length.value = toXmlString(pml.value <% if (c.var("Task.moo").equals("true")) { %>, _pml_mode.value<% } %>);
            }

            <%-- Password Expiration Interval --%>
            if( (fppc.checked)&& (pei.value.length != 0) )
            {
               seconds = parseInt(pei.value) * 86400;
               eDir$target$Password_Expiration_Interval.value = toXmlString(""+seconds <% if (c.var("Task.moo").equals("true")) { %>, _pei_mode.value<% } %>);
            }
            else
            {
               eDir$target$Password_Expiration_Interval.value = toXmlString(""<% if (c.var("Task.moo").equals("true")) { %>, _pei_mode.value<% } %>);
            }

            if((fppc.checked)&&(petDay.value.length != 0))
            {
               if(petYear.value<1970 || petYear.value>2037)
               {
                  alert("<iman:string key="PasswordRestriction.TimeBefore2038"/>");
                  return false;
               }


               <%-- Password Expiration Time --%>
               when = new Date(petYear.value, petMonth.value, petDay.value, petHour.value, petMinute.value);
               var d = when.valueOf();

               // make sure the date could be parsed and was in IETF standard date format which looks like this:
               // Wed, 8 May 1996 17:41:46 -0400
               if( isNaN(d))
               {
                  alert("<%= c.string("PasswordRestrictionsFormatError") %>");
                  petDay.focus();
                  return false;
               }

               eDir$target$Password_Expiration_Time.value = toXmlString(""+d <% if (c.var("Task.moo").equals("true")) { %>, _pet_mode.value<% } %>);
            }
            else
            {
               eDir$target$Password_Expiration_Time.value = toXmlString(""<% if (c.var("Task.moo").equals("true")) { %>, _pet_mode.value<% } %>);
            }

            <%-- Password Unique Required --%>
            <c:if test="${edasRights.target.Password_Unique_Required.writeable}">
            if(rup.checked)
            {
               eDir$target$Password_Unique_Required.value = toXmlString('true' <% if (c.var("Task.moo").equals("true")) { %>, _rup_mode.value<% } %>);
            }
            else
            {
               eDir$target$Password_Unique_Required.value = toXmlString('false' <% if (c.var("Task.moo").equals("true")) { %>, _rup_mode.value<% } %>);
            }
            </c:if>


            if(lgl.checked)
            {
               <%-- Login Grace Limit --%>
               document.forms[0].eDir$target$Login_Grace_Limit.value = toXmlString(gla.value <% if (c.var("Task.moo").equals("true")) { %>, _gla_mode.value<% } %>);   <%-- Login Grace Limit --%>

               <%-- Login Grace Remaining --%>
               <% if (c.var("Book.Target.type").equals("Template") == false) { %>
                  document.forms[0].eDir$target$Login_Grace_Remaining.value = toXmlString(rgl.value <% if (c.var("Task.moo").equals("true")) { %>, _rgl_mode.value<% } %>);   <%-- Login Grace Remaining --%>
                  return true;
               <% } %>
            }
            else
            {
               eDir$target$Login_Grace_Limit.value = "<attribute></attribute>";
               <% if (c.var("Book.Target.type").equals("Template") == false) { %>
                  eDir$target$Login_Grace_Remaining.value = "<attribute></attribute>";
               <% } %>
            }
         }
      }

      function checkMPL()
      {
         with( document.forms[0] )
         {
            if(!validateIntegerField(pml,1,128))
            {
               return false;
            }
            else
            {
               initPml = pml.value;
               return true;
            }
         }
      }

	  /*callback function for calendar widget*/
      function getExpTime()
      {
         var form = document.form;
         if(form.fppc.checked == true)
         {
            return new Date(form.petYear.value, form.petMonth.value, form.petDay.value, form.petHour.value, form.petMinute.value);
         }
         else
         {
            return new Date();
         }
      }
      
      /*callback function for calendar widget*/      
      function returnExpTime(date)
      {
         var form = document.form;
         if(form.fppc.checked == true)
         {
            form.petDay.value = date.getDate();
            form.petMonth.options[date.getMonth()].selected = true;
            form.petYear.value = date.getFullYear();
            form.petHour.options[date.getHours()].selected = true;
            form.petMinute.value = date.getMinutes();
            if(form.petMinute.value.length == 1)
            {
               form.petMinute.value = "0"+form.petMinute.value;
            }
         }
      }
   </SCRIPT>
</HEAD>


<BODY bgcolor="#FFFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" onload="onInit();" >
<FORM name="form" method=post action="webacc">

   <jsp:include page='<%= c.getPath("dev/Messagebar_inc.jsp") %>' flush="true" />
   <jsp:include page='<%= c.getPath("dev/BookVars_inc.jsp") %>' flush="true" />

   <TABLE border="0" cellpadding="3" cellspacing="0">

    <!-- Password_Allow_Change -->
	<TR>
	     <TD align=left>

            <c:if test="${edasRights.target.Password_Allow_Change.writeable}">
              <INPUT name="eDir$target$Password_Allow_Change" type="hidden" value="<%= c.var("eDir$target$Password_Allow_Change") %>">
            </c:if>

           <INPUT name=pac type=checkbox onClick="checkControls();" <% if (c.var("eDirRights$target$Password_Allow_Change").equals("R") || c.var("eDirRights$target$Password_Allow_Change").equals("NONE")) { %>DISABLED<% } %>>
        </TD>
        <TD class="mediumtext">
	        <NOBR><%= c.string("PasswordRestrictionsPACPrompt") %></NOBR>
        </TD>
        <TD valign=top>
           <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_pac_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
        </TD>
    </TR>

	<!-- Password_Required -->
	<TR>
	    <TD align=left>
           <c:if test="${edasRights.target.Password_Required.writeable}">
           <INPUT name="eDir$target$Password_Required" type=hidden value="<%= c.var("eDir$target$Password_Required") %>">
           </c:if>

	        <INPUT TYPE=CHECKBOX name=pr value=yes onClick="checkControls();" <% if (c.var("eDirRights$target$Password_Required").equals("R") || c.var("eDirRights$target$Password_Required").equals("NONE")) { %>DISABLED<% } %> >
        </TD>
        <TD class="mediumtext"><NOBR><%= c.string("PasswordRestrictionsPRPrompt") %></NOBR></TD>
        <TD valign=top>
           <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_pr_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
        </TD>
   </TR>

    <!-- Password Minimum Length -->
	<TR>
	   <TD align=left></TD>
      <TD>
         <TABLE cellpadding="0" cellspacing="0" >
            <TR>
               <TD class="mediumtext"><NOBR><%= c.string("PasswordRestrictionsPMLPrompt") %>:</NOBR>&nbsp;</TD>
               <TD><INPUT type="text" name="pml" id="pmlId" style="padding-left:3;padding-right:3;" size="5" maxlength="3" ></TD>
               <TD><iman:spinner elementId="pmlId" /></TD>
            </TR>
         </TABLE>
         <INPUT name='eDir$target$Password_Minimum_Length' type=hidden value="<%= c.var("eDir$target$Password_Minimum_Length") %>">
      </TD>
      <TD valign=top>
         <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_pml_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
      </TD>
   </TR>
   <tr><td height=5></td></tr>

    <!-- Force Periodic Password Changes -->
	<TR>
	    <TD align=left>
	        <INPUT TYPE=CHECKBOX name=fppc value=yes onClick="if(this.checked)document.form.lgl.checked=true;checkControls();">
        </TD>
        <TD class="mediumtext">
	        <NOBR><%= c.string("PasswordRestrictionsFPPCPrompt") %></NOBR>
        </TD>
    </TR>

    <!-- Password_Expiration_Interval -->
	<TR>
      <TD align=left> </TD>
      <TD>
         <TABLE cellpadding="0" cellspacing="0" >
            <TR>
               <TD class="mediumtext"><NOBR><%= c.string("PasswordRestrictionsPEIPrompt") %>:</NOBR>&nbsp;</TD>
               <TD><input type=text name=pei id="peiId" style="padding-left:3;padding-right:3;" size=5 maxlength=3 ></TD>
               <TD><iman:spinner elementId="peiId"/></TD>
            </TR>
         </TABLE>

         <INPUT name='eDir$target$Password_Expiration_Interval' type=hidden value="<%= c.var("eDir$target$Password_Expiration_Interval") %>">

      </TD>
      <TD valign=top>
         <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_pei_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
      </TD>
   </TR>

    <!-- Prompt -->
	<TR>
	    <TD align=left>
        </TD>
        <TD class="mediumtext">
	        <NOBR><%= c.string("PasswordRestrictionsPETPrompt") %>:</NOBR>
        </TD>
    </TR>

    <!-- Password_Expiration_Time -->
	<TR>
	    <TD align=left>
        </TD>
        <TD class=smalltext>
	        &nbsp;&nbsp;&nbsp;<%= c.string("Date.Day") %>: <input type="text" name="petDay" size="2" maxlength="2">&nbsp;
            <%= c.string("Date.Month") %>: <select name=petMonth size="1" style="width:130px">
                <option value=0><%= c.string("Date.Month.0") %>
                <option value=1><%= c.string("Date.Month.1") %>
                <option value=2><%= c.string("Date.Month.2") %>
                <option value=3><%= c.string("Date.Month.3") %>
                <option value=4><%= c.string("Date.Month.4") %>
                <option value=5><%= c.string("Date.Month.5") %>
                <option value=6><%= c.string("Date.Month.6") %>
                <option value=7><%= c.string("Date.Month.7") %>
                <option value=8><%= c.string("Date.Month.8") %>
                <option value=9><%= c.string("Date.Month.9") %>
                <option value=10><%= c.string("Date.Month.10") %>
                <option value=11><%= c.string("Date.Month.11") %>
            </select>&nbsp;
	        <%= c.string("Date.Year") %>: <input type=text name=petYear size="4" maxlength="4">
			<%= c.string("Date.Time") %>: <select name=petHour>
              <option value=00>00</option>
              <option value=01>01</option>
              <option value=02>02</option>
              <option value=03>03</option>
              <option value=04>04</option>
              <option value=05>05</option>
              <option value=06>06</option>
              <option value=07>07</option>
              <option value=08>08</option>
              <option value=09>09</option>
              <option value=10>10</option>
              <option value=11>11</option>
              <option value=12>12</option>
              <option value=13>13</option>
              <option value=14>14</option>
              <option value=15>15</option>
              <option value=16>16</option>
              <option value=17>17</option>
              <option value=18>18</option>
              <option value=19>19</option>
              <option value=20>20</option>
              <option value=21>21</option>
              <option value=22>22</option>
              <option value=23>23</option>
           </select>:<input type=text name=petMinute size=2 maxlength=2>&nbsp;
           <iman:calendar onLoadCallback="getExpTime" name="expTimeWidget" returnCallback="returnExpTime"/>

            <INPUT name='eDir$target$Password_Expiration_Time' type=hidden>

<!--
	        <input type=text name=pet style="padding-left:3;padding-right:3;" size=40>
-->
<!--
           <INPUT name='eDir$target$Password_Expiration_Time' type=hidden><br>
            &nbsp;&nbsp;&nbsp;<%= c.toDisplay(c.string("PasswordRestrictionsExpirationTimeEx")) %>

-->
        </TD>
        <TD valign=top>
           <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_pet_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
        </TD>
    </TR>
    <tr><td height=5></td></tr>

	<!-- Password_Unique_Required -->
	<TR>
	    <TD align=left>
	        <INPUT type="checkbox" name="rup">

           <c:if test="${edasRights.target.Password_Unique_Required.writeable}">
           <INPUT name="eDir$target$Password_Unique_Required" type=hidden value="<%= c.var("eDir$target$Password_Unique_Required") %>">
           </c:if>

        </TD>
        <TD class="mediumtext">
	        <NOBR><%= c.string("PasswordRestrictionsRUPPrompt") %></NOBR>
        </TD>
        <TD valign=top>
           <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_rup_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
        </TD>
    </TR>

    <!-- Limit Grace Logins -->
	<TR>
	    <TD align=left>
	        <INPUT TYPE=CHECKBOX name=lgl onClick="if(!this.checked)alert('<%= c.toScript(c.string("Password.removeLimitWarning"))%>'); checkControls();">
        </TD>
        <TD class="mediumtext">
	        <NOBR><%= c.string("PasswordRestrictionsLGLPropmt") %></NOBR>
        </TD>
    </TR>

	<!-- Login_Grace_Limit -->
	<TR>
	    <TD align=left> </TD>

      <TD>
         <TABLE cellpadding="0" cellspacing="0" >
            <TR>
               <TD class="mediumtext"><NOBR><%= c.string("PasswordRestrictionsGLAPrompt") %>:</NOBR>&nbsp;</TD>
               <TD><INPUT type=text name=gla id="glaId" style="padding-left:3;padding-right:3;" size=5 maxlength=3 onChange='if(!validateIntegerField(gla,0,200)){this.focus(); return false;}'></TD>
               <TD><iman:spinner elementId="glaId" /></TD>
            </TR>
         </TABLE>
         <INPUT name='eDir$target$Login_Grace_Limit' type=hidden value="<%= c.var("eDir$target$Login_Grace_Limit") %>">
      </TD>
      <TD valign=top>
         <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_gla_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
      </TD>
   </TR>

<% if (c.var("Book.Target.type").equals("Template") == false) { %>
	<!-- Login_Grace_Remaining -->
   <TR>
      <TD align=left> </TD>
      <TD>
         <TABLE cellpadding="0" cellspacing="0">
            <TR>
               <TD class="mediumtext"><NOBR><%= c.string("PasswordRestrictionsRGLPrompt") %>:</NOBR>&nbsp;</TD>
               <TD><INPUT type=text name=rgl id="rglId" style="padding-left:3;padding-right:3;" size=5 maxlength=3 onChange='if(!validateIntegerField(rgl,0,200)){this.focus();return false;}'></TD>
               <TD><iman:spinner elementId="rglId"/></TD>
            </TR>
         </TABLE>
         <INPUT name='eDir$target$Login_Grace_Remaining' type=hidden value="<%= c.var("eDir$target$Login_Grace_Remaining") %>">
      </TD>
      <TD valign=top>
      <% if (c.var("Task.moo").equals("true")) {    c.set("ModeSelector.name", "_rgl_mode"); %>&nbsp;&nbsp;<jsp:include page='<%= c.getPath("dev/ModeSelector_inc.jsp") %>' flush="true" /><% } %>
      </TD>
      </TR>

    <% if (!c.var("Task.moo").equals("true")) { %>

       <TR><TD>&nbsp;</TD><TR/>

       <!-- Set Password -->
       <TR>
          <TD align=left></TD>
          <TD><a href="javascript:setPassword();"><%= c.string("SetPassword") %></a><BR></TD>
      <TD valign=top></TD>
   </TR>

   <% } %>

<% } %>

  </TABLE>
</FORM>
</BODY>
</HTML>
