﻿var mbox = {
    // internal method
    displayMsg: function(options) {
        var css = {};
        if (options.title == null || typeof (options.title) == 'undefined')
            options.title = 'Poruka';

        switch (options.msgType) {
            case "error":
                css = {
                    background: '#F3D8D9',
                    color: '#9A3033'
                };
                break;
            case "warning":
                css = {
                    background: '#E8E2C1',
                    color: '#6F6428'
                };
                break;
            default:
                css = {
                    background: '#C0DCE4',
                    color: '#326574'
                };
                options.msgType = 'info';
                break;
        };
        css.opacity = 1;
        $.msg({
            msgID: 1,
            content: '<div class="msg-box"><table style="border:0px;width:100%;"><tr><td><img src="' +
            _settings.url + '/images/mbox-' + options.msgType + '-icon.png" alt="Poruka" /></td><td style="width:100%;vertical-align:middle;"><h2>' +
            options.title + '</h2></td></tr></table>' + options.content + '</div><div style="text-align:right;" class="msg-box-' +
            options.msgType + '">' +
            '<input type="button" value="Zatvori" onclick="$.msg(\'unblock\', 0, 1);"/></div>',
            autoUnblock: false,
            bgPath: _settings.url + '/images/',
            css: css
        });
    },
    alert: function(options) {
        // required: content
        // optional: msgType (info/warning/error), title
        this.displayMsg(options);
    }
};
