
//  @import com.hedgehoglab.application.view.BaseView;

var FlashMessage=(function(_scope){
    $(function(e){
        _scope.element=$(_scope.jquery_template).hide().removeClass('hide');
    });


    function log(obj){
        $('div.fm-container',_scope.element).removeClass('notification').removeClass('error');
        $('div.fm-container',_scope.element).addClass(obj.type);
        
        $('div.fm-container',_scope.element).html("<p>"+obj.message+"</p>");
        _scope.element.fadeIn(250);

        setTimeout(function(e){
            _scope.element.fadeOut(250,function(e){
                $('div',_scope.element).html("");
            });
        },_scope.timeout);
    };

    function _FlashMessage(scope){
        //BaseView.call(this,_scope);
        
        if(!_scope.element)
        this.log=log;
    };

    return _FlashMessage;
})({
    jquery_template:'#iFlashMessage',
    timeout:5000
});
