<div class="shell">
	<section class="sectionHomePlan">
		<?php
		if(isset($tpl['arr']))
		{
			
			$floorlan = $tpl['arr']['image'];
			$floorlan_size = getimagesize($floorlan);
			
			?>
			<div class="sectionBody" style="height: <?php echo $floorlan_size[1];?>px;">
				<div class="plan" style="height: <?php echo $floorlan_size[1];?>px; width:<?php echo $floorlan_size[0];?>px; margin-left: 0px; margin:0 auto;">
					<img src="<?php echo PJ_INSTALL_URL . $tpl['arr']['image'];?>" class="planImage" alt="" />
					
					<?php
					if(count($tpl['camera_arr']) > 0)
					{
						$map = array(
							'top_right' => ' cameraImageTopRight',
							'top_center' => ' cameraImageTopCenter',
							'top_left' => ' cameraImageTopLeft',
							'bottom_right' => ' cameraImageBottomRight',
							'bottom_center' => ' cameraImageBottomCenter',
							'bottom_left' => ' cameraImageBottomLeft'
						);
						?>
						<ul class="cameras">
							<?php
							foreach($tpl['camera_arr'] as $v)
							{
								$gallery = array();
								if(isset($tpl['gallery_arr'][$v['image_id']]))
								{
									$gallery = $tpl['gallery_arr'][$v['image_id']];
								}
								$size = $v['width'];
								$left_top = ($size - (round($size / 4))) / 2;
								?>
								<li class="camera" id="camera<?php echo $v['id']?>" style="top:<?php echo $v['top'];?>px;left:<?php echo $v['left'];?>px;width:<?php echo $v['width'];?>px;height:<?php echo $v['height'];?>px;">
									<?php
									if(!empty($gallery))
									{ 
										?>
										<a href="<?php echo PJ_INSTALL_URL . $gallery['large_path'];?>" data-medium="<?php echo PJ_INSTALL_URL . $gallery['medium_path'];?>" class="popupTrigger" style="top: <?php echo $left_top; ?>px; left: <?php echo $left_top; ?>px;">
											<div class="cameraImage<?php echo $map[$v['position']];?>">
												<img src="<?php echo PJ_INSTALL_URL . $gallery['medium_path'];?>" alt="" />
											</div><!-- /.cameraImage cameraImageTopRight -->
										</a>
										<?php
									} 
									?>
		
									<div class="cameraIcon">
										<img src="<?php echo PJ_INSTALL_URL ?>app/web/img/frontend/camera-image-1.png" alt="" style="transform: rotate(<?php echo $v['deg'];?>deg);"/>
									</div><!-- /.cameraIcon -->
								</li><!-- /#camera1.camera -->
								<?php
							} 
							?>
						</ul>
						<?php
					}
					if(count($tpl['info_arr']) > 0)
					{
						?>
						<ul class="roomsInfos">
							<?php
							foreach($tpl['info_arr'] as $v)
							{
								$left = '-80px';
								$_left = $v['left'];
								if($_left < 80)
								{
									$left = '0px';
								}else if(($_left + 100) > $floorlan_size[0]){
									$left = '-160px';
								}
								?>
								<li class="roomInfo" id="roomInfo<?php echo $v['id'];?>" data-height="<?php echo $floorlan_size[1];?>" data-width="<?php echo $floorlan_size[0];?>" style="top:<?php echo $v['top'];?>px;left:<?php echo $v['left'];?>px;">
									<a href="#">
										<i class="ico icoInfo"></i>
										<?php
										if($v['title'] != '' || $v['size'] != '' || $v['dimensions'] != '' || $v['info'] != '')
										{  
											?>
											<div class="roomInfoInner" style="width:200px;left:<?php echo $left;?>">
												<p class="roomInfoTitle"><?php echo pjSanitize::html($v['title']);?></p><!-- /.roomInfoTitle -->
												<?php
												if($v['size'] != '' || $v['dimensions'] != '') 
												{
													?>
													<ul class="roomInfoMeta">
														<?php
														if($v['size'] != '')
														{
															?>
															<li>
																<dl>
																	<dt><?php __('front_size');?></dt>
																	<dd><?php echo pjSanitize::html($v['size']);?></dd>
																</dl>
															</li>
															<?php
														}
														if($v['dimensions'] != '')
														{
															?>
															<li>
																<dl>
																	<dt><?php __('front_dimensions');?></dt>
																	<dd><?php echo pjSanitize::html($v['dimensions']);?></dd>
																</dl>
															</li>
															<?php
														} 
														?>
													</ul><!-- /.roomInfoMeta -->
													<?php
												}
												if($v['info'] != '')
												{ 
													?>
													<p><?php echo stripslashes(nl2br($v['info']));?></p>
													<?php
												} 
												?>
											</div><!-- /.roomInfoInner -->
											<?php
										} 
										?>
									</a>
								</li><!-- /#roomInfo1.roomInfo -->
								<?php
							}
							?>
						</ul>
						<?php
					} 
					?>
				</div><!-- /.plan -->
			</div><!-- /.sectionBody -->
			<?php
			if(!empty($tpl['image_arr']))
			{ 
				?>
				<footer class="sectionFoot">
					<div class="slider sliderThumbs">
						<div class="sliderClip">
							<ul class="slides">
								<?php
								foreach($tpl['image_arr'] as $v)
								{
									?>
									<li class="slide">
										<a href="<?php echo PJ_INSTALL_URL . $v['large_path'];?>" class="thumb popupTrigger" data-imageGroup="popupSlider">
											<div class="thumbImage">
												<img src="<?php echo PJ_INSTALL_URL . $v['medium_path'];?>" alt="" />
											</div><!-- /.thumbImage -->
										</a>
									</li><!-- /.slide -->
									<?php
								} 
								?>
							</ul><!-- /.slides -->
						</div><!-- /.sliderClip -->
		
						<div class="sliderControls">
							<a href="#" class="sliderPrev">&#60;</a>
							<a href="#" class="sliderNext">&#62;</a>
						</div><!-- /.sliderControls -->
					</div><!-- /.slider sliderThumbs -->
				</footer><!-- /.sectionFoot -->
				<?php
			}
		}else{
			__('front_floorplan_not_exist');
		} 
		?>
	</section></section><!-- /.sectionHomePlan -->
</div>