<?php foreach ($adv_banners as $adv_banner): ?>
	<?php $src = @$adv_banner['link'] ?>
	<?php $width = @$adv_banner['width'] ?>
	<?php $height = @$adv_banner['height'] ?>
	<?php $gap = @$adv_banner['gap'] ?>
	<?php if ($gap): ?>
		<?php $gap = explode(',', $gap); ?>
		<?php $left = $gap[0]; ?>
		<?php $top = $gap[1]; ?>
	<?php else: ?>
		<?php $left = 10 ?>
		<?php $top = 0 ?>
	<?php endif ?>
	<?php if (!$width) $width = 500; ?>
	<?php if (!$height) $height = 430; ?>


	<style>#clink, #clink:link, #clink:visited, #click:hover, #clink:active {color: red}</style>
	<div id="previewad" style="margin-left: <?php echo $left?>px; margin-top: <?php echo $top ?>px; position: absolute; width: <?php echo $width ?>px; height: <?php echo $height ?>px; z-index: 100">
        <?php /*
	   <a id="clink" style="margin-left:<?php echo $width-70 ?>px; margin-top:10px; position: absolute" onclick="document.getElementById('previewad').style.display='none'; return false;" href="#">Close (x)</a>
        */ ?>
	   <a id="clink" style="margin-left:<?php echo $width-27 ?>px; margin-top:10px; position: absolute" onclick="document.getElementById('previewad').style.display='none'; return false;" href="#"><img src="/images/close.png"/></a>
	   <iframe scrolling="no" src="<?php echo $src ?>" width="<?php echo $width+4 ?>" height="<?php echo $height ?>" style="border:none"></iframe>
	</div>
<?php endforeach ?>
