PageSourceSearch

https://www.tristargroup.net/modules/gavias_sliderlayer/vendor/rev…/jquery.themepunch.revolution.js?v=1.x

js tristargroup.net collected 2026-10-06 14:00:01 UTC 92,727 bytes, 2,891 lines download raw bytes

1/**************************************************************************
2 * jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider
3 * @version: 5.2.5.3 (30.05.2016)
4 * @requires jQuery v1.7 or later (tested on 1.9)
5 * @author ThemePunch
6**************************************************************************/
7(function(jQuery,undefined){
8	"use strict";
9		
10	jQuery.fn.extend({
11
12		revolution: function(options) {
13
14			// SET DEFAULT VALUES OF ITEM //
15			var defaults = {
16				delay:9000,
17				responsiveLevels:4064,					// Single or Array for Responsive Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480]					
18				visibilityLevels:[2048,1024,778,480],	// Single or Array for Responsive Visibility Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480]					
19				gridwidth:960,							// Single or Array i.e. 960 or [960, 840,760,460]
20				gridheight:500,							// Single or Array i.e. 500 or [500, 450,400,350]
21				minHeight:0,
22				autoHeight:"off",					
23				sliderType : "standard",				// standard, carousel, hero					
24				sliderLayout : "auto",					// auto, fullwidth, fullscreen				
25
26				fullScreenAutoWidth:"off",				// Turns the FullScreen Slider to be a FullHeight but auto Width Slider
27				fullScreenAlignForce:"off",
28				fullScreenOffsetContainer:"",			// Size for FullScreen Slider minimising Calculated on the Container sizes
29				fullScreenOffset:"0",					// Size for FullScreen Slider minimising					
30
31				hideCaptionAtLimit:0,					// It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser)
32				hideAllCaptionAtLimit:0,				// Hide all The Captions if Width of Browser is less then this value
33				hideSliderAtLimit:0,					// Hide the whole slider, and stop also functions if Width of Browser is less than this value										
34				disableProgressBar:"off",				// Hides Progress Bar if is set to "on"
35				stopAtSlide:-1,							// Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case.
36				stopAfterLoops:-1,						// Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic
37				shadow:0,								//0 = no Shadow, 1,2,3 = 3 Different Art of Shadows  (No Shadow in Fullwidth Version !)
38				dottedOverlay:"none",					//twoxtwo, threexthree, twoxtwowhite, threexthreewhite
39				startDelay:0,							// Delay before the first Animation starts.										
40				lazyType : "smart",						//full, smart, single
41				spinner:"spinner0",
42				shuffle:"off",							// Random Order of Slides,
43
44				
45				viewPort:{
46					enable:false,						// if enabled, slider wait with start or wait at first slide.
47					outof:"wait",						// wait,pause						
48					visible_area:"60%"					
49				},
50
51				fallbacks:{
52					isJoomla:false,
53					panZoomDisableOnMobile:"off",
54					simplifyAll:"on",
55					nextSlideOnWindowFocus:"off",	
56					disableFocusListener:true,
57					ignoreHeightChanges:"off",  // off, mobile, always
58					ignoreHeightChangesSize:0
59				},
60				
61				parallax : {
62					type : "off",						// off, mouse, scroll, mouse+scroll
63					levels: [5, 10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85],
64					origo:"slidercenter",			// slidercenter or enterpoint
65					speed:500,
66					bgparallax:"off",
67					opacity:"off",
68					disable_onmobile:"off",
69					ddd_shadow:"on",
70					ddd_bgfreeze:"off",
71					ddd_overflow:"visible",
72					ddd_layer_overflow:"visible",
73					ddd_z_correction:65,
74					ddd_path:"mouse"
75				},
76				
77				carousel : {
78					horizontal_align : "center",
79					vertical_align : "center",
80					infinity : "on",
81					space : 0,
82					maxVisibleItems : 3,						
83					stretch:"off",						
84					fadeout:"on",						
85					maxRotation:0,						
86					minScale:0,
87					vary_fade:"off",
88					vary_rotation:"on",
89					vary_scale:"off",						
90					border_radius:"0px",
91					padding_top:0,
92					padding_bottom:0
93				},
94
95				navigation : {
96					keyboardNavigation:"off",	
97					keyboard_direction:"horizontal",		//	horizontal - left/right arrows,  vertical - top/bottom arrows
98					mouseScrollNavigation:"off",			// on, off, carousel					
99					onHoverStop:"on",						// Stop Banner Timet at Hover on Slide on/off
100
101					touch:{
102						touchenabled:"off",						// Enable Swipe Function : on/off
103						swipe_treshold : 75,					// The number of pixels that the user must move their finger by before it is considered a swipe.
104						swipe_min_touches : 1,					// Min Finger (touch) used for swipe							
105						drag_block_vertical:false,				// Prevent Vertical Scroll during Swipe
106						swipe_direction:"horizontal"
107					},
108					arrows: {
109						style:"",
110						enable:false,
111						hide_onmobile:false,							
112						hide_onleave:true,
113						hide_delay:200,
114						hide_delay_mobile:1200,
115						hide_under:0,
116						hide_over:9999,
117						tmp:'',
118						rtl:false,
119						left : {															
120							h_align:"left",
121							v_align:"center",
122							h_offset:20,
123							v_offset:0,	
124							container:"slider",							
125						},
126						right : {
127							h_align:"right",
128							v_align:"center",
129							h_offset:20,
130							v_offset:0,
131							container:"slider",
132						}
133					},
134					bullets: {
135						container:"slider",
136						rtl:false,
137						style:"",
138						enable:false,
139						hide_onmobile:false,							
140						hide_onleave:true,
141						hide_delay:200,
142						hide_delay_mobile:1200,
143						hide_under:0,
144						hide_over:9999,
145						direction:"horizontal",
146						h_align:"left",
147						v_align:"center",
148						space:0,
149						h_offset:20,
150						v_offset:0,
151						tmp:'<span class="tp-bullet-image"></span><span class="tp-bullet-title"></span>'
152					},
153					thumbnails: {
154						container:"slider",
155						rtl:false,
156						style:"",
157						enable:false,
158						width:100,
159						height:50,
160						min_width:100,
161						wrapper_padding:2,
162						wrapper_color:"#f5f5f5",
163						wrapper_opacity:1,
164						tmp:'<span class="tp-thumb-image"></span><span class="tp-thumb-title"></span>',
165						visibleAmount:5,
166						hide_onmobile:false,							
167						hide_onleave:true,
168						hide_delay:200,
169						hide_delay_mobile:1200,
170						hide_under:0,
171						hide_over:9999,
172						direction:"horizontal",
173						span:false,
174						position:"inner",							
175						space:2,
176						h_align:"left",
177						v_align:"center",
178						h_offset:20,
179						v_offset:0
180					},
181					tabs: {
182						container:"slider",
183						rtl:false,
184						style:"",
185						enable:false,
186						width:100,
187						min_width:100,
188						height:50,
189						wrapper_padding:10,
190						wrapper_color:"#f5f5f5",
191						wrapper_opacity:1,
192						tmp:'<span class="tp-tab-image"></span>',
193						visibleAmount:5,
194						hide_onmobile:false,							
195						hide_onleave:true,
196						hide_delay:200,
197						hide_delay_mobile: 1200,
198						hide_under:0,
199						hide_over:9999,
200						direction:"horizontal",
201						span:false,
202						space:0,
203						position:"inner",							
204						h_align:"left",
205						v_align:"center",
206						h_offset:20,
207						v_offset:0
208					}
209				},					
210				extensions:"extensions/",			//example extensions/ or extensions/source/
211				extensions_suffix:".min.js",
212				//addons:[{fileprefix:"revolution.addon.whiteboard",init:"initWhiteBoard",params:"opt",handel:"whiteboard"}],
213				debugMode:false
214			};
215				
216			// Merge of Defaults									
217			options = jQuery.extend(true,{},defaults, options);
218			
219			return this.each(function() {	
220
221				
222				var c = jQuery(this);
223				
224				// Prepare maxHeight
225				options.minHeight = options.minHeight!=undefined ? parseInt(options.minHeight,0) : options.minHeight;
226
227				//REMOVE SLIDES IF SLIDER IS HERO
228				if (options.sliderType=="hero") {
229					c.find('>ul>li').each(function(i) {
230						if (i>0) jQuery(this).remove();
231					})
232				}
233				options.jsFileLocation = options.jsFileLocation || getScriptLocation("themepunch.revolution.min.js");						
234				options.jsFileLocation = options.jsFileLocation + options.extensions;
235				options.scriptsneeded = getNeededScripts(options,c);
236				options.curWinRange = 0;
237
238				options.rtl = true; //jQuery('body').hasClass("rtl"); 	
239
240				  if (options.navigation!=undefined && options.navigation.touch!=undefined) 
241       				 options.navigation.touch.swipe_min_touches = options.navigation.touch.swipe_min_touches >5 ? 1 : options.navigation.touch.swipe_min_touches;
242   
243
244
245				jQuery(this).on("scriptsloaded",function() {
246					if (options.modulesfailing ) {
247						c.html('<div style="margin:auto;line-height:40px;font-size:14px;color:#fff;padding:15px;background:#e74c3c;margin:20px 0px;">!! Error at loading Slider Revolution 5.0 Extrensions.'+options.errorm+'</div>').show();
248						return false;
249					}
250
251					// CHECK FOR MIGRATION
252					if (_R.migration!=undefined) options = _R.migration(c,options);			
253					punchgs.force3D = true;
254					if (options.simplifyAll!=="on") punchgs.TweenLite.lagSmoothing(1000,16);													
255					prepareOptions(c,options);
256					initSlider(c,options);
257				});						
258				c.data('opt',options);
259				waitForScripts(c,options);
260			})
261		},
262
263		// Remove a Slide from the Slider
264		revremoveslide : function(sindex) {
265
266			return this.each(function() {	
267				
268				var container=jQuery(this);
269				if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
270					var bt = container.parent().find('.tp-bannertimer'),
271						opt = bt.data('opt');					
272					if (opt && opt.li.length>0) {
273						if (sindex>0 || sindex<=opt.li.length) {
274							
275							var li = jQuery(opt.li[sindex]),
276								ref = li.data("index"),
277								nextslideafter = false;
278										
279							opt.slideamount = opt.slideamount-1;										
280							removeNavWithLiref('.tp-bullet',ref,opt);
281							removeNavWithLiref('.tp-tab',ref,opt);
282							removeNavWithLiref('.tp-thumb',ref,opt);	
283							if (li.hasClass('active-revslide')) 
284								nextslideafter = true;													
285							li.remove();
286							opt.li = removeArray(opt.li,sindex);	
287							if (opt.carousel && opt.carousel.slides)
288								opt.carousel.slides = removeArray(opt.carousel.slides,sindex)
289							opt.thumbs = removeArray(opt.thumbs,sindex);	
290							if (_R.updateNavIndexes) _R.updateNavIndexes(opt); 
291							if (nextslideafter) container.revnext();
292							punchgs.TweenLite.set(opt.li,{minWidth:"99%"});														
293							punchgs.TweenLite.set(opt.li,{minWidth:"100%"});
294						}
295					}
296				}
297			});
298			
299		},
300
301		// Add a New Call Back to some Module
302		revaddcallback: function(callback) {
303			return this.each(function() {						
304				var container=jQuery(this);
305				if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
306					var bt = container.parent().find('.tp-bannertimer'),
307						opt = bt.data('opt');
308					if (opt.callBackArray === undefined)
309						opt.callBackArray = new Array();
310					opt.callBackArray.push(callback);						
311				}
312			})
313		},
314
315		// Get Current Parallax Proc
316		revgetparallaxproc : function() {		
317			var container=jQuery(this);
318			if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
319				var bt = container.parent().find('.tp-bannertimer'),
320					opt = bt.data('opt');
321				return opt.scrollproc;
322			}
323			
324		},
325
326		// ENABLE DEBUG MODE
327		revdebugmode: function() {
328			return this.each(function() {						
329				var container=jQuery(this);
330				if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
331					var bt = container.parent().find('.tp-bannertimer'),
332						opt = bt.data('opt');
333						opt.debugMode = true;
334					containerResized(container,opt);
335				}
336			})
337		},
338
339		// METHODE SCROLL
340		revscroll: function(oy) {
341					return this.each(function() {
342						var container=jQuery(this);
343						if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0)
344							jQuery('body,html').animate({scrollTop:(container.offset().top+(container.height())-oy)+"px"},{duration:400});
345					})
346				},
347
348		// METHODE PAUSE
349		revredraw: function(oy) {
350					return this.each(function() {
351						
352						var container=jQuery(this);
353						if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
354							var bt = container.parent().find('.tp-bannertimer');
355							var opt = bt.data('opt');
356							containerResized(container,opt);																	
357						}
358					})
359				},
360		// METHODE PAUSE
361		revkill: function(oy) {
362
363						var self = this,
364							container=jQuery(this);
365
366							punchgs.TweenLite.killDelayedCallsTo(_R.showHideNavElements);
367							if (_R.endMoveCaption)
368								if (opt.endtimeouts && opt.endtimeouts.length>0) 
369									jQuery.each(opt.endtimeouts,function(i,timeo) {	clearTimeout(timeo);});
370								
371								//punchgs.TweenLite.killDelayedCallsTo(_R.endMoveCaption);
372
373						if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
374
375							container.data('conthover',1);
376							container.data('conthover-changed',1);
377							container.trigger('revolution.slide.onpause');
378							var bt = container.parent().find('.tp-bannertimer'),
379								opt = bt.data('opt');
380							opt.tonpause = true;
381							container.trigger('stoptimer');
382
383							punchgs.TweenLite.killTweensOf(container.find('*'),false);
384							punchgs.TweenLite.killTweensOf(container,false);
385							container.unbind('hover, mouseover, mouseenter,mouseleave, resize');
386							var resizid = "resize.revslider-"+container.attr('id');
387							jQuery(window).off(resizid);
388							container.find('*').each(function() {
389									var el = jQuery(this);
390
391									el.unbind('on, hover, mouseenter,mouseleave,mouseover, resize,restarttimer, stoptimer');
392									el.off('on, hover, mouseenter,mouseleave,mouseover, resize');
393									el.data('mySplitText',null);
394									el.data('ctl',null);
395									if (el.data('tween')!=undefined)
396										el.data('tween').kill();
397									if (el.data('kenburn')!=undefined)
398										el.data('kenburn').kill();
399									if (el.data('timeline_out')!=undefined)											
400										el.data('timeline_out').kill();	
401									if (el.data('timeline')!=undefined)											
402										el.data('timeline').kill();													
403										
404									el.remove();
405									el.empty();
406									el=null;
407							})
408
409
410							punchgs.TweenLite.killTweensOf(container.find('*'),false);
411							punchgs.TweenLite.killTweensOf(container,false);
412							bt.remove();
413							try{container.closest('.forcefullwidth_wrapper_tp_banner').remove();} catch(e) {}
414							try{container.closest('.rev_slider_wrapper').remove()} catch(e) {}
415							try{container.remove();} catch(e) {}
416							container.empty();
417							container.html();
418							container = null;
419
420							opt = null;
421							delete(self.c);
422							delete(self.opt);
423
424							return true;
425						} else {
426							return false;
427						}
428
429
430				},
431
432		// METHODE PAUSE
433		revpause: function() {
434			return this.each(function() {
435				var c=jQuery(this);
436				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
437					c.data('conthover',1);
438					c.data('conthover-changed',1);
439					c.trigger('revolution.slide.onpause');
440					var bt = c.parent().find('.tp-bannertimer');
441					var opt = bt.data('opt');					
442					opt.tonpause = true;
443					c.trigger('stoptimer');
444				}
445			})
446		},
447
448		// METHODE RESUME
449		revresume: function() {
450			return this.each(function() {
451				var c=jQuery(this);
452				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
453					c.data('conthover',0);
454					c.data('conthover-changed',1);
455					c.trigger('revolution.slide.onresume');
456					var bt = c.parent().find('.tp-bannertimer');
457					var opt = bt.data('opt');
458					opt.tonpause = false;					
459					c.trigger('starttimer');
460				}
461			})
462		},
463
464		revstart: function() {
465			//return this.each(function() {
466				var c=jQuery(this);
467				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0 && c.data('opt')) {		
468					if (!c.data('opt')["sliderisrunning"]) {
469						runSlider(c,c.data('opt'));
470						return true;
471					}
472					else {
473						console.log("Slider Is Running Already");
474						return false;
475					}
476
477				}
478			//})
479
480		},
481
482		// METHODE NEXT
483		revnext: function() {
484			return this.each(function() {
485				// CATCH THE CONTAINER
486				var c=jQuery(this);
487				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
488					var bt = c.parent().find('.tp-bannertimer'),
489						opt = bt.data('opt');					
490					_R.callingNewSlide(opt,c,1);
491				}
492			})
493		},
494
495		// METHODE RESUME
496		revprev: function() {
497			return this.each(function() {
498				// CATCH THE CONTAINER
499				var c=jQuery(this);
500				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
501					var bt = c.parent().find('.tp-bannertimer'),
502						opt = bt.data('opt');					
503					_R.callingNewSlide(opt,c,-1);
504				}
505			})
506		},
507
508		// METHODE LENGTH
509		revmaxslide: function() {
510			// CATCH THE CONTAINER
511			return jQuery(this).find('.tp-revslider-mainul >li').length;
512		},
513
514
515		// METHODE CURRENT
516		revcurrentslide: function() {
517			// CATCH THE CONTAINER
518			var c=jQuery(this);
519			if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
520				var bt = c.parent().find('.tp-bannertimer');
521				var opt = bt.data('opt');
522				return parseInt(opt.act,0)+1;
523			}
524		},
525
526		// METHODE CURRENT
527		revlastslide: function() {
528			// CATCH THE CONTAINER
529			return jQuery(this).find('.tp-revslider-mainul >li').length;
530		},
531
532
533		// METHODE JUMP TO SLIDE
534		revshowslide: function(slide) {
535			return this.each(function() {
536				// CATCH THE CONTAINER
537				var c=jQuery(this);
538				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
539					var bt = c.parent().find('.tp-bannertimer'),
540						opt = bt.data('opt');							
541					_R.callingNewSlide(opt,c,"to"+(slide-1));
542				}
543			})
544		},
545		revcallslidewithid: function(slide) {
546			return this.each(function() {
547				// CATCH THE CONTAINER
548				var c=jQuery(this);
549				if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
550					var bt = c.parent().find('.tp-bannertimer'),
551						opt = bt.data('opt');										
552					_R.callingNewSlide(opt,c,slide);
553				}
554			})
555		}		
556});
557
558
559
560//////////////////////////////////////////////////////////////
561// -	REVOLUTION FUNCTION EXTENSIONS FOR GLOBAL USAGE  -  //	
562//////////////////////////////////////////////////////////////
563var _R = jQuery.fn.revolution;
564
565jQuery.extend(true, _R, {
566	
567	simp : function(a,b,basic) {
568		var c = Math.abs(a) - (Math.floor(Math.abs(a / b))*b);																			
569		if (basic)
570			return c;
571		else 
572			return a<0 ? -1*c : c;
573	},
574
575	//	-	IS IOS VERSION OLDER THAN 5 ??	
576 	iOSVersion : function() {
577		var oldios = false;
578		if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
579	        if (navigator.userAgent.match(/OS 4_\d like Mac OS X/i)) {
580	        	oldios = true;
581			}
582	    } else {
583			   oldios = false;
584	    }
585		return oldios;
586	},
587
588
589	//	-	CHECK IF BROWSER IS IE		-		
590	isIE : function( version, comparison ){
591	    var $div = jQuery('<div style="display:none;"/>').appendTo(jQuery('body'));
592	    $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');
593	    var ieTest = $div.find('a').length;
594	    $div.remove();
595	    return ieTest;
596	},
597
598	// 	-	IS MOBILE ?? 
599	is_mobile : function() {
600	    var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];
601		var ismobile=false;
602	    for(var i in agents) {
603	
604		    if (navigator.userAgent.split(agents[i]).length>1) {
605	            ismobile = true;
606	
607	          }
608	    }
609	    return ismobile;		    
610	},
611
612	// -  CALL BACK HANDLINGS - //
613	 callBackHandling : function(opt,type,position) {
614	 	try{
615			if (opt.callBackArray)
616				jQuery.each(opt.callBackArray,function(i,c) {				
617					if (c) {
618						if (c.inmodule && c.inmodule === type)
619							if (c.atposition && c.atposition === position)
620								if (c.callback) 
621									c.callback.call();											
622					}
623				});
624		} catch(e) {
625			console.log("Call Back Failed");
626		}
627	},
628
629	get_browser : function(){
630	    var N=navigator.appName, ua=navigator.userAgent, tem;
631	    var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
632	    if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
633	    M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
634	    return M[0];
635    },
636
637	get_browser_version  : function(){
638	    var N=navigator.appName, ua=navigator.userAgent, tem;
639	    var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
640	    if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
641	    M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
642	    return M[1];
643    },
644
645    // GET THE HORIZONTAL OFFSET OF SLIDER BASED ON THE THU`MBNAIL AND TABS LEFT AND RIGHT SIDE
646	getHorizontalOffset : function(container,side) {
647		var thumbloff = gWiderOut(container,'.outer-left'),
648			thumbroff = gWiderOut(container,'.outer-right');
649							
650		switch (side) {
651			case "left":
652				return thumbloff;
653			break;
654			case "right":
655				return thumbroff;
656			break;
657			case "both":
658				return thumbloff+thumbroff;
659			break;
660		}
661	},
662
663
664	// 	-	CALLING THE NEW SLIDE 	-	//		
665	callingNewSlide : function(opt,container,direction) {
666		
667		
668		var aindex = container.find('.next-revslide').length>0 ? container.find('.next-revslide').index() : container.find('.processing-revslide').length>0 ? container.find('.processing-revslide').index() : container.find('.active-revslide').index(),
669			nindex = 0;
670	
671		container.find('.next-revslide').removeClass("next-revslide");
672		
673		// IF WE ARE ON AN INVISIBLE SLIDE CURRENTLY
674		if (container.find('.active-revslide').hasClass("tp-invisible-slide"))
675			aindex = opt.last_shown_slide;
676		
677		// SET NEXT DIRECTION
678		if (direction && jQuery.isNumeric(direction) || direction.match(/to/g)) {			
679			if (direction===1 || direction === -1) {
680				
681				nindex = aindex + direction;
682				nindex = nindex<0 ? opt.slideamount-1 : nindex>=opt.slideamount ? 0 : nindex;						
683			} else {							
684
685				direction=jQuery.isNumeric(direction) ? direction : parseInt(direction.split("to")[1],0);
686				nindex = direction<0 ? 0 : direction>opt.slideamount-1 ? opt.slideamount-1 : direction;						
687			}
688			container.find('.tp-revslider-slidesli:eq('+nindex+')').addClass("next-revslide");
689		} else 		
690		if (direction) {
691			
692			container.find('.tp-revslider-slidesli').each(function() {
693				var li=jQuery(this);				
694				if (li.data('index')===direction) li.addClass("next-revslide");									
695			})			
696		}
697
698		
699		nindex = container.find('.next-revslide').index();				
700		container.trigger("revolution.nextslide.waiting");
701				
702
703		if ((aindex===nindex && aindex === opt.last_shown_slide) || (nindex !== aindex && nindex!=-1))
704			swapSlide(container,opt);	
705		else
706			container.find('.next-revslide').removeClass("next-revslide");
707	},
708
709	slotSize : function(img,opt) {
710		opt.slotw=Math.ceil(opt.width/opt.slots);
711
712		if (opt.sliderLayout=="fullscreen")
713			opt.sloth=Math.ceil(jQuery(window).height()/opt.slots);
714		else
715			opt.sloth=Math.ceil(opt.height/opt.slots);
716
717		if (opt.autoHeight=="on" && img!==undefined && img!=="")
718		 	opt.sloth=Math.ceil(img.height()/opt.slots);
719
720
721	},
722
723	setSize : function(opt) {
724	
725		var ofh = (opt.top_outer || 0) + (opt.bottom_outer || 0),
726			cpt = parseInt((opt.carousel.padding_top||0),0),
727			cpb = parseInt((opt.carousel.padding_bottom||0),0),
728			maxhei = opt.gridheight[opt.curWinRange];
729
730			opt.paddings = opt.paddings === undefined ? {top:(parseInt(opt.c.parent().css("paddingTop"),0) || 0), bottom:(parseInt(opt.c.parent().css("paddingBottom"),0) || 0)} : opt.paddings; 
731			
732		maxhei = maxhei<opt.minHeight ? opt.minHeight : maxhei;		
733		if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off")	punchgs.TweenLite.set(opt.c,{maxHeight:maxhei+"px"});	
734		opt.c.css({marginTop:cpt,marginBottom:cpb});					
735		opt.width=opt.ul.width();
736		opt.height=opt.ul.height();	
737		setScale(opt);
738			
739		opt.height = Math.round(opt.gridheight[opt.curWinRange] * (opt.width/opt.gridwidth[opt.curWinRange]));
740
741		if (opt.height>opt.gridheight[opt.curWinRange] && opt.autoHeight!="on") opt.height=opt.gridheight[opt.curWinRange];
742
743		if (opt.sliderLayout=="fullscreen" || opt.infullscreenmode) {
744			opt.height = opt.bw * opt.gridheight[opt.curWinRange];
745			var cow = opt.c.parent().width();
746			var coh = jQuery(window).height();
747
748			if (opt.fullScreenOffsetContainer!=undefined) {
749				try{
750					var offcontainers = opt.fullScreenOffsetContainer.split(",");
751					if (offcontainers)
752						jQuery.each(offcontainers,function(index,searchedcont) {
753							coh = jQuery(searchedcont).length>0 ? coh - jQuery(searchedcont).outerHeight(true) : coh;										
754						});
755				} catch(e) {}
756				try{
757					if (opt.fullScreenOffset.split("%").length>1 && opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0) 
758							coh = coh - (jQuery(window).height()* parseInt(opt.fullScreenOffset,0)/100);
759					else
760					if (opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0)
761					 		coh = coh - parseInt(opt.fullScreenOffset,0);								
762				} catch(e) {}
763			}
764
765			coh = coh<opt.minHeight ? opt.minHeight : coh;	
766			coh = coh - ofh;			
767			opt.c.parent().height(coh);
768
769			opt.c.closest('.rev_slider_wrapper').height(coh);
770			opt.c.css({'height':'100%'});
771
772			opt.height=coh;
773			if (opt.minHeight!=undefined && opt.height<opt.minHeight)
774				opt.height = opt.minHeight;
775		} else {
776
777			if (opt.minHeight!=undefined && opt.height<opt.minHeight)
778				opt.height = opt.minHeight;			
779			opt.c.height(opt.height);
780
781		}
782		var si = {	height:(cpt+cpb+ofh+opt.height+opt.paddings.top+opt.paddings.bottom)};	
783		
784		opt.c.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css(si);
785		opt.c.closest('.rev_slider_wrapper').css(si);		
786		setScale(opt);		
787	},
788
789	enterInViewPort : function(opt) {
790		// START COUNTER IF VP ENTERED, AND COUNTDOWN WAS NOT ON YET
791		if (opt.waitForCountDown) {
792			countDown(opt.c,opt);		
793			opt.waitForCountDown=false;			
794		}
795		// START FIRST SLIDE IF NOT YET STARTED AND VP ENTERED
796		if (opt.waitForFirstSlide) {
797			swapSlide(opt.c,opt);		
798			opt.waitForFirstSlide=false;			
799		}			
800
801		if (opt.sliderlaststatus == "playing" || opt.sliderlaststatus==undefined) {
802			opt.c.trigger("starttimer");
803		}			
804
805		
806		if (opt.lastplayedvideos != undefined && opt.lastplayedvideos.length>0) {
807			
808			jQuery.each(opt.lastplayedvideos,function(i,_nc) {
809				
810				_R.playVideo(_nc,opt);
811			});
812		}	
813	},
814
815	leaveViewPort : function(opt) {		
816		opt.sliderlaststatus = opt.sliderstatus;
817		opt.c.trigger("stoptimer");		
818		if (opt.playingvideos != undefined && opt.playingvideos.length>0) { 
819			opt.lastplayedvideos = jQuery.extend(true,[],opt.playingvideos);
820			if (opt.playingvideos)
821				jQuery.each(opt.playingvideos,function(i,_nc) {		
822					opt.leaveViewPortBasedStop = true;		
823					if (_R.stopVideo) _R.stopVideo(_nc,opt);
824				});
825		}
826	},
827
828	unToggleState : function(a) {			
829		if (a!=undefined && a.length>0)
830			jQuery.each(a,function(i,layer) {
831				layer.removeClass("rs-toggle-content-active");
832			});		
833	},
834
835	toggleState : function(a) {
836		if (a!=undefined && a.length>0)
837			jQuery.each(a,function(i,layer) {
838				layer.addClass("rs-toggle-content-active");
839			});
840	},
841	lastToggleState : function(a) {
842		var state = 0;
843		if (a!=undefined && a.length>0)
844			jQuery.each(a,function(i,layer) {
845				state = layer.hasClass("rs-toggle-content-active");
846			});
847		return state;
848	}
849
850});
851
852
853var	_ISM = _R.is_mobile();
854
855
856
857////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
858////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////		
859////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
860////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
861var removeArray = function(arr,i) {
862				var newarr = [];
863				jQuery.each(arr,function(a,b) {
864					if (a!=i) newarr.push(b);
865				})
866				return newarr;
867			}
868
869var removeNavWithLiref = function(a,ref,opt) {
870	opt.c.find(a).each(function() {
871		var a = jQuery(this);
872		if (a.data('liref')===ref)
873			a.remove();
874	})
875}
876
877
878var lAjax = function(s,o) {
879	if (jQuery('body').data(s)) return false;
880	if (o.filesystem) {
881		if (o.errorm===undefined) 
882			o.errorm = "<br>Local Filesystem Detected !<br>Put this to your header:";
883		console.warn('Local Filesystem detected !');
884		o.errorm = o.errorm+'<br>&lt;script type="text/javascript" src="'+o.jsFileLocation+s+o.extensions_suffix+'"&gt;&lt;/script&gt;';
885		console.warn(o.jsFileLocation+s+o.extensions_suffix+' could not be loaded !');
886		console.warn('Please use a local Server or work online or make sure that you load all needed Libraries manually in your Document.');
887		console.log(" ");
888		o.modulesfailing = true;
889		return false;
890	}
891	jQuery.ajax({
892		url:o.jsFileLocation+s+o.extensions_suffix,
893		'dataType':'script',
894		'cache':true,
895		"error":function(e) {
896			console.warn("Slider Revolution 5.0 Error !")
897			console.error("Failure at Loading:"+s+o.extensions_suffix+" on Path:"+o.jsFileLocation)
898			console.info(e);
899		}			
900	});
901	jQuery('body').data(s,true);
902}
903
904var getNeededScripts = function(o,c) {	
905	var n = new Object(),
906		_n = o.navigation;
907	
908	n.kenburns = false;
909	n.parallax = false;
910	n.carousel = false;
911	n.navigation = false;
912	n.videos = false;
913	n.actions = false;
914	n.layeranim = false;
915	n.migration = false;
916
917	
918
919
920	// MIGRATION EXTENSION
921	if (!c.data('version') || !c.data('version').toString().match(/5./gi)) {
922		n.kenburns = true;
923		n.parallax = true;
924		n.carousel = false;
925		n.navigation = true;
926		n.videos = true;
927		n.actions = true;
928		n.layeranim = true;
929		n.migration = true;		
930	}
931	else {
932		// KEN BURN MODUL
933		c.find('img').each(function(){			
934			if (jQuery(this).data('kenburns')=="on") n.kenburns = true;
935		});						
936
937		// NAVIGATION EXTENSTION
938		if (o.sliderType =="carousel" || _n.keyboardNavigation=="on" || _n.mouseScrollNavigation=="on" || _n.touch.touchenabled=="on" || _n.arrows.enable || _n.bullets.enable || _n.thumbnails.enable || _n.tabs.enable )
939			n.navigation = true;
940		
941		// LAYERANIM, VIDEOS, ACTIONS EXTENSIONS
942		c.find('.tp-caption, .tp-static-layer, .rs-background-video-layer').each(function(){
943			var _nc = jQuery(this);
944			if ((_nc.data('ytid')!=undefined  || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('youtube')>0))			
945				n.videos = true;			
946			if ((_nc.data('vimeoid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('vimeo')>0))
947				n.videos = true;		
948			if (_nc.data('actions')!==undefined) 
949				n.actions = true;
950			n.layeranim = true;
951		});
952
953
954		c.find('li').each(function() {
955			if (jQuery(this).data('link') && jQuery(this).data('link')!=undefined) {
956				n.layeranim = true;
957				n.actions = true;
958			}
959		})
960
961		// VIDEO EXTENSION
962		if (!n.videos && (c.find('.rs-background-video-layer').length>0 || c.find(".tp-videolayer").length>0 || c.find(".tp-audiolayer").length>0 || c.find('iframe').length>0 || c.find('video').length>0))						
963			n.videos = true;
964		
965
966		// VIDEO EXTENSION
967		if (o.sliderType =="carousel")
968			n.carousel = true;
969
970		
971
972		if (o.parallax.type!=="off" || o.viewPort.enable || o.viewPort.enable=="true")
973			n.parallax = true;
974	}
975	
976	if (o.sliderType=="hero") {
977		n.carousel = false;
978		n.navigation = false;
979	}
980	
981	if (window.location.href.match(/file:/gi)) {
982		n.filesystem = true;
983		o.filesystem = true;
984	}
985
986	
987	// LOAD THE NEEDED LIBRARIES
988	//if (n.videos && typeof _R.isVideoPlaying=='undefined') lAjax('revolution.extension.video',o);
989	//if (n.carousel && typeof _R.prepareCarousel=='undefined') lAjax('revolution.extension.carousel',o);								
990	//if (!n.carousel && typeof _R.animateSlide=='undefined') lAjax('revolution.extension.slideanims',o);								
991	//if (n.actions && typeof _R.checkActions=='undefined') lAjax('revolution.extension.actions',o);						
992	//if (n.layeranim && typeof _R.handleStaticLayers=='undefined') lAjax('revolution.extension.layeranimation',o);						
993	//if (n.kenburns && typeof _R.stopKenBurn=='undefined') lAjax('revolution.extension.kenburn',o); 
994	//if (n.navigation && typeof _R.createNavigation=='undefined') lAjax('revolution.extension.navigation',o);					
995	//if (n.migration && typeof _R.migration=='undefined') lAjax('revolution.extension.migration',o);					
996	//if (n.parallax && typeof _R.checkForParallax=='undefined') lAjax('revolution.extension.parallax',o);					
997	
998	if (o.addons!=undefined && o.addons.length>0) {		
999		jQuery.each(o.addons, function(i,obj) {			
1000			if (typeof obj === "object" && obj.fileprefix!=undefined) 
1001				lAjax(obj.fileprefix,o);			
1002		})
1003	}
1004	
1005
1006	return n;
1007}
1008
1009///////////////////////////////////
1010//   -  WAIT FOR SCRIPT LOADS  - //
1011///////////////////////////////////	
1012var waitForScripts = function(c,o) {
1013	// CHECK KEN BURN DEPENDENCIES
1014	var addonsloaded = true,
1015		n = o.scriptsneeded;
1016	
1017	// CHECK FOR ADDONS
1018	if (o.addons!=undefined && o.addons.length>0) {		
1019		jQuery.each(o.addons, function(i,obj) {			
1020			if (typeof obj === "object" && obj.init!=undefined) {				
1021				if (_R[obj.init]===undefined) addonsloaded = false;
1022			}
1023		})
1024	}
1025	 
1026	if (n.filesystem || 
1027		(typeof punchgs !== 'undefined' &&
1028		(addonsloaded) &&
1029		(!n.kenburns || (n.kenburns && typeof _R.stopKenBurn !== 'undefined')) &&
1030		(!n.navigation || (n.navigation && typeof _R.createNavigation !== 'undefined')) &&
1031		(!n.carousel || (n.carousel && typeof _R.prepareCarousel !== 'undefined')) &&
1032		(!n.videos || (n.videos && typeof _R.resetVideo !== 'undefined')) &&
1033		(!n.actions || (n.actions && typeof _R.checkActions !== 'undefined')) &&
1034		(!n.layeranim || (n.layeranim && typeof _R.handleStaticLayers !== 'undefined')) &&
1035		(!n.migration || (n.migration && typeof _R.migration !== 'undefined')) &&
1036		(!n.parallax || (n.parallax && typeof _R.checkForParallax !== 'undefined')) &&
1037		(n.carousel || (!n.carousel && typeof _R.animateSlide !== 'undefined'))
1038	   ))
1039		c.trigger("scriptsloaded");
1040	else			
1041		setTimeout(function() {
1042			waitForScripts(c,o);
1043		},50);
1044		
1045}
1046
1047//////////////////////////////////
1048//	-	GET SCRIPT LOCATION	-	//
1049//////////////////////////////////
1050var getScriptLocation = function(a) {
1051
1052	var srcexp = new RegExp("themepunch.revolution.min.js","gi"),
1053		ret = "";
1054	jQuery("script").each(function() {
1055		var src = jQuery(this).attr("src");
1056		if (src && src.match(srcexp)) 								
1057			ret = src;							
1058	});
1059	
1060	ret = ret.replace('jquery.themepunch.revolution.min.js', ''); 
1061	ret = ret.replace('jquery.themepunch.revolution.js', ''); 	
1062	ret = ret.split("?")[0];		
1063	return ret;
1064}
1065
1066//////////////////////////////////////////
1067//	-	ADVANCED RESPONSIVE LEVELS	-	//
1068//////////////////////////////////////////
1069var setCurWinRange = function(opt,vis) {		
1070	var curlevel = 0,
1071		curwidth = 9999,
1072		lastmaxlevel = 0,
1073		lastmaxid = 0,
1074		curid = 0,
1075		winw = jQuery(window).width(),
1076		l = vis && opt.responsiveLevels==9999 ? opt.visibilityLevels : opt.responsiveLevels;
1077	
1078	 if (l && l.length)
1079		jQuery.each(l,function(index,level) {				
1080			if (winw<level) {
1081				if (lastmaxlevel==0 || lastmaxlevel>level) {					
1082					curwidth = level;
1083					curid = index;
1084					lastmaxlevel = level;
1085				}
1086			}
1087		
1088		if (winw>level && lastmaxlevel<level) {
1089			lastmaxlevel = level;
1090			lastmaxid = index;
1091		}
1092	});
1093
1094	if (lastmaxlevel<curwidth) 
1095		curid = lastmaxid;		
1096
1097	
1098	if (!vis)
1099		opt.curWinRange = curid;				
1100	else
1101		opt.forcedWinRange = curid;
1102
1103	
1104}
1105
1106
1107
1108
1109//////////////////////////////////////////
1110//	-	INITIALISATION OF OPTIONS 	-	//
1111//////////////////////////////////////////
1112var prepareOptions = function(container,opt) {		
1113	opt.carousel.maxVisibleItems = opt.carousel.maxVisibleItems < 1 ? 999 : opt.carousel.maxVisibleItems; // === 1 ? 2 : opt.carousel.maxVisibleItems;
1114	opt.carousel.vertical_align = opt.carousel.vertical_align === "top" ? "0%" : opt.carousel.vertical_align==="bottom" ? "100%" : "50%";
1115}
1116
1117var gWiderOut = function(c,cl) {
1118	var r = 0;
1119	c.find(cl).each(function() {
1120		var a = jQuery(this);
1121		if (!a.hasClass("tp-forcenotvisible") && r<a.outerWidth())
1122			r = a.outerWidth();			
1123	});
1124	return r;
1125}
1126
1127
1128
1129
1130//////////////////////////////////////////
1131//	-	INITIALISATION OF SLIDER	-	//
1132//////////////////////////////////////////
1133var initSlider = function (container,opt) {
1134	if (container==undefined) return false;
1135
1136	// CHECK FOR ALTERNATIVE IMAGE, AND IFRAM EXIST, AND WE ARE IN IE8, MOBILE, DRAW IT SIMPLE
1137	if (container.data('aimg')!=undefined) 
1138		if ((container.data('aie8')=="enabled" && _R.isIE(8)) || (container.data('amobile')=="enabled" && _ISM))
1139			container.html('<img class="tp-slider-alternative-image" src="'+container.data("aimg")+'">');
1140	
1141	// PREPRARE SOME CLASSES AND VARIABLES
1142	container.find('>ul').addClass("tp-revslider-mainul");
1143
1144	
1145	// CREATE SOME DEFAULT OPTIONS FOR LATER			
1146	opt.c=container;
1147	opt.ul = container.find('.tp-revslider-mainul');
1148
1149	 // Remove Not Needed Slides for Mobile Devices
1150    opt.ul.find('>li').each(function(i) {
1151    	var li = jQuery(this);    	
1152    	if (li.data('hideslideonmobile')=="on" && _ISM) li.remove();
1153    	if (li.data('invisible') || li.data('invisible')===true) {
1154    		li.addClass("tp-invisible-slide");
1155    		li.appendTo(opt.ul);
1156    	}
1157   	});
1158
1159
1160   	if (opt.addons!=undefined && opt.addons.length>0) {		
1161		jQuery.each(opt.addons, function(i,obj) {			
1162			if (typeof obj === "object" && obj.init!=undefined) {				
1163				_R[obj.init](eval(obj.params));
1164			}
1165		})
1166	}
1167
1168	
1169
1170	opt.cid = container.attr('id');
1171	opt.ul.css({visibility:"visible"});
1172    opt.slideamount = opt.ul.find('>li').not('.tp-invisible-slide').length;
1173    opt.slayers = container.find('.tp-static-layers');
1174
1175    if (opt.waitForInit == true) 
1176    	return;
1177    else {
1178    	container.data('opt',opt);
1179    	runSlider(container,opt);
1180    }
1181
1182 }
1183
1184 var onFullScreenChange = function() {
1185			 jQuery("body").data('rs-fullScreenMode',!jQuery("body").data('rs-fullScreenMode'));
1186		     if (jQuery("body").data('rs-fullScreenMode')) {
1187			     setTimeout(function() {
1188			     	jQuery(window).trigger("resize");
1189			     },200);
1190		     }
1191		}
1192
1193 var runSlider = function(container,opt) {
1194
1195
1196 	opt.sliderisrunning = true;
1197    // Save Original Index of Slides
1198    opt.ul.find('>li').each(function(i) {
1199    	jQuery(this).data('originalindex',i);
1200    });
1201	
1202	
1203
1204
1205	// RANDOMIZE THE SLIDER SHUFFLE MODE
1206	if (opt.shuffle=="on") {		
1207		var fsa = new Object,
1208			fli = opt.ul.find('>li:first-child');
1209		fsa.fstransition = fli.data('fstransition');
1210		fsa.fsmasterspeed = fli.data('fsmasterspeed');
1211		fsa.fsslotamount = fli.data('fsslotamount');
1212
1213		for (var u=0;u<opt.slideamount;u++) {
1214			var it = Math.round(Math.random()*opt.slideamount);			
1215			opt.ul.find('>li:eq('+it+')').prependTo(opt.ul);			
1216		}
1217
1218		var newfli = opt.ul.find('>li:first-child');
1219		newfli.data('fstransition',fsa.fstransition);
1220		newfli.data('fsmasterspeed',fsa.fsmasterspeed);
1221		newfli.data('fsslotamount',fsa.fsslotamount);
1222
1223		 // COLLECT ALL LI INTO AN ARRAY
1224		opt.li = opt.ul.find('>li').not('.tp-invisible-slide');
1225	}
1226
1227	opt.allli = opt.ul.find('>li');
1228	opt.li = opt.ul.find('>li').not('.tp-invisible-slide');
1229	opt.inli = opt.ul.find('>li.tp-invisible-slide');
1230
1231
1232	opt.thumbs = new Array();		
1233	
1234	opt.slots=4;
1235	opt.act=-1;					
1236	opt.firststart=1;
1237	opt.loadqueue = new Array();
1238	opt.syncload = 0;
1239	opt.conw = container.width();
1240	opt.conh = container.height();
1241
1242	if (opt.responsiveLevels.length>1) 
1243		opt.responsiveLevels[0] = 9999;
1244	else
1245		opt.responsiveLevels = 9999;
1246	
1247	// RECORD THUMBS AND SET INDEXES
1248	jQuery.each(opt.allli,function(index,li) {
1249		var li = jQuery(li),
1250			img = li.find('.rev-slidebg') || li.find('img').first(),
1251			i = 0;		
1252		
1253	
1254		li.addClass("tp-revslider-slidesli");
1255		if (li.data('index')===undefined) li.data('index','rs-'+Math.round(Math.random()*999999));
1256
1257		var obj = new Object;
1258		obj.params = new Array();
1259		
1260		obj.id = li.data('index');
1261		obj.src = li.data('thumb')!==undefined ? li.data('thumb') : img.data('lazyload') !== undefined ? img.data('lazyload') : img.attr('src');					
1262		if (li.data('title') !== undefined) obj.params.push({from:RegExp("\\{\\{title\\}\\}","g"), to:li.data("title")})		
1263		if (li.data('description') !== undefined) obj.params.push({from:RegExp("\\{\\{description\\}\\}","g"), to:li.data("description")})		
1264		for (var i=1;i<=10;i++) {
1265			if (li.data("param"+i)!==undefined) 
1266				obj.params.push({from:RegExp("\\{\\{param"+i+"\\}\\}","g"), to:li.data("param"+i)})
1267		}			
1268		opt.thumbs.push(obj);	
1269
1270		li.data('origindex',li.index());
1271		
1272		// IF LINK ON SLIDE EXISTS, NEED TO CREATE A PROPER LAYER FOR IT.
1273		if (li.data('link')!=undefined) {
1274			var link = li.data('link'),
1275				target= li.data('target') || "_self",
1276				zindex= li.data('slideindex')==="back" ? 0 : 60,					
1277				linktoslide=li.data('linktoslide'),
1278				checksl = linktoslide;	
1279			
1280			if (linktoslide != undefined) 
1281				if (linktoslide!="next" && linktoslide!="prev")
1282					opt.allli.each(function() {
1283						var t = jQuery(this);
1284						if (t.data('origindex')+1==checksl) linktoslide = t.data('index');
1285					});
1286			
1287			
1288			if (link!="slide") linktoslide="no";
1289			
1290			var apptxt = '<div class="tp-caption slidelink" style="cursor:pointer;width:100%;height:100%;z-index:'+zindex+';" data-x="center" data-y="center" data-basealign="slide" ',
1291				jts = linktoslide==="scroll_under" ? '[{"event":"click","action":"scrollbelow","offset":"100px","delay":"0"}]' : 
1292					 linktoslide==="prev" ? '[{"event":"click","action":"jumptoslide","slide":"prev","delay":"0.2"}]' : 
1293					 linktoslide==="next" ? '[{"event":"click","action":"jumptoslide","slide":"next","delay":"0.2"}]' : '[{"event":"click","action":"jumptoslide","slide":"'+linktoslide+'","delay":"0.2"}]'
1294			
1295			apptxt = linktoslide=="no" ? apptxt +' data-start="0">' : apptxt + 'data-actions='+"'"+jts + "'"+' data-start="0">';
1296			apptxt = apptxt + '<a style="width:100%;height:100%;display:block"';					
1297			apptxt = link!="slide" ? apptxt + ' target="'+target+'" href="'+link+'"' : apptxt;
1298			apptxt = apptxt + '><span style="width:100%;height:100%;display:block"></span></a></div>';
1299			li.append(apptxt);
1300		}			
1301	});
1302
1303	
1304	// CREATE GRID WIDTH AND HEIGHT ARRAYS		
1305	opt.rle = opt.responsiveLevels.length || 1;
1306	opt.gridwidth = cArray(opt.gridwidth,opt.rle);
1307	opt.gridheight = cArray(opt.gridheight,opt.rle);																														
1308	// END OF VERSION 5.0 INIT MODIFICATION
1309
1310
1311
1312	// SIMPLIFY ANIMATIONS ON OLD IOS AND IE8 IF NEEDED
1313	if (opt.simplifyAll=="on" && (_R.isIE(8) || _R.iOSVersion())) {
1314		container.find('.tp-caption').each(function() {
1315			var tc = jQuery(this);
1316			tc.removeClass("customin customout").addClass("fadein fadeout");
1317			tc.data('splitin',"");
1318			tc.data('speed',400);
1319		})
1320		opt.allli.each(function() {
1321			var li= jQuery(this);				
1322			li.data('transition',"fade");
1323			li.data('masterspeed',500);
1324			li.data('slotamount',1);
1325			var img = li.find('.rev-slidebg') || li.find('>img').first();
1326			img.data('kenburns',"off");
1327		});
1328	}
1329
1330	opt.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i);
1331
1332	// SOME OPTIONS WHICH SHOULD CLOSE OUT SOME OTHER SETTINGS		
1333	opt.autoHeight = opt.sliderLayout=="fullscreen" ? "on" : opt.autoHeight;		
1334
1335	if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") container.css({maxHeight:opt.gridheight[opt.curWinRange]+"px"});
1336	
1337	// BUILD A FORCE FULLWIDTH CONTAINER, TO SPAN THE FULL SLIDER TO THE FULL WIDTH OF BROWSER
1338	if (opt.sliderLayout!="auto" && container.closest('.forcefullwidth_wrapper_tp_banner').length==0) {
1339		if (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on") {			
1340			var cp = container.parent(),				
1341				mb = cp.css('marginBottom'),
1342				mt = cp.css('marginTop'),
1343				cid = container.attr('id')+"_forcefullwidth";
1344			mb = mb===undefined ? 0 : mb;
1345			mt = mt===undefined ? 0 : mt;
1346
1347			cp.wrap('<div class="forcefullwidth_wrapper_tp_banner" id="'+cid+'" style="position:relative;width:100%;height:auto;margin-top:'+mt+';margin-bottom:'+mb+'"></div>');
1348			container.closest('.forcefullwidth_wrapper_tp_banner').append('<div class="tp-fullwidth-forcer" style="width:100%;height:'+container.height()+'px"></div>');
1349			container.parent().css({marginTop:"0px",marginBottom:"0px"});
1350			//container.css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
1351			container.parent().css({position:'absolute'});						
1352		}
1353	}
1354
1355
1356
1357	// SHADOW ADD ONS
1358	if (opt.shadow!==undefined && opt.shadow>0) {
1359		container.parent().addClass('tp-shadow'+opt.shadow);			
1360		container.parent().append('<div class="tp-shadowcover"></div>');
1361		container.parent().find('.tp-shadowcover').css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
1362	}
1363
1364	// ESTIMATE THE CURRENT WINDOWS RANGE INDEX
1365	setCurWinRange(opt);
1366	setCurWinRange(opt,true);
1367	
1368	// IF THE CONTAINER IS NOT YET INITIALISED, LETS GO FOR IT
1369	if (!container.hasClass("revslider-initialised")) {
1370		// MARK THAT THE CONTAINER IS INITIALISED WITH SLIDER REVOLUTION ALREADY
1371		container.addClass("revslider-initialised");
1372
1373		// FOR BETTER SELECTION, ADD SOME BASIC CLASS
1374		container.addClass("tp-simpleresponsive");
1375
1376		// WE DONT HAVE ANY ID YET ? WE NEED ONE ! LETS GIVE ONE RANDOMLY FOR RUNTIME
1377		if (container.attr('id')==undefined) container.attr('id',"revslider-"+Math.round(Math.random()*1000+5));
1378
1379		// CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED
1380		opt.firefox13 = false;
1381		opt.ie = !jQuery.support.opacity;
1382		opt.ie9 = (document.documentMode == 9);
1383
1384		opt.origcd=opt.delay;
1385
1386
1387
1388		// CHECK THE jQUERY VERSION
1389		var version = jQuery.fn.jquery.split('.'),
1390			versionTop = parseFloat(version[0]),
1391			versionMinor = parseFloat(version[1]),
1392			versionIncrement = parseFloat(version[2] || '0');
1393		if (versionTop==1 && versionMinor < 7) 
1394			container.html('<div style="text-align:center; padding:40px 0px; font-size:20px; color:#992222;"> The Current Version of jQuery:'+version+' <br>Please update your jQuery Version to min. 1.7 in Case you wish to use the Revolution Slider Plugin</div>');									
1395		if (versionTop>1) opt.ie=false;
1396		 		
1397					
1398
1399		// PREPARE VIDEO PLAYERS
1400		var addedApis = new Object();				
1401		addedApis.addedyt=0;
1402		addedApis.addedvim=0;
1403		addedApis.addedvid=0;
1404		
1405		container.find('.tp-caption, .rs-background-video-layer').each(function(i) {
1406			var _nc = jQuery(this),
1407				an = _nc.data('autoplayonlyfirsttime'),
1408				ap = _nc.data('autoplay'),
1409				al = _nc.hasClass("tp-audiolayer"),
1410				loop = _nc.data('videoloop');
1411
1412
1413			if (_nc.hasClass("tp-static-layer") && _R.handleStaticLayers)
1414				_R.handleStaticLayers(_nc,opt);
1415
1416			var pom = _nc.data('noposteronmobile') || _nc.data('noPosterOnMobile') ||  _nc.data('posteronmobile') || _nc.data('posterOnMobile') || _nc.data('posterOnMObile');
1417			_nc.data('noposteronmobile',pom);
1418
1419			// FIX VISIBLE IFRAME BUG IN SAFARI
1420			var iff = 0;
1421			_nc.find('iframe').each(function() {
1422				punchgs.TweenLite.set(jQuery(this),{autoAlpha:0});
1423				iff++;
1424			})
1425			if (iff>0)
1426				_nc.data('iframes',true)
1427
1428			if (_nc.hasClass("tp-caption")) {
1429				// PREPARE LAYERS AND WRAP THEM WITH PARALLAX, LOOP, MASK HELP CONTAINERS
1430				var ec = _nc.hasClass("slidelink") ? "width:100% !important;height:100% !important;" : "";
1431				_nc.wrap('<div class="tp-parallax-wrap" style="'+ec+'position:absolute;visibility:hidden"><div class="tp-loop-wrap" style="'+ec+'position:absolute;"><div class="tp-mask-wrap" style="'+ec+'position:absolute" ></div></div></div>');				
1432				var lar = ['pendulum', 'rotate','slideloop','pulse','wave'],
1433					_lc = _nc.closest('.tp-loop-wrap');
1434				
1435				jQuery.each(lar,function(i,k) {	
1436					var lw = _nc.find('.rs-'+k),
1437						f = lw.data() || "";
1438					if (f!="") {			
1439						_lc.data(f);
1440						_lc.addClass("rs-"+k);									
1441						lw.children(0).unwrap();
1442						_nc.data('loopanimation',"on");
1443					}
1444				});	
1445				punchgs.TweenLite.set(_nc,{visibility:"hidden"});
1446			}
1447
1448			var as = _nc.data('actions');
1449			if (as!==undefined) _R.checkActions(_nc,opt,as);
1450
1451			checkHoverDependencies(_nc,opt);
1452
1453			if (_R.checkVideoApis)
1454				addedApis = _R.checkVideoApis(_nc,opt,addedApis);
1455
1456			// REMOVE VIDEO AUTOPLAYS FOR MOBILE DEVICES 
1457			if (_ISM) {
1458				if (an == true || an=="true") {
1459						_nc.data('autoplayonlyfirsttime',"false");
1460						an=false;
1461				}
1462				if (ap==true || ap=="true" || ap=="on" || ap=="1sttime") {
1463					 _nc.data('autoplay',"off");
1464					 ap="off";
1465				}
1466			}
1467
1468			//loop =  loop=="none" && _nc.hasClass('rs-background-video-layer') ?  "loopandnoslidestop" : loop;
1469
1470			_nc.data('videoloop',loop);
1471			
1472
1473			// PREPARE TIMER BEHAVIOUR BASED ON AUTO PLAYED VIDEOS IN SLIDES
1474			if (!al && (an == true || an=="true" || ap == "1sttime") && loop !="loopandnoslidestop") 
1475				_nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-once");
1476				
1477			
1478			if (!al && (ap==true || ap=="true" || ap == "on" || ap == "no1sttime") && loop !="loopandnoslidestop")  
1479				_nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-always");
1480				
1481			
1482				
1483				
1484		});
1485		
1486		container[0].addEventListener('mouseenter',function() {				
1487			container.trigger('tp-mouseenter');										
1488			opt.overcontainer=true;
1489		},{passive:true});
1490
1491		container[0].addEventListener('mouseover',function() {												
1492			container.trigger('tp-mouseover');
1493			opt.overcontainer=true;
1494		},{passive:true});
1495
1496		container[0].addEventListener('mouseleave',function() {				
1497			container.trigger('tp-mouseleft');												
1498			opt.overcontainer=false;
1499		},{passive:true});
1500
1501		// REMOVE ANY VIDEO JS SETTINGS OF THE VIDEO  IF NEEDED  (OLD FALL BACK, AND HELP FOR 3THD PARTY PLUGIN CONFLICTS)
1502		container.find('.tp-caption video').each(function(i) {
1503			var v = jQuery(this);
1504			v.removeClass("video-js vjs-default-skin");
1505			v.attr("preload","");
1506			v.css({display:"none"});
1507		});
1508
1509		//PREPARE LOADINGS ALL IN SEQUENCE
1510		if (opt.sliderType!=="standard") opt.lazyType = "all";
1511		
1512		
1513		// PRELOAD STATIC LAYERS			
1514		loadImages(container.find('.tp-static-layers'),opt,0,true);
1515
1516		waitForCurrentImages(container.find('.tp-static-layers'),opt,function() {
1517			container.find('.tp-static-layers img').each(function() {								
1518				var e = jQuery(this),
1519					src = e.data('lazyload') != undefined ? e.data('lazyload') : e.attr('src'),
1520					loadobj = getLoadObj(opt,src);								
1521				e.attr('src',loadobj.src)				
1522			})
1523		})
1524
1525
1526
1527		// SET ALL LI AN INDEX AND INIT LAZY LOADING
1528		opt.allli.each(function(i) {
1529			var li = jQuery(this);
1530			
1531			if (opt.lazyType=="all" || (opt.lazyType=="smart" && (i==0 || i == 1 || i == opt.slideamount || i == opt.slideamount-1))) { 								
1532				loadImages(li,opt,i);	
1533				waitForCurrentImages(li,opt,function() { 
1534					if (opt.sliderType=="carousel") 
1535						punchgs.TweenLite.to(li,1,{autoAlpha:1,ease:punchgs.Power3.easeInOut});
1536				});					
1537			}
1538
1539		});
1540
1541		
1542
1543		// IF DEEPLINK HAS BEEN SET
1544		var deeplink = getUrlVars("#")[0];
1545		if (deeplink.length<9) {
1546			if (deeplink.split('slide').length>1) {
1547				var dslide=parseInt(deeplink.split('slide')[1],0);
1548				if (dslide<1) dslide=1;
1549				if (dslide>opt.slideamount) dslide=opt.slideamount;
1550				opt.startWithSlide=dslide-1;
1551			}
1552		}
1553		
1554		// PREPARE THE SPINNER
1555		container.append(	'<div class="tp-loader '+opt.spinner+'">'+
1556					  		'<div class="dot1"></div>'+
1557					  	    '<div class="dot2"></div>'+
1558					  	    '<div class="bounce1"></div>'+
1559							'<div class="bounce2"></div>'+
1560							'<div class="bounce3"></div>'+
1561						 '</div>');
1562		
1563
1564		// RESET THE TIMER
1565		if (container.find('.tp-bannertimer').length===0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>');
1566		container.find('.tp-bannertimer').css({'width':'0%'});
1567		container.find('.tp-bannertimer').data('opt',opt);
1568
1569		
1570		// PREPARE THE SLIDES
1571		opt.ul.css({'display':'block'});
1572		prepareSlides(container,opt);
1573		if (opt.parallax.type!=="off" && _R.checkForParallax) _R.checkForParallax(container,opt);
1574
1575		
1576		// PREPARE SLIDER SIZE			
1577		_R.setSize(opt);
1578		
1579
1580		// Call the Navigation Builder
1581		if (opt.sliderType!=="hero" && _R.createNavigation) _R.createNavigation(container,opt);
1582		if (_R.resizeThumbsTabs && _R.resizeThumbsTabs) _R.resizeThumbsTabs(opt);
1583		contWidthManager(opt);
1584		var _v = opt.viewPort;
1585		opt.inviewport = false;
1586		
1587		if (_v !=undefined && _v.enable) {
1588			if (!jQuery.isNumeric(_v.visible_area))
1589			 if (_v.visible_area.indexOf('%')!==-1) 
1590				_v.visible_area = parseInt(_v.visible_area)/100;
1591				
1592			if (_R.scrollTicker) _R.scrollTicker(opt,container);
1593		}
1594		
1595
1596
1597		// START THE SLIDER
1598		setTimeout(function() {
1599			if ( opt.sliderType =="carousel" && _R.prepareCarousel) _R.prepareCarousel(opt);	
1600			
1601			if (!_v.enable || (_v.enable && opt.inviewport) || (_v.enable &&  !opt.inviewport && !_v.outof=="wait")) {
1602				swapSlide(container,opt);	
1603			}
1604			else
1605				opt.waitForFirstSlide = true;
1606
1607			if (_R.manageNavigation) _R.manageNavigation(opt);	
1608
1609
1610			// START COUNTDOWN
1611			if (opt.slideamount>1) {
1612				if (!_v.enable || (_v.enable && opt.inviewport)) 
1613					countDown(container,opt);
1614				else
1615					opt.waitForCountDown = true;
1616			}
1617			setTimeout(function() {					
1618				container.trigger('revolution.slide.onloaded');					
1619			},100);
1620		},opt.startDelay);
1621		opt.startDelay=0;
1622
1623		
1624
1625		/******************************
1626			-	FULLSCREEN CHANGE	-
1627		********************************/
1628		// FULLSCREEN MODE TESTING
1629		jQuery("body").data('rs-fullScreenMode',false);
1630
1631		
1632		window.addEventListener('fullscreenchange',onFullScreenChange,{passive:true});
1633		window.addEventListener('mozfullscreenchange',onFullScreenChange,{passive:true});
1634		window.addEventListener('webkitfullscreenchange',onFullScreenChange,{passive:true});
1635
1636		
1637
1638		var resizid = "resize.revslider-"+container.attr('id');
1639
1640		// IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES
1641		jQuery(window).on(resizid,function() {
1642			console.log("happening")
1643			if (container==undefined) return false;
1644			
1645			if (jQuery('body').find(container)!=0) 				
1646				contWidthManager(opt);							
1647				
1648				var hchange = false;
1649
1650				if (opt.sliderLayout=="fullscreen") {
1651					var jwh = jQuery(window).height();
1652					if ((opt.fallbacks.ignoreHeightChanges=="mobile" && _ISM) || opt.fallbacks.ignoreHeightChanges=="always") {
1653						opt.fallbacks.ignoreHeightChangesSize = opt.fallbacks.ignoreHeightChangesSize == undefined ? 0 : opt.fallbacks.ignoreHeightChangesSize;
1654						hchange = (jwh!=opt.lastwindowheight) && (Math.abs(jwh-opt.lastwindowheight) > opt.fallbacks.ignoreHeightChangesSize)							
1655					} else {
1656						hchange = (jwh!=opt.lastwindowheight) 
1657					}
1658				}
1659				
1660	
1661				if (container.outerWidth(true)!=opt.width || container.is(":hidden") || (hchange)) {
1662						opt.lastwindowheight = jQuery(window).height();
1663						containerResized(container,opt);
1664				}
1665
1666
1667		});
1668		
1669		hideSliderUnder(container,opt);	
1670		contWidthManager(opt);		
1671		if (!opt.fallbacks.disableFocusListener && opt.fallbacks.disableFocusListener != "true" && opt.fallbacks.disableFocusListener !== true) tabBlurringCheck(container,opt);
1672	}
1673}
1674
1675/*************************************
1676	-	 CREATE SIMPLE ARRAYS	-
1677**************************************/
1678var cArray = function(b,l) {		
1679	if (!jQuery.isArray(b)) {
1680		var t = b;
1681		b = new Array();
1682		b.push(t);
1683	}		
1684	if (b.length<l) {			
1685		var t = b[b.length-1];
1686		for (var i=0;i<(l-b.length)+2;i++)
1687			b.push(t)
1688	}		
1689	return b;
1690}
1691
1692
1693
1694var checkHoverDependencies = function(_nc,opt) {
1695	
1696	if (_nc.data('start')==="sliderenter") {		
1697		if (opt.layersonhover===undefined) {					
1698			opt.c.on('tp-mouseenter',function() {								
1699				if (opt.layersonhover)					
1700					jQuery.each(opt.layersonhover,function(i,tnc) {											
1701						tnc.data('animdirection',"in");
1702						var otl = tnc.data('timeline_out'),
1703							base_offsetx = opt.sliderType==="carousel" ? 0 : opt.width/2 - (opt.gridwidth[opt.curWinRange]*opt.bw)/2,
1704							base_offsety=0,
1705							cli = tnc.closest('.tp-revslider-slidesli'),
1706							stl = tnc.closest('.tp-static-layers');
1707
1708						if ((cli.length>0 && (cli.hasClass("active-revslide")) || cli.hasClass("processing-revslide")) || (stl.length>0)) {
1709
1710							if (otl!=undefined) {										
1711								otl.pause(0);
1712								otl.kill();													
1713							}							
1714							_R.animateSingleCaption(tnc,opt,base_offsetx,base_offsety,0,false,true);	
1715							var tl = tnc.data('timeline');
1716							tnc.data('triggerstate',"on");																															
1717							tl.play(0);										
1718						}
1719					});
1720			});
1721			opt.c.on('tp-mouseleft',function() {
1722				if (opt.layersonhover)
1723					jQuery.each(opt.layersonhover,function(i,tnc) {
1724						tnc.data('animdirection',"out");
1725						tnc.data('triggered',true);
1726						tnc.data('triggerstate',"off");
1727						if (_R.stopVideo) _R.stopVideo(tnc,opt);												
1728						if (_R.endMoveCaption) _R.endMoveCaption(tnc,null,null,opt);	
1729					});
1730			});			
1731			opt.layersonhover = new Array;
1732		} 				
1733		opt.layersonhover.push(_nc);
1734	}
1735}
1736
1737
1738
1739var contWidthManager = function(opt) {	
1740
1741	var rl = _R.getHorizontalOffset(opt.c,"left");
1742
1743	if (opt.sliderLayout!="auto" && (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on")) {		
1744		var loff = Math.ceil(opt.c.closest('.forcefullwidth_wrapper_tp_banner').offset().left - rl);																
1745		punchgs.TweenLite.set(opt.c.parent(),{'left':(0-loff)+"px",'width':jQuery(window).width()-_R.getHorizontalOffset(opt.c,"both")});		
1746	} else {		
1747		if (opt.sliderLayout=="fullscreen" && opt.fullScreenAutoWidth=="on")
1748			punchgs.TweenLite.set(opt.ul,{left:0,width:opt.c.width()});		
1749		else
1750			punchgs.TweenLite.set(opt.ul,{left:rl,width:opt.c.width()-_R.getHorizontalOffset(opt.c,"both")});		
1751	}	
1752
1753
1754	// put Static Layer Wrapper in Position	
1755	if (opt.slayers && (opt.sliderLayout!="fullwidth" && opt.sliderLayout!="fullscreen"))
1756		punchgs.TweenLite.set(opt.slayers,{left:rl});
1757}
1758
1759
1760var cv = function(a,d) {
1761  	return a===undefined ? d : a;
1762}
1763
1764
1765var hideSliderUnder = function(container,opt,resized) {
1766	// FIRST TIME STOP/START HIDE / SHOW SLIDER
1767	//REMOVE AND SHOW SLIDER ON DEMAND
1768	var contpar= container.parent();
1769	if (jQuery(window).width()<opt.hideSliderAtLimit) {
1770		container.trigger('stoptimer');
1771		if (contpar.css('display')!="none")
1772			contpar.data('olddisplay',contpar.css('display'));
1773		contpar.css({display:"none"});
1774	} else {
1775		if (container.is(":hidden") && resized) {
1776			if (contpar.data('olddisplay')!=undefined && contpar.data('olddisplay')!="undefined" && contpar.data('olddisplay') != "none")
1777				contpar.css({display:contpar.data('olddisplay')});
1778			else
1779				contpar.css({display:"block"});
1780			container.trigger('restarttimer');
1781			setTimeout(function() {
1782				containerResized(container,opt);
1783			},150)
1784		}
1785	}
1786	if (_R.hideUnHideNav) _R.hideUnHideNav(opt);	
1787}
1788
1789
1790//////////////////////////
1791//	CONTAINER RESIZED	//
1792/////////////////////////
1793var containerResized = function (c,opt) {								
1794	if (opt.infullscreenmode == true)
1795		opt.minHeight = jQuery(window).height();							
1796	
1797	
1798	setCurWinRange(opt);
1799	setCurWinRange(opt,true);
1800	if (!_R.resizeThumbsTabs || _R.resizeThumbsTabs(opt)===true) {
1801		
1802		hideSliderUnder(c,opt,true);
1803		contWidthManager(opt);
1804		
1805		if ( opt.sliderType =="carousel") _R.prepareCarousel(opt,true);		
1806
1807		if (c===undefined) return false;
1808								
1809		_R.setSize(opt);
1810		
1811		opt.conw = opt.c.width();
1812		opt.conh = opt.infullscreenmode ? opt.minHeight : opt.c.height();
1813		
1814		
1815		var actsh = c.find('.active-revslide .slotholder'),
1816			nextsh = c.find('.processing-revslide .slotholder');
1817		
1818		removeSlots(c,opt,c,2);
1819
1820		if (opt.sliderType==="standard") {
1821			punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0});		
1822			actsh.find('.defaultimg').css({'opacity':1});
1823		} 
1824
1825		
1826		if ( opt.sliderType =="carousel" && opt.lastconw != opt.conw)  {
1827			clearTimeout(opt.pcartimer);
1828			opt.pcartimer = setTimeout(function() {
1829				_R.prepareCarousel(opt,true);		
1830			},100);
1831			opt.lastconw = opt.conw;
1832		}
1833
1834		if (_R.manageNavigation) _R.manageNavigation(opt);
1835
1836
1837		if (_R.animateTheCaptions) _R.animateTheCaptions(c.find('.active-revslide'), opt,true);
1838		
1839		if (nextsh.data('kenburns')=="on") 				
1840			_R.startKenBurn(nextsh,opt,nextsh.data('kbtl').progress());
1841
1842		if (actsh.data('kenburns')=="on") 				
1843			_R.startKenBurn(actsh,opt,actsh.data('kbtl').progress());
1844
1845		// DOUBLE CALL FOR SOME FUNCTION TO AVOID PORTRAIT/LANDSCAPE ISSUES, AND TO AVOID FULLSCREEN/NORMAL SWAP ISSUES
1846		if (_R.animateTheCaptions) _R.animateTheCaptions(nextsh.closest('li'), opt,true);
1847		if (_R.manageNavigation) _R.manageNavigation(opt);
1848		
1849	}	
1850	
1851}
1852
1853	
1854	
1855	
1856	
1857
1858////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1859///////////////////////////////////////////////////////////////////////////////       PREPARING / REMOVING		////////////////////////////////////////////////////////
1860////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
1861var setScale = function(opt) {
1862	opt.bw = (opt.width / opt.gridwidth[opt.curWinRange]);
1863	opt.bh = (opt.height / opt.gridheight[opt.curWinRange]);
1864	
1865	
1866	if (opt.bh>opt.bw) 
1867		opt.bh=opt.bw
1868	else
1869		opt.bw = opt.bh;
1870	
1871	if (opt.bh>1 || opt.bw>1) { opt.bw=1; opt.bh=1; }
1872}
1873
1874	
1875
1876
1877
1878/////////////////////////////////////////
1879//	-	PREPARE THE SLIDES / SLOTS -  //
1880///////////////////////////////////////
1881var prepareSlides = function(container,opt) {
1882
1883	container.find('.tp-caption').each(function() { 
1884		var c = jQuery(this);
1885		if (c.data('transition')!==undefined) c.addClass(c.data('transition')); 
1886	});
1887
1888	// PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION
1889	opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')})
1890	if (opt.autoHeight=="on") {
1891	   opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:"none"});
1892	   container.css({'maxHeight':'none'});
1893	   container.parent().css({'maxHeight':'none'});
1894	 }
1895	//_R.setSize("",opt);
1896	opt.allli.each(function(j) {
1897		var li=jQuery(this),
1898			originalIndex = li.data('originalindex');
1899					
1900		//START WITH CORRECT SLIDE
1901		if ((opt.startWithSlide !=undefined && originalIndex==opt.startWithSlide) || opt.startWithSlide ===undefined && j==0)
1902			li.addClass("next-revslide");
1903		
1904
1905		// MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES
1906		li.css({'width':'100%','height':'100%','overflow':'hidden'});
1907					
1908	});
1909
1910	if (opt.sliderType === "carousel") {
1911		//SET CAROUSEL				
1912		opt.ul.css({overflow:"visible"}).wrap('<div class="tp-carousel-wrapper" style="width:100%;height:100%;position:absolute;top:0px;left:0px;overflow:hidden;"></div>');
1913		var apt = '<div style="clear:both;display:block;width:100%;height:1px;position:relative;margin-bottom:-1px"></div>';
1914		opt.c.parent().prepend(apt);
1915		opt.c.parent().append(apt);
1916		_R.prepareCarousel(opt);				
1917	}
1918
1919	// RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER
1920	container.parent().css({'overflow':'visible'});
1921    
1922	opt.allli.find('>img').each(function(j) {
1923
1924		var img=jQuery(this),
1925			bgvid = img.closest('li').find('.rs-background-video-layer');
1926
1927		bgvid.addClass("defaultvid").css({zIndex:30});
1928
1929		img.addClass('defaultimg');				
1930						
1931		// TURN OF KEN BURNS IF WE ARE ON MOBILE AND IT IS WISHED SO
1932		if (opt.fallbacks.panZoomDisableOnMobile == "on"  && _ISM) {
1933			img.data('kenburns',"off");
1934			img.data('bgfit',"cover");
1935		}
1936
1937		img.wrap('<div class="slotholder" style="position:absolute; top:0px; left:0px; z-index:0;width:100%;height:100%;"></div>');
1938		bgvid.appendTo(img.closest('li').find('.slotholder'));
1939		var dts = img.data();
1940		img.closest('.slotholder').data(dts);
1941									
1942		if (bgvid.length>0 && dts.bgparallax!=undefined)
1943			bgvid.data('bgparallax',dts.bgparallax);
1944
1945		if (opt.dottedOverlay!="none" && opt.dottedOverlay!=undefined)
1946				img.closest('.slotholder').append('<div class="tp-dottedoverlay '+opt.dottedOverlay+'"></div>');
1947
1948		var src=img.attr('src');		
1949		dts.src = src;		
1950		dts.bgfit = dts.bgfit || "cover";
1951		dts.bgrepeat = dts.bgrepeat || "no-repeat",
1952		dts.bgposition = dts.bgposition || "center center";
1953
1954		var pari = img.closest('.slotholder');
1955		img.parent().append('<div class="tp-bgimg defaultimg" style="background-color:'+img.css("backgroundColor")+';background-repeat:'+dts.bgrepeat+';background-image:url('+src+');background-size:'+dts.bgfit+';background-position:'+dts.bgposition+';width:100%;height:100%;"></div>');
1956		var comment = document.createComment("Runtime Modification - Img tag is Still Available for SEO Goals in Source - " + img.get(0).outerHTML);
1957		img.replaceWith(comment);
1958		img = pari.find('.tp-bgimg');			
1959		img.data(dts);
1960		img.attr("src",src);
1961
1962		if (opt.sliderType === "standard" || opt.sliderType==="undefined") 				
1963			img.css({'opacity':0});
1964	
1965	})
1966
1967	
1968}
1969
1970
1971//	REMOVE SLOTS	//
1972var removeSlots = function(container,opt,where,addon) {
1973	opt.removePrepare = opt.removePrepare + addon;
1974	where.find('.slot, .slot-circle-wrapper').each(function() {
1975		jQuery(this).remove();
1976	});	
1977	opt.transition = 0;	
1978	opt.removePrepare = 0;	
1979}
1980
1981
1982////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1983///////////////////////////////////////////////////////////////////////////////       SLIDE SWAPS			////////////////////////////////////////////////////////////
1984////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
1985
1986
1987// THE IMAGE IS LOADED, WIDTH, HEIGHT CAN BE SAVED
1988var cutParams = function(a) {
1989	var b = a;
1990	if (a!=undefined && a.length>0)
1991		b = a.split("?")[0];
1992	return b;
1993}
1994
1995var relativeRedir = function(redir){
1996  return location.pathname.replace(/(.*)\/[^/]*/, "$1/"+redir);
1997}
1998
1999var abstorel = function (base, relative) {
2000    var stack = base.split("/"),
2001        parts = relative.split("/");
2002    stack.pop(); // remove current file name (or empty string)
2003                 // (omit if "base" is the current folder without trailing slash)
2004    for (var i=0; i<parts.length; i++) {
2005        if (parts[i] == ".")
2006            continue;
2007        if (parts[i] == "..")
2008            stack.pop();
2009        else
2010            stack.push(parts[i]);
2011    }
2012    return stack.join("/");
2013}
2014
2015var imgLoaded = function(img,opt,progress) {
2016	opt.syncload--;	
2017	if (opt.loadqueue)
2018		jQuery.each(opt.loadqueue, function(index,queue) {		
2019
2020			var mqsrc = queue.src.replace(/\.\.\/\.\.\//gi,""),
2021				fullsrc = self.location.href,
2022				origin = document.location.origin,
2023				fullsrc_b = fullsrc.substring(0,fullsrc.length-1)+"/"+mqsrc,
2024				origin_b = origin+"/"+mqsrc,
2025				absolute = abstorel(self.location.href,queue.src);
2026						
2027			fullsrc = fullsrc.substring(0,fullsrc.length-1)+mqsrc;						
2028			origin = origin+mqsrc;
2029						
2030			if (cutParams(origin) === cutParams(decodeURIComponent(img.src)) || 
2031				cutParams(fullsrc)=== cutParams(decodeURIComponent(img.src)) || 
2032				cutParams(absolute)=== cutParams(decodeURIComponent(img.src)) || 
2033				cutParams(origin_b) === cutParams(decodeURIComponent(img.src)) || 
2034				cutParams(fullsrc_b)=== cutParams(decodeURIComponent(img.src)) || 
2035				cutParams(queue.src) === cutParams(decodeURIComponent(img.src)) || 
2036				cutParams(queue.src).replace(/^.*\/\/[^\/]+/, '') === cutParams(decodeURIComponent(img.src)).replace(/^.*\/\/[^\/]+/, '') || 
2037				(window.location.origin==="file://" && cutParams(img.src).match(new RegExp(mqsrc)))) {																	
2038					queue.progress = progress;
2039					queue.width = img.width;
2040					queue.height = img.height;
2041			} 
2042		});		
2043	progressImageLoad(opt);
2044}
2045
2046// PRELOAD IMAGES 3 PIECES ON ONE GO, CHECK LOAD PRIORITY
2047var progressImageLoad = function(opt) {		
2048	if (opt.syncload == 3) return;
2049	if (opt.loadqueue)
2050		jQuery.each(opt.loadqueue, function(index,queue) {	
2051			if (queue.progress.match(/prepared/g)) {				
2052			 	 if (opt.syncload<=3) {			 	 	
2053					opt.syncload++;	
2054					if (queue.type=="img") {				
2055						var img = new Image();
2056						
2057						img.onload = function() {											
2058						 	imgLoaded(this,opt,"loaded");
2059						 	queue.error = false;				
2060						};
2061						img.onerror = function() {
2062							imgLoaded(this,opt,"failed");					
2063							queue.error = true;
2064						};		
2065						
2066						img.src=queue.src;
2067					} else {
2068						jQuery.get(queue.src, function(data) {						  
2069						  queue.innerHTML = new XMLSerializer().serializeToString(data.documentElement);						  
2070						  queue.progress="loaded";
2071						  opt.syncload--;
2072						  progressImageLoad(opt);
2073						}).fail(function() {					      
2074						  queue.progress="failed";
2075						  opt.syncload--;
2076						  progressImageLoad(opt);
2077						});
2078					}
2079					queue.progress="inload";
2080				}
2081			}				
2082		});
2083}
2084
2085
2086
2087// ADD TO QUEUE THE NOT LOADED IMAGES YES
2088var addToLoadQueue = function(src,opt,prio,type,staticlayer) {		
2089	var alreadyexist = false;	
2090	if (opt.loadqueue)	
2091		jQuery.each(opt.loadqueue, function(index,queue) {			
2092			if (queue.src === src) alreadyexist = true;
2093		});
2094
2095
2096	if (!alreadyexist) {		
2097			var loadobj = new Object();			
2098			loadobj.src = src;
2099			loadobj.starttoload = jQuery.now();
2100			loadobj.type = type || "img";
2101			loadobj.prio = prio;
2102			loadobj.progress = "prepared";
2103			loadobj.static = staticlayer;
2104			opt.loadqueue.push(loadobj);		
2105	}				
2106
2107}
2108
2109// LOAD THE IMAGES OF THE PREDEFINED CONTAINER
2110var loadImages = function(container,opt,prio,staticlayer) {	
2111	
2112	container.find('img,.defaultimg, .tp-svg-layer').each(function() {
2113		var element = jQuery(this),
2114			src = element.data('lazyload') !== undefined && element.data('lazyload')!=="undefined" ? element.data('lazyload') : element.data('svg_src') !=undefined ? element.data('svg_src')  : element.attr('src'),
2115			type = element.data('svg_src') !=undefined ? "svg" : "img";
2116		
2117		element.data('start-to-load',jQuery.now());
2118		addToLoadQueue(src,opt,prio,type,staticlayer);
2119	});
2120	progressImageLoad(opt);
2121}
2122
2123
2124// FIND SEARCHED IMAGE/SRC IN THE LOAD QUEUE
2125var getLoadObj = function(opt,src) {	
2126	var obj = new Object();
2127	if (opt.loadqueue)
2128		jQuery.each(opt.loadqueue, function(index,queue) {			
2129			if (queue.src == src) obj = queue;
2130		});
2131	return obj;
2132}
2133
2134// WAIT PROGRESS TILL THE PREDEFINED CONTAINER HAS ALL IMAGES LOADED INSIDE
2135var waitForCurrentImages = function(nextli,opt,callback) {
2136
2137	var waitforload = false;
2138	
2139
2140	// PRELOAD ALL IMAGES
2141	nextli.find('img,.defaultimg, .tp-svg-layer').each(function() {
2142		var element = jQuery(this),
2143			src = element.data('lazyload') != undefined ? element.data('lazyload') : element.data('svg_src') !=undefined ? element.data('svg_src')  : element.attr('src'),
2144			loadobj = getLoadObj(opt,src);
2145		
2146
2147		// IF ELEMENTS IS NOT LOADED YET, AND IT IS NOW LOADED
2148		if (element.data('loaded')===undefined && loadobj !==undefined && loadobj.progress && loadobj.progress.match(/loaded/g)) {
2149			
2150			element.attr('src',loadobj.src);
2151
2152			
2153			// IF IT IS A DEFAULT IMG, WE NEED TO ASSIGN SOME SPECIAL VALUES TO IT
2154			if (loadobj.type=="img") {
2155				if (element.hasClass("defaultimg")) {		
2156					if (!_R.isIE(8))
2157						element.css({backgroundImage:'url("'+loadobj.src+'")'});
2158					else {
2159						defimg.attr('src',loadobj.src);
2160					}			
2161					nextli.data('owidth',loadobj.width);
2162					nextli.data('oheight',loadobj.height);
2163					nextli.find('.slotholder').data('owidth',loadobj.width);
2164					nextli.find('.slotholder').data('oheight',loadobj.height);
2165				} else { 
2166					var w = element.data('ww'),
2167						h = element.data('hh');
2168					
2169					element.data('owidth',loadobj.width);
2170					element.data('oheight',loadobj.height);
2171
2172					w = w==undefined || w =="auto" || w=="" ? loadobj.width : w;
2173					h = h==undefined || h =="auto" || h=="" ? loadobj.height : h;
2174					
2175					
2176					element.data('ww',w);
2177					element.data('hh',h); 
2178					
2179				}
2180			} else  
2181
2182			if (loadobj.type=="svg" && loadobj.progress=="loaded") {				
2183
2184				element.append('<div class="tp-svg-innercontainer"></div>');
2185				element.find('.tp-svg-innercontainer').append(loadobj.innerHTML);
2186			}
2187			// ELEMENT IS NOW FULLY LOADED
2188			element.data('loaded',true);
2189		} 		
2190
2191
2192		if (loadobj && loadobj.progress && loadobj.progress.match(/inprogress|inload|prepared/g)) 
2193			if (!loadobj.error && jQuery.now()-element.data('start-to-load')<5000) 
2194					waitforload = true;			
2195			else {
2196				loadobj.progress="failed";
2197				if (!loadobj.reported_img) {
2198					loadobj.reported_img = true;
2199					console.warn(src+"  Could not be loaded !");
2200				}
2201			}
2202		
2203		// WAIT FOR VIDEO API'S					
2204		if (opt.youtubeapineeded == true && (!window['YT'] || YT.Player==undefined)) {		
2205			waitforload = true;			
2206			if (jQuery.now()-opt.youtubestarttime>5000 && opt.youtubewarning!=true) {
2207				opt.youtubewarning = true;
2208				var txt = "YouTube Api Could not be loaded !";
2209				if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !";
2210				console.error(txt); 
2211				opt.c.append('<div style="position:absolute;top:50%;width:100%;
2211color:#e74c3c;  font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>')				 				
2212			}
2213		}
2214
2215		if (opt.vimeoapineeded == true && !window['Froogaloop']) {
2216			waitforload = true;
2217			if (jQuery.now()-opt.vimeostarttime>5000 && opt.vimeowarning!=true) {
2218				opt.vimeowarning= true;
2219				var txt = "Vimeo Froogaloop Api Could not be loaded !";
2220				if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !";
2221				console.error(txt); 
2222				opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c;  font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>')				 
2223			}
2224		}	
2225			
2226	});
2227
2228	if (!_ISM && opt.audioqueue && opt.audioqueue.length>0) {		
2229		jQuery.each(opt.audioqueue,function(i,obj) {
2230			if (obj.status && obj.status==="prepared")
2231				if (jQuery.now() - obj.start<obj.waittime)
2232					waitforload = true;			
2233		});		
2234	}
2235	
2236	jQuery.each(opt.loadqueue,function(i,o) {				
2237		if (o.static===true && (o.progress!="loaded" || o.progress==="failed")) {
2238			if (o.progress=="failed") {
2239				if (!o.reported) {
2240					o.reported = true;
2241					console.warn("Static Image "+o.src+"  Could not be loaded in time. Error Exists:"+o.error);
2242				}
2243			}
2244			else
2245			if (!o.error && jQuery.now()-o.starttoload<5000) {
2246				waitforload = true;			
2247			}
2248			else {
2249				if (!o.reported) {
2250					o.reported = true;
2251					console.warn("Static Image "+o.src+"  Could not be loaded within 5s! Error Exists:"+o.error);
2252				}
2253			}
2254			
2255		}
2256	});
2257		
2258	if (waitforload) 
2259		setTimeout(function() {
2260				waitForCurrentImages(nextli,opt,callback) ;
2261			},19);
2262	else 		
2263		setTimeout(callback,19);
2264	
2265}
2266
2267
2268
2269
2270//////////////////////////////////////
2271//	-	CALL TO SWAP THE SLIDES -  //
2272/////////////////////////////////////
2273var swapSlide = function(container,opt) {	
2274
2275	clearTimeout(opt.waitWithSwapSlide);
2276
2277
2278
2279	if (container.find('.processing-revslide').length>0) {			
2280		opt.waitWithSwapSlide = setTimeout(function() {
2281			swapSlide(container,opt);
2282			
2283		},150);
2284		return false;
2285	}	
2286
2287	var actli = container.find('.active-revslide'),
2288		nextli = container.find('.next-revslide'),
2289		defimg= nextli.find('.defaultimg');
2290	
2291	
2292	if (nextli.index() === actli.index()) {
2293		nextli.removeClass("next-revslide");
2294		return false;
2295	}
2296
2297
2298	nextli.removeClass("next-revslide").addClass("processing-revslide");
2299		
2300	nextli.data('slide_on_focus_amount',(nextli.data('slide_on_focus_amount')+1) || 1);
2301	// CHECK IF WE ARE ALREADY AT LAST ITEM TO PLAY IN REAL LOOP SESSION
2302	if (opt.stopLoop=="on" && nextli.index()==opt.lastslidetoshow-1) {
2303		container.find('.tp-bannertimer').css({'visibility':'hidden'});
2304		container.trigger('revolution.slide.onstop');
2305		opt.noloopanymore = 1;
2306	} 
2307
2308	// INCREASE LOOP AMOUNTS
2309	if (nextli.index()===opt.slideamount-1) {
2310		opt.looptogo=opt.looptogo-1;
2311		if (opt.looptogo<=0)
2312				opt.stopLoop="on";
2313	}	
2314   
2315	opt.tonpause = true;
2316	container.trigger('stoptimer');
2317	opt.cd=0;
2318	if (opt.spinner==="off")
2319		container.find('.tp-loader').css({display:"none"});
2320	else
2321		container.find('.tp-loader').css({display:"block"});
2322
2323	
2324	loadImages(nextli,opt,1);	
2325	if (_R.preLoadAudio) _R.preLoadAudio(nextli,opt,1);
2326
2327	// WAIT FOR SWAP SLIDE PROGRESS
2328	waitForCurrentImages(nextli,opt,function() {				 
2329
2330
2331		// MANAGE BG VIDEOS
2332		nextli.find('.rs-background-video-layer').each(function() {
2333			var _nc = jQuery(this);				
2334			if (!_nc.hasClass("HasListener")) {
2335				_nc.data('bgvideo',1);
2336				if (_R.manageVideoLayer) _R.manageVideoLayer(_nc,opt);
2337			}
2338			if (_nc.find('.rs-fullvideo-cover').length==0)
2339				_nc.append('<div class="rs-fullvideo-cover"></div>')
2340		});
2341		swapSlideProgress(opt,defimg,container)
2342	});			
2343
2344}
2345
2346//////////////////////////////////////
2347//	-	PROGRESS SWAP THE SLIDES -  //
2348/////////////////////////////////////
2349var swapSlideProgress = function(opt,defimg,container) {
2350	
2351	var actli = container.find('.active-revslide'),	
2352		nextli = container.find('.processing-revslide'),		
2353		actsh = actli.find('.slotholder'),
2354		nextsh = nextli.find('.slotholder');
2355	
2356	
2357	opt.tonpause=false;
2358    
2359    opt.cd=0;    
2360    
2361    
2362    
2363    
2364    container.find('.tp-loader').css({display:"none"});	
2365   // if ( opt.sliderType =="carousel") _R.prepareCarousel(opt);
2366	_R.setSize(opt);
2367	_R.slotSize(defimg,opt);
2368	
2369   	if (_R.manageNavigation) _R.manageNavigation(opt);
2370   	var data={};
2371   	data.nextslide=nextli;
2372    data.currentslide=actli;
2373	container.trigger('revolution.slide.onbeforeswap',data);
2374
2375	opt.transition = 1;
2376	opt.videoplaying = false;
2377
2378	// IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE...
2379	if (nextli.data('delay')!=undefined) {
2380				opt.cd=0;
2381				opt.delay=nextli.data('delay');
2382	} else 
2383		opt.delay=opt.origcd;
2384
2385	
2386	if (nextli.data('ssop')=="true" || nextli.data('ssop')===true)
2387		opt.ssop = true
2388	else
2389		opt.ssop = false;
2390
2391	
2392
2393	container.trigger('nulltimer');
2394
2395	var ai = actli.index(),
2396		ni = nextli.index();
2397	opt.sdir = ni<ai ? 1 : 0;
2398	
2399	if (opt.sc_indicator=="arrow") {	
2400		if (ai==0 && ni==opt.slideamount-1) opt.sdir = 1;
2401		if (ai==opt.slideamount-1 && ni==0) opt.sdir = 0;	
2402	}
2403
2404	opt.lsdir = opt.lsdir === undefined ? opt.sdir : opt.lsdir; 
2405	opt.dirc = opt.lsdir != opt.sdir;
2406	opt.lsdir = opt.sdir;
2407
2408	///////////////////////////
2409	//	REMOVE THE CAPTIONS //
2410	///////////////////////////
2411
2412
2413	
2414	if (actli.index() != nextli.index() && opt.firststart!=1) 	
2415		if (_R.removeTheCaptions) _R.removeTheCaptions(actli,opt);
2416    
2417	
2418	if (!nextli.hasClass('rs-pause-timer-once') && !nextli.hasClass("rs-pause-timer-always")) 	
2419    	container.trigger('restarttimer');		
2420    else
2421    	opt.videoplaying = true;   
2422	
2423    nextli.removeClass("rs-pause-timer-once");
2424		
2425	var nexttrans,
2426		direction=-1,
2427		mtl;
2428		
2429	// SELECT SLIDER TYPE
2430	if ( opt.sliderType =="carousel") {									
2431		mtl = new punchgs.TimelineLite();
2432		_R.prepareCarousel(opt,mtl);		
2433		letItFree(container,opt,nextsh,actsh,nextli,actli,mtl);
2434		opt.transition = 0;
2435		opt.firststart = 0;
2436	} else {	
2437		mtl = new punchgs.TimelineLite({onComplete:function() {				
2438			letItFree(container,opt,nextsh,actsh,nextli,actli,mtl);
2439		}});	
2440		mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0}));
2441		mtl.pause();
2442
2443		if (opt.firststart==1) {
2444			punchgs.TweenLite.set(actli,{autoAlpha:0});			
2445			opt.firststart=0;
2446		}
2447
2448		
2449		punchgs.TweenLite.set(actli,{zIndex:18});
2450		punchgs.TweenLite.set(nextli,{autoAlpha:0,zIndex:20});
2451		
2452				
2453		// IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED
2454		if (nextli.data('differentissplayed') =='prepared') {
2455			nextli.data('differentissplayed','done');
2456			nextli.data('transition',nextli.data('savedtransition'));
2457			nextli.data('slotamount',nextli.data('savedslotamount'));
2458			nextli.data('masterspeed',nextli.data('savedmasterspeed'));
2459		}
2460
2461
2462		if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") {
2463
2464			nextli.data('savedtransition',nextli.data('transition'));
2465			nextli.data('savedslotamount',nextli.data('slotamount'));
2466			nextli.data('savedmasterspeed',nextli.data('masterspeed'));
2467			nextli.data('transition',nextli.data('fstransition'));
2468			nextli.data('slotamount',nextli.data('fsslotamount'));
2469			nextli.data('masterspeed',nextli.data('fsmasterspeed'));
2470			nextli.data('differentissplayed','prepared');
2471		}
2472
2473		if (nextli.data('transition')==undefined) nextli.data('transition',"random");
2474		
2475		nexttrans = 0;		
2476		var transtext = nextli.data('transition') !== undefined ? nextli.data('transition').split(",") : "fade",
2477			curtransid = nextli.data('nexttransid') == undefined ? -1 : nextli.data('nexttransid');		
2478		if (nextli.data('randomtransition')=="on")
2479			curtransid = Math.round(Math.random()*transtext.length);
2480		else
2481			curtransid=curtransid+1;
2482
2483		if (curtransid==transtext.length) curtransid=0;
2484		nextli.data('nexttransid',curtransid);
2485
2486		var comingtransition = transtext[curtransid];
2487
2488		if (opt.ie) {
2489			if (comingtransition=="boxfade") comingtransition = "boxslide";
2490			if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical";
2491			if (comingtransition=="slotfade-horizontal") comingtransition = "slotzoom-horizontal";
2492		}
2493
2494		if (_R.isIE(8)) 
2495			comingtransition = 11;	
2496		
2497
2498						
2499		mtl = _R.animateSlide(nexttrans, comingtransition, container,  opt, nextli, actli, nextsh, actsh,  mtl);	
2500		if (nextsh.data('kenburns')=="on") {
2501			_R.startKenBurn(nextsh,opt);				
2502			mtl.add(punchgs.TweenLite.set(nextsh,{autoAlpha:0}))
2503		}
2504		
2505		// SHOW FIRST LI && ANIMATE THE CAPTIONS
2506		mtl.pause();
2507	}
2508
2509	if (_R.scrollHandling) {
2510		_R.scrollHandling(opt, true);
2511		mtl.eventCallback("onUpdate",function() {
2512			_R.scrollHandling(opt, true);
2513		});
2514	}
2515	
2516	// START PARALLAX IF NEEDED		
2517	if (opt.parallax.type!="off" && opt.parallax.firstgo==undefined && _R.scrollHandling) {
2518		opt.parallax.firstgo = true;
2519		opt.lastscrolltop = -999;
2520		_R.scrollHandling(opt,true);
2521		setTimeout(function() {
2522			opt.lastscrolltop = -999;
2523			_R.scrollHandling(opt,true);
2524		},210);
2525		setTimeout(function() {
2526			opt.lastscrolltop = -999;
2527			_R.scrollHandling(opt,true);
2528		},420);
2529	}
2530	
2531	
2532	if (_R.animateTheCaptions) {
2533		_R.animateTheCaptions(nextli, opt,null,mtl);	
2534	} else {
2535		if (mtl != undefined) setTimeout(function() {			
2536			mtl.resume();
2537		},30);
2538	}
2539	punchgs.TweenLite.to(nextli,0.001,{autoAlpha:1});
2540
2541	
2542	//if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli);	
2543	
2544}
2545
2546
2547//////////////////////////////////////////
2548//	GIVE FREE THE TRANSITIOSN			//
2549//////////////////////////////////////////
2550var letItFree = function(container,opt,nextsh,actsh,nextli,actli,mtl) {
2551		
2552	if (opt.sliderType==="carousel") {
2553		// CAROUSEL SLIDER
2554	}  else {
2555		opt.removePrepare = 0;
2556		punchgs.TweenLite.to(nextsh.find('.defaultimg'),0.001,{zIndex:20,autoAlpha:1,onComplete:function() {
2557			removeSlots(container,opt,nextli,1);
2558
2559		}});
2560		if (nextli.index()!=actli.index()) {
2561			punchgs.TweenLite.to(actli,0.2,{zIndex:18,autoAlpha:0,onComplete:function() {
2562				removeSlots(container,opt,actli,1);							
2563			}});
2564		}
2565	}
2566
2567
2568	container.find('.active-revslide').removeClass("active-revslide");	
2569	container.find('.processing-revslide').removeClass("processing-revslide").addClass("active-revslide");
2570	opt.act=nextli.index();
2571	
2572	opt.c.attr('data-slideactive',container.find('.active-revslide').data('index'));	
2573	
2574	
2575	if (opt.parallax.type=="scroll" || opt.parallax.type=="scroll+mouse" || opt.parallax.type=="mouse+scroll") {
2576		opt.lastscrolltop = -999;
2577		_R.scrollHandling(opt);
2578	}
2579	
2580	mtl.clear();		
2581	
2582	
2583	if (actsh.data('kbtl')!=undefined) {
2584		actsh.data('kbtl').reverse();
2585		actsh.data('kbtl').timeScale(25);
2586	}	
2587	if (nextsh.data('kenburns')=="on") {		
2588		if (nextsh.data('kbtl')!=undefined) {
2589			nextsh.data('kbtl').timeScale(1);	
2590			nextsh.data('kbtl').play();						
2591		}
2592		else
2593			_R.startKenBurn(nextsh,opt);						
2594	}
2595
2596	nextli.find('.rs-background-video-layer').each(function(i) {		
2597		if (_ISM) return false;
2598		var _nc = jQuery(this)
2599		_R.resetVideo(_nc,opt);								
2600		
2601		punchgs.TweenLite.fromTo(_nc,1,{autoAlpha:0},{autoAlpha:1,ease:punchgs.Power3.easeInOut,delay:0.2,onComplete:function() {		
2602			if (_R.animcompleted) _R.animcompleted(_nc,opt);
2603		}});
2604	});
2605	
2606
2607	actli.find('.rs-background-video-layer').each(function(i) {		
2608		if (_ISM) return false;
2609		var _nc = jQuery(this);
2610		if (_R.stopVideo) {
2611			_R.resetVideo(_nc,opt);
2612			_R.stopVideo(_nc,opt);					
2613		}
2614		punchgs.TweenLite.to(_nc,1,{autoAlpha:0,ease:punchgs.Power3.easeInOut,delay:0.2});
2615	});
2616	// TIRGGER THE ON CHANGE EVENTS
2617	var data={};
2618	data.slideIndex=nextli.index()+1;
2619	data.slideLIIndex=nextli.index();
2620	data.slide = nextli;
2621	data.currentslide=nextli;
2622	data.prevslide = actli;
2623	opt.last_shown_slide = actli.index();
2624
2625	container.trigger('revolution.slide.onchange',data);
2626	container.trigger('revolution.slide.onafterswap',data);	
2627
2628	opt.duringslidechange = false;
2629
2630	var lastSlideLoop = actli.data('slide_on_focus_amount'),
2631		lastSlideMaxLoop = actli.data('hideafterloop');	
2632	if (lastSlideMaxLoop!=0 && lastSlideMaxLoop<=lastSlideLoop) {		
2633		opt.c.revremoveslide(actli.index());
2634	}
2635	//if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli);		
2636	
2637}
2638
2639
2640
2641
2642
2643///////////////////////////
2644//	REMOVE THE LISTENERS //
2645///////////////////////////
2646var removeAllListeners = function(container,opt) {
2647	container.children().each(function() {
2648	  try{ jQuery(this).die('click'); } catch(e) {}
2649	  try{ jQuery(this).die('mouseenter');} catch(e) {}
2650	  try{ jQuery(this).die('mouseleave');} catch(e) {}
2651	  try{ jQuery(this).unbind('hover');} catch(e) {}
2652	})
2653	try{ container.die('click','mouseenter','mouseleave');} catch(e) {}
2654	clearInterval(opt.cdint);
2655	container=null;
2656}
2657
2658///////////////////////////
2659//	-	countDown	-	//
2660/////////////////////////
2661var countDown = function(container,opt) {
2662	opt.cd=0;
2663	opt.loop=0;
2664	if (opt.stopAfterLoops!=undefined && opt.stopAfterLoops>-1)
2665			opt.looptogo=opt.stopAfterLoops;
2666	else
2667		opt.looptogo=9999999;
2668
2669	if (opt.stopAtSlide!=undefined && opt.stopAtSlide>-1)
2670			opt.lastslidetoshow=opt.stopAtSlide;
2671	else
2672			opt.lastslidetoshow=999;
2673
2674	opt.stopLoop="off";
2675
2676	if (opt.looptogo==0) opt.stopLoop="on";
2677
2678	
2679	var bt=container.find('.tp-bannertimer');
2680
2681	// LISTENERS  //container.trigger('stoptimer');
2682	container.on('stoptimer',function() {		
2683	
2684		var bt = jQuery(this).find('.tp-bannertimer');
2685		bt.data('tween').pause();
2686		if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
2687		opt.sliderstatus = "paused";
2688		_R.unToggleState(opt.slidertoggledby);
2689	});
2690
2691
2692	container.on('starttimer',function() {			
2693		if (opt.forcepause_viatoggle) return;
2694		if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideSliderAtLimit && opt.tonpause != true && opt.overnav !=true && opt.ssop!=true)
2695			if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport)) {	
2696				
2697				bt.css({visibility:"visible"});
2698				bt.data('tween').resume();
2699				opt.sliderstatus = "playing";
2700			}
2701
2702			if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
2703			_R.toggleState(opt.slidertoggledby);
2704	});
2705
2706
2707	container.on('restarttimer',function() {	
2708		if (opt.forcepause_viatoggle) return;		
2709		var bt = jQuery(this).find('.tp-bannertimer');
2710		if (opt.mouseoncontainer && opt.navigation.onHoverStop=="on" && (!_ISM)) return false; 
2711		if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport) && opt.ssop!=true) {
2712			bt.css({visibility:"visible"});
2713			bt.data('tween').kill();			
2714		
2715			bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1}));
2716			opt.sliderstatus = "playing";
2717		}
2718		if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
2719		_R.toggleState(opt.slidertoggledby);
2720	});
2721
2722	container.on('nulltimer',function() {						
2723			bt.data('tween').kill();			
2724			bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1}));
2725			bt.data('tween').pause(0);
2726			if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
2727			opt.sliderstatus = "paused";
2728	});
2729
2730	var countDownNext = function() {
2731		if (jQuery('body').find(container).length==0) {
2732			removeAllListeners(container,opt);
2733			clearInterval(opt.cdint);
2734		}
2735
2736		container.trigger("revolution.slide.slideatend");
2737
2738		//STATE OF API CHANGED -> MOVE TO AIP BETTER
2739		if (container.data('conthover-changed') == 1) {
2740			opt.conthover=	container.data('conthover');
2741			container.data('conthover-changed',0);
2742		}
2743
2744		_R.callingNewSlide(opt,container,1);												
2745	}
2746
2747	bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1}));
2748	bt.data('opt',opt);
2749
2750	if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1)) {
2751		container.trigger("starttimer");
2752	}
2753	else {
2754		opt.noloopanymore = 1;
2755		
2756		container.trigger("nulltimer");		
2757	}
2758
2759	container.on('tp-mouseenter',function() {	
2760		    opt.mouseoncontainer = true;			
2761			if (opt.navigation.onHoverStop=="on" && (!_ISM)) {
2762				container.trigger('stoptimer');
2763				container.trigger('revolution.slide.onpause');								
2764			}
2765	});
2766	container.on('tp-mouseleft',function() {
2767			opt.mouseoncontainer = false;
2768			if (container.data('conthover')!=1 && opt.navigation.onHoverStop=="on" && ((opt.viewPort.enable==true && opt.inviewport) || opt.viewPort.enable==false)) {
2769				container.trigger('revolution.slide.onresume');
2770				container.trigger('starttimer');									
2771			}
2772	});
2773	
2774}
2775
2776
2777 
2778
2779//////////////////////////////////////////////////////
2780// * Revolution Slider - NEEDFULL FUNCTIONS
2781// * @version: 1.0 (30.10.2014)
2782// * @author ThemePunch
2783//////////////////////////////////////////////////////
2784
2785
2786
2787// 	-	BLUR / FOXUS FUNCTIONS ON BROWSER 
2788
2789var vis = (function(){
2790	    var stateKey,
2791	        eventKey,
2792	        keys = {
2793	                hidden: "visibilitychange",
2794	                webkitHidden: "webkitvisibilitychange",
2795	                mozHidden: "mozvisibilitychange",
2796	                msHidden: "msvisibilitychange"
2797	    };
2798	    for (stateKey in keys) {
2799	        if (stateKey in document) {
2800	            eventKey = keys[stateKey];
2801	            break;
2802	        }
2803	    }
2804	    return function(c) {
2805	        if (c) document.addEventListener(eventKey, c,{pasive:true});
2806	        return !document[stateKey];
2807	    }
2808	})();
2809
2810var restartOnFocus = function(opt) {
2811	if (opt==undefined || opt.c==undefined) return false;
2812	if (opt.windowfocused!=true) {
2813		opt.windowfocused = true;
2814	    punchgs.TweenLite.delayedCall(0.3,function(){        	
2815	        // TAB IS ACTIVE, WE CAN START ANY PART OF THE SLIDER        
2816	        if (opt.fallbacks.nextSlideOnWindowFocus=="on") opt.c.revnext();
2817	        opt.c.revredraw();
2818	        if (opt.lastsliderstatus=="playing")								
2819			opt.c.revresume();
2820	    });
2821	}
2822}
2823
2824var lastStatBlur = function(opt) {
2825	opt.windowfocused = false;
2826	opt.lastsliderstatus = opt.sliderstatus;	
2827	opt.c.revpause();	
2828	var actsh = opt.c.find('.active-revslide .slotholder'),
2829		nextsh = opt.c.find('.processing-revslide .slotholder');
2830
2831	if (nextsh.data('kenburns')=="on") 				
2832		_R.stopKenBurn(nextsh,opt);
2833
2834	if (actsh.data('kenburns')=="on") 				
2835		_R.stopKenBurn(actsh,opt);
2836	
2837	
2838}
2839
2840var tabBlurringCheck = function(container,opt) {
2841	var notIE = (document.documentMode === undefined),
2842	    isChromium = window.chrome;
2843
2844	if (notIE && !isChromium) {
2845	    // checks for Firefox and other  NON IE Chrome versions
2846	    jQuery(window).on("focusin", function () {
2847			restartOnFocus(opt);
2848	    }).on("focusout", function () {
2849	    	lastStatBlur(opt);	    					
2850	    });
2851	} else {
2852	    // checks for IE and Chromium versions
2853	    if (window.addEventListener) {			    	
2854	        // bind focus event
2855	        window.addEventListener("focus", function (event) {
2856				restartOnFocus(opt);
2857	        }, {capture:false,passive:true});
2858	        // bind blur event
2859	        window.addEventListener("blur", function (event) {
2860				lastStatBlur(opt);	  
2861	        }, {capture:false,passive:true});
2862
2863	    } else {
2864	        // bind focus event
2865	        window.attachEvent("focus", function (event) {
2866	        	restartOnFocus(opt);
2867	        });
2868	        // bind focus event
2869	        window.attachEvent("blur", function (event) {
2870				lastStatBlur(opt);	  
2871	        });
2872	    }
2873	}
2874}
2875
2876
2877// 	-	GET THE URL PARAMETER //
2878
2879var getUrlVars = function (hashdivider){
2880	var vars = [], hash;
2881	var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');
2882	for(var i = 0; i < hashes.length; i++)
2883	{
2884		hashes[i] = hashes[i].replace('%3D',"=");
2885		hash = hashes[i].split('=');
2886		vars.push(hash[0]);
2887		vars[hash[0]] = hash[1];
2888	}
2889	return vars;
2890}
2891})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.