<?php if (get_option('disable_slider', 1) == '1') : ?>
<!-- begin banner -->
<div class="banner" style="height:<?php echo get_option('slider_height', '300'); ?>px;" class="clearfix">
		
		<div class="slider_mask_top"></div><!-- slider top corners effect --> 
		
		<!-- begin slider content -->
		<div class="slider_content">
			
			<!-- begin slider items -->
			<div id="slideshow" class="sliders_full">
				<?php
				
					global $wpdb;
					$table_name = $wpdb->prefix . "deluxe_slider"; // select the slider database!
					
					if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
						include (TEMPLATEPATH . '/includes/get_database.php');
					}
					
					$slider_datas = $wpdb->get_results("SELECT * FROM $table_name ORDER BY orderby");
					$check = 0;
					foreach ($slider_datas as $data) {
					
					$type = $data->src;
					$type =  substr($type, -4);
					if($type == ".jpg" or $type == ".gif" or $type == ".png" or $type == ".jpeg" or $type == ".JPG" or $type == ".GIF" or $type == ".PNG" or $type == ".JPEG"){
				?>
				<div class="slider_item" style="background:url(<?php echo $data->src;?>) center no-repeat; height:<?php echo get_option('slider_height', '300'); ?>px; <?php if($check > 0){ echo "display:none;"; } ?>"><?php if($data->url) { ?><a href="<?php echo $data->url;?>" target="<?php if($data->target) { echo $data->target; } else { echo "_self"; } ;?>"></a><?php } ?></div>
				<?php 
				
				} else { 
				
					echo $data->src; 
				
				}
				
				$check++; } ?>
				
				<?php if($check == 0){	?>
					<div class="slider_item" style="background-color:#000; height:<?php echo get_option('slider_height', '300'); ?>px;"></div>
				<?php } ?>
				
			</div>
			<!-- end slider items -->
		
		</div>
		<!-- end slider content -->
		
		<?php if($check > 1){ ?>
		<!-- begin slider buttons -->
		<div class="slider_nav" style="margin-top:-50px; position:absolute;">
		
			<div id="nav">
					<ul id="recentimages">
						<?php foreach ($slider_datas as $data) { ?>
						<li class="recentimages"></li>
						<?php } ?>
					</ul>
		  </div>
		  
		</div>
		<!-- end slider buttons -->
		<?php } ?>
		
		<div class="slider_mask_bottom"></div><!-- slider bottom corners effect --> 
</div>
<!-- end banner -->
<?php endif; ?>