<%@  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("FwResources"); %>

<HTML>
<HEAD>
   <LINK rel='stylesheet' href='<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>'>
   <TITLE><%= c.string("ProductName") %></TITLE>

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

   <SCRIPT>
      function setChar(s, i, c)
      {
        return s.substring(0,i) + c + s.substring(i+1,s.length) ;
      }

      function okClicked()
      {
         // set options
         var f = document.form;
         var oform = opener.document.forms[0];
         var o;

         <% c.set("j", "0");
            while (c.lt(c.var("j"), c.var("uihandler.count"))) { %>
            o = oform.elements["<%= c.toScript(c.var("AttributeDetails.name")) %>+<%= c.toScript(c.var("uihandler."+c.var("j")+ ".id")) %>"].value;
            if(f.elements["uihandler<%= c.var("j") %>ReadOnly"].checked == true) o=setChar(o,0,'1'); else o=setChar(o,0,'0');
            if(f.elements["uihandler<%= c.var("j") %>SingleValued"].checked == true) o=setChar(o,2,'1'); else o=setChar(o,2,'0');
            oform.elements["<%= c.toScript(c.var("AttributeDetails.name")) %>+<%= c.toScript(c.var("uihandler."+c.var("j")+ ".id")) %>"].value = o;
         <% c.inc("j");    } %>

         // pass back selected control
         for(var i=0; i<<%= c.var("uihandler.count") %>; i++)
         {
            var btn = document.getElementById("uihandler" + i);
            if(btn.checked)
            {
               var sel = window.opener.document.forms[0].elements["<%= c.toHTML(c.var("AttributeDetails.name")) %>_handler"];
               for(var j=0; j<sel.options.length; j++)
               {
                  if(sel.options[j].value == btn.value)
                  {
                     sel.selectedIndex = j;
                     window.close();
                     return false;
                  }
               }
            }
         }

         alert("ASSERTION FAILED: Internal Error");  // DEBUG
      }

      function onInit()
      {
         var f = document.form;
         var oform = opener.document.forms[0];
         var o;

         <% c.set("j", "0");
            while (c.lt(c.var("j"), c.var("uihandler.count"))) { %>
            o = oform.elements["<%= c.toScript(c.var("AttributeDetails.name")) %>+<%= c.toScript(c.var("uihandler."+c.var("j")+ ".id")) %>"].value;
            if(o.charAt(0)=="0") f.elements["uihandler<%= c.var("j") %>ReadOnly"].checked = false; else f.elements["uihandler<%= c.var("j") %>ReadOnly"].checked = true;
            if(o.charAt(1)=="0") f.elements["uihandler<%= c.var("j") %>ReadOnly"].disabled = true; else f.elements["uihandler<%= c.var("j") %>ReadOnly"].disabled = false;

            if(o.charAt(2)=="0") f.elements["uihandler<%= c.var("j") %>SingleValued"].checked = false; else f.elements["uihandler<%= c.var("j") %>SingleValued"].checked = true;
            if(o.charAt(3)=="0") f.elements["uihandler<%= c.var("j") %>SingleValued"].disabled = true; else f.elements["uihandler<%= c.var("j") %>SingleValued"].disabled = false;
         <% c.inc("j");    } %>
      }


      function toggleShowAll()
      {
         toggleDivDisplay("attributeDetails");
         toggleDivDisplay("noAttributeDetails");
      }
   </SCRIPT>

   <STYLE>
      .myFormHead  { color: white; font-weight: bold; font-size: 1em; line-height: 1.2em; background-color: #6b8899; text-align: center; letter-spacing: 0.05em; vertical-align: middle }
   </STYLE>

</HEAD>
<body text="#000000" bgcolor="#ffffff" onLoad="onInit();">
   <FORM name=form>




<DIV id=noAttributeDetails style="display:block">
   <TABLE>
      <TR>
         <TD><B><%= c.string("TaskBuilder.AttributeName") %>:</B></TD>
         <TD><B><%= c.toHTML(c.var("AttributeDetails.name")) %></B></TD>
         <TD><A href="#" id=toggleLink onclick="toggleShowAll();" style="text-decoration:none;font-size:12px;"><%= c.string("TaskBuilder.ShowAttributeDetails") %></A></TD>
      </TR>
   </TABLE>
</DIV>

<DIV id=attributeDetails style="display:none">
   <TABLE>
      <TR>
         <TD><B><%= c.string("TaskBuilder.AttributeName") %>:</B></TD>
         <TD><B><%= c.toHTML(c.var("AttributeDetails.name")) %></B></TD>
         <TD><A href="#" id=toggleLink onclick="toggleShowAll();" style="text-decoration:none;font-size:12px;"><%= c.string("TaskBuilder.HideAttributeDetails") %></A></TD>
      </TR>
   </TABLE>
   <TABLE>
      <TR>
         <TD><%= c.string("TaskBuilder.Syntax") %></TD>
         <TD><%= c.toHTML(c.var("AttributeDetails.syntax")) %></TD>
      </TR>
      <TR>
         <TD><%= c.string("TaskBuilder.ReadOnly") %></TD>
         <TD><%= c.toHTML(c.var("AttributeDetails.readOnly")) %></TD>
      </TR>
      <TR>
         <TD><%= c.string("TaskBuilder.SingleValued") %></TD>
         <TD><%= c.toHTML(c.var("AttributeDetails.singleValued")) %></TD>
      </TR>
      <TR>
         <TD nowrap><%= c.string("TaskBuilder.Naming") %></TD>
         <TD nowrap><%= c.toHTML(c.var("AttributeDetails.naming")) %></TD>
      </TR>
      <TR>
         <TD nowrap><%= c.string("TaskBuilder.Mandatory") %></TD>
         <TD nowrap><%= c.toHTML(c.var("AttributeDetails.mandatory")) %></TD>
      </TR>
   </TABLE>
</DIV>

   <BR>
   <TABLE style="border:1">
      <TR>
         <TD class=myFormHead align=center>&nbsp;<%= c.string("TaskBuilder.Control") %>&nbsp;</TD>
         <TD class=myFormHead align=center>&nbsp;<%= c.string("TaskBuilder.ReadOnly") %>&nbsp;</TD>
         <TD class=myFormHead align=center>&nbsp;<%= c.string("TaskBuilder.SingleValued") %>&nbsp;</TD>
         <TD class=myFormHead align=center>&nbsp;Browser&nbsp;</TD>
         <TD class=myFormHead align=center>&nbsp;Simple&nbsp;</TD>
         <TD class=myFormHead align=center>&nbsp;Pocket&nbsp;</TD>
      </TR>

      <% c.set("j", "0");
         while (c.lt(c.var("j"), c.var("uihandler.count"))) { %>
      <TR>
         <TD>
            <INPUT type=hidden value="<%= c.var("handlerOptions") %>">
            <INPUT id=uihandler<%= c.var("j") %> type=radio name=uihandler value=<%= c.toHTML(c.var("uihandler."+c.var("j")+ ".id")) %> <% if (c.var("handlerId").equals(c.var("uihandler."+c.var("j")+ ".id"))) { %>checked<% } %>  ><%= c.toHTML(c.var("uihandler."+c.var("j")+ ".name")) %><BR>
         </TD>
         <TD align=center><INPUT type=checkbox name="uihandler<%= c.var("j") %>ReadOnly"></TD>
         <TD align=center><INPUT type=checkbox name="uihandler<%= c.var("j") %>SingleValued"></TD>
         <TD align=center><% if (c.var("uihandler."+c.var("j")+ ".browser").equals("true")) { %><IMG src="<%= c.getModulesUrl() + "/dev/images/success16.gif" %>" alt="<%= c.string("Button.ArrowLeft.alt") %>" title="<%= c.string("Button.ArrowLeft.alt") %>" border=0><% } else { %>&nbsp;<% } %></TD>
         <TD align=center><% if (c.var("uihandler."+c.var("j")+ ".simple").equals("true")) { %><IMG src="<%= c.getModulesUrl() + "/dev/images/success16.gif" %>" alt="<%= c.string("Button.ArrowLeft.alt") %>" title="<%= c.string("Button.ArrowLeft.alt") %>" border=0><% } else { %>&nbsp;<% } %></TD>
         <TD align=center><% if (c.var("uihandler."+c.var("j")+ ".pocket").equals("true")) { %><IMG src="<%= c.getModulesUrl() + "/dev/images/success16.gif" %>" alt="<%= c.string("Button.ArrowLeft.alt") %>" title="<%= c.string("Button.ArrowLeft.alt") %>" border=0><% } else { %>&nbsp;<% } %></TD>

         <% c.inc("j"); %>
      </TR>
      <% } %>
   </TABLE>

   <BR>
   <A href="#" onClick="okClicked();"><IMG alt="<%= c.string("Button.OK.alt") %>" title="<%= c.string("Button.OK.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>" border=0></A>
   <A href="#" onClick="window.close();"><IMG alt="<%= c.string("Button.Cancel.alt") %>" title="<%= c.string("Button.Cancel.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Cancel.image") %>" border=0></A>

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