function content_55ccec9f7b1266_22892671($_smarty_tpl)
    {
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            $_smarty_tpl->tpl_vars["object_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product_id'], null, 0);
            $_smarty_tpl->tpl_vars["object_type"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['discussion']['object_type'], null, 0);
            $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['object_id']->value), null, 0);
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['attributes']->value) {
                ?>
<div id="attributes_head">
	<?php 
                $_smarty_tpl->tpl_vars["rev_count"] = new Smarty_variable(fn_get_review_count($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, $_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id']), null, 0);
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['product']->value['product_id'] && $_smarty_tpl->tpl_vars['attributes']->value) {
                    ?>
	
		<?php 
                    $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id']), null, 0);
                    ?>
	<?php 
                } else {
                    ?>
		<?php 
                    $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id'], true), null, 0);
                    ?>
	<?php 
                }
                ?>
	<?php 
                if ($_smarty_tpl->tpl_vars['attributes']->value && !$_smarty_tpl->tpl_vars['ratings']->value || $_smarty_tpl->tpl_vars['ratings']->value['average'] == 0.0 && !$_smarty_tpl->tpl_vars['ratings']->value['rating']) {
                    ?>
		<?php 
                    $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id'], true), null, 0);
                    ?>
	<?php 
                }
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['ratings']->value['average']) {
                    ?>
		<?php 
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
<a style="text-decoration: none;" onclick="$('#review_attributes').click(); $.scrollToElm($('#review_attributes')); return false;"><?php 
                    }
                    echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average'])), 0);
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
</a><?php 
                    }
                    ?>
		<?php 
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
<a style="text-decoration: none;" onclick="$('#review_attributes').click(); $.scrollToElm($('#review_attributes')); return false;"><?php 
                    }
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['rev_count']->value, ENT_QUOTES, 'UTF-8');
                    ?>
&nbsp;<?php 
                    echo $_smarty_tpl->__('reviews');
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
</a><?php 
                    }
                    ?>
	<?php 
                }
                ?>
<!--attributes_head--></div>
<?php 
            } else {
                ?>

	<?php 
                $_smarty_tpl->tpl_vars["average_rating"] = new Smarty_variable(fn_get_average_rating($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value), null, 0);
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['average_rating']->value) {
                    ?>
		<?php 
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
<a onclick="$('#review_attributes').click(); return false;"><?php 
                    }
                    echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['average_rating']->value), 'mode' => 'big'), 0);
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
</a><?php 
                    }
                    ?>
	<?php 
                }
                ?>

<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="addons/altteam_review_attributes/hooks/products/main_info_title.post.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "addons/altteam_review_attributes/hooks/products/main_info_title.post.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            $_smarty_tpl->tpl_vars["object_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product_id'], null, 0);
            $_smarty_tpl->tpl_vars["object_type"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['discussion']['object_type'], null, 0);
            $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['object_id']->value), null, 0);
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['attributes']->value) {
                ?>
<div id="attributes_head">
	<?php 
                $_smarty_tpl->tpl_vars["rev_count"] = new Smarty_variable(fn_get_review_count($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, $_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id']), null, 0);
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['product']->value['product_id'] && $_smarty_tpl->tpl_vars['attributes']->value) {
                    ?>
	
		<?php 
                    $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id']), null, 0);
                    ?>
	<?php 
                } else {
                    ?>
		<?php 
                    $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id'], true), null, 0);
                    ?>
	<?php 
                }
                ?>
	<?php 
                if ($_smarty_tpl->tpl_vars['attributes']->value && !$_smarty_tpl->tpl_vars['ratings']->value || $_smarty_tpl->tpl_vars['ratings']->value['average'] == 0.0 && !$_smarty_tpl->tpl_vars['ratings']->value['rating']) {
                    ?>
		<?php 
                    $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['product']->value['discussion']['thread_id'], true), null, 0);
                    ?>
	<?php 
                }
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['ratings']->value['average']) {
                    ?>
		<?php 
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
<a style="text-decoration: none;" onclick="$('#review_attributes').click(); $.scrollToElm($('#review_attributes')); return false;"><?php 
                    }
                    echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average'])), 0);
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
</a><?php 
                    }
                    ?>
		<?php 
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
<a style="text-decoration: none;" onclick="$('#review_attributes').click(); $.scrollToElm($('#review_attributes')); return false;"><?php 
                    }
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['rev_count']->value, ENT_QUOTES, 'UTF-8');
                    ?>
&nbsp;<?php 
                    echo $_smarty_tpl->__('reviews');
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
</a><?php 
                    }
                    ?>
	<?php 
                }
                ?>
<!--attributes_head--></div>
<?php 
            } else {
                ?>

	<?php 
                $_smarty_tpl->tpl_vars["average_rating"] = new Smarty_variable(fn_get_average_rating($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value), null, 0);
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['average_rating']->value) {
                    ?>
		<?php 
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
<a onclick="$('#review_attributes').click(); return false;"><?php 
                    }
                    echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['average_rating']->value), 'mode' => 'big'), 0);
                    if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "products" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "view") {
                        ?>
</a><?php 
                    }
                    ?>
	<?php 
                }
                ?>

<?php 
            }
        }
    }
    function content_55ccec9fd41274_29204611($_smarty_tpl)
    {
        if (!is_callable('smarty_function_cycle')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.cycle.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('write_your_review', 'write_your_review'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            if ($_smarty_tpl->tpl_vars['_REQUEST']->value['dispatch'] == 'products.view') {
                ?>
   

        
	<?php 
                $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, true, $_REQUEST), null, 0);
                ?>

	<?php 
                $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable($_smarty_tpl->tpl_vars['discussion']->value['posts'], null, 0);
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D") {
                    ?>
            <style>
                div.review_post_images{
                    display: block;
                }
                div.review_post_image{
                    display: inline-block;
                    padding: 5px;
                }
                div.review_post_image > img{
                    max-width: 150px;

                }
            </style>
	<div id="content_review_attributes">
	<?php 
                    if ($_smarty_tpl->tpl_vars['wrap']->value == true) {
                        ?>
	<p>&nbsp;</p>
	<?php 
                        $_smarty_tpl->_capture_stack[0][] = array("content", null, null);
                        ob_start();
                        ?>
	<?php 
                        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['title']->value), 0);
                        ?>

	<?php 
                    } else {
                        ?>
	<h2 class="reviews-title"><?php 
                        echo $_smarty_tpl->__('customer_reviews');
                        ?>
</h2>
	<?php 
                    }
                    ?>

	<?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == 'E') {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts(0, $_REQUEST['page'])), null, 0);
                        ?>
	<?php 
                    } else {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], $_REQUEST['page'])), null, 0);
                        ?>
	<?php 
                    }
                    ?>

	
	<?php 
                    $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['object_id']->value), null, 0);
                    ?>
	<?php 
                    if ($_smarty_tpl->tpl_vars['object_type']->value == 'P' && $_smarty_tpl->tpl_vars['attributes']->value) {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0);
                        ?>
	
	<?php 
                    } else {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0);
                        ?>
	<?php 
                    }
                    ?>

	<?php 
                    if (!$_smarty_tpl->tpl_vars['ratings']->value || $_smarty_tpl->tpl_vars['ratings']->value['average'] == 0.0 && !$_smarty_tpl->tpl_vars['ratings']->value['rating']) {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0);
                        ?>
	<?php 
                    }
                    ?>
        
        <?php 
                    $_smarty_tpl->tpl_vars["posts_count"] = new Smarty_variable(fn_get_review_posts_count($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0);
                    ?>
        
        
        
	
	<?php 
                    if (($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") && $_smarty_tpl->tpl_vars['ratings']->value) {
                        ?>
	<div>
		<div class="global-average-rating">
			<h3><?php 
                        echo $_smarty_tpl->__('average_rating');
                        ?>
</h3>
			<p><?php 
                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average']), 'mode' => 'big'), 0);
                        ?>
</p>

			<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['count'], ENT_QUOTES, 'UTF-8');
                        ?>
 <?php 
                        echo $_smarty_tpl->__('reviews');
                        ?>

		</div>
		<div class="global-attribute-rating">
			<table cellpadding="0" cellspacing="0" class="ga-rating">
			<?php 
                        $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars["attribute"]->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['attributes']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) {
                            $_smarty_tpl->tpl_vars["attribute"]->_loop = true;
                            ?>
			<tr>
				<td class="right"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8');
                            ?>
&nbsp;=&nbsp;</td>
				<td class="left">
					<?php 
                            $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0);
                            ?>
					<?php 
                            echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['value'])), 0);
                            ?>
&nbsp;<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['percent'], ENT_QUOTES, 'UTF-8');
                            ?>

				</td>
			</tr>
			<?php 
                        }
                        ?>
			</table>
		</div>
	</div>
	<?php 
                    }
                    ?>
	<div class="clearfix" style="padding-top: 20px;"></div>
	
	<?php 
                    if (strpos("CRB", $_smarty_tpl->tpl_vars['discussion']->value['type']) !== false) {
                        ?>
		<div class="buttons-container">
                     
                    <?php 
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => __("write_your_review"), 'but_role' => "submit", 'but_target_id' => "new_extended_post_dialog", 'but_meta' => "ty-btn__secondary ty-btn cm-dialog-opener cm-dialog-auto-size", 'data_ca_view_id' => time()), 0);
                        ?>

		</div>

		<?php 
                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0);
                        ?>


	<?php 
                    }
                    ?>
	<div class="sort-review-block">
		<label for="sort_review" class="sort-review-label"><?php 
                    echo $_smarty_tpl->__('sort_by');
                    ?>
</label>

		<select id="sort_review" name="sort_review" onchange="$.ceAjax('request', fn_url(this.value), <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                    ?>
result_ids: 'content_review_attributes,attributes_head'<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                    ?>
);">

			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=MH&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'MH' || !$_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review']) {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('most_helpful_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=HR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'HR') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('highest_rating_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=LR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'LR') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('lowest_rating_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=NW&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'NW') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('newest_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=OD&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'OD') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('oldest_first');
                    ?>
</option>
		</select>
	</div>
	
	<?php 
                    if ($_smarty_tpl->tpl_vars['posts']->value) {
                        ?>
	<?php 
                        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0);
                        ?>

	<?php 
                        $_smarty_tpl->tpl_vars["escaped_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
                        ?>
        
	<table cellpadding="0" cellspacing="0" class="posts-table">
	<?php 
                        $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['post']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['posts']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) {
                            $_smarty_tpl->tpl_vars['post']->_loop = true;
                            ?>
	<tr class="posts<?php 
                            echo smarty_function_cycle(array('values' => ", manage-post"), $_smarty_tpl);
                            ?>
 clear-both" id="post_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
                            ?>
">
		<td class="r-legend">
			<p class="r-author"><?php 
                            echo htmlspecialchars(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8');
                            ?>
</p>
			<p class="r-date"><?php 
                            echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
                            ?>
</p>
                        <p class="r-user-age">
                            <?php 
                            echo $_smarty_tpl->__('age_group');
                            ?>
: 
                            <?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 1) {
                                echo $_smarty_tpl->__('24&under');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 2) {
                                echo $_smarty_tpl->__('between25and34');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 3) {
                                echo $_smarty_tpl->__('between35and44');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 4) {
                                echo $_smarty_tpl->__('between45and54');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 5) {
                                echo $_smarty_tpl->__('between55and64');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 6) {
                                echo $_smarty_tpl->__('65andafter');
                                ?>

                            <?php 
                            }
                            ?>
                        </p>
			<?php 
                            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                                ?>
				<?php 
                                if ($_smarty_tpl->tpl_vars['attributes']->value) {
                                    ?>
				<table cellpadding="0" cellspacing="0" class="ga-rating">
					<?php 
                                    $_smarty_tpl->tpl_vars["post_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['post']->value['post_id'], null, 0);
                                    ?>
					<?php 
                                    $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable();
                                    $_smarty_tpl->tpl_vars["attribute"]->_loop = false;
                                    $_from = $_smarty_tpl->tpl_vars['attributes']->value;
                                    if (!is_array($_from) && !is_object($_from)) {
                                        settype($_from, 'array');
                                    }
                                    foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) {
                                        $_smarty_tpl->tpl_vars["attribute"]->_loop = true;
                                        ?>
                                    <tr>
					<td class="right"><?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8');
                                        ?>
&nbsp;=&nbsp;</td>
					<td class="left" style="margin-top: 2px;">
						<?php 
                                        $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0);
                                        ?>
						<?php 
                                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['rating'][$_smarty_tpl->tpl_vars['post_id']->value][$_smarty_tpl->tpl_vars['attr_id']->value])), 0);
                                        ?>

					</td>
                                    </tr>
				<?php 
                                    }
                                    ?>
				</table>
				<?php 
                                }
                                ?>
			<?php 
                            }
                            ?>
		</td>
		<td class="r-message">
			<?php 
                            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] != "C") {
                                ?>
				<div class="r-subject">

					<?php 
                                if ($_smarty_tpl->tpl_vars['attributes']->value) {
                                    ?>
						<?php 
                                    $_smarty_tpl->tpl_vars["rates"] = new Smarty_variable(fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value]), null, 0);
                                    ?>
						<?php 
                                    if ($_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['FULL']['index']] != 0 || $_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['PART']['index']] != 0) {
                                        ?>

							<?php 
                                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value])), 0);
                                        ?>


						<?php 
                                    } else {
                                        ?>
							<?php 
                                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0);
                                        ?>

						<?php 
                                    }
                                    ?>
					<?php 
                                } else {
                                    ?>

						<?php 
                                    echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0);
                                    ?>

					<?php 
                                }
                                ?>
					<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message_title'], ENT_QUOTES, 'UTF-8');
                                ?>

				</div>
			<?php 
                            }
                            ?>
			<?php 
                            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                                ?>
				<?php 
                                echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8', true));
                                ?>

			<?php 
                            }
                            ?>
                        <?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['image1'] || $_smarty_tpl->tpl_vars['post']->value['image2']) {
                                ?>
                            <div class="review_post_images">
                                <?php 
                                if ($_smarty_tpl->tpl_vars['post']->value['image1']) {
                                    ?>
                                    <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image1'], ENT_QUOTES, 'UTF-8');
                                    ?>
" alt="img"  border="0"></div>
                                <?php 
                                }
                                ?>
                                <?php 
                                if ($_smarty_tpl->tpl_vars['post']->value['image1']) {
                                    ?>
                                    <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image2'], ENT_QUOTES, 'UTF-8');
                                    ?>
" alt="img"  border="0"></div>
                                <?php 
                                }
                                ?>
                            </div>
                        <?php 
                            }
                            ?>
			<div class="r-likes">
				<div class="is-useful float-left"><?php 
                            echo $_smarty_tpl->__('found_useful');
                            ?>
: <strong><?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['likes']['yes']) {
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['yes'], ENT_QUOTES, 'UTF-8');
                            } else {
                                ?>
0<?php 
                            }
                            ?>
</strong>&nbsp;<?php 
                            echo $_smarty_tpl->__('out_of');
                            ?>
&nbsp;<strong><?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['likes']['votes']) {
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['votes'], ENT_QUOTES, 'UTF-8');
                            } else {
                                ?>
0<?php 
                            }
                            ?>
</strong></div>
				<?php 
                            echo $_smarty_tpl->__('was_helpful');
                            ?>

				<?php 
                            if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                                ?>
					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=1&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0);
                                ?>

					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=0&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0);
                                ?>

				<?php 
                            } else {
                                ?>
					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0);
                                ?>

					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0);
                                ?>

				<?php 
                            }
                            ?>
			</div>
		</td>
	</tr>
	<?php 
                        }
                        ?>
	<?php 
                        if ($_smarty_tpl->tpl_vars['object_type']->value == "E" && $_smarty_tpl->tpl_vars['current_post_id']->value) {
                            ?>
	<script type="text/javascript">
	//<![CDATA[
	$(document).ready(function()<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>

		if ($('#post_' + <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
).length) <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>

			jQuery.scrollToElm($('#post_' + <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
));
		<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>

	<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>
);
	//]]>
	</script>
	<?php 
                        }
                        ?>
	</table>
        <script type="text/javascript">
	//<![CDATA[
	$(document).ready(function()<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                        ?>

            var userCheckForReview = true;
            var user_product_ordered = 1;
            $('a#opener_new_post').click(function(){
                var checkout_est_url = fn_url('review_attributes.check_user&object_id=<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
&is_ajax=1');
                var ajax_exectute = $.ajax({
                    url: checkout_est_url,
                    dataType:'html',
                    async:false,
                    cache: false,
                    beforeSend: function(xhr) {
                        xhr.withCredentials = true;
                    },
                });

                 ajax_exectute.done(function(data) {
                    if(typeof data ==="string" ){
                        data = JSON.parse(data);
                    }
                    if(data.text=='notordered'){
                        
                        user_product_ordered = 0;
                    }else if(data.text=='logedout'){
                        window.location.href = fn_url('auth.login_form&return_url=<?php 
                        echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8');
                        ?>
');
                        userCheckForReview = false;
                    }else if(data.text=='allchecked'){
                        
                        user_product_ordered = 1;
                        userCheckForReview = true;
                    }else {
                        user_product_ordered = 1;
                        userCheckForReview = true;
                    }
                 });
                 $('form#add_extended_post_form').trigger('reset');
                 $('div.ls_review_image_container2').remove();
                 $('img#ls_uploadPreview').attr("src","/images/review_img/review_no_image.jpg");
                 $('input#user_product_ordered').val(user_product_ordered);
                 return userCheckForReview;
            });
            
	<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                        ?>
);
	//]]>
        </script>
        <div class="div_show_more_posts_action" style="text-align:center">
            <input type="hidden" value="2" id="input_show_more_posts_action" />
            <input type="hidden" value="<?php 
                        if ($_REQUEST['sort_review']) {
                            echo htmlspecialchars($_REQUEST['sort_review'], ENT_QUOTES, 'UTF-8');
                        } else {
                            ?>
MH<?php 
                        }
                        ?>
" id="input_sort_review" />
            <?php 
                        if ($_smarty_tpl->tpl_vars['posts_count']->value > count($_smarty_tpl->tpl_vars['posts']->value)) {
                            ?>
            <a onclick="ls_show_more_posts(<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
,'<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['object_type']->value, ENT_QUOTES, 'UTF-8');
                            ?>
');return false;" id="show_more_posts"><?php 
                            echo $_smarty_tpl->__('show_more_posts');
                            ?>
</a>
            <?php 
                        }
                        ?>
        </div>

	<?php 
                        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0);
                        ?>

	<?php 
                    } else {
                        ?>
	<p class="no-items ty-no-items"><?php 
                        echo $_smarty_tpl->__('no_posts_found');
                        ?>
</p>
	<?php 
                    }
                    ?>

	<?php 
                    if ($_smarty_tpl->tpl_vars['wrap']->value == true) {
                        ?>
	<?php 
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        ?>
		<?php 
                        echo $_smarty_tpl->getSubTemplate("common/group.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['content']), 0);
                        ?>

	<?php 
                    } else {
                        ?>
		<?php 
                        $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                        ob_start();
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        ?>
	<?php 
                    }
                    ?>
	<!--content_review_attributes--></div>

	<?php 
                }
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="addons/altteam_review_attributes/views/discussion/view.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "addons/altteam_review_attributes/views/discussion/view.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            if ($_smarty_tpl->tpl_vars['_REQUEST']->value['dispatch'] == 'products.view') {
                ?>
   

        
	<?php 
                $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, true, $_REQUEST), null, 0);
                ?>

	<?php 
                $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable($_smarty_tpl->tpl_vars['discussion']->value['posts'], null, 0);
                ?>

	<?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D") {
                    ?>
            <style>
                div.review_post_images{
                    display: block;
                }
                div.review_post_image{
                    display: inline-block;
                    padding: 5px;
                }
                div.review_post_image > img{
                    max-width: 150px;

                }
            </style>
	<div id="content_review_attributes">
	<?php 
                    if ($_smarty_tpl->tpl_vars['wrap']->value == true) {
                        ?>
	<p>&nbsp;</p>
	<?php 
                        $_smarty_tpl->_capture_stack[0][] = array("content", null, null);
                        ob_start();
                        ?>
	<?php 
                        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['title']->value), 0);
                        ?>

	<?php 
                    } else {
                        ?>
	<h2 class="reviews-title"><?php 
                        echo $_smarty_tpl->__('customer_reviews');
                        ?>
</h2>
	<?php 
                    }
                    ?>

	<?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == 'E') {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts(0, $_REQUEST['page'])), null, 0);
                        ?>
	<?php 
                    } else {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], $_REQUEST['page'])), null, 0);
                        ?>
	<?php 
                    }
                    ?>

	
	<?php 
                    $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['object_id']->value), null, 0);
                    ?>
	<?php 
                    if ($_smarty_tpl->tpl_vars['object_type']->value == 'P' && $_smarty_tpl->tpl_vars['attributes']->value) {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0);
                        ?>
	
	<?php 
                    } else {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0);
                        ?>
	<?php 
                    }
                    ?>

	<?php 
                    if (!$_smarty_tpl->tpl_vars['ratings']->value || $_smarty_tpl->tpl_vars['ratings']->value['average'] == 0.0 && !$_smarty_tpl->tpl_vars['ratings']->value['rating']) {
                        ?>
		<?php 
                        $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0);
                        ?>
	<?php 
                    }
                    ?>
        
        <?php 
                    $_smarty_tpl->tpl_vars["posts_count"] = new Smarty_variable(fn_get_review_posts_count($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0);
                    ?>
        
        
        
	
	<?php 
                    if (($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") && $_smarty_tpl->tpl_vars['ratings']->value) {
                        ?>
	<div>
		<div class="global-average-rating">
			<h3><?php 
                        echo $_smarty_tpl->__('average_rating');
                        ?>
</h3>
			<p><?php 
                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average']), 'mode' => 'big'), 0);
                        ?>
</p>

			<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['count'], ENT_QUOTES, 'UTF-8');
                        ?>
 <?php 
                        echo $_smarty_tpl->__('reviews');
                        ?>

		</div>
		<div class="global-attribute-rating">
			<table cellpadding="0" cellspacing="0" class="ga-rating">
			<?php 
                        $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars["attribute"]->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['attributes']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) {
                            $_smarty_tpl->tpl_vars["attribute"]->_loop = true;
                            ?>
			<tr>
				<td class="right"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8');
                            ?>
&nbsp;=&nbsp;</td>
				<td class="left">
					<?php 
                            $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0);
                            ?>
					<?php 
                            echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['value'])), 0);
                            ?>
&nbsp;<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['percent'], ENT_QUOTES, 'UTF-8');
                            ?>

				</td>
			</tr>
			<?php 
                        }
                        ?>
			</table>
		</div>
	</div>
	<?php 
                    }
                    ?>
	<div class="clearfix" style="padding-top: 20px;"></div>
	
	<?php 
                    if (strpos("CRB", $_smarty_tpl->tpl_vars['discussion']->value['type']) !== false) {
                        ?>
		<div class="buttons-container">
                     
                    <?php 
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => __("write_your_review"), 'but_role' => "submit", 'but_target_id' => "new_extended_post_dialog", 'but_meta' => "ty-btn__secondary ty-btn cm-dialog-opener cm-dialog-auto-size", 'data_ca_view_id' => time()), 0);
                        ?>

		</div>

		<?php 
                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0);
                        ?>


	<?php 
                    }
                    ?>
	<div class="sort-review-block">
		<label for="sort_review" class="sort-review-label"><?php 
                    echo $_smarty_tpl->__('sort_by');
                    ?>
</label>

		<select id="sort_review" name="sort_review" onchange="$.ceAjax('request', fn_url(this.value), <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                    ?>
result_ids: 'content_review_attributes,attributes_head'<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                    ?>
);">

			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=MH&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'MH' || !$_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review']) {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('most_helpful_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=HR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'HR') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('highest_rating_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=LR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'LR') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('lowest_rating_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=NW&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'NW') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('newest_first');
                    ?>
</option>
			<option value="<?php 
                    echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=OD&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'OD') {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo $_smarty_tpl->__('oldest_first');
                    ?>
</option>
		</select>
	</div>
	
	<?php 
                    if ($_smarty_tpl->tpl_vars['posts']->value) {
                        ?>
	<?php 
                        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0);
                        ?>

	<?php 
                        $_smarty_tpl->tpl_vars["escaped_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
                        ?>
        
	<table cellpadding="0" cellspacing="0" class="posts-table">
	<?php 
                        $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['post']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['posts']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) {
                            $_smarty_tpl->tpl_vars['post']->_loop = true;
                            ?>
	<tr class="posts<?php 
                            echo smarty_function_cycle(array('values' => ", manage-post"), $_smarty_tpl);
                            ?>
 clear-both" id="post_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
                            ?>
">
		<td class="r-legend">
			<p class="r-author"><?php 
                            echo htmlspecialchars(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8');
                            ?>
</p>
			<p class="r-date"><?php 
                            echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
                            ?>
</p>
                        <p class="r-user-age">
                            <?php 
                            echo $_smarty_tpl->__('age_group');
                            ?>
: 
                            <?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 1) {
                                echo $_smarty_tpl->__('24&under');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 2) {
                                echo $_smarty_tpl->__('between25and34');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 3) {
                                echo $_smarty_tpl->__('between35and44');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 4) {
                                echo $_smarty_tpl->__('between45and54');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 5) {
                                echo $_smarty_tpl->__('between55and64');
                                ?>

                            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 6) {
                                echo $_smarty_tpl->__('65andafter');
                                ?>

                            <?php 
                            }
                            ?>
                        </p>
			<?php 
                            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                                ?>
				<?php 
                                if ($_smarty_tpl->tpl_vars['attributes']->value) {
                                    ?>
				<table cellpadding="0" cellspacing="0" class="ga-rating">
					<?php 
                                    $_smarty_tpl->tpl_vars["post_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['post']->value['post_id'], null, 0);
                                    ?>
					<?php 
                                    $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable();
                                    $_smarty_tpl->tpl_vars["attribute"]->_loop = false;
                                    $_from = $_smarty_tpl->tpl_vars['attributes']->value;
                                    if (!is_array($_from) && !is_object($_from)) {
                                        settype($_from, 'array');
                                    }
                                    foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) {
                                        $_smarty_tpl->tpl_vars["attribute"]->_loop = true;
                                        ?>
                                    <tr>
					<td class="right"><?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8');
                                        ?>
&nbsp;=&nbsp;</td>
					<td class="left" style="margin-top: 2px;">
						<?php 
                                        $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0);
                                        ?>
						<?php 
                                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['rating'][$_smarty_tpl->tpl_vars['post_id']->value][$_smarty_tpl->tpl_vars['attr_id']->value])), 0);
                                        ?>

					</td>
                                    </tr>
				<?php 
                                    }
                                    ?>
				</table>
				<?php 
                                }
                                ?>
			<?php 
                            }
                            ?>
		</td>
		<td class="r-message">
			<?php 
                            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] != "C") {
                                ?>
				<div class="r-subject">

					<?php 
                                if ($_smarty_tpl->tpl_vars['attributes']->value) {
                                    ?>
						<?php 
                                    $_smarty_tpl->tpl_vars["rates"] = new Smarty_variable(fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value]), null, 0);
                                    ?>
						<?php 
                                    if ($_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['FULL']['index']] != 0 || $_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['PART']['index']] != 0) {
                                        ?>

							<?php 
                                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value])), 0);
                                        ?>


						<?php 
                                    } else {
                                        ?>
							<?php 
                                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0);
                                        ?>

						<?php 
                                    }
                                    ?>
					<?php 
                                } else {
                                    ?>

						<?php 
                                    echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0);
                                    ?>

					<?php 
                                }
                                ?>
					<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message_title'], ENT_QUOTES, 'UTF-8');
                                ?>

				</div>
			<?php 
                            }
                            ?>
			<?php 
                            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                                ?>
				<?php 
                                echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8', true));
                                ?>

			<?php 
                            }
                            ?>
                        <?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['image1'] || $_smarty_tpl->tpl_vars['post']->value['image2']) {
                                ?>
                            <div class="review_post_images">
                                <?php 
                                if ($_smarty_tpl->tpl_vars['post']->value['image1']) {
                                    ?>
                                    <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image1'], ENT_QUOTES, 'UTF-8');
                                    ?>
" alt="img"  border="0"></div>
                                <?php 
                                }
                                ?>
                                <?php 
                                if ($_smarty_tpl->tpl_vars['post']->value['image1']) {
                                    ?>
                                    <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image2'], ENT_QUOTES, 'UTF-8');
                                    ?>
" alt="img"  border="0"></div>
                                <?php 
                                }
                                ?>
                            </div>
                        <?php 
                            }
                            ?>
			<div class="r-likes">
				<div class="is-useful float-left"><?php 
                            echo $_smarty_tpl->__('found_useful');
                            ?>
: <strong><?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['likes']['yes']) {
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['yes'], ENT_QUOTES, 'UTF-8');
                            } else {
                                ?>
0<?php 
                            }
                            ?>
</strong>&nbsp;<?php 
                            echo $_smarty_tpl->__('out_of');
                            ?>
&nbsp;<strong><?php 
                            if ($_smarty_tpl->tpl_vars['post']->value['likes']['votes']) {
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['votes'], ENT_QUOTES, 'UTF-8');
                            } else {
                                ?>
0<?php 
                            }
                            ?>
</strong></div>
				<?php 
                            echo $_smarty_tpl->__('was_helpful');
                            ?>

				<?php 
                            if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                                ?>
					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=1&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0);
                                ?>

					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=0&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0);
                                ?>

				<?php 
                            } else {
                                ?>
					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0);
                                ?>

					<?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0);
                                ?>

				<?php 
                            }
                            ?>
			</div>
		</td>
	</tr>
	<?php 
                        }
                        ?>
	<?php 
                        if ($_smarty_tpl->tpl_vars['object_type']->value == "E" && $_smarty_tpl->tpl_vars['current_post_id']->value) {
                            ?>
	<script type="text/javascript">
	//<![CDATA[
	$(document).ready(function()<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>

		if ($('#post_' + <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
).length) <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>

			jQuery.scrollToElm($('#post_' + <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
));
		<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>

	<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                            ?>
);
	//]]>
	</script>
	<?php 
                        }
                        ?>
	</table>
        <script type="text/javascript">
	//<![CDATA[
	$(document).ready(function()<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                        ?>

            var userCheckForReview = true;
            var user_product_ordered = 1;
            $('a#opener_new_post').click(function(){
                var checkout_est_url = fn_url('review_attributes.check_user&object_id=<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
&is_ajax=1');
                var ajax_exectute = $.ajax({
                    url: checkout_est_url,
                    dataType:'html',
                    async:false,
                    cache: false,
                    beforeSend: function(xhr) {
                        xhr.withCredentials = true;
                    },
                });

                 ajax_exectute.done(function(data) {
                    if(typeof data ==="string" ){
                        data = JSON.parse(data);
                    }
                    if(data.text=='notordered'){
                        
                        user_product_ordered = 0;
                    }else if(data.text=='logedout'){
                        window.location.href = fn_url('auth.login_form&return_url=<?php 
                        echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8');
                        ?>
');
                        userCheckForReview = false;
                    }else if(data.text=='allchecked'){
                        
                        user_product_ordered = 1;
                        userCheckForReview = true;
                    }else {
                        user_product_ordered = 1;
                        userCheckForReview = true;
                    }
                 });
                 $('form#add_extended_post_form').trigger('reset');
                 $('div.ls_review_image_container2').remove();
                 $('img#ls_uploadPreview').attr("src","/images/review_img/review_no_image.jpg");
                 $('input#user_product_ordered').val(user_product_ordered);
                 return userCheckForReview;
            });
            
	<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                        ?>
);
	//]]>
        </script>
        <div class="div_show_more_posts_action" style="text-align:center">
            <input type="hidden" value="2" id="input_show_more_posts_action" />
            <input type="hidden" value="<?php 
                        if ($_REQUEST['sort_review']) {
                            echo htmlspecialchars($_REQUEST['sort_review'], ENT_QUOTES, 'UTF-8');
                        } else {
                            ?>
MH<?php 
                        }
                        ?>
" id="input_sort_review" />
            <?php 
                        if ($_smarty_tpl->tpl_vars['posts_count']->value > count($_smarty_tpl->tpl_vars['posts']->value)) {
                            ?>
            <a onclick="ls_show_more_posts(<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
,'<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['object_type']->value, ENT_QUOTES, 'UTF-8');
                            ?>
');return false;" id="show_more_posts"><?php 
                            echo $_smarty_tpl->__('show_more_posts');
                            ?>
</a>
            <?php 
                        }
                        ?>
        </div>

	<?php 
                        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0);
                        ?>

	<?php 
                    } else {
                        ?>
	<p class="no-items ty-no-items"><?php 
                        echo $_smarty_tpl->__('no_posts_found');
                        ?>
</p>
	<?php 
                    }
                    ?>

	<?php 
                    if ($_smarty_tpl->tpl_vars['wrap']->value == true) {
                        ?>
	<?php 
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        ?>
		<?php 
                        echo $_smarty_tpl->getSubTemplate("common/group.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['content']), 0);
                        ?>

	<?php 
                    } else {
                        ?>
		<?php 
                        $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                        ob_start();
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        ?>
	<?php 
                    }
                    ?>
	<!--content_review_attributes--></div>

	<?php 
                }
            }
        }
    }
    }
    exit;
}
if ($mode == 'view_posts') {
    $posts = array();
    $object_id = $_REQUEST["object_id"];
    if ($object_id) {
        $object_type = $_REQUEST['object_type'];
        $page = $_REQUEST["page"];
        $discussion = fn_get_discussion($object_id, $object_type, true, $_REQUEST);
        $attributes = fn_get_review_attributes_work($object_id);
        $no_atributes = true;
        if ($attributes) {
            $no_atributes = false;
        }
        $ratings = fn_get_review_ratings($discussion["thread_id"], $no_atributes);
        $posts = fn_get_review_posts($discussion['thread_id'], $page);
    }
    Registry::set('runtime.root_template', 'addons/altteam_review_attributes/views/view_posts.tpl');
    $discussion_object_types = array('P' => 'product', 'C' => 'category', 'A' => 'page', 'O' => 'order', 'E' => 'home_page');
    //get the values from the settings
    $getDiscutionsPostPerPageSettings = db_get_field("\n                SELECT ?:settings_objects.value\n                FROM ?:settings_objects\n                    JOIN ?:settings_sections ON ?:settings_sections.section_id = ?:settings_objects.section_id\n                WHERE \n                    ?:settings_sections.name = 'discussion'\n                    AND ?:settings_objects.name=?s\n            ", $discussion_object_types[$object_type] . "_posts_per_page");
    //
    $total_posts = db_get_field("SELECT COUNT(*) FROM ?:discussion_posts WHERE ?:discussion_posts.status = 'A' AND ?:discussion_posts.thread_id=?i", $discussion["thread_id"]);
    if ($page * $getDiscutionsPostPerPageSettings >= $total_posts) {
        fn_set_notification('N', __('notice'), null);
    }
    Registry::get('view')->assign('discussion', $discussion);
    Registry::get('view')->assign('attributes', $attributes);
    Registry::get('view')->assign('ratings', $ratings);
    Registry::get('view')->assign('posts', $posts);