<%@  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.string("DeleteCreator.Title") %></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/MoveListItems_inc.jsp") %>' flush="true" />

<script language="JavaScript">

   function setFocus( )
   {
      document.ClassListForm.AvailableClasses.focus();
      var Opt = document.ClassListForm.AvailableClasses.options;
      if (Opt.length > 0)
      {
         document.ClassListForm.AvailableClasses[0].selected = true;
      }
   }

   function deleteSelected()
   {
      var Opt = document.ClassListForm.AvailableClasses.options;
      if (Opt.length == 0)
      {
         cancelSelected();
         return false;
      }

      var selectedItem = -1;
      selectedItem 	= document.ClassListForm.AvailableClasses.selectedIndex;
      if (selectedItem == -1)
      {
         selectedItem = 0;
      }
      document.ClassListForm.AvailableClasses[selectedItem].selected = true;

      // get the untranslated name from the class list
<%--      selectedText = urlEncode(tempText);--%>
      var selectedText = "";
      selectedText = untranslatedClasses[selectedItem];

      document.ClassListForm.elements["merge"].value="dev.GenErr";
      document.ClassListForm.elements["SelectedClass"].value = selectedText;
      document.ClassListForm.elements["nextState"].value="deleteFromCreationList";
      document.ClassListForm.elements["Task.SelectedButton"].value="deleteSelected";
      document.ClassListForm.submit();

   }

   function cancelSelected()
   {
      document.ClassListForm.elements["taskId"].value="fw.HomePage";
      document.ClassListForm.elements["merge"].value="fw.HomePage";
      document.ClassListForm.elements["nextState"].value="fw.HomePage";
      document.ClassListForm.elements["Task.SelectedButton"].value="cancelSelected";
      document.ClassListForm.submit();
   }

	function checkDefaultKey(evt)
   {
      var keyCode = evt.which ? evt.which : evt.keyCode;
      // 13 is the Enter key code
      if (keyCode == 13)
      {
         deleteSelected();
         return false;
      }
      return true;
   }


   var untranslatedClasses =
   [
	<% c.set("j", "0");
	   while (c.lt(c.var("j"), c.var("Sch_ClassList.Count"))) { %>
      "<%= c.toScript(c.var("Sch_ClassList.name."+c.var("j"))) %>"
      <% c.inc("j");
         if (c.lt(c.var("j"), c.var("Sch_ClassList.Count"))) { %>,<% }
  	   } %>
   ];

</script>
</head>

<body text="#000000" link="#000000" vlink="#000000" alink="#000000" bgcolor="#FFFFFF" onload="setFocus()">
<form name="ClassListForm" method=post action="webacc">


   <input type="hidden" name="merge" value="">
   <input type="hidden" name="error" value="dev.GenErr">
   <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="SelectedClass" value="<%= c.toTag(c.var("SelectedClass")) %>">
   <input type="hidden" name="targetNames" value="<%= c.var("targetNames") %>">



   <% c.set("TaskHeader.title", c.string("DeleteCreator.Title"));
      c.set("TaskHeader.iconUrl", c.plus("dir/", c.string("GenericTask.image")));
      c.set("TaskHeader.helpFile", "base/deletecreatorclass.html");
   %>
   <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" /><BR>

   <p class="instructions"><%= c.string("DeleteCreator.SelectPrompt") %></p>

   <table name="ClassListTable" >
   <tr>
	   <td  class="mediumtext"><%= c.string("DeleteCreator.AvailableClasses") %></td>
   </tr>
   <tr>
	   <td>
		   <select name="AvailableClasses" size=10 style="WIDTH: 340px" onkeypress="return checkDefaultKey(event)">
		      <% c.set("i", "0");
		         while (c.lt(c.var("i"), c.var("Sch_ClassList.Count"))) { %>
		         <option value="<%= c.toTag(c.var("Sch_ClassList.name."+c.var("i"))) %>"><%= c.var("Sch_ClassList.displayname."+c.var("i")) %>
 		         <% c.inc("i");
		     	   } %>
		  	</select>
	   </td>
   </tr>
   </table>
   <br>

   <br>
   <jsp:include page='<%= c.getPath("dev/Bar_inc.jsp") %>' flush="true" />
   <A HREF="#"onClick="javascript:deleteSelected();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Remove.image") %>" alt="<%= c.string("Button.Remove.alt") %>" title="<%= c.string("Button.Remove.alt") %>" border=0></a>
   <jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
</form>
</body></html>
