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

<HTML>
<HEAD>
   <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" />
   <jsp:include page='<%= c.getPath("dev/XmlScripts_inc.jsp") %>' flush="true" />
   <jsp:include page='<%= c.getPath("dev/ValidateIntegerScripts_inc.jsp") %>' flush="true" />

    <SCRIPT LANGUAGE="JavaScript">
	function onInit()
	{
		if( document.forms[0].auxClasses.length != 0 )
		{
			document.forms[0].auxClasses.options[0].selected = true;
		}

		document.forms[0].auxClasses.focus();
	}

	function showClasses()
	{
		url = "webacc?taskId=<%= c.var("taskId") %>&merge=fw.ExtendClasses&User.context=<%= c.var("User.context") %>" +
			"&nextState=doShowClasses&eDir$target=<%= c.urlEncode(c.var("eDir$target")) %>";

		swidth = 350;
		sheight = 400;

		sleft = (screen.availWidth-swidth)/2;
		stop = (screen.availHeight-sheight)/2;

		settings = "left="+sleft+", top="+stop+",width="+swidth+",height="+sheight;
		WinObj = window.open(url, "AuxClasses", settings+", toolbar=0, status=0, resizable=1, scrollbars=1");
	}

	function showMandatoryUI()
	{
		url = "webacc?taskId=<%= c.var("taskId") %>&merge=fw.ExtendClasses&User.context=<%= c.var("User.context") %>" +
			"&nextState=doExtendObject&eDir$target=<%= c.urlEncode(c.var("eDir$target")) %>&className=" +
			document.auxClassForm.className.value;

		swidth = 700;
		sheight = 400;

		sleft = (screen.availWidth-swidth)/2;
		stop = (screen.availHeight-sheight)/2;

		settings = "left="+sleft+", top="+stop+",width="+swidth+",height="+sheight;
		WinObj = window.open(url, "MandatoryUI", settings+", toolbar=0, status=0, resizable=1, scrollbars=1");
	}

	function removeClass()
	{
        
            // set the next state
            document.auxClassForm.nextState.value = "doRemoveObject";

            //set the auxClassName
            indx = document.auxClassForm.auxClasses.selectedIndex;
            document.auxClassForm.className.value = document.auxClassForm.auxClasses.options[indx].text;

            // set the merge to be the same file
            document.auxClassForm.merge.value = "fw.ExtendObject";
            className = document.auxClassForm.auxClasses.options[indx].text;

            if(confirm("<%= c.toScript(c.string("ExtendObjectDelete")) %> " + className + "?") )
            {
                // submit form
                document.auxClassForm.submit();
            }
       
	}

    </SCRIPT>
</HEAD>


<BODY bgcolor="#FFFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" onload="onInit();" >
<FORM name=auxClassForm method=post action=webacc>

   <!---- WEBACC VARIABLES ---->
   <INPUT type=hidden name="taskId" value="<%= c.var("taskId") %>">
   <INPUT type=hidden name="User.context" value="<%= c.var("User.context") %>">
   <!---- eDir Access Service VARIABLES ---->
   <INPUT type=hidden name="eDir$target" value="<%= c.var("eDir$target") %>">
   <INPUT type=hidden name="merge" value="dev.GenConf">
   <INPUT type=hidden name="error" value="dev.GenErr">
   <INPUT type=hidden name="nextState">
   <INPUT type=hidden name="className" value="<%= c.var("className") %>">

   <!---- Shared Form Code ---->
    <%
    c.set("TaskHeader.title", c.plus(c.plus(c.string("ExtendObjectTaskDisplayName"), " - "), c.var("Task.targetDisplayName")));
    c.set("TaskHeader.iconUrl", "dir/auxclass.gif");
    c.set("TaskHeader.iconAlt", c.string("ExtendIconAlt"));
    if(c.var("isMultipleObject").equals("true"))
    {
    	c.set("TaskHeader.helpFile", "fw/objectextensions.html");
    }	
    %>
    <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" /><BR>
 	
    <% if(c.var("isMultipleObject").equals("true")){ %>   
 	<TABLE border="0" cellspacing="0" cellpadding="2">

    <TR valign="baseline">
        <TD>
            <%= c.toDisplay(c.string("OS.Browser.SelectedObjects")) %>
        </TD>
    </TR>
    <TR>
        <TD class="smalltext">
        <IFRAME class="smalltext" src="webacc?taskId=<%= c.var("taskId") %>&merge=fw.TCPreviewFilter&User.context=<%= c.var("User.context") %>&nextState=doShowExtensions&eDir$target=<%= c.urlEncode(c.var("eDir$target"))%>" name="selectedObj" style="width:450px;height:100px "></IFRAME>
        </TD>
    </TR>
     <TR height="10"><TD></TD></TR>
    </TABLE>
    <% } %>
   
    <TABLE border="0" cellspacing="0" cellpadding="2">

    <TR valign="baseline">
        <TD>
            <% if(c.var("isMultipleObject").equals("true")){    %>
            <%= c.toDisplay(c.string("ExtendObjectCommonAux")) %>
            <% } else {    %>
            <%= c.toDisplay(c.string("ExtendObjectCurrentAux")) %>
            <% } %>
        </TD>

        <TD>
        </TD>
    </TR>

    <TR valign="baseline">
        <TD>
            <select style="width:300" name=auxClasses size=8>
            	<% c.set("i", "0"); 
	               while (c.lt(c.var("i"), c.var("auxClass.count"))) { %>
	                <option><%= c.toDisplay(c.var("auxClass."+c.var("i"))) %></option>
            		<% c.inc("i"); 
            	   } %>
            </select>
        </TD>

        <TD valign="top">
            <table border=0 cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <A href="javascript: showClasses();">
                    <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Add.image") %>" border=0></A>
                </td>
            </tr>
            <tr>
                <td>
                    	<% if (c.var("auxClass.count").equals("0")) { %>
                              <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Remove.image") %>" border=0>
					<% } else { %>
	                    <A href="javascript: removeClass();">
	                    <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Remove.image") %>" border=0></A>
					<% } %>
					</a>
                </td>
            </tr>
            </table>
        </TD>


    </TR>

    </TABLE>

    <TABLE width="100%" border="0" cellspacing="0" cellpadding="2" height="25">
      <TR>
         <TD>&nbsp;</TD>
      </TR>
      <TR>
         <TD><jsp:include page='<%= c.getPath("dev/Bar_inc.jsp") %>' flush="true" /></TD>
      </TR>
      <tr>
         <td>
            <A href="webacc?taskId=<%= c.var("taskId") %>&taskComplete=true&User.context=<%= c.var("User.context") %>"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Close.image") %>" border=0></A>
            <A href="webacc?taskId=base.ExtendObjects&merge=fw.ExtendObject&nextState=initialState&User.context=<%= c.var("User.context") %>"><IMG alt="<%= c.string("Button.RepeatTask.alt") %>" title="<%= c.string("Button.RepeatTask.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.RepeatTask.image") %>" border=0></a>
         </td>
      </tr>
   </table>


</form>

</BODY>
</HTML>

