(function(){//enable.views.js requires enable.js

/******************************************************************************\
    Enable.view.tip
    Tool-tip style message.
*******************************************************************************/
Enable.view.tip = function(contents) {
    var message = div(contents).css({
        background   : '#191919',
        borderTop    : '1px solid #707070',
        borderleft   : '1px solid #707070',
        color        : '#EFEFEF',
        fontSize     : 10,
        lineHeight   : 14,
        padding      : '3px 5px',
        fontWeight   : 'bold'
    });
    var point = div().css({
        paddingBottom   : '6px',
        background      : 'no-repeat bottom left',
        backgroundImage : image('tip-black-point.gif')
    });
    var tip = div().css({
        width         : '350px'
    });
    
    message.appendTo(point);
    point.appendTo(tip);
    
    return tip;
};
/******************************************************************************\
    Enable.view.label
    Status labels
*******************************************************************************/
Enable.view.label = function(message, type) {
    var label = {};
    var types = {};
    
    types.normal = {
        paddingLeft : '8px',
        color       : '#000000'
    };
    types.warning = {
        paddingLeft : '25px',
        color       : '#000000'
    };
    types.correct = {
        paddingLeft : '25px',
        color       : '#FFFFFF'
    };
    types.question = {
        paddingLeft : '25px',
        color       : '#FFFFFF'
    };
    types.error = {
        paddingLeft : '25px',
        color       : '#FFFFFF'
    };
    
    message = message || '';
    type = types[type] ? type : 'normal';
    
    label.right = div().css({
        height          : '35px',
        lineHeight      : '35px',
        background      : 'no-repeat top right',
        backgroundImage : image('tip-'+type+'-right.gif'),
        paddingRight    : '8px',
        position        : 'absolute'
    });
    label.left = div().css({
        height          : '35px',
        lineHeight      : '35px',
        background      : 'no-repeat top left',
        backgroundImage : image('tip-'+type+'-left.gif'),
        paddingLeft     : types[type].paddingLeft
    });
    label.body = div(message).css({
        height          : '35px',
        lineHeight      : '25px',
        fontSize        : '13px',
        fontWeight      : 'bold',
        whiteSpace      : 'nowrap',
        paddingLeft     : '4px',
        paddingRight    : '8px',
        color           : types[type].color,
        background      : 'repeat-x top',
        backgroundImage : image('tip-'+type+'-repeat.gif')
    });
    
    label.right.append(label.left);
    label.left.append(label.body);
    
    return label.right;
};

//image folder file path
Enable.setting.image_path = "http://www.causes.com/cur/images/facebook/enable/";

//local image paths
var image = function(src) {
    return 'url('+Enable.setting.image_path+src+')';
};

//blank blockmodel div
var div = function(innerHTML){
    innerHTML = innerHTML || '';
    return Enable('<div>'+innerHTML+'</div>').css({
        margin : '0px',
        padding: '0px',
        border : '0px black solid'
    });
};

})();// end of enable.views.js