403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.185
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/httpd/html/members.watchyoujerk.com/public_html/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/members.watchyoujerk.com/public_html/js/helper.js
enable_vid_swiping  = 1;
enable_vid_hover    = 1;

const { userAgentData, userAgent } = window.navigator;
const edge = Boolean(userAgentData?.brands.find(({ brand }) => brand === 'Microsoft Edge')); // doesn't, chromium though
const chromium85 = !edge && Boolean(userAgentData?.brands.find(({ brand, version }) => brand === 'Chromium' && parseFloat(version, 10) >= 85));
const ff93 = !chromium85 && parseFloat(userAgent.split('Firefox/').pop(), 10) >= 93;
const sb14 = !ff93 && parseFloat(userAgent.split('SamsungBrowser/').pop(), 10) >= 14;
const avifSupport = chromium85 || ff93 || sb14;

// Code that only executes after there hasn't been other calls in X ms
// See here for license and more info - http://yckart.github.io/jquery.unevent.js/

;(function ($) {
    var on = $.fn.on, timer;
    $.fn.on = function () {
        var args = Array.apply(null, arguments);
        var last = args[args.length - 1];

        if (isNaN(last) || (last === 1 && args.pop())) return on.apply(this, args);

        var delay = args.pop();
        var fn = args.pop();

        args.push(function () {
            var self = this, params = arguments;
            clearTimeout(timer);
            timer = setTimeout(function () {
                fn.apply(self, params);
            }, delay);
        });

        return on.apply(this, args);
    };
}(this.jQuery));

// End unevent code


// Diagnostic code that will append text at the bottom of the page

function customlog(html)
{	
	if ($("#customexlog").length == 0)
	{
		$('<div id="customexlog">footer</div>').appendTo('body');
		
		$("#customexlog").css("background-color", "#BBBBBB");
		$("#customexlog").css("width", "100%");
		$("#customexlog").css("position", "fixed");
		$("#customexlog").css("z-index", "1000");
		$("#customexlog").css("bottom", "0px");
		$("#customexlog").css("padding", "20px");
		$("#customexlog").css("max-height", "100px");
		$("#customexlog").css("overflow-y", "scroll");

		$("#customexlog").html((new Date) + " - " + html);		
	}
	else
	{
		$("#customexlog").html((new Date) + " - " + html + "<BR>" +  $("#customexlog").html());
	}
}



$( document ).ready(function() {


	$(".convert_unixtime").each( function(e) { 
		
		vx = $(this).html();
		vs = new Date(vx * 1000);
		
		$(this).html( convert_fromunixtime(vs) );
	});
	
	$(".hide_if_live").each( function(e) { 
		var t = $(this).data("time");
		var u = new Date(t * 1000);
		
		var c = new Date();
		
		if (c < u)
		{
			$(this).show();
		}
	});

	$(".show_if_live").each( function(e) { 
		
		var t = $(this).data("time");
		var u = new Date(t * 1000);
		
		var c = new Date();
		
		if (c >= u)
		{
			$(this).show();
		}
	});


	lsb = $("#live_show_box");

	st = $("#live_show_box").data("start")
	ed = $("#live_show_box").data("end")
	if (st == undefined) return;
	ct = $("#live_show_box").data("currtime")
	
	var s = new Date(st * 1000);
	var e = new Date(ed * 1000);
	
	var live_int = setInterval(function(){ 

		var c = new Date();
		
		fullt = convert_fromunixtime(s);
		
		if (c > e)
		{
			$(".live_show_wrapper").fadeOut();
			clearInterval(live_int);
		}		
		else if (s > c)
		{
			$("#live_show_fulltime").html(fullt);
			$("#live_show_fulltime").fadeIn();

			
			tm = Math.floor(s.getTime() - c.getTime() ) / 1000;
			
			st = Math.floor(tm / 86400);
			if (st < 10) st = "0" + st;
			tm = tm % 86400;
			$("#live_show_days").html(st);
			
			st = Math.floor(tm / 3600);
			if (st < 10) st = "0" + st;
			tm = tm % 3600;
			$("#live_show_hours").html(st);
			
			st = Math.floor(tm / 60);
			if (st < 10) st = "0" + st;
			tm = tm % 60;
			$("#live_show_minutes").html(st);
			
			st = Math.floor(tm);
			if (st < 10) st = "0" + st;
			tm = tm;
			$("#live_show_seconds").html(st);
			
			$("#live_show_now").fadeOut("400", function() { 
				$("#live_show_future").fadeIn();			
			});

		}
		else
		{
			if (lsb.data("refresh") == "1")
			{
				clearInterval(live_int);
				document.location.reload(); 
				return;
			}
			
			$("#live_show_days").html("00");		
			$("#live_show_hours").html("00");		
			$("#live_show_minutes").html("00");		
			$("#live_show_seconds").html("00");
			
			$("#live_show_fulltime").fadeOut(400, function() {
				$("#live_show_watchnow").fadeIn();
			});
			
			$("#live_show_future").fadeOut(400, function() { 			
				$("#live_show_now").fadeIn();	
			});
		}

	}, 1000);
});

function convert_fromunixtime(s)
{
	w = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
	m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
	
	h = s.getHours();
	ampm = (h > 11) ? "pm" : "am";
	h -= (h > 11) ? 12 : 0;
	h = (h == 0) ? 12 : h;
	min = s.getMinutes();
	if (min < 10) min = "0" + min;
	
	return w[s.getDay()] + " " + m[s.getMonth()] + " " + s.getDate() + ", " + s.getFullYear() + " " + h + ":" + min + ampm;
}



var interv;

var animate_selector = '.stdvideo:not([controls]), .stdimage[cnt][cnt!=1]';

this.stdthis = function(ide){

	if (ide == null) { return; }
	
	fnc = function() { 

		idx = $(this);
				
		cnt = idx.attr('cnt');
		v = idx.attr('v');
		v = parseInt(v);
		v = (v + 1) % cnt;
		
		var imageinfo = getSuffixFileZoom( idx[0] );
		var suffix = imageinfo.suffix;
					
					
		if (avifSupport && idx.attr('src' + v + "_avif" + suffix) != undefined )
		{
			sr = idx.attr('src' + v + "_avif" + suffix)
		}
		else if (Modernizr.webp && idx.attr('src' + v + "_webp" + suffix) != undefined )
		{
			sr = idx.attr('src' + v + "_webp" + suffix)
		}
		else if ( idx.attr('src' + v + suffix) != undefined )
		{
			sr = idx.attr('src' + v + suffix)			
		}
		else
		{
			sr = idx.attr('src' + v)	
		}
		
		idx.attr('v', v);
		
		tagAttr = ( idx.prop("tagName") == "SOURCE") ? "srcset" : "src";
		
		if (idx.attr(tagAttr) != sr)
		{
			idx.attr(tagAttr, sr);
		}

		
		if (v == 0 && idx.attr("nolooptrigger") == "1")
		{
			clearInterval(interv);
			ovidimg = currvidimg;
			currvidimg = (currvidimg + 1) % $(animate_selector).length;
			startvidimg();
			return;		
		}

	}

	if ($(ide).prop("tagName") == "PICTURE")
	{
		// If picture tag, loop through all children.
		$(ide).children().each( fnc );
	}
	else
	{		
		// otherwise, pass directly.
		$(ide).each( fnc );
	}
	
}

// Determines the image zoom level
// If iwidth and swidth aren't passed along, this is a general purpose
// combination of retina level * zoom level

// If iwidth and width are passed along, the zoom level
// for an individual image is calculated.

function pixelRatioZoom(iwidth, swidth)
{	
	zr = 1;
	
	if (!!("undefined" != typeof document.documentElement.ontouchstart))
	{
		zr = screen.width / $(window).width();		
	}
	
	var dpr = (window.devicePixelRatio) ? window.devicePixelRatio : 1;
	
	var zm = NaN;

	if (isNaN(zm))
	{
		try
		{
			zm = document.documentElement.clientWidth / window.innerWidth;
		}
		catch(e)
		{
			zm = NaN;
		}
	}
	
	if (isNaN(zm))
	{
		try
		{		
			zm = screen.deviceXDPI / screen.logicalXDPI 
		}
		catch(e)
		{
			zm = NaN;
		}
	}
	
	zm = (isNaN(zm)) ? 1 : zm;
	
	ret = zm * dpr * zr;
	
	if (typeof iwidth == "undefined" || iwidth == 0)
	{
		return ret;
	}
	
	if (typeof swidth == "undefined" || swidth == 0)
	{
		return ret;
	}
	
	// If the image display width and the actual image width are defined, factor that into image zoom.

	return zm * dpr * zr * (iwidth / swidth);	
}

// Given an image, calculate the zoom level for the image
// And subsequently, what suffix it recommends.

function getSuffixFileZoom(v, pfix)
{
	var ret = {};
	
	if (typeof pfix == "undefined")
	{
		pfix = "src0";
	}
	
	if (typeof v.width == "function")
		wdth = v.width();
	else if (typeof v.width == "number")
		wdth = v.width		
	
		
	ret.zoom = pixelRatioZoom(wdth, $(v).attr(pfix + "_1x_width"))
	ret.suffix = "_1x";
	ret.src="";
	
	// Uncomment this if you want to disable retina images.
	// Uncomment and change to 2.0 if you want to force retina images.
	// ret.zoom = 1.0;
	
	
	if (ret.zoom > 3.3 && avifSupport && ($(v).attr(pfix + "_avif_4x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_avif_4x");
		ret.suffix = "_4x"
	}
	else if (ret.zoom > 3.3 && Modernizr.webp && ($(v).attr(pfix + "_webp_4x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_webp_4x");
		ret.suffix = "_4x"
	}
	else if (ret.zoom > 3.3 && ($(v).attr(pfix + "_4x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_4x");
		ret.suffix = "_4x"
	}
	else if (ret.zoom > 2.3 && avifSupport && ($(v).attr(pfix + "_avif_3x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_avif_3x");
		ret.suffix = "_3x"
	}
	else if (ret.zoom > 2.3 && Modernizr.webp && ($(v).attr(pfix + "_webp_3x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_webp_3x");
		ret.suffix = "_3x"
	}
	else if (ret.zoom > 2.3 && ($(v).attr(pfix + "_3x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_3x");
		ret.suffix = "_3x"
	}
	else if (ret.zoom > 1.3 && avifSupport && ($(v).attr(pfix + "_avif_2x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_avif_2x");
		ret.suffix = "_2x"
	}
	else if (ret.zoom > 1.3 && Modernizr.webp && ($(v).attr(pfix + "_webp_2x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_webp_2x");
		ret.suffix = "_2x"
	}
	else if (ret.zoom > 1.3 && ($(v).attr(pfix + "_2x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_2x");
		ret.suffix = "_2x"
	}
	else
	{
		if (avifSupport && ($(v).attr(pfix + "_avif_1x") != undefined))
		{
			ret.src = $(v).attr(pfix + "_avif_1x");
		}
		else if (Modernizr.webp && ($(v).attr(pfix + "_webp_1x") != undefined))
		{
			ret.src = $(v).attr(pfix + "_webp_1x");
		}
		else if ($(v).attr(pfix + "_1x") != undefined)
		{
			ret.src = $(v).attr(pfix + "_1x");
		}
		else
		{
			ret.src = $(v).attr(pfix);
		}
	}
		
	return ret;
}


suffix = "_1x";

var zoom = pixelRatioZoom();
var z_w = NaN;
var z_h = NaN;

try
{
	z_w = window.innerWidth;
	z_h = window.innerHeight;
}
catch(e)
{
	alert(e)
}


// This will swap in new images if page is scrolled
// Or zoomed in.

function szhandler()
{
    var newzoom = pixelRatioZoom();

	var z_nw = NaN;
	var z_nh = NaN;

	try
	{
		z_nw = window.innerWidth;
		z_nh = window.innerHeight;
	}
	catch(e)
	{
		return;
	}

	if (isNaN(z_w) || isNaN(z_h) || isNaN(z_nw) || isNaN(z_nh))
	{
		return;
	}

	// If this is just scrolling, return
	// If zooming or resizing, do not return.

	if ((z_w == z_nw) && (z_h == z_nh) && (newzoom == zoom))
	{
		return;
	}

	z_w = z_nw;
	z_h = z_nh;
        
	zoom = newzoom

	$(".stdimage").each(function(index) {

		o_img = $(this).attr("src");
		var imageinfo = getSuffixFileZoom(this);			
		n_img = imageinfo.src;
		
		if (n_img != o_img)
		{
			$(this).attr("src", n_img);
		}
	});
	
	$(".stdvideo").each(function(index) {

		o_img = $(this).attr("poster");
		var imageinfo = getSuffixFileZoom(this, "poster");			
		n_img = imageinfo.src;
		
		if (n_img != o_img)
		{
			$(this).attr("poster", n_img);
		}
	});
	
}

// zoom / scroll handler.

sch = 0;

if (sch == 0)
{
	try
	{
		document.addEventListener("scroll", szhandler, true);
		sch = 1;
	}
	catch(e) {}
}

if (sch == 0)
{
	try
	{
		window.attachEvent ("onscroll", szhandler);
		sch = 1;
	}
	catch(e) {}
}

$(window).resize(function() {
	szhandler();
});

interv = 0;



// video loading code

var loadnew = 0;
var currvidimg = -1;
var ovidimg = -1;
var disable_vidimgcheck = 0;



this.StdImageHandler = function(){	

	
	imgs = [];
	
	
	
	$(".stdimage").ready(function() {
	
		//! Put .stdimage images into place.
	
		$("img.stdimage").each(function(index) {
			
			var imageinfo = getSuffixFileZoom(this);
			$(this).attr("src", imageinfo.src);
		});
		
		$("picture.stdimage").each(function(index) {
						
			// only populate the first child.
						
			var children = $(this).children();
			for (var i = 0; i < children.length; i++)
			{
				var currentChild = children.eq(i);
				
				if ( $(currentChild).prop("tagName") == "SOURCE" )
				{
					gt = $(currentChild).attr("type")
					
					if (gt == "image/avif" && avifSupport)
					{	
						var imageinfo = getSuffixFileZoom($(currentChild));
						$(currentChild).attr("srcset", imageinfo.src);
						return;
					}
	
					if (gt == "image/webp" && Modernizr.webp)
					{	
						var imageinfo = getSuffixFileZoom($(currentChild));						
						$(currentChild).attr("srcset", imageinfo.src);
						return;
					}
	
					if (gt == "image/jpeg")
					{
						var imageinfo = getSuffixFileZoom($(currentChild));
						$(currentChild).attr("srcset", imageinfo.src);
						return;
					}
				}
			}
		});
	});
	
	function PreloadImage(v)
	{
		cnt = $(v).attr('cnt')
		
		if (cnt < 2)
		{
			return;
		}
	
		var imageinfo = getSuffixFileZoom(v);
		var suffix = imageinfo.suffix;
		
					
		for(c=0; c < cnt; c++)
		{
			
			if (avifSupport && ( $(v).attr('src' + c + "_avif" + suffix) != undefined ))
			{
				itr = imgs.length;
				imgs[itr] = new Image;				
				imgs[itr].src = $(v).attr('src' + c + "_avif" + suffix)
			}
			else if (Modernizr.webp && ( $(v).attr('src' + c + "_webp" + suffix) != undefined ))
			{				
				itr = imgs.length;
				imgs[itr] = new Image;				
				imgs[itr].src = $(v).attr('src' + c + "_webp" + suffix)
			}
			else if ( $(v).attr('src' + c + suffix) != undefined )
			{
				itr = imgs.length;
				imgs[itr] = new Image;				
				imgs[itr].src = $(v).attr('src' + c + suffix)
			}
		
			if ( $(v).attr('src' + c) != undefined )
			{
				itr = imgs.length;
				imgs[itr] = new Image;				
				imgs[itr].src = $(v).attr('src' + c)
			}
		}
	}
	
	
	$(window).on('load', function() {
			
		//! Preload .stdimage rotated images only after page is done.
		$("img.stdimage").each(function(index) {
			PreloadImage( this );
		});
		
		$("picture.stdimage").each(function(index) {
			
			var children = $(this).children();
			for (var i = 0; i < children.length; i++)
			{
				var currentChild = children.eq(i);
				
				if ( $(currentChild).prop("tagName") == "SOURCE" )
				{
					gt = $(currentChild).attr("type")
					
					if (gt == "image/avif" && avifSupport)
					{	
						PreloadImage( $(currentChild) );
						return;
					}
					
					if (gt == "image/webp" && Modernizr.webp)
					{	
						PreloadImage( $(currentChild) );
						return;
					}
					
					if (gt == "image/jpeg")
					{
						PreloadImage( $(currentChild) );
						return;
					}
				}
			}
		});
		
		
		
	});	
	
	//! Load .stdvideo 1x/2x/3x/4x poster into place.
	
	$(".stdvideo").ready(function() {
	
		$(".stdvideo").each(function(index) {
	
			var imageinfo = getSuffixFileZoom(this, "poster");			
			$(this).attr("poster", imageinfo.src);
		});		
	});
	
	//! Different behavior for mouse vs tablet
	
	if (matchMedia('(pointer:fine)').matches)
	{	
		if (enable_vid_hover == 1)
		{
			init_mousehoverbehavior();
		}
	}
	else
	{
		init_touchbehavior();
	}

}

function init_touchbehavior()
{
	if ( $(animate_selector).length != 0 )
	{		
		vidimgcheck();
		startvidimg();
	}		
}


on_hover_start = null;
on_hover_end = null;

function init_mousehoverbehavior()
{	
	$(".stdvideo:not([controls])").hover( function(e) {
	
		$(this).next(".videoloadline").addClass("videoloadline_on");
		on_hover_start = new Date();
		$(this).get(0).play();
	
	}, function() { 
	
		$(".videoloadline").removeClass("videoloadline_on");
		on_hover_start = null;
		on_hover_end = null;
	
		$(this).get(0).pause();
		$(this).get(0).load();

	});	
	
	$('.stdvideo:not([controls])').on('playing',function(){
		
		on_hover_end = new Date();
		
		timeDiff = (on_hover_end - on_hover_start) % 1500;
		
		setTimeout(function () {
			
			$(".videoloadline").removeClass("videoloadline_on");  
			on_hover_start = null;
			on_hover_end = null;

		}, 1500 - timeDiff);
	});

	$(".stdimage").hover(function(e){
		stdthis($(this));
		interv = setInterval(stdthis, 800, $(this));
	},
	function(e){
		clearvidimg(this)
	});
}

function clearvidimg(e)
{
	if ($(e)[0].nodeName == "VIDEO")
	{
		$(e).load();
		$(e).removeAttr("loop");
		$(".videoloadline").removeClass("videoloadline_on");
	}
	else
	{
		fncc = function(fx) {
			
			fx = $(this);
			
			cnt = fx.attr('cnt')
						
			if (cnt > 1)
			{
				var imageinfo = getSuffixFileZoom(fx);
				var suffix = imageinfo.suffix;
			
				fx.attr('v' ,0);
				
				attrname = (fx.prop("tagName") == "SOURCE") ? "srcset" : "src";
								
				if (avifSupport && fx.attr('src0' + "_avif" + suffix) != undefined )
				{
					fx.attr(attrname, fx.attr('src0' + "_avif" + suffix))
				}
				else if (Modernizr.webp && fx.attr('src0' + "_webp" + suffix) != undefined )
				{
					fx.attr(attrname, fx.attr('src0' + "_webp" + suffix))
				}
				else if ( fx.attr('src0' + suffix) != undefined )
				{
					fx.attr(attrname, fx.attr('src0' + suffix))
				}
				else
				{
					fx.attr(attrname, fx.attr('src0'))			
				}
			}	
		}
		
		if ($(e).prop("tagName") == "PICTURE")
		{						
			// If picture tag, clear all children
			$(e).children().each( fncc );
		}
		else
		{	
			// otherwise, pass directly.
			$(e).each( fncc );
		}
	}
	
	clearInterval(interv)
	interv = 0;
}

var restart_check = 0;

function vidimgcheck()
{
	if (disable_vidimgcheck == 1)
	{
		return;
	}
	
	if (restart_check == 1)
	{
		startvidimg();
		restart_check = 0;
		return;
	}

	var is_new = 0;
	if (currvidimg == -1)
	{
		currvidimg = 0;
		is_new = 1;
	}
	
	vd = $(animate_selector).get(currvidimg);
	if (vd == undefined)
	{
		currvidimg = 0;
		startvidimg();
		return;
	}
	
	if ($(vd).get(0).nodeName == "VIDEO")
	{
		if (!loadnew && !vd.paused && !isScrolledIntoView(vd))
		{
			loadnew = 1;

			if (is_new == 0)
			{
				clearvidimg(vd)
				$( animate_selector ).off();
			}
			startvidimg();
			is_new = 0;
			return;
		}	
	}
	else
	{	
		if (!loadnew && !isScrolledIntoView(vd))
		{
			clearvidimg(vd)
			$( animate_selector ).off();
			startvidimg();
			return;
		}		
	}
}




function startvidimg()
{
	if (disable_vidimgcheck == 1)
	{
		return;
	}
	
	if (enable_vid_swiping == 1)
	{
		$(animate_selector).bind('touchstart', function(e){
			
			disable_vidimgcheck = 1;
			
			vlx = this
	
			// Unbind all video activity
			$(animate_selector).unbind("ended");
			
			$(".stdvideo:not([controls])").each( function(e) { 
				
				if ( $(vlx)[0] !== $(this)[0] )
				{
					if (!$(this).get(0).paused)
					{
						$(this).get(0).load();
					}
					
					$(this).next(".videoloadline").removeClass("videoloadline_on");
				}
			});
			
			// Unbind all photo activity and reset to slot.
	
			$(".stdimage").each( function() { 
				clearvidimg(e);
			});
			
			if ( $(this).get(0).nodeName == "VIDEO")
			{
				$(this).attr("loop", "loop")
	
				if (!$(this).get(0).paused)
				{
					$(this).next(".videoloadline").removeClass("videoloadline_on");			
				}
				else
				{
					$(this).next(".videoloadline").addClass("videoloadline_on");
					this.play();
				}
			}
			else
			{
				$(this).removeAttr("nolooptrigger");
				stdthis($(this));
				interv = setInterval(stdthis, 800, $(this));
			}
					
		});
	}	
	
    if ($(animate_selector).length == 0)
	{
		return;	
	}
	
	// Only applies for videos: remove loader.
	$(animate_selector).on('play',function(){		
		$(".videoloadline").removeClass("videoloadline_on");
	});
	
	// Don't try and autoplay on touch devices
	if (!matchMedia('(pointer:fine)').matches) return;
	
	var loopcount = 0;
	
	do
	{
		loopcount++;

		vd = $(animate_selector).get(currvidimg);
		if (vd == undefined)
		{					
			currvidimg = (currvidimg + 1) % $(animate_selector).length;
			continue;
		}

		isv = isScrolledIntoView(vd)
		if (!isv)
		{
			currvidimg = (currvidimg + 1) % $(animate_selector).length;

			if (loopcount > $(animate_selector).length)
			{
				// Nothing is on screen. We wait until the user scrolls or screen is resized to try again.
				currvidimg = -1;
				loadnew = 0;
				restart_check = 1;
				return;
			}		
		}

	} while(!isv);
	
	
	if (ovidimg != -1 && currvidimg != ovidimg)
	{		
		olvd = $(animate_selector).get(ovidimg);
				
		if ($(olvd).get(0).nodeName == "VIDEO")
		{
			$(olvd).get(0).load();			
		}
		else
		{
			clearInterval(interv)
		}
	}

	
	if ($(vd).get(0).nodeName == "VIDEO")
	{
		// Take out loops on video
		$(vd).removeAttr("loop");
	}
	
	
	$( animate_selector ).off();
	
	// Only applies for video
    $( animate_selector).on('ended',function(){
	    
	    ovidimg = currvidimg;
	    currvidimg = (currvidimg + 1) % $(animate_selector).length;
		startvidimg();
		return;		    
    });
    
}




function isScrolledIntoView(elem)
{
	if (!$(elem).is(":visible"))
	{
		return false;
	}
	
    var docViewTop = $(window).scrollTop();
    var docViewBottom = docViewTop + $(window).height();
    var docViewLeft = $(window).scrollLeft();
    var docViewRight = docViewLeft + $(window).width();

    var elemTop = $(elem).offset().top;
    var elemBottom = elemTop + $(elem).height();
    var elemLeft = $(elem).offset().left;
    var elemRight = elemLeft + $(elem).width();

    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop) && (elemRight <= docViewRight) && (elemLeft >= docViewLeft) );
}
		



Youez - 2016 - github.com/yon3zu
LinuXploit