<?php global $modules, $images, $images_files, $id, $images_dir, $system_data, $template_data; ?>

<?php if(isset($images)) { ?>
	<div class="image-set" id="image-set-<?php echo $id; ?>">
   		<?php foreach($images as $image) { ?>
   			<div class="image">
				<?php if($module_settings["image-set"]["open image"] != 'disabled') { ?><a <?php echo $module_settings["image-set"]["open image attribute"]; ?> href="<?php echo $image['path']; ?>"><?php } ?>
	    			<img src="<?php echo $image['path']; ?>" width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" style="-ms-interpolation-mode: bicubic" alt="<?php echo strip_tags($image['description']) == '' ? $image['basename'] : strip_tags($image['description']); ?>" title="<?php echo strip_tags($image['title']); ?>">
	    		<?php if($module_settings["image-set"]["open image"] != 'disabled') { ?></a><?php } ?>
		    </div>
   		<?php } ?>
    </div>
	
	<?php if($module_settings["image-set"]["open image"] != 'disabled') { ?>
		<!-- JS ACTIONS -->
		<script type="text/javascript">
	    	// Global data
	    	var pagemapImages = [];
	    	
	    	<?php if(isset($images)) foreach($images as $image) { ?>
	    		pagemapImages['<?php echo $image['basename']; ?>'] = {
	    			'basename' : '<?php echo $image['basename']; ?>',
	    			'width' : '<?php echo trim($image['width']); ?>',
	    			'height' : '<?php echo trim($image['height']); ?>'
	    		};
	    	<?php } ?>
	    		
	    	eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8 e=f(a){8 b;3(4.9){b=(a==\'5\')?4.9:4.g}c 3(1.2&&1.2.6){b=(a==\'5\')?1.2.6:1.2.d}c 3(1.7){b=(a==\'5\')?1.7.6:1.7.d}h(b<0)?0:b};',18,18,'|document|documentElement|if|self|width|clientWidth|body|var|innerWidth|||else|clientHeight|innerSize|function|innerHeight|return'.split('|'),0,{}));
	    	
	    	var imagesPath = '<?php echo $images_dir; ?>';
	    	var showImageProperties = <?php echo $module_settings["image-set"]["image properties"]; ?>;
	
	    	var maxWidth = parseInt(<?php echo $module_settings["image-set"]["image properties"] == 0 ? 'innerSize("width")' : $module_settings["image-set"]["popup width"]; ?>);
	    	var maxHeight = parseInt(<?php echo $module_settings["image-set"]["image properties"] == 0 ? 'innerSize("height")' : $module_settings["image-set"]["popup height"]; ?>);
	    	
	    	var popupWidth = <?php echo $module_settings["image-set"]["popup width"]; ?>;
	    	var popupHeight = <?php echo $module_settings["image-set"]["popup height"]; ?>;

			var popupPath = '<?php echo is_file(get_module_path('image-set') . 'popup.php') ? get_module_path('image-set') : $system_data['folder']['modules'] . 'image-set/'; ?>popup.php';
	    </script>

		<script type="text/javascript" src="<?php echo $system_data['folder']['modules']; ?>image-set/sources/actions.js">
		</script>
	<?php } ?>
<?php } ?>