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;
 }
 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_Motion_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_image_responsive' => 'true', 'content_image_height' => 'height: 100%;', 'content_image_width_r' => 100, 'content_image_width_f' => 300, 'content_image_size' => 'large', '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_lightbox' => 'false', 'content_motion' => '', 'content_motion_trigger' => 'preview', 'content_motion_title' => '', 'content_motion_subtitle' => '', 'content_motion_image' => '', 'content_motion_image_simple' => 'false', 'content_motion_icon' => '', 'content_motion_iconsize' => 30, 'content_motion_iconcolor' => '#cccccc', 'content_motion_button' => '', 'content_motion_buttonstyle' => 'ts-dual-buttons-color-sun-flower', 'content_motion_buttonhover' => 'ts-dual-buttons-preview-default ts-dual-buttons-hover-default', 'content_motion_buttontext' => 'View Video', 'content_motion_buttonsize' => 16, 'content_motion_text' => '', 'content_raw' => '', 'content_tooltip_css' => '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-motion-' . 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_css == "false") {
        if (strlen($content_tooltip_content) != 0) {
            $motion_tooltipclasses = " ts-has-tooltipster-tooltip";
            $motion_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 {
            $motion_tooltipclasses = "";
            $motion_tooltipcontent = "";
        }
    } else {
        if (strlen($content_tooltip_encoded) != 0) {
            $motion_tooltipclasses = " ts-has-tooltipster-tooltip";
            $motion_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 {
            $motion_tooltipclasses = "";
            $motion_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 (preg_match('~((http|https|ftp|ftps)://|www.)(.+?)~', $content_motion)) {
        $content_motion = $content_motion;
    } else {
        $content_motion = $content_motion;
    }
    if ($lightbox_play == "true") {
        $video_autoplay = '?autoplay=1';
    } else {
        $video_autoplay = '?autoplay=0';
    }
    $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-Motion', $atts);
    } else {
        $css_class = '';
    }
    if ($content_lightbox == "true") {
        if ($content_motion_trigger == "preview") {
            $modal_image = TS_VCSC_VideoImage_Motion($content_motion);
            if ($motion_tooltipcontent != '') {
                $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                $output .= '<div id="' . $modal_id . '" class="' . $css_class . ' ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-motion" style="width: 100%; height: 100%;">';
            } else {
                $output .= '<div id="' . $modal_id . '" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-motion" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
            }
            $output .= '<a href="' . $content_motion . '" class="nch-lightbox-media" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" 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_motion_title)) {
                $output .= '<div class="nchgrid-caption-text">' . $content_motion_title . '</div>';
            }
            $output .= '</a>';
            $output .= '</div>';
            if ($motion_tooltipcontent != '') {
                $output .= '</div>';
            }
        }
        if ($content_motion_trigger == "default") {
            $modal_image = TS_VCSC_GetResourceURL('images/defaults/default_motion.jpg');
            if ($motion_tooltipcontent != '') {
                $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                $output .= '<div id="' . $modal_id . '" class="' . $css_class . ' ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-motion" style="width: 100%; height: 100%;">';
            } else {
                $output .= '<div id="' . $modal_id . '" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-motion" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
            }
            $output .= '<a href="' . $content_motion . '" class="nch-lightbox-media" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" 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_motion_title)) {
                $output .= '<div class="nchgrid-caption-text">' . $content_motion_title . '</div>';
            }
            $output .= '</a>';
            $output .= '</div>';
            if ($motion_tooltipcontent != '') {
                $output .= '</div>';
            }
        }
        if ($content_motion_trigger == "image") {
            $modal_image = wp_get_attachment_image_src($content_motion_image, 'large');
            $modal_image = $modal_image[0];
            if ($content_motion_image_simple == "false") {
                if ($motion_tooltipcontent != '') {
                    $output .= '<div class="' . $modal_id . '-parent nch-holder ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                    $output .= '<div id="' . $modal_id . '" class="' . $css_class . ' ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-motion" style="width: 100%; height: 100%;">';
                } else {
                    $output .= '<div id="' . $modal_id . '" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder ' . $el_class . ' nchgrid-item nchgrid-tile nch-lightbox-motion" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; ' . $parent_dimensions . '">';
                }
                $output .= '<a href="' . $content_motion . '" class="nch-lightbox-media" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" 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_motion_title)) {
                    $output .= '<div class="nchgrid-caption-text">' . $content_motion_title . '</div>';
                }
                $output .= '</a>';
                $output .= '</div>';
                if ($motion_tooltipcontent != '') {
                    $output .= '</div>';
                }
            } else {
                $output .= '<a href="' . $content_motion . '" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder nch-lightbox-media ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="' . $parent_dimensions . '" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" 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_motion_trigger == "icon") {
            $icon_style = 'color: ' . $content_motion_iconcolor . '; width:' . $content_motion_iconsize . 'px; height:' . $content_motion_iconsize . 'px; font-size:' . $content_motion_iconsize . 'px; line-height:' . $content_motion_iconsize . 'px;';
            $output .= '<div id="' . $modal_id . '" style="" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder ts-vcsc-font-icon ts-font-icons ts-shortcode ts-icon-align-center ' . $el_class . ' ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<a class="ts-font-icons-link nch-lightbox-media" href="' . $content_motion . '" target="_blank" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
            $output .= '<i class="ts-font-icon ' . $content_motion_icon . '" style="' . $icon_style . '"></i>';
            $output .= '</a>';
            $output .= '</div>';
        }
        if ($content_motion_trigger == "flat" || $content_motion_trigger == "flaticon") {
            wp_enqueue_style('ts-extend-buttonsdual');
            $button_style = $content_motion_buttonstyle . ' ' . $content_motion_buttonhover;
            $output .= '<a id="' . $modal_id . '" class="ts-dual-buttons-wrapper nch-lightbox-media ' . $css_class . ' ' . $el_class . '" href="' . $content_motion . '" target="_blank" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" 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 ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="display: block; width: 100%; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            if ($content_motion_icon != '' && $content_motion_icon != 'transparent' && $content_motion_trigger == "flaticon") {
                $output .= '<i class="ts-dual-buttons-icon ' . $content_motion_icon . '" style="font-size: ' . $content_motion_buttonsize . 'px; line-height: ' . $content_motion_buttonsize . 'px;"></i>';
            }
            $output .= '<span class="ts-dual-buttons-title" style="font-size: ' . $content_motion_buttonsize . 'px; line-height: ' . $content_motion_buttonsize . 'px;">' . $content_motion_buttontext . '</span>';
            $output .= '</div>';
            $output .= '</a>';
        }
        if ($content_motion_trigger == "winged") {
            $output .= '<div id="' . $modal_id . '-trigger" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder ' . $el_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_motion_title . '</div>';
            $output .= '<div class="bottom">' . $content_motion_subtitle . '</div>';
            $output .= '<a href="' . $content_motion . '" class="nch-lightbox-media icon" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '><span class="motion">' . $content_motion_buttontext . '</span></a>';
            $output .= '</div>';
            $output .= '</div>';
        }
        if ($content_motion_trigger == "simple") {
            $output .= '<div id="' . $modal_id . '-trigger" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder' . $el_class . ' ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' style="display: block; width: 100%; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<a href="' . $content_motion . '" class="ts-lightbox-button-2 icon nch-lightbox-media" data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '><span class="motion">' . $content_motion_buttontext . '</span></a>';
            $output .= '</div>';
        }
        if ($content_motion_trigger == "text") {
            $output .= '<div id="' . $modal_id . '-trigger" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder" style="text-align: center; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
            $output .= '<a href="' . $content_motion . '" class="nch-lightbox-media ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" rel="' . $lightbox_group_name . '" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . ' target="_blank">' . $content_motion_text . '</a>';
            $output .= '</div>';
        }
        if ($content_motion_trigger == "custom") {
            if ($content_raw != "") {
                $content_raw = rawurldecode(base64_decode(strip_tags($content_raw)));
                $output .= '<div id="' . $modal_id . '-trigger" class="' . $css_class . ' ' . $modal_id . '-parent nch-holder" style="text-align: center; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
                $output .= '<a href="' . $content_motion . '" class="nch-lightbox-media ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . ' data-title="' . $content_motion_title . '" data-videoplay="' . $lightbox_play . '" data-type="dailymotion" 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>';
            }
        }
    } else {
        $modal_image = TS_VCSC_VideoID_Motion($content_motion);
        $output .= '<div id="' . $modal_id . '" class="ts-video-container ' . $motion_tooltipclasses . '" ' . $motion_tooltipcontent . '>';
        $output .= '<iframe class="ts-video-iframe" src="http://www.dailymotion.com/embed/video/' . $modal_image . $video_autoplay . '?forcedQuality=hq" width="100%" height="auto" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        $output .= '</div>';
    }
    echo $output;
    $myvariable = ob_get_clean();
    return $myvariable;
}