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

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

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

   <SCRIPT>
      function init()
      {
         document.form.objectTypeName.focus();
         parent.setFooterButtons(parent.nextButton | parent.backButton | parent.cancelButton);
         parent.setHeader("<% if (c.var("mode").equals("developer")) { %><%= c.string("TemplateBuilder.title") %><% } else { %><%= c.string("TaskBuilder.title") %><% } %>", "<%= c.string("TaskBuilder.ChooseType")%>", "fw/studio_getobjecttype.html");
      }
     
      function isPageValid()
      {
         if(document.form.pluginType.selectedIndex != 3)
         {
            document.form.target="_parent";
         }

         document.form.screenWidth.value = window.screen.width - 50;
         document.form.screenHeight.value = window.screen.height - 50;

         return true;
      }

      function showDiv(id)
      {
         document.getElementById(id).style.display = "block";
      }

      function hideDiv(id)
      {
         document.getElementById(id).style.display = "none";
      }

      function pluginTypeChange(sel)
      {
         if(sel.value=='delete') // || sel.value=='create'
         {
            document.form.addaux.checked=false;
            document.form.addaux.disabled=true;
            hideDiv('aux');
         }
         else
         {
            document.form.addaux.disabled=false;
         }
      }
   </SCRIPT>
</HEAD>

<body text="#000000" bgcolor="#ffffff" onload="init();">
<FORM name="form" method=post action="webacc">

<!-- WEBACC VARIABLES -->
<INPUT type="hidden" name="taskId" value="<%= c.var("taskId") %>">
<INPUT type="hidden" name="nextState" value="GetAttributes">
<INPUT type="hidden" name="merge" value="fw.Studio_main">
<%--<INPUT type=hidden name="merge" value="fw.TemplateBuilder_getAttributes">--%>
<INPUT type="hidden" name="mode" value="<%= c.var("mode") %>">
<INPUT type="hidden" name="error" value="dev.GenErr">
<INPUT type="hidden" name="screenWidth">
<INPUT type="hidden" name="screenHeight">

<DIV class=instructions><%= c.string("TaskBuilder.Instructions") %></DIV><BR>

<table border="0" bgcolor="#FFFFFF" cellpadding="3" cellspacing="0">
	<!-- Select Tree Object -->
	<TR>
		<TD align="left" valign="top"><%= c.string("TaskBuilder.AvailabeClasses") %></TD>
		<TD>
			<select name="objectTypeName" size="1" style="width:210">

			<% c.set("i", "0");
			   while (c.lt(c.var("i"), c.var("TemplateObjects.Count"))) { %>
				<option <% if (c.var("TemplateObjects."+c.var("i")).equals("User")) { %>selected<% } %>><%= c.toHTML(c.var("TemplateObjects."+c.var("i"))) %></option>
				<% c.inc("i");
			   } %>
			</select>
		</TD>
	</TR>

	<TR>
		<TD align="left" valign="top"><%= c.string("TaskBuilder.TargetDevice") %></TD>
		<TD>
         <select name="client" size="1" style="width:210">
			   <option value="browser"><%= c.string("Devices.Browser") %>
			   <option value="default" selected><%= c.string("Button.Default.alt") %>
			   <!-- <option value="pocket"><%= c.string("Devices.Pocket") %> -->
			</select>
		</TD>
	</TR>

	<TR>
		<TD align="left" valign="top"><%= c.string("TaskBuilder.PluginType") %></TD>
		<TD>
         <select name="pluginType" size="1" style="width:210" onChange="pluginTypeChange(this);">
			   <option value="task" selected><%= c.string("TaskBuilder.Task") %>
			   <option value="page" ><%= c.string("TaskBuilder.PropertyBookPage") %>
			   <option value="create" ><%= c.string("TaskBuilder.CreateTask") %>
			   <option value="delete" ><%= c.string("TaskBuilder.CreateDelete") %>
			</select>
		</TD>
	</TR>


   <TR>
      <TD valign="top"><%= c.string("Studio.addAuxClass") %> </TD>
      <TD>
         <INPUT type="checkbox" name="addaux" onclick="if(this.checked) showDiv('aux'); else hideDiv('aux');">
         <select id="aux" style="display:none" name="aux" size="10" style="width:210" multiple>
            <c:forEach items="${auxClass}" var="element">
               <option value="<c:out value="${element}"/>"><c:out value="${element}"/>
            </c:forEach>
         </select>
      </TD>
   </TR>

</TABLE>
<BR>

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