<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
?>
<div id="product-image-browser" class="<?php if(!$_product->isSaleable()) { echo "unavailable"; } ?>">
	<div id="product-images">
		<ul class="clearfix">
	    	<li><?php
	        $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(300)->setQuality(Mage::getStoreConfig('avalanche_mobile/design/jpeg_compression')).'" alt="'.$this->escapeHtml($this->getImageLabel()).'" title="'.$this->escapeHtml($this->getImageLabel()).'" width="300"/>';
	        echo $_helper->productAttribute($_product, $_img, 'image');
	    	?></li>
	    	<?php if(count($this->getGalleryImages()) > 0): ?>
			    <?php foreach ($this->getGalleryImages() as $_image): ?>
			        <li>
			            <a href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()) ?>" title="<?php echo $this->escapeHtml($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->resize(300)->setQuality(Mage::getStoreConfig('avalanche_mobile/design/jpeg_compression')); ?>" width="300" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>"></a>
			        </li>
			    <?php endforeach; ?>
	    	<?php endif; ?>
	</div>
	<div id="media-legend">
		<?php for($x = 0; $x <= count($this->getGalleryImages()); $x++) { ?>
			<span>&#9679;</span>
		<?php } ?>
	</div>
</div>
