﻿// 2_ show the notification by calling the "create" method
function showNotification(titleText, textText, elementId) {
    // 1_ initialise widget on the container
    if (typeof elementId == "undefined" || elementId == null) {
        elementId = "#notification";
    }

    var notification = $(elementId);

    if (notification.length > 0) {
        $notification = notification.notify();

        return $notification.notify("create", {
            title: titleText,
            text: textText
        }, {
            speed: 500,
            expires: 5000
        });
    }
}
