<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)WizardButtons.jsp    1.16    03/09/30     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<!-- locale stuff -->
<html:html locale="true">
<!-- end locale -->
<head>
<%@include file="/layout/page_head_section.jsp"%>
</head>

<body class="wizard-navigation-body">
<% boolean shouldDisable = false; 
   boolean needFinishButton = false; 
   boolean disableBackOnly = false;
   if(session.getAttribute("disableBackOnly") != null) { 
    disableBackOnly = true;
   } 
   if(session.getAttribute("disableNext") != null) { 
    shouldDisable = true;
   } 
   if(session.getAttribute(Constants.HttpSessionFields.NEED_FINISH_BUTTON) != null) { 
    needFinishButton = true;
   } 
%>

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  <tr>
   <% if(!shouldDisable) { %>
    <td width="30%" valign="top" align="left"></td>
    <td width="70%">
      <table border="0" cellpadding="0" cellspacing="5" width="100%">
        <tr>
          <td>
            <logic:equal name="wizardframework" property="activePage" value="0">
            <!-- Disabled button -->
            <table border="0" cellpadding="1" cellspacing="0" class="button-frame-disabled">
              <tr>
                <td>
                  <table border="0" cellpadding="0" cellspacing="0" class="button-content-disabled">
                    <tr>
                      <td align="center" valign="middle" nowrap>
                          <!-- Disabled button -->
                          <div class="wizard-button-disabled-text">
                            <img alt="<bean:message key="wizard.alt.back"/>" src="images/general/wizard-back-disabled.gif" width="17" height="13">
                            <bean:message key="wizard.back"/>
                          </div>
            </logic:equal>
            <!-- End disabled button -->

            <!-- Enabled button -->
            <logic:notEqual name="wizardframework" property="activePage" value="0">
            
            <% if(disableBackOnly) { %>
            <table border="0" cellpadding="1" cellspacing="0" class="button-frame-disabled">
              <tr>
                <td>
                  <table border="0" cellpadding="0" cellspacing="0" class="button-content-disabled">
                    <tr>
                      <td align="center" valign="middle" nowrap>
                          <!-- Disabled button -->
                          <div class="wizard-button-disabled-text">
                            <img alt="<bean:message key="wizard.alt.back"/>" src="images/general/wizard-back-disabled.gif" width="17" height="13">
                            <bean:message key="wizard.back"/>
                          </div>
            <% } else {%>
            <table border="0" cellpadding="1" cellspacing="0" class="button-frame-enabled">
              <tr>
                <td>
                  <table border="0" cellpadding="0" cellspacing="0" class="button-content-enabled">
                    <tr>
                      <td align="center" valign="middle" nowrap>
                          <div class="button-link-enabled-text">
                          <a href="javascript:parent.previousPage()" class="mini-button-link">
                            <img alt="<bean:message key="wizard.alt.back"/>" src="images/general/wizard-back.gif" width="17" height="13" border="0">
                              <bean:message key="wizard.back"/>
                            </a>
                          </div>
            <% }%>
            </logic:notEqual>
			<!-- end Enabled Button -->

                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
          <td width="90%">
                <table border="0" cellpadding="1" cellspacing="0" class="button-frame-enabled">
              <tr>
                <td>
                  <table border="0" cellpadding="0" cellspacing="0" class="button-content-enabled">
                    <tr>
                      <td align="center" valign="middle" nowrap>
                        <logic:lessThan name="wizardframework" property="activePage" value='<%=new Integer(Integer.parseInt(request.getParameter("totalPages"))-1).toString()%>'>
                          <div class="button-link-enabled-text">
                            <a href="javascript:parent.nextPage()" title="Next" class="mini-button-link"><bean:message key="wizard.next"/>
                              <img alt="<bean:message key="wizard.alt.next"/>" src="images/general/wizard-next.gif" border="0" width="17" height="13"></a>
                          </div>
                        </logic:lessThan>
                        <logic:greaterEqual name="wizardframework" property="activePage" value='<%=new Integer(Integer.parseInt(request.getParameter("totalPages"))-1).toString()%>'>
                          <div class="button-link-enabled-text">
                            <a href="javascript:parent.confirmChoices()" title="Next" class="mini-button-link"> <bean:message key="wizard.confirm"/> </a>
                          </div>
                        </logic:greaterEqual>
                      </td>
                    </tr>
                  </table>
                </td>

              </tr>
            </table>
          </td>
          <% } %>
          <td align="right">
            <table border="0" cellpadding="1" cellspacing="0" class="button-frame-enabled">
              <tr>
                <td>
                  <table border="0" cellpadding="0" cellspacing="0" class="button-content-enabled">
                    <tr>
                      <td align="center" valign="middle" nowrap>
                        <% if(needFinishButton) { 
                         %>
                             <logic:greaterEqual name="wizardframework" property="activePage" value='<%=new Integer(Integer.parseInt(request.getParameter("totalPages"))-1).toString()%>'>
                              <div class="button-link-enabled-text">
                                <a href="javascript:parent.confirmChoices()" title="Next" class="mini-button-link"> <bean:message key="wizard.finish"/> </a>
                              </div>
                        </logic:greaterEqual>
                        <% } else if(session.getAttribute(
                             Constants.HttpSessionFields.NEED_CLOSE_BUTTON) != null) { 
                        %>
                              <div class="button-link-enabled-text">
                                <a href="javascript: parent.closeWindow(true);" title="<bean:message key="wizard.close"/>" class="mini-button-link"> <bean:message key="wizard.close"/> </a>
                              </div>
                        <% } else { %>
                        <div class="button-link-enabled-text">
                          <a href="javascript: parent.cancel();" title="Cancel" class="mini-button-link"> <bean:message key="wizard.cancel"/> </a>
                        </div>
                        <% } %>
                      </td>
                    </tr>
                  </table>
                </td>

              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>

</html:html>
