function front_end_slider($images, $paramssld, $slider)
{
    ob_start();
    if (isset($slider)) {
        $sliderID = $slider[0]->id;
        $slidertitle = $slider[0]->name;
        $sliderheight = $slider[0]->sl_height;
        $sliderwidth = $slider[0]->sl_width;
        $slidereffect = $slider[0]->slider_list_effects_s;
        $slidepausetime = $slider[0]->description + $slider[0]->param;
        $sliderpauseonhover = $slider[0]->pause_on_hover;
        $sliderposition = $slider[0]->sl_position;
        $slidechangespeed = $slider[0]->param;
        $sliderloadingicon = $slider[0]->sl_loading_icon;
        $sliderthumbslider = $slider[0]->show_thumb;
        $slideshow_title_position = explode('-', trim($paramssld['slider_title_position']));
        $slideshow_description_position = explode('-', trim($paramssld['slider_description_position']));
    }
    $hasyoutube = false;
    $hasvimeo = false;
    foreach ($images as $key => $image_row) {
        if (strpos($image_row->image_url, 'youtube') !== false || strpos($image_row->image_url, 'youtu.be') !== false) {
            $hasyoutube = true;
        }
        if (strpos($image_row->image_url, 'vimeo') !== false) {
            $hasvimeo = true;
        }
    }
    $GLOBALS['pause_time'] = $slidepausetime;
    $GLOBALS['thumbnail_width'] = $sliderwidth;
    $GLOBALS['changespeed'] = $slider[0]->param;
    ?>
<script>
	var huge_video_playing={};
	var autoplayMatch={};
	
	

</script>


<?php 
    if ($hasvimeo == true) {
        ?>
<script src="<?php 
        echo plugins_url('js/vimeo.lib.js', __FILE__);
        ?>
"></script>
<script src="https://f.vimeocdn.com/js/froogaloop2.min.js "></script>
<script>
jQuery(function(){
	var vimeoPlayer = document.querySelector('iframe');

	var volumes = [];
	var colors = [];
	var i=0;		
	<?php 
        $i = 0;
        //$vimeoparams=array_reverse($images);
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'vimeo') !== false) {
                ?>
		volumes[<?php 
                echo $i;
                ?>
] = '<?php 
                echo intval($image_row->description) / 100;
                ?>
';
		colors[<?php 
                echo $i;
                ?>
] = '<?php 
                echo $image_row->link_target;
                ?>
';
	<?php 
                $i++;
            }
        }
        ?>
		
	jQuery('iframe').each(function(){
				Froogaloop(this).addEvent('ready', ready);
	});
	jQuery(".sidedock,.controls").remove();
	function ready(player_id) {
	
		froogaloop = $f(player_id);
	
		function setupEventListeners() {
			function setVideoVolume(player_id,value) {
				Froogaloop(player_id).api('setVolume',value);
			}	
			function setVideoColor(player_id,value) {
				Froogaloop(player_id).api('setColor',value);
			}			
			function onPlay() {
				froogaloop.addEvent('play',
				function(){
					huge_video_playing['video_is_playing_'+<?php 
        echo $sliderID;
        ?>
]=true;
				});
			}
			function onPause() {
				froogaloop.addEvent('pause',
				function(){
					huge_video_playing['video_is_playing_'+<?php 
        echo $sliderID;
        ?>
]=false;
				});
			}					
			function stopVimeoVideo(player){
				Froogaloop(player).api('pause');
			}
			setVideoVolume(player_id,volumes[i]);
			setVideoColor(player_id,colors[i]);
			i++;			
			
			onPlay();
			onPause();
			jQuery('#huge_it_slideshow_left_<?php 
        echo $sliderID;
        ?>
, #huge_it_slideshow_right_<?php 
        echo $sliderID;
        ?>
,.huge_it_slideshow_dots_<?php 
        echo $sliderID;
        ?>
').click(function(){
				stopVimeoVideo(player_id);
			});
		}
		setupEventListeners();
	}
});		
</script>
<?php 
    }
    ?>

<?php 
    if ($hasyoutube == true) {
        ?>

<script src="<?php 
        echo plugins_url('js/youtube.lib.js', __FILE__);
        ?>
"></script>
<script> 
  <?php 
        function get_youtube_id_from_url($url)
        {
            if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $match)) {
                return $match[1];
            }
        }
        $i = 0;
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtu') !== false) {
                ?>
 
		var player_<?php 
                echo $image_row->id;
                ?>
;
<?php 
            } else {
                if (strpos($image_row->image_url, 'vimeo') !== false) {
                    ?>
				
<?php 
                } else {
                    continue;
                }
            }
            $i++;
        }
        ?>
		huge_video_playing['video_is_playing_'+<?php 
        echo $sliderID;
        ?>
]=false;
		function onYouTubeIframeAPIReady() {
			<?php 
        foreach ($images as $key => $image_row) {
            ?>
							
				<?php 
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                ?>
 
				player_<?php 
                echo $image_row->id;
                ?>
 = new YT.Player('video_id_<?php 
                echo $sliderID;
                ?>
_<?php 
                echo $key;
                ?>
', {
				  height: '<?php 
                echo $sliderheight;
                ?>
',
				  width: '<?php 
                echo $sliderwidth;
                ?>
',
				  videoId: '<?php 
                echo get_youtube_id_from_url($image_row->image_url);
                ?>
',
				   playerVars: {
					'controls': <?php 
                if ($images[$key]->sl_url == "on") {
                    echo 1;
                } else {
                    echo 0;
                }
                ?>
,           
					'showinfo': <?php 
                if ($images[$key]->link_target == "on") {
                    echo 1;
                } else {
                    echo 0;
                }
                ?>
,
					'rel':0
				  },
				  events: {
					'onReady': onPlayerReady_<?php 
                echo $image_row->id;
                ?>
,
					'onStateChange': onPlayerStateChange_<?php 
                echo $image_row->id;
                ?>
,
					'loop':1
				  }
				});
			<?php 
            } else {
                continue;
            }
        }
        ?>
		}
		
		
<?php 
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtu') !== false) {
                ?>
 
		  function onPlayerReady_<?php 
                echo $image_row->id;
                ?>
(event) {	
			 player_<?php 
                echo $image_row->id;
                ?>
.setVolume(<?php 
                echo $images[$key]->description;
                ?>
);
		  }
		  
		  function onPlayerStateChange_<?php 
                echo $image_row->id;
                ?>
(event) {
			//(event.data);
			
   //jQuery("iframe[class^='huge_it_video_frame_']")[myid].src;

			if (event.data == YT.PlayerState.PLAYING) {
				event.target.setPlaybackQuality('<?php 
                echo $images[$key]->name;
                ?>
');
				huge_video_playing['video_is_playing_'+<?php 
                echo $sliderID;
                ?>
]=true;
				
			}
			else if(event.data == YT.PlayerState.PAUSED){
				huge_video_playing['video_is_playing_'+<?php 
                echo $sliderID;
                ?>
]=false;
				
			}
		  }
<?php 
            } else {
                continue;
            }
        }
        ?>
	function stopYoutubeVideo() {
		<?php 
        $i = 0;
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                ?>
			player_<?php 
                echo $image_row->id;
                ?>
.pauseVideo();
		<?php 
            } else {
                continue;
            }
            $i++;
        }
        ?>
	}

</script>
<?php 
    }
    ?>
	
	
<script>

	jQuery(document).ready(function($) {

  $('.thumb_wrapper').on('click', function(ev) {
  	var hugeid=$(this).data('rowid');
  	var myid=hugeid;
  	myid=parseInt(myid);
  	eval('player_'+myid+'.playVideo()')
   ev.preventDefault();
 
  });
});

	if(typeof sliderID_array =="undefined"){
		var sliderID_array=[];
	}
	
	var data_<?php 
    echo $sliderID;
    ?>
 = [];      
	var event_stack_<?php 
    echo $sliderID;
    ?>
 = [];
	huge_video_playing['video_is_playing_'+<?php 
    echo $sliderID;
    ?>
]=false;
	<?php 
    $args = array('numberposts' => 10, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private', 'suppress_filters' => true);
    //	$images=array_reverse($images);
    $recent_posts = wp_get_recent_posts($args, ARRAY_A);
    $i = 0;
    foreach ($images as $image) {
        $imagerowstype = $image->sl_type;
        if ($image->sl_type == '') {
            $imagerowstype = 'image';
        }
        switch ($imagerowstype) {
            case 'image':
                echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                $strdesription = str_replace('"', "'", $image->description);
                $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                $stralt = str_replace('"', "'", $image->name);
                $stralt = preg_replace("/\r|\n/", " ", $stralt);
                echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                $i++;
                break;
            case 'video':
                echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                $strdesription = str_replace('"', "'", $image->description);
                $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                $stralt = str_replace('"', "'", $image->name);
                $stralt = preg_replace("/\r|\n/", " ", $stralt);
                echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                $i++;
                break;
            case 'last_posts':
                $keyForStoping = 0;
                foreach ($recent_posts as $keyl => $recentimage) {
                    if ($image->name == "0") {
                        if (get_the_post_thumbnail($recentimage["ID"], 'thumbnail') != '') {
                            if ($keyl < $image->sl_url) {
                                echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                                echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                                echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $recentimage['guid'] . '";';
                                $strdesription = str_replace('"', "'", $recentimage['post_content']);
                                $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                                $strdesription = substr_replace($strdesription, "", $image->description);
                                echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                                $stralt = str_replace('"', "'", $recentimage['post_title']);
                                $stralt = preg_replace("/\r|\n/", " ", $stralt);
                                echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                                $i++;
                            }
                        }
                    } else {
                        $category_id = get_cat_ID($image->name);
                        //       USER CHOOSED CATEGORY
                        $category_id_from_posts = wp_get_post_categories($recentimage['ID']);
                        //       GETTING ALL CATEGORIES FOR THIS POST
                        if ($keyForStoping < $image->sl_url) {
                            if (in_array($category_id, $category_id_from_posts)) {
                                if (get_the_post_thumbnail($recentimage["ID"], 'thumbnail') != '') {
                                    $keyForStoping++;
                                    //                                                        if($keyl < $image->sl_url){
                                    echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                                    echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                                    echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $recentimage['guid'] . '";';
                                    $strdesription = str_replace('"', "'", $recentimage['post_content']);
                                    $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                                    $strdesription = substr_replace($strdesription, "", $image->description);
                                    echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                                    $stralt = str_replace('"', "'", $recentimage['post_title']);
                                    $stralt = preg_replace("/\r|\n/", " ", $stralt);
                                    echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                                    $i++;
                                    //                                                        }
                                }
                            }
                        }
                    }
                }
                break;
        }
    }
    ?>
	
	

      var huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = false;
      var huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 = <?php 
    echo $slidechangespeed;
    ?>
;
      var huge_interval ={};
      var id_array_index=sliderID_array.length

	  <?php 
    $huge_sliderId = '';
    if (isset($huge_sliderId)) {
        $huge_sliderId = $huge_sliderId;
    } else {
        $huge_sliderId = '';
    }
    if ($huge_sliderId == ';') {
        $huge_sliderId = '';
    }
    if ($slider[0]->show_thumb == 'thumbnails') {
        $huge_sliderId = $slider[0]->id;
    }
    ?>

      
	  var ifhasthumb ="<?php 
    echo $sliderthumbslider;
    ?>
";
	  sliderID_array[id_array_index] = <?php 
    echo $huge_sliderId;
    ?>
      // Stop autoplay.
      window.clearInterval(huge_interval['huge_it_playInterval_'+<?php 
    echo $sliderID;
    ?>
]);
	  
     var huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 = '<?php 
    echo isset($current_key) ? $current_key : '';
    ?>
';
	 function huge_it_move_dots_<?php 
    echo $sliderID;
    ?>
() {
        var image_left = jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").position().left;
        var image_right = jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").position().left + jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").outerWidth(true);
       
      }
      function huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
() {
        return huge_it_testDom_<?php 
    echo $sliderID;
    ?>
('Transition');
      }
      function huge_it_testBrowser_cssTransforms3d_<?php 
    echo $sliderID;
    ?>
() {
        return huge_it_testDom_<?php 
    echo $sliderID;
    ?>
('Perspective');
      }
      function huge_it_testDom_<?php 
    echo $sliderID;
    ?>
(prop) {
        // Browser vendor CSS prefixes.
        var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
        // Browser vendor DOM prefixes.
        var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
        var i = domPrefixes.length;
        while (i--) {
          if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
            return true;
          }
        }
        return false;
      }
		function huge_it_cube_<?php 
    echo $sliderID;
    ?>
(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
		
        /* If browser does not support 3d transforms/CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
()) {
			jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
          return huge_it_fallback_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
        }
        if (!huge_it_testBrowser_cssTransforms3d_<?php 
    echo $sliderID;
    ?>
()) {
          return huge_it_fallback3d_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
        }
			//alert(current_image_class+' '+next_image_class);
		  jQuery(current_image_class).css({'z-index': 'none'});
          jQuery(next_image_class).css({'z-index' : 2});
        huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");  
		jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
        jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").css('perspective', 1000);
        jQuery(current_image_class).css({
          transform : 'translateZ(' + tz + 'px)',
          backfaceVisibility : 'hidden'
        });
		
		 jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
,.huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_item_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_second_item_<?php 
    echo $sliderID;
    ?>
 ").css('overflow', 'visible');
		
        jQuery(next_image_class).css({
          opacity : 1,
          filter: 'Alpha(opacity=100)',
          backfaceVisibility : 'hidden',
          transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
        });
        jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").css({
          transform: 'translateZ(-' + tz + 'px)',
          transformStyle: 'preserve-3d'
        });
        /* Execution steps.*/
        setTimeout(function () {
          jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").css({
            transition: 'all ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms ease-in-out',
            transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
          });
        }, 20);
        /* After transition.*/
        jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          /*if (huge_it_from_focus_<?php 
    echo $sliderID;
    ?>
) {
            huge_it_from_focus_<?php 
    echo $sliderID;
    ?>
 = false;
            return;
          }*/
		  jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_item_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_second_item_<?php 
    echo $sliderID;
    ?>
 ").css('overflow', 'hidden');
		  jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").removeAttr('style');
          jQuery(current_image_class).removeAttr('style');
          jQuery(next_image_class).removeAttr('style');
          jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").removeAttr('style');
		 // alert(current_image_class+' '+next_image_class);
          jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
         // huge_it_change_watermark_container_<?php 
    echo $sliderID;
    ?>
();
          huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = false;
          if (typeof event_stack_<?php 
    echo $sliderID;
    ?>
 !== 'undefined' && event_stack_<?php 
    echo $sliderID;
    ?>
.length > 0) {
            key = event_stack_<?php 
    echo $sliderID;
    ?>
[0].split("-");
            event_stack_<?php 
    echo $sliderID;
    ?>
.shift();
            huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(key[0], key[1], data_<?php 
    echo $sliderID;
    ?>
, true,false);
          }
        }
      }
      function huge_it_cubeH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image width.*/
        var dimension = jQuery(current_image_class).width() / 2;
        if (direction == 'right') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
        }
      }
      function huge_it_cubeV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image height.*/
        var dimension = jQuery(current_image_class).height() / 2;
        /* If next slide.*/
        if (direction == 'right') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction);
        }
      }
      /* For browsers that does not support transitions.*/
      function huge_it_fallback_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_fade_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
      }
      /* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
      function huge_it_fallback3d_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_sliceV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
      }
      function huge_it_none_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
        jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});

        /* Set active thumbnail.*/
        jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
      }
      function huge_it_fade_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
		if (huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
()) {
			
          jQuery(next_image_class).css('transition', 'opacity ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms linear');
		  jQuery(current_image_class).css('transition', 'opacity ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms linear');
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
        }
        else {
		
          jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
);
          jQuery(next_image_class).animate({
              'opacity' : 1,
              'z-index': 2
            }, {
              duration: huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
,
              complete: function () {return false;}
            });
          // For IE.
          jQuery(current_image_class).fadeTo(huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
, 0);
          jQuery(next_image_class).fadeTo(huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
, 1);
        }

		jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
		jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
      }
      function huge_it_grid_<?php 
    echo $sliderID;
    ?>
(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
        /* If browser does not support CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
()) {
			jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
          return huge_it_fallback_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
		  
        }
        huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
        /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
        var count = (huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
) / (cols + rows);
        /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
        function huge_it_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
          var delay = (c + r) * count;
          /* Return a gridlet elem with styles for specific transition.*/
          return jQuery('<div class="huge_it_gridlet_<?php 
    echo $sliderID;
    ?>
" />').css({
            width : width,
            height : height,
            top : top,
            left : left,
            backgroundImage : 'url("' + src + '")',
            backgroundColor: jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").css("background-color"),
            /*backgroundColor: rgba(0, 0, 0, 0),*/
            backgroundRepeat: 'no-repeat',
            backgroundPosition : img_left + 'px ' + img_top + 'px',
            backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
            transition : 'all ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms ease-in-out ' + delay + 'ms',
            transform : 'none'
          });
        }
        /* Get the current slide's image.*/
        var cur_img = jQuery(current_image_class).find('img');
        /* Create a grid to hold the gridlets.*/
        var grid = jQuery('<div />').addClass('huge_it_grid_<?php 
    echo $sliderID;
    ?>
');
        /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
        jQuery(current_image_class).prepend(grid);
        /* vars to calculate positioning/size of gridlets*/
        var cont = jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
");
        var imgWidth = cur_img.width();
        var imgHeight = cur_img.height();
        var contWidth = cont.width(),
            contHeight = cont.height(),
            imgSrc = cur_img.attr('src'),/*.replace('/thumb', ''),*/
            colWidth = Math.floor(contWidth / cols),
            rowHeight = Math.floor(contHeight / rows),
            colRemainder = contWidth - (cols * colWidth),
            colAdd = Math.ceil(colRemainder / cols),
            rowRemainder = contHeight - (rows * rowHeight),
            rowAdd = Math.ceil(rowRemainder / rows),
            leftDist = 0,
            img_leftDist = (jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").width() - cur_img.width()) / 2;
        /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
        tx = tx === 'auto' ? contWidth : tx;
        tx = tx === 'min-auto' ? - contWidth : tx;
        ty = ty === 'auto' ? contHeight : ty;
        ty = ty === 'min-auto' ? - contHeight : ty;
        /* Loop through cols*/
        for (var i = 0; i < cols; i++) {
          var topDist = 0,
              img_topDst = (jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").height() - cur_img.height()) / 2,
              newColWidth = colWidth;
          /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
          if (colRemainder > 0) {
            var add = colRemainder >= colAdd ? colAdd : colRemainder;
            newColWidth += add;
            colRemainder -= add;
          }
          /* Nested loop to create row gridlets for each col.*/
          for (var j = 0; j < rows; j++)  {
            var newRowHeight = rowHeight,
                newRowRemainder = rowRemainder;
            /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
            if (newRowRemainder > 0) {
              add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
              newRowHeight += add;
              newRowRemainder -= add;
            }
            /* Create & append gridlet to grid.*/
            grid.append(huge_it_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
            topDist += newRowHeight;
            img_topDst -= newRowHeight;
          }
          img_leftDist -= newColWidth;
          leftDist += newColWidth;
        }
        /* Set event listener on last gridlet to finish transitioning.*/
        var last_gridlet = grid.children().last();
        /* Show grid & hide the image it replaces.*/
        grid.show();
        cur_img.css('opacity', 0);
        /* Add identifying classes to corner gridlets (useful if applying border radius).*/
        grid.children().first().addClass('rs-top-left');
        grid.children().last().addClass('rs-bottom-right');
        grid.children().eq(rows - 1).addClass('rs-bottom-left');
        grid.children().eq(- rows).addClass('rs-top-right');
        /* Execution steps.*/
        setTimeout(function () {
          grid.children().css({
            opacity: op,
            transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
          });
        }, 1);
        jQuery(next_image_class).css('opacity', 1);
        /* After transition.*/
        jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          cur_img.css('opacity', 1);
          grid.remove();
          huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = false;
          if (typeof event_stack_<?php 
    echo $sliderID;
    ?>
 !== 'undefined' && event_stack_<?php 
    echo $sliderID;
    ?>
.length > 0) {
            key = event_stack_<?php 
    echo $sliderID;
    ?>
[0].split("-");
            event_stack_<?php 
    echo $sliderID;
    ?>
.shift();
            huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(key[0], key[1], data_<?php 
    echo $sliderID;
    ?>
, true,false);
          }
        }
      }
      function huge_it_sliceH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_sliceV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'min-auto';
        }
        else if (direction == 'left') {
          var translateY = 'auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_slideV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'auto';
        }
        else if (direction == 'left') {
          var translateY = 'min-auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_slideH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleOut_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleIn_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blockScale_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(8, 6, 0, 0, 0, .6, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_kaleidoscope_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_fan_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var rotate = 45;
          var translateX = 100;
        }
        else if (direction == 'left') {
          var rotate = -45;
          var translateX = -100;
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blindV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_blindH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_random_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV'];
        /* Pick a random transition from the anims array.*/
        this["huge_it_" + anims[Math.floor(Math.random() * anims.length)] + "_<?php 
    echo $sliderID;
    ?>
"](current_image_class, next_image_class, direction);
      }
      
      function iterator_<?php 
    echo $sliderID;
    ?>
() {
        var iterator = 1;

        return iterator;
     }
	 
     function huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(current_key, key, data_<?php 
    echo $sliderID;
    ?>
, from_effect,clicked) {
		
        if (data_<?php 
    echo $sliderID;
    ?>
[key]) {
		
			if(huge_video_playing['video_is_playing_'+<?php 
    echo $sliderID;
    ?>
] && !clicked){
				return false;
			}
         
		 
		 
          if (!from_effect) {
            // Change image key.
            jQuery("#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
").val(key);
             // if (current_key == '-2') { /* Dots.*/
				current_key = jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").attr("data-image_key");
			//  }
          }

          if (huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
) {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" --IN TRANSACTION-- <br />");
            event_stack_<?php 
    echo $sliderID;
    ?>
.push(current_key + '-' + key);
            return;
          }
		  
          var direction = 'right';
          if (huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 > key) {
            var direction = 'left';
          }
          else if (huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 == key) {
            return false;
          }
         
          // Set active thumbnail position.
      
          huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 = key;
          //Change image id, title, description.
          jQuery("#huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
").attr('data-image_id', data_<?php 
    echo $sliderID;
    ?>
[key]["id"]);
		  
		  
		  jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").html(data_<?php 
    echo $sliderID;
    ?>
[key]["alt"]);
          jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").html(data_<?php 
    echo $sliderID;
    ?>
[key]["description"]);
        
		  var current_image_class = "#image_id_<?php 
    echo $sliderID;
    ?>
_" + data_<?php 
    echo $sliderID;
    ?>
[current_key]["id"];
          var next_image_class = "#image_id_<?php 
    echo $sliderID;
    ?>
_" + data_<?php 
    echo $sliderID;
    ?>
[key]["id"];
          
		  
		
		 if(jQuery(current_image_class).find('.huge_it_video_frame_<?php 
    echo $sliderID;
    ?>
').length>0) {
			var streffect='<?php 
    echo $slidereffect;
    ?>
';
			if(streffect=="cubeV" || streffect=="cubeH" || streffect=="none" || streffect=="fade"){
				huge_it_<?php 
    echo $slidereffect;
    ?>
_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
			}else{	
				huge_it_fade_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
			}	
		  }else{	
				huge_it_<?php 
    echo $slidereffect;
    ?>
_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
		  }	
		  
		  
		jQuery('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').html()==""){jQuery('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');}

		jQuery('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').html()==""){jQuery('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');}
	  
		  
		  
		  jQuery(current_image_class).find('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');
		  jQuery(current_image_class).find('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');
		
		

		  
		  //errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after("--cur-key="+current_key+" --cur-img-class="+current_image_class+" nxt-img-class="+next_image_class+"--");
			 huge_it_move_dots_<?php 
    echo $sliderID;
    ?>
();
			<?php 
    foreach ($images as $key => $image_row) {
        if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
            ?>
				stopYoutubeVideo();
			<?php 
        }
    }
    ?>
			window.clearInterval(huge_interval['huge_it_playInterval_'+<?php 
    echo $sliderID;
    ?>
]);
			play_<?php 
    echo $sliderID;
    ?>
();
        }

      }
	   var staticthumbWidth;
      jQuery(window).load(function(){
      	 staticthumbWidth=jQuery('#huge_it_thumb_slider>li').width()
	  	
      })
     function huge_it_popup_resize_<?php 
    echo $sliderID;
    ?>
() {

		var staticsliderwidth=<?php 
    echo $sliderwidth;
    ?>
;
		var sliderwidth=<?php 
    echo $sliderwidth;
    ?>
;
		
		var thumbWidth=jQuery(".huge_it_slideshow_thumbnails_<?php 
    echo $sliderID;
    ?>
").width();
		
		//alert(thumbHeight)
		//alert(thumbWidth/2)
		var bodyWidth=jQuery(window).width();
        var parentWidth = jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").parent().width();
		//if responsive js late responsive.js @  take body size and not parent div
		jQuery(".huge_it_slideshow_thumbnails_<?php 
    echo $sliderID;
    ?>
").css({height: <?php 
    echo $paramssld['slider_thumb_height'];
    ?>
});
		if(sliderwidth>parentWidth){sliderwidth=parentWidth;}
		if(sliderwidth>bodyWidth){sliderwidth=bodyWidth;}
		var str=(<?php 
    echo $sliderheight;
    ?>
/staticsliderwidth); 
		
			
			jQuery(".huge_it_slideshow_thumbnails_<?php 
    echo $sliderID;
    ?>
").css({width: thumbWidth});
			
				var str2=(<?php 
    echo $paramssld['slider_thumb_height'];
    ?>
/staticthumbWidth);
			
			jQuery(".huge_it_slideshow_thumbnails_<?php 
    echo $sliderID;
    ?>
").css({height: thumbWidth*str2});
			jQuery(".bx-viewport").css({height: thumbWidth*str2});
			
			
			
		
		
		
		jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").css({height: ((sliderwidth) * str)});
		
		jQuery(".huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
").css({height: ((sliderwidth) * str)});
			
		if("<?php 
    echo $slideshow_title_position[1];
    ?>
"=="middle"){var titlemargintopminus=jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").outerHeight()/2;}		
		if("<?php 
    echo $slideshow_title_position[0];
    ?>
"=="center"){var titlemarginleftminus=jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").outerWidth()/2;}		
		jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").css({cssText: "margin-top:-" + titlemargintopminus + "px; margin-left:-"+titlemarginleftminus+"px;"});
		
		if("<?php 
    echo $slideshow_description_position[1];
    ?>
"=="middle"){var descriptionmargintopminus=jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").outerHeight()/2;}	
		if("<?php 
    echo $slideshow_description_position[0];
    ?>
"=="center"){var descriptionmarginleftminus=jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").outerWidth()/2;}
		jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").css({cssText: "margin-top:-" + descriptionmargintopminus + "px; margin-left:-"+descriptionmarginleftminus+"px;"});
		        jQuery("#huge_it_loading_image_<?php 
    echo $sliderID;
    ?>
").css({display: "none"});
                jQuery(".huge_it_slideshow_image_wrap1_<?php 
    echo $sliderID;
    ?>
").css({display: "block"});
				jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").removeClass("nocolor");

		
		
		if("<?php 
    echo $paramssld['slider_crop_image'];
    ?>
"=="resize"){
			jQuery(".huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
,  .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
 img").css({
				cssText: "width:" + sliderwidth + "px; height:" + ((sliderwidth) * str)	+"px;"
			});
		}else {
			jQuery(".huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_item2_<?php 
    echo $sliderID;
    ?>
").css({
			cssText: "max-width: " + sliderwidth + "px !important; max-height: " + (sliderwidth * str) + "px !important;"
		  });
		}
		
		jQuery('.huge_it_video_frame_<?php 
    echo $sliderID;
    ?>
').each(function (e) {
          jQuery(this).width(sliderwidth);
          jQuery(this).height(sliderwidth * str);
        });
      }
      
      jQuery(window).load(function () {
		jQuery(window).resize(function() {
			huge_it_popup_resize_<?php 
    echo $sliderID;
    ?>
();
		});
		
		jQuery('#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
').on('click',function(){
			huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) - iterator_<?php 
    echo $sliderID;
    ?>
()) >= 0 ? (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) - iterator_<?php 
    echo $sliderID;
    ?>
()) % data_<?php 
    echo $sliderID;
    ?>
.length : data_<?php 
    echo $sliderID;
    ?>
.length - 1, data_<?php 
    echo $sliderID;
    ?>
,false,true);
			return false;
		});
		
		jQuery('#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
').on('click',function(){
			huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) + iterator_<?php 
    echo $sliderID;
    ?>
()) % data_<?php 
    echo $sliderID;
    ?>
.length, data_<?php 
    echo $sliderID;
    ?>
,false,true);
			return false;
		});
	

		
	
		
		huge_it_popup_resize_<?php 
    echo $sliderID;
    ?>
();
        /* Disable right click.*/
        jQuery('div[id^="huge_it_container"]').bind("contextmenu", function () {
          return false;
        });
        			
		/*HOVER SLIDESHOW*/
		jQuery("#huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_dots_container_<?php 
    echo $sliderID;
    ?>
,#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
,#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").hover(function(){
			//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" -- hover -- <br /> ");
			jQuery("#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
").css({'display':'inline'});
			jQuery("#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").css({'display':'inline'});
		},function(){
			jQuery("#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
").css({'display':'none'});
			jQuery("#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").css({'display':'none'});
		});
		var pausehover="<?php 
    echo $sliderpauseonhover;
    ?>
";
		if(pausehover=="on"){
			jQuery("#huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
").hover(function(){
				window.clearInterval(huge_interval['huge_it_playInterval_'+<?php 
    echo $sliderID;
    ?>
]);
			},function(){
				window.clearInterval(huge_interval['huge_it_playInterval_'+<?php 
    echo $sliderID;
    ?>
]);
				play_<?php 
    echo $sliderID;
    ?>
();
			});		
		}	
          play_<?php 
    echo $sliderID;
    ?>
();        
      });
		//var huge_play={};

      function play_<?php 
    echo $sliderID;
    ?>
(){	   
        /* Play.*/
		//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" -- paly  ---- ");
        huge_interval['huge_it_playInterval_'+<?php 
    echo $sliderID;
    ?>
] = setInterval(function () {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" -- time left ---- ");
          var iterator = 1;
          huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) + iterator) % data_<?php 
    echo $sliderID;
    ?>
.length, data_<?php 
    echo $sliderID;
    ?>
,false,false);
        }, '<?php 
    echo $slidepausetime;
    ?>
');
      }
	  
      jQuery(window).focus(function() {
       /*event_stack_<?php 
    echo $sliderID;
    ?>
 = [];*/
        var i_<?php 
    echo $sliderID;
    ?>
 = 0;
        jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").children("div").each(function () {
          if (jQuery(this).css('opacity') == 1) {
            jQuery("#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
").val(i_<?php 
    echo $sliderID;
    ?>
);
          }
          i_<?php 
    echo $sliderID;
    ?>
++;
        });
      });
      jQuery(window).blur(function() {
        event_stack_<?php 
    echo $sliderID;
    ?>
 = [];
     //   window.clearInterval(huge_interval['huge_it_playInterval_'+<?php 
    echo $sliderID;
    ?>
]);
      });      
    </script>
<style>
	.thumb_image{
		  position: absolute;
		  width: 100%;
		  height: 100%;
		  top: 0;
		  left:0;
	}
	.entry-content a{
		border-bottom: none !important;
	}
	.play-button-slider{
		top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
	}
	.youtube-icon { position: absolute;
    
    background:url(<?php 
    echo plugin_dir_url(__FILE__);
    ?>
images/play.youtube.png) center center no-repeat;background-size:14%;}
</style>
	<?php 
    $args = array('numberposts' => 10, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private', 'suppress_filters' => true);
    $recent_posts = wp_get_recent_posts($args, ARRAY_A);
    //print_r($recent_posts);
    //echo get_the_post_thumbnail(1, 'thumbnail');
    $image = wp_get_attachment_image_src(get_post_thumbnail_id(1), 'thumbnail');
    ?>

<?php 
    if ($sliderloadingicon == "on") {
        ?>
<div class="huge_it_slideshow_image_wrap_<?php 
        echo $sliderID;
        ?>
 nocolor">
<?php 
    } else {
        ?>
<div class="huge_it_slideshow_image_wrap_<?php 
        echo $sliderID;
        ?>
 ">
<?php 
    }
    ?>
	<?php 
    if ($sliderloadingicon == "on") {
        ?>
		<div id="huge_it_loading_image_<?php 
        echo $sliderID;
        ?>
" class="display" ><img  src="<?php 
        echo plugins_url('', __FILE__) . '/Front_images/loading/loading' . $paramssld["loading_icon_type"] . '.gif';
        ?>
" alt="" /> </div>
		<div class="huge_it_slideshow_image_wrap1_<?php 
        echo $sliderID;
        ?>
 nodisplay">
	<?php 
    } else {
        ?>
		<div id="huge_it_loading_image_<?php 
        echo $sliderID;
        ?>
" class="nodisplay"> <img src="<?php 
        echo plugins_url('', __FILE__) . '/Front_images/loading/loading' . $paramssld["loading_icon_type"] . '.gif';
        ?>
"  alt="" width="100" height="100" style=" margin: 0px auto;" /> </div>
		<div class="huge_it_slideshow_image_wrap1_<?php 
        echo $sliderID;
        ?>
"class="display">
	<?php 
    }
    ?>
      <?php 
    $current_pos = 0;
    ?>
      
		<!-- ##########################DOTS######################### -->
        <div class="huge_it_slideshow_dots_container_<?php 
    echo $sliderID;
    ?>
">
			  <div class="huge_it_slideshow_dots_thumbnails_<?php 
    echo $sliderID;
    ?>
">
				<?php 
    $current_image_id = 0;
    $current_pos = 0;
    $current_key = 0;
    $stri = 0;
    foreach ($images as $key => $image_row) {
        $imagerowstype = $image_row->sl_type;
        if ($image_row->sl_type == '') {
            $imagerowstype = 'image';
        }
        switch ($imagerowstype) {
            case 'image':
                if ($image_row->id == $current_image_id) {
                    $current_pos = $stri;
                    $current_key = $stri;
                }
                ?>
								<div id="huge_it_dots_<?php 
                echo $stri;
                ?>
_<?php 
                echo $sliderID;
                ?>
" class="huge_it_slideshow_dots_<?php 
                echo $sliderID;
                ?>
 <?php 
                echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_dots_active_<?php 
                echo $sliderID;
                ?>
')) { return false; } huge_it_change_image_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                echo $sliderID;
                ?>
').val()), '<?php 
                echo $stri;
                ?>
', data_<?php 
                echo $sliderID;
                ?>
,false,true);return false;" data-image_id="<?php 
                echo $image_row->id;
                ?>
" data-image_key="<?php 
                echo $stri;
                ?>
"></div>
							<?php 
                $stri++;
                break;
            case 'video':
                if ($image_row->id == $current_image_id) {
                    $current_pos = $stri;
                    $current_key = $stri;
                }
                ?>
								<div id="huge_it_dots_<?php 
                echo $stri;
                ?>
_<?php 
                echo $sliderID;
                ?>
" class="huge_it_slideshow_dots_<?php 
                echo $sliderID;
                ?>
 <?php 
                echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_dots_active_<?php 
                echo $sliderID;
                ?>
')) { return false; } huge_it_change_image_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                echo $sliderID;
                ?>
').val()), '<?php 
                echo $stri;
                ?>
', data_<?php 
                echo $sliderID;
                ?>
,false,true);return false;" data-image_id="<?php 
                echo $image_row->id;
                ?>
" data-image_key="<?php 
                echo $stri;
                ?>
"></div>
							<?php 
                $stri++;
                break;
            case 'last_posts':
                $keyForStoping = 0;
                foreach ($recent_posts as $lkeys => $last_posts) {
                    if ($image_row->name == "0") {
                        if ($lkeys < $image_row->sl_url) {
                            if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                if ($image_row->id == $current_image_id) {
                                    $current_pos = $stri;
                                    $current_key = $stri;
                                }
                                ?>
                                                                            <div id="huge_it_dots_<?php 
                                echo $stri;
                                ?>
_<?php 
                                echo $sliderID;
                                ?>
" class="huge_it_slideshow_dots_<?php 
                                echo $sliderID;
                                ?>
 <?php 
                                echo $stri == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                                ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_dots_active_<?php 
                                echo $sliderID;
                                ?>
')) { return false; } huge_it_change_image_<?php 
                                echo $sliderID;
                                ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                                echo $sliderID;
                                ?>
').val()), '<?php 
                                echo $stri;
                                ?>
', data_<?php 
                                echo $sliderID;
                                ?>
,false,true);return false;" data-image_id="<?php 
                                echo $image_row->id;
                                ?>
" data-image_key="<?php 
                                echo $stri;
                                ?>
"></div>
                                                                    <?php 
                                $stri++;
                            }
                        }
                    } else {
                        $category_id = get_cat_ID($image_row->name);
                        //       USER CHOOSED CATEGORY
                        $category_id_from_posts = wp_get_post_categories($last_posts['ID']);
                        //       GETTING ALL CATEGORIES FOR THIS POST
                        if ($keyForStoping < $image_row->sl_url) {
                            if (in_array($category_id, $category_id_from_posts)) {
                                if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                    $keyForStoping++;
                                    $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                    if ($image_row->id == $current_image_id) {
                                        $current_pos = $stri;
                                        $current_key = $stri;
                                    }
                                    ?>
                                                                                        <div id="huge_it_dots_<?php 
                                    echo $stri;
                                    ?>
_<?php 
                                    echo $sliderID;
                                    ?>
" class="huge_it_slideshow_dots_<?php 
                                    echo $sliderID;
                                    ?>
 <?php 
                                    echo $stri == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                                    ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_dots_active_<?php 
                                    echo $sliderID;
                                    ?>
')) { return false; } huge_it_change_image_<?php 
                                    echo $sliderID;
                                    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                                    echo $sliderID;
                                    ?>
').val()), '<?php 
                                    echo $stri;
                                    ?>
', data_<?php 
                                    echo $sliderID;
                                    ?>
,false,true);return false;" data-image_id="<?php 
                                    echo $image_row->id;
                                    ?>
" data-image_key="<?php 
                                    echo $stri;
                                    ?>
"></div>
                                                                                <?php 
                                    $stri++;
                                }
                            }
                        }
                    }
                }
                break;
        }
    }
    ?>
			  </div>
			
			<?php 
    if ($paramssld['slider_show_arrows'] == "on") {
        ?>
				<a id="huge_it_slideshow_left_<?php 
        echo $sliderID;
        ?>
" href="#">
					<div id="huge_it_slideshow_left-ico_<?php 
        echo $sliderID;
        ?>
">
					<div><i class="huge_it_slideshow_prev_btn_<?php 
        echo $sliderID;
        ?>
 fa"></i></div></div>
				</a>
				
				<a id="huge_it_slideshow_right_<?php 
        echo $sliderID;
        ?>
" href="#">
					<div id="huge_it_slideshow_right-ico_<?php 
        echo $sliderID;
        ?>
">
					<div><i class="huge_it_slideshow_next_btn_<?php 
        echo $sliderID;
        ?>
 fa"></i></div></div>
				</a>
			<?php 
    }
    ?>
		</div>
	  <!-- ##########################IMAGES######################### -->

      <div id="huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
" class="huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
">        
        <div class="huge_it_slide_container_<?php 
    echo $sliderID;
    ?>
">
          <div class="huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
">
            <ul class="huge_it_slider_<?php 
    echo $sliderID;
    ?>
">
			  <?php 
    $i = 0;
    //                          var_dump($images);exit;
    foreach ($images as $key => $image_row) {
        $imagerowstype = $image_row->sl_type;
        if ($image_row->sl_type == '') {
            $imagerowstype = 'image';
        }
        switch ($imagerowstype) {
            case 'image':
                $target = "";
                ?>
					  <li class="huge_it_slideshow_image<?php 
                if ($i != $current_image_id) {
                    $current_key = $key;
                    echo '_second';
                }
                ?>
_item_<?php 
                echo $sliderID;
                ?>
" id="image_id_<?php 
                echo $sliderID . '_' . $i;
                ?>
">      
						<?php 
                if ($image_row->sl_url != "") {
                    if ($image_row->link_target == "on") {
                        $target = 'target="_blank"';
                    }
                    echo '<a href="' . $image_row->sl_url . '" ' . $target . '>';
                }
                ?>
						<img id="huge_it_slideshow_image_<?php 
                echo $sliderID;
                ?>
_<?php 
                echo $key;
                ?>
" class="huge_it_slideshow_image_<?php 
                echo $sliderID;
                ?>
" src="<?php 
                echo $image_row->image_url;
                ?>
"  alt="<?php 
                echo $image_row->name;
                ?>
" data-image_id="<?php 
                echo $image_row->id;
                ?>
" />
						<?php 
                if ($image_row->sl_url != "") {
                    echo '</a>';
                }
                ?>
		
						<div class="huge_it_slideshow_title_text_<?php 
                echo $sliderID;
                ?>
 <?php 
                if (trim($image_row->name) == "") {
                    echo "none";
                }
                ?>
">
							<?php 
                echo $image_row->name;
                ?>
						</div>
						<div class="huge_it_slideshow_description_text_<?php 
                echo $sliderID;
                ?>
 <?php 
                if (trim($image_row->description) == "") {
                    echo "none";
                }
                ?>
">
							<?php 
                echo $image_row->description;
                ?>
						</div>
					  </li>
					  <?php 
                $i++;
                break;
            case 'last_posts':
                $keyForStoping = 0;
                foreach ($recent_posts as $lkeys => $last_posts) {
                    if ($image_row->name == "0") {
                        if ($lkeys < $image_row->sl_url) {
                            $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                            if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                $target = "";
                                ?>
                                                      <li class="huge_it_slideshow_image<?php 
                                if ($i != $current_image_id) {
                                    $current_key = $key;
                                    echo '_second';
                                }
                                ?>
_item_<?php 
                                echo $sliderID;
                                ?>
" id="image_id_<?php 
                                echo $sliderID . '_' . $i;
                                ?>
">      
                                                            <?php 
                                if ($image_row->sl_postlink == "1") {
                                    if ($image_row->link_target == "on") {
                                        $target = 'target="_blank"';
                                    }
                                    echo '<a href="' . $last_posts["guid"] . '" ' . $target . '>';
                                }
                                ?>
                                                            <img id="huge_it_slideshow_image_<?php 
                                echo $sliderID;
                                ?>
_<?php 
                                echo $key;
                                ?>
" class="huge_it_slideshow_image_<?php 
                                echo $sliderID;
                                ?>
" src="<?php 
                                echo $imagethumb[0];
                                ?>
"  alt=" <?php 
                                echo $last_posts["post_title"];
                                ?>
" data-image_id="<?php 
                                echo $image_row->id;
                                ?>
" />
                                                            <?php 
                                if ($image_row->sl_postlink == "1") {
                                    echo '</a>';
                                }
                                ?>
		
                                                            <div class="huge_it_slideshow_title_text_<?php 
                                echo $sliderID;
                                ?>
 <?php 
                                if (trim($last_posts["post_title"]) == "") {
                                    echo "none";
                                }
                                if ($image_row->sl_stitle != "1") {
                                    echo " hidden";
                                }
                                ?>
">
                                                                            <?php 
                                echo $last_posts["post_title"];
                                ?>
                                                            </div>
                                                            <div class="huge_it_slideshow_description_text_<?php 
                                echo $sliderID;
                                ?>
 <?php 
                                if (trim($last_posts["post_content"]) == "") {
                                    echo "none";
                                }
                                if ($image_row->sl_sdesc != "1") {
                                    echo " hidden";
                                }
                                ?>
">
                                                                    <?php 
                                echo substr_replace($last_posts["post_content"], "", $image_row->description);
                                ?>
                                                            </div>
                                                     </li>
                                                      <?php 
                                $i++;
                            }
                        }
                    } else {
                        $category_id = get_cat_ID($image_row->name);
                        //       USER CHOOSED CATEGORY
                        $category_id_from_posts = wp_get_post_categories($last_posts['ID']);
                        //       GETTING ALL CATEGORIES FOR THIS POST
                        if ($keyForStoping < $image_row->sl_url) {
                            if (in_array($category_id, $category_id_from_posts)) {
                                $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                    $keyForStoping++;
                                    $target = "";
                                    ?>
                                                          <li class="huge_it_slideshow_image<?php 
                                    if ($i != $current_image_id) {
                                        $current_key = $key;
                                        echo '_second';
                                    }
                                    ?>
_item_<?php 
                                    echo $sliderID;
                                    ?>
" id="image_id_<?php 
                                    echo $sliderID . '_' . $i;
                                    ?>
">      
                                                                <?php 
                                    if ($image_row->sl_postlink == "1") {
                                        if ($image_row->link_target == "on") {
                                            $target = 'target="_blank"';
                                        }
                                        echo '<a href="' . $last_posts["guid"] . '" ' . $target . '>';
                                    }
                                    ?>
                                                                <img id="huge_it_slideshow_image_<?php 
                                    echo $sliderID;
                                    ?>
" class="huge_it_slideshow_image_<?php 
                                    echo $sliderID;
                                    ?>
" src="<?php 
                                    echo $imagethumb[0];
                                    ?>
"  alt="<?php 
                                    echo $last_posts["post_title"];
                                    ?>
" data-image_id="<?php 
                                    echo $image_row->id;
                                    ?>
" />
                                                                <?php 
                                    if ($image_row->sl_postlink == "1") {
                                        echo '</a>';
                                    }
                                    ?>
		
                                                                <div class="huge_it_slideshow_title_text_<?php 
                                    echo $sliderID;
                                    ?>
 <?php 
                                    if (trim($last_posts["post_title"]) == "") {
                                        echo "none";
                                    }
                                    if ($image_row->sl_stitle != "1") {
                                        echo " hidden";
                                    }
                                    ?>
">
                                                                                <?php 
                                    echo $last_posts["post_title"];
                                    ?>
                                                                </div>
                                                                <div class="huge_it_slideshow_description_text_<?php 
                                    echo $sliderID;
                                    ?>
 <?php 
                                    if (trim($last_posts["post_content"]) == "") {
                                        echo "none";
                                    }
                                    if ($image_row->sl_sdesc != "1") {
                                        echo " hidden";
                                    }
                                    ?>
">
                                                                        <?php 
                                    echo substr_replace($last_posts["post_content"], "", $image_row->description);
                                    ?>
                                                                </div>
                                                         </li>
                                                          <?php 
                                    $i++;
                                }
                            }
                        }
                    }
                }
                break;
            case 'video':
                ?>
						<li  class="huge_it_slideshow_image<?php 
                if ($i != $current_image_id) {
                    $current_key = $key;
                    echo '_second';
                }
                ?>
_item_<?php 
                echo $sliderID;
                ?>
" id="image_id_<?php 
                echo $sliderID . '_' . $i;
                ?>
">      
							<?php 
                if (strpos($image_row->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                    $video_thumb_url = get_youtube_id_from_url($image_row->image_url);
                    ?>
									
									<div id="video_id_<?php 
                    echo $sliderID;
                    ?>
_<?php 
                    echo $key;
                    ?>
" class="huge_it_video_frame_<?php 
                    echo $sliderID;
                    ?>
"></div>
									<div class="thumb_wrapper" data-rowid="<?php 
                    echo $image_row->id;
                    ?>
" onclick="thevid=document.getElementById('video_id_<?php 
                    echo $sliderID;
                    ?>
_<?php 
                    echo $key;
                    ?>
'); thevid.style.display='block'; this.style.display='none'">
												<img  class="thumb_image" src="https://i.ytimg.com/vi/<?php 
                    echo $video_thumb_url;
                    ?>
/hqdefault.jpg">
												<div class="play-button-slider youtube-icon"></div>
									</div>
							<?php 
                } else {
                    $vimeo = $image_row->image_url;
                    $imgid = end(explode("/", $vimeo));
                    ?>
					
								<iframe id="player_<?php 
                    echo $key;
                    ?>
"  class="huge_it_video_frame_<?php 
                    echo $sliderID;
                    ?>
" src="//player.vimeo.com/video/<?php 
                    echo $imgid;
                    ?>
?api=1&player_id=player_<?php 
                    echo $key;
                    ?>
&showinfo=0&controls=0" frameborder="0" allowfullscreen></iframe>
							<?php 
                }
                ?>
						</li>
					<?php 
                $i++;
                break;
        }
    }
    ?>
            </ul>
          </div>
		  <input  type="hidden" id="huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
" value="0" />
        </div>
      </div>
	</div>
<!-- slider thumbs  -->

<script>
jQuery(document).ready(function($) {

		
	setInterval(function() {
	jQuery('.huge_it_slider_<?php 
    echo $sliderID;
    ?>
').find("li").each(function (){
		
  		if($(this).css("opacity") == "1"){

  			var img_id=$(this).attr('id');
  			jQuery('.huge_it_slideshow_thumbs_<?php 
    echo $sliderID;
    ?>
').each(function (){
  				//if ($(this).hasClass('bx-clone')){$(this).removeAttr('id')}
  				var allListElements = $( 'li[id='+img_id+']' );
  				
  				$(this).find(allListElements).not(".bx-clone").each(function() {
  					

  					jQuery('.huge_it_slideshow_thumbs_<?php 
    echo $sliderID;
    ?>
 li').find(".trans_back").css('background','rgba(255,255,255,0.3)');
  					$(this).find('.trans_back').css('background','none');

  						
  					
  				})
  				

  			
  			})
			
  		}
		
	})
},100)


	

})
</script>

	
</div>
<?php 
    if ($sliderthumbslider == 'thumbnails') {
        ?>
<div class="huge_it_slideshow_thumbs_container_<?php 
        echo $sliderID;
        ?>
">
			  <ul id="huge_it_thumb_slider" class="huge_it_slideshow_thumbs_<?php 
        echo $sliderID;
        ?>
">
				<?php 
        $i = 0;
        $current_image_id = 0;
        $current_pos = 0;
        $current_key = 0;
        $stri = 0;
        // foreach ($slider as $row => $value) {
        // 	$time=$row->description;
        // 	echo $time;
        // }
        foreach ($images as $key => $image_row) {
            $imagerowstype = $image_row->sl_type;
            ////////$imgurl
            if ($image_row->sl_type == '') {
                $imagerowstype = 'image';
            }
            switch ($imagerowstype) {
                case 'image':
                    if ($image_row->id == $current_image_id) {
                        $current_pos = $stri;
                        $current_key = $stri;
                    }
                    ?>
							
								<li id="image_id_<?php 
                    echo $sliderID . '_' . $i;
                    ?>
" class="huge_it_slideshow_thumbnails_<?php 
                    echo $sliderID;
                    ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_thumbnails_active_<?php 
                    echo $sliderID;
                    ?>
')) { return false; } huge_it_change_image_<?php 
                    echo $sliderID;
                    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                    echo $sliderID;
                    ?>
').val()), '<?php 
                    echo $stri;
                    ?>
', data_<?php 
                    echo $sliderID;
                    ?>
,false,true);return false;" data-image_id="<?php 
                    echo $image_row->id;
                    ?>
" data-image_key="<?php 
                    echo $stri;
                    ?>
">
										<img class="sl_thumb_img" src="<?php 
                    echo $image_row->image_url;
                    ?>
" />
										<div class="trans_back" ></div>
										<input type="hidden" id="time" name="time" value="<?php 
                    echo $slidepausetime;
                    ?>
">
										
								</li>
							<?php 
                    $stri++;
                    $i++;
                    break;
                case 'video':
                    $url = $image_row->image_url;
                    if (!function_exists('get_youtube_id_from_url_slider_thumb')) {
                        function get_youtube_id_from_url_slider_thumb($url)
                        {
                            if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $match)) {
                                return $match[1];
                            }
                        }
                    }
                    if (strpos($image_row->image_url, 'youtube') !== false || strpos($image_row->image_url, 'youtu') !== false) {
                        $video_thumb_url = get_youtube_id_from_url_slider_thumb($image_row->image_url);
                        $thumburl = '<img class="sl_thumb_img" src="http://img.youtube.com/vi/' . $video_thumb_url . '/mqdefault.jpg" alt="" />';
                        $liclass = "youtube";
                    } else {
                        if (strpos($image_row->image_url, 'vimeo') !== false) {
                            $liclass = "vimeo";
                            $vimeo = $image_row->image_url;
                            $imgid = end(explode("/", $vimeo));
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $imgid . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            $thumburl = '<img src="' . $imgsrc . '" alt="" />';
                        }
                    }
                    if ($image_row->id == $current_image_id) {
                        $current_pos = $stri;
                        $current_key = $stri;
                    }
                    ?>
							<li id="image_id_<?php 
                    echo $sliderID . '_' . $i;
                    ?>
" class="huge_it_slideshow_thumbnails_<?php 
                    echo $sliderID;
                    ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_thumbnails_active_<?php 
                    echo $sliderID;
                    ?>
')) { return false; } huge_it_change_image_<?php 
                    echo $sliderID;
                    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                    echo $sliderID;
                    ?>
').val()), '<?php 
                    echo $stri;
                    ?>
', data_<?php 
                    echo $sliderID;
                    ?>
,false,true);return false;" data-image_id="<?php 
                    echo $image_row->id;
                    ?>
" data-image_key="<?php 
                    echo $stri;
                    ?>
">
								<?php 
                    echo $thumburl;
                    ?>
								<div class="play-icon <?php 
                    echo $liclass;
                    ?>
"></div>
								<div class="trans_back" ></div>
								<input type="hidden" id="time" name="time" value="<?php 
                    echo $slidepausetime;
                    ?>
" slide="<?php 
                    echo $sliderID;
                    ?>
">
							</li>

								
							<?php 
                    $stri++;
                    $i++;
                    break;
                case 'last_posts':
                    $keyForStoping = 0;
                    foreach ($recent_posts as $lkeys => $last_posts) {
                        if ($image_row->name == "0") {
                            if ($lkeys < $image_row->sl_url) {
                                $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                    $target = "";
                                    ?>
                                                      <li id="image_id_<?php 
                                    echo $sliderID . '_' . $i;
                                    ?>
" class="huge_it_slideshow_thumbnails_<?php 
                                    echo $sliderID;
                                    ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_thumbnails_active_<?php 
                                    echo $sliderID;
                                    ?>
')) { return false; } huge_it_change_image_<?php 
                                    echo $sliderID;
                                    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                                    echo $sliderID;
                                    ?>
').val()), '<?php 
                                    echo $stri;
                                    ?>
', data_<?php 
                                    echo $sliderID;
                                    ?>
,false,true);return false;" data-image_id="<?php 
                                    echo $image_row->id;
                                    ?>
" data-image_key="<?php 
                                    echo $stri;
                                    ?>
">      
                                                            
                                                            <img class="sl_thumb_img" src="<?php 
                                    echo $imagethumb[0];
                                    ?>
"/>
                                                            <div class="trans_back" ></div>
															<input type="hidden" id="time" name="time" value="<?php 
                                    echo $slidepausetime;
                                    ?>
">		
                                                            
                                                     </li>
                                                      <?php 
                                    $i++;
                                }
                            }
                        } else {
                            $category_id = get_cat_ID($image_row->name);
                            //       USER CHOOSED CATEGORY
                            $category_id_from_posts = wp_get_post_categories($last_posts['ID']);
                            //       GETTING ALL CATEGORIES FOR THIS POST
                            if ($keyForStoping < $image_row->sl_url) {
                                if (in_array($category_id, $category_id_from_posts)) {
                                    $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                    if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                        $keyForStoping++;
                                        $target = "";
                                        ?>
                                                           <li id="image_id_<?php 
                                        echo $sliderID . '_' . $i;
                                        ?>
" class="huge_it_slideshow_thumbnails_<?php 
                                        echo $sliderID;
                                        ?>
" onclick="if(jQuery(this).hasClass('huge_it_slideshow_thumbnails_active_<?php 
                                        echo $sliderID;
                                        ?>
')) { return false; } huge_it_change_image_<?php 
                                        echo $sliderID;
                                        ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                                        echo $sliderID;
                                        ?>
').val()), '<?php 
                                        echo $stri;
                                        ?>
', data_<?php 
                                        echo $sliderID;
                                        ?>
,false,true);return false;" data-image_id="<?php 
                                        echo $image_row->id;
                                        ?>
" data-image_key="<?php 
                                        echo $stri;
                                        ?>
">        
                                                                
                                                                <img id="huge_it_slideshow_image_<?php 
                                        echo $sliderID;
                                        ?>
" class="huge_it_slideshow_image_<?php 
                                        echo $sliderID;
                                        ?>
" src="<?php 
                                        echo $imagethumb[0];
                                        ?>
"/>
                                                                <div class="trans_back" ></div>
																<input type="hidden" id="time" name="time" value="<?php 
                                        echo $slidepausetime;
                                        ?>
">		
                                                               
                                                         </li>
                                                          <?php 
                                        $i++;
                                    }
                                }
                            }
                        }
                    }
                    break;
            }
        }
        //print_r($count);
        ?>
					
			  </ul>

	</div>	
<?php 
    }
    ?>


	  <?php 
    return ob_get_clean();
}
function Html_editvideogallery($ord_elem, $count_ord, $images, $row, $cat_row, $rowim, $rowsld, $rowsposts, $rowsposts8, $postsbycat)
{
    global $wpdb;
    if (isset($_GET["addslide"])) {
        if ($_GET["addslide"] == 1) {
            header('Location: admin.php?page=videogallerys_huge_it_videogallery&id=' . $row->id . '&task=apply');
        }
    }
    ?>
<script type="text/javascript">
function submitbutton(pressbutton) 
{
	if(!document.getElementById('name').value){
	alert("Name is required.");
	return;
	
	}
	
	document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
	document.getElementById("adminForm").submit();
	
}
var  name_changeRight = function(e) {
	document.getElementById("name").value = e.value;
}
var  name_changeTop = function(e) {
		document.getElementById("huge_it_videogallery_name").value = e.value;
		//alert(e);
	};
function change_select()
{
		submitbutton('apply'); 
	
}
jQuery(function() {

	jQuery('.def_thumb').on('click',(function (){
		jQuery(this).parents('li').find('.image-container input+input').val('');
		submitbutton('apply');
	}))
	;


	
	jQuery( "#images-list" ).sortable({
	  stop: function() {
			jQuery("#images-list > li").removeClass('has-background');
			count=jQuery("#images-list > li").length;
			for(var i=0;i<=count;i+=2){
					jQuery("#images-list > li").eq(i).addClass("has-background");
			}
			jQuery("#images-list > li").each(function(){
				jQuery(this).find('.order_by').val(jQuery(this).index());
			});
	  },
	  revert: true
	});
   // jQuery( "ul, li" ).disableSelection();
	});
</script>

<!-- GENERAL PAGE, ADD IMAGES PAGE -->

<div class="wrap">
<?php 
    $path_site2 = plugins_url("../images", __FILE__);
    ?>
	<style>
		.free_version_banner {
			position:relative;
			display:block;
			background-image:url(<?php 
    echo $path_site2;
    ?>
/wp_banner_bg.jpg);
			background-position:top left;
			backround-repeat:repeat;
			overflow:hidden;
		}
		
		.free_version_banner .manual_icon {
			position:absolute;
			display:block;
			top:15px;
			left:15px;
		}
		
		.free_version_banner .usermanual_text {
                        font-weight: bold !important;
			display:block;
			float:left;
			width:270px;
			margin-left:75px;
			font-family:'Open Sans',sans-serif;
			font-size:12px;
			font-weight:300;
			font-style:italic;
			color:#ffffff;
			line-height:10px;
                        margin-top: 0;
                        padding-top: 15px;
		}
		
		.free_version_banner .usermanual_text a,
		.free_version_banner .usermanual_text a:link,
		.free_version_banner .usermanual_text a:visited {
			display:inline-block;
			font-family:'Open Sans',sans-serif;
			font-size:17px;
			font-weight:600;
			font-style:italic;
			color:#ffffff;
			line-height:30.5px;
			text-decoration:underline;
		}
		
		.free_version_banner .usermanual_text a:hover,
		.free_version_banner .usermanual_text a:focus,
		.free_version_banner .usermanual_text a:active {
			text-decoration:underline;
		}
		
		.free_version_banner .get_full_version,
		.free_version_banner .get_full_version:link,
		.free_version_banner .get_full_version:visited {
                        padding-left: 60px;
                        padding-right: 4px;
			display: inline-block;
                        position: absolute;
                        top: 15px;
                        right: calc(50% - 167px);
                        height: 38px;
                        width: 268px;
                        border: 1px solid rgba(255,255,255,.6);
                        font-family: 'Open Sans',sans-serif;
                        font-size: 23px;
                        color: #ffffff;
                        line-height: 43px;
                        text-decoration: none;
                        border-radius: 2px;
		}
		
		.free_version_banner .get_full_version:hover {
			background:#ffffff;
			color:#bf1e2e;
			text-decoration:none;
			outline:none;
		}
		
		.free_version_banner .get_full_version:focus,
		.free_version_banner .get_full_version:active {
			
		}
		
		.free_version_banner .get_full_version:before {
			content:'';
			display:block;
			position:absolute;
			width:33px;
			height:23px;
			left:25px;
			top:9px;
			background-image:url(<?php 
    echo $path_site2;
    ?>
/wp_shop.png);
			background-position:0px 0px;
			background-repeat;
		}
		
		.free_version_banner .get_full_version:hover:before {
			background-position:0px -27px;
		}
		
		.free_version_banner .huge_it_logo {
			float:right;
			margin:15px 15px;
		}
		
		.free_version_banner .description_text {
                        padding:0 0 13px 0;
			position:relative;
			display:block;
			width:100%;
			text-align:center;
			float:left;
			font-family:'Open Sans',sans-serif;
			color:#fffefe;
			line-height:inherit;
		}
                .free_version_banner .description_text p{
                        margin:0;
                        padding:0;
                        font-size: 14px;
                }
		</style>
	<div class="free_version_banner">
		<img class="manual_icon" src="<?php 
    echo $path_site2;
    ?>
/icon-user-manual.png" alt="user manual" />
		<p class="usermanual_text">If you have any difficulties in using the options, Follow the link to <a href="http://huge-it.com/wordpress-video-gallery-user-manual/" target="_blank">User Manual</a></p>
		<a class="get_full_version" href="http://huge-it.com/wordpress-video-gallery/" target="_blank">GET THE FULL VERSION</a>
                <a href="http://huge-it.com" target="_blank"><img class="huge_it_logo" src="<?php 
    echo $path_site2;
    ?>
/Huge-It-logo.png"/></a>
                <div style="clear: both;"></div>
		<div  class="description_text"><p>This is the free version of the plugin. Click "GET THE FULL VERSION" for more advanced options. We appreciate every customer.</p></div>
	</div>
	<div style="clear: both;"></div>
<form action="admin.php?page=videogallerys_huge_it_videogallery&id=<?php 
    echo $row->id;
    ?>
" method="post" name="adminForm" id="adminForm">

	<div id="poststuff" >
	<div id="videogallery-header">
		<ul id="videogallerys-list">
			
			<?php 
    foreach ($rowsld as $rowsldires) {
        if ($rowsldires->id != $row->id) {
            ?>
					<li>
						<a href="#" onclick="window.location.href='admin.php?page=videogallerys_huge_it_videogallery&task=edit_cat&id=<?php 
            echo $rowsldires->id;
            ?>
'" ><?php 
            echo $rowsldires->name;
            ?>
</a>
					</li>
				<?php 
        } else {
            ?>
					<li class="active" onclick='document.getElementById("name").style.width = ((document.getElementById("name").value.length + 1) * 8) + "px"' style="background-image:url(<?php 
            echo plugins_url('../images/edit.png', __FILE__);
            ?>
);cursor:pointer;">
						<input class="text_area" onfocus="this.style.width = ((this.value.length + 1) * 8) + 'px'" onkeyup="name_changeTop(this)" type="text" name="name" id="name" maxlength="250" value="<?php 
            echo esc_html(stripslashes($row->name));
            ?>
" />
					</li>
				<?php 
        }
    }
    ?>
			<li class="add-new">
				<a onclick="window.location.href='admin.php?page=videogallerys_huge_it_videogallery&amp;task=add_cat'">+</a>
			</li>
		</ul>
		</div>
		<div id="post-body" class="metabox-holder columns-2">
			<!-- Content -->
			<div id="post-body-content">


			<?php 
    add_thickbox();
    ?>

				<div id="post-body">
					<div id="post-body-heading">
						<h3>Projects/Videos</h3>			
						<?php 
    $_GET['id'] = esc_html($_GET['id']);
    ?>
						<a href="admin.php?page=videogallerys_huge_it_videogallery&task=videogallery_video&id=<?php 
    echo $_GET['id'];
    ?>
&TB_iframe=1" class="button button-primary add-video-slide thickbox"  id="slideup3s" value="iframepop">
							<span class="wp-media-buttons-icon"></span>Add Video 
						</a>
					</div>
					<ul id="images-list">
					<?php 
    function get_youtube_id_from_url($url)
    {
        if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $match)) {
            return $match[1];
        }
    }
    $i = 2;
    foreach ($rowim as $key => $rowimages) {
        ?>
					<?php 
        if ($rowimages->sl_type == '') {
            $rowimages->sl_type = 'image';
        }
        switch ($rowimages->sl_type) {
            case 'video':
                ?>
							
							<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
  >
							<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
								<?php 
                if (empty($rowimages->thumb_url)) {
                    if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                        $liclass = "youtube";
                        $video_thumb_url = get_youtube_id_from_url($rowimages->image_url);
                        $thumburl = '<img src="http://img.youtube.com/vi/' . $video_thumb_url . '/mqdefault.jpg" alt="" />';
                    } else {
                        if (strpos($rowimages->image_url, 'vimeo') !== false) {
                            $liclass = "vimeo";
                            $vimeo = $rowimages->image_url;
                            $imgid = explode("/", $vimeo);
                            $imgid = end($imgid);
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $imgid . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            $imgsrc = esc_html($imgsrc);
                            $thumburl = '<img src="' . $imgsrc . '" alt="" />';
                        }
                    }
                } else {
                    if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                        $liclass = "youtube";
                    } else {
                        if (strpos($rowimages->image_url, 'vimeo') !== false) {
                            $liclass = "vimeo";
                        }
                    }
                    $thumburl = '<img src="' . $rowimages->thumb_url . '" alt="" />';
                }
                ?>
 
									<div class="image-container">	
										<?php 
                echo $thumburl;
                ?>
										<div class="play-icon <?php 
                echo $liclass;
                ?>
"></div>
										
										<div>
											<script>
											jQuery(document).ready(function($){
											  var _custom_media = true,
												  _orig_send_attachment = wp.media.editor.send.attachment;

											  jQuery('.huge-it-editnewuploader .button<?php 
                echo $rowimages->id;
                ?>
').click(function(e) {
												var send_attachment_bkp = wp.media.editor.send.attachment;
												var button = jQuery(this);
												var id = button.attr('id').replace('_button', '');
												_custom_media = true;
												wp.media.editor.send.attachment = function(props, attachment){
												  if ( _custom_media ) {
													jQuery("#"+id).val(attachment.url);
													jQuery("#save-buttom").click();
												  } else {
													return _orig_send_attachment.apply( this, [props, attachment] );
												  };
												}

												wp.media.editor.open(button);
												return false;
											  });











											  jQuery('.add_media').on('click', function(){
												_custom_media = false;
											  });
												jQuery(".huge-it-editnewuploader").click(function() {
												});
													jQuery(".wp-media-buttons-icon").click(function() {
													jQuery(".wp-media-buttons-icon").click(function() {
													jQuery(".media-menu .media-menu-item").css("display","none");
													jQuery(".media-menu-item:first").css("display","block");
													jQuery(".separator").next().css("display","none");
													jQuery('.attachment-filters').val('image').trigger('change');
													jQuery(".attachment-filters").css("display","none");

												});
											});
													jQuery("input[name='thumb_id_button<?php 
                echo $rowimages->id;
                ?>
'], .hg_set_def_button").each(function(){
														
														jQuery(this).hover(function(){
															
																  jQuery(this).clearQueue().animate({
																	 width: "170px", 
																	 color:"rgba(0,0,0,1)"
																}, 200);
															
															
															
															
														},
																			function(){
															jQuery(this).animate({
																width: "20px", 
																color:"rgba(0,0,0,0)"   
															}, 200);
															
															
														})
														
													})
											});
											</script>
											<input type="hidden" name="imagess<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->image_url;
                ?>
" />
											<input type="hidden" name="thumbs<?php 
                echo $rowimages->id;
                ?>
" id="thumb_id<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->thumb_url;
                ?>
" />
											<div class="huge-it-editnewuploader uploader button<?php 
                echo $rowimages->id;
                ?>
 add-new-image">
												<input type="button" class="editimgbutton button<?php 
                echo $rowimages->id;
                ?>
 wp-media-buttons-icon" name="thumb_id_button<?php 
                echo $rowimages->id;
                ?>
" id="thumb_id_button<?php 
                echo $rowimages->id;
                ?>
" value="Set Custom Thumbnail" />
												<div class="hg_set_def_button button def_thumb <?php 
                if ($rowimages->thumb_url == "") {
                    echo "hg_disp_none";
                }
                ?>
">
													Set Default Thumbnail
												</div>
											</div>
											
										</div>
										
										<div class="hg_thumbneil_views">
												
											<div class="hg_report">		
											<?php 
                ?>
											
												<div class="hg_info_div">
													<div class="cb"></div>
													<?php 
                /*<a href="admin.php?page=videogallerys_huge_it_videogallery&task=videogallery_test_name&namevideo=<?php echo $rowimages->name; ?>&view_count=<?php echo count((array)$view_count); ?>&id_id=<?php echo $rowimages->id; ?>&id=1" class="thickbox hg_open_pop_up">View Report PDF</a> */
                ?>
													<div class="hg_view_count"><span>Video Views Count (pro)</span>
														<a href="#TB_inline?width=600&height=550&inlineId=html_videogallery_video_test" class="thickbox hg_open_pop_up"><div class="hg-arrow-right"></div>View Detailed Report</a>
													</div>
													<div class="cb"></div>
													
													<div id="html_videogallery_video_test" style="display: none;">
														<style>
														.updated {
															display: none;
														}
														#TB_window {
															overflow: scroll;
															max-height: 750px;
														}
														#TB_ajaxContent {
															width: 100%!important;
															background: url(<?php 
                echo plugins_url('../images/pop-up.jpg', __FILE__);
                ?>
) center no-repeat;
															padding: 0;
														}
														.get_full_version {
															display: block;
															border: 1px solid #bf1e2e;
															text-decoration: none;
															font-size: 23px;
															color: #bf1e2e;	
															font-family: 'Open sans', sans-serif;
															width: 280px;
															padding: 10px;
															text-align: center;
															margin: 0 auto;
															
														}
														.get_full_version:hover {
															color: #fff;
															background-color: #bf1e2e;
														}
														span {
															display: block;
														}
														h3 {
															font-size: 37.3px;
															color: #524e4e;
															text-align: center;
															line-height: 37.3px;
														}
														.hg_pop_up_div img {
															margin: 0 auto;
															display: block;
															padding-top: 120px;
														}
														}
														</style>
														
														<div class="hg_pop_up_div">
															<img src="<?php 
                echo plugins_url('../images/pop_pdf.png', __FILE__);
                ?>
" alt="Download Full Version" />
															<h3>Sorry, this option is available in the full version.</h3>															
															<a class="get_full_version" href="http://huge-it.com/wordpress-video-gallery/" target="_blank">
																GET THE FULL VERSION
															</a>	
														</div>

													</div>
												</div>
											</div>											
										</div>										
									</div>
									<div class="image-options">
								<div>
									<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Title:</label>
                                                                        <input  class="text_area" type="text" id="titleimage<?php 
                echo $rowimages->id;
                ?>
" name="titleimage<?php 
                echo $rowimages->id;
                ?>
" id="titleimage<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo htmlspecialchars(str_replace('__5_5_5__', '%', $rowimages->name));
                ?>
">
								</div>
								<div class="description-block">
									<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description:</label>
									<textarea id="im_description<?php 
                echo $rowimages->id;
                ?>
" name="im_description<?php 
                echo $rowimages->id;
                ?>
" ><?php 
                echo str_replace('__5_5_5__', '%', $rowimages->description);
                ?>
</textarea>
								</div>
								<div class="link-block">
									<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">URL:</label>
									<input class="text_area url-input" type="text" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->sl_url);
                ?>
" >
									<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">
										<span>Open in new tab</span>
										<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />
									</label>
									
									
							
								</div>
								<div class="remove-image-container">
									<a class="button remove-image" href="admin.php?page=videogallerys_huge_it_videogallery&task=edit_cat&id=<?php 
                echo $row->id;
                ?>
&removeslide=<?php 
                echo $rowimages->id;
                ?>
">Remove Video</a>
								</div>
							</div>
							<div class="clear"></div>
							</li>
					<?php 
                break;
        }
        ?>
					<?php 
    }
    ?>
					</ul>
				</div>

			</div>
				
			<!-- SIDEBAR -->
			<div id="postbox-container-1" class="postbox-container">
				<div id="side-sortables" class="meta-box-sortables ui-sortable">
					<div id="videogallery-unique-options" class="postbox">
					<h3 class="hndle"><span>Video Gallery Custom Options</span></h3>
					<ul id="videogallery-unique-options-list">
						<li>
							<label for="huge_it_videogallery_name">Gallery Name</label>
							<input type = "text" name="name" id="huge_it_videogallery_name" value="<?php 
    echo esc_html(stripslashes($row->name));
    ?>
" onkeyup = "name_changeRight(this)">
						</li>
						<li>
							<label for="huge_it_sl_effects">Views</label>
							<select name="huge_it_sl_effects" id="huge_it_sl_effects">
									<option <?php 
    if ($row->huge_it_sl_effects == '0') {
        echo 'selected';
    }
    ?>
  value="0">Video Gallery/Content-Popup</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '1') {
        echo 'selected';
    }
    ?>
  value="1">Content Video Slider</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '5') {
        echo 'selected';
    }
    ?>
  value="5">Lightbox-Video Gallery</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '3') {
        echo 'selected';
    }
    ?>
  value="3">Video Slider</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '4') {
        echo 'selected';
    }
    ?>
  value="4">Thumbnails View</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '6') {
        echo 'selected';
    }
    ?>
  value="6">Justified</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '7') {
        echo 'selected';
    }
    ?>
  value="7">Blog Style Gallery</option>
							</select>
						</li>
						<script>
						jQuery(document).ready(function ($){
							//alert('hi');
							//$('div[id^="list_"]')
                                                        if($('select[name="display_type"]').val()== 2){
								$('li[id="content_per_page"]').hide();
							}else{
								$('li[id="content_per_page"]').show();
							}
                                                        
							$('select[name="display_type"]').on('change' ,function(){
								if($(this).val()== 2){
								$('li[id="content_per_page"]').hide();
							}else{
								$('li[id="content_per_page"]').show();
							}
							})
							  	$( 'div[id^="videogallery-current-options"]').each(function(){
								if(!$(this).hasClass( "active" )){
									$(this).find('ul li input[name="content_per_page"]').attr('name', '');
									$(this).find('ul li select[name="display_type"]').attr('name', '');
									//$(this).find('ul li select').attr('name', '');
								}else{
									//alert('no');
								}
							})

							$('#videogallery-unique-options').on('change',function(){
								$( 'div[id^="videogallery-current-options"]').each(function(){
								if(!$(this).hasClass( "active" )){
									$(this).find('ul li input[name="content_per_page"]').attr('name', '');
									$(this).find('ul li select[name="display_type"]').attr('name', '');
									//$(this).find('ul li select').attr('name', '');
								}else{
									//alert('no');
								}
							})
							})
                                                      
							
						})
					</script>
						<div id="videogallery-current-options-0" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 0) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>	
					<div id="videogallery-current-options-3" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 3) {
        echo ' active';
    }
    ?>
">
					<ul id="slider-unique-options-list">
						<li>
							<label for="sl_width">Width</label>
							<input type="text" name="sl_width" id="sl_width" value="<?php 
    echo $row->sl_width;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_height">Height</label>
							<input type="text" name="sl_height" id="sl_height" value="<?php 
    echo $row->sl_height;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="pause_on_hover">Pause on hover</label>
							<input type="hidden" value="off" name="pause_on_hover" />					
							<input type="checkbox" name="pause_on_hover"  value="on" id="pause_on_hover"  <?php 
    if ($row->pause_on_hover == 'on') {
        echo 'checked="checked"';
    }
    ?>
 />
						</li>
						<li>
							<label for="videogallery_list_effects_s">Effects</label>
							<select name="videogallery_list_effects_s" id="videogallery_list_effects_s">
									<option <?php 
    if ($row->videogallery_list_effects_s == 'none') {
        echo 'selected';
    }
    ?>
  value="none">None</option>
									<option <?php 
    if ($row->videogallery_list_effects_s == 'cubeH') {
        echo 'selected';
    }
    ?>
   value="cubeH">Cube Horizontal</option>
									<option <?php 
    if ($row->videogallery_list_effects_s == 'cubeV') {
        echo 'selected';
    }
    ?>
  value="cubeV">Cube Vertical</option>
									<option <?php 
    if ($row->videogallery_list_effects_s == 'fade') {
        echo 'selected';
    }
    ?>
  value="fade">Fade</option>
							</select>
						</li>

						<li>
							<label for="sl_pausetime">Pause time</label>
							<input type="text" name="sl_pausetime" id="sl_pausetime" value="<?php 
    echo $row->description;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_changespeed">Change speed</label>
							<input type="text" name="sl_changespeed" id="sl_changespeed" value="<?php 
    echo $row->param;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="slider_position">Slider Position</label>
							<select name="sl_position" id="slider_position">
									<option <?php 
    if ($row->sl_position == 'left') {
        echo 'selected';
    }
    ?>
  value="left">Left</option>
									<option <?php 
    if ($row->sl_position == 'right') {
        echo 'selected';
    }
    ?>
   value="right">Right</option>
									<option <?php 
    if ($row->sl_position == 'center') {
        echo 'selected';
    }
    ?>
  value="center">Center</option>
							</select>
						</li>
					</ul>
					</div>
					<div id="videogallery-current-options-4" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 4) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>
					<div id="videogallery-current-options-5" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 5) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>
					<div id="videogallery-current-options-6" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 6) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>
					<div id="videogallery-current-options-7" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 7) {
        echo ' active';
    }
    ?>
">
					<ul id="view7">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Videos Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>


					</ul>
						<div id="major-publishing-actions">
							<div id="publishing-action">
								<input type="button" onclick="submitbutton('apply')" value="Save Video Gallery" id="save-buttom" class="button button-primary button-large">
							</div>
							<div class="clear"></div>
							<!--<input type="button" onclick="window.location.href='admin.php?page=videogallerys_huge_it_videogallery'" value="Cancel" class="button-secondary action">-->
						</div>
					</div>
					<div id="videogallery-shortcode-box" class="postbox shortcode ms-toggle">
					<h3 class="hndle"><span>Usage</span></h3>
					<div class="inside">
						<ul>
							<li rel="tab-1" class="selected">
								<h4>Shortcode</h4>
								<p>Copy &amp; paste the shortcode directly into any WordPress post or page.</p>
								<textarea class="full" readonly="readonly">[huge_it_videogallery id="<?php 
    echo $row->id;
    ?>
"]</textarea>
							</li>
							<li rel="tab-2">
								<h4>Template Include</h4>
								<p>Copy &amp; paste this code into a template file to include the slideshow within your theme.</p>
								<textarea class="full" readonly="readonly">&lt;?php echo do_shortcode("[huge_it_videogallery id='<?php 
    echo $row->id;
    ?>
']"); ?&gt;</textarea>
							</li>
						</ul>
					</div>
				</div>
				</div>
			</div>
		</div>
	</div>
			<?php 
    @session_start();
    $hugeItCSRFToken = $_SESSION["csrf_token_hugeit_gallery"] = md5(time());
    ?>
	<input type="hidden" name="csrf_token_hugeit_gallery" value="<?php 
    echo $hugeItCSRFToken;
    ?>
" />
	<input type="hidden" name="task" value="" />
</form>
</div>

<?php 
}
Example #3
0
function Html_editslider($ord_elem, $count_ord, $images, $row, $cat_row, $rowim, $rowsld, $paramssld, $rowsposts, $rowsposts8, $postsbycat)
{
    global $wpdb;
    if (isset($_GET["addslide"])) {
        $_GET["addslide"] = esc_html($_GET["addslide"]);
        if ($_GET["addslide"] == 1) {
            header('Location: admin.php?page=sliders_huge_it_slider&id=' . $row->id . '&task=apply');
        }
    }
    ?>
<script type="text/javascript">
function submitbutton(pressbutton) 
{
	if(!document.getElementById('name').value){
	alert("Name is required.");
	return;
	
	}
	
	document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
	document.getElementById("adminForm").submit();
	
}
function change_select()
{
		submitbutton('apply'); 
	
}
</script>

<!-- GENERAL PAGE, ADD IMAGES PAGE -->

<div class="wrap">
	<?php 
    $path_site2 = plugins_url("images", __FILE__);
    ?>
	<div class="slider-options-head">
		<div style="float: left;">
			<div><a href="http://huge-it.com/wordpress-plugins-slider-user-manual/" target="_blank">User Manual</a></div>
			<div>This section allows you to configure the Slider options. <a href="http://huge-it.com/wordpress-plugins-slider-user-manual/" target="_blank">More...</a></div>
		</div>
		<div style="float: right;">
			<a class="header-logo-text" href="http://huge-it.com/slider/" target="_blank">
				<div><img width="250px" src="<?php 
    echo $path_site2;
    ?>
/huge-it1.png" /></div>
				<div>Get the full version</div>
			</a>
		</div>
	</div>
	<div style="clear:both;"></div>
<form action="admin.php?page=sliders_huge_it_slider&id=<?php 
    echo $row->id;
    ?>
" method="post" name="adminForm" id="adminForm">
	<div id="poststuff" >
	<div id="slider-header">
		<ul id="sliders-list">
			
			<?php 
    foreach ($rowsld as $rowsldires) {
        if ($rowsldires->id != $row->id) {
            ?>
					<li>
						<a href="#" onclick="window.location.href='admin.php?page=sliders_huge_it_slider&task=edit_cat&id=<?php 
            echo $rowsldires->id;
            ?>
'" ><?php 
            echo $rowsldires->name;
            ?>
</a>
					</li>
				<?php 
        } else {
            ?>
					<li class="active" onclick="this.firstElementChild.style.width = ((this.firstElementChild.value.length + 1) * 8) + 'px';" style="background-image:url(<?php 
            echo plugins_url('images/edit.png', __FILE__);
            ?>
);cursor: pointer;">
						<input class="text_area" onfocus="this.style.width = ((this.value.length + 1) * 8) + 'px'" type="text" name="name" id="name" maxlength="250" value="<?php 
            echo esc_html(stripslashes($row->name));
            ?>
" />
					</li>
				<?php 
        }
    }
    ?>
			<li class="add-new">
				<a onclick="window.location.href='admin.php?page=sliders_huge_it_slider&amp;task=add_cat'">+</a>
			</li>
		</ul>
		</div>
		<div id="post-body" class="metabox-holder columns-2">
			<!-- Content -->
			<div id="post-body-content">


			<?php 
    add_thickbox();
    ?>

				<div id="post-body">
					<div id="post-body-heading">
						<h3>Slides</h3>
<script>
jQuery(document).ready(function($){
	/*jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".attachment-filters").css("display","none");
	});*/
  var _custom_media = true,
      _orig_send_attachment = wp.media.editor.send.attachment;
	 

  jQuery('.huge-it-newuploader .button').click(function(e) {
    var send_attachment_bkp = wp.media.editor.send.attachment;
	
    var button = jQuery(this);
    var id = button.attr('id').replace('_button', '');
    _custom_media = true;

	jQuery("#"+id).val('');
	wp.media.editor.send.attachment = function(props, attachment){
      if ( _custom_media ) {
	     jQuery("#"+id).val(attachment.url+';;;'+jQuery("#"+id).val());
		 jQuery("#save-buttom").click();
      } else {
        return _orig_send_attachment.apply( this, [props, attachment] );
      };
    }
  
    wp.media.editor.open(button);
	 
    return false;
  });

  jQuery('.add_media').on('click', function(){
    _custom_media = false;
	
  });
	/*jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".media-menu-item").css("display","none");
		jQuery(".media-menu-item:first").css("display","block");
		jQuery(".separator").next().css("display","block");
		jQuery('.attachment-filters').val('image').trigger('change');
		jQuery(".attachment-filters").css("display","none");
	});*/
});
</script>
						<input type="hidden" name="imagess" id="_unique_name" />
						<span class="wp-media-buttons-icon"></span>
						<div class="huge-it-newuploader uploader button button-primary add-new-image">
						<input type="button" class="button wp-media-buttons-icon" name="_unique_name_button" id="_unique_name_button" value="Add Image Slide" />
						</div>
						<a href="admin.php?page=sliders_huge_it_slider&task=popup_posts&id=<?php 
    echo esc_html($_GET['id']);
    ?>
&TB_iframe=1" class="button button-primary add-post-slide thickbox"  id="slideup2s" value="iframepop">
						<input  title="Add Post" class="thickbox" type="button" value="Add Post" />
						<span class="wp-media-buttons-icon"></span>Add Post Slide
						</a>
						<a href="admin.php?page=sliders_huge_it_slider&task=popup_video&id=<?php 
    echo esc_html($_GET['id']);
    ?>
&TB_iframe=1" class="button button-primary add-video-slide thickbox"  id="slideup3s" value="iframepop">
							<span class="wp-media-buttons-icon"></span>Add Video Slide
						</a>
						<script>
								jQuery(document).ready(function ($) {
										jQuery("#slideup").click(function () {
											window.parent.uploadID = jQuery(this).prev('input');
											formfield = jQuery('.upload').attr('name');
											tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
											return false;
										});
										window.send_to_editor = function (html) {
											imgurl = jQuery('img', html).attr('src');
											if(imgurl) {
												window.parent.uploadID.val(imgurl);
													tb_remove();
													jQuery("#save-buttom").click();
											}
											else {
												imgurl = jQuery('#embed-url-field').val();
												if(imgurl) {


													window.parent.jQuery("#_unique_name").val(imgurl+';;;');				
													jQuery("#save-buttom").click();												

													tb_remove();
												}
											}
										};
									});
						</script>				
					</div>
					<ul id="images-list">
					<?php 
    function get_youtube_id_from_url($url)
    {
        if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $match)) {
            return $match[1];
        }
    }
    $i = 2;
    foreach ($rowim as $key => $rowimages) {
        ?>
					<?php 
        if ($rowimages->sl_type == '') {
            $rowimages->sl_type = 'image';
        }
        switch ($rowimages->sl_type) {
            case 'image':
                ?>
						<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
>
						<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
							<div class="image-container">
								<img src="<?php 
                echo $rowimages->image_url;
                ?>
" />
								<div>
								<script>
									jQuery(document).ready(function($){
									  var _custom_media = true,
										  _orig_send_attachment = wp.media.editor.send.attachment;

									  jQuery('.huge-it-editnewuploader .button<?php 
                echo $rowimages->id;
                ?>
').click(function(e) {
										var send_attachment_bkp = wp.media.editor.send.attachment;
										var button = jQuery(this);
										var id = button.attr('id').replace('_button', '');
										_custom_media = true;
										wp.media.editor.send.attachment = function(props, attachment){
										  if ( _custom_media ) {
											jQuery("#"+id).val(attachment.url);
											jQuery("#save-buttom").click();
										  } else {
											return _orig_send_attachment.apply( this, [props, attachment] );
										  };
										}

										wp.media.editor.open(button);
										return false;
									  });

									  jQuery('.add_media').on('click', function(){
										_custom_media = false;
									  });
										/* jQuery(".huge-it-editnewuploader").click(function() {
										});
											jQuery(".wp-media-buttons-icon").click(function() {
											jQuery(".media-menu-item").css("display","none");
											jQuery(".media-menu-item:first").css("display","block");
											jQuery(".separator").next().css("display","block");
											jQuery('.attachment-filters').val('image').trigger('change');
											jQuery(".attachment-filters").css("display","none");

										});*/
									});
								</script>
								<input type="hidden" name="imagess<?php 
                echo $rowimages->id;
                ?>
" id="_unique_name<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->image_url;
                ?>
" />
								<span class="wp-media-buttons-icon"></span>
								<div class="huge-it-editnewuploader uploader button<?php 
                echo $rowimages->id;
                ?>
 add-new-image">
								<input type="button" class="button<?php 
                echo $rowimages->id;
                ?>
 wp-media-buttons-icon editimageicon" name="_unique_name_button<?php 
                echo $rowimages->id;
                ?>
" id="_unique_name_button<?php 
                echo $rowimages->id;
                ?>
" value="Edit image" />
							</div>
									</div>
							</div>
							<div class="image-options">
								<div>
									<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Title:</label>
									<input  class="text_area" type="text" id="titleimage<?php 
                echo $rowimages->id;
                ?>
" name="titleimage<?php 
                echo $rowimages->id;
                ?>
" id="titleimage<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo $rowimages->name;
                ?>
">
								</div>
								<div class="description-block">
									<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description:</label>
									<textarea id="im_description<?php 
                echo $rowimages->id;
                ?>
" name="im_description<?php 
                echo $rowimages->id;
                ?>
" ><?php 
                echo $rowimages->description;
                ?>
</textarea>
								</div>
								<div class="link-block">
									<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">URL:</label>
									<input class="text_area url-input" type="text" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo $rowimages->sl_url;
                ?>
" >
									<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">Open in new tab</label>
									<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
									<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />
									
									<!--<input type="checkbox" name="pause_on_hover" id="pause_on_hover"  <?php 
                if ($row->pause_on_hover == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target"/>-->
								</div>
								<div class="remove-image-container">
									<a class="button remove-image" href="admin.php?page=sliders_huge_it_slider&id=<?php 
                echo $row->id;
                ?>
&task=apply&removeslide=<?php 
                echo $rowimages->id;
                ?>
">Remove Image</a>
								</div>
							</div>
							
						<div class="clear"></div>
						</li>
						<?php 
                break;
            case 'last_posts':
                ?>
						<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
  >
						<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
							<div class="image-container">
								<img width='100' height='100' src="<?php 
                echo plugins_url('images/pin.png', __FILE__);
                ?>
" />
							</div>
							<div class="recent-post-options image-options">
								<div>
									<div class="left">
										<?php 
                $categories = get_categories();
                ?>
										<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Show Posts From:</label>
										<select name="titleimage<?php 
                echo $rowimages->id;
                ?>
" class="categories-list">
											<option <?php 
                if ($rowimages->name == 0) {
                    echo 'selected="selected"';
                }
                ?>
 value="0">All Categories</option>
										<?php 
                foreach ($categories as $strcategories) {
                    ?>
											<option <?php 
                    if ($rowimages->name == $strcategories->cat_name) {
                        echo 'selected="selected"';
                    }
                    ?>
 value="<?php 
                    echo $strcategories->cat_name;
                    ?>
"><?php 
                    echo $strcategories->cat_name;
                    ?>
</option>
										<?php 
                }
                ?>
 
										</select>
									</div>
									<div  class="left">
										<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">Showing Posts Count:</label>
										<input class="text_area url-input number" type="number" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo $rowimages->sl_url;
                ?>
" >
									</div>
								</div>
	
								<div>
									<label class="long" for="sl_stitle<?php 
                echo $rowimages->id;
                ?>
">Show Title:</label>
									<input type="hidden" name="sl_stitle<?php 
                echo $rowimages->id;
                ?>
" value="" />
									<input  <?php 
                if ($rowimages->sl_stitle == '1') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" name="sl_stitle<?php 
                echo $rowimages->id;
                ?>
" value="1" />
								</div>
								<div>
									<div class="left margin">
										<label class="long" for="sl_sdesc<?php 
                echo $rowimages->id;
                ?>
">Show Description:</label>
										<input type="hidden" name="sl_sdesc<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->sl_sdesc == '1') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" name="sl_sdesc<?php 
                echo $rowimages->id;
                ?>
" value="1" />
									</div>
									<div class="left">
										<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description Symbols Number:</label>
										<input value="<?php 
                echo $rowimages->description;
                ?>
" class="text_area url-input number" id="im_description<?php 
                echo $rowimages->id;
                ?>
" type="number" name="im_description<?php 
                echo $rowimages->id;
                ?>
" />
									</div>
								</div>
								<div>
									<div class="left margin">
										<label class="long" for="sl_postlink<?php 
                echo $rowimages->id;
                ?>
">Use Post Link:</label>
										<input type="hidden" name="sl_postlink<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->sl_postlink == '1') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" name="sl_postlink<?php 
                echo $rowimages->id;
                ?>
" value="1" />
									</div>
									<div  class="left">	
										<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">Open Link In New Tab:</label>
										<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />
										<!--<input type="checkbox" name="pause_on_hover" id="pause_on_hover"  <?php 
                if ($row->pause_on_hover == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target"/>-->
									</div>
								</div>
								<div class="remove-image-container">
									<a class="button remove-image" href="admin.php?page=sliders_huge_it_slider&id=<?php 
                echo $row->id;
                ?>
&task=apply&removeslide=<?php 
                echo $rowimages->id;
                ?>
">Remove Last posts</a>
								</div>
							</div>
							
						<div class="clear"></div>
						</li>
						<?php 
                break;
            case 'video':
                ?>
							
							<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
  >
							<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
								<?php 
                if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                    $liclass = "youtube";
                    $video_thumb_url = get_youtube_id_from_url($rowimages->image_url);
                    $thumburl = '<img src="http://img.youtube.com/vi/' . $video_thumb_url . '/mqdefault.jpg" alt="" />';
                } else {
                    if (strpos($rowimages->image_url, 'vimeo') !== false) {
                        $liclass = "vimeo";
                        $vimeo = $rowimages->image_url;
                        $imgid = end(explode("/", $vimeo));
                        $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $imgid . ".php"));
                        $imgsrc = esc_html($hash[0]['thumbnail_large']);
                        $thumburl = '<img src="' . $imgsrc . '" alt="" />';
                    }
                }
                ?>
 
									<div class="image-container">	
										<?php 
                echo $thumburl;
                ?>
										<div class="play-icon <?php 
                echo $liclass;
                ?>
"></div>
										
										<div>
											<script>
													jQuery(document).ready(function ($) {
															
															jQuery("#slideup<?php 
                echo $key;
                ?>
").click(function () {
																window.parent.uploadID = jQuery(this).prev('input');
																formfield = jQuery('.upload').attr('name');
																tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
																
																return false;
															});
													window.send_to_editor = function (html) {
														imgurl = jQuery('img', html).attr('src');
														if(imgurl) {
															window.parent.uploadID.val(imgurl);
																tb_remove();
																jQuery("#save-buttom").click();
														}
														else {
															imgurl = jQuery('#embed-url-field').val();
															if(imgurl) {


																window.parent.jQuery("#_unique_name").val(imgurl+';;;');				
																jQuery("#save-buttom").click();												

																tb_remove();
															}
														}
													};
														});
															
											</script>
											<input type="hidden" name="imagess<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->image_url;
                ?>
" />
										</div>
									</div>
									<div class="image-options video-options">
										<?php 
                if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                    ?>
										
										<div class="video-quality video-options">
											<label for="titleimage<?php 
                    echo $rowimages->id;
                    ?>
">Quality:</label>	
											<select id="titleimage<?php 
                    echo $rowimages->id;
                    ?>
" name="titleimage<?php 
                    echo $rowimages->id;
                    ?>
">
												<option value="none" <?php 
                    if ($rowimages->name == 'none') {
                        echo 'selected="selected"';
                    }
                    ?>
>Auto</option>
												<option value="280" <?php 
                    if ($rowimages->name == '280') {
                        echo 'selected="selected"';
                    }
                    ?>
>280</option>
												<option value="360" <?php 
                    if ($rowimages->name == '360') {
                        echo 'selected="selected"';
                    }
                    ?>
>360</option>
												<option value="480" <?php 
                    if ($rowimages->name == '480') {
                        echo 'selected="selected"';
                    }
                    ?>
>480</option>
												<option value="hd720" <?php 
                    if ($rowimages->name == 'hd720') {
                        echo 'selected="selected"';
                    }
                    ?>
>720 HD</option>
												<option value="hd1080" <?php 
                    if ($rowimages->name == 'hd1080') {
                        echo 'selected="selected"';
                    }
                    ?>
>1080 HD</option>
											</select>
										</div>
										<div class="video-volume video-options">
											<label for="im_description<?php 
                    echo $rowimages->id;
                    ?>
">Volume:</label>	
											<div class="slider-container">
												<input id="im_description<?php 
                    echo $rowimages->id;
                    ?>
" name="im_description<?php 
                    echo $rowimages->id;
                    ?>
" value="<?php 
                    echo $rowimages->description;
                    ?>
" data-slider-range="1,100"  type="text" data-slider="true"  data-slider-highlight="true" />
											</div>
										</div>
										<div class="video-options">
											<label class="long" for="sl_url<?php 
                    echo $rowimages->id;
                    ?>
">Show Controls:</label>
											<input type="hidden" name="sl_url<?php 
                    echo $rowimages->id;
                    ?>
" value="" />
											<input <?php 
                    if ($rowimages->sl_url == 'on') {
                        echo 'checked="checked"';
                    }
                    ?>
 class="link_target"  type="checkbox" id="sl_url<?php 
                    echo $rowimages->id;
                    ?>
" name="sl_url<?php 
                    echo $rowimages->id;
                    ?>
" />		
										</div>
										<div class="video-options">
											<label class="long" for="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
">Show Info:</label>
											<input type="hidden" name="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
" value="" />
											<input  <?php 
                    if ($rowimages->link_target == 'on') {
                        echo 'checked="checked"';
                    }
                    ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
" name="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
" />		
										</div>
										<div class="remove-image-container">
											<a class="button remove-image" href="admin.php?page=sliders_huge_it_slider&id=<?php 
                    echo $row->id;
                    ?>
&task=apply&removeslide=<?php 
                    echo $rowimages->id;
                    ?>
">Remove Video</a>
										</div>
										<?php 
                } else {
                    ?>
										
										<div class="video-quality video-options">
											<label for="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
">Elements Color:</label>	
											<input name="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
" type="text" class="color" id="sl_link_target<?php 
                    echo $rowimages->id;
                    ?>
" size="10" value="<?php 
                    echo $rowimages->link_target;
                    ?>
"/>
										</div>
										<div class="video-volume video-options">
											<label for="im_description<?php 
                    echo $rowimages->id;
                    ?>
">Volume:</label>	
											<div class="slider-container">
												<input id="im_description<?php 
                    echo $rowimages->id;
                    ?>
" name="im_description<?php 
                    echo $rowimages->id;
                    ?>
" value="<?php 
                    echo $rowimages->description;
                    ?>
" data-slider-range="1,100"  type="text" data-slider="true"  data-slider-highlight="true" />
											</div>
										</div>
										<div class="remove-image-container">
											<a class="button remove-image" href="admin.php?page=sliders_huge_it_slider&id=<?php 
                    echo $row->id;
                    ?>
&task=apply&removeslide=<?php 
                    echo $rowimages->id;
                    ?>
">Remove Video</a>
										</div>
										<?php 
                }
                ?>
									</div>	
							<div class="clear"></div>
							</li>
					<?php 
                break;
        }
        ?>
			<?php 
    }
    ?>
					</ul>
				</div>

			</div>
				
			<!-- SIDEBAR -->
			<div id="postbox-container-1" class="postbox-container">
				<div id="side-sortables" class="meta-box-sortables ui-sortable">
					<div id="slider-unique-options" class="postbox">
					<h3 class="hndle"><span>Current Slider Options</span></h3>
					<ul id="slider-unique-options-list">
						
						<li>
							<label for="sl_width">Width</label>
							<input type="text" name="sl_width" id="sl_width" value="<?php 
    echo $row->sl_width;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_height">Height</label>
							<input type="text" name="sl_height" id="sl_height" value="<?php 
    echo $row->sl_height;
    ?>
" class="text_area" />
						</li>
						
						<li>
							<label for="slider_effects_list">Effects</label>
							<select name="slider_effects_list" id="slider_effects_list">
									<option <?php 
    if ($row->slider_list_effects_s == 'none') {
        echo 'selected';
    }
    ?>
  value="none">None</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'cubeH') {
        echo 'selected';
    }
    ?>
   value="cubeH">Cube Horizontal</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'cubeV') {
        echo 'selected';
    }
    ?>
  value="cubeV">Cube Vertical</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'fade') {
        echo 'selected';
    }
    ?>
  value="fade">Fade</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'sliceH') {
        echo 'selected';
    }
    ?>
  value="sliceH">Slice Horizontal</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'sliceV') {
        echo 'selected';
    }
    ?>
  value="sliceV">Slice Vertical</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'slideH') {
        echo 'selected';
    }
    ?>
  value="slideH">Slide Horizontal</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'slideV') {
        echo 'selected';
    }
    ?>
  value="slideV">Slide Vertical</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'scaleOut') {
        echo 'selected';
    }
    ?>
  value="scaleOut">Scale Out</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'scaleIn') {
        echo 'selected';
    }
    ?>
  value="scaleIn">Scale In</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'blockScale') {
        echo 'selected';
    }
    ?>
  value="blockScale">Block Scale</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'kaleidoscope') {
        echo 'selected';
    }
    ?>
  value="kaleidoscope">Kaleidoscope</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'fan') {
        echo 'selected';
    }
    ?>
  value="fan">Fan</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'blindH') {
        echo 'selected';
    }
    ?>
  value="blindH">Blind Horizontal</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'blindV') {
        echo 'selected';
    }
    ?>
  value="blindV">Blind Vertical</option>
									<option <?php 
    if ($row->slider_list_effects_s == 'random') {
        echo 'selected';
    }
    ?>
  value="random">Random</option>
							</select>
						</li>

						<li>
							<label for="sl_pausetime">Pause Time</label>
							<input type="text" name="sl_pausetime" id="sl_pausetime" value="<?php 
    echo $row->description;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_changespeed">Change Speed</label>
							<input type="text" name="sl_changespeed" id="sl_changespeed" value="<?php 
    echo $row->param;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="slider_position">Slider Position</label>
							<select name="sl_position" id="slider_position">
									<option <?php 
    if ($row->sl_position == 'left') {
        echo 'selected';
    }
    ?>
  value="left">Left</option>
									<option <?php 
    if ($row->sl_position == 'right') {
        echo 'selected';
    }
    ?>
   value="right">Right</option>
									<option <?php 
    if ($row->sl_position == 'center') {
        echo 'selected';
    }
    ?>
  value="center">Center</option>
							</select>
						</li>
						<li>
							<label for="sl_loading_icon">Loading Icon</label>
							<select id="sl_loading_icon" name="sl_loading_icon">
								  <option <?php 
    if ($row->sl_loading_icon == 'on') {
        echo 'selected';
    }
    ?>
 value="on">On</option>
								  <option <?php 
    if ($row->sl_loading_icon == 'off') {
        echo 'selected';
    }
    ?>
 value="off">Off</option>
							</select>
						</li>
						<li>
							<label for="show_thumb">Navigate By</label>
							<input type="hidden" value="off" name="show_thumb" />					
							<select id="show_thumb" name="show_thumb">
								  <option <?php 
    if ($row->show_thumb == 'dotstop') {
        echo 'selected';
    }
    ?>
 value="dotstop">Dots</option>
								  <option <?php 
    if ($row->show_thumb == 'thumbnails') {
        echo 'selected';
    }
    ?>
 value="thumbnails">Thumbnails</option>
								  <option <?php 
    if ($row->show_thumb == 'nonav') {
        echo 'selected';
    }
    ?>
 value="nonav">No Navigation</option>
							</select>
						</li>
						<li>
							<label for="pause_on_hover">Pause on Hover</label>
							<input type="hidden" value="off" name="pause_on_hover" />					
							<input type="checkbox" name="pause_on_hover"  value="on" id="pause_on_hover"  <?php 
    if ($row->pause_on_hover == 'on') {
        echo 'checked="checked"';
    }
    ?>
 />
						</li>
					</ul>
						<div id="major-publishing-actions">
							<div id="publishing-action">
								<input type="button" onclick="submitbutton('apply')" value="Save Slider" id="save-buttom" class="button button-primary button-large">
							</div>
							<div class="clear"></div>
							<!--<input type="button" onclick="window.location.href='admin.php?page=sliders_huge_it_slider'" value="Cancel" class="button-secondary action">-->
						</div>
					</div>
				</div>
				<div id="slider-shortcode-box" class="postbox shortcode ms-toggle">
					<h3 class="hndle"><span>Usage</span></h3>
					<div class="inside">
						<ul>
							<li rel="tab-1" class="selected">
								<h4>Shortcode</h4>
								<p>Copy &amp; paste the shortcode directly into any WordPress post or page.</p>
								<textarea class="full" readonly="readonly">[huge_it_slider id="<?php 
    echo $row->id;
    ?>
"]</textarea>
							</li>
							<li rel="tab-2">
								<h4>Template Include</h4>
								<p>Copy &amp; paste this code into a template file to include the slideshow within your theme.</p>
								<textarea class="full" readonly="readonly">&lt;?php echo do_shortcode("[huge_it_slider id='<?php 
    echo $row->id;
    ?>
']"); ?&gt;</textarea>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<input type="hidden" name="task" value="" />
	 <input type="hidden" name="csrf_token_hugeit_1752" value="csrf_token_hugeit_1752" />
			 <?php 
    $_SESSION['csrf_token_hugeit_1752'] = 'csrf_token_hugeit_1752';
    ?>
</form>
</div>

<?php 
}
function Html_editvideogallery($ord_elem, $count_ord, $images, $row, $cat_row, $rowim, $rowsld, $rowsposts, $rowsposts8, $postsbycat)
{
    global $wpdb;
    if (isset($_GET["addslide"])) {
        if ($_GET["addslide"] == 1) {
            header('Location: admin.php?page=videogallerys_huge_it_videogallery&id=' . $row->id . '&task=apply');
        }
    }
    ?>
<script type="text/javascript">
function submitbutton(pressbutton) 
{
	if(!document.getElementById('name').value){
	alert("Name is required.");
	return;
	
	}
	
	document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
	document.getElementById("adminForm").submit();
	
}
var  name_changeRight = function(e) {
	document.getElementById("name").value = e.value;
}
var  name_changeTop = function(e) {
		document.getElementById("huge_it_videogallery_name").value = e.value;
		//alert(e);
	};
function change_select()
{
		submitbutton('apply'); 
	
}
jQuery(function() {

	jQuery('.def_thumb').on('click',(function (){
		jQuery(this).parents('li').find('.image-container input+input').val('');
		submitbutton('apply');
	}))
	;


	
	jQuery( "#images-list" ).sortable({
	  stop: function() {
			jQuery("#images-list > li").removeClass('has-background');
			count=jQuery("#images-list > li").length;
			for(var i=0;i<=count;i+=2){
					jQuery("#images-list > li").eq(i).addClass("has-background");
			}
			jQuery("#images-list > li").each(function(){
				jQuery(this).find('.order_by').val(jQuery(this).index());
			});
	  },
	  revert: true
	});
   // jQuery( "ul, li" ).disableSelection();
	});
</script>

<!-- GENERAL PAGE, ADD IMAGES PAGE -->

<div class="wrap">
<?php 
    $path_site2 = plugins_url("../images", __FILE__);
    ?>
	<div class="slider-options-head">
		<div style="float: left;">
			<div><a href="http://huge-it.com/wordpress-plugins-video-gallery-user-manual/" target="_blank">User Manual</a></div>
			<div>This section allows you to configure the Video Gallery options. <a href="http://huge-it.com/wordpress-plugins-video-gallery-user-manual/" target="_blank">More...</a></div>
		</div>
		<div style="float: right;">
			<a class="header-logo-text" href="http://huge-it.com/video-gallery/" target="_blank">
				<div><img width="250px" src="<?php 
    echo $path_site2;
    ?>
/huge-it1.png" /></div>
				<div>Get the full version</div>
			</a>
		</div>
	</div>
	<div style="clear: both;"></div>
<form action="admin.php?page=videogallerys_huge_it_videogallery&id=<?php 
    echo $row->id;
    ?>
" method="post" name="adminForm" id="adminForm">

	<div id="poststuff" >
	<div id="videogallery-header">
		<ul id="videogallerys-list">
			
			<?php 
    foreach ($rowsld as $rowsldires) {
        if ($rowsldires->id != $row->id) {
            ?>
					<li>
						<a href="#" onclick="window.location.href='admin.php?page=videogallerys_huge_it_videogallery&task=edit_cat&id=<?php 
            echo $rowsldires->id;
            ?>
'" ><?php 
            echo $rowsldires->name;
            ?>
</a>
					</li>
				<?php 
        } else {
            ?>
					<li class="active" onclick='document.getElementById("name").style.width = ((document.getElementById("name").value.length + 1) * 8) + "px"' style="background-image:url(<?php 
            echo plugins_url('../images/edit.png', __FILE__);
            ?>
);cursor:pointer;">
						<input class="text_area" onfocus="this.style.width = ((this.value.length + 1) * 8) + 'px'" onkeyup="name_changeTop(this)" type="text" name="name" id="name" maxlength="250" value="<?php 
            echo esc_html(stripslashes($row->name));
            ?>
" />
					</li>
				<?php 
        }
    }
    ?>
			<li class="add-new">
				<a onclick="window.location.href='admin.php?page=videogallerys_huge_it_videogallery&amp;task=add_cat'">+</a>
			</li>
		</ul>
		</div>
		<div id="post-body" class="metabox-holder columns-2">
			<!-- Content -->
			<div id="post-body-content">


			<?php 
    add_thickbox();
    ?>

				<div id="post-body">
					<div id="post-body-heading">
						<h3>Projects/Videos</h3>			
						<?php 
    $_GET['id'] = esc_html($_GET['id']);
    ?>
						<a href="admin.php?page=videogallerys_huge_it_videogallery&task=videogallery_video&id=<?php 
    echo $_GET['id'];
    ?>
&TB_iframe=1" class="button button-primary add-video-slide thickbox"  id="slideup3s" value="iframepop">
							<span class="wp-media-buttons-icon"></span>Add Video 
						</a>
					</div>
					<ul id="images-list">
					<?php 
    function get_youtube_id_from_url($url)
    {
        if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $match)) {
            return $match[1];
        }
    }
    $i = 2;
    foreach ($rowim as $key => $rowimages) {
        ?>
					<?php 
        if ($rowimages->sl_type == '') {
            $rowimages->sl_type = 'image';
        }
        switch ($rowimages->sl_type) {
            case 'video':
                ?>
							
							<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
  >
							<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
								<?php 
                if (empty($rowimages->thumb_url)) {
                    if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                        $liclass = "youtube";
                        $video_thumb_url = get_youtube_id_from_url($rowimages->image_url);
                        $thumburl = '<img src="http://img.youtube.com/vi/' . $video_thumb_url . '/mqdefault.jpg" alt="" />';
                    } else {
                        if (strpos($rowimages->image_url, 'vimeo') !== false) {
                            $liclass = "vimeo";
                            $vimeo = $rowimages->image_url;
                            $imgid = explode("/", $vimeo);
                            $imgid = end($imgid);
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $imgid . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            $imgsrc = esc_html($imgsrc);
                            $thumburl = '<img src="' . $imgsrc . '" alt="" />';
                        }
                    }
                } else {
                    if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                        $liclass = "youtube";
                    } else {
                        if (strpos($rowimages->image_url, 'vimeo') !== false) {
                            $liclass = "vimeo";
                        }
                    }
                    $thumburl = '<img src="' . $rowimages->thumb_url . '" alt="" />';
                }
                ?>
 
									<div class="image-container">	
										<?php 
                echo $thumburl;
                ?>
										<div class="play-icon <?php 
                echo $liclass;
                ?>
"></div>
										
										<div>
											<script>
jQuery(document).ready(function($){
  var _custom_media = true,
      _orig_send_attachment = wp.media.editor.send.attachment;

  jQuery('.huge-it-editnewuploader .button<?php 
                echo $rowimages->id;
                ?>
').click(function(e) {
    var send_attachment_bkp = wp.media.editor.send.attachment;
    var button = jQuery(this);
    var id = button.attr('id').replace('_button', '');
    _custom_media = true;
    wp.media.editor.send.attachment = function(props, attachment){
      if ( _custom_media ) {
        jQuery("#"+id).val(attachment.url);
		jQuery("#save-buttom").click();
      } else {
        return _orig_send_attachment.apply( this, [props, attachment] );
      };
    }

    wp.media.editor.open(button);
    return false;
  });











  jQuery('.add_media').on('click', function(){
    _custom_media = false;
  });
	jQuery(".huge-it-editnewuploader").click(function() {
	});
		jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".media-menu .media-menu-item").css("display","none");
		jQuery(".media-menu-item:first").css("display","block");
		jQuery(".separator").next().css("display","none");
		jQuery('.attachment-filters').val('image').trigger('change');
		jQuery(".attachment-filters").css("display","none");

	});
});
		jQuery("input[name='thumb_id_button<?php 
                echo $rowimages->id;
                ?>
']").each(function(){
			
			jQuery(this).hover(function(){
				
					  jQuery(this).clearQueue().animate({
	       				 width: "170px", 
	       				 color:"rgba(0,0,0,1)"
	      			}, 200);
				
				
      			
      			
			},
								function(){
				jQuery(this).animate({
        			width: "20px", 
        			color:"rgba(0,0,0,0)"   
     			}, 200);
     			
     			
			})
			
		})
});
</script>
											<input type="hidden" name="imagess<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->image_url;
                ?>
" />
											<input type="hidden" name="thumbs<?php 
                echo $rowimages->id;
                ?>
" id="thumb_id<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->thumb_url;
                ?>
" />
										<div class="huge-it-editnewuploader uploader button<?php 
                echo $rowimages->id;
                ?>
 add-new-image">
												<input type="button" class="editimgbutton button<?php 
                echo $rowimages->id;
                ?>
 wp-media-buttons-icon" name="thumb_id_button<?php 
                echo $rowimages->id;
                ?>
" id="thumb_id_button<?php 
                echo $rowimages->id;
                ?>
" value="Set Custom Thumbnail" />
											</div>
											
										</div>
										<div class="button def_thumb">
												Set Default Thumbnail
										</div>
									</div>
									<div class="image-options">
								<div>
									<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Title:</label>
									<input  class="text_area" type="text" id="titleimage<?php 
                echo $rowimages->id;
                ?>
" name="titleimage<?php 
                echo $rowimages->id;
                ?>
" id="titleimage<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->name);
                ?>
">
								</div>
								<div class="description-block">
									<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description:</label>
									<textarea id="im_description<?php 
                echo $rowimages->id;
                ?>
" name="im_description<?php 
                echo $rowimages->id;
                ?>
" ><?php 
                echo str_replace('__5_5_5__', '%', $rowimages->description);
                ?>
</textarea>
								</div>
								<div class="link-block">
									<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">URL:</label>
									<input class="text_area url-input" type="text" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->sl_url);
                ?>
" >
									<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">
										<span>Open in new tab</span>
										<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />
									</label>
									
									
							
								</div>
								<div class="remove-image-container">
									<a class="button remove-image" href="admin.php?page=videogallerys_huge_it_videogallery&task=edit_cat&id=<?php 
                echo $row->id;
                ?>
&removeslide=<?php 
                echo $rowimages->id;
                ?>
">Remove Video</a>
								</div>
							</div>
							<div class="clear"></div>
							</li>
					<?php 
                break;
        }
        ?>
					<?php 
    }
    ?>
					</ul>
				</div>

			</div>
				
			<!-- SIDEBAR -->
			<div id="postbox-container-1" class="postbox-container">
				<div id="side-sortables" class="meta-box-sortables ui-sortable">
					<div id="videogallery-unique-options" class="postbox">
					<h3 class="hndle"><span>Video Gallery Custom Options</span></h3>
					<ul id="videogallery-unique-options-list">
						<li>
							<label for="huge_it_videogallery_name">Gallery Name</label>
							<input type = "text" name="name" id="huge_it_videogallery_name" value="<?php 
    echo esc_html(stripslashes($row->name));
    ?>
" onkeyup = "name_changeRight(this)">
						</li>
						<li>
							<label for="huge_it_sl_effects">Views</label>
							<select name="huge_it_sl_effects" id="huge_it_sl_effects">
									<option <?php 
    if ($row->huge_it_sl_effects == '0') {
        echo 'selected';
    }
    ?>
  value="0">Video Gallery/Content-Popup</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '1') {
        echo 'selected';
    }
    ?>
  value="1">Content Video Slider</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '5') {
        echo 'selected';
    }
    ?>
  value="5">Lightbox-Video Gallery</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '3') {
        echo 'selected';
    }
    ?>
  value="3">Video Slider</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '4') {
        echo 'selected';
    }
    ?>
  value="4">Thumbnails View</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '6') {
        echo 'selected';
    }
    ?>
  value="6">Justified</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '7') {
        echo 'selected';
    }
    ?>
  value="7">Blog Style Gallery</option>
							</select>
						</li>
						<script>
						jQuery(document).ready(function ($){
							//alert('hi');
							//$('div[id^="list_"]')
								if($('select[name="display_type"]').val()== 2){
								$('li[id="content_per_page"]').hide();
							}else{
								$('li[id="content_per_page"]').show();
							}
							$('select[name="display_type"]').on('change' ,function(){
								if($(this).val()== 2){
								$('li[id="content_per_page"]').hide();
							}else{
								$('li[id="content_per_page"]').show();
							}
							})
							

							$('#videogallery-unique-options').on('change',function(){
								$( 'div[id^="videogallery-current-options"]').each(function(){
								if(!$(this).hasClass( "active" )){
									$(this).find('ul li input[name="content_per_page"]').attr('name', '');
									$(this).find('ul li select[name="display_type"]').attr('name', '');
									//$(this).find('ul li select').attr('name', '');
								}else{
									//alert('no');
								}
							})
							})
							
						})
					</script>
						<div id="videogallery-current-options-0" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 0) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>	
					<div id="videogallery-current-options-3" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 3) {
        echo ' active';
    }
    ?>
">
					<ul id="slider-unique-options-list">
						<li>
							<label for="sl_width">Width</label>
							<input type="text" name="sl_width" id="sl_width" value="<?php 
    echo $row->sl_width;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_height">Height</label>
							<input type="text" name="sl_height" id="sl_height" value="<?php 
    echo $row->sl_height;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="pause_on_hover">Pause on hover</label>
							<input type="hidden" value="off" name="pause_on_hover" />					
							<input type="checkbox" name="pause_on_hover"  value="on" id="pause_on_hover"  <?php 
    if ($row->pause_on_hover == 'on') {
        echo 'checked="checked"';
    }
    ?>
 />
						</li>
						<li>
							<label for="videogallery_list_effects_s">Effects</label>
							<select name="videogallery_list_effects_s" id="videogallery_list_effects_s">
									<option <?php 
    if ($row->videogallery_list_effects_s == 'none') {
        echo 'selected';
    }
    ?>
  value="none">None</option>
									<option <?php 
    if ($row->videogallery_list_effects_s == 'cubeH') {
        echo 'selected';
    }
    ?>
   value="cubeH">Cube Horizontal</option>
									<option <?php 
    if ($row->videogallery_list_effects_s == 'cubeV') {
        echo 'selected';
    }
    ?>
  value="cubeV">Cube Vertical</option>
									<option <?php 
    if ($row->videogallery_list_effects_s == 'fade') {
        echo 'selected';
    }
    ?>
  value="fade">Fade</option>
							</select>
						</li>

						<li>
							<label for="sl_pausetime">Pause time</label>
							<input type="text" name="sl_pausetime" id="sl_pausetime" value="<?php 
    echo $row->description;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_changespeed">Change speed</label>
							<input type="text" name="sl_changespeed" id="sl_changespeed" value="<?php 
    echo $row->param;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="slider_position">Slider Position</label>
							<select name="sl_position" id="slider_position">
									<option <?php 
    if ($row->sl_position == 'left') {
        echo 'selected';
    }
    ?>
  value="left">Left</option>
									<option <?php 
    if ($row->sl_position == 'right') {
        echo 'selected';
    }
    ?>
   value="right">Right</option>
									<option <?php 
    if ($row->sl_position == 'center') {
        echo 'selected';
    }
    ?>
  value="center">Center</option>
							</select>
						</li>
					</ul>
					</div>
					<div id="videogallery-current-options-4" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 4) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>
					<div id="videogallery-current-options-5" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 5) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>
					<div id="videogallery-current-options-6" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 6) {
        echo ' active';
    }
    ?>
">
						<ul id="view4">
							<?php 
    //print_r($row);
    ?>
							<?php 
    //var_dump($row->display_type);
    ?>
							  <li>
								<label for="display_type">Displaying Content</label>
								<select id="display_type" name="display_type">

									  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
										<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
										<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
							
								</select>
								</li>
							<li id="content_per_page">
								<label for="content_per_page">Videos Per Page</label>
								<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
							</li>
							

						
						</ul>
					</div>
					<div id="videogallery-current-options-7" class="videogallery-current-options <?php 
    if ($row->huge_it_sl_effects == 7) {
        echo ' active';
    }
    ?>
">
					<ul id="view7">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Videos Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>


					</ul>
						<div id="major-publishing-actions">
							<div id="publishing-action">
								<input type="button" onclick="submitbutton('apply')" value="Save Video Gallery" id="save-buttom" class="button button-primary button-large">
							</div>
							<div class="clear"></div>
							<!--<input type="button" onclick="window.location.href='admin.php?page=videogallerys_huge_it_videogallery'" value="Cancel" class="button-secondary action">-->
						</div>
					</div>
					<div id="videogallery-shortcode-box" class="postbox shortcode ms-toggle">
					<h3 class="hndle"><span>Usage</span></h3>
					<div class="inside">
						<ul>
							<li rel="tab-1" class="selected">
								<h4>Shortcode</h4>
								<p>Copy &amp; paste the shortcode directly into any WordPress post or page.</p>
								<textarea class="full" readonly="readonly">[huge_it_videogallery id="<?php 
    echo $row->id;
    ?>
"]</textarea>
							</li>
							<li rel="tab-2">
								<h4>Template Include</h4>
								<p>Copy &amp; paste this code into a template file to include the slideshow within your theme.</p>
								<textarea class="full" readonly="readonly">&lt;?php echo do_shortcode("[huge_it_videogallery id='<?php 
    echo $row->id;
    ?>
']"); ?&gt;</textarea>
							</li>
						</ul>
					</div>
				</div>
				</div>
			</div>
		</div>
	</div>
			<?php 
    @session_start();
    $hugeItCSRFToken = $_SESSION["csrf_token_hugeit_gallery"] = md5(time());
    ?>
	<input type="hidden" name="csrf_token_hugeit_gallery" value="<?php 
    echo $hugeItCSRFToken;
    ?>
" />
	<input type="hidden" name="task" value="" />
</form>
</div>

<?php 
}
Example #5
0
                        </div>
                   </div>
                   <div class="content-wrap grey-border">
                        <ul class="slick-multimedia">
                            <?php 
foreach ($multimedia_video as $video) {
    ?>
                            <li>          
                                <a class="video fancybox.iframe" href="https://www.youtube.com/embed/<?php 
    echo get_youtube_id_from_url($video['iframe']);
    ?>
">
                                    <div class="multi-img ">
                                        <div class="play_multi_btn"></div>
                                        <img src="http://i1.ytimg.com/vi/<?php 
    echo get_youtube_id_from_url($video['iframe']);
    ?>
/sddefault.jpg">
                                    </div> 
                                    <div class="multi-content">
                                        <span class="multi-title" style="height: 56px;overflow: hidden;"><?php 
    echo $video['name_' . $lng];
    ?>
</span>
                                        <p class="date"><i class="mdi mdi-calendar-clock"></i><?php 
    echo show_date($video['data']);
    ?>
</p>
                                    </div>
                                </a>
                            </li>
function front_end_videogallery($images, $paramssld, $videogallery)
{
    ob_start();
    $videogalleryID = $videogallery[0]->id;
    $videogallerytitle = $videogallery[0]->name;
    $videogalleryheight = $videogallery[0]->sl_height;
    $videogallerywidth = $videogallery[0]->sl_width;
    $videogalleryeffect = $videogallery[0]->videogallery_list_effects_s;
    $slidepausetime = $videogallery[0]->description + $videogallery[0]->param;
    $videogallerypauseonhover = $videogallery[0]->pause_on_hover;
    $videogalleryposition = $videogallery[0]->sl_position;
    $slidechangespeed = $videogallery[0]->param;
    $videogallerychangeview = $videogallery[0]->huge_it_sl_effects;
    $paramssld["ht_view2_element_linkbutton_text"] = "View More";
    $paramssld["ht_view2_element_show_linkbutton"] = "on";
    $paramssld["ht_view2_element_linkbutton_color"] = "ffffff";
    $paramssld["ht_view2_element_linkbutton_font_size"] = "14";
    $paramssld["ht_view2_element_linkbutton_background_color"] = "FF2C2C";
    $paramssld["ht_view2_show_popup_linkbutton"] = "on";
    $paramssld["ht_view2_popup_linkbutton_text"] = "View More";
    $paramssld["ht_view2_popup_linkbutton_background_hover_color"] = "c02121";
    $paramssld["ht_view2_popup_linkbutton_background_color"] = "FF2C2C";
    $paramssld["ht_view2_popup_linkbutton_font_hover_color"] = "ffffff";
    $paramssld["ht_view2_popup_linkbutton_color"] = "ffffff";
    $paramssld["ht_view2_popup_linkbutton_font_size"] = "14";
    $paramssld["ht_view2_description_color"] = "222222";
    $paramssld["ht_view2_description_font_size"] = "14";
    $paramssld["ht_view2_show_description"] = "on";
    $paramssld["ht_view2_thumbs_width"] = "75";
    $paramssld["ht_view2_thumbs_height"] = "75";
    $paramssld["ht_view2_thumbs_position"] = "before";
    $paramssld["ht_view2_show_thumbs"] = "on";
    $paramssld["ht_view2_popup_background_color"] = "FFFFFF";
    $paramssld["ht_view2_popup_overlay_color"] = "000000";
    $paramssld["ht_view2_popup_overlay_transparency_color"] = "70";
    $paramssld["ht_view2_popup_closebutton_style"] = "dark";
    $paramssld["ht_view2_show_separator_lines"] = "on";
    $paramssld["ht_view2_show_popup_title"] = "on";
    $paramssld["ht_view2_element_title_font_size"] = "18";
    $paramssld["ht_view2_element_title_font_color"] = "222222";
    $paramssld["ht_view2_popup_title_font_size"] = "18";
    $paramssld["ht_view2_popup_title_font_color"] = "222222";
    $paramssld["ht_view2_element_overlay_color"] = "FFFFFF";
    $paramssld["ht_view2_element_overlay_transparency"] = "70";
    $paramssld["ht_view2_zoombutton_style"] = "light";
    $paramssld["ht_view2_element_border_width"] = "1";
    $paramssld["ht_view2_element_border_color"] = "dedede";
    $paramssld["ht_view2_element_background_color"] = "f9f9f9";
    $paramssld["ht_view2_element_width"] = "275";
    $paramssld["ht_view2_element_height"] = "160";
    $paramssld["ht_view5_icons_style"] = "dark";
    $paramssld["ht_view5_show_separator_lines"] = "on";
    $paramssld["ht_view5_linkbutton_text"] = "View More";
    $paramssld["ht_view5_show_linkbutton"] = "on";
    $paramssld["ht_view5_linkbutton_background_hover_color"] = "c02121";
    $paramssld["ht_view5_linkbutton_background_color"] = "FF2C2C";
    $paramssld["ht_view5_linkbutton_font_hover_color"] = "ffffff";
    $paramssld["ht_view5_linkbutton_color"] = "ffffff";
    $paramssld["ht_view5_linkbutton_font_size"] = "14";
    $paramssld["ht_view5_description_color"] = "555555";
    $paramssld["ht_view5_description_font_size"] = "14";
    $paramssld["ht_view5_show_description"] = "on";
    $paramssld["ht_view5_thumbs_width"] = "75";
    $paramssld["ht_view5_thumbs_height"] = "75";
    $paramssld["ht_view5_show_thumbs"] = "on";
    $paramssld["ht_view5_title_font_size"] = "16";
    $paramssld["ht_view5_title_font_color"] = "c02121";
    $paramssld["ht_view5_main_image_width"] = "275";
    $paramssld["ht_view5_slider_tabs_font_color"] = "d9d99";
    $paramssld["ht_view5_slider_tabs_background_color"] = "555555";
    $paramssld["ht_view5_slider_background_color"] = "f9f9f9";
    $paramssld["ht_view6_title_font_size"] = "16";
    $paramssld["ht_view6_title_font_color"] = "c02121";
    $paramssld["ht_view6_title_font_hover_color"] = "FF2C2C";
    $paramssld["ht_view6_title_background_color"] = "000000";
    $paramssld["ht_view6_title_background_transparency"] = "80";
    $paramssld["ht_view6_border_radius"] = "3";
    $paramssld["ht_view6_border_width"] = "0";
    $paramssld["ht_view6_border_color"] = "eeeeee";
    $paramssld["ht_view6_width"] = "275";
    /***/
    $paramssld["ht_view8_element_cssAnimation"] = 'false';
    $paramssld["ht_view8_element_height"] = '120';
    $paramssld["ht_view8_element_maxheight"] = '155';
    $paramssld["ht_view8_element_show_caption"] = 'true';
    $paramssld["ht_view8_element_padding"] = '0';
    $paramssld["ht_view8_element_border_radius"] = '5';
    $paramssld["ht_view8_icons_style"] = 'dark';
    $paramssld["ht_view8_element_title_font_size"] = '13';
    $paramssld["ht_view8_element_title_font_color"] = '3AD6FC';
    $paramssld["ht_view8_popup_background_color"] = '000000';
    $paramssld["ht_view8_popup_overlay_transparency_color"] = '0';
    $paramssld["ht_view8_popup_closebutton_style"] = 'dark';
    $paramssld["ht_view8_element_title_overlay_transparency"] = '90';
    $paramssld["ht_view8_element_size_fix"] = 'false';
    $paramssld["ht_view8_element_title_background_color"] = 'FF1C1C';
    $paramssld["ht_view8_element_justify"] = 'true';
    $paramssld["ht_view8_element_randomize"] = 'false';
    $paramssld["ht_view8_element_animation_speed"] = '2000';
    /***/
    $paramssld["light_box_size"] = "17";
    $paramssld["light_box_width"] = "800";
    $paramssld["light_box_transition"] = "elastic";
    $paramssld["light_box_speed"] = "800";
    $paramssld["light_box_href"] = "False";
    $paramssld["light_box_title"] = "false";
    $paramssld["light_box_scalephotos"] = "true";
    $paramssld["light_box_rel"] = "false";
    $paramssld["light_box_scrolling"] = "false";
    $paramssld["light_box_opacity"] = "20";
    $paramssld["light_box_open"] = "false";
    $paramssld["light_box_overlayclose"] = "true";
    $paramssld["light_box_esckey"] = "false";
    $paramssld["light_box_arrowkey"] = "false";
    $paramssld["light_box_loop"] = "true";
    $paramssld["light_box_data"] = "false";
    $paramssld["light_box_classname"] = "false";
    $paramssld["light_box_fadeout"] = "300";
    $paramssld["light_box_closebutton"] = "true";
    $paramssld["light_box_current"] = "image";
    $paramssld["light_box_previous"] = "previous";
    $paramssld["light_box_next"] = "next";
    $paramssld["light_box_close"] = "close";
    $paramssld["light_box_iframe"] = "false";
    $paramssld["light_box_inline"] = "false";
    $paramssld["light_box_html"] = "false";
    $paramssld["light_box_photo"] = "false";
    $paramssld["light_box_height"] = "600";
    $paramssld["light_box_innerwidth"] = "false";
    $paramssld["light_box_innerheight"] = "false";
    $paramssld["light_box_initialwidth"] = "300";
    $paramssld["light_box_initialheight"] = "100";
    $paramssld["light_box_maxwidth"] = "";
    $paramssld["light_box_maxheight"] = "";
    $paramssld["light_box_slideshow"] = "false";
    $paramssld["light_box_slideshowspeed"] = "2500";
    $paramssld["light_box_slideshowauto"] = "true";
    $paramssld["light_box_slideshowstart"] = "start slideshow";
    $paramssld["light_box_slideshowstop"] = "stop slideshow";
    $paramssld["light_box_fixed"] = "true";
    $paramssld["light_box_top"] = "false";
    $paramssld["light_box_bottom"] = "false";
    $paramssld["light_box_left"] = "false";
    $paramssld["light_box_right"] = "false";
    $paramssld["light_box_reposition"] = "false";
    $paramssld["light_box_retinaimage"] = "true";
    $paramssld["light_box_retinaurl"] = "false";
    $paramssld["light_box_retinasuffix"] = "@2x.\$1";
    $paramssld["light_box_returnfocus"] = "true";
    $paramssld["light_box_trapfocus"] = "true";
    $paramssld["light_box_fastiframe"] = "true";
    $paramssld["light_box_preloading"] = "true";
    $paramssld["lightbox_open_position"] = "5";
    $paramssld["light_box_style"] = "1";
    $paramssld["light_box_size_fix"] = "false";
    $paramssld["slider_crop_image"] = "crop";
    $paramssld["slider_title_color"] = "000000";
    $paramssld["slider_title_font_size"] = "13";
    $paramssld["slider_description_color"] = "ffffff";
    $paramssld["slider_description_font_size"] = "12";
    $paramssld["slider_title_position"] = "right-top";
    $paramssld["slider_description_position"] = "right-bottom";
    $paramssld["slider_title_border_size"] = "0";
    $paramssld["slider_title_border_color"] = "ffffff";
    $paramssld["slider_title_border_radius"] = "4";
    $paramssld["slider_description_border_size"] = "0";
    $paramssld["slider_description_border_color"] = "ffffff";
    $paramssld["slider_description_border_radius"] = "0";
    $paramssld["slider_slideshow_border_size"] = "0";
    $paramssld["slider_slideshow_border_color"] = "ffffff";
    $paramssld["slider_slideshow_border_radius"] = "0";
    $paramssld["slider_navigation_type"] = "1";
    $paramssld["slider_navigation_position"] = "bottom";
    $paramssld["slider_title_background_color"] = "ffffff";
    $paramssld["slider_description_background_color"] = "000000";
    $paramssld["slider_title_transparent"] = "on";
    $paramssld["slider_description_transparent"] = "on";
    $paramssld["slider_slider_background_color"] = "ffffff";
    $paramssld["slider_dots_position"] = "none";
    $paramssld["slider_active_dot_color"] = "ffffff";
    $paramssld["slider_dots_color"] = "000000";
    $paramssld["slider_description_width"] = "70";
    $paramssld["slider_description_height"] = "50";
    $paramssld["slider_description_background_transparency"] = "70";
    $paramssld["slider_description_text_align"] = "justify";
    $paramssld["slider_title_width"] = "30";
    $paramssld["slider_title_height"] = "50";
    $paramssld["slider_title_background_transparency"] = "70";
    $paramssld["slider_title_text_align"] = "right";
    $paramssld["slider_title_has_margin"] = "off";
    $paramssld["slider_description_has_margin"] = "off";
    $paramssld["slider_show_arrows"] = "on";
    $paramssld["thumb_image_behavior"] = "on";
    $paramssld["thumb_image_width"] = "240";
    $paramssld["thumb_image_height"] = "150";
    $paramssld["thumb_image_border_width"] = "1";
    $paramssld["thumb_image_border_color"] = "444444";
    $paramssld["thumb_image_border_radius"] = "5";
    $paramssld["thumb_margin_image"] = "1";
    $paramssld["thumb_title_font_size"] = "16";
    $paramssld["thumb_title_font_color"] = "FFFFFF";
    $paramssld["thumb_title_background_color"] = "CCCCCC";
    $paramssld["thumb_title_background_transparency"] = "80";
    $paramssld["thumb_box_padding"] = "28";
    $paramssld["thumb_box_background"] = "333333";
    $paramssld["thumb_box_use_shadow"] = "on";
    $paramssld["thumb_box_has_background"] = "on";
    $paramssld["thumb_view_text"] = "Watch Video";
    ////////////////////////////////
    ///////////////////////////////////
    $paramssld["video_ht_view9_title_fontsize"] = "18";
    $paramssld["video_ht_view9_title_color"] = "FFFFFF";
    $paramssld["video_ht_view9_desc_color"] = "000000";
    $paramssld["video_ht_view9_desc_fontsize"] = "14";
    $paramssld["video_ht_view9_element_title_show"] = "true";
    $paramssld["video_ht_view9_element_desc_show"] = "true";
    $paramssld["video_ht_view9_general_width"] = "100";
    $paramssld["video_view9_general_position"] = "center";
    $paramssld["video_view9_title_textalign"] = "left";
    $paramssld["video_view9_desc_textalign"] = "justify";
    $paramssld["video_view9_image_position"] = "2";
    $paramssld["video_ht_view9_title_back_color"] = "000000";
    $paramssld["video_ht_view9_title_opacity"] = "70";
    $paramssld["video_ht_view9_desc_opacity"] = "100";
    $paramssld["video_ht_view9_desc_back_color"] = "FFFFFF";
    $paramssld["video_ht_view9_general_space"] = "0";
    $paramssld["video_ht_view9_general_separator_size"] = "0";
    $paramssld["video_ht_view9_general_separator_color"] = "010457";
    $paramssld["video_view9_general_separator_style"] = "dotted";
    $paramssld["video_ht_view9_general_content_count"] = "2";
    $paramssld["video_ht_view9_paginator_fontsize"] = "22";
    $paramssld["video_ht_view9_paginator_color"] = "615854";
    $paramssld["video_ht_view9_paginator_icon_color"] = "B3A5A1";
    $paramssld["video_ht_view9_paginator_icon_size"] = "25";
    $paramssld["video_view9_paginator_position"] = "left";
    $paramssld["video_ht_view9_video_width"] = "720";
    $paramssld["video_ht_view9_video_height"] = "420";
    $paramssld["video_view9_video_position"] = "center";
    ///////////////////////////////////////
    //////////////////////////////////////
    $paramssld["video_view9_loadmore_position"] = "center";
    $paramssld["video_ht_view9_loadmore_fontsize"] = "19";
    $paramssld["video_ht_view9_button_color"] = "615854";
    $paramssld["video_ht_view9_loadmore_font_color"] = "FFFFFF";
    $paramssld["loading_type"] = "1";
    $paramssld["video_ht_view9_loadmore_text"] = "View More";
    $paramssld["video_ht_view8_paginator_position"] = "center";
    $paramssld["video_ht_view8_paginator_icon_size"] = "18";
    $paramssld["video_ht_view8_paginator_icon_color"] = "26A6FC";
    $paramssld["video_ht_view8_paginator_color"] = "26A6FC";
    $paramssld["video_ht_view8_paginator_fontsize"] = "18";
    $paramssld["video_ht_view8_loadmore_position"] = "center";
    $paramssld["video_ht_view8_loadmore_fontsize"] = "14";
    $paramssld["video_ht_view8_button_color"] = "26A6FC";
    $paramssld["video_ht_view8_loadmore_font_color"] = "FF1C1C";
    $paramssld["video_ht_view8_loading_type"] = "3";
    $paramssld["video_ht_view8_loadmore_text"] = "View More";
    $paramssld["video_ht_view7_paginator_fontsize"] = "22";
    $paramssld["video_ht_view7_paginator_color"] = "0A0202";
    $paramssld["video_ht_view7_paginator_icon_color"] = "333333";
    $paramssld["video_ht_view7_paginator_icon_size"] = "22";
    $paramssld["video_ht_view7_paginator_position"] = "center";
    $paramssld["video_ht_view7_loadmore_position"] = "center";
    $paramssld["video_ht_view7_loadmore_fontsize"] = "19";
    $paramssld["video_ht_view7_button_color"] = "333333";
    $paramssld["video_ht_view7_loadmore_font_color"] = "CCCCCC";
    $paramssld["video_ht_view7_loading_type"] = "1";
    $paramssld["video_ht_view7_loadmore_text"] = "View More";
    $paramssld["video_ht_view4_paginator_fontsize"] = "19";
    $paramssld["video_ht_view4_paginator_color"] = "FF2C2C";
    $paramssld["video_ht_view4_paginator_icon_color"] = "B82020";
    $paramssld["video_ht_view4_paginator_icon_size"] = "21";
    $paramssld["video_ht_view4_paginator_position"] = "center";
    $paramssld["video_ht_view4_loadmore_position"] = "center";
    $paramssld["video_ht_view4_loadmore_fontsize"] = "16";
    $paramssld["video_ht_view4_button_color"] = "5CADFF";
    $paramssld["video_ht_view4_loadmore_font_color"] = "FF0D0D";
    $paramssld["video_ht_view4_loading_type"] = "3";
    $paramssld["video_ht_view4_loadmore_text"] = "View More";
    $paramssld["video_ht_view1_paginator_fontsize"] = "22";
    $paramssld["video_ht_view1_paginator_color"] = "222222";
    $paramssld["video_ht_view1_paginator_icon_color"] = "FF2C2C";
    $paramssld["video_ht_view1_paginator_icon_size"] = "22";
    $paramssld["video_ht_view1_paginator_position"] = "left";
    $paramssld["video_ht_view1_loadmore_position"] = "center";
    $paramssld["video_ht_view1_loadmore_fontsize"] = "22";
    $paramssld["video_ht_view1_button_color"] = "FF2C2C";
    $paramssld["video_ht_view1_loadmore_font_color"] = "FFFFFF";
    $paramssld["video_ht_view1_loading_type"] = "2";
    $paramssld["video_ht_view1_loadmore_text"] = "Load More";
    $paramssld["video_ht_view9_loadmore_font_color_hover"] = "D9D9D9";
    $paramssld["video_ht_view9_button_color_hover"] = "8F827C";
    $paramssld["video_ht_view8_loadmore_font_color_hover"] = "FF4242";
    $paramssld["video_ht_view8_button_color_hover"] = "0FEFFF";
    $paramssld["video_ht_view7_loadmore_font_color_hover"] = "D9D9D9";
    $paramssld["video_ht_view7_button_color_hover"] = "8F827C";
    $paramssld["video_ht_view4_loadmore_font_color_hover"] = "FF4040";
    $paramssld["video_ht_view4_button_color_hover"] = "99C5FF";
    $paramssld["video_ht_view1_loadmore_font_color_hover"] = "F2F2F2";
    $paramssld["video_ht_view1_button_color_hover"] = "991A1A";
    ?>

<script>
	var lightbox_transition = '<?php 
    echo $paramssld['light_box_transition'];
    ?>
';
	var lightbox_speed = <?php 
    echo $paramssld['light_box_speed'];
    ?>
;
	var lightbox_fadeOut = <?php 
    echo $paramssld['light_box_fadeout'];
    ?>
;
	var lightbox_title = <?php 
    echo $paramssld['light_box_title'];
    ?>
;
	var lightbox_scalePhotos = <?php 
    echo $paramssld['light_box_scalephotos'];
    ?>
;
	var lightbox_scrolling = <?php 
    echo $paramssld['light_box_scrolling'];
    ?>
;
	var lightbox_opacity = <?php 
    echo $paramssld['light_box_opacity'] / 100 + 0.001;
    ?>
;
	var lightbox_open = <?php 
    echo $paramssld['light_box_open'];
    ?>
;
	var lightbox_returnFocus = <?php 
    echo $paramssld['light_box_returnfocus'];
    ?>
;
	var lightbox_trapFocus = <?php 
    echo $paramssld['light_box_trapfocus'];
    ?>
;
	var lightbox_fastIframe = <?php 
    echo $paramssld['light_box_fastiframe'];
    ?>
;
	var lightbox_preloading = <?php 
    echo $paramssld['light_box_preloading'];
    ?>
;
	var lightbox_overlayClose = <?php 
    echo $paramssld['light_box_overlayclose'];
    ?>
;
	var lightbox_escKey = <?php 
    echo $paramssld['light_box_esckey'];
    ?>
;
	var lightbox_arrowKey = <?php 
    echo $paramssld['light_box_arrowkey'];
    ?>
;
	var lightbox_loop = <?php 
    echo $paramssld['light_box_loop'];
    ?>
;
	var lightbox_closeButton = <?php 
    echo $paramssld['light_box_closebutton'];
    ?>
;
	var lightbox_previous = "<?php 
    echo $paramssld['light_box_previous'];
    ?>
";
	var lightbox_next = "<?php 
    echo $paramssld['light_box_next'];
    ?>
";
	var lightbox_close = "<?php 
    echo $paramssld['light_box_close'];
    ?>
";
	var lightbox_html = <?php 
    echo $paramssld['light_box_html'];
    ?>
;
	var lightbox_photo = <?php 
    echo $paramssld['light_box_photo'];
    ?>
;
	var lightbox_width = "<?php 
    echo $paramssld['light_box_width'];
    ?>
";
	var lightbox_height = "<?php 
    echo $paramssld['light_box_height'];
    ?>
";
	var lightbox_innerWidth = '<?php 
    echo $paramssld['light_box_innerwidth'];
    ?>
';
	var lightbox_innerHeight = '<?php 
    echo $paramssld['light_box_innerheight'];
    ?>
';
	var lightbox_initialWidth = '<?php 
    echo $paramssld['light_box_initialwidth'];
    ?>
';
	var lightbox_initialHeight = '<?php 
    echo $paramssld['light_box_initialheight'];
    ?>
';
	
        var maxwidth=jQuery(window).width();
        if(maxwidth > <?php 
    echo $paramssld['light_box_width'];
    ?>
 ){ maxwidth= <?php 
    echo $paramssld['light_box_width'];
    ?>
 ; }
        var lightbox_maxWidth = <?php 
    if ($paramssld['light_box_size_fix'] == 'true') {
        echo '"100%"';
    } else {
        echo 'maxwidth';
    }
    ?>
;
        var lightbox_maxHeight = <?php 
    if ($paramssld['light_box_size_fix'] == 'true') {
        echo '"100%"';
    } else {
        echo $paramssld['light_box_height'];
    }
    ?>
;
        
	var lightbox_slideshow = <?php 
    echo $paramssld['light_box_slideshow'];
    ?>
;
	var lightbox_slideshowSpeed = <?php 
    echo $paramssld['light_box_slideshowspeed'];
    ?>
;
	var lightbox_slideshowAuto = <?php 
    echo $paramssld['light_box_slideshowauto'];
    ?>
;
	var lightbox_slideshowStart = "<?php 
    echo $paramssld['light_box_slideshowstart'];
    ?>
";
	var lightbox_slideshowStop = "<?php 
    echo $paramssld['light_box_slideshowstop'];
    ?>
";
	var lightbox_fixed = <?php 
    echo $paramssld['light_box_fixed'];
    ?>
;
	<?php 
    $pos = $paramssld['lightbox_open_position'];
    switch ($pos) {
        case 1:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 1:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 2:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = false;
	<?php 
            break;
        case 3:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = '10%';
	<?php 
            break;
        case 4:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = false;
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 5:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = false;
	<?php 
            break;
        case 6:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = '10%';
	<?php 
            break;
        case 7:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = '10%';
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 8:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = '10%';
		var lightbox_left = false;
		var lightbox_right = false;
	<?php 
            break;
        case 9:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = '10%';
		var lightbox_left = false;
		var lightbox_right = '10%';
	<?php 
            break;
    }
    ?>
	
	var lightbox_reposition = <?php 
    echo $paramssld['light_box_reposition'];
    ?>
;
	var lightbox_retinaImage = <?php 
    echo $paramssld['light_box_retinaimage'];
    ?>
;
	var lightbox_retinaUrl = <?php 
    echo $paramssld['light_box_retinaurl'];
    ?>
;
	var lightbox_retinaSuffix = "<?php 
    echo $paramssld['light_box_retinasuffix'];
    ?>
";
	
				jQuery(document).ready(function(){
				jQuery("#huge_it_videogallery_content a[href$='.jpg'], #huge_it_videogallery_content a[href$='.jpeg'], #huge_it_videogallery_content a[href$='.png'], #huge_it_videogallery_content a[href$='.gif']").addClass('videogroup<?php 
    echo $videogalleryID;
    ?>
');
				
				jQuery(".videogroup<?php 
    echo $videogalleryID;
    ?>
").colorbox({rel:'videogroup<?php 
    echo $videogalleryID;
    ?>
'});
				jQuery(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
				jQuery(".vimeo").colorbox({iframe:true, innerWidth:640, innerHeight:390});
				jQuery(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
				jQuery(".inline").colorbox({inline:true, width:"50%"});
				jQuery(".callbacks").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});

				jQuery('.non-retina').colorbox({rel:'group5', transition:'none'})
				jQuery('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
				
				jQuery("#click").click(function(){ 
					jQuery('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
		
</script>
<!--Huge IT videogallery START-->
	<!-- videogallery CONTENT POPUP -->
	<?php 
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (!is_plugin_active('lightbox/lightbox.php')) {
        ?>
	<link href="<?php 
        echo plugins_url('../style/colorbox-' . $paramssld['light_box_style'] . '.css', __FILE__);
        ?>
" rel="stylesheet" type="text/css" />
	<?php 
    }
    ?>
	
	<script src="<?php 
    echo plugins_url('../js/jquery.colorbox.js', __FILE__);
    ?>
"></script>
	<script src="<?php 
    echo plugins_url('../js/jquery.hugeitmicro.min.js', __FILE__);
    ?>
"></script>
	<?php 
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (!is_plugin_active('wp-lightbox-2/wp-lightbox-2.php')) {
        ?>

	<?php 
    }
    ?>
	

	<?php 
    $i = $videogallerychangeview;
    switch ($i) {
        case 0:
            ?>
<script> 
jQuery(function(){
    var defaultBlockHeight=<?php 
            echo $paramssld['ht_view2_element_height'] + 37;
            ?>
;
	var defaultBlockWidth=<?php 
            echo $paramssld['ht_view2_element_width'];
            ?>
;
    var $container = jQuery('#huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
');

      // add randomish size classes
      $container.find('.videoelement_<?php 
            echo $videogalleryID;
            ?>
').each(function(){
        var $this = jQuery(this),
            number = parseInt( $this.find('.number').text(), 10 );
			//alert(number);
        if ( number % 7 % 2 === 1 ) {
          $this.addClass('width2');
        }
        if ( number % 3 === 0 ) {
          $this.addClass('height2');
        }
      });
    
    $container.hugeitmicro({
      itemSelector : '.videoelement_<?php 
            echo $videogalleryID;
            ?>
',
      masonry : {
        columnWidth : defaultBlockWidth+20
      },
      masonryHorizontal : {
        rowHeight: defaultBlockHeight+20
      },
      cellsByRow : {
        columnWidth : defaultBlockWidth+20,
        rowHeight : defaultBlockHeight
      },
      cellsByColumn : {
        columnWidth : defaultBlockWidth+20,
        rowHeight : defaultBlockHeight
      },
      getSortData : {
        symbol : function( $elem ) {
          return $elem.attr('data-symbol');
        },
        category : function( $elem ) {
          return $elem.attr('data-category');
        },
        number : function( $elem ) {
          return parseInt( $elem.find('.number').text(), 10 );
        },
        weight : function( $elem ) {
          return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
        },
        name : function ( $elem ) {
          return $elem.find('.name').text();
        }
      }
	 
    });
    
    
	var $optionSets = jQuery('#huge_it_videogallery_options .option-set'),
	$optionLinks = $optionSets.find('a');

	$optionLinks.click(function(){
		var $this = jQuery(this);

		if ( $this.hasClass('selected') ) {
		  return false;
		}
		var $optionSet = $this.parents('.option-set');
		$optionSet.find('.selected').removeClass('selected');
		$this.addClass('selected');

		var options = {},
			key = $optionSet.attr('data-option-key'),
			value = $this.attr('data-option-value');

		value = value === 'false' ? false : value;
		options[ key ] = value;
		if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {

		  changeLayoutMode( $this, options )
		} else {

		  $container.hugeitmicro( options );
		}

		return false;
	});    

	var isHorizontal = false;
	function changeLayoutMode( $link, options ) {
		var wasHorizontal = isHorizontal;
		isHorizontal = $link.hasClass('horizontal');

		if ( wasHorizontal !== isHorizontal ) {

		  var style = isHorizontal ? 
			{ height: '100%', width: $container.width() } : 
			{ width: 'auto' };

		  $container.filter(':animated').stop();

		  $container.addClass('no-transition').css( style );
		  setTimeout(function(){
			$container.removeClass('no-transition').hugeitmicro( options );
		  }, 100 )
		} else {
		  $container.hugeitmicro( options );
		}
	}

    var $sortBy = jQuery('#sort-by');
    jQuery('#shuffle a').click(function(){
      $container.hugeitmicro('shuffle');
      $sortBy.find('.selected').removeClass('selected');
      $sortBy.find('[data-option-value="random"]').addClass('selected');
      return false;
    });
});

jQuery(document).ready(function(){

	jQuery('.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 .videogallery-image-overlay a').on('click',function(){
		var strid = jQuery(this).attr('href').replace('#','');
		jQuery(this).parents('body').append('<div id="huge-popup-overlay-video_<?php 
            echo $videogalleryID;
            ?>
"></div>');
		jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
').insertBefore('#huge-popup-overlay-video_<?php 
            echo $videogalleryID;
            ?>
');
		var height = jQuery(window).height();
		var width=jQuery(window).width();
		//console.log(height)
		//console.log(width)
		if(width<=767){
			jQuery(window).scrollTop(0);
			//console.log(jQuery('body').scrollTop(0))
			jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 iframe').height(jQuery('body').width()*0.5);
		}else {jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 iframe').height(jQuery('body').width()*0.23);}
		jQuery('#huge_it_videogallery_pupup_element_'+strid).addClass('active').css({height:height*0.7});
		jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
').addClass('active');
		
		return false;
	});
	 /*      <-- POPUP LEFT CLICK -->        */
        jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .left-change").click(function(){
        	//var strid = jQuery(this).closest(".pupup-element").prev(".pupup-element").find('a').data('popupid').replace('#','');
        	var height = jQuery(window).height();
        	//jQuery('#huge_it_gallery_pupup_element_'+strid).css({height:height*0.7});
            var num = jQuery(this).find("a").attr("href").replace('#', '');
            if(num >= 1){
            	var strid = jQuery(this).closest(".pupup-element").prev(".pupup-element").find('a').data('popupid').replace('#','');
            	jQuery('#huge_it_videogallery_pupup_element_'+strid).css({height:height*0.7});
                jQuery(this).closest(".pupup-element").removeClass("active");
                jQuery(this).closest(".pupup-element").prev(".pupup-element").addClass("active");
            }else{
            	var strid = jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
").find(".pupup-element").last().find('a').data('popupid').replace('#','');
            	jQuery('#huge_it_videogallery_pupup_element_'+strid).css({height:height*0.7});
                jQuery(this).closest(".pupup-element").removeClass("active");
                jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
").find(".pupup-element").last().addClass("active");
            }
            
        });
        
        /*      <-- POPUP RIGHT CLICK -->        */
        jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .right-change").click(function(){
        	var height = jQuery(window).height();
            var num = jQuery(this).find("a").attr("href").replace('#', '');
            var cnt = 0;
            jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
").find(".pupup-element").each(function(){
                cnt++;
            });
//            alert(num+" "+cnt);
            if(num <= cnt){
            	var strid = jQuery(this).closest(".pupup-element").next(".pupup-element").find('a').data('popupid').replace('#','');
	        	jQuery('#huge_it_videogallery_pupup_element_'+strid).css({height:height*0.7});
                jQuery(this).closest(".pupup-element").removeClass("active");
                jQuery(this).closest(".pupup-element").next(".pupup-element").addClass("active");
            }else{
            	var strid = jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
").find(".pupup-element:first-child a").data('popupid').replace('#','');	        	
	        	jQuery('#huge_it_videogallery_pupup_element_'+strid).css({height:height*0.7});
                jQuery(this).closest(".pupup-element").removeClass("active");
                jQuery("#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
").find(".pupup-element:first-child").addClass("active");
            }
        });
	//////
	
	jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close').on('click',function(){
		closePopup();
		return false;
	});
	
	jQuery('body').on('click','#huge-popup-overlay-video_<?php 
            echo $videogalleryID;
            ?>
',function(){
		closePopup();
		return false;
	});
	
	function closePopup() {

		var scrollingTo = jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .pupup-element.active').attr('id');
		jQuery(window).scrollTop(jQuery("#"+scrollingTo+"_child").offset().top-100)
		jQuery('#huge-popup-overlay-video_<?php 
            echo $videogalleryID;
            ?>
').remove();
		var videsrc=jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.active iframe').attr('src');
		jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.active iframe').attr('src','');
		jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.active iframe').attr('src',videsrc);
		jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li').removeClass('active');
		jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
').removeClass('active');
		
	}

	jQuery(window).resize(function(){
		var imgBlockWidth=jQuery(window).width();
		if(imgBlockWidth>=768){
			jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 iframe').height(jQuery(window).width()*0.20);
		}else{
			jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 iframe').height(jQuery(window).width()*0.5);
		}
	});

	
}); 
</script>

<style type="text/css">
    #huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 a{
        border:none;
    }    

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 {
	width:100%;
	max-width:<?php 
            echo $paramssld['ht_view2_element_width'];
            ?>
px;
	height:<?php 
            echo $paramssld['ht_view2_element_height'] + 45;
            ?>
px;
	margin:0px 0px 10px 0px;
	background:#<?php 
            echo $paramssld['ht_view2_element_background_color'];
            ?>
;
	border:<?php 
            echo $paramssld['ht_view2_element_border_width'];
            ?>
px solid #<?php 
            echo $paramssld['ht_view2_element_border_color'];
            ?>
;
	outline:none;
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 {
	position:relative;
	width:100%;
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 img {
	width:<?php 
            echo $paramssld['ht_view2_element_width'];
            ?>
px !important;
	height:<?php 
            echo $paramssld['ht_view2_element_height'];
            ?>
px !important;
	display:block;
	border-radius: 0px !important;
	box-shadow: 0 0px 0px rgba(0, 0, 0, 0) !important; 
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 .videogallery-image-overlay {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height:100%;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view2_element_overlay_color'], 2));
            $titleopacity = $paramssld["ht_view2_element_overlay_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
	display:none;
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
:hover .image-block_<?php 
            echo $videogalleryID;
            ?>
  .videogallery-image-overlay {
	display:block;
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 .videogallery-image-overlay a {
	position:absolute;
	top:0px;
	left:0px;
	display:block;
	width:100%;
	height:100%;
	background:url('<?php 
            echo plugins_url('../images/zoom.' . $paramssld["ht_view2_zoombutton_style"] . '.png', __FILE__);
            ?>
') center center no-repeat;
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 {
	position:relative;
	height: 30px;
	margin: 0;
	padding: 15px 0px 15px 0px;
	-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,.1);
	box-shadow: inset 0 1px 0 rgba(0,0,0,.1);
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 h3 {
	position:relative;
	margin:0px !important;
	padding:0px 1% 5px 1% !important;
	width:98%;
	text-overflow: ellipsis;
	overflow: hidden; 
	white-space:nowrap;
	font-weight:normal;
	font-size: <?php 
            echo $paramssld["ht_view2_element_title_font_size"];
            ?>
px !important;
	line-height: <?php 
            echo $paramssld["ht_view2_element_title_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view2_element_title_font_color"];
            ?>
;
}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 .button-block {
	position:absolute;
	right:0px;
	top:0px;
	display:none;
	vertical-align:middle;
	height:30px;
	padding:10px 10px 4px 10px;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view2_element_overlay_color'], 2));
            $titleopacity = $paramssld["ht_view2_element_overlay_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
	border-left: 1px solid rgba(0,0,0,.05);
}
	.load_more5 {
		margin: 10px 0;
		position:relative;
		text-align:<?php 
            if ($paramssld['video_ht_view1_loadmore_position'] == 'left') {
                echo 'left';
            } elseif ($paramssld['video_ht_view1_loadmore_position'] == 'center') {
                echo 'center';
            } elseif ($paramssld['video_ht_view1_loadmore_position'] == 'right') {
                echo 'right';
            }
            ?>
;

		width:100%;


	}

	.load_more_button5 {
		border-radius: 10px;
		display:inline-block;
		padding:5px 15px;
		font-size:<?php 
            echo $paramssld['video_ht_view1_loadmore_fontsize'];
            ?>
px !important;;
		color:<?php 
            echo '#' . $paramssld['video_ht_view1_loadmore_font_color'];
            ?>
 !important;;
		background:<?php 
            echo '#' . $paramssld['video_ht_view1_button_color'];
            ?>
 !important;
		cursor:pointer;

	}
	.load_more_button5:hover{
		color:<?php 
            echo '#' . $paramssld['video_ht_view1_loadmore_font_color_hover'];
            ?>
 !important;
		background:<?php 
            echo '#' . $paramssld['video_ht_view1_button_color_hover'];
            ?>
 !important;
	}

	.loading5 {
		display:none;
	}
	.paginate5{
		font-size:<?php 
            echo $paramssld['video_ht_view1_paginator_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view1_paginator_color'];
            ?>
 !important;
		text-align: <?php 
            echo $paramssld['video_ht_view1_paginator_position'];
            ?>
;
		margin-top:15px;
	}
	.paginate5 a{
		border-bottom: none !important;
	}
	.icon-style5{
		font-size: <?php 
            echo $paramssld['video_ht_view1_paginator_icon_size'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view1_paginator_icon_color'];
            ?>
 !important;
	}
	.clear{
		clear:both;
	}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
:hover .title-block_<?php 
            echo $videogalleryID;
            ?>
 .button-block {display:block;}

#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a,#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:link,#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:visited,
#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:hover,#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:focus,#huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
 #huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
 .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:active {
	position:relative;
	display:block;
	vertical-align:middle;
	padding: 3px 10px 3px 10px; 
	border-radius:3px;
	font-size:<?php 
            echo $paramssld["ht_view2_element_linkbutton_font_size"];
            ?>
px;
	background:#<?php 
            echo $paramssld["ht_view2_element_linkbutton_background_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view2_element_linkbutton_color"];
            ?>
;
	text-decoration:none;
}

/*#####POPUP#####*/

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 {
	position:fixed;
	display:table;
	width:80%;
	top:7%;
	left:7%;
	margin:0px !important;
	padding:0px !important;
	list-style:none;
	z-index:2000;
	display:none;
	height:85%;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
.active {display:table;}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element {
	position:relative;
	display:none;
	width:100%;
	padding:40px 0px 20px 0px;
	min-height:100%;
	position:relative;
	background:#<?php 
            echo $paramssld["ht_view2_popup_background_color"];
            ?>
;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element.active {
	display:block;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation {
	position:absolute;
	width:100%;
	height:40px;
	top:0px;
	left:0px;
	z-index:2001;
	background:url('<?php 
            echo plugins_url('../images/divider.line.png', __FILE__);
            ?>
') center bottom repeat-x;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close,#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close:link, #huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close:visited {
	position:relative;
	float:right;
	width:40px;
	height:40px;
	display:block;
	background:url('<?php 
            echo plugins_url('../images/close.popup.' . $paramssld["ht_view2_popup_closebutton_style"] . '.png', __FILE__);
            ?>
') center center no-repeat;
	border-left:1px solid #ccc;
	opacity:.65;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close:hover, #huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close:focus, #huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .close:active {opacity:1;}


#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 {
	overflow-y:scroll;
	position:relative;
	width:96%;
	height:98%;
	padding:2% 2% 0% 2%;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 {
	width:60%;
	position:relative;
	float:left;
	margin-right:2%;
	border-right:1px solid #ccc;
	min-width:200px;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 img {
	width:100% !important;
	display:block;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 iframe  {
	width:100% !important;
	height:100%;
	display:block;

}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block {
	width:37%;
	position:relative;
	float:left;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block > div {
	padding-top:10px;
	margin-bottom:10px;
	<?php 
            if ($paramssld['ht_view2_show_separator_lines'] == "on") {
                ?>
		background:url('<?php 
                echo plugins_url('../images/divider.line.png', __FILE__);
                ?>
') center top repeat-x;
	<?php 
            }
            ?>
}
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block > div:last-child {background:none;}


#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .title {
	position:relative;
	display:block;
	margin:0px 0px 10px 0px !important;
	font-size:<?php 
            echo $paramssld["ht_view2_popup_title_font_size"];
            ?>
px !important;
	line-height:<?php 
            echo $paramssld["ht_view2_popup_title_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view2_popup_title_font_color"];
            ?>
;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description {
	clear:both;
	position:relative;
	font-weight:normal;
	text-align:justify;
	font-size:<?php 
            echo $paramssld["ht_view2_description_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view2_description_color"];
            ?>
;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description h1,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description h2,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description h3,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description h4,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description h5,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description h6,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description p, 
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description strong,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description span {
	padding:2px !important;
	margin:0px !important;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description ul,
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block .description li {
	padding:2px 0px 2px 5px;
	margin:0px 0px 0px 8px;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block ul.thumbs-list {
	list-style:none;
	display:table;
	position:relative;
	clear:both;
	width:100%;
	margin:0px auto;
	padding:0px;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block ul.thumbs-list li {
	display:block;
	float:left;
	width:<?php 
            echo $paramssld["ht_view2_thumbs_width"];
            ?>
px;
	height:<?php 
            echo $paramssld["ht_view2_thumbs_height"];
            ?>
px;
	margin:0px 2% 5px 1% !important;
	opacity:0.45;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block ul.thumbs-list li.active,#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block ul.thumbs-list li:hover {
	opacity:1;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block ul.thumbs-list li a {
	display:block;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block ul.thumbs-list li img {
	width:<?php 
            echo $paramssld["ht_view2_thumbs_width"];
            ?>
px !important;
	height:<?php 
            echo $paramssld["ht_view2_thumbs_height"];
            ?>
px !important;
}
/**/
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .left-change, #huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .right-change{
    width: 40px;
    height: 39px;
    font-size: 25px;
    display: inline-block;
    text-align: center;
    border: 1px solid #eee;
    border-bottom: none;
    border-top: none;
}
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .right-change{
    position:relative;
    margin-left: -6px;
}
#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .right-change:hover, #huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .left-change:hover{
    background: #ddd;
    border-color: #ccc;
    color: #000 !important;
    cursor: pointer;
}

#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .right-change a, #huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .heading-navigation .left-change a{
    position: absolute;
    transform: translate(-50%, -50%);
    top:50%;
    color: #777;
    text-decoration: none;
    width: 12px;
    height: 24px;  
    display: inline-block;
    line-height:1 !important;
}


/**/

.pupup-element .button-block {
	position:relative;
}

.pupup-element .button-block a,.pupup-element .button-block a:link,.pupup-element .button-block a:visited {
	position:relative;
	display:inline-block;
	padding:6px 12px;
	background:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_background_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_color"];
            ?>
;
	font-size:<?php 
            echo $paramssld["ht_view2_popup_linkbutton_font_size"];
            ?>
px;
	text-decoration:none;
}

.pupup-element .button-block a:hover,.pupup-element .button-block a:focus,.pupup-element .button-block a:active {
	background:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_background_hover_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_font_hover_color"];
            ?>
;
}


#huge-popup-overlay-video_<?php 
            echo $videogalleryID;
            ?>
 {
	position:fixed;
	top:0px;
	left:0px;
	width:100%;
	height:100%;
	z-index:199;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view2_popup_overlay_color'], 2));
            $titleopacity = $paramssld["ht_view2_popup_overlay_transparency_color"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
}


@media only screen and (max-width: 767px) {
	
	#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 {
		position:absolute;
		left:0px;
		top:0px;
		width:100%;
		height:auto !important;
		left:0px;
	}
	
	#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element {
		margin:0px;
		height:auto !important;
		position:absolute;
		left:0px;
		top:0px;
	}

	#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 {
		height:auto !important;
		overflow-y:auto;
	}


	#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 {
		width:100%;
		float:none;
		clear:both;
		margin-right:0px;
		border-right:0px;
	}

	#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .right-block {
		width:100%;
		float:none;
		clear:both;
		margin-right:0px;
		border-right:0px;
	}

	#huge-popup-overlay-video_<?php 
            echo $videogalleryID;
            ?>
 {
		position:fixed;
		top:0px;
		left:0px;
		width:100%;
		height:100%;
		z-index:199;
	}

}
</style>
<section id="huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
">
  <div id="huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
" class="super-list variable-sizes clearfix">
  	<input type="hidden" class="pagenum" value="1" />
  	<?php 
            foreach ($images as $image) {
                $idofgallery = $image->videogallery_id;
                //print_r($image);
            }
            global $wpdb;
            $pattern = '/-/';
            $query2 = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_galleries where id = '%d' order by ordering ASC ", $idofgallery);
            $gallery = $wpdb->get_results($query2);
            foreach ($gallery as $gall) {
                global $post;
                $pID = $post->ID;
                $disp_type = $gall->display_type;
                $count_page = $gall->content_per_page;
                if ($count_page == 0) {
                    $count_page = 999;
                } elseif (preg_match($pattern, $count_page)) {
                    $count_page = preg_replace($pattern, '', $count_page);
                }
                //var_dump($count_page) ;
            }
            global $wpdb;
            $num = $count_page;
            //$total = count($images) ;
            $total = intval((count($images) - 1) / $num + 1);
            //$total_img=count($images);
            if (isset($_GET['page-img' . $videogalleryID . $pID])) {
                $page = $_GET['page-img' . $videogalleryID . $pID];
            } else {
                $page = '';
            }
            $page = intval($page);
            if (empty($page) or $page < 0) {
                $page = 1;
            }
            if ($page > $total) {
                $page = $total;
            }
            $start = $page * $num - $num;
            $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_videos where videogallery_id = '%d' order by ordering ASC LIMIT " . $start . "," . $num . "", $idofgallery);
            $page_images = $wpdb->get_results($query);
            if ($disp_type == 2) {
                $page_images = $images;
                $count_page = 9999;
            }
            ?>
			<input type="hidden" id="total" value="<?php 
            echo $total;
            ?>
" />
  	<?php 
            foreach ($page_images as $key => $row) {
                $link = str_replace('__5_5_5__', '%', $row->sl_url);
                $descnohtml = strip_tags(str_replace('__5_5_5__', '%', $row->description));
                $result = substr($descnohtml, 0, 50);
                ?>
		<div class="videoelement_<?php 
                echo $videogalleryID;
                ?>
" id="huge_it_videogallery_pupup_element_<?php 
                echo $row->id;
                ?>
_child" tabindex="0" data-symbol="<?php 
                echo str_replace('__5_5_5__', '%', $row->name);
                ?>
" data-category="alkaline-earth">
			<div class="image-block_<?php 
                echo $videogalleryID;
                ?>
">
			<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        $imgurl = explode(";", $row->image_url);
                        ?>
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
" alt="" />
							<?php 
                        } else {
                            ?>
							<img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg" alt="" />
							<?php 
                        }
                        ?>

				<?php 
                        break;
                    case 'video':
                        ?>
							<?php 
                        $videourl = get_video_gallery_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            if (empty($row->thumb_url)) {
                                $thumb_pic = 'http://img.youtube.com/vi/' . $videourl[0] . '/mqdefault.jpg';
                            } else {
                                $thumb_pic = $row->thumb_url;
                            }
                            ?>
									
										
										
										<img src="<?php 
                            echo $thumb_pic;
                            ?>
" alt="" />		
								<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            if (empty($row->thumb_url)) {
                                $imgsrc = $hash[0]['thumbnail_large'];
                            } else {
                                $imgsrc = $row->thumb_url;
                            }
                            ?>
										<img src="<?php 
                            echo $imgsrc;
                            ?>
" alt="" />
								<?php 
                        }
                        ?>
				<?php 
                        break;
                }
                if (str_replace('__5_5_5__', '%', $row->sl_url) == '') {
                    $viwMoreButton = '';
                } else {
                    if ($row->link_target == "on") {
                        $target = 'target="_blank"';
                    } else {
                        $target = '';
                    }
                    $viwMoreButton = '<div class="button-block"><a href="' . str_replace('__5_5_5__', '%', $row->sl_url) . '" ' . $target . ' >' . $paramssld["ht_view2_element_linkbutton_text"] . '</a></div>';
                }
                ?>
				<div class="videogallery-image-overlay"><a href="#<?php 
                echo $row->id;
                ?>
"></a></div>
			</div>
			<div class="title-block_<?php 
                echo $videogalleryID;
                ?>
">
				<h3><?php 
                echo str_replace('__5_5_5__', '%', $row->name);
                ?>
</h3>
				<?php 
                if ($paramssld["ht_view2_element_show_linkbutton"] == 'on') {
                    ?>
					<?php 
                    echo $viwMoreButton;
                    ?>
				<?php 
                }
                ?>
			</div>
		</div>	
		<?php 
            }
            ?>
	<div style="clear:both;"></div>
  </div>
  <?php 
            $path_site = plugins_url("/../Front_images", __FILE__);
            $a = $disp_type;
            if ($a == 1) {
                //if (!function_exists('check_url')) {
                //  function check_url() {
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                $pattern3 = "/\\?page-img[0-9]+=[0-9]+/";
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                        header("Location:" . $actual_link . "");
                        exit;
                    }
                } elseif (preg_match($pattern3, $actual_link)) {
                    $actual_link = preg_replace($pattern3, '', $actual_link);
                    header("Location:" . $actual_link . "");
                    exit;
                }
                //  }
                //}
                ?>
				<div class="load_more5">
					<div class="load_more_button5"><?php 
                echo $paramssld['video_ht_view1_loadmore_text'];
                ?>
</div>
					<div class="loading5"><img src="<?php 
                if ($paramssld['video_ht_view1_loading_type'] == '1') {
                    echo $path_site . '/arrows/loading1.gif';
                } elseif ($paramssld['video_ht_view1_loading_type'] == '2') {
                    echo $path_site . '/arrows/loading4.gif';
                } elseif ($paramssld['video_ht_view1_loading_type'] == '3') {
                    echo $path_site . '/arrows/loading36.gif';
                } elseif ($paramssld['video_ht_view1_loading_type'] == '4') {
                    echo $path_site . '/arrows/loading51.gif';
                }
                ?>
"></div>
					<script>
						jQuery(document).ready(function(){
							if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5").length){
								jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5").on("click tap",function(){
									

									if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()<jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
										
										var pagenum = parseInt(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()) + 1;
										var perpage =<?php 
                echo $count_page;
                ?>
;
										var galleryid="<?php 
                echo $image->videogallery_id;
                ?>
";
										var thumbtext="<?php 
                echo $paramssld["thumb_view_text"];
                ?>
";
										var linkbutton="<?php 
                echo $paramssld["ht_view2_element_linkbutton_text"];
                ?>
"
										var showbutton="<?php 
                echo $paramssld["ht_view2_element_show_linkbutton"];
                ?>
"
										var width="<?php 
                echo $paramssld['video_ht_view9_video_width'];
                ?>
";
										var height="<?php 
                echo $paramssld['video_ht_view9_video_height'];
                ?>
";
										//alert(pagenum+','+perpage+','+galleryid+','+width+','+height);
										getresult(pagenum,perpage,galleryid,thumbtext,linkbutton,showbutton,width,height);
									}else{
										jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5').hide();
									}
									return false;
								});
							}
											if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5').hide();
											}
							function getresult(pagenum,perpage,galleryid,thumbtext,linkbutton,showbutton,width,height){
								var data = {
										action:"huge_it_video_gallery_ajax",
										task:'load_videos_content',
										page:pagenum,
										perpage:perpage,
										galleryid:galleryid,
										thumbtext:thumbtext,
										linkbutton:linkbutton,
										showbutton:showbutton,
										width:width,
										height:height
								}
								jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .loading5').show();
								
								jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5').hide();

								jQuery.post('<?php 
                echo admin_url("admin-ajax.php");
                ?>
',data,function(response){
									if(response.success){
										jQuery('#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
').append(jQuery(response.success) ).hugeitmicro( 'reloadItems' ).hugeitmicro({ sortBy: 'original-order' }).hugeitmicro( 'reLayout' );
										jQuery('#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 img').on("load",function(){
											
											//jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
").append(response.success);
											jQuery(document).ready(function(){

												jQuery('.videoelement_<?php 
                echo $videogalleryID;
                ?>
 .image-block_<?php 
                echo $videogalleryID;
                ?>
 .videogallery-image-overlay a').on('click',function(){
													var strid = jQuery(this).attr('href').replace('#','');
													jQuery(this).parents('body').append('<div id="huge-popup-overlay-video_<?php 
                echo $videogalleryID;
                ?>
"></div>');
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
').insertBefore('#huge-popup-overlay-video_<?php 
                echo $videogalleryID;
                ?>
');
													var height = jQuery(window).height();
													var width=jQuery(window).width();
													if(width<=767){
														jQuery(window).scrollTop(0);
														jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 .popup-wrapper_<?php 
                echo $videogalleryID;
                ?>
 .image-block_<?php 
                echo $videogalleryID;
                ?>
 iframe').height(jQuery('body').width()*0.5);
													}else {jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 .popup-wrapper_<?php 
                echo $videogalleryID;
                ?>
 .image-block_<?php 
                echo $videogalleryID;
                ?>
 iframe').height(jQuery('body').width()*0.23);}
													jQuery('#huge_it_videogallery_pupup_element_'+strid).addClass('active').css({height:height*0.7});
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
').addClass('active');
													
													return false;
												});
												
												
												jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 .heading-navigation .close').on('click',function(){
													closePopup();
													return false;
												});
												
												jQuery('body').on('click','#huge-popup-overlay-video_<?php 
                echo $videogalleryID;
                ?>
',function(){
													closePopup();
													return false;
												});
												
												function closePopup() {
													jQuery('#huge-popup-overlay-video_<?php 
                echo $videogalleryID;
                ?>
').remove();
													var videsrc=jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 li.active iframe').attr('src');
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 li.active iframe').attr('src','');
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 li.active iframe').attr('src',videsrc);
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 li').removeClass('active');
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
').removeClass('active');
													
												}

												jQuery(window).resize(function(){
													jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 .popup-wrapper_<?php 
                echo $videogalleryID;
                ?>
 .image-block_<?php 
                echo $videogalleryID;
                ?>
 iframe').height(jQuery('#huge_it_videogallery_popup_list_<?php 
                echo $videogalleryID;
                ?>
 .popup-wrapper_<?php 
                echo $videogalleryID;
                ?>
 .image-block_<?php 
                echo $videogalleryID;
                ?>
').width()*0.5);
												});

												
											}); 
											////////////////////////////////////////////////////////////////////////////////////////////////////
											jQuery(".videogroup<?php 
                echo $videogalleryID;
                ?>
").colorbox({rel:'videogroup<?php 
                echo $videogalleryID;
                ?>
'});
											jQuery(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".vimeo").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
											jQuery(".inline").colorbox({inline:true, width:"50%"});
											jQuery(".callbacks").colorbox({
												onOpen:function(){ alert('onOpen: colorbox is about to open'); },
												onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
												onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
												onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
												onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
											});

											jQuery('.non-retina').colorbox({rel:'group5', transition:'none'})
											jQuery('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});


  
											jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5').show();
											jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .loading5').hide();
											
											if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button5').hide();
											}
										});

									}else{
										alert("no");
									}
								},"json");
							}

						});
					</script>
				</div>
				<?php 
            } elseif ($a == 0) {
                ?>
			<div class="paginate5">
			<?php 
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $checkREQ = '';
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                //$res=preg_match($pattern, $actual_link);
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                    }
                    $checkREQ = $actual_link . '&page-img' . $videogalleryID . $pID;
                } else {
                    $checkREQ = '?page-img' . $videogalleryID . $pID;
                }
                //var_dump($res);
                // Проверяем нужны ли стрелки назад
                $pervpage = '';
                if ($page != 1) {
                    $pervpage = '<a href= ' . $checkREQ . '=1><i class="icon-style5 hugeiticons-fast-backward" ></i></a>  
			                               <a href= ' . $checkREQ . '=' . ($page - 1) . '><i class="icon-style5 hugeiticons-chevron-left"></i></a> ';
                }
                // Проверяем нужны ли стрелки вперед
                $nextpage = '';
                if ($page != $total) {
                    $nextpage = ' <a href= ' . $checkREQ . '=' . ($page + 1) . '><i class="icon-style5 hugeiticons-chevron-right"></i></a>  
			                                   <a href= ' . $checkREQ . '=' . $total . '><i class="icon-style5 hugeiticons-fast-forward" ></i></a>';
                }
                // Вывод меню
                echo $pervpage . $page . '/' . $total . $nextpage;
                ?>
</div>
<?php 
            }
            ?>
</section>
<ul id="huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
">
	<?php 
            $changePopup = 1;
            foreach ($images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                $link = str_replace('__5_5_5__', '%', $row->sl_url);
                $descnohtml = strip_tags(str_replace('__5_5_5__', '%', $row->description));
                $result = substr($descnohtml, 0, 50);
                ?>
		<li class="pupup-element" id="huge_it_videogallery_pupup_element_<?php 
                echo $row->id;
                ?>
">
			<div class="heading-navigation">
				<div style="display: inline-block; float: left;">
                        <div class="left-change" ><a href="#<?php 
                echo $changePopup - 1;
                ?>
" data-popupid="#<?php 
                echo $row->id;
                ?>
"><</a></div>
                        <div class="right-change" ><a href="#<?php 
                echo $changePopup + 1;
                ?>
" data-popupid="#<?php 
                echo $row->id;
                ?>
">></a></div>
                </div>
                <?php 
                $changePopup = $changePopup + 1;
                ?>
				<a href="#close" class="close"></a>
				<div style="clear:both;"></div>
			</div>
			<div class="popup-wrapper_<?php 
                echo $videogalleryID;
                ?>
">
				<div class="image-block_<?php 
                echo $videogalleryID;
                ?>
">					
					<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
" alt="" />
							<?php 
                        } else {
                            ?>
							<img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg" alt="" />
							<?php 
                        }
                        ?>
	

					<?php 
                        break;
                    case 'video':
                        ?>
								<?php 
                        $videourl = get_video_gallery_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
										<iframe src="//www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
" style="border: 0;" allowfullscreen></iframe>
									<?php 
                        } else {
                            ?>
										<iframe src="//player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
?title=0&amp;byline=0&amp;portrait=0"  style="border: 0;" allowfullscreen></iframe>
									<?php 
                        }
                        ?>
					<?php 
                        break;
                }
                if (str_replace('__5_5_5__', '%', $row->sl_url) == '') {
                    $viwMoreButton = '';
                } else {
                    if ($row->link_target == "on") {
                        $target = 'target="_blank"';
                    } else {
                        $target = '';
                    }
                    $viwMoreButton = '<div class="button-block"><a href="' . str_replace('__5_5_5__', '%', $row->sl_url) . '" ' . $target . ' >' . $paramssld["ht_view2_element_linkbutton_text"] . '</a></div>';
                }
                ?>
				</div>
				<div class="right-block">
					<?php 
                if ($paramssld["ht_view2_show_popup_title"] == 'on') {
                    ?>
<h3 class="title"><?php 
                    echo str_replace('__5_5_5__', '%', $row->name);
                    ?>
</h3><?php 
                }
                ?>
					<?php 
                if ($paramssld["ht_view2_show_description"] == 'on') {
                    ?>
<div class="description"><?php 
                    echo str_replace('__5_5_5__', '%', $row->description);
                    ?>
</div><?php 
                }
                ?>
					<?php 
                if ($paramssld["ht_view2_show_popup_linkbutton"] == 'on') {
                    ?>
						<?php 
                    echo $viwMoreButton;
                    ?>
					<?php 
                }
                ?>
					<div style="clear:both;"></div>
				</div>
				<div style="clear:both;"></div>
			</div>
		</li>
		<?php 
            }
            ?>
</ul>
	  
  <?php 
            break;
            /////////////////////////////////// VIEW 1 CONTENT SLIDER ////////////////////////////////////
        /////////////////////////////////// VIEW 1 CONTENT SLIDER ////////////////////////////////////
        case 1:
            ?>


  <script src="<?php 
            echo plugins_url('../js/jquery.easing.min.js', __FILE__);
            ?>
"></script>
  <script src="<?php 
            echo plugins_url('../js/jquery.touchSwipe.min.js', __FILE__);
            ?>
"></script>
  <link rel="stylesheet" href="<?php 
            echo plugins_url('../style/animate.min.css', __FILE__);
            ?>
">
  <link href="<?php 
            echo plugins_url('../style/liquid-slider.css', __FILE__);
            ?>
" rel="stylesheet" type="text/css" />
 
<style>
* {outline:none;}
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 a{
    border:none;
}
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 {background:#<?php 
            echo $paramssld["ht_view5_slider_background_color"];
            ?>
;}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 div.slider-content {
	position:relative;
	width:100%;
	padding:0px 0px 0px 0px;
	position:relative;
	background:#<?php 
            echo $paramssld["ht_view5_slider_background_color"];
            ?>
;
}



[class$="-arrow"] {
	background-image:url(<?php 
            echo plugins_url('../images/arrow.' . $paramssld["ht_view5_icons_style"] . '.png', __FILE__);
            ?>
);
}

.ls-select-box {
	background:url(<?php 
            echo plugins_url('../images/menu.' . $paramssld["ht_view5_icons_style"] . '.png', __FILE__);
            ?>
) right center no-repeat #<?php 
            echo $paramssld["ht_view5_slider_background_color"];
            ?>
;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
-nav-select {
	color:#<?php 
            echo $paramssld["ht_view5_title_font_color"];
            ?>
;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 div.slider-content .slider-content-wrapper {
	position:relative;
	width:100%;
	padding:0px;
	display:block;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $videogalleryID;
            ?>
 {
	position:relative;
	width:<?php 
            echo $paramssld["ht_view5_main_image_width"];
            ?>
px;
	display:table-cell;
	padding:0px 10px 0px 0px;
	float:left;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $videogalleryID;
            ?>
 img.main-image {
	position:relative;
	width:100%;
	height:auto;
	display:block;
}


#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $videogalleryID;
            ?>
 .play-icon {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height:100%;	
}
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $videogalleryID;
            ?>
  .play-icon.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $videogalleryID;
            ?>
  .play-icon.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}




#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block {
	display:table-cell;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block > div {
	padding-bottom:10px;
	margin-top:10px;
	<?php 
            if ($paramssld['ht_view5_show_separator_lines'] == "on") {
                ?>
		background:url('<?php 
                echo plugins_url('../images/divider.line.png', __FILE__);
                ?>
') center bottom repeat-x;
	<?php 
            }
            ?>
}
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block > div:last-child {background:none;}


#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .title {
	position:relative;
	display:block;
	margin:-10px 0px 0px 0px;
	font-size:<?php 
            echo $paramssld["ht_view5_title_font_size"];
            ?>
px !important;
	line-height:<?php 
            echo $paramssld["ht_view5_title_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view5_title_font_color"];
            ?>
;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description {
	clear:both;
	position:relative;
	font-weight:normal;
	text-align:justify;
	font-size:<?php 
            echo $paramssld["ht_view5_description_font_size"];
            ?>
px !important;
	line-height:<?php 
            echo $paramssld["ht_view5_description_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view5_description_color"];
            ?>
;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description h1,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description h2,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description h3,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description h4,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description h5,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description h6,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description p, 
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description strong,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description span {
	padding:2px !important;
	margin:0px !important;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description ul,
#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block .description li {
	padding:2px 0px 2px 5px;
	margin:0px 0px 0px 8px;
}



#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block {
	position:relative;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block a,#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block a:link,#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block a:visited{
	position:relative;
	display:inline-block;
	padding:6px 12px;
	background:#<?php 
            echo $paramssld["ht_view5_linkbutton_background_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view5_linkbutton_color"];
            ?>
;
	font-size:<?php 
            echo $paramssld["ht_view5_linkbutton_font_size"];
            ?>
;
	text-decoration:none;
}

#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block a:hover,#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block a:focus,#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .button-block a:active {
	background:#<?php 
            echo $paramssld["ht_view5_linkbutton_background_hover_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view5_linkbutton_font_hover_color"];
            ?>
;
}

@media only screen and (min-width:500px) {
	#main-slider_<?php 
            echo $videogalleryID;
            ?>
-nav-ul {
		visibility:hidden !important;
		height:1px;
	}
}

@media only screen and (max-width:500px) {
	#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $videogalleryID;
            ?>
,#main-slider_<?php 
            echo $videogalleryID;
            ?>
 .slider-content-wrapper .right-block {
		width:100%;
		display:block;
		float:none;
		clear:both;
	}
}

</style>
<div id="main-slider_<?php 
            echo $videogalleryID;
            ?>
" class="liquid-slider">
	<?php 
            foreach ($images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                //array_pop($imgurl);
                $link = str_replace('__5_5_5__', '%', $row->sl_url);
                $descnohtml = strip_tags(str_replace('__5_5_5__', '%', $row->description));
                $result = substr($descnohtml, 0, 50);
                ?>
		<div class="slider-content">
			
			<div class="slider-content-wrapper">
				<div class="image-block_<?php 
                echo $videogalleryID;
                ?>
">
					

					<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<a class="videogroup<?php 
                            echo $videogalleryID;
                            ?>
" href="<?php 
                            echo $imgurl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
"><img class="main-image" src="<?php 
                            echo $imgurl[0];
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" /></a>
							<?php 
                        } else {
                            ?>
							<img class="main-image" src="images/noimage.jpg" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />
							<?php 
                        }
                        ?>

						<?php 
                        break;
                    case 'video':
                        ?>
						<?php 
                        $videourl = get_video_gallery_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            if (empty($row->thumb_url)) {
                                $thumb_pic = 'http://img.youtube.com/vi/' . $videourl[0] . '/mqdefault.jpg';
                            } else {
                                $thumb_pic = $row->thumb_url;
                            }
                            ?>
								<a class="youtube huge_it_videogallery_item"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
									<img src="<?php 
                            echo $thumb_pic;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>								
							<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            if (empty($row->thumb_url)) {
                                $imgsrc = $hash[0]['thumbnail_large'];
                            } else {
                                $imgsrc = $row->thumb_url;
                            }
                            ?>
								<a class="vimeo huge_it_videogallery_item" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
									<img src="<?php 
                            echo $imgsrc;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>
							<?php 
                        }
                        ?>
				<?php 
                        break;
                }
                ?>
	
				</div>
				<div class="right-block">
					<div><h2 class="title"><?php 
                echo str_replace('__5_5_5__', '%', $row->name);
                ?>
</h2></div>
					<?php 
                if ($paramssld["ht_view5_show_description"] == 'on') {
                    ?>
<div class="description"><?php 
                    echo str_replace('__5_5_5__', '%', $row->description);
                    ?>
</div><?php 
                }
                ?>
					<?php 
                if ($paramssld["ht_view5_show_linkbutton"] == 'on') {
                    ?>
						<div class="button-block">
							<a href="<?php 
                    echo $link;
                    ?>
"  <?php 
                    if ($row->link_target == "on") {
                        echo 'target="_blank"';
                    }
                    ?>
><?php 
                    echo $paramssld["ht_view5_linkbutton_text"];
                    ?>
</a>
						</div>
					<?php 
                }
                ?>
				</div>
			</div>
		</div>
		<?php 
            }
            ?>
</div>
  <script src="<?php 
            echo plugins_url('../js/jquery.liquid-slider.min.js', __FILE__);
            ?>
"></script>  
   <script>
	
   
    /**
     * If you need to access the internal property or methods, use this:
     * var api = $.data( jQuery('#main-slider_<?php 
            echo $videogalleryID;
            ?>
')[0], 'liquidSlider');
     * console.log(api);
     */
	 jQuery('#main-slider_<?php 
            echo $videogalleryID;
            ?>
').liquidSlider();
  </script>
<?php 
            break;
            /////////////////////////////// VIEW 2 Lightbox videogallery /////////////////////////////
        /////////////////////////////// VIEW 2 Lightbox videogallery /////////////////////////////
        case 5:
            ?>

<style type="text/css"> 

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 {
	width: 100%;
	max-width:<?php 
            echo $paramssld['ht_view6_width'];
            ?>
px;
	margin:0px 0px 10px 0px;
	border:<?php 
            echo $paramssld['ht_view6_border_width'];
            ?>
px solid #<?php 
            echo $paramssld['ht_view6_border_color'];
            ?>
;
	border-radius:<?php 
            echo $paramssld['ht_view6_border_radius'];
            ?>
px;
	outline:none;
	overflow:hidden;
}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 {
	position:relative;
	width: 100%;
	max-width:<?php 
            echo $paramssld['ht_view6_width'];
            ?>
px;
}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 a {display:block;}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 img {
	width:<?php 
            echo $paramssld['ht_view6_width'];
            ?>
px !important;
	height:auto;
	display:block;
	border-radius: 0px !important;
	box-shadow: 0 0px 0px rgba(0, 0, 0, 0) !important; 
}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 img:hover {
	cursor: -webkit-zoom-in; cursor: -moz-zoom-in;
}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 .play-icon {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height:100%;	
	
}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
  .play-icon.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
  .play-icon.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}


.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 {
	position:absolute;
	text-overflow: ellipsis;
	overflow: hidden; 	
	left:0px;
	width:100%;
	height:30px;
	bottom:-35px;
	color:#<?php 
            echo $paramssld["ht_view6_title_font_color"];
            ?>
;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view6_title_background_color'], 2));
            $titleopacity = $paramssld["ht_view6_title_background_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
	 -webkit-transition: bottom 0.3s ease-out 0.1s;
     -moz-transition: bottom 0.3s ease-out 0.1s;
     -o-transition: bottom 0.3s ease-out 0.1s;
     transition: bottom 0.3s ease-out 0.1s;
}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
:hover .title-block_<?php 
            echo $videogalleryID;
            ?>
 {bottom:0px;}

.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a, .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:link, .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:visited {
	position:relative;
	margin:0px;
	padding:0px 1% 0px 2%;
	width:97%;
	text-decoration:none;
	text-overflow: ellipsis;
	overflow: hidden; 
	white-space:nowrap;
	z-index:20;
	font-size: <?php 
            echo $paramssld["ht_view6_title_font_size"];
            ?>
px;
	color:#<?php 
            echo $paramssld["ht_view6_title_font_color"];
            ?>
;
	font-weight:normal;
}



.videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:hover, .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:focus, .videoelement_<?php 
            echo $videogalleryID;
            ?>
 .title-block_<?php 
            echo $videogalleryID;
            ?>
 a:active {
	color:#<?php 
            echo $paramssld["ht_view6_title_font_hover_color"];
            ?>
;
	text-decoration:none;
}
.load_more4 {
		margin: 10px 0;
		position:relative;
		text-align:<?php 
            if ($paramssld['video_ht_view4_loadmore_position'] == 'left') {
                echo 'left';
            } elseif ($paramssld['video_ht_view4_loadmore_position'] == 'center') {
                echo 'center';
            } elseif ($paramssld['video_ht_view4_loadmore_position'] == 'right') {
                echo 'right';
            }
            ?>
;

		width:100%;


	}
.entry-content a{
	border-bottom: none;
}
	.load_more_button4 {
		border-radius: 10px;
		display:inline-block;
		padding:5px 15px;
		font-size:<?php 
            echo $paramssld['video_ht_view4_loadmore_fontsize'];
            ?>
px !important;;
		color:<?php 
            echo '#' . $paramssld['video_ht_view4_loadmore_font_color'];
            ?>
 !important;;
		background:<?php 
            echo '#' . $paramssld['video_ht_view4_button_color'];
            ?>
 !important;
		cursor:pointer;

	}
	.load_more_button4:hover{
		color:<?php 
            echo '#' . $paramssld['video_ht_view4_loadmore_font_color_hover'];
            ?>
 !important;
		background:<?php 
            echo '#' . $paramssld['video_ht_view4_button_color_hover'];
            ?>
 !important;
	}

	.loading4 {
		display:none;
	}
	.paginate4{
		font-size:<?php 
            echo $paramssld['video_ht_view4_paginator_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view4_paginator_color'];
            ?>
 !important;
		text-align: <?php 
            echo $paramssld['video_ht_view4_paginator_position'];
            ?>
;
		margin-top: 25px;
	}
	.paginate4 a{
		border-bottom: none !important;
	}
	.icon-style4{
		font-size: <?php 
            echo $paramssld['video_ht_view4_paginator_icon_size'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view4_paginator_icon_color'];
            ?>
 !important;
	}
	.clear{
		clear:both;
	}

</style>
<section id="huge_it_videogallery_content_<?php 
            echo $videogalleryID;
            ?>
">
  <div id="huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
" class="super-list variable-sizes clearfix">
  	<input type="hidden" class="pagenum" value="1" />
  	<?php 
            foreach ($images as $image) {
                $idofgallery = $image->videogallery_id;
                //print_r($image);
            }
            global $wpdb;
            $pattern = '/-/';
            $query2 = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_galleries where id = '%d' order by ordering ASC ", $idofgallery);
            $gallery = $wpdb->get_results($query2);
            foreach ($gallery as $gall) {
                global $post;
                $pID = $post->ID;
                $disp_type = $gall->display_type;
                $count_page = $gall->content_per_page;
                if ($count_page == 0) {
                    $count_page = 999;
                } elseif (preg_match($pattern, $count_page)) {
                    $count_page = preg_replace($pattern, '', $count_page);
                }
                //var_dump($count_page) ;
            }
            global $wpdb;
            $num = $count_page;
            //$total = count($images) ;
            $total = intval((count($images) - 1) / $num + 1);
            //$total_img=count($images);
            if (isset($_GET['page-img' . $videogalleryID . $pID])) {
                $page = $_GET['page-img' . $videogalleryID . $pID];
            } else {
                $page = '';
            }
            $page = intval($page);
            if (empty($page) or $page < 0) {
                $page = 1;
            }
            if ($page > $total) {
                $page = $total;
            }
            $start = $page * $num - $num;
            $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_videos where videogallery_id = '%d' order by ordering ASC LIMIT " . $start . "," . $num . "", $idofgallery);
            $page_images = $wpdb->get_results($query);
            if ($disp_type == 2) {
                $page_images = $images;
                $count_page = 9999;
            }
            ?>
			<input type="hidden" id="total" value="<?php 
            echo $total;
            ?>
" />
  	<?php 
            foreach ($page_images as $key => $row) {
                $link = str_replace('__5_5_5__', '%', $row->sl_url);
                $descnohtml = strip_tags(str_replace('__5_5_5__', '%', $row->description));
                $result = substr($descnohtml, 0, 50);
                ?>
		<div class="videoelement_<?php 
                echo $videogalleryID;
                ?>
" tabindex="0" data-symbol="<?php 
                echo str_replace('__5_5_5__', '%', $row->name);
                ?>
" data-category="alkaline-earth">
			<div class="image-block_<?php 
                echo $videogalleryID;
                ?>
">
				<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        $imgurl = explode(";", $row->image_url);
                        ?>
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<a href="<?php 
                            echo $imgurl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
"><img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" /></a>
							<?php 
                        } else {
                            ?>
							<img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg" alt="" />
							<?php 
                        }
                        ?>

				<?php 
                        break;
                    case 'video':
                        ?>
						<?php 
                        $videourl = get_video_gallery_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            if (empty($row->thumb_url)) {
                                $thumb_pic = 'http://img.youtube.com/vi/' . $videourl[0] . '/mqdefault.jpg';
                            } else {
                                $thumb_pic = $row->thumb_url;
                            }
                            ?>
								<a class="youtube huge_it_videogallery_item videogroup<?php 
                            echo $videogalleryID;
                            ?>
"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
									<img src="<?php 
                            echo $thumb_pic;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>								
							<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            if (empty($row->thumb_url)) {
                                $imgsrc = $hash[0]['thumbnail_large'];
                            } else {
                                $imgsrc = $row->thumb_url;
                            }
                            ?>
								<a class="vimeo huge_it_videogallery_item videogroup<?php 
                            echo $videogalleryID;
                            ?>
" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
									<img src="<?php 
                            echo $imgsrc;
                            ?>
" alt="" />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>
							<?php 
                        }
                        ?>
				<?php 
                        break;
                }
                ?>
			</div>
			<?php 
                if ($row->name != "") {
                    ?>
			<div class="title-block_<?php 
                    echo $videogalleryID;
                    ?>
">
				<a href="<?php 
                    echo $link;
                    ?>
" <?php 
                    if ($row->link_target == "on") {
                        echo 'target="_blank"';
                    }
                    ?>
><?php 
                    echo str_replace('__5_5_5__', '%', $row->name);
                    ?>
</a>
			</div>
			<?php 
                }
                ?>
		</div>	
		<?php 
            }
            ?>
	<!-- <div style="clear:both;"></div> -->
  </div>

<?php 
            $path_site = plugins_url("/../Front_images", __FILE__);
            $a = $disp_type;
            if ($a == 1) {
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                $pattern3 = "/\\?page-img[0-9]+=[0-9]+/";
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                        header("Location:" . $actual_link . "");
                        exit;
                    }
                } elseif (preg_match($pattern3, $actual_link)) {
                    $actual_link = preg_replace($pattern3, '', $actual_link);
                    header("Location:" . $actual_link . "");
                    exit;
                }
                ?>
				<div class="load_more4">
					<div class="load_more_button4"><?php 
                echo $paramssld['video_ht_view4_loadmore_text'];
                ?>
</div>
					<div class="loading4"><img src="<?php 
                if ($paramssld['video_ht_view4_loading_type'] == '1') {
                    echo $path_site . '/arrows/loading1.gif';
                } elseif ($paramssld['video_ht_view4_loading_type'] == '2') {
                    echo $path_site . '/arrows/loading4.gif';
                } elseif ($paramssld['video_ht_view4_loading_type'] == '3') {
                    echo $path_site . '/arrows/loading36.gif';
                } elseif ($paramssld['video_ht_view4_loading_type'] == '4') {
                    echo $path_site . '/arrows/loading51.gif';
                }
                ?>
"></div>
					<script>
						jQuery(document).ready(function(){
							if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4").length){
								jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4").on("click tap",function(){

									if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()<jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
										
										var pagenum = parseInt(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()) + 1;
										var perpage =<?php 
                echo $count_page;
                ?>
;
										var galleryid="<?php 
                echo $image->videogallery_id;
                ?>
";
										var thumbtext="<?php 
                echo $paramssld["thumb_view_text"];
                ?>
";
										var width="<?php 
                echo $paramssld['video_ht_view9_video_width'];
                ?>
";
										var height="<?php 
                echo $paramssld['video_ht_view9_video_height'];
                ?>
";
										//alert(pagenum+','+perpage+','+galleryid+','+width+','+height);
										getresult(pagenum,perpage,galleryid,thumbtext,width,height);
									}else{
										jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4').hide();
									}
									return false;
								});
							}
											if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4').hide();
											}
							function getresult(pagenum,perpage,galleryid,thumbtext,width,height){
								var data = {
										action:"huge_it_video_gallery_ajax",
										task:'load_videos_lightbox',
										page:pagenum,
										perpage:perpage,
										galleryid:galleryid,
										thumbtext:thumbtext,
										width:width,
										height:height
								}
								jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .loading4').show();
								
								jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4').hide();

								jQuery.post('<?php 
                echo admin_url("admin-ajax.php");
                ?>
',data,function(response){
									if(response.success){
											//alert(response.success);
										var $objnewitems= jQuery(response.success);										
											jQuery('#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
').append( $objnewitems ).hugeitmicro({ sortBy: 'original-order' }) .hugeitmicro( 'reLayout' ).hugeitmicro( 'reloadItems' );
										jQuery('#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 img').on('load',function(){
											jQuery('#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
').hugeitmicro({ sortBy: 'original-order' }) .hugeitmicro( 'reLayout' ).hugeitmicro( 'reloadItems' );
											//############# Hakob
											
											//############# End
											
											
											jQuery(".videogroup<?php 
                echo $videogalleryID;
                ?>
").colorbox({rel:'videogroup<?php 
                echo $videogalleryID;
                ?>
'});
											jQuery(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".vimeo").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
											jQuery(".inline").colorbox({inline:true, width:"50%"});
											jQuery(".callbacks").colorbox({
												onOpen:function(){ alert('onOpen: colorbox is about to open'); },
												onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
												onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
												onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
												onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
											});

											jQuery('.non-retina').colorbox({rel:'group5', transition:'none'})
											jQuery('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
											var defaultBlockWidth=<?php 
                echo $paramssld['ht_view6_width'];
                ?>
+20+<?php 
                echo $paramssld['ht_view6_width'] * 2;
                ?>
;
    										

  
											jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4').show();
											jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .loading4').hide();
											
											if(jQuery("#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#huge_it_videogallery_container_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#huge_it_videogallery_content_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button4').hide();
											}
										});
										

									}else{
										alert("no");
									}
								},"json");
							}

						});
					</script>
				</div>
				<?php 
            } elseif ($a == 0) {
                ?>
			<div class="paginate4">
			<?php 
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $checkREQ = '';
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                //$res=preg_match($pattern, $actual_link);
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                    }
                    $checkREQ = $actual_link . '&page-img' . $videogalleryID . $pID;
                } else {
                    $checkREQ = '?page-img' . $videogalleryID . $pID;
                }
                //var_dump($res);
                // Проверяем нужны ли стрелки назад
                $pervpage = '';
                if ($page != 1) {
                    $pervpage = '<a href= ' . $checkREQ . '=1><i class="icon-style4 hugeiticons-fast-backward" ></i></a>  
			                               <a href= ' . $checkREQ . '=' . ($page - 1) . '><i class="icon-style4 hugeiticons-chevron-left"></i></a> ';
                }
                // Проверяем нужны ли стрелки вперед
                $nextpage = '';
                if ($page != $total) {
                    $nextpage = ' <a href= ' . $checkREQ . '=' . ($page + 1) . '><i class="icon-style4 hugeiticons-chevron-right"></i></a>  
			                                   <a href= ' . $checkREQ . '=' . $total . '><i class="icon-style4 hugeiticons-fast-forward" ></i></a>';
                }
                // Вывод меню
                echo $pervpage . $page . '/' . $total . $nextpage;
                ?>
</div>
<?php 
            }
            ?>
</section>

<script> 
 jQuery(function(){
	var defaultBlockWidth=<?php 
            echo $paramssld['ht_view6_width'];
            ?>
+20+<?php 
            echo $paramssld['ht_view6_width'] * 2;
            ?>
;
    var $container = jQuery('#huge_it_videogallery_container_<?php 
            echo $videogalleryID;
            ?>
');
    
    
      // add randomish size classes
      $container.find('.videoelement_<?php 
            echo $videogalleryID;
            ?>
').each(function(){
        var $this = jQuery(this),
            number = parseInt( $this.find('.number').text(), 10 );
			//alert(number);
        if ( number % 7 % 2 === 1 ) {
          $this.addClass('width2');
        }
        if ( number % 3 === 0 ) {
          $this.addClass('height2');
        }
      });
    
$container.hugeitmicro({
  itemSelector : '.videoelement_<?php 
            echo $videogalleryID;
            ?>
',
  masonry : {
	columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
+10+<?php 
            echo $paramssld['ht_view6_border_width'] * 2;
            ?>
  },
  masonryHorizontal : {
	rowHeight: 'auto'
  },
  cellsByRow : {
	columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
,
	rowHeight : 'auto'
  },
  cellsByColumn : {
	columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
,
	rowHeight : 'auto'
  },
  getSortData : {
	symbol : function( $elem ) {
	  return $elem.attr('data-symbol');
	},
	category : function( $elem ) {
	  return $elem.attr('data-category');
	},
	number : function( $elem ) {
	  return parseInt( $elem.find('.number').text(), 10 );
	},
	weight : function( $elem ) {
	  return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
	},
	name : function ( $elem ) {
	  return $elem.find('.name').text();
	}
  }
});
 reSortImages();	  //add hugitmicro function
   	  function reSortImages() { 
		$container.hugeitmicro({
		  itemSelector : '.videoelement_<?php 
            echo $videogalleryID;
            ?>
',
		  masonry : {
			columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
+10+<?php 
            echo $paramssld['ht_view6_border_width'] * 2;
            ?>
		  },
		  masonryHorizontal : {
			rowHeight: 'auto'
		  },
		  cellsByRow : {
			columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
,
			rowHeight : 'auto'
		  },
		  cellsByColumn : {
			columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
,
			rowHeight : 'auto'
		  },
		  getSortData : {
			symbol : function( $elem ) {
			  return $elem.attr('data-symbol');
			},
			category : function( $elem ) {
			  return $elem.attr('data-category');
			},
			number : function( $elem ) {
			  return parseInt( $elem.find('.number').text(), 10 );
			},
			weight : function( $elem ) {
			  return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
			},
			name : function ( $elem ) {
			  return $elem.find('.name').text();
			}
		  }
		});
} 
jQuery(window).resize(function(){
	reSortImages(); // add
});    
    
      var $optionSets = jQuery('#huge_it_videogallery_options .option-set'),
          $optionLinks = $optionSets.find('a');

      $optionLinks.click(function(){
        var $this = jQuery(this);

        if ( $this.hasClass('selected') ) {
          return false;
        }
        var $optionSet = $this.parents('.option-set');
        $optionSet.find('.selected').removeClass('selected');
        $this.addClass('selected');
  

        var options = {},
            key = $optionSet.attr('data-option-key'),
            value = $this.attr('data-option-value');

        value = value === 'false' ? false : value;
        options[ key ] = value;
        if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {

          changeLayoutMode( $this, options )
        } else {

          $container.hugeitmicro( options );
        }
        
        return false;
      });


    

      var isHorizontal = false;
      function changeLayoutMode( $link, options ) {
        var wasHorizontal = isHorizontal;
        isHorizontal = $link.hasClass('horizontal');

        if ( wasHorizontal !== isHorizontal ) {

          var style = isHorizontal ? 
            { height: '100%', width: $container.width() } : 
            { width: 'auto' };

          $container.filter(':animated').stop();

          $container.addClass('no-transition').css( style );
          setTimeout(function(){
            $container.removeClass('no-transition').hugeitmicro( options );
          }, 100 )
        } else {
          $container.hugeitmicro( options );
        }
      }
     
    var $sortBy = jQuery('#sort-by');
    jQuery('#shuffle a').click(function(){
      $container.hugeitmicro('shuffle');
      $sortBy.find('.selected').removeClass('selected');
      $sortBy.find('[data-option-value="random"]').addClass('selected');
      return false;
    });

	  jQuery(window).load(function(){
		$container.hugeitmicro('reLayout');
	  });
  });
  

</script>
<?php 
            break;
            /////////////////////////////// VIEW 3 videogallery Huge IT Slider /////////////////////////////
        /////////////////////////////// VIEW 3 videogallery Huge IT Slider /////////////////////////////
        case 3:
            $sliderID = $videogallery[0]->id;
            $slidertitle = $videogallery[0]->name;
            $sliderheight = $videogallery[0]->sl_height;
            $sliderwidth = $videogallery[0]->sl_width;
            $slidereffect = $videogallery[0]->videogallery_list_effects_s;
            $slidepausetime = $videogallery[0]->description + $videogallery[0]->param;
            $sliderpauseonhover = $videogallery[0]->pause_on_hover;
            $sliderposition = $videogallery[0]->sl_position;
            $slidechangespeed = $videogallery[0]->param;
            $trim_slider_title_position = trim($paramssld['slider_title_position']);
            $slideshow_title_position = explode('-', $trim_slider_title_position);
            $trim_slider_description_position = trim($paramssld['slider_description_position']);
            $slideshow_description_position = explode('-', $trim_slider_description_position);
            $hasyoutube = false;
            $hasvimeo = false;
            foreach ($images as $key => $image_row) {
                if (strpos($image_row->image_url, 'youtu') !== false) {
                    $hasyoutube = true;
                }
                if (strpos($image_row->image_url, 'vimeo') !== false) {
                    $hasvimeo = true;
                }
            }
            ?>
<script>var video_is_playing_videogallery_<?php 
            echo $sliderID;
            ?>
=false;</script>
<?php 
            if ($hasvimeo == true) {
                ?>
<script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
jQuery(function(){
	
	var vimeoPlayer = document.querySelector('iframe');
		
	jQuery('iframe').each(function(){
				Froogaloop(this).addEvent('ready', ready);
	});

	jQuery(".sidedock,.controls").remove();
	function ready(player_id) {
	
		froogaloop = $f(player_id);
	
		function setupEventListeners() {
			function onPlay() {
				froogaloop.addEvent('play',
				function(){
					video_is_playing_videogallery_<?php 
                echo $sliderID;
                ?>
=true;
				});
			}
			function onPause() {
				froogaloop.addEvent('pause',
				function(){
					video_is_playing_videogallery_<?php 
                echo $sliderID;
                ?>
=false;
				});
			}					
			function stopVimeoVideo(player){
				Froogaloop(player).api('pause');
			}
			
			onPlay();
			onPause();
			jQuery('#huge_it_slideshow_left_videogallery_<?php 
                echo $sliderID;
                ?>
, #huge_it_slideshow_right_videogallery_<?php 
                echo $sliderID;
                ?>
,.huge_it_slideshow_dots_videogallery_<?php 
                echo $sliderID;
                ?>
').click(function(){
				stopVimeoVideo(player_id);
			});
		}
		setupEventListeners();
	}
});		
</script>
<?php 
            }
            ?>

<?php 
            if ($hasyoutube == true) {
                ?>

<script src="<?php 
                echo plugins_url('js/youtube.lib.js', __FILE__);
                ?>
"></script>
<script> 
  <?php 
                if (!function_exists('get_youtube_id_from_url')) {
                    function get_youtube_id_from_url($url)
                    {
                        if (stristr($url, 'youtu.be/')) {
                            preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $final_ID);
                            return $final_ID[4];
                        } else {
                            preg_match('/(https:|http:|):(\\/\\/www\\.|\\/\\/|)(.*?)\\/(embed\\/|watch\\?v=|(.*?)&v=|v\\/|e\\/|.+\\/|watch.*v=|)([a-z_A-Z0-9]{11})/i', $url, $IDD);
                            /*var_dump($IDD);*/
                            return $IDD[6];
                        }
                    }
                }
                $i = 0;
                foreach ($images as $key => $image_row) {
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtu') !== false) {
                        ?>
 
		var player_<?php 
                        echo $image_row->id;
                        ?>
;
<?php 
                    } else {
                        if (strpos($image_row->image_url, 'vimeo') !== false) {
                            ?>
				
<?php 
                        } else {
                            continue;
                        }
                    }
                    $i++;
                }
                ?>
		video_is_playing_videogallery_<?php 
                echo $sliderID;
                ?>
=false;
		function onYouTubeIframeAPIReady() {
			<?php 
                foreach ($images as $key => $image_row) {
                    ?>
							
				<?php 
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtu') !== false) {
                        ?>
 
				player_<?php 
                        echo $image_row->id;
                        ?>
 = new YT.Player('video_id_videogallery_<?php 
                        echo $sliderID;
                        ?>
_<?php 
                        echo $key;
                        ?>
', {
				  height: '<?php 
                        echo $sliderheight;
                        ?>
',
				  width: '<?php 
                        echo $sliderwidth;
                        ?>
',
				  videoId: '<?php 
                        echo get_youtube_id_from_url($image_row->image_url);
                        ?>
',
				   playerVars: {
					'controls': <?php 
                        if ($images[$key]->sl_url == "on") {
                            echo 1;
                        } else {
                            echo 0;
                        }
                        ?>
,           
					'showinfo': <?php 
                        if ($images[$key]->link_target == "on") {
                            echo 1;
                        } else {
                            echo 0;
                        }
                        ?>
				  },
				  events: {
					'onStateChange': onPlayerStateChange_<?php 
                        echo $image_row->id;
                        ?>
,
					'loop':1
				  }
				});
			<?php 
                    } else {
                        continue;
                    }
                }
                ?>
		}
		
		
<?php 
                foreach ($images as $key => $image_row) {
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtu') !== false) {
                        ?>
		 function onPlayerStateChange_<?php 
                        echo $image_row->id;
                        ?>
(event) {
			//(event.data);
                        <?php 
                        $images[$key]->name = htmlspecialchars($images[$key]->name, ENT_QUOTES);
                        ?>
			if (event.data == YT.PlayerState.PLAYING) {
				event.target.setPlaybackQuality('<?php 
                        echo $images[$key]->name;
                        ?>
');
				video_is_playing_videogallery_<?php 
                        echo $sliderID;
                        ?>
=true;
			}
			else{
				video_is_playing_videogallery_<?php 
                        echo $sliderID;
                        ?>
=false;
			}
		  }
<?php 
                    } else {
                        continue;
                    }
                }
                ?>
	function stopYoutubeVideo() {
		<?php 
                $i = 0;
                foreach ($images as $key => $image_row) {
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtu') !== false) {
                        ?>
			player_<?php 
                        echo $image_row->id;
                        ?>
.pauseVideo();
		<?php 
                    } else {
                        continue;
                    }
                    $i++;
                }
                ?>
	}

</script>
<?php 
            }
            ?>
	
	
	<script>
	var data_videogallery_<?php 
            echo $sliderID;
            ?>
 = [];      
	var event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
 = [];
	<?php 
            //	$images=array_reverse($images);
            //$recent_posts = wp_get_recent_posts( $args, ARRAY_A );
            $i = 0;
            foreach ($images as $image) {
                $imagerowstype = $image->sl_type;
                if ($image->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]=[];';
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                        $strdesription = str_replace('"', "'", $image->description);
                        $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                        $stralt = str_replace('"', "'", $image->name);
                        $stralt = preg_replace("/\r|\n/", " ", $stralt);
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                        $i++;
                        break;
                    case 'video':
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]=[];';
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                        $strdesription = str_replace('"', "'", $image->description);
                        $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                        $stralt = str_replace('"', "'", $image->name);
                        $stralt = preg_replace("/\r|\n/", " ", $stralt);
                        echo 'data_videogallery_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                        $i++;
                        break;
                        /*case 'last_posts':
                        					
                        					foreach($recent_posts as $keyl => $recentimage){
                        					if(get_the_post_thumbnail($recentimage["ID"], 'thumbnail') != ''){
                        						if($keyl < $image->sl_url){
                        						echo 'data_videogallery_'.$sliderID.'["'.$i.'"]=[];';
                        						echo 'data_videogallery_'.$sliderID.'["'.$i.'"]["id"]="'.$i.'";';
                        						echo 'data_videogallery_'.$sliderID.'["'.$i.'"]["image_url"]="'.$recentimage['guid'].'";';
                        						
                        						
                        						$strdesription=str_replace('"',"'",$recentimage['post_content']);
                        						$strdesription=preg_replace( "/\r|\n/", " ", $strdesription );
                        						$strdesription=substr_replace($strdesription, "",$image->description);
                        						echo 'data_videogallery_'.$sliderID.'["'.$i.'"]["description"]="'.$strdesription.'";';
                        
                        						
                        						$stralt=str_replace('"',"'",$recentimage['post_title']);
                        						$stralt=preg_replace( "/\r|\n/", " ", $stralt );
                        						echo 'data_videogallery_'.$sliderID.'["'.$i.'"]["alt"]="'.$stralt.'";';
                        						$i++;
                        						}
                        					}
                        					}
                        					
                        					break;
                        					*/
                }
            }
            ?>
	
	

      var huge_it_trans_in_progress_videogallery_<?php 
            echo $sliderID;
            ?>
 = false;
      var huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
 = <?php 
            echo $slidechangespeed;
            ?>
;
	  var huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
;
      // Stop autoplay.
      window.clearInterval(huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
);
	 // alert('huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
');
     var huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 = '<?php 
            echo isset($current_key) ? $current_key : '';
            ?>
';
	 function huge_it_move_dots_videogallery_<?php 
            echo $sliderID;
            ?>
() {
        var image_left = jQuery(".huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").position().left;
        var image_right = jQuery(".huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").position().left + jQuery(".huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").outerWidth(true);
       
      }
      function huge_it_testBrowser_cssTransitions_videogallery_<?php 
            echo $sliderID;
            ?>
() {
        return huge_it_testDom_videogallery_<?php 
            echo $sliderID;
            ?>
('Transition');
      }
      function huge_it_testBrowser_cssTransforms3d_videogallery_<?php 
            echo $sliderID;
            ?>
() {
        return huge_it_testDom_videogallery_<?php 
            echo $sliderID;
            ?>
('Perspective');
      }
      function huge_it_testDom_videogallery_<?php 
            echo $sliderID;
            ?>
(prop) {
        // Browser vendor CSS prefixes.
        var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
        // Browser vendor DOM prefixes.
        var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
        var i = domPrefixes.length;
        while (i--) {
          if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
            return true;
          }
        }
        return false;
      }
		function huge_it_cube_videogallery_<?php 
            echo $sliderID;
            ?>
(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
        /* If browser does not support 3d transforms/CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_videogallery_<?php 
            echo $sliderID;
            ?>
()) {
			jQuery(".huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 + "_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
");
          return huge_it_fallback_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
        }
        if (!huge_it_testBrowser_cssTransforms3d_videogallery_<?php 
            echo $sliderID;
            ?>
()) {
          return huge_it_fallback3d_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
        }
        huge_it_trans_in_progress_videogallery_<?php 
            echo $sliderID;
            ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
");  
		jQuery("#huge_it_dots_" + huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 + "_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery(".huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
").css('perspective', 1000);
        jQuery(current_image_class).css({
          transform : 'translateZ(' + tz + 'px)',
          backfaceVisibility : 'hidden'
        });
		
		 jQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_second_item_videogallery_<?php 
            echo $sliderID;
            ?>
 ").css('overflow', 'visible');
		
        jQuery(next_image_class).css({
          opacity : 1,
          filter: 'Alpha(opacity=100)',
          backfaceVisibility : 'hidden',
          transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
        });
        jQuery(".huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
").css({
          transform: 'translateZ(-' + tz + 'px)',
          transformStyle: 'preserve-3d'
        });
        /* Execution steps.*/
        setTimeout(function () {
          jQuery(".huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
").css({
            transition: 'all ' + huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
 + 'ms ease-in-out',
            transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
          });
        }, 20);
        /* After transition.*/
        jQuery(".huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          /*if (huge_it_from_focus_videogallery_<?php 
            echo $sliderID;
            ?>
) {
            huge_it_from_focus_videogallery_<?php 
            echo $sliderID;
            ?>
 = false;
            return;
          }*/
		  jQuery(".huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_second_item_videogallery_<?php 
            echo $sliderID;
            ?>
 ").css('overflow', 'hidden');
		  jQuery(".huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
").removeAttr('style');
          jQuery(current_image_class).removeAttr('style');
          jQuery(next_image_class).removeAttr('style');
          jQuery(".huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
").removeAttr('style');
          jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
         // huge_it_change_watermark_container_videogallery_<?php 
            echo $sliderID;
            ?>
();
          huge_it_trans_in_progress_videogallery_<?php 
            echo $sliderID;
            ?>
 = false;
          if (typeof event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
 !== 'undefined' && event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
.length > 0) {
            key = event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
[0].split("-");
            event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
.shift();
            huge_it_change_image_videogallery_<?php 
            echo $sliderID;
            ?>
(key[0], key[1], data_videogallery_<?php 
            echo $sliderID;
            ?>
, true,false);
          }
        }
      }
      function huge_it_cubeH_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image width.*/
        var dimension = jQuery(current_image_class).width() / 2;
        if (direction == 'right') {
          huge_it_cube_videogallery_<?php 
            echo $sliderID;
            ?>
(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_videogallery_<?php 
            echo $sliderID;
            ?>
(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
        }
      }
      function huge_it_cubeV_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image height.*/
        var dimension = jQuery(current_image_class).height() / 2;
        /* If next slide.*/
        if (direction == 'right') {
          huge_it_cube_videogallery_<?php 
            echo $sliderID;
            ?>
(dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_videogallery_<?php 
            echo $sliderID;
            ?>
(dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction);
        }
      }
      /* For browsers that does not support transitions.*/
      function huge_it_fallback_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_fade_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
      }
      /* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
      function huge_it_fallback3d_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_sliceV_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
      }
      function huge_it_none_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
        jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});

        /* Set active thumbnail.*/
        jQuery(".huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 + "_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
");
      }
      function huge_it_fade_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
		if (huge_it_testBrowser_cssTransitions_videogallery_<?php 
            echo $sliderID;
            ?>
()) {
          jQuery(next_image_class).css('transition', 'opacity ' + huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
 + 'ms linear');
		  jQuery(current_image_class).css('transition', 'opacity ' + huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
 + 'ms linear');
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
        }
        else {
          jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
);
          jQuery(next_image_class).animate({
              'opacity' : 1,
              'z-index': 2
            }, {
              duration: huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
,
              complete: function () {return false;}
            });
          // For IE.
          jQuery(current_image_class).fadeTo(huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
, 0);
          jQuery(next_image_class).fadeTo(huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
, 1);
        }

		jQuery(".huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
");
		jQuery("#huge_it_dots_" + huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 + "_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
");
      }
      function huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
        /* If browser does not support CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_videogallery_<?php 
            echo $sliderID;
            ?>
()) {
			jQuery(".huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 + "_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
");
          return huge_it_fallback_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
		  
        }
        huge_it_trans_in_progress_videogallery_<?php 
            echo $sliderID;
            ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 + "_videogallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
");
        /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
        var count = (huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
) / (cols + rows);
        /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
        function huge_it_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
          var delay = (c + r) * count;
          /* Return a gridlet elem with styles for specific transition.*/
          return jQuery('<div class="huge_it_gridlet_videogallery_<?php 
            echo $sliderID;
            ?>
" />').css({
            width : width,
            height : height,
            top : top,
            left : left,
            backgroundImage : 'url("' + src + '")',
            backgroundColor: jQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").css("background-color"),
            /*backgroundColor: rgba(0, 0, 0, 0),*/
            backgroundRepeat: 'no-repeat',
            backgroundPosition : img_left + 'px ' + img_top + 'px',
            backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
            transition : 'all ' + huge_it_transition_duration_videogallery_<?php 
            echo $sliderID;
            ?>
 + 'ms ease-in-out ' + delay + 'ms',
            transform : 'none'
          });
        }
        /* Get the current slide's image.*/
        var cur_img = jQuery(current_image_class).find('img');
        /* Create a grid to hold the gridlets.*/
        var grid = jQuery('<div />').addClass('huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
');
        /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
        jQuery(current_image_class).prepend(grid);
        /* vars to calculate positioning/size of gridlets*/
        var cont = jQuery(".huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
");
        var imgWidth = cur_img.width();
        var imgHeight = cur_img.height();
        var contWidth = cont.width(),
            contHeight = cont.height(),
            imgSrc = cur_img.attr('src'),/*.replace('/thumb', ''),*/
            colWidth = Math.floor(contWidth / cols),
            rowHeight = Math.floor(contHeight / rows),
            colRemainder = contWidth - (cols * colWidth),
            colAdd = Math.ceil(colRemainder / cols),
            rowRemainder = contHeight - (rows * rowHeight),
            rowAdd = Math.ceil(rowRemainder / rows),
            leftDist = 0,
            img_leftDist = (jQuery(".huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
").width() - cur_img.width()) / 2;
        /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
        tx = tx === 'auto' ? contWidth : tx;
        tx = tx === 'min-auto' ? - contWidth : tx;
        ty = ty === 'auto' ? contHeight : ty;
        ty = ty === 'min-auto' ? - contHeight : ty;
        /* Loop through cols*/
        for (var i = 0; i < cols; i++) {
          var topDist = 0,
              img_topDst = (jQuery(".huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
").height() - cur_img.height()) / 2,
              newColWidth = colWidth;
          /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
          if (colRemainder > 0) {
            var add = colRemainder >= colAdd ? colAdd : colRemainder;
            newColWidth += add;
            colRemainder -= add;
          }
          /* Nested loop to create row gridlets for each col.*/
          for (var j = 0; j < rows; j++)  {
            var newRowHeight = rowHeight,
                newRowRemainder = rowRemainder;
            /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
            if (newRowRemainder > 0) {
              add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
              newRowHeight += add;
              newRowRemainder -= add;
            }
            /* Create & append gridlet to grid.*/
            grid.append(huge_it_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
            topDist += newRowHeight;
            img_topDst -= newRowHeight;
          }
          img_leftDist -= newColWidth;
          leftDist += newColWidth;
        }
        /* Set event listener on last gridlet to finish transitioning.*/
        var last_gridlet = grid.children().last();
        /* Show grid & hide the image it replaces.*/
        grid.show();
        cur_img.css('opacity', 0);
        /* Add identifying classes to corner gridlets (useful if applying border radius).*/
        grid.children().first().addClass('rs-top-left');
        grid.children().last().addClass('rs-bottom-right');
        grid.children().eq(rows - 1).addClass('rs-bottom-left');
        grid.children().eq(- rows).addClass('rs-top-right');
        /* Execution steps.*/
        setTimeout(function () {
          grid.children().css({
            opacity: op,
            transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
          });
        }, 1);
        jQuery(next_image_class).css('opacity', 1);
        /* After transition.*/
        jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          cur_img.css('opacity', 1);
          grid.remove();
          huge_it_trans_in_progress_videogallery_<?php 
            echo $sliderID;
            ?>
 = false;
          if (typeof event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
 !== 'undefined' && event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
.length > 0) {
            key = event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
[0].split("-");
            event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
.shift();
            huge_it_change_image_videogallery_<?php 
            echo $sliderID;
            ?>
(key[0], key[1], data_videogallery_<?php 
            echo $sliderID;
            ?>
, true,false);
          }
        }
      }
      function huge_it_sliceH_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_sliceV_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'min-auto';
        }
        else if (direction == 'left') {
          var translateY = 'auto';
        }
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_slideV_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'auto';
        }
        else if (direction == 'left') {
          var translateY = 'min-auto';
        }
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_slideH_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleOut_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleIn_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blockScale_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(8, 6, 0, 0, 0, .6, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_kaleidoscope_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_fan_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var rotate = 45;
          var translateX = 100;
        }
        else if (direction == 'left') {
          var rotate = -45;
          var translateX = -100;
        }
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blindV_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_blindH_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_random_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV'];
        /* Pick a random transition from the anims array.*/
        this["huge_it_" + anims[Math.floor(Math.random() * anims.length)] + "_videogallery_<?php 
            echo $sliderID;
            ?>
"](current_image_class, next_image_class, direction);
      }
      
      function iterator_videogallery_<?php 
            echo $sliderID;
            ?>
() {
        var iterator = 1;

        return iterator;
     }
	 
     function huge_it_change_image_videogallery_<?php 
            echo $sliderID;
            ?>
(current_key, key, data_videogallery_<?php 
            echo $sliderID;
            ?>
, from_effect,clicked) {
		
        if (data_videogallery_<?php 
            echo $sliderID;
            ?>
[key]) {
			
			if(video_is_playing_videogallery_<?php 
            echo $sliderID;
            ?>
 && !clicked){
				return false;
			}
        
          if (!from_effect) {
			
            // Change image key.
            jQuery("#huge_it_current_image_key_videogallery_<?php 
            echo $sliderID;
            ?>
").val(key);
             // if (current_key == '-2') { /* Dots.*/
				current_key = jQuery(".huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
").attr("data-image_key");
			//  }
          }

          if (huge_it_trans_in_progress_videogallery_<?php 
            echo $sliderID;
            ?>
) {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").after(" --IN TRANSACTION-- <br />");
            event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
.push(current_key + '-' + key);
            return;
          }
		  
          var direction = 'right';
          if (huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 > key) {
            var direction = 'left';
          }
          else if (huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 == key) {
            return false;
          }

         
          // Set active thumbnail position.
      
          huge_it_current_key_videogallery_<?php 
            echo $sliderID;
            ?>
 = key;
          //Change image id, title, description.
          jQuery("#huge_it_slideshow_image_videogallery_<?php 
            echo $sliderID;
            ?>
").attr('data-image_id', data_videogallery_<?php 
            echo $sliderID;
            ?>
[key]["id"]);
		  
		  
		  jQuery(".huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
").html(data_videogallery_<?php 
            echo $sliderID;
            ?>
[key]["alt"]);
          jQuery(".huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
").html(data_videogallery_<?php 
            echo $sliderID;
            ?>
[key]["description"]);
        
		  var current_image_class = "#image_id_videogallery_<?php 
            echo $sliderID;
            ?>
_" + data_videogallery_<?php 
            echo $sliderID;
            ?>
[current_key]["id"];
          var next_image_class = "#image_id_videogallery_<?php 
            echo $sliderID;
            ?>
_" + data_videogallery_<?php 
            echo $sliderID;
            ?>
[key]["id"];
          
		  
		if(jQuery(current_image_class).find('.huge_it_video_frame_videogallery_<?php 
            echo $sliderID;
            ?>
').length>0) {
			var streffect='<?php 
            echo $slidereffect;
            ?>
';
			if(streffect=="cubeV" || streffect=="cubeH" || streffect=="none" || streffect=="fade"){
				huge_it_<?php 
            echo $slidereffect;
            ?>
_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
			}else{	
				huge_it_fade_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
			}	
		}else{	
				huge_it_<?php 
            echo $slidereffect;
            ?>
_videogallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
		}	
		  
		  
		jQuery('.huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
').html()==""){jQuery('.huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');}

		jQuery('.huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
').html()==""){jQuery('.huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');}
	  
		  
		  
		  jQuery(current_image_class).find('.huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');
		  jQuery(current_image_class).find('.huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');
		
		

		  
		  //errorlogjQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").after("--cur-key="+current_key+" --cur-img-class="+current_image_class+" nxt-img-class="+next_image_class+"--");
			huge_it_move_dots_videogallery_<?php 
            echo $sliderID;
            ?>
();
			<?php 
            if ($hasyoutube == true) {
                ?>
stopYoutubeVideo(); <?php 
            }
            ?>
			window.clearInterval(huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
);
			play_videogallery_<?php 
            echo $sliderID;
            ?>
();
        }

      }
	  
      function huge_it_popup_resize_videogallery_<?php 
            echo $sliderID;
            ?>
() {

		var staticsliderwidth=<?php 
            echo $sliderwidth;
            ?>
;
		var sliderwidth=<?php 
            echo $sliderwidth;
            ?>
;
		
		var bodyWidth=jQuery(window).width();
        var parentWidth = jQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").parent().width();
		//if responsive js late responsive.js @  take body size and not parent div
		if(sliderwidth>parentWidth){sliderwidth=parentWidth;}
		if(sliderwidth>bodyWidth){sliderwidth=bodyWidth;}
		
		var str=(<?php 
            echo $sliderheight;
            ?>
/staticsliderwidth);
		
		jQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").css({height: ((sliderwidth) * str)});
		jQuery(".huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
").css({height: ((sliderwidth) * str)});
			
		if("<?php 
            echo $slideshow_title_position[1];
            ?>
"=="middle"){var titlemargintopminus=jQuery(".huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
").outerHeight()/2;}		
		if("<?php 
            echo $slideshow_title_position[0];
            ?>
"=="center"){var titlemarginleftminus=jQuery(".huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
").outerWidth()/2;}		
		jQuery(".huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
").css({cssText: "margin-top:-" + titlemargintopminus + "px; margin-left:-"+titlemarginleftminus+"px;"});
		
		if("<?php 
            echo $slideshow_description_position[1];
            ?>
"=="middle"){var descriptionmargintopminus=jQuery(".huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
").outerHeight()/2;}	
		if("<?php 
            echo $slideshow_description_position[0];
            ?>
"=="center"){var descriptionmarginleftminus=jQuery(".huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
").outerWidth()/2;}
		jQuery(".huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
").css({cssText: "margin-top:-" + descriptionmargintopminus + "px; margin-left:-"+descriptionmarginleftminus+"px;"});		
		
		
		if("<?php 
            echo $paramssld['slider_crop_image'];
            ?>
"=="resize"){
			jQuery(".huge_it_slideshow_image_videogallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_image_item1_videogallery_<?php 
            echo $sliderID;
            ?>
 img, .huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
 img").css({
				cssText: "width:" + sliderwidth + "px; height:" + ((sliderwidth) * str)	+"px;"
			});
		}else {
			jQuery(".huge_it_slideshow_image_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item1_videogallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item2_videogallery_<?php 
            echo $sliderID;
            ?>
").css({
			cssText: "max-width: " + sliderwidth + "px !important; max-height: " + (sliderwidth * str) + "px !important;"
		  });
		}
		
		jQuery('.huge_it_video_frame_videogallery_<?php 
            echo $sliderID;
            ?>
').each(function (e) {
          jQuery(this).width(sliderwidth);
          jQuery(this).height(sliderwidth * str);
        });
      }
      
      jQuery(window).load(function () {
		jQuery(window).resize(function() {
			huge_it_popup_resize_videogallery_<?php 
            echo $sliderID;
            ?>
();
		});
		
		huge_it_popup_resize_videogallery_<?php 
            echo $sliderID;
            ?>
();
        /* Disable right click.*/
        jQuery('div[id^="huge_it_container"]').bind("contextmenu", function () {
          return false;
        });
        			
		/*HOVER SLIDESHOW*/
		jQuery("#huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_dots_container_videogallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_right_videogallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_left_videogallery_<?php 
            echo $sliderID;
            ?>
").hover(function(){
			//errorlogjQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").after(" -- hover -- <br /> ");
			jQuery("#huge_it_slideshow_right_videogallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'inline'});
			jQuery("#huge_it_slideshow_left_videogallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'inline'});
		},function(){
			jQuery("#huge_it_slideshow_right_videogallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'none'});
			jQuery("#huge_it_slideshow_left_videogallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'none'});
		});
		var pausehover="<?php 
            echo $sliderpauseonhover;
            ?>
";
		if(pausehover=="on"){
			jQuery("#huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_dots_container_videogallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_right_videogallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_left_videogallery_<?php 
            echo $sliderID;
            ?>
").hover(function(){
				window.clearInterval(huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
);
			},function(){
				window.clearInterval(huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
);
				play_videogallery_<?php 
            echo $sliderID;
            ?>
();
			});		
		}	
          play_videogallery_<?php 
            echo $sliderID;
            ?>
();        
      });

      function play_videogallery_<?php 
            echo $sliderID;
            ?>
() {	   
        /* Play.*/
		//errorlogjQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").after(" -- paly  ---- ");
        huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
 = setInterval(function () {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
").after(" -- time left ---- ");
          var iterator = 1;
          huge_it_change_image_videogallery_<?php 
            echo $sliderID;
            ?>
(parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
            echo $sliderID;
            ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
            echo $sliderID;
            ?>
').val()) + iterator) % data_videogallery_<?php 
            echo $sliderID;
            ?>
.length, data_videogallery_<?php 
            echo $sliderID;
            ?>
,false,false);
        }, '<?php 
            echo $slidepausetime;
            ?>
');
      }
	  
      jQuery(window).focus(function() {
       /*event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
 = [];*/
        var i_videogallery_<?php 
            echo $sliderID;
            ?>
 = 0;
        jQuery(".huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
").children("div").each(function () {
          if (jQuery(this).css('opacity') == 1) {
            jQuery("#huge_it_current_image_key_videogallery_<?php 
            echo $sliderID;
            ?>
").val(i_videogallery_<?php 
            echo $sliderID;
            ?>
);
          }
          i_videogallery_<?php 
            echo $sliderID;
            ?>
++;
        });
      });
      jQuery(window).blur(function() {
        event_stack_videogallery_<?php 
            echo $sliderID;
            ?>
 = [];
        window.clearInterval(huge_it_playInterval_videogallery_<?php 
            echo $sliderID;
            ?>
);
      });      
    </script>
	<style>				
	 .huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		height:<?php 
            echo $sliderheight;
            ?>
px;
		width:<?php 
            echo $sliderwidth;
            ?>
px;
		position:relative;
		display: block;
		text-align: center;
		/*HEIGHT FROM HEADER.PHP*/
		clear:both;
		<?php 
            if ($sliderposition == "left") {
                $position = 'float:left;';
            } elseif ($sliderposition == "right") {
                $position = 'float:right;';
            } else {
                $position = 'float:none; margin:0px auto;';
            }
            ?>
		<?php 
            echo $position;
            ?>
		
		border-style:solid;
		border-left:0px !important;
		border-right:0px !important;
	}


	.huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
 * {
		box-sizing: border-box;
		-moz-box-sizing: border-box;
		-webkit-box-sizing: border-box;
	}
		 

	  .huge_it_slideshow_image_videogallery_<?php 
            echo $sliderID;
            ?>
 {
			/*width:100%;*/
	  }

	  #huge_it_slideshow_left_videogallery_<?php 
            echo $sliderID;
            ?>
,
	  #huge_it_slideshow_right_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		cursor: pointer;
		display:none;
		display: block;
		
		height: 100%;
		outline: medium none;
		position: absolute;

		/*z-index: 10130;*/
		z-index: 13;
		bottom:25px;
		top:50%;		
	  }
	 

	  #huge_it_slideshow_left-ico_videogallery_<?php 
            echo $sliderID;
            ?>
,
	  #huge_it_slideshow_right-ico_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		z-index: 13;
		-moz-box-sizing: content-box;
		box-sizing: content-box;
		cursor: pointer;
		display: table;
		left: -9999px;
		line-height: 0;
		margin-top: -15px;
		position: absolute;
		top: 50%;
		/*z-index: 10135;*/
	  }
	  #huge_it_slideshow_left-ico_videogallery_<?php 
            echo $sliderID;
            ?>
:hover,
	  #huge_it_slideshow_right-ico_videogallery_<?php 
            echo $sliderID;
            ?>
:hover {
		cursor: pointer;
	  }
	  
	  .huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		display: table;
		position: relative;
		top:0px;
		left:0px;
		text-align: center;
		vertical-align: middle;
		width:100%;
	  }	  
		
	  .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		text-decoration: none;
		position: absolute;
		z-index: 11;
		display: inline-block;
		<?php 
            if ($paramssld['slider_title_has_margin'] == 'on') {
                $slider_title_width = $paramssld['slider_title_width'] - 6;
                $slider_title_height = $paramssld['slider_title_height'] - 6;
                $slider_title_margin = "3";
            } else {
                $slider_title_width = $paramssld['slider_title_width'];
                $slider_title_height = $paramssld['slider_title_height'];
                $slider_title_margin = "0";
            }
            ?>
		
		width:<?php 
            echo $slider_title_width;
            ?>
%;
		/*height:<?php 
            echo $slider_title_height;
            ?>
%;*/
		
		<?php 
            if ($slideshow_title_position[0] == "left") {
                echo 'left:' . $slider_title_margin . '%;';
            } elseif ($slideshow_title_position[0] == "center") {
                echo 'left:50%;';
            } elseif ($slideshow_title_position[0] == "right") {
                echo 'right:' . $slider_title_margin . '%;';
            }
            if ($slideshow_title_position[1] == "top") {
                echo 'top:' . $slider_title_margin . '%;';
            } elseif ($slideshow_title_position[1] == "middle") {
                echo 'top:50%;';
            } elseif ($slideshow_title_position[1] == "bottom") {
                echo 'bottom:' . $slider_title_margin . '%;';
            }
            ?>
		padding:2%;
		text-align:<?php 
            echo $paramssld['slider_title_text_align'];
            ?>
;  
		font-weight:bold;
		color:#<?php 
            echo $paramssld['slider_title_color'];
            ?>
;
			
		background:<?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['slider_title_background_color'], 2));
            $titleopacity = $paramssld["slider_title_background_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
		border-style:solid;
		font-size:<?php 
            echo $paramssld['slider_title_font_size'];
            ?>
px;
		border-width:<?php 
            echo $paramssld['slider_title_border_size'];
            ?>
px;
		border-color:#<?php 
            echo $paramssld['slider_title_border_color'];
            ?>
;
		border-radius:<?php 
            echo $paramssld['slider_title_border_radius'];
            ?>
px;
	  }
	  	  
	  .huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		text-decoration: none;
		position: absolute;
		z-index: 11;
		border-style:solid;
		display: inline-block;
		<?php 
            if ($paramssld['slider_description_has_margin'] == 'on') {
                $slider_description_width = $paramssld['slider_description_width'] - 6;
                $slider_description_height = $paramssld['slider_description_height'] - 6;
                $slider_description_margin = "3";
            } else {
                $slider_description_width = $paramssld['slider_description_width'];
                $slider_descriptione_height = $paramssld['slider_description_height'];
                $slider_description_margin = "0";
            }
            ?>
		
		width:<?php 
            echo $slider_description_width;
            ?>
%;
		/*height:<?php 
            echo $slider_description_height;
            ?>
%;*/
		<?php 
            if ($slideshow_description_position[0] == "left") {
                echo 'left:' . $slider_description_margin . '%;';
            } elseif ($slideshow_description_position[0] == "center") {
                echo 'left:50%;';
            } elseif ($slideshow_description_position[0] == "right") {
                echo 'right:' . $slider_description_margin . '%;';
            }
            if ($slideshow_description_position[1] == "top") {
                echo 'top:' . $slider_description_margin . '%;';
            } elseif ($slideshow_description_position[1] == "middle") {
                echo 'top:50%;';
            } elseif ($slideshow_description_position[1] == "bottom") {
                echo 'bottom:' . $slider_description_margin . '%;';
            }
            ?>
		padding:3%;
		text-align:<?php 
            echo $paramssld['slider_description_text_align'];
            ?>
;  
		color:#<?php 
            echo $paramssld['slider_description_color'];
            ?>
;
		
		background:<?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['slider_description_background_color'], 2));
            $descriptionopacity = $paramssld["slider_description_background_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $descriptionopacity . ') !important';
            ?>
;
		border-style:solid;
		font-size:<?php 
            echo $paramssld['slider_description_font_size'];
            ?>
px;
		border-width:<?php 
            echo $paramssld['slider_description_border_size'];
            ?>
px;
		border-color:#<?php 
            echo $paramssld['slider_description_border_color'];
            ?>
;
		border-radius:<?php 
            echo $paramssld['slider_description_border_radius'];
            ?>
px;
	  }
	  
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
.none, .huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
.none,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
.hidden, .huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
.hidden	   {display:none;}
	      
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h1, .huge_it_slideshow_description_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h1,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h2, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h2,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h3, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h3,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h4, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 h4,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 p, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 p,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 strong,  .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 strong,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 span, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 span,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 ul, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 ul,
	   .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 li, .huge_it_slideshow_title_text_videogallery_<?php 
            echo $sliderID;
            ?>
 li {
			padding:2px;
			margin:0px;
	   }

	  .huge_it_slide_container_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		display: table-cell;
		margin: 0 auto;
		position: relative;
		vertical-align: middle;
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
	  }
	  .huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		margin: 0 auto;
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
	  }
	  .huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		width:100%;
		height:100%;
		display:table;
		padding:0px;
		margin:0px;
		
	  }
	  .huge_it_slideshow_image_item_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		width:100%;
		height:100%;
		width: inherit;
		height: inherit;
		display: table-cell;
		filter: Alpha(opacity=100);
		opacity: 1;
		position: absolute;
		top:0px;
		left:0px;
		vertical-align: middle;
		z-index: 2;
		margin:0px !important;
		padding:0px;
		overflow:hidden;
		border-radius: <?php 
            echo $paramssld['slider_slideshow_border_radius'];
            ?>
px !important;
	  }
	  .huge_it_slideshow_image_second_item_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
		display: table-cell;
		filter: Alpha(opacity=0);
		opacity: 0;
		position: absolute;
		top:0px;
		left:0px;
		vertical-align: middle;
		z-index: 1;
		overflow:hidden;
		margin:0px !important;
		padding:0px;
		border-radius: <?php 
            echo $paramssld['slider_slideshow_border_radius'];
            ?>
px !important;
	  }
	  .huge_it_grid_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		display: none;
		height: 100%;
		overflow: hidden;
		position: absolute;
		width: 100%;
	  }
	  .huge_it_gridlet_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		opacity: 1;
		filter: Alpha(opacity=100);
		position: absolute;
	  }
	  
					
	  .huge_it_slideshow_dots_container_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		display: table;
		position: absolute;
		width:100% !important;
		height:100% !important;
	  }
	  .huge_it_slideshow_dots_thumbnails_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		margin: 0 auto;
		overflow: hidden;
		position: absolute;
		width:100%;
		height:30px;
	  }
	  
	  .huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		display: inline-block;
		position: relative;
		cursor: pointer;
		box-shadow: 1px 1px 1px rgba(0,0,0,0.1) inset, 1px 1px 1px rgba(255,255,255,0.1);
		width:10px;
		height: 10px;
		border-radius: 10px;
		background: #00f;
		margin: 10px;
		overflow: hidden;
		z-index: 17;
	  }
	  
	  .huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		opacity: 1;
		background:#0f0;
		filter: Alpha(opacity=100);
	  }
	  .huge_it_slideshow_dots_deactive_videogallery_<?php 
            echo $sliderID;
            ?>
 {
	  
	  }
	  
	  .huge_it_slideshow_image_item1_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		 display: table; 
		 width: inherit; 
		 height: inherit;
	  }
	  .huge_it_slideshow_image_item2_videogallery_<?php 
            echo $sliderID;
            ?>
 {
		 display: table-cell; 
		 vertical-align: middle; 
		 text-align: center;
	  }
	  
	  .huge_it_slideshow_image_item2_videogallery_<?php 
            echo $sliderID;
            ?>
 a {
		display:block;
		vertical-align:middle;
		width:100%;
		height:100%;
	  }
		.slide_thumb{
			position: absolute;
		}
		
		.huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
 {
			background:#<?php 
            echo $paramssld['slider_slider_background_color'];
            ?>
;
			border-width:<?php 
            echo $paramssld['slider_slideshow_border_size'];
            ?>
px;
			border-color:#<?php 
            echo $paramssld['slider_slideshow_border_color'];
            ?>
;
			border-radius:<?php 
            echo $paramssld['slider_slideshow_border_radius'];
            ?>
px;
		}
		
		.huge_it_slideshow_dots_thumbnails_videogallery_<?php 
            echo $sliderID;
            ?>
 {
			<?php 
            if ($paramssld['slider_dots_position'] == "bottom") {
                ?>
			bottom:0px;
			<?php 
            } else {
                if ($paramssld['slider_dots_position'] == "none") {
                    ?>
			display:none;
			
			}else{
			top:0px; <?php 
                }
            }
            ?>
		}
		
		.huge_it_slideshow_dots_videogallery_<?php 
            echo $sliderID;
            ?>
 {
			background:#<?php 
            echo $paramssld['slider_dots_color'];
            ?>
;
		}
		
		.huge_it_slideshow_dots_active_videogallery_<?php 
            echo $sliderID;
            ?>
 {
			background:#<?php 
            echo $paramssld['slider_active_dot_color'];
            ?>
;
		}
		.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}
	.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}
	.playbutton{
		width: 100%;
		height: 100%;
		position: absolute;
	}
		
		<?php 
            $arrowfolder = plugins_url('gallery-video/Front_images/arrows');
            switch ($paramssld['slider_navigation_type']) {
                case 1:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-21px;
						height:43px;
						width:29px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.simple.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-21px;
						height:43px;
						width:29px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.simple.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 2:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.shadow.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.shadow.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -50px;
					}

					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -50px;
					}
				<?php 
                    break;
                case 3:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-22px;
						height:44px;
						width:44px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.simple.dark.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-22px;
						height:44px;
						width:44px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.simple.dark.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -44px;
					}

					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -44px;
					}
				<?php 
                    break;
                case 4:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-33px;
						height:65px;
						width:59px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.cube.dark.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-33px;
						height:65px;
						width:59px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.cube.dark.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -66px;
					}

					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -66px;
					}
				<?php 
                    break;
                case 5:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-18px;
						height:37px;
						width:40px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.blue.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-18px;
						height:37px;
						width:40px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.blue.png) right top no-repeat; 
					}

				<?php 
                    break;
                case 6:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.cube.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.cube.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -50px;
					}

					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -50px;
					}
				<?php 
                    break;
                case 7:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						right:0px;
						margin-top:-19px;
						height:38px;
						width:38px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.transparent.circle.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-19px;
						height:38px;
						width:38px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.transparent.circle.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 8:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 9:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.blue.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.blue.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 10:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-24px;
						height:48px;
						width:48px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.green.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-24px;
						height:48px;
						width:48px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.green.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -48px;
					}

					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -48px;
					}
				<?php 
                    break;
                case 11:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-29px;
						height:58px;
						width:55px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.blue.retro.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-29px;
						height:58px;
						width:55px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.blue.retro.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 12:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-37px;
						height:74px;
						width:74px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.green.retro.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-37px;
						height:74px;
						width:74px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.green.retro.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 13:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-16px;
						height:33px;
						width:33px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.red.circle.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-16px;
						height:33px;
						width:33px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.red.circle.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 14:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-51px;
						height:102px;
						width:52px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.triangle.white.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-51px;
						height:102px;
						width:52px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.triangle.white.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 15:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-19px;
						height:39px;
						width:70px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.ancient.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-19px;
						height:39px;
						width:70px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.ancient.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 16:
                    ?>
					#huge_it_slideshow_left_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:-21px;
						margin-top:-20px;
						height:40px;
						width:37px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.black.out.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_videogallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:-21px;
						margin-top:-20px;
						height:40px;
						width:37px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.black.out.png) right top no-repeat; 
					}
				<?php 
                    break;
            }
            ?>
.thumb_image{
		  position: absolute;
		  width: 100%;
		  height: 100%;
		  top: 0;
		  left:0;
	}
	.entry-content a{
		border-bottom: none !important;
	}
	</style>

	<div class="huge_it_slideshow_image_wrap_videogallery_<?php 
            echo $sliderID;
            ?>
">

      <?php 
            $current_pos = 0;
            ?>
		<!-- ##########################DOTS######################### -->
        <div class="huge_it_slideshow_dots_container_videogallery_<?php 
            echo $sliderID;
            ?>
">
			  <div class="huge_it_slideshow_dots_thumbnails_videogallery_<?php 
            echo $sliderID;
            ?>
">
				<?php 
            $current_image_id = 0;
            $current_pos = 0;
            $current_key = 0;
            $stri = 0;
            foreach ($images as $key => $image_row) {
                if ($image_row->id == $current_image_id) {
                    $current_pos = $stri;
                    $current_key = $stri;
                }
                ?>
						<div id="huge_it_dots_<?php 
                echo $stri;
                ?>
_videogallery_<?php 
                echo $sliderID;
                ?>
" class="huge_it_slideshow_dots_videogallery_<?php 
                echo $sliderID;
                ?>
 <?php 
                echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_videogallery_' . $sliderID : 'huge_it_slideshow_dots_deactive_videogallery_' . $sliderID;
                ?>
" onclick="huge_it_change_image_videogallery_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
                echo $sliderID;
                ?>
').val()), '<?php 
                echo $stri;
                ?>
', data_videogallery_<?php 
                echo $sliderID;
                ?>
,false,true);return false;" data-image_id="<?php 
                echo $image_row->id;
                ?>
" data-image_key="<?php 
                echo $stri;
                ?>
"></div>
					<?php 
                $stri++;
            }
            ?>
			  </div>
			
			<?php 
            if ($paramssld['slider_show_arrows'] == "on") {
                ?>
				<a id="huge_it_slideshow_left_videogallery_<?php 
                echo $sliderID;
                ?>
" href="#" onclick="huge_it_change_image_videogallery_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
                echo $sliderID;
                ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
                echo $sliderID;
                ?>
').val()) - iterator_videogallery_<?php 
                echo $sliderID;
                ?>
()) >= 0 ? (parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
                echo $sliderID;
                ?>
').val()) - iterator_videogallery_<?php 
                echo $sliderID;
                ?>
()) % data_videogallery_<?php 
                echo $sliderID;
                ?>
.length : data_videogallery_<?php 
                echo $sliderID;
                ?>
.length - 1, data_videogallery_<?php 
                echo $sliderID;
                ?>
,false,true);return false;">
					<div id="huge_it_slideshow_left-ico_videogallery_<?php 
                echo $sliderID;
                ?>
">
					<div><i class="huge_it_slideshow_prev_btn_videogallery_<?php 
                echo $sliderID;
                ?>
 fa"></i></div></div>
				</a>
				
				<a id="huge_it_slideshow_right_videogallery_<?php 
                echo $sliderID;
                ?>
" href="#" onclick="huge_it_change_image_videogallery_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
                echo $sliderID;
                ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_videogallery_<?php 
                echo $sliderID;
                ?>
').val()) + iterator_videogallery_<?php 
                echo $sliderID;
                ?>
()) % data_videogallery_<?php 
                echo $sliderID;
                ?>
.length, data_videogallery_<?php 
                echo $sliderID;
                ?>
,false,true);return false;">
					<div id="huge_it_slideshow_right-ico_<?php 
                echo $sliderID;
                ?>
">
					<div><i class="huge_it_slideshow_next_btn_videogallery_<?php 
                echo $sliderID;
                ?>
 fa"></i></div></div>
				</a>
			<?php 
            }
            ?>
		</div>
	  <!-- ##########################IMAGES######################### -->
	  <script>

	jQuery(document).ready(function($) {

  $('.thumb_wrapper').on('click', function(ev) {
  	var hugeid=$(this).data('rowid');
  	var myid=hugeid;
  	myid=parseInt(myid);
  	eval('player_'+myid+'.playVideo()')
   ev.preventDefault();
 
  });
});
//console.log($(".video_view9_img"));
</script>
      <div id="huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
" class="huge_it_slideshow_image_container_videogallery_<?php 
            echo $sliderID;
            ?>
">        
        <div class="huge_it_slide_container_videogallery_<?php 
            echo $sliderID;
            ?>
">
          <div class="huge_it_slide_bg_videogallery_<?php 
            echo $sliderID;
            ?>
">
            <ul class="huge_it_slider_videogallery_<?php 
            echo $sliderID;
            ?>
">
			<?php 
            $i = 0;
            foreach ($images as $key => $image_row) {
                $video_thumb = $image_row->thumb_url;
                $videourl = $image_row->image_url;
                $icon = youtube_or_vimeo($videourl);
                ?>
						<li  class="huge_it_slideshow_image<?php 
                if ($i != $current_image_id) {
                    $current_key = $key;
                    echo '_second';
                }
                ?>
_item_videogallery_<?php 
                echo $sliderID;
                ?>
" id="image_id_videogallery_<?php 
                echo $sliderID . '_' . $i;
                ?>
">      
							<?php 
                if (strpos($image_row->image_url, 'youtu') !== false) {
                    $video_thumb_url = get_youtube_id_from_url($image_row->image_url);
                    ?>
								<?php 
                    if ($video_thumb != '') {
                        ?>
								<div class="thumb_wrapper" data-rowid="<?php 
                        echo $image_row->id;
                        ?>
" onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'">
									
									<div class="playbutton <?php 
                        echo $icon;
                        ?>
-icon"></div>
									
									<img  src="<?php 
                        echo $image_row->thumb_url;
                        ?>
">
								</div>
								<?php 
                    } else {
                        ?>
								<div class="thumb_wrapper" data-rowid="<?php 
                        echo $image_row->id;
                        ?>
" onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'">
									
									
									
									<img  class="thumb_image" src="https://i.ytimg.com/vi/<?php 
                        echo $video_thumb_url;
                        ?>
/hqdefault.jpg">
									<div class="playbutton <?php 
                        echo $icon;
                        ?>
-icon"></div>
								</div>
								<?php 
                    }
                    ?>
									<div id="thevideo" style="display: block;">
										<div id="video_id_videogallery_<?php 
                    echo $sliderID;
                    ?>
_<?php 
                    echo $key;
                    ?>
" class="huge_it_video_frame_videogallery_<?php 
                    echo $sliderID;
                    ?>
 framvideo"></div>
									</div>
							<?php 
                } else {
                    $vimeo = $image_row->image_url;
                    $vimeo_explode = explode("/", $vimeo);
                    $imgid = end($vimeo_explode);
                    //var_dump($image_row->thumb_url);
                    ?>
		
							<?php 
                    if ($video_thumb != '') {
                        ?>
								<div class="thumb_wrapper" data-rowid="<?php 
                        echo $image_row->id;
                        ?>
" onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'">
									
									<div class="playbutton <?php 
                        echo $icon;
                        ?>
-icon"></div>
									
									<img  src="<?php 
                        echo $image_row->thumb_url;
                        ?>
">
								</div>
								<?php 
                    }
                    ?>
								<div id="thevideo" style="display: block;">
									<iframe id="player_<?php 
                    echo $key;
                    ?>
"  class="huge_it_video_frame_videogallery_<?php 
                    echo $sliderID;
                    ?>
 framvideo" src="//player.vimeo.com/video/<?php 
                    echo $imgid;
                    ?>
?api=1&amp;player_id=player_<?php 
                    echo $key;
                    ?>
&amp;showinfo=0&amp;controls=0" style="border: 0;" allowfullscreen></iframe>
								</div>	
							<?php 
                }
                ?>
						</li>
					<?php 
                $i++;
            }
            ?>
            </ul>
			<input type="hidden" id="huge_it_current_image_key_videogallery_<?php 
            echo $sliderID;
            ?>
" value="0" />
          </div>
        </div>
      </div>
	</div>
		
		<?php 
            break;
            /* ########## VIEW 4 Thumbnails VIEW ##########*/
        /* ########## VIEW 4 Thumbnails VIEW ##########*/
        case 4:
            ?>
		
		<link href="<?php 
            echo plugins_url('../style/thumb_view.css', __FILE__);
            ?>
" rel="stylesheet" type="text/css" />
		<script src="<?php 
            echo plugins_url('../js/thumb_view.min.js', __FILE__);
            ?>
"></script>
		<script src="<?php 
            echo plugins_url('../js/jquery.lazyload.min.js', __FILE__);
            ?>
"></script>
		<script>
											/***<add>  change elements height ***/
									
							jQuery(window).resize(function(){
								setResponsiveElements() ;//add
								jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
 iframe').height(jQuery('#huge_it_videogallery_popup_list_<?php 
            echo $videogalleryID;
            ?>
 .popup-wrapper_<?php 
            echo $videogalleryID;
            ?>
 .image-block_<?php 
            echo $videogalleryID;
            ?>
').width()*0.5);
							});

							function setResponsiveElements() {

								if(jQuery(window).width() < <?php 
            echo $paramssld['thumb_image_width'];
            ?>
) {
									var currentWidth = jQuery('.huge_it_big_li').width();
									var currentHeight = jQuery('.huge_it_big_li').height();
									var elWidth = <?php 
            echo $paramssld['thumb_image_width'];
            ?>
;
									var elHeight = <?php 
            echo $paramssld['thumb_image_height'];
            ?>
;
									var divWidthHeight = elWidth/elHeight;
									//alert(currentWidth/divWidthHeight);
									jQuery('.huge_it_big_li').height(currentWidth/divWidthHeight);
									jQuery('.huge_it_videogallery_item').height(currentWidth/divWidthHeight);
									jQuery('.huge_it_videogallery_item img').css('height','100%');
								//	jQuery('.image-block_<?php 
            echo $videogalleryID;
            ?>
').height(currentWidth/divWidthHeight);
								//	jQuery('.image-block_<?php 
            echo $videogalleryID;
            ?>
 img').height(currentWidth/divWidthHeight);
									//reSortImages(currentWidth,currentWidth/divWidthHeight);
									//alert(divWidthHeight);
								}
								else {
									jQuery('.huge_it_big_li').height(<?php 
            echo $paramssld['thumb_image_height'];
            ?>
);
								}
							}
							/***</add>***/
		</script>
		<style>
			section #huge_it_videogallery {
				padding: <?php 
            echo $paramssld["thumb_box_padding"] . "px";
            ?>
;
				min-width: 69%;
				display: block;
				min-height: 100%;
				text-align: center;
				margin-bottom: 30px;
				<?php 
            if ($paramssld["thumb_box_has_background"] == 'on') {
                ?>
  background-color: #<?php 
                echo $paramssld["thumb_box_background"];
                ?>
; <?php 
            }
            ?>
				<?php 
            if ($paramssld["thumb_box_use_shadow"] == 'on') {
                echo 'box-shadow: 0 0 10px;';
            }
            ?>
			}
				

			#huge_it_videogallery .huge_it_big_li {
				overflow:hidden;
				width: 100%;	
				max-width: <?php 
            echo $paramssld["thumb_image_width"];
            ?>
px;
				height:<?php 
            echo $paramssld["thumb_image_height"];
            ?>
px;
				margin: <?php 
            echo $paramssld["thumb_margin_image"];
            ?>
px !important;
                                border: <?php 
            echo $paramssld["thumb_image_border_width"];
            ?>
px solid #<?php 
            echo $paramssld["thumb_image_border_color"];
            ?>
;
				border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
				padding:0px !important
			}
			.load_more3 {
		margin: 10px 0;
		position:relative;
		text-align:<?php 
            if ($paramssld['video_ht_view7_loadmore_position'] == 'left') {
                echo 'left';
            } elseif ($paramssld['video_ht_view7_loadmore_position'] == 'center') {
                echo 'center';
            } elseif ($paramssld['video_ht_view7_loadmore_position'] == 'right') {
                echo 'right';
            }
            ?>
;

		width:100%;


	}

	.load_more_button3 {
		border-radius: 10px;
		display:inline-block;
		padding:5px 15px;
		font-size:<?php 
            echo $paramssld['video_ht_view7_loadmore_fontsize'];
            ?>
px !important;;
		color:<?php 
            echo '#' . $paramssld['video_ht_view7_loadmore_font_color'];
            ?>
 !important;;
		background:<?php 
            echo '#' . $paramssld['video_ht_view7_button_color'];
            ?>
 !important;
		cursor:pointer;

	}
	.load_more_button3:hover{
		color:<?php 
            echo '#' . $paramssld['video_ht_view7_loadmore_font_color_hover'];
            ?>
 !important;
		background:<?php 
            echo '#' . $paramssld['video_ht_view7_button_color_hover'];
            ?>
 !important;
	} 
	.loading3 {
		display:none;
	}
	.paginate3{
		font-size:<?php 
            echo $paramssld['video_ht_view7_paginator_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view7_paginator_color'];
            ?>
 !important;
		text-align: <?php 
            echo $paramssld['video_ht_view7_paginator_position'];
            ?>
;
	}
	.paginate3 a{
		border-bottom: none !important;
	}
	.icon-style3{
		font-size: <?php 
            echo $paramssld['video_ht_view7_paginator_icon_size'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view7_paginator_icon_color'];
            ?>
 !important;
	}
	.clear{
		clear:both;
	}
			
			
			
			section #huge_it_videogallery li .infoLayer ul li {
				max-height:80px;
				overflow:hidden;
			}
			
			section #huge_it_videogallery li .overLayer ul li h2,
			section #huge_it_videogallery li .infoLayer ul li h2 {
				font-size: <?php 
            echo $paramssld["thumb_title_font_size"];
            ?>
px;
				color: #<?php 
            echo $paramssld["thumb_title_font_color"];
            ?>
;
				margin:0px !important;
			}
			
			section #huge_it_videogallery li .infoLayer ul li p {
				color: #<?php 
            echo $paramssld["thumb_title_font_color"];
            ?>
;
				margin:0px !important;
			}
			
			section #huge_it_videogallery li .overLayer,
			section #huge_it_videogallery li .infoLayer {
				-webkit-transition: opacity 0.3s linear;
				-moz-transition: opacity 0.3s linear;
				-ms-transition: opacity 0.3s linear;
				-o-transition: opacity 0.3s linear;
				transition: opacity 0.3s linear;
				width: 100%;
				max-width: <?php 
            echo $paramssld["thumb_image_width"];
            ?>
px;
				height: <?php 
            echo $paramssld["thumb_image_height"];
            ?>
px;
				position: absolute;
				text-align: center;
				opacity: 0;
				top: 0px;
				left: 0;
				z-index: 4;
                                border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
			}
			
			
			
			section #huge_it_videogallery li a {
				position: absolute;
				display: block;
				width: 100%;
				max-width: <?php 
            echo $paramssld["thumb_image_width"];
            ?>
px;
				height: <?php 
            echo $paramssld["thumb_image_height"];
            ?>
px;
				top: 0px;
				left: 0px;
				z-index: 6; 
				border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
			}

			
			#huge_it_videogallery li img {
				width: 100%;	
				max-width: <?php 
            echo $paramssld["thumb_image_width"] - 2 * $paramssld["thumb_image_border_width"];
            ?>
px;
			<?php 
            if ($paramssld["thumb_image_behavior"] == 'on') {
                ?>
				height: 100% !important;
				max-height: <?php 
                echo $paramssld["thumb_image_height"];
                ?>
px !important;
			<?php 
            }
            ?>
				border: <?php 
            echo $paramssld["thumb_image_border_width"];
            ?>
px solid #<?php 
            echo $paramssld["thumb_image_border_color"];
            ?>
;
				border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
				margin:0px !important;
			}
			
			
			section #huge_it_videogallery li:hover .overLayer {
				-webkit-transition: opacity 0.3s linear;
				-moz-transition: opacity 0.3s linear;
				-ms-transition: opacity 0.3s linear;
				-o-transition: opacity 0.3s linear;
				transition: opacity 0.3s linear;
				opacity: <?php 
            echo $paramssld["thumb_title_background_transparency"] / 100 + 0.001;
            ?>
;
				display: block;
				background: #<?php 
            echo $paramssld["thumb_title_background_color"];
            ?>
; 
			}
			section #huge_it_videogallery li:hover .infoLayer {
				-webkit-transition: opacity 0.3s linear;
				-moz-transition: opacity 0.3s linear;
				ms-transition: opacity 0.3s linear;
				-o-transition: opacity 0.3s linear;
				transition: opacity 0.3s linear;
				opacity: 1;
				display: block; 
			}
			
			section #huge_it_videogallery p {text-align:center;}
		</style>
		
		
		<section id="thumbwrapper<?php 
            echo $videogalleryID;
            ?>
">
			<input type="hidden" class="pagenum" value="1" />
			<ul id="huge_it_videogallery">
				<li id="fullPreview"></li>
				<?php 
            foreach ($images as $image) {
                $idofgallery = $image->videogallery_id;
                //print_r($image);
            }
            global $wpdb;
            $pattern = '/-/';
            $query2 = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_galleries where id = '%d' order by ordering ASC ", $idofgallery);
            $gallery = $wpdb->get_results($query2);
            foreach ($gallery as $gall) {
                global $post;
                $pID = $post->ID;
                $disp_type = $gall->display_type;
                $count_page = $gall->content_per_page;
                if ($count_page == 0) {
                    $count_page = 999;
                } elseif (preg_match($pattern, $count_page)) {
                    $count_page = preg_replace($pattern, '', $count_page);
                }
                //var_dump($count_page) ;
            }
            global $wpdb;
            $num = $count_page;
            //$total = count($images) ;
            $total = intval((count($images) - 1) / $num + 1);
            //$total_img=count($images);
            if (isset($_GET['page-img' . $videogalleryID . $pID])) {
                $page = $_GET['page-img' . $videogalleryID . $pID];
            } else {
                $page = '';
            }
            $page = intval($page);
            if (empty($page) or $page < 0) {
                $page = 1;
            }
            if ($page > $total) {
                $page = $total;
            }
            $start = $page * $num - $num;
            $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_videos where videogallery_id = '%d' order by ordering ASC LIMIT " . $start . "," . $num . "", $idofgallery);
            $page_images = $wpdb->get_results($query);
            if ($disp_type == 2) {
                $page_images = $images;
                $count_page = 9999;
            }
            ?>
			<input type="hidden" id="total" value="<?php 
            echo $total;
            ?>
" />
				<?php 
            foreach ($page_images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                ?>
				<li class="huge_it_big_li">
				<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
                                    <a class="videogroup<?php 
                        echo $videogalleryID;
                        ?>
" href="<?php 
                        echo $row->image_url;
                        ?>
"></a>
						<img src="<?php 
                        echo $row->image_url;
                        ?>
" alt="<?php 
                        echo str_replace('__5_5_5__', '%', $row->name);
                        ?>
" />
					<?php 
                        break;
                    case 'video':
                        ?>
							<?php 
                        $videourl = get_video_gallery_id_from_url($row->image_url);
                        $thumb_pic = "http://img.youtube.com/vi/<?php echo {$videourl['0']}; ?>/mqdefault.jpg";
                        if ($videourl[1] == 'youtube') {
                            if (empty($row->thumb_url)) {
                                $thumb_pic = 'http://img.youtube.com/vi/' . $videourl[0] . '/mqdefault.jpg';
                            } else {
                                $thumb_pic = $row->thumb_url;
                            }
                            ?>
								
									<a  class="youtube huge_it_videogallery_item videogroup<?php 
                            echo $videogalleryID;
                            ?>
"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
"></a>
									<img src="<?php 
                            echo $thumb_pic;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />				
								<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            if (empty($row->thumb_url)) {
                                $imgsrc = $hash[0]['thumbnail_large'];
                            } else {
                                $imgsrc = $row->thumb_url;
                            }
                            ?>
									<a  class="vimeo huge_it_videogallery_item videogroup<?php 
                            echo $videogalleryID;
                            ?>
" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
"></a>
									<img src="<?php 
                            echo $imgsrc;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />
								<?php 
                        }
                        ?>
					<?php 
                        break;
                }
                ?>
					
					<div class="overLayer"></div>
					<div class="infoLayer">
						<ul>
							<li>
								<h2>
									<?php 
                echo str_replace('__5_5_5__', '%', $row->name);
                ?>
								</h2>
							</li>
							<li>
								<p>
									<?php 
                echo $paramssld["thumb_view_text"];
                ?>
								</p>
							</li>
						</ul>
					</div>
				</li>
				<?php 
            }
            ?>
				
			</ul>
			<?php 
            $path_site = plugins_url("/../Front_images", __FILE__);
            $a = $disp_type;
            if ($a == 1) {
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                $pattern3 = "/\\?page-img[0-9]+=[0-9]+/";
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                        header("Location:" . $actual_link . "");
                        exit;
                    }
                } elseif (preg_match($pattern3, $actual_link)) {
                    $actual_link = preg_replace($pattern3, '', $actual_link);
                    header("Location:" . $actual_link . "");
                    exit;
                }
                ?>
				<div class="load_more3">
					<div class="load_more_button3"><?php 
                echo $paramssld['video_ht_view7_loadmore_text'];
                ?>
</div>
					<div class="loading3"><img src="<?php 
                if ($paramssld['video_ht_view7_loading_type'] == '1') {
                    echo $path_site . '/arrows/loading1.gif';
                } elseif ($paramssld['video_ht_view7_loading_type'] == '2') {
                    echo $path_site . '/arrows/loading4.gif';
                } elseif ($paramssld['video_ht_view7_loading_type'] == '3') {
                    echo $path_site . '/arrows/loading36.gif';
                } elseif ($paramssld['video_ht_view7_loading_type'] == '4') {
                    echo $path_site . '/arrows/loading51.gif';
                }
                ?>
"></div>
					<script>
						jQuery(document).ready(function(){
							if(jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3").length){
								jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3").on("click tap",function(){

									if(jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()<jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
										var pagenum = parseInt(jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()) + 1;
										var perpage =<?php 
                echo $count_page;
                ?>
;
										var galleryid="<?php 
                echo $image->videogallery_id;
                ?>
";
										var thumbtext="<?php 
                echo $paramssld["thumb_view_text"];
                ?>
";
										var width="<?php 
                echo $paramssld['video_ht_view9_video_width'];
                ?>
";
										var height="<?php 
                echo $paramssld['video_ht_view9_video_height'];
                ?>
";
										//alert(pagenum+','+perpage+','+galleryid+','+width+','+height);
										getresult(pagenum,perpage,galleryid,thumbtext,width,height);
									}else{
										jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3').hide();
									}
									return false;
								});
							}
											if(jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3').hide();
											}
							function getresult(pagenum,perpage,galleryid,thumbtext,width,height){
								var data = {
										action:"huge_it_video_gallery_ajax",
										task:'load_videos_thumbnail',
										page:pagenum,
										perpage:perpage,
										galleryid:galleryid,
										thumbtext:thumbtext,
										width:width,
										height:height
								}
								jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .loading3').show();
								
								jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3').hide();

								jQuery.post('<?php 
                echo admin_url("admin-ajax.php");
                ?>
',data,function(response){
									if(response.success){
										jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 #huge_it_videogallery").append(response.success);
										jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 #huge_it_videogallery img').on('load',function(){
											
											
											jQuery(".videogroup<?php 
                echo $videogalleryID;
                ?>
").colorbox({rel:'videogroup<?php 
                echo $videogalleryID;
                ?>
'});
											jQuery(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".vimeo").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
											jQuery(".inline").colorbox({inline:true, width:"50%"});
											jQuery(".callbacks").colorbox({
												onOpen:function(){ alert('onOpen: colorbox is about to open'); },
												onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
												onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
												onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
												onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
											});

											jQuery('.non-retina').colorbox({rel:'group5', transition:'none'})
											jQuery('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
											jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3').show();
											jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .loading3').hide();
											
											if(jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#thumbwrapper<?php 
                echo $videogalleryID;
                ?>
 .load_more_button3').hide();
											}
										});
										

									}else{
										alert("no");
									}
								},"json");
							}

						});
					</script>
				</div>
				<?php 
            } elseif ($a == 0) {
                ?>
			<div class="paginate3">
			<?php 
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $checkREQ = '';
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                //$res=preg_match($pattern, $actual_link);
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                    }
                    $checkREQ = $actual_link . '&page-img' . $videogalleryID . $pID;
                } else {
                    $checkREQ = '?page-img' . $videogalleryID . $pID;
                }
                //var_dump($res);
                // Проверяем нужны ли стрелки назад
                $pervpage = '';
                if ($page != 1) {
                    $pervpage = '<a href= ' . $checkREQ . '=1><i class="icon-style3 hugeiticons-fast-backward" ></i></a>  
			                               <a href= ' . $checkREQ . '=' . ($page - 1) . '><i class="icon-style3 hugeiticons-chevron-left"></i></a> ';
                }
                // Проверяем нужны ли стрелки вперед
                $nextpage = '';
                if ($page != $total) {
                    $nextpage = ' <a href= ' . $checkREQ . '=' . ($page + 1) . '><i class="icon-style3 hugeiticons-chevron-right"></i></a>  
			                                   <a href= ' . $checkREQ . '=' . $total . '><i class="icon-style3 hugeiticons-fast-forward" ></i></a>';
                }
                // Вывод меню
                echo $pervpage . $page . '/' . $total . $nextpage;
                ?>
</div>
<?php 
            }
            ?>
		</section>
		<?php 
            break;
            /* ########## VIEW 8 justified's ##########*/
        /* ########## VIEW 8 justified's ##########*/
        case 6:
            ?>
        <?php 
            $path_site = plugins_url("", __FILE__);
            ?>
        <link rel="stylesheet" href="<?php 
            echo $path_site;
            ?>
/../style/justifiedGallery.css" />
		<script>
			var imagemargin=<?php 
            echo $paramssld["ht_view8_element_padding"];
            ?>
;
			var imagerandomize=<?php 
            echo $paramssld["ht_view8_element_randomize"];
            ?>
;
			var imagecssAnimation=<?php 
            echo $paramssld["ht_view8_element_cssAnimation"];
            ?>
;
			var imagecssAnimationSpeed=<?php 
            echo $paramssld["ht_view8_element_animation_speed"];
            ?>
;
			var imageheight= <?php 
            echo $paramssld["ht_view8_element_height"];
            ?>
;
			var imagejustify= <?php 
            echo $paramssld["ht_view8_element_justify"];
            ?>
;
			var imageshowcaption= <?php 
            echo $paramssld["ht_view8_element_show_caption"];
            ?>
;
			
			//var imagemaxheight=<?php 
            //echo $paramssld["ht_view8_element_maxheight"];
            ?>
;
			//var imagefixed=<?php 
            //echo $paramssld["ht_view8_element_size_fix"];
            ?>
;
		</script>
	    <script src="<?php 
            echo $path_site;
            ?>
/../js/justifiedGallery.js"></script>
        
<style>
	.justified-gallery {
		width: 100%;
		position: relative;
	}
	.justified-gallery > a,
	.justified-gallery > div {
		position: absolute;
		display: inline-block;
		opacity: 0;
		overflow:hidden;
		filter: alpha(opacity=0);
                border:none;
		/* IE8 or Earlier */
	}
	.justified-gallery > a > img,
	.justified-gallery > div > img {
	   /* width: 200px !important;*/
		position: absolute;
		top: 50%;
		left: 50%;
		padding: 0;
		//border: <?php 
            php;
            ?>
px solid #<?php 
            php;
            ?>
;
		//border-radius: <?php 
            php;
            ?>
px;
	}
	.justified-gallery > a > .caption,
	.justified-gallery > div > .caption {
		display: none;
		position: absolute;
		bottom: 0;
		padding: 5px;
		left: 0;
		right: 0;
		margin: 0;
		color: #<?php 
            echo $paramssld["ht_view8_element_title_font_color"];
            ?>
;
		font-size: <?php 
            echo $paramssld["ht_view8_element_title_font_size"];
            ?>
px;
		font-weight: 300;
		font-family: sans-serif;
		//margin-left: <?php 
            //echo $paramssld["ht_view8_element_border_width"];
            ?>
px;
		background:<?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view8_element_title_background_color'], 2));
            $titleopacity = $paramssld["ht_view8_element_title_overlay_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
		
		overflow: hidden;
		text-overflow: ellipsis;
		white-space:nowrap;
	}
	.justified-gallery > a > .caption.caption-visible,
	.justified-gallery > div > .caption.caption-visible {
		display: initial;
		opacity: 0.7;
		filter: "alpha(opacity=70)";
		/* IE8 or Earlier */
		-webkit-animation: justified-gallery-show-caption-animation 500ms 0 ease;
		-moz-animation: justified-gallery-show-caption-animation 500ms 0 ease;
		-ms-animation: justified-gallery-show-caption-animation 500ms 0 ease;
	}
	.justified-gallery > .entry-visible {
		opacity: 1.0;
		filter: alpha(opacity=100);
		/* IE8 or Earlier */
		-webkit-animation: justified-gallery-show-entry-animation 300ms 0 ease;
		-moz-animation: justified-gallery-show-entry-animation 300ms 0 ease;
		-ms-animation: justified-gallery-show-entry-animation 300ms 0 ease;
	}
	.justified-gallery > .spinner {
		position: absolute;
		bottom: 0;
		margin-left: -24px;
		padding: 10px 0 10px 0;
		left: 50%;
		opacity: initial;
		filter: initial;
		overflow: initial;
	}
	.justified-gallery > .spinner > span {
		display: inline-block;
		opacity: 0;
		filter: alpha(opacity=0);
		/* IE8 or Earlier */
		width: 8px;
		height: 8px;
		margin: 0 4px 0 4px;
		background-color: #000;
		border-top-left-radius: 6px;
		border-top-right-radius: 6px;
		border-bottom-right-radius: 6px;
		border-bottom-left-radius: 6px;
	}
		.load_more2 {
		margin: 10px 0;
		position:relative;
		text-align:<?php 
            if ($paramssld['video_ht_view8_loadmore_position'] == 'left') {
                echo 'left';
            } elseif ($paramssld['video_ht_view8_loadmore_position'] == 'center') {
                echo 'center';
            } elseif ($paramssld['video_ht_view8_loadmore_position'] == 'right') {
                echo 'right';
            }
            ?>
;

		width:100%;


	}

	.load_more_button2 {
		border-radius: 10px;
		display:inline-block;
		padding:5px 15px;
		font-size:<?php 
            echo $paramssld['video_ht_view8_loadmore_fontsize'];
            ?>
px !important;;
		color:<?php 
            echo '#' . $paramssld['video_ht_view8_loadmore_font_color'];
            ?>
 !important;;
		background:<?php 
            echo '#' . $paramssld['video_ht_view8_button_color'];
            ?>
 !important;
		cursor:pointer;

	}
	.load_more_button2:hover{
		color:<?php 
            echo '#' . $paramssld['video_ht_view8_loadmore_font_color_hover'];
            ?>
 !important;
		background:<?php 
            echo '#' . $paramssld['video_ht_view8_button_color_hover'];
            ?>
 !important;
	} 

	.loading2 {
		display:none;
	}
	.paginate2{
		font-size:<?php 
            echo $paramssld['video_ht_view8_paginator_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view8_paginator_color'];
            ?>
 !important;
		text-align: <?php 
            echo $paramssld['video_ht_view8_paginator_position'];
            ?>
;
		margin-top: 25px;
	}
	.paginate2 a{
		border-bottom: none !important;
	}
	.icon-style2{
		font-size: <?php 
            echo $paramssld['video_ht_view8_paginator_icon_size'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view8_paginator_icon_color'];
            ?>
 !important;
	}
	.clear{
		clear:both;
	}
        .play-icon {
                position:absolute;
                top:0px;
                left:0px;
                width:100%;
                height:100%;	

        }

        .play-icon.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;background-size:20%;}
        .play-icon.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;background-size:20%;}
</style>


<?php 
            $path_site = plugins_url("", __FILE__);
            ?>
                <div id="my_video_gallery_wrapper_<?php 
            echo $videogalleryID;
            ?>
" class="clearfix">

					
                <div id="my_video_gallery_<?php 
            echo $videogalleryID;
            ?>
" class="clearfix">

<?php 
            foreach ($images as $image) {
                $idofgallery = $image->videogallery_id;
                //print_r($image);
            }
            global $wpdb;
            $pattern = '/-/';
            $query2 = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_galleries where id = '%d' order by ordering ASC ", $idofgallery);
            $gallery = $wpdb->get_results($query2);
            foreach ($gallery as $gall) {
                global $post;
                $pID = $post->ID;
                $disp_type = $gall->display_type;
                $count_page = $gall->content_per_page;
                if ($count_page == 0) {
                    $count_page = 999;
                } elseif (preg_match($pattern, $count_page)) {
                    $count_page = preg_replace($pattern, '', $count_page);
                }
                //var_dump($count_page) ;
            }
            global $wpdb;
            $num = $count_page;
            //$total = count($images) ;
            $total = intval((count($images) - 1) / $num + 1);
            //$total_img=count($images);
            if (isset($_GET['page-img' . $videogalleryID . $pID])) {
                $page = $_GET['page-img' . $videogalleryID . $pID];
            } else {
                $page = '';
            }
            $page = intval($page);
            if (empty($page) or $page < 0) {
                $page = 1;
            }
            if ($page > $total) {
                $page = $total;
            }
            $start = $page * $num - $num;
            $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_videos where videogallery_id = '%d' order by ordering ASC LIMIT " . $start . "," . $num . "", $idofgallery);
            $page_images = $wpdb->get_results($query);
            if ($disp_type == 2) {
                $page_images = $images;
                $count_page = 9999;
            }
            ?>
			

<input type="hidden" id="total" value="<?php 
            echo $total;
            ?>
" />
                    <?php 
            foreach ($page_images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
                                <?php 
                        if ($row->image_url != ';') {
                            ?>
                                <a class="videogroup<?php 
                            echo $videogalleryID;
                            ?>
" href="<?php 
                            echo $imgurl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
                                    <img id="wd-cl-img<?php 
                            echo $key;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" src="<?php 
                            echo get_huge_image($imgurl[0], $image_prefix);
                            ?>
"/>
                                </a>
                                <?php 
                        } else {
                            ?>
                                <img alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg"  />
                                <input type="hidden" class="pagenum" value="1" />
                                <?php 
                        }
                        ?>
                                <?php 
                        break;
                    case 'video':
                        $videourl = get_video_gallery_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            if (empty($row->thumb_url)) {
                                $thumb_pic = 'http://img.youtube.com/vi/' . $videourl[0] . '/mqdefault.jpg';
                            } else {
                                $thumb_pic = $row->thumb_url;
                            }
                            ?>
                                        <a class="youtube huge_it_videogallery_item videogroup<?php 
                            echo $videogalleryID;
                            ?>
"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
                                                <img  src="<?php 
                            echo $thumb_pic;
                            ?>
" alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" />
                                                <div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
                                        </a>
                                        <input type="hidden" class="pagenum" value="1" />
                                <?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            if (empty($row->thumb_url)) {
                                $imgsrc = $hash[0]['thumbnail_large'];
                            } else {
                                $imgsrc = $row->thumb_url;
                            }
                            ?>
                                        <a class="vimeo huge_it_videogallery_item videogroup<?php 
                            echo $videogalleryID;
                            ?>
" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
" title="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
">
                                                <img alt="<?php 
                            echo str_replace('__5_5_5__', '%', $row->name);
                            ?>
" src="<?php 
                            echo $imgsrc;
                            ?>
"/>
                                                <div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
                                        </a>
                                        <input type="hidden" class="pagenum" value="1" />
                                <?php 
                        }
                }
            }
            ?>
                </div>
            </div>
                <script>
                jQuery(document).ready(function($){
                	$( window ).load(function(){
                	$('.huge_it_videogallery_item').each(function(){
                		var img=$(this).find('img');
                		if($(this).find('img').attr('alt')==''){
                		//	alert('yo');
                			img.parent().find(".caption" ).css('display','none');
                		}
                	})
                	})
                })
                </script>
                <?php 
            $path_site = plugins_url("/../Front_images", __FILE__);
            $a = $disp_type;
            if ($a == 1) {
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                $pattern3 = "/\\?page-img[0-9]+=[0-9]+/";
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                        header("Location:" . $actual_link . "");
                        exit;
                    }
                } elseif (preg_match($pattern3, $actual_link)) {
                    $actual_link = preg_replace($pattern3, '', $actual_link);
                    header("Location:" . $actual_link . "");
                    exit;
                }
                ?>
				<div class="load_more2">
					<div class="load_more_button2 load_more_button_<?php 
                echo $videogalleryID;
                ?>
"><?php 
                echo $paramssld['video_ht_view8_loadmore_text'];
                ?>
</div>
					<div class="loading2 loading_<?php 
                echo $videogalleryID;
                ?>
"><img src="<?php 
                if ($paramssld['video_ht_view8_loading_type'] == '1') {
                    echo $path_site . '/arrows/loading1.gif';
                } elseif ($paramssld['video_ht_view8_loading_type'] == '2') {
                    echo $path_site . '/arrows/loading4.gif';
                } elseif ($paramssld['video_ht_view8_loading_type'] == '3') {
                    echo $path_site . '/arrows/loading36.gif';
                } elseif ($paramssld['video_ht_view8_loading_type'] == '4') {
                    echo $path_site . '/arrows/loading51.gif';
                }
                ?>
"></div>
					<script>
						jQuery(document).ready(function(){

							if(jQuery("#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
").length){
								jQuery("#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
").on("click tap",function(){
									//alert(jQuery(this).length);

									if(jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()<jQuery("#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
										
										var pagenum = parseInt(jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()) + 1;
										//alert(pagenum);
										var perpage =<?php 
                echo $count_page;
                ?>
;
										var galleryid="<?php 
                echo $image->videogallery_id;
                ?>
";
										var width="<?php 
                echo $paramssld['video_ht_view9_video_width'];
                ?>
";
										var height="<?php 
                echo $paramssld['video_ht_view9_video_height'];
                ?>
";
										getresult(pagenum,perpage,galleryid,width,height);
									}else{
										jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
').hide();
									}
									return false;
								});
							}
							if(jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
').hide();
											}			
							function getresult(pagenum,perpage,galleryid,width,height){
								var data = {
										action:"huge_it_video_gallery_ajax",
										task:'load_videos_justified',
										page:pagenum,
										perpage:perpage,
										galleryid:galleryid,
										width:width,
										height:height										
								}
								jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .loading_<?php 
                echo $videogalleryID;
                ?>
').show();
								jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
').hide();
								
								jQuery.post('<?php 
                echo admin_url("admin-ajax.php");
                ?>
',data,function(response){
									jQuery('.huge_it_videogallery_item').each(function(){
							                		var img=jQuery(this).find('img');
							                		if(jQuery(this).find('img').attr('alt')==''){
							                		//	alert('yo');
							                			img.parent().find(".caption" ).css('display','none');
							                		}
							                	})
									if(response.success){
											jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
").append(response.success);
											jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
").justifiedGallery();
										jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 img").on('load',function(){
											
											
											jQuery(".videogroup<?php 
                echo $videogalleryID;
                ?>
").colorbox({rel:'videogroup<?php 
                echo $videogalleryID;
                ?>
'});
											jQuery(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".vimeo").colorbox({iframe:true, innerWidth:640, innerHeight:390});
											jQuery(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
											jQuery(".inline").colorbox({inline:true, width:"50%"});
											jQuery(".callbacks").colorbox({
												onOpen:function(){ alert('onOpen: colorbox is about to open'); },
												onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
												onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
												onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
												onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
											});

											jQuery('.non-retina').colorbox({rel:'group5', transition:'none'})
											jQuery('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
											jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
').show();
											jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .loading_<?php 
                echo $videogalleryID;
                ?>
').hide();
											
											if(jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#my_video_gallery_<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#my_video_gallery_wrapper_<?php 
                echo $videogalleryID;
                ?>
 .load_more_button_<?php 
                echo $videogalleryID;
                ?>
').hide();
											}
										});
										

									}else{
										alert("no");
									}
								},"json");
							}

						});
					</script>
				</div>
				<?php 
            } elseif ($a == 0) {
                ?>
		<div class="paginate2">
			<?php 
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $checkREQ = '';
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                //$res=preg_match($pattern, $actual_link);
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                    }
                    $checkREQ = $actual_link . '&page-img' . $videogalleryID . $pID;
                } else {
                    $checkREQ = '?page-img' . $videogalleryID . $pID;
                }
                //var_dump($res);
                // Проверяем нужны ли стрелки назад
                $pervpage = '';
                if ($page != 1) {
                    $pervpage = '<a href= ' . $checkREQ . '=1><i class="icon-style2 hugeiticons-fast-backward" ></i></a>  
			                               <a href= ' . $checkREQ . '=' . ($page - 1) . '><i class="icon-style2 hugeiticons-chevron-left"></i></a> ';
                }
                // Проверяем нужны ли стрелки вперед
                $nextpage = '';
                if ($page != $total) {
                    $nextpage = ' <a href= ' . $checkREQ . '=' . ($page + 1) . '><i class="icon-style2 hugeiticons-chevron-right"></i></a>  
			                                   <a href= ' . $checkREQ . '=' . $total . '><i class="icon-style2 hugeiticons-fast-forward" ></i></a>';
                }
                // Находим две ближайшие станицы с обоих краев, если они есть
                /*if($page - 2 > 0) $page2left = ' <a href= ./?page='. ($page - 2) .'>'. ($page - 2) .'</a> | ';  
                		if($page - 1 > 0) $page1left = '<a href= ./?page='. ($page - 1) .'>'. ($page - 1) .'</a> | ';  
                		if($page + 2 <= $total) $page2right = ' | <a href= ./?page='. ($page + 2) .'>'. ($page + 2) .'</a>';  
                		if($page + 1 <= $total) $page1right = ' | <a href= ./?page='. ($page + 1) .'>'. ($page + 1) .'</a>'; */
                // Вывод меню
                echo $pervpage . $page . '/' . $total . $nextpage;
                ?>
</div>
</div>
<?php 
            }
            ?>


<script>
    jQuery(document).ready(function(){

    jQuery("#my_video_gallery_<?php 
            echo $videogalleryID;
            ?>
").justifiedGallery();

}); 
</script>
  <?php 
            break;
            /////////////////////Block style view///////////////////////
        /////////////////////Block style view///////////////////////
        case 7:
            ?>
	<style>
	.video_view9_container:nth-last-child(3){
		margin-bottom: 0px !important;
		padding-bottom: 0px !important;
		border:none !important;

	}
	.video_view9_container{
		width: <?php 
            echo $paramssld['video_ht_view9_general_width'];
            ?>
%;
		float:<?php 
            if ($paramssld['video_view9_general_position'] == 'left' || $paramssld['video_view9_general_position'] == 'center') {
                echo 'none';
            } elseif ($paramssld['video_view9_general_position'] == 'right') {
                echo 'right';
            }
            ?>
;
		<?php 
            if ($paramssld['video_view9_general_position'] == 'center') {
                echo 'margin:0 auto;';
            }
            ?>
;
		margin-bottom: <?php 
            echo $paramssld['video_ht_view9_general_space'];
            ?>
px !important;
		padding-bottom: <?php 
            echo $paramssld['video_ht_view9_general_space'];
            ?>
px !important;
		border-bottom:  <?php 
            echo $paramssld['video_ht_view9_general_separator_size'];
            ?>
px 

		<?php 
            if ($paramssld['video_view9_general_separator_style'] == 'none') {
                echo 'none';
            } elseif ($paramssld['video_view9_general_separator_style'] == 'solid') {
                echo 'solid';
            } elseif ($paramssld['video_view9_general_separator_style'] == 'dashed') {
                echo 'dashed';
            } elseif ($paramssld['video_view9_general_separator_style'] == 'dotted') {
                echo 'dotted';
            } elseif ($paramssld['video_view9_general_separator_style'] == 'groove') {
                echo 'groove';
            } elseif ($paramssld['video_view9_general_separator_style'] == 'double') {
                echo 'double';
            }
            ?>
 #<?php 
            echo $paramssld['video_ht_view9_general_separator_color'];
            ?>
;
	}
	.video_new_view_title{
		font-size:<?php 
            echo $paramssld['video_ht_view9_title_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view9_title_color'];
            ?>
 !important;
		<?php 
            if ($paramssld['video_ht_view9_element_title_show'] == 'false') {
                echo 'display:none;';
            }
            ?>
;
		<?php 
            if ($paramssld['video_view9_title_textalign'] == 'left') {
                echo 'text-align:left;';
            } elseif ($paramssld['video_view9_title_textalign'] == 'right') {
                echo 'text-align:right;';
            } elseif ($paramssld['video_view9_title_textalign'] == 'center') {
                echo 'text-align:center;';
            } elseif ($paramssld['video_view9_title_textalign'] == 'justify') {
                echo 'text-align:justify;';
            }
            ?>
;
		background-color:<?php 
            echo '#' . $paramssld['video_ht_view9_title_back_color'];
            ?>
 !important;  
		<?php 
            if ($paramssld['video_ht_view9_title_opacity'] != 100) {
                echo 'opacity:' . $paramssld['video_ht_view9_title_opacity'] / 100 . ';';
            }
            ?>
;    
	}
	.video_new_view_desc ul{
		list-style-type: none;
	}
	.video_new_view_desc{
		margin-top: 15px;
		font-size:<?php 
            echo $paramssld['video_ht_view9_desc_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view9_desc_color'];
            ?>
 !important;
		<?php 
            if ($paramssld['video_ht_view9_element_desc_show'] == 'false') {
                echo 'display:none;';
            }
            ?>
;
		<?php 
            if ($paramssld['video_view9_desc_textalign'] == 'left') {
                echo 'text-align:left;';
            } elseif ($paramssld['video_view9_desc_textalign'] == 'right') {
                echo 'text-align:right;';
            } elseif ($paramssld['video_view9_desc_textalign'] == 'center') {
                echo 'text-align:center;';
            } elseif ($paramssld['video_view9_desc_textalign'] == 'justify') {
                echo 'text-align:justify;';
            }
            ?>
;
	      background-color:<?php 
            echo '#' . $paramssld['video_ht_view9_desc_back_color'];
            ?>
 !important;  
		<?php 
            if ($paramssld['video_ht_view9_desc_opacity'] != 100) {
                echo 'opacity:' . $paramssld['video_ht_view9_desc_opacity'] / 100 . ';';
            }
            ?>
; 
	}
	.paginate{
		font-size:<?php 
            echo $paramssld['video_ht_view9_paginator_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view9_paginator_color'];
            ?>
 !important;
		text-align: <?php 
            echo $paramssld['video_view9_paginator_position'];
            ?>
;
	}
	.paginate a{
		border-bottom: none !important;
	}
	.icon-style{
		font-size: <?php 
            echo $paramssld['video_ht_view9_paginator_icon_size'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view9_paginator_icon_color'];
            ?>
 !important;
	}
	.clear{
		clear:both;
	}
	.video_view9_img{
		display:block;
		margin: 0 auto;
	}
	.video_view9_vid_wrapper{
		position: relative;
		margin-bottom: 15px;
	}
	.video_view9_vid_wrapper iframe{
		/*position: relative;*/
		opacity: 1;
		cursor: pointer;
		float:<?php 
            if ($paramssld['video_view9_video_position'] == 'left') {
                echo 'left';
            } elseif ($paramssld['video_view9_video_position'] == 'center') {
                echo 'none';
            } elseif ($paramssld['video_view9_video_position'] == 'right') {
                echo 'right';
            }
            ?>
;


	}
	.thumb_image{
		  position: absolute;
		  width: 100%;
		  height: 100%;
	}
	.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}
	.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}
	.playbutton{
		width: 100%;
		height: 100%;
		position: absolute;
	}

	.load_more {
		margin: 10px 0;
		position:relative;
		text-align:<?php 
            if ($paramssld['video_view9_loadmore_position'] == 'left') {
                echo 'left';
            } elseif ($paramssld['video_view9_loadmore_position'] == 'center') {
                echo 'center';
            } elseif ($paramssld['video_view9_loadmore_position'] == 'right') {
                echo 'right';
            }
            ?>
;

		width:100%;


	}

	.load_more_button {
		border-radius: 10px;
		display:inline-block;
		padding:5px 15px;
		font-size:<?php 
            echo $paramssld['video_ht_view9_loadmore_fontsize'];
            ?>
px !important;
		color:<?php 
            echo '#' . $paramssld['video_ht_view9_loadmore_font_color'];
            ?>
 !important;
		background:<?php 
            echo '#' . $paramssld['video_ht_view9_button_color'];
            ?>
 !important;
		cursor:pointer;
		margin-top: 15px;

	}
	.load_more_button:hover{
		color:<?php 
            echo '#' . $paramssld['video_ht_view9_loadmore_font_color_hover'];
            ?>
 !important;
		background:<?php 
            echo '#' . $paramssld['video_ht_view9_button_color_hover'];
            ?>
 !important;
	} 
	.loading {
		display:none;
	}

</style>
<script>

	$(document).ready(function() {
  $('.thumb_wrapper').on('click', function(ev) {
  	var hugeid=$(this).parent().parent().index();
  	var myid=hugeid;
  	myid=parseInt(myid)/2;
  	
  	//alert(myid);
  	
 	//console.log($(this).parent().parent().index());
   $(".video_view9_img")[myid].src += "?autoplay=1";
   ev.preventDefault();
 
  });
});
//console.log($(".video_view9_img"));
</script>

<div class="video_view9_cont_wrapper" id="video_view9_cont_wrapper_video<?php 
            echo $videogalleryID;
            ?>
">
	<div id="video_view9_cont_list_video<?php 
            echo $videogalleryID;
            ?>
">
		<?php 
            foreach ($images as $image) {
                $idofgallery = $image->videogallery_id;
                //print_r($image);
            }
            global $wpdb;
            $pattern = '/-/';
            $query2 = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_galleries where id = '%d' order by ordering ASC ", $idofgallery);
            $gallery = $wpdb->get_results($query2);
            foreach ($gallery as $gall) {
                global $post;
                $pID = $post->ID;
                $disp_type = $gall->display_type;
                $count_page = $gall->content_per_page;
                if ($count_page == 0) {
                    $count_page = 999;
                } elseif (preg_match($pattern, $count_page)) {
                    $count_page = preg_replace($pattern, '', $count_page);
                }
                //var_dump($count_page) ;
            }
            global $wpdb;
            $num = $count_page;
            //$total = count($images) ;
            $total = intval((count($images) - 1) / $num + 1);
            //$total_img=count($images);
            if (isset($_GET['page-img' . $videogalleryID . $pID])) {
                $page = $_GET['page-img' . $videogalleryID . $pID];
            } else {
                $page = '';
            }
            $page = intval($page);
            if (empty($page) or $page < 0) {
                $page = 1;
            }
            if ($page > $total) {
                $page = $total;
            }
            $start = $page * $num - $num;
            $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_it_videogallery_videos where videogallery_id = '%d' order by ordering ASC LIMIT " . $start . "," . $num . "", $idofgallery);
            $page_images = $wpdb->get_results($query);
            if ($disp_type == 2) {
                $page_images = $images;
                $count_page = 9999;
            }
            ?>
			<input type="hidden" id="total" value="<?php 
            echo $total;
            ?>
" />
			<?php 
            foreach ($page_images as $key => $row) {
                $videourl = $row->image_url;
                //var_dump($row);
                $pattern = '/watch\\?v=/';
                $videourl = preg_replace($pattern, 'embed/', $videourl);
                $icon = youtube_or_vimeo($videourl);
                //var_dump($icon);
                $video_name = str_replace('__5_5_5__', '%', $row->name);
                $video_desc = str_replace('__5_5_5__', '%', $row->description);
                $video_thumb = $row->thumb_url;
                if ($paramssld['video_view9_image_position'] == 1) {
                    //var_dump($row);
                    ?>
			<div class="video_view9_container">
				<input type="hidden" class="pagenum" value="1" />
				<div class="video_view9_vid_wrapper">
					<?php 
                    if ($video_thumb != '') {
                        ?>
					<div class="thumb_wrapper" onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'">
						<img class="thumb_image" style="cursor: pointer;" src="<?php 
                        echo $video_thumb;
                        ?>
" alt="" />
						
							<div class="playbutton <?php 
                        echo $icon;
                        ?>
-icon"></div>
						
					</div>
					<?php 
                    }
                    ?>
					<div id="thevideo" style="display: block;">
							<?php 
                    $videourl = get_video_gallery_id_from_url($row->image_url);
                    if ($videourl[1] == 'youtube') {
                        ?>
								<iframe class="video_view9_img" width="<?php 
                        echo $paramssld['video_ht_view9_video_width'];
                        ?>
" height="<?php 
                        echo $paramssld['video_ht_view9_video_height'];
                        ?>
" src="//www.youtube.com/embed/<?php 
                        echo $videourl[0];
                        ?>
" style="border: 0;" allowfullscreen></iframe>
								<?php 
                    } else {
                        ?>
									<iframe class="video_view9_img" width="<?php 
                        echo $paramssld['video_ht_view9_video_width'];
                        ?>
" height="<?php 
                        echo $paramssld['video_ht_view9_video_height'];
                        ?>
" src="//player.vimeo.com/video/<?php 
                        echo $videourl[0];
                        ?>
"  style="border: 0;" allowfullscreen></iframe>
								<?php 
                    }
                    ?>
					</div>
				</div>
				<h1 class="video_new_view_title"><?php 
                    echo $video_name;
                    ?>
</h1>
				<div class="video_new_view_desc"><?php 
                    echo $video_desc;
                    ?>
</div>
			</div>
			<div class="clear"></div>
			<?php 
                } elseif ($paramssld['video_view9_image_position'] == 2) {
                    ?>
			<div class="video_view9_container">
				<input type="hidden" class="pagenum" value="1" />
				<h1 class="video_new_view_title"><?php 
                    echo $video_name;
                    ?>
</h1>
				<div class="video_view9_vid_wrapper">
									
						<?php 
                    if ($video_thumb != '') {
                        ?>
						<div class="thumb_wrapper" onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'">
							<img class="thumb_image" style="cursor: pointer;" src="<?php 
                        echo $video_thumb;
                        ?>
" alt="" />
							
							<div class="playbutton <?php 
                        echo $icon;
                        ?>
-icon"></div>
							
						</div>
						<?php 
                    }
                    ?>
						<div id="thevideo" style="display: block;">
								<?php 
                    $videourl = get_video_gallery_id_from_url($row->image_url);
                    if ($videourl[1] == 'youtube') {
                        ?>
								<iframe class="video_view9_img" width="<?php 
                        echo $paramssld['video_ht_view9_video_width'];
                        ?>
" height="<?php 
                        echo $paramssld['video_ht_view9_video_height'];
                        ?>
" src="//www.youtube.com/embed/<?php 
                        echo $videourl[0];
                        ?>
" style="border: 0;" allowfullscreen></iframe>
								<?php 
                    } else {
                        ?>
									<iframe class="video_view9_img" width="<?php 
                        echo $paramssld['video_ht_view9_video_width'];
                        ?>
" height="<?php 
                        echo $paramssld['video_ht_view9_video_height'];
                        ?>
" src="//player.vimeo.com/video/<?php 
                        echo $videourl[0];
                        ?>
"  style="border: 0;" allowfullscreen></iframe>
								<?php 
                    }
                    ?>
							<!-- <iframe class="video_view9_img" width="<?php 
                    echo $paramssld['video_ht_view9_video_width'];
                    ?>
" height="<?php 
                    echo $paramssld['video_ht_view9_video_height'];
                    ?>
" src="<?php 
                    echo $videourl;
                    ?>
" frameborder="0" allowfullscreen> -->
							
				 		</iframe>
						</div>
				
				</div>
				<div class="video_new_view_desc"><?php 
                    echo $video_desc;
                    ?>
</div>
			
			</div>
			
			<div class="clear"></div>
			<?php 
                } elseif ($paramssld['video_view9_image_position'] == 3) {
                    ?>
			<div class="video_view9_container">
				<input type="hidden" class="pagenum" value="1" />
				<h1 class="video_new_view_title"><?php 
                    echo $video_name;
                    ?>
</h1>
				<div class="video_new_view_desc"><?php 
                    echo $video_desc;
                    ?>
</div>
				<div class="video_view9_vid_wrapper">
					<?php 
                    if ($video_thumb != '') {
                        ?>
						<div class="thumb_wrapper" onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'">
							<img class="thumb_image" style="cursor: pointer;" src="<?php 
                        echo $video_thumb;
                        ?>
" alt="" />
							
							<div class="playbutton <?php 
                        echo $icon;
                        ?>
-icon"></div>
							
						</div>
						<?php 
                    }
                    ?>
						<div id="thevideo" style="display: block;">
								<?php 
                    $videourl = get_video_gallery_id_from_url($row->image_url);
                    if ($videourl[1] == 'youtube') {
                        ?>
								<iframe class="video_view9_img" width="<?php 
                        echo $paramssld['video_ht_view9_video_width'];
                        ?>
" height="<?php 
                        echo $paramssld['video_ht_view9_video_height'];
                        ?>
" src="//www.youtube.com/embed/<?php 
                        echo $videourl[0];
                        ?>
" style="border: 0;" allowfullscreen></iframe>
								<?php 
                    } else {
                        ?>
									<iframe class="video_view9_img" width="<?php 
                        echo $paramssld['video_ht_view9_video_width'];
                        ?>
" height="<?php 
                        echo $paramssld['video_ht_view9_video_height'];
                        ?>
" src="//player.vimeo.com/video/<?php 
                        echo $videourl[0];
                        ?>
"  style="border: 0;" allowfullscreen></iframe>
								<?php 
                    }
                    ?>
							<!-- <iframe class="video_view9_img" width="<?php 
                    echo $paramssld['video_ht_view9_video_width'];
                    ?>
" height="<?php 
                    echo $paramssld['video_ht_view9_video_height'];
                    ?>
" src="<?php 
                    echo $videourl;
                    ?>
" frameborder="0" allowfullscreen> -->
							
				 		</iframe>
						</div>
				</div>
			</div>

			<div class="clear"></div>
			<?php 
                }
            }
            ?>
	</div>
	
		<?php 
            $path_site = plugins_url("/../Front_images", __FILE__);
            $a = $disp_type;
            if ($a == 1) {
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                $pattern3 = "/\\?page-img[0-9]+=[0-9]+/";
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                        header("Location:" . $actual_link . "");
                        exit;
                    }
                } elseif (preg_match($pattern3, $actual_link)) {
                    $actual_link = preg_replace($pattern3, '', $actual_link);
                    header("Location:" . $actual_link . "");
                    exit;
                }
                ?>
				<div class="load_more">
					<div class="load_more_button"><?php 
                echo $paramssld['video_ht_view9_loadmore_text'];
                ?>
</div>
					<div class="loading"><img src="<?php 
                if ($paramssld['loading_type'] == '1') {
                    echo $path_site . '/arrows/loading1.gif';
                } elseif ($paramssld['loading_type'] == '2') {
                    echo $path_site . '/arrows/loading4.gif';
                } elseif ($paramssld['loading_type'] == '3') {
                    echo $path_site . '/arrows/loading36.gif';
                } elseif ($paramssld['loading_type'] == '4') {
                    echo $path_site . '/arrows/loading51.gif';
                }
                ?>
"></div>
					<script>
						jQuery(document).ready(function(){
							if(jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button").length){
								jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button").on("click tap",function(){
									if(jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()<jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
										var pagenum = parseInt(jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()) + 1;
										var perpage =<?php 
                echo $count_page;
                ?>
;
										var galleryid="<?php 
                echo $image->videogallery_id;
                ?>
";
										var width="<?php 
                echo $paramssld['video_ht_view9_video_width'];
                ?>
";
										var height="<?php 
                echo $paramssld['video_ht_view9_video_height'];
                ?>
";
										var position="<?php 
                echo $paramssld['video_view9_image_position'];
                ?>
";
										getresult(pagenum,perpage,galleryid,width,height,position);
									}else{
										jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button').hide();
									}
									return false;
								});
							}
if(jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button').hide();
											}
							function getresult(pagenum,perpage,galleryid,width,height,position){
								var data = {
										action:"huge_it_video_gallery_ajax",
										task:'load_videos',
										page:pagenum,
										perpage:perpage,
										galleryid:galleryid,
										width:width,
										height:height,
										position:position
								}
								jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .loading').show();
								jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button').hide();
								jQuery.post('<?php 
                echo admin_url("admin-ajax.php");
                ?>
',data,function(response){
									if(response.success){
										setTimeout(function(){
											jQuery("#video_view9_cont_list_video<?php 
                echo $videogalleryID;
                ?>
").append(response.success);
											jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button').show();
											jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .loading').hide();
											
										},10);
										setTimeout(function(){
											if(jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .pagenum:last").val()==jQuery("#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 #total").val()) {
												jQuery('#video_view9_cont_wrapper_video<?php 
                echo $videogalleryID;
                ?>
 .load_more_button').hide();
											}
										},1000);

									}else{
										alert("no");
									}
								},"json");
							}

						});
					</script>
				</div>
				<?php 
            } elseif ($a == 0) {
                ?>
		<div class="paginate">
			<?php 
                $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
                $actual_link = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "";
                $checkREQ = '';
                $pattern = "/\\?p=/";
                $pattern2 = "/&page-img[0-9]+=[0-9]+/";
                $pattern3 = "/?page-img[0-9]+=[0-9]+/";
                //$res=preg_match($pattern, $actual_link);
                if (preg_match($pattern, $actual_link)) {
                    if (preg_match($pattern2, $actual_link)) {
                        $actual_link = preg_replace($pattern2, '', $actual_link);
                    }
                    $checkREQ = $actual_link . '&page-img' . $videogalleryID . $pID;
                } else {
                    $checkREQ = '?page-img' . $videogalleryID . $pID;
                }
                //var_dump($res);
                // Проверяем нужны ли стрелки назад
                $pervpage = '';
                if ($page != 1) {
                    $pervpage = '<a href= ' . $checkREQ . '=1><i class="icon-style hugeiticons-fast-backward" ></i></a>  
			                               <a href= ' . $checkREQ . '=' . ($page - 1) . '><i class="icon-style hugeiticons-chevron-left"></i></a> ';
                }
                // Проверяем нужны ли стрелки вперед
                $nextpage = '';
                if ($page != $total) {
                    $nextpage = ' <a href= ' . $checkREQ . '=' . ($page + 1) . '><i class="icon-style hugeiticons-chevron-right"></i></a>  
			                                   <a href= ' . $checkREQ . '=' . $total . '><i class="icon-style hugeiticons-fast-forward" ></i></a>';
                }
                // Находим две ближайшие станицы с обоих краев, если они есть
                /*if($page - 2 > 0) $page2left = ' <a href= ./?page='. ($page - 2) .'>'. ($page - 2) .'</a> | ';  
                		if($page - 1 > 0) $page1left = '<a href= ./?page='. ($page - 1) .'>'. ($page - 1) .'</a> | ';  
                		if($page + 2 <= $total) $page2right = ' | <a href= ./?page='. ($page + 2) .'>'. ($page + 2) .'</a>';  
                		if($page + 1 <= $total) $page1right = ' | <a href= ./?page='. ($page + 1) .'>'. ($page + 1) .'</a>'; */
                // Вывод меню
                echo $pervpage . $page . '/' . $total . $nextpage;
                ?>
</div>
<?php 
            }
            ?>
				
</div>
<?php 
            break;
    }
    ?>
	
      <?php 
    return ob_get_clean();
}
function front_end_slider($images, $paramssld, $slider)
{
    ob_start();
    $sliderID = $slider[0]->id;
    $slidertitle = $slider[0]->name;
    $sliderheight = $slider[0]->sl_height;
    $sliderwidth = $slider[0]->sl_width;
    $slidereffect = $slider[0]->slider_list_effects_s;
    $slidepausetime = $slider[0]->description + $slider[0]->param;
    $sliderpauseonhover = $slider[0]->pause_on_hover;
    $sliderposition = $slider[0]->sl_position;
    $slidechangespeed = $slider[0]->param;
    $slideshow_title_position = explode('-', trim($paramssld['slider_title_position']));
    $slideshow_description_position = explode('-', trim($paramssld['slider_description_position']));
    $hasyoutube = false;
    $hasvimeo = false;
    foreach ($images as $key => $image_row) {
        if (strpos($image_row->image_url, 'youtube') !== false) {
            $hasyoutube = true;
        }
        if (strpos($image_row->image_url, 'vimeo') !== false) {
            $hasvimeo = true;
        }
    }
    ?>


<?php 
    if ($hasvimeo == true) {
        ?>
<script src="<?php 
        echo plugins_url('js/vimeo.lib.js', __FILE__);
        ?>
"></script>
<script>
jQuery(function(){
	var vimeoPlayer = document.querySelector('iframe');

	var volumes = [];
	var colors = [];
	var i=0;		
	<?php 
        $i = 0;
        //$vimeoparams=array_reverse($images);
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'vimeo') !== false) {
                ?>
		volumes[<?php 
                echo $i;
                ?>
] = '<?php 
                echo intval($image_row->description) / 100;
                ?>
';
		colors[<?php 
                echo $i;
                ?>
] = '<?php 
                echo $image_row->link_target;
                ?>
';
	<?php 
                $i++;
            }
        }
        ?>
		
	jQuery('iframe').each(function(){
				Froogaloop(this).addEvent('ready', ready);
	});
	jQuery(".sidedock,.controls").remove();
	function ready(player_id) {
	
		froogaloop = $f(player_id);
	
		function setupEventListeners() {
			function setVideoVolume(player_id,value) {
				Froogaloop(player_id).api('setVolume',value);
			}	
			function setVideoColor(player_id,value) {
				Froogaloop(player_id).api('setColor',value);
			}			
			function onPlay() {
				froogaloop.addEvent('play',
				function(){
					video_is_playing_<?php 
        echo $sliderID;
        ?>
=true;
				});
			}
			function onPause() {
				froogaloop.addEvent('pause',
				function(){
					video_is_playing_<?php 
        echo $sliderID;
        ?>
=false;
				});
			}					
			function stopVimeoVideo(player){
				Froogaloop(player).api('pause');
			}
			
			setVideoVolume(player_id,volumes[i]);
			setVideoColor(player_id,colors[i]);
			i++;			
			
			onPlay();
			onPause();
			jQuery('#huge_it_slideshow_left_<?php 
        echo $sliderID;
        ?>
, #huge_it_slideshow_right_<?php 
        echo $sliderID;
        ?>
,.huge_it_slideshow_dots_<?php 
        echo $sliderID;
        ?>
').click(function(){
				stopVimeoVideo(player_id);
			});
		}
		setupEventListeners();
	}
});		
</script>
<?php 
    }
    ?>

<?php 
    if ($hasyoutube == true) {
        ?>

<script src="<?php 
        echo plugins_url('js/youtube.lib.js', __FILE__);
        ?>
"></script>
<script> 
  <?php 
        function get_youtube_id_from_url($url)
        {
            if (stristr($url, 'youtu.be/')) {
                preg_match('/(https:|http:|)(\\/\\/www\\.|\\/\\/|)(.*?)\\/(.{11})/i', $url, $final_ID);
                return $final_ID[4];
            } else {
                preg_match('/(https:|http:|):(\\/\\/www\\.|\\/\\/|)(.*?)\\/(embed\\/|watch\\?v=|(.*?)&v=|v\\/|e\\/|.+\\/|watch.*v=|)([a-z_A-Z0-9]{11})/i', $url, $IDD);
                return $IDD[6];
            }
        }
        $i = 0;
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                ?>
 
		var player_<?php 
                echo $image_row->id;
                ?>
;
<?php 
            } else {
                if (strpos($image_row->image_url, 'vimeo') !== false) {
                    ?>
				
<?php 
                } else {
                    continue;
                }
            }
            $i++;
        }
        ?>
		video_is_playing_<?php 
        echo $sliderID;
        ?>
=false;
		function onYouTubeIframeAPIReady() {
			<?php 
        foreach ($images as $key => $image_row) {
            ?>
							
				<?php 
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                ?>
 
				player_<?php 
                echo $image_row->id;
                ?>
 = new YT.Player('video_id_<?php 
                echo $sliderID;
                ?>
_<?php 
                echo $key;
                ?>
', {
				  height: '<?php 
                echo $sliderheight;
                ?>
',
				  width: '<?php 
                echo $sliderwidth;
                ?>
',
				  videoId: '<?php 
                echo get_youtube_id_from_url($image_row->image_url);
                ?>
',
				   playerVars: {
					'controls': <?php 
                if ($images[$key]->sl_url == "on") {
                    echo 1;
                } else {
                    echo 0;
                }
                ?>
,           
					'showinfo': <?php 
                if ($images[$key]->link_target == "on") {
                    echo 1;
                } else {
                    echo 0;
                }
                ?>
				  },
				  events: {
					'onReady': onPlayerReady_<?php 
                echo $image_row->id;
                ?>
,
					'onStateChange': onPlayerStateChange_<?php 
                echo $image_row->id;
                ?>
,
					'loop':1
				  }
				});
			<?php 
            } else {
                continue;
            }
        }
        ?>
		}
		
		
<?php 
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                ?>
 
		  function onPlayerReady_<?php 
                echo $image_row->id;
                ?>
(event) {	
			 player_<?php 
                echo $image_row->id;
                ?>
.setVolume(<?php 
                echo $images[$key]->description;
                ?>
);
		  }
		  
		  function onPlayerStateChange_<?php 
                echo $image_row->id;
                ?>
(event) {
			//(event.data);
			if (event.data == YT.PlayerState.PLAYING) {
				event.target.setPlaybackQuality('<?php 
                echo $images[$key]->name;
                ?>
');
				video_is_playing_<?php 
                echo $sliderID;
                ?>
=true;
			}
			else{
				video_is_playing_<?php 
                echo $sliderID;
                ?>
=false;
			}
		  }
<?php 
            } else {
                continue;
            }
        }
        ?>
	function stopYoutubeVideo() {
		<?php 
        $i = 0;
        foreach ($images as $key => $image_row) {
            if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                ?>
			player_<?php 
                echo $image_row->id;
                ?>
.pauseVideo();
		<?php 
            } else {
                continue;
            }
            $i++;
        }
        ?>
	}

</script>
<?php 
    }
    ?>
	
	
<script>
	var data_<?php 
    echo $sliderID;
    ?>
 = [];      
	var event_stack_<?php 
    echo $sliderID;
    ?>
 = [];
	video_is_playing_<?php 
    echo $sliderID;
    ?>
=false;
	<?php 
    //	$images=array_reverse($images);
    $recent_posts = wp_get_recent_posts($args, ARRAY_A);
    $i = 0;
    foreach ($images as $image) {
        $imagerowstype = $image->sl_type;
        if ($image->sl_type == '') {
            $imagerowstype = 'image';
        }
        switch ($imagerowstype) {
            case 'image':
                echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                $strdesription = str_replace('"', "'", $image->description);
                $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                $stralt = str_replace('"', "'", $image->name);
                $stralt = preg_replace("/\r|\n/", " ", $stralt);
                echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                $i++;
                break;
            case 'video':
                echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                $strdesription = str_replace('"', "'", $image->description);
                $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                $stralt = str_replace('"', "'", $image->name);
                $stralt = preg_replace("/\r|\n/", " ", $stralt);
                echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                $i++;
                break;
            case 'last_posts':
                foreach ($recent_posts as $keyl => $recentimage) {
                    if (get_the_post_thumbnail($recentimage["ID"], 'thumbnail') != '') {
                        if ($keyl < $image->sl_url) {
                            echo 'data_' . $sliderID . '["' . $i . '"]=[];';
                            echo 'data_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                            echo 'data_' . $sliderID . '["' . $i . '"]["image_url"]="' . $recentimage['guid'] . '";';
                            $strdesription = str_replace('"', "'", $recentimage['post_content']);
                            $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                            $strdesription = substr_replace($strdesription, "", $image->description);
                            echo 'data_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                            $stralt = str_replace('"', "'", $recentimage['post_title']);
                            $stralt = preg_replace("/\r|\n/", " ", $stralt);
                            echo 'data_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                            $i++;
                        }
                    }
                }
                break;
        }
    }
    ?>
	
	

      var huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = false;
      var huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 = <?php 
    echo $slidechangespeed;
    ?>
;
      var huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
;
      // Stop autoplay.
      window.clearInterval(huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
);
	  
     var huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 = '<?php 
    echo isset($current_key) ? $current_key : '';
    ?>
';
	 function huge_it_move_dots_<?php 
    echo $sliderID;
    ?>
() {
        var image_left = jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").position().left;
        var image_right = jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").position().left + jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").outerWidth(true);
       
      }
      function huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
() {
        return huge_it_testDom_<?php 
    echo $sliderID;
    ?>
('Transition');
      }
      function huge_it_testBrowser_cssTransforms3d_<?php 
    echo $sliderID;
    ?>
() {
        return huge_it_testDom_<?php 
    echo $sliderID;
    ?>
('Perspective');
      }
      function huge_it_testDom_<?php 
    echo $sliderID;
    ?>
(prop) {
        // Browser vendor CSS prefixes.
        var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
        // Browser vendor DOM prefixes.
        var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
        var i = domPrefixes.length;
        while (i--) {
          if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
            return true;
          }
        }
        return false;
      }
		function huge_it_cube_<?php 
    echo $sliderID;
    ?>
(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
		
        /* If browser does not support 3d transforms/CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
()) {
			jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
          return huge_it_fallback_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
        }
        if (!huge_it_testBrowser_cssTransforms3d_<?php 
    echo $sliderID;
    ?>
()) {
          return huge_it_fallback3d_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
        }
			//alert(current_image_class+' '+next_image_class);
		  jQuery(current_image_class).css({'z-index': 'none'});
          jQuery(next_image_class).css({'z-index' : 2});
        huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");  
		jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
        jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").css('perspective', 1000);
        jQuery(current_image_class).css({
          transform : 'translateZ(' + tz + 'px)',
          backfaceVisibility : 'hidden'
        });
		
		 jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
,.huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_item_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_second_item_<?php 
    echo $sliderID;
    ?>
 ").css('overflow', 'visible');
		
        jQuery(next_image_class).css({
          opacity : 1,
          filter: 'Alpha(opacity=100)',
          backfaceVisibility : 'hidden',
          transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
        });
        jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").css({
          transform: 'translateZ(-' + tz + 'px)',
          transformStyle: 'preserve-3d'
        });
        /* Execution steps.*/
        setTimeout(function () {
          jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").css({
            transition: 'all ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms ease-in-out',
            transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
          });
        }, 20);
        /* After transition.*/
        jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          /*if (huge_it_from_focus_<?php 
    echo $sliderID;
    ?>
) {
            huge_it_from_focus_<?php 
    echo $sliderID;
    ?>
 = false;
            return;
          }*/
		  jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_item_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_second_item_<?php 
    echo $sliderID;
    ?>
 ").css('overflow', 'hidden');
		  jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").removeAttr('style');
          jQuery(current_image_class).removeAttr('style');
          jQuery(next_image_class).removeAttr('style');
          jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").removeAttr('style');
		 // alert(current_image_class+' '+next_image_class);
          jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
         // huge_it_change_watermark_container_<?php 
    echo $sliderID;
    ?>
();
          huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = false;
          if (typeof event_stack_<?php 
    echo $sliderID;
    ?>
 !== 'undefined' && event_stack_<?php 
    echo $sliderID;
    ?>
.length > 0) {
            key = event_stack_<?php 
    echo $sliderID;
    ?>
[0].split("-");
            event_stack_<?php 
    echo $sliderID;
    ?>
.shift();
            huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(key[0], key[1], data_<?php 
    echo $sliderID;
    ?>
, true,false);
          }
        }
      }
      function huge_it_cubeH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image width.*/
        var dimension = jQuery(current_image_class).width() / 2;
        if (direction == 'right') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
        }
      }
      function huge_it_cubeV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image height.*/
        var dimension = jQuery(current_image_class).height() / 2;
        /* If next slide.*/
        if (direction == 'right') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_<?php 
    echo $sliderID;
    ?>
(dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction);
        }
      }
      /* For browsers that does not support transitions.*/
      function huge_it_fallback_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_fade_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
      }
      /* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
      function huge_it_fallback3d_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_sliceV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
      }
      function huge_it_none_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
        jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});

        /* Set active thumbnail.*/
        jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
      }
      function huge_it_fade_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
		if (huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
()) {
			
          jQuery(next_image_class).css('transition', 'opacity ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms linear');
		  jQuery(current_image_class).css('transition', 'opacity ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms linear');
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
        }
        else {
		
          jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
);
          jQuery(next_image_class).animate({
              'opacity' : 1,
              'z-index': 2
            }, {
              duration: huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
,
              complete: function () {return false;}
            });
          // For IE.
          jQuery(current_image_class).fadeTo(huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
, 0);
          jQuery(next_image_class).fadeTo(huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
, 1);
        }

		jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
		jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
      }
      function huge_it_grid_<?php 
    echo $sliderID;
    ?>
(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
        /* If browser does not support CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_<?php 
    echo $sliderID;
    ?>
()) {
			jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
          return huge_it_fallback_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
		  
        }
        huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 + "_<?php 
    echo $sliderID;
    ?>
").removeClass("huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
").addClass("huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
");
        /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
        var count = (huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
) / (cols + rows);
        /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
        function huge_it_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
          var delay = (c + r) * count;
          /* Return a gridlet elem with styles for specific transition.*/
          return jQuery('<div class="huge_it_gridlet_<?php 
    echo $sliderID;
    ?>
" />').css({
            width : width,
            height : height,
            top : top,
            left : left,
            backgroundImage : 'url("' + src + '")',
            backgroundColor: jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").css("background-color"),
            /*backgroundColor: rgba(0, 0, 0, 0),*/
            backgroundRepeat: 'no-repeat',
            backgroundPosition : img_left + 'px ' + img_top + 'px',
            backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
            transition : 'all ' + huge_it_transition_duration_<?php 
    echo $sliderID;
    ?>
 + 'ms ease-in-out ' + delay + 'ms',
            transform : 'none'
          });
        }
        /* Get the current slide's image.*/
        var cur_img = jQuery(current_image_class).find('img');
        /* Create a grid to hold the gridlets.*/
        var grid = jQuery('<div />').addClass('huge_it_grid_<?php 
    echo $sliderID;
    ?>
');
        /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
        jQuery(current_image_class).prepend(grid);
        /* vars to calculate positioning/size of gridlets*/
        var cont = jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
");
        var imgWidth = cur_img.width();
        var imgHeight = cur_img.height();
        var contWidth = cont.width(),
            contHeight = cont.height(),
            imgSrc = cur_img.attr('src'),/*.replace('/thumb', ''),*/
            colWidth = Math.floor(contWidth / cols),
            rowHeight = Math.floor(contHeight / rows),
            colRemainder = contWidth - (cols * colWidth),
            colAdd = Math.ceil(colRemainder / cols),
            rowRemainder = contHeight - (rows * rowHeight),
            rowAdd = Math.ceil(rowRemainder / rows),
            leftDist = 0,
            img_leftDist = (jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").width() - cur_img.width()) / 2;
        /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
        tx = tx === 'auto' ? contWidth : tx;
        tx = tx === 'min-auto' ? - contWidth : tx;
        ty = ty === 'auto' ? contHeight : ty;
        ty = ty === 'min-auto' ? - contHeight : ty;
        /* Loop through cols*/
        for (var i = 0; i < cols; i++) {
          var topDist = 0,
              img_topDst = (jQuery(".huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
").height() - cur_img.height()) / 2,
              newColWidth = colWidth;
          /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
          if (colRemainder > 0) {
            var add = colRemainder >= colAdd ? colAdd : colRemainder;
            newColWidth += add;
            colRemainder -= add;
          }
          /* Nested loop to create row gridlets for each col.*/
          for (var j = 0; j < rows; j++)  {
            var newRowHeight = rowHeight,
                newRowRemainder = rowRemainder;
            /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
            if (newRowRemainder > 0) {
              add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
              newRowHeight += add;
              newRowRemainder -= add;
            }
            /* Create & append gridlet to grid.*/
            grid.append(huge_it_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
            topDist += newRowHeight;
            img_topDst -= newRowHeight;
          }
          img_leftDist -= newColWidth;
          leftDist += newColWidth;
        }
        /* Set event listener on last gridlet to finish transitioning.*/
        var last_gridlet = grid.children().last();
        /* Show grid & hide the image it replaces.*/
        grid.show();
        cur_img.css('opacity', 0);
        /* Add identifying classes to corner gridlets (useful if applying border radius).*/
        grid.children().first().addClass('rs-top-left');
        grid.children().last().addClass('rs-bottom-right');
        grid.children().eq(rows - 1).addClass('rs-bottom-left');
        grid.children().eq(- rows).addClass('rs-top-right');
        /* Execution steps.*/
        setTimeout(function () {
          grid.children().css({
            opacity: op,
            transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
          });
        }, 1);
        jQuery(next_image_class).css('opacity', 1);
        /* After transition.*/
        jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          cur_img.css('opacity', 1);
          grid.remove();
          huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
 = false;
          if (typeof event_stack_<?php 
    echo $sliderID;
    ?>
 !== 'undefined' && event_stack_<?php 
    echo $sliderID;
    ?>
.length > 0) {
            key = event_stack_<?php 
    echo $sliderID;
    ?>
[0].split("-");
            event_stack_<?php 
    echo $sliderID;
    ?>
.shift();
            huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(key[0], key[1], data_<?php 
    echo $sliderID;
    ?>
, true,false);
          }
        }
      }
      function huge_it_sliceH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_sliceV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'min-auto';
        }
        else if (direction == 'left') {
          var translateY = 'auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_slideV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'auto';
        }
        else if (direction == 'left') {
          var translateY = 'min-auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_slideH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleOut_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleIn_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blockScale_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(8, 6, 0, 0, 0, .6, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_kaleidoscope_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_fan_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var rotate = 45;
          var translateX = 100;
        }
        else if (direction == 'left') {
          var rotate = -45;
          var translateX = -100;
        }
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blindV_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_blindH_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_<?php 
    echo $sliderID;
    ?>
(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_random_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction) {
        var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV'];
        /* Pick a random transition from the anims array.*/
        this["huge_it_" + anims[Math.floor(Math.random() * anims.length)] + "_<?php 
    echo $sliderID;
    ?>
"](current_image_class, next_image_class, direction);
      }
      
      function iterator_<?php 
    echo $sliderID;
    ?>
() {
        var iterator = 1;

        return iterator;
     }
	 
     function huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(current_key, key, data_<?php 
    echo $sliderID;
    ?>
, from_effect,clicked) {
		
        if (data_<?php 
    echo $sliderID;
    ?>
[key]) {
		
			if(video_is_playing_<?php 
    echo $sliderID;
    ?>
 && !clicked){
				return false;
			}
         
		 
		 
          if (!from_effect) {
            // Change image key.
            jQuery("#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
").val(key);
             // if (current_key == '-2') { /* Dots.*/
				current_key = jQuery(".huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
").attr("image_key");
			//  }
          }

          if (huge_it_trans_in_progress_<?php 
    echo $sliderID;
    ?>
) {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" --IN TRANSACTION-- <br />");
            event_stack_<?php 
    echo $sliderID;
    ?>
.push(current_key + '-' + key);
            return;
          }
		  
          var direction = 'right';
          if (huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 > key) {
            var direction = 'left';
          }
          else if (huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 == key) {
            return false;
          }
         
          // Set active thumbnail position.
      
          huge_it_current_key_<?php 
    echo $sliderID;
    ?>
 = key;
          //Change image id, title, description.
          jQuery("#huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
").attr('image_id', data_<?php 
    echo $sliderID;
    ?>
[key]["id"]);
		  
		  
		  jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").html(data_<?php 
    echo $sliderID;
    ?>
[key]["alt"]);
          jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").html(data_<?php 
    echo $sliderID;
    ?>
[key]["description"]);
        
		  var current_image_class = "#image_id_<?php 
    echo $sliderID;
    ?>
_" + data_<?php 
    echo $sliderID;
    ?>
[current_key]["id"];
          var next_image_class = "#image_id_<?php 
    echo $sliderID;
    ?>
_" + data_<?php 
    echo $sliderID;
    ?>
[key]["id"];
          
		  
		
		 if(jQuery(current_image_class).find('.huge_it_video_frame_<?php 
    echo $sliderID;
    ?>
').length>0) {
			var streffect='<?php 
    echo $slidereffect;
    ?>
';
			if(streffect=="cubeV" || streffect=="cubeH" || streffect=="none" || streffect=="fade"){
				huge_it_<?php 
    echo $slidereffect;
    ?>
_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
			}else{	
				huge_it_fade_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
			}	
		  }else{	
				huge_it_<?php 
    echo $slidereffect;
    ?>
_<?php 
    echo $sliderID;
    ?>
(current_image_class, next_image_class, direction);
		  }	
		  
		  
		jQuery('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').html()==""){jQuery('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');}

		jQuery('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').html()==""){jQuery('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');}
	  
		  
		  
		  jQuery(current_image_class).find('.huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');
		  jQuery(current_image_class).find('.huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
').addClass('none');
		
		

		  
		  //errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after("--cur-key="+current_key+" --cur-img-class="+current_image_class+" nxt-img-class="+next_image_class+"--");
			 huge_it_move_dots_<?php 
    echo $sliderID;
    ?>
();
			<?php 
    foreach ($images as $key => $image_row) {
        if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
            ?>
				stopYoutubeVideo();
			<?php 
        }
    }
    ?>
			window.clearInterval(huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
);
			play_<?php 
    echo $sliderID;
    ?>
();
        }

      }
	  
      function huge_it_popup_resize_<?php 
    echo $sliderID;
    ?>
() {

		var staticsliderwidth=<?php 
    echo $sliderwidth;
    ?>
;
		var sliderwidth=<?php 
    echo $sliderwidth;
    ?>
;
		
		var bodyWidth=jQuery(window).width();
        var parentWidth = jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").parent().width();
		//if responsive js late responsive.js @  take body size and not parent div
		if(sliderwidth>parentWidth){sliderwidth=parentWidth;}
		if(sliderwidth>bodyWidth){sliderwidth=bodyWidth;}
		
		var str=(<?php 
    echo $sliderheight;
    ?>
/staticsliderwidth);
		
		jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").css({height: ((sliderwidth) * str)});
		jQuery(".huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
").css({height: ((sliderwidth) * str)});
			
		if("<?php 
    echo $slideshow_title_position[1];
    ?>
"=="middle"){var titlemargintopminus=jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").outerHeight()/2;}		
		if("<?php 
    echo $slideshow_title_position[0];
    ?>
"=="center"){var titlemarginleftminus=jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").outerWidth()/2;}		
		jQuery(".huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
").css({cssText: "margin-top:-" + titlemargintopminus + "px; margin-left:-"+titlemarginleftminus+"px;"});
		
		if("<?php 
    echo $slideshow_description_position[1];
    ?>
"=="middle"){var descriptionmargintopminus=jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").outerHeight()/2;}	
		if("<?php 
    echo $slideshow_description_position[0];
    ?>
"=="center"){var descriptionmarginleftminus=jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").outerWidth()/2;}
		jQuery(".huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
").css({cssText: "margin-top:-" + descriptionmargintopminus + "px; margin-left:-"+descriptionmarginleftminus+"px;"});		
		
		
		if("<?php 
    echo $paramssld['slider_crop_image'];
    ?>
"=="resize"){
			jQuery(".huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
,  .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
 img").css({
				cssText: "width:" + sliderwidth + "px; height:" + ((sliderwidth) * str)	+"px;"
			});
		}else {
			jQuery(".huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
,.huge_it_slideshow_image_item2_<?php 
    echo $sliderID;
    ?>
").css({
			cssText: "max-width: " + sliderwidth + "px !important; max-height: " + (sliderwidth * str) + "px !important;"
		  });
		}
		
		jQuery('.huge_it_video_frame_<?php 
    echo $sliderID;
    ?>
').each(function (e) {
          jQuery(this).width(sliderwidth);
          jQuery(this).height(sliderwidth * str);
        });
      }
      
      jQuery(window).load(function () {
			jQuery(window).resize(function() {
				huge_it_popup_resize_<?php 
    echo $sliderID;
    ?>
();
			});
			
			jQuery('#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
').on('click',function(){
				huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) - iterator_<?php 
    echo $sliderID;
    ?>
()) >= 0 ? (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) - iterator_<?php 
    echo $sliderID;
    ?>
()) % data_<?php 
    echo $sliderID;
    ?>
.length : data_<?php 
    echo $sliderID;
    ?>
.length - 1, data_<?php 
    echo $sliderID;
    ?>
,false,true);
				return false;
			});
			
			jQuery('#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
').on('click',function(){
				huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) + iterator_<?php 
    echo $sliderID;
    ?>
()) % data_<?php 
    echo $sliderID;
    ?>
.length, data_<?php 
    echo $sliderID;
    ?>
,false,true);
				return false;
			});
			
			huge_it_popup_resize_<?php 
    echo $sliderID;
    ?>
();
			/* Disable right click.*/
			jQuery('div[id^="huge_it_container"]').bind("contextmenu", function () {
			  return false;
			});
						
			/*HOVER SLIDESHOW*/
			jQuery("#huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_dots_container_<?php 
    echo $sliderID;
    ?>
,#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
,#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").hover(function(){
				//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" -- hover -- <br /> ");
				jQuery("#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
").css({'display':'inline'});
				jQuery("#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").css({'display':'inline'});
			},function(){
				jQuery("#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
").css({'display':'none'});
				jQuery("#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").css({'display':'none'});
			});
			var pausehover="<?php 
    echo $sliderpauseonhover;
    ?>
";
			if(pausehover=="on"){
				jQuery("#huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
, .huge_it_slideshow_dots_container_<?php 
    echo $sliderID;
    ?>
,#huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
,#huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
").hover(function(){
					window.clearInterval(huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
);
				},function(){
					window.clearInterval(huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
);
					play_<?php 
    echo $sliderID;
    ?>
();
				});		
			}	
			play_<?php 
    echo $sliderID;
    ?>
();        
      });

      function play_<?php 
    echo $sliderID;
    ?>
() {	   
        /* Play.*/
		//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" -- paly  ---- ");
        huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
 = setInterval(function () {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
").after(" -- time left ---- ");
          var iterator = 1;
          huge_it_change_image_<?php 
    echo $sliderID;
    ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
').val()) + iterator) % data_<?php 
    echo $sliderID;
    ?>
.length, data_<?php 
    echo $sliderID;
    ?>
,false,false);
        }, '<?php 
    echo $slidepausetime;
    ?>
');
      }
	  
      jQuery(window).focus(function() {
       /*event_stack_<?php 
    echo $sliderID;
    ?>
 = [];*/
        var i_<?php 
    echo $sliderID;
    ?>
 = 0;
        jQuery(".huge_it_slider_<?php 
    echo $sliderID;
    ?>
").children("div").each(function () {
          if (jQuery(this).css('opacity') == 1) {
            jQuery("#huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
").val(i_<?php 
    echo $sliderID;
    ?>
);
          }
          i_<?php 
    echo $sliderID;
    ?>
++;
        });
      });
      jQuery(window).blur(function() {
        event_stack_<?php 
    echo $sliderID;
    ?>
 = [];
        window.clearInterval(huge_it_playInterval_<?php 
    echo $sliderID;
    ?>
);
      });      
    </script>
	<style>				
	 .huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
 {
		height:<?php 
    echo $sliderheight;
    ?>
px;
		width:<?php 
    echo $sliderwidth;
    ?>
px;
		position:relative;
		display: block;
		text-align: center;
		/*HEIGHT FROM HEADER.PHP*/
		clear:both;
		<?php 
    if ($sliderposition == "left") {
        $position = 'float:left;';
    } elseif ($sliderposition == "right") {
        $position = 'float:right;';
    } else {
        $position = 'float:none; margin:0px auto;';
    }
    ?>
		<?php 
    echo $position;
    ?>
		
		border-style:solid;
		border-left:0px !important;
		border-right:0px !important;
	}


	.huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
 * {
		box-sizing: border-box;
		-moz-box-sizing: border-box;
		-webkit-box-sizing: border-box;
	}
		 

	  .huge_it_slideshow_image_<?php 
    echo $sliderID;
    ?>
 {
			/*width:100%;*/
	  }

	  #huge_it_slideshow_left_<?php 
    echo $sliderID;
    ?>
,
	  #huge_it_slideshow_right_<?php 
    echo $sliderID;
    ?>
 {
		cursor: pointer;
		display:none;
		display: block;
		
		height: 100%;
		outline: medium none;
		position: absolute;

		/*z-index: 10130;*/
		z-index: 13;
		bottom:25px;
		top:50%;		
	  }
	 

	  #huge_it_slideshow_left-ico_<?php 
    echo $sliderID;
    ?>
,
	  #huge_it_slideshow_right-ico_<?php 
    echo $sliderID;
    ?>
 {
		z-index: 13;
		-moz-box-sizing: content-box;
		box-sizing: content-box;
		cursor: pointer;
		display: table;
		left: -9999px;
		line-height: 0;
		margin-top: -15px;
		position: absolute;
		top: 50%;
		/*z-index: 10135;*/
	  }
	  #huge_it_slideshow_left-ico_<?php 
    echo $sliderID;
    ?>
:hover,
	  #huge_it_slideshow_right-ico_<?php 
    echo $sliderID;
    ?>
:hover {
		cursor: pointer;
	  }
	  
	  .huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
 {
		display: table;
		position: relative;
		top:0px;
		left:0px;
		text-align: center;
		vertical-align: middle;
		width:100%;
	  }	  
		
	  .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 {
		text-decoration: none;
		position: absolute;
		z-index: 11;
		display: inline-block;
		<?php 
    if ($paramssld['slider_title_has_margin'] == 'on') {
        $slider_title_width = $paramssld['slider_title_width'] - 6;
        $slider_title_height = $paramssld['slider_title_height'] - 6;
        $slider_title_margin = "3";
    } else {
        $slider_title_width = $paramssld['slider_title_width'];
        $slider_title_height = $paramssld['slider_title_height'];
        $slider_title_margin = "0";
    }
    ?>
		
		width:<?php 
    echo $slider_title_width;
    ?>
%;
		/*height:<?php 
    echo $slider_title_height;
    ?>
%;*/
		
		<?php 
    if ($slideshow_title_position[0] == "left") {
        echo 'left:' . $slider_title_margin . '%;';
    } elseif ($slideshow_title_position[0] == "center") {
        echo 'left:50%;';
    } elseif ($slideshow_title_position[0] == "right") {
        echo 'right:' . $slider_title_margin . '%;';
    }
    if ($slideshow_title_position[1] == "top") {
        echo 'top:' . $slider_title_margin . '%;';
    } elseif ($slideshow_title_position[1] == "middle") {
        echo 'top:50%;';
    } elseif ($slideshow_title_position[1] == "bottom") {
        echo 'bottom:' . $slider_title_margin . '%;';
    }
    ?>
		padding:2%;
		text-align:<?php 
    echo $paramssld['slider_title_text_align'];
    ?>
;  
		font-weight:bold;
		color:#<?php 
    echo $paramssld['slider_title_color'];
    ?>
;
			
		background:<?php 
    list($r, $g, $b) = array_map('hexdec', str_split($paramssld['slider_title_background_color'], 2));
    $titleopacity = $paramssld["slider_title_background_transparency"] / 100;
    echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
    ?>
;
		border-style:solid;
		font-size:<?php 
    echo $paramssld['slider_title_font_size'];
    ?>
px;
		border-width:<?php 
    echo $paramssld['slider_title_border_size'];
    ?>
px;
		border-color:#<?php 
    echo $paramssld['slider_title_border_color'];
    ?>
;
		border-radius:<?php 
    echo $paramssld['slider_title_border_radius'];
    ?>
px;
	  }
	  	  
	  .huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
 {
		text-decoration: none;
		position: absolute;
		z-index: 11;
		border-style:solid;
		display: inline-block;
		<?php 
    if ($paramssld['slider_description_has_margin'] == 'on') {
        $slider_description_width = $paramssld['slider_description_width'] - 6;
        $slider_description_height = $paramssld['slider_description_height'] - 6;
        $slider_description_margin = "3";
    } else {
        $slider_description_width = $paramssld['slider_description_width'];
        $slider_descriptione_height = $paramssld['slider_description_height'];
        $slider_description_margin = "0";
    }
    ?>
		
		width:<?php 
    echo $slider_description_width;
    ?>
%;
		/*height:<?php 
    echo $slider_description_height;
    ?>
%;*/
		<?php 
    if ($slideshow_description_position[0] == "left") {
        echo 'left:' . $slider_description_margin . '%;';
    } elseif ($slideshow_description_position[0] == "center") {
        echo 'left:50%;';
    } elseif ($slideshow_description_position[0] == "right") {
        echo 'right:' . $slider_description_margin . '%;';
    }
    if ($slideshow_description_position[1] == "top") {
        echo 'top:' . $slider_description_margin . '%;';
    } elseif ($slideshow_description_position[1] == "middle") {
        echo 'top:50%;';
    } elseif ($slideshow_description_position[1] == "bottom") {
        echo 'bottom:' . $slider_description_margin . '%;';
    }
    ?>
		padding:3%;
		text-align:<?php 
    echo $paramssld['slider_description_text_align'];
    ?>
;  
		color:#<?php 
    echo $paramssld['slider_description_color'];
    ?>
;
		
		background:<?php 
    list($r, $g, $b) = array_map('hexdec', str_split($paramssld['slider_description_background_color'], 2));
    $descriptionopacity = $paramssld["slider_description_background_transparency"] / 100;
    echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $descriptionopacity . ') !important';
    ?>
;
		border-style:solid;
		font-size:<?php 
    echo $paramssld['slider_description_font_size'];
    ?>
px;
		border-width:<?php 
    echo $paramssld['slider_description_border_size'];
    ?>
px;
		border-color:#<?php 
    echo $paramssld['slider_description_border_color'];
    ?>
;
		border-radius:<?php 
    echo $paramssld['slider_description_border_radius'];
    ?>
px;
	  }
	  
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
.none, .huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
.none,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
.hidden, .huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
.hidden	   {display:none;}
	      
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h1, .huge_it_slideshow_description_text_<?php 
    echo $sliderID;
    ?>
 h1,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h2, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h2,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h3, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h3,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h4, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 h4,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 p, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 p,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 strong,  .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 strong,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 span, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 span,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 ul, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 ul,
	   .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 li, .huge_it_slideshow_title_text_<?php 
    echo $sliderID;
    ?>
 li {
			padding:2px;
			margin:0px;
	   }

	  .huge_it_slide_container_<?php 
    echo $sliderID;
    ?>
 {
		display: table-cell;
		margin: 0 auto;
		position: relative;
		vertical-align: middle;
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
	  }
	  .huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
 {
		margin: 0 auto;
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
	  }
	  .huge_it_slider_<?php 
    echo $sliderID;
    ?>
 {
		width:100%;
		height:100%;
		display:table !important;
		padding:0px !important;
		margin:0px !important;
		
	  }
	  .huge_it_slideshow_image_item_<?php 
    echo $sliderID;
    ?>
 {
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
		display: table-cell;
		filter: Alpha(opacity=100);
		opacity: 1;
		position: absolute;
		top:0px;
		left:0px;
		vertical-align: middle;
		z-index: 1;
		margin:0px !important;
		padding:0px  !important;
		border-radius: <?php 
    echo $paramssld['slider_slideshow_border_radius'];
    ?>
px !important;
	  }
	  .huge_it_slideshow_image_second_item_<?php 
    echo $sliderID;
    ?>
 {
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
		display: table-cell;
		filter: Alpha(opacity=0);
		opacity: 0;
		position: absolute;
		top:0px;
		left:0px;
		vertical-align: middle;
		overflow:hidden;
		margin:0px !important;
		visibility:visible !important;
		padding:0px  !important;
		border-radius: <?php 
    echo $paramssld['slider_slideshow_border_radius'];
    ?>
px !important;
	  }
	  
	   .huge_it_slideshow_image_second_item_<?php 
    echo $sliderID;
    ?>
 a, .huge_it_slideshow_image_item_<?php 
    echo $sliderID;
    ?>
 a {
			display:block;
			width:100%;
			height:100%;	
	   }
	   
	  .huge_it_grid_<?php 
    echo $sliderID;
    ?>
 {
		display: none;
		height: 100%;
		overflow: hidden;
		position: absolute;
		width: 100%;
	  }
	  .huge_it_gridlet_<?php 
    echo $sliderID;
    ?>
 {
		opacity: 1;
		filter: Alpha(opacity=100);
		position: absolute;
	  }
	  
					
	  .huge_it_slideshow_dots_container_<?php 
    echo $sliderID;
    ?>
 {
		display: table;
		position: absolute;
		width:100% !important;
		height:100% !important;
	  }
	  .huge_it_slideshow_dots_thumbnails_<?php 
    echo $sliderID;
    ?>
 {
		margin: 0 auto;
		overflow: hidden;
		position: absolute;
		width:100%;
		height:30px;
	  }
	  
	  .huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
 {
		display: inline-block;
		position: relative;
		cursor: pointer;
		box-shadow: 1px 1px 1px rgba(0,0,0,0.1) inset, 1px 1px 1px rgba(255,255,255,0.1);
		width:10px;
		height: 10px;
		border-radius: 10px;
		background: #00f;
		margin: 10px;
		overflow: hidden;
		z-index: 17;
	  }
	  
	  .huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
 {
		opacity: 1;
		filter: Alpha(opacity=100);
	  }
	  .huge_it_slideshow_dots_deactive_<?php 
    echo $sliderID;
    ?>
 {
	  
	  }
	  
	
		
		.huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
 {
			background:#<?php 
    echo $paramssld['slider_slider_background_color'];
    ?>
;
			border-width:<?php 
    echo $paramssld['slider_slideshow_border_size'];
    ?>
px;
			border-color:#<?php 
    echo $paramssld['slider_slideshow_border_color'];
    ?>
;
			border-radius:<?php 
    echo $paramssld['slider_slideshow_border_radius'];
    ?>
px;
		}
		
		.huge_it_slideshow_dots_thumbnails_<?php 
    echo $sliderID;
    ?>
 {
			<?php 
    if ($paramssld['slider_dots_position'] == "bottom") {
        ?>
			bottom:0px;
			<?php 
    } else {
        if ($paramssld['slider_dots_position'] == "none") {
            ?>
			display:none;
			<?php 
        } else {
            ?>
			top:0px; <?php 
        }
    }
    ?>
		}
		
		.huge_it_slideshow_dots_<?php 
    echo $sliderID;
    ?>
 {
			background:#<?php 
    echo $paramssld['slider_dots_color'];
    ?>
;
		}
		
		.huge_it_slideshow_dots_active_<?php 
    echo $sliderID;
    ?>
 {
			background:#<?php 
    echo $paramssld['slider_active_dot_color'];
    ?>
;
		}
		
		<?php 
    $arrowfolder = plugins_url('slider-image/Front_images/arrows');
    switch ($paramssld['slider_navigation_type']) {
        case 1:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-21px;
						height:43px;
						width:29px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.simple.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-21px;
						height:43px;
						width:29px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.simple.png) right top no-repeat; 
					}
				<?php 
            break;
        case 2:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.shadow.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.shadow.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:left -50px;
					}

					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:right -50px;
					}
				<?php 
            break;
        case 3:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-22px;
						height:44px;
						width:44px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.simple.dark.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-22px;
						height:44px;
						width:44px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.simple.dark.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:left -44px;
					}

					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:right -44px;
					}
				<?php 
            break;
        case 4:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-33px;
						height:65px;
						width:59px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.cube.dark.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-33px;
						height:65px;
						width:59px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.cube.dark.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:left -66px;
					}

					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:right -66px;
					}
				<?php 
            break;
        case 5:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-18px;
						height:37px;
						width:40px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.light.blue.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-18px;
						height:37px;
						width:40px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.light.blue.png) right top no-repeat; 
					}

				<?php 
            break;
        case 6:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.light.cube.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.light.cube.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:left -50px;
					}

					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:right -50px;
					}
				<?php 
            break;
        case 7:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						right:0px;
						margin-top:-19px;
						height:38px;
						width:38px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.light.transparent.circle.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-19px;
						height:38px;
						width:38px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.light.transparent.circle.png) right top no-repeat; 
					}
				<?php 
            break;
        case 8:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.png) right top no-repeat; 
					}
				<?php 
            break;
        case 9:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.blue.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.blue.png) right top no-repeat; 
					}
				<?php 
            break;
        case 10:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-24px;
						height:48px;
						width:48px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.green.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-24px;
						height:48px;
						width:48px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.circle.green.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:left -48px;
					}

					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
:hover {
						background-position:right -48px;
					}
				<?php 
            break;
        case 11:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-29px;
						height:58px;
						width:55px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.blue.retro.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-29px;
						height:58px;
						width:55px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.blue.retro.png) right top no-repeat; 
					}
				<?php 
            break;
        case 12:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-37px;
						height:74px;
						width:74px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.green.retro.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-37px;
						height:74px;
						width:74px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.green.retro.png) right top no-repeat; 
					}
				<?php 
            break;
        case 13:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-16px;
						height:33px;
						width:33px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.red.circle.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-16px;
						height:33px;
						width:33px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.red.circle.png) right top no-repeat; 
					}
				<?php 
            break;
        case 14:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-51px;
						height:102px;
						width:52px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.triangle.white.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-51px;
						height:102px;
						width:52px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.triangle.white.png) right top no-repeat; 
					}
				<?php 
            break;
        case 15:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:0px;
						margin-top:-19px;
						height:39px;
						width:70px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.ancient.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:0px;
						margin-top:-19px;
						height:39px;
						width:70px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.ancient.png) right top no-repeat; 
					}
				<?php 
            break;
        case 16:
            ?>
					#huge_it_slideshow_left_<?php 
            echo $sliderID;
            ?>
 {	
						left:-21px;
						margin-top:-20px;
						height:40px;
						width:37px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.black.out.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_<?php 
            echo $sliderID;
            ?>
 {
						right:-21px;
						margin-top:-20px;
						height:40px;
						width:37px;
						background:url(<?php 
            echo $arrowfolder;
            ?>
/arrows.black.out.png) right top no-repeat; 
					}
				<?php 
            break;
    }
    ?>
	</style>
	<?php 
    $args = array('numberposts' => 10, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private', 'suppress_filters' => true);
    $recent_posts = wp_get_recent_posts($args, ARRAY_A);
    //print_r($recent_posts);
    //echo get_the_post_thumbnail(1, 'thumbnail');
    $image = wp_get_attachment_image_src(get_post_thumbnail_id(1), 'thumbnail');
    ?>
	<div class="huge_it_slideshow_image_wrap_<?php 
    echo $sliderID;
    ?>
">
      <?php 
    $current_pos = 0;
    ?>
		<!-- ##########################DOTS######################### -->
        <div class="huge_it_slideshow_dots_container_<?php 
    echo $sliderID;
    ?>
">
			  <div class="huge_it_slideshow_dots_thumbnails_<?php 
    echo $sliderID;
    ?>
">
				<?php 
    $current_image_id = 0;
    $current_pos = 0;
    $current_key = 0;
    $stri = 0;
    foreach ($images as $key => $image_row) {
        $imagerowstype = $image_row->sl_type;
        if ($image_row->sl_type == '') {
            $imagerowstype = 'image';
        }
        switch ($imagerowstype) {
            case 'image':
                if ($image_row->id == $current_image_id) {
                    $current_pos = $stri;
                    $current_key = $stri;
                }
                ?>
								<div id="huge_it_dots_<?php 
                echo $stri;
                ?>
_<?php 
                echo $sliderID;
                ?>
" class="huge_it_slideshow_dots_<?php 
                echo $sliderID;
                ?>
 <?php 
                echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                ?>
" onclick="huge_it_change_image_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                echo $sliderID;
                ?>
').val()), '<?php 
                echo $stri;
                ?>
', data_<?php 
                echo $sliderID;
                ?>
,false,true);return false;" image_id="<?php 
                echo $image_row->id;
                ?>
" image_key="<?php 
                echo $stri;
                ?>
"></div>
							<?php 
                $stri++;
                break;
            case 'video':
                if ($image_row->id == $current_image_id) {
                    $current_pos = $stri;
                    $current_key = $stri;
                }
                ?>
								<div id="huge_it_dots_<?php 
                echo $stri;
                ?>
_<?php 
                echo $sliderID;
                ?>
" class="huge_it_slideshow_dots_<?php 
                echo $sliderID;
                ?>
 <?php 
                echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                ?>
" onclick="huge_it_change_image_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                echo $sliderID;
                ?>
').val()), '<?php 
                echo $stri;
                ?>
', data_<?php 
                echo $sliderID;
                ?>
,false,true);return false;" image_id="<?php 
                echo $image_row->id;
                ?>
" image_key="<?php 
                echo $stri;
                ?>
"></div>
							<?php 
                $stri++;
                break;
            case 'last_posts':
                foreach ($recent_posts as $lkeys => $last_posts) {
                    if ($lkeys < $image_row->sl_url) {
                        if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                            $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                            if ($image_row->id == $current_image_id) {
                                $current_pos = $stri;
                                $current_key = $stri;
                            }
                            ?>
								<div id="huge_it_dots_<?php 
                            echo $stri;
                            ?>
_<?php 
                            echo $sliderID;
                            ?>
" class="huge_it_slideshow_dots_<?php 
                            echo $sliderID;
                            ?>
 <?php 
                            echo $stri == $current_image_id ? 'huge_it_slideshow_dots_active_' . $sliderID : 'huge_it_slideshow_dots_deactive_' . $sliderID;
                            ?>
" onclick="huge_it_change_image_<?php 
                            echo $sliderID;
                            ?>
(parseInt(jQuery('#huge_it_current_image_key_<?php 
                            echo $sliderID;
                            ?>
').val()), '<?php 
                            echo $stri;
                            ?>
', data_<?php 
                            echo $sliderID;
                            ?>
,false,true);return false;" image_id="<?php 
                            echo $image_row->id;
                            ?>
" image_key="<?php 
                            echo $stri;
                            ?>
"></div>
							<?php 
                            $stri++;
                        }
                    }
                }
                break;
        }
    }
    ?>
			  </div>
			
			<?php 
    if ($paramssld['slider_show_arrows'] == "on") {
        ?>
				<a id="huge_it_slideshow_left_<?php 
        echo $sliderID;
        ?>
" href="#" >
					<div id="huge_it_slideshow_left-ico_<?php 
        echo $sliderID;
        ?>
">
					<div><i class="huge_it_slideshow_prev_btn_<?php 
        echo $sliderID;
        ?>
 fa"></i></div></div>
				</a>
				
				<a id="huge_it_slideshow_right_<?php 
        echo $sliderID;
        ?>
" href="#" >
					<div id="huge_it_slideshow_right-ico_<?php 
        echo $sliderID;
        ?>
 , data_<?php 
        echo $sliderID;
        ?>
">
					<div><i class="huge_it_slideshow_next_btn_<?php 
        echo $sliderID;
        ?>
 fa"></i></div></div>
				</a>
			<?php 
    }
    ?>
		</div>
	  <!-- ##########################IMAGES######################### -->
      <div id="huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
" class="huge_it_slideshow_image_container_<?php 
    echo $sliderID;
    ?>
">        
        <div class="huge_it_slide_container_<?php 
    echo $sliderID;
    ?>
">
          <div class="huge_it_slide_bg_<?php 
    echo $sliderID;
    ?>
">
            <ul class="huge_it_slider_<?php 
    echo $sliderID;
    ?>
">
			  <?php 
    $i = 0;
    foreach ($images as $key => $image_row) {
        $imagerowstype = $image_row->sl_type;
        if ($image_row->sl_type == '') {
            $imagerowstype = 'image';
        }
        switch ($imagerowstype) {
            case 'image':
                $target = "";
                ?>
					  <li class="huge_it_slideshow_image<?php 
                if ($i != $current_image_id) {
                    $current_key = $key;
                    echo '_second';
                }
                ?>
_item_<?php 
                echo $sliderID;
                ?>
" id="image_id_<?php 
                echo $sliderID . '_' . $i;
                ?>
">      
						<?php 
                if ($image_row->sl_url != "") {
                    if ($image_row->link_target == "on") {
                        $target = 'target="_blank' . $image_row->link_target . '"';
                    }
                    echo '<a href="' . $image_row->sl_url . '" ' . $target . '>';
                }
                ?>
						<img id="huge_it_slideshow_image_<?php 
                echo $sliderID;
                ?>
" class="huge_it_slideshow_image_<?php 
                echo $sliderID;
                ?>
" src="<?php 
                echo $image_row->image_url;
                ?>
" image_id="<?php 
                echo $image_row->id;
                ?>
" />
						<?php 
                if ($image_row->sl_url != "") {
                    echo '</a>';
                }
                ?>
		
						<div class="huge_it_slideshow_title_text_<?php 
                echo $sliderID;
                ?>
 <?php 
                if (trim($image_row->name) == "") {
                    echo "none";
                }
                ?>
">
							<?php 
                echo $image_row->name;
                ?>
						</div>
						<div class="huge_it_slideshow_description_text_<?php 
                echo $sliderID;
                ?>
 <?php 
                if (trim($image_row->description) == "") {
                    echo "none";
                }
                ?>
">
							<?php 
                echo $image_row->description;
                ?>
						</div>
					  </li>
					  <?php 
                $i++;
                break;
            case 'last_posts':
                foreach ($recent_posts as $lkeys => $last_posts) {
                    if ($lkeys < $image_row->sl_url) {
                        $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                        if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                            $target = "";
                            ?>
							  <li class="huge_it_slideshow_image<?php 
                            if ($i != $current_image_id) {
                                $current_key = $key;
                                echo '_second';
                            }
                            ?>
_item_<?php 
                            echo $sliderID;
                            ?>
" id="image_id_<?php 
                            echo $sliderID . '_' . $i;
                            ?>
">      
								<?php 
                            if ($image_row->sl_postlink == "1") {
                                if ($image_row->link_target == "on") {
                                    $target = 'target="_blank' . $image_row->link_target . '"';
                                }
                                echo '<a href="' . $last_posts["guid"] . '" ' . $target . '>';
                            }
                            ?>
								<img id="huge_it_slideshow_image_<?php 
                            echo $sliderID;
                            ?>
" class="huge_it_slideshow_image_<?php 
                            echo $sliderID;
                            ?>
" src="<?php 
                            echo $imagethumb[0];
                            ?>
" image_id="<?php 
                            echo $image_row->id;
                            ?>
" />
								<?php 
                            if ($image_row->sl_postlink == "1") {
                                echo '</a>';
                            }
                            ?>
		
								<div class="huge_it_slideshow_title_text_<?php 
                            echo $sliderID;
                            ?>
 <?php 
                            if (trim($last_posts["post_title"]) == "") {
                                echo "none";
                            }
                            if ($image_row->sl_stitle != "1") {
                                echo " hidden";
                            }
                            ?>
">
										<?php 
                            echo $last_posts["post_title"];
                            ?>
								</div>
								<div class="huge_it_slideshow_description_text_<?php 
                            echo $sliderID;
                            ?>
 <?php 
                            if (trim($last_posts["post_content"]) == "") {
                                echo "none";
                            }
                            if ($image_row->sl_sdesc != "1") {
                                echo " hidden";
                            }
                            ?>
">
									<?php 
                            echo substr_replace($last_posts["post_content"], "", $image_row->description);
                            ?>
								</div>
							 </li>
							  <?php 
                            $i++;
                        }
                    }
                }
                break;
            case 'video':
                ?>
						<li  class="huge_it_slideshow_image<?php 
                if ($i != $current_image_id) {
                    $current_key = $key;
                    echo '_second';
                }
                ?>
_item_<?php 
                echo $sliderID;
                ?>
" id="image_id_<?php 
                echo $sliderID . '_' . $i;
                ?>
">      
							<?php 
                if (strpos($image_row->image_url, 'youtube') !== false) {
                    $video_thumb_url = get_youtube_id_from_url($image_row->image_url);
                    ?>
									
									<div id="video_id_<?php 
                    echo $sliderID;
                    ?>
_<?php 
                    echo $key;
                    ?>
" class="huge_it_video_frame_<?php 
                    echo $sliderID;
                    ?>
"></div>
							<?php 
                } else {
                    $vimeo = $image_row->image_url;
                    $imgid = end(explode("/", $vimeo));
                    ?>
					
								<iframe id="player_<?php 
                    echo $key;
                    ?>
"  class="huge_it_video_frame_<?php 
                    echo $sliderID;
                    ?>
" src="//player.vimeo.com/video/<?php 
                    echo $imgid;
                    ?>
?api=1&player_id=player_<?php 
                    echo $key;
                    ?>
&showinfo=0&controls=0" frameborder="0" allowfullscreen></iframe>
							<?php 
                }
                ?>
						</li>
					<?php 
                $i++;
                break;
        }
    }
    ?>
			   <input  type="hidden" id="huge_it_current_image_key_<?php 
    echo $sliderID;
    ?>
" value="0" />
            </ul>
          </div>
        </div>
      </div>
	</div>
	  <?php 
    return ob_get_clean();
}
 function get_image_from_video($image_url)
 {
     if (strpos($image_url, 'youtube') !== false || strpos($image_url, 'youtu') !== false) {
         $liclass = "youtube";
         $video_thumb_url = get_youtube_id_from_url($image_url);
         $thumburl = 'http://img.youtube.com/vi/' . $video_thumb_url . '/mqdefault.jpg';
     } else {
         if (strpos($image_url, 'vimeo') !== false) {
             $liclass = "vimeo";
             $vimeo = $image_url;
             $vimeo_explode = explode("/", $vimeo);
             $imgid = end($vimeo_explode);
             $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $imgid . ".php"));
             $imgsrc = $hash[0]['thumbnail_large'];
             $thumburl = $imgsrc;
         }
     }
     return $thumburl;
 }
function front_end_gallery($images, $paramssld, $gallery)
{
    ob_start();
    $galleryID = $gallery[0]->id;
    $gallerytitle = $gallery[0]->name;
    $galleryheight = $gallery[0]->sl_height;
    $gallerywidth = $gallery[0]->sl_width;
    $galleryeffect = $gallery[0]->gallery_list_effects_s;
    $slidepausetime = $gallery[0]->description + $gallery[0]->param;
    $gallerypauseonhover = $gallery[0]->pause_on_hover;
    $galleryposition = $gallery[0]->sl_position;
    $slidechangespeed = $gallery[0]->param;
    $gallerychangeview = $gallery[0]->huge_it_sl_effects;
    ?>
<script>
	var lightbox_transition = '<?php 
    echo $paramssld['light_box_transition'];
    ?>
';
	var lightbox_speed = <?php 
    echo $paramssld['light_box_speed'];
    ?>
;
	var lightbox_fadeOut = <?php 
    echo $paramssld['light_box_fadeout'];
    ?>
;
	var lightbox_title = <?php 
    echo $paramssld['light_box_title'];
    ?>
;
	var lightbox_scalePhotos = <?php 
    echo $paramssld['light_box_scalephotos'];
    ?>
;
	var lightbox_scrolling = <?php 
    echo $paramssld['light_box_scrolling'];
    ?>
;
	var lightbox_opacity = <?php 
    echo $paramssld['light_box_opacity'] / 100 + 0.001;
    ?>
;
	var lightbox_open = <?php 
    echo $paramssld['light_box_open'];
    ?>
;
	var lightbox_returnFocus = <?php 
    echo $paramssld['light_box_returnfocus'];
    ?>
;
	var lightbox_trapFocus = <?php 
    echo $paramssld['light_box_trapfocus'];
    ?>
;
	var lightbox_fastIframe = <?php 
    echo $paramssld['light_box_fastiframe'];
    ?>
;
	var lightbox_preloading = <?php 
    echo $paramssld['light_box_preloading'];
    ?>
;
	var lightbox_overlayClose = <?php 
    echo $paramssld['light_box_overlayclose'];
    ?>
;
	var lightbox_escKey = <?php 
    echo $paramssld['light_box_esckey'];
    ?>
;
	var lightbox_arrowKey = <?php 
    echo $paramssld['light_box_arrowkey'];
    ?>
;
	var lightbox_loop = <?php 
    echo $paramssld['light_box_loop'];
    ?>
;
	var lightbox_closeButton = <?php 
    echo $paramssld['light_box_closebutton'];
    ?>
;
	var lightbox_previous = "<?php 
    echo $paramssld['light_box_previous'];
    ?>
";
	var lightbox_next = "<?php 
    echo $paramssld['light_box_next'];
    ?>
";
	var lightbox_close = "<?php 
    echo $paramssld['light_box_close'];
    ?>
";
	var lightbox_html = <?php 
    echo $paramssld['light_box_html'];
    ?>
;
	var lightbox_photo = <?php 
    echo $paramssld['light_box_photo'];
    ?>
;
	var lightbox_width = '<?php 
    if ($paramssld['light_box_size_fix'] == 'false') {
        echo '';
    } else {
        echo $paramssld['light_box_width'];
    }
    ?>
';
	var lightbox_height = '<?php 
    if ($paramssld['light_box_size_fix'] == 'false') {
        echo '';
    } else {
        echo $paramssld['lightbox_height'];
    }
    ?>
';
	var lightbox_innerWidth = '<?php 
    echo $paramssld['light_box_innerwidth'];
    ?>
';
	var lightbox_innerHeight = '<?php 
    echo $paramssld['light_box_innerheight'];
    ?>
';
	var lightbox_initialWidth = '<?php 
    echo $paramssld['light_box_initialwidth'];
    ?>
';
	var lightbox_initialHeight = '<?php 
    echo $paramssld['light_box_initialheight'];
    ?>
';
        
	var maxwidth=jQuery(window).width();
        if(maxwidth><?php 
    echo $paramssld['light_box_maxwidth'];
    ?>
){maxwidth=<?php 
    echo $paramssld['light_box_maxwidth'];
    ?>
;}
        var lightbox_maxWidth = <?php 
    if ($paramssld['light_box_size_fix'] == 'true') {
        echo '"100%"';
    } else {
        echo 'maxwidth';
    }
    ?>
;
        var lightbox_maxHeight = <?php 
    if ($paramssld['light_box_size_fix'] == 'true') {
        echo '"100%"';
    } else {
        echo $paramssld['light_box_maxheight'];
    }
    ?>
;
        
	var lightbox_slideshow = <?php 
    echo $paramssld['light_box_slideshow'];
    ?>
;
	var lightbox_slideshowSpeed = <?php 
    echo $paramssld['light_box_slideshowspeed'];
    ?>
;
	var lightbox_slideshowAuto = <?php 
    echo $paramssld['light_box_slideshowauto'];
    ?>
;
	var lightbox_slideshowStart = "<?php 
    echo $paramssld['light_box_slideshowstart'];
    ?>
";
	var lightbox_slideshowStop = "<?php 
    echo $paramssld['light_box_slideshowstop'];
    ?>
";
	var lightbox_fixed = <?php 
    echo $paramssld['light_box_fixed'];
    ?>
;
	<?php 
    $pos = $paramssld['lightbox_open_position'];
    switch ($pos) {
        case 1:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 1:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 2:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = false;
	<?php 
            break;
        case 3:
            ?>
		var lightbox_top = '10%';
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = '10%';
	<?php 
            break;
        case 4:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = false;
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 5:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = false;
	<?php 
            break;
        case 6:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = false;
		var lightbox_left = false;
		var lightbox_right = '10%';
	<?php 
            break;
        case 7:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = '10%';
		var lightbox_left = '10%';
		var lightbox_right = false;
	<?php 
            break;
        case 8:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = '10%';
		var lightbox_left = false;
		var lightbox_right = false;
	<?php 
            break;
        case 9:
            ?>
		var lightbox_top = false;
		var lightbox_bottom = '10%';
		var lightbox_left = false;
		var lightbox_right = '10%';
	<?php 
            break;
    }
    ?>
	
	var lightbox_reposition = <?php 
    echo $paramssld['light_box_reposition'];
    ?>
;
	var lightbox_retinaImage = <?php 
    echo $paramssld['light_box_retinaimage'];
    ?>
;
	var lightbox_retinaUrl = <?php 
    echo $paramssld['light_box_retinaurl'];
    ?>
;
	var lightbox_retinaSuffix = "<?php 
    echo $paramssld['light_box_retinasuffix'];
    ?>
";
	
				jQuery(document).ready(function(){
				jQuery("#huge_it_gallery_content_<?php 
    echo $galleryID;
    ?>
 a[href$='.jpg'], #huge_it_gallery_content_<?php 
    echo $galleryID;
    ?>
 a[href$='.jpeg'], #huge_it_gallery_content_<?php 
    echo $galleryID;
    ?>
 a[href$='.png'], #huge_it_gallery_content_<?php 
    echo $galleryID;
    ?>
 a[href$='.gif']").addClass('group1');
				
				
				jQuery(".group1").colorbox({rel:'group1'});
				jQuery(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
				jQuery(".vimeo").colorbox({iframe:true, innerWidth:640, innerHeight:390});
				jQuery(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
				jQuery(".inline").colorbox({inline:true, width:"50%"});
				jQuery(".callbacks").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});

				jQuery('.non-retina').colorbox({rel:'group5', transition:'none'})
				jQuery('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
				

				jQuery("#click").click(function(){ 
					jQuery('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
		
</script>
	<!--Huge IT gallery START-->
	<!-- GALLERY CONTENT POPUP -->
	<?php 
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (!is_plugin_active('lightbox/lightbox.php')) {
        ?>
	<link href="<?php 
        echo plugins_url('../style/colorbox-' . $paramssld['light_box_style'] . '.css', __FILE__);
        ?>
" rel="stylesheet" type="text/css" />
	<?php 
    }
    ?>
<!--	<link href="<?php 
    // echo plugins_url('../style/gallery-all.css', __FILE__);
    ?>
" rel="stylesheet" type="text/css" />
	<script src="<?php 
    // echo plugins_url('../js/jquery.colorbox.js', __FILE__);
    ?>
"></script>
	<script src="<?php 
    ?>
<?php// echo plugins_url('../js/gallery-all.js', __FILE__);?>"></script>
	<link rel="stylesheet" href="<?php 
    echo plugins_url('../style/style2-os.css', __FILE__);
    ?>
" />
	<script src="<?php 
    ?>
<?php// echo plugins_url('../js/jquery.hugeitmicro.min.js', __FILE__);?>"></script>
	<link href="<?php 
    //echo plugins_url('../style/lightbox.css', __FILE__);
    ?>
" rel="stylesheet" type="text/css" />-->
	
	
	<?php 
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (!is_plugin_active('wp-lightbox-2/wp-lightbox-2.php')) {
        ?>

	<?php 
    }
    ?>
	

	<?php 
    $i = $gallerychangeview;
    switch ($i) {
        case 0:
            ?>
<script>
jQuery(function(){
    var defaultBlockHeight=<?php 
            echo $paramssld['ht_view2_element_height'] + 37;
            ?>
;
	var defaultBlockWidth=<?php 
            echo $paramssld['ht_view2_element_width'];
            ?>
;
    var $container = jQuery('#huge_it_gallery_container_<?php 
            echo $galleryID;
            ?>
');

      // add randomish size classes
      $container.find('.element_<?php 
            echo $galleryID;
            ?>
').each(function(){
        var $this = jQuery(this),
            number = parseInt( $this.find('.number').text(), 10 );
			//alert(number);
        if ( number % 7 % 2 === 1 ) {
          $this.addClass('width2');
        }
        if ( number % 3 === 0 ) {
          $this.addClass('height2');
        }
      });
    
    $container.hugeitmicro({
      itemSelector : '.element_<?php 
            echo $galleryID;
            ?>
',
      masonry : {
        columnWidth : defaultBlockWidth+20
      },
      masonryHorizontal : {
        rowHeight: defaultBlockHeight+20
      },
      cellsByRow : {
        columnWidth : defaultBlockWidth+20,
        rowHeight : defaultBlockHeight
      },
      cellsByColumn : {
        columnWidth : defaultBlockWidth+20,
        rowHeight : defaultBlockHeight
      },
      getSortData : {
        symbol : function( $elem ) {
          return $elem.attr('data-symbol');
        },
        category : function( $elem ) {
          return $elem.attr('data-category');
        },
        number : function( $elem ) {
          return parseInt( $elem.find('.number').text(), 10 );
        },
        weight : function( $elem ) {
          return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
        },
        name : function ( $elem ) {
          return $elem.find('.name').text();
        }
      }
	 
    });
    
    
    <?php 
            if ($paramssld['ht_view2_content_in_center'] == 'on') {
                ?>
    centersection();
      jQuery(window).resize(function(){
          centersection();
      });
            function centersection(){
                var elementwidth=<?php 
                echo $paramssld['ht_view2_element_width'];
                ?>
 + 20 + <?php 
                echo $paramssld['ht_view2_element_border_width'] * 2;
                ?>
;
                var enterycontent=jQuery("#huge_it_gallery_container_<?php 
                echo $galleryID;
                ?>
").width();
                var whole=~~(enterycontent/(elementwidth));
                if(whole==0){ return false; }
                else { var sectionwidth= whole * elementwidth;}
                jQuery("#huge_it_gallery_container_moving_<?php 
                echo $galleryID;
                ?>
").width(sectionwidth).css({"margin":"0px auto","overflow":"hidden",});
//                 alert(elementwidth + " " + enterycontent + " " + whole + " " + sectionwidth);
      }
      <?php 
            }
            ?>
    
    
    
	var $optionSets = jQuery('#huge_it_gallery_options .option-set'),
	$optionLinks = $optionSets.find('a');

	$optionLinks.click(function(){
		var $this = jQuery(this);

		if ( $this.hasClass('selected') ) {
		  return false;
		}
		var $optionSet = $this.parents('.option-set');
		$optionSet.find('.selected').removeClass('selected');
		$this.addClass('selected');

		var options = {},
			key = $optionSet.attr('data-option-key'),
			value = $this.attr('data-option-value');

		value = value === 'false' ? false : value;
		options[ key ] = value;
		if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {

		  changeLayoutMode( $this, options )
		} else {

		  $container.hugeitmicro( options );
		}

		return false;
	});    

	var isHorizontal = false;
	function changeLayoutMode( $link, options ) {
		var wasHorizontal = isHorizontal;
		isHorizontal = $link.hasClass('horizontal');

		if ( wasHorizontal !== isHorizontal ) {

		  var style = isHorizontal ? 
			{ height: '100%', width: $container.width() } : 
			{ width: 'auto' };

		  $container.filter(':animated').stop();

		  $container.addClass('no-transition').css( style );
		  setTimeout(function(){
			$container.removeClass('no-transition').hugeitmicro( options );
		  }, 100 )
		} else {
		  $container.hugeitmicro( options );
		}
	}

    var $sortBy = jQuery('#sort-by');
    jQuery('#shuffle a').click(function(){
      $container.hugeitmicro('shuffle');
      $sortBy.find('.selected').removeClass('selected');
      $sortBy.find('[data-option-value="random"]').addClass('selected');
      return false;
    });
});

jQuery(document).ready(function(){

	jQuery('.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 .image-overlay a').on('click',function(){
		var strid = jQuery(this).attr('href').replace('#','');
		jQuery('body').append('<div id="huge-popup-overlay"></div>');
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
').insertBefore('#huge-popup-overlay');
		var height = jQuery(window).height();
		var width=jQuery(window).width();
		if(width<=767){
			jQuery('body').scrollTop(0);
			jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 iframe').height(jQuery('body').width()*0.5);
		}else {jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 iframe').height(jQuery('body').width()*0.23);}
		jQuery('#huge_it_gallery_pupup_element_'+strid).addClass('active').css({height:height*0.7});
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
').addClass('active');
		
		return false;
	});
	
	
	jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close').on('click',function(){
		closePopup();
		return false;
	});
	
	jQuery('body').on('click','#huge-popup-overlay',function(){
		closePopup();
		return false;
	});
	
	function closePopup() {
		jQuery('#huge-popup-overlay').remove();
		var videsrc=jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.active iframe').attr('src');
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.active iframe').attr('src','');
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.active iframe').attr('src',videsrc);
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li').removeClass('active');
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
').removeClass('active');
		
	}

	jQuery(window).resize(function(){
		jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 iframe').height(jQuery('#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
').width()*0.5);
	});

	
}); 
</script>

<style type="text/css">

.element_<?php 
            echo $galleryID;
            ?>
 {
	width:<?php 
            echo $paramssld['ht_view2_element_width'];
            ?>
px;
	height:<?php 
            echo $paramssld['ht_view2_element_height'] + 45;
            ?>
px;
	margin:0px 0px 10px 0px;
	background:#<?php 
            echo $paramssld['ht_view2_element_background_color'];
            ?>
;
	border:<?php 
            echo $paramssld['ht_view2_element_border_width'];
            ?>
px solid #<?php 
            echo $paramssld['ht_view2_element_border_color'];
            ?>
;
	outline:none;
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 {
	position:relative;
	width:100%;
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 img {
	width:<?php 
            echo $paramssld['ht_view2_element_width'];
            ?>
px !important;
	height:<?php 
            echo $paramssld['ht_view2_element_height'];
            ?>
px !important;
	display:block;
	border-radius: 0px !important;
	box-shadow: 0 0px 0px rgba(0, 0, 0, 0) !important; 
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 .image-overlay {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height:100%;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view2_element_overlay_color'], 2));
            $titleopacity = $paramssld["ht_view2_element_overlay_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
	display:none;
}

.element_<?php 
            echo $galleryID;
            ?>
:hover .image-block_<?php 
            echo $galleryID;
            ?>
  .image-overlay {
	display:block;
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 .image-overlay a {
	position:absolute;
	top:0px;
	left:0px;
	display:block;
	width:100%;
	height:100%;
	background:url('<?php 
            echo plugins_url('../images/zoom.' . $paramssld["ht_view2_zoombutton_style"] . '.png', __FILE__);
            ?>
') center center no-repeat;
}

.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 {
	position:relative;
	height: 30px;
	margin: 0;
	padding: 15px 0px 15px 0px;
	-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,.1);
	box-shadow: inset 0 1px 0 rgba(0,0,0,.1);
}

.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 h3 {
	position:relative;
	margin:0px !important;
	padding:0px 1% 0px 1% !important;
	width:98%;
	text-overflow: ellipsis;
	overflow: hidden; 
	white-space:nowrap;
	font-weight:normal;
	font-size: <?php 
            echo $paramssld["ht_view2_element_title_font_size"];
            ?>
px !important;
	line-height: <?php 
            echo $paramssld["ht_view2_popup_title_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view2_popup_title_font_color"];
            ?>
;
}

.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 .button-block {
	position:absolute;
	right:0px;
	top:0px;
	display:none;
	vertical-align:middle;
	height:30px;
	padding:10px 10px 4px 10px;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view2_element_overlay_color'], 2));
            $titleopacity = $paramssld["ht_view2_element_overlay_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
	border-left: 1px solid rgba(0,0,0,.05);
}
.element_<?php 
            echo $galleryID;
            ?>
:hover .title-block_<?php 
            echo $galleryID;
            ?>
 .button-block {display:block;}

.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a,.element .title-block_<?php 
            echo $galleryID;
            ?>
 a:link,.element .title-block_<?php 
            echo $galleryID;
            ?>
 a:visited,
.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:hover,.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:focus,.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:active {
	position:relative;
	display:block;
	vertical-align:middle;
	padding: 3px 10px 3px 10px; 
	border-radius:3px;
	font-size:<?php 
            echo $paramssld["ht_view2_element_linkbutton_font_size"];
            ?>
px;
	background:#<?php 
            echo $paramssld["ht_view2_element_linkbutton_background_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view2_element_linkbutton_color"];
            ?>
;
	text-decoration:none;
}

/*#####POPUP#####*/

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 {
	position:fixed;
	display:table;
	width:80%;
	top:7%;
	left:7%;
	margin:0px !important;
	padding:0px !important;
	list-style:none;
	z-index:2000;
	display:none;
	height:85%;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
.active {display:table;}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element {
	position:relative;
	display:none;
	width:100%;
	padding:40px 0px 20px 0px;
	min-height:100%;
	position:relative;
	background:#<?php 
            echo $paramssld["ht_view2_popup_background_color"];
            ?>
;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element.active {
	display:block;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 {
	position:absolute;
	width:100%;
	height:40px;
	top:0px;
	left:0px;
	z-index:2001;
	background:url('<?php 
            echo plugins_url('../images/divider.line.png', __FILE__);
            ?>
') center bottom repeat-x;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close,#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close:link, #huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close:visited {
	position:relative;
	float:right;
	width:40px;
	height:40px;
	display:block;
	background:url('<?php 
            echo plugins_url('../images/close.popup.' . $paramssld["ht_view2_popup_closebutton_style"] . '.png', __FILE__);
            ?>
') center center no-repeat;
	border-left:1px solid #ccc;
	opacity:.65;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close:hover, #huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close:focus, #huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .heading-navigation_<?php 
            echo $galleryID;
            ?>
 .close:active {opacity:1;}


#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 {
	overflow-y:scroll;
	position:relative;
	width:96%;
	height:98%;
	padding:2% 2% 0% 2%;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 {
	width:60%;
	<?php 
            if ($paramssld['ht_view2_popup_full_width'] == 'off') {
                echo "height:100%;";
            }
            ?>
	position:relative;
	float:left;
	margin-right:2%;
	border-right:1px solid #ccc;
	min-width:200px;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 img {
	    <?php 
            if ($paramssld['ht_view2_popup_full_width'] == 'off') {
                echo "max-width:100% !important; max-height:100% !important;margin: 0px auto !important; position:relative;";
            } else {
                echo "width:100% !important;";
            }
            ?>
	display:block;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 iframe  {
	width:100% !important;
	height:100%;
	display:block;

}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block {
	width:37%;
	position:relative;
	float:left;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block > div {
	padding-top:10px;
	margin-bottom:10px;
	<?php 
            if ($paramssld['ht_view2_show_separator_lines'] == "on") {
                ?>
		background:url('<?php 
                echo plugins_url('../images/divider.line.png', __FILE__);
                ?>
') center top repeat-x;
	<?php 
            }
            ?>
}
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block > div:last-child {background:none;}


#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .title {
	position:relative;
	display:block;
	margin:0px 0px 10px 0px !important;
	font-size:<?php 
            echo $paramssld["ht_view2_popup_title_font_size"];
            ?>
px !important;
	line-height:<?php 
            echo $paramssld["ht_view2_popup_title_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view2_popup_title_font_color"];
            ?>
;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description {
	clear:both;
	position:relative;
	font-weight:normal;
	text-align:justify;
	font-size:<?php 
            echo $paramssld["ht_view2_description_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view2_description_color"];
            ?>
;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description h1,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description h2,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description h3,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description h4,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description h5,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description h6,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description p, 
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description strong,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description span {
	padding:2px !important;
	margin:0px !important;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description ul,
#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block .description li {
	padding:2px 0px 2px 5px;
	margin:0px 0px 0px 8px;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block ul.thumbs-list {
	list-style:none;
	display:table;
	position:relative;
	clear:both;
	width:100%;
	margin:0px auto;
	padding:0px;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block ul.thumbs-list li {
	display:block;
	float:left;
	width:<?php 
            echo $paramssld["ht_view2_thumbs_width"];
            ?>
px;
	height:<?php 
            echo $paramssld["ht_view2_thumbs_height"];
            ?>
px;
	margin:0px 2% 5px 1% !important;
	opacity:0.45;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block ul.thumbs-list li.active,#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block ul.thumbs-list li:hover {
	opacity:1;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block ul.thumbs-list li a {
	display:block;
}

#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block ul.thumbs-list li img {
	width:<?php 
            echo $paramssld["ht_view2_thumbs_width"];
            ?>
px !important;
	height:<?php 
            echo $paramssld["ht_view2_thumbs_height"];
            ?>
px !important;
}


.pupup-element .button-block {
	position:relative;
}

.pupup-element .button-block a,.pupup-element .button-block a:link,.pupup-element .button-block a:visited {
	position:relative;
	display:inline-block;
	padding:6px 12px;
	background:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_background_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_color"];
            ?>
;
	font-size:<?php 
            echo $paramssld["ht_view2_popup_linkbutton_font_size"];
            ?>
;
	text-decoration:none;
}

.pupup-element .button-block a:hover,.pupup-element .button-block a:focus,.pupup-element .button-block a:active {
	background:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_background_hover_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view2_popup_linkbutton_font_hover_color"];
            ?>
;
}


#huge-popup-overlay {
	position:fixed;
	top:0px;
	left:0px;
	width:100%;
	height:100%;
	z-index:199;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view2_popup_overlay_color'], 2));
            $titleopacity = $paramssld["ht_view2_popup_overlay_transparency_color"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
}


@media only screen and (max-width: 767px) {
	
	#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 {
		position:absolute;
		left:0px;
		top:0px;
		width:100%;
		height:auto !important;
		left:0px;
	}
	
	#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element {
		margin:0px;
		height:auto !important;
		position:absolute;
		left:0px;
		top:0px;
	}

	#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 li.pupup-element .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 {
		height:auto !important;
		overflow-y:auto;
	}


	#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 {
		width:100%;
		float:none;
		clear:both;
		margin-right:0px;
		border-right:0px;
	}

	#huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
 .popup-wrapper_<?php 
            echo $galleryID;
            ?>
 .right-block {
		width:100%;
		float:none;
		clear:both;
		margin-right:0px;
		border-right:0px;
	}

	#huge-popup-overlay {
		position:fixed;
		top:0px;
		left:0px;
		width:100%;
		height:100%;
		z-index:199;
	}

}
</style>
<section id="huge_it_gallery_content_<?php 
            echo $galleryID;
            ?>
" >
  <div id="huge_it_gallery_container_<?php 
            echo $galleryID;
            ?>
" class="super-list variable-sizes clearfix">
  	<?php 
            foreach ($images as $key => $row) {
                $link = $row->sl_url;
                $descnohtml = strip_tags($row->description);
                $result = substr($descnohtml, 0, 50);
                ?>
		<div class="element_<?php 
                echo $galleryID;
                ?>
" tabindex="0" data-symbol="<?php 
                echo $row->name;
                ?>
" data-category="alkaline-earth">
			<div class="image-block_<?php 
                echo $galleryID;
                ?>
">
			<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        $imgurl = explode(";", $row->image_url);
                        ?>
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
"  />
							<?php 
                        } else {
                            ?>
							<img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg"  />
							<?php 
                        }
                        ?>

				<?php 
                        break;
                    case 'video':
                        ?>
							<?php 
                        $videourl = get_video_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
										<img alt="<?php 
                            echo $row->name;
                            ?>
" src="http://img.youtube.com/vi/<?php 
                            echo $videourl[0];
                            ?>
/mqdefault.jpg"  />		
								<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            ?>
										<img alt="<?php 
                            echo $row->name;
                            ?>
" src="<?php 
                            echo $imgsrc;
                            ?>
"  />
								<?php 
                        }
                        ?>
				<?php 
                        break;
                }
                ?>
			
				<div class="image-overlay"><a href="#<?php 
                echo $row->id;
                ?>
"></a></div>
			</div>
			<div class="title-block_<?php 
                echo $galleryID;
                ?>
">
				<h3><?php 
                echo $row->name;
                ?>
</h3>
				<?php 
                if ($paramssld["ht_view2_element_show_linkbutton"] == 'on') {
                    ?>
					<div class="button-block"><a href="<?php 
                    echo $row->sl_url;
                    ?>
" <?php 
                    if ($row->link_target == "on") {
                        echo 'target="_blank"';
                    }
                    ?>
 ><?php 
                    echo $paramssld["ht_view2_element_linkbutton_text"];
                    ?>
</a></div>
				<?php 
                }
                ?>
			</div>
		</div>	
		<?php 
            }
            ?>
	<div style="clear:both;"></div>
  </div>
</section>
<ul id="huge_it_gallery_popup_list_<?php 
            echo $galleryID;
            ?>
">
	<?php 
            foreach ($images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                $link = $row->sl_url;
                $descnohtml = strip_tags($row->description);
                $result = substr($descnohtml, 0, 50);
                ?>
		<li class="pupup-element" id="huge_it_gallery_pupup_element_<?php 
                echo $row->id;
                ?>
">
			<div class="heading-navigation_<?php 
                echo $galleryID;
                ?>
">
				<a href="#close" class="close"></a>
				<div style="clear:both;"></div>
			</div>
			<div class="popup-wrapper_<?php 
                echo $galleryID;
                ?>
">
				<div class="image-block_<?php 
                echo $galleryID;
                ?>
">					
					<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
"  />
							<?php 
                        } else {
                            ?>
							<img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg"  />
							<?php 
                        }
                        ?>
	

					<?php 
                        break;
                    case 'video':
                        ?>
								<?php 
                        $videourl = get_video_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
										<iframe src="//www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
" frameborder="0" allowfullscreen></iframe>
									<?php 
                        } else {
                            ?>
										<iframe src="//player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
?title=0&amp;byline=0&amp;portrait=0" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
									<?php 
                        }
                        ?>
					<?php 
                        break;
                }
                ?>
	
				</div>
				<div class="right-block">
					<?php 
                if ($paramssld["ht_view2_show_popup_title"] == 'on') {
                    ?>
<h3 class="title"><?php 
                    echo $row->name;
                    ?>
</h3><?php 
                }
                ?>
					<?php 
                if ($paramssld["ht_view2_show_description"] == 'on') {
                    ?>
<div class="description"><?php 
                    echo $row->description;
                    ?>
</div><?php 
                }
                ?>
					<?php 
                if ($paramssld["ht_view2_show_popup_linkbutton"] == 'on') {
                    ?>
						<div class="button-block">
						<a href="<?php 
                    echo $link;
                    ?>
"  <?php 
                    if ($row->link_target == "on") {
                        echo 'target="_blank"';
                    }
                    ?>
><?php 
                    echo $paramssld["ht_view2_popup_linkbutton_text"];
                    ?>
</a>
						</div>
					<?php 
                }
                ?>
					<div style="clear:both;"></div>
				</div>
				<div style="clear:both;"></div>
			</div>
		</li>
		<?php 
            }
            ?>
</ul>
	  
  <?php 
            break;
            /////////////////////////////////// VIEW 1 CONTENT SLIDER ////////////////////////////////////
        /////////////////////////////////// VIEW 1 CONTENT SLIDER ////////////////////////////////////
        case 1:
            ?>


  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.4/jquery.touchSwipe.min.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.0.0/animate.min.css">
  <link href="<?php 
            echo plugins_url('../style/liquid-slider.css', __FILE__);
            ?>
" rel="stylesheet" type="text/css" />
 
<style>
* {outline:none;}
#main-slider_<?php 
            echo $galleryID;
            ?>
 {background:#<?php 
            echo $paramssld["ht_view5_slider_background_color"];
            ?>
;}

#main-slider_<?php 
            echo $galleryID;
            ?>
 div.slider-content {
	position:relative;
	width:100%;
	padding:0px 0px 0px 0px;
	position:relative;
	background:#<?php 
            echo $paramssld["ht_view5_slider_background_color"];
            ?>
;
}



[class$="-arrow"] {
	background-image:url(<?php 
            echo plugins_url('../images/arrow.' . $paramssld["ht_view5_icons_style"] . '.png', __FILE__);
            ?>
);
}

.ls-select-box {
	background:url(<?php 
            echo plugins_url('../images/menu.' . $paramssld["ht_view5_icons_style"] . '.png', __FILE__);
            ?>
) right center no-repeat #<?php 
            echo $paramssld["ht_view5_slider_background_color"];
            ?>
;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
-nav-select {
	color:#<?php 
            echo $paramssld["ht_view5_title_font_color"];
            ?>
;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 div.slider-content .slider-content-wrapper {
	position:relative;
	width:100%;
	padding:0px;
	display:block;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $galleryID;
            ?>
 {
	position:relative;
	width:<?php 
            echo $paramssld["ht_view5_main_image_width"];
            ?>
px;
	display:table-cell;
	padding:0px 10px 0px 0px;
	float:left;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $galleryID;
            ?>
 img.main-image {
	position:relative;
	width:100%;
	height:auto;
	display:block;
}


#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $galleryID;
            ?>
 .play-icon {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height:100%;	
}
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $galleryID;
            ?>
  .play-icon.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $galleryID;
            ?>
  .play-icon.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}




#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block {
	display:table-cell;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block > div {
	padding-bottom:10px;
	margin-top:10px;
	<?php 
            if ($paramssld['ht_view5_show_separator_lines'] == "on") {
                ?>
		background:url('<?php 
                echo plugins_url('../images/divider.line.png', __FILE__);
                ?>
') center bottom repeat-x;
	<?php 
            }
            ?>
}
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block > div:last-child {background:none;}


#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .title {
	position:relative;
	display:block;
	margin:-10px 0px 0px 0px;
	font-size:<?php 
            echo $paramssld["ht_view5_title_font_size"];
            ?>
px !important;
	line-height:<?php 
            echo $paramssld["ht_view5_title_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view5_title_font_color"];
            ?>
;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description {
	clear:both;
	position:relative;
	font-weight:normal;
	text-align:justify;
	font-size:<?php 
            echo $paramssld["ht_view5_description_font_size"];
            ?>
px !important;
	line-height:<?php 
            echo $paramssld["ht_view5_description_font_size"];
            ?>
px !important;
	color:#<?php 
            echo $paramssld["ht_view5_description_color"];
            ?>
;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description h1,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description h2,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description h3,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description h4,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description h5,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description h6,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description p, 
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description strong,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description span {
	padding:2px !important;
	margin:0px !important;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description ul,
#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block .description li {
	padding:2px 0px 2px 5px;
	margin:0px 0px 0px 8px;
}



#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block {
	position:relative;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block a,#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block a:link,#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block a:visited{
	position:relative;
	display:inline-block;
	padding:6px 12px;
	background:#<?php 
            echo $paramssld["ht_view5_linkbutton_background_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view5_linkbutton_color"];
            ?>
;
	font-size:<?php 
            echo $paramssld["ht_view5_linkbutton_font_size"];
            ?>
;
	text-decoration:none;
}

#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block a:hover,#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block a:focus,#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .button-block a:active {
	background:#<?php 
            echo $paramssld["ht_view5_linkbutton_background_hover_color"];
            ?>
;
	color:#<?php 
            echo $paramssld["ht_view5_linkbutton_font_hover_color"];
            ?>
;
}

@media only screen and (min-width:500px) {
	#main-slider_<?php 
            echo $galleryID;
            ?>
-nav-ul {
		visibility:hidden !important;
		height:1px;
	}
}

@media only screen and (max-width:500px) {
	#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .image-block_<?php 
            echo $galleryID;
            ?>
,#main-slider_<?php 
            echo $galleryID;
            ?>
 .slider-content-wrapper .right-block {
		width:100%;
		display:block;
		float:none;
		clear:both;
	}
}

</style>
<div id="main-slider_<?php 
            echo $galleryID;
            ?>
" class="liquid-slider">
	<?php 
            foreach ($images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                //array_pop($imgurl);
                $link = $row->sl_url;
                $descnohtml = strip_tags($row->description);
                $result = substr($descnohtml, 0, 50);
                ?>
		<div class="slider-content">
			
			<div class="slider-content-wrapper">
				<div class="image-block_<?php 
                echo $galleryID;
                ?>
">
					

					<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<a class="group1" href="<?php 
                            echo $imgurl[0];
                            ?>
"><img alt="<?php 
                            echo $row->name;
                            ?>
" class="main-image" src="<?php 
                            echo $imgurl[0];
                            ?>
"  /></a>
							<?php 
                        } else {
                            ?>
							<img alt="<?php 
                            echo $row->name;
                            ?>
" class="main-image" src="images/noimage.jpg"  />
							<?php 
                        }
                        ?>

						<?php 
                        break;
                    case 'video':
                        ?>
						<?php 
                        $videourl = get_video_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
								<a class="youtube huge_it_gallery_item"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
">
									<img alt="<?php 
                            echo $row->name;
                            ?>
" src="http://img.youtube.com/vi/<?php 
                            echo $videourl[0];
                            ?>
/mqdefault.jpg"  />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>								
							<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            ?>
								<a class="vimeo huge_it_gallery_item" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
">
									<img alt="<?php 
                            echo $row->name;
                            ?>
" src="<?php 
                            echo $imgsrc;
                            ?>
"  />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>
							<?php 
                        }
                        ?>
				<?php 
                        break;
                }
                ?>
	
				</div>
				<div class="right-block">
					<div><h2 class="title"><?php 
                echo $row->name;
                ?>
</h2></div>
					<?php 
                if ($paramssld["ht_view5_show_description"] == 'on') {
                    ?>
<div class="description"><?php 
                    echo $row->description;
                    ?>
</div><?php 
                }
                ?>
					<?php 
                if ($paramssld["ht_view5_show_linkbutton"] == 'on') {
                    ?>
						<div class="button-block">
							<a href="<?php 
                    echo $link;
                    ?>
"  <?php 
                    if ($row->link_target == "on") {
                        echo 'target="_blank"';
                    }
                    ?>
><?php 
                    echo $paramssld["ht_view5_linkbutton_text"];
                    ?>
</a>
						</div>
					<?php 
                }
                ?>
				</div>
			</div>
		</div>
		<?php 
            }
            ?>
</div>
  <script src="<?php 
            echo plugins_url('../js/jquery.liquid-slider.min.js', __FILE__);
            ?>
"></script>  
   <script>
	
   
    /**
     * If you need to access the internal property or methods, use this:
     * var api = $.data( jQuery('#main-slider')[0], 'liquidSlider');
     * console.log(api);
     */
	 jQuery('#main-slider_<?php 
            echo $galleryID;
            ?>
').liquidSlider();
  </script>
<?php 
            break;
            /////////////////////////////// VIEW 2 Lightbox Gallery /////////////////////////////
        /////////////////////////////// VIEW 2 Lightbox Gallery /////////////////////////////
        case 5:
            ?>

<style type="text/css"> 

.element_<?php 
            echo $galleryID;
            ?>
 {
	width:<?php 
            echo $paramssld['ht_view6_width'];
            ?>
px;
	margin:0px 0px 10px 0px;
	border:<?php 
            echo $paramssld['ht_view6_border_width'];
            ?>
px solid #<?php 
            echo $paramssld['ht_view6_border_color'];
            ?>
;
	border-radius:<?php 
            echo $paramssld['ht_view6_border_radius'];
            ?>
px;
	outline:none;
	overflow:hidden;
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 {
	position:relative;
	width:<?php 
            echo $paramssld['ht_view6_width'];
            ?>
px;
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 a {display:block;}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 img {
	width:<?php 
            echo $paramssld['ht_view6_width'];
            ?>
px !important;
	height:auto;
	display:block;
	border-radius: 0px !important;
	box-shadow: 0 0px 0px rgba(0, 0, 0, 0) !important; 
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 img:hover {
	cursor: -webkit-zoom-in; cursor: -moz-zoom-in;
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
 .play-icon {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height:100%;	
	
}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
  .play-icon.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}

.element_<?php 
            echo $galleryID;
            ?>
 .image-block_<?php 
            echo $galleryID;
            ?>
  .play-icon.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}


.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 {
	position:absolute;
	
	left:0px;
	width:100%;
	padding-top:5px;
	height:30px;
	bottom:-35px;
	background: <?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view6_title_background_color'], 2));
            $titleopacity = $paramssld["ht_view6_title_background_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
	 -webkit-transition: bottom 0.3s ease-out 0.1s;
     -moz-transition: bottom 0.3s ease-out 0.1s;
     -o-transition: bottom 0.3s ease-out 0.1s;
     transition: bottom 0.3s ease-out 0.1s;
}

.element_<?php 
            echo $galleryID;
            ?>
:hover .title-block_<?php 
            echo $galleryID;
            ?>
 {bottom:0px;}

.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a, .element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:link, .element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:visited {
	position:relative;
	margin:0px;
	padding:0px 1% 0px 2%;
	width:97%;
	text-decoration:none;
	text-overflow: ellipsis;
	overflow: hidden; 
	white-space:nowrap;
	z-index:20;
	font-size: <?php 
            echo $paramssld["ht_view6_title_font_size"];
            ?>
px;
	color:#<?php 
            echo $paramssld["ht_view6_title_font_color"];
            ?>
;
	font-weight:normal;
}



.element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:hover, .element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:focus, .element_<?php 
            echo $galleryID;
            ?>
 .title-block_<?php 
            echo $galleryID;
            ?>
 a:active {
	color:#<?php 
            echo $paramssld["ht_view6_title_font_hover_color"];
            ?>
;
	text-decoration:none;
}

</style>
<section id="huge_it_gallery_content_<?php 
            echo $galleryID;
            ?>
">
  <div id="huge_it_gallery_container_<?php 
            echo $galleryID;
            ?>
" class="super-list variable-sizes clearfix">
  	<?php 
            foreach ($images as $key => $row) {
                $link = $row->sl_url;
                $descnohtml = strip_tags($row->description);
                $result = substr($descnohtml, 0, 50);
                ?>
		<div class="element_<?php 
                echo $galleryID;
                ?>
" tabindex="0" data-symbol="<?php 
                echo $row->name;
                ?>
" data-category="alkaline-earth">
			<div class="image-block_<?php 
                echo $galleryID;
                ?>
">
				<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
							<?php 
                        $imgurl = explode(";", $row->image_url);
                        ?>
							<?php 
                        if ($row->image_url != ';') {
                            ?>
							<a href="<?php 
                            echo $imgurl[0];
                            ?>
"><img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
"  /></a>
							<?php 
                        } else {
                            ?>
							<img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg"  />
							<?php 
                        }
                        ?>

				<?php 
                        break;
                    case 'video':
                        ?>
						<?php 
                        $videourl = get_video_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
								<a class="youtube huge_it_gallery_item group1"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
">
									<img alt="<?php 
                            echo $row->name;
                            ?>
" src="http://img.youtube.com/vi/<?php 
                            echo $videourl[0];
                            ?>
/mqdefault.jpg"  />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>								
							<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            ?>
								<a class="vimeo huge_it_gallery_item group1" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
">
									<img alt="<?php 
                            echo $row->name;
                            ?>
" src="<?php 
                            echo $imgsrc;
                            ?>
"  />
									<div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
								</a>
							<?php 
                        }
                        ?>
				<?php 
                        break;
                }
                ?>
			</div>
			<?php 
                if ($row->name != "") {
                    ?>
			<div class="title-block_<?php 
                    echo $galleryID;
                    ?>
">
				<a href="<?php 
                    echo $link;
                    ?>
" <?php 
                    if ($row->link_target == "on") {
                        echo 'target="_blank"';
                    }
                    ?>
><?php 
                    echo $row->name;
                    ?>
</a>
			</div>
			<?php 
                }
                ?>
		</div>	
		<?php 
            }
            ?>
	<div style="clear:both;"></div>
  </div>
</section>

<script> 
 jQuery(function(){
	var defaultBlockWidth=<?php 
            echo $paramssld['ht_view6_width'];
            ?>
+20+<?php 
            echo $paramssld['ht_view6_width'] * 2;
            ?>
;
    var $container = jQuery('#huge_it_gallery_container_<?php 
            echo $galleryID;
            ?>
');
    
    
      // add randomish size classes
      $container.find('.element_<?php 
            echo $galleryID;
            ?>
').each(function(){
        var $this = jQuery(this),
            number = parseInt( $this.find('.number').text(), 10 );
			//alert(number);
        if ( number % 7 % 2 === 1 ) {
          $this.addClass('width2');
        }
        if ( number % 3 === 0 ) {
          $this.addClass('height2');
        }
      });
    
$container.hugeitmicro({
  itemSelector : '.element_<?php 
            echo $galleryID;
            ?>
',
  masonry : {
	columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
+10+<?php 
            echo $paramssld['ht_view6_border_width'] * 2;
            ?>
  },
  masonryHorizontal : {
	rowHeight: 'auto'
  },
  cellsByRow : {
	columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
,
	rowHeight : 'auto'
  },
  cellsByColumn : {
	columnWidth : <?php 
            echo $paramssld['ht_view6_width'];
            ?>
,
	rowHeight : 'auto'
  },
  getSortData : {
	symbol : function( $elem ) {
	  return $elem.attr('data-symbol');
	},
	category : function( $elem ) {
	  return $elem.attr('data-category');
	},
	number : function( $elem ) {
	  return parseInt( $elem.find('.number').text(), 10 );
	},
	weight : function( $elem ) {
	  return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
	},
	name : function ( $elem ) {
	  return $elem.find('.name').text();
	}
  }
});
    
    
      var $optionSets = jQuery('#huge_it_gallery_options .option-set'),
          $optionLinks = $optionSets.find('a');

      $optionLinks.click(function(){
        var $this = jQuery(this);

        if ( $this.hasClass('selected') ) {
          return false;
        }
        var $optionSet = $this.parents('.option-set');
        $optionSet.find('.selected').removeClass('selected');
        $this.addClass('selected');
  

        var options = {},
            key = $optionSet.attr('data-option-key'),
            value = $this.attr('data-option-value');

        value = value === 'false' ? false : value;
        options[ key ] = value;
        if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {

          changeLayoutMode( $this, options )
        } else {

          $container.hugeitmicro( options );
        }
        
        return false;
      });

      
      <?php 
            if ($paramssld['ht_view6_content_in_center'] == 'on') {
                ?>
      centersection();
      jQuery(window).resize(function(){
          centersection();
      });
            function centersection(){
                var elementwidth=<?php 
                echo $paramssld['ht_view6_width'];
                ?>
 + 10 + <?php 
                echo $paramssld['ht_view6_border_width'] * 2;
                ?>
;
                var enterycontent=jQuery("#huge_it_gallery_container_<?php 
                echo $galleryID;
                ?>
").width();
                var whole=~~(enterycontent/(elementwidth));
                if(whole==0){ return false; }
                else { var sectionwidth= whole * elementwidth;}
                jQuery("#huge_it_gallery_container_moving_<?php 
                echo $galleryID;
                ?>
").width(sectionwidth).css({"margin":"0px auto","overflow":"hidden",});
//                 alert(elementwidth + " " + enterycontent + " " + whole + " " + sectionwidth);
      }
      <?php 
            }
            ?>
      
    

      var isHorizontal = false;
      function changeLayoutMode( $link, options ) {
        var wasHorizontal = isHorizontal;
        isHorizontal = $link.hasClass('horizontal');

        if ( wasHorizontal !== isHorizontal ) {

          var style = isHorizontal ? 
            { height: '100%', width: $container.width() } : 
            { width: 'auto' };

          $container.filter(':animated').stop();

          $container.addClass('no-transition').css( style );
          setTimeout(function(){
            $container.removeClass('no-transition').hugeitmicro( options );
          }, 100 )
        } else {
          $container.hugeitmicro( options );
        }
      }
     
    var $sortBy = jQuery('#sort-by');
    jQuery('#shuffle a').click(function(){
      $container.hugeitmicro('shuffle');
      $sortBy.find('.selected').removeClass('selected');
      $sortBy.find('[data-option-value="random"]').addClass('selected');
      return false;
    });

	  jQuery(window).load(function(){
		$container.hugeitmicro('reLayout');
	  });
  });
  

</script>
<?php 
            break;
            /////////////////////////////// VIEW 3 Gallery Huge IT Slider /////////////////////////////
        /////////////////////////////// VIEW 3 Gallery Huge IT Slider /////////////////////////////
        case 3:
            $sliderID = $gallery[0]->id;
            $slidertitle = $gallery[0]->name;
            $sliderheight = $gallery[0]->sl_height;
            $sliderwidth = $gallery[0]->sl_width;
            $slidereffect = $gallery[0]->gallery_list_effects_s;
            $slidepausetime = $gallery[0]->description + $gallery[0]->param;
            $sliderpauseonhover = $gallery[0]->pause_on_hover;
            $sliderposition = $gallery[0]->sl_position;
            $slidechangespeed = $gallery[0]->param;
            $slideshow_title_position = explode('-', trim($paramssld['slider_title_position']));
            $slideshow_description_position = explode('-', trim($paramssld['slider_description_position']));
            $hasyoutube = false;
            $hasvimeo = false;
            foreach ($images as $key => $image_row) {
                if (strpos($image_row->image_url, 'youtube') !== false) {
                    $hasyoutube = true;
                }
                if (strpos($image_row->image_url, 'vimeo') !== false) {
                    $hasvimeo = true;
                }
            }
            ?>
<script>var video_is_playing_gallery_<?php 
            echo $sliderID;
            ?>
=false;</script>
<?php 
            if ($hasvimeo == true) {
                ?>
<script src="<?php 
                echo plugins_url('js/vimeo.lib.js', __FILE__);
                ?>
"></script>
<script>
jQuery(function(){
	
	var vimeoPlayer = document.querySelector('iframe');
		
	jQuery('iframe').each(function(){
				Froogaloop(this).addEvent('ready', ready);
	});

	jQuery(".sidedock,.controls").remove();
	function ready(player_id) {
	
		froogaloop = $f(player_id);
	
		function setupEventListeners() {			
			function onPlay() {
				froogaloop.addEvent('play',
				function(){
					video_is_playing_gallery_<?php 
                echo $sliderID;
                ?>
=true;
				});
			}
			function onPause() {
				froogaloop.addEvent('pause',
				function(){
					video_is_playing_gallery_<?php 
                echo $sliderID;
                ?>
=false;
				});
			}					
			function stopVimeoVideo(player){
				Froogaloop(player).api('pause');
			}
			
			onPlay();
			onPause();
			jQuery('#huge_it_slideshow_left_gallery_<?php 
                echo $sliderID;
                ?>
, #huge_it_slideshow_right_gallery_<?php 
                echo $sliderID;
                ?>
,.huge_it_slideshow_dots_gallery_<?php 
                echo $sliderID;
                ?>
').click(function(){
				stopVimeoVideo(player_id);
			});
		}
		setupEventListeners();
	}
});		
</script>
<?php 
            }
            ?>

<?php 
            if ($hasyoutube == true) {
                ?>

<script src="<?php 
                echo plugins_url('js/youtube.lib.js', __FILE__);
                ?>
"></script>
<script> 
  <?php 
                function get_youtube_id_from_url($url)
                {
                    if (stristr($url, 'youtu.be/')) {
                        preg_match('/(https:|http:|)(\\/\\/www\\.|\\/\\/|)(.*?)\\/(.{11})/i', $url, $final_ID);
                        return $final_ID[4];
                    } else {
                        preg_match('/(https:|http:|):(\\/\\/www\\.|\\/\\/|)(.*?)\\/(embed\\/|watch\\?v=|(.*?)&v=|v\\/|e\\/|.+\\/|watch.*v=|)([a-z_A-Z0-9]{11})/i', $url, $IDD);
                        return $IDD[6];
                    }
                }
                $i = 0;
                foreach ($images as $key => $image_row) {
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                        ?>
 
		var player_<?php 
                        echo $image_row->id;
                        ?>
;
<?php 
                    } else {
                        if (strpos($image_row->image_url, 'vimeo') !== false) {
                            ?>
				
<?php 
                        } else {
                            continue;
                        }
                    }
                    $i++;
                }
                ?>
		 video_is_playing_gallery_<?php 
                echo $sliderID;
                ?>
=false;
		function onYouTubeIframeAPIReady() {
			<?php 
                foreach ($images as $key => $image_row) {
                    ?>
							
				<?php 
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                        ?>
 
				player_<?php 
                        echo $image_row->id;
                        ?>
 = new YT.Player('video_id_gallery_<?php 
                        echo $sliderID;
                        ?>
_<?php 
                        echo $key;
                        ?>
', {
				  height: '<?php 
                        echo $sliderheight;
                        ?>
',
				  width: '<?php 
                        echo $sliderwidth;
                        ?>
',
				  videoId: '<?php 
                        echo get_youtube_id_from_url($image_row->image_url);
                        ?>
',
				   playerVars: {
					'controls': <?php 
                        if ($images[$key]->sl_url == "on") {
                            echo 1;
                        } else {
                            echo 0;
                        }
                        ?>
,           
					'showinfo': <?php 
                        if ($images[$key]->link_target == "on") {
                            echo 1;
                        } else {
                            echo 0;
                        }
                        ?>
				  },
				  events: {
					'onStateChange': onPlayerStateChange_<?php 
                        echo $image_row->id;
                        ?>
,
					'loop':1
				  }
				});
			<?php 
                    } else {
                        continue;
                    }
                }
                ?>
		}
		
		
<?php 
                foreach ($images as $key => $image_row) {
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                        ?>
		 function onPlayerStateChange_<?php 
                        echo $image_row->id;
                        ?>
(event) {
			//(event.data);
			if (event.data == YT.PlayerState.PLAYING) {
				event.target.setPlaybackQuality('<?php 
                        echo $images[$key]->name;
                        ?>
');
				video_is_playing_gallery_<?php 
                        echo $sliderID;
                        ?>
=true;
			}
			else{
				video_is_playing_gallery_<?php 
                        echo $sliderID;
                        ?>
=false;
			}
		  }
<?php 
                    } else {
                        continue;
                    }
                }
                ?>
	function stopYoutubeVideo() {
		<?php 
                $i = 0;
                foreach ($images as $key => $image_row) {
                    if ($image_row->sl_type == "video" and strpos($image_row->image_url, 'youtube') !== false) {
                        ?>
			player_<?php 
                        echo $image_row->id;
                        ?>
.pauseVideo();
		<?php 
                    } else {
                        continue;
                    }
                    $i++;
                }
                ?>
	}

</script>
<?php 
            }
            ?>
	
	
	<script>
	var data_gallery_<?php 
            echo $sliderID;
            ?>
 = [];      
	var event_stack_gallery_<?php 
            echo $sliderID;
            ?>
 = [];
	<?php 
            //	$images=array_reverse($images);
            $recent_posts = wp_get_recent_posts($args, ARRAY_A);
            $i = 0;
            foreach ($images as $image) {
                $imagerowstype = $image->sl_type;
                if ($image->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]=[];';
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                        $strdesription = str_replace('"', "'", $image->description);
                        $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                        $stralt = str_replace('"', "'", $image->name);
                        $stralt = preg_replace("/\r|\n/", " ", $stralt);
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                        $i++;
                        break;
                    case 'video':
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]=[];';
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["image_url"]="' . $image->image_url . '";';
                        $strdesription = str_replace('"', "'", $image->description);
                        $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                        $stralt = str_replace('"', "'", $image->name);
                        $stralt = preg_replace("/\r|\n/", " ", $stralt);
                        echo 'data_gallery_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                        $i++;
                        break;
                    case 'last_posts':
                        foreach ($recent_posts as $keyl => $recentimage) {
                            if (get_the_post_thumbnail($recentimage["ID"], 'thumbnail') != '') {
                                if ($keyl < $image->sl_url) {
                                    echo 'data_gallery_' . $sliderID . '["' . $i . '"]=[];';
                                    echo 'data_gallery_' . $sliderID . '["' . $i . '"]["id"]="' . $i . '";';
                                    echo 'data_gallery_' . $sliderID . '["' . $i . '"]["image_url"]="' . $recentimage['guid'] . '";';
                                    $strdesription = str_replace('"', "'", $recentimage['post_content']);
                                    $strdesription = preg_replace("/\r|\n/", " ", $strdesription);
                                    $strdesription = substr_replace($strdesription, "", $image->description);
                                    echo 'data_gallery_' . $sliderID . '["' . $i . '"]["description"]="' . $strdesription . '";';
                                    $stralt = str_replace('"', "'", $recentimage['post_title']);
                                    $stralt = preg_replace("/\r|\n/", " ", $stralt);
                                    echo 'data_gallery_' . $sliderID . '["' . $i . '"]["alt"]="' . $stralt . '";';
                                    $i++;
                                }
                            }
                        }
                        break;
                }
            }
            ?>
	
	

      var huge_it_trans_in_progress_gallery_<?php 
            echo $sliderID;
            ?>
 = false;
      var huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
 = <?php 
            echo $slidechangespeed;
            ?>
;
	  var huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
;
      // Stop autoplay.
      window.clearInterval(huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
);
	 // alert('huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
');
     var huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 = '<?php 
            echo isset($current_key) ? $current_key : '';
            ?>
';
	 function huge_it_move_dots_gallery_<?php 
            echo $sliderID;
            ?>
() {
        var image_left = jQuery(".huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").position().left;
        var image_right = jQuery(".huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").position().left + jQuery(".huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").outerWidth(true);
       
      }
      function huge_it_testBrowser_cssTransitions_gallery_<?php 
            echo $sliderID;
            ?>
() {
        return huge_it_testDom_gallery_<?php 
            echo $sliderID;
            ?>
('Transition');
      }
      function huge_it_testBrowser_cssTransforms3d_gallery_<?php 
            echo $sliderID;
            ?>
() {
        return huge_it_testDom_gallery_<?php 
            echo $sliderID;
            ?>
('Perspective');
      }
      function huge_it_testDom_gallery_<?php 
            echo $sliderID;
            ?>
(prop) {
        // Browser vendor CSS prefixes.
        var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
        // Browser vendor DOM prefixes.
        var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
        var i = domPrefixes.length;
        while (i--) {
          if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
            return true;
          }
        }
        return false;
      }
		function huge_it_cube_gallery_<?php 
            echo $sliderID;
            ?>
(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
        /* If browser does not support 3d transforms/CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_gallery_<?php 
            echo $sliderID;
            ?>
()) {
			jQuery(".huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 + "_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
");
          return huge_it_fallback_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
        }
        if (!huge_it_testBrowser_cssTransforms3d_gallery_<?php 
            echo $sliderID;
            ?>
()) {
          return huge_it_fallback3d_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
        }
        huge_it_trans_in_progress_gallery_<?php 
            echo $sliderID;
            ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
");  
		jQuery("#huge_it_dots_" + huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 + "_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery(".huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
").css('perspective', 1000);
        jQuery(current_image_class).css({
          transform : 'translateZ(' + tz + 'px)',
          backfaceVisibility : 'hidden'
        });
		
		 jQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_second_item_gallery_<?php 
            echo $sliderID;
            ?>
 ").css('overflow', 'visible');
		
        jQuery(next_image_class).css({
          opacity : 1,
          filter: 'Alpha(opacity=100)',
          backfaceVisibility : 'hidden',
          transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
        });
        jQuery(".huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
").css({
          transform: 'translateZ(-' + tz + 'px)',
          transformStyle: 'preserve-3d'
        });
        /* Execution steps.*/
        setTimeout(function () {
          jQuery(".huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
").css({
            transition: 'all ' + huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
 + 'ms ease-in-out',
            transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
          });
        }, 20);
        /* After transition.*/
        jQuery(".huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          /*if (huge_it_from_focus_gallery_<?php 
            echo $sliderID;
            ?>
) {
            huge_it_from_focus_gallery_<?php 
            echo $sliderID;
            ?>
 = false;
            return;
          }*/
		  jQuery(".huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_second_item_gallery_<?php 
            echo $sliderID;
            ?>
 ").css('overflow', 'hidden');
		  jQuery(".huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
").removeAttr('style');
          jQuery(current_image_class).removeAttr('style');
          jQuery(next_image_class).removeAttr('style');
          jQuery(".huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
").removeAttr('style');
          jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
         // huge_it_change_watermark_container_gallery_<?php 
            echo $sliderID;
            ?>
();
          huge_it_trans_in_progress_gallery_<?php 
            echo $sliderID;
            ?>
 = false;
          if (typeof event_stack_gallery_<?php 
            echo $sliderID;
            ?>
 !== 'undefined' && event_stack_gallery_<?php 
            echo $sliderID;
            ?>
.length > 0) {
            key = event_stack_gallery_<?php 
            echo $sliderID;
            ?>
[0].split("-");
            event_stack_gallery_<?php 
            echo $sliderID;
            ?>
.shift();
            huge_it_change_image_gallery_<?php 
            echo $sliderID;
            ?>
(key[0], key[1], data_gallery_<?php 
            echo $sliderID;
            ?>
, true,false);
          }
        }
      }
      function huge_it_cubeH_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image width.*/
        var dimension = jQuery(current_image_class).width() / 2;
        if (direction == 'right') {
          huge_it_cube_gallery_<?php 
            echo $sliderID;
            ?>
(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_gallery_<?php 
            echo $sliderID;
            ?>
(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
        }
      }
      function huge_it_cubeV_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image height.*/
        var dimension = jQuery(current_image_class).height() / 2;
        /* If next slide.*/
        if (direction == 'right') {
          huge_it_cube_gallery_<?php 
            echo $sliderID;
            ?>
(dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          huge_it_cube_gallery_<?php 
            echo $sliderID;
            ?>
(dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction);
        }
      }
      /* For browsers that does not support transitions.*/
      function huge_it_fallback_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_fade_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
      }
      /* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
      function huge_it_fallback3d_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_sliceV_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
      }
      function huge_it_none_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
        jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});

        /* Set active thumbnail.*/
        jQuery(".huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 + "_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
");
      }
      function huge_it_fade_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
		if (huge_it_testBrowser_cssTransitions_gallery_<?php 
            echo $sliderID;
            ?>
()) {
          jQuery(next_image_class).css('transition', 'opacity ' + huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
 + 'ms linear');
		  jQuery(current_image_class).css('transition', 'opacity ' + huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
 + 'ms linear');
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
        }
        else {
          jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
);
          jQuery(next_image_class).animate({
              'opacity' : 1,
              'z-index': 2
            }, {
              duration: huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
,
              complete: function () {return false;}
            });
          // For IE.
          jQuery(current_image_class).fadeTo(huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
, 0);
          jQuery(next_image_class).fadeTo(huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
, 1);
        }

		jQuery(".huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
");
		jQuery("#huge_it_dots_" + huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 + "_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
");
      }
      function huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
        /* If browser does not support CSS transitions.*/
        if (!huge_it_testBrowser_cssTransitions_gallery_<?php 
            echo $sliderID;
            ?>
()) {
			jQuery(".huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 + "_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
");
          return huge_it_fallback_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
		  
        }
        huge_it_trans_in_progress_gallery_<?php 
            echo $sliderID;
            ?>
 = true;
        /* Set active thumbnail.*/
		jQuery(".huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
");
        jQuery("#huge_it_dots_" + huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 + "_gallery_<?php 
            echo $sliderID;
            ?>
").removeClass("huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
").addClass("huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
");
        /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
        var count = (huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
) / (cols + rows);
        /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
        function huge_it_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
          var delay = (c + r) * count;
          /* Return a gridlet elem with styles for specific transition.*/
          return jQuery('<div class="huge_it_gridlet_gallery_<?php 
            echo $sliderID;
            ?>
" />').css({
            width : width,
            height : height,
            top : top,
            left : left,
            backgroundImage : 'url("' + src + '")',
            backgroundColor: jQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").css("background-color"),
            /*backgroundColor: rgba(0, 0, 0, 0),*/
            backgroundRepeat: 'no-repeat',
            backgroundPosition : img_left + 'px ' + img_top + 'px',
            backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
            transition : 'all ' + huge_it_transition_duration_gallery_<?php 
            echo $sliderID;
            ?>
 + 'ms ease-in-out ' + delay + 'ms',
            transform : 'none'
          });
        }
        /* Get the current slide's image.*/
        var cur_img = jQuery(current_image_class).find('img');
        /* Create a grid to hold the gridlets.*/
        var grid = jQuery('<div />').addClass('huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
');
        /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
        jQuery(current_image_class).prepend(grid);
        /* vars to calculate positioning/size of gridlets*/
        var cont = jQuery(".huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
");
        var imgWidth = cur_img.width();
        var imgHeight = cur_img.height();
        var contWidth = cont.width(),
            contHeight = cont.height(),
            imgSrc = cur_img.attr('src'),/*.replace('/thumb', ''),*/
            colWidth = Math.floor(contWidth / cols),
            rowHeight = Math.floor(contHeight / rows),
            colRemainder = contWidth - (cols * colWidth),
            colAdd = Math.ceil(colRemainder / cols),
            rowRemainder = contHeight - (rows * rowHeight),
            rowAdd = Math.ceil(rowRemainder / rows),
            leftDist = 0,
            img_leftDist = (jQuery(".huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
").width() - cur_img.width()) / 2;
        /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
        tx = tx === 'auto' ? contWidth : tx;
        tx = tx === 'min-auto' ? - contWidth : tx;
        ty = ty === 'auto' ? contHeight : ty;
        ty = ty === 'min-auto' ? - contHeight : ty;
        /* Loop through cols*/
        for (var i = 0; i < cols; i++) {
          var topDist = 0,
              img_topDst = (jQuery(".huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
").height() - cur_img.height()) / 2,
              newColWidth = colWidth;
          /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
          if (colRemainder > 0) {
            var add = colRemainder >= colAdd ? colAdd : colRemainder;
            newColWidth += add;
            colRemainder -= add;
          }
          /* Nested loop to create row gridlets for each col.*/
          for (var j = 0; j < rows; j++)  {
            var newRowHeight = rowHeight,
                newRowRemainder = rowRemainder;
            /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
            if (newRowRemainder > 0) {
              add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
              newRowHeight += add;
              newRowRemainder -= add;
            }
            /* Create & append gridlet to grid.*/
            grid.append(huge_it_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
            topDist += newRowHeight;
            img_topDst -= newRowHeight;
          }
          img_leftDist -= newColWidth;
          leftDist += newColWidth;
        }
        /* Set event listener on last gridlet to finish transitioning.*/
        var last_gridlet = grid.children().last();
        /* Show grid & hide the image it replaces.*/
        grid.show();
        cur_img.css('opacity', 0);
        /* Add identifying classes to corner gridlets (useful if applying border radius).*/
        grid.children().first().addClass('rs-top-left');
        grid.children().last().addClass('rs-bottom-right');
        grid.children().eq(rows - 1).addClass('rs-bottom-left');
        grid.children().eq(- rows).addClass('rs-top-right');
        /* Execution steps.*/
        setTimeout(function () {
          grid.children().css({
            opacity: op,
            transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
          });
        }, 1);
        jQuery(next_image_class).css('opacity', 1);
        /* After transition.*/
        jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(huge_it_after_trans));
        function huge_it_after_trans() {
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          cur_img.css('opacity', 1);
          grid.remove();
          huge_it_trans_in_progress_gallery_<?php 
            echo $sliderID;
            ?>
 = false;
          if (typeof event_stack_gallery_<?php 
            echo $sliderID;
            ?>
 !== 'undefined' && event_stack_gallery_<?php 
            echo $sliderID;
            ?>
.length > 0) {
            key = event_stack_gallery_<?php 
            echo $sliderID;
            ?>
[0].split("-");
            event_stack_gallery_<?php 
            echo $sliderID;
            ?>
.shift();
            huge_it_change_image_gallery_<?php 
            echo $sliderID;
            ?>
(key[0], key[1], data_gallery_<?php 
            echo $sliderID;
            ?>
, true,false);
          }
        }
      }
      function huge_it_sliceH_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_sliceV_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'min-auto';
        }
        else if (direction == 'left') {
          var translateY = 'auto';
        }
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_slideV_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'auto';
        }
        else if (direction == 'left') {
          var translateY = 'min-auto';
        }
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_slideH_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateX = 'min-auto';
        }
        else if (direction == 'left') {
          var translateX = 'auto';
        }
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleOut_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_scaleIn_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blockScale_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(8, 6, 0, 0, 0, .6, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_kaleidoscope_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_fan_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var rotate = 45;
          var translateX = 100;
        }
        else if (direction == 'left') {
          var rotate = -45;
          var translateX = -100;
        }
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
      }
      function huge_it_blindV_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_blindH_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function huge_it_random_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction) {
        var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV'];
        /* Pick a random transition from the anims array.*/
        this["huge_it_" + anims[Math.floor(Math.random() * anims.length)] + "_gallery_<?php 
            echo $sliderID;
            ?>
"](current_image_class, next_image_class, direction);
      }
      
      function iterator_gallery_<?php 
            echo $sliderID;
            ?>
() {
        var iterator = 1;

        return iterator;
     }
	 
     function huge_it_change_image_gallery_<?php 
            echo $sliderID;
            ?>
(current_key, key, data_gallery_<?php 
            echo $sliderID;
            ?>
, from_effect,clicked) {
		
        if (data_gallery_<?php 
            echo $sliderID;
            ?>
[key]) {
			
			if(video_is_playing_gallery_<?php 
            echo $sliderID;
            ?>
 && !clicked){
				return false;
			}
        
          if (!from_effect) {
			
            // Change image key.
            jQuery("#huge_it_current_image_key_gallery_<?php 
            echo $sliderID;
            ?>
").val(key);
             // if (current_key == '-2') { /* Dots.*/
				current_key = jQuery(".huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
").attr("image_key");
			//  }
          }

          if (huge_it_trans_in_progress_gallery_<?php 
            echo $sliderID;
            ?>
) {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").after(" --IN TRANSACTION-- <br />");
            event_stack_gallery_<?php 
            echo $sliderID;
            ?>
.push(current_key + '-' + key);
            return;
          }
		  
          var direction = 'right';
          if (huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 > key) {
            var direction = 'left';
          }
          else if (huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 == key) {
            return false;
          }

         
          // Set active thumbnail position.
      
          huge_it_current_key_gallery_<?php 
            echo $sliderID;
            ?>
 = key;
          //Change image id, title, description.
          jQuery("#huge_it_slideshow_image_gallery_<?php 
            echo $sliderID;
            ?>
").attr('image_id', data_gallery_<?php 
            echo $sliderID;
            ?>
[key]["id"]);
		  
		  
		  jQuery(".huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
").html(data_gallery_<?php 
            echo $sliderID;
            ?>
[key]["alt"]);
          jQuery(".huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
").html(data_gallery_<?php 
            echo $sliderID;
            ?>
[key]["description"]);
        
		  var current_image_class = "#image_id_gallery_<?php 
            echo $sliderID;
            ?>
_" + data_gallery_<?php 
            echo $sliderID;
            ?>
[current_key]["id"];
          var next_image_class = "#image_id_gallery_<?php 
            echo $sliderID;
            ?>
_" + data_gallery_<?php 
            echo $sliderID;
            ?>
[key]["id"];
          
		  
		if(jQuery(current_image_class).find('.huge_it_video_frame_gallery_<?php 
            echo $sliderID;
            ?>
').length>0) {
			var streffect='<?php 
            echo $slidereffect;
            ?>
';
			if(streffect=="cubeV" || streffect=="cubeH" || streffect=="none" || streffect=="fade"){
				huge_it_<?php 
            echo $slidereffect;
            ?>
_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
			}else{	
				huge_it_fade_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
			}	
		}else{	
				huge_it_<?php 
            echo $slidereffect;
            ?>
_gallery_<?php 
            echo $sliderID;
            ?>
(current_image_class, next_image_class, direction);
		}	
		  
		  
		jQuery('.huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
').html()==""){jQuery('.huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');}

		jQuery('.huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
').removeClass('none');
		if(jQuery('.huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
').html()==""){jQuery('.huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');}
	  
		  
		  
		  jQuery(current_image_class).find('.huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');
		  jQuery(current_image_class).find('.huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
').addClass('none');
		
		

		  
		  //errorlogjQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").after("--cur-key="+current_key+" --cur-img-class="+current_image_class+" nxt-img-class="+next_image_class+"--");
			huge_it_move_dots_gallery_<?php 
            echo $sliderID;
            ?>
();
			<?php 
            if ($hasyoutube == true) {
                ?>
stopYoutubeVideo(); <?php 
            }
            ?>
			window.clearInterval(huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
);
			play_gallery_<?php 
            echo $sliderID;
            ?>
();
        }

      }
	  
      function huge_it_popup_resize_gallery_<?php 
            echo $sliderID;
            ?>
() {

		var staticsliderwidth=<?php 
            echo $sliderwidth;
            ?>
;
		var sliderwidth=<?php 
            echo $sliderwidth;
            ?>
;
		
		var bodyWidth=jQuery(window).width();
        var parentWidth = jQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").parent().width();
		//if responsive js late responsive.js @  take body size and not parent div
		if(sliderwidth>parentWidth){sliderwidth=parentWidth;}
		if(sliderwidth>bodyWidth){sliderwidth=bodyWidth;}
		
		var str=(<?php 
            echo $sliderheight;
            ?>
/staticsliderwidth);
		
		jQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").css({height: ((sliderwidth) * str)});
		jQuery(".huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
").css({width: (sliderwidth)});
		jQuery(".huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
").css({height: ((sliderwidth) * str)});
			
		if("<?php 
            echo $slideshow_title_position[1];
            ?>
"=="middle"){var titlemargintopminus=jQuery(".huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
").outerHeight()/2;}		
		if("<?php 
            echo $slideshow_title_position[0];
            ?>
"=="center"){var titlemarginleftminus=jQuery(".huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
").outerWidth()/2;}		
		jQuery(".huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
").css({cssText: "margin-top:-" + titlemargintopminus + "px; margin-left:-"+titlemarginleftminus+"px;"});
		
		if("<?php 
            echo $slideshow_description_position[1];
            ?>
"=="middle"){var descriptionmargintopminus=jQuery(".huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
").outerHeight()/2;}	
		if("<?php 
            echo $slideshow_description_position[0];
            ?>
"=="center"){var descriptionmarginleftminus=jQuery(".huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
").outerWidth()/2;}
		jQuery(".huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
").css({cssText: "margin-top:-" + descriptionmargintopminus + "px; margin-left:-"+descriptionmarginleftminus+"px;"});		
		
		
		if("<?php 
            echo $paramssld['slider_crop_image'];
            ?>
"=="resize"){
			jQuery(".huge_it_slideshow_image_gallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_image_item1_gallery_<?php 
            echo $sliderID;
            ?>
 img, .huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
 img").css({
				cssText: "width:" + sliderwidth + "px; height:" + ((sliderwidth) * str)	+"px;"
			});
		}else {
			jQuery(".huge_it_slideshow_image_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item1_gallery_<?php 
            echo $sliderID;
            ?>
,.huge_it_slideshow_image_item2_gallery_<?php 
            echo $sliderID;
            ?>
").css({
			cssText: "max-width: " + sliderwidth + "px !important; max-height: " + (sliderwidth * str) + "px !important;"
		  });
		}
		
		jQuery('.huge_it_video_frame_gallery_<?php 
            echo $sliderID;
            ?>
').each(function (e) {
          jQuery(this).width(sliderwidth);
          jQuery(this).height(sliderwidth * str);
        });
      }
      
      jQuery(window).load(function () {
		jQuery(window).resize(function() {
			huge_it_popup_resize_gallery_<?php 
            echo $sliderID;
            ?>
();
		});
		
		huge_it_popup_resize_gallery_<?php 
            echo $sliderID;
            ?>
();
        /* Disable right click.*/
        jQuery('div[id^="huge_it_container"]').bind("contextmenu", function () {
          return false;
        });
        			
		/*HOVER SLIDESHOW*/
		jQuery("#huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_dots_container_gallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_right_gallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_left_gallery_<?php 
            echo $sliderID;
            ?>
").hover(function(){
			//errorlogjQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").after(" -- hover -- <br /> ");
			jQuery("#huge_it_slideshow_right_gallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'inline'});
			jQuery("#huge_it_slideshow_left_gallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'inline'});
		},function(){
			jQuery("#huge_it_slideshow_right_gallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'none'});
			jQuery("#huge_it_slideshow_left_gallery_<?php 
            echo $sliderID;
            ?>
").css({'display':'none'});
		});
		var pausehover="<?php 
            echo $sliderpauseonhover;
            ?>
";
		if(pausehover=="on"){
			jQuery("#huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
, .huge_it_slideshow_dots_container_gallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_right_gallery_<?php 
            echo $sliderID;
            ?>
,#huge_it_slideshow_left_gallery_<?php 
            echo $sliderID;
            ?>
").hover(function(){
				window.clearInterval(huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
);
			},function(){
				window.clearInterval(huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
);
				play_gallery_<?php 
            echo $sliderID;
            ?>
();
			});		
		}	
          play_gallery_<?php 
            echo $sliderID;
            ?>
();        
      });

      function play_gallery_<?php 
            echo $sliderID;
            ?>
() {	   
        /* Play.*/
		//errorlogjQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").after(" -- paly  ---- ");
        huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
 = setInterval(function () {
			//errorlogjQuery(".huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
").after(" -- time left ---- ");
          var iterator = 1;
          huge_it_change_image_gallery_<?php 
            echo $sliderID;
            ?>
(parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
            echo $sliderID;
            ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
            echo $sliderID;
            ?>
').val()) + iterator) % data_gallery_<?php 
            echo $sliderID;
            ?>
.length, data_gallery_<?php 
            echo $sliderID;
            ?>
,false,false);
        }, '<?php 
            echo $slidepausetime;
            ?>
');
      }
	  
      jQuery(window).focus(function() {
       /*event_stack_gallery_<?php 
            echo $sliderID;
            ?>
 = [];*/
        var i_gallery_<?php 
            echo $sliderID;
            ?>
 = 0;
        jQuery(".huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
").children("div").each(function () {
          if (jQuery(this).css('opacity') == 1) {
            jQuery("#huge_it_current_image_key_gallery_<?php 
            echo $sliderID;
            ?>
").val(i_gallery_<?php 
            echo $sliderID;
            ?>
);
          }
          i_gallery_<?php 
            echo $sliderID;
            ?>
++;
        });
      });
      jQuery(window).blur(function() {
        event_stack_gallery_<?php 
            echo $sliderID;
            ?>
 = [];
        window.clearInterval(huge_it_playInterval_gallery_<?php 
            echo $sliderID;
            ?>
);
      });      
    </script>
	<style>				
	 .huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
 {
		height:<?php 
            echo $sliderheight;
            ?>
px;
		width:<?php 
            echo $sliderwidth;
            ?>
px;
		position:relative;
		display: block;
		text-align: center;
		/*HEIGHT FROM HEADER.PHP*/
		clear:both;
		<?php 
            if ($sliderposition == "left") {
                $position = 'float:left;';
            } elseif ($sliderposition == "right") {
                $position = 'float:right;';
            } else {
                $position = 'float:none; margin:0px auto;';
            }
            ?>
		<?php 
            echo $position;
            ?>
		
		border-style:solid;
		border-left:0px !important;
		border-right:0px !important;
	}


	.huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
 * {
		box-sizing: border-box;
		-moz-box-sizing: border-box;
		-webkit-box-sizing: border-box;
	}
		 

	  .huge_it_slideshow_image_gallery_<?php 
            echo $sliderID;
            ?>
 {
			/*width:100%;*/
	  }

	  #huge_it_slideshow_left_gallery_<?php 
            echo $sliderID;
            ?>
,
	  #huge_it_slideshow_right_gallery_<?php 
            echo $sliderID;
            ?>
 {
		cursor: pointer;
		display:none;
		display: block;
		
		height: 100%;
		outline: medium none;
		position: absolute;

		/*z-index: 10130;*/
		z-index: 13;
		bottom:25px;
		top:50%;		
	  }
	 

	  #huge_it_slideshow_left-ico_gallery_<?php 
            echo $sliderID;
            ?>
,
	  #huge_it_slideshow_right-ico_gallery_<?php 
            echo $sliderID;
            ?>
 {
		z-index: 13;
		-moz-box-sizing: content-box;
		box-sizing: content-box;
		cursor: pointer;
		display: table;
		left: -9999px;
		line-height: 0;
		margin-top: -15px;
		position: absolute;
		top: 50%;
		/*z-index: 10135;*/
	  }
	  #huge_it_slideshow_left-ico_gallery_<?php 
            echo $sliderID;
            ?>
:hover,
	  #huge_it_slideshow_right-ico_gallery_<?php 
            echo $sliderID;
            ?>
:hover {
		cursor: pointer;
	  }
	  
	  .huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
 {
		display: table;
		position: relative;
		top:0px;
		left:0px;
		text-align: center;
		vertical-align: middle;
		width:100%;
	  }	  
		
	  .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 {
		text-decoration: none;
		position: absolute;
		z-index: 11;
		display: inline-block;
		<?php 
            if ($paramssld['slider_title_has_margin'] == 'on') {
                $slider_title_width = $paramssld['slider_title_width'] - 6;
                $slider_title_height = $paramssld['slider_title_height'] - 6;
                $slider_title_margin = "3";
            } else {
                $slider_title_width = $paramssld['slider_title_width'];
                $slider_title_height = $paramssld['slider_title_height'];
                $slider_title_margin = "0";
            }
            ?>
		
		width:<?php 
            echo $slider_title_width;
            ?>
%;
		/*height:<?php 
            echo $slider_title_height;
            ?>
%;*/
		
		<?php 
            if ($slideshow_title_position[0] == "left") {
                echo 'left:' . $slider_title_margin . '%;';
            } elseif ($slideshow_title_position[0] == "center") {
                echo 'left:50%;';
            } elseif ($slideshow_title_position[0] == "right") {
                echo 'right:' . $slider_title_margin . '%;';
            }
            if ($slideshow_title_position[1] == "top") {
                echo 'top:' . $slider_title_margin . '%;';
            } elseif ($slideshow_title_position[1] == "middle") {
                echo 'top:50%;';
            } elseif ($slideshow_title_position[1] == "bottom") {
                echo 'bottom:' . $slider_title_margin . '%;';
            }
            ?>
		padding:2%;
		text-align:<?php 
            echo $paramssld['slider_title_text_align'];
            ?>
;  
		font-weight:bold;
		color:#<?php 
            echo $paramssld['slider_title_color'];
            ?>
;
			
		background:<?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['slider_title_background_color'], 2));
            $titleopacity = $paramssld["slider_title_background_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
		border-style:solid;
		font-size:<?php 
            echo $paramssld['slider_title_font_size'];
            ?>
px;
		border-width:<?php 
            echo $paramssld['slider_title_border_size'];
            ?>
px;
		border-color:#<?php 
            echo $paramssld['slider_title_border_color'];
            ?>
;
		border-radius:<?php 
            echo $paramssld['slider_title_border_radius'];
            ?>
px;
	  }
	  	  
	  .huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
 {
		text-decoration: none;
		position: absolute;
		z-index: 11;
		border-style:solid;
		display: inline-block;
		<?php 
            if ($paramssld['slider_description_has_margin'] == 'on') {
                $slider_description_width = $paramssld['slider_description_width'] - 6;
                $slider_description_height = $paramssld['slider_description_height'] - 6;
                $slider_description_margin = "3";
            } else {
                $slider_description_width = $paramssld['slider_description_width'];
                $slider_descriptione_height = $paramssld['slider_description_height'];
                $slider_description_margin = "0";
            }
            ?>
		
		width:<?php 
            echo $slider_description_width;
            ?>
%;
		/*height:<?php 
            echo $slider_description_height;
            ?>
%;*/
		<?php 
            if ($slideshow_description_position[0] == "left") {
                echo 'left:' . $slider_description_margin . '%;';
            } elseif ($slideshow_description_position[0] == "center") {
                echo 'left:50%;';
            } elseif ($slideshow_description_position[0] == "right") {
                echo 'right:' . $slider_description_margin . '%;';
            }
            if ($slideshow_description_position[1] == "top") {
                echo 'top:' . $slider_description_margin . '%;';
            } elseif ($slideshow_description_position[1] == "middle") {
                echo 'top:50%;';
            } elseif ($slideshow_description_position[1] == "bottom") {
                echo 'bottom:' . $slider_description_margin . '%;';
            }
            ?>
		padding:3%;
		text-align:<?php 
            echo $paramssld['slider_description_text_align'];
            ?>
;  
		color:#<?php 
            echo $paramssld['slider_description_color'];
            ?>
;
		
		background:<?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['slider_description_background_color'], 2));
            $descriptionopacity = $paramssld["slider_description_background_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $descriptionopacity . ') !important';
            ?>
;
		border-style:solid;
		font-size:<?php 
            echo $paramssld['slider_description_font_size'];
            ?>
px;
		border-width:<?php 
            echo $paramssld['slider_description_border_size'];
            ?>
px;
		border-color:#<?php 
            echo $paramssld['slider_description_border_color'];
            ?>
;
		border-radius:<?php 
            echo $paramssld['slider_description_border_radius'];
            ?>
px;
	  }
	  
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
.none, .huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
.none,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
.hidden, .huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
.hidden	   {display:none;}
	      
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h1, .huge_it_slideshow_description_text_gallery_<?php 
            echo $sliderID;
            ?>
 h1,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h2, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h2,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h3, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h3,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h4, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 h4,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 p, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 p,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 strong,  .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 strong,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 span, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 span,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 ul, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 ul,
	   .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 li, .huge_it_slideshow_title_text_gallery_<?php 
            echo $sliderID;
            ?>
 li {
			padding:2px;
			margin:0px;
	   }

	  .huge_it_slide_container_gallery_<?php 
            echo $sliderID;
            ?>
 {
		display: table-cell;
		margin: 0 auto;
		position: relative;
		vertical-align: middle;
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
	  }
	  .huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
 {
		margin: 0 auto;
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
	  }
	  .huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
 {
		width:100%;
		height:100%;
		display:table;
		padding:0px;
		margin:0px;
		
	  }
	  .huge_it_slideshow_image_item_gallery_<?php 
            echo $sliderID;
            ?>
 {
		width:100%;
		height:100%;
		width: inherit;
		height: inherit;
		display: table-cell;
		filter: Alpha(opacity=100);
		opacity: 1;
		position: absolute;
		top:0px;
		left:0px;
		vertical-align: middle;
		z-index: 2;
		margin:0px !important;
		padding:0px;
		overflow:hidden;
		border-radius: <?php 
            echo $paramssld['slider_slideshow_border_radius'];
            ?>
px !important;
	  }
	  .huge_it_slideshow_image_second_item_gallery_<?php 
            echo $sliderID;
            ?>
 {
		width:100%;
		height:100%;
		_width: inherit;
		_height: inherit;
		display: table-cell;
		filter: Alpha(opacity=0);
		opacity: 0;
		position: absolute;
		top:0px;
		left:0px;
		vertical-align: middle;
		z-index: 1;
		overflow:hidden;
		margin:0px !important;
		padding:0px;
		border-radius: <?php 
            echo $paramssld['slider_slideshow_border_radius'];
            ?>
px !important;
	  }
	  .huge_it_grid_gallery_<?php 
            echo $sliderID;
            ?>
 {
		display: none;
		height: 100%;
		overflow: hidden;
		position: absolute;
		width: 100%;
	  }
	  .huge_it_gridlet_gallery_<?php 
            echo $sliderID;
            ?>
 {
		opacity: 1;
		filter: Alpha(opacity=100);
		position: absolute;
	  }
	  
					
	  .huge_it_slideshow_dots_container_gallery_<?php 
            echo $sliderID;
            ?>
 {
		display: table;
		position: absolute;
		width:100% !important;
		height:100% !important;
	  }
	  .huge_it_slideshow_dots_thumbnails_gallery_<?php 
            echo $sliderID;
            ?>
 {
		margin: 0 auto;
		overflow: hidden;
		position: absolute;
		width:100%;
		height:30px;
	  }
	  
	  .huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
 {
		display: inline-block;
		position: relative;
		cursor: pointer;
		box-shadow: 1px 1px 1px rgba(0,0,0,0.1) inset, 1px 1px 1px rgba(255,255,255,0.1);
		width:10px;
		height: 10px;
		border-radius: 10px;
		background: #00f;
		margin: 10px;
		overflow: hidden;
		z-index: 17;
	  }
	  
	  .huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
 {
		opacity: 1;
		background:#0f0;
		filter: Alpha(opacity=100);
	  }
	  .huge_it_slideshow_dots_deactive_gallery_<?php 
            echo $sliderID;
            ?>
 {
	  
	  }
	  
	  .huge_it_slideshow_image_item1_gallery_<?php 
            echo $sliderID;
            ?>
 {
		 display: table; 
		 width: inherit; 
		 height: inherit;
	  }
	  .huge_it_slideshow_image_item2_gallery_<?php 
            echo $sliderID;
            ?>
 {
		 display: table-cell; 
		 vertical-align: middle; 
		 text-align: center;
	  }
	  
	  .huge_it_slideshow_image_item2_gallery_<?php 
            echo $sliderID;
            ?>
 a {
		display:block;
		vertical-align:middle;
		width:100%;
		height:100%;
	  }
		
		
		.huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
 {
			background:#<?php 
            echo $paramssld['slider_slider_background_color'];
            ?>
;
			border-width:<?php 
            echo $paramssld['slider_slideshow_border_size'];
            ?>
px;
			border-color:#<?php 
            echo $paramssld['slider_slideshow_border_color'];
            ?>
;
			border-radius:<?php 
            echo $paramssld['slider_slideshow_border_radius'];
            ?>
px;
		}
		
		.huge_it_slideshow_dots_thumbnails_gallery_<?php 
            echo $sliderID;
            ?>
 {
			<?php 
            if ($paramssld['slider_dots_position'] == "bottom") {
                ?>
			bottom:0px;
			<?php 
            } else {
                if ($paramssld['slider_dots_position'] == "none") {
                    ?>
			display:none;
			<?php 
                } else {
                    ?>
			top:0px; <?php 
                }
            }
            ?>
		}
		
		.huge_it_slideshow_dots_gallery_<?php 
            echo $sliderID;
            ?>
 {
			background:#<?php 
            echo $paramssld['slider_dots_color'];
            ?>
;
		}
		
		.huge_it_slideshow_dots_active_gallery_<?php 
            echo $sliderID;
            ?>
 {
			background:#<?php 
            echo $paramssld['slider_active_dot_color'];
            ?>
;
		}
		
		<?php 
            $arrowfolder = plugins_url('gallery-images/Front_images/arrows');
            switch ($paramssld['slider_navigation_type']) {
                case 1:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-21px;
						height:43px;
						width:29px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.simple.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-21px;
						height:43px;
						width:29px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.simple.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 2:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.shadow.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.shadow.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -50px;
					}

					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -50px;
					}
				<?php 
                    break;
                case 3:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-22px;
						height:44px;
						width:44px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.simple.dark.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-22px;
						height:44px;
						width:44px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.simple.dark.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -44px;
					}

					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -44px;
					}
				<?php 
                    break;
                case 4:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-33px;
						height:65px;
						width:59px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.cube.dark.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-33px;
						height:65px;
						width:59px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.cube.dark.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -66px;
					}

					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -66px;
					}
				<?php 
                    break;
                case 5:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-18px;
						height:37px;
						width:40px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.blue.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-18px;
						height:37px;
						width:40px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.blue.png) right top no-repeat; 
					}

				<?php 
                    break;
                case 6:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.cube.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-25px;
						height:50px;
						width:50px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.cube.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -50px;
					}

					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -50px;
					}
				<?php 
                    break;
                case 7:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						right:0px;
						margin-top:-19px;
						height:38px;
						width:38px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.transparent.circle.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-19px;
						height:38px;
						width:38px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.light.transparent.circle.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 8:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 9:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.blue.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-22px;
						height:45px;
						width:45px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.blue.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 10:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-24px;
						height:48px;
						width:48px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.green.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-24px;
						height:48px;
						width:48px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.circle.green.png) right top no-repeat; 
					}

					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:left -48px;
					}

					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
:hover {
						background-position:right -48px;
					}
				<?php 
                    break;
                case 11:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-29px;
						height:58px;
						width:55px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.blue.retro.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-29px;
						height:58px;
						width:55px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.blue.retro.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 12:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-37px;
						height:74px;
						width:74px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.green.retro.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-37px;
						height:74px;
						width:74px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.green.retro.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 13:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-16px;
						height:33px;
						width:33px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.red.circle.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-16px;
						height:33px;
						width:33px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.red.circle.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 14:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-51px;
						height:102px;
						width:52px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.triangle.white.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-51px;
						height:102px;
						width:52px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.triangle.white.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 15:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:0px;
						margin-top:-19px;
						height:39px;
						width:70px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.ancient.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:0px;
						margin-top:-19px;
						height:39px;
						width:70px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.ancient.png) right top no-repeat; 
					}
				<?php 
                    break;
                case 16:
                    ?>
					#huge_it_slideshow_left_gallery_<?php 
                    echo $sliderID;
                    ?>
 {	
						left:-21px;
						margin-top:-20px;
						height:40px;
						width:37px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.black.out.png) left  top no-repeat; 
					}
					
					#huge_it_slideshow_right_gallery_<?php 
                    echo $sliderID;
                    ?>
 {
						right:-21px;
						margin-top:-20px;
						height:40px;
						width:37px;
						background:url(<?php 
                    echo $arrowfolder;
                    ?>
/arrows.black.out.png) right top no-repeat; 
					}
				<?php 
                    break;
            }
            ?>
	</style>

	<div class="huge_it_slideshow_image_wrap_gallery_<?php 
            echo $sliderID;
            ?>
">
      <?php 
            $current_pos = 0;
            ?>
		<!-- ##########################DOTS######################### -->
        <div class="huge_it_slideshow_dots_container_gallery_<?php 
            echo $sliderID;
            ?>
">
			  <div class="huge_it_slideshow_dots_thumbnails_gallery_<?php 
            echo $sliderID;
            ?>
">
				<?php 
            $current_image_id = 0;
            $current_pos = 0;
            $current_key = 0;
            $stri = 0;
            foreach ($images as $key => $image_row) {
                $imagerowstype = $image_row->sl_type;
                if ($image_row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        if ($image_row->id == $current_image_id) {
                            $current_pos = $stri;
                            $current_key = $stri;
                        }
                        ?>
								<div id="huge_it_dots_<?php 
                        echo $stri;
                        ?>
_gallery_<?php 
                        echo $sliderID;
                        ?>
" class="huge_it_slideshow_dots_gallery_<?php 
                        echo $sliderID;
                        ?>
 <?php 
                        echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_gallery_' . $sliderID : 'huge_it_slideshow_dots_deactive_gallery_' . $sliderID;
                        ?>
" onclick="huge_it_change_image_gallery_<?php 
                        echo $sliderID;
                        ?>
(parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                        echo $sliderID;
                        ?>
').val()), '<?php 
                        echo $stri;
                        ?>
', data_gallery_<?php 
                        echo $sliderID;
                        ?>
,false,true);return false;" image_id="<?php 
                        echo $image_row->id;
                        ?>
" image_key="<?php 
                        echo $stri;
                        ?>
"></div>
							<?php 
                        $stri++;
                        break;
                    case 'video':
                        if ($image_row->id == $current_image_id) {
                            $current_pos = $stri;
                            $current_key = $stri;
                        }
                        ?>
								<div id="huge_it_dots_<?php 
                        echo $stri;
                        ?>
_gallery_<?php 
                        echo $sliderID;
                        ?>
" class="huge_it_slideshow_dots_gallery_<?php 
                        echo $sliderID;
                        ?>
 <?php 
                        echo $key == $current_image_id ? 'huge_it_slideshow_dots_active_gallery_' . $sliderID : 'huge_it_slideshow_dots_deactive_gallery_' . $sliderID;
                        ?>
" onclick="huge_it_change_image_gallery_<?php 
                        echo $sliderID;
                        ?>
(parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                        echo $sliderID;
                        ?>
').val()), '<?php 
                        echo $stri;
                        ?>
', data_gallery_<?php 
                        echo $sliderID;
                        ?>
,false,true);return false;" image_id="<?php 
                        echo $image_row->id;
                        ?>
" image_key="<?php 
                        echo $stri;
                        ?>
"></div>
							<?php 
                        $stri++;
                        break;
                    case 'last_posts':
                        foreach ($recent_posts as $lkeys => $last_posts) {
                            if ($lkeys < $image_row->sl_url) {
                                if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                    $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                    if ($image_row->id == $current_image_id) {
                                        $current_pos = $stri;
                                        $current_key = $stri;
                                    }
                                    ?>
								<div id="huge_it_dots_<?php 
                                    echo $stri;
                                    ?>
_gallery_<?php 
                                    echo $sliderID;
                                    ?>
" class="huge_it_slideshow_dots_gallery_<?php 
                                    echo $sliderID;
                                    ?>
 <?php 
                                    echo $stri == $current_image_id ? 'huge_it_slideshow_dots_active_gallery_' . $sliderID : 'huge_it_slideshow_dots_deactive_gallery_' . $sliderID;
                                    ?>
" onclick="huge_it_change_image_gallery_<?php 
                                    echo $sliderID;
                                    ?>
(parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                                    echo $sliderID;
                                    ?>
').val()), '<?php 
                                    echo $stri;
                                    ?>
', data_gallery_<?php 
                                    echo $sliderID;
                                    ?>
,false,true);return false;" image_id="<?php 
                                    echo $image_row->id;
                                    ?>
" image_key="<?php 
                                    echo $stri;
                                    ?>
"></div>
							<?php 
                                    $stri++;
                                }
                            }
                        }
                        break;
                }
            }
            ?>
			  </div>
			
			<?php 
            if ($paramssld['slider_show_arrows'] == "on") {
                ?>
				<a id="huge_it_slideshow_left_gallery_<?php 
                echo $sliderID;
                ?>
" href="#" onclick="huge_it_change_image_gallery_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                echo $sliderID;
                ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                echo $sliderID;
                ?>
').val()) - iterator_gallery_<?php 
                echo $sliderID;
                ?>
()) >= 0 ? (parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                echo $sliderID;
                ?>
').val()) - iterator_gallery_<?php 
                echo $sliderID;
                ?>
()) % data_gallery_<?php 
                echo $sliderID;
                ?>
.length : data_gallery_<?php 
                echo $sliderID;
                ?>
.length - 1, data_gallery_<?php 
                echo $sliderID;
                ?>
,false,true);return false;">
					<div id="huge_it_slideshow_left-ico_gallery_<?php 
                echo $sliderID;
                ?>
">
					<div><i class="huge_it_slideshow_prev_btn_gallery_<?php 
                echo $sliderID;
                ?>
 fa"></i></div></div>
				</a>
				
				<a id="huge_it_slideshow_right_gallery_<?php 
                echo $sliderID;
                ?>
" href="#" onclick="huge_it_change_image_gallery_<?php 
                echo $sliderID;
                ?>
(parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                echo $sliderID;
                ?>
').val()), (parseInt(jQuery('#huge_it_current_image_key_gallery_<?php 
                echo $sliderID;
                ?>
').val()) + iterator_gallery_<?php 
                echo $sliderID;
                ?>
()) % data_gallery_<?php 
                echo $sliderID;
                ?>
.length, data_gallery_<?php 
                echo $sliderID;
                ?>
,false,true);return false;">
					<div id="huge_it_slideshow_right-ico_<?php 
                echo $sliderID;
                ?>
 , data_<?php 
                echo $sliderID;
                ?>
">
					<div><i class="huge_it_slideshow_next_btn_gallery_<?php 
                echo $sliderID;
                ?>
 fa"></i></div></div>
				</a>
			<?php 
            }
            ?>
		</div>
	  <!-- ##########################IMAGES######################### -->
      <div id="huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
" class="huge_it_slideshow_image_container_gallery_<?php 
            echo $sliderID;
            ?>
">        
        <div class="huge_it_slide_container_gallery_<?php 
            echo $sliderID;
            ?>
">
          <div class="huge_it_slide_bg_gallery_<?php 
            echo $sliderID;
            ?>
">
            <ul class="huge_it_slider_gallery_<?php 
            echo $sliderID;
            ?>
">
			<?php 
            $i = 0;
            foreach ($images as $key => $image_row) {
                $imagerowstype = $image_row->sl_type;
                if ($image_row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        $target = "";
                        ?>
						  <li class="huge_it_slideshow_image<?php 
                        if ($i != $current_image_id) {
                            $current_key = $key;
                            echo '_second';
                        }
                        ?>
_item_gallery_<?php 
                        echo $sliderID;
                        ?>
" id="image_id_gallery_<?php 
                        echo $sliderID . '_' . $i;
                        ?>
">      
							<?php 
                        if ($image_row->sl_url != "") {
                            if ($image_row->link_target == "on") {
                                $target = 'target="_blank' . $image_row->link_target . '"';
                            }
                            echo '<a href="' . $image_row->sl_url . '" ' . $target . '>';
                        }
                        ?>
							<img alt="<?php 
                        echo $image_row->name;
                        ?>
" id="huge_it_slideshow_image_gallery_<?php 
                        echo $sliderID;
                        ?>
" class="huge_it_slideshow_image_gallery_<?php 
                        echo $sliderID;
                        ?>
" src="<?php 
                        echo $image_row->image_url;
                        ?>
" image_id="<?php 
                        echo $image_row->id;
                        ?>
" />
							<?php 
                        if ($image_row->sl_url != "") {
                            echo '</a>';
                        }
                        ?>
		
							<div class="huge_it_slideshow_title_text_gallery_<?php 
                        echo $sliderID;
                        ?>
 <?php 
                        if (trim($image_row->name) == "") {
                            echo "none";
                        }
                        ?>
">
								<?php 
                        echo $image_row->name;
                        ?>
							</div>
							<div class="huge_it_slideshow_description_text_gallery_<?php 
                        echo $sliderID;
                        ?>
 <?php 
                        if (trim($image_row->description) == "") {
                            echo "none";
                        }
                        ?>
">
								<?php 
                        echo $image_row->description;
                        ?>
							</div>
						  </li>
						  <?php 
                        $i++;
                        break;
                    case 'last_posts':
                        foreach ($recent_posts as $lkeys => $last_posts) {
                            if ($lkeys < $image_row->sl_url) {
                                $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($last_posts["ID"]), 'thumbnail-size', true);
                                if (get_the_post_thumbnail($last_posts["ID"], 'thumbnail') != '') {
                                    $target = "";
                                    ?>
								  <li class="huge_it_slideshow_image<?php 
                                    if ($i != $current_image_id) {
                                        $current_key = $key;
                                        echo '_second';
                                    }
                                    ?>
_item_gallery_<?php 
                                    echo $sliderID;
                                    ?>
" id="image_id_gallery_<?php 
                                    echo $sliderID . '_' . $i;
                                    ?>
">      
									<?php 
                                    if ($image_row->sl_postlink == "1") {
                                        if ($image_row->link_target == "on") {
                                            $target = 'target="_blank' . $image_row->link_target . '"';
                                        }
                                        echo '<a href="' . $last_posts["guid"] . '" ' . $target . '>';
                                    }
                                    ?>
									<img alt="<?php 
                                    echo $image_row->name;
                                    ?>
" id="huge_it_slideshow_image_gallery_<?php 
                                    echo $sliderID;
                                    ?>
" class="huge_it_slideshow_image_gallery_<?php 
                                    echo $sliderID;
                                    ?>
" src="<?php 
                                    echo $imagethumb[0];
                                    ?>
" image_id="<?php 
                                    echo $image_row->id;
                                    ?>
" />
									<?php 
                                    if ($image_row->sl_postlink == "1") {
                                        echo '</a>';
                                    }
                                    ?>
		
									<div class="huge_it_slideshow_title_text_gallery_<?php 
                                    echo $sliderID;
                                    ?>
 <?php 
                                    if (trim($last_posts["post_title"]) == "") {
                                        echo "none";
                                    }
                                    if ($image_row->sl_stitle != "1") {
                                        echo " hidden";
                                    }
                                    ?>
">
											<?php 
                                    echo $last_posts["post_title"];
                                    ?>
									</div>
									<div class="huge_it_slideshow_description_text_gallery_<?php 
                                    echo $sliderID;
                                    ?>
 <?php 
                                    if (trim($last_posts["post_content"]) == "") {
                                        echo "none";
                                    }
                                    if ($image_row->sl_sdesc != "1") {
                                        echo " hidden";
                                    }
                                    ?>
">
										<?php 
                                    echo substr_replace($last_posts["post_content"], "", $image_row->description);
                                    ?>
									</div>
								 </li>
								  <?php 
                                    $i++;
                                }
                            }
                        }
                        break;
                    case 'video':
                        ?>
							<li  class="huge_it_slideshow_image<?php 
                        if ($i != $current_image_id) {
                            $current_key = $key;
                            echo '_second';
                        }
                        ?>
_item_gallery_<?php 
                        echo $sliderID;
                        ?>
" id="image_id_gallery_<?php 
                        echo $sliderID . '_' . $i;
                        ?>
">      
								<?php 
                        if (strpos($image_row->image_url, 'youtube') !== false) {
                            $video_thumb_url = get_youtube_id_from_url($image_row->image_url);
                            ?>
										
										<div id="video_id_gallery_<?php 
                            echo $sliderID;
                            ?>
_<?php 
                            echo $key;
                            ?>
" class="huge_it_video_frame_gallery_<?php 
                            echo $sliderID;
                            ?>
"></div>
								<?php 
                        } else {
                            $vimeo = $image_row->image_url;
                            $openError = explode("/", $vimeo);
                            $imgid = end($openError);
                            ?>
					
									<iframe id="player_<?php 
                            echo $key;
                            ?>
"  class="huge_it_video_frame_gallery_<?php 
                            echo $sliderID;
                            ?>
" src="//player.vimeo.com/video/<?php 
                            echo $imgid;
                            ?>
?api=1&player_id=player_<?php 
                            echo $key;
                            ?>
&showinfo=0&controls=0" frameborder="0" allowfullscreen></iframe>
								<?php 
                        }
                        ?>
							</li>
						<?php 
                        $i++;
                        break;
                }
            }
            ?>
			   <input type="hidden" id="huge_it_current_image_key_gallery_<?php 
            echo $sliderID;
            ?>
" value="0" />
            </ul>
          </div>
        </div>
      </div>
	</div>
		<?php 
            break;
            /* ########## VIEW 4 Thumbnails VIEW ##########*/
        /* ########## VIEW 4 Thumbnails VIEW ##########*/
        case 4:
            ?>
		<link href="<?php 
            echo plugins_url('../style/thumb_view.css', __FILE__);
            ?>
" rel="stylesheet" type="text/css" />
		<script src="<?php 
            echo plugins_url('../js/thumb_view.min.js', __FILE__);
            ?>
"></script>
		<script src="<?php 
            echo plugins_url('../js/jquery.lazyload.min.js', __FILE__);
            ?>
"></script>
		
		<style>
			section #huge_it_gallery {
				padding: 0px !important;
				min-width: 100%;
				width: 100%;
				min-height: 100%;
				text-align: center;
				margin-bottom: 30px;
				<?php 
            if ($paramssld["thumb_box_has_background"] == 'on') {
                ?>
  background-color: #<?php 
                echo $paramssld["thumb_box_background"];
                ?>
; <?php 
            }
            ?>
				<?php 
            if ($paramssld["thumb_box_use_shadow"] == 'on') {
                echo 'box-shadow: 0 0 10px;';
            }
            ?>
			}
				

			#huge_it_gallery .huge_it_big_li {
				overflow:hidden;
				width: <?php 
            echo $paramssld["thumb_image_width"];
            ?>
px;	
				height: <?php 
            echo $paramssld["thumb_image_height"];
            ?>
px;
				margin: <?php 
            echo $paramssld["thumb_margin_image"];
            ?>
px !important;
				border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
				padding:0px !important
			}
			
			section #huge_it_gallery li .overLayer ul li h2,
			section #huge_it_gallery li .infoLayer ul li h2 {
				font-size: <?php 
            echo $paramssld["thumb_title_font_size"];
            ?>
px;
				color: #<?php 
            echo $paramssld["thumb_title_font_color"];
            ?>
;
			}
			
			section #huge_it_gallery li .infoLayer ul li p {
				color: #<?php 
            echo $paramssld["thumb_title_font_color"];
            ?>
;
			}
			
			section #huge_it_gallery li .overLayer,
			section #huge_it_gallery li .infoLayer {
				-webkit-transition: opacity 0.3s linear;
				-moz-transition: opacity 0.3s linear;
				-ms-transition: opacity 0.3s linear;
				-o-transition: opacity 0.3s linear;
				transition: opacity 0.3s linear;
				width: <?php 
            echo $paramssld["thumb_image_width"];
            ?>
px;
				height: <?php 
            echo $paramssld["thumb_image_height"];
            ?>
px;
				position: absolute;
				text-align: center;
				opacity: 0;
				top: 0px;
				left: 0;
				z-index: 4;
			}
			
			section #huge_it_gallery li a {
				position: absolute;
				display: block;
				width: <?php 
            echo $paramssld["thumb_image_width"];
            ?>
px;
				height: <?php 
            echo $paramssld["thumb_image_height"];
            ?>
px;
				top: 0px;
				left: 0px;
				z-index: 6; 
				border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
			}
			
			#huge_it_gallery li img {
				width: <?php 
            echo $paramssld["thumb_image_width"] - 2 * $paramssld["thumb_image_border_width"];
            ?>
px;	
			<?php 
            if ($paramssld["thumb_image_behavior"] == 'on') {
                ?>
				height: <?php 
                echo $paramssld["thumb_image_height"] - 2 * $paramssld["thumb_image_border_width"];
                ?>
px;
			<?php 
            }
            ?>
				border: <?php 
            echo $paramssld["thumb_image_border_width"];
            ?>
px solid #<?php 
            echo $paramssld["thumb_image_border_color"];
            ?>
;
				border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
				margin:0px !important;
			}
			
			
  			section #huge_it_gallery li:hover .overLayer {
				-webkit-transition: opacity 0.3s linear;
				-moz-transition: opacity 0.3s linear;
				-ms-transition: opacity 0.3s linear;
				-o-transition: opacity 0.3s linear;
				transition: opacity 0.3s linear;
				opacity: <?php 
            echo $paramssld["thumb_title_background_transparency"] / 100 + 0.001;
            ?>
;
				display: block;
				background: #<?php 
            echo $paramssld["thumb_title_background_color"];
            ?>
; 
                                border-radius: <?php 
            echo $paramssld["thumb_image_border_radius"];
            ?>
px;
			}
			section #huge_it_gallery li:hover .infoLayer {
				-webkit-transition: opacity 0.3s linear;
				-moz-transition: opacity 0.3s linear;
				ms-transition: opacity 0.3s linear;
				-o-transition: opacity 0.3s linear;
				transition: opacity 0.3s linear;
				opacity: 1;
				display: block; 
			}
			
			section #huge_it_gallery p {text-align:center;}
		</style>
		<section>
			<ul id="huge_it_gallery">
				<li id="fullPreview"></li>
				<?php 
            foreach ($images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                ?>
				<li class="huge_it_big_li">
				<?php 
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
									
						<a class="group1" href="<?php 
                        echo $row->image_url;
                        ?>
"></a>
						<img alt="<?php 
                        echo $row->name;
                        ?>
" src="<?php 
                        echo $row->image_url;
                        ?>
" />
					<?php 
                        break;
                    case 'video':
                        ?>
							<?php 
                        $videourl = get_video_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
									<a class="youtube huge_it_gallery_item group1"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
"></a>
									<img alt="<?php 
                            echo $row->name;
                            ?>
" src="http://img.youtube.com/vi/<?php 
                            echo $videourl[0];
                            ?>
/mqdefault.jpg"  />				
								<?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            ?>
									<a class="vimeo huge_it_gallery_item group1" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
"></a>
									<img alt="<?php 
                            echo $row->name;
                            ?>
" src="<?php 
                            echo $imgsrc;
                            ?>
"  />
								<?php 
                        }
                        ?>
					<?php 
                        break;
                }
                ?>
					<div class="overLayer"></div>
					<div class="infoLayer">
						<ul>
							<li>
								<h2>
									<?php 
                echo $row->name;
                ?>
								</h2>
							</li>
							<li>
								<p>
									<?php 
                echo $paramssld["thumb_view_text"];
                ?>
								</p>
							</li>
						</ul>
					</div>
				</li>
				<?php 
            }
            ?>
				
			</ul>
		</section>
		<?php 
            break;
            ///////////////////////////// view 8 justified's view ///////////////////////////////////////
        ///////////////////////////// view 8 justified's view ///////////////////////////////////////
        case 6:
            ?>
        <?php 
            $path_site = plugins_url("", __FILE__);
            ?>
        <link rel="stylesheet" href="<?php 
            echo $path_site;
            ?>
/../style/justifiedGallery.css" />
		<script>
			var imagemargin=<?php 
            echo $paramssld["ht_view8_element_padding"];
            ?>
;
			var imagerandomize=<?php 
            echo $paramssld["ht_view8_element_randomize"];
            ?>
;
			var imagecssAnimation=<?php 
            echo $paramssld["ht_view8_element_cssAnimation"];
            ?>
;
			var imagecssAnimationSpeed=<?php 
            echo $paramssld["ht_view8_element_animation_speed"];
            ?>
;
			var imageheight= <?php 
            echo $paramssld["ht_view8_element_height"];
            ?>
;
			var imagejustify= <?php 
            echo $paramssld["ht_view8_element_justify"];
            ?>
;
			var imageshowcaption= <?php 
            echo $paramssld["ht_view8_element_show_caption"];
            ?>
;
			//var imagemaxheight=<?php 
            //echo $paramssld["ht_view8_element_maxheight"];
            ?>
;
			//var imagefixed=<?php 
            //echo $paramssld["ht_view8_element_size_fix"];
            ?>
;
		</script>
	    <script src="<?php 
            echo $path_site;
            ?>
/../js/justifiedGallery.js"></script>
        
<style>
	.justified-gallery {
		width: 100%;
		position: relative;
	}
	.justified-gallery > a,
	.justified-gallery > div {
		position: absolute;
		display: inline-block;
		opacity: 0;
		overflow:hidden;
		filter: alpha(opacity=0);
		/* IE8 or Earlier */
	}
	.justified-gallery > a > img,
	.justified-gallery > div > img {
	   /* width: 200px !important;*/
		position: absolute;
		top: 50%;
		left: 50%;
		padding: 0;
		//border: <?php 
            ?>
<?php// echo $paramssld["ht_view8_element_border_width"]; ?>px solid #<?php 
            ?>
<?php// echo $paramssld["ht_view8_element_border_color"]; ?>;
		//border-radius: <?php 
            ?>
<?php// echo $paramssld["ht_view8_element_border_radius"]; ?>px;
	}
	.justified-gallery > a > .caption,
	.justified-gallery > div > .caption {
		display: none;
		position: absolute;
		bottom: 0;
		padding: 5px;
		left: 0;
		right: 0;
		margin: 0;
		color: #<?php 
            echo $paramssld["ht_view8_element_title_font_color"];
            ?>
;
		font-size: <?php 
            echo $paramssld["ht_view8_element_title_font_size"];
            ?>
px;
		font-weight: 300;
		font-family: sans-serif;
		//margin-left: <?php 
            //echo $paramssld["ht_view8_element_border_width"];
            ?>
px;
		background:<?php 
            list($r, $g, $b) = array_map('hexdec', str_split($paramssld['ht_view8_element_title_background_color'], 2));
            $titleopacity = $paramssld["ht_view8_element_title_overlay_transparency"] / 100;
            echo 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $titleopacity . ')  !important';
            ?>
;
		
		overflow: hidden;
		text-overflow: ellipsis;
		white-space:nowrap;
	}
	.justified-gallery > a > .caption.caption-visible,
	.justified-gallery > div > .caption.caption-visible {
		display: initial;
		opacity: 0.7;
		filter: "alpha(opacity=70)";
		/* IE8 or Earlier */
		-webkit-animation: justified-gallery-show-caption-animation 500ms 0 ease;
		-moz-animation: justified-gallery-show-caption-animation 500ms 0 ease;
		-ms-animation: justified-gallery-show-caption-animation 500ms 0 ease;
	}
	.justified-gallery > .entry-visible {
		opacity: 1.0;
		filter: alpha(opacity=100);
		/* IE8 or Earlier */
		-webkit-animation: justified-gallery-show-entry-animation 300ms 0 ease;
		-moz-animation: justified-gallery-show-entry-animation 300ms 0 ease;
		-ms-animation: justified-gallery-show-entry-animation 300ms 0 ease;
	}
	.justified-gallery > .spinner {
		position: absolute;
		bottom: 0;
		margin-left: -24px;
		padding: 10px 0 10px 0;
		left: 50%;
		opacity: initial;
		filter: initial;
		overflow: initial;
	}
	.justified-gallery > .spinner > span {
		display: inline-block;
		opacity: 0;
		filter: alpha(opacity=0);
		/* IE8 or Earlier */
		width: 8px;
		height: 8px;
		margin: 0 4px 0 4px;
		background-color: #000;
		border-top-left-radius: 6px;
		border-top-right-radius: 6px;
		border-bottom-right-radius: 6px;
		border-bottom-left-radius: 6px;
	}
        .play-icon {
                position:absolute;
                top:0px;
                left:0px;
                width:100%;
                height:100%;	

        }

        .play-icon.youtube-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.youtube.png) center center no-repeat;}
        .play-icon.vimeo-icon {background:url(<?php 
            echo plugin_dir_url(__FILE__);
            ?>
../images/play.vimeo.png) center center no-repeat;}
</style>


<?php 
            $path_site = plugins_url("", __FILE__);
            ?>
                <div id="mygallery_<?php 
            echo $galleryID;
            ?>
" class="clearfix">
                    <?php 
            foreach ($images as $key => $row) {
                $imgurl = explode(";", $row->image_url);
                $link = $row->sl_url;
                $descnohtml = strip_tags($row->description);
                $result = substr($descnohtml, 0, 50);
                $imagerowstype = $row->sl_type;
                if ($row->sl_type == '') {
                    $imagerowstype = 'image';
                }
                switch ($imagerowstype) {
                    case 'image':
                        ?>
                                <?php 
                        if ($row->image_url != ';') {
                            ?>
                                <a class="group1" href="<?php 
                            echo $imgurl[0];
                            ?>
">
                                    <img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="<?php 
                            echo $imgurl[0];
                            ?>
"/>
                                </a>
                                <?php 
                        } else {
                            ?>
                                <img alt="<?php 
                            echo $row->name;
                            ?>
" id="wd-cl-img<?php 
                            echo $key;
                            ?>
" src="images/noimage.jpg"  />
                                <?php 
                        }
                        ?>
                                <?php 
                        break;
                    case 'video':
                        $videourl = get_video_id_from_url($row->image_url);
                        if ($videourl[1] == 'youtube') {
                            ?>
                                        <a class="youtube huge_it_gallery_item group1"  href="https://www.youtube.com/embed/<?php 
                            echo $videourl[0];
                            ?>
">
                                                <img alt="<?php 
                            echo $row->name;
                            ?>
" src="http://img.youtube.com/vi/<?php 
                            echo $videourl[0];
                            ?>
/mqdefault.jpg" />
                                                <div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
                                        </a>
                                <?php 
                        } else {
                            $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $videourl[0] . ".php"));
                            $imgsrc = $hash[0]['thumbnail_large'];
                            ?>
                                        <a class="vimeo huge_it_gallery_item group1" href="http://player.vimeo.com/video/<?php 
                            echo $videourl[0];
                            ?>
">
                                                <img alt="<?php 
                            echo $row->name;
                            ?>
" src="<?php 
                            echo $imgsrc;
                            ?>
" />
                                                <div class="play-icon <?php 
                            echo $videourl[1];
                            ?>
-icon"></div>
                                        </a>
                                <?php 
                        }
                }
            }
            ?>
                </div>


<script>
    jQuery(document).ready(function(){

    jQuery("#mygallery_<?php 
            echo $galleryID;
            ?>
").justifiedGallery();

}); 
</script>
  <?php 
            break;
    }
    ?>
      <?php 
    return ob_get_clean();
}
Example #10
0
        <tbody>

          <? if ($video) { ?>
          <? foreach ($video as $item) { ?>
          <tr>
            <td class="center"><input type="checkbox" name="selected[]" value="<?php 
echo $item['id_video'];
?>
" /></td>
            
            <td class="left" valign="top">
                    <?php 
if ($item['iframe']) {
    ?>
                        <img src="http://img.youtube.com/vi/<?php 
    echo get_youtube_id_from_url($item['iframe']);
    ?>
/0.jpg" width="40" /> 
                    <?php 
} else {
    ?>
                        <img src="/assets/backend/img/no_image.jpg"  width="40" height="35" />                         
                    <?php 
}
?>
            </td>  
                       
            <td class="left"><a href="/admin/video_form/<?php 
echo $item['parent'];
?>
/<?php 
Example #11
0
function Html_editgallery($ord_elem, $count_ord, $images, $row, $cat_row, $rowim, $rowsld, $rowsposts, $rowsposts8, $postsbycat)
{
    global $wpdb;
    if (isset($_GET["addslide"])) {
        if ($_GET["addslide"] == 1) {
            header('Location: admin.php?page=gallerys_huge_it_gallery&id=' . $row->id . '&task=apply');
        }
    }
    ?>
<script type="text/javascript">
function submitbutton(pressbutton) 
{
	if(!document.getElementById('name').value){
	alert("Name is required.");
	return;
	
	}
	filterInputs();		
	document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
	document.getElementById("adminForm").submit();
	
}
var  name_changeRight = function(e) {
	document.getElementById("name").value = e.value;
}
var  name_changeTop = function(e) {
		document.getElementById("huge_it_gallery_name").value = e.value;
		//alert(e);
	};
function change_select()
{
		submitbutton('apply'); 
	
}

	/*** creating array of changed projects***/

function filterInputs() {
	
		var mainInputs = "";
		jQuery("#images-list > li.highlights").each(function(){
			jQuery(this).next().addClass('submit-post');
			jQuery(this).prev().addClass('submit-post');
			jQuery(this).addClass('submit-post');
			jQuery(this).removeClass('highlights');
		})
		if(jQuery("#images-list > li.submit-post").length) {
			
			jQuery("#images-list > li.submit-post").each(function(){
				
				var inputs = jQuery(this).find('.order_by').attr("name");
				var n = inputs.lastIndexOf('_');
				var res = inputs.substring(n+1, inputs.length);
				res +=',';
				mainInputs += res;

			});

			mainInputs = mainInputs.substring(0,mainInputs.length-1);

				
			jQuery(".changedvalues").val(mainInputs);
			
			jQuery("#images-list > li").not('.submit-post').each(function(){
					jQuery(this).find('input').removeAttr('name');
					jQuery(this).find('textarea').removeAttr('name');
			});
			console.log(mainInputs);
			return mainInputs;
		
		}
		jQuery("#images-list > li").each(function(){
				jQuery(this).find('input').removeAttr('name');
				jQuery(this).find('textarea').removeAttr('name');
				jQuery(this).find('select').removeAttr('name');
		});

}	
		/***</add>***/
		
jQuery(function() {
	/*** <posted only submit classes> ***/ 

	jQuery( "#images-list > li input" ).on('keyup',function(){
		jQuery(this).parents("#images-list > li").addClass('submit-post');
		//filterInputs();
	});
	jQuery( "#images-list > li textarea" ).on('keyup',function(){
		jQuery(this).parents("#images-list > li").addClass('submit-post');
	//	filterInputs();
	});
	jQuery( "#images-list > li input" ).on('change',function(){
		jQuery(this).parents("#images-list > li").addClass('submit-post');
	//	filterInputs();
	});
	jQuery('.editimageicon').click(function(){
		jQuery(this).parents("#images-list > li").addClass('submit-post');		
	})
	/*** </posted only submit classes> ***/ 

	jQuery( "#images-list" ).sortable({
	  stop: function() {
			jQuery("#images-list > li").removeClass('has-background');
			count=jQuery("#images-list > li").length;
			for(var i=0;i<=count;i+=2){
					jQuery("#images-list > li").eq(i).addClass("has-background");
			}
			jQuery("#images-list > li").each(function(){
				jQuery(this).find('.order_by').val(jQuery(this).index());
			//	jQuery(this).find('.order_by').trigger('change');
			});
	  },
     change: function(event, ui) {
            var start_pos = ui.item.data('start_pos');
            var index = ui.placeholder.index();
            if (start_pos < index) {
                jQuery('#images-list > li:nth-child(' + index + ')').addClass('highlights');
            } else {
                jQuery('#images-list > li:eq(' + (index + 1) + ')').addClass('highlights');
            }
        },
        update: function(event, ui) {
            jQuery('#sortable li').removeClass('highlights');
        },
	  revert: true
	});
   // jQuery( "ul, li" ).disableSelection();
	});
</script>

<!-- GENERAL PAGE, ADD IMAGES PAGE -->
<?php 
    $path_site2 = plugins_url("../images", __FILE__);
    ?>
<style>
		.free_version_banner {
			position:relative;
			display:block;
			background-image:url(<?php 
    echo $path_site2;
    ?>
/wp_banner_bg.jpg);
			background-position:top left;
			backround-repeat:repeat;
			overflow:hidden;
		}
		
		.free_version_banner .manual_icon {
			position:absolute;
			display:block;
			top:15px;
			left:15px;
		}
		
		.free_version_banner .usermanual_text {
                        font-weight: bold !important;
			display:block;
			float:left;
			width:270px;
			margin-left:75px;
			font-family:'Open Sans',sans-serif;
			font-size:12px;
			font-weight:300;
			font-style:italic;
			color:#ffffff;
			line-height:10px;
                        margin-top: 0;
                        padding-top: 15px;
		}
		
		.free_version_banner .usermanual_text a,
		.free_version_banner .usermanual_text a:link,
		.free_version_banner .usermanual_text a:visited {
			display:inline-block;
			font-family:'Open Sans',sans-serif;
			font-size:17px;
			font-weight:600;
			font-style:italic;
			color:#ffffff;
			line-height:30.5px;
			text-decoration:underline;
		}
		
		.free_version_banner .usermanual_text a:hover,
		.free_version_banner .usermanual_text a:focus,
		.free_version_banner .usermanual_text a:active {
			text-decoration:underline;
		}
		
		.free_version_banner .get_full_version,
		.free_version_banner .get_full_version:link,
		.free_version_banner .get_full_version:visited {
                        padding-left: 60px;
                        padding-right: 4px;
			display: inline-block;
                        position: absolute;
                        top: 15px;
                        right: calc(50% - 167px);
                        height: 38px;
                        width: 268px;
                        border: 1px solid rgba(255,255,255,.6);
                        font-family: 'Open Sans',sans-serif;
                        font-size: 23px;
                        color: #ffffff;
                        line-height: 43px;
                        text-decoration: none;
                        border-radius: 2px;
		}
		
		.free_version_banner .get_full_version:hover {
			background:#ffffff;
			color:#bf1e2e;
			text-decoration:none;
			outline:none;
		}
		
		.free_version_banner .get_full_version:focus,
		.free_version_banner .get_full_version:active {
			
		}
		
		.free_version_banner .get_full_version:before {
			content:'';
			display:block;
			position:absolute;
			width:33px;
			height:23px;
			left:25px;
			top:9px;
			background-image:url(<?php 
    echo $path_site2;
    ?>
/wp_shop.png);
			background-position:0px 0px;
			background-repeat;
		}
		
		.free_version_banner .get_full_version:hover:before {
			background-position:0px -27px;
		}
		
		.free_version_banner .huge_it_logo {
			float:right;
			margin:15px 15px;
		}
		
		.free_version_banner .description_text {
                        padding:0 0 13px 0;
			position:relative;
			display:block;
			width:100%;
			text-align:center;
			float:left;
			font-family:'Open Sans',sans-serif;
			color:#fffefe;
			line-height:inherit;
		}
                .free_version_banner .description_text p{
                        margin:0;
                        padding:0;
                        font-size: 14px;
                }
		</style>

<div class="wrap">
    <?php 
    $path_site2 = plugins_url("../images", __FILE__);
    ?>
	<div class="free_version_banner">
		<img class="manual_icon" src="<?php 
    echo $path_site2;
    ?>
/icon-user-manual.png" alt="user manual" />
		<p class="usermanual_text">If you have any difficulties in using the options, Follow the link to <a href="http://huge-it.com/wordpress-gallery-user-manual/" target="_blank">User Manual</a></p>
		<a class="get_full_version" href="http://huge-it.com/wordpress-gallery/" target="_blank">GET THE FULL VERSION</a>
                <a href="http://huge-it.com" target="_blank"><img class="huge_it_logo" src="<?php 
    echo $path_site2;
    ?>
/Huge-It-logo.png"/></a>
                <div style="clear: both;"></div>
		<div  class="description_text"><p>This is the free version of the plugin. Click "GET THE FULL VERSION" for more advanced options.   We appreciate every customer.</p></div>
	</div>
	<div style="clear: both;"></div>
<form action="admin.php?page=gallerys_huge_it_gallery&id=<?php 
    echo $row->id;
    ?>
" method="post" name="adminForm" id="adminForm">
	<input type="hidden" class="changedvalues" value="" name="changedvalues" size="80">	

	<div id="poststuff" >
	<div id="gallery-header">
		<ul id="gallerys-list">
			
			<?php 
    foreach ($rowsld as $rowsldires) {
        if ($rowsldires->id != $row->id) {
            ?>
					<li>
						<a href="#" onclick="window.location.href='admin.php?page=gallerys_huge_it_gallery&task=edit_cat&id=<?php 
            echo $rowsldires->id;
            ?>
'" ><?php 
            echo $rowsldires->name;
            ?>
</a>
					</li>
				<?php 
        } else {
            ?>
					<li class="active" onclick="this.firstElementChild.style.width = ((this.firstElementChild.value.length + 1) * 8) + 'px';" style="background-image:url(<?php 
            echo plugins_url('../images/edit.png', __FILE__);
            ?>
);cursor: pointer;">
						<input class="text_area" onkeyup = "name_changeTop(this)" onfocus="this.style.width = ((this.value.length + 1) * 8) + 'px'" type="text" name="name" id="name" maxlength="250" value="<?php 
            echo esc_html(stripslashes($row->name));
            ?>
" />
					</li>
				<?php 
        }
    }
    ?>
			<li class="add-new">
				<a onclick="window.location.href='admin.php?page=gallerys_huge_it_gallery&amp;task=add_cat'">+</a>
			</li>
		</ul>
		</div>
		<div id="post-body" class="metabox-holder columns-2">
			<!-- Content -->
			<div id="post-body-content">


			<?php 
    add_thickbox();
    ?>

				<div id="post-body">
					<div id="post-body-heading">
						<h3>Projects/Images</h3>
						


						<script>
jQuery(document).ready(function($){
	jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".attachment-filters").css("display","none");
	});
  var _custom_media = true,
      _orig_send_attachment = wp.media.editor.send.attachment;
	 

  jQuery('.huge-it-newuploader .button').click(function(e) {
    var send_attachment_bkp = wp.media.editor.send.attachment;
	
    var button = jQuery(this);
    var id = button.attr('id').replace('_button', '');
    _custom_media = true;

	jQuery("#"+id).val('');
	wp.media.editor.send.attachment = function(props, attachment){
      if ( _custom_media ) {
	     jQuery("#"+id).val(attachment.url+';;;'+jQuery("#"+id).val());
		 jQuery("#save-buttom").click();
      } else {
        return _orig_send_attachment.apply( this, [props, attachment] );
      };
    }
  
    wp.media.editor.open(button);
	 
    return false;
  });

  jQuery('.add_media').on('click', function(){
    _custom_media = false;
	
  });
/*	jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".media-menu .media-menu-item").css("display","none");
		jQuery(".media-menu-item:first").css("display","block");
		jQuery(".separator").next().css("display","none");
		jQuery('.attachment-filters').val('image').trigger('change');
		jQuery(".attachment-filters").css("display","none");
	});*/
});
</script>
						<input type="hidden" name="imagess" id="_unique_name" />
						<span class="wp-media-buttons-icon"></span>
						<div class="huge-it-newuploader uploader button button-primary add-new-image">
						<input type="button" class="button wp-media-buttons-icon" name="_unique_name_button" id="_unique_name_button" value="Add Image" />
						</div>
						<?php 
    $_GET['id'] = esc_html($_GET['id']);
    ?>
					
						<a href="admin.php?page=gallerys_huge_it_gallery&task=gallery_video&id=<?php 
    echo $_GET['id'];
    ?>
&TB_iframe=1" class="button button-primary add-video-slide thickbox"  id="slideup3s" value="iframepop">
							<span class="wp-media-buttons-icon"></span>Add Video
						</a>


					
				
					</div>
					<ul id="images-list">
					<?php 
    function get_youtube_id_from_url($url)
    {
        if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $url, $match)) {
            return $match[1];
        }
    }
    $i = 2;
    foreach ($rowim as $key => $rowimages) {
        ?>
					<?php 
        if ($rowimages->sl_type == '') {
            $rowimages->sl_type = 'image';
        }
        switch ($rowimages->sl_type) {
            case 'image':
                ?>
						<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
>
						<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
							<div class="image-container">
								<img src="<?php 
                echo $rowimages->image_url;
                ?>
" />
								<div>
										<script>
jQuery(document).ready(function($){
  var _custom_media = true,
      _orig_send_attachment = wp.media.editor.send.attachment;

  jQuery('.huge-it-editnewuploader .button<?php 
                echo $rowimages->id;
                ?>
').click(function(e) {
    var send_attachment_bkp = wp.media.editor.send.attachment;
    var button = jQuery(this);
    var id = button.attr('id').replace('_button', '');
    _custom_media = true;
    wp.media.editor.send.attachment = function(props, attachment){
      if ( _custom_media ) {
        jQuery("#"+id).val(attachment.url);
		jQuery("#save-buttom").click();
      } else {
        return _orig_send_attachment.apply( this, [props, attachment] );
      };
    }

    wp.media.editor.open(button);
    return false;
  });

  jQuery('.add_media').on('click', function(){
    _custom_media = false;
  });
	jQuery(".huge-it-editnewuploader").click(function() {
	});
		jQuery(".wp-media-buttons-icon").click(function() {
	/*	jQuery(".wp-media-buttons-icon").click(function() {
		jQuery(".media-menu .media-menu-item").css("display","none");
		jQuery(".media-menu-item:first").css("display","block");
		jQuery(".separator").next().css("display","none");
		jQuery('.attachment-filters').val('image').trigger('change');
		jQuery(".attachment-filters").css("display","none");

	});*/
});
	if(jQuery('#rating').val()=='off'){
			jQuery('.like_dislike_wrapper').css('display','none');
			jQuery('.heart_wrapper').css('display','none');
		}else if (jQuery('#rating').val()=='dislike'){
			jQuery('.like_dislike_wrapper').css('display','block');
			jQuery('.heart_wrapper').css('display','none');
			jQuery('.heart_wrapper').find('input').removeAttr('name');
		}else if (jQuery('#rating').val()=='heart'){
			jQuery('.heart_wrapper').css('display','block');
			
			
		}


		jQuery('#rating').on('change',function(){
			if(jQuery(this).val()=='off'){
				jQuery('.like_dislike_wrapper').css('display','none');
				jQuery('.heart_wrapper').css('display','none');
			}else if (jQuery(this).val()=='dislike'){
				jQuery('.like_dislike_wrapper').css('display','block');
				jQuery('.heart_wrapper').css('display','none');
				jQuery('.heart_wrapper').find('input').removeAttr('name');
			}else if (jQuery(this).val()=='heart'){
				jQuery('.heart_wrapper').css('display','block');
				jQuery('.like_dislike_wrapper').css('display','none');
				jQuery('.heart_wrapper').each(function(){
					var num=jQuery(this).find('input').attr('num');
					jQuery(this).find('input').attr('name','like_'+num);
				})
					
			}

		});

});
	function deleteproject<?php 
                echo $rowimages->id;
                ?>
() {
	   jQuery('#adminForm').attr('action', 'admin.php?page=gallerys_huge_it_gallery&task=edit_cat&id=<?php 
                echo $row->id;
                ?>
&removeslide=<?php 
                echo $rowimages->id;
                ?>
');
	}
</script>
								<input type="hidden" name="imagess<?php 
                echo $rowimages->id;
                ?>
" id="_unique_name<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->image_url;
                ?>
" />
								<span class="wp-media-buttons-icon"></span>
								<div class="huge-it-editnewuploader uploader button<?php 
                echo $rowimages->id;
                ?>
 add-new-image">
								<input type="button" class="button<?php 
                echo $rowimages->id;
                ?>
 wp-media-buttons-icon editimageicon" name="_unique_name_button<?php 
                echo $rowimages->id;
                ?>
" id="_unique_name_button<?php 
                echo $rowimages->id;
                ?>
" value="Edit image" />
							</div>
									</div>
							</div>
							<div class="image-options">
								<div>
									<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Title:</label>
									<input  class="text_area" type="text" id="titleimage<?php 
                echo $rowimages->id;
                ?>
" name="titleimage<?php 
                echo $rowimages->id;
                ?>
" id="titleimage<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->name);
                ?>
">
								</div>
								<div class="description-block">
									<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description:</label>
									<textarea id="im_description<?php 
                echo $rowimages->id;
                ?>
" name="im_description<?php 
                echo $rowimages->id;
                ?>
" ><?php 
                echo str_replace('__5_5_5__', '%', $rowimages->description);
                ?>
</textarea>
								</div>
								<div class="link-block">
									<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">URL:</label>
									<input class="text_area url-input" type="text" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->sl_url);
                ?>
" >
									<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">
										<span>Open in new tab</span>
										<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />
									</label>
									
									
							
								</div>
								<div class="remove-image-container">
									<a onclick="deleteproject<?php 
                echo $rowimages->id;
                ?>
(); submitbutton('apply');" id="remove_image<?php 
                echo $rowimages->id;
                ?>
" class="button remove-image">Remove Image</a>
								</div>
								<div class="like_dislike_wrapper">
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
">Ratings:</label>
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
" class="like">Like</label>
									<input  class="" type="number" id="like_<?php 
                echo $rowimages->id;
                ?>
" name="like_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->like);
                ?>
">
									<label for="dislike_<?php 
                echo $rowimages->id;
                ?>
" class="dislike">Dislike</label>
									<input  class="" num="<?php 
                echo $rowimages->id;
                ?>
" type="number" id="dislike_<?php 
                echo $rowimages->id;
                ?>
" name="dislike_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->dislike);
                ?>
">
								</div>
								<div class="heart_wrapper">
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
">Ratings:</label>
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
" class="like">Hearts</label>
									<input  class="" num="<?php 
                echo $rowimages->id;
                ?>
" type="number" id="like_<?php 
                echo $rowimages->id;
                ?>
" name="like_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->like);
                ?>
">								
								</div>
							</div>
							
						<div class="clear"></div>
						</li>
						<?php 
                break;
            case 'last_posts':
                ?>
						<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
  >
						<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
							<div class="image-container">
								<img width='100' height='100' src="<?php 
                echo plugins_url('images/pin.png', __FILE__);
                ?>
" />
							</div>
							<div class="recent-post-options image-options">
								<div>
									<div class="left">
										<?php 
                $categories = get_categories();
                ?>
										<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Show Posts From:</label>
										<select name="titleimage<?php 
                echo $rowimages->id;
                ?>
" class="categories-list">
											<option <?php 
                if (str_replace('__5_5_5__', '%', $rowimages->name) == 0) {
                    echo 'selected="selected"';
                }
                ?>
 value="0">All Categories</option>
										<?php 
                foreach ($categories as $strcategories) {
                    ?>
											<option <?php 
                    if (str_replace('__5_5_5__', '%', $rowimages->name) == $strcategories->cat_name) {
                        echo 'selected="selected"';
                    }
                    ?>
 value="<?php 
                    echo $strcategories->cat_name;
                    ?>
"><?php 
                    echo $strcategories->cat_name;
                    ?>
</option>
										<?php 
                }
                ?>
 
										</select>
									</div>
									<div  class="left">
										<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">Showing Posts Count:</label>
										<input class="text_area url-input number" type="number" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->sl_url);
                ?>
" >
									</div>
								</div>
	
								<div>
									<label class="long" for="sl_stitle<?php 
                echo $rowimages->id;
                ?>
">Show Title:</label>
									<input type="hidden" name="sl_stitle<?php 
                echo $rowimages->id;
                ?>
" value="" />
									<input  <?php 
                if ($rowimages->sl_stitle == '1') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" name="sl_stitle<?php 
                echo $rowimages->id;
                ?>
" value="1" />
								</div>
								<div>
									<div class="left margin">
										<label class="long" for="sl_sdesc<?php 
                echo $rowimages->id;
                ?>
">Show Description:</label>
										<input type="hidden" name="sl_sdesc<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->sl_sdesc == '1') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" name="sl_sdesc<?php 
                echo $rowimages->id;
                ?>
" value="1" />
									</div>
									<div class="left">
										<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description Symbols Number:</label>
										<input value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->description);
                ?>
" class="text_area url-input number" id="im_description<?php 
                echo $rowimages->id;
                ?>
" type="number" name="im_description<?php 
                echo $rowimages->id;
                ?>
" />
									</div>
								</div>
								<div>
									<div class="left margin">
										<label class="long" for="sl_postlink<?php 
                echo $rowimages->id;
                ?>
">Use Post Link:</label>
										<input type="hidden" name="sl_postlink<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->sl_postlink == '1') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" name="sl_postlink<?php 
                echo $rowimages->id;
                ?>
" value="1" />
									</div>
									<div  class="left">	
										<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">Open Link In New Tab:</label>
										<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />

									</div>
								</div>
								<div class="remove-image-container">
									<a class="button remove-image" href="admin.php?page=sliders_huge_it_slider&id=<?php 
                echo $row->id;
                ?>
&task=apply&removeslide=<?php 
                echo $rowimages->id;
                ?>
">Remove Last posts</a>
								</div>
							</div>
							
						<div class="clear"></div>
						</li>
						<?php 
                break;
            case 'video':
                ?>
							
							<li <?php 
                if ($i % 2 == 0) {
                    echo "class='has-background'";
                }
                $i++;
                ?>
  >
							<input class="order_by" type="hidden" name="order_by_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->ordering;
                ?>
" />
								<?php 
                if (strpos($rowimages->image_url, 'youtube') !== false || strpos($rowimages->image_url, 'youtu') !== false) {
                    $liclass = "youtube";
                    $video_thumb_url = get_youtube_id_from_url($rowimages->image_url);
                    $thumburl = '<img src="http://img.youtube.com/vi/' . $video_thumb_url . '/mqdefault.jpg" alt="" />';
                } else {
                    if (strpos($rowimages->image_url, 'vimeo') !== false) {
                        $liclass = "vimeo";
                        $vimeo = $rowimages->image_url;
                        $vimeo_explode = explode("/", $vimeo);
                        $imgid = end($vimeo_explode);
                        $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $imgid . ".php"));
                        $imgsrc = $hash[0]['thumbnail_large'];
                        $imgsrc = esc_html($imgsrc);
                        $thumburl = '<img src="' . $imgsrc . '" alt="" />';
                    }
                }
                ?>
 
									<div class="image-container">	
										<?php 
                echo $thumburl;
                ?>
										<div class="play-icon <?php 
                echo $liclass;
                ?>
"></div>
										
										<div>
											<script>
													jQuery(document).ready(function ($) {
															
															jQuery("#slideup<?php 
                echo $key;
                ?>
").click(function () {
																window.parent.uploadID = jQuery(this).prev('input');
																formfield = jQuery('.upload').attr('name');
																tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
																
																return false;
															});
															window.send_to_editor = function (html) {
																imgurl = jQuery('img', html).attr('src');
																window.parent.uploadID.val(imgurl);
																
																tb_remove();
																jQuery("#save-buttom").click();
															};
														});
			function deleteproject<?php 
                echo $rowimages->id;
                ?>
() {
			   jQuery('#adminForm').attr('action', 'admin.php?page=gallerys_huge_it_gallery&task=edit_cat&id=<?php 
                echo $row->id;
                ?>
&removeslide=<?php 
                echo $rowimages->id;
                ?>
');
			}
											</script>
											<input type="hidden" name="imagess<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo $rowimages->image_url;
                ?>
" />
										</div>
									</div>
									<div class="image-options">
								<div>
									<label for="titleimage<?php 
                echo $rowimages->id;
                ?>
">Title:</label>
									<input  class="text_area" type="text" id="titleimage<?php 
                echo $rowimages->id;
                ?>
" name="titleimage<?php 
                echo $rowimages->id;
                ?>
" id="titleimage<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->name);
                ?>
">
								</div>
								<div class="description-block">
									<label for="im_description<?php 
                echo $rowimages->id;
                ?>
">Description:</label>
									<textarea id="im_description<?php 
                echo $rowimages->id;
                ?>
" name="im_description<?php 
                echo $rowimages->id;
                ?>
" ><?php 
                echo str_replace('__5_5_5__', '%', $rowimages->description);
                ?>
</textarea>
								</div>
								<div class="link-block">
									<label for="sl_url<?php 
                echo $rowimages->id;
                ?>
">URL:</label>
									<input class="text_area url-input" type="text" id="sl_url<?php 
                echo $rowimages->id;
                ?>
" name="sl_url<?php 
                echo $rowimages->id;
                ?>
"  value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->sl_url);
                ?>
" >
									<label class="long" for="sl_link_target<?php 
                echo $rowimages->id;
                ?>
">
										<span>Open in new tab</span>
										<input type="hidden" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" value="" />
										<input  <?php 
                if ($rowimages->link_target == 'on') {
                    echo 'checked="checked"';
                }
                ?>
  class="link_target" type="checkbox" id="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" name="sl_link_target<?php 
                echo $rowimages->id;
                ?>
" />
									</label>
									
									
							
								</div>
								<div class="remove-image-container">
									<a onclick="deleteproject<?php 
                echo $rowimages->id;
                ?>
(); submitbutton('apply');" id="remove_image<?php 
                echo $rowimages->id;
                ?>
" class="button remove-image">Remove Image</a>
								</div>
								<div class="like_dislike_wrapper">
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
">Ratings:</label>
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
" class="like">Like</label>
									<input  class="" type="number" id="like_<?php 
                echo $rowimages->id;
                ?>
" name="like_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->like);
                ?>
">
									<label for="dislike_<?php 
                echo $rowimages->id;
                ?>
" class="dislike">Dislike</label>
									<input  class="" num="<?php 
                echo $rowimages->id;
                ?>
" type="number" id="dislike_<?php 
                echo $rowimages->id;
                ?>
" name="dislike_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->dislike);
                ?>
">
								</div>
								<div class="heart_wrapper">
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
">Ratings:</label>
									<label for="like_<?php 
                echo $rowimages->id;
                ?>
" class="like">Hearts</label>
									<input  class="" num="<?php 
                echo $rowimages->id;
                ?>
" type="number" id="like_<?php 
                echo $rowimages->id;
                ?>
" name="like_<?php 
                echo $rowimages->id;
                ?>
" value="<?php 
                echo str_replace('__5_5_5__', '%', $rowimages->like);
                ?>
">								
								</div>
							</div>
							<div class="clear"></div>
							</li>
					<?php 
                break;
        }
        ?>
					<?php 
    }
    ?>
					</ul>
				</div>

			</div>
				
			<!-- SIDEBAR -->
			<div id="postbox-container-1" class="postbox-container">
				<div id="side-sortables" class="meta-box-sortables ui-sortable">
					<div id="gallery-unique-options" class="postbox">
					<h3 class="hndle"><span>Image Gallery Custom Options</span></h3>
					<ul id="gallery-unique-options-list">
						<li>
							<label for="huge_it_gallery_name">Gallery name</label>
							<input type = "text" name="name" id="huge_it_gallery_name" value="<?php 
    echo esc_html(stripslashes($row->name));
    ?>
" onkeyup = "name_changeRight(this)">
						</li>
						<li>
							<label for="huge_it_sl_effects">Select View</label>
							<select name="huge_it_sl_effects" id="huge_it_sl_effects">
									<option <?php 
    if ($row->huge_it_sl_effects == '0') {
        echo 'selected';
    }
    ?>
  value="0">Gallery/Content-Popup</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '1') {
        echo 'selected';
    }
    ?>
  value="1">Content Slider</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '5') {
        echo 'selected';
    }
    ?>
  value="5">Lightbox-Gallery</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '3') {
        echo 'selected';
    }
    ?>
  value="3">Slider</option>
									<option <?php 
    if ($row->huge_it_sl_effects == '4') {
        echo 'selected';
    }
    ?>
  value="4">Thumbnails View</option>
                                    <option <?php 
    if ($row->huge_it_sl_effects == '6') {
        echo 'selected';
    }
    ?>
  value="6">Justified</option>
                                    <option <?php 
    if ($row->huge_it_sl_effects == '7') {
        echo 'selected';
    }
    ?>
  value="7">Blog Style Gallery</option>
							</select>
						</li>
						<script>
						jQuery(document).ready(function ($){
							//alert('hi');
							//$('div[id^="list_"]')
								if($('select[name="display_type"]').val()== 2){
								$('li[id="content_per_page"]').hide();
							}else{
								$('li[id="content_per_page"]').show();
							}
							$('select[name="display_type"]').on('change' ,function(){
								if($(this).val()== 2){
								$('li[id="content_per_page"]').hide();
							}else{
								$('li[id="content_per_page"]').show();
							}
							})
							

							$('#gallery-unique-options').on('change',function(){
								$( 'div[id^="gallery-current-options"]').each(function(){
								if(!$(this).hasClass( "active" )){
									$(this).find('ul li input[name="content_per_page"]').attr('name', '');
									$(this).find('ul li select[name="display_type"]').attr('name', '');
									//$(this).find('ul li select').attr('name', '');
								}else{
									//alert('no');
								}
							})
							})
							
						})
					</script>	
					<div id="gallery-current-options-3" class="gallery-current-options <?php 
    if ($row->huge_it_sl_effects == 3) {
        echo ' active';
    }
    ?>
">
					<ul id="slider-unique-options-list">
						<li>
							<label for="sl_width">Width</label>
							<input type="text" name="sl_width" id="sl_width" value="<?php 
    echo $row->sl_width;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_height">Height</label>
							<input type="text" name="sl_height" id="sl_height" value="<?php 
    echo $row->sl_height;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="pause_on_hover">Pause on hover</label>
							<input type="hidden" value="off" name="pause_on_hover" />					
							<input type="checkbox" name="pause_on_hover"  value="on" id="pause_on_hover"  <?php 
    if ($row->pause_on_hover == 'on') {
        echo 'checked="checked"';
    }
    ?>
 />
						</li>
						<li>
							<label for="gallery_list_effects_s">Effects</label>
							<select name="gallery_list_effects_s" id="gallery_list_effects_s">
									<option <?php 
    if ($row->gallery_list_effects_s == 'none') {
        echo 'selected';
    }
    ?>
  value="none">None</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'cubeH') {
        echo 'selected';
    }
    ?>
   value="cubeH">Cube Horizontal</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'cubeV') {
        echo 'selected';
    }
    ?>
  value="cubeV">Cube Vertical</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'fade') {
        echo 'selected';
    }
    ?>
  value="fade">Fade</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'sliceH') {
        echo 'selected';
    }
    ?>
  value="sliceH">Slice Horizontal</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'sliceV') {
        echo 'selected';
    }
    ?>
  value="sliceV">Slice Vertical</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'slideH') {
        echo 'selected';
    }
    ?>
  value="slideH">Slide Horizontal</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'slideV') {
        echo 'selected';
    }
    ?>
  value="slideV">Slide Vertical</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'scaleOut') {
        echo 'selected';
    }
    ?>
  value="scaleOut">Scale Out</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'scaleIn') {
        echo 'selected';
    }
    ?>
  value="scaleIn">Scale In</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'blockScale') {
        echo 'selected';
    }
    ?>
  value="blockScale">Block Scale</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'kaleidoscope') {
        echo 'selected';
    }
    ?>
  value="kaleidoscope">Kaleidoscope</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'fan') {
        echo 'selected';
    }
    ?>
  value="fan">Fan</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'blindH') {
        echo 'selected';
    }
    ?>
  value="blindH">Blind Horizontal</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'blindV') {
        echo 'selected';
    }
    ?>
  value="blindV">Blind Vertical</option>
									<option <?php 
    if ($row->gallery_list_effects_s == 'random') {
        echo 'selected';
    }
    ?>
  value="random">Random</option>
							</select>
						</li>

						<li>
							<label for="sl_pausetime">Pause time</label>
							<input type="text" name="sl_pausetime" id="sl_pausetime" value="<?php 
    echo $row->description;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="sl_changespeed">Change speed</label>
							<input type="text" name="sl_changespeed" id="sl_changespeed" value="<?php 
    echo $row->param;
    ?>
" class="text_area" />
						</li>
						<li>
							<label for="slider_position">Slider Position</label>
							<select name="sl_position" id="slider_position">
									<option <?php 
    if ($row->sl_position == 'left') {
        echo 'selected';
    }
    ?>
  value="left">Left</option>
									<option <?php 
    if ($row->sl_position == 'right') {
        echo 'selected';
    }
    ?>
   value="right">Right</option>
									<option <?php 
    if ($row->sl_position == 'center') {
        echo 'selected';
    }
    ?>
  value="center">Center</option>
							</select>
						</li>
					</ul>
					</div>
						<div id="gallery-current-options-0" class="gallery-current-options <?php 
    if ($row->huge_it_sl_effects == 0) {
        echo ' active';
    }
    ?>
">
					<ul id="view0">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Images Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>
						<div id="gallery-current-options-5" class="gallery-current-options <?php 
    if ($row->huge_it_sl_effects == 5) {
        echo ' active';
    }
    ?>
">
					<ul id="view5">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Images Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>
					<div id="gallery-current-options-4" class="gallery-current-options <?php 
    if ($row->huge_it_sl_effects == 4) {
        echo ' active';
    }
    ?>
">
					<ul id="view4">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Images Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>
					<div id="gallery-current-options-6" class="gallery-current-options <?php 
    if ($row->huge_it_sl_effects == 6) {
        echo ' active';
    }
    ?>
">
					<ul id="view6">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Images Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>
						<div id="gallery-current-options-7" class="gallery-current-options <?php 
    if ($row->huge_it_sl_effects == 7) {
        echo ' active';
    }
    ?>
">
					<ul id="view7">
						
						  <li>
							<label for="display_type">Displaying Content</label>
							<select id="display_type" name="display_type">

								  <option <?php 
    if ($row->display_type == 0) {
        echo 'selected';
    }
    ?>
  value="0">Pagination</option>
									<option <?php 
    if ($row->display_type == 1) {
        echo 'selected';
    }
    ?>
   value="1">Load More</option>
									<option <?php 
    if ($row->display_type == 2) {
        echo 'selected';
    }
    ?>
   value="2">Show All</option>
						
							</select>
							</li>
						<li id="content_per_page">
							<label for="content_per_page">Images Per Page</label>
							<input type="text" name="content_per_page" id="content_per_page" value="<?php 
    echo $row->content_per_page;
    ?>
" class="text_area" />
						</li>
						

					
					</ul>
					</div>
					
					<li>
						<label for="rating">Ratings</label>
						<select id="rating" name="rating">

							  <option <?php 
    if ($row->rating == 'off') {
        echo 'selected';
    }
    ?>
  value="off">Off</option>
								<option <?php 
    if ($row->rating == 'dislike') {
        echo 'selected';
    }
    ?>
   value="dislike">Like/Dislike</option>
								<option <?php 
    if ($row->rating == 'heart') {
        echo 'selected';
    }
    ?>
   value="heart">Heart</option>
					
						</select>
					</li>
					</ul>
						<div id="major-publishing-actions">
							<div id="publishing-action">
								<input type="button" onclick="submitbutton('apply')" value="Save gallery" id="save-buttom" class="button button-primary button-large">
							</div>
							<div class="clear"></div>
							<!--<input type="button" onclick="window.location.href='admin.php?page=gallerys_huge_it_gallery'" value="Cancel" class="button-secondary action">-->
						</div>
					</div>
					<div id="gallery-shortcode-box" class="postbox shortcode ms-toggle">
					<h3 class="hndle"><span>Usage</span></h3>
					<div class="inside">
						<ul>
							<li rel="tab-1" class="selected">
								<h4>Shortcode</h4>
								<p>Copy &amp; paste the shortcode directly into any WordPress post or page.</p>
								<textarea class="full" readonly="readonly">[huge_it_gallery id="<?php 
    echo $row->id;
    ?>
"]</textarea>
							</li>
							<li rel="tab-2">
								<h4>Template Include</h4>
								<p>Copy &amp; paste this code into a template file to include the slideshow within your theme.</p>
								<textarea class="full" readonly="readonly">&lt;?php echo do_shortcode("[huge_it_gallery id='<?php 
    echo $row->id;
    ?>
']"); ?&gt;</textarea>
							</li>
						</ul>
					</div>
				</div>
				</div>
			</div>
		</div>
	</div>
		<?php 
    @session_start();
    $hugeItCSRFToken = $_SESSION["csrf_token_hugeit_gallery"] = md5(time());
    ?>
	<input type="hidden" name="csrf_token_hugeit_gallery" value="<?php 
    echo $hugeItCSRFToken;
    ?>
" />
	<input type="hidden" name="task" value="" />
</form>
</div>

<?php 
}
Example #12
0
foreach ($video as $value) {
    ?>
                            
                            <div class="col-md-6">
                                <?php 
    if ($value['iframe'] != '') {
        ?>
                                    <div class="multimedia-block">
                                        <a class="video fancybox.iframe" href="https://www.youtube.com/embed/<?php 
        echo get_youtube_id_from_url($value['iframe']);
        ?>
">
                                            <div class="multi-img ">
                                                <div class="play_multi_btn"></div>
                                                <img class="img-responsive" src="http://i1.ytimg.com/vi/<?php 
        echo get_youtube_id_from_url($value['iframe']);
        ?>
/sddefault.jpg"/> 
                                            </div> 
                                            
                                            <div class="multimedia-title">
                                                <p class="center"><?php 
        echo $value['name_' . $lng];
        ?>
</p>
                                            </div>
                                        </a>
                                        <div class="date-time-posts">
                                            <span class="center"><i class="mdi mdi-calendar-clock"></i> <?php 
        echo show_date_time($value['data']);
        ?>
Example #13
0
 } else {
     if ($slide->type == 'indicator') {
         $src = '';
         foreach ($indicators as $k => $ind) {
             if ($ind->id == $slide->content) {
                 $src = $ind->link;
             }
         }
         $content_to_display = '<iframe src="' . $src . '" frameborder="0" ></iframe>';
         //$content_to_display = '<input type="hidden" class="src" value="'.$src.'" />';
     } else {
         if ($slide->type == 'media') {
             if (is_img($slide->content)) {
                 $content_to_display = '<img src="' . $slide->content . '" alt="' . $slide->title . '" class="full_width" />';
             } else {
                 $vid_id = get_youtube_id_from_url($slide->content);
                 if (!empty($vid_id)) {
                     $content_to_display = '<iframe style="" src="//www.youtube.com/embed/' . $vid_id . '" frameborder="0"></iframe>';
                     //$content_to_display = '<input type="hidden" class="src" value="//www.youtube.com/embed/'.$vid_id.'" />';
                 } else {
                     $vid_id = get_vimeo_id_from_url($slide->content);
                     if (!empty($vid_id)) {
                         $content_to_display = '<iframe style="" src="//player.vimeo.com/video/' . $vid_id . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
                     }
                 }
             }
             //$all_content = '<div id="slide_preview_content_area" class="col-sm-8 col-md-9">' . $content_to_display . '</div><div id="slide_preview_desc_area" class="col-sm-4 col-md-3 ' . $obj->style . '"><h1>' . $slide->title . '</h1><p>' . remove_unicode($slide->description) . '</p></div>';
         } else {
             if ($slide->type == 'wordcloud') {
                 $winWidth = 800;
                 $winHeight = 600;