function TS_VCSC_Timeline_CSS_Function_Section($atts)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     extract(shortcode_atts(array('section' => '', 'section_icon' => '', 'icon_color' => '#7c7979', 'tooltipster_offsetx' => 0, 'tooltipster_offsety' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $media_string = '';
     $output = '';
     $randomizer = mt_rand(999999, 9999999);
     if (!empty($el_id)) {
         $timeline_id = $el_id;
     } else {
         $timeline_id = 'ts-vcsc-timeline-section-' . $randomizer;
     }
     // Retrieve Timeline Post
     $timeline_array = array();
     $category_fields = array();
     $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => 'ts_timeline', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
     $timeline_query = new WP_Query($args);
     if ($timeline_query->have_posts()) {
         foreach ($timeline_query->posts as $p) {
             if ($p->ID == $section) {
                 // Retrieve Post Categories
                 $section_categories = get_the_terms($p->ID, 'ts_timeline_category');
                 $array_categories = array();
                 if ($section_categories != false) {
                     foreach ($section_categories as $category) {
                         $array_categories[] = $category->name;
                     }
                 }
                 $section_categories = join(",", $array_categories);
                 // Retrieve Post Tags
                 $sections_tags = get_the_terms($p->ID, 'ts_timeline_tags');
                 $array_tags = array();
                 if ($sections_tags != false) {
                     foreach ($sections_tags as $tag) {
                         $array_tags[] = $tag->name;
                     }
                 }
                 $sections_tags = join(",", $array_tags);
                 // Build Data Array
                 $timeline_data = array('author' => $p->post_author, 'name' => $p->post_name, 'title' => $p->post_title, 'id' => $p->ID, 'categories' => $section_categories, 'tags' => $sections_tags);
                 $timeline_array[] = $timeline_data;
                 $array_categories = array();
                 $array_tags = array();
             }
         }
     }
     wp_reset_postdata();
     // Section Main Data
     foreach ($timeline_array as $index => $array) {
         $Section_Author = $timeline_array[$index]['author'];
         $Section_Name = $timeline_array[$index]['name'];
         $Section_Title = $timeline_array[$index]['title'];
         $Section_ID = $timeline_array[$index]['id'];
         $Section_Categories = $timeline_array[$index]['categories'];
         $Section_Tags = $timeline_array[$index]['tags'];
     }
     // Retrieve Timeline Post Meta Content
     $custom_fields = get_post_custom($Section_ID);
     $custom_fields_array = array();
     foreach ($custom_fields as $field_key => $field_values) {
         if (!isset($field_values[0])) {
             continue;
         }
         if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
             continue;
         }
         if (strpos($field_key, 'ts_vcsc_timeline_') !== false) {
             if ($field_key == "ts_vcsc_timeline_media_featuredimage_id") {
                 $field_key = "ts_vcsc_timeline_media_featuredimageid";
             }
             $field_key_split = explode("_", $field_key);
             $field_key_length = count($field_key_split) - 1;
             $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Timeline_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
             $custom_fields_array[] = $custom_data;
         }
     }
     foreach ($custom_fields_array as $index => $array) {
         ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
     }
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-timeline-css-section ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Timeline_CSS_Section', $atts);
     } else {
         $css_class = 'ts-timeline-css-section ' . $el_class;
     }
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $vc_inline = 'true';
         $vc_inline_style = ' display: block;';
     } else {
         $vc_inline = 'false';
         $vc_inline_style = '';
     }
     if ($vc_inline == "false") {
         // Tooltip String
         if (isset($Timeline_Tooltiptext)) {
             if (isset($Timeline_Tooltipstyle)) {
                 $tooltip_style = "tooltipster-" . $Timeline_Tooltipstyle;
             } else {
                 $tooltip_style = "tooltipster-black";
             }
             if (isset($Timeline_Tooltipposition)) {
                 $tooltip_position = $Timeline_Tooltipposition;
             } else {
                 $tooltip_position = 'top';
             }
             $tooltip_content = 'data-tooltipster-html="true" data-tooltipster-title="" data-tooltipster-text="' . base64_encode($Timeline_Tooltiptext) . '" data-tooltipster-image="" data-tooltipster-position="' . $tooltip_position . '" data-tooltipster-touch="false" data-tooltipster-arrow="true" data-tooltipster-theme="' . $tooltip_style . '" data-tooltipster-animation="swing" data-tooltipster-trigger="hover" data-tooltipster-offsetx="' . $tooltipster_offsetx . '" data-tooltipster-offsety="' . $tooltipster_offsety . '"';
             $tooltip_class = 'ts-has-tooltipster-tooltip';
         } else {
             $tooltip_content = '';
             $tooltip_class = '';
         }
         // Border Radius
         if (isset($Timeline_Radiusborder)) {
             $border_radius = $Timeline_Radiusborder;
         } else {
             $border_radius = '';
         }
         // Timeline Event
         if ($Timeline_Type == "event") {
             // Feature Media Alignment
             if (isset($Timeline_Featuredmediaalign)) {
                 if ($Timeline_Featuredmediaalign == "center") {
                     $image_alignment = "margin: 5px auto; float: none;";
                 } else {
                     if ($Timeline_Featuredmediaalign == "left") {
                         $image_alignment = "margin: 5px 0; float: left;";
                     } else {
                         if ($Timeline_Featuredmediaalign == "right") {
                             $image_alignment = "margin: 5px 0; float: right;";
                         }
                     }
                 }
             } else {
                 $image_alignment = "margin: 5px auto; float: none;";
             }
             // Feature Media Dimensions
             $image_dimensions = 'width: 100%; height: auto;';
             $parent_dimensions = 'width: ' . $Timeline_Featuredmediawidth . '%; ' . $Timeline_Featuredmediaheight;
             // Lightbox Background Color
             if (isset($Timeline_Lightboxbacklight)) {
                 if ($Timeline_Lightboxbacklight == "auto") {
                     $nacho_color = '';
                 } else {
                     if ($Timeline_Lightboxbacklight == "custom") {
                         $nacho_color = 'data-color="' . $Timeline_Lightboxbacklightcolor . '"';
                     } else {
                         if ($Timeline_Lightboxbacklight == "hideit") {
                             $nacho_color = 'data-color="#000000"';
                         }
                     }
                 }
             } else {
                 $nacho_color = '';
             }
             // Adjustment for Inline Edit Mode of VC
             if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
                 $Timeline_Fullwidth = 'true';
                 $vcinline_active = 'true';
                 $vcinline_class = '';
                 $vcinline_slider = 'owl-carousel2-edit';
             } else {
                 $Timeline_Fullwidth = $Timeline_Fullwidth;
                 $vcinline_active = 'false';
                 $vcinline_class = '';
                 $vcinline_slider = 'owl-carousel2';
             }
             // Featured Media
             if (isset($Timeline_Featuredmedia)) {
                 // Featured Media: Image
                 if ($Timeline_Featuredmedia == 'image') {
                     if (isset($Timeline_Featuredimageid)) {
                         $media_image = wp_get_attachment_image_src($Timeline_Featuredimageid, 'large');
                         if ($media_image != false) {
                             $image_extension = pathinfo($media_image[0], PATHINFO_EXTENSION);
                             if (isset($Timeline_Attributealtvalue)) {
                                 $alt_attribute = $Timeline_Attributealtvalue;
                             } else {
                                 $alt_attribute = basename($Timeline_Featuredimage, "." . $image_extension);
                             }
                             if (isset($Timeline_Attributetitle)) {
                                 $media_title = $Timeline_Attributetitle;
                             } else {
                                 if (isset($Timeline_Eventtitletext)) {
                                     $media_title = $Timeline_Eventtitletext;
                                 } else {
                                     $media_title = '';
                                 }
                             }
                             if ($Timeline_Lightboxfeatured == "false") {
                                 $media_string .= '<div class="ts-timeline-media" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                                 $media_string .= '<img class="" src="' . $media_image[0] . '" alt="' . $alt_attribute . '" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                                 $media_string .= '</div>';
                             } else {
                                 $media_string .= '<div class="ts-timeline-media nchgrid-item nchgrid-tile nch-lightbox-image" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                                 $media_string .= '<a href="' . $media_image[0] . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image[0] . '" data-title="' . $media_title . '" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . $Timeline_Lightboxeffect . '" data-duration="5000" ' . $nacho_color . '>';
                                 $media_string .= '<img src="' . $media_image[0] . '" alt="' . $alt_attribute . '" title="" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                                 $media_string .= '<div class="nchgrid-caption"></div>';
                                 if ($media_title != '') {
                                     $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                                 }
                                 $media_string .= '</a>';
                                 $media_string .= '</div>';
                             }
                         }
                     }
                 }
                 // Featured Media: Image Slider
                 if ($Timeline_Featuredmedia == 'slider') {
                     if (isset($Timeline_Featuredslider)) {
                         if (isset($Timeline_Pagertl)) {
                             $page_rtl = $Timeline_Pagertl;
                         } else {
                             $page_rtl = "false";
                         }
                         $featured_slider = array();
                         $featured_images = array();
                         $featured_maxheight = isset($Timeline_Slidermaxheight) ? $Timeline_Slidermaxheight : 400;
                         $featured_fixheight = isset($Timeline_Sliderfixheight) ? $Timeline_Sliderfixheight : 400;
                         $images = get_post_meta($Section_ID, 'ts_vcsc_timeline_media_featuredslider', true);
                         if ($images) {
                             foreach ($images as $attachment_id => $img_full_url) {
                                 $featured_slider[] = $attachment_id;
                             }
                         }
                         $i = -1;
                         $b = 0;
                         $nachoLength = count($featured_slider) - 1;
                         if (isset($Timeline_Slidertitles)) {
                             $titles_array = explode("\n", $Timeline_Slidertitles);
                             $titles_array = array_filter($titles_array, 'trim');
                         } else {
                             $titles_array = array();
                         }
                         $media_string .= '<div id="ts-timeline-css-imageslider-' . $randomizer . '" class="ts-timeline-css-imageslider-container ' . $vcinline_slider . '" style="" data-id="' . $randomizer . '" data-parent="' . $timeline_id . '" data-items="' . count($featured_slider) . '" data-maxheight="' . $featured_maxheight . '">';
                         $media_string .= '<div class="ts-timeline-css-imageslider-slides">';
                         foreach ($featured_slider as $single_image) {
                             $i++;
                             $modal_image = wp_get_attachment_image_src($single_image, 'full');
                             if ($modal_image != false) {
                                 $modal_thumb = wp_get_attachment_image_src($single_image, 'thumb');
                                 $image_ratio = $modal_image[1] / $modal_image[2];
                                 $image_height = $modal_image[2] > $featured_maxheight ? $featured_maxheight : $modal_image[2];
                                 $image_width = round($image_height * $image_ratio, 0);
                                 $image_extension = pathinfo($modal_image[0], PATHINFO_EXTENSION);
                                 $featured_images[] = $modal_thumb[0];
                                 if ($Timeline_Lightboxfeatured == "false") {
                                     if ($i == 0 && $vcinline_active == "true" || $vcinline_active == "false") {
                                         $media_string .= '<div id="ts-timeline-css-imageslider-image-' . $single_image . '-parent" class="ts-timeline-css-imageslider-image-parent nchgrid-item nchgrid-tile nch-lightbox-image ts-timeline-css-imageslider-item ' . ($i == 0 ? "ts-timeline-css-slider-view-active" : "ts-timeline-css-slider-view-hidden") . '" data-width="' . $modal_image[1] . '" data-height="' . $modal_image[2] . '" data-ratio="' . $modal_image[1] / $modal_image[2] . '" data-order="' . $i . '" data-total="' . count($featured_slider) . '">';
                                         $media_string .= '<img src="' . $modal_image[0] . '" style="max-width: ' . $image_width . 'px; max-height: ' . $image_height . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                                         $media_string .= '<div class="nchgrid-caption"></div>';
                                         if (isset($titles_array[$i]) && $titles_array[$i] != '') {
                                             $media_string .= '<div class="nchgrid-caption-text">' . strip_tags($titles_array[$i]) . '</div>';
                                         }
                                         $media_string .= '</div>';
                                     }
                                 } else {
                                     if ($i == $nachoLength && $vcinline_active == "false") {
                                         $media_string .= '<div id="ts-timeline-css-imageslider-image-' . $single_image . '-parent" class="ts-timeline-css-imageslider-image-parent nchgrid-item nchgrid-tile nch-lightbox-image ts-timeline-css-imageslider-item ' . ($i == 0 ? "ts-timeline-css-slider-view-active" : "ts-timeline-css-slider-view-hidden") . '" data-width="' . $modal_image[1] . '" data-height="' . $modal_image[2] . '" data-ratio="' . $modal_image[1] / $modal_image[2] . '" data-order="' . $i . '" data-total="' . count($featured_slider) . '">';
                                         $media_string .= '<a id="' . $timeline_id . '-' . $single_image . '" href="' . $modal_image[0] . '" data-thumbnail="' . $modal_image[0] . '" data-title="' . (isset($titles_array[$i]) && $titles_array[$i] != '' ? strip_tags($titles_array[$i]) : '') . '" class="nch-lightbox-media no-ajaxy ts-hover-image ' . $timeline_id . '-slider-image" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-effect="' . $Timeline_Lightboxeffect . '" data-share="0" data-autoplay="0" data-duration="5000" data-thumbsize="100" data-thumbs="bottom" ' . $nacho_color . '>';
                                         $media_string .= '<img src="' . $modal_image[0] . '" style="max-width: ' . $image_width . 'px; max-height: ' . $image_height . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                                         $media_string .= '<div class="nchgrid-caption"></div>';
                                         if (isset($titles_array[$i]) && $titles_array[$i] != '') {
                                             $media_string .= '<div class="nchgrid-caption-text">' . strip_tags($titles_array[$i]) . '</div>';
                                         }
                                         $media_string .= '</a>';
                                         $media_string .= '</div>';
                                     } else {
                                         if ($i == 0 && $vcinline_active == "true" || $vcinline_active == "false") {
                                             $media_string .= '<div id="ts-timeline-css-imageslider-image-' . $single_image . '-parent" class="ts-timeline-css-imageslider-image-parent nchgrid-item nchgrid-tile nch-lightbox-image ts-timeline-css-imageslider-item ' . ($i == 0 ? "ts-timeline-css-slider-view-active" : "ts-timeline-css-slider-view-hidden") . '" data-width="' . $modal_image[1] . '" data-height="' . $modal_image[2] . '" data-ratio="' . $modal_image[1] / $modal_image[2] . '" data-order="' . $i . '" data-total="' . count($featured_slider) . '">';
                                             $media_string .= '<a id="' . $timeline_id . '-' . $single_image . '" href="' . $modal_image[0] . '" data-thumbnail="' . $modal_image[0] . '" data-title="' . (isset($titles_array[$i]) && $titles_array[$i] != '' ? strip_tags($titles_array[$i]) : '') . '" class="nch-lightbox-media no-ajaxy ts-hover-image ' . $timeline_id . '-slider-image" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-effect="' . $Timeline_Lightboxeffect . '" ' . $nacho_color . '>';
                                             $media_string .= '<img src="' . $modal_image[0] . '" style="max-width: ' . $image_width . 'px; max-height: ' . $image_height . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                                             $media_string .= '<div class="nchgrid-caption"></div>';
                                             if (isset($titles_array[$i]) && $titles_array[$i] != '') {
                                                 $media_string .= '<div class="nchgrid-caption-text">' . strip_tags($titles_array[$i]) . '</div>';
                                             }
                                             $media_string .= '</a>';
                                             $media_string .= '</div>';
                                         }
                                     }
                                 }
                             }
                         }
                         $media_string .= '</div>';
                         $media_string .= '<div class="ts-timeline-css-imageslider-navigation">';
                         $media_string .= '<div class="ts-timeline-css-imageslider-dotholder">';
                         $i = -1;
                         foreach ($featured_slider as $single_image) {
                             $i++;
                             $media_string .= '<div class="ts-timeline-css-imageslider-dot ' . ($i == 0 ? "ts-timeline-css-imageslider-dotactive" : "") . ' ts-has-tooltipster-tooltip" data-order="' . $i . '" data-image="' . (isset($featured_images[$i]) ? $featured_images[$i] : "") . '" data-tooltipster-html="false" data-tooltipster-title="" data-tooltipster-text="" data-tooltipster-image="' . (isset($featured_images[$i]) ? $featured_images[$i] : "") . '" data-tooltipster-position="top" data-tooltipster-touch="false" data-tooltipster-arrow="true" data-tooltipster-theme="tooltipster-thumb" data-tooltipster-animation="fade" data-tooltipster-trigger="hover" data-tooltipster-offsetx="' . $tooltipster_offsetx . '" data-tooltipster-offsety="' . $tooltipster_offsety . '"></div>';
                         }
                         $media_string .= '</div>';
                         $media_string .= '<div class="ts-timeline-css-imageslider-prev"><i class="dashicons dashicons-arrow-left-alt2"></i></div>';
                         $media_string .= '<div class="ts-timeline-css-imageslider-next"><i class="dashicons dashicons-arrow-right-alt2"></i></div>';
                         $media_string .= '</div>';
                         $media_string .= '</div>';
                         $slider_class = '';
                     }
                 } else {
                     $slider_class = '';
                 }
                 // Featured Media: YouTube
                 if (isset($Timeline_Featuredyoutubeurl) && ($Timeline_Featuredmedia == 'youtube_default' || $Timeline_Featuredmedia == 'youtube_custom' || $Timeline_Featuredmedia == 'youtube_embed')) {
                     if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $Timeline_Featuredyoutubeurl)) {
                         $featured_youtube_url = $Timeline_Featuredyoutubeurl;
                     } else {
                         $featured_youtube_url = 'https://www.youtube.com/watch?v=' . $Timeline_Featuredyoutubeurl;
                     }
                     if (isset($Timeline_Featuredyoutubeplay)) {
                         if ($Timeline_Featuredyoutubeplay == "true") {
                             $video_autoplay = 'true';
                         } else {
                             $video_autoplay = 'false';
                         }
                     } else {
                         $video_autoplay = 'false';
                     }
                     if (isset($Timeline_Featuredyoutuberelated)) {
                         if ($Timeline_Featuredyoutuberelated == "true") {
                             $video_related = '&rel=1';
                         } else {
                             $video_related = '&rel=0';
                         }
                     } else {
                         $video_related = '&rel=0';
                     }
                     if (isset($Timeline_Attributetitle)) {
                         $media_title = $Timeline_Attributetitle;
                     } else {
                         if (isset($Timeline_Eventtitletext)) {
                             $media_title = $Timeline_Eventtitletext;
                         } else {
                             $media_title = '';
                         }
                     }
                     if ($Timeline_Featuredmedia == 'youtube_default') {
                         $media_image = TS_VCSC_VideoImage_Youtube($featured_youtube_url);
                         $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-youtube" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                         $media_string .= '<a href="' . $featured_youtube_url . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image . '" data-title="' . $media_title . '" data-related="' . $video_related . '" data-videoplay="' . $video_autoplay . '" data-type="youtube" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . (isset($Timeline_Lightboxeffect) ? $Timeline_Lightboxeffect : 'random') . '" data-duration="5000" ' . $nacho_color . '>';
                         $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                         $media_string .= '<div class="nchgrid-caption"></div>';
                         if ($media_title != '') {
                             $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                         }
                         $media_string .= '</a>';
                         $media_string .= '</div>';
                     } else {
                         if ($Timeline_Featuredmedia == 'youtube_custom') {
                             if (isset($Timeline_Featuredimageid)) {
                                 $media_image = wp_get_attachment_image_src($Timeline_Featuredimageid, 'full');
                                 $media_image = $media_image[0];
                                 $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                                 if (isset($Timeline_Attributealtvalue)) {
                                     $alt_attribute = $Timeline_Attributealtvalue;
                                 } else {
                                     $alt_attribute = basename($Timeline_Featuredimage, "." . $image_extension);
                                 }
                             } else {
                                 $media_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
                                 $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                                 if (isset($Timeline_Attributealtvalue)) {
                                     $alt_attribute = $Timeline_Attributealtvalue;
                                 } else {
                                     $alt_attribute = basename($media_image, "." . $image_extension);
                                 }
                             }
                             $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-youtube" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                             $media_string .= '<a href="' . $featured_youtube_url . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image . '" data-title="' . $media_title . '" data-related="' . $video_related . '" data-videoplay="' . $video_autoplay . '" data-type="youtube" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . (isset($Timeline_Lightboxeffect) ? $Timeline_Lightboxeffect : 'random') . '" data-duration="5000" ' . $nacho_color . '>';
                             $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                             $media_string .= '<div class="nchgrid-caption"></div>';
                             if ($media_title != '') {
                                 $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                             }
                             $media_string .= '</a>';
                             $media_string .= '</div>';
                         } else {
                             if ($Timeline_Featuredmedia == 'youtube_embed') {
                                 $video_id = TS_VCSC_VideoID_Youtube($featured_youtube_url);
                                 if ($video_autoplay == "true") {
                                     $video_autoplay = '?autoplay=1';
                                 } else {
                                     $video_autoplay = '?autoplay=0';
                                 }
                                 $media_string .= '<div class="ts-video-container" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                                 $media_string .= '<iframe width="100%" height="auto" src="//www.youtube.com/embed/' . $video_id . $video_autoplay . $video_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                                 $media_string .= '</div>';
                             }
                         }
                     }
                 }
                 // Featured Media: DailyMotion
                 if (isset($Timeline_Featureddailymotionurl) && ($Timeline_Featuredmedia == 'dailymotion_default' || $Timeline_Featuredmedia == 'dailymotion_custom' || $Timeline_Featuredmedia == 'dailymotion_embed')) {
                     if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $Timeline_Featureddailymotionurl)) {
                         $featured_dailymotion_url = $Timeline_Featureddailymotionurl;
                     } else {
                         $featured_dailymotion_url = 'http://www.dailymotion.com/video/' . $Timeline_Featureddailymotionurl;
                     }
                     if (isset($Timeline_Featureddailymotionplay)) {
                         if ($Timeline_Featureddailymotionplay == "true") {
                             $video_autoplay = 'true';
                         } else {
                             $video_autoplay = 'false';
                         }
                     } else {
                         $video_autoplay = 'false';
                     }
                     if (isset($Timeline_Attributetitle)) {
                         $media_title = $Timeline_Attributetitle;
                     } else {
                         if (isset($Timeline_Eventtitletext)) {
                             $media_title = $Timeline_Eventtitletext;
                         } else {
                             $media_title = '';
                         }
                     }
                     if ($Timeline_Featuredmedia == 'dailymotion_default') {
                         $media_image = TS_VCSC_VideoImage_Motion($featured_dailymotion_url);
                         $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-motion" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                         $media_string .= '<a href="' . $featured_dailymotion_url . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image . '" data-title="' . $media_title . '" data-videoplay="' . $video_autoplay . '" data-type="dailymotion" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . (isset($Timeline_Lightboxeffect) ? $Timeline_Lightboxeffect : 'random') . '" data-duration="5000" ' . $nacho_color . '>';
                         $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                         $media_string .= '<div class="nchgrid-caption"></div>';
                         if ($media_title != '') {
                             $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                         }
                         $media_string .= '</a>';
                         $media_string .= '</div>';
                     } else {
                         if ($Timeline_Featuredmedia == 'dailymotion_custom') {
                             if (isset($Timeline_Featuredimageid)) {
                                 $media_image = wp_get_attachment_image_src($Timeline_Featuredimageid, 'full');
                                 $media_image = $media_image[0];
                                 $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                                 if (isset($Timeline_Attributealtvalue)) {
                                     $alt_attribute = $Timeline_Attributealtvalue;
                                 } else {
                                     $alt_attribute = basename($Timeline_Featuredimage, "." . $image_extension);
                                 }
                             } else {
                                 $media_image = TS_VCSC_GetResourceURL('images/defaults/default_motion.jpg');
                                 $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                                 if (isset($Timeline_Attributealtvalue)) {
                                     $alt_attribute = $Timeline_Attributealtvalue;
                                 } else {
                                     $alt_attribute = basename($media_image, "." . $image_extension);
                                 }
                             }
                             $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-motion" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                             $media_string .= '<a href="' . $featured_dailymotion_url . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image . '" data-title="' . $media_title . '" data-videoplay="' . $video_autoplay . '" data-type="dailymotion" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . (isset($Timeline_Lightboxeffect) ? $Timeline_Lightboxeffect : 'random') . '" data-duration="5000" ' . $nacho_color . '>';
                             $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                             $media_string .= '<div class="nchgrid-caption"></div>';
                             if ($media_title != '') {
                                 $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                             }
                             $media_string .= '</a>';
                             $media_string .= '</div>';
                         } else {
                             if ($Timeline_Featuredmedia == 'dailymotion_embed') {
                                 $video_id = TS_VCSC_VideoID_Motion($featured_dailymotion_url);
                                 if ($video_autoplay == "true") {
                                     $video_autoplay = '?autoplay=1';
                                 } else {
                                     $video_autoplay = '?autoplay=0';
                                 }
                                 $media_string .= '<div class="ts-video-container" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                                 $media_string .= '<iframe width="100%" height="auto" src="http://www.dailymotion.com/embed/video/' . $video_id . $video_autoplay . '&forcedQuality=hq&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                                 $media_string .= '</div>';
                             }
                         }
                     }
                 }
                 // Featured Media: Vimeo
                 if (isset($Timeline_Featuredvimeourl) && ($Timeline_Featuredmedia == 'vimeo_default' || $Timeline_Featuredmedia == 'vimeo_custom' || $Timeline_Featuredmedia == 'vimeo_embed')) {
                     if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $Timeline_Featuredvimeourl)) {
                         $featured_vimeo_url = $Timeline_Featuredvimeourl;
                     } else {
                         $featured_vimeo_url = 'http://www.vimeo.com/video/' . $Timeline_Featuredvimeourl;
                     }
                     if (isset($Timeline_Featuredvimeoplay)) {
                         if ($Timeline_Featuredvimeoplay == "true") {
                             $video_autoplay = 'true';
                         } else {
                             $video_autoplay = 'false';
                         }
                     } else {
                         $video_autoplay = 'false';
                     }
                     if (isset($Timeline_Attributetitle)) {
                         $media_title = $Timeline_Attributetitle;
                     } else {
                         if (isset($Timeline_Eventtitletext)) {
                             $media_title = $Timeline_Eventtitletext;
                         } else {
                             $media_title = '';
                         }
                     }
                     if ($Timeline_Featuredmedia == 'vimeo_default') {
                         $media_image = TS_VCSC_VideoImage_Vimeo($featured_vimeo_url);
                         $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-vimeo" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                         $media_string .= '<a href="' . $featured_vimeo_url . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image . '" data-title="' . $media_title . '" data-videoplay="' . $video_autoplay . '" data-type="vimeo" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . (isset($Timeline_Lightboxeffect) ? $Timeline_Lightboxeffect : 'random') . '" data-duration="5000" ' . $nacho_color . '>';
                         $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                         $media_string .= '<div class="nchgrid-caption"></div>';
                         if ($media_title != '') {
                             $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                         }
                         $media_string .= '</a>';
                         $media_string .= '</div>';
                     } else {
                         if ($Timeline_Featuredmedia == 'vimeo_custom') {
                             if (isset($Timeline_Featuredimageid)) {
                                 $media_image = wp_get_attachment_image_src($Timeline_Featuredimageid, 'full');
                                 $media_image = $media_image[0];
                                 $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                                 if (isset($Timeline_Attributealtvalue)) {
                                     $alt_attribute = $Timeline_Attributealtvalue;
                                 } else {
                                     $alt_attribute = basename($Timeline_Featuredimage, "." . $image_extension);
                                 }
                             } else {
                                 $media_image = TS_VCSC_GetResourceURL('images/defaults/default_vimeo.jpg');
                                 $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                                 if (isset($Timeline_Attributealtvalue)) {
                                     $alt_attribute = $Timeline_Attributealtvalue;
                                 } else {
                                     $alt_attribute = basename($media_image, "." . $image_extension);
                                 }
                             }
                             $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-vimeo" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                             $media_string .= '<a href="' . $featured_vimeo_url . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image . '" data-title="' . $media_title . '" data-videoplay="' . $video_autoplay . '" data-type="vimeo" rel="' . ($Timeline_Lightboxgroup == "true" ? "timelinegroup" : (isset($Timeline_Lightboxgroupname) ? $Timeline_Lightboxgroupname : "")) . '" data-share="0" data-effect="' . (isset($Timeline_Lightboxeffect) ? $Timeline_Lightboxeffect : 'random') . '" data-duration="5000" ' . $nacho_color . '>';
                             $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                             $media_string .= '<div class="nchgrid-caption"></div>';
                             if ($media_title != '') {
                                 $media_string .= '<div class="nchgrid-caption-text">' . $media_title . '</div>';
                             }
                             $media_string .= '</a>';
                             $media_string .= '</div>';
                         } else {
                             if ($Timeline_Featuredmedia == 'vimeo_embed') {
                                 $video_id = TS_VCSC_VideoID_vimeo($featured_vimeo_url);
                                 if ($video_autoplay == "true") {
                                     $video_autoplay = '?autoplay=1';
                                 } else {
                                     $video_autoplay = '?autoplay=0';
                                 }
                                 $media_string .= '<div class="ts-video-container" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                                 $media_string .= '<iframe width="100%" height="auto" src="//player.vimeo.com/video/' . $video_id . $video_autoplay . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                                 $media_string .= '</div>';
                             }
                         }
                     }
                 }
             } else {
                 $media_string = '';
                 $slider_class = '';
             }
             // Link Button
             if (isset($Timeline_Dedicatedpage) && $Timeline_Dedicatedpage != -1) {
                 // Link Values
                 if ($Timeline_Dedicatedpage == "external") {
                     $a_href = $Timeline_Dedicatedlink;
                 } else {
                     $a_href = get_page_link($Timeline_Dedicatedpage);
                 }
                 if (isset($Timeline_Dedicatedtooltip)) {
                     $a_title = $Timeline_Dedicatedtooltip;
                 } else {
                     $a_title = "";
                 }
                 if (isset($Timeline_Dedicatedtarget)) {
                     if ($Timeline_Dedicatedtarget == true) {
                         $a_target = "_blank";
                     } else {
                         $a_target = "_windows";
                     }
                 } else {
                     $a_target = "_blank";
                 }
                 // Button Alignment
                 if (isset($Timeline_Dedicatedalign)) {
                     if ($Timeline_Dedicatedalign == "center") {
                         $buttonstyle = "width: " . (isset($Timeline_Dedicatedwidth) ? $Timeline_Dedicatedwidth : 100) . "%; margin: 0 auto; float: none;";
                     } else {
                         if ($Timeline_Dedicatedalign == "left") {
                             $buttonstyle = "width: " . (isset($Timeline_Dedicatedwidth) ? $Timeline_Dedicatedwidth : 100) . "%; margin: 0 auto; float: left;";
                         } else {
                             if ($Timeline_Dedicatedalign == "right") {
                                 $buttonstyle = "width: " . (isset($Timeline_Dedicatedwidth) ? $Timeline_Dedicatedwidth : 100) . "%; margin: 0 auto; float: right;";
                             }
                         }
                     }
                 } else {
                     $buttonstyle = 'width: 100%; margin: 0 auto; float: none;';
                 }
                 $button_string = '';
                 if (!empty($a_href) && isset($Timeline_Dedicatedlabel)) {
                     $button_string .= '<div class="ts-timeline-css-button-outer clearFixMe">';
                     $button_string .= '<div class="ts-timeline-css-button-wrapper" style="' . $buttonstyle . '%;">';
                     if (isset($Timeline_Dedicatedicon)) {
                         if ($Timeline_Dedicatedicon != "none") {
                             $button_string .= '<a class="ts-timeline-css-button-link ' . $Timeline_Dedicateddefault . ' ' . $Timeline_Dedicatedhover . '" href="' . $a_href . '" target="' . $a_target . '" title="' . $a_title . '"><i class="ts-timeline-css-button-icon dashicons dashicons-' . $Timeline_Dedicatedicon . '" style="' . (isset($Timeline_Dedicatedcolor) ? "color: " . $Timeline_Dedicatedcolor : "") . '"></i>' . $Timeline_Dedicatedlabel . '</a>';
                         } else {
                             $button_string .= '<a class="ts-timeline-css-button-link ' . $Timeline_Dedicateddefault . ' ' . $Timeline_Dedicatedhover . '" href="' . $a_href . '" target="' . $a_target . '" title="' . $a_title . '">' . $Timeline_Dedicatedlabel . '</a>';
                         }
                     } else {
                         $button_string .= '<a class="ts-timeline-css-button-link ' . $Timeline_Dedicateddefault . ' ' . $Timeline_Dedicatedhover . '" href="' . $a_href . '" target="' . $a_target . '" title="' . $a_title . '">' . $Timeline_Dedicatedlabel . '</a>';
                     }
                     $button_string .= '</div>';
                     $button_string .= '</div>';
                 } else {
                     $button_string = '';
                 }
             } else {
                 $button_string = '';
             }
             // Event Icon
             if ((empty($section_icon) || $section_icon == "transparent") && !isset($Timeline_Eventcontent) && !isset($Timeline_Featuredimage)) {
                 $title_margin = 'margin: 0;';
             } else {
                 $title_margin = '';
             }
             // Column Adjustment for Full Width Event
             if ($Timeline_Fullwidth == "true" && !isset($Timeline_Eventtitletext) && (empty($section_icon) || $section_icon == "transparent") && !isset($Timeline_Eventcontent) && !isset($Timeline_Buttontext)) {
                 $columnA_adjust = 'width: 100%; margin: 0;';
                 $columnB_adjust = 'display: none; width: 0;';
             } else {
                 if ($Timeline_Fullwidth == "true" && $Timeline_Featuredmedia == "none") {
                     $columnA_adjust = 'display: none; width: 0; margin: 0;';
                     $columnB_adjust = 'width: 100%; margin: 0;';
                 } else {
                     $columnA_adjust = '';
                     $columnB_adjust = '';
                 }
             }
             // Final Output
             $output .= '<div id="' . $timeline_id . '" class="' . $css_class . ' ' . $slider_class . ' ' . ($Timeline_Fullwidth == "true" ? "ts-timeline-css-fullwidth" : "ts-timeline-css-event") . ' ts-timeline-css-visible ts-timeline-css-animated ' . (isset($Timeline_Eventdatetext) ? "ts-timeline-css-date-true" : "ts-timeline-css-date-false") . '" style="' . ($Timeline_Fullwidth == "true" ? "width: 98%;" : "") . ' ' . $vc_inline_style . '" data-categories="' . $Section_Categories . '" data-tags="' . $Section_Tags . '" data-filtered-categories="false" data-filtered-tags="false">';
             $output .= '<div class="ts-timeline-css-text-wrap ' . (isset($Timeline_Eventdatetext) ? "ts-timeline-css-text-wrap-date" : "ts-timeline-css-text-wrap-nodate") . ' ' . $border_radius . ' ' . $tooltip_class . '" ' . $tooltip_content . ' style="' . (isset($Timeline_Eventdatetext) ? "padding-top: 35px" : "") . '">';
             if (isset($Timeline_Eventdatetext)) {
                 if (isset($Timeline_Eventdateicon)) {
                     if ($Timeline_Eventdateicon == "none") {
                         $output .= '<div class="ts-timeline-css-date"><span class="ts-timeline-css-date-connect"><span class="ts-timeline-css-date-text">' . $Timeline_Eventdatetext . '</span></span></div>';
                     } else {
                         $output .= '<div class="ts-timeline-css-date"><span class="ts-timeline-css-date-connect"><span class="ts-timeline-css-date-text"><i class="ts-timeline-css-date-icon dashicons dashicons-' . $Timeline_Eventdateicon . '"></i>' . $Timeline_Eventdatetext . '</span></span></div>';
                     }
                 } else {
                     $output .= '<div class="ts-timeline-css-date"><span class="ts-timeline-css-date-connect"><span class="ts-timeline-css-date-text">' . $Timeline_Eventdatetext . '</span></span></div>';
                 }
             }
             if ($Timeline_Fullwidth == "true") {
                 $output .= '<div class="ts-timeline-css-fullwidth-colA" style="' . $columnA_adjust . '">';
                 $output .= $media_string;
                 $output .= '</div>';
                 $output .= '<div class="ts-timeline-css-fullwidth-colB" style="' . $columnB_adjust . '">';
                 if (isset($Timeline_Eventtitletext)) {
                     $output .= '<h3 class="ts-timeline-css-title" style="color: ' . (isset($Timeline_Eventtitlecolor) ? $Timeline_Eventtitlecolor : $title_color) . '; text-align: ' . (isset($Timeline_Eventtitlealign) ? $Timeline_Eventtitlealign : $title_align) . '; ' . (!isset($Timeline_Eventcontent) && empty($section_icon) ? "border: none; margin-bottom: 0; padding-bottom: 0;" : "") . ' ' . $title_margin . '">' . $Timeline_Eventtitletext . '</h3>';
                 }
                 if (!empty($section_icon) && $section_icon != "transparent" || isset($Timeline_Eventcontent) || isset($Timeline_Linkurl)) {
                     $output .= '<div style="width: 100%; display: block; float: left; position: relative; padding-bottom: ' . (!empty($a_href) && !empty($button_string) ? 0 : 15) . 'px; ' . (!isset($Timeline_Eventcontent) && !empty($section_icon) ? "height: 60px;" : "") . '">';
                     if (isset($Timeline_Eventcontent)) {
                         $output .= '<div class="ts-timeline-css-text-wrap-inner" style="' . (empty($section_icon) ? "width: 100%; height: 100%; left: 0;" : " left: 0;") . '">';
                         if (function_exists('wpb_js_remove_wpautop')) {
                             $output .= '<div class="ts-timeline-css-text" style="">' . wpb_js_remove_wpautop(do_shortcode($Timeline_Eventcontent), true) . '</div>';
                         } else {
                             $output .= '<div class="ts-timeline-css-text" style="">' . do_shortcode($Timeline_Eventcontent) . '</div>';
                         }
                         $output .= '</div>';
                     }
                     if (!empty($section_icon) && $section_icon != "transparent") {
                         $output .= '<div class="ts-timeline-css-icon ts-timeline-css-icon-full" style="' . (!isset($Timeline_Eventcontent) ? "display: inline-block; width: 100%; left: 0; margin: 0 0 0 2%;" : "left: 80%;") . '"><i class="' . $section_icon . '" style="color: ' . $icon_color . ';"></i></div>';
                     }
                     if (!empty($a_href) && !empty($button_string)) {
                         $output .= '<div class="ts-timeline-css-button-container">';
                         $output .= $button_string;
                         $output .= '</div>';
                     }
                     $output .= '</div>';
                 }
                 $output .= '</div>';
                 if ($Section_Tags != '') {
                     $output .= '<div class="ts-timeline-css-output-tags"><i class="dashicons dashicons-tag"></i><span>' . str_replace(",", ", ", $Section_Tags) . '</span></div>';
                 }
                 if ($Section_Categories != '') {
                     $output .= '<div class="ts-timeline-css-output-cats"><i class="dashicons dashicons-category"></i><span>' . str_replace(",", ", ", $Section_Categories) . '</span></div>';
                 }
             } else {
                 $output .= $media_string;
                 if (isset($Timeline_Eventtitletext)) {
                     $output .= '<h3 class="ts-timeline-css-title" style="color: ' . (isset($Timeline_Eventtitlecolor) ? $Timeline_Eventtitlecolor : $title_color) . '; text-align: ' . (isset($Timeline_Eventtitlealign) ? $Timeline_Eventtitlealign : $title_align) . '; ' . (!isset($Timeline_Eventcontent) && empty($section_icon) ? "border: none; margin-bottom: 0; padding-bottom: 0;" : "") . ' ' . $title_margin . '">' . $Timeline_Eventtitletext . '</h3>';
                 }
                 if (!empty($section_icon) && $section_icon != "transparent" || isset($Timeline_Eventcontent)) {
                     $output .= '<div style="width: 100%; display: block; float: left; position: relative; padding-bottom: 15px; ' . (!isset($Timeline_Eventcontent) && !empty($section_icon) ? "height: 60px;" : "") . '">';
                     if (!empty($section_icon) && $section_icon != "transparent") {
                         $output .= '<div class="ts-timeline-css-icon ts-timeline-css-icon-half" style="' . (!isset($Timeline_Eventcontent) ? "display: inline-block; width: 100%; left: 0;" : "") . '"><i class="' . $section_icon . '" style="color: ' . $icon_color . ';"></i></div>';
                     }
                     if (isset($Timeline_Eventcontent)) {
                         $output .= '<div class="ts-timeline-css-text-wrap-inner" style="' . (empty($section_icon) ? "width: 100%; height: 100%; left: 0;" : "") . '">';
                         if (function_exists('wpb_js_remove_wpautop')) {
                             $output .= '<div class="ts-timeline-css-text" style="">' . wpb_js_remove_wpautop(do_shortcode($Timeline_Eventcontent), true) . '</div>';
                         } else {
                             $output .= '<div class="ts-timeline-css-text" style="">' . do_shortcode($Timeline_Eventcontent) . '</div>';
                         }
                         $output .= '</div>';
                     }
                     $output .= '</div>';
                     if (!empty($a_href) && !empty($button_string)) {
                         $output .= '<div class="ts-timeline-css-button-container">';
                         $output .= $button_string;
                         $output .= '</div>';
                     }
                 }
                 if ($Section_Tags != '') {
                     $output .= '<div class="ts-timeline-css-output-tags"><i class="dashicons dashicons-tag"></i><span>' . str_replace(",", ", ", $Section_Tags) . '</span></div>';
                 }
                 if ($Section_Categories != '') {
                     $output .= '<div class="ts-timeline-css-output-cats"><i class="dashicons dashicons-category"></i><span>' . str_replace(",", ", ", $Section_Categories) . '</span></div>';
                 }
             }
             $output .= '<div class="clearFixMe"></div>';
             $output .= '</div>';
             $output .= '</div>';
         }
         // Timeline Break
         if ($Timeline_Type == "break") {
             if (!isset($Timeline_Breakcontent)) {
                 $title_margin = ' margin: 0 !important; padding: 0;';
             } else {
                 $title_margin = '';
             }
             if (isset($Timeline_Breakfull)) {
                 if ($Timeline_Breakfull == "true") {
                     $break_width = 'width: 98%; margin-left: 1%; margin-right: 1%;';
                     $break_data = 'true';
                 } else {
                     $break_width = 'width: 50%;';
                     $break_data = 'false';
                 }
             } else {
                 $break_width = 'width: 50%;';
                 $break_data = 'false';
             }
             if (isset($Timeline_Breakbackground)) {
                 $break_background = 'background: ' . $Timeline_Breakbackground . ';';
             } else {
                 $break_background = '';
             }
             $output .= '<div id="' . $timeline_id . '" class="ts-timeline-css-break ts-timeline-css-visible ' . $css_class . '" style="' . $break_width . ' ' . $vc_inline_style . '" data-fullwidth="' . $break_data . '" data-categories="' . $Section_Categories . '" data-tags="' . $Section_Tags . '" data-filtered-categories="false" data-filtered-tags="false">';
             $output .= '<div class="ts-timeline-css-text-wrap ' . $border_radius . ' ' . $tooltip_class . '" ' . $tooltip_content . ' style="' . $break_background . '">';
             $output .= '<div class="ts-timeline-css-text-wrap-inner" style="width: 100%; left: 0; ' . $title_margin . '">';
             if (isset($Timeline_Breaktitletext)) {
                 $output .= '<h3 class="ts-timeline-css-title" style="padding: 0 10px; text-align: ' . (isset($Timeline_Breaktitlealign) ? $Timeline_Breaktitlealign : $title_align) . '; color: ' . (isset($Timeline_Breaktitlecolor) ? $Timeline_Breaktitlecolor : $title_color) . ';' . $title_margin . '">' . $Timeline_Breaktitletext . '</h3>';
             }
             if (!empty($section_icon) && $section_icon != "transparent") {
                 $output .= '<div class="ts-timeline-css-icon ts-timeline-css-icon-break" style="margin: 10px auto;"><i class="' . $section_icon . '" style="color: ' . $icon_color . ';"></i></div>';
             }
             if (isset($Timeline_Breakcontent)) {
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '<div class="ts-timeline-css-text">' . wpb_js_remove_wpautop(do_shortcode($Timeline_Breakcontent), true) . '</div>';
                 } else {
                     $output .= '<div class="ts-timeline-css-text">' . do_shortcode($Timeline_Breakcontent) . '</div>';
                 }
             }
             $output .= '</div>';
             $output .= '<div class="clearFixMe"></div>';
             $output .= '</div>';
             $output .= '</div>';
         }
     } else {
         $output .= '<div id="' . $timeline_id . '" class="' . $css_class . ' ts-timeline-css-fullwidth" style="width: 98%; ' . $vc_inline_style . '">';
         $output .= '<div class="ts-timeline-css-text-wrap">';
         $output .= '<div class="ts-timeline-css-text-wrap-inner" style="width: 100%; left: 0; margin: 20px auto;">';
         $output .= '<div>Section ID: ' . $Section_ID . '</div>';
         $output .= '<div>Section Title: ' . $Section_Title . '</div>';
         $output .= '<div>Section Type: ' . ($Timeline_Type == "event" ? "Event" : "Break") . '</div>';
         $output .= '</div>';
         $output .= '<div class="clearFixMe"></div>';
         $output .= '</div>';
         $output .= '</div>';
     }
     echo $output;
     // Clear Out all Variables
     foreach ($custom_fields_array as $index => $array) {
         ${$custom_fields_array[$index]['name']} = "";
         unset(${$custom_fields_array[$index]['name']});
     }
     $custom_fields_array = '';
     $timeline_array = '';
     $category_fields = '';
     $media_string = '';
     $output = '';
     $myvariable = ob_get_clean();
     return $myvariable;
 }
function TS_VCSC_ComposerRowAdditions($output, $atts, $content = '')
{
    global $VISUAL_COMPOSER_EXTENSIONS;
    $TS_VCSC_RowToggleLimits = get_option('ts_vcsc_extend_settings_rowVisibilityLimits', $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_Row_Toggle_Defaults);
    $TS_VCSC_RowOffsetSettings = get_option('ts_vcsc_extend_settings_additionsOffsets', 0);
    ob_start();
    extract(shortcode_atts(array('ts_row_bg_retrieve' => 'single', 'ts_row_bg_image' => '', 'ts_row_bg_group' => '', 'ts_row_bg_source' => 'full', 'ts_row_bg_effects' => '', 'ts_row_break_parents' => 0, 'ts_row_blur_strength' => '', 'ts_row_raster_use' => 'false', 'ts_row_raster_type' => '', 'ts_row_overlay_use' => 'false', 'ts_row_overlay_color' => 'rgba(30,115,190,0.25)', 'ts_row_overlay_opacity' => 25, 'ts_row_zindex' => 0, 'ts_row_min_height' => 100, 'ts_row_screen_height' => 'false', 'ts_row_screen_offset' => 0, 'svg_top_on' => 'false', 'svg_top_style' => '1', 'svg_top_height' => 100, 'svg_top_flip' => 'false', 'svg_top_position' => 0, 'svg_top_color1' => '#ffffff', 'svg_top_color2' => '#ededed', 'svg_bottom_on' => 'false', 'svg_bottom_style' => '1', 'svg_bottom_height' => 100, 'svg_bottom_flip' => 'false', 'svg_bottom_position' => 0, 'svg_bottom_color1' => '#ffffff', 'svg_bottom_color2' => '#ededed', 'ts_row_bg_position' => 'center', 'ts_row_bg_position_custom' => '', 'ts_row_bg_alignment_h' => 'center', 'ts_row_bg_alignment_v' => 'center', 'ts_row_bg_repeat' => 'no-repeat', 'ts_row_bg_size_parallax' => 'cover', 'ts_row_bg_size_standard' => 'cover', 'ts_row_parallax_type' => 'up', 'ts_row_parallax_speed' => 20, 'ts_row_parallax_fade' => 1000, 'ts_row_slide_images' => '', 'ts_row_slide_auto' => 'true', 'ts_row_slide_controls' => 'true', 'ts_row_slide_shuffle' => 'false', 'ts_row_slide_delay' => 5000, 'ts_row_slide_bar' => 'true', 'ts_row_slide_transition' => 'random', 'ts_row_slide_switch' => 2000, 'ts_row_slide_halign' => 'center', 'ts_row_slide_valign' => 'center', 'ts_row_kenburns_animation' => 'null', 'ts_row_automove_scroll' => 'true', 'ts_row_automove_align' => 'horizontal', 'ts_row_automove_path_v' => 'topbottom', 'ts_row_automove_path_h' => 'leftright', 'ts_row_automove_speed' => 75, 'ts_row_movement_x_allow' => 'true', 'ts_row_movement_x_ratio' => 20, 'ts_row_movement_y_allow' => 'true', 'ts_row_movement_y_ratio' => 20, 'ts_row_movement_content' => 'false', 'ts_margin_left' => 0, 'ts_margin_right' => 0, 'margin_left' => 0, 'margin_right' => 0, 'padding_top' => 30, 'padding_bottom' => 30, 'enable_mobile' => 'false', 'single_color' => '#ffffff', 'gradiant_advanced' => 'false', 'gradient_generator' => '', 'gradient_angle' => 0, 'gradient_color_start' => '#cccccc', 'gradient_start_offset' => 0, 'gradient_color_end' => '#cccccc', 'gradient_end_offset' => 100, 'trianglify_render' => 'canvas', 'trianglify_colorsx' => 'random', 'trianglify_colorsy' => 'match_x', 'trianglify_generatorx' => '', 'trianglify_generatory' => '', 'trianglify_cellsize' => 50, 'trianglify_variance' => 0.75, 'ts_particles_count' => 30, 'ts_particles_size_max' => 10, 'ts_particles_size_scale' => 'true', 'ts_particles_size_anim' => 'false', 'ts_particles_color' => '#ffffff', 'ts_particles_stroke_width' => 0, 'ts_particles_stroke_color' => '#000000', 'ts_particles_back_type' => 'color', 'ts_particles_back_color' => '#b61924', 'ts_particles_back_image' => '', 'ts_particles_back_repeat' => 'no-repeat', 'ts_particles_back_place' => 'center center', 'ts_particles_back_size' => 'cover', 'ts_particles_shape_source' => 'internal', 'ts_particles_shape_types' => 'circle', 'ts_particles_shape_image' => '', 'ts_particles_link_lines' => 'true', 'ts_particles_link_color' => '#ffffff', 'ts_particles_link_width' => 1, 'ts_particles_hover' => 'false', 'ts_particles_click' => 'false', 'ts_particles_move' => 'true', 'ts_particles_direction' => 'none', 'ts_particles_speed' => 6, 'ts_particles_random' => 'false', 'ts_particles_straight' => 'false', 'video_youtube' => '', 'video_background' => '', 'video_mute' => 'true', 'video_loop' => 'false', 'video_remove' => 'false', 'video_start' => 'false', 'video_hover' => 'false', 'video_stop' => 'true', 'video_controls' => 'true', 'video_raster' => 'false', 'video_mp4' => '', 'video_ogv' => '', 'video_webm' => '', 'video_image' => '', 'multi_effect' => 'fixed', 'multi_speed' => 1, 'ts_equalize_columns' => 'false', 'ts_equalize_align' => 'center', 'ts_equalize_stack' => 'false', 'animation_factor' => '0.33', 'animation_scroll' => 'false', 'animation_view' => '', 'animation_speed' => 2000, 'show_large' => 'true', 'show_medium' => 'true', 'show_small' => 'true', 'show_extra' => 'true', 'show_remove' => 'true'), $atts));
    // Check for Frontend Editor Mode
    if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
        $frontend_edit = 'true';
    } else {
        $frontend_edit = 'false';
    }
    // Check if Extended Row Options Utilized
    if ($ts_row_bg_effects != "" || !empty($animation_view) || $ts_equalize_columns == 'true') {
        $extended_effects = "true";
    } else {
        $extended_effects = "false";
    }
    if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndWaypoints == "true" && $extended_effects == "true") {
        if (wp_script_is('waypoints', $list = 'registered')) {
            wp_enqueue_script('waypoints');
        } else {
            wp_enqueue_script('ts-extend-waypoints');
        }
    }
    if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false" && $extended_effects == "true") {
        wp_enqueue_style('ts-extend-animations');
        wp_enqueue_style('ts-visual-composer-extend-front');
        wp_enqueue_script('ts-visual-composer-extend-front');
    }
    $output = "";
    $randomizer = mt_rand(999999, 9999999);
    // Check for Row Padding/Margin Offsets
    if ($TS_VCSC_RowOffsetSettings == 0) {
        $row_offsetsallow = 'data-offsetsallow="false"';
        $padding_top = '0';
        $padding_bottom = '0';
        $margin_left = $ts_margin_left;
        $margin_right = $ts_margin_right;
    } else {
        $row_offsetsallow = 'data-offsetsallow="true"';
    }
    // Viewport Animations
    if (!empty($animation_view)) {
        $animation_css = "ts-viewport-css-" . $animation_view;
        $output .= '<div class="ts-viewport-row ts-viewport-animation" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-scrollup = "' . $animation_scroll . '" data-factor="' . $animation_factor . '" data-viewport="' . $animation_css . '" data-speed="' . $animation_speed . '"></div>';
    } else {
        $animation_css = '';
    }
    // CSS3 Blur Effect
    if ($ts_row_blur_strength != '') {
        $blur_class = "ts-background-blur " . $ts_row_blur_strength;
        if ($ts_row_blur_strength == "ts-background-blur-small") {
            $blur_factor = 2;
        } else {
            if ($ts_row_blur_strength == "ts-background-blur-medium") {
                $blur_factor = 5;
            } else {
                if ($ts_row_blur_strength == "ts-background-blur-strong") {
                    $blur_factor = 8;
                }
            }
        }
    } else {
        $blur_class = "";
        $blur_factor = 0;
    }
    // Raster (Noise) Overlay
    if ($ts_row_raster_use == "true" && $ts_row_raster_type != '') {
        $raster_content = '<div class="ts-background-raster" style="background-image: url(' . $ts_row_raster_type . ');"></div>';
    } else {
        $raster_content = '';
    }
    // Color Overlay
    if ($ts_row_overlay_use == "true" && $ts_row_overlay_color != '') {
        $overlay_content = '<div class="ts-background-overlay" style="background: ' . $ts_row_overlay_color . ';"></div>';
    } else {
        $overlay_content = '';
    }
    // SVG Shape Overlays
    $svg_enabled = 'false';
    if ($svg_top_on == "true") {
        $svg_top_content = '<div id="ts-background-separator-top-' . $randomizer . '" class="ts-background-separator-container" style="height: ' . $svg_top_height . 'px; top: ' . $svg_top_position . 'px; bottom: auto; z-index: ' . (1 + $ts_row_zindex) . ';"><div class="ts-background-separator-wrap ts-background-separator-top' . ($svg_top_flip == "true" ? "-flip" : "") . '" data-random="' . $randomizer . '" data-height="' . $svg_top_height . '" data-position="top" style="height: ' . $svg_top_height . 'px;">' . TS_VCSC_GetRowSeparator($svg_top_style, $svg_top_color1, $svg_top_color2, $svg_top_height) . '</div></div>';
        $svg_enabled = 'true';
    } else {
        $svg_top_content = '';
    }
    if ($svg_bottom_on == "true") {
        $svg_bottom_content = '<div id="ts-background-separator-bottom-' . $randomizer . '" class="ts-background-separator-container" style="height: ' . $svg_bottom_height . 'px; top: auto; bottom: ' . $svg_bottom_position . 'px; z-index: ' . (1 + $ts_row_zindex) . ';"><div class="ts-background-separator-wrap ts-background-separator-bottom' . ($svg_bottom_flip == "true" ? "-flip" : "") . '" data-random="' . $randomizer . '" data-height="' . $svg_bottom_height . '" data-position="bottom" style="height: ' . $svg_bottom_height . 'px;">' . TS_VCSC_GetRowSeparator($svg_bottom_style, $svg_bottom_color1, $svg_bottom_color2, $svg_bottom_height) . '</div></div>';
        $svg_enabled = 'true';
    } else {
        $svg_bottom_content = '';
    }
    // Column Equalize Settings
    if ($ts_equalize_columns == 'true') {
        $column_equalize_string = 'data-column-equalize="true" data-column-align="' . $ts_equalize_align . '" data-column-stack="' . $ts_equalize_stack . '"';
        $column_equalize_class = 'ts-columns-equalize-enabled';
    } else {
        $column_equalize_string = 'data-column-equalize="false"';
        $column_equalize_class = 'ts-columns-equalize-disabled';
    }
    // Row Toggle Settings
    $row_toggle_limits = $TS_VCSC_RowToggleLimits;
    $large_default = 'true';
    $large_limit = $row_toggle_limits['Large Devices'];
    $medium_default = 'true';
    $medium_limit = $row_toggle_limits['Medium Devices'];
    $small_default = 'true';
    $small_limit = $row_toggle_limits['Small Devices'];
    $extra_default = 'true';
    $extra_limit = 0;
    if (($large_default != $show_large || $medium_default != $show_medium || $small_default != $show_small || $extra_default != $show_extra) && $frontend_edit == "false") {
        $row_toggle_trigger = 'true';
        $row_toggle_class = $column_equalize_class . ' ts-composium-row-background ts-device-visibility';
        $row_toggle_string = $column_equalize_string . ' data-width-current="" data-width-break="' . get_option('ts_vcsc_extend_settings_additionsRowEffectsBreak', '600') . '" data-showremove="' . $show_remove . '" data-largeshow="' . $show_large . '" data-largelimit="' . $large_limit . '" data-mediumshow="' . $show_medium . '" data-mediumlimit="' . $medium_limit . '" data-smallshow="' . $show_small . '" data-smalllimit="' . $small_limit . '" data-extrashow="' . $show_extra . '" data-extralimit="' . $extra_limit . '"';
    } else {
        $row_toggle_trigger = 'false';
        $row_toggle_class = $column_equalize_class . ' ts-composium-row-background';
        $row_toggle_string = $column_equalize_string . ' data-width-current="" data-width-break="' . get_option('ts_vcsc_extend_settings_additionsRowEffectsBreak', '600') . '"';
    }
    // Ken Burns Effect
    if ($ts_row_kenburns_animation != 'null') {
        if ($ts_row_kenburns_animation == 'random') {
            $kenburns_effects = array('centerZoom', 'centerZoomFadeOut', 'centerZoomFadeIn', 'kenburns', 'kenburnsLeft', 'kenburnsRight', 'kenburnsUp', 'kenburnsUpLeft', 'kenburnsUpRight', 'kenburnsDown', 'kenburnsDownLeft', 'kenburnsDownRight');
            $kenburns_animation = 'ts-css-animation-' . $kenburns_effects[array_rand($kenburns_effects, 1)];
        } else {
            $kenburns_animation = 'ts-css-animation-' . $ts_row_kenburns_animation;
        }
        $kenburns_string = 'data-kenburns-set="true" data-kenburns-animation="' . $kenburns_animation . '"';
    } else {
        $kenburns_animation = '';
        $kenburns_string = 'data-kenburns-set="false"';
    }
    // No Background Effect
    if ($row_toggle_trigger == "true") {
        if ($ts_row_bg_effects == "") {
            $output .= '<div id="' . $row_toggle_class . '-' . $randomizer . '" class="' . $row_toggle_class . '" ' . $row_toggle_string . '></div>';
        }
    } else {
        if ($ts_equalize_columns == 'true') {
            if ($ts_row_bg_effects == "") {
                $output .= '<div id="' . $row_toggle_class . '-' . $randomizer . '" class="' . $row_toggle_class . '" ' . $row_toggle_string . '></div>';
            }
        }
    }
    // Single Image or Group
    if ($ts_row_bg_effects == "image" || $ts_row_bg_effects == "fixed" || $ts_row_bg_effects == "parallax" || $ts_row_bg_effects == "automove" || $ts_row_bg_effects == "movement") {
        if ($ts_row_bg_retrieve == 'random') {
            $ts_row_bg_group = explode(',', $ts_row_bg_group);
            if (is_array($ts_row_bg_group)) {
                $ts_row_bg_image = $ts_row_bg_group[array_rand($ts_row_bg_group)];
            } else {
                $ts_row_bg_image = '';
            }
        } else {
            if ($ts_row_bg_retrieve == 'single') {
                $ts_row_bg_image = $ts_row_bg_image;
            }
        }
    }
    // Simple Background Image
    if ($ts_row_bg_effects == "image") {
        $ts_row_bg_image_url = wp_get_attachment_image_src($ts_row_bg_image, $ts_row_bg_source);
        if ($ts_row_bg_position == "custom") {
            $ts_row_bg_position = $ts_row_bg_position_custom;
        }
        $output .= "<div id='ts-background-main-" . $randomizer . "' class='ts-background-image ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " " . $kenburns_string . " " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' data-image-width='" . $ts_row_bg_image_url[1] . "' data-image-height='" . $ts_row_bg_image_url[2] . "' data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-image='" . $ts_row_bg_image_url[0] . "' data-size='" . $ts_row_bg_size_standard . "' data-position='" . esc_attr($ts_row_bg_position) . "' data-repeat='" . $ts_row_bg_repeat . "' data-break-parents='" . esc_attr($ts_row_break_parents) . "'>";
        if ($ts_row_kenburns_animation != 'null') {
            $output .= '<div class="ts-background-kenburns-wrapper"><div class="ts-background-kenburns-parent"><div class="ts-background-kenburns-image ' . $kenburns_animation . '"></div></div></div>';
        }
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= "</div>";
    }
    // Fixed Background Image
    if ($ts_row_bg_effects == "fixed") {
        $ts_row_bg_image_url = wp_get_attachment_image_src($ts_row_bg_image, $ts_row_bg_source);
        if ($ts_row_bg_position == "custom") {
            $ts_row_bg_position = $ts_row_bg_position_custom;
        }
        $output .= "<div id='ts-background-main-" . $randomizer . "' class='ts-background-fixed ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' data-image-width='" . $ts_row_bg_image_url[1] . "' data-image-height='" . $ts_row_bg_image_url[2] . "' data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-image='" . $ts_row_bg_image_url[0] . "' data-size='" . $ts_row_bg_size_standard . "' data-position='" . esc_attr($ts_row_bg_position) . "' data-repeat='" . $ts_row_bg_repeat . "' data-break-parents='" . esc_attr($ts_row_break_parents) . "'>";
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= "</div>";
    }
    // Image Slideshow Background
    if ($ts_row_bg_effects == "slideshow") {
        wp_enqueue_style('ts-extend-vegas');
        wp_enqueue_script('ts-extend-vegas');
        $slider_settings = 'data-initialized="false" data-autoplay="' . $ts_row_slide_auto . '" data-playing="' . $ts_row_slide_auto . '" data-halign="' . $ts_row_slide_halign . '" data-valign="' . $ts_row_slide_valign . '" data-controls="' . $ts_row_slide_controls . '" data-shuffle="' . $ts_row_slide_shuffle . '" data-delay="' . $ts_row_slide_delay . '" data-bar="' . $ts_row_slide_bar . '" data-transition="' . $ts_row_slide_transition . '" data-switch="' . $ts_row_slide_switch . '" data-animation="' . $ts_row_kenburns_animation . '"';
        $output .= "<div id='ts-background-main-" . $randomizer . "' class='ts-background-slideshow ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' " . $slider_settings . " data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-size='" . $ts_row_bg_size_standard . "' data-position='" . esc_attr($ts_row_bg_position) . "' data-repeat='" . $ts_row_bg_repeat . "' data-break-parents='" . esc_attr($ts_row_break_parents) . "'>";
        $slide_images = explode(',', $ts_row_slide_images);
        $i = 0;
        foreach ($slide_images as $single_image) {
            $i++;
            $slide_image = wp_get_attachment_image_src($single_image, $ts_row_bg_source);
            $output .= '<div class="ts-background-slideshow-holder" style="display: none;" data-image="' . $slide_image[0] . '" data-width="' . $slide_image[1] . '" data-height="' . $slide_image[2] . '" data-ratio="' . $slide_image[1] / $slide_image[2] . '"></div>';
        }
        $output .= '<div class="ts-background-slideshow-wrapper"></div>';
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        if ($ts_row_slide_controls == 'true') {
            // Left / Right Navigation
            $output .= '<nav id="nav-arrows-' . $randomizer . '" class="nav-arrows">';
            $output .= '<span class="nav-arrow-prev" style="text-indent: -90000px;">Previous</span>';
            $output .= '<span class="nav-arrow-next" style="text-indent: -90000px;">Next</span>';
            $output .= '</nav>';
        }
        if ($ts_row_slide_auto == 'true') {
            // Auto-Play Controls
            $output .= '<nav id="nav-auto-' . $randomizer . '" class="nav-auto">';
            $output .= '<span class="nav-auto-play" style="display: none; text-indent: -90000px;">Play</span>';
            $output .= '<span class="nav-auto-pause" style="text-indent: -90000px;">Pause</span>';
            $output .= '</nav>';
        }
        $output .= '</div>';
    }
    // Parallax Background
    if ($ts_row_bg_effects == "parallax") {
        $parallaxClass = $ts_row_parallax_type == "none" ? "" : "ts-background-parallax";
        $parallaxClass = in_array($ts_row_parallax_type, array("none", "fixed", "up", "down", "left", "right", "ts-background-parallax")) ? $parallaxClass : "";
        if ($ts_row_parallax_type == "up" || $ts_row_parallax_type == "down") {
            $ts_row_bg_alignment = $ts_row_bg_alignment_v;
        } else {
            if ($ts_row_parallax_type == "left" || $ts_row_parallax_type == "right") {
                $ts_row_bg_alignment = $ts_row_bg_alignment_h;
            }
        }
        if (!empty($parallaxClass)) {
            $ts_row_bg_image_url = wp_get_attachment_image_src($ts_row_bg_image, $ts_row_bg_source);
            $ts_row_parallax_speed = round($ts_row_parallax_speed / 100, 2);
            $output .= "<div id='ts-background-main-" . $randomizer . "' class='" . esc_attr($parallaxClass) . " ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " data-completed='false' data-fadespeed='" . $ts_row_parallax_fade . "' " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' data-image-width='" . $ts_row_bg_image_url[1] . "' data-image-height='" . $ts_row_bg_image_url[2] . "' data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-disabled='false' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-image='" . $ts_row_bg_image_url[0] . "' data-size='" . $ts_row_bg_size_parallax . "' data-position='" . esc_attr($ts_row_bg_position) . "' data-alignment='" . $ts_row_bg_alignment . "' data-repeat='" . $ts_row_bg_repeat . "' data-direction='" . esc_attr($ts_row_parallax_type) . "' data-momentum='" . esc_attr((double) $ts_row_parallax_speed) . "' data-mobile-enabled='" . esc_attr($enable_mobile) . "' data-break-parents='" . esc_attr($ts_row_break_parents) . "'>";
            $output .= "<div id='ts-background-parallax-holder-" . $randomizer . "' class='ts-background-parallax-holder'></div>";
            $output .= $svg_top_content;
            $output .= $overlay_content;
            $output .= $raster_content;
            $output .= $svg_bottom_content;
            $output .= "</div>";
        }
    }
    // AutoMove Background
    if ($ts_row_bg_effects == "automove") {
        $ts_row_bg_image_url = wp_get_attachment_image_src($ts_row_bg_image, $ts_row_bg_source);
        if ($ts_row_automove_align == "horizontal") {
            $ts_row_automove_path = $ts_row_automove_path_h;
        } else {
            if ($ts_row_automove_align == "vertical") {
                $ts_row_automove_path = $ts_row_automove_path_v;
            }
        }
        $output .= "<div id='ts-background-main-" . $randomizer . "' class='ts-background-automove ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' data-image-width='" . $ts_row_bg_image_url[1] . "' data-image-height='" . $ts_row_bg_image_url[2] . "' data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-image='" . $ts_row_bg_image_url[0] . "' data-size='" . $ts_row_bg_size_parallax . "' data-position='" . esc_attr($ts_row_bg_position) . "' data-repeat='repeat 0 0' data-scroll='" . $ts_row_automove_scroll . "' data-alignment='" . $ts_row_automove_align . "' data-direction='" . $ts_row_automove_path . "' data-speed='" . $ts_row_automove_speed . "' data-break-parents='" . esc_attr($ts_row_break_parents) . "'>";
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= "</div>";
    }
    // Movement Background
    if ($ts_row_bg_effects == "movement") {
        wp_enqueue_script('ts-extend-parallaxify');
        $ts_row_bg_image_url = wp_get_attachment_image_src($ts_row_bg_image, $ts_row_bg_source);
        $ts_row_movement_data = ' data-allowx="' . $ts_row_movement_x_allow . '" data-movex="' . $ts_row_movement_x_ratio . '" data-allowy="' . $ts_row_movement_y_allow . '" data-movey="' . $ts_row_movement_y_ratio . '" data-allowcontent="' . $ts_row_movement_content . '"';
        $output .= "<div id='ts-background-main-" . $randomizer . "' class='ts-background-movement ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' data-image-width='" . $ts_row_bg_image_url[1] . "' data-image-height='" . $ts_row_bg_image_url[2] . "' data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-disabled='false' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-image='" . $ts_row_bg_image_url[0] . "' data-size='" . $ts_row_bg_size_parallax . "' data-position='" . esc_attr($ts_row_bg_position) . "' data-repeat='" . $ts_row_bg_repeat . "' data-mobile-enabled='" . esc_attr($enable_mobile) . "' data-break-parents='" . esc_attr($ts_row_break_parents) . "' " . $ts_row_movement_data . ">";
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= "</div>";
    }
    // Particles Background
    if ($ts_row_bg_effects == "particles") {
        wp_enqueue_script('ts-extend-particles');
        if ($ts_particles_back_type == "image") {
            $ts_particles_back_image = wp_get_attachment_image_src($ts_particles_back_image, 'full');
            $ts_particles_back_image = $ts_particles_back_image[0];
        }
        if ($ts_particles_shape_source == "external") {
            $ts_particles_shape_image = wp_get_attachment_image_src($ts_particles_shape_image, 'full');
            $ts_particles_shape_width = $ts_particles_shape_image[1];
            $ts_particles_shape_height = $ts_particles_shape_image[2];
            $ts_particles_shape_image = $ts_particles_shape_image[0];
        } else {
            $ts_particles_shape_width = 100;
            $ts_particles_shape_height = 100;
        }
        $ts_row_particles_data = 'data-particles-count="' . $ts_particles_count . '" data-particles-sizemax="' . $ts_particles_size_max . '" data-particles-sizescale="' . $ts_particles_size_scale . '" data-particles-sizeanimate="' . $ts_particles_size_anim . '"';
        $ts_row_particles_data .= ' data-particles-shapesource="' . $ts_particles_shape_source . '" data-particles-shapetypes="' . $ts_particles_shape_types . '" data-particles-shapeimage="' . $ts_particles_shape_image . '" data-particles-shapewidth="' . $ts_particles_shape_width . '"';
        $ts_row_particles_data .= ' data-particles-color="' . $ts_particles_color . '" data-particles-strokewidth="' . $ts_particles_stroke_width . '" data-particles-strokecolor="' . $ts_particles_stroke_color . '" data-particles-linklines="' . $ts_particles_link_lines . '" data-particles-linkcolor="' . $ts_particles_link_color . '" data-particles-linkwidth="' . $ts_particles_link_width . '" data-particles-interhover="' . $ts_particles_hover . '" data-particles-interclick="' . $ts_particles_click . '"';
        $ts_row_particles_data .= ' data-particles-backtype="' . $ts_particles_back_type . '" data-particles-backcolor="' . $ts_particles_back_color . '" data-particles-backimage="' . $ts_particles_back_image . '" data-particles-backrepeat="' . $ts_particles_back_repeat . '" data-particles-backposition="' . $ts_particles_back_place . '" data-particles-backsize="' . $ts_particles_back_size . '" data-particles-shapeheight="' . $ts_particles_shape_height . '"';
        $ts_row_particles_data .= ' data-particles-moveallow="' . $ts_particles_move . '" data-particles-movedirection="' . $ts_particles_direction . '" data-particles-movespeed="' . $ts_particles_speed . '" data-particles-moverandom="' . $ts_particles_random . '" data-particles-movestraight="' . $ts_particles_straight . '"';
        $output .= "<div id='ts-background-main-" . $randomizer . "' class='ts-background-particles ts-background " . $row_toggle_class . " " . $blur_class . "' " . $row_toggle_string . " " . $row_offsetsallow . " data-svgshape='" . $svg_enabled . "' data-random='" . $randomizer . "' data-type='" . $ts_row_bg_effects . "' data-inline='" . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . "' data-disabled='false' data-height='" . $ts_row_min_height . "' data-screen='" . $ts_row_screen_height . "' data-offset='" . $ts_row_screen_offset . "' data-blur='" . $blur_factor . "' data-index='" . $ts_row_zindex . "' data-marginleft='" . $margin_left . "' data-marginright='" . $margin_right . "' data-paddingtop='" . $padding_top . "' data-paddingbottom='" . $padding_bottom . "' data-size='cover' data-position='center center' data-repeat='no-repeat' data-mobile-enabled='false' data-break-parents='" . esc_attr($ts_row_break_parents) . "' " . $ts_row_particles_data . ">";
        $output .= '<div id="ts-background-particles-holder-' . $randomizer . '" class="ts-background-particles-holder" style=""></div>';
        $output .= $svg_top_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= "</div>";
    }
    // Selfhosted Video Background I
    if ($ts_row_bg_effects == "video") {
        wp_enqueue_style('ts-font-mediaplayer');
        wp_enqueue_style('ts-extend-wallpaper');
        wp_enqueue_script('ts-extend-wallpaper');
        if (!empty($video_image)) {
            $video_image_url = wp_get_attachment_image_src($video_image, 'full');
            $video_image_url = $video_image_url[0];
        } else {
            $video_image_url = "";
        }
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-video ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-raster="' . ($ts_row_raster_use == "true" && $ts_row_raster_type != '' ? $ts_row_raster_type : "") . '" data-overlay="' . ($ts_row_overlay_use == "true" && $ts_row_overlay_color != '' ? $ts_row_overlay_color : "") . '" data-mp4="' . $video_mp4 . '" data-ogv="' . $video_ogv . '" data-webm="' . $video_webm . '" data-image="' . $video_image_url . '" data-controls="' . $video_controls . '" data-start="' . $video_start . '" data-stop="' . $video_stop . '" data-hover="' . $video_hover . '" data-loop="' . $video_loop . '" data-remove="' . $video_remove . '" data-mute="' . $video_mute . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        $output .= '<div class="ts-background-video-holder" style=""></div>';
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    // Selfhosted Video Background II
    if ($ts_row_bg_effects == "videomb") {
        wp_enqueue_style('ts-font-mediaplayer');
        wp_enqueue_script('ts-extend-multibackground');
        if (!empty($video_image)) {
            $video_image_url = wp_get_attachment_image_src($video_image, 'full');
            $video_image_url = $video_image_url[0];
        } else {
            $video_image_url = "";
        }
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-multiback ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' data-attachment="' . $multi_effect . '" data-parallax="' . $multi_speed . '" ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-raster="' . ($ts_row_raster_use == "true" && $ts_row_raster_type != '' ? $ts_row_raster_type : "") . '" data-overlay="' . ($ts_row_overlay_use == "true" && $ts_row_overlay_color != '' ? $ts_row_overlay_color : "") . '" data-mp4="' . $video_mp4 . '" data-ogv="' . $video_ogv . '" data-webm="' . $video_webm . '" data-image="' . $video_image_url . '" data-controls="' . $video_controls . '" data-start="' . $video_start . '" data-stop="' . $video_stop . '" data-hover="' . $video_hover . '" data-loop="' . $video_loop . '" data-remove="' . $video_remove . '" data-mute="' . $video_mute . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        $output .= '<div class="ts-background-video-holder" style=""></div>';
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    // Youtube Video Background I
    if ($ts_row_bg_effects == "youtube") {
        wp_enqueue_script('ts-extend-ytplayer');
        wp_enqueue_style('ts-extend-ytplayer');
        if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $video_youtube)) {
            $video_youtube = $video_youtube;
        } else {
            $video_youtube = 'https://www.youtube.com/watch?v=' . $video_youtube;
        }
        if (!empty($video_background)) {
            $video_background = wp_get_attachment_image_src($video_background, 'full');
            $video_background = $video_background[0];
        } else {
            $video_background = TS_VCSC_VideoImage_Youtube($video_youtube);
        }
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-youtube ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-image="' . $video_background . '" data-video="' . $video_youtube . '" data-controls="' . $video_controls . '" data-start="' . $video_start . '" data-stop="' . $video_stop . '" data-hover="' . $video_hover . '" data-raster="' . $video_raster . '" data-mute="' . $video_mute . '" data-loop="' . $video_loop . '" data-remove="' . $video_remove . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    // Youtube Video Background II
    if ($ts_row_bg_effects == "youtubemb") {
        wp_enqueue_script('ts-extend-multibackground');
        if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $video_youtube)) {
            $video_youtube = TS_VCSC_VideoID_Youtube($video_youtube);
        } else {
            $video_youtube = $video_youtube;
        }
        if (!empty($video_background)) {
            $video_background = wp_get_attachment_image_src($video_background, 'full');
            $video_background = $video_background[0];
        } else {
            $video_background = TS_VCSC_VideoImage_Youtube($video_youtube);
        }
        wp_enqueue_script('ts-extend-multibackground');
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-multiback ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' data-attachment="' . $multi_effect . '" data-parallax="' . $multi_speed . '" ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-image="' . $video_background . '" data-video="' . $video_youtube . '" data-controls="' . $video_controls . '" data-start="' . $video_start . '" data-stop="' . $video_stop . '" data-hover="' . $video_hover . '" data-raster="' . $video_raster . '" data-mute="' . $video_mute . '" data-loop="' . $video_loop . '" data-remove="' . $video_remove . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        $output .= '<div class="ts-background-video-holder multibackground" style=""></div>';
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    // Vimeo Video Background
    if ($ts_row_bg_effects == "vimeo") {
    }
    // Trianglify Background
    if ($ts_row_bg_effects == "triangle") {
        wp_enqueue_script('ts-extend-trianglify');
        $trianglify_predefined = array("YlGn" => "#ffffe5,#f7fcb9,#d9f0a3,#addd8e,#78c679,#41ab5d,#238443,#006837,#004529", "YlGnBu" => "#ffffd9,#edf8b1,#c7e9b4,#7fcdbb,#41b6c4,#1d91c0,#225ea8,#253494,#081d58", "GnBu" => "#f7fcf0,#e0f3db,#ccebc5,#a8ddb5,#7bccc4,#4eb3d3,#2b8cbe,#0868ac,#084081", "BuGn" => "#f7fcfd,#e5f5f9,#ccece6,#99d8c9,#66c2a4,#41ae76,#238b45,#006d2c,#00441b", "PuBuGn" => "#fff7fb,#ece2f0,#d0d1e6,#a6bddb,#67a9cf,#3690c0,#02818a,#016c59,#014636", "PuBu" => "#fff7fb,#ece7f2,#d0d1e6,#a6bddb,#74a9cf,#3690c0,#0570b0,#045a8d,#023858", "BuPu" => "#f7fcfd,#e0ecf4,#bfd3e6,#9ebcda,#8c96c6,#8c6bb1,#88419d,#810f7c,#4d004b", "RdPu" => "#fff7f3,#fde0dd,#fcc5c0,#fa9fb5,#f768a1,#dd3497,#ae017e,#7a0177,#49006a", "PuRd" => "#f7f4f9,#e7e1ef,#d4b9da,#c994c7,#df65b0,#e7298a,#ce1256,#980043,#67001f", "OrRd" => "#fff7ec,#fee8c8,#fdd49e,#fdbb84,#fc8d59,#ef6548,#d7301f,#b30000,#7f0000", "YlOrRd" => "#ffffcc,#ffeda0,#fed976,#feb24c,#fd8d3c,#fc4e2a,#e31a1c,#bd0026,#800026", "YlOrBr" => "#ffffe5,#fff7bc,#fee391,#fec44f,#fe9929,#ec7014,#cc4c02,#993404,#662506", "Purples" => "#fcfbfd,#efedf5,#dadaeb,#bcbddc,#9e9ac8,#807dba,#6a51a3,#54278f,#3f007d", "Blues" => "#f7fbff,#deebf7,#c6dbef,#9ecae1,#6baed6,#4292c6,#2171b5,#08519c,#08306b", "Greens" => "#f7fcf5,#e5f5e0,#c7e9c0,#a1d99b,#74c476,#41ab5d,#238b45,#006d2c,#00441b", "Oranges" => "#fff5eb,#fee6ce,#fdd0a2,#fdae6b,#fd8d3c,#f16913,#d94801,#a63603,#7f2704", "Reds" => "#fff5f0,#fee0d2,#fcbba1,#fc9272,#fb6a4a,#ef3b2c,#cb181d,#a50f15,#67000d", "Greys" => "#ffffff,#f0f0f0,#d9d9d9,#bdbdbd,#969696,#737373,#525252,#252525,#000000", "PuOr" => "#7f3b08,#b35806,#e08214,#fdb863,#fee0b6,#f7f7f7,#d8daeb,#b2abd2,#8073ac,#542788,#2d004b", "BrBG" => "#543005,#8c510a,#bf812d,#dfc27d,#f6e8c3,#f5f5f5,#c7eae5,#80cdc1,#35978f,#01665e,#003c30", "PRGn" => "#40004b,#762a83,#9970ab,#c2a5cf,#e7d4e8,#f7f7f7,#d9f0d3,#a6dba0,#5aae61,#1b7837,#00441b", "PiYG" => "#8e0152,#c51b7d,#de77ae,#f1b6da,#fde0ef,#f7f7f7,#e6f5d0,#b8e186,#7fbc41,#4d9221,#276419", "RdBu" => "#67001f,#b2182b,#d6604d,#f4a582,#fddbc7,#f7f7f7,#d1e5f0,#92c5de,#4393c3,#2166ac,#053061", "RdGy" => "#67001f,#b2182b,#d6604d,#f4a582,#fddbc7,#ffffff,#e0e0e0,#bababa,#878787,#4d4d4d,#1a1a1a", "RdYlBu" => "#a50026,#d73027,#f46d43,#fdae61,#fee090,#ffffbf,#e0f3f8,#abd9e9,#74add1,#4575b4,#313695", "Spectral" => "#9e0142,#d53e4f,#f46d43,#fdae61,#fee08b,#ffffbf,#e6f598,#abdda4,#66c2a5,#3288bd,#5e4fa2", "RdYlGn" => "#a50026,#d73027,#f46d43,#fdae61,#fee08b,#ffffbf,#d9ef8b,#a6d96a,#66bd63,#1a9850,#006837", "Accent" => "#7fc97f,#beaed4,#fdc086,#ffff99,#386cb0,#f0027f,#bf5b17,#666666", "Dark2" => "#1b9e77,#d95f02,#7570b3,#e7298a,#66a61e,#e6ab02,#a6761d,#666666", "Paired" => "#a6cee3,#1f78b4,#b2df8a,#33a02c,#fb9a99,#e31a1c,#fdbf6f,#ff7f00,#cab2d6,#6a3d9a,#ffff99,#b15928", "Pastel1" => "#fbb4ae,#b3cde3,#ccebc5,#decbe4,#fed9a6,#ffffcc,#e5d8bd,#fddaec,#f2f2f2", "Pastel2" => "#b3e2cd,#fdcdac,#cbd5e8,#f4cae4,#e6f5c9,#fff2ae,#f1e2cc,#cccccc", "Set1" => "#e41a1c,#377eb8,#4daf4a,#984ea3,#ff7f00,#ffff33,#a65628,#f781bf,#999999", "Set2" => "#66c2a5,#fc8d62,#8da0cb,#e78ac3,#a6d854,#ffd92f,#e5c494,#b3b3b3", "Set3" => "#8dd3c7,#ffffb3,#bebada,#fb8072,#80b1d3,#fdb462,#b3de69,#fccde5,#d9d9d9,#bc80bd,#ccebc5,#ffed6f");
        // Horizontal Pattern
        if ($trianglify_colorsx == "random") {
            //$trianglify_random			= rand(0, count($trianglify_predefined) - 1);
            //$trianglify_allkeys			= array_keys($trianglify_predefined)[$trianglify_random];
            //$trianglify_stringx			= $trianglify_predefined[$trianglify_allkeys];
            $trianglify_stringx = $trianglify_predefined[array_rand($trianglify_predefined)];
        } else {
            if ($trianglify_colorsx == "custom") {
                $trianglify_array = explode(";", $trianglify_generatorx);
                $trianglify_array = TS_VCSC_GetContentsBetween($trianglify_array[0], 'color-stop(', ')');
                $trianglify_stringx = array();
                $trianglyfy_position = 0;
                foreach ($trianglify_array as $key => $value) {
                    //$trianglify_stringx[]		= "#" . substr($value, (strrpos($value, '#') ? : -1) + 1) . "";
                    //$trianglify_stringx[]		= "#" . substr($value, (strrpos($value, '#') ? strrpos($value, '#') : -1) + 1) . "";
                    $trianglyfy_position = TS_VCSC_STRRPOS_String($value, '#', 0);
                    $trianglify_stringx[] = "#" . substr($value, ($trianglyfy_position != false ? $trianglyfy_position : -1) + 1) . "";
                }
                $trianglify_stringx = implode(",", $trianglify_stringx);
            } else {
                $trianglify_stringx = $trianglify_predefined[$trianglify_colorsx];
            }
        }
        // Vertical Pattern
        if ($trianglify_colorsy == "match_x") {
            $trianglify_stringy = $trianglify_stringx;
        } else {
            if ($trianglify_colorsy == "random") {
                //$trianglify_random		= rand(0, count($trianglify_predefined) - 1);
                //$trianglify_allkeys		= array_keys($trianglify_predefined)[$trianglify_random];
                //$trianglify_stringy		= $trianglify_predefined[$trianglify_allkeys];
                $trianglify_stringy = $trianglify_predefined[array_rand($trianglify_predefined)];
            } else {
                if ($trianglify_colorsy == "custom") {
                    $trianglify_array = explode(";", $trianglify_generatory);
                    $trianglify_array = TS_VCSC_GetContentsBetween($trianglify_array[0], 'color-stop(', ')');
                    $trianglify_stringy = array();
                    $trianglyfy_position = 0;
                    foreach ($trianglify_array as $key => $value) {
                        //$trianglify_stringy[]	= "#" . substr($value, (strrpos($value, '#') ? : -1) + 1) . "";
                        //$trianglify_stringy[]	= "#" . substr($value, (strrpos($value, '#') ? strrpos($value, '#') : -1) + 1) . "";
                        $trianglyfy_position = TS_VCSC_STRRPOS_String($value, '#', 0);
                        $trianglify_stringy[] = "#" . substr($value, ($trianglyfy_position != false ? $trianglyfy_position : -1) + 1) . "";
                    }
                    $trianglify_stringy = implode(",", $trianglify_stringy);
                } else {
                    $trianglify_stringy = $trianglify_predefined[$trianglify_colorsy];
                }
            }
        }
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-trianglify ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' data-render="' . $trianglify_render . '" data-cellsize="' . $trianglify_cellsize . '" data-variance="' . $trianglify_variance . '" data-colorsx="' . $trianglify_stringx . '" data-colorsy="' . $trianglify_stringy . '" ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-raster="' . $video_raster . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        $output .= '<div class="ts-background-trianglify-holder" style=""></div>';
        $output .= $svg_top_content;
        $output .= $overlay_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    // Single Color Background
    if ($ts_row_bg_effects == "single") {
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-single ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' style="display: none; background-color: ' . $single_color . ';" ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-color="' . $single_color . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        $output .= $svg_top_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    // Gradient Background
    if ($ts_row_bg_effects == "gradient") {
        if ($gradiant_advanced == 'false') {
            $gradient_css_attr[] = 'background: ' . $gradient_color_start . '';
            $gradient_css_attr[] = 'background: -moz-linear-gradient(' . $gradient_angle . 'deg, ' . $gradient_color_start . ' ' . $gradient_start_offset . '%, ' . $gradient_color_end . ' ' . $gradient_end_offset . '%)';
            $gradient_css_attr[] = 'background: -webkit-linear-gradient(' . $gradient_angle . 'deg, ' . $gradient_color_start . ' ' . $gradient_start_offset . '%, ' . $gradient_color_end . ' ' . $gradient_end_offset . '%)';
            $gradient_css_attr[] = 'background: -o-linear-gradient(' . $gradient_angle . 'deg, ' . $gradient_color_start . ' ' . $gradient_start_offset . '%, ' . $gradient_color_end . ' ' . $gradient_end_offset . '%)';
            $gradient_css_attr[] = 'background: -ms-linear-gradient(' . $gradient_angle . 'deg, ' . $gradient_color_start . ' ' . $gradient_start_offset . '%, ' . $gradient_color_end . ' ' . $gradient_end_offset . '%)';
            $gradient_css_attr[] = 'background: linear-gradient(' . $gradient_angle . 'deg, ' . $gradient_color_start . ' ' . $gradient_start_offset . '%, ' . $gradient_color_end . ' ' . $gradient_end_offset . '%)';
            $gradient_css_attr = implode('; ', $gradient_css_attr);
        } else {
            $gradient_css_attr = $gradient_generator;
        }
        $output .= '<div id="ts-background-main-' . $randomizer . '" class="ts-background-gradient ts-background ' . $row_toggle_class . '" ' . $row_toggle_string . ' ' . $kenburns_string . ' style="display: none; ' . ($ts_row_kenburns_animation == 'null' ? $gradient_css_attr : '') . '" ' . $row_offsetsallow . ' data-svgshape="' . $svg_enabled . '" data-random="' . $randomizer . '" data-type="' . $ts_row_bg_effects . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-height="' . $ts_row_min_height . '" data-screen="' . $ts_row_screen_height . '" data-offset="' . $ts_row_screen_offset . '" data-blur="' . $blur_factor . '" data-index="' . $ts_row_zindex . '" data-marginleft="' . $margin_left . '" data-marginright="' . $margin_right . '" data-paddingtop="' . $padding_top . '" data-paddingbottom="' . $padding_bottom . '" data-break-parents="' . esc_attr($ts_row_break_parents) . '">';
        if ($ts_row_kenburns_animation != 'null') {
            $output .= '<div class="ts-background-kenburns-wrapper"><div class="ts-background-kenburns-parent"><div class="ts-background-kenburns-image ' . $kenburns_animation . '" style="' . $gradient_css_attr . '"></div></div></div>';
        }
        $output .= $svg_top_content;
        $output .= $raster_content;
        $output .= $svg_bottom_content;
        $output .= '</div>';
    }
    if ($frontend_edit == "false") {
        echo $output;
    }
    $myvariable = ob_get_clean();
    return $myvariable;
}
 function TS_VCSC_Timeline_Function_Single($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     extract(shortcode_atts(array('full_width' => 'false', 'featured_media' => 'none', 'featured_image' => '', 'featured_image_alt' => '', 'featured_slider' => '', 'featured_youtube_url' => '', 'featured_youtube_related' => 'false', 'featured_youtube_play' => 'false', 'featured_dailymotion_url' => '', 'featured_dailymotion_play' => 'false', 'featured_vimeo_url' => '', 'featured_vimeo_play' => 'false', 'featured_media_height' => 'height: 100%;', 'featured_media_width' => 100, 'featured_media_align' => 'center', 'link' => '', 'tooltip_css' => 'false', 'tooltip_position' => 'ts-simptip-position-top', 'tooltip_style' => '', 'button_align' => 'center', 'button_width' => 100, 'button_type' => 'square', 'button_square' => 'ts-button-3d', 'button_rounded' => 'ts-button-3d ts-button-rounded', 'button_pill' => 'ts-button-3d ts-button-pill', 'button_circle' => 'ts-button-3d ts-button-circle', 'button_size' => '', 'button_wrapper' => 'false', 'button_text' => '', 'button_change' => 'false', 'button_color' => '#666666', 'button_font' => 18, 'thumbnail_position' => 'bottom', 'thumbnail_height' => 100, 'lightbox_featured' => 'true', 'lightbox_group' => 'true', 'lightbox_group_name' => '', 'lightbox_size' => 'full', 'lightbox_effect' => 'random', 'lightbox_autoplay' => 'false', 'lightbox_speed' => 5000, 'lightbox_social' => 'true', 'lightbox_backlight' => 'auto', 'lightbox_backlight_color' => '#ffffff', 'number_images' => 1, 'auto_height' => 'true', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_bar' => 'false', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', "items_loop" => 'false', 'animation_in' => 'ts-viewport-css-flipInX', 'animation_out' => 'ts-viewport-css-slideOutDown', 'animation_mobile' => 'false', 'date_text' => '', 'title_text' => '', 'title_align' => 'center', 'title_color' => '#7c7979', 'icon' => '', 'icon_color' => '#7c7979', 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $media_string = '';
     $output = '';
     $randomizer = mt_rand(999999, 9999999);
     if (!empty($el_id)) {
         $timeline_id = $el_id;
     } else {
         $timeline_id = 'ts-vcsc-timeline-item-' . $randomizer;
     }
     // Media Layout
     if ($featured_media_align == "center") {
         $image_alignment = "margin: 5px auto; float: none;";
     } else {
         if ($featured_media_align == "left") {
             $image_alignment = "margin: 5px 0; float: left;";
         } else {
             if ($featured_media_align == "right") {
                 $image_alignment = "margin: 5px 0; float: right;";
             }
         }
     }
     $image_dimensions = 'width: 100%; height: auto;';
     $parent_dimensions = 'width: ' . $featured_media_width . '%; ' . $featured_media_height;
     if ($lightbox_backlight == "auto") {
         $nacho_color = '';
     } else {
         if ($lightbox_backlight == "custom") {
             $nacho_color = 'data-color="' . $lightbox_backlight_color . '"';
         } else {
             if ($lightbox_backlight == "hideit") {
                 $nacho_color = 'data-color="#000000"';
             }
         }
     }
     // Adjustment for Inline Edit Mode of VC
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $full_width = 'true';
         $vcinline_active = 'true';
         $vcinline_class = '';
         $vcinline_slider = 'owl-carousel2-edit';
     } else {
         $full_width = $full_width;
         $vcinline_active = 'false';
         $vcinline_class = '';
         $vcinline_slider = 'owl-carousel2';
     }
     // Featured Media: Image
     if ($featured_media == 'image') {
         if (!empty($featured_image)) {
             $media_image = wp_get_attachment_image_src($featured_image, 'large');
             $image_extension = pathinfo($media_image[0], PATHINFO_EXTENSION);
             if ($featured_image_alt != "") {
                 $alt_attribute = $featured_image_alt;
             } else {
                 $alt_attribute = basename($media_image[0], "." . $image_extension);
             }
             if ($lightbox_featured == "false") {
                 $media_string .= '<div class="ts-timeline-media" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                 $media_string .= '<img class="" src="' . $media_image[0] . '" alt="' . $alt_attribute . '" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                 $media_string .= '</div>';
             } else {
                 $media_string .= '<div class="ts-timeline-media nchgrid-item nchgrid-tile nch-lightbox-image" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                 $media_string .= '<a href="' . $media_image[0] . '" class="nch-lightbox-media" data-title="' . $title_text . '" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                 $media_string .= '<img src="' . $media_image[0] . '" alt="' . $alt_attribute . '" title="" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                 $media_string .= '<div class="nchgrid-caption"></div>';
                 if (!empty($title_text)) {
                     $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
                 }
                 $media_string .= '</a>';
                 $media_string .= '</div>';
             }
         }
     }
     // Featured Media: Image Slider
     if ($featured_media == 'slider') {
         if (!empty($featured_slider)) {
             $featured_slider = explode(',', $featured_slider);
             $i = -1;
             $b = 0;
             $nachoLength = count($featured_slider) - 1;
             // Add Progressbar
             if ($auto_play == "true" && $show_bar == "true" && $frontend_edit == "false") {
                 $media_string .= '<div id="ts-owlslider-progressbar-' . $randomizer . '" class="ts-owlslider-progressbar-holder" style=""><div class="ts-owlslider-progressbar" style="background: ' . $bar_color . '; height: 100%; width: 0%;"></div></div>';
             }
             if ($auto_play == "true" && $show_bar == "true" || $show_navigation == "true") {
                 $slider_margin = 'margin-top: -10px;';
             } else {
                 $slider_margin = 'margin-top: 5px;';
             }
             if (($auto_play == "true" || $show_navigation == "true") && count($featured_slider) > 1) {
                 $media_string .= '<div id="ts-owlslider-controls-' . $randomizer . '" class="ts-owlslider-controls">';
                 if ($show_navigation == "true") {
                     $media_string .= '<div id="ts-owlslider-controls-next-' . $randomizer . '" class="ts-owlslider-controls-next"><span class="ts-ecommerce-arrowright5"></span></div>';
                     $media_string .= '<div id="ts-owlslider-controls-prev-' . $randomizer . '" class="ts-owlslider-controls-prev"><span class="ts-ecommerce-arrowleft5"></span></div>';
                 }
                 if ($auto_play == "true") {
                     $media_string .= '<div id="ts-owlslider-controls-play-' . $randomizer . '" class="ts-owlslider-controls-play active"><span class="ts-ecommerce-pause"></span></div>';
                 }
                 $media_string .= '</div>';
             }
             $media_string .= '<div id="ts-timeline-gallery-slider-' . $randomizer . '" class="ts-timeline-gallery-slider ' . $vcinline_slider . '" style="' . $slider_margin . '" data-id="' . $randomizer . '" data-items="' . $number_images . '" data-rtl="' . $page_rtl . '" data-loop="' . $items_loop . '" data-navigation="' . $show_navigation . '" data-mobile="' . $animation_mobile . '" data-animationin="' . $animation_in . '" data-animationout="' . $animation_out . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '">';
             foreach ($featured_slider as $single_image) {
                 $i++;
                 $modal_image = wp_get_attachment_image_src($single_image, $lightbox_size);
                 $image_extension = pathinfo($modal_image[0], PATHINFO_EXTENSION);
                 if ($lightbox_featured == "false") {
                     if ($i == 0 && $vcinline_active == "true" || $vcinline_active == "false") {
                         $media_string .= '<div id="' . $timeline_id . '-' . $i . '-parent" class="' . $timeline_id . '-parent ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-image" style="">';
                         $media_string .= '<img src="' . $modal_image[0] . '" style="max-width: ' . $modal_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                         $media_string .= '<div class="nchgrid-caption"></div>';
                         $media_string .= '</div>';
                     }
                 } else {
                     if ($i == $nachoLength && $vcinline_active == "false") {
                         $media_string .= '<div id="' . $timeline_id . '-' . $i . '-parent" class="' . $timeline_id . '-parent ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-image" style="">';
                         $media_string .= '<a id="' . $timeline_id . '-' . $i . '" href="' . $modal_image[0] . '" data-title="" class="nch-lightbox-media ts-hover-image ' . $timeline_id . '-slider-image" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-share="f" data-autoplay="' . ($lightbox_autoplay == "true" ? 1 : 0) . '" data-duration="' . $lightbox_speed . '" data-thumbsize="' . $thumbnail_height . '" data-thumbs="' . $thumbnail_position . '" ' . $nacho_color . '>';
                         $media_string .= '<img src="' . $modal_image[0] . '" style="max-width: ' . $modal_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                         $media_string .= '<div class="nchgrid-caption"></div>';
                         $media_string .= '</a>';
                         $media_string .= '</div>';
                     } else {
                         if ($i == 0 && $vcinline_active == "true" || $vcinline_active == "false") {
                             $media_string .= '<div id="' . $timeline_id . '-' . $i . '-parent" class="' . $timeline_id . '-parent ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-image" style="">';
                             $media_string .= '<a id="' . $timeline_id . '-' . $i . '" href="' . $modal_image[0] . '" data-title="" class="nch-lightbox-media ts-hover-image ' . $timeline_id . '-slider-image" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" ' . $nacho_color . '>';
                             $media_string .= '<img src="' . $modal_image[0] . '" style="max-width: ' . $modal_image[1] . 'px; padding: 0; margin: 0 auto; display: block; ' . $image_dimensions . '">';
                             $media_string .= '<div class="nchgrid-caption"></div>';
                             $media_string .= '</a>';
                             $media_string .= '</div>';
                         }
                     }
                 }
             }
             $media_string .= '</div>';
         }
     }
     // Featured Media: YouTube
     if ($featured_media == 'youtube_default' || $featured_media == 'youtube_custom' || $featured_media == 'youtube_embed') {
         if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $featured_youtube_url)) {
             $featured_youtube_url = $featured_youtube_url;
         } else {
             $featured_youtube_url = 'https://www.youtube.com/watch?v=' . $featured_youtube_url;
         }
         if ($featured_youtube_play == "true") {
             $video_autoplay = '?autoplay=1';
         } else {
             $video_autoplay = '?autoplay=0';
         }
         if ($featured_youtube_related == "true") {
             $video_related = '&rel=1';
         } else {
             $video_related = '&rel=0';
         }
         if ($featured_media == 'youtube_default') {
             $media_image = TS_VCSC_VideoImage_Youtube($featured_youtube_url);
             $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-youtube" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
             $media_string .= '<a href="' . $featured_youtube_url . '" class="nch-lightbox-media" data-title="' . $title_text . '" data-related="' . $video_related . '" data-videoplay="' . $video_autoplay . '" data-type="youtube" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
             $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
             $media_string .= '<div class="nchgrid-caption"></div>';
             if (!empty($title_text)) {
                 $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
             }
             $media_string .= '</a>';
             $media_string .= '</div>';
         } else {
             if ($featured_media == 'youtube_custom') {
                 if (!empty($featured_image)) {
                     $media_image = wp_get_attachment_image_src($featured_image, 'full');
                     $media_image = $media_image[0];
                     $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                     if ($featured_image_alt != "") {
                         $alt_attribute = $featured_image_alt;
                     } else {
                         $alt_attribute = basename($media_image, "." . $image_extension);
                     }
                 } else {
                     $media_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
                     $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                     if ($featured_image_alt != "") {
                         $alt_attribute = $featured_image_alt;
                     } else {
                         $alt_attribute = basename($media_image, "." . $image_extension);
                     }
                 }
                 $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-youtube" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                 $media_string .= '<a href="' . $featured_youtube_url . '" class="nch-lightbox-media" data-title="' . $title_text . '" data-related="' . $video_related . '" data-videoplay="' . $video_autoplay . '" data-type="youtube" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                 $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                 $media_string .= '<div class="nchgrid-caption"></div>';
                 if (!empty($title_text)) {
                     $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
                 }
                 $media_string .= '</a>';
                 $media_string .= '</div>';
             } else {
                 if ($featured_media == 'youtube_embed') {
                     $video_id = TS_VCSC_VideoID_Youtube($featured_youtube_url);
                     $media_string .= '<div class="ts-video-container" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                     $media_string .= '<iframe width="100%" height="auto" src="//www.youtube.com/embed/' . $video_id . $video_autoplay . $video_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                     $media_string .= '</div>';
                 }
             }
         }
     }
     // Featured Media: DailyMotion
     if ($featured_media == 'dailymotion_default' || $featured_media == 'dailymotion_custom' || $featured_media == 'dailymotion_embed') {
         if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $featured_dailymotion_url)) {
             $featured_dailymotion_url = $featured_dailymotion_url;
         } else {
             $featured_dailymotion_url = 'http://www.dailymotion.com/video/' . $featured_dailymotion_url;
         }
         if ($featured_dailymotion_play == "true") {
             $video_autoplay = '?autoplay=1';
         } else {
             $video_autoplay = '?autoplay=0';
         }
         if ($featured_media == 'dailymotion_default') {
             $media_image = TS_VCSC_VideoImage_Motion($featured_dailymotion_url);
             $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-motion" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
             $media_string .= '<a href="' . $featured_dailymotion_url . '" class="nch-lightbox-media" data-title="' . $title_text . '" data-videoplay="' . $video_autoplay . '" data-type="dailymotion" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
             $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
             $media_string .= '<div class="nchgrid-caption"></div>';
             if (!empty($title_text)) {
                 $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
             }
             $media_string .= '</a>';
             $media_string .= '</div>';
         } else {
             if ($featured_media == 'dailymotion_custom') {
                 if (!empty($featured_image)) {
                     $media_image = wp_get_attachment_image_src($featured_image, 'full');
                     $media_image = $media_image[0];
                     $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                     if ($featured_image_alt != "") {
                         $alt_attribute = $featured_image_alt;
                     } else {
                         $alt_attribute = basename($media_image, "." . $image_extension);
                     }
                 } else {
                     $media_image = TS_VCSC_GetResourceURL('images/defaults/default_motion.jpg');
                     $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                     if ($featured_image_alt != "") {
                         $alt_attribute = $featured_image_alt;
                     } else {
                         $alt_attribute = basename($media_image, "." . $image_extension);
                     }
                 }
                 $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-motion" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                 $media_string .= '<a href="' . $featured_dailymotion_url . '" class="nch-lightbox-media" data-title="' . $title_text . '" data-videoplay="' . $video_autoplay . '" data-type="dailymotion" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                 $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                 $media_string .= '<div class="nchgrid-caption"></div>';
                 if (!empty($title_text)) {
                     $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
                 }
                 $media_string .= '</a>';
                 $media_string .= '</div>';
             } else {
                 if ($featured_media == 'dailymotion_embed') {
                     $video_id = TS_VCSC_VideoID_Motion($featured_dailymotion_url);
                     $media_string .= '<div class="ts-video-container" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                     $media_string .= '<iframe width="100%" height="auto" src="http://www.dailymotion.com/embed/video/' . $video_id . $video_autoplay . '&forcedQuality=hq&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                     $media_string .= '</div>';
                 }
             }
         }
     }
     // Featured Media: Vimeo
     if ($featured_media == 'vimeo_default' || $featured_media == 'vimeo_custom' || $featured_media == 'vimeo_embed') {
         if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $featured_vimeo_url)) {
             $featured_vimeo_url = $featured_vimeo_url;
         } else {
             $featured_vimeo_url = 'http://www.vimeo.com/video/' . $featured_vimeo_url;
         }
         if ($featured_vimeo_play == "true") {
             $video_autoplay = '?autoplay=1';
         } else {
             $video_autoplay = '?autoplay=0';
         }
         if ($featured_media == 'vimeo_default') {
             $media_image = TS_VCSC_VideoImage_Vimeo($featured_vimeo_url);
             $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-vimeo" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
             $media_string .= '<a href="' . $featured_vimeo_url . '" class="nch-lightbox-media" data-title="' . $title_text . '" data-videoplay="' . $video_autoplay . '" data-type="vimeo" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
             $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
             $media_string .= '<div class="nchgrid-caption"></div>';
             if (!empty($title_text)) {
                 $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
             }
             $media_string .= '</a>';
             $media_string .= '</div>';
         } else {
             if ($featured_media == 'vimeo_custom') {
                 if (!empty($featured_image)) {
                     $media_image = wp_get_attachment_image_src($featured_image, 'full');
                     $media_image = $media_image[0];
                     $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                     if ($featured_image_alt != "") {
                         $alt_attribute = $featured_image_alt;
                     } else {
                         $alt_attribute = basename($media_image, "." . $image_extension);
                     }
                 } else {
                     $media_image = TS_VCSC_GetResourceURL('images/defaults/default_vimeo.jpg');
                     $image_extension = pathinfo($media_image, PATHINFO_EXTENSION);
                     if ($featured_image_alt != "") {
                         $alt_attribute = $featured_image_alt;
                     } else {
                         $alt_attribute = basename($media_image, "." . $image_extension);
                     }
                 }
                 $media_string .= '<div class="nch-holder nchgrid-item nchgrid-tile nch-lightbox-vimeo" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                 $media_string .= '<a href="' . $featured_vimeo_url . '" class="nch-lightbox-media" data-title="' . $title_text . '" data-videoplay="' . $video_autoplay . '" data-type="vimeo" rel="' . ($lightbox_group == "true" ? "timelinegroup" : $lightbox_group_name) . '" data-effect="' . $lightbox_effect . '" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                 $media_string .= '<img src="' . $media_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                 $media_string .= '<div class="nchgrid-caption"></div>';
                 if (!empty($title_text)) {
                     $media_string .= '<div class="nchgrid-caption-text">' . $title_text . '</div>';
                 }
                 $media_string .= '</a>';
                 $media_string .= '</div>';
             } else {
                 if ($featured_media == 'vimeo_embed') {
                     $video_id = TS_VCSC_VideoID_vimeo($featured_vimeo_url);
                     $media_string .= '<div class="ts-video-container" style="' . $parent_dimensions . '; ' . $image_alignment . '">';
                     $media_string .= '<iframe width="100%" height="auto" src="//player.vimeo.com/video/' . $video_id . $video_autoplay . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                     $media_string .= '</div>';
                 }
             }
         }
     }
     // Link Button
     if (!empty($link)) {
         // Link Values
         $link = $link == '||' ? '' : $link;
         $link = vc_build_link($link);
         $a_href = $link['url'];
         $a_title = $link['title'];
         $a_target = $link['target'];
         // Tooltip
         if ($tooltip_css == "true") {
             if (strlen($a_title) != 0) {
                 $button_tooltipclasses = " ts-simptip-multiline " . $tooltip_style . " " . $tooltip_position;
                 $button_tooltipcontent = ' data-tstooltip="' . $a_title . '"';
             } else {
                 $button_tooltipclasses = "";
                 $button_tooltipcontent = "";
             }
         } else {
             $button_tooltipclasses = "";
             if (strlen($a_title) != 0) {
                 $button_tooltipcontent = ' title="' . $a_title . '"';
             } else {
                 $button_tooltipcontent = "";
             }
         }
         // Button Type
         if ($button_type == "square") {
             $button_style = $button_square;
             $button_font = '';
         } else {
             if ($button_type == "rounded") {
                 $button_style = $button_rounded;
                 $button_font = '';
             } else {
                 if ($button_type == "pill") {
                     $button_style = $button_pill;
                     $button_font = '';
                 } else {
                     if ($button_type == "circle") {
                         $button_style = $button_circle;
                         $button_font = 'font-size: ' . $button_font . 'px;';
                     }
                 }
             }
         }
         // Button Alignment
         if ($button_align == "center") {
             $button_align = 'text-align: center;';
         } else {
             if ($button_align == "left") {
                 $button_align = 'text-align: left';
             } else {
                 if ($button_align == "right") {
                     $button_align = 'text-align: right';
                 }
             }
         }
         // Button Text Color
         if ($button_change == "true") {
             $button_color = 'color: ' . $button_color . ';';
         } else {
             $button_color = '';
         }
         $button_string = '';
         if (!empty($a_href)) {
             $button_string .= '<div class="ts-button-parent ts-button-type-' . $button_type . '" style="' . $button_align . '">';
             if ($button_wrapper == "true") {
                 $button_string .= '<div class="ts-button-wrap" style="">';
             }
             $button_string .= '<a href="' . $a_href . '" target="' . trim($a_target) . '" style="' . $button_font . ' width: ' . $button_width . '%;" class="ts-button ' . $button_style . ' ' . $button_size . ' ' . $button_tooltipclasses . '" ' . $button_tooltipcontent . '>';
             $button_string .= '<span class="ts-button-text" style="display: inline; ' . $button_color . '">' . $button_text . '</span>';
             $button_string .= '</a>';
             if ($button_wrapper == "true") {
                 $button_string .= '</div>';
             }
             $button_string .= '</div>';
         } else {
             $link = '';
         }
     } else {
         $button_string = '';
     }
     // Event Icon
     if (empty($icon) && empty($content) && empty($featured_image)) {
         $title_margin = 'margin: 0;';
     } else {
         $title_margin = '';
     }
     // Column Adjustment for Full Width Event
     if ($full_width == "true" && empty($title_text) && (empty($icon) || $icon == "transparent") && empty($content) && empty($button_string)) {
         $columnA_adjust = 'width: 100%; margin: 0;';
         $columnB_adjust = 'display: none; width: 0;';
     } else {
         if ($full_width == "true" && $featured_media == "none") {
             $columnA_adjust = 'display: none; width: 0; margin: 0;';
             $columnB_adjust = 'width: 100%; margin: 0;';
         } else {
             $columnA_adjust = '';
             $columnB_adjust = '';
         }
     }
     // Margin Adjustment for Full Width Element
     if ($full_width == "true" && !empty($date_text)) {
         $margin_Adjust = 'margin: 25px 10px 0px 10px;';
     } else {
         if ($full_width == "true" && empty($date_text)) {
             $margin_Adjust = 'margin: 0 10px;';
         } else {
             if (!empty($date_text)) {
                 $margin_Adjust = 'margin-top: 25px;';
             } else {
                 $margin_Adjust = 'margin-top: 0;';
             }
         }
     }
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-timeline-list-item ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Timeline_Single', $atts);
     } else {
         $css_class = 'ts-timeline-list-item ' . $el_class;
     }
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $vc_inline_style = ' display: block;';
     } else {
         $vc_inline_style = '';
     }
     $output .= '<li id="' . $timeline_id . '" class="' . $css_class . ' ' . ($full_width == "true" ? "ts-timeline-full" : "") . ' ' . (!empty($date_text) ? "ts-timeline-date-true" : "ts-timeline-date-false") . '" style="' . ($full_width == "true" ? "width: 100%;" : "") . ' ' . $vc_inline_style . '">';
     $output .= '<div class="ts-timeline-column">';
     $output .= '<div class="ts-timeline-text-wrap ' . (!empty($date_text) ? "ts-timeline-text-wrap-date" : "ts-timeline-text-wrap-nodate") . '" style="' . $margin_Adjust . '">';
     if (!empty($date_text)) {
         $output .= '<div class="ts-timeline-date"><span class="ts-timeline-date-connect"><span class="ts-timeline-date-text">' . $date_text . '</span></span></div>';
     }
     if ($full_width == "true") {
         $output .= '<div class="ts-timeline-full-colA" style="' . $columnA_adjust . '">';
         $output .= $media_string;
         $output .= '</div>';
         $output .= '<div class="ts-timeline-full-colB" style="' . $columnB_adjust . '">';
         if (!empty($title_text)) {
             $output .= '<h3 class="ts-timeline-title" style="color: ' . $title_color . '; text-align: ' . $title_align . '; ' . (empty($content) && empty($icon) ? "border: none; margin-bottom: 0; padding-bottom: 0;" : "") . ' ' . $title_margin . '">' . $title_text . '</h3>';
         }
         if (!empty($icon) && $icon != "transparent" || !empty($content) || !empty($link)) {
             $output .= '<div style="width: 100%; display: block; float: left; position: relative; padding-bottom: 15px; ' . (empty($content) && !empty($icon) ? "height: 60px;" : "") . '">';
             if (!empty($content)) {
                 $output .= '<div class="ts-timeline-text-wrap-inner" style="' . (empty($icon) ? "width: 100%; height: 100%; left: 0;" : " left: 0;") . '">';
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '<div class="ts-timeline-text" style="">' . wpb_js_remove_wpautop(do_shortcode($content), true) . '</div>';
                 } else {
                     $output .= '<div class="ts-timeline-text" style="">' . do_shortcode($content) . '</div>';
                 }
                 $output .= '</div>';
             }
             if (!empty($icon) && $icon != "transparent") {
                 $output .= '<div class="ts-timeline-icon ts-timeline-icon-full" style="' . (empty($content) ? "display: inline-block; width: 100%; left: 0; margin: 0 0 0 2%;" : "left: 80%;") . '"><i class="' . $icon . '" style="color: ' . $icon_color . ';"></i></div>';
             }
             if (!empty($button_string)) {
                 $output .= '<div class="ts-timeline-button">';
                 $output .= $button_string;
                 $output .= '</div>';
             }
             $output .= '</div>';
         }
         $output .= '</div>';
     } else {
         $output .= $media_string;
         if (!empty($title_text)) {
             $output .= '<h3 class="ts-timeline-title" style="color: ' . $title_color . '; text-align: ' . $title_align . '; ' . (empty($content) && empty($icon) ? "border: none; margin-bottom: 0; padding-bottom: 0;" : "") . ' ' . $title_margin . '">' . $title_text . '</h3>';
         }
         if (!empty($icon) && $icon != "transparent" || !empty($content)) {
             $output .= '<div style="width: 100%; display: block; float: left; position: relative; padding-bottom: 15px; ' . (empty($content) && !empty($icon) ? "height: 60px;" : "") . '">';
             if (!empty($icon) && $icon != "transparent") {
                 $output .= '<div class="ts-timeline-icon ts-timeline-icon-half" style="' . (empty($content) ? "display: inline-block; width: 100%; left: 0;" : "") . '"><i class="' . $icon . '" style="color: ' . $icon_color . ';"></i></div>';
             }
             if (!empty($content)) {
                 $output .= '<div class="ts-timeline-text-wrap-inner" style="' . (empty($icon) ? "width: 100%; height: 100%; left: 0;" : "") . '">';
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '<div class="ts-timeline-text" style="">' . wpb_js_remove_wpautop(do_shortcode($content), true) . '</div>';
                 } else {
                     $output .= '<div class="ts-timeline-text" style="">' . do_shortcode($content) . '</div>';
                 }
                 $output .= '</div>';
             }
             $output .= '</div>';
             if (!empty($link)) {
                 $output .= '<div class="ts-timeline-button">';
                 $output .= $button_string;
                 $output .= '</div>';
             }
         }
     }
     $output .= '<div class="clearFixMe"></div>';
     $output .= '</div>';
     $output .= '</div>';
     $output .= '</li>';
     echo $output;
     $myvariable = ob_get_clean();
     return $myvariable;
 }
示例#4
0
function TS_VCSC_Youtube_Function($atts, $content = null)
{
    global $VISUAL_COMPOSER_EXTENSIONS;
    ob_start();
    wp_enqueue_script('ts-extend-hammer');
    wp_enqueue_script('ts-extend-nacho');
    wp_enqueue_style('ts-extend-nacho');
    if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
        wp_enqueue_style('ts-extend-tooltipster');
        wp_enqueue_script('ts-extend-tooltipster');
        wp_enqueue_style('ts-extend-animations');
        wp_enqueue_style('ts-visual-composer-extend-front');
        wp_enqueue_script('ts-visual-composer-extend-front');
    }
    extract(shortcode_atts(array('content_type' => 'video', 'content_youtube' => '', 'content_playlist' => '', 'content_search' => '', 'content_combination' => '', 'content_uploads' => '', 'content_lightbox' => 'false', 'content_overlay_use' => 'false', 'content_overlay_image' => '', 'content_overlay_quality' => 'medium', 'content_overlay_trigger' => 'click', 'content_overlay_text' => '', 'content_overlay_font' => '#ffffff', 'content_overlay_handle' => 'true', 'content_overlay_color' => '#fb4400', 'content_overlay_align' => 'center', 'content_image_responsive' => 'true', 'content_image_height' => 'height: 100%;', 'content_image_width_r' => 100, 'content_image_width_f' => 300, 'content_image_size' => 'large', 'video_controls' => 1, 'video_autohide' => 1, 'video_related' => 'false', 'video_start' => 0, 'video_end' => 0, 'lightbox_group_name' => 'nachogroup', 'lightbox_size' => 'full', 'lightbox_effect' => 'random', 'lightbox_speed' => 5000, 'lightbox_social' => 'true', 'lightbox_play' => 'false', 'lightbox_backlight_auto' => 'true', 'lightbox_backlight_color' => '#ffffff', 'content_youtube_start' => '', 'content_youtube_end' => '', 'content_youtube_trigger' => 'preview', 'content_youtube_title' => '', 'content_youtube_subtitle' => '', 'content_youtube_image' => '', 'content_youtube_image_simple' => 'false', 'content_youtube_icon' => '', 'content_youtube_iconsize' => 30, 'content_youtube_iconcolor' => '#cccccc', 'content_youtube_button' => '', 'content_youtube_buttonstyle' => 'ts-dual-buttons-color-sun-flower', 'content_youtube_buttonhover' => 'ts-dual-buttons-preview-default ts-dual-buttons-hover-default', 'content_youtube_buttontext' => 'View Video', 'content_youtube_buttonsize' => 16, 'content_youtube_text' => '', 'content_raw' => '', 'content_tooltip_html' => 'true', 'content_tooltip_content' => '', 'content_tooltip_encoded' => '', 'content_tooltip_position' => 'ts-simptip-position-top', 'content_tooltip_style' => '', 'tooltipster_offsetx' => 0, 'tooltipster_offsety' => 0, 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
    if (!empty($el_id)) {
        $modal_id = $el_id;
    } else {
        $modal_id = 'ts-vcsc-youtube-' . mt_rand(999999, 9999999);
    }
    // Tooltip
    if ($content_tooltip_position == "ts-simptip-position-top" || $content_tooltip_position == "top") {
        $content_tooltip_position = "top";
    }
    if ($content_tooltip_position == "ts-simptip-position-left" || $content_tooltip_position == "left") {
        $content_tooltip_position = "left";
    }
    if ($content_tooltip_position == "ts-simptip-position-right" || $content_tooltip_position == "right") {
        $content_tooltip_position = "right";
    }
    if ($content_tooltip_position == "ts-simptip-position-bottom" || $content_tooltip_position == "bottom") {
        $content_tooltip_position = "bottom";
    }
    if ($content_tooltip_style == "" || $content_tooltip_style == "ts-simptip-style-black" || $content_tooltip_style == "tooltipster-black") {
        $content_tooltip_style = "tooltipster-black";
    }
    if ($content_tooltip_style == "ts-simptip-style-gray" || $content_tooltip_style == "tooltipster-gray") {
        $content_tooltip_style = "tooltipster-gray";
    }
    if ($content_tooltip_style == "ts-simptip-style-green" || $content_tooltip_style == "tooltipster-green") {
        $content_tooltip_style = "tooltipster-green";
    }
    if ($content_tooltip_style == "ts-simptip-style-blue" || $content_tooltip_style == "tooltipster-blue") {
        $content_tooltip_style = "tooltipster-blue";
    }
    if ($content_tooltip_style == "ts-simptip-style-red" || $content_tooltip_style == "tooltipster-red") {
        $content_tooltip_style = "tooltipster-red";
    }
    if ($content_tooltip_style == "ts-simptip-style-orange" || $content_tooltip_style == "tooltipster-orange") {
        $content_tooltip_style = "tooltipster-orange";
    }
    if ($content_tooltip_style == "ts-simptip-style-yellow" || $content_tooltip_style == "tooltipster-yellow") {
        $content_tooltip_style = "tooltipster-yellow";
    }
    if ($content_tooltip_style == "ts-simptip-style-purple" || $content_tooltip_style == "tooltipster-purple") {
        $content_tooltip_style = "tooltipster-purple";
    }
    if ($content_tooltip_style == "ts-simptip-style-pink" || $content_tooltip_style == "tooltipster-pink") {
        $content_tooltip_style = "tooltipster-pink";
    }
    if ($content_tooltip_style == "ts-simptip-style-white" || $content_tooltip_style == "tooltipster-white") {
        $content_tooltip_style = "tooltipster-white";
    }
    if ($content_tooltip_html == "false") {
        if (strlen($content_tooltip_content) != 0) {
            $youtube_tooltipclasses = " ts-has-tooltipster-tooltip";
            $youtube_tooltipcontent = 'data-tooltipster-html="false" data-tooltipster-title="" data-tooltipster-text="' . strip_tags($content_tooltip_content) . '" data-tooltipster-image="" data-tooltipster-position="' . $content_tooltip_position . '" data-tooltipster-touch="false" data-tooltipster-arrow="true" data-tooltipster-theme="' . $content_tooltip_style . '" data-tooltipster-animation="swing" data-tooltipster-trigger="hover" data-tooltipster-offsetx="' . $tooltipster_offsetx . '" data-tooltipster-offsety="' . $tooltipster_offsety . '"';
        } else {
            $youtube_tooltipclasses = "";
            $youtube_tooltipcontent = "";
        }
    } else {
        if (strlen($content_tooltip_encoded) != 0) {
            $youtube_tooltipclasses = " ts-has-tooltipster-tooltip";
            $youtube_tooltipcontent = 'data-tooltipster-html="true" data-tooltipster-title="" data-tooltipster-text="' . strip_tags($content_tooltip_encoded) . '" data-tooltipster-image="" data-tooltipster-position="' . $content_tooltip_position . '" data-tooltipster-touch="false" data-tooltipster-arrow="true" data-tooltipster-theme="' . $content_tooltip_style . '" data-tooltipster-animation="swing" data-tooltipster-trigger="hover" data-tooltipster-offsetx="' . $tooltipster_offsetx . '" data-tooltipster-offsety="' . $tooltipster_offsety . '"';
        } else {
            $youtube_tooltipclasses = "";
            $youtube_tooltipcontent = "";
        }
    }
    if ($lightbox_backlight_auto == "false") {
        $nacho_color = 'data-backlight="' . $lightbox_backlight_color . '"';
    } else {
        $nacho_color = '';
    }
    if ($content_image_responsive == "true") {
        $image_dimensions = 'width: 100%; height: auto;';
        $parent_dimensions = 'width: ' . $content_image_width_r . '%; ' . $content_image_height . '';
    } else {
        $image_dimensions = 'width: 100%; height: auto;';
        $parent_dimensions = 'width: ' . $content_image_width_f . 'px; ' . $content_image_height . '';
    }
    if ($lightbox_play == "true") {
        if ($content_overlay_use == 'true') {
            $video_autoplay = $content_type == 'video' ? '?autoplay=0' : '&autoplay=0';
        } else {
            $video_autoplay = $content_type == 'video' ? '?autoplay=1' : '&autoplay=1';
        }
    } else {
        $video_autoplay = $content_type == 'video' ? '?autoplay=0' : '&autoplay=0';
    }
    if ($video_related == "true") {
        $videos_related = '&rel=1';
    } else {
        $videos_related = '&rel=0';
    }
    $videos_controls = '&controls=' . $video_controls;
    $videos_autohide = '&autohide=' . $video_autohide;
    if ($video_start > 0) {
        $videos_start = '&start=' . $video_start;
    } else {
        $videos_start = '';
    }
    if ($video_end > 0 && $video_end > $video_start) {
        $videos_end = '&end=' . $video_end;
    } else {
        $videos_end = '';
    }
    if ($content_type != 'video') {
        $content_youtube = '#';
    }
    $output = '';
    if (function_exists('vc_shortcode_custom_css_class')) {
        $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS-VCSC-Youtube', $atts);
    } else {
        $css_class = '';
    }
    // YouTube Video in Lightbox
    if ($content_lightbox == "true") {
        if ($content_type == 'combination') {
            $videos = explode(",", str_replace(' ', '', $content_combination));
            $count = count($videos);
            if ($count == 1) {
                $first = $content_combination;
                $other = '';
            } else {
                if ($count > 1) {
                    $first = $videos[0];
                    array_shift($videos);
                    $other = implode(",", $videos);
                }
            }
        } else {
            $first = '';
            $other = '';
        }
        $playlistdata = 'data-contenttype="' . $content_type . '" data-listid="' . ($content_type == 'playlist' ? TS_VCSC_PlaylistID_Youtube($content_playlist) : '') . '" data-userid="' . ($content_type == 'uploads' ? $content_uploads : '') . '" data-videofirst="' . $first . '" data-videosother="' . $other . '" data-search="' . ($content_type == 'searchterm' ? str_replace(' ', '', $content_search) : '') . '"';
        if ($content_youtube_trigger == "preview" || $content_youtube_trigger == "coverfirst") {
            if (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $content_youtube) && $content_youtube_trigger == "preview") {
                $content_youtube = $content_youtube;
            } else {
                if ($content_youtube_trigger == "preview" && $content_youtube_trigger == "preview") {
                    $content_youtube = 'https://www.youtube.com/watch?v=' . $content_youtube;
                } else {
                    if ($content_youtube_trigger == "coverfirst" && $content_type == 'combination') {
                        $content_youtube = 'https://www.youtube.com/watch?v=' . $first;
                    } else {
                        $content_youtube = '#';
                    }
                }
            }
            if ($content_youtube != '#') {
                $modal_image = TS_VCSC_VideoImage_Youtube($content_youtube);
            } else {
                $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
            }
            if ($youtube_tooltipcontent != '') {
                $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                $output .= '<div id="' . $modal_id . '" class="' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="width: 100%; height: 100%;">';
            } else {
                $output .= '<div id="' . $modal_id . '" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
            }
            $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<img src="' . $modal_image . '" title="" style="display: block; ' . $image_dimensions . '">';
            $output .= '<div class="nchgrid-caption"></div>';
            if (!empty($content_youtube_title)) {
                $output .= '<div class="nchgrid-caption-text">' . $content_youtube_title . '</div>';
            }
            $output .= '</a>';
            $output .= '</div>';
            if ($youtube_tooltipcontent != '') {
                $output .= '</div>';
            }
        }
        if ($content_youtube_trigger == "playcover") {
            if ($content_playlist != '' && $content_type == 'playlist') {
                $xmlfeed = TS_VCSC_PlaylistImage_Youtube('http://gdata.youtube.com/feeds/api/playlists/' . TS_VCSC_PlaylistID_Youtube($content_playlist) . '', true);
            } else {
                $xmlfeed = array();
            }
            if ($xmlfeed != '') {
                if (isset($xmlfeed['FEED']['MEDIA:GROUP']['MEDIA:THUMBNAIL'][2]['URL'])) {
                    $modal_image = $xmlfeed['FEED']['MEDIA:GROUP']['MEDIA:THUMBNAIL'][2]['URL'];
                } else {
                    if (isset($xmlfeed['FEED']['MEDIA:GROUP']['MEDIA:THUMBNAIL'][1]['URL'])) {
                        $modal_image = $xmlfeed['FEED']['MEDIA:GROUP']['MEDIA:THUMBNAIL'][1]['URL'];
                    } else {
                        if (isset($xmlfeed['FEED']['MEDIA:GROUP']['MEDIA:THUMBNAIL'][0]['URL'])) {
                            $modal_image = $xmlfeed['FEED']['MEDIA:GROUP']['MEDIA:THUMBNAIL'][0]['URL'];
                        } else {
                            $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
                        }
                    }
                }
            } else {
                $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
            }
            $content_youtube = '#';
            if ($youtube_tooltipcontent != '') {
                $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                $output .= '<div id="' . $modal_id . '" class="' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="width: 100%; height: 100%;">';
            } else {
                $output .= '<div id="' . $modal_id . '" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
            }
            $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<img src="' . $modal_image . '" title="" style="display: block; ' . $image_dimensions . '">';
            $output .= '<div class="nchgrid-caption"></div>';
            if (!empty($content_youtube_title)) {
                $output .= '<div class="nchgrid-caption-text">' . $content_youtube_title . '</div>';
            }
            $output .= '</a>';
            $output .= '</div>';
            if ($youtube_tooltipcontent != '') {
                $output .= '</div>';
            }
        }
        if ($content_youtube_trigger == "usercover") {
            if ($content_uploads != '' && $content_type == 'uploads') {
                $xmlfeed = TS_VCSC_PlaylistImage_Youtube('http://gdata.youtube.com/feeds/api/users/' . $content_uploads . '?fields=yt:username,media:thumbnail', true);
            } else {
                $xmlfeed = array();
            }
            if ($xmlfeed != '') {
                if (isset($xmlfeed['ENTRY']['MEDIA:THUMBNAIL']['URL'])) {
                    $modal_image = $xmlfeed['ENTRY']['MEDIA:THUMBNAIL']['URL'];
                } else {
                    $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
                }
            } else {
                $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
            }
            $content_youtube = '#';
            if ($youtube_tooltipcontent != '') {
                $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                $output .= '<div id="' . $modal_id . '" class="' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="width: 100%; height: 100%;">';
            } else {
                $output .= '<div id="' . $modal_id . '" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
            }
            $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<img src="' . $modal_image . '" title="" style="display: block; ' . $image_dimensions . '">';
            $output .= '<div class="nchgrid-caption"></div>';
            if (!empty($content_youtube_title)) {
                $output .= '<div class="nchgrid-caption-text">' . $content_youtube_title . '</div>';
            }
            $output .= '</a>';
            $output .= '</div>';
            if ($youtube_tooltipcontent != '') {
                $output .= '</div>';
            }
        }
        if ($content_youtube_trigger == "default") {
            $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_youtube.jpg');
            if ($youtube_tooltipcontent != '') {
                $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                $output .= '<div id="' . $modal_id . '" class="' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="width: 100%; height: 100%;">';
            } else {
                $output .= '<div id="' . $modal_id . '" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
            }
            $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<img src="' . $modal_image . '" title="" style="display: block; ' . $image_dimensions . '">';
            $output .= '<div class="nchgrid-caption"></div>';
            if (!empty($content_youtube_title)) {
                $output .= '<div class="nchgrid-caption-text">' . $content_youtube_title . '</div>';
            }
            $output .= '</a>';
            $output .= '</div>';
            if ($youtube_tooltipcontent != '') {
                $output .= '</div>';
            }
        }
        if ($content_youtube_trigger == "image") {
            $modal_image = wp_get_attachment_image_src($content_youtube_image, 'large');
            $modal_image = $modal_image[0];
            if ($content_youtube_image_simple == "false") {
                if ($youtube_tooltipcontent != '') {
                    $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                    $output .= '<div id="' . $modal_id . '" class="' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="width: 100%; height: 100%;">';
                } else {
                    $output .= '<div id="' . $modal_id . '" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-youtube ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                }
                $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                $output .= '<img src="' . $modal_image . '" title="" style="display: block; ' . $image_dimensions . '">';
                $output .= '<div class="nchgrid-caption"></div>';
                if (!empty($content_youtube_title)) {
                    $output .= '<div class="nchgrid-caption-text">' . $content_youtube_title . '</div>';
                }
                $output .= '</a>';
                $output .= '</div>';
                if ($youtube_tooltipcontent != '') {
                    $output .= '</div>';
                }
            } else {
                $output .= '<a href="' . $content_youtube . '" class="' . $modal_id . '-parent nch-holder nch-lightbox-media ' . $youtube_tooltipclasses . ' ' . $css_class . '" ' . $youtube_tooltipcontent . ' style="' . $parent_dimensions . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-title="' . $content_youtube_title . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                $output .= '<img class="" src="' . $modal_image . '" style="display: block; ' . $image_dimensions . '">';
                $output .= '</a>';
            }
        }
        if ($content_youtube_trigger == "icon") {
            $icon_style = 'color: ' . $content_youtube_iconcolor . '; width:' . $content_youtube_iconsize . 'px; height:' . $content_youtube_iconsize . 'px; font-size:' . $content_youtube_iconsize . 'px; line-height:' . $content_youtube_iconsize . 'px;';
            $output .= '<div id="' . $modal_id . '" style="" class="' . $modal_id . '-parent nch-holder ts-vcsc-font-icon ts-font-icons ts-shortcode ts-icon-align-center ' . $el_class . ' ' . $css_class . ' ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<a class="ts-font-icons-link nch-lightbox-media" href="' . $content_youtube . '" target="_blank" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<i class="ts-font-icon ' . $content_youtube_icon . '" style="' . $icon_style . '"></i>';
            $output .= '</a>';
            $output .= '</div>';
        }
        if ($content_youtube_trigger == "flat" || $content_youtube_trigger == "flaticon") {
            wp_enqueue_style('ts-extend-buttonsdual');
            $button_style = $content_youtube_buttonstyle . ' ' . $content_youtube_buttonhover;
            $output .= '<a id="' . $modal_id . '" class="ts-dual-buttons-wrapper nch-lightbox-media ' . $css_class . ' ' . $el_class . '" href="' . $content_youtube . '" target="_blank" data-title="' . $content_youtube_title . '" data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<div id="' . $modal_id . '-trigger" class="ts-dual-buttons-container clearFixMe ' . $button_style . ' ' . $modal_id . '-parent nch-holder ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' style="display: block; width: 100%; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            if ($content_youtube_icon != '' && $content_youtube_icon != 'transparent' && $content_youtube_trigger == "flaticon") {
                $output .= '<i class="ts-dual-buttons-icon ' . $content_youtube_icon . '" style="font-size: ' . $content_youtube_buttonsize . 'px; line-height: ' . $content_youtube_buttonsize . 'px;"></i>';
            }
            $output .= '<span class="ts-dual-buttons-title" style="font-size: ' . $content_youtube_buttonsize . 'px; line-height: ' . $content_youtube_buttonsize . 'px;">' . $content_youtube_buttontext . '</span>';
            $output .= '</div>';
            $output .= '</a>';
        }
        if ($content_youtube_trigger == "winged") {
            $output .= '<div id="' . $modal_id . '-trigger" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' ' . $css_class . '" style="display: block; width: 100%; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<div class="ts-lightbox-button-1 clearFixMe">';
            $output .= '<div class="top">' . $content_youtube_title . '</div>';
            $output .= '<div class="bottom">' . $content_youtube_subtitle . '</div>';
            $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media icon" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '><span class="youtube">' . $content_youtube_buttontext . '</span></a>';
            $output .= '</div>';
            $output .= '</div>';
        }
        if ($content_youtube_trigger == "simple") {
            $output .= '<div id="' . $modal_id . '-trigger" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' ' . $youtube_tooltipclasses . ' ' . $css_class . '" ' . $youtube_tooltipcontent . ' style="display: block; width: 100%; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<a href="' . $content_youtube . '" class="ts-lightbox-button-2 icon nch-lightbox" data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '><span class="youtube">' . $content_youtube_buttontext . '</span></a>';
            $output .= '</div>';
        }
        if ($content_youtube_trigger == "text") {
            $output .= '<div id="' . $modal_id . '-trigger" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' ' . $css_class . '" style="text-align: center; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . ' target="_blank">' . $content_youtube_text . '</a>';
            $output .= '</div>';
        }
        if ($content_youtube_trigger == "custom") {
            if ($content_raw != "") {
                $content_raw = rawurldecode(base64_decode(strip_tags($content_raw)));
                $output .= '<div id="' . $modal_id . '-trigger" class="' . $modal_id . '-parent nch-holder ' . $el_class . ' ' . $css_class . '" style="text-align: center; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
                $output .= '<a href="' . $content_youtube . '" class="nch-lightbox-media ' . $youtube_tooltipclasses . '" ' . $youtube_tooltipcontent . ' data-title="' . $content_youtube_title . '" ' . $playlistdata . ' data-controls="' . $video_controls . '" data-autohide="' . $video_autohide . '" data-start="' . $video_start . '" data-end="' . $video_end . '" data-related="' . $video_related . '" data-videoplay="' . $lightbox_play . '" data-type="youtube" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . 'style="" target="_blank">';
                $output .= $content_raw;
                $output .= '</a>';
                $output .= '</div>';
            }
        }
    }
    // Create Video iFrame Overlay
    if ($content_overlay_use == 'true') {
        $overlay_image = wp_get_attachment_image_src($content_overlay_image, $content_overlay_quality);
        $overlay_data = '<div class="ts-video-overlay">';
        $overlay_data .= '<img class="ts-video-overlay-image" src="' . $overlay_image[0] . '">';
        if ($content_overlay_text != '') {
            $overlay_data .= '<div class="ts-video-overlay-text" style="color: ' . $content_overlay_font . '; text-align: ' . $content_overlay_align . '">';
            $overlay_data .= '<span style="color: ' . $content_overlay_font . '; text-align: ' . $content_overlay_align . '">' . rawurldecode(base64_decode(strip_tags($content_overlay_text))) . '</span>';
            $overlay_data .= '</div>';
        }
        $overlay_data .= '</div>';
        $overlay_class = 'ts-video-overlay-true';
        $overlay_start = '<div class="ts-video-overlay-wrapper" data-trigger="' . $content_overlay_trigger . '">';
        $overlay_end = '</div>';
        if ($content_overlay_handle == 'true') {
            $overlay_handle = '<div class="ts-video-overlay-handle"><span class="frame_handle_' . $content_overlay_trigger . '" style="background-color: ' . $content_overlay_color . '"><i class="handle_' . $content_overlay_trigger . '"></i></span></div>';
        } else {
            $overlay_handle = '';
        }
    } else {
        $overlay_data = '';
        $overlay_class = 'ts-video-overlay-false';
        $overlay_start = '';
        $overlay_end = '';
        $overlay_handle = '';
    }
    // Single Video in iFrame
    if ($content_type == "video" && $content_lightbox == "false") {
        $modal_image = TS_VCSC_VideoID_Youtube($content_youtube);
        $output .= $overlay_start;
        $output .= '<div id="' . $modal_id . '" class="ts-video-container ' . $youtube_tooltipclasses . ' ' . $overlay_class . '" ' . $youtube_tooltipcontent . ' style="">';
        $output .= '<iframe class="ts-video-iframe" width="100%" height="auto" src="//www.youtube.com/embed/' . $modal_image . $video_autoplay . $videos_controls . $videos_autohide . $videos_start . $videos_end . $videos_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        $output .= $overlay_data;
        $output .= '</div>';
        $output .= $overlay_handle;
        $output .= $overlay_end;
    }
    // Defined Playlist in iFrame
    if ($content_type == "playlist" && $content_lightbox == "false") {
        $output .= $overlay_start;
        $output .= '<div id="' . $modal_id . '" class="ts-video-container ' . $youtube_tooltipclasses . ' ' . $overlay_class . '" ' . $youtube_tooltipcontent . ' style="">';
        $output .= '<iframe class="ts-video-iframe" width="100%" height="auto" src="//www.youtube.com/embed?listType=playlist&list=' . TS_VCSC_PlaylistID_Youtube($content_playlist) . '&showinfo=1&' . $video_autoplay . $videos_controls . $videos_autohide . $videos_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        $output .= $overlay_data;
        $output .= '</div>';
        $output .= $overlay_end;
    }
    // Search Playlist in iFrame
    if ($content_type == "searchterm" && $content_lightbox == "false") {
        $output .= $overlay_start;
        $output .= '<div id="' . $modal_id . '" class="ts-video-container ' . $youtube_tooltipclasses . ' ' . $overlay_class . '" ' . $youtube_tooltipcontent . ' style="">';
        $output .= '<iframe class="ts-video-iframe" width="100%" height="auto" src="//www.youtube.com/embed?listType=search&list=' . str_replace(' ', '', $content_search) . '&showinfo=1' . $video_autoplay . $videos_controls . $videos_autohide . $videos_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        $output .= $overlay_data;
        $output .= '</div>';
        $output .= $overlay_end;
    }
    // Individual Videos Playlist in iFrame
    if ($content_type == "combination" && $content_lightbox == "false") {
        $output .= $overlay_start;
        $videos = explode(",", str_replace(' ', '', $content_combination));
        $count = count($videos);
        if ($count == 1) {
            $iframe = '<iframe class="ts-video-iframe" width="100%" height="auto" src="//www.youtube.com/embed/' . $content_combination . $video_autoplay . $videos_controls . $videos_autohide . $videos_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        } else {
            if ($count > 1) {
                $first = $videos[0];
                array_shift($videos);
                $other = implode(",", $videos);
                $iframe = '<iframe class="ts-video-iframe" width="100%" height="auto" src="//www.youtube.com/embed/' . $first . '?playlist=' . $other . '&showinfo=1' . $video_autoplay . $videos_controls . $videos_autohide . $videos_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
            }
        }
        $output .= '<div id="' . $modal_id . '" class="ts-video-container ' . $youtube_tooltipclasses . ' ' . $overlay_class . '" ' . $youtube_tooltipcontent . ' style="">';
        $output .= $iframe;
        $output .= $overlay_data;
        $output .= '</div>';
        $output .= $overlay_end;
    }
    // Playlist from User Uploads in iFrame
    if ($content_type == "uploads" && $content_lightbox == "false") {
        $output .= $overlay_start;
        $output .= '<div id="' . $modal_id . '" class="ts-video-container ' . $youtube_tooltipclasses . ' ' . $overlay_class . '" ' . $youtube_tooltipcontent . ' style="">';
        $output .= '<iframe class="ts-video-iframe" width="100%" height="auto" src="//www.youtube.com/embed?listType=user_uploads&list=' . $content_uploads . '&showinfo=1' . $video_autoplay . $videos_controls . $videos_autohide . $videos_related . '&wmode=opaque" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        $output .= $overlay_data;
        $output .= '</div>';
        $output .= $overlay_end;
    }
    echo $output;
    $myvariable = ob_get_clean();
    return $myvariable;
}