/**
 * The onclick handler for HtmlNavigationMenu.
 *
 * @param formClientId  the clientId of the enclosing UIForm component
 * @param clientId      the clientId of the UINavigationMenu component
 * @param itemId        the id of the UINavigationItem that was clicked
 */
function _onNavigationItem_click (
  formClientId, 
  clientId, 
  itemId,
  itemlevel)
{
  var form = document.forms[formClientId];
  var input = form[clientId];
  if (!input)
  {
    input = document.createElement("input");
    input.type = 'hidden';
    input.name = clientId;
    form.appendChild(input);
  }
  input.value = itemId;
  
  var level = form[clientId + "level"];
  if (!level)
  {
    level = document.createElement("input");
    level.type = 'hidden';
    level.name = clientId + "level";
    form.appendChild(level);
  }
  level.value = itemlevel; 
  form.submit();
}
