<?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
if(Mage::getStoreConfig('avalanche_config/avalanche_product_details/avalanche_showtags') == 1) {
?>
<div id="product-tags" class="white-box">
    <h2><?php echo $this->__('Product Tags') ?></h2>
    <?php echo $this->getChildHtml('list_before')?>
    <div class="white-box-inner">
    	<?php if( $this->getCount() ): ?>
	  	  	<p><?php echo $this->__('Other people marked this product with these tags:') ?></p>
		    <ul id="<?php echo $this->getUniqueHtmlId('product-tags_'); ?>" class="product-tags clearfix">
		        <?php echo $this->renderTags('<li><a href="%1$s">%2$s</a> (%3$s)</li>') ?>
		    </ul>
	    <?php endif; ?>
	    <form id="addTagForm" action="<?php echo $this->getFormAction(); ?>" method="get">
	        <div class="form-add">
	            <label for="productTagName"><?php echo $this->__('Add Your Tags:') ?></label>
	            <div class="input-box">
	                <input type="text" class="input-text required-entry" name="productTagName" id="productTagName" />&nbsp;&nbsp;
		            <button type="button" title="<?php echo $this->__('Add Tags') ?>" class="button" onclick="submitTagForm()">
		                <span>
		                    <span><?php echo $this->__('Add Tags') ?></span>
		                </span>
		            </button>
	            </div>
	        </div>
	    </form>
	    <p class="note" style="font-size: 12px; color: #888"><?php echo $this->__("Use spaces to separate tags. Use single quotes (') for phrases.") ?></p>
	    <script type="text/javascript">
	    //<![CDATA[
	        var addTagFormJs = new VarienForm('addTagForm');
	        function submitTagForm(){
	            if(addTagFormJs.validator.validate()) {
	                addTagFormJs.form.submit();
	            }
	        }
	    //]]>
	    </script>
	</div>
</div>
<?php
}
?>
