<?php $bauen_options = get_option('bauen'); ?>

	<?php if(get_post_meta($post->ID,'bauen_fullscreen_slider_speed',true)):?>
	<?php $bauen_slider_speed = get_post_meta($post->ID,'bauen_fullscreen_slider_speed',true);?>
	<?php else: ?>
	<?php $bauen_slider_speed = '5000';?>
	<?php endif;?>	

	<!-- Slider -->
	<header class="header slider-fade full-screen-slider" data-scroll-index="0">
		<div class="owl-carousel owl-theme" data-speed="<?php echo esc_attr($bauen_slider_speed);?>">
		    <?php if( function_exists( 'rwmb_meta' ) ) { ?> 
			<?php
			$bauen_fullscreen_slider = rwmb_meta( 'bauen_fullscreen_slider_opt' );
			if ( ! empty( $bauen_fullscreen_slider ) ) {
			foreach ( $bauen_fullscreen_slider as $bauen_fullscreen_sliders ) { ;?>
			
			<?php $bauen_fullscreen_slider_title = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_title_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_title_opt'] : ''; ?>
			
			<?php $bauen_fullscreen_slider_title_tag = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_title_tag_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_title_tag_opt'] : ''; ?>
			
			<?php $bauen_fullscreen_slider_subtitle = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_sub_title_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_sub_title_opt'] : ''; ?>
			
			<?php $bauen_fullscreen_slider_buttontxt = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_buttontxt_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_buttontxt_opt'] : ''; ?>
			
			<?php $bauen_fullscreen_slider_buttonurl = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_buttonurl_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_buttonurl_opt'] : ''; ?>
			
			<?php $bauen_fullscreen_slider_button_target = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_button_target_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_button_target_opt'] : ''; ?>	
			
			<?php $bauen_fullscreen_slider_overlay = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_slider_overlay_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_slider_overlay_opt'] : ''; ?>		
			
			<?php $bauen_fullscreen_slider_img_ids = isset( $bauen_fullscreen_sliders['bauen_fullscreen_slider_img_id_opt'] ) ? $bauen_fullscreen_sliders['bauen_fullscreen_slider_img_id_opt'] : array();
			foreach ( $bauen_fullscreen_slider_img_ids as $bauen_fullscreen_slider_img_id ) {
			$bauen_image = RWMB_Image_Field::file_info( $bauen_fullscreen_slider_img_id, array( 'size' => '' ) ); ?>
			
			<div class="text-left item bg-img" data-overlay-dark="<?php if ( !empty( $bauen_fullscreen_slider_overlay ) ) { ?><?php echo esc_attr($bauen_fullscreen_slider_overlay);?><?php } else { ?>3<?php } ?>" data-background="<?php echo esc_url(($bauen_image['url']));?>">
				<div class="v-middle caption mt-30">
					<div class="container">
						<div class="row">
							<div class="col-md-7">
								<div class="o-hidden">
								    <?php if ( !empty( $bauen_fullscreen_slider_title ) ) { ?>
										<?php if ($bauen_fullscreen_slider_title_tag =='st2'){?>
											<h2><?php echo esc_html($bauen_fullscreen_slider_title);?></h2>
										<?php } else if ($bauen_fullscreen_slider_title_tag =='st3'){?>
											<h3><?php echo esc_html($bauen_fullscreen_slider_title);?></h3>
										<?php } else if ($bauen_fullscreen_slider_title_tag =='st4'){?>
											<h4><?php echo esc_html($bauen_fullscreen_slider_title);?></h4>
										<?php } else if ($bauen_fullscreen_slider_title_tag =='st5'){?>
											<h5><?php echo esc_html($bauen_fullscreen_slider_title);?></h5>
										<?php } else if ($bauen_fullscreen_slider_title_tag =='st6'){?>
											<h6><?php echo esc_html($bauen_fullscreen_slider_title);?></h6>	
										<?php } else { ?>
											<h1><?php echo esc_html($bauen_fullscreen_slider_title);?></h1>
										<?php } ?>
									<?php } ?>
									<?php if ( !empty( $bauen_fullscreen_slider_subtitle ) ) { ?>
									<p><?php echo balanceTags($bauen_fullscreen_slider_subtitle);?></p>
									<?php } ?>	
									<?php if ( !empty( $bauen_fullscreen_slider_buttontxt ) ) { ?>
							        <?php if ( !empty( $bauen_fullscreen_slider_buttonurl ) ) { ?>
									<div class="butn-light mt-30 mb-30"><a href="<?php echo esc_url($bauen_fullscreen_slider_buttonurl);?>" <?php if ( !empty( $bauen_fullscreen_slider_button_target ) ) { ?>target="<?php echo esc_attr($bauen_fullscreen_slider_button_target);?>"<?php } ?>><span><?php echo esc_html($bauen_fullscreen_slider_buttontxt);?></span></a></div>
									<?php } ?>
							        <?php } ?>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			
			<?php } ?>
            <?php } } ;?> 			
            <?php } ;?> 			
		</div>
	</header>