<%@  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>
<TITLE><%= c.var("DisplayNameTitle") %></TITLE>
<link   rel='stylesheet'
        href='<%= c.getModulesUrl() + "/dev/css/hf_style.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">


   /*******************
    * FUNCTION HEADER *
    *******************/
    function onPageLoad()
    {

    }


   /*******************
    * FUNCTION HEADER *
    *******************/
    function onPageSubmit()
    {

    }

    function toggleEditable(obj)
    {
		var sName = obj.name;
		var sPart = sName.substring(0,sName.indexOf("_Enabled"));

		var myForm = document.eGuideAttributesForm;
		var len = myForm.length;
		var editableCB;

		// Get indexed CB
		for ( var i=0; i<len; i++ )
		{
			if ( myForm.elements[i].name == sPart + "_Editable" )
			{
				editableCB = myForm.elements[i];
				break;
			}
		}

		if ( obj.checked )
		{
			editableCB.disabled = false;
		}
		else
		{
			editableCB.disabled = true;
			editableCB.checked = false;
		}
	}


</SCRIPT>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onLoad="returnFromOS();onPageLoad()">
<FORM name="eGuideAttributesForm" method=post action="webacc" onSubmit="return(onPageSubmit())">
	<input  type=hidden name="taskId" value="<%= c.var("taskId") %>">
	<input  type=hidden name="merge" value="fw.eGuideTaskAssign">
	<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="displayAlleGuideRoles">
   <!-- End of hidden tags -->

   <% c.set("WizardHeader.title", c.toDisplay(c.string("eGuide.Taskbuilder.Title")));
      c.set("WizardHeader.subtitle", c.toDisplay(c.string("eGuide.Taskbuilder.Attributes.SubTitle"))); %>
   <jsp:include page='<%= c.getPath("dev/WizardHeader_inc.jsp") %>' flush="true" />

   <DIV class="instructions"><%= c.toDisplay(c.string("eGuide.Taskbuilder.Attributes.Description")) %></DIV>
   <BR>

   <!-- Build table here to house all attributes -->

   <TABLE style="border:1" cellspacing="0">
      <TR>
         <TD class=formdescriptext align=center>&nbsp;<b><%= c.toDisplay(c.string("eGuide.Taskbuilder.AttributeName.Label")) %></b>&nbsp;</TD>
         <TD class=formdescriptext align=center>&nbsp;<b><%= c.toDisplay(c.string("eGuide.Taskbuilder.Enabled.Label")) %></b>&nbsp;</TD>
         <TD class=formdescriptext align=center>&nbsp;<b><%= c.toDisplay(c.string("eGuide.Taskbuilder.Editable.Label")) %></b>&nbsp;</TD>
      </TR>

      <% c.set("i", "0");
         c.set("iColorCounter", "0");
         while (c.lt(c.var("i"), c.var("Attribute.Count"))) { %>
		<TR>
			 <% if (c.mod(c.var("iColorCounter"), "2").equals("0")) { %>
				<TD bgcolor="#EFEEE9"><%= c.toDisplay(c.var("Attribute."+c.var("i")+ ".Name")) %></TD>
				<TD bgcolor="#EFEEE9" align=center><INPUT type=checkbox name="<%= c.toDisplay(c.var("Attribute."+c.var("i")+ ".Name")) %>_Enabled" onClick="toggleEditable(this)"></TD>
				<TD bgcolor="#EFEEE9" align=center><INPUT type=checkbox name="<%= c.toDisplay(c.var("Attribute."+c.var("i")+ ".Name")) %>_Editable" disabled="true"></TD>
		   <% } else { %>
				<TD><%= c.var("Attribute."+c.var("i")+ ".Name") %></TD>
				<TD align=center><INPUT type=checkbox name="<%= c.toDisplay(c.var("Attribute."+c.var("i")+ ".Name")) %>_Enabled" onClick="toggleEditable(this)"></TD>
				<TD align=center><INPUT type=checkbox name="<%= c.toDisplay(c.var("Attribute."+c.var("i")+ ".Name")) %>_Editable" disabled="true"></TD>
		   <% }

			    c.inc("i");
			    c.inc("iColorCounter");

		      if (c.mod(c.var("i"), "13").equals("0")) {
				   c.set("iColorCounter", "0"); %>
				<TR>
					<TD class=formdescriptext align=center>&nbsp;<b><%= c.toDisplay(c.string("eGuide.Taskbuilder.AttributeName.Label")) %></b>&nbsp;</TD>
					<TD class=formdescriptext align=center>&nbsp;<b><%= c.toDisplay(c.string("eGuide.Taskbuilder.Enabled.Label")) %></b>&nbsp;</TD>
					<TD class=formdescriptext align=center>&nbsp;<b><%= c.toDisplay(c.string("eGuide.Taskbuilder.Editable.Label")) %></b>&nbsp;</TD>
				</TR>
		   <% } %>
		 </TR>

      <% } %>

   </TABLE>

   </DIV>
   <BR>
   	<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
      <TR>
      	<TD class="ruleabove">
         	<a href="javascript:history.go(-1);"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Back.image") %>" alt="<%= c.toDisplay(c.string("Button.Back.alt")) %>" border=0></a>
            <INPUT type=image name="Next" alt="<%= c.toDisplay(c.string("Button.Next.alt")) %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Next.image") %>" border=0>
            <jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
         </TD>
      </TR>
   </TABLE>
</FORM>
</BODY>

</HTML>
