/**
 *	Class to submit a form according to a specific action.
 *
 *	@author		Unknown
 *	@version	1.0
 *	@copyright	Katana Productions Pty Ltd 2002
 *
 *	@param	form    The form object to be submitted.
*/
function PageAction(form, idName)
{
  this.base = Action;
  this.base(form, idName)
}

PageAction.prototype = new Action

/**
 *	Causes a page action submit of the form.
 *
 *	@param action A string representing the action to be taken on the server.
 *	@param page An integer representing the new page number.
*/
PageAction.prototype.doPage = function(action, page, url)
{
  if (this.form)
  {
    this._insertSearchFields();
    var pageField = eval('this.form.' + this.form.name + 'Page')
    if (pageField) pageField.value = page;
    // if a url has been specified then we need to redirect to it.
    if (url)
    {
      this.doRedirectAction(url,action);
    }
    else
    {
      this.doAction(action);
    }
  }
}
