<?php
//
    include_once('customer_data_tab_session.php');
    session_start();
    $_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_prod']      = "";
    $_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_imag_temp'] = "";
class customer_data_tab
{
  var $nm_data;
  var $sc_page;
  var $str_lang;
  var $str_conf_reg;
  var $str_schema_all;
  var $custship_edit_form;
  var $data_terms_edit_grid;
//
  function sc_Include($path, $tp, $name)
  {
      if (($tp == "F" && !function_exists($name)) || ($tp == "C" && !class_exists($name)))
      {
          include_once($path);
      }
  } // sc_Include
//
  function controle()
  {
     global 
             
            $path_libs, $path_lib_php, $path_imag_cab, $script_case_init,
            $nmgp_num_aba, $nm_saida;
//
     $this->sc_page = $script_case_init;
     $this->sc_charset['UTF-8'] = 'utf-8';
     $this->sc_charset['ISO-8859-1'] = 'iso-8859-1';
     $this->sc_charset['SJIS'] = 'shift-jis';
     $this->sc_charset['ISO-8859-14'] = 'iso-8859-14';
     $this->sc_charset['ISO-8859-7'] = 'iso-8859-7';
     $this->sc_charset['ISO-8859-10'] = 'iso-8859-10';
     $this->sc_charset['ISO-8859-3'] = 'iso-8859-3';
     $this->sc_charset['ISO-8859-15'] = 'iso-8859-15';
     $this->sc_charset['WINDOWS-1252'] = 'windows-1252';
     $this->sc_charset['ISO-8859-13'] = 'iso-8859-13';
     $this->sc_charset['ISO-8859-4'] = 'iso-8859-4';
     $this->sc_charset['ISO-8859-2'] = 'iso-8859-2';
     $this->sc_charset['ISO-8859-5'] = 'iso-8859-5';
     $this->sc_charset['KOI8-R'] = 'koi8-r';
     $this->sc_charset['WINDOWS-1251'] = 'windows-1251';
     $this->sc_charset['BIG-5'] = 'big5';
     $this->sc_charset['EUC-CN'] = 'EUC-CN';
     $this->sc_charset['EUC-JP'] = 'euc-jp';
     $this->sc_charset['ISO-2022-JP'] = 'iso-2022-jp';
     $this->sc_charset['EUC-KR'] = 'euc-kr';
     $this->sc_charset['ISO-2022-KR'] = 'iso-2022-kr';
     $this->sc_charset['ISO-8859-9'] = 'iso-8859-9';
     $this->sc_charset['ISO-8859-6'] = 'iso-8859-6';
     $this->sc_charset['ISO-8859-8'] = 'iso-8859-8';
     $this->sc_charset['ISO-8859-8-I'] = 'iso-8859-8-i';
     $_SESSION['scriptcase']['sc_num_page'] = $script_case_init;
     $_SESSION['scriptcase']['sc_aba_iframe']['customer_data_tab'][] = "custship_edit_form";
     $_SESSION['scriptcase']['sc_aba_iframe']['customer_data_tab'][] = "data_terms_edit_grid";
//
      $NM_dir_atual = getcwd();
      if (empty($NM_dir_atual))
      {
         $str_path_sys    = (isset($_SERVER['SCRIPT_FILENAME'])) ? $_SERVER['SCRIPT_FILENAME'] : $_SERVER['ORIG_PATH_TRANSLATED'];
         $str_path_sys    = str_replace("\\", '/', $str_path_sys);
         $str_path_sys    = str_replace('//', '/', $str_path_sys);
      }
      else
      {
         $sc_nm_arquivo   = explode("/", $_SERVER['PHP_SELF']);
         $str_path_sys    = str_replace("\\", "/", str_replace("\\\\", "\\", getcwd())) . "/" . $sc_nm_arquivo[count($sc_nm_arquivo)-1];
      }
      //check publication with the prod
      $str_path_apl_url = $_SERVER['PHP_SELF'];
      $str_path_apl_url = str_replace("\\", '/', $str_path_apl_url);
      $str_path_apl_url = str_replace('//', '/', $str_path_apl_url);
      $str_path_apl_url = substr($str_path_apl_url, 0, strrpos($str_path_apl_url, "/"));
      $str_path_apl_url = substr($str_path_apl_url, 0, strrpos($str_path_apl_url, "/")+1);
      $str_path_apl_dir = substr($str_path_sys, 0, strrpos($str_path_sys, "/"));
      $str_path_apl_dir = substr($str_path_apl_dir, 0, strrpos($str_path_apl_dir, "/")+1);
      //check prod
      if(empty($_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_prod']))
      {
              /*check prod*/$_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_prod'] = $str_path_apl_url . "_lib/prod";
      }
      //check tmp
      if(empty($_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_imag_temp']))
      {
              /*check tmp*/$_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_imag_temp'] = $str_path_apl_url . "_lib/tmp";
      }
      //end check publication with the prod
     $str_path_web    = $_SERVER['PHP_SELF'];
     $str_path_web    = str_replace("\\", '/', $str_path_web);
     $str_path_web    = str_replace('//', '/', $str_path_web);
     $root            = substr($str_path_sys, 0, -1 * strlen($str_path_web));
     $path_aplicacao  = substr($str_path_sys, 0, strrpos($str_path_sys, '/'));
     $path_embutida   = substr($path_aplicacao, 0, strrpos($path_aplicacao, '/') + 1);
     $path_aplicacao .= '/';
     $path_link       = substr($str_path_web, 0, strrpos($str_path_web, '/'));
     $path_link       = substr($path_link, 0, strrpos($path_link, '/')) . '/';
     $dir_raiz = strrpos($_SERVER['PHP_SELF'],"/") ;  
     $dir_raiz = substr($_SERVER['PHP_SELF'], 0, $dir_raiz + 1) ;  
     $path_imag_temp  = $_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_imag_temp'];
     $path_img_global = $path_link . "_lib/img/";
     $path_botoes     = $path_link . "_lib/img";
     $path_icones     = $path_link . "_lib/img/";
     $path_img_modelo = $path_link . "_lib/img/";
     $path_imag_cab   = $path_link . "_lib/img/";
     $path_css        = $root . $path_link . "_lib/css/";
     $path_lib_php    = $root . $path_link . "_lib/lib/php";
     $path_help       = $path_link . "_lib/webhelp/";
     $path_imagens    = $_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_prod'] . "/imagens/";
     $path_libs       = $root . $_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_prod'] . "/lib/php/";
     $path_third      = $root . $_SESSION['scriptcase']['customer_data_tab']['glo_nm_path_prod'] . "/third/";
     if (isset($_SESSION['scriptcase']['user_logout']))
     {
         foreach ($_SESSION['scriptcase']['user_logout'] as $ind => $parms)
         {
             if (isset($_SESSION[$parms['V']]) && $_SESSION[$parms['V']] == $parms['U'])
             {
                 unset($_SESSION['scriptcase']['user_logout'][$ind]);
                 $nm_apl_dest = $parms['R'];
                 $dir = explode("/", $nm_apl_dest);
                 if (count($dir) == 1)
                 {
                     $nm_apl_dest = str_replace(".php", "", $nm_apl_dest);
                     $nm_apl_dest = $path_link . SC_dir_app_name($nm_apl_dest) . "/";
                 }
?>
                 <html>
                 <body>
                 <form name="FRedirect" method="POST" action="<?php echo $nm_apl_dest; ?>" target="<?php echo $parms['T']; ?>">
                 </form>
                 <script>
                  document.FRedirect.submit();
                 </script>
                 </body>
                 </html>
<?php
                 exit;
             }
         }
     }
     if (!isset($_SESSION['scriptcase']['str_lang']) || empty($_SESSION['scriptcase']['str_lang']))
     {
         $_SESSION['scriptcase']['str_lang'] = "en_us";
     }
     if (!isset($_SESSION['scriptcase']['str_conf_reg']) || empty($_SESSION['scriptcase']['str_conf_reg']))
     {
         $_SESSION['scriptcase']['str_conf_reg'] = "en_us";
     }
     $this->str_lang        = $_SESSION['scriptcase']['str_lang'];
     $this->str_conf_reg    = $_SESSION['scriptcase']['str_conf_reg'];
     $this->str_schema_all    = (isset($_SESSION['scriptcase']['str_schema_all']) && !empty($_SESSION['scriptcase']['str_schema_all'])) ? $_SESSION['scriptcase']['str_schema_all'] : "Scriptcase7_BlueSky/Scriptcase7_BlueSky";
     $this->path_lang = "../_lib/lang/";
     include($this->path_lang . $this->str_lang . ".lang.php");
     include($this->path_lang . "config_region.php");
     include("../_lib/css/" . $this->str_schema_all . "_tab.php");
     $_SESSION['scriptcase']['charset'] = (isset($this->Nm_lang['Nm_charset']) && !empty($this->Nm_lang['Nm_charset'])) ? $this->Nm_lang['Nm_charset'] : "ISO-8859-1";
     $_SESSION['scriptcase']['charset_html']  = (isset($this->sc_charset[$_SESSION['scriptcase']['charset']])) ? $this->sc_charset[$_SESSION['scriptcase']['charset']] : $_SESSION['scriptcase']['charset'];
     foreach ($this->Nm_conf_reg[$this->str_conf_reg] as $ind => $dados)
     {
        if ($_SESSION['scriptcase']['charset'] != "UTF-8" && NM_is_utf8($dados))
        {
            $this->Nm_conf_reg[$this->str_conf_reg][$ind] = mb_convert_encoding($dados, $_SESSION['scriptcase']['charset'], "UTF-8");
        }
     }
     foreach ($this->Nm_lang as $ind => $dados)
     {
        if ($_SESSION['scriptcase']['charset'] != "UTF-8" && NM_is_utf8($ind))
        {
            $ind = mb_convert_encoding($ind, $_SESSION['scriptcase']['charset'], "UTF-8");
            $this->Nm_lang[$ind] = $dados;
        }
        if ($_SESSION['scriptcase']['charset'] != "UTF-8" && NM_is_utf8($dados))
        {
            $this->Nm_lang[$ind] = mb_convert_encoding($dados, $_SESSION['scriptcase']['charset'], "UTF-8");
        }
     }
     include("../_lib/css/" . $this->str_schema_all . "_grid.php");
     include("../_lib/buttons/" . trim($str_button) . "/" . trim($str_button) . ".php");
     $Str_btn_css = trim($str_button) . "/" . trim($str_button) . ".css";
     $this->sc_Include($path_lib_php . "/nm_gp_config_btn.php", "F", "nmButtonOutput"); 
     $_SESSION['scriptcase']['reg_conf']['date_format']   = (isset($this->Nm_conf_reg[$this->str_conf_reg]['data_format']))              ?  $this->Nm_conf_reg[$this->str_conf_reg]['data_format'] : "mmddyyyy";
     $_SESSION['scriptcase']['reg_conf']['date_sep']      = (isset($this->Nm_conf_reg[$this->str_conf_reg]['data_sep']))                 ?  $this->Nm_conf_reg[$this->str_conf_reg]['data_sep'] : "/";
     $_SESSION['scriptcase']['reg_conf']['date_week_ini'] = (isset($this->Nm_conf_reg[$this->str_conf_reg]['prim_dia_sema']))            ?  $this->Nm_conf_reg[$this->str_conf_reg]['prim_dia_sema'] : "SU";
     $_SESSION['scriptcase']['reg_conf']['time_format']   = (isset($this->Nm_conf_reg[$this->str_conf_reg]['hora_format']))              ?  $this->Nm_conf_reg[$this->str_conf_reg]['hora_format'] : "hhiiss";
     $_SESSION['scriptcase']['reg_conf']['time_sep']      = (isset($this->Nm_conf_reg[$this->str_conf_reg]['hora_sep']))                 ?  $this->Nm_conf_reg[$this->str_conf_reg]['hora_sep'] : ":";
     $_SESSION['scriptcase']['reg_conf']['time_pos_ampm'] = (isset($this->Nm_conf_reg[$this->str_conf_reg]['hora_pos_ampm']))            ?  $this->Nm_conf_reg[$this->str_conf_reg]['hora_pos_ampm'] : "right_without_space";
     $_SESSION['scriptcase']['reg_conf']['time_simb_am']  = (isset($this->Nm_conf_reg[$this->str_conf_reg]['hora_simbolo_am']))          ?  $this->Nm_conf_reg[$this->str_conf_reg]['hora_simbolo_am'] : "am";
     $_SESSION['scriptcase']['reg_conf']['time_simb_pm']  = (isset($this->Nm_conf_reg[$this->str_conf_reg]['hora_simbolo_pm']))          ?  $this->Nm_conf_reg[$this->str_conf_reg]['hora_simbolo_pm'] : "pm";
     $_SESSION['scriptcase']['reg_conf']['simb_neg']      = (isset($this->Nm_conf_reg[$this->str_conf_reg]['num_sinal_neg']))            ?  $this->Nm_conf_reg[$this->str_conf_reg]['num_sinal_neg'] : "-";
     $_SESSION['scriptcase']['reg_conf']['grup_num']      = (isset($this->Nm_conf_reg[$this->str_conf_reg]['num_sep_agr']))              ?  $this->Nm_conf_reg[$this->str_conf_reg]['num_sep_agr'] : ",";
     $_SESSION['scriptcase']['reg_conf']['dec_num']       = (isset($this->Nm_conf_reg[$this->str_conf_reg]['num_sep_dec']))              ?  $this->Nm_conf_reg[$this->str_conf_reg]['num_sep_dec'] : ".";
     $_SESSION['scriptcase']['reg_conf']['neg_num']       = (isset($this->Nm_conf_reg[$this->str_conf_reg]['num_format_num_neg']))       ?  $this->Nm_conf_reg[$this->str_conf_reg]['num_format_num_neg'] : 2;
     $_SESSION['scriptcase']['reg_conf']['monet_simb']    = (isset($this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_simbolo']))        ?  $this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_simbolo'] : "$";
     $_SESSION['scriptcase']['reg_conf']['monet_f_pos']   = (isset($this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_format_num_pos'])) ?  $this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_format_num_pos'] : 3;
     $_SESSION['scriptcase']['reg_conf']['monet_f_neg']   = (isset($this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_format_num_neg'])) ?  $this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_format_num_neg'] : 13;
     $_SESSION['scriptcase']['reg_conf']['grup_val']      = (isset($this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_sep_agr']))        ?  $this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_sep_agr'] : ",";
     $_SESSION['scriptcase']['reg_conf']['dec_val']       = (isset($this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_sep_dec']))        ?  $this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_sep_dec'] : ".";
     $_SESSION['scriptcase']['reg_conf']['html_dir']      = (isset($this->Nm_conf_reg[$this->str_conf_reg]['ger_ltr_rtl']))              ?  " DIR='" . $this->Nm_conf_reg[$this->str_conf_reg]['ger_ltr_rtl'] . "'" : "";
     $_SESSION['scriptcase']['reg_conf']['num_group_digit']       = (isset($this->Nm_conf_reg[$this->str_conf_reg]['num_group_digit']))       ?  $this->Nm_conf_reg[$this->str_conf_reg]['num_group_digit'] : "1";
     $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit'] = (isset($this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_group_digit'])) ?  $this->Nm_conf_reg[$this->str_conf_reg]['unid_mont_group_digit'] : "1";
     $_SESSION['scriptcase']['contr_link_emb'] = $dir_raiz . "customer_data_tab.php" ; 
     $_SESSION['scriptcase']['nm_bases_security']  = "enc_nm_enc_v1D9NmDQBqDSBYVWJsDMrYV9FeDuFqHIBiHQBiZkBiHAN7V5FUDEBeVkXeDuJeDoB/DcBwDuBqHABYD5rqDMBOVcFeDWXCDoJsDcBwH9B/Z1rYHQJwHgveVkJ3DWB3DoBqHQBiDuBqHArYHuX7DMvOV9BUDWXKVoF7HQBsVINUHAzGD5BOHgveVkJ3V5FqHMBiHQFYZSBiDSN7HuFaHuNOZSrCH5FqDoXGHQJmZ1BiHIveD5rqDEBeHEXeDWrGZuFaHQXODuFaHIvsV5XGDMBODkBsV5X7DoraHQNmH9B/HABYHQX7HgBOZSJ3HEXCHIJsD9XsZ9JeD1BeD5F7DMvmVcFKDWFYVorqDcNwH9B/HAN7D5XGDEBOZSXeV5XCZuJsDcBwDuFaHAveD5NUHgNKDkBOV5FYHMBiHQFYH9B/D1rwZMFaDErKZSJGH5F/DoB/D9XsDQX7HABYV5BOHgrYDkBOH5XCVoB/D9BiZ1F7HABYD5BiDEvsHEFiDWX7DorqHQXGH9FGHAveD5BOHuzGVcFeDWXCDoJsDcBwH9B/Z1rYHQJwHgBYHEFiHEXCHIrqHQXsDuBqHANOD5B/DMvmVcBOHEFYDoBiDcBqZSBqHABYHQrqHgBeHEFiV5B3DoF7D9XsDuFaHAveHQXGDMvsZSNiH5FqHIF7HQNmVIJsHAN7HuFUHgvCHArCDWFqDoJsHQFYDQFaD1vOV5BODMrwVcB/DuFGVENUHQJmVINUHArYHQJeHgvCHArsH5F/HIrqHQXsZSBiHIvsVWBOHgNKDkBODuFqDoFGDcBqVIJwD1rwHQF7HgBYVkJ3H5X/ZuFaHQFYZSBiZ1BYHuX7DMrwV9BUDWJeHIJeHQJmVINUHANOHuJsHgvCHArCDWr/HIFGHQJeDuFaDSrwHQNUDMrwVcB/DWB3VoX7DcNmZSBqZ1rYHuJwDMrYZSXeDuFYVoXGDcJeZ9rqD1BeHuFGDMvsVIBsDuFqHMFGHQNmH9BODSNOHQBqHgvCHArsHEFqHMJwHQFYZ9XGHAN7HuNUDMrwV9BUDWFYHMFUHQJmZkFGD1vsD5JeHgvCHArsDuJeHMBOHQXODuBqD1veHuXGHgNKDkBODuFqDoFGDcBqVIJwD1rwD5JeDMBYZSJqV5FaDoBODcJeDQFGD1veD5BOHgrYDkBsH5B7VEBiHQFYH9BOHArKD5XGDEBOZSXeDuFaDoJeDcJeDQX7Z1zGV5BiDMNOVIBOHEFYDoJeDcJUZ1FaD1NaD5FaHgvsVkXeDWFqZuFaHQNmDQX7HArYD5B/HgrKV9FiV5X7VErqHQNwVIJsHAzGD5FaDEvsZSJGDuFaZuBqD9NwH9X7Z1rwV5JwHuBYVcFiV5X7VoFGDcBqH9FaHAN7V5JeDErKHEBUH5F/DoF7DcJeDQFGD1BeD5JwDMrwZSJ3H5FqDoJeD9JmZ1B/D1NaD5rqDErKZSXeH5FYDoFUD9JKDQJsZ1rwV5BqHuBYVcXKV5X7VoBqD9XOH9B/HIrwD5NUDErKHEBUH5F/DoB/D9NwDQBqHANOHuFaHuNOZSrCH5FqDoXGHQJmZ1BiHAvCD5BqHgveHArsH5BmDoBqHQBiZ9XGHAvmVWXGDMvmVcFKV5BmVoBqD9BsZkFGHArKZMBqDEvsVkJGH5FYZuJeHQXOZSX7HINaV5JeDMrYV9FeHEX7DoJeHQJmZ1FaDSrYV5X7HgvsHArCDWF/VoBiDcJUZSX7Z1BYHuFaDMvmDkBODuFqVoB/D9BiZ1B/D1rKV5FaDMrYHENiH5FYVoXGD9XsDQX7Z1rwD5NUDMvmVcFKV5BmVoBqD9BsZkFGHAvsZMBOHgvCDkXKDWBmZura";
     if (is_dir($path_aplicacao . 'img'))
     {
         $Res_dir_img = @opendir($path_aplicacao . 'img');
         if ($Res_dir_img)
         {
             while (FALSE !== ($Str_arquivo = @readdir($Res_dir_img))) 
             {
                if (@is_file($path_aplicacao . 'img/' . $Str_arquivo) && '.' != $Str_arquivo && '..' != $path_aplicacao . 'img/' . $Str_arquivo)
                {
                    @unlink($path_aplicacao . 'img/' . $Str_arquivo);
                }
             }
         }
         @closedir($Res_dir_img);
         rmdir($path_aplicacao . 'img');
     }
     $this->sc_Include($path_libs. "/nm_sec_prod.php", "F", "nm_reg_prod") ; 
     $this->sc_Include($path_libs. "/nm_trata_saida.php", "C", "nm_trata_saida") ; 
     $nm_saida = new nm_trata_saida();
     $nmsc_falta_var = "";
     if (!empty($nmsc_falta_var)) 
     {
         echo "<html>";
         echo "<table width=\"80%\" border=\"0\" height=\"117\">";
         echo "<tr>";
         echo "   <td bgcolor=\"#D5E1E8\">";
         echo "       <b><font size=\"4\">" . $this->Nm_lang['lang_errm_glob'] . "</font>";
         echo "  " . $nmsc_falta_var;
         echo "   </b></td>";
         echo " </tr>";
         echo "<tr>";
         echo '<td align="middle"><A HREF="javascript:document.FSAI.submit()">' . $this->Nm_lang['lang_btns_exit_appl_hint'] . '</A></TD>';
         echo " </tr>";
         echo "</table>";
         echo "<form name='FSAI' method='post'"; 
         echo "    action='customer_data_tab_fim.php'"; 
         echo "    target='_self'>"; 
         echo "    <input type='hidden' name='saida_aba' value='" . NM_encode_input($_SESSION['sc_session'][$this->sc_page]['customer_data_tab']['aba_saida']) . "'/>";
         echo "    <input type='hidden' name='script_case_init' value='" . NM_encode_input($this->sc_page) . "'/>"; 
         echo "    <input type='hidden' name='script_case_session' value='" . NM_encode_input(session_id()) . "'/>"; 
         echo "</form>"; 
         echo "</html>";
         exit ;
     }
//  
     if (isset($_SESSION['scriptcase']['sc_apl_conf']['customer_data_tab']['exit']) && $_SESSION['scriptcase']['sc_apl_conf']['customer_data_tab']['exit'] != '')
     {
         $_SESSION['sc_session'][$this->sc_page]['customer_data_tab']['aba_saida'] = $_SESSION['scriptcase']['sc_apl_conf']['customer_data_tab']['exit'];
     }
  
$nm_saida->saida("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
$nm_saida->saida("            \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\r\n");
     $nm_saida->saida("  <HTML" . $_SESSION['scriptcase']['reg_conf']['html_dir'] . ">\r\n");
     $nm_saida->saida("  <HEAD>\r\n");
     $nm_saida->saida("   <TITLE>customer_data_tab</TITLE>\r\n");
     $nm_saida->saida("   <META http-equiv=\"Content-Type\" content=\"text/html; charset=" . $_SESSION['scriptcase']['charset_html'] . "\" />\r\n");
     $nm_saida->saida("   <META http-equiv=\"Expires\" content=\"Fri, Jan 01 1900 00:00:00 GMT\"/>\r\n");
     $nm_saida->saida("   <META http-equiv=\"Last-Modified\" content=\"" . gmdate("D, d M Y H:i:s") . " GMT\"/>\r\n");
     $nm_saida->saida("   <META http-equiv=\"Cache-Control\" content=\"no-store, no-cache, must-revalidate\"/>\r\n");
     $nm_saida->saida("   <META http-equiv=\"Cache-Control\" content=\"post-check=0, pre-check=0\"/>\r\n");
     $nm_saida->saida("   <META http-equiv=\"Pragma\" content=\"no-cache\"/>\r\n");
     $nm_saida->saida("   <link rel=\"stylesheet\" type=\"text/css\" href=\"../_lib/css/" . $this->str_schema_all . "_tab.css\" /> \r\n");
     $nm_saida->saida("   <link rel=\"stylesheet\" type=\"text/css\" href=\"../_lib/buttons/" . $Str_btn_css . "\" /> \r\n");
     $nm_saida->saida("  </HEAD>\r\n");
     $nm_saida->saida("  <BODY class=\"scTabPage\">\r\n");
     $nm_saida->saida("   <H1></H1>\r\n");
     $nm_saida->saida("   <style type=\"text/css\">\r\n");
     $nm_saida->saida("    .ttip {border:1px solid black;font-size:12px;layer-background-color:lightyellow;background-color:lightyellow}\r\n");
     $nm_saida->saida("   </style>\r\n");
     $nm_saida->saida("   <div id=\"tooltip\" style=\"position:absolute;visibility:hidden;border:1px solid black;font-size:12px;layer-background-color:lightyellow;background-color:lightyellow;padding:1px\"></div>\r\n");
     $nm_saida->saida("   <TABLE class=\"scTabTable\" CELLPADDING=\"0\" CELLSPACING=\"0\" ALIGN=\"center\" WIDTH=\"80%\">\r\n");
     $nm_saida->saida("    <TR>\r\n");
     $nm_saida->saida("     <TD>\r\n");
     $this->cabecalho();
     $nm_saida->saida("     </TD>\r\n");
     $nm_saida->saida("    </TR>\r\n");
     $nm_saida->saida("    <TR>\r\n");
     $nm_saida->saida("     <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("   <TABLE style=\"border-collapse: collapse; width: 100%\"><TR><TD  class=\"scTabLine\" style=\"width: 100%; padding: 0px\">\r\n");
     $nm_saida->saida("   <TABLE style=\"border-collapse: collapse; border-width: 0px\" align=\"left\">\r\n");
     $nm_saida->saida("    <TR>\r\n");
     $cor_celula  = "scTabInactive";
     $fonte_texto = "scTabInactiveFont";
         $img_nm_esq  = $str_inactive_col_esq;
         $img_nm_te   = $str_inactive_top_esq;
         $img_nm_top  = $str_inactive_lin_top;
         $img_nm_dir  = $str_inactive_col_dir;
         $img_nm_td   = $str_inactive_top_dir;
         $class_bg    = "scTabInactiveBg";
     $imagem_fun = "";
     if ($nmgp_num_aba == "1" || empty($nmgp_num_aba)) 
     {
         $cor_celula  = "scTabActive";
         $fonte_texto = "scTabActiveFont";
         $img_nm_esq  = $str_active_col_esq;
         $img_nm_te   = $str_active_top_esq;
         $img_nm_top  = $str_active_lin_top;
         $img_nm_dir  = $str_active_col_dir;
         $img_nm_td   = $str_active_top_dir;
         $class_bg    = "scTabActiveBg";
         $imagem_fun = "";
     }
     $nm_saida->saida("        <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("         <TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">\r\n");
     $nm_saida->saida("          <TR HEIGHT=\"1\">\r\n");
     $nm_saida->saida("           <TD WIDTH=\"1\"><IMG ID=\"img1_1\" SRC=\"" . $path_img_global . $img_nm_te . "\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD  ID=\"img1_2\" HEIGHT=\"3\" style=\"background-image: url(" . $path_img_global . $img_nm_top . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD WIDTH=\"1\"><IMG  ID=\"img1_3\" SRC=\"" . $path_img_global . $img_nm_td . "\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("          </TR>\r\n");
     $nm_saida->saida("          <TR  ID=\"cel1_2\" class=\"" . $cor_celula . "\">\r\n");
     $nm_saida->saida("           <TD  ID=\"img1_6\" style=\"background-image: url(" . $path_img_global . $img_nm_esq . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD " . $imagem_fun . " class=\"" . $class_bg . "\" ID=\"cel1_bg\" nowrap><A ID=\"cel1_txt\" class=\"" . $fonte_texto . "\" HREF=\"javascript:nm_gp_aba1()\" TARGET=\"_self\">Shipping Addresses</A></TD>\r\n");
     $nm_saida->saida("           <TD  ID=\"img1_7\" style=\"background-image: url(" . $path_img_global . $img_nm_dir . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("          </TR>\r\n");
     $nm_saida->saida("         </TABLE>\r\n");
     $nm_saida->saida("        </TD>\r\n");
     $nm_saida->saida("        <TD class=\"scTab_space_wi\">\r\n");
     $nm_saida->saida("          <IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\" class=\"scTab_space_wi\">\r\n");
     $nm_saida->saida("        </TD>\r\n");
     $cor_celula  = "scTabInactive";
     $fonte_texto = "scTabInactiveFont";
         $img_nm_esq  = $str_inactive_col_esq;
         $img_nm_te   = $str_inactive_top_esq;
         $img_nm_top  = $str_inactive_lin_top;
         $img_nm_dir  = $str_inactive_col_dir;
         $img_nm_td   = $str_inactive_top_dir;
         $class_bg    = "scTabInactiveBg";
     $imagem_fun = "";
     if ($nmgp_num_aba == "2") 
     {
         $cor_celula  = "scTabActive";
         $fonte_texto = "scTabActiveFont";
         $img_nm_esq  = $str_active_col_esq;
         $img_nm_te   = $str_active_top_esq;
         $img_nm_top  = $str_active_lin_top;
         $img_nm_dir  = $str_active_col_dir;
         $img_nm_td   = $str_active_top_dir;
         $class_bg    = "scTabActiveBg";
         $imagem_fun = "";
     }
     $nm_saida->saida("        <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("         <TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">\r\n");
     $nm_saida->saida("          <TR HEIGHT=\"1\">\r\n");
     $nm_saida->saida("           <TD WIDTH=\"1\"><IMG ID=\"img2_1\" SRC=\"" . $path_img_global . $img_nm_te . "\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD  ID=\"img2_2\" HEIGHT=\"3\" style=\"background-image: url(" . $path_img_global . $img_nm_top . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD WIDTH=\"1\"><IMG  ID=\"img2_3\" SRC=\"" . $path_img_global . $img_nm_td . "\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("          </TR>\r\n");
     $nm_saida->saida("          <TR  ID=\"cel2_2\" class=\"" . $cor_celula . "\">\r\n");
     $nm_saida->saida("           <TD  ID=\"img2_6\" style=\"background-image: url(" . $path_img_global . $img_nm_esq . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD " . $imagem_fun . " class=\"" . $class_bg . "\" ID=\"cel2_bg\" nowrap><A ID=\"cel2_txt\" class=\"" . $fonte_texto . "\" HREF=\"javascript:nm_gp_aba2()\" TARGET=\"_self\">Terms</A></TD>\r\n");
     $nm_saida->saida("           <TD  ID=\"img2_7\" style=\"background-image: url(" . $path_img_global . $img_nm_dir . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("          </TR>\r\n");
     $nm_saida->saida("         </TABLE>\r\n");
     $nm_saida->saida("        </TD>\r\n");
     $nm_saida->saida("        <TD class=\"scTab_space_wi\">\r\n");
     $nm_saida->saida("          <IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\" class=\"scTab_space_wi\">\r\n");
     $nm_saida->saida("        </TD>\r\n");
//
     $cor_celula  = "scTabInactive";
         $fonte_texto = "scTabInactiveFont";
         $imagem_fun = "";
//
         $cor_celula  = "scTabInactive";
         $fonte_texto = "scTabInactiveFont";
         $img_nm_esq  = $str_inactive_col_esq;
         $img_nm_te   = $str_inactive_top_esq;
         $img_nm_top  = $str_inactive_lin_top;
         $img_nm_dir  = $str_inactive_col_dir;
         $img_nm_td   = $str_inactive_top_dir;
         $class_bg    = "scTabInactiveBg";
     if (is_file("customer_data_tab_help.txt"))
     {
        $Arq_WebHelp = file("customer_data_tab_help.txt"); 
        if (isset($Arq_WebHelp[0]) && !empty($Arq_WebHelp[0]))
        {
            $Arq_WebHelp[0] = str_replace("\r\n" , "", trim($Arq_WebHelp[0]));
            $Tmp = explode(";", $Arq_WebHelp[0]); 
            foreach ($Tmp as $Cada_help)
            {
                $Tmp1 = explode(":", $Cada_help); 
                if (!empty($Tmp1[0]) && isset($Tmp1[1]) && !empty($Tmp1[1]) && $Tmp1[0] == "aba" && is_file($root . $path_help . $Tmp1[1]))
                {
                    $nm_saida->saida("        <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("         <TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">\r\n");
     $nm_saida->saida("          <TR HEIGHT=\"1\">\r\n");
     $nm_saida->saida("           <TD WIDTH=\"1\"><IMG ID=\"img3_1\" SRC=\"" . $path_img_global . $img_nm_te . "\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD  ID=\"img3_2\" HEIGHT=\"3\" style=\"background-image: url(" . $path_img_global . $img_nm_top . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("           <TD WIDTH=\"1\"><IMG  ID=\"img3_3\" SRC=\"" . $path_img_global . $img_nm_td . "\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("          </TR>\r\n");
     $nm_saida->saida("          <TR  ID=\"cel3_2\" class=\"" . $cor_celula . "\">\r\n");
     $nm_saida->saida("           <TD  ID=\"img3_6\" style=\"background-image: url(" . $path_img_global . $img_nm_esq . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
                    $nm_saida->saida("          <TD " . $imagem_fun . " class=\"" . $class_bg . "\" ID=\"cel_help_bg\" nowrap><A ID=\"cel_help\" class=\"" . $fonte_texto . "\" HREF=\"javascript:nm_help('" . $path_help . $Tmp1[1] . "')\" >" . $this->Nm_lang['lang_btns_help_hint'] . "</A></TD>\r\n");
     $nm_saida->saida("           <TD  ID=\"img3_7\" style=\"background-image: url(" . $path_img_global . $img_nm_dir . ");\"><IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\"></TD>\r\n");
     $nm_saida->saida("          </TR>\r\n");
     $nm_saida->saida("         </TABLE>\r\n");
                    $nm_saida->saida("        </TD>\r\n");
                    $nm_saida->saida("        <TD class=\"scTab_space_wi\">\r\n");
                    $nm_saida->saida("          <IMG SRC=\"" . $path_img_global . "scriptcase__NM__nm_transparent.gif\" BORDER=\"0\" class=\"scTab_space_wi\">\r\n");
                    $nm_saida->saida("        </TD>\r\n");
                }
            }
        }
     }
     $nm_saida->saida("        <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("     </TD>\r\n");
     $nm_saida->saida("    </TR>\r\n");
     $nm_saida->saida("   </TABLE>\r\n");
     $nm_saida->saida("     </TD>\r\n");
     $nm_saida->saida("    </TR>\r\n");
     $nm_saida->saida("   </TABLE>\r\n");
     $nm_saida->saida("   <TABLE BORDER=\"0\" CELLSPACING=\"0\"  WIDTH=\"100%\" class=\"scTabTableApls\" style=\"padding: 0 1px 0 0;\" align=\"center\">\r\n");
     $nm_saida->saida("    <TR>\r\n");
     $nm_saida->saida("      <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("         <iframe id=\"nmsc_iframe_custship_edit_form_1\" frameborder=\"0\" align=\"center\" valign=\"top\" name=\"nm_iframe_aba_custship_edit_form_1\" height=\"600px\" width=\"100%\" scrolling=\"auto\"></iframe>\r\n");
     $nm_saida->saida("      </TD>\r\n");
     $nm_saida->saida("    </TR>\r\n");
     $nm_saida->saida("    <TR>\r\n");
     $nm_saida->saida("      <TD style=\"padding: 0px\">\r\n");
     $nm_saida->saida("         <iframe id=\"nmsc_iframe_data_terms_edit_grid_2\" frameborder=\"0\" align=\"center\" valign=\"top\" name=\"nm_iframe_aba_data_terms_edit_grid_2\" height=\"600px\" width=\"100%\" scrolling=\"auto\"></iframe>\r\n");
     $nm_saida->saida("      </TD>\r\n");
     $nm_saida->saida("    </TR>\r\n");
     $nm_saida->saida("   </TABLE>\r\n");
     $nm_saida->saida("     </TD>\r\n");
     $nm_saida->saida("    </TR>\r\n");
     if (!$_SESSION['sc_session'][$this->sc_page]['customer_data_tab']['iframe_menu'])
     {
         $nm_saida->saida("    <TR>\r\n");
         $Saida = $_SESSION['sc_session'][$this->sc_page]['customer_data_tab']['aba_saida'];
         $Cod_Btn = nmButtonOutput($this->arr_buttons, "bsair", "nm_gp_submit2('$Saida')", "nm_gp_submit2('$Saida')", "sc_b_sair", "", "", "", "absmiddle", "", "0px", $path_botoes, "", "", "", "", "", "only_text", "text_right", "", "");
         $nm_saida->saida("        <TD align=\"left\">" . $Cod_Btn . "</TD> \r\n");
         $nm_saida->saida("    </TR>\r\n");
     }
         $nm_saida->saida("    </TABLE>\r\n");
     $nm_saida->saida("   <form name=\"F1\" method=\"post\" \r\n");
     $nm_saida->saida("                     action=\"./\" \r\n");
     $nm_saida->saida("                     target=\"_self\"> \r\n");
     $nm_saida->saida("    <input type=\"hidden\" name=\"nmgp_num_aba\" value=\"1\"/>\r\n");
     $nm_saida->saida("   </form> \r\n");
     $nm_saida->saida("   <form name=\"F2\" method=\"post\" \r\n");
     $nm_saida->saida("                     target=\"_self\"> \r\n");
     $nm_saida->saida("    <input type=\"hidden\" name=\"saida_aba\" value=\"\"/>\r\n");
     $nm_saida->saida("    <input type=\"hidden\" name=\"script_case_init\" value=\"" . NM_encode_input($this->sc_page) . "\"/> \r\n");
     $nm_saida->saida("    <input type=\"hidden\" name=\"script_case_session\" value=\"" . NM_encode_input(session_id()) . "\"/>\r\n");
     $nm_saida->saida("   </form> \r\n");
     $nm_saida->saida("   <form name=\"Faba\" method=\"post\" \r\n");
     $nm_saida->saida("                       action=\"\" \r\n");
     $nm_saida->saida("                       target=\"\"> \r\n");
     $nm_saida->saida("    <input type=\"hidden\" name=\"nmgp_parms\" value=\"\"/>\r\n");
     $nm_saida->saida("    <input type=\"hidden\" name=\"script_case_session\" value=\"" . NM_encode_input(session_id()) . "\"/>\r\n");
     $nm_saida->saida("   </form> \r\n");
     $nm_saida->saida("   <script language=\"javascript\">\r\n");
     $nm_saida->saida("   function nm_gp_submit(aba) \r\n");
     $nm_saida->saida("   { \r\n");
     $nm_saida->saida("      document.F1.nmgp_num_aba.value = aba;\r\n");
     $nm_saida->saida("      document.F1.submit() ;\r\n");
     $nm_saida->saida("   } \r\n");
     $nm_saida->saida("   function nm_gp_submit2(apl_saida) \r\n");
     $nm_saida->saida("   { \r\n");
     $nm_saida->saida("      document.F2.saida_aba.value = apl_saida  ;\r\n");
     $nm_saida->saida("      document.F2.action = \"customer_data_tab_fim.php\";\r\n");
     $nm_saida->saida("      document.F2.submit() ;\r\n");
     $nm_saida->saida("   } \r\n");
     $nm_saida->saida("   function nm_help(Page)\r\n");
     $nm_saida->saida("   {\r\n");
     $nm_saida->saida("      window.open(Page, '" . $this->Nm_lang['lang_btns_help_hint'] . "', 'resizable');\r\n");
     $nm_saida->saida("   }\r\n");
     $nm_saida->saida("   var sc_cel_ativa = 1;\r\n");
     $nm_saida->saida("   var nm_custship_edit_form_1 = 'no';\r\n");
     $nm_saida->saida("   var nm_data_terms_edit_grid_2 = 'no';\r\n");
     $nm_saida->saida("   function nm_gp_aba1() \r\n");
     $nm_saida->saida("   { \r\n");
     $nm_saida->saida("      cel2 =  \"cel\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      celt =  \"cel\" + sc_cel_ativa + \"_txt\";\r\n");
     $nm_saida->saida("      celbg=  \"cel\" + sc_cel_ativa + \"_bg\";\r\n");
     $nm_saida->saida("      img1 =  \"img\" + sc_cel_ativa + \"_1\";\r\n");
     $nm_saida->saida("      img2 =  \"img\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      img3 =  \"img\" + sc_cel_ativa + \"_3\";\r\n");
     $nm_saida->saida("      img6 =  \"img\" + sc_cel_ativa + \"_6\";\r\n");
     $nm_saida->saida("      img7 =  \"img\" + sc_cel_ativa + \"_7\";\r\n");
     $nm_saida->saida("      document.getElementById(cel2).className = 'scTabInactive';\r\n");
     $nm_saida->saida("      document.getElementById(celt).className             = 'scTabInactiveFont';\r\n");
     $nm_saida->saida("      document.getElementById(celbg).className            = 'scTabInactiveBg';\r\n");
     $nm_saida->saida("      document.getElementById(img1).src                   = '" . $path_img_global . $str_inactive_top_esq . "';\r\n");
     $nm_saida->saida("      document.getElementById(img2).style.backgroundImage = 'url(" . $path_img_global . $str_inactive_lin_top . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img3).src                   = '" . $path_img_global . $str_inactive_top_dir . "';\r\n");
     $nm_saida->saida("      document.getElementById(img6).style.backgroundImage = 'url(" . $path_img_global . $str_inactive_col_esq . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img7).style.backgroundImage = 'url(" . $path_img_global . $str_inactive_col_dir . ")';\r\n");
     $nm_saida->saida("      sc_cel_ativa = 1;\r\n");
     $nm_saida->saida("      cel2 =  \"cel\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      celt =  \"cel\" + sc_cel_ativa + \"_txt\";\r\n");
     $nm_saida->saida("      celbg=  \"cel\" + sc_cel_ativa + \"_bg\";\r\n");
     $nm_saida->saida("      img1 =  \"img\" + sc_cel_ativa + \"_1\";\r\n");
     $nm_saida->saida("      img2 =  \"img\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      img3 =  \"img\" + sc_cel_ativa + \"_3\";\r\n");
     $nm_saida->saida("      img6 =  \"img\" + sc_cel_ativa + \"_6\";\r\n");
     $nm_saida->saida("      img7 =  \"img\" + sc_cel_ativa + \"_7\";\r\n");
     $nm_saida->saida("      document.getElementById(cel2).className = 'scTabActive';\r\n");
     $nm_saida->saida("      document.getElementById(celt).className = 'scTabActiveFont';\r\n");
     $nm_saida->saida("      document.getElementById(celbg).className= 'scTabActiveBg';\r\n");
     $nm_saida->saida("      document.getElementById(img1).src                   = '" . $path_img_global . $str_active_top_esq . "';\r\n");
     $nm_saida->saida("      document.getElementById(img2).style.backgroundImage = 'url(" . $path_img_global . $str_active_lin_top . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img3).src                   = '" . $path_img_global . $str_active_top_dir . "';\r\n");
     $nm_saida->saida("      document.getElementById(img6).style.backgroundImage = 'url(" . $path_img_global . $str_active_col_esq . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img7).style.backgroundImage = 'url(" . $path_img_global . $str_active_col_dir . ")';\r\n");
     $nm_saida->saida("      document.getElementById('nmsc_iframe_data_terms_edit_grid_2').style.display = 'none'; \r\n");
     $nm_saida->saida("      if (nm_custship_edit_form_1 == 'no') \r\n");
     $nm_saida->saida("      { \r\n");
     $nm_saida->saida("          document.Faba.nmgp_parms.value = \"\"; \r\n");
     $nm_saida->saida("          document.Faba.target   = \"nm_iframe_aba_custship_edit_form_1\"; \r\n");
     $nm_saida->saida("          document.Faba.action   = \"" . $path_link  . SC_dir_app_name('custship_edit_form') . "/\";\r\n");
     $nm_saida->saida("          document.Faba.submit() ;\r\n");
     $nm_saida->saida("      } \r\n");
     $nm_saida->saida("      document.getElementById('nmsc_iframe_custship_edit_form_1').style.display = 'block'; \r\n");
     $nm_saida->saida("      nm_custship_edit_form_1 = 'yes';\r\n");
     $nm_saida->saida("   } \r\n");
     $nm_saida->saida("   function nm_gp_aba2() \r\n");
     $nm_saida->saida("   { \r\n");
     $nm_saida->saida("      cel2 =  \"cel\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      celt =  \"cel\" + sc_cel_ativa + \"_txt\";\r\n");
     $nm_saida->saida("      celbg=  \"cel\" + sc_cel_ativa + \"_bg\";\r\n");
     $nm_saida->saida("      img1 =  \"img\" + sc_cel_ativa + \"_1\";\r\n");
     $nm_saida->saida("      img2 =  \"img\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      img3 =  \"img\" + sc_cel_ativa + \"_3\";\r\n");
     $nm_saida->saida("      img6 =  \"img\" + sc_cel_ativa + \"_6\";\r\n");
     $nm_saida->saida("      img7 =  \"img\" + sc_cel_ativa + \"_7\";\r\n");
     $nm_saida->saida("      document.getElementById(cel2).className = 'scTabInactive';\r\n");
     $nm_saida->saida("      document.getElementById(celt).className             = 'scTabInactiveFont';\r\n");
     $nm_saida->saida("      document.getElementById(celbg).className            = 'scTabInactiveBg';\r\n");
     $nm_saida->saida("      document.getElementById(img1).src                   = '" . $path_img_global . $str_inactive_top_esq . "';\r\n");
     $nm_saida->saida("      document.getElementById(img2).style.backgroundImage = 'url(" . $path_img_global . $str_inactive_lin_top . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img3).src                   = '" . $path_img_global . $str_inactive_top_dir . "';\r\n");
     $nm_saida->saida("      document.getElementById(img6).style.backgroundImage = 'url(" . $path_img_global . $str_inactive_col_esq . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img7).style.backgroundImage = 'url(" . $path_img_global . $str_inactive_col_dir . ")';\r\n");
     $nm_saida->saida("      sc_cel_ativa = 2;\r\n");
     $nm_saida->saida("      cel2 =  \"cel\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      celt =  \"cel\" + sc_cel_ativa + \"_txt\";\r\n");
     $nm_saida->saida("      celbg=  \"cel\" + sc_cel_ativa + \"_bg\";\r\n");
     $nm_saida->saida("      img1 =  \"img\" + sc_cel_ativa + \"_1\";\r\n");
     $nm_saida->saida("      img2 =  \"img\" + sc_cel_ativa + \"_2\";\r\n");
     $nm_saida->saida("      img3 =  \"img\" + sc_cel_ativa + \"_3\";\r\n");
     $nm_saida->saida("      img6 =  \"img\" + sc_cel_ativa + \"_6\";\r\n");
     $nm_saida->saida("      img7 =  \"img\" + sc_cel_ativa + \"_7\";\r\n");
     $nm_saida->saida("      document.getElementById(cel2).className = 'scTabActive';\r\n");
     $nm_saida->saida("      document.getElementById(celt).className = 'scTabActiveFont';\r\n");
     $nm_saida->saida("      document.getElementById(celbg).className= 'scTabActiveBg';\r\n");
     $nm_saida->saida("      document.getElementById(img1).src                   = '" . $path_img_global . $str_active_top_esq . "';\r\n");
     $nm_saida->saida("      document.getElementById(img2).style.backgroundImage = 'url(" . $path_img_global . $str_active_lin_top . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img3).src                   = '" . $path_img_global . $str_active_top_dir . "';\r\n");
     $nm_saida->saida("      document.getElementById(img6).style.backgroundImage = 'url(" . $path_img_global . $str_active_col_esq . ")';\r\n");
     $nm_saida->saida("      document.getElementById(img7).style.backgroundImage = 'url(" . $path_img_global . $str_active_col_dir . ")';\r\n");
     $nm_saida->saida("      document.getElementById('nmsc_iframe_custship_edit_form_1').style.display = 'none'; \r\n");
     $nm_saida->saida("      if (nm_data_terms_edit_grid_2 == 'no') \r\n");
     $nm_saida->saida("      { \r\n");
     $nm_saida->saida("          document.Faba.nmgp_parms.value = \"\"; \r\n");
     $nm_saida->saida("          document.Faba.target   = \"nm_iframe_aba_data_terms_edit_grid_2\"; \r\n");
     $nm_saida->saida("          document.Faba.action   = \"" . $path_link  . SC_dir_app_name('data_terms_edit_grid') . "/\";\r\n");
     $nm_saida->saida("          document.Faba.submit() ;\r\n");
     $nm_saida->saida("      } \r\n");
     $nm_saida->saida("      document.getElementById('nmsc_iframe_data_terms_edit_grid_2').style.display = 'block'; \r\n");
     $nm_saida->saida("      nm_data_terms_edit_grid_2 = 'yes';\r\n");
     $nm_saida->saida("   } \r\n");
     if ($nmgp_num_aba == "1" || empty($nmgp_num_aba)) 
     { 
         $nm_saida->saida("   nm_gp_aba1(); \r\n");
     } 
     $nm_saida->saida("   </script>\r\n");
     $nm_saida->saida("   </body>\r\n");
     $nm_saida->saida("   </HTML>\r\n");
  }
  function cabecalho()
  {
     global 
             
            $nm_saida, $path_lib_php, $path_libs, $path_imag_cab;
     $_SESSION['scriptcase']['sc_tab_meses']['int'] = array(
                                  $this->Nm_lang['lang_mnth_janu'],
                                  $this->Nm_lang['lang_mnth_febr'],
                                  $this->Nm_lang['lang_mnth_marc'],
                                  $this->Nm_lang['lang_mnth_apri'],
                                  $this->Nm_lang['lang_mnth_mayy'],
                                  $this->Nm_lang['lang_mnth_june'],
                                  $this->Nm_lang['lang_mnth_july'],
                                  $this->Nm_lang['lang_mnth_augu'],
                                  $this->Nm_lang['lang_mnth_sept'],
                                  $this->Nm_lang['lang_mnth_octo'],
                                  $this->Nm_lang['lang_mnth_nove'],
                                  $this->Nm_lang['lang_mnth_dece']);
     $_SESSION['scriptcase']['sc_tab_meses']['abr'] = array(
                                  $this->Nm_lang['lang_shrt_mnth_janu'],
                                  $this->Nm_lang['lang_shrt_mnth_febr'],
                                  $this->Nm_lang['lang_shrt_mnth_marc'],
                                  $this->Nm_lang['lang_shrt_mnth_apri'],
                                  $this->Nm_lang['lang_shrt_mnth_mayy'],
                                  $this->Nm_lang['lang_shrt_mnth_june'],
                                  $this->Nm_lang['lang_shrt_mnth_july'],
                                  $this->Nm_lang['lang_shrt_mnth_augu'],
                                  $this->Nm_lang['lang_shrt_mnth_sept'],
                                  $this->Nm_lang['lang_shrt_mnth_octo'],
                                  $this->Nm_lang['lang_shrt_mnth_nove'],
                                  $this->Nm_lang['lang_shrt_mnth_dece']);
     $_SESSION['scriptcase']['sc_tab_dias']['int'] = array(
                                  $this->Nm_lang['lang_days_sund'],
                                  $this->Nm_lang['lang_days_mond'],
                                  $this->Nm_lang['lang_days_tued'],
                                  $this->Nm_lang['lang_days_wend'],
                                  $this->Nm_lang['lang_days_thud'],
                                  $this->Nm_lang['lang_days_frid'],
                                  $this->Nm_lang['lang_days_satd']);
     $_SESSION['scriptcase']['sc_tab_dias']['abr'] = array(
                                  $this->Nm_lang['lang_shrt_days_sund'],
                                  $this->Nm_lang['lang_shrt_days_mond'],
                                  $this->Nm_lang['lang_shrt_days_tued'],
                                  $this->Nm_lang['lang_shrt_days_wend'],
                                  $this->Nm_lang['lang_shrt_days_thud'],
                                  $this->Nm_lang['lang_shrt_days_frid'],
                                  $this->Nm_lang['lang_shrt_days_satd']);
     $this->sc_Include($path_lib_php . "/nm_data.class.php", "C", "nm_data") ; 
     $this->nm_data     = new nm_data("port");
     $Str_date = strtolower($_SESSION['scriptcase']['reg_conf']['date_format']);
     $Lim   = strlen($Str_date);
     $Ult   = "";
     $Arr_D = array();
     for ($I = 0; $I < $Lim; $I++)
     {
         $Char = substr($Str_date, $I, 1);
         if ($Char != $Ult)
         {
             $Arr_D[] = $Char;
         }
         $Ult = $Char;
     }
      $Prim = true;
     $Str  = "";
     foreach ($Arr_D as $Cada_d)
     {
         $Str .= (!$Prim) ? $_SESSION['scriptcase']['reg_conf']['date_sep'] : "";
         $Str .= $Cada_d;
         $Prim = false;
     }
     $Str = str_replace("a", "Y", $Str);
     $Str = str_replace("y", "Y", $Str);
     $nm_data_fixa = date($Str); 
     $nm_saida->saida("<style>\r\n");
     $nm_saida->saida("#lin1_col1 { margin-left:9px; margin-top:7px;  width:70%; height:27px; float:left; overflow:hidden;}			 \r\n");
     $nm_saida->saida("#lin1_col2 { margin-right:9px; margin-top:7px; width:20%; height:27px; float:right; overflow:hidden; text-align:right;}\r\n");
     $nm_saida->saida("</style>\r\n");
     $nm_saida->saida("<div style=\"width: 100%\" class=\"scTabHeader\">\r\n");
     $nm_saida->saida(" <span style=\"height:37px; background-color:#FFFFFF; border-width:0px 0px 1px 0px; display: block\">\r\n");
     $nm_saida->saida("      <span id=\"lin1_col1\" class=\"scTabHeaderFont\">customer_data_tab</span>\r\n");
     $nm_saida->saida("      <span id=\"lin1_col2\" class=\"scTabHeaderFont\" style=\"float: right\">" . $nm_data_fixa . "</span>\r\n");
     $nm_saida->saida(" </span>\r\n");
     $nm_saida->saida("</div>\r\n");
  }
}
if (!function_exists("NM_is_utf8"))
{
    include_once("customer_data_tab_nmutf8.php");
}
if (!function_exists("SC_dir_app_ini"))
{
    include_once("../_lib/lib/php/nm_ctrl_app_name.php");
}
SC_dir_app_ini('Veratex');
if (!empty($_POST))
{
    foreach ($_POST as $nmgp_var => $nmgp_val)
    {
         $$nmgp_var = $nmgp_val;
    }
}
if (!empty($_GET))
{
    foreach ($_GET as $nmgp_var => $nmgp_val)
    {
         $$nmgp_var = $nmgp_val;
    }
}
if (isset($nmgp_parms))
{
    $nmgp_parms = str_replace("@aspass@", "'", $nmgp_parms);
    $nmgp_parms = str_replace("*scout", "?@?", $nmgp_parms);
    $nmgp_parms = str_replace("*scin", "?#?", $nmgp_parms);
    $todo = explode("?@?", $nmgp_parms);
    foreach ($todo as $param)
    {
       $cadapar = explode("?#?", $param);
       if (1 < sizeof($cadapar))
       {
           $$cadapar[0] = $cadapar[1];
       }
    }
}
if (empty($script_case_init))
{
    $script_case_init = rand(2, 1000);
}
if (isset($_SESSION['scriptcase']['sc_outra_jan']) && $_SESSION['scriptcase']['sc_outra_jan'] == 'customer_data_tab')
{
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['sc_outra_jan'] = true;
     unset($_SESSION['scriptcase']['sc_outra_jan']);
}
if (isset($nmgp_outra_jan) && $nmgp_outra_jan == 'true')
{
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['sc_outra_jan'] = true;
}
$salva_iframe = false;
if (isset($_SESSION['sc_session'][$script_case_init]['customer_data_tab']['iframe_menu']))
{
    $salva_iframe = $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['iframe_menu'];
    unset($_SESSION['sc_session'][$script_case_init]['customer_data_tab']['iframe_menu']);
}
if (isset($nm_run_menu) && $nm_run_menu == 1)
{
    if (isset($_SESSION['scriptcase']['sc_aba_iframe']) && isset($_SESSION['scriptcase']['sc_apl_menu_atual']) && $script_case_init == 1)
    {
        foreach ($_SESSION['scriptcase']['sc_aba_iframe'] as $aba => $apls_aba)
        {
            if ($aba == $_SESSION['scriptcase']['sc_apl_menu_atual'])
            {
                unset($_SESSION['scriptcase']['sc_aba_iframe'][$aba]);
                break;
            }
        }
    }
    if ($script_case_init == 1)
    {
        $_SESSION['scriptcase']['sc_apl_menu_atual'] = "customer_data_tab";
    }
    $achou = false;
    if (isset($_SESSION['sc_session'][$script_case_init]))
    {
        foreach ($_SESSION['sc_session'][$script_case_init] as $nome_apl => $resto)
        {
            if ($nome_apl == 'customer_data_tab' || $achou)
            {
                if ($achou)
                {
                    unset($_SESSION['sc_session'][$script_case_init][$nome_apl]);
                }
                $achou = true;
            }
        }
        if (!$achou && isset($nm_apl_menu))
        {
            foreach ($_SESSION['sc_session'][$script_case_init] as $nome_apl => $resto)
            {
                if ($nome_apl == $nm_apl_menu || $achou)
                {
                    $achou = true;
                    if ($nome_apl != $nm_apl_menu)
                    {
                        unset($_SESSION['sc_session'][$script_case_init][$nome_apl]);
                    }
                }
            }
        }
    }
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['iframe_menu'] = true;
}
else
{
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['iframe_menu'] = $salva_iframe;
}

   if (!isset($_SESSION['sc_session'][$script_case_init]['customer_data_tab']['initialize']))
   {
       $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['initialize'] = true;
   }
   elseif (!isset($_SERVER['HTTP_REFERER']))
   {
       $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['initialize'] = false;
   }
   elseif (false === strpos($_SERVER['HTTP_REFERER'], '.php'))
   {
       $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['initialize'] = true;
   }
   else
   {
       $sReferer = substr($_SERVER['HTTP_REFERER'], 0, strpos($_SERVER['HTTP_REFERER'], '.php'));
       $sReferer = substr($sReferer, strrpos($sReferer, '/') + 1);
       if ('customer_data_tab' == $sReferer || 'customer_data_tab_' == substr($sReferer, 0, 18))
       {
           $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['initialize'] = false;
       }
       else
       {
           $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['initialize'] = true;
       }
   }

if (!empty($nmgp_parms)) 
{ 
    $nmgp_parms = str_replace("*scout", "?@?", $nmgp_parms);
    $nmgp_parms = str_replace("*scin", "?#?", $nmgp_parms);
    $todo = explode("?@?", $nmgp_parms);
    $ix = 0;
    while (!empty($todo[$ix]))
    {
           $cadapar = explode("?#?", $todo[$ix]);
           $$cadapar[0] = $cadapar[1]; 
           $ix++;
    }
} 
if (isset($_POST["nmgp_num_aba"])) 
{
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['num_aba'] = $nmgp_num_aba;
}
if (isset($nmgp_url_saida) && !empty($nmgp_url_saida)) 
{ 
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['aba_saida'] = $nmgp_url_saida ; 
} 
$STR_lang    = (isset($_SESSION['scriptcase']['str_lang']) && !empty($_SESSION['scriptcase']['str_lang'])) ? $_SESSION['scriptcase']['str_lang'] : "en_us";
     $STR_schema_all = (isset($_SESSION['scriptcase']['str_schema_all']) && !empty($_SESSION['scriptcase']['str_schema_all'])) ? $_SESSION['scriptcase']['str_schema_all'] : "Scriptcase7_BlueSky/Scriptcase7_BlueSky";
$NM_arq_lang = "../_lib/lang/" . $STR_lang . ".lang.php";
$Nm_lang = array();
if (is_file($NM_arq_lang))
{
    $Lixo = file($NM_arq_lang);
    foreach ($Lixo as $Cada_lin) 
    {
        if (strpos($Cada_lin, "array()") === false && (trim($Cada_lin) != "<?php")  && (trim($Cada_lin) != "?" . ">"))
        {
            eval (str_replace("\$this->", "\$", $Cada_lin));
        }
    }
}
$_SESSION['scriptcase']['charset'] = (isset($Nm_lang['Nm_charset']) && !empty($Nm_lang['Nm_charset'])) ? $Nm_lang['Nm_charset'] : "ISO-8859-1";
foreach ($Nm_lang as $ind => $dados)
{
   if ($_SESSION['scriptcase']['charset'] != "UTF-8" && NM_is_utf8($dados))
   {
       $Nm_lang[$ind] = mb_convert_encoding($dados, $_SESSION['scriptcase']['charset'], "UTF-8");
   }
}
$nm_url_saida = "";
if (empty($nm_url_saida) && isset($_SERVER['HTTP_REFERER']))
{
    $trab_saida      = str_replace("\\", "/", $_SERVER['HTTP_REFERER']);
    $trab_saida      = strrpos($trab_saida, "/");
    $trab_saida      = substr($_SERVER['HTTP_REFERER'], $trab_saida + 1);
    if (strpos($_SERVER['HTTP_REFERER'], "customer_data_tab.php") === FALSE && !empty($trab_saida) && empty($_SESSION['sc_session'][$script_case_init]['customer_data_tab']['aba_saida']))
    {
        $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['aba_saida'] = $_SERVER['HTTP_REFERER'];
    }
}
else
{
    $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['aba_saida'] = $nm_url_saida;
}
if (isset($_SESSION['nm_session']['user']['sec']['flag']) && $_SESSION['nm_session']['user']['sec']['flag'] == "N") 
{ 
   $_SESSION['scriptcase']['sc_apl_seg']['customer_data_tab'] = "on";
} 
if (!isset($_SESSION['scriptcase']['sc_apl_seg']['customer_data_tab']) || $_SESSION['scriptcase']['sc_apl_seg']['customer_data_tab'] != "on")
{ 
    $NM_Mens_Erro = $Nm_lang['lang_errm_unth_user'];
    $nm_botao_ok = ($_SESSION['sc_session'][$script_case_init]['customer_data_tab']['iframe_menu']) ? false : true;
    if (isset($_SESSION['scriptcase']['sc_aba_iframe']))
    {
        foreach ($_SESSION['scriptcase']['sc_aba_iframe'] as $aba => $apls_aba)
        {
            if (in_array("customer_data_tab", $apls_aba))
            {
                $nm_botao_ok = false;
                 break;
            }
        }
    }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML>
     <HEAD>
      <TITLE>customer_data_tab</TITLE>
      <META http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['scriptcase']['charset_html'] ?>" />
      <META http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"/>      <META http-equiv="Pragma" content="no-cache"/>
      <link rel="stylesheet" type="text/css" href="../_lib/css/<?php echo $STR_schema_all ?>_aba.css" /> 
      <link rel="stylesheet" type="text/css" href="../_lib/css/<?php echo $STR_schema_all ?>_grid.css" /> 
     </HEAD>
     <body class="scTabPage">
      <table align="center" class="scGridBorder"><tr><td style="padding: 0">
      <table style="width: 100%" class="scGridTabela"><tr class="scGridFieldOdd"><td class="scGridFieldOddFont" style="padding: 15px 30px; text-align: center">
       <?php echo $NM_Mens_Erro ?>
<?php
     if ($nm_botao_ok)
    {
?>
      <br />
      <form name="Fseg" method="post" 
                          action="<?php echo $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['aba_saida']; ?>" 
                          target="_self"> 
       <input type="hidden" name="script_case_init" value="<?php echo NM_encode_input($script_case_init) ?>"/> 
       <input type="hidden" name="script_case_session" value="<?php echo NM_encode_input(session_id());?>"/>
       <input type="submit" name="sc_sai_seg" value="OK"> 
      </form> 
<?php
     }
?>
      </td></tr></table>
      </td></tr></table>
<?php
    if (isset($_SESSION['scriptcase']['nm_sc_retorno']) && !empty($_SESSION['scriptcase']['nm_sc_retorno']))
    {
?>
<br /><br /><br />
<table align="center" class="scGridBorder" style="width: 450px"><tr><td style="padding: 0">
 <table style="width: 100%" class="scGridTabela">
  <tr class="scGridFieldOdd">
   <td class="scGridFieldOddFont" style="padding: 15px 30px">
    <?php echo $Nm_lang['lang_errm_unth_hwto']; ?>
   </td>
  </tr>
 </table>
</td></tr></table>
<?php
    }
?>
     </body>
    </HTML>
<?php
    exit;
} 
$nmgp_num_aba = (isset($_SESSION['sc_session'][$script_case_init]['customer_data_tab']['num_aba'])) ? $_SESSION['sc_session'][$script_case_init]['customer_data_tab']['num_aba'] : 1;
$customer_data_tab_contr = new customer_data_tab();
$customer_data_tab_contr->controle();
?>
