<% /*
     $Revision$
     $Id$

    File:           fac_nieuws_forum.inc
    Description:    Toont de hotnew portal alert die via fac_portalert_xd is ingesteld
    Parameters:
    Context:        myfacilitor.asp en mogelijk klanten met geheel eigen portal
    Note:

*/ %>
<%

var hasNews = Application("portalalert") &&
              (user.checkAutorisation("WEB_PRSSYS", true) || user.checkAutorisation("WEB_FACMGT", true));

if (hasNews)
    FCLTHeader.Requires({ plugins: ["jQuery"],
                          js: ["jQuery-ui.js"] // Voor accordion
                        });

function injectNews ()
{
  if (!user.has("WEB_PRSSYS") && !user.has("WEB_FACMGT"))
    return;

  // Hot news overruled forum berichten
  if (Application("portalalert"))
  {
      var messageContainer = "<div id=\"container\">"+ Application("portalalert").replace(/\n/g, "<br>") + "</div>";
      var header = "<h5><a href=\"#\">" + L("lcl_forum_news").format(1) + "</a></h5>";

      Response.Write('<div id="facforum"></div>');
      Response.Write('<script>$("#facforum").append(\'' + safe.jsstring(header + messageContainer) + '\')');
      Response.Write('.accordion({ collapsible: true , heightStyleType: "auto", active : false, activate: function () { FcltMgr.resized() } });');
      Response.Write('</script>');
  }
}
%>