<h2>&nbsp;</h2>
<form name="hotlist" action="">
	<div class="mailbox_table">
			<dl class="content_active" style="padding:5px 0;">
				<dd class="float_left" style="width:20px;"><b>&nbsp;</b></dd>
				<dd class="float_left" style="width:130px;" onclick="javascript: location.href='{$form.sort_link_1}';">{$lang.mailbox.to}</dd>
				<dd class="float_left" style="width:130px;" onclick="javascript: location.href='{$form.sort_link_2}';">{$lang.mailbox.age}</dd>
				<dd class="float_left" style="width:130px;" onclick="javascript: location.href='{$form.sort_link_3}';">{$lang.mailbox.country}</dd>
			</dl>
		<div class="mailbox_friend_list_wrapper">
			{section name=s loop=$hotlist}
				<dl style="padding:5px 0;">
					<dd class="float_left" style="width:20px;">
						<input type="checkbox" name="mail{$smarty.section.s.index}" value="{$hotlist[s].id}">
					</dd>
					<dd class="float_left" style="width:130px;"><div id="user{$smarty.section.s.index}">{$hotlist[s].friend}</div></dd>
					<dd class="float_left" style="width:130px;">&nbsp;{$hotlist[s].age}</dd>
					<dd class="float_left" style="width:130px;">{$hotlist[s].country}&nbsp;</dd>
				</dl>
			{/section}
			{if !$hotlist}
				<p class="error_msg">&nbsp;{$lang.mailbox.empty_hotlist}&nbsp;</p>
			{/if}
		</div>
		<p>			
			<input type="button" class="button" onclick="javascript: SendToSelect();" value="{$lang.button.send}">
		</p>
	</div>
</form>

{literal}
<script language="JavaScript" type="text/javascript">
	function SendToSelect(){
		var hotl = document.hotlist;
		var users_str = '';
		var i = 0;

		for(i=0;i<hotl.length;i++){
			if(hotl[i].name.substr(0,4)== "mail" && hotl[i].checked == true){
				hot_num = hotl[i].value;
				users_str = users_str + document.getElementById('user'+i).innerHTML+ ';';
				if($('#mail_to_arr').val() == '')
					$('#mail_to_arr').val(hotl[i].value);
				else
					$('#mail_to_arr').val($('#mail_to_arr').val()+','+hotl[i].value);
			}
		}
		old_val = /*opener.*/document.mailbox_write.to.value;

		if(old_val.length>0 && users_str.length>0)
			val = old_val+';'+users_str.substr(0,users_str.length-1);
		else
			if(old_val.length>0)
				val = old_val;
			else
				val = users_str.substr(0,users_str.length-1);
		/*opener.*/
		document.mailbox_write.to.value = val;
		$('#mask').hide(); 
		$('.window').hide();
	}
</script>
{/literal}
