<?php
$svg = '';
if( $this->useSVG && file_exists(TL_ROOT.'/'.$this->singleSRC) && strtolower( pathinfo($this->singleSRC, PATHINFO_EXTENSION) ) == 'svg' )
{
	$svg = file_get_contents(TL_ROOT.'/'.$this->singleSRC);
}
?>

<?php if($this->href): ?>
<a class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?> href="<?php echo $this->href; ?>"<?php if ($this->linkTitle): ?> title="<?php echo $this->linkTitle; ?>"<?php endif; ?><?php echo $this->attributes; ?>>
<?php else: ?>	
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php endif; ?>
	<?php if(strlen($svg) > 0): ?>
	
	<?= $svg; ?>
	<img id="rs_image_<?= $this->id; ?>" src="<?= $this->src; ?>" class="hidden tp-resizeme">
	<script>
	/* <![CDATA[ */

	jQuery(window).bind('ready resize', function() 
	{
		var img = jQuery('#rs_image_<?= $this->id; ?>');
		jQuery('#rs_image_<?= $this->id; ?>').siblings('svg').height( img.height() ) ;
		jQuery('#rs_image_<?= $this->id; ?>').siblings('svg').width( img.width() ) ;
	});

	/* ]]> */
	</script>

	<?php else: ?>
	<?php $this->insert('picture_default', $this->picture); ?>
	<?php endif; ?>
<?php if($this->href): ?>
</a>
<?php else: ?>	
</div>
<?php endif; ?>