// EmbeddedForum.js

function CommunityServer_EmbeddedForum(variableName, callbackUrl, scriptUrl, format_header, format_header_anonymous, format_post, format_postAlt, format_footer, format_footer_anonymous, format_registerForm, format_loginForm, format_postForm, format_replyForm, format_reportAbuseForm, loginToPostMessage, postTooLongMessage, css)
{
    this._variableName = variableName;
    this._scriptUrl = scriptUrl;
    this._callbackUrl = callbackUrl;
    if (this._callbackUrl.indexOf('&hosturl=') < 0)
    {
        if (this._callbackUrl.indexOf('?') > 0)
            this._callbackUrl += '&';
        else
            this._callbackUrl += '?';
            
        this._callbackUrl += 'rawhosturl=' + (new String(window.location));
    }
    
    this._format_header = format_header;
    this._format_header_anonymous = format_header_anonymous;
    this._format_post = format_post;
    this._format_postAlt = format_postAlt;
    this._format_footer = format_footer;
    this._format_footer_anonymous = format_footer_anonymous;
    this._format_registerForm = format_registerForm;
    this._format_loginForm = format_loginForm;
    this._format_postForm = format_postForm;
    this._format_replyForm = format_replyForm;
    this._format_reportAbuseForm = format_reportAbuseForm;
    this._css = css;
    
    this._message_loginToPost = loginToPostMessage;
    this._message_posttoolong = postTooLongMessage;

    this._container = null;
    this._currentForm = ""; // post, login, register
    this._currentPost = null;
    
    this._user_isLoggedIn = false;
    this._user_canPost = false;
    this._user_userAvatarUrl = '';
    this._posts = new Array();
    
    this._scriptCount = 0;
    
    window.setTimeout(new Function(this._variableName + '._initialize();'), 99);
}

// Initialize

CommunityServer_EmbeddedForum.prototype._initialize = function()
{
    var scriptUrl = this._scriptUrl.toLowerCase();
	var scripts = document.getElementsByTagName('script');
    var script = null;
    for (var i = 0; i < scripts.length; i++)
    {
        if (scripts[i].src && scripts[i].src.toLowerCase() == scriptUrl)
        {
	        script = scripts[i];
	        break;
        }
    }

    if (script)
    {
        this._container = document.createElement('div');
        
        var style = document.createElement('style');
        style.type = 'text/css';

        if (style.styleSheet)
            style.styleSheet.cssText = this._css;
        else
            style.appendChild(document.createTextNode(this._css));
        
        var heads = document.getElementsByTagName('HEAD');
        if (heads.length > 0)
            heads[0].appendChild(style);
        else
            script.parentNode.insertBefore(style, script);
        
        script.parentNode.insertBefore(this._container, script);
        script.parentNode.removeChild(script);
    
        var postData = new Array();
        
        if (document.title)
        {
            postData[postData.length] = 'hosttitle=';
            postData[postData.length] = encodeURIComponent(document.title);
        }
                
        this._doCallback("data", postData.join(''), new Function('data', this._variableName + '._initializeCallback(data);'), null);
    }
}

CommunityServer_EmbeddedForum.prototype._initializeCallback = function(data)
{
    this._user_isLoggedIn = data.isLoggedIn;
    this._user_canPost = data.canPost;
    this._user_userName = data.userName;
    this._user_userAvatarUrl = data.userAvatarUrl;
    this._posts = data.posts;
    
    if (this._user_canPost || this._user_isLoggedIn)
        this._currentForm = "post";
    else
        this._currentForm = "login";
    
    this.Refresh();
}

// Login

CommunityServer_EmbeddedForum.prototype._openLoginForm = function()
{
    this._currentForm = "login";
    
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._login = function()
{
    var postData = new Array();
    postData[postData.length] = 'userName=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('username','login')).value);
    postData[postData.length] = '&password=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('password','login')).value);
    
    var submitButton = document.getElementById(this._getFieldId('submit','login'));
    if (submitButton)
        submitButton.disabled = true;

    this._doCallback('login', postData.join(''), new Function('data', this._variableName + '._loginCallback(data)'), new Function('message', this._variableName + '._loginFailed(message)'));
}

CommunityServer_EmbeddedForum.prototype._loginCallback = function(data)
{
    this._user_isLoggedIn = data.isLoggedIn;
    this._user_userName = data.userName;
    this._user_canPost = data.canPost;
    this._user_userAvatarUrl = data.userAvatarUrl;
    
    if (this._user_isLoggedIn)
        this._currentForm = "post";
    
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._loginFailed = function(message)
{
    var submitButton = document.getElementById(this._getFieldId('submit','login'));
    if (submitButton)
        submitButton.disabled = false;
        
    alert(message);
}

// Register

CommunityServer_EmbeddedForum.prototype._openRegistrationForm = function()
{
    this._currentForm = "register";
    
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._register = function()
{
    var postData = new Array();
    postData[postData.length] = 'userName=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('username','register')).value);
    postData[postData.length] = '&password=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('password','register')).value);
    postData[postData.length] = '&email=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('email','register')).value);
    
    var submitButton = document.getElementById(this._getFieldId('submit','register'));
    if (submitButton)
        submitButton.disabled = true;

    this._doCallback("register", postData.join(''), new Function('data', this._variableName + '._registerCallback(data)'), new Function('message', this._variableName + '._registerFailed(message);'));
}

CommunityServer_EmbeddedForum.prototype._registerCallback = function(data)
{
    this._user_isLoggedIn = data.isLoggedIn;
    this._user_userName = data.userName;
    this._user_canPost = data.canPost;
    this._user_userAvatarUrl = data.userAvatarUrl;
    
    if (this._user_isLoggedIn)
        this._currentForm = "post";
    
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._registerFailed = function(message)
{
    var submitButton = document.getElementById(this._getFieldId('submit','register'));
    if (submitButton)
        submitButton.disabled = false;
        
    alert(message);
}

// Post

CommunityServer_EmbeddedForum.prototype._openPostForm = function()
{
    if (this._user_canPost)
        this._currentForm = "post";
    else
    {
        alert(this._message_loginToPost);
        this._currentForm = "login";
    }
        
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._addPost = function()
{
    var postData = new Array();
    postData[postData.length] = 'body=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('body','post')).value);

    var submitButton = document.getElementById(this._getFieldId('submit','post'));
    if (submitButton)
        submitButton.disabled = true;

    this._doCallback("addpost", postData.join(''), new Function('data', this._variableName + '._addPostCallback(data)'), new Function('message', this._variableName + '._addPostFailed(message);'));
}

CommunityServer_EmbeddedForum.prototype._addPostCallback = function(data)
{
    if (data.isApproved)
        this._posts[this._posts.length] = data.post;
    else
        alert(data.message);
    
    this._currentForm = "post";
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._addPostFailed = function(message)
{
    var submitButton = document.getElementById(this._getFieldId('submit','post'));
    if (submitButton)
        submitButton.disabled = false;
        
    alert(message);
}

// Reply

CommunityServer_EmbeddedForum.prototype._openReplyForm = function(postID)
{
    if (this._user_canPost)
    {
        this._currentPost = null;
        for (var i = 0; i < this._posts.length; i++)
        {
            if (this._posts[i].id == postID)
            {
                this._currentPost = this._posts[i];
                break;
            }
        }
    
        this._currentForm = "reply";
    }
    else
    {
        alert(this._message_loginToPost);
        this._currentForm = "login";
    }
        
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._addReply = function()
{
    var postData = new Array();
    postData[postData.length] = 'replyToPostID=';
    postData[postData.length] = this._currentPost.id;
    postData[postData.length] = '&body=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('body','reply')).value);

    var submitButton = document.getElementById(this._getFieldId('submit','reply'));
    if (submitButton)
        submitButton.disabled = true;

    this._doCallback("addpost", postData.join(''), new Function('data', this._variableName + '._addReplyCallback(data)'), new Function('message', this._variableName + '._addReplyFailed(message)'));
}

CommunityServer_EmbeddedForum.prototype._addReplyCallback = function(data)
{
    if (data.isApproved)
        this._posts[this._posts.length] = data.post;
    else
        alert(data.message);
    
    this._currentForm = "post";
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._addReplyFailed = function(message)
{
    var submitButton = document.getElementById(this._getFieldId('submit','reply'));
    if (submitButton)
        submitButton.disabled = false;
        
    alert(message);
}

// Report Abuse

CommunityServer_EmbeddedForum.prototype._openReportAbuseForm = function(postID)
{
    this._currentPost = null;
    for (var i = 0; i < this._posts.length; i++)
    {
        if (this._posts[i].id == postID)
        {
            this._currentPost = this._posts[i];
            break;
        }
    }

    this._currentForm = "reportabuse";
        
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._reportAbuse = function()
{
    var postData = new Array();
     
    postData[postData.length] = 'reportedPostID=';
    postData[postData.length] = this._currentPost.id;
    postData[postData.length] = '&body=';
    postData[postData.length] = encodeURIComponent(document.getElementById(this._getFieldId('body','abuse')).value);
    
    var submitButton = document.getElementById(this._getFieldId('submit','abuse'));
    if (submitButton)
        submitButton.disabled = true;

    this._doCallback("reportpost", postData.join(''), new Function('data', this._variableName + '._reportAbuseCallback(data)'), new Function('message', this._variableName + '._reportAbuseFailed(data)'));
}

CommunityServer_EmbeddedForum.prototype._reportAbuseCallback = function(data)
{
    alert(data.message);
    this._currentForm = "post";
    this.Refresh();
}

CommunityServer_EmbeddedForum.prototype._reportAbuseFailed = function(message)
{
    var submitButton = document.getElementById(this._getFieldId('submit','abuse'));
    if (submitButton)
        submitButton.disabled = false;
        
    alert(message);
}

// Log Out

CommunityServer_EmbeddedForum.prototype._logout = function()
{
    this._doCallback('logout', '', new Function('data', this._variableName + '._logoutCallback(data)'), null);
}

CommunityServer_EmbeddedForum.prototype._logoutCallback = function(data)
{
    this._user_isLoggedIn = data.isLoggedIn;
    this._user_userName = data.userName;
    this._user_canPost = data.canPost;
    this._user_userAvatarUrl = data.userAvatarUrl;
    
    if (this._user_canPost)
        this._currentForm = "post";
    else
        this._currentForm = "login";
    
    this.Refresh();
}

// UI refreshing

CommunityServer_EmbeddedForum.prototype.Reload = function()
{
    this._doCallback('data', '', new Function('data', this._variableName + '._initializeCallback(data);'), null);
}

CommunityServer_EmbeddedForum.prototype.Refresh = function()
{
    var content = new Array();
    
    if (this._user_isLoggedIn)
        content[content.length] = this._processHeaderFooterTemplate(this._format_header);
    else
        content[content.length] = this._processHeaderFooterTemplate(this._format_header_anonymous);
    
    for (var i = 0; i < this._posts.length; i++)
    {
        if (i % 2 == 0)
            content[content.length] = this._processPostTemplate(this._format_post, this._posts[i]);
        else
            content[content.length] = this._processPostTemplate(this._format_postAlt, this._posts[i]);
    }
    
    if (this._user_isLoggedIn)
        content[content.length] = this._processHeaderFooterTemplate(this._format_footer);
    else
        content[content.length] = this._processHeaderFooterTemplate(this._format_footer_anonymous);
    
    this._container.innerHTML = content.join('');
}

CommunityServer_EmbeddedForum.prototype._processPostTemplate = function(template, post)
{
    return this._commonTemplate(template).replace(/\{postbody\}/gi, post.body).replace(/\{postusername\}/gi, post.userName).replace(/\{postuserurl\}/gi, post.userUrl).replace(/\{postuseravatarurl\}/gi, post.userAvatarUrl).replace(/\{postdate\}/gi, post.postDate).replace(/\{replyscript\}/i, this._variableName + '._openReplyForm(' + post.id + '); return false;').replace(/\{reportabusescript\}/i, this._variableName + '._openReportAbuseForm(' + post.id + '); return false;');
}

CommunityServer_EmbeddedForum.prototype._processHeaderFooterTemplate = function(template)
{
    var result = this._commonTemplate(template);
    
    if (this._currentForm == "post" && this._user_canPost)
        result = result.replace(/\{form\}/i, this._getPostForm());
    else if (this._currentForm == "reply" && this._currentPost && this._user_canPost)
        result = result.replace(/\{form\}/i, this._getReplyForm());
    else if (this._currentForm == "reportabuse")
        result = result.replace(/\{form\}/i, this._getReportAbuseForm());
    else if (this._currentForm == "register" && !this._user_isLoggedIn)
        result = result.replace(/\{form\}/i, this._getRegisterForm());
    else if (this._currentForm = "login" && !this._user_isLoggedIn)
        result = result.replace(/\{form\}/i, this._getLoginForm());
    else
        result = result.replace(/\{form\}/i, "");
        
    return result;
}

CommunityServer_EmbeddedForum.prototype._getReportAbuseForm = function()
{
    return this._processPostTemplate(this._format_reportAbuseForm, this._currentPost).replace(/\{submitscript\}/i, this._variableName + '._reportAbuse(); return false;').replace(/\{bodyid\}/i, this._getFieldId('body','abuse')).replace(/\{submitid\}/i, this._getFieldId('submit','abuse'));    
}

CommunityServer_EmbeddedForum.prototype._getReplyForm = function()
{
    return this._processPostTemplate(this._format_replyForm, this._currentPost).replace(/\{submitscript\}/i, this._variableName + '._addReply(); return false;').replace(/\{bodyid\}/i, this._getFieldId('body','reply')).replace(/\{submitid\}/i, this._getFieldId('submit','reply'));    
}

CommunityServer_EmbeddedForum.prototype._getPostForm = function()
{
    return this._commonTemplate(this._format_postForm).replace(/\{submitscript\}/i, this._variableName + '._addPost(); return false;').replace(/\{bodyid\}/i, this._getFieldId('body','post')).replace(/\{submitid\}/i, this._getFieldId('submit','post'));
}

CommunityServer_EmbeddedForum.prototype._getRegisterForm = function()
{
    return this._commonTemplate(this._format_registerForm).replace(/\{submitscript\}/i, this._variableName + '._register(); return false;').replace(/\{usernameid\}/i, this._getFieldId('username','register')).replace(/\{passwordid\}/i, this._getFieldId('password','register')).replace(/\{emailid\}/i, this._getFieldId('email','register')).replace(/\{submitid\}/i, this._getFieldId('submit','register'));
}

CommunityServer_EmbeddedForum.prototype._getLoginForm = function()
{
    return this._commonTemplate(this._format_loginForm).replace(/\{submitscript\}/i, this._variableName + '._login(); return false;').replace(/\{usernameid\}/i, this._getFieldId('username','login')).replace(/\{passwordid\}/i, this._getFieldId('password','login')).replace(/\{submitid\}/i, this._getFieldId('submit','login'));
}

CommunityServer_EmbeddedForum.prototype._getFieldId = function(id, form)
{
    return this._variableName + "__" + form + "__" + id;
}

CommunityServer_EmbeddedForum.prototype._commonTemplate = function(template)
{
    return template.replace(/\{username\}/gi, this._user_userName).replace(/\{useravatarurl\}/gi, this._user_userAvatarUrl).replace(/\{postcount\}/gi, this._posts.length).replace(/\{registerscript\}/gi, this._variableName + "._openRegistrationForm(); return false;").replace(/\{postscript\}/gi, this._variableName + "._openPostForm(); return false;").replace(/\{loginscript\}/gi, this._variableName + "._openLoginForm(); return false;").replace(/\{logoutscript\}/gi, this._variableName + "._logout(); return false;");
}

/* AJAX stuff */

CommunityServer_EmbeddedForum.prototype._doCallback = function(mode, postData, clientCallback, clientErrorCallback)
{
    var url = this._callbackUrl.replace(/\{mode\}/i, mode);
    
    if (postData)
    {
        if (url.indexOf('?') > 0)
            url += "&" + postData;
        else
            url += "?" + postData;
    }
    
    this._scriptCount++;
    var context = this._variableName + "_s" + this._scriptCount;
    
    url = url.replace(/\{context\}/i, encodeURIComponent(context)).replace(/\{parentname\}/i, this._variableName);
    
    if (url.length > 2048)
    {
        if (clientErrorCallback)
            clientErrorCallback(this._mesage_posttoolong);
        else
            alert(this._message_posttoolong);
        return;
    }
    
    var s = document.createElement('script');
    s._clientCallback = clientCallback;
    s._clientErrorCallback = clientErrorCallback;
    s.id = context;
    s.src = url
    document.body.appendChild(s);
    
    s._callbackTimeout = window.setTimeout(new Function(this._variableName + '._callbackTimeout(\'' + s.id + '\');'), 29999);
}

CommunityServer_EmbeddedForum.prototype._callbackResponse = function(context, success, result)
{
    var s = document.getElementById(context);
    if (s)
    {
        window.clearTimeout(s._callbackTimeout);
    
        if (success)
        {
            if (s._clientCallback)
                s._clientCallback(result);
        }
        else
        {
            if (s._clientErrorCallback)
                s._clientErrorCallback(result);
            else if (result)
                alert(result);
        }
                
        s.parentNode.removeChild(s);
    }
}

CommunityServer_EmbeddedForum.prototype._callbackTimeout = function(context)
{
    var s = document.getElementById(context);
    if (s && s._clientErrorCallback)
    {
        s._clientErrorCallback('Callback request timed out.');
        s.parentNode.removeChild(s);
    }
}


var ef_3_527 = new CommunityServer_EmbeddedForum('ef_3_527','http://comunidade.mundofox.com.br/forums/3/embed.aspx?434658&hosturl=http%3a%2f%2fwww.mundofox.com.br%2fbr%2fvideos%2flipstick-jungle%2ftemporada-2%2f13662200001%2f&parentname={parentname}&context={context}&mode={mode}','http://comunidade.mundofox.com.br/forums/3/embed.aspx?434658&hosturl=http://www.mundofox.com.br/br/videos/lipstick-jungle/temporada-2/13662200001/','\r\n    <div class=\"EmbeddedForumHeaderArea\">\r\n      <h4 class=\"EmbeddedForumHeader\">{postcount} Comentários</h4>\r\n      <p><a href=\"#embeddedforumform\">Adicionar um comentário</a></p>\r\n    </div>\r\n    <div class=\"EmbeddedForumPosts\">\r\n      <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n        <tbody>\r\n  ','\r\n    <div class=\"EmbeddedForumHeaderArea\">\r\n      <h4 class=\"EmbeddedForumHeader\">{postcount} Comentários</h4>\r\n      <p><a href=\"#embeddedforumform\">Adicionar um comentário</a></p>\r\n    </div>\r\n    <div class=\"EmbeddedForumPosts\">\r\n      <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n        <tbody>\r\n  ','\r\n    <tr class=\"EmbeddedForumPost\">\r\n      <td class=\"EmbeddedForumPostAvatar\"><a href=\"{postuserurl}\"><img src=\"{postuseravatarurl}\" alt=\"{postusername}\" /></a></td>\r\n      <td class=\"EmbeddedForumPostDetails\">\r\n        <h5 class=\"EmbeddedForumPostAuthor\"><a href=\"{postuserurl}\">{postusername}</a></h5>\r\n        <div class=\"EmbeddedForumPostDate\">{postdate}</div>\r\n      </td>\r\n      <td class=\"EmbeddedForumPostContent\">\r\n        {postbody}\r\n        <div class=\"EmbeddedForumPostActions\">\r\n          <a href=\"#\" onclick=\"window.location=\'#embeddedforumform\';{replyscript}\">Responder</a> |\r\n          <a href=\"#\" onclick=\"window.location=\'#embeddedforumform\';{reportabusescript}\">Denunciar abuso</a>\r\n        <div>\r\n      </td>\r\n    </tr>\r\n  ','\r\n    <tr class=\"EmbeddedForumPostAlt\">\r\n      <td class=\"EmbeddedForumPostAvatar\"><a href=\"{postuserurl}\"><img src=\"{postuseravatarurl}\" alt=\"{postusername}\" /></a></td>\r\n      <td class=\"EmbeddedForumPostDetails\">\r\n        <h5 class=\"EmbeddedForumPostAuthor\"><a href=\"{postuserurl}\">{postusername}</a></h5>\r\n        <div class=\"EmbeddedForumPostDate\">{postdate}</div>\r\n      </td>\r\n      <td class=\"EmbeddedForumPostContent\">\r\n        {postbody}\r\n        <div class=\"EmbeddedForumPostActions\">\r\n          <a href=\"#\" onclick=\"window.location=\'#embeddedforumform\';{replyscript}\">Responder</a> |\r\n          <a href=\"#\" onclick=\"window.location=\'#embeddedforumform\';{reportabusescript}\">Denunciar abuso</a>\r\n        <div>\r\n      </td>\r\n    </tr>\r\n  ','\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    {form}\r\n    <p>Você está logueado como {username} (<a href=\"#\" onclick=\"javascript:FoxPassLogin(\'logout\');\">sair</a>).</p>\r\n  ','\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n   {form}\r\n  ','\r\n    <div id=\"embeddedforumform\">\r\n      <div class=\"EmbeddedForumHeaderArea\">\r\n        <h4 class=\"EmbeddedForumHeader\">Adicionar um comentário</h4>\r\n      </div>\r\n      <p>Por favor, crie uma conta para adicionar um comentário. Você já tem uma conta? <a href=\"#\" onclick=\"{loginscript}\">Entrar</a>.</p>\r\n      <div class=\"EmbeddedForumFieldName\">Usuário:</div>\r\n      <div class=\"EmbeddedForumField\"><input type=\"text\" id=\"{usernameid}\" /></div>\r\n      <div class=\"EmbeddedForumFieldName\">E-mail:</div>\r\n      <div class=\"EmbeddedForumField\"><input type=\"text\" id=\"{emailid}\" /></div>\r\n      <div class=\"EmbeddedForumFieldName\">Senha:</div>\r\n      <div class=\"EmbeddedForumField\"><input type=\"password\" id=\"{passwordid}\" /></div>\r\n      <div class=\"EmbeddedForumFieldName\"><input type=\"button\" id=\"{submitid}\" value=\"Register\" onclick=\"{submitscript}\" /></div>\r\n    </div>\r\n  ','\r\n    <div id=\"embeddedforumform\">\r\n      <div class=\"EmbeddedForumHeaderArea\">\r\n        <h4 class=\"EmbeddedForumHeader\">Adicionar um comentário</h4>\r\n      </div>\r\n      <p>Por favor, faça login para adicionar um comentário. Você ainda não tem uma conta? <a href=\"javascript:FoxPassLogin(\'register\');\" onclick=\"javascript:FoxPassLogin(\'register\');\">Registre-se agora</a>.</p>\r\n    <!--    <div class=\"EmbeddedForumFieldName\">Usuário:</div>\r\n      <div class=\"EmbeddedForumField\"><input type=\"text\" id=\"{usernameid}\" /></div>\r\n      <div class=\"EmbeddedForumFieldName\">Senha:</div>\r\n      <div class=\"EmbeddedForumField\"><input type=\"password\" id=\"{passwordid}\" /></div> -->\r\n      <div class=\"EmbeddedForumFieldName\"><input type=\"button\" id=\"{submitid}\" value=\"Entrar\" onclick=\"javascript:FoxPassLogin(\'login\');\" /></div>\r\n    </div>\r\n  ','\r\n    <div id=\"embeddedforumform\">\r\n      <div class=\"EmbeddedForumHeaderArea\">\r\n        <h4 class=\"EmbeddedForumHeader\">Adicionar um comentário</h4>\r\n      </div>\r\n      <div class=\"EmbeddedForumField\"><textarea rows=\"10\" cols=\"40\" id=\"{bodyid}\"></textarea></div>\r\n      <div class=\"EmbeddedForumFieldName\"><input type=\"button\" id=\"{submitid}\" value=\"Adicionar um comentário\" onclick=\"{submitscript}\" /></div>\r\n    </div>\r\n  ','\r\n    <div id=\"embeddedforumform\">\r\n      <div class=\"EmbeddedForumHeaderArea\">\r\n        <h4 class=\"EmbeddedForumHeader\">Responder um comentário</h4>\r\n      </div>\r\n      <p>Responder a <a href=\"{postuserurl}\">{postusername}</a> comentado em {postdate} (<a href=\"#\" onclick=\"{postscript}\">cancelar resposta</a>)</p>\r\n      <div class=\"EmbeddedForumField\"><textarea rows=\"10\" cols=\"40\" id=\"{bodyid}\"></textarea></div>\r\n      <div class=\"EmbeddedForumFieldName\">\r\n        <input type=\"button\" id=\"{submitid}\" value=\"Responder um comentário\" onclick=\"{submitscript}\" />\r\n      </div>\r\n    </div>\r\n  ','\r\n    <div id=\"embeddedforumform\">\r\n      <div class=\"EmbeddedForumHeaderArea\">\r\n        <h4 class=\"EmbeddedForumHeader\">Denunciar abuso</h4>\r\n      </div>\r\n      <p>Denunciar <a href=\"{postuserurl}\">{postusername}</a> comentado em {postdate} como abuso (<a href=\"#\" onclick=\"{postscript}\">cancelar denúncia de abuso</a>)</p>\r\n      <div class=\"EmbeddedForumField\"><textarea rows=\"10\" cols=\"40\" id=\"{bodyid}\"></textarea></div>\r\n      <div class=\"EmbeddedForumFieldName\">\r\n        <input type=\"button\" id=\"{submitid}\" value=\"Denunciar abuso\" onclick=\"{submitscript}\" />\r\n      </div>\r\n    </div>\r\n  ','Faça login ou crie uma conta para comentar ou responder.','O seu comentário é muito extenso. Por favor, reduza o texto e envie novamente.','\r\n    .EmbeddedForumHeaderArea \r\n    {\r\n      margin: 2em 0 1em 0;\r\n      padding: 0;\r\n    } \r\n    \r\n    .EmbeddedForumHeader\r\n    {\r\n      margin: 0;\r\n      font-size: 130%;\r\n      font-weight: bold;\r\n      font-family: Arial, Helvetica;\r\n    } \r\n    \r\n    .EmbeddedForumPosts \r\n    {\r\n      font-family: Arial, Helvetica;\r\n      font-size: 90%;\r\n      border-top: solid 1px #ddd;\r\n    } \r\n    \r\n    .EmbeddedForumDetails \r\n    {\r\n      margin: 1em 0;\r\n      font-family: Arial, Helvetica;\r\n      font-size: 90%;\r\n    } \r\n    \r\n    .EmbeddedForumPost .EmbeddedForumPostAvatar, .EmbeddedForumPost .EmbeddedForumPostDetails, .EmbeddedForumPost .EmbeddedForumPostContent\r\n    { \r\n      border-bottom: solid 1px #ddd; \r\n    } \r\n    \r\n    .EmbeddedForumPostAlt .EmbeddedForumPostAvatar, .EmbeddedForumPostAlt .EmbeddedForumPostDetails, .EmbeddedForumPostAlt .EmbeddedForumPostContent\r\n    { \r\n      background-color: #f7f7f7; \r\n      border-bottom: solid 1px #ddd; \r\n    } \r\n    \r\n    .EmbeddedForumPostAvatar\r\n    {\r\n      width: 44px;\r\n      vertical-align: top;\r\n    }\r\n    \r\n    .EmbeddedForumPostAvatar img\r\n    {\r\n      width: 40px;\r\n      height: 40px;\r\n      border: solid 1px #ddd;\r\n      padding: 1px;\r\n      margin: 4px;\r\n    }\r\n    \r\n    .EmbeddedForumPostDetails\r\n    {\r\n      white-space: nowrap;\r\n      vertical-align: top;\r\n      padding: 4px;\r\n      width: 25%;\r\n    }\r\n    \r\n    .EmbeddedForumPostAuthor \r\n    { \r\n      font-weight: bold;	\r\n      font-size: 100%; \r\n      margin: 0; \r\n      padding: 0;\r\n    } \r\n    \r\n    .EmbeddedForumPostDate \r\n    { \r\n      font-size: 90%; \r\n    } \r\n    \r\n    .EmbeddedForumPostContent \r\n    { \r\n      padding: 4px;\r\n\r\n      width: 75%;\r\n    } \r\n    \r\n    .EmbeddedForumPostContent p\r\n    {\r\n      margin: 0 0 1em 0;\r\n    }\r\n    \r\n    .EmbeddedForumPostActions\r\n    {\r\n      margin-top: 1em;\r\n      text-align: right;\r\n    }\r\n    \r\n    .EmbeddedForumFieldName \r\n    { \r\n      font-weight: bold; \r\n      padding: 2px 0; \r\n      font-family: Arial, Helvetica; \r\n      margin-top: 1em; \r\n    } \r\n    \r\n    .EmbeddedForumField \r\n    {	\r\n      padding: 2px 0; \r\n    }\r\n    \r\n    .EmbeddedForumField input\r\n    {\r\n      width: 33%;\r\n    }\r\n    \r\n    .EmbeddedForumField textarea\r\n    {\r\n      height: 10em;\r\n      width: 50%;\r\n    }\r\n  ');