<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <div class="prod-header"><h1><?php echo $heading_title; ?></h1></div>
  
  <div id="tab-description">
  <div class="product-info">
    <?php if ($thumb || $images) { ?>
    <div class="left">
      <?php if ($thumb) { ?>
		<div class="image"><a href="<?php echo $zoom_image; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom" id='zoom1' data-rel="adjustX: 10, adjustY:-4, tint:'#000000',tintOpacity:0.2, zoomWidth:360"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a><br/><div >
						<b>Рейтинг товара:</b>
						<div class="clear"></div>
						<div class="clear"></div>
						<table class="open_store stores"><tr class="store_1">
										<span><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" /></span>
									</tr>
									</table>
			</div></div>
      <?php } ?>
	  
      <?php if ($images) { ?>
      <div class="image-additional">
	  <ul id="mycarousel" class="jcarousel-skin-tango">
			<li>
			<a href="<?php echo $zoom_image; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" data-rel="useZoom: 'zoom1', smallImage: '<?php echo $thumb; ?>' "><img src="<?php echo $thumbadditional; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" onclick="largelink('<?php echo $popup; ?>')"/></a>
			</li>
		<?php foreach ($images as $image) { ?>
		<li><a href="<?php echo $image['zoom_image']; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" data-rel="useZoom: 'zoom1', smallImage: '<?php echo $image['thumbimage']; ?>' "><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" onclick="largelink('<?php echo $image['popup']; ?>')" /></a></li>
        <?php } ?>
		</ul>
      </div>
      <?php } ?>

	  <div class="pricetools2" id="reitingparsetools">	
 <!-- JV_Quick_Order -->
<?php if ( $isShowButtonQOInProduct && $jvquickorder_status ) { ?>
    &nbsp;<a onclick="jv_qiuckorder_show('<?php echo $product_id; ?>');" class="myButtonqick" style="display:none;"><span><?php echo $button_jv_quick_order; ?></span></a> 
<?php } ?>
<!-- JV_Quick_Order -->
      </div>

	  	<div  id="parcels" style="display:none;">
	  <form method="post" enctype="multipart/form-data">
								<input type="hidden" name="quantity" value="<?php echo $minimum; ?>" />
        						<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
								<input style="margin-left: 56px;" type="button" value="Добавить в корзину" class="myButton2" id="button-cart"  />

	   </form>
	  </div>
    </div>
    <?php } ?>
    <div class="right">
		<div class="right-left">
			
			<div class="pricetools-skladi">
			<b>Поделитесь в соц.сетях!</b>
			
					<div style="margin-top: 10px;" class="share42init"></div>
<script type="text/javascript" src="http://igrawka.ru/share42/share42.js"></script>
				
			</div>
		

			
			
<div class="yashare-auto-init" data-yashareL10n="ru"
 data-yashareType="button" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir"

></div>      
		</div>
		<div  class="right-right">
			<!--new panels start-->
			  <div>
			  	<div id="delivery-panel">
					<div id="region">Регион: <span id="user-city"></span></div>
					<div id="courier">Курьером, 5 дней</div>
					<div id="data-p">Дата передачи в доставку: 7 декабря, суббота</div>
					<div id="del-info"><a href="http://igrawka.ru/index.php?route=information/information&information_id=6">О доставке и оплате</a></div>
				</div>
				<div id="price-panel">
					<div id="price-stock">
						<div style="padding:10px 0px 5px 0px;font-size:16px;">Цена:</div>
						<div style="font-size:30px;">
						<?php echo $special; ?>
				
						<?php if (!$special) { ?>
						<span  > <?php echo $price; ?> </span>
	
				<?php } else { ?>
						<span class="productold" > <?php echo $price; ?> </span>
			<?php } ?>
					
						<br />
						</div>
						<a href="#" data-rel="<?php echo $heading_title;?>" class="less">Нашли дешевле?</a>
						<div id="stock-status"><span><?php echo $stock; ?></span></div>
						
					</div>
					
					
					<div id="buy-but"><span>Добавить в корзину</span></div>

 <!-- JV_Quick_Order -->

					<div id="quick-but"><a style="text-decoration: none;" href="javascript:void(0);" onClick="recalld_show();" ><span>Задайте вопрос</span></a> </div>
				
				</div>	
			
				
				<div id="promo-banner"><a href="#"><img src="image/promo/photobook.jpg" /></a></div>  
			  </div>
			<!--new panels end-->
		<div style="margin-top: 355px; margin-left: -1000px; display:none;" class="pricetools">						
				<span style="font-size: 25px;" class="price-new1"><?php 
				if(mb_strlen($price) == 11){
				echo substr($price, 0, 1);
				};
				if(mb_strlen($price) == 12){
				echo substr($price, 0, 2);
				};
				if(mb_strlen($price) == 13){
				echo substr($price, 0, 3);
				};
				if(mb_strlen($price) == 14){
				echo substr($price, 0, 4);
				};
				if(mb_strlen($price) == 15){
				echo substr($price, 0, 5);
				};
				if(mb_strlen($price) == 16){
				echo substr($price, 0, 6);
				};
				if(mb_strlen($price) == 17){
				echo substr($price, 0, 7);
				};
				
				?>р.</span><br />
			<span style="font-size: 20px;" class="price-new1"><?php echo round($price_); ?>$</span><br />
			<span style="font-size: 20px;" class="price-new1"><?php echo round($price_1); ?>€</span>
				
				<p><a href="#" data-rel="<?php echo $heading_title;?>" class="less">Нашли дешевле?</a></p>
			</div>
			
			<div class="share">
			    
			</div>		
		</div>
		
     <!-- <div class="description">
        <?php if ($manufacturer) { ?>
        <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
        <?php } ?>
        <span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
        <?php if ($reward) { ?>
        <span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
        <?php } ?>
        <span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
      <?php if ($price) { ?>
      <div class="price"><?php echo $text_price; ?>
        <?php if (!$special) { ?>
        <?php echo $price; ?>
		<span style="color:#999999; font-size: 13px; "> /<?php echo $price_; ?>  р.</span>
        <?php } else { ?><span style="color:#999;">выгода - <?php echo $economy; ?></span>
        <span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
        <?php } ?>
        <br />
        <?php if ($tax) { ?>
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
        <?php } ?>
		 
        <?php if ($points) { ?>
        <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br />
        <?php } ?>
        <?php if ($discounts) { ?>
        <br />
        <div class="discount">
          <?php foreach ($discounts as $discount) { ?>
          <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
          <?php } ?>
        </div>
        <?php } ?>
      </div>
      <?php } ?>
      <?php if ($options) { ?>
      <div class="options">
        <h2><?php echo $text_option; ?></h2>
        <br />
        <?php foreach ($options as $option) { ?>
        <?php if ($option['type'] == 'select') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <select name="option[<?php echo $option['product_option_id']; ?>]">
            <option value=""><?php echo $text_select; ?></option>
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
            </option>
            <?php } ?>
          </select>
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'radio') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <?php foreach ($option['option_value'] as $option_value) { ?>
          <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
          </label>
          <br />
          <?php } ?>
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'checkbox') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <?php foreach ($option['option_value'] as $option_value) { ?>
          <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
          </label>
          <br />
          <?php } ?>
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'image') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <table class="option-image">
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <tr>
              <td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
              <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
              <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
                  <?php if ($option_value['price']) { ?>
                  (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                  <?php } ?>
                </label></td>
            </tr>
            <?php } ?>
          </table>
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'text') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'textarea') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'file') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <input type="button" value="<?php echo $button_upload; ?>" id="button-option-<?php echo $option['product_option_id']; ?>" class="button">
          <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'date') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'datetime') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'time') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
        </div>
        <br />
        <?php } ?>
        <?php } ?>
      </div>
      <?php } ?>
      <div class="cart">
        <div><?php echo $text_qty; ?>
          <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
          <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
          &nbsp;
          <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
          <span>&nbsp;&nbsp;<?php echo $text_or; ?>&nbsp;&nbsp;</span>
          <span class="links"><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
            <a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></span>
        </div>
        <?php if ($minimum > 1) { ?>
        <div class="minimum"><?php echo $text_minimum; ?></div>
        <?php } ?>
      </div>
      <?php if ($review_status) { ?>
      <div class="review">
        <div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>
        <div class="share">
          <script type="text/javascript" src="http://yraaa.ru/share/share_16x16.d3sn"></script>
        </div>
      </div>-->
      <?php } ?>
    </div>
  </div>

     <div style="margin-left: 0px;  margin-top: 34px;" class="tabs_names" id="tabs">

		  <a style="width: 75px;" class="tabstyle" href="#tab-dscription">Описание</a>		
			
   		<?php if ($product_tabs_1) { ?>
					<?php foreach($product_tabs_1 as $product_tab_1) { ?>
						<a style="width: 115px;" class="tabstyle" href="#tab-product-tab<?php echo $product_tab_1['tab_id'];?>"><?php echo $product_tab_1['name']; ?></a>
					<?php } ?>
		<?php } ?>

  <?php if ($attribute_groups) { ?><a href="#tab-attribute">Характеристики</a>
  
  <?php } ?>


 <a style="width: 62px;" class="tabstyle" href="#tab-review" class="tabstyle">Отзывы</a>
 
<?php if ($product_tabs_1) { ?>
<?php foreach($product_tabs_1 as $product_tab_1) { ?>
  <div id="tab-product-tab<?php echo $product_tab_1['tab_id'];?>">
    	
<?php } ?>
 
	<div class="pmd-desc">
	<table style="padding:10px; width:1100px;">
      <?php foreach ($product_tabs_1 as $product_tab_1) { ?>
      <thead>
        <tr>
		<br /><br /><br />
          <td colspan="2"><?php echo $product_tab_1['text']; ?></td>
        </tr>
      </thead>
      <?php } ?>
    </table>
	</div>
  </div>
  </div>
  <?php } ?>
  
 
 <div id="tab-dscription">
<div class="prod-main-desc">
  	<div class="pmd-head"></div>
	
	<div class="pmd-desc"><?php echo $description; ?></div>
	
</div>
</div>
 <?php if ($review_status) { ?>
  <div id="tab-review"><br /><br /><br />
    <div id="review"></div>
    <h2 id="review-title"><?php echo $text_write; ?></h2>
    <b><?php echo $entry_name; ?></b><br />
    <input type="text" name="name" value="" />
    <br />
    <br />
    <b><?php echo $entry_review; ?></b>
    <textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
    <span style="font-size: 11px;"><?php echo $text_note; ?></span><br />
    <br />
    <b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span>&nbsp;
    <input type="radio" name="rating" value="1" />
    &nbsp;
    <input type="radio" name="rating" value="2" />
    &nbsp;
    <input type="radio" name="rating" value="3" />
    &nbsp;
    <input type="radio" name="rating" value="4" />
    &nbsp;
    <input type="radio" name="rating" value="5" />
    &nbsp;<span><?php echo $entry_good; ?></span><br />
    <br />
    <b><?php echo $entry_captcha; ?></b><br />
    <input type="text" name="captcha" value="" />
    <br />
    <img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />
    <br />
    <div class="buttons">
      <div class="right"><a id="button-review" class="button"><?php echo $button_continue; ?></a></div>
    </div>
  </div>
  <?php } ?>
  </div>
  

  <?php if ($attribute_groups) { ?>
  <div class="prod-main-desc">
  	<div class="pmd-head"><?php echo $tab_attribute; ?></div>
	<div class="pmd-desc">
	<table class="attribute">
      <?php foreach ($attribute_groups as $attribute_group) { ?>
      <thead>
        <tr>
          <td colspan="2"><?php echo $attribute_group['name']; ?></td>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
        <tr>
          <td><?php echo $attribute['name']; ?></td>
          <td><?php echo $attribute['text']; ?></td>
        </tr>
        <?php } ?>
      </tbody>
      <?php } ?>
    </table>
	</div>
  </div>
  
  <?php } ?>





  <div style="clear:both; height:20px;">
  <?php if ($attribute_groups) { ?>
  <div id="tab-attribute" style="padding-top:20px;">
    <table class="attribute">
      <?php foreach ($attribute_groups as $attribute_group) { ?>
      <thead>
        <tr>
          <td colspan="2"><?php echo $attribute_group['name']; ?></td>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
        <tr>
          <td><?php echo $attribute['name']; ?></td>
          <td><?php echo $attribute['text']; ?></td>
        </tr>
        <?php } ?>
      </tbody>
      <?php } ?>
    </table>
  </div>
  <?php } ?>
  </div>
  
  <?php if ($review_status) { ?>

  <?php } ?>
  <!--<?php if ($products) { ?>
  <div id="tab-related" class="tab-content">
    <div class="box-product">
      <?php foreach ($products as $product) { ?>
      <div>
        <?php if ($product['thumb']) { ?>
        <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
        <?php } ?>
        <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
        <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
          <?php } ?>
        </div>
        <?php } ?>
        <?php if ($product['rating']) { ?>
        <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        <?php } ?>
        <a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><?php echo $button_cart; ?></a></div>
      <?php } ?>
    </div>
  </div>
  <?php } ?>
  <?php if ($tags) { ?>
  <div class="tags"><b><?php echo $text_tags; ?></b>
    <?php for ($i = 0; $i < count($tags); $i++) { ?>
    <?php if ($i < (count($tags) - 1)) { ?>
    <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>,
    <?php } else { ?>
    <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>
    <?php } ?>
    <?php } ?>
  </div>
  <?php } ?>-->
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$(document).ready(function() {
	$('.colorbox').colorbox({
		overlayClose: true,
		opacity: 0.5,
		rel: "colorbox"
	});
});
//--></script> 
<script type="text/javascript"><!--
$('#buy-but span').bind('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/cart/add',
		type: 'post',
		data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
		dataType: 'json',	
		success: function(json) {
			$('.success, .warning, .attention, information, .error').remove();			
			if (json['error']) {
				if (json['error']['option']) {
					for (i in json['error']['option']) {
						$('#option-' + i).after('<span class="error">' + json['error']['option'][i] + '</span>');
					}
				}
			} 
			
			if (json['success']) {
			$('#cart_total').html(json['total']);
			$('#cart_in_header').html(json['summa']);

			$.ajax({
				url: "/ajax.php", 
				type: "GET", 
				data: "action=notif&idProduct="+<?php echo $product_id; ?>, 
				dataType: "xml", 
				success: notifShop, 
				error: function () {alert("Error...");}
			});
		}	
		}
	});
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
	action: 'index.php?route=product/product/upload',
	name: 'file',
	autoSubmit: true,
	responseType: 'json',
	onSubmit: function(file, extension) {
		$('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
		$('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', true);
	},
	onComplete: function(file, json) {
		$('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', false);
		
		$('.error').remove();
		
		if (json['success']) {
			
			$('input[name=\'option[<?php echo $option['product_option_id']; ?>]\']').attr('value', json['file']);
		}
		
		if (json['error']) {
			$('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json['error'] + '</span>');
		}
		
		$('.loading').remove();	
	}
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
	$('#review').fadeOut('slow');
		
	$('#review').load(this.href);
	
	$('#review').fadeIn('slow');
	
	return false;
});			

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

$('#button-review').bind('click', function() {
	$.ajax({
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		type: 'post',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#button-review').attr('disabled', true);
			$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$('#button-review').attr('disabled', false);
			$('.attention').remove();
		},
		success: function(data) {
			if (data['error']) {
				$('#review-title').after('<div class="warning">' + data['error'] + '</div>');
			}
			
			if (data['success']) {
				$('#review-title').after('<div class="success">' + data['success'] + '</div>');
								
				$('input[name=\'name\']').val('');
				$('textarea[name=\'text\']').val('');
				$('input[name=\'rating\']:checked').attr('checked', '');
				$('input[name=\'captcha\']').val('');
			}
		}
	});
});
//--></script> 
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script> 
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script> 
<script type="text/javascript"><!--
$(document).ready(function() {
	if ($.browser.msie && $.browser.version == 6) {
		$('.date, .datetime, .time').bgIframe();
	}

	$('.date').datepicker({dateFormat: 'yy-mm-dd'});
	$('.datetime').datetimepicker({
		dateFormat: 'yy-mm-dd',
		timeFormat: 'h:m'
	});
	$('.time').timepicker({timeFormat: 'h:m'});
});
//--></script> 
<div id="svh_boxes">
<div id="svh_bpc_dialog" class="bpcwindow">
<div class="bpc_chello">Заказ товара:</div>
<div id="svh_bpc_first">
<div class="bpc">
<form method="post">
<div class="l1_1">Вас зовут:</div>
<div class="l1_2"><input name="nv_params[name]" class="svh_input_a"></div>
<div class="l1_z"></div>
<div class="l1_1">Ваш телефон:</div>
<div class="l1_2"><input name="nv_params[phone]" id="svh_mp" class="svh_input_a" value="+38"></div>
<div class="l1_z"></div>

<div class="l1_3">
Заказ <?php echo $heading_title; ?> за <?php echo $price; ?><br>
<input type="submit" name="svhBtn" id="getitem" class="sBtn" value="Заказать товар!" disabled="disabled">
</div>
<input type="hidden" name="nv_params[prod_name]" value="{имя товара}">
<input type="hidden" name="nv_params[prod_price]" value="{цена товара}">
<input type="hidden" name="submit_bpc">
</form>
</div>
</div>
<div id="PasteSvhBpcFooter"></div>
</div><div id="svh_mask"></div>

<script type="text/javascript">

function downloadImage() {
	var imgSrc = $('div.image').find('a').prop('href');
	document.location.href = 'download_image.php?pic=' + imgSrc;
}

</script>
</div>
<?php echo $footer; ?>