<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils,
                                                                             com.novell.emframe.dev.MContext,
                                                                             com.novell.emframe.dev.eMFrameFactory" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request);
   c.stringTable("DevResources");
   c.stringTable("BaseResources");
   c.stringTable("FwResources");
%>

<HTML>
<HEAD>
<TITLE><%= c.string("CreateUser.CreateUserTitle") %></TITLE>
<LINK href="<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>" rel="styleSheet" type="text/css">
<jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
<jsp:include page='<%= c.getPath("dev/OSScripts_inc.jsp") %>' flush="true" />
<script language="JavaScript">

var ENABLED_COLOR = "white";
var DISABLED_COLOR = "#EFEEE9";


   function addOption(controlName, result)
   {
      alert("result = " + result);
   }

   function checkCreateUserNullInput()
   {
      var strContainerInput = document.CreateUserForm.CreateUserContext.value;
      var strUserNameInput = document.CreateUserForm.CreateUserName.value;
      var strSurnameInput = document.CreateUserForm.CreateUserSurName.value;
      if ((null == strContainerInput) || (0 == strContainerInput.length))
      {
         alert("<%= c.string("CreateUser.InvalidContext") %>");
         return false;
      }
      if ((null == strUserNameInput) || (0 == strUserNameInput.length))
      {
         alert("<%= c.string("CreateUser.InvalidUserName") %>");
         return false;
      }
      if ((null == strSurnameInput) || (0 == strSurnameInput.length))
      {
         alert("<%= c.string("CreateUser.InvalidSurName") %>");
         return false;
      }

      return true;
   }

   function setFocusToFormElement()
   {
      // added for Object View
      if ("<%= c.var("OS.ReturningToAnchor") %>"!="true")    //haven't entered a value from OS
      {
         document.CreateUserForm.CreateUserContext.value = "<%= c.toScript(eMFrameUtils.getSingleTarget(request)) %>";
      }

		document.CreateUserForm.CreateUserName.focus();
   }

   function setTheValue(control)
   {
   	with(document.CreateUserForm)
		{
  			control = eval(control);
   	  		if (control.checked == true)
	  		{
				control.value = 'true';
			}
			else
			{
				control.value = 'false';
			}
		}
   }

	function checkDefaultKey(evt)
   {
      <% if (c.var("Browser.name").equals("NSN")) { %>
         return true;
		<% } %>

      var keyCode = evt.which ? evt.which : evt.keyCode;
      // 13 is the Enter key code
      if (keyCode == 13)
      {
         if (checkCreateUserNullInput())
         {
            document.CreateUserForm.submit();
            return false;
         }
      }
      return true;
   }

   function copyToFirstName()
   {
      document.CreateUserForm.firstname.value = document.CreateUserForm.CreateUserName.value.substring(0, 32);
   }

</script>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onLoad="returnFromOS();setFocusToFormElement();">
<form name="CreateUserForm" method=post action="webacc" onSubmit="return(checkCreateUserNullInput())">
   <input type=hidden name="taskId" value="<%= c.var("taskId") %>">
   <input type=hidden name="merge" value="dev.GenConf">
   <input type=hidden name="error" value="dev.GenErr">
   <input type=hidden name="User.context" value="<%= c.var("User.context") %>">
   <input type=hidden name="nextState" value="doCreateUser">
   <input type=hidden name="SelectedClass" value="<%= c.var("SelectedClass") %>">
   <input type=hidden name="TranslatedClass" value="<%= c.var("TranslatedClass") %>">
   <input type=hidden name="GifName" value="<%= c.var("GifName") %>">
   <input type=hidden name="targetNames" value="<%= c.var("targetNames") %>">

   <% c.set("TaskHeader.title", c.formatMessage(c.string("Creator.Create"), new String[]{c.var("TranslatedClass")}));
      c.set("TaskHeader.iconUrl", c.plus("dir/", c.var("GifName")));
      c.set("TaskHeader.iconAlt", c.var("TranslatedClass"));
      c.set("TaskHeader.helpFile", "base/crtuseracct.html");
   %>
   <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" />

<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class=smalltext align="right"><font color="#c82727">*=<%= c.string("CreateUser.Rquired") %></font></td>
  </tr>
</TABLE><BR>

<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.UserName") %><font color="#c82727"> *</font></td>
    </tr><tr><td><input type="text" name="CreateUserName" size="<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onChange="copyToFirstName();" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.FirstName") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="firstname" size="<%= c.string("PocketUI.textboxSize") %>" maxlength="32" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.LastName") %><font color="#c82727"> *</font></td>
    </tr><tr><td><input type="text" name="CreateUserSurName" size="<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
      <td class=mediumtext nowrap><%= c.string("CreateUser.Context") %><font color="#c82727"> *</font></td>
      </tr><tr><td nowrap>
         <input type="text" name="CreateUserContext" size="<%= c.string("PocketUI.textboxSizeOneButton") %>" maxlength="256" onkeypress="return checkDefaultKey(event)">
         <% c.set("OS.TypeFilter", c.var("CreatorSearchFilter"));
            c.set("OS.Control", "CreateUserContext");
            c.set("OS.History", "true"); %>
         <jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
      </td>
  </tr>

  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.Title") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="title" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.Location") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="location" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.Department") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="department" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.Telephone") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="telephone" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.FaxNumber") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="faxnumber" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.EmailAddress") %></td>
    </tr><tr><td class=smalltext2d width=100%><input type="text" name="emailaddress" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
  <tr>
    <td class=mediumtext nowrap><%= c.string("CreateUser.Description") %></td>
    </tr><tr><td class=smalltext2d><input type="text" name="description" size = "<%= c.string("PocketUI.textboxSize") %>" maxlength="64" onkeypress="return checkDefaultKey(event)"></td>
  </tr>
</TABLE>

<jsp:include page='<%= c.getPath("dev/Bar_inc.jsp") %>' flush="true" />
<INPUT type=image name="Create" alt="<%= c.string("Button.Create.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>" border=0><jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
</form>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</body>
</html>
