<?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"  style="width: <?php echo $_banner->getWidth().'px'?>; height: <?php echo $_banner->getHeight().'px' ?>; display:none;"> 
      
	<?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().'px'?> " height=" <?php echo $_banner->getHeight().'px'?>" alt="easybanner"/>
     <?php elseif ($_banner_item->getImageUrl()): ?>
		<img src="<?php echo $_banner_item->getImageUrl()?>" width="<?php echo $_banner->getWidth().'px'?> " height=" <?php echo $_banner->getHeight().'px'?>" alt="easybanner" />
     <?php endif; ?>
	</a>    
        <?php endforeach ?>
      
<?php endif; ?>
</div>
<script type="text/javascript">
var $j = jQuery.noConflict(); 

 $j(document).ready(function() {
    $j('#slideshow').cycle({
      fx: 'fade',
     timeout: <?php echo $_banner->getDelay(); ?>
	});
	$j('#slideshow').fadeIn(1500);
});
 
</script>
<?php endif; ?>
