<%@  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"); 
   c.stringTable("BaseResources"); %>
<HTML>
<HEAD>
<TITLE><%= c.toDisplay(c.string("DevelopersForm.Task.DisplayName")) %></TITLE>
<LINK   href="<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>"
        rel="styleSheet"
        type="text/css">

<script language="JavaScript">


    /*******************
     * FUNCTION HEADER *
     *******************/
    function nextSelected()
    {
        if(checkRequiredFields() == false)
        {
            return false;
        }

        var form = document.DeveloperFileForm;

        var strURL = "webacc?";
        strURL += "taskId=fw.Developer";
        strURL += "&merge=fw.DeveloperModule";
        strURL += "&nextState=DeveloperModulePage";
        strURL += "&Task.SelectedButton=NextFileButton";
        strURL += "&error=dev.GenErr";

        if(form.DF_FileSelection[1].checked == true)
        {

            strURL += "&DF_FileSelection=DF_ExistingFile";
            strURL += "&DF_FileName=";
            strURL += form.DF_FileName.value;
        }
        else
        {
            strURL += "&DF_FileSelection=DF_NewFile";
        }


        form.target = "Content";
        form.action = strURL;
        form.submit();
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function backSelected()
    {
        var form = document.DeveloperFileForm;

        var strURL = "webacc?";
        strURL += "taskId=fw.Developer";
        strURL += "&merge=fw.DeveloperIntro";
        strURL += "&nextState=DeveloperIntroPage";
        strURL += "&Task.SelectedButton=BackFileButton";
        strURL += "&error=dev.GenErr";

        form.target = "Content";
        form.action = strURL;
        form.submit();
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function checkRequiredFields()
    {
        var form = document.DeveloperFileForm;

        if(form.DF_FileSelection[1].checked == true)
        {
            var fileName = form.DF_FileName.value;
            if ((fileName == null) || (fileName.length == 0))
            {
                alert("<%= c.toScript(c.string("DevelopersForm.FileOption.NoFile")) %>");
                return false;
            }
        }
        return true;
    }
    /*******************
     * FUNCTION HEADER *
     *******************/
    function enableTextBox()
    {
        var form = document.DeveloperFileForm;
        if(form.DF_FileSelection[0].checked)
        {
            form.DF_FileName.disabled=true;
        }
        else
        {
           form.DF_FileName.disabled=false;

        }
        return true;
    }
     /*******************
     * FUNCTION HEADER *
     *******************/
    function disableFileBox()
    {
       var form = document.DeveloperFileForm;
       form.DF_FileName.disabled=true;
       return true;
    }


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

      }
      return true;
   }



</SCRIPT>
</HEAD>

<BODY   TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF"onLoad="enableTextBox()" >
<form   name="DeveloperFileForm"
        method="post"
	     onSubmit="return(nextSelected());"
        action="fw.Developer"
        enctype="multipart/form-data">

	<!-- ************ -->
	<!-- HEADER TABLE -->
	<!-- ************ -->
    <% c.set("WizardHeader.title", c.toDisplay(c.string("DevelopersForm.Wizard.Header")));
       c.set("WizardHeader.subtitle", c.toDisplay(c.string("Schema.Step1"))); 
       c.set("WizardHeader.instruction", c.toDisplay(c.string("DevelopersForm.FileOption.Step"))); 
       c.set("WizardHeader.helpFile", "base/xmlinstallfile_createoredit.html"); %>
    <jsp:include page='<%= c.getPath("dev/WizardHeader_inc.jsp") %>' flush="true" />
 
	<!-- ************************* -->
	<!-- STEPS & INSTRUCTION TABLE -->
	<!-- ************************* -->
    <!--<table border="0" cellspacing="0" cellpadding="2" width="90%">
        <tr valign="baseline"> 
            <td height="16" colspan="7" align="center" valign="middle" class="instructions"> 
                <div align="left"><%= c.toDisplay(c.string("DevelopersForm.FileOption.Instruction")) %></div>
            </td>
        </tr>
        <tr valign="baseline">
            <td height="16" colspan="5" align="center" valign="middle" class="mediumtext">
                &nbsp;
            </td>
        </tr>
    </table>-->
    
    <!-- ************* -->
    <!-- CONTENT TABLE -->
    <!-- ************* -->
    <table border="0" cellspacing="0" cellpadding="2">
        <tr valign="baseline"> 
            <td class="mediumtext">
                <input  type="radio"
                        name="DF_FileSelection"
                        value="DF_NewFile"
                        checked onClick="enableTextBox()"/>
            </td>
            <td class="mediumtext">
                <%= c.toDisplay(c.string("DevelopersForm.FileOption.NewFile")) %>
            </td>
        </tr>
        <tr valign="baseline"> 
            <td class="mediumtext">
                <input  type="radio"
                        name="DF_FileSelection"
                        value="DF_ExistingFile" onClick="enableTextBox()"/>
            </td>
            <td class="mediumtext">
                <%= c.toDisplay(c.string("DevelopersForm.FileOption.ExistingFile")) %>
            </td>
        </tr>
        <tr valign="baseline"> 
            <td>
                &nbsp;
            </td>
            <td class="mediumtext">
                <input  type="file"
                        name="DF_FileName"
                        size="45"
                        accept="text/xml" onkeypress="return checkDefaultKey(event)"/>
            </td>
        </tr>
    </table>
    
	<!-- ************ -->
	<!-- BUTTON TABLE -->
	<!-- ************ -->
    <table width="85%" border="0" cellspacing="0" cellpadding="0" height="25">
        <tr valign="baseline" bgcolor="#FFFFFF">
            <td height="16" colspan="5" align="center" valign="middle" class="mediumtext">
                &nbsp;
            </td>
            <td height="16" align="left" valign="middle" colspan="2" class="mediumtext">
                &nbsp;
            </td>
        </tr>
        <tr> 
            <td colspan="2" height="23" class="ruleabove">
                <a href="#" onClick="javascript:backSelected();return false">
                    <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Back.image") %>"
                    alt="<%= c.string("Button.Back.alt") %>"
                    title="<%= c.string("Button.Back.alt") %>"
                    border=0></a>
                <a href="#" onClick="javascript:nextSelected();return false">
                    <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Next.image") %>"
                    alt="<%= c.string("Button.Next.alt") %>"
                    title="<%= c.string("Button.Next.alt") %>"
                    border=0></a><jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
            </td>
        </tr>
    </table>
</form>
</BODY></HTML>

