<?php
/**
 * @package ZT Headline module 
 * @author http://www.ZooTemplate.com
 * @copyright (C) 2010- ZooTemplate.com
 * @license PHP files are GNU/GPL
**/
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.mootools');

$document 	= JFactory::getDocument();
$document->addScript(JURI::base() . 'modules/mod_zt_headline/assets/js/jquery-1.7.1.min.js'); 
$document->addScriptDeclaration('var Zoo = jQuery.noConflict();'); 
$document->addStyleSheet(JURI::base() . 'templates/zt_moscho/css/zt_featurelist.css');
$document->addScript(JURI::base() . 'modules/mod_zt_headline/assets/js/zt_featurelist.js');
$cssMod 	= "width:".$moduleWidth."px; height: ".$moduleHeight."px;";  
$listwidth = $params->get('zt_featurelist_list_width', 320);
$ThumbWidth = $params->get('thumbWidth');
$ThumbHeight = $params->get('thumbHeight');
$navWidth = $params->get('zt_featurelist_thumbwidth');
$navHeight = $params->get('zt_featurelist_thumbheight');
$itemHeight = $params->get('zt_featurelist_item_height');
$enableDes = $params->get('zt_featurelist_enable_description');
$mainwidth = $params->get('zt_featurelist_main_width');
$eventType = $params->get('zt_featurelist_eventtype', 1);

?>    
<div class="feature_list" style="<?php echo $cssMod;?>">
	<ul id="feature_tabs<?php echo $moduleId;?>" class="feature_tabs" style="width: <?php echo $listwidth;?>px;">
		<?php
		$j=0;
		$total = count($slides);
		foreach($slides as $item) {
		?>
		<li class="item<?php echo $j; ?> <?php if($j==0){echo "first";}else if($j==$total-1){echo "last";}?>">
			<div class="detail">
            	<div class="icon">
					<span><?php echo $item->title; ?></span>
                </div>
			</div>
		</li> 
		<?php
		$j++;
		}
		?> 
	</ul>
	<div class="feature_output_outer">
		<div class="headline-wrapper">
			<div class="bkg-title-cat"><a href="http://joomvision.com">ZooTemplate.com</a></div>
			<ul id="feature_output<?php echo $moduleId;?>" class="feature_output">
				<?php
				$i=0;
				foreach($slides as $item) {
				?>
				<li style="display: none; height: <?php echo $ThumbHeight;?>px;">
						<div class="category-title"><a href="<?php echo $item->cat_link; ?>"><?php echo $item->cat_name; ?></a></div>
						<?php if($enableDes){?>
							<div class="info">
								<h2><a href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></h2>
								<p><?php echo $item->introtext; ?></p>
							</div>
						<?php }?>
                        <div class="thumb-diff-image">
							<img alt="<?php echo $item->title; ?>" src="<?php echo JURI::root().'modules/mod_zt_headline/timthumb.php?src='.$item->thumbs.'&amp;h='.$navHeight.'&amp;w='.$navWidth; ?>" />
                        </div>
				</li> 
				<?php
				$i++;
				}
				?> 
			</ul>
		</div>
	</div>
</div>
<script type="text/javascript">  
	Zoo(document).ready(function() {
		Zoo.featureList(
			Zoo("#feature_tabs<?php echo $moduleId;?> li"),
			Zoo("#feature_output<?php echo $moduleId;?> li"), {
				start_item : 0,
				transition_interval: 5000,
				eventType: <?php echo $eventType;?>
			}
		);
	}); 
</script>