<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <ui:page binding="#{NovoUtilizador.page1}" id="page1">
            <ui:html binding="#{NovoUtilizador.html1}" id="html1">
                <ui:head binding="#{NovoUtilizador.head1}" id="head1">
                    <ui:link binding="#{NovoUtilizador.link1}" id="link1" url="/resources/stylesheet.css"/>
                    <script>

			function showPdf()
			{
			    sOptions = " width = '" + screen.availWidth + "'";
			    sOptions += " height= '" + screen.availHeight + "'";
			    var wOpen;
				wOpen = window.open('./resources/pdf/Ajuda.pdf','', sOptions );
			   wOpen.focus();
			   wOpen.moveTo(0,0);
			   wOpen.resizeTo( screen.availWidth, screen.availHeight );
			}                        

                        function showPanel(rb)
                        {
                            document.getElementById("form1:gridTrabalhadores").className = "hidden"; 
                            document.getElementById("form1:gridTecnicosHs").className = "hidden";  
                            document.getElementById("form1:gridMedicos").className = "hidden";  
                            //alert("XX");
                            
                            if(rb.checked)
                            {
                               if(rb.id == "form1:rbCatDirRh")
                               {
                                  document.getElementById("form1:gridTrabalhadores").className = "";
                               }
                               else if(rb.id == "form1:rbCatGestao")
                               {
                                  document.getElementById("form1:gridTrabalhadores").className = "";                               
                               }
                               else if(rb.id == "form1:rbCatHs")
                               {
                                  document.getElementById("form1:gridTecnicosHs").className = "";                               
                               }                              
                               else if(rb.id == "form1:rbCatMed")
                               {
                                  document.getElementById("form1:gridMedicos").className = "";                               
                               }                               
                               else if(rb.id == "form1:rbCatRh")
                               {
                                  document.getElementById("form1:gridTrabalhadores").className = "";                               
                               }                              
                               else if(rb.id == "form1:rbCatSeg")
                               {
                                  document.getElementById("form1:gridTrabalhadores").className = "";                               
                               }                               
                            } 
                        }
                        
                        function highlight()
                        {
                            var hid = document.getElementById("form1:hidHighlight");
                            rowNumber = hid.value;

                            document.getElementById("form1:tblTrabalhadores:tableRowGroup1:" + rowNumber + ":tableColumn1").style.background='#ffa500';
                            document.getElementById("form1:tblTrabalhadores:tableRowGroup1:" + rowNumber + ":tableColumn2").style.background='#ffa500';
                            document.getElementById("form1:tblTrabalhadores:tableRowGroup1:" + rowNumber + ":tableColumn3").style.background='#ffa500';

                            return true;                        
                        }
                        
                    </script>
                </ui:head>
                <ui:body binding="#{NovoUtilizador.body1}" id="body1" onLoad="highlight()" style="-rave-layout: grid">
                    <ui:form binding="#{NovoUtilizador.form1}" id="form1">
                        <h:panelGrid binding="#{NovoUtilizador.gridBase1}" columns="1" id="gridBase1"
                            style="height: 39px; left: 0px; top: 72px; position: absolute; width: 100%" styleClass="centerBlock">
                            <h:panelGrid binding="#{NovoUtilizador.gridLayout1}" columns="1" id="gridLayout1" style="height: 24px; width: 80%"
                                styleClass="centerBlock" width="456">
                                <h:panelGrid binding="#{NovoUtilizador.gridPanel1}" columnClasses="gridColLeft, gridColRightBottom" columns="2" id="gridPanel1"
                                    style="border-bottom: solid rgb(0, 0, 0) 1px; height: 24px; width: 100%" width="312">
                                    <ui:panelGroup binding="#{NovoUtilizador.groupPanel1}" id="groupPanel1" style="height: 24px; width: 216px">
                                        <ui:image binding="#{NovoUtilizador.image1}" id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
                                        <ui:image binding="#{NovoUtilizador.image2}" id="image2" url="/resources/images/logo_auchan_small1.jpg"/>
                                    </ui:panelGroup>
                                    <ui:panelGroup binding="#{NovoUtilizador.groupPanel2}" id="groupPanel2" style="height: 24px; width: 310px; top: 90%">
                                        <ui:staticText binding="#{NovoUtilizador.lblUser}" escape="false" id="lblUser" styleClass="labelBold "/>
                                        <ui:staticText binding="#{NovoUtilizador.staticText1}" escape="false" id="staticText1" text="   "/>
                                        <ui:hyperlink action="#{NovoUtilizador.lnkAnalisesAcidente_action}" binding="#{NovoUtilizador.lnkAnalisesAcidente}"
                                            id="lnkAnalisesAcidente" text="analisar acidentes"/>
                                        <ui:staticText binding="#{NovoUtilizador.staticText28}" escape="false" id="staticText28" text=" | "/>
                                        <ui:hyperlink action="#{NovoUtilizador.lnkNewUser_action}" binding="#{NovoUtilizador.lnkNewUser1}" disabled="true"
                                            id="lnkNewUser1" style="" text="gerir utilizadores"/>
                                        <ui:staticText binding="#{NovoUtilizador.staticText27}" escape="false" id="staticText27" text=" | "/>
                                        <ui:hyperlink action="#{NovoUtilizador.lnkEditUser_action}" binding="#{NovoUtilizador.lnkEditUser1}" id="lnkEditUser1" text="alterar dados utilizador"/>
                                        <ui:staticText binding="#{NovoUtilizador.staticText2}" escape="false" id="staticText2" text=" | "/>
                                        <ui:hyperlink action="#{NovoUtilizador.lnkAjuda_action}" binding="#{NovoUtilizador.lnkAjuda1}" id="lnkAjuda1"
                                            onClick="showPdf();" style="" text="ajuda "/>
                                        <ui:staticText binding="#{NovoUtilizador.staticText29}" id="staticText29" style="height: 22px; width: 0px" text="|"/>
                                        <ui:hyperlink action="#{NovoUtilizador.lnkLogout_action}" binding="#{NovoUtilizador.lnkLogout1}" id="lnkLogout1" text="sair&gt;&gt;"/>
                                    </ui:panelGroup>
                                </h:panelGrid>
                                <h:panelGrid binding="#{NovoUtilizador.gridMsg1}" columnClasses="gridColCenter" columns="1" id="gridMsg1"
                                    style="height: 24px; width: 100%" width="96">
                                    <ui:staticText binding="#{NovoUtilizador.txtMsg}" escape="false" id="txtMsg" style="height: 24px; width: 384px" styleClass="labelMsg"/>
                                </h:panelGrid>
                                <h:panelGrid binding="#{NovoUtilizador.gridPanel2}" cellpadding="0" cellspacing="0" columns="1" id="gridPanel2"
                                    style="border: 1px solid rgb(0, 0, 0); height: 24px; width: 100%" width="384">
                                    <h:panelGrid binding="#{NovoUtilizador.gridPanel3}" columnClasses="gridColLeft, gridColLeft" columns="1" id="gridPanel3"
                                        style="background-color: #668597; border-bottom: solid #000000 1px; height: 24px; width: 100%" width="312">
                                        <ui:panelGroup binding="#{NovoUtilizador.groupPanel3}" id="groupPanel3" style="height: 24px; width: 264px">
                                            <ui:staticText binding="#{NovoUtilizador.staticText3}" escape="false" id="staticText3"
                                                style="height: 24px; width: 120px" styleClass="labelBold" text="NOVO UTILIZADOR"/>
                                        </ui:panelGroup>
                                    </h:panelGrid>
                                    <h:panelGrid binding="#{NovoUtilizador.gridPanel4}" columns="1" id="gridPanel4" style="height: 24px; width: 80%"
                                        styleClass="centerBlock" width="480">
                                        <h:panelGrid binding="#{NovoUtilizador.gridCategoria}" columnClasses="gridColLeft" columns="1" id="gridCategoria"
                                            style="height: 24px; width: 100%" width="456">
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatDirRh}" id="pgCatDirRh" style="height: 24px; width: 312px">
                                                <ui:radioButton binding="#{NovoUtilizador.rbCatDirRh}" id="rbCatDirRh" name="categorias"
                                                    onClick="showPanel(this);" style="height: 24px; width: 24px"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText11}" escape="false" id="staticText11"
                                                    style="height: 24px; width: 240px" text="Direc&amp;ccedil;&amp;atilde;o-Geral de Recursos Humanos&#xa; "/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatGestao}" id="pgCatGestao" style="height: 24px; width: 312px">
                                                <ui:radioButton binding="#{NovoUtilizador.rbCatGestao}" id="rbCatGestao" name="categorias"
                                                    onClick="showPanel(this);" style="height: 24px; width: 24px"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText12}" escape="false" id="staticText12"
                                                    style="height: 24px; width: 240px" text="Gest&amp;atilde;o&#xa;"/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatGestaoAd}" id="pgCatGestaoAd" style="height: 24px; width: 288px">
                                                <ui:staticText binding="#{NovoUtilizador.staticText13}" escape="false" id="staticText13"
                                                    style="height: 24px; width: 240px" text="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Geral&amp;nbsp;"/>
                                                <ui:checkbox binding="#{NovoUtilizador.chkGestaoGeral}" id="chkGestaoGeral" style="height: 24px; width: 24px"/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatHs}" id="pgCatHs" style="height: 24px; width: 312px">
                                                <ui:radioButton binding="#{NovoUtilizador.rbCatHs}" id="rbCatHs" name="categorias" onClick="showPanel(this);"
                                                    style="height: 24px; width: 24px" valueChangeListener="#{NovoUtilizador.rbCatHs_processValueChange}"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText14}" escape="false" id="staticText14"
                                                    style="height: 24px; width: 240px" text="Higiene e Seguran&amp;ccedil;a&#xa; "/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatMed}" id="pgCatMed" style="height: 24px; width: 312px">
                                                <ui:radioButton binding="#{NovoUtilizador.rbCatMed}" id="rbCatMed" name="categorias" onClick="showPanel(this);" style="height: 24px; width: 24px"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText15}" escape="false" id="staticText15"
                                                    style="height: 24px; width: 240px" text="M&amp;eacute;dico&#xa; "/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatRh}" id="pgCatRh" style="height: 24px; width: 312px">
                                                <ui:radioButton binding="#{NovoUtilizador.rbCatRh}" id="rbCatRh" name="categorias" onClick="showPanel(this);"
                                                    style="height: 24px; width: 24px" valueChangeListener="#{NovoUtilizador.rbCatRh_processValueChange}"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText16}" escape="false" id="staticText16"
                                                    style="height: 24px; width: 240px" text="Recursos Humanos&#xa; "/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatRhAd}" id="pgCatRhAd" style="height: 24px; width: 288px">
                                                <ui:staticText binding="#{NovoUtilizador.staticText17}" escape="false" id="staticText17"
                                                    style="height: 24px; width: 240px" text="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Respons&amp;aacute;vel de loja&amp;nbsp;"/>
                                                <ui:checkbox binding="#{NovoUtilizador.chkRhResp}" id="chkRhResp" style="height: 24px; width: 24px"/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatSeg}" id="pgCatSeg" style="height: 24px; width: 312px">
                                                <ui:radioButton binding="#{NovoUtilizador.rbCatSeg}" id="rbCatSeg" name="categorias" onClick="showPanel(this);" style="height: 24px; width: 24px"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText18}" escape="false" id="staticText18"
                                                    style="height: 24px; width: 240px" text="Seguran&amp;ccedil;a&#xa; "/>
                                            </ui:panelGroup>
                                            <ui:panelGroup binding="#{NovoUtilizador.pgCatSegAd}" id="pgCatSegAd" style="height: 24px; width: 288px">
                                                <ui:staticText binding="#{NovoUtilizador.staticText19}" escape="false" id="staticText19"
                                                    style="height: 24px; width: 240px" text="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Respons&amp;aacute;vel de loja&amp;nbsp;"/>
                                                <ui:checkbox binding="#{NovoUtilizador.chkSegResp}" id="chkSegResp" style="height: 24px; width: 24px"/>
                                            </ui:panelGroup>
                                        </h:panelGrid>
                                        <h:panelGrid binding="#{NovoUtilizador.gridUtilizador}" columnClasses="gridColLeft" columns="1" id="gridUtilizador"
                                            style="height: 24px; width: 100%" width="456">
                                            <h:panelGrid binding="#{NovoUtilizador.gridTrabalhadores}" columnClasses="gridColLeft" columns="1"
                                                id="gridTrabalhadores" style="height: 24px; width: 90%" width="456">
                                                <ui:staticText binding="#{NovoUtilizador.txtSearchMsg1}" escape="false" id="txtSearchMsg1" rendered="false" style="color: rgb(204, 0, 0); height: 24px; width: 336px"/>
                                                <ui:panelGroup binding="#{NovoUtilizador.groupPanel6}" id="groupPanel6" style="height: 24px; width: 900px">
                                                    <ui:staticText binding="#{NovoUtilizador.staticText4}" escape="false" id="staticText4" style="width: 118px"
                                                        styleClass="labelBold" text="POR:"/>
                                                    <ui:textField binding="#{NovoUtilizador.txtNrMecanografico}" id="txtNrMecanografico" style="height: 18px; width: 144px"/>
                                                    <ui:staticText binding="#{NovoUtilizador.staticText5}" escape="false" id="staticText5" style="width: 118px"
                                                        styleClass="labelBold" text="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Nome:"/>
                                                    <ui:textField binding="#{NovoUtilizador.txtNomeTrabalhador}" id="txtNomeTrabalhador" style="height: 18px; width: 245px"/>
                                                    <ui:staticText binding="#{NovoUtilizador.staticText6}" escape="false" id="staticText6"
                                                        style="height: 24px; width: 118px" text="&amp;nbsp;&amp;nbsp;"/>
                                                    <ui:button action="#{NovoUtilizador.butProcurarTrab_action}" binding="#{NovoUtilizador.butProcurarTrab}"
                                                        id="butProcurarTrab" style="height: 24px; width: 95px" text="Procurar"/>
                                                </ui:panelGroup>
                                                <ui:table augmentTitle="false" binding="#{NovoUtilizador.tblTrabalhadores}" id="tblTrabalhadores" width="1941">
                                                    <ui:tableRowGroup binding="#{NovoUtilizador.tableRowGroup1}" id="tableRowGroup1"
                                                        sourceData="#{SessionBean1.trabalhadoresListDataProvider}" sourceVar="currentRow">
                                                        <ui:tableColumn binding="#{NovoUtilizador.tableColumn1}" headerText="POR" id="tableColumn1"
                                                            sort="numero_mecanografico" style="width: 10%" width="898">
                                                            <ui:hyperlink action="#{NovoUtilizador.lnkPOR_action}" binding="#{NovoUtilizador.lnkPOR}"
                                                                id="lnkPOR" style="width: 96px; height: 24px" text="#{currentRow.value['numero_mecanografico']}"/>
                                                        </ui:tableColumn>
                                                        <ui:tableColumn binding="#{NovoUtilizador.tableColumn2}" headerText="Nome" id="tableColumn2" sort="nome" style="width: 75%">
                                                            <ui:hyperlink action="#{NovoUtilizador.lnkNomeTrabalhador_action}"
                                                                binding="#{NovoUtilizador.lnkNomeTrabalhador}" id="lnkNomeTrabalhador"
                                                                style="height: 24px; width: 100%" text="#{currentRow.value['nome']}"/>
                                                        </ui:tableColumn>
                                                        <ui:tableColumn binding="#{NovoUtilizador.tableColumn3}" headerText="Estabelecimento" id="tableColumn3"
                                                            sort="estabelecimento" style="width: 15%">
                                                            <ui:hyperlink action="#{NovoUtilizador.lnkEstabelecimentoTrabalhador_action}"
                                                                binding="#{NovoUtilizador.lnkEstabelecimentoTrabalhador}" id="lnkEstabelecimentoTrabalhador"
                                                                style="width: 96px; height: 24px" text="#{currentRow.value['estabelecimento']}"/>
                                                        </ui:tableColumn>
                                                    </ui:tableRowGroup>
                                                </ui:table>
                                                <ui:staticText binding="#{NovoUtilizador.staticText7}" escape="false" id="staticText7"
                                                    style="height: 24px; width: 72px" text=" "/>
                                                <ui:staticText binding="#{NovoUtilizador.stOutro}" escape="false" id="stOutro" style="height: 24px; width: 72px"
                                                    styleClass="labelBold" text=" Outro"/>
                                                <h:panelGrid binding="#{NovoUtilizador.gridOutro}" columnClasses="gridColLeft15, gridColLeft85" columns="2"
                                                    id="gridOutro" style="height: 24px" width="360">
                                                    <ui:staticText binding="#{NovoUtilizador.staticText9}" escape="false" id="staticText9" style="width: 72px"
                                                        styleClass="labelBold" text="Designa&amp;ccedil;&amp;atilde;o:"/>
                                                    <ui:textField binding="#{NovoUtilizador.txtNomeOutro}" id="txtNomeOutro" style="height: 18px; width: 216px"/>
                                                    <ui:staticText binding="#{NovoUtilizador.staticText20}" id="staticText20" style="width: 72px"
                                                        styleClass="labelBold" text="Estabelecimento:"/>
                                                    <ui:dropDown binding="#{NovoUtilizador.drpEstabelecimentoOutro}" id="drpEstabelecimentoOutro"
                                                        items="#{SessionBean1.estabelecimentosOutroOptions}"
                                                        selected="#{SessionBean1.estabelecimentoOutroChoice}" style="height: 18px; width: 216px"/>
                                                </h:panelGrid>
                                            </h:panelGrid>
                                            <h:panelGrid binding="#{NovoUtilizador.gridTecnicosHs}" columnClasses="gridColLeft15, gridColLeft85" columns="2"
                                                id="gridTecnicosHs" style="height: 24px" width="360">
                                                <ui:staticText binding="#{NovoUtilizador.staticText21}" id="staticText21" style="width: 72px"
                                                    styleClass="labelBold" text="Nome:"/>
                                                <ui:dropDown binding="#{NovoUtilizador.drpNomeHs}" id="drpNomeHs" items="#{SessionBean1.tecnicosOptions}"
                                                    selected="#{SessionBean1.tecnicoChoice}" style="height: 18px; width: 216px"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText22}" id="staticText22" style="width: 72px"
                                                    styleClass="labelBold" text="C.A.P. nº:"/>
                                                <ui:textField binding="#{NovoUtilizador.txtCap}" id="txtCap" style="height: 18px; width: 216px"/>
                                            </h:panelGrid>
                                            <h:panelGrid binding="#{NovoUtilizador.gridMedicos}" columnClasses="gridColLeft15, gridColLeft85" columns="2"
                                                id="gridMedicos" style="height: 24px" width="360">
                                                <ui:staticText binding="#{NovoUtilizador.staticText23}" id="staticText23" style="width: 72px"
                                                    styleClass="labelBold" text="Nome:"/>
                                                <ui:dropDown binding="#{NovoUtilizador.drpNomeMed}" id="drpNomeMed" items="#{SessionBean1.medicosOptions}"
                                                    selected="#{SessionBean1.medicoChoice}" style="height: 18px; width: 216px"/>
                                                <ui:staticText binding="#{NovoUtilizador.staticText24}" id="staticText24" style="width: 72px"
                                                    styleClass="labelBold" text="Estabelecimento:"/>
                                                <ui:dropDown binding="#{NovoUtilizador.drpEstabelecimentoMed}" id="drpEstabelecimentoMed"
                                                    items="#{SessionBean1.estabelecimentosMedOptions}" selected="#{SessionBean1.estabelecimentoMedChoice}" style="height: 18px; width: 216px"/>
                                            </h:panelGrid>
                                        </h:panelGrid>
                                    </h:panelGrid>
                                    <h:panelGrid binding="#{NovoUtilizador.gridPanel6}" columns="1" id="gridPanel6" style="height: 24px; width: 90%"
                                        styleClass="centerBlock" width="336">
                                        <ui:panelGroup binding="#{NovoUtilizador.groupPanel4}" id="groupPanel4" style="height: 24px; width: 240px">
                                            <ui:staticText binding="#{NovoUtilizador.staticText10}" escape="false" id="staticText10"
                                                style="height: 24px; width: 144px" text=" "/>
                                        </ui:panelGroup>
                                    </h:panelGrid>
                                    <h:panelGrid binding="#{NovoUtilizador.gridPanel7}" columnClasses="gridColLeft, gridColRight" columns="2" id="gridPanel7"
                                        style="height: 24px; width: 80%" styleClass="centerBlock" width="336">
                                        <ui:button action="#{NovoUtilizador.butCancelar_action}" binding="#{NovoUtilizador.butCancelar}" id="butCancelar"
                                            style="height: 24px; width: 96px" text="Cancelar"/>
                                        <ui:panelGroup binding="#{NovoUtilizador.groupPanel5}" id="groupPanel5" style="height: 24px; width: 240px">
                                            <ui:button action="#{NovoUtilizador.butContinuar_action}" binding="#{NovoUtilizador.butContinuar}" id="butContinuar"
                                                style="height: 24px; width: 96px" text="Continuar &gt;&gt;"/>
                                        </ui:panelGroup>
                                    </h:panelGrid>
                                </h:panelGrid>
                                <h:panelGrid binding="#{NovoUtilizador.gridPanel8}" columnClasses="gridColCenter" columns="1" id="gridPanel8" style="height: 24px; width: 100%">
                                    <ui:panelGroup binding="#{NovoUtilizador.groupPanel7}" id="groupPanel7" style="border-bottom: solid rgb(255, 255, 255) 1px; height: 21px">
                                        <ui:staticText binding="#{NovoUtilizador.staticText25}" id="staticText25" text="Software desenvolvido por "/>
                                        <ui:image binding="#{NovoUtilizador.image3}" height="21" id="image3" url="/resources/images/logo_evolute_small.png" width="100"/>
                                        <ui:staticText binding="#{NovoUtilizador.staticText26}" escape="false" id="staticText26" text="&amp;nbsp;&amp;copy; 2008 "/>
                                    </ui:panelGroup>
                                </h:panelGrid>
                            </h:panelGrid>
                        </h:panelGrid>
                        <ui:hiddenField binding="#{NovoUtilizador.hidHighlight}" id="hidHighlight"/>
                        <ui:hiddenField binding="#{NovoUtilizador.hidClear}" id="hidClear"/>
                    </ui:form>
                </ui:body>
            </ui:html>
        </ui:page>
    </f:view>
</jsp:root>
