<form name="F2" method=post 
               action="./" 
               target="_self"> 
<input type=hidden name="id2" value="<?php echo NM_encode_input($this->nmgp_dados_form['id2']); ?>">
<input type=hidden name="nm_form_submit" value="1">
<input type=hidden name="nmgp_opcao" value="">
<input type=hidden name="master_nav" value="off">
<input type=hidden name="sc_ifr_height" value="">
<input type="hidden" name="nmgp_parms" value=""/>
<input type="hidden" name="nmgp_ordem" value=""/>
<input type="hidden" name="nmgp_clone" value=""/>
<input type="hidden" name="nmgp_fast_search" value=""/>
<input type="hidden" name="nmgp_cond_fast_search" value=""/>
<input type="hidden" name="nmgp_arg_fast_search" value=""/>
<input type=hidden name="script_case_init" value="<?php echo NM_encode_input($this->Ini->sc_page); ?>"> 
<input type=hidden name="script_case_session" value="<?php echo NM_encode_input(session_id()); ?>"> 
</form> 
<form name="F3" method="post" 
                  target="_self"> 
  <input type="hidden" name="nmgp_chave" value=""/>
  <input type="hidden" name="nmgp_opcao" value=""/>
  <input type="hidden" name="nmgp_ordem" value=""/>
  <input type="hidden" name="nmgp_chave_det" value=""/>
  <input type="hidden" name="nmgp_quant_linhas" value=""/>
  <input type="hidden" name="nmgp_url_saida" value=""/>
  <input type="hidden" name="nmgp_parms" value=""/>
  <input type="hidden" name="nmgp_outra_jan" value=""/>
  <input type="hidden" name="script_case_init" value="<?php echo NM_encode_input($this->Ini->sc_page); ?>"/> 
  <input type="hidden" name="script_case_session" value="<?php echo NM_encode_input(session_id()); ?>"> 
</form> 
<form name="F5" method="post" 
                  action="./" 
                  target="_self"> 
  <input type="hidden" name="nmgp_opcao" value="<?php if ($this->nm_Start_new) {echo "ini";} elseif ($this->sc_insert_on) {echo "final";} else {echo "igual";}?>"/>
  <input type="hidden" name="nmgp_parms" value="<?php echo NM_encode_input($_SESSION['sc_session'][$this->Ini->sc_page]['beam_warppo_beam_form']['parms']); ?>"/>
  <input type="hidden" name="script_case_init" value="<?php echo NM_encode_input($this->Ini->sc_page); ?>"/> 
  <input type="hidden" name="script_case_session" value="<?php echo NM_encode_input(session_id()); ?>"> 
</form> 
<form name="F6" method="post" 
                  action="./" 
                  target="_self"> 
  <input type="hidden" name="script_case_init" value="<?php echo NM_encode_input($this->Ini->sc_page); ?>"/> 
  <input type="hidden" name="script_case_session" value="<?php echo NM_encode_input(session_id()); ?>"> 
</form> 
<div id="id_div_process" style="display: none; margin: 10px; whitespace: nowrap" class="scFormProcessFixed"><span class="scFormProcess"><img border="0" src="<?php echo $this->Ini->path_icones; ?>/scriptcase__NM__ajax_load.gif" align="absmiddle" />&nbsp;<?php echo $this->Ini->Nm_lang['lang_othr_prcs']; ?>...</span></div>
<div id="id_div_process_block" style="display: none; margin: 10px; whitespace: nowrap"><span class="scFormProcess"><img border="0" src="<?php echo $this->Ini->path_icones; ?>/scriptcase__NM__ajax_load.gif" align="absmiddle" />&nbsp;<?php echo $this->Ini->Nm_lang['lang_othr_prcs']; ?>...</span></div>
<div id="id_fatal_error" class="scFormLabelOdd" style="display: none; position: absolute"></div>
<script type="text/javascript"> 
function sc_btn_sc_btn_0()
{
    document.F1.nmgp_parms.value = "nmgp_opcao?#?formphp?@?nm_call_php?#?sc_btn_0?@?";
    document.F1.action = "./";
    document.F1.target = "_self";
    document.F1.submit();
}
function sc_btn_sc_btn_1()
{
    document.F1.nmgp_parms.value = "nmgp_opcao?#?formphp?@?nm_call_php?#?sc_btn_1?@?";
    document.F1.action = "./";
    document.F1.target = "_self";
    document.F1.submit();
}
var var_btn_sc_btn_2_var_po = "<?php echo $this->nmgp_dados_form['p_o_number']; ?>";
function sc_btn_sc_btn_2()
{
  nm_gp_submit('<?php echo $this->Ini->link_beam_knitorder_pdf_cons; ?>', '<?php echo $this->nm_location; ?>', '<?php echo "var_po?#?' + var_btn_sc_btn_2_var_po + '?@?"; ?>', 'inicio', '_self');
}
function sc_btn_sc_btn_3()
{
    document.F1.nmgp_parms.value = "nmgp_opcao?#?formphp?@?nm_call_php?#?sc_btn_3?@?";
    document.F1.action = "./";
    document.F1.target = "_self";
    document.F1.submit();
}
 NM_tp_critica(1);
function nm_gp_submit(apl_lig, apl_saida, parms, opc, target, modal_h, modal_w) 
{ 
   if (target == 'modal') 
   {
       par_modal = '?script_case_init=<?php echo $this->Ini->sc_page ?>&script_case_session=<?php echo session_id() ?>&nmgp_outra_jan=true&nmgp_url_saida=modal';
       if (opc != null && opc != '') 
       {
           par_modal += '&nmgp_opcao=grid';
       }
       if (parms != null && parms != '') 
       {
           par_modal += '&nmgp_parms=' + parms;
       }
       tb_show('', apl_lig + par_modal + '&TB_iframe=true&modal=true&height=' + modal_h + '&width=' + modal_w, '');
       return;
   }
   document.F3.target               = "_self"; 
   document.F3.action               = apl_lig  ;
   if (opc != null && opc != "") 
   {
       document.F3.nmgp_opcao.value = "grid" ;
   }
   else
   {
       document.F3.nmgp_opcao.value = "" ;
   }
   if (target != null && target == '_blank') 
   {
       document.F3.nmgp_outra_jan.value = "true" ;
       document.F3.target           = target; 
   }
   document.F3.nmgp_url_saida.value = apl_saida ;
   document.F3.nmgp_parms.value     = parms ;
   document.F3.submit() ;
} 

function scInlineFormSend()
{
  return false;
}

function NM_critica (form, campo, label, mask, tipo, intr, dec, min, max)
{
    this.form = form;
    this.campo = campo;
    this.label = label;
    this.mask = mask;
    this.tipo = tipo;
    this.intr = intr;
    this.dec = dec;
    this.min = min;
    this.max = max;
}
 NM_tab_crit = new NM_critica(44);
 NM_tab_crit[1] = new NM_critica('F1', 'ac', 'AC', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit[2] = new NM_critica('F1', 'p_o_number', 'P_O_NUMBER', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit[3] = new NM_critica('F1', 'date', 'DATE', 'naomask', 'data', '<?php echo $this->field_config['date']['date_format']; ?>'<?php echo ", '', ''"; ?>, '<?php echo $this->field_config['date']['date_sep']; ?>');
 NM_tab_crit[4] = new NM_critica('F1', 'to', 'TO', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit[5] = new NM_critica('F1', 'ship_to', 'SHIP_TO', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit[6] = new NM_critica('F1', 'location', 'LOCATION', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit[7] = new NM_critica('F1', 'desc', 'DESC', 'naomask', 'lista', 'cxab', 25, 'TUDO');
 NM_tab_crit[8] = new NM_critica('F1', 'delivery', 'DELIVERY', 'naomask', 'lista', 'cxab', 13, 'TUDO');
 NM_tab_crit[9] = new NM_critica('F1', 'comment', 'COMMENT', 'naomask', 'lista', 'cxab', 40, 'TUDO');
 NM_tab_crit[10] = new NM_critica('F1', 'lbs_orderd', 'LBS_ORDERD', 'naomask', 'numeroedtvg', 11, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['lbs_orderd']['symbol_grp']); ?>');
 NM_tab_crit[11] = new NM_critica('F1', 'price_lb_w', 'PRICE_LB_W', 'naomask', 'valorvg', 5, 3, -0, 99999999, '<?php echo str_replace("'", "\'", $this->field_config['price_lb_w']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['price_lb_w']['symbol_dec']); ?>');
 NM_tab_crit[12] = new NM_critica('F1', 'order_amt', 'ORDER_AMT', 'naomask', 'valorvg', 9, 2, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['order_amt']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['order_amt']['symbol_dec']); ?>');
 NM_tab_crit[13] = new NM_critica('F1', 'warp_loss', 'WARP_LOSS', 'naomask', 'valorvg', 5, 1, -0, 999999, '<?php echo str_replace("'", "\'", $this->field_config['warp_loss']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['warp_loss']['symbol_dec']); ?>');
 NM_tab_crit[14] = new NM_critica('F1', 'markdown', 'MARKDOWN', 'naomask', 'valorvg', 5, 2, -0, 9999999, '<?php echo str_replace("'", "\'", $this->field_config['markdown']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['markdown']['symbol_dec']); ?>');
 NM_tab_crit[15] = new NM_critica('F1', 'mdvalue', 'MDVALUE', 'naomask', 'valorvg', 9, 2, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['mdvalue']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['mdvalue']['symbol_dec']); ?>');
 NM_tab_crit[16] = new NM_critica('F1', 'den', 'DEN', 'naomask', 'lista', 'cxab', 3, 'TUDO');
 NM_tab_crit[17] = new NM_critica('F1', 'fil', 'FIL', 'naomask', 'lista', 'cxab', 3, 'TUDO');
 NM_tab_crit[18] = new NM_critica('F1', 'luster', 'LUSTER', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit[19] = new NM_critica('F1', 'producer', 'PRODUCER', 'naomask', 'lista', 'cxab', 6, 'TUDO');
 NM_tab_crit[20] = new NM_critica('F1', 'fiber', 'FIBER', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit[21] = new NM_critica('F1', 'merge', 'MERGE', 'naomask', 'lista', 'cxab', 6, 'TUDO');
 NM_tab_crit[22] = new NM_critica('F1', 'beam_code', 'BEAM_CODE', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit[23] = new NM_critica('F1', 'size', 'SIZE', 'naomask', 'lista', 'cxab', 6, 'TUDO');
 NM_tab_crit[24] = new NM_critica('F1', 'b_s', 'B_S', 'naomask', 'lista', 'cxab', 1, 'TUDO');
 NM_tab_crit[25] = new NM_critica('F1', 'yarn_code', 'YARN_CODE', 'naomask', 'numeroedtvg', 10, -0, 9999999999, '<?php echo str_replace("'", "\'", $this->field_config['yarn_code']['symbol_grp']); ?>');
 NM_tab_crit[26] = new NM_critica('F1', 'lbs_recd', 'LBS_RECD', 'naomask', 'valorvg', 10, 1, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['lbs_recd']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['lbs_recd']['symbol_dec']); ?>');
 NM_tab_crit[27] = new NM_critica('F1', 'lbs_open', 'LBS_OPEN', 'naomask', 'valorvg', 10, 1, null, null, '<?php echo str_replace("'", "\'", $this->field_config['lbs_open']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['lbs_open']['symbol_dec']); ?>');
 NM_tab_crit[28] = new NM_critica('F1', 'lbs_knit', 'LBS_KNIT', 'naomask', 'valorvg', 7, 1, -0, 99999999, '<?php echo str_replace("'", "\'", $this->field_config['lbs_knit']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['lbs_knit']['symbol_dec']); ?>');
 NM_tab_crit[29] = new NM_critica('F1', 'lbs_sold', 'LBS_SOLD', 'naomask', 'valorvg', 10, 1, null, null, '<?php echo str_replace("'", "\'", $this->field_config['lbs_sold']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['lbs_sold']['symbol_dec']); ?>');
 NM_tab_crit[30] = new NM_critica('F1', 'waste', 'waste', 'naomask', 'valorvg', 10, 1, null, null, '<?php echo str_replace("'", "\'", $this->field_config['waste']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['waste']['symbol_dec']); ?>');
 NM_tab_crit[31] = new NM_critica('F1', 'inventory', 'INVENTORY', 'naomask', 'valorvg', 8, 1, null, null, '<?php echo str_replace("'", "\'", $this->field_config['inventory']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['inventory']['symbol_dec']); ?>');
 NM_tab_crit[32] = new NM_critica('F1', 'lbs_allocd', 'LBS_ALLOCD', 'naomask', 'numeroedtvg', 11, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['lbs_allocd']['symbol_grp']); ?>');
 NM_tab_crit[33] = new NM_critica('F1', 'lbs_avail', 'LBS_AVAIL', 'naomask', 'numeroedtvg', 11, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['lbs_avail']['symbol_grp']); ?>');
 NM_tab_crit[34] = new NM_critica('F1', 'cost_lb_y', 'COST_LB_Y', 'naomask', 'valorvg', 5, 3, -0, 99999999, '<?php echo str_replace("'", "\'", $this->field_config['cost_lb_y']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['cost_lb_y']['symbol_dec']); ?>');
 NM_tab_crit[35] = new NM_critica('F1', 'cost_lb_w', 'COST_LB_W', 'naomask', 'valorvg', 5, 3, -0, 99999999, '<?php echo str_replace("'", "\'", $this->field_config['cost_lb_w']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['cost_lb_w']['symbol_dec']); ?>');
 NM_tab_crit[36] = new NM_critica('F1', 'cost_lb_t', 'COST_LB_T', 'naomask', 'valorvg', 5, 3, -0, 99999999, '<?php echo str_replace("'", "\'", $this->field_config['cost_lb_t']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['cost_lb_t']['symbol_dec']); ?>');
 NM_tab_crit[37] = new NM_critica('F1', 'tv', 'TV', 'naomask', 'valorvg', 9, 2, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['tv']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['tv']['symbol_dec']); ?>');
 NM_tab_crit[38] = new NM_critica('F1', 'top_p_o_', 'TOP_P_O_', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit[39] = new NM_critica('F1', 'bot_p_o_', 'BOT_P_O_', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit[40] = new NM_critica('F1', 'tcost', 'TCOST', 'naomask', 'valorvg', 9, 2, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['tcost']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['tcost']['symbol_dec']); ?>');
 NM_tab_crit[41] = new NM_critica('F1', 'samt', 'SAMT', 'naomask', 'valorvg', 9, 2, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['samt']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['samt']['symbol_dec']); ?>');
 NM_tab_crit[42] = new NM_critica('F1', 'acost', 'ACOST', 'naomask', 'valorvg', 6, 3, null, null, '<?php echo str_replace("'", "\'", $this->field_config['acost']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['acost']['symbol_dec']); ?>');
 NM_tab_crit[43] = new NM_critica('F1', 'ns', 'NS', 'naomask', 'numeroedtvg', 4, -0, 9999, '<?php echo str_replace("'", "\'", $this->field_config['ns']['symbol_grp']); ?>');
 NM_tab_crit[44] = new NM_critica('NM_final');
 NM_tab_crit_1 = new NM_critica(30);
 NM_tab_crit_1[1] = new NM_critica('F1', 'ac', 'AC', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit_1[2] = new NM_critica('F1', 'p_o_number', 'P_O_NUMBER', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit_1[3] = new NM_critica('F1', 'date', 'DATE', 'naomask', 'data', '<?php echo $this->field_config['date']['date_format']; ?>'<?php echo ", '', ''"; ?>, '<?php echo $this->field_config['date']['date_sep']; ?>');
 NM_tab_crit_1[4] = new NM_critica('F1', 'to', 'TO', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit_1[5] = new NM_critica('F1', 'ship_to', 'SHIP_TO', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit_1[6] = new NM_critica('F1', 'location', 'LOCATION', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit_1[7] = new NM_critica('F1', 'desc', 'DESC', 'naomask', 'lista', 'cxab', 25, 'TUDO');
 NM_tab_crit_1[8] = new NM_critica('F1', 'delivery', 'DELIVERY', 'naomask', 'lista', 'cxab', 13, 'TUDO');
 NM_tab_crit_1[9] = new NM_critica('F1', 'comment', 'COMMENT', 'naomask', 'lista', 'cxab', 40, 'TUDO');
 NM_tab_crit_1[10] = new NM_critica('F1', 'lbs_orderd', 'LBS_ORDERD', 'naomask', 'numeroedtvg', 11, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['lbs_orderd']['symbol_grp']); ?>');
 NM_tab_crit_1[11] = new NM_critica('F1', 'price_lb_w', 'PRICE_LB_W', 'naomask', 'valorvg', 5, 3, -0, 99999999, '<?php echo str_replace("'", "\'", $this->field_config['price_lb_w']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['price_lb_w']['symbol_dec']); ?>');
 NM_tab_crit_1[12] = new NM_critica('F1', 'warp_loss', 'WARP_LOSS', 'naomask', 'valorvg', 5, 1, -0, 999999, '<?php echo str_replace("'", "\'", $this->field_config['warp_loss']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['warp_loss']['symbol_dec']); ?>');
 NM_tab_crit_1[13] = new NM_critica('F1', 'markdown', 'MARKDOWN', 'naomask', 'valorvg', 5, 2, -0, 9999999, '<?php echo str_replace("'", "\'", $this->field_config['markdown']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['markdown']['symbol_dec']); ?>');
 NM_tab_crit_1[14] = new NM_critica('F1', 'den', 'DEN', 'naomask', 'lista', 'cxab', 3, 'TUDO');
 NM_tab_crit_1[15] = new NM_critica('F1', 'fil', 'FIL', 'naomask', 'lista', 'cxab', 3, 'TUDO');
 NM_tab_crit_1[16] = new NM_critica('F1', 'luster', 'LUSTER', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit_1[17] = new NM_critica('F1', 'producer', 'PRODUCER', 'naomask', 'lista', 'cxab', 6, 'TUDO');
 NM_tab_crit_1[18] = new NM_critica('F1', 'fiber', 'FIBER', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit_1[19] = new NM_critica('F1', 'merge', 'MERGE', 'naomask', 'lista', 'cxab', 6, 'TUDO');
 NM_tab_crit_1[20] = new NM_critica('F1', 'beam_code', 'BEAM_CODE', 'naomask', 'lista', 'cxab', 4, 'TUDO');
 NM_tab_crit_1[21] = new NM_critica('F1', 'size', 'SIZE', 'naomask', 'lista', 'cxab', 6, 'TUDO');
 NM_tab_crit_1[22] = new NM_critica('F1', 'b_s', 'B_S', 'naomask', 'lista', 'cxab', 1, 'TUDO');
 NM_tab_crit_1[23] = new NM_critica('F1', 'yarn_code', 'YARN_CODE', 'naomask', 'numeroedtvg', 10, -0, 9999999999, '<?php echo str_replace("'", "\'", $this->field_config['yarn_code']['symbol_grp']); ?>');
 NM_tab_crit_1[24] = new NM_critica('F1', 'waste', 'waste', 'naomask', 'valorvg', 10, 1, null, null, '<?php echo str_replace("'", "\'", $this->field_config['waste']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['waste']['symbol_dec']); ?>');
 NM_tab_crit_1[25] = new NM_critica('F1', 'top_p_o_', 'TOP_P_O_', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit_1[26] = new NM_critica('F1', 'bot_p_o_', 'BOT_P_O_', 'naomask', 'lista', 'cxab', 5, 'TUDO');
 NM_tab_crit_1[27] = new NM_critica('F1', 'samt', 'SAMT', 'naomask', 'valorvg', 9, 2, -0, 99999999999, '<?php echo str_replace("'", "\'", $this->field_config['samt']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['samt']['symbol_dec']); ?>');
 NM_tab_crit_1[28] = new NM_critica('F1', 'acost', 'ACOST', 'naomask', 'valorvg', 6, 3, null, null, '<?php echo str_replace("'", "\'", $this->field_config['acost']['symbol_grp']); ?>', '<?php echo str_replace("'", "\'", $this->field_config['acost']['symbol_dec']); ?>');
 NM_tab_crit_1[29] = new NM_critica('F1', 'ns', 'NS', 'naomask', 'numeroedtvg', 4, -0, 9999, '<?php echo str_replace("'", "\'", $this->field_config['ns']['symbol_grp']); ?>');
 NM_tab_crit_1[30] = new NM_critica('NM_final');

function nm_navpage(x, op) 
{ 
    nm_move('navpage', x);
} 
function nm_move(x, y, z) 
{ 
    if (Nm_Proc_Atualiz)
    {
        return;
    }
    if (("inicio" == x || "retorna" == x) && "S" != Nav_permite_ret)
    {
        return;
    }
    if (("avanca" == x || "final" == x) && "S" != Nav_permite_ava)
    {
        return;
    }
    document.F2.nmgp_opcao.value = x; 
    document.F2.nmgp_ordem.value = y; 
    document.F2.nmgp_clone.value = "";
    if ("apl_detalhe" == x)
    {
        document.F2.nmgp_opcao.value = 'igual'; 
        document.F2.master_nav.value = 'on'; 
        if (z)
        {
            document.F2.sc_ifr_height.value = z;
        }
        document.F2.submit();
        return;
    }
    if ("clone" == x)
    {
        x = "novo";
        document.F2.nmgp_clone.value = "S";
        document.F2.nmgp_opcao.value = x; 
    }
    if ("fast_search" == x)
    {
        document.F2.nmgp_ordem.value = ''; 
        document.F2.nmgp_fast_search.value = scAjaxGetFieldSelect("nmgp_fast_search_" + y); 
        document.F2.nmgp_cond_fast_search.value = scAjaxGetFieldSelect("nmgp_cond_fast_search_" + y); 
        document.F2.nmgp_arg_fast_search.value = scAjaxGetFieldText("nmgp_arg_fast_search_" + y); 
    }
    if ("novo" == x || "edit_novo" == x)
    {
<?php
       $NM_parm_ifr = ($NM_run_iframe == 1) ? "NM_run_iframe?#?1?@?" : "";
?>
        document.F2.nmgp_parms.value = "<?php echo $NM_parm_ifr ?>";
        document.F2.submit();
    }
    else
    {
        do_ajax_beam_warppo_beam_form_navigate_form();
    }
} 
var sc_mupload_ok = true;
function nm_atualiza(x, y) 
{ 
    if (!sc_mupload_ok)
    {
        if (!confirm("<?php echo $this->Ini->Nm_lang['lang_errm_muok'] ?>"))
        {
            return;
        }
        sc_mupload_ok = true;
    }
    var Nm_submit_ok = true; 
    if (Nm_Proc_Atualiz)
    {
        return;
    }
    if (!scAjaxDetailProc())
    {
        return;
    }
<?php
    $NM_parm_ifr = ($NM_run_iframe == 1) ? "NM_run_iframe?#?1?@?" : "";
?>
    document.F1.nmgp_parms.value = "<?php echo $NM_parm_ifr ?>";
    document.F1.target = "_self";
    if (x == "muda_form") 
    { 
       document.F1.nmgp_num_form.value = y; 
    } 
    if (x == "excluir") 
    { 
       if (confirm ("<?php echo html_entity_decode($this->Ini->Nm_lang['lang_errm_remv']); ?>"))  
       { 
           document.F1.nmgp_opcao.value = x; 
           document.F1.submit(); 
       } 
       else 
       { 
          return; 
       } 
    } 
    else 
    { 
       document.F1.nmgp_opcao.value = x; 
       if ("incluir" == x || "muda_form" == x)
       {
           Nm_Proc_Atualiz = true;
           document.F1.submit();
       }
       else
       {
           Nm_Proc_Atualiz = true;
           do_ajax_beam_warppo_beam_form_submit_form();
       }
    } 
    if (Nm_submit_ok)
    { 
        Nm_Proc_Atualiz = true;
    } 
} 
function nm_mostra_img(imagem, altura, largura)
{
    tb_show('', imagem, '');
}
function nm_recarga_form(nm_ult_ancora, nm_ult_page) 
{ 
    document.F1.target = "_self";
    document.F1.nmgp_parms.value = "";
    document.F1.nmgp_ancora.value= nm_ult_page; 
    document.F1.nmgp_ancora.value= nm_ult_page; 
    document.F1.nmgp_opcao.value= "recarga"; 
    document.F1.action += "#" +  nm_ult_ancora;
    document.F1.submit(); 
} 
function nm_link_url(Sc_url)
{
    if (Sc_url.substr(0, 7) != 'http://' && Sc_url.substr(0, 8) != 'https://')
    {
        Sc_url = 'http://' + Sc_url;
    }
    return Sc_url;
}
function sc_trim(str, chars) {
        return sc_ltrim(sc_rtrim(str, chars), chars);
}
function sc_ltrim(str, chars) {
        chars = chars || "\\s";
        return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function sc_rtrim(str, chars) {
        chars = chars || "\\s";
        return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
var hasJsFormOnload = false;
function sc_exib_ocult_pag(N_pagina)
{
    document.getElementById('beam_warppo_beam_form_form0').style.width='1px';
    document.getElementById('beam_warppo_beam_form_form0').style.height='0px';
    document.getElementById('beam_warppo_beam_form_form0').style.display='none';
    document.getElementById('beam_warppo_beam_form_form0').style.overflow='scroll';
    document.getElementById('beam_warppo_beam_form_form1').style.width='1px';
    document.getElementById('beam_warppo_beam_form_form1').style.height='0px';
    document.getElementById('beam_warppo_beam_form_form1').style.display='none';
    document.getElementById('beam_warppo_beam_form_form1').style.overflow='scroll';
    document.getElementById('beam_warppo_beam_form_form2').style.width='1px';
    document.getElementById('beam_warppo_beam_form_form2').style.height='0px';
    document.getElementById('beam_warppo_beam_form_form2').style.display='none';
    document.getElementById('beam_warppo_beam_form_form2').style.overflow='scroll';
    document.getElementById('beam_warppo_beam_form_form3').style.width='1px';
    document.getElementById('beam_warppo_beam_form_form3').style.height='0px';
    document.getElementById('beam_warppo_beam_form_form3').style.display='none';
    document.getElementById('beam_warppo_beam_form_form3').style.overflow='scroll';
    document.getElementById('beam_warppo_beam_form_form4').style.width='1px';
    document.getElementById('beam_warppo_beam_form_form4').style.height='0px';
    document.getElementById('beam_warppo_beam_form_form4').style.display='none';
    document.getElementById('beam_warppo_beam_form_form4').style.overflow='scroll';
    document.getElementById('beam_warppo_beam_form_form5').style.width='1px';
    document.getElementById('beam_warppo_beam_form_form5').style.height='0px';
    document.getElementById('beam_warppo_beam_form_form5').style.display='none';
    document.getElementById('beam_warppo_beam_form_form5').style.overflow='scroll';
    document.getElementById(N_pagina).style.width='';
    document.getElementById(N_pagina).style.height='';
    document.getElementById(N_pagina).style.display='';
    document.getElementById(N_pagina).style.overflow='visible';
    sc_tab_pag(pag_ativa, 'scTabInactive');
    pag_ativa = N_pagina;
    sc_tab_pag(pag_ativa, 'scTabActive');
   if ("beam_warppo_beam_form_form1" == N_pagina) {
     scAjaxDetailHeight("beam_wstemp_edit_grid", $($("#nmsc_iframe_liga_beam_wstemp_edit_grid")[0].contentWindow.document).innerHeight());
    }
   if ("beam_warppo_beam_form_form2" == N_pagina) {
     scAjaxDetailHeight("beam_TopUse_grid", $($("#nmsc_iframe_liga_beam_TopUse_grid")[0].contentWindow.document).innerHeight());
     scAjaxDetailHeight("beam_BotUse_grid", $($("#nmsc_iframe_liga_beam_BotUse_grid")[0].contentWindow.document).innerHeight());
    }
   if ("beam_warppo_beam_form_form4" == N_pagina) {
     scAjaxDetailHeight("beam_bysale_edit_grid", $($("#nmsc_iframe_liga_beam_bysale_edit_grid")[0].contentWindow.document).innerHeight());
    }
   if ("beam_warppo_beam_form_form5" == N_pagina) {
     scAjaxDetailHeight("beam_pyalloc_edit_grid", "1000`");
    }
}
function sc_tab_pag(N_pagina, C_class)
{
    document.getElementById('id_' + N_pagina + '_font').className = C_class + 'Font ' + C_class + 'FontCustom';
    document.getElementById('id_' + N_pagina + '_4').className = C_class;
    document.getElementById('id_' + N_pagina + '_5').className = C_class + ' ' + C_class + 'Bg';
    document.getElementById('id_' + N_pagina + '_6').className = C_class;
    if ('scTabActive' == C_class)
    {
        document.getElementById('id_' + N_pagina + '_tl').src = '<?php echo $this->Ini->path_img_global . '/' . $str_active_top_esq; ?>';
        document.getElementById('id_' + N_pagina + '_tr').src = '<?php echo $this->Ini->path_img_global . '/' . $str_active_top_dir; ?>';
        document.getElementById('id_' + N_pagina + '_t').style.backgroundImage = 'url(<?php echo $this->Ini->path_img_global . '/' . $str_active_lin_top; ?>)';
        document.getElementById('id_' + N_pagina + '_4').style.backgroundImage = 'url(<?php echo $this->Ini->path_img_global . '/' . $str_active_col_esq; ?>)';
        document.getElementById('id_' + N_pagina + '_6').style.backgroundImage = 'url(<?php echo $this->Ini->path_img_global . '/' . $str_active_col_dir; ?>)';
    }
    else
    {
        document.getElementById('id_' + N_pagina + '_tl').src = '<?php echo $this->Ini->path_img_global . '/' . $str_inactive_top_esq; ?>';
        document.getElementById('id_' + N_pagina + '_tr').src = '<?php echo $this->Ini->path_img_global . '/' . $str_inactive_top_dir; ?>';
        document.getElementById('id_' + N_pagina + '_t').style.backgroundImage = 'url(<?php echo $this->Ini->path_img_global . '/' . $str_inactive_lin_top; ?>)';
        document.getElementById('id_' + N_pagina + '_4').style.backgroundImage = 'url(<?php echo $this->Ini->path_img_global . '/' . $str_inactive_col_esq; ?>)';
        document.getElementById('id_' + N_pagina + '_6').style.backgroundImage = 'url(<?php echo $this->Ini->path_img_global . '/' . $str_inactive_col_dir; ?>)';
    }
}

function scCssFocus(oHtmlObj)
{
  if (navigator.userAgent && 0 < navigator.userAgent.indexOf("MSIE") && "select" == oHtmlObj.type.substr(0, 6))
    return;
  $(oHtmlObj).addClass('scFormObjectFocusOdd')
             .removeClass('scFormObjectOdd');
}

function scCssBlur(oHtmlObj)
{
  if (navigator.userAgent && 0 < navigator.userAgent.indexOf("MSIE") && "select" == oHtmlObj.type.substr(0, 6))
    return;
  $(oHtmlObj).addClass('scFormObjectOdd')
             .removeClass('scFormObjectFocusOdd');
}

</script> 
