<?php
$goCutCom = 0;
if (strlen($D->o_comment) > 200) {
	$goCutCom = 1;
	$textCutCom = str_cut($D->o_comment, 200);	
}
?>
<?php if ($this->user->is_logged) { ?>
<div id="msgaction_<?php echo $D->o_idcomment?>" class="msgactionpost hide pdn5 centered txtsize00">
	<span id="msgcr_<?php echo $D->o_idcomment?>" class="hide"><?php echo $this->lang('global_txt_action_comm_msgreportcomment')?></span> 
    <span id="msgch_<?php echo $D->o_idcomment?>" class="hide"><?php echo $this->lang('global_txt_action_comm_msghiddencomment')?></span> 
    <span id="bundorc_<?php echo $D->o_idcomment?>" class="onlyblue bold hand hide"><?php echo($this->lang('global_txt_opcundo'))?></span>
    <span id="bundohc_<?php echo $D->o_idcomment?>" class="onlyblue bold hand hide"><?php echo($this->lang('global_txt_opcundo'))?></span>
</div>
<?php } ?>
<div id="comment_post_<?php echo $D->o_idcomment?>" class="onecomment">

	<?php if ($this->user->is_logged) { ?>
	
	<div id="bactioncomment_<?php echo $D->o_idcomment?>" class="hand delete">x</div>
	
	<?php if ($D->o_idUser == $this->user->id) { ?>
	<div id="submcom_<?php echo $D->o_idcomment?>" class="tright hide"><span id="bopcdel_<?php echo $D->o_idcomment?>" class="onlyblue hand"><?php echo $this->lang('global_txt_smenu_comm_delete')?></span> <span class="grey3">&#8226;</span> <span id="bopccancel_<?php echo $D->o_idcomment?>" class="onlyblue hand"><?php echo $this->lang('global_txt_smenu_comm_cancel')?></span></div>
    <?php } else { ?>
    <div id="submcom_<?php echo $D->o_idcomment?>" class="tright hide"><span id="bopcreport_<?php echo $D->o_idcomment?>" class="onlyblue hand"><?php echo $this->lang('global_txt_smenu_comm_report')?></span> <span class="grey3">&#8226;</span> <span id="bopchidden_<?php echo $D->o_idcomment?>" class="onlyblue hand"><?php echo $this->lang('global_txt_smenu_comm_hide')?></span> <span class="grey3">&#8226;</span> <span id="bopccancel_<?php echo $D->o_idcomment?>" class="onlyblue hand"><?php echo $this->lang('global_txt_smenu_comm_cancel')?></span></div>
    <?php } ?>
    
    <?php } ?>
    
    <div class="avatar"><a href="<?php echo $C->SITE_URL.$D->o_username?>"><img onmouseout="ignoreItemCard()" onmouseover="ItemCard(2, 'comment_post_<?php echo $D->o_idcomment?>', '<?php echo $D->o_ucode?>', 0)" src="<?php echo $C->SITE_URL.$C->FOLDER_AVATAR.'min2/'.$D->o_avatar?>" class="rounded"></a></div>
    <div class="info">
        <div class="user"><span class="linkblue2" onmouseout="ignoreItemCard()" onmouseover="ItemCard(3, 'comment_post_<?php echo $D->o_idcomment?>', '<?php echo $D->o_ucode?>', 0)"><a href="<?php echo $C->SITE_URL.$D->o_username?>"><?php echo $D->o_nameUser?></a></span></div>
        <div class="message">

        
		<?php if ($goCutCom == 1) { ?>
        
        <span id="txtCutCom_<?php echo $D->o_idcomment.$D->o_ucode?>"><?php echo analyzeMessage($textCutCom)?> <span id="linkseemoreCom_<?php echo $D->o_idcomment.$D->o_ucode?>" class="hand onlyblue2 txtsize00">See more</span></span>
        <span id="txtMaxCom_<?php echo $D->o_idcomment.$D->o_ucode?>" class="hide"><?php echo analyzeMessage($D->o_comment)?></span>
        
        <?php } else { ?>
        
        <span id="txtMaxCom_<?php echo $D->o_idcomment.$D->o_ucode?>"><?php echo analyzeMessage($D->o_comment)?></span>
        
        <?php } ?>
        
        
        </div>
        <div class="whend"><abbr class="timeago" title="<?php echo date("c", $D->o_whendate); ?>"><?php echo date($this->lang('global_format_date'),$D->o_whendate);?></abbr></div>
    </div>
    
</div>
<script>
	<?php if ($goCutCom == 1) { ?>
	$('#linkseemoreCom_<?php echo $D->o_idcomment.$D->o_ucode?>').click(function(){
		$('#txtCutCom_<?php echo $D->o_idcomment.$D->o_ucode?>').fadeOut('fast', function(){
			$('#txtMaxCom_<?php echo $D->o_idcomment.$D->o_ucode?>').fadeIn('fast');
		});
	});
	<?php } ?>

	<?php if ($this->user->is_logged) { ?>
	
	$("#bactioncomment_<?php echo $D->o_idcomment?>").on("click",function(){
		$("#bactioncomment_<?php echo $D->o_idcomment?>").fadeOut(200, function(){
			$("#submcom_<?php echo $D->o_idcomment?>").fadeIn(200);
		});	
	});

	$("#bopccancel_<?php echo $D->o_idcomment?>").on("click",function(){
		$("#submcom_<?php echo $D->o_idcomment?>").fadeOut(200, function(){
			$("#bactioncomment_<?php echo $D->o_idcomment?>").fadeIn(200);
		});	
	});

	$("#bopcdel_<?php echo $D->o_idcomment?>").on("click",function(){
		deletecomment(<?php echo $D->o_idcomment?>, <?php echo $D->o_idpost?>, <?php echo $D->o_idUserOwner?>, '<?php echo $D->o_codepost?>');
		return false;
	});
	
	$("#bopcreport_<?php echo $D->o_idcomment?>").on("click",function(){
		$('#submcom_<?php echo $D->o_idcomment?>').hide();
		reportComment(<?php echo $D->o_idcomment?>, <?php echo $D->o_idUser?>);
		return false;
	});
	
	$("#bundorc_<?php echo $D->o_idcomment?>").on("click",function(){
		undoReportComment('<?php echo $D->o_idcomment?>');
		return false;
	});
	
	$("#bopchidden_<?php echo $D->o_idcomment?>").on("click",function(){
		$('#submcom_<?php echo $D->o_idcomment?>').hide();
		hiddenComment('<?php echo $D->o_idcomment?>');
		return false;
	});

	$("#bundohc_<?php echo $D->o_idcomment?>").on("click",function(){
		undoHiddenComment('<?php echo $D->o_idcomment?>');
		return false;
	});
	
	<?php } ?>

</script>