<div id="primary_header">
	<h1><?php print $this->translate('SubAdmin Users')?></h1>   
</div>

<div id="primary_content">
	<div id="primary_content_inner">
		<div id="Flash" class="flash_notice"></div>

			<table class="settings">
				<tr>
					<td class="label" style="padding-left: 34px !important;"><?php print $this->translate('Filter results:')?></td>
					<td class="filterinput">
						<input type="text" name="subadminFilter" id="subadminFilter" class='panelFilter' value=""/> 
						<small><?php print $this->translate('Specify a Subadmin details to filter results')?></small>
					</td>
					<td class="filterdomain">
						&nbsp;
					</td>
				</tr>               
			</table>
			
			<form id="subadminListForm" method="post" action="<?php echo $this->moduleBaseUrl ?>/security/subadmindelete">
			                                                                               
			<div id="Table_Subadmins">
			</div>

            <div class="mail_row_paginator_aliases">

				<div id="back_button_delete_selected">
					<a href="#">
						<span class="stronglastword"><?php echo $this->translate('Delete Selected') ?></span>
					</a>
				</div>
			
	            <!--
				<select id="pageSelect" name="page">
				<option value="1" selected="">1-25</option>
				</select>
				<span>of 25</span>
				<img class="pagingIcon" width="20" height="19" alt="Previous page" src="<?php echo $this->siteBaseUrl ?>/images/paging-prev-grey.png"/><img class="pagingIcon" width="20" height="19" alt="Next page" src="<?php echo $this->siteBaseUrl ?>/images/paging-next.png"/>
				-->

			</div>
			
		</form>
	</div>
</div>

<script type="text/javascript">
$( function()
{

	$('#Table_Subadmins').height( $("BODY").innerHeight() - 300 );
	
	// Load the email-alias list
	$('#Table_Subadmins').load('<?php echo $this->moduleBaseUrl ?>/security/subadminlistmatches');
    
	// bind delete multiple entries
	$('#back_button_delete_selected a', '#Security').bind('click', function() 
	{
		
		if( $('.subadminids:checked', '#subadminListForm').length == 0 )
			return false
			
		if( confirm('<?php echo $this->translate("Are you sure you want to delete the selected Subadmins?"); ?>') )
			$.php( $('#subadminListForm').attr('action'), $('#subadminListForm').serializeArray() )
		
		return false
	
	})

	// Filter results
	$('#back_button_filter a', '#subadminListForm').bind("click", function()
	{

		$("#service_aliases #Flash").hide();
		$('#Table_Subadmins').load('<?php echo $this->moduleBaseUrl ?>/security/subadminlistmatches/filter/' + $("#subadminFilter").val() );
		return false

	}) 

	var search_timeout = 0;
	$('#subadminFilter').bind('keyup', function()
	{

		if ( search_timeout != undefined )
			clearTimeout(search_timeout);
		
		var thecall = this; // save reference to 'this' so we can use it in timeout function
		search_timeout = setTimeout(function()
									{
		
										search_timeout = undefined;
										$('#Table_Subadmins').load('<?php echo $this->moduleBaseUrl ?>/security/subadminlistmatches/filter/' + $("#subadminFilter").val() );
		
									}, 300);

	});
	
	$('.stronglastword').each( function() { $(this).stronglastword() });
	
})
</script>