<?php TPL::output('global/header.tpl.htm'); ?>

<div class="tny-basic main tny-clear allbg">
	<div class="tny-left lsidebar">
		<div class="b_restrain">
			<h3 class="trends-H3  rel content-H3 ">
        		<p class="tny-right p_sx"><a href="inbox/">Return private letter »</a></p>
        		Private letter Dialogue:<?php echo $this->recipient_user['user_name']; ?>
        	</h3>
        	
        	<ul class="pri_letter p_talks">
        	<li class="p_isMe">
		        <a class="addUser" href="people/<?php echo $this->user_info['url_token']; ?>"><img title="<?php echo $this->user_info['user_name']; ?>" alt="<?php echo $this->user_info['user_name']; ?>" src="<?php echo get_avatar_url($this->user_info['uid'], 'mid');?>"></a>
		        <form action="inbox/ajax/send/" method="post" id="recipient_form">
		        	<input type="hidden" name="post_hash" value="<?php echo new_post_hash(); ?>" />
		        	<input type="hidden" name="recipient" value="<?php echo $this->recipient_user['user_name']; ?>" />
		        	<div class="p_txtarea ">
			        	<textarea class="glotxtclass" onFocus="$.focus(this,'What do you want to say to her or him?',$.I.privateLetter(this));" maxlength="500" name="message">What do you want to say to her or him?</textarea>
			        	<p class="p_fx tny-cl_02">You can also enter <big id="msg_num">500</big> words  <a href="javascript:;" class="btn-blue2" id="msg_but2" onclick="ajax_post($('#recipient_form'));">Send</a></p>
			        </div>
			     </form>
			     <a name="contents"></a>
			</li>
            <?php foreach($this->list AS $key => $val) { ?>
          	<li<?php if ($val['sender_uid'] == $this->user_id) { ?> class="p_isMe"<?php } ?>>
            	<a class="addUser umsg" href="people/<?php echo $val['url_token']; ?>" data-message="&uid=<?php echo $val['sender_uid']; ?>&card=user" ><img src="<?php echo get_avatar_url($val['sender_uid'], 'mid'); ?>" alt="" /></a>
                <div class="p_bg rel">
                	<p class="p_txt"> 
	                	<a href="people/<?php echo $val['url_token']; ?>"><?php if ($val['sender_uid'] == $this->user_id) { ?>Me<?php } else { ?><?php echo $val['user_name']; ?><?php } ?></a>:<?php echo nl2br($val['notice_content']); ?></p>
	                	<p class="p_time"><span class="tny-right"><?php if ($val['sender_uid'] != $this->user_id) { ?><a title="Reply" href="javascript:" onclick="$.scrollTo(($('#recipient_form').offset()['top']) - 20, 600, {queue:true});">Reply</a><?php } ?></span><?php echo date('Y-m-d H:i:s', $val['add_time']); ?>
	                </p>
	                	<em class="q_arr abs tny-small">Small arrow</em>
                </div>
     	     </li>
     	     <?php } ?>
     	     </ul>
     	     
     	     <?php echo $this->pagination; ?>
        </div>
    </div>

	<div class="rsidebar"> 
		<?php TPL::output('block/sidebar_menu.tpl.htm'); ?>	
	</div>
</div>
<?php TPL::output('global/footer.tpl.htm'); ?>