<?php
/*
 * Nivo Slider Joomla! module
 *
 * @package		Nivo Slider Joomla! module.
 * @version		1.0.0
 * @author		ARI Soft
 * @copyright	Copyright (c) 2009 www.ari-soft.com. All rights reserved
 * @license		GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
 * 
 */

(defined('_JEXEC') && defined('ARI_FRAMEWORK_LOADED')) or die;

$theme = $this->getTheme();
$activeIdx = $this->getActiveIndex();
$mainParams = AriUtils::getParam($params, '_default');
$class = AriUtils::getParam($mainParams, 'class');
?>
<div id="<?php echo $accordionId; ?>_wrapper" class="accordion-wrapper jui-<?php echo $theme; ?><?php if ($class) echo ' ' . $class;?>">
	<div id="<?php echo $accordionId; ?>" class="accordion ui-accordion ui-widget ui-helper-reset">
		<?php
			$idx = 0;
			foreach ($items as $item):
				$isActive = ($idx == $activeIdx);
				$title = AriUtils::getParam($item, 'title'); 
				$content = AriUtils::getParam($item, 'content');
		?>
			<h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-accordion-icons<?php if ($isActive):?> ui-accordion-header-active ui-state-active<?php endif; ?>"><?php echo $title; ?></h3>
	  		<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom<?php if ($isActive):?> ui-accordion-content-active<?php endif; ?>"<?php if (!$isActive):?> style="display: none"<?php endif; ?>><?php echo $content; ?></div>
	  	<?php
	  			++$idx;
	  		endforeach; 
	  	?>
	</div>
</div>