<?php if (Mage::getStoreConfig('easybanner/info/enabled')):?>
<script src="<?php echo $this->getSkinUrl('js/easybanner/jquery.cycle.js')?>" type="text/javascript"></script>

<?php if ($this->isVisible()): ?>
	<?php $_banner = $this->getBanner(); ?>
	<?php if ($_banner->getShowTitle()==1): ?>
		<h3><?php echo $_banner->getTitle(); ?></h3>
	<?php endif; ?>
	
	<div id="slideshow">   
		<?php $_banner_items = $this->getBannerItems(); ?>
		<?php foreach ($_banner_items as $_banner_item): ?>
			<a href="<?php echo $_banner_item->getLinkUrl(); ?>"> 
				<?php if ($_banner_item->getImage()): ?>
					<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$_banner_item->getImage()?>" width="<?php echo $_banner->getWidth()?>" height="<?php echo $_banner->getHeight()?>" alt="easybanner"/>
				<?php elseif ($_banner_item->getImageUrl()): ?>
					<img src="<?php echo $_banner_item->getImageUrl() ?>" width="<?php echo $_banner->getWidth()?>" height="<?php echo $_banner->getHeight()?>" alt="easybanner" />
				<?php endif; ?>
			</a>    
		<?php endforeach ?>
	</div>
	<div class="so">
		<ul id="nav1">
			<?php $j=0;
				for($j=0; $j<3; $j++)
				{ ?>
				<li>
					<?php $value='&lt;li'.'&gt;&lt;a  href="#"&gt;&lt;/a&gt;&lt;/li&gt;';?>
					<input type="hidden" id="array_text_<?php echo $j;?>" value='<?php echo $value;?>' />
				</li>
				<?php }
			?>
		</ul>
	</div>
	
<?php endif; ?>
<?php endif; ?>
<script type="text/javascript">

jQuery.noConflict(); 
jQuery(document).ready(function(){
		jQuery(function() {

    jQuery('#slideshow').cycle({
        
        timeout:<?php echo $_banner->getDelay(); ?>,
        prev:    '#prev',
        next:    '#next',
        pager:   '#nav1'//,
        //pagerAnchorBuilder: pagerFactory
    });
	function pagerFactory(idx, slide) {
		var array_text = document.getElementById('array_text_'+idx);
		return array_text.value;
    };
    
});
});


</script>
