<?php
$output = $el_class = $bg_image = $bg_color = $bg_image_repeat = $font_color = $padding = $margin_bottom = $css = '';
extract(shortcode_atts(array(
    'el_class'        => '',
    'bg_image'        => '',
    'bg_color'        => '',
    'bg_image_repeat' => '',
    'font_color'      => '',
    'padding'         => '',
    'margin_bottom'   => '',
	'row_fullwidth'	  => '', //ozy
	'row_fullheight'  => '', //ozy
	'bg_parallax'	  => '', //ozy
	'row_min_height'  => '', //ozy
	'bg_video'		  => '', //ozy
	'bg_video_mp4'	  => '', //ozy
	'bg_video_webm'	  => '', //ozy
	'bg_video_ogv'	  => '', //ozy
	'row_id'		  => '', //ozy	
	'video_overlay_color' => '', //ozy
	'bottom_button' => '', //ozy
	'bottom_button_icon' => '', //ozy
	'bottom_button_link' => '', //ozy
	'bottom_button_color' => '', //ozy
	'row_zero_column_space' => '', //ozy
	'bg_scroll' => '', //ozy
	'row_vertical_center' => '', //ozy	
    'css' => ''
), $atts));

global $ozyHelper;

// wp_enqueue_style( 'js_composer_front' );
wp_enqueue_script( 'wpb_composer_front_js' );
// wp_enqueue_style('js_composer_custom_css');

$el_class = $this->getExtraClass($el_class);

$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_row wpb_row '. ( $this->settings('base')==='vc_row_inner' ? 'vc_inner ' : '' ) . get_row_css_class() . $el_class . vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts );

$style = $this->buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom);


/*ozy*/
/*if font color selected for the row element, make sure all the sub elements are affected*/
if($font_color && $css_class) {
	global $ozyHelper;
	$rand_id = "ozy-crfclr-". rand(1,10000);
	$ozyHelper->set_footer_style(".$rand_id h1,.$rand_id h2,.$rand_id h3,.$rand_id h4,.$rand_id h5,.$rand_id h6{color:$font_color !important;}");
	$css_class .= " " . $rand_id;
}

/*ozy*/
$css_class .= ($row_fullwidth == '1' ? ' ozy-custom-full-row' : '');
$css_class .= ($row_fullheight == '1' ? ' ozy-custom-fullheight-row' : '');
$css_class .= ($row_vertical_center == '1' ? ' ozy-custom-verticalcentered-row' : '');
$css_class .= ($bg_parallax == 'on' || $bg_parallax == '1' ? ' ozy-custom-row parallax' : '');

if((int)$row_min_height>0) {
	if(strpos($style, 'style="')>-1) {
		$style = str_replace('style="', ' style="position:relative;overflow:hidden;min-height:'. $row_min_height .'px;', $style);
	}else{
		$style = ' style="position:relative;overflow:hidden;min-height:'. $row_min_height .'px;"';
	}
}
$css_class .= ($bg_video == 'on' ? ' ozy-row-has-video' : '');
$css_class .= ($row_zero_column_space == '1' ? ' ozy-row-zero-space' : '');

$output .= '<div class="'.$css_class.'"'.$style.' '.(esc_attr($row_id)?' id="'. esc_attr($row_id) .'"':'').' '. (esc_attr($bg_scroll) ? 'data-bgscroll="'. esc_attr($bg_scroll) .'"':'') .'>';

if(esc_attr($row_id)) {
	array_push($ozyHelper->vertical_nav_buttons, 'page-' . esc_attr($row_id));
}

/*ozy*/
if($bg_video == 'on') { 
	$output .= '<video class="slider-video" width="1920" height="1081" style="position:absolute;left:0;top:0;" preload="auto" loop autoplay src="'.$bg_video_mp4.'">';
	if($bg_video_ogv) $output .='<source type="video/ogv" src="'. $bg_video_ogv .'">';
	if($bg_video_mp4) $output .='<source type="video/mp4" src="'. $bg_video_mp4 .'">';	
	if($bg_video_webm) $output .='<source type="video/webm" src="'. $bg_video_webm .'">';
	$output .= '</video>';
}
if($video_overlay_color) {
	$output .= '<div class="video-mask'. ($video_overlay_color ? ' has-bg' : '' ) .'" '. ($video_overlay_color ? ' style="background-color:'. $video_overlay_color .';"' : '' ) .'></div>';
}

$output .= '<div class="parallax-wrapper">'; //ozy
//$output .= '<div class="'.$css_class.'"'.$style.'>';
$output .= wpb_js_remove_wpautop($content);
$output .= '</div>'; //ozy
if($bottom_button == 'on') {
	$output .= '<a href="'. $bottom_button_link .'" class="row-botton-button" style="color:'. $bottom_button_color .'"><span class="'. $bottom_button_icon .'" ></span></a>';
}
$output .= '</div>'.$this->endBlockComment('row');

echo $output;