Ext.define('LessonFrameClass', {
    constructor: function(){
        this.Frame = Ext.getBody();
    },
    setColor: function(color){
        this.Frame.setStyle('background-color', color);
    },
    setLinearGradient: function(startColor, endColor){
        var gradientStyle = "";
        if (Ext.isIE) {
            gradientStyle = Ext.String.format("filter: progid:DXImageTransform.Microsoft.gradient(enabled='true', startColorstr={0}, endColorstr={1});", startColor, endColor);
        }
        else if (Ext.isGecko) {
            gradientStyle = Ext.String.format("background-image: -moz-linear-gradient(0% 0 270deg, {0}, {1});", startColor, endColor);
        }
        else if (Ext.isOpera) {
            gradientStyle = Ext.String.format("background-image: -o-linear-gradient(top, {0}, {1});", startColor, endColor);
        }
        else {
            gradientStyle = Ext.String.format("background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from({0}), to({1}));", startColor, endColor);
        }
        this.Frame.applyStyles(gradientStyle);
    },
    setImage: function(imageFileName, repeat){
        repeat = repeat || 'repeat';
        var imageUrl = AuthorUtils.getAbsoluteResourcePath(Author.resourcePath) + imageFileName;
        this.Frame.setStyle('background-image', Ext.String.format('url({0})', imageUrl));
        this.Frame.setStyle('background-repeat', repeat);
    }
});
