I have a MVC3 HtmlHelper extension like this:
public static MvcHtmlString ShowInfoBar(this HtmlHelper helper, string message, InfoMessageType messageType)
On every brace that isn't a token you must double - so
function() {{
Etc
Also - consider XSS here - is message escaped correctly for inserting into JavaScript?
message