﻿var nav =
{
  submit : function()
  {
    window.document.forms[0].submit();
  },
  
  to : function(pg)
  {
    var p = document.getElementById('npg'); 
    
    p.value = pg;
      
    nav.submit();
  },
  
  next : function()
  {
    var lp = document.getElementById('lpg');
    nav.to(parseInt(lp.value) + 1);
  },
    
  event : function(pbe, npg)
  {
    var e = document.getElementById('pbe'); 
    var p = document.getElementById('npg');   
    var c = true;
    
    if (window.onAction)
      c = window.onAction();      
      
    if (c)
    {      
      e.value = pbe ;
      
      if (npg)
        p.value = npg;
              
      nav.submit();
    }
  },
  
  popup : function(url)
  {
    window.open(url, "AddIncPopup", "width=800,height=600");
  },
  
  window : function(url)
  {
    window.open(url, "AddIncWindow", "width=800,height=600,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes,scrollbars=yes");
  }
}
