<?php
/* Droconut SLIDERS v1.3; Droconut - Dropping Coconut KG
http://www.droconut.com 
Support: office@droconut.com

Copyright 2012, Attila Santo (Dropping Coconut KG) */
?>
<div class="slideshow">
  <div id="droco_slideshow<?php echo $module; ?>" style="width:<?php echo $width; ?>px;height:<?php echo $height; ?>px;overflow:hidden">
<?php foreach ($banners as $key => $banner) { ?>
<?php if ($banner['link']) { ?>
	<div style="position:relative;<?php if ($slideWidth) {echo "width:$slideWidth;overflow:hidden";} ?>">
		<div class="bxSliderImage">
			<a href="<?php echo $banner['link']; ?>">
				<img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" title="<?php echo $banner['title']; ?>"  />
			</a>
		</div>
		<div class="bxSliderText">
			<?php echo $banner['caption']."\n"; ?>
		</div>
	</div>
<?php } else { ?>
	<div style="position:relative;<?php if ($slideWidth) {echo "width:$slideWidth;overflow:hidden";} ?>">
		<div class="bxSliderImage">
			<img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" title="<?php echo $banner['title']; ?>" width="<?php echo $width;?>px" height="<?php echo $height;?>px" />
		</div>
		<div class="bxSliderText">
			<?php echo $banner['caption']."\n"; ?>
		</div>
	</div>
<?php } ?>
<?php } ?>
  </div>
</div>
<style>
	.bxSliderImage {<?php if ($slideCSSImg) {echo $slideCSSImg;} ?>}
	.bxSliderText {<?php if ($slideCSSTxt) {echo $slideCSSTxt;} ?>}
</style>
<script type="text/javascript">
$(document).ready(function() {
	$('#droco_slideshow<?php echo $module; ?>').bxSlider({
<?php $i=0;
foreach ($preferences as $key => $value) {
	if(!empty($value)) {
		if($i!=0){echo ",\n";}
			if(is_array($value)) {echo "\t\t$key: '" . implode(', ', $value) . "'";}
			else if(is_numeric($value)) {echo "\t\t$key: $value";}
			else if(in_array($value, array("true","false"))) {echo "\t\t$key: $value";}
			else if(substr($value, -1) == "}") {echo "\t\t$key: $value";}
			else {echo "\t\t$key: '$value'";}
		$i++;
	};
}; echo "\n";?>
	});
});
</script>