<%@ page extends="oneit.servlets.jsp.JSPInclude" %>

<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>

<%
    JobApplication  jobApplication          =   (JobApplication) process.getAttribute("JobApplication");
    String          pageNumber              =   (String)  getData(request, "PageNumber");
    String          firstPage               =   WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
    String          secondPage              =   WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture");
    String          thirdPage               =   WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment");
    boolean         includeAssessment       =   jobApplication.isIncludeAssessmentCriteria();
    
//    Boolean         alreadyCompletedCulture =   (Boolean) process.getAttribute("AlreadyCompletedCulture");
//    Boolean         alreadyCompletedRole    =   (Boolean) process.getAttribute("AlreadyCompletedRole");
    Boolean         isSelectionComplete     =   jobApplication.selectionCompleted(); //REQ
    Boolean         isCultureComplete       =   jobApplication.cultureCompleted();
    Boolean         isAssesmentComplete     =   jobApplication.assessmentCompleted();
    boolean         fromRequirements        =   pageNumber == "1";

%>

<oneit:dynIncluded>

    <div class="main-tab-form">
        <ul class="nav nav-pills nav-justified">
        <%
            if(includeAssessment)
            {
        %>
                <li class="<%= pageNumber == "1" ? "active" : isSelectionComplete ? "complate" : ""%>">
                    <oneit:button   value=" "   name="gotoPage" skin="link"
                                    requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
                                                                    .toMap() %>">
                        <span><%= isSelectionComplete ? "<img src=\"images/right-mark.png\" />" : "1"%></span>
                        <div class="mobile-hide">Your Experience</div>
                    </oneit:button>
                </li>
        <%
            }
        %>
            <li class="<%= pageNumber == "2" ? "active" : isCultureComplete ? "complate" : ""%>">
                <oneit:button   value=" "   name="validateApplication"  skin="link" disabled="<%= isCultureComplete ? "true" : "false"%>"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
                                                                .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
                                                                .mapEntry("fromRequirements", fromRequirements)
                                                                .toMap() %>">
                    <span><%= isCultureComplete ? "<img src=\"images/right-mark.png\" />" : (includeAssessment ? "2" : "1")%></span>
                    <div class="mobile-hide">Workplace Preferences</div>
                </oneit:button>
            </li>
            <li class="<%= pageNumber == "3" ? "active" :  isAssesmentComplete ? "complate" : ""%>">
                <oneit:button   value=" "   name="validateApplication"  skin="link" disabled="<%= isAssesmentComplete ? "true" : "false"%>"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
                                                                    .mapEntry("fromRequirements", fromRequirements)
                                                                    .toMap() %>">
                    <span><%= isAssesmentComplete ? "<img src=\"images/right-mark.png\" />" : (includeAssessment ? "3" : "2")%></span>
                    <div class="mobile-hide">Your Work Style</div>
                </oneit:button>
            </li>
            <li><a href="#"><span><%= includeAssessment ? "4" : "3" %></span><div class="mobile-hide">Submit Application</div></a></li>
        </ul>
    </div>
</oneit:dynIncluded>
