<?php
/**
 * @version $Id$
 * @package    Contact_Enhanced
 * @author     Douglas Machado {@link http://ideal.fok.com.br}
 * @author     Created on 02-July-10
 * @license		GNU/GPL, see license.txt
 * Contact Enhanced  is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
defined( '_JEXEC' ) or die( 'Restricted access' );
$doc =& JFactory::getDocument();
$doc->addStyleSheet(JURI::root(). 'components/com_contact_enhanced/assets/css/validate.css');
$cparams =& JComponentHelper::getParams('com_media');
?>
<div id="ce-container">
	<?php if ( $this->params->get( 'show_page_title', 1 ) ) : ?>
		<div class="componentheading<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
			<?php echo $this->escape($this->params->get('page_title')); ?>
		</div>
	<?php endif; ?>
	<div class="contentpane<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
	<?php if ($this->params->get('page_desc')) : ?>
		<div class="contentdescription<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
		<?php if ($this->params->get('image') != -1 && $this->params->get('image') != '') : ?>
			<img src="<?php echo $this->baseurl .'/'. 'images/stories' . '/'. $this->params->get('image'); ?>" align="<?php echo $this->params->get('image_align'); ?>" hspace="6" alt="<?php echo JText::_( 'Contacts' ); ?>" />
		<?php endif; ?>
		<?php echo $this->params->get('page_desc'); ?>
		</div>
	<?php endif; ?>
	<script language="javascript" type="text/javascript">
		function tableOrdering( order, dir, task ) {
		var form = document.adminForm;
	
		form.filter_order.value 	= order;
		form.filter_order_Dir.value	= dir;
		document.adminForm.submit( task );
	}
	</script>
	<form action="<?php echo $this->action; ?>" method="post" name="adminForm">
	<div style="text-align:right">
		<?php if ($this->params->get('show_limit')) :
			echo JText::_('Display Num') .'&nbsp;';
			echo $this->pagination->getLimitBox();
		endif; ?>
	</div>
	<?php 
		foreach($this->items as $category){
			$this->category	= &$category;
			echo $this->loadTemplate('category');
		}
	 ?>
	
	<input type="hidden" name="option" value="com_contact_enhanced" />
	<input type="hidden" name="catid" value="<?php echo $this->category->id;?>" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="" />
	</form>
	<div style="text-align:center" >
		<?php echo $this->pagination->getPagesLinks(); ?>
	</div>
	<div style="text-align:right">
		<?php echo $this->pagination->getPagesCounter(); ?>
	</div>
	</div>
</div>