{{* funkcja przed usunięciem spacji *
{{function page_tree aPageTree=$aProduct.aPagesTree bCaption=true bMenu=true}}
	{{if $bMenu && isset($aPageTree.sMenu)}}
		{{$aPageTree.sMenu}}
		{{if $bCaption || count( $aPagesTree.aPath ) > 0}}
			&nbsp;&raquo;&nbsp;
		{{/if}}
	{{/if}}
	{{foreach from=$aPageTree.aPath item=aPage}}
		<span><a href="{{$aPage.sLinkName}}">{{$aPage.sName}}</a></span>
		{{if !$aPage@last || $bCaption}}
			&nbsp;&raquo;&nbsp;
		{{/if}}
	{{/foreach}}
	{{if $bCaption}}
		{{$aPageTree.aCurrent.sName}}
	{{/if}}
{{/function}}
*                                    *}}
{{function page_tree aPageTree=$aProduct.aPagesTree bCaption=true bMenu=true}}{{if $bMenu && isset($aPageTree.sMenu)}}{{$aPageTree.sMenu}}{{if $bCaption || count( $aPagesTree.aPath ) > 0}}&nbsp;&raquo;&nbsp;{{/if}}{{/if}}{{foreach from=$aPageTree.aPath item=aPage}}<span><a href="{{$aPage.sLinkName}}">{{$aPage.sName}}</a></span>{{if !$aPage@last || $bCaption}}&nbsp;&raquo;&nbsp;{{/if}}{{/foreach}}{{if $bCaption}}{{$aPageTree.aCurrent.sName}}{{/if}}{{/function}}

{{function name=attributes aProduct=$aProduct}}
	{{if count($aProduct.aAttributes) > 0}}
		<dl id="attributes">
		{{foreach from=$aProduct.aAttributes item=aAttribute}}
			{{if count($aAttribute.aValues) > 1}}
				<dt><label for="attr-{{$aAttribute@key}}">{{$aAttribute.sName}}:</label></dt>
				<dd><select name="aAttributes[{{$aAttribute@key}}]" id="attr-{{$aAttribute@key}}" class="attributes" ><option value="">{{$lang.Select}}</option>
				{{foreach from=$aAttribute.aValues item=sValue}}<option value="{{$sValue@key}}">{{$sValue}}</option>{{/foreach}}
				</select></dd>
			{{elseif $config.show_unselectable_attributes_in_basket}}
				<dt>{{$aAttribute.sName}}:</dt>
				<dd class="single-value">{{foreach from=$aAttribute.aValues item=sValue}}{{$sValue}}{{/foreach}}</dd>
			{{/if}}
		{{/foreach}}
		</dl>
	{{/if}}
{{/function}}



{{function name="displayPriceInfo" aProduct=null}}
<div class="prices">
	{{if $config.iNettoOption > 0}}
		<div class="price netto">
			{{if $aProduct.iVisiblePrice}}
				{{if isset($aProduct.sDiscountPercent)}}
					<div class="old"><span class="value">{{number_format( $aProduct.fCatalogPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span></div>
					<span class="value">{{number_format( $aProduct.fPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span>
				{{else}}
					{{if !empty( $aProduct.fPriceOld )}}
						<div class="old"><span class="value">{{number_format( $aProduct.fPriceOld / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span></div>
					{{/if}}
					<span class="value">{{number_format( $aProduct.fPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span>
					{{if $aProduct.fCatalogPrice > $aProduct.fPrice}}
						<div class="catalog">{{$lang.Catalog_price}}: <span class="value">{{number_format( $aProduct.fCatalogPrice / ( 1 + $aProduct.fVatValue ), 2, '.', '' )}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Plus_vat}}</span></div>
					{{/if}}
				{{/if}}
			{{/if}}
		</div>
	{{/if}}
	{{if $config.iNettoOption < 2}}
		<div class="price gross">
			{{if $aProduct.iVisiblePrice}}
				{{if $config.iNettoOption == 1}}
					<span class="value">{{$aProduct.sPrice}}</span> <span class="currency">{{$config.currency_symbol}} {{$lang.Inc_vat}}</span>
				{{else}}
					{{if isset($aProduct.sDiscountPercent)}}
						<div class="old"><span class="value">{{$aProduct.sCatalogPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span></div>
						<span class="value">{{$aProduct.sPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span>
					{{else}}
						{{if !empty( $aProduct.sPriceOld )}}
							<div class="old"><span class="value">{{$aProduct.sPriceOld}}</span> <span class="currency">{{$config.currency_symbol}}</span></div>
						{{/if}}
						<span class="value">{{$aProduct.sPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span>
						{{if $aProduct.fCatalogPrice > $aProduct.fPrice}}
							<div class="catalog">{{$lang.Catalog_price}}: <span class="value">{{$aProduct.sCatalogPrice}}</span> <span class="currency">{{$config.currency_symbol}}</span></div>
						{{/if}}
					{{/if}}
				{{/if}}
			{{/if}}
		</div>
	{{/if}}
</div>
{{/function}}


<div id="product">
	<script type="text/javascript">
		var sDisplayType = "product";
		var iProduct = {{$aProduct.iProduct}};
	</script>

	<h1 {{if $aProduct.iStatus == 0}}class="admin"{{/if}}>
		{{if $smarty.session.bSellSmartUser}}
			<a class="product-edit" href="admin.php?p=products-form&amp;iProduct={{$aProduct.iProduct}}" target="_blank"><img title="{{$lang.Edit}}" alt="{{$lang.Edit}}" src="{{$config.dir_templates}}admin/images/ico/edit.png" /></a>
			{{if !empty( $aProduct.sAdminInfo )}}
				<img src="templates/admin/images/ico/comment-new.png" title="{{$aProduct.sAdminInfo}}" class="tTip info" />
			{{/if}}
		{{/if}}
		{{$aProduct.sName}}
		
		{{if isset($aProduct.aProducer.sLogoUrl)}}
			<span class="producer-logo-container">
				{{if !empty( $sLinkSearch )}}
					<a href="{{$sLinkSearch}}?sPhrase=&amp;iProducer={{$aProduct.aProducer.iProducer}}" title="{{$lang.producer}}: {{$aProduct.aProducer.sName}}">
				{{/if}}
						<img class="producer-logo" src="{{$config.dir_files}}h30/{{$aProduct.aProducer.sLogoUrl}}" alt="{{$lang.producer}}: {{$aProduct.aProducer.sName}}" />
				{{if !empty( $sLinkSearch )}}
					</a>
				{{/if}}
			</span>
		{{/if}}
	</h1>
	<div id="breadcrumb">{{$lang.You_are_in}}:&nbsp;{{page_tree aPageTree=$aProduct.aPagesTree bCaption=1 bMenu=1}}</div>
	<div class="block50">
		<div id="gallery" style="height: auto;">{{$aFiles.7}}</div>
	</div>
	<div class="block50">
		{{if !$config.prices_off && $aProduct.iVisiblePrice}}
			<div id="order">
				{{displayPriceInfo aProduct=$aProduct}}
				
				{{if isset($aProduct.sPriceTimeRemain)}}
					<script type="text/javascript">
						/*<![CDATA[*/
						TargetDate = {{$aProduct.iPriceTimeTo}}000;
						BackColor = "transparent";
						ForeColor = "white";
						CountActive = true;
						CountStepper = -1;
						LeadingZero = true;
						DisplayFormat = "%%D%% {{$lang.days}} %%H%% {{$lang.h}} %%M%% {{$lang.min}} %%S%% {{$lang.sec}}";
						FinishMessage = "";

						/*
						Author: Robert Hashemian
						http://www.hashemian.com/

						You can use this code in any manner so long as the author's
						name, Web address and this disclaimer is kept intact.

						Modified by LabSQL
						********************************************************/
						function calcage(secs, num1, num2) {
							s = ((Math.floor(secs/num1))%num2).toString();
							if (LeadingZero && s.length < 2)
								s = "0" + s;
							return "<b>" + s + "</b>";
						}

						function CountBack(secs) {
							if (secs < 0) {
								document.getElementById("cntdwn").innerHTML = FinishMessage;
								return;
							}
							days = calcage(secs,86400,100000);
							DisplayStr = DisplayFormat.replace(/%%D%%/g, days);
							DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
							DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
							DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));

							document.getElementById("cntdwn").innerHTML = DisplayStr;
							if (CountActive){
								setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
							}
						}

						if (typeof(TargetDate)=="undefined")
							TargetDate = "12/31/2020 5:00 AM";
						if (typeof(DisplayFormat)=="undefined")
							DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
						if (typeof(CountActive)=="undefined")
							CountActive = true;
						if (typeof(FinishMessage)=="undefined")
							FinishMessage = "";
						if (typeof(CountStepper)!="number")
							CountStepper = -1;
						if (typeof(LeadingZero)=="undefined")
							LeadingZero = true;

						CountStepper = Math.ceil(CountStepper);
						if (CountStepper == 0)
							CountActive = false;
						var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
						var dthen = new Date(TargetDate);
						var dnow = new Date();

						/*var anim_speed = 100;
						var anim_delay = 2000;*/

						var anim_speed = 1000;
						var anim_delay = 0;

						$(document).ready(function(){
							if(CountStepper>0)
								ddiff = new Date(dnow-dthen);
							else
								ddiff = new Date(dthen-dnow);
							gsecs = Math.floor(ddiff.valueOf()/1000);
							CountBack(gsecs);
						})
						/* ]]> */
					</script>
					<div id="cntdwn-container">
						<p id="cntdwn-header">{{$lang.Offer_ends_in}}:</p>
						<p id="cntdwn">{{$aProduct.sPriceTimeRemain}}</p>
						{{if $aProduct.iPriceTimeCount > 0}}<p id="groupon-buyers">{{$lang.Buyers_prefix}}: <span>{{$aProduct.iPriceTimeCount}}</span> {{$lang.Buyers_suffix}}.</p>{{/if}}
					</div>
				{{/if}}

				<div id="basket-add">
					{{if isset( $sBasketPage ) && isset( $aProduct.aVariants ) && ( ( count( $aProduct.aVariants ) == 1 && $config.product_attributes_list > 0 ) || ( $config.product_attributes_list > 1 ) )}}
						<script type="text/javascript">
						$(document).ready(function(){
							$("form#basket").validate();
							$("form#basket #basket-quantity").rules("add", {required: true, number: true, min: 1});
							$("form#basket select").each(function(){ $(this).rules("add", {required: true}); });
						});
						</script>
						<form action="{{$sBasketPage}}" method="post" id="basket"><fieldset>
						<input type="hidden" name="iProductAdd" value="{{$aProduct.iProduct}}" />
						{{attributes aProduct=$aProduct}}
						<div class="clear"></div>
						<input type="submit" value="{{$lang.basket_add_product}}" class="submit" />
						<input type="hidden" name="iQuantity" value="1" class="quantity input" id="basket-quantity" />
						</fieldset>
						</form>
					{{elseif !$aProduct.iCanBuy && $config.products_avail_newsletter}}
						<div id="products_avail_newsletter_wrapper"><a href="#iProduct={{$aProduct.iProduct}}" class="products_avail_newsletter">{{$lang.products_avail_newsletter}}</a></div>
					{{/if}}

					{{if $aProduct.bInStorage}}
						<a class="storage remove" href="{{$aProduct.sStorageLinkName}}iProductStorageRemove={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_remove}}">{{$lang.storage_remove}}</a>
					{{elseif isset($aProduct.bInStorage)}}
						<a class="storage add" href="{{$aProduct.sStorageLinkName}}iProductStorageAdd={{$aProduct.iProduct}}" rel="nofollow" title="{{$lang.storage_add}}">{{$lang.storage_add}}</a>
					{{/if}}
					
					{{if $config.negotiate_price_form}}
						<a id="product-negotiate-button" href="#"><span>{{$lang.Product_price_negotiate}}</span></a>
					{{/if}}
					
					
					<div class="clear"></div>
				</div>

			</div>

			{{if !empty( $config.zagiel_id ) && $aProduct.fPrice >= $config.zagiel_min_price}}
				<a id="zagiel-button" href="https://wniosek.eraty.pl/symulator/oblicz/numerSklepu/{{$config.zagiel_id}}/wariantSklepu/1/typProduktu/0/wartoscTowarow/{{$aProduct.fPrice}}" rel="nofollow"><img src="{{$config.dir_templates}}images/zagiel_oblicz_rate.gif" alt="{{$lang.Zagiel_calculate}}" /></a>
			{{/if}}

			{{if !empty( $config.LR_psp_id ) && !in_array($aProduct.iMainCategory, explode(',', $config.LR_categories))}}
				<script type="text/javascript">
				/*<![CDATA[*/
					function LR_PoliczRate(koszyk) {
						var iWidth = 820;
						var iHeight = 530;
						var iX = ( screen.availWidth - iWidth ) / 2;
						var iY = ( screen.availHeight - iHeight ) / 2;	
						window.open('https://ewniosek.credit-agricole.pl/eWniosek/simulator.jsp?PARAM_TYPE=RAT&PARAM_PROFILE={{$config.LR_psp_id}}&PARAM_CREDIT_AMOUNT='+koszyk, 'Policz_rate', 'height='+iHeight+',width='+iWidth+',top='+iY+',left='+iX+',resizable=yes,scrollbars=yes,status=0;');
						return false;
					}
				/*]]>*/
				</script>
				<a OnClick="return LR_PoliczRate('{{$aProduct.fPrice}}');" target="raty_symulator" id="LR-button" href="https://ewniosek.credit-agricole.pl/eWniosek/simulator.jsp?PARAM_TYPE=RAT&PARAM_PROFILE={{$config.LR_psp_id}}&PARAM_CREDIT_AMOUNT={{$aProduct.fPrice}}" rel="nofollow">
					<img src="https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/oblicz_raty_{{$config.LR_logo_color}}.png" alt="{{$lang.LR_name}}" /></a>
				</a>
			{{/if}}
		{{else}}
			<p class="available">{{$lang.Ask_about_product}}<br /><a href=mailto:{{$config.orders_email}}>{{$config.orders_email}}</a></p>
		{{/if}}
		{{if $smarty.session.bSellSmartUser && !empty( $aProduct.sAdminInfo )}}
			<img src="templates/admin/images/ico/comment-new.png" title="{{$aProduct.sAdminInfo}}" class="tTip info" style="background:none; box-sizing: initial; float: none; padding: 0; width: auto; margin: 0; height: auto; position: absolute; bottom: 10px; right: 10px;" />
		{{/if}}
		
		<div id="info" class="box">
			{{if $config.stock_visual || $config.stock_show_level_for_client}}
				<p id="stock-quantity">
					<strong>{{$lang.Stock_level_users}}:</strong>
					{{if $config.stock_show_level_for_client}}
						<span class="value">{{$aProduct.iStock}}</span>
					{{/if}}
					{{if $config.stock_visual && is_numeric( $aProduct.iStock )}}
						{{if $aProduct.iStock <= 0}}
							<img src="{{$config.dir_templates}}images/0_{{$config.language}}.png" title="{{$lang.stock_0}}" alt="{{$lang.stock_0}}" />
						{{elseif is_numeric( $config.visualstock1max ) && ( $config.visualstock1max >= $aProduct.iStock )}}
							<img src="{{$config.dir_templates}}images/1_{{$config.language}}.png" title="{{$lang.stock_1}}" alt="{{$lang.stock_1}}" />
						{{elseif is_numeric( $config.visualstock2max ) && ( $config.visualstock2max >= $aProduct.iStock )}}
							<img src="{{$config.dir_templates}}images/2_{{$config.language}}.png" title="{{$lang.stock_2}}" alt="{{$lang.stock_2}}" />
						{{elseif is_numeric( $config.visualstock3max ) && ( $config.visualstock3max >= $aProduct.iStock )}}
							<img src="{{$config.dir_templates}}images/3_{{$config.language}}.png" title="{{$lang.stock_3}}" alt="{{$lang.stock_3}}" />
						{{elseif is_numeric( $config.visualstock4min )}}
							<img src="{{$config.dir_templates}}images/4_{{$config.language}}.png" title="{{$lang.stock_4}}" alt="{{$lang.stock_4}}" />
						{{/if}}
					{{/if}}
				</p>
			{{/if}}
			{{if isset($aProduct.sAvailable)}}
				<p id="available"><strong>{{$lang.Avail_time}}:</strong> <span class="value">{{$aProduct.sAvailable}}</span></p>
			{{/if}}

			{{if isset( $aProduct.sCatalogNumber )}}
				<p><strong>{{$lang.CatalogNumber}}:</strong> {{$aProduct.sCatalogNumber}}</p>
			{{/if}}

			{{if isset( $aProduct.sProductIndex )}}
				<p><strong>{{$lang.ProductIndex}}:</strong> {{$aProduct.sProductIndex}}</p>
			{{/if}}

			{{if !empty( $aProduct.sWeightDisplayed )}}
				<p><strong>{{$lang.Weight}}:</strong> {{$aProduct.sWeightDisplayed}} {{$config.weight_symbol}}</p>
			{{elseif !empty( $aProduct.sWeight )}}
				<p><strong>{{$lang.Weight}}:</strong> {{$aProduct.sWeight}} {{$config.weight_symbol}}</p>
			{{/if}}

			{{if isset( $aProduct.sSizeXYZ )}}
				<p><strong>{{$lang.SizeXYZ}}:</strong> {{$aProduct.sSizeXYZ}}</p>
			{{/if}}

			{{if !empty( $aProduct.aProducer.sName )}}
				<p><strong>{{$lang.Producer}}:</strong> {{$aProduct.aProducer.sName}}</p>
			{{/if}}

			{{if isset( $aProduct.sProducerURL )}}
				<p><a href="{{$aProduct.sProducerURL}}" rel="nofollow">{{$lang.ProducerPagePrefix}} {{$aProduct.sName}} {{$lang.ProducerPageSuffix}}</a></p>
			{{/if}}

			{{if isset( $aProduct.sReviewURL )}}
				<p><a href="{{$aProduct.sReviewURL}}" rel="nofollow">{{$lang.ReviewPrefix}} {{$aProduct.sName}} {{$lang.ReviewSuffix}}</a></p>
			{{/if}}
		</div>

	</div>
	<div id="products_avail_newsletter-container" style="display: none;">
		{{if $config.products_avail_newsletter}}
			<script type="text/javascript">
				$(document).ready(function(){
					$("form#product-avail-newsletter").validate();
					$("form#product-avail-newsletter input#avail-newsletter-email").rules("add", {required: { depends: function(element){ return $('input#avail-newsletter-phone').length == 0 || $('input#avail-newsletter-phone').val().length == 0; } }, email: true});
					{{if $config.sms_send_avail_newsletter}}
						$("form#product-avail-newsletter input#avail-newsletter-phone").rules("add", {required: { depends: function(element){ return $('input#avail-newsletter-email').val().length == 0; } }, number: true});
					{{/if}}
				});
			</script>
			<form action="" method="post" id="product-avail-newsletter" class="form-styled">
				<fieldset>
					<input type="hidden" name="sOption" value="sendProductAvailNewsletter" />
					<input type="hidden" name="iProduct" value="{{$aProduct.iProduct}}" />
					<input type="hidden" name="iProductVariant" value="" />
					<table>
						<tr>
							<th><label for="avail-newsletter-email">{{$lang.Your_email}}:</label></th>
							<td><input type="text" name="sEmail" class="input" id="avail-newsletter-email" value="{{$_SESSION.sUserEmail}}" size="20" /></td>
						</tr>
						{{if $config.sms_send_avail_newsletter}}
							<tr>
								<th><label for="avail-newsletter-phone">{{$lang.Your_phone}}</label>:</th>
								<td><input type="tel" name="sPhone" class="input" id="avail-newsletter-phone" value="{{$_SESSION.sUserPhone}}" /></td>
							</tr>
						{{/if}}
						<tr>
							<td colspan="2" class="buttons"><input name="sSubmitAvailNewsletter" type="submit" value="{{$lang.send}}" class="submit submit-styled" /></td>
						</tr>
					</table>
				</fieldset>
			</form>
		{{/if}}
	</div>
	<div id="product-negotiate-container" style="display: none;">
		{{if $config.negotiate_price_form}}
			<script type="text/javascript">
				$(document).ready(function(){
					$("form#product-negotiate").validate();
					$("form#product-negotiate input#product-negotiate-name").rules("add", {required: true, minlength: 2});
					$("form#product-negotiate input#product-negotiate-email").rules("add", {required: true, email: true});
					$("form#product-negotiate input#product-negotiate-phone").rules("add", {number: true});
					$("form#product-negotiate textarea#product-negotiate-content").rules("add", {required: true});
				});
			</script>
			<form action="" method="post" id="product-negotiate" class="form-styled">
				<fieldset>
					<input type="hidden" name="sOption" value="sendPriceNegotiate" />
					<table>
						<tr>
							<th><label for="product-negotiate-name">{{$lang.Name_and_surname}}:</label></th>
							<td><input id="product-negotiate-name" type="text" name="sName" class="input" value="{{$_SESSION.sUserName}}"/></td>
						</tr><tr>
							<th><label for="product-negotiate-email">{{$lang.Your_email}}:</label></th>
							<td><input type="text" name="sSender" class="input" id="product-negotiate-email" value="{{$_SESSION.sUserEmail}}" size="20" /></td>
						</tr><tr>
							<th><label for="product-negotiate-phone">{{$lang.Your_phone}}:</label></th>
							<td><input type="tel" name="sPhone" class="input" id="product-negotiate-phone" value="{{$_SESSION.sUserPhone}}" /></td>
						</tr><tr>
							<th><label for="product-negotiate-content">{{$lang.Product_price_negotiate_reason}}:</label></th>
							<td><textarea name="sMailContent" id="product-negotiate-content" cols="30" rows="4"></textarea></td>
						</tr><tr>
							<td colspan="2" class="buttons"><input id="product-negotiate_popup" name="sSubmitProductError" type="submit" value="{{$lang.send}}" class="submit submit-styled reCaptcha" /></td>
						</tr>
					</table>
				</fieldset>
			</form>
		{{/if}}
	</div>
	<div class="clear"></div>

	{{if is_array( $aMessage )}}
		<div class="cb_message"><h1>{{$aMessage.header}}</h1> {{$aMessage.content}}</div>
	{{/if}}

	<div class="clear"></div>
	{{if isset( $aProduct.aVariants ) && ( ( count( $aProduct.aVariants ) > 1 && $config.product_variants_list > 0 ) || ( $config.product_variants_list > 1 ) )}}
		<form action="{{$sBasketPage}}" method="post">
			<div id="product-variants">
			{{foreach from=$aProduct.aVariants item=aVariant}}
				<div class="variant">
					{{if !empty( $aVariant.sFileName )}}<div class="variant_img"><a href="{{$config.dir_files}}{{$config.max_image_size_full}}/{{$aVariant.sFileName}}" class="photo"><img alt="variant image" src="{{$config.dir_files}}100/{{$aVariant.sFileName}}" /></a></div>{{/if}}
					<div class="variant_description">
						{{if $config.stock_visual || $config.stock_show_level_for_client}}
							<p class="stock-quantity">
								<strong>{{$lang.Stock_level_users}}:</strong>
								{{if $config.stock_show_level_for_client}}
									<span class="value">{{$aVariant.iStock}}</span>
								{{/if}}
								{{if $config.stock_visual && is_numeric( $aVariant.iStock )}}
									{{if $aVariant.iStock <= 0}}
										<img src="{{$config.dir_templates}}images/0_{{$config.language}}.png" title="{{$lang.stock_0}}" alt="{{$lang.stock_0}}" />
									{{elseif is_numeric( $config.visualstock1max ) && ( $config.visualstock1max >= $aVariant.iStock )}}
										<img src="{{$config.dir_templates}}images/1_{{$config.language}}.png" title="{{$lang.stock_1}}" alt="{{$lang.stock_1}}" />
									{{elseif is_numeric( $config.visualstock2max ) && ( $config.visualstock2max >= $aVariant.iStock )}}
										<img src="{{$config.dir_templates}}images/2_{{$config.language}}.png" title="{{$lang.stock_2}}" alt="{{$lang.stock_2}}" />
									{{elseif is_numeric( $config.visualstock3max ) && ( $config.visualstock3max >= $aVariant.iStock )}}
										<img src="{{$config.dir_templates}}images/3_{{$config.language}}.png" title="{{$lang.stock_3}}" alt="{{$lang.stock_3}}" />
									{{elseif is_numeric( $config.visualstock4min )}}
										<img src="{{$config.dir_templates}}images/4_{{$config.language}}.png" title="{{$lang.stock_4}}" alt="{{$lang.stock_4}}" />
									{{/if}}
								{{/if}}
							</p>
						{{/if}}
						{{if isset($aVariant.sAvailable)}}
							<p class="available"><strong>{{$lang.Avail_time}}:</strong> <span class="value">{{$aVariant.sAvailable}}</span></p>
						{{/if}}
						{{if !empty( $aVariant.sShortDescription )}}<p>{{$aVariant.sShortDescription}}</p>{{/if}}
						{{if count( $aProduct.aAttributes ) > 0}}
							<ul class="attributes">
								{{foreach from=$aProduct.aAttributes item=aAttribute}}
									<li>{{$aAttribute.sName}}: {{if count( $aAttribute.aValues ) > 1}}<strong>{{/if}}{{$aAttribute.aValues[$aVariant.aAttributes[$aAttribute@key]]}}{{if count( $aAttribute.aValues ) > 1}}</strong>{{/if}}</li>
								{{/foreach}}
							</ul>
						{{/if}}
					</div>
					<div class="variant_price">
						{{$aVariantTmp = $aVariant}}
						{{foreach from=$aVariantTmp item=mVariantData}}
							{{if empty( $mVariantData )}}{{$aVariantTmp[$mVariantData@key] = $aProduct[$mVariantData@key]}}{{/if}}
						{{/foreach}}
						{{displayPriceInfo aProduct=array_merge( $aProduct, $aVariantTmp )}}
						{{if isset( $sBasketPage ) && $aVariant.iCanBuy}}
							<input type="text" name="aVariantsAdd[{{$aVariant.iProductVariant}}]" value="0" {{if $aVariant.iCanBuy < 1}}disabled="disabled"{{/if}}/> szt.
							<input type="submit" class="basket submit" value="" />
						{{/if}}
					</div>
				</div>
			{{/foreach}}
			<div id="submit-all">
				<button type="submit" class="basket submit" value="">{{$lang.Basket_all}}</button>
			</div>
			</div>
		</form>
	{{/if}}

	{{if isset( $aProduct.aVariants ) && ( ( count( $aProduct.aVariants ) > 1 && $config.product_variants_table > 0 ) || ( $config.product_variants_table > 1 ) )}}
		<div class="block100">
			<form action="{{$sBasketPage}}" method="post">
				<div class="desktop tablet product-variants-table">
					<h2>{{str_replace( '%sProduct%', $aProduct.sName, $lang.Tech_parameters )}}</h2>
					<table>
						<tr>
							{{foreach from=$aProduct.aAttributes item=aAttribute}}
								<th>{{$aAttribute.sName}}</th>
							{{/foreach}}
							<th>{{$lang.Price}} / {{$lang.Basket}}</th>
						</tr>
						{{foreach from=$aProduct.aVariants item=aVariant}}
							<tr>
								{{foreach from=$aProduct.aAttributes item=aAttribute}}
									{{if $aVariant@first || count( $aAttribute.aValues ) > 1}}<td {{if count( $aAttribute.aValues ) == 1}}rowspan="{{count( $aProduct.aVariants )}}"{{/if}}>{{$aAttribute.aValues[$aVariant.aAttributes[$aAttribute@key]]}}</td>{{/if}}
								{{/foreach}}
								<td class="price">
									{{$aVariantTmp = $aVariant}}
									{{foreach from=$aVariantTmp item=mVariantData}}
										{{if empty( $mVariantData )}}{{$aVariantTmp[$mVariantData@key] = $aProduct[$mVariantData@key]}}{{/if}}
									{{/foreach}}
									{{displayPriceInfo aProduct=array_merge( $aProduct, $aVariantTmp )}}
									{{if isset( $sBasketPage ) && $aVariant.iCanBuy}}
										<input type="text" name="aVariantsAdd[{{$aVariant.iProductVariant}}]" value="0" {{if $aVariant.iCanBuy < 1}}disabled="disabled"{{/if}}/> szt.
										<input type="submit" class="basket submit" value="" />
									{{/if}}
								</td>
							</tr>
						{{/foreach}}
					</table>
				</div>
			</form>
		</div>
	{{/if}}
	
	<div class="clear"></div>

	{{if count($aProduct.aTabs) > 0}}
		<div id="product-tabs">
			<ul class="headers">
				{{foreach from=$aProduct.aTabs key=sName item=aTab}}
					<li><a class="tab-{{$aTab@iteration}}" href="#tab-{{$aTab@iteration}}">{{$aTab.sTitle}}</a></li>
				{{/foreach}}
			</ul>
			{{foreach from=$aProduct.aTabs item=aTab}}
				<div class="tab content {{if $aTab@key == 'description'}}description{{/if}}" id="tab-{{$aTab@iteration}}">
					<h2>{{if !empty( $aTab.sTitleLong )}}{{$aTab.sTitleLong}}{{else}}{{$aTab.sTitle}}{{/if}}</h2>
					{{if isset($aTab.sContent)}}
						{{if $aTab@key == 'description'}}
							{{$aFiles.5}}
							{{$aFiles.3}}
							{{$aFiles.4}}
						{{/if}}
						{{$aTab.sContent}}
						{{if $aTab@key == 'description'}}
							{{$aFiles.6}}
						{{/if}}
						
						{{if !empty( $aProduct.aProducer.aGuarantee[$aProduct.iMainCategory].sGuarantee )}}
							<h3>{{$lang.Guarantee_conditions}}</h3>
							<p>{{$lang.Guarantee}}: <strong>{{$aProduct.aProducer.aGuarantee[$aProduct.iMainCategory].sGuarantee}}</strong></p>
							{{if $aProduct.aProducer.sGuaranteeFile != ""}}<p>{{$lang.Guarantee_card}} {{$aProduct.aProducer.sName}} - <a href="upload/{{$aProduct.aProducer.sGuaranteeFile}}" title="{{$aProduct.aProducer.sName}} - {{$aProduct.aProducer.sGuaranteeFile}}">{{$aProduct.aProducer.sGuaranteeFile}}</a> [{{$aProduct.aProducer.sFileDate}}, {{$aProduct.aProducer.sFileSize}}]</p>{{/if}}
						{{elseif isset( $aProduct.aProducer.aGuarantee[0].sGuarantee ) }}
							<h3>{{$lang.Guarantee_conditions}}</h3>
							<p>{{$lang.Guarantee}}: <strong>{{$aProduct.aProducer.aGuarantee[0].sGuarantee}}</strong></p>
							{{if $aProduct.aProducer.sGuaranteeFile != ""}}<p>{{$lang.Guarantee_card}} {{$aProduct.aProducer.sName}} - <a href="upload/{{$aProduct.aProducer.sGuaranteeFile}}" title="{{$aProduct.aProducer.sName}} - {{$aProduct.aProducer.sGuaranteeFile}}">{{$aProduct.aProducer.sGuaranteeFile}}</a> [{{$aProduct.aProducer.sFileDate}}, {{$aProduct.aProducer.sFileSize}}]</p>{{/if}}
						{{/if}}
					{{else}}
						{{if $aTab@key == 'ask'}}
							<script type="text/javascript">
								$(document).ready(function(){
									$("form#product-ask-tab").validate();
									$("form#product-ask-tab input#ask-tab-name").rules("add", {required: true, minlength: 2});
									$("form#product-ask-tab input#ask-tab-email").rules("add", {required: true, email: true});
									$("form#product-ask-tab input#ask-tab-phone").rules("add", {number: true});
									$("form#product-ask-tab textarea#ask-tab-content").rules("add", {required: true});
								});
							</script>
							<form action="" method="post" id="product-ask-tab" class="form-styled">
								<fieldset>
									<input type="hidden" name="sOption" value="sendProductQuestion" />
									<table>
										<tr>
											<th><label for="ask-tab-name">{{$lang.Name_and_surname}}</label>:</th>
											<td><input id="ask-tab-name" type="text" name="sName" class="input" value="{{$_SESSION.sUserName}}"/></td>
										</tr><tr>
											<th><label for="ask-tab-email">{{$lang.Your_email}}</label>:</th>
											<td><input id="ask-tab-email" type="text" name="sSender" class="input" value="{{$_SESSION.sUserEmail}}" size="20" /></td>
										</tr><tr>
											<th><label for="ask-tab-phone">{{$lang.Your_phone}}</label>:</th>
											<td><input id="ask-tab-phone" type="tel" name="sPhone" class="input" value="{{$_SESSION.sUserPhone}}" /></td>
										</tr><tr>
											<th><label for="ask-tab-content">{{$lang.Your_question}}</label>:</th>
											<td><textarea id="ask-tab-content" name="sMailContent" cols="30" rows="4"></textarea></td>
										</tr>
										<tr>
											<td colspan="2" class="buttons"><input id="sSubmitAskAboutProduct" name="sSubmitAskAboutProduct" type="submit" value="{{$lang.send}}" class="submit submit-styled reCaptcha" /></td>
										</tr>
									</table>
								</fieldset>
							</form>
						{{elseif $aTab@key == 'comments'}}
							{{if count( $aProduct.aComments.aList ) > 0}}
								<ul class="products-comments comments">
									{{foreach from=$aProduct.aComments.aList item=aComment}}
										<li>
											<p class="comment-content">{{$aComment.sContent}}</p>
											{{if !empty( $aComment.iRating )}}
												<p class="comment-rate"><span class="value rating{{$lang.Rate}}"></span><span class="description">{{$lang.Rate}}: <span>{{$aComment.iRating}}</span></span></p>
											{{/if}}
											<p class="comment-author">{{$aComment.sName}}, <span class="date">{{$aComment.sDate}}</span></p>
										</li>
									{{/foreach}}
								</ul>
							{{/if}}
							<script type="text/javascript">
								$(document).ready(function(){
									$("form#products-comment").validate();
									$("form#products-comment input#comment-name").rules("add", {required: true, minlength: 2});
									$("form#products-comment textarea#comment-content").rules("add", {required: true});
								});
							</script>
							<form action="{{$aProduct.sLinkName}}" method="post" id="products-comment" class="products-comment form-styled">
								<fieldset>
									<input type="hidden" name="sOption" value="saveComment" />

									<label>{{$lang.Name_and_surname}}: <input type="text" name="sName" class="input" value="{{$_SESSION.sUserName}}" id="comment-name" /></label>
									<label>{{$lang.Comment_content}}: <textarea name="sContent" id="comment-content" class="textarea" cols="30" rows="5"></textarea></label>
									<span style="margin: 0 5px 0 10px;">{{$lang.Rating}}:</span>
									<label id="rating-wrapper" style="width: 98px; height: 18px; display: inline-block; vertical-align: middle; padding: 5px; margin-left: 5px;">
										<select name="iRating" id="comment-rating" class="select">
											<option value="0" id="rating0" selected="selected">{{$lang.No_rating}}</option>
											<option value="1" id="rating1">1</option>
											<option value="2" id="rating2">2</option>
											<option value="3" id="rating3">3</option>
											<option value="4" id="rating4">4</option>
											<option value="5" id="rating5">5</option>
										</select>
									</label>
									<label class="comment-rate-current clear">{{$lang.Average}}: {{round( $aProduct.aComments.fRating, 2 )}}</label>
									<input id="comment-rate-submit" type="submit" value="{{$lang.Add_comment}}" class="submit submit-styled reCaptcha" />
								</fieldset>
							</form>
						{{elseif $aTab@key == 'recommend'}}
							<script type="text/javascript">
								$(document).ready(function(){
									$("form#product-recommend").validate();
									$("form#product-recommend input#recommend-name").rules("add", {required: true, minlength: 2});
									$("form#product-recommend input#recommend-email").rules("add", {required: true, email: true});
									$("form#product-recommend textarea#recommend-content").rules("add", {required: true});
								});
							</script>
							<form action="{{$aProduct.sLinkName}}" method="post" id="product-recommend" class="form-styled">
								<fieldset>
									<input type="hidden" name="sOption" value="sendRecommendation" />
									<table cellspacing="0">
										<tr>
											<th><label for="recommend-name">{{$lang.Name_and_surname}}</label>:</th>
											<td><input id="recommend-name" type="text" name="sName" class="input" value="{{$_SESSION.sUserName}}" /></td>
										</tr><tr>
											<th><label for="recommend-email">{{$lang.Recommend_email}}</label>:</th>
											<td><input id="recommend-email" type="text" name="sEmail" class="input" /></td>
										</tr><tr>
											<th><label for="recommend-content">{{$lang.Recommendation_content}}</label>:</th>
											<td><textarea id="recommend-content" name="sContent" cols="30" rows="4"></textarea></td>
										</tr>
										<tr>
											<td colspan="2" class="buttons"><input name="sSubmitRecommend" id="sSubmitRecommend" type="submit" value="{{$lang.send}}" class="submit submit-styled reCaptcha" /></td>
										</tr>
									</table>
								</fieldset>
							</form>
						{{elseif $aTab@key == 'error'}}
							<script type="text/javascript">
								$(document).ready(function(){
									$("form#product-error").validate();
									$("form#product-error input#product-error-name").rules("add", {minlength: 2});
									$("form#product-error input#product-error-email").rules("add", {email: true});
									$("form#product-error textarea#product-error-content").rules("add", {required: true});
								});
							</script>
							<form action="" method="post" id="product-error" class="form-styled">
								<fieldset>
									<input type="hidden" name="sOption" value="sendProductError" />
									<table>
										<tr>
											<th><label for="product-error-name">{{$lang.Name_and_surname}}</label>:</th>
											<td><input id="product-error-name" type="text" name="sName" class="input" value="{{$_SESSION.sUserName}}"/></td>
										</tr><tr>
											<th><label for="product-error-email">{{$lang.Your_email}}</label>:</th>
											<td><input type="text" name="sSender" class="input" id="product-error-email" value="{{$_SESSION.sUserEmail}}" size="20" /></td>
										</tr><tr>
											<th><label for="product-error-content">{{$lang.Error_description}}</label>:</th>
											<td><textarea name="sMailContent" id="product-error-content" cols="30" rows="4"></textarea></td>
										</tr>
										<tr>
											<td colspan="2" class="buttons"><input name="sSubmitProductError" id="sSubmitProductError" type="submit" value="{{$lang.send}}" class="submit submit-styled reCaptcha" /></td>
										</tr>
									</table>
								</fieldset>
							</form>
						{{/if}}
					{{/if}}
					{{if $aTab@key == 'description'}}
						{{if !empty( $aProduct.aTags )}}<div class="tags">Tagi: {{foreach from=$aProduct.aTags item=sTag}}<a href="{{$sLinkSearch}}?sPhrase=&amp;sTag={{str_replace( ' ', '_', $sTag )}}">{{$sTag}}</a> {{/foreach}}</div>{{/if}}
					{{/if}}
				<div class="clear"></div>
				</div>
			{{/foreach}}
		</div>
	{{/if}}

	{{$aFiles.8}}
	{{$aFiles.9}}
	{{$aFiles.1}}

	{{$cl=true}}
	{{foreach from=$aProduct.aRelated item=aRelated}}
		{{if !empty( $aRelated.aList )}}
			{{if $aRelated.iWidthType == 100}}
				{{$cl=true}}
			{{else}}
				{{if $cl}}
					<div class="clear"></div>
					{{$cl=false}}
				{{else}}
					{{$cl=true}}
				{{/if}}
			{{/if}}
			<div class="block{{$aRelated.iWidthType}}">
				{{if !empty( $aRelated.sTitle )}}<h2>{{$aRelated.sTitle}}</h2>{{/if}}
		
		
				{{include file='products_list.tpl' aBlock=['iElement' => $aRelated@iteration, 'sType' => 'HL', 'sProductsShow' => $aRelated.sProductsShow, 'aProducts' => $aRelated, 'bExtras' => true]}}
			</div>
		{{/if}}
	{{/foreach}}
</div>