<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request); 
   c.stringTable("DevResources"); 
   c.stringTable("BaseResources"); %>
<HTML>
<HEAD>
<TITLE><%= c.toDisplay(c.string("CreateAttr.Title")) %></TITLE>
<LINK rel="stylesheet" href="<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>" type="text/css">
<jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
</HEAD>
<!-------------------------JAVA SCRIPT BEGINS HERE------------------------------------------->
<SCRIPT language="JavaScript">

function previousSelected()
{
   document.AttrSyntaxForm.elements["merge"].value="base.CreateAttrName";
   document.AttrSyntaxForm.elements["nextState"].value="getNewAttrSyntax";
   document.AttrSyntaxForm.elements["Task.SelectedButton"].value="previousSelected";
   document.AttrSyntaxForm.submit();
}

function nextSelected()
{
   if (checkForSelection())
   {
      if(getSyntax())
      {
         document.AttrSyntaxForm.elements["merge"].value="base.CreateAttrFlags";
         document.AttrSyntaxForm.elements["nextState"].value="getNewAttrSyntax";
         document.AttrSyntaxForm.elements["Task.SelectedButton"].value="nextSelected";
         document.AttrSyntaxForm.submit();
       }
   }
}

function getSyntax()
{
   var attrOpt = document.AttrSyntaxForm.AvailableSyntax.options;
   for (var i=0; i<attrOpt.length; i++)
   {
      if(attrOpt[i].selected)
      {
         document.AttrSyntaxForm.elements["EnteredAttrSyntax"].value = attrOpt[i].text;
      }
   }
   return true;
}

function checkForSelection()
{
   var selectedSyntax = document.AttrSyntaxForm.AvailableSyntax.selectedIndex;
   if(selectedSyntax == -1)
   {
      alert ("<%= c.toScript(c.string("CreateAttr.MustSelectSyntax")) %>");
      return false;
   }
   else
   {
      return true;
   }
}

function restore()
{
   var whatSelected = document.AttrSyntaxForm.elements["EnteredAttrSyntax"].value;
   var attrOpt = document.AttrSyntaxForm.AvailableSyntax.options;
   for (var i=0; i<attrOpt.length; i++)
   {
      if(whatSelected == attrOpt[i].text)
      {
         attrOpt[i].selected = true;
         return true;
       }
   }
   return false;
}

function setFormFocus()
{
   document.AttrSyntaxForm.AvailableSyntax.focus();
   return true;
}

</SCRIPT>


<BODY text="#000000" link="#000000" vlink="#000000" alink="#000000" bgcolor="#FFFFFF" onload="restore();setFormFocus();" >
<FORM name="AttrSyntaxForm" method=post action="webacc">

<!------------------------ BEGIN WEBACCESS VARIABLES ---------------------------->

<INPUT type="hidden" name="error" value="dev.GenErr">
<INPUT type="hidden" name="merge" value="">
<INPUT type="hidden" name="User.context" value="<%= c.var("User.context") %>">
<INPUT type="hidden" name="nextState" value="">
<INPUT type="hidden" name="taskId" value="<%= c.var("taskId") %>">
<INPUT type="hidden" name="Task.SelectedButton" value="">
<INPUT type="hidden" name="EnteredAttrName" value="<%= c.var("EnteredAttrName") %>">
<INPUT type="hidden" name="EnteredAttrID" value="<%= c.var("EnteredAttrID") %>">
<INPUT type="hidden" name="EnteredAttrSyntax" value="<%= c.var("EnteredAttrSyntax") %>">
<INPUT type="hidden" name="Sch_AttrSyntax.Count" value="<%= c.var("Sch_AttrSyntax.Count") %>">
<INPUT type="hidden" name="SyntaxNames" value="<%= c.var("SyntaxNames") %>">
<% c.set("WizardHeader.title", c.string("CreateAttr.Title")); 
   c.set("WizardHeader.subtitle", c.string("Schema.Step2")); 
   c.set("WizardHeader.instruction", c.string("CreateAttr.Instr2")); 
   c.set("WizardHeader.helpFile", "base/schemacreate_attr_wizard_syntax.html"); %>
<jsp:include page='<%= c.getPath("dev/WizardHeader_inc.jsp") %>' flush="true" />

<!----------------------------------------- CONTENT TABLE ------------------------------------>

<TABLE border="0" cellspacing="0" cellpadding="2">
   <TR valign="baseline">
      <TD class="mediumtext"><%= c.toDisplay(c.string("CreateAttr.Syntax")) %></TD>
   </TR>
   <TR valign="baseline">
      <TD class="mediumtext">
         <SELECT name="AvailableSyntax" style="WIDTH: 270px" size="5">
         <% c.set("i", "0"); 
            while (c.lt(c.var("i"), c.var("Sch_AttrSyntax.Count"))) { %>
         <OPTION value="<%= c.toDisplay(c.var("Sch_AttrSyntaxEnum.Name."+c.var("i"))) %>"><%= c.toDisplay(c.var("Sch_AttrSyntaxEnum.Name."+c.var("i"))) %>
         <% c.inc("i"); 
            } %>
         </SELECT>
      </TD>
   </TR>
</TABLE>
<BR>

<!------------------------- BUTTON TABLE --------------------------->

<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" >
   <TR>
      <TD><jsp:include page='<%= c.getPath("dev/Bar_inc.jsp") %>' flush="true" /></TD>
   </TR>
   <TR>
      <TD>
         <A HREF="#"onClick="javascript:previousSelected();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Back.image") %>" alt="<%= c.toDisplay(c.string("Button.Back.alt")) %>" title="<%= c.toDisplay(c.string("Button.Back.alt")) %>" border=0></A>
         <A HREF="#"onClick="javascript:nextSelected();return false"> <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Next.image") %>" alt="<%= c.toDisplay(c.string("Button.Next.alt")) %>" title="<%= c.toDisplay(c.string("Button.Next.alt")) %>" border=0></A>
         <jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
      </TD>
   </TR>
</TABLE>
</FORM>
</BODY></HTML>
