function Novo()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $obj_permissoes = new clsPermissoes();
     $permite_cadastrar = $obj_permissoes->permissao_cadastra(829, $this->pessoa_logada, 3, "", true);
     if (!$permite_cadastrar) {
         echo "<script>window.parent.fechaExpansivel( '{$_GET['div']}');</script>";
         die;
     }
     $obj = new clsPmieducarSubnivel(null, $this->pessoa_logada, $this->pessoa_logada, null, $this->ref_cod_nivel);
     $obj->desativaTodos();
     if ($this->nm_nivel) {
         $nivel_anterior = null;
         foreach ($this->nm_nivel as $id => $nm_nivel) {
             $obj_nivel = new clsPmieducarSubnivel($this->cod_nivel[$id], $this->pessoa_logada, $this->pessoa_logada, $nivel_anterior, $this->ref_cod_nivel, $nm_nivel, null, null, 1, str_replace(',', '.', str_replace('.', '', $this->salario_base[$id])));
             if ($obj_nivel->existe()) {
                 $obj_nivel->edita();
                 $nivel_anterior = $this->cod_nivel[$id];
             } else {
                 $nivel_anterior = $obj_nivel->cadastra();
             }
         }
         echo "<script>window.parent.fechaExpansivel( '{$_GET['div']}');</script>";
         die;
     }
     $this->mensagem = "Cadastro n&atilde;o realizado.<br>";
     echo "<!--\nErro ao cadastrar clsPmieducarNivel\nvalores obrigatorios\nis_numeric( {$this->ref_cod_categoria_nivel} ) && is_numeric( {$this->ref_usuario_cad} ) && is_numeric( {$this->ref_cod_nivel_anterior} ) && is_string( {$this->nm_nivel} )\n-->";
     return false;
 }