function updateMenu(form)
{
     var norecs=form.del.length;
     var url='modules.php?mod=menuedit&req=update&norecs='+norecs;

     // add each record in the loop to the URL.
     for (x=0; x < norecs; x++)
          {
          url+='&del'+x+'='+form.del[x].checked+
          '&parentid'+x+'='+form.parentid[x].value+
          '&group'+x+'='+form.group[x].value+
          '&title'+x+'='+form.title[x].value+
          '&url'+x+'='+form.url[x].value+
          '&li'+x+'='+form.li[x].checked+
          '&lo'+x+'='+form.lo[x].checked+
          '&orderno'+x+'='+form.orderno[x].value+
          '&recno'+x+'='+form.recno[x].value;

          }
     // add the form fields at the bottom for a new record.
     url+='&x_parentid='+form.x_parentid.value+
     '&x_group='+form.x_group.value+
     '&x_title='+form.x_title.value+
     '&x_url='+form.x_url.value+
     '&x_li='+form.x_li.checked+
     '&x_lo='+form.x_lo.checked+
     '&x_orderno='+form.x_orderno.value;

     // post the URL to the server.
     ret=serverFunction(url);

     // refresh the menu and the edit screen after the update to reflect changes.
     mainmenu();
     displayText('maincontent','modules.php?mod=menuedit');
     alert('The menu configuration has been upated.');
     return false;
}