<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct();
    $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product);
?>

<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/cloud-zoom.js') ?>"></script>
<script type="text/javascript">
    var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
</script>
<div class="product-view">
    <form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="magik_quickview"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
    <div class="product-essential">
	
	   <div class="product-img-box"> 
              <?php echo $this->helper('amazesettings')->getLabel($_product);  ?>           
              <?php echo $this->getChildHtml('media') ?>           
        </div>

	  <div class="product-shop">
	      <div class="product-name">
               <h1 itemprop="name"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
               
             </div>

	     <?php echo $this->getReviewsSummaryHtml($_product, false, true)?> 
  
            <?php echo $this->getChildHtml('alert_urls') ?>
            <?php echo $this->getChildHtml('product_type_data') ?>
            <?php echo $this->getChildHtml('bundle_prices') ?>
            <?php echo $this->getTierPriceHtml() ?>
            <?php echo $this->getChildHtml('extrahint') ?>      

            <?php if ($_product->getShortDescription()):?>
               <div class="short-description">   
                 <h2><?php echo $this->__('Quick Overview') ?></h2>             
                 <p><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></p>
               </div>
             <?php endif;?>        
      
	   
            <?php if($_product->isSaleable()): ?>
                      <?php if($this->hasOptions()): ?>
                            <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
                            <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
                     <?php endif; ?>
            <?php endif; ?>



<div class="add-to-box">
    <div class="add-to-cart">
<?php if($_product->isSaleable()): ?>    
  <div class="pull-left">  
    <div class="custom pull-left">
        <?php if(!$_product->isGrouped()): ?>
          <button onClick="var result = document.getElementById('qty1'); var qty1 = result.value; if( !isNaN( qty1 ) &amp;&amp; qty1 &gt; 0 ) result.value--;return false;" class="reduced items-count" type="button"><i class="icon-minus">&nbsp;</i></button>
          <input type="text" name="qty" id="qty1"  maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Quantity:') ?>" class="input-text qty" />
          <button onClick="var result = document.getElementById('qty1'); var qty1 = result.value; if( !isNaN( qty1 )) result.value++;return false;" class="increase items-count" type="button"><i class="icon-plus">&nbsp;</i></button>
        <?php endif; ?>                  
    </div> <!--custom pull-left-->
  </div> <!--pull-left-->     
<?php endif; ?>

<div class="pull-right">
    <?php if($_product->isSaleable()): ?>
     <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><?php echo $this->__('Add to Cart') ?></span></button>  
     <?php else: ?>
        <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
     <?php endif; ?>
  </div> <!--pull-right-->
</div> <!--add-to-cart-->

              </div> <!--add-to-box-->
	     
	     

	</div> <!--product-shop-->
  </div> <!--product-essential-->
</form>
<script type="text/javascript">
    //<![CDATA[
        var productAddToCartForm = new VarienForm('magik_quickview');
        productAddToCartForm.submit = function(button, url) { 
            if (this.validator.validate()) {
                var form = this.form;
                var oldUrl = form.action;

                if (url) {
                   form.action = url;
                }
                var e = null;
                try {
                    this.form.submit();
                } catch (e) {
                }
                this.form.action = oldUrl;
                if (e) {
                    throw e;
                }

                if (button && button != 'undefined') {
                    button.disabled = true;
                }
            }
        }.bind(productAddToCartForm);

        productAddToCartForm.submitLight = function(button, url){ 
            if(this.validator) {
                var nv = Validation.methods;
                delete Validation.methods['required-entry'];
                delete Validation.methods['validate-one-required'];
                delete Validation.methods['validate-one-required-by-name'];
                // Remove custom datetime validators
                for (var methodName in Validation.methods) {
                    if (methodName.match(/^validate-datetime-.*/i)) {
                        delete Validation.methods[methodName];
                    }
                }

                if (this.validator.validate()) {
                    if (url) {
                        this.form.action = url;
                    }
                    this.form.submit();
                }
                Object.extend(Validation.methods, nv);
            }
        }.bind(productAddToCartForm);
    //]]>
    </script>
</div> <!--product-view-->

