<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- 
    Document   : PlanoActuacao
    Created on : Aug 26, 2008, 3:10:59 PM
    Author     : lluis
-->
<jsp:root version="2.1" 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:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1"/>
    <f:view>
        <webuijsf:page id="page1">
            <webuijsf:html id="html1">
                <webuijsf:head id="head1">
                    <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    <script>
                        function goToAnchor()
                        {
                            //document.location.href="#plano";
                            location.href="#plano";                            
                        }
                        function setButEnviarText(chk, index)
                        {
                            if(chk == null)  // dropDown
                            {
                                hid = document.getElementById("form1:hidValidacao");                                
                                if(hid.value == "dns")
                                {
                                    var butEnviar = document.getElementById("form1:groupPanel2:butEnviar");                                                                        
                                    var drp = document.getElementById("form1:groupPanel2:drpIrPara"); 
                                    //var fase = drp.selectedIndex;
                                    var fase = index;

                                    switch(fase)
                                    {
                                        case 0:
                                            butEnviar.value = "Enviar para Responsável de segurança&gt;&gt;";
                                            break;
                                            
                                        case 1:
                                            butEnviar.value = "Enviar para Director de loja&gt;&gt;";
                                            break;                                            
                                    }
                                }
                            }
                            //else
                            //{
                            //    hid = document.getElementById("form1:hidValidacao");                                
                            //    if(hid.value == "dir_loja")
                            //    {
                            //        var butEnviar = document.getElementById("form1:groupPanel2:butEnviar");                                    
                            //        if(chk.checked)
                            //        {
                            // 
                            //            butEnviar.value = "Enviar para DNS";                                    }
                            //        else
                            //        {
                            //            butEnviar.value = "Enviar para Responsável de segurança";                                        
                            //        }
                            //    }
                            //}
                        }
                        
                        function showDns()
                        {
                            var chk = document.getElementById("form1:groupPanel3:chkValidacao");
                           hid = document.getElementById("form1:hidValidacao");
                           if(hid.value == 'dns')
                           {
                               if(chk.checked)
                               {
                                    document.getElementById("form1:gridParecer").className = "";                               
                                    document.getElementById("form1:groupPanel2:stIrPara").className = "hidden";                                
                                    document.getElementById("form1:groupPanel2:drpIrPara").className = "hidden";                                                                
                                    var butEnviar = document.getElementById("form1:groupPanel2:butEnviar");                                                                                                            
                                    butEnviar.value = "Enviar para Técnico de HS&gt;&gt;";                                                                            
                               }    
                               else
                               {
                                    document.getElementById("form1:gridParecer").className = "hidden";
                                    document.getElementById("form1:groupPanel2:stIrPara").className = "";                                
                                    document.getElementById("form1:groupPanel2:drpIrPara").className = ""; 
                                    setButEnviarText(null, 0);
                               }                               
                           }
                        }
                        
                        function show(chk)
                        {
                           hid = document.getElementById("form1:hidValidacao");
                           //alert('hid : ' + hid.value);
                           //alert('chk : ' + chk.checked);                           

                           if(chk.checked)
                           {
                               if(hid.value == 'dir_loja')
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviar',{"id":"form1:groupPanel2:butEnviar","widgetType":"webui.suntheme4_2.widget.button","style":"width: 223px","visible":true,"primary":false,"value":"Enviar a Director Nacional Segurança&gt;&gt;","escape":true,"mini":false,"disabled":false});                                   
                                    //var but = document.getElementById("form1:groupPanel2:butEnviar");
                                    //but.disabled = false;
                               }
                               else if(hid.value == 'dns')
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviar',{"id":"form1:groupPanel2:butEnviar","widgetType":"webui.suntheme4_2.widget.button","style":"width: 223px","visible":true,"primary":false,"value":"Enviar para Técnico HS&gt;&gt;","escape":true,"mini":false,"disabled":false});                                                                      
                               }
                               else if(hid.value == 'hs')
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviar',{"id":"form1:groupPanel2:butEnviar","widgetType":"webui.suntheme4_2.widget.button","style":"width: 223px","visible":true,"primary":false,"value":"Concluir","escape":true,"mini":false,"disabled":false});                                                                                                         
                               }
                           }
                           else
                           {
                               if(hid.value == 'dir_loja')
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviar',{"id":"form1:groupPanel2:butEnviar","widgetType":"webui.suntheme4_2.widget.button","style":"width: 223px","visible":true,"primary":false,"value":"Enviar a Director Nacional Segurança&gt;&gt;","escape":true,"mini":false,"disabled":true});                                   
                               }
                               else if(hid.value == 'dns')
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviar',{"id":"form1:groupPanel2:butEnviar","widgetType":"webui.suntheme4_2.widget.button","style":"width: 223px","visible":true,"primary":false,"value":"Enviar para Técnico HS&gt;&gt;","escape":true,"mini":false,"disabled":true});                                                                      
                               }
                               else if(hid.value == 'hs')
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviar',{"id":"form1:groupPanel2:butEnviar","widgetType":"webui.suntheme4_2.widget.button","style":"width: 223px","visible":true,"primary":false,"value":"Concluir","escape":true,"mini":false,"disabled":true});                                                                                                         
                               }
                           }
                           if(hid.value == 'dns')
                           {
                               if(chk.checked)
                               {
                                    //document.getElementById("form1:gridParecer").className = ""; 
                                    //document.getElementById("form1:groupPanel2:butEnviarCorrecao").disabled = true;
                                    //document.getElementById("form1:groupPanel2:butEnviarCorrecao").className = "Btn2Dis_sun4";     
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviarCorrecao',{"id":"form1:groupPanel2:butEnviarCorrecao","widgetType":"webui.suntheme4_2.widget.button","visible":true,"primary":false,"value":"Enviar correcão","escape":false,"mini":false,"disabled":true});                                    
                                    //document.getElementById("_form1:groupPanel2:stIrPara").className = "hidden";                                
                                    //document.getElementById("form1:groupPanel2:drpIrPara").className = "hidden";                                                                
                                    //var butEnviar = document.getElementById("form1:groupPanel2:butEnviar");                                                                                                            
                                    //butEnviar.value = "Enviar para Técnico de HS&gt;&gt;";                                                                            
                               }    
                               else
                               {
                                    //document.getElementById("form1:gridParecer").className = "hidden";
                                    //document.getElementById("form1:groupPanel2:butEnviarCorrecao").disabled = false;                                    
                                    //document.getElementById("form1:groupPanel2:butEnviarCorrecao").className = ""; 
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviarCorrecao',{"id":"form1:groupPanel2:butEnviarCorrecao","widgetType":"webui.suntheme4_2.widget.button","visible":true,"primary":false,"value":"Enviar correção","escape":false,"mini":false,"disabled":false});                                    
                                    //document.getElementById("_form1:groupPanel2:stIrPara").className = "";                                
                                    //document.getElementById("form1:groupPanel2:drpIrPara").className = ""; 
                                    //setButEnviarText(null, 0);
                               }                               
                           } 
                           else if(hid.value == 'dir_loja')
                           {
                               if(chk.checked)
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviarCorrecao',{"id":"form1:groupPanel2:butEnviarCorrecao","widgetType":"webui.suntheme4_2.widget.button","visible":true,"primary":false,"value":"Enviar correcão","escape":false,"mini":false,"disabled":true});                                                                       
                                    //var butEnviarCor = document.getElementById("form1:groupPanel2:butEnviarCorrecao");                                                                                                            
                                    //alert(butEnviarCor.disabled);
                                    //butEnviarCor.disabled = true;
                               }
                               else
                               {
                                    webui.suntheme4_2.widget.common._createWidget('_form1:groupPanel2:butEnviarCorrecao',{"id":"form1:groupPanel2:butEnviarCorrecao","widgetType":"webui.suntheme4_2.widget.button","visible":true,"primary":false,"value":"Enviar correção","escape":false,"mini":false,"disabled":false});                                                                       
                                    //var butEnviar = document.getElementById("form1:groupPanel2:butEnviar");                                                                                                            
                                    //butEnviar.value = "Enviar para Responsável de Segurança&gt;&gt;";                                                                                                               
                               }
                           }

                        }
                    </script>
                </webuijsf:head>
                <webuijsf:body id="body1">
                    
                        <div style="left: 0px; top: 0px; width: 100%">
                            <jsp:directive.include file="Header.jspf"/>
                        </div>
						<webuijsf:form id="form1">
                        <h:inputHidden binding="#{EditarPlano.hidValidacao}" id="hidValidacao"/>
                        <h:panelGrid columns="1" id="gridBaseLayout" style="left: 0px; top: 76px; position: absolute; width: 100%" styleClass="centerBlock">
                            <webuijsf:staticText escape="false" id="staticText1" style="" text="&amp;nbsp;"/>
                            <h:panelGrid columnClasses="gridColCenter" columns="1" id="gridMsg" style="height: 24px; width: 100%">
                                <webuijsf:staticText binding="#{EditarPlano.lblMsg}" escape="false" id="lblMsg" styleClass="labelMsg   "/>
                                <webuijsf:staticText binding="#{EditarPlano.lblObs}" escape="false" id="lblObs" style="color: #1d3fe3" styleClass="labelMsg    "/>
                            </h:panelGrid>
                            <h:panelGrid columnClasses="gridColLeft10,gridColLeft90" columns="2" id="gridEmpresa"
                                style="background-color: #668597; border: 1px solid black; height: 24px; width: 80%" styleClass="centerBlock" width="504">
                                <webuijsf:staticText escape="false" id="staticText5" styleClass="label" text="Empresa:"/>
                                <webuijsf:staticText binding="#{EditarPlano.stNomeEmpresa}" escape="false" id="stNomeEmpresa" style="color: #ffffff" text="#{SessionBean1.planoActuacao.nome_empresa}"/>
                                <webuijsf:staticText escape="false" id="staticText7" styleClass="label" text="Estabelecimento:"/>
                                <webuijsf:staticText escape="false" id="staticText8" style="color: #ffffff" text="#{SessionBean1.planoActuacao.nome_estabelecimento}"/>
                            </h:panelGrid>
                            <webuijsf:staticText escape="false" id="staticText4" text="&amp;nbsp;"/>
                            <h:panelGrid binding="#{EditarPlano.gridLayout}" columnClasses="gridColLeft" columns="1" id="gridLayout"
                                style="border: 1px solid black; background-color: #eeeeee; height: 24px; width: 80%" styleClass="centerBlock">
                                <h:panelGrid binding="#{EditarPlano.gridPlano}" columnClasses="gridColCenter" columns="1" id="gridPlano" style="height: 24px; width: 100%"/>
                                <h:panelGrid binding="#{EditarPlano.gridPagination}" columnClasses="gridColCenter" columns="1" id="gridPagination"
                                    style="height: 24px; width: 60%" styleClass="centerBlock" width="408">
                                    <webuijsf:panelGroup binding="#{EditarPlano.grpPagination}" id="grpPagination"/>
                                </h:panelGrid>
                                <h:panelGrid binding="#{EditarPlano.gridValidar}" columns="1" id="gridValidar"
                                    style="background-color: #f6f4e8; border: 1px solid rgb(165, 163, 163); height: 24px; width: 100%" width="408">
                                    <h:panelGrid binding="#{EditarPlano.gridValidacoes}" columnClasses="gridColLeft" columns="1" id="gridValidacoes" style="height: 24px; width: 100%"/>
                                    <h:panelGrid binding="#{EditarPlano.gridValidar2}" columnClasses="gridColLeft" columns="1" id="gridValidar2" style="height: 24px; width: 100%">
                                        <h:panelGrid binding="#{EditarPlano.gridObservacoes}" columnClasses="gridColLeft" columns="1" id="gridObservacoes" style="height: 24px; width: 100%"/>
                                        <webuijsf:panelGroup id="groupPanel3">
                                            <webuijsf:staticText id="staticText2" styleClass="label" text="Validar processo:"/>
                                            <webuijsf:checkbox binding="#{EditarPlano.chkValidacao}" id="chkValidacao" onClick="show(this)" valueChangeListenerExpression="#{EditarPlano.chkValidacao_processValueChange}"/>
                                        </webuijsf:panelGroup>
                                    </h:panelGrid>
                                </h:panelGrid>
                            </h:panelGrid>
                            <h:panelGrid columns="1" id="gridButtons1" style="height: 24px; width: 80%" styleClass="centerBlock">
                                <h:panelGrid columnClasses="gridColLeft,gridColRight" columns="2" id="gridPanel1" style="height: 24px; width: 100%">
                                    <webuijsf:button actionExpression="#{EditarPlano.butLimparDados_action}" binding="#{EditarPlano.butLimparDados}"
                                        id="butLimparDados" style="width: 95px" text="Limpar dados"/>
                                    <webuijsf:panelGroup id="groupPanel1" style="width: 194px">
                                        <webuijsf:button actionExpression="#{EditarPlano.butGravarPlano_action}" binding="#{EditarPlano.butGravarPlano}"
                                            id="butGravarPlano" style="width: 95px" text="Gravar Plano"/>
                                        <webuijsf:button actionExpression="#{EditarPlano.butGravarRisco_action}" binding="#{EditarPlano.butGravarRisco}"
                                            id="butGravarRisco" style="width: 95px" text="Gravar Risco&gt;&gt;"/>
                                    </webuijsf:panelGroup>
                                </h:panelGrid>
                                <h:panelGrid columnClasses="gridColLeft,gridColRight" columns="2" id="gridPanel2" style="height: 24px; width: 100%">
                                    <webuijsf:button actionExpression="#{EditarPlano.butCancelar_action}" binding="#{EditarPlano.butCancelar}" id="butCancelar"
                                        onClick="location.href='#plano'" style="width: 95px" text="Cancelar"/>
                                    <webuijsf:panelGroup id="groupPanel2" style="width: 194px">
                                        <webuijsf:button actionExpression="#{EditarPlano.butEnviarCorrecao_action}" binding="#{EditarPlano.butEnviarCorrecao}"
                                            escape="false" id="butEnviarCorrecao" text="&amp;lt;&amp;lt;Enviar correc&amp;ccedil;&amp;atilde;o"/>
                                        <webuijsf:button actionExpression="#{EditarPlano.butEnviar_action}" binding="#{EditarPlano.butEnviar}" id="butEnviar" style="width: 223px"/>
                                    </webuijsf:panelGroup>
                                </h:panelGrid>
                            </h:panelGrid>
                            <h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel3" style="height: 24px; width: 80%" styleClass="centerBlock">
                                <webuijsf:panelGroup id="groupPanel4" style="border-bottom: solid white 2px; ">
                                    <webuijsf:staticText escape="false" id="staticText9" text="Software desenvolvido por&amp;nbsp;"/>
                                    <webuijsf:image id="image1" url="/resources/images/logo_evolute_small.png"/>
                                    <webuijsf:staticText escape="false" id="staticText10" text="&amp;nbsp;&amp;copy; 2008"/>
                                </webuijsf:panelGroup>
                            </h:panelGrid>
                            <h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel4" style="height: 24px; width: 80%" styleClass="centerBlock">
                                <f:verbatim>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                    <br/>
                                </f:verbatim>
                                <webuijsf:staticText escape="false" id="staticText3" text="&amp;nbsp;"/>
                            </h:panelGrid>
                        </h:panelGrid>
						</webuijsf:form>
                    <script type="text/javascript">
                    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
                    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
                    </script>
                    <script type="text/javascript">
                    try {
                    var pageTracker = _gat._getTracker("UA-6942416-1");
                    pageTracker._trackPageview();
                    } catch(err) {}</script>
                </webuijsf:body>
            </webuijsf:html>
        </webuijsf:page>
    </f:view>
</jsp:root>
