function ExecuteCommand(fname, command) {
  var f = document.forms[fname];
  f.elements['command'].value = command;
  f.submit();
}

function deleteFriendship(fname, command, friend_id) {
  var f = document.forms[fname];
  f.elements['custom'].value = friend_id;
  ExecuteCommand(fname, command);
}

function toogleCommentForm(id1, id2) {
  var b0 = document.getElementById(id1);
  var b1 = document.getElementById(id2);
  b0.style.display = (b0.style.display == 'none') ? 'block' : 'none';
  b1.style.display = (b1.style.display == 'none') ? 'block' : 'none';
}

function addComment(fname, command, comment_el_id) {
  var foo = document.getElementById(comment_el_id).value;
  var comment = trim(foo);
  if (0 == foo.length) {
    alert(_msg03); 
    return false;
  }
  var f = document.forms[fname];
  f.elements['custom'].value = comment;
  ExecuteCommand(fname, command);
}

function delComment(fname, command, comment_id) {
  var f = document.forms[fname];
  f.elements['custom'].value = comment_id;
  ExecuteCommand(fname, command);
}
