<div id="commets-block-<?php echo $this->commentsBlockName;?>" class="comments-block">

    <div id="seotoaster">
        <div class="success" id="comment-success" style="z-index:999;width:300px;display:none;">
            <ul>
                <li id="added" style="display:none;">Your comment was added.</li>
                <li id="addedwait" style="display:none;">Your comment was added and awaits for moderation.</li>
            </ul>
        </div>

        <div class="errors" id="comment-errors-<?php echo $this->commentsBlockName;?>" style="z-index:999;width:300px; display:none;">
            <ul>
                <li id="comment-name-empty-error-<?php echo $this->commentsBlockName;?>" style="display:none;">The Name field cannot be empty.</li>
                <li id="comment-email-empty-error-<?php echo $this->commentsBlockName;?>" style="display:none;">The Email field cannot be empty.</li>
                <li id="comment-email-regex-error-<?php echo $this->commentsBlockName;?>" style="display:none;">Please enter a valid email address.</li>
                <li id="comment-content-empty-error-<?php echo $this->commentsBlockName;?>" style="display:none;">The Content field cannot be empty.</li>
                <li id="comment-content-lenght-error-<?php echo $this->commentsBlockName;?>" style="display:none;">The Content field must contain more than 2 characters.</li>
                <li id="comment-captcha-invalid-error-<?php echo $this->commentsBlockName;?>" style="display:none;">The Captcha entered code is invalid.</li>
                <li id="comment-captcha-empty-error-<?php echo $this->commentsBlockName;?>" style="display:none;">The Captcha field cannot be empty.</li>

            </ul>
        </div>
    </div>

    <div  id="comment-form">
        <p>Post a comment:</p>

        
        <form name="comment-form-<?php echo $this->commentsBlockName;?>" id="comment-form-<?php echo $this->commentsBlockName;?>" action="javascript:addComment('<?php echo $this->containerId;?>','<?php echo $this->commentsBlockName;?>','<?php echo $this->countComments; ?>','<?php echo $this->requestedPage;?>','<?php echo $this->publishedByDefault;?>');" method="post" onsubmit="return checkPostCommentForm('<?php echo $this->commentsBlockName;?>');" class="comment-form">
            <p>
                <input type="text" id="sign-<?php echo $this->commentsBlockName;?>" name="sign" value="" />
                <label >{%Name (required)%}</label>
            </p>

            <p>
                <input type="text" id="email-<?php echo $this->commentsBlockName;?>" name="email" value="" />
                <label >{%Mail (will not be published) (required)%}</label>
            </p>

            <p>
                <input type="text" id="website-<?php echo $this->commentsBlockName;?>" name="website" value="" />
                <label>{%Website%}</label>
            </p>

            <p>
                <input type="checkbox" id="notify-<?php echo $this->commentsBlockName;?>" name="notify" value="" />
                <label >{%Notify me of followup comments via e-mail.%}</label>
            </p>

            <p>
                <img style="width:200px; border:none;" id="captcha-image" src="<?php echo $this->websiteUrl;?>public/tmp/<?php echo $this->captchaId ?>.png" alt=""/><br />
            </p>
            <p>
                <input type="text" name="captcha[input]" id="captcha-input" />
                <input type="hidden" value="<?php echo $this->captchaId ?>" id="captcha-id" name="captcha[id]"/>
                <label >{%Enter the string above.%}</label>
            </p>
            <p>
                <textarea name="post_content" id="post-content-<?php echo $this->commentsBlockName;?>" rows="4" cols="30"></textarea>
            </p>
            <p>
                <input id="submit-comment" type="submit" value="{%Post Comment%}" />
            </p>
            <input type="hidden" id="keyword-<?php echo $this->commentsBlockName;?>"             name="keyword-<?php echo $this->commentsBlockName;?>"             value="<?php echo $this->keyword?>" />
            <input type="hidden" id="topic-<?php echo $this->commentsBlockName;?>"               name="topic-<?php echo $this->commentsBlockName;?>"               value="<?php echo $this->topic?>" />
            <input type="hidden" id="publishedbydefault-<?php echo $this->commentsBlockName;?>"  name="publishedbydefault-<?php echo $this->commentsBlockName;?>"  value="<?php echo $this->publishedByDefault?>" />
            <input type="hidden" id="websiteUrl"  name="websiteUrl"  value="<?php echo $this->websiteUrl;?>" />
        </form>
    </div>
    <!-- Start comments list-->
    <div id="comments-list-<?php echo $this->commentsBlockName;?>" class="comments-div-list">
        <div id="commentslinkholder">
            <?php if($this->commentsArray && sizeof($this->commentsArray)>$this->countComments) { ?>
            <a href="javascript:void(0);" onclick="showHideComments('<?php echo $this->commentsBlockName;?>','<?php echo $this->countComments; ?>')" id="show-all-comments-<?php echo $this->commentsBlockName;?>"  title="Show All Comments" >Show all comments</a>
            <?php } ?>
        </div>
        <ol id="comments-ol-<?php echo $this->commentsBlockName;?>" class="comments-ol-list">
            <?php if($this->commentsArray ) {
                static $i=0;

                foreach ($this->commentsArray as $comment) {?>
                    <?php if($comment['publish']==1){
                        $style =  'style="border:1px solid #DDDDDD;"';
                        $publishedLink=false;
                        }
                    else{
                        $style = 'style="border:1px dotted red"';
                        $publishedLink = true;
                        }
                    ?>
            <li id="comment-item-li-<?php echo $comment['id'];?>" <?php echo $style;?>  <?php $i++; if($i>$this->countComments) {echo 'style="display:none;"'; } ?>>
                    
                        <span class="username"><?php echo ucfirst(strtolower($comment['user_sign']));?> says: </span>
						<span class="commentdate"><?php echo $comment['date'];?></span>
                        <a class="commentreply" href="<?php echo $_SERVER['REQUEST_URI']."#comment-form" ?>" title="Reply to this comment">Reply</a>
                    
                    <p class="commenttext"><?php echo $comment['content'];?></p>
                    <?php if(isset($publishedLink) && $publishedLink ){  ?>
                    <div   id="publish-link-<?php echo $comment['id'];?>" >
                        <a class="publish-comments-link" title="Publish this comment" onclick="if(confirm('Do you really want to publish this comment?')){publishComment('<?php echo $comment['id'];?>'); }" href="javascript:void(0);" >
                            <img style="border:none;" alt="Publish this comment" src="<?php echo $this->websiteUrl;?>system/images/ico_publish.png"/>
                         </a>
                    </div>
                       <?php }?>
                    
                            <?php if($this->isLogged) { ?>
                        <a class="deletecomment" title="Delete this comment" onclick="if(confirm('Do you really want to delete this comment?')){deleteComment('<?php echo $comment['id'];?>'); }" href="javascript:void(0);" >
                        <img alt="Delete this comment" src="<?php echo $this->websiteUrl;?>system/images/ico_delete.gif"/></a>

                            <?php } ?>
            </li>
                <?php } } ?>
        </ol>

    </div>





</div>