<div class="owm_forum_new_post_win owm_bg_color_1">
    {form name="post_form"}
        <div class="owm_forum_topic owm_forum_topic_reply">
            <div class="owm_forum_topic_nav">
                {if !empty($quoteText) && !empty($quoteId)}
                    <div class="owm_quote_link_wrap owm_padding owm_border">
                        <a class="owm_quote_link" id="forum_view_quote" href="#">{text key='forum+view_quote'}</a>
                        <input type="hidden" name="quoteId" value="{$quoteId}" />
                        <a class="owm_quote_close owm_ic_close_cont" id="forum_view_quote_close" href="#"></a>
                    </div>
                {/if}
            </div>
            <div class="owm_forum_topic_body owm_bg_color_1">
                <div class="owm_forum_topic_input">
                    <div class="ow_inline owm_inline">
                        {input name="text"}
                    </div>
                </div>
                <div class="owm_error_txt">
                    {error name="text"}
                </div>
            </div>
            <div class="owm_forum_topic_bottom owm_border owm_forum_topic_submit owm_padding owm_bg_color_1 clearfix">
                {if $enableAttachments}
                    <div class="owm_forum_topic_attach_info owm_float_left">
                        <label id="forum_add_post_attach_file" class="owm_attach_label owm_topic_attach_icon">
                            <div id="forum_add_post_attach_default_title" class="owm_inline">{text key='forum+attach_files'}</div>
                            <div id="forum_add_post_first_attach_name" class="owm_inline" style="display: none"></div>
                        </label>
                    </div>
                {/if}
                <div class="owm_float_right owm_forum_topic_submit">
                    {submit name="submit"}
                </div>
            </div>
        </div>
    {/form}
</div>

{if !empty($quoteText) && !empty($quoteId)}
    <div style="display:none">
        <div class="owm_quote_win owm_padding owm_bg_color_1" id="forum_post_attach_wrapper">
            <div class="owm_quote owm_std_margin_bottom" id="forum_post_attach_wrapper">
                {$quoteText}
            </div>
            <div>
                <a href="javascript://" id="forum_close_floatbox">{text key='forum+back_to_post'}</a>
                {script}
                    $("#forum_close_floatbox").click(function(){
                        OWM.getActiveFloatBox().close();
                    });
                {/script}
            </div>
        </div>
    </div>
{/if}

{if $enableAttachments}
    <div style="display: none">
        <div id="forum_add_post_attachments" class="owm_attach_win owm_forum_attach_win owm_padding owm_bg_color_1">
            {$attachments}
            <div class="owm_padding owm_btn_wrap">
                {decorator name="button" langLabel="forum+clear_all" id="forum_add_post_clear_files"}
                {decorator name="button" langLabel="forum+add_files" id="forum_add_post_attach_files"}
            </div>
        </div>
    </div>
    {script}
        $( document ).ready(function() 
        { 
            var forumAddPostAttachments = new ForumAttachments({
                "attachmentUid"      : "{$attachmentUid}",
                "attachmentsWrapper" : $('#forum_add_post_attachments'),
                "attachDefaultTitle" : $("#forum_add_post_attach_default_title"),
                "firstAttachName"    : $("#forum_add_post_first_attach_name"),
                "clearFiles"         : $("#forum_add_post_clear_files"),
                "attachNewFiles"     : $("#forum_add_post_attach_files"),
                "attachNewFile"      : $("#forum_add_post_attach_file")
            });
 
            {if !empty($quoteText) && !empty($quoteId)}
                $("#forum_view_quote").bind("click", function(e){
                    e.preventDefault();
                    OWM.FloatBox({
                        "title" : "{text key='forum+view_quote'}",
                        "content" : $("#forum_post_attach_wrapper")
                    });
                });
                $("#forum_view_quote_close").bind("click", function(e){
                    if(confirm('{text key='forum+delete_quote_confirm'}')) {
                        $(this).parent().remove();
                    }
                });
            {/if}
        });
    {/script}
{/if}