					
				<?php if( $this->rowProduct['product_body'] == 1 ){ ?>
					<div class="configuratorMenuElement" data-field="bodyBox"><?php if( $this->ProductFieldnameInfo['product_fieldname_body'] != '' ) echo $this->ProductFieldnameInfo['product_fieldname_body']; else echo @Lib_Lang::translate(front_configurator_body); ?><div class="configuratorMenuElementZR"><?php echo @Lib_Lang::translate(front_configurator_zr); ?></div></div>
					
					
					
				<div class="configuratorDiv">
				<?php if( $this->rowProduct['product_body'] == 1 ){ ?>
					<div class="configuratorDivElement" id="bodyBox">
						<h4><?php if( $this->ProductFieldnameInfo['product_fieldname_body'] != '' ) echo $this->ProductFieldnameInfo['product_fieldname_body']; else echo @Lib_Lang::translate(front_configurator_body); ?></h4>						
					
					
					<script type="text/javascript" language="javascript">

						$(document).ready(function () {
					
							$(".elementItemBody").click(function(){
								$(".elementItemBody").removeClass('activ');
								$(this).addClass('activ');	
								
							});
					
							$(".elementItemBody").hover(function(){	
								var kids = $(this).children('.elementItemBodyCloud');
								$(kids).show();
							},function(){
								var kids = $(this).children('.elementItemBodyCloud');
								$(kids).hide();
							});
					
							$(".elementItemBody1").click(function(){
								$(".elementItemBody1").removeClass('activ');
								$(this).addClass('activ');	
								
							});
					
							$(".elementItemBody1").hover(function(){	
								var kids = $(this).children('.elementItemBodyCloud');
								$(kids).show();
							},function(){
								var kids = $(this).children('.elementItemBodyCloud');
								$(kids).hide();
							});
					
							$(".elementItemRim").click(function(){
								$(".elementItemRim").removeClass('activ');
								$(this).addClass('activ');	
								
							});
							

	
	function filtrChange(){
		var f = $('[name="bodyType"] option:selected').val();		
		var fl = $('[name="bodyType"] option:selected').attr('filtrlist');
		
		$('.filtrbodytype').hide();
		var res = fl.split(",");
		for ( i = 0; i < res.length; i++ ) {
			$('.filtrbodytype.option'+res[i]).show();
		}
		$('.filtrbodytype.optionall').show();
				
		$('.elementItemBody').hide();
		$('.elementItemBody[cmd*="typ'+f+',"]').show();

		if( f == 0 ){
			$('.obrzezeDiv').show();
		}else{		
			$('.obrzezeDiv').hide();					
		}
	}
	
							filtrChange();
							
							$('[name="bodyType"]').change(function(){
							
								filtrChange();
								
								var idProduct = <?php echo$this->idProduct;?>;
								var product_field = 'body_filtr';
								var product_value = $(this).val();
								
								$( "#shopProduct" ).load( "<?php echo $this->url(array('controller' => 'product', 'action' => 'productshop'), 'default', true); ?>", {product_id: idProduct, product_field: product_field, product_value: product_value}, function(){$('#productTable').load( "<?php echo $this->url(array('controller' => 'product', 'action' => 'productshoptable'), 'default', true); ?>", {product_id: <?php echo$this->idProduct; ?>}, function(){} );} );
							
							});
							
							
							$('.filtrbodytype').click(function(){
								var f = $('[name="bodyType"] option:selected').val();
								var option = $(this).attr('data-field');
								$('.elementItemBody').hide();
								if( option == 'optionall' ){	
									$('.elementItemBody[cmd*="typ'+f+',"]').show();
								}else{
									$('.elementItemBody[cmd*="typ'+f+',"][cmd*="'+option+',"]').show();
								}
							});
							
							
							$('.aFiltrBody2Type').click(function(){
								var v = $(this).attr('c');
								$('[name="bodyType"] option').prop('selected',false);
								$('[name="bodyType"] option[value="'+v+'"]').prop('selected',true);
								
								$('.aFiltrBody2Type').removeClass('selected');
								$(this).addClass('selected');
								
								$('[name="bodyType"]').click();
								$('[name="bodyType"]').change();
							});
							
							
						});

					</script>	
					
					
						<div class="row" style="margin:5px;"><?php echo @Lib_Lang::translate(front_configurator_bodydesc); ?></div>
					
						<div class="row text-right" style="margin:10px;">
							<?php echo @Lib_Lang::translate(front_configurator_bodytypetext); ?>
							<select class="selectFiltrBodyType" name="bodyType" style="width:100%;display:none;">
							<?php foreach ($this->dataTableMapFiltrBody as $key => $val): ?>
								<option filtrlist="<?php echo Lib_Product::mapbody($val); ?>" value="<?php echo$val['map_filtr_body_index']; ?>" <?php if( $this->dataSelect['body_filtr'] == $val['map_filtr_body_index'] ) echo'selected'; ?>><?php echo @Lib_Lang::translate(front_configurator_bodytype.$val['map_filtr_body_index']); ?></option>
							<?php endforeach; ?>
							</select>
							
							<?php foreach ($this->dataTableMapFiltrBody as $key => $val): ?>
								<a class="aFiltrBody2Type <?php if( $this->dataSelect['body_filtr'] == $val['map_filtr_body_index'] )echo'selected'; ?>" c="<?php echo$val['map_filtr_body_index']; ?>"><?php echo @Lib_Lang::translate(front_configurator_bodytype.$val['map_filtr_body_index']); ?></a>
							<?php endforeach; ?>							
						
						</div>
						
						<div class="row" style="text-align:center;background-color:#9bc335;margin:5px;padding:10px;">
						
							<a href="javascript:void(0);" class="filtrbodytype optionall" data-field="optionall"><?php echo @Lib_Lang::translate(front_configurator_body_option_all); ?></a>
						
							<?php for( $i=1; $i<=8; $i++ ){ ?>
							<a href="javascript:void(0);" class="filtrbodytype option<?php echo$i; ?>" data-field="opt<?php echo$i; ?>" c="<?php echo$i; ?>"><?php echo @Lib_Lang::translate(front_configurator_body_option.$i); ?></a>
							<?php } ?>
						
						</div>
					
						<div class="row" style="margin:5px;overflow-y:scroll;max-height:575px;">
						<?php if( count($this->dataBody) > 0 ){ ?>
						<?php foreach ($this->dataBody as $key => $val): ?>
						
						<div class="elementItem elementItemBody<?php if($val['product_body_id']==$this->dataSelect['product_body_id'])echo' activ';?>" cmd="<?php echo Lib_Product::mapproductbody($val);?>" data-field="product_body_id" data-value="<?php echo$val['product_body_id']; ?>">
							<?php if( $val['product_body_image'] ){ ?>
								<div style="background: url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/body/<?php echo$val['product_body_image']; ?>.jpeg');background-repeat: no-repeat;background-size:cover;background-position:center;width:100%;height: 95px;margin-bottom:3px;"></div>
							<?php }else{ ?>			
								<div style="width:100%;height: 95px;margin-bottom:3px;">
								</div>
							<?php } ?>
							<center><?php echo @Lib_Lang::consta(product_bodyname_.$val['product_body_id']); ?></center>
							<div class="elementItemBodyCloud">
							
							<?php if( $val['product_body_image'] ){ ?>
								<div style="background: url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/body/<?php echo$val['product_body_image']; ?>.jpeg');background-repeat: no-repeat;background-size:cover;background-position:center;width:100%;height: 250px;margin-bottom:3px;"></div>
							<?php }else{ ?>			
								<div style="width:100%;height: 250px;margin-bottom:3px;">
								</div>
							<?php } ?>
							
							<div style="content: ''; position: absolute; width: 0; height: 0; border: 15px solid;border-color: transparent; border-right-color: #464646; top: 25px; right: 100%; margin-top: -15px;"></div>
							
							
							<div style="padding:5px;">								
								<center><h4><?php echo @Lib_Lang::consta(product_bodyname_.$val['product_body_id']); ?></h4></center>
								<?php echo @Lib_Lang::consta(product_bodydescription_.$val['product_body_id']); ?>
							</div>
							
							</div>
						</div>
						
						<?php endforeach; ?>
						<?php }else{ ?>
						<center><?php echo @Lib_Lang::translate(front_element_list_0); ?></center>
						<?php } ?>	
						</div>

					<?php 
						if(
							$this->rowProduct['product_rim1'] == 1 OR
							$this->rowProduct['product_rim2'] == 1 OR
							$this->rowProduct['product_rim3'] == 1 OR
							$this->rowProduct['product_rim4'] == 1
						){
					?>
						<div class="obrzezeDiv" style="display:none;">
						<div class="row" style="background-color:#ccc;margin:5px;padding:10px;">
							<b><?php echo @Lib_Lang::translate(front_configurator_bodyrimtext); ?></b>						
						</div>						
						<div class="row" style="margin:5px;">
						
						<?php if( $this->rowProduct['product_rim1'] == 1 ){ ?>
							<div class="elementItem elementItemRim<?php if( $this->dataSelect['product_rim_id'] == 1 )echo' activ';?>" data-field="product_rim_id" data-value="1"><?php echo @Lib_Lang::translate(front_configurator_body_rim1); ?></div>
						<?php } ?>
						
						<?php if( $this->rowProduct['product_rim2'] == 1 ){ ?>
							<div class="elementItem elementItemRim<?php if( $this->dataSelect['product_rim_id'] == 2 )echo' activ';?>" data-field="product_rim_id" data-value="2"><?php echo @Lib_Lang::translate(front_configurator_body_rim2); ?></div>
						<?php } ?>
						
						<?php if( $this->rowProduct['product_rim3'] == 1 ){ ?>
							<div class="elementItem elementItemRim<?php if( $this->dataSelect['product_rim_id'] == 3 )echo' activ';?>" data-field="product_rim_id" data-value="3"><?php echo @Lib_Lang::translate(front_configurator_body_rim3); ?></div>
						<?php } ?>
						
						<?php if( $this->rowProduct['product_rim4'] == 1 ){ ?>
							<div class="elementItem elementItemRim<?php if( $this->dataSelect['product_rim_id'] == 4 )echo' activ';?>" data-field="product_rim_id" data-value="4"><?php echo @Lib_Lang::translate(front_configurator_body_rim4); ?></div>
						<?php } ?>
						
						
						</div>
						</div>
					<?php } ?>
					<div class="row" style="background-color:#ccc;margin:5px;padding:10px;">
						<b><?php echo @Lib_Lang::translate(front_configurator_body2text); ?></b>						
					</div>
					
						<div class="row" style="margin:5px;">
						<?php if( count($this->dataBody2) > 0 ){ ?>
						<?php foreach ($this->dataBody2 as $key => $val): ?>
						
						<div class="elementItem elementItemBody1<?php if($val['product_body_id']==$this->dataSelect['product_body2_id'])echo' activ';?>" data-field="product_body2_id" data-value="<?php echo$val['product_body_id']; ?>">
							<?php if( $val['product_body_image'] ){ ?>
								<div style="background: url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/body/<?php echo$val['product_body_image']; ?>.jpeg');background-repeat: no-repeat;background-size:cover;background-position:center;width:100%;height: 95px;margin-bottom:3px;"></div>
							<?php }else{ ?>			
								<div style="width:100%;height: 95px;margin-bottom:3px;">
								</div>
							<?php } ?>
							<center><?php echo @Lib_Lang::consta(product_bodyname_.$val['product_body_id']); ?></center>
							<div class="elementItemBodyCloud" style="display:none;position:relative;top:-100px;left:95px;background-color:#fff;border:3px solid #464646;width:300px;z-index:9999;">
							
							<?php if( $val['product_body_image'] ){ ?>
								<div style="background: url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/body/<?php echo$val['product_body_image']; ?>.jpeg');background-repeat: no-repeat;background-size:cover;background-position:center;width:100%;height: 250px;margin-bottom:3px;"></div>
							<?php }else{ ?>			
								<div style="width:100%;height: 250px;margin-bottom:3px;">
								</div>
							<?php } ?>
							
							<div style="content: ''; position: absolute; width: 0; height: 0; border: 15px solid;border-color: transparent; border-right-color: #464646; top: 25px; right: 100%; margin-top: -15px;"></div>
							
							
							<div style="padding:5px;">								
								<center><h4><?php echo @Lib_Lang::consta(product_bodyname_.$val['product_body_id']); ?></h4></center>
								<?php echo @Lib_Lang::consta(product_bodydescription_.$val['product_body_id']); ?>
							</div>
							
							</div>
						</div>
						
						<?php endforeach; ?>
						<?php }else{ ?>
						<center><?php echo @Lib_Lang::translate(front_element_list_0); ?></center>
						<?php } ?>	
						</div>

						
					</div>
				<?php } ?>
				</div>




				
					
					
				<?php } ?>