<div class='pp-tabwrap'>
	<if="$this->ipsclass->input['tab'] == 'list' OR ! $this->ipsclass->input['tab']">
		<div class='pp-tabon' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=list", 1); return false;'>{$this->ipsclass->lang['m_friends_list']}</div>
		<div class='pp-taboff' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=pending", 1); return false;'>{$this->ipsclass->lang['m_friends_pending']}</div>
		<div class='pp-taboff' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=mutual", 1); return false;'>{$this->ipsclass->lang['m_friends_mutual']}</div>
	<else />
		<if="$this->ipsclass->input['tab'] == 'pending'">
			<div class='pp-taboff' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=list", 1); return false;'>{$this->ipsclass->lang['m_friends_list']}</div>
			<div class='pp-tabon' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=pending", 1); return false;'>{$this->ipsclass->lang['m_friends_pending']}</div>
			<div class='pp-taboff' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=mutual", 1); return false;'>{$this->ipsclass->lang['m_friends_mutual']}</div>
		<else />
			<div class='pp-taboff' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=list", 1); return false;'>{$this->ipsclass->lang['m_friends_list']}</div>
			<div class='pp-taboff' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=pending", 1); return false;'>{$this->ipsclass->lang['m_friends_pending']}</div>
			<div class='pp-tabon' style='cursor:pointer' onclick='ipsclass.location_jump("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;tab=mutual", 1); return false;'>{$this->ipsclass->lang['m_friends_mutual']}</div>
		</if>
	</if>
</div>
<div class="pp-tabclear">{$this->ipsclass->lang['m_friends_list']}</div>
<div class="borderwrap">
	<div class='pp-header'>
		<div style='float:left;font-weight:normal;padding-top:3px'>$pages</div>
		<div align='right' style='font-weight:normal'>
			<if="$this->ipsclass->input['tab'] == 'list' OR ! $this->ipsclass->input['tab']">
				<select name='friends_filter' id='friends_filter' onchange='pp_filter_change()'>
					<if="$this->ipsclass->input['friends_filter'] == 'all' OR ! $this->ipsclass->input['friends_filter']">
						<option value='all' selected='selected'>{$this->ipsclass->lang['m_showall_friends']}</option>
					<else />
						<option value='all'>{$this->ipsclass->lang['m_showall_friends']}</option>
					</if>
					<if="$this->ipsclass->input['friends_filter'] == 'online'">
						<option value='online' selected='selected'>{$this->ipsclass->lang['m_showonline_friends']}</option>
					<else />
						<option value='online'>{$this->ipsclass->lang['m_showonline_friends']}</option>
					</if>
					<if="$this->ipsclass->input['friends_filter'] == 'offline'">
						<option value='offline' selected='selected'>{$this->ipsclass->lang['m_showoffline_friends']}</option>
					<else />
						<option value='offline'>{$this->ipsclass->lang['m_showoffline_friends']}</option>
					</if>
				</select>
			<else />
				<if="$this->ipsclass->input['tab'] == 'mutual'">
					<select name='friends_filter' id='friends_filter' onchange='pp_filter_change()'>
						<if="$this->ipsclass->input['friends_filter'] == 'mutual' OR ! $this->ipsclass->input['friends_filter']">
							<option value='mutual' selected='selected'>{$this->ipsclass->lang['fl_show_mutual']}</option>
						<else />
							<option value='mutual'>{$this->ipsclass->lang['fl_show_mutual']}</option>
						</if>
						<if="$this->ipsclass->input['friends_filter'] == 'added'">
							<option value='added' selected='selected'>{$this->ipsclass->lang['fl_show_who_added_me']}</option>
						<else />
							<option value='added'>{$this->ipsclass->lang['fl_show_who_added_me']}</option>
						</if>
					</select>
				<else />
					&nbsp;
				</if>
			</if>
		</div>
	</div>
	<if="$this->ipsclass->input['tab'] == 'pending'">
		<form onsubmit='return pp_check_form()' action='{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;do=friends_list_moderation&amp;md5check={$this->ipsclass->md5_check}&amp;tab={$this->ipsclass->input['tab']}' method='POST'>
	</if>
	<if="is_array($friends) and count($friends)">
		<foreach="$friends as $friend">
			<if="$this->ipsclass->input['tab'] == 'pending'">
				<!-- Approval list -->
				<div class='pp-mini-entry-noheight-shaded' id='pp-friend-entry-{$friend['friend_id']}'>
					<div class='pp-tiny-text'>
					<div style='float:left; border-right:1px dotted black; margin-right: 3px'>
						<a href='#' title='{$this->ipsclass->lang['m_remove_friend']}' onclick='ipsclass.confirm_action("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;do=remove&amp;member_id={$friend['id']}&amp;md5check={$this->ipsclass->md5_check}&amp;tab=pending")'><img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/friend_remove_small.png' alt='' border='0' /></a>
						<br />
						<a href="#" title='{$this->ipsclass->lang['m_sendpm_friend']}' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}act=Msg&amp;CODE=4&amp;MID={$friend['id']}", 1); return false;'><img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/send_pm_small.png' alt='' border='0' /></a>
					</div>
					<div class='pp-image-mini-wrap-floatright'><img src='{$friend['pp_mini_photo']}' width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' alt='' /></div>
					<div style='float:right;padding-top:5px;padding-right:6px'><input type='checkbox' name='pp_friend_id[{$friend['id']}]' value='{$friend['id']}' /></div>
						{$friend['_pp_gender_image']} <strong><a href='#' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}showuser={$friend['id']}", 1); return false;'>{$friend['members_display_name']}</a></strong>
						<br />
						{$friend['_pp_online_image']}
						<strong>{$this->ipsclass->lang['m_requested']}: {$friend['_friends_added']}</strong>
					</div>
				</div>
				<!-- / Approval list -->
			<else />
				<if="$this->ipsclass->input['tab'] == 'mutual'">
					<!-- Mutual list -->
					<div class='pp-mini-content-entry-noheight' id='pp-friend-entry-{$friend['friend_id']}'>
						<div class='pp-tiny-text'>
							<div class='pp-image-mini-wrap-floatright'><img src='{$friend['pp_mini_photo']}' width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' alt='' /></div>
							{$friend['_pp_gender_image']} <strong><a href='#' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}showuser={$friend['id']}", 1); return false;'>{$friend['members_display_name']}</a></strong>
							<br />
							{$friend['_pp_online_image']}
							<strong>{$this->ipsclass->lang['m_lastactive']}: {$friend['_last_active']}</strong>
						</div>
					</div>
					<!-- / Mututal list -->
				<else />
					<if="$friend['friends_approved']">
						<!-- Normal friend list -->
						<div class='pp-mini-content-entry-noheight' id='pp-friend-entry-{$friend['friend_id']}'>
							<div class='pp-tiny-text'>
							<div style='float:left; border-right:1px dotted black; margin-right: 3px'>
								<a href='#' title='{$this->ipsclass->lang['m_remove_friend']}' onclick='ipsclass.confirm_action("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;do=remove&amp;member_id={$friend['id']}&amp;md5check={$this->ipsclass->md5_check}")'><img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/friend_remove_small.png' alt='' border='0' /></a>
								<br />
								<a href="#" title='{$this->ipsclass->lang['m_sendpm_friend']}' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}act=Msg&amp;CODE=4&amp;MID={$friend['id']}", 1); return false;'><img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/send_pm_small.png' alt='' border='0' /></a>
							</div>
							<div class='pp-image-mini-wrap-floatright'><img src='{$friend['pp_mini_photo']}' width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' alt='' /></div>
								{$friend['_pp_gender_image']} <strong><a href='#' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}showuser={$friend['id']}", 1); return false;'>{$friend['members_display_name']}</a></strong>
								<br />
								{$friend['_pp_online_image']}
								<strong>{$this->ipsclass->lang['m_lastactive']}: {$friend['_last_active']}</strong>
							</div>
							<!-- / Normal friend list -->
						</div>
					<else />
						<!-- UNAPPROVED friend list -->
						<div class='pp-mini-entry-noheight-shaded' id='pp-friend-entry-{$friend['friend_id']}'>
							<div class='pp-tiny-text'>
							<div style='float:left; border-right:1px dotted black; margin-right: 3px'>
								<a href='#' title='{$this->ipsclass->lang['m_remove_friend']}' onclick='ipsclass.confirm_action("{$this->ipsclass->base_url}act=profile&amp;CODE=friends_list_popup&amp;do=remove&amp;member_id={$friend['id']}&amp;md5check={$this->ipsclass->md5_check}")'><img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/friend_remove_small.png' alt='' border='0' /></a>
								<br />
								<a href="#" title='{$this->ipsclass->lang['m_sendpm_friend']}' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}act=Msg&amp;CODE=4&amp;MID={$friend['id']}", 1); return false;'><img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/send_pm_small.png' alt='' border='0' /></a>
							</div>
							<div class='pp-image-mini-wrap-floatright'><img src='{$friend['pp_mini_photo']}' width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' alt='' /></div>
								{$friend['_pp_gender_image']} <strong><a href='#' onclick='opener.ipsclass.location_jump("{$this->ipsclass->base_url}showuser={$friend['id']}", 1); return false;'>{$friend['members_display_name']}</a></strong>
								[ {$this->ipsclass->lang['m_pending']} ]
								<br />
								{$friend['_pp_online_image']}
								<strong>{$this->ipsclass->lang['m_lastactive']}: {$friend['_last_active']}</strong>
							</div>
							<!-- / UNAPPROVED friend list -->
						</div>
					</if>
				</if>
			</if>
		</foreach>
		<!-- BOTTOM MOD OPTIONS -->
		<if="$this->ipsclass->input['tab'] == 'pending'">
			<div class='pp-header' style='text-align:right'>
				{$this->ipsclass->lang['m_dd_with_selected']}: <select name='pp_option' id='pp-moderation'>
					<option value='add_reciprocal'>{$this->ipsclass->lang['m_dd_approve_add']}</option>
					<option value='add'>{$this->ipsclass->lang['m_dd_approve']}</option>
					<option value='delete'>{$this->ipsclass->lang['m_dd_refuse']}</option>
				</select> <input class='button' type='submit' style='margin:0px' value='{$this->ipsclass->lang['m_go']}' />
			</div>
		</form>
		</if>
		<!-- BOTTOM MOD OPTIONS -->
		
	<else />
		<div class='post1' style='padding:6px'>
			<em>{$this->ipsclass->lang['m_nofriends']}</em>
		</div>
	</if>
</div>
<script type='text/javascript'>
//<![CDATA[
function pp_filter_change()
{
	var selectbox = document.getElementById('friends_filter');
	var chosen    = selectbox.options[ selectbox.selectedIndex ].value;
	
	if ( chosen )
	{
		ipsclass.location_jump( ipb_var_base_url + 'act=profile&CODE=friends_list_popup&tab={$this->ipsclass->input['tab']}&friends_filter=' + chosen );
	}
}
// Check form
function pp_check_form()
{
	var selectbox = document.getElementById('pp-moderation');
	var chosen    = selectbox.options[ selectbox.selectedIndex ].value;
	
	if ( chosen == 'delete' )
	{
		if ( confirm("{$this->ipsclass->lang['m_confirm']}") )
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		return true;
	}
}
//]]>
</script>