/*
     $Revision$
     $Id$

     JS voor fac_user_messages.asp
*/
function DoAction(messKey, isNew, action) {
  if (isNew)
      MarkAsRead(messKey, isNew, 0);
  FcltMgr.openDetail(action, { reuse: true });
}

function MarkAsRead(messKey, wasnew, dopurge) {
  $.post("fac_user_messages_setReadFlag.asp?messKey=" + messKey+(dopurge==1 ? "&purge=1" : ""));
  if (dopurge) $("[messKey="+messKey+"]").hide();
}

function MarkAsReadAll()
{
  if (confirm(L("lcl_fac_delete_all_msg")))
    $.post("fac_user_messages_setReadFlag.asp",
           { deleteall: 1 },
           FcltCallbackRefresh,
           "json");
}