/**
 * Разбор объекта
 * @param obj - Объект на проверку
 */

var dump = function (obj) {
    var out = "";
    if(obj && typeof(obj) == "object"){
        for (var i in obj) {
            out += i + ": " + obj[i] + "\n";
        }
    } else {
        out = obj;
    }
    alert(out);
}

var message = {

    show: function(text, type) {
        var id = new Date().getTime();

        var classes = 'n-box';
        switch(type) {
        case 'error':
            classes += ' n-error'
            break;
        case 'notice':
            classes += ' n-notice'
            break;
        }
        $('#notifier').append('<div id="notice-' + id + '" class="' + classes + '" style=""><p>' + text + '</p></div>');
        setTimeout(function() {
            $('#notice-' + id).remove();
        }, 5000);
    },

    error: function(text) {
        this.show(text, 'error');
    },

    notice: function(text) {
        this.show(text, 'notice');
    }
}
