<?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="top_banner" style="width:<?php echo $_banner->getWidth().'px'?>; padding:0px; height:<?php echo $_banner->getHeight().'px' ?>; background:none; position: relative; display:none;" >
      <div id="divSimpleSlider">   
		<?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 id="divSimpleSliderRotate"></div>
<?php endif; ?>
</div>
<script type="text/javascript">
var $j = jQuery.noConflict(); 

  $j(document).ready(function(){
    //Setup the main rotater on the home page
    $j('#divSimpleSlider').cycle({
      speed:       <?php echo $_banner->getDelay(); ?>,
      timeout:     3500,
      pager:      '#divSimpleSliderRotate',
      pagerEvent: 'mouseover',
      fastOnEvent: false
    });
     $j('#top_banner').fadeIn(1500);
  });
 
</script>
<?php endif;?>
