Show CRM style notification bar at entity forms.

document.addNotification = function(img, msg) {
    var parent = document.getElementById("Notifications"
);
    if
(parent) {
        var
count = parent.childNodes.length;
        var html = "<DIV class=\"Notification\" id=\"Notification"+count+"\" Order=\""+count+"\"><TABLE cellSpacing=\"0\" cellPadding=\"0\"><TBODY><TR><TD vAlign=\"top\">"
;
        if (img!=null
)
            html += "<IMG class=\"ms-crm-Lookup-Item\" src=\""+img+"\" />"
;
        html += "</TD><TD><SPAN id=\"Notification"+count+"_text\"><B style=\"COLOR: #ff0000\">"+msg+"</B></SPAN></TD></TR></TBODY></TABLE></DIV>"
;
        parent.innerHTML+=html;
        parent.style.display="block"
;
    }
}

The first argument is image url. The second is the message text:

document.addNotification("/_imgs/error/notif_icn_warn16.png","This is a test.");