PageSourceSearch

https://buergerplattform.net/wp-content/themes/revolution-press-pr…/camera-slider/js/camera.js?ver=7.1.2

js buergerplattform.net collected 2026-10-02 23:15:48 UTC 68,857 bytes, 2,278 lines download raw bytes

1// Camera slideshow v1.4.0 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.9.1+
2// Copyright (c) 2012 by Manuel Masia - www.pixedelic.com
3// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
4;(function($){$.fn.camera = function(opts, callback) {
5	
6	var defaults = {
7		alignment			: 'center', //topLeft, topCenter, topRight, centerLeft, center, centerRight, bottomLeft, bottomCenter, bottomRight
8		
9		autoAdvance			: true,	//true, false
10		
11		mobileAutoAdvance	: true, //true, false. Auto-advancing for mobile devices
12		
13		barDirection		: 'leftToRight',	//'leftToRight', 'rightToLeft', 'topToBottom', 'bottomToTop'
14		
15		barPosition			: 'bottom',	//'bottom', 'left', 'top', 'right'
16		
17		cols				: 6,
18		
19		easing				: 'easeInOutExpo',	//for the complete list http://jqueryui.com/demos/effect/easing.html
20		
21		mobileEasing		: '',	//leave empty if you want to display the same easing on mobile devices and on desktop etc.
22		
23		fx					: 'random',	//'random','simpleFade', 'curtainTopLeft', 'curtainTopRight', 'curtainBottomLeft', 'curtainBottomRight', 'curtainSliceLeft', 'curtainSliceRight', 'blindCurtainTopLeft', 'blindCurtainTopRight', 'blindCurtainBottomLeft', 'blindCurtainBottomRight', 'blindCurtainSliceBottom', 'blindCurtainSliceTop', 'stampede', 'mosaic', 'mosaicReverse', 'mosaicRandom', 'mosaicSpiral', 'mosaicSpiralReverse', 'topLeftBottomRight', 'bottomRightTopLeft', 'bottomLeftTopRight', 'bottomLeftTopRight'
24										//you can also use more than one effect, just separate them with commas: 'simpleFade, scrollRight, scrollBottom'
25
26		mobileFx			: '',	//leave empty if you want to display the same effect on mobile devices and on desktop etc.
27
28		gridDifference		: 250,	//to make the grid blocks slower than the slices, this value must be smaller than transPeriod
29		
30		height				: '50%',	//here you can type pixels (for instance '300px'), a percentage (relative to the width of the slideshow, for instance '50%') or 'auto'
31		
32		imagePath			: 'images/',	//he path to the image folder (it serves for the blank.gif, when you want to display videos)
33		
34		hover				: true,	//true, false. Puase on state hover. Not available for mobile devices
35				
36		loader				: 'pie',	//pie, bar, none (even if you choose "pie", old browsers like IE8- can't display it... they will display always a loading bar)
37		
38		loaderColor			: '#eeeeee', 
39		
40		loaderBgColor		: '#222222', 
41		
42		loaderOpacity		: .8,	//0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1
43		
44		loaderPadding		: 2,	//how many empty pixels you want to display between the loader and its background
45		
46		loaderStroke		: 7,	//the thickness both of the pie loader and of the bar loader. Remember: for the pie, the loader thickness must be less than a half of the pie diameter
47				
48		minHeight			: '200px',	//you can also leave it blank
49		
50		navigation			: true,	//true or false, to display or not the navigation buttons
51		
52		navigationHover		: true,	//if true the navigation button (prev, next and play/stop buttons) will be visible on hover state only, if false they will be visible always
53		
54		mobileNavHover		: true,	//same as above, but only for mobile devices
55		
56		opacityOnGrid		: false,	//true, false. Decide to apply a fade effect to blocks and slices: if your slideshow is fullscreen or simply big, I recommend to set it false to have a smoother effect 
57		
58		overlayer			: true,	//a layer on the images to prevent the users grab them simply by clicking the right button of their mouse (.camera_overlayer)
59		
60		pagination			: true,
61		
62		playPause			: true,	//true or false, to display or not the play/pause buttons
63		
64		pauseOnClick		: true,	//true, false. It stops the slideshow when you click the sliders.
65		
66		pieDiameter			: 38,
67		
68		piePosition			: 'rightTop',	//'rightTop', 'leftTop', 'leftBottom', 'rightBottom'
69		
70		portrait			: false, //true, false. Select true if you don't want that your images are cropped
71		
72		rows				: 4,
73		
74		slicedCols			: 12,	//if 0 the same value of cols
75		
76		slicedRows			: 8,	//if 0 the same value of rows
77		
78		slideOn				: 'random',	//next, prev, random: decide if the transition effect will be applied to the current (prev) or the next slide
79		
80		thumbnails			: false,
81		
82		time				: 7000,	//milliseconds between the end of the sliding effect and the start of the nex one
83		
84		transPeriod			: 1500,	//lenght of the sliding effect in milliseconds
85		
86////////callbacks
87
88		onEndTransition		: function() {  },	//this callback is invoked when the transition effect ends
89
90		onLoaded			: function() {  },	//this callback is invoked when the image on a slide has completely loaded
91		
92		onStartLoading		: function() {  },	//this callback is invoked when the image on a slide start loading
93		
94		onStartTransition	: function() {  }	//this callback is invoked when the transition effect starts
95
96    };
97	
98	
99	function isMobile() {
100		if( navigator.userAgent.match(/Android/i) ||
101			navigator.userAgent.match(/webOS/i) ||
102			navigator.userAgent.match(/iPad/i) ||
103			navigator.userAgent.match(/iPhone/i) ||
104			navigator.userAgent.match(/iPod/i)
105			){
106				return true;
107		}
108	}
109
110	$.support.borderRadius = false;
111	$.each(['borderRadius','BorderRadius','MozBorderRadius','WebkitBorderRadius','OBorderRadius','KhtmlBorderRadius'], function() {
112		if(document.body.style[this] !== undefined) $.support.borderRadius = true;
113	});
114
115	var opts = $.extend({}, defaults, opts);
116	
117	var wrap = $(this).addClass('camera_wrap');
118	
119	wrap.wrapInner(
120        '<div class="camera_src" />'
121		).wrapInner(
122	    '<div class="camera_fakehover" />'
123		);
124		
125	var fakeHover = $('.camera_fakehover',wrap);
126	var fakeHoverSelector = ('.camera_fakehover',wrap);
127	
128	fakeHover.append(
129		'<div class="camera_target"></div>'
130		);
131	if(opts.overlayer == true){
132		fakeHover.append(
133			'<div class="camera_overlayer"></div>'
134			)
135	}
136		fakeHover.append(
137        '<div class="camera_target_content"></div>'
138		);
139		
140	var loader;
141	
142	if(opts.loader=='pie' && !$.support.borderRadius){
143		loader = 'bar';
144	} else {
145		loader = opts.loader;
146	}
147	
148	if(loader == 'pie'){
149		fakeHover.append(
150			'<div class="camera_pie"></div>'
151			)
152	} else if (loader == 'bar') {
153		fakeHover.append(
154			'<div class="camera_bar"></div>'
155			)
156	} else {
157		fakeHover.append(
158			'<div class="camera_bar" style="display:none"></div>'
159			)
160	}
161	
162	if(opts.playPause==true){
163		fakeHover.append(
164        '<div class="camera_commands"></div>'
165		)
166	}
167		
168	if(opts.navigation==true){
169		fakeHover.append(
170			'<div class="camera_prev"><span></span></div>'
171			).append(
172			'<div class="camera_next"><span></span></div>'
173			);
174	}
175		
176	if(opts.thumbnails==true){
177		wrap.append(
178			'<div class="camera_thumbs_cont" />'
179			);
180	}
181	
182	if(opts.thumbnails==true && opts.pagination!=true){
183		$('.camera_thumbs_cont',wrap).wrap(
184			'<div />'
185			).wrap(
186				'<div class="camera_thumbs" />'
187			).wrap(
188				'<div />'
189			).wrap(
190				'<div class="camera_command_wrap" />'
191			);
192	}
193		
194	if(opts.pagination==true){
195		wrap.append(
196			'<div class="camera_pag"></div>'
197			);
198	}
199		
200	wrap.append(
201		'<div class="camera_loader"></div>'
202		);
203		
204	$('.camera_caption',wrap).each(function(){
205		$(this).wrapInner('<div />');
206	});
207		
208                
209	var pieID = 'pie_'+wrap.index(),
210		elem = $('.camera_src',wrap),
211		target = $('.camera_target',wrap),
212		content = $('.camera_target_content',wrap),
213		pieContainer = $('.camera_pie',wrap),
214		barContainer = $('.camera_bar',wrap),
215		prevNav = $('.camera_prev',wrap),
216		nextNav = $('.camera_next',wrap),
217		commands = $('.camera_commands',wrap),
218		pagination = $('.camera_pag',wrap),
219		thumbs = $('.camera_thumbs_cont',wrap);	
220
221	
222	var w,
223		h;
224
225
226	var allImg = new Array();
227	$('> div', elem).each( function() { 
228		allImg.push($(this).attr('data-src'));
229	});
230	
231	var allLinks = new Array();
232	$('> div', elem).each( function() {
233		if($(this).attr('data-link')){
234			allLinks.push($(this).attr('data-link'));
235		} else {
236			allLinks.push('');
237		}
238	});
239	
240	var allTargets = new Array();
241	$('> div', elem).each( function() {
242		if($(this).attr('data-target')){
243			allTargets.push($(this).attr('data-target'));
244		} else {
245			allTargets.push('');
246		}
247	});
248	
249	var allPor = new Array();
250	$('> div', elem).each( function() {
251		if($(this).attr('data-portrait')){
252			allPor.push($(this).attr('data-portrait'));
253		} else {
254			allPor.push('');
255		}
256	});
257	
258	var allAlign= new Array();
259	$('> div', elem).each( function() { 
260		if($(this).attr('data-alignment')){
261			allAlign.push($(this).attr('data-alignment'));
262		} else {
263			allAlign.push('');
264		}
265	});
266	
267		
268	var allThumbs = new Array();
269	$('> div', elem).each( function() { 
270		if($(this).attr('data-thumb')){
271			allThumbs.push($(this).attr('data-thumb'));
272		} else {
273			allThumbs.push('');
274		}
275	});
276	
277	var amountSlide = allImg.length;
278
279	$(content).append('<div class="cameraContents" />');
280	var loopMove;
281	for (loopMove=0;loopMove<amountSlide;loopMove++)
282	{
283		$('.cameraContents',content).append('<div class="cameraContent" />');
284		if(allLinks[loopMove]!=''){
285			//only for Wordpress plugin
286			var dataBox = $('> div ',elem).eq(loopMove).attr('data-box');
287			if(typeof dataBox !== 'undefined' && dataBox !== false && dataBox != '') {
288				dataBox = 'data-box="'+$('> div ',elem).eq(loopMove).attr('data-box')+'"';
289			} else {
290				dataBox = '';
291			}
292			//
293			$('.camera_target_content .cameraContent:eq('+loopMove+')',wrap).append('<a class="camera_link" href="'+allLinks[loopMove]+'" '+dataBox+' target="'+allTargets[loopMove]+'"></a>');
294		}
295
296	}
297	$('.camera_caption',wrap).each(function(){
298		var ind = $(this).parent().index(),
299			cont = wrap.find('.cameraContent').eq(ind);
300		$(this).appendTo(cont);
301	});
302	
303	target.append('<div class="cameraCont" />');
304	var cameraCont = $('.cameraCont',wrap);
305	
306
307	
308	var loop;
309	for (loop=0;loop<amountSlide;loop++)
310	{
311		cameraCont.append('<div class="cameraSlide cameraSlide_'+loop+'" />');
312		var div = $('> div:eq('+loop+')',elem);
313		target.find('.cameraSlide_'+loop).clone(div);
314	}
315	
316	
317	function thumbnailVisible() {
318		var wTh = $(thumbs).width();
319		$('li', thumbs).removeClass('camera_visThumb');
320		$('li', thumbs).each(function(){
321			var pos = $(this).position(),
322				ulW = $('ul', thumbs).outerWidth(),
323				offUl = $('ul', thumbs).offset().left,
324				offDiv = $('> div',thumbs).offset().left,
325				ulLeft = offDiv-offUl;
326				if(ulLeft>0){
327					$('.camera_prevThumbs',camera_thumbs_wrap).removeClass('hideNav');
328				} else {
329					$('.camera_prevThumbs',camera_thumbs_wrap).addClass('hideNav');
330				}
331				if((ulW-ulLeft)>
331wTh){
332					$('.camera_nextThumbs',camera_thumbs_wrap).removeClass('hideNav');
333				} else {
334					$('.camera_nextThumbs',camera_thumbs_wrap).addClass('hideNav');
335				}
336				var left = pos.left,
337					right = pos.left+($(this).width());
338				if(right-ulLeft<=wTh && left-ulLeft>=0){
339					$(this).addClass('camera_visThumb');
340				}
341		});
342	}
343	
344	$(window).on('load resize pageshow',function(){
345		thumbnailPos();
346		thumbnailVisible();
347	});
348
349
350	cameraCont.append('<div class="cameraSlide cameraSlide_'+loop+'" />');
351	
352	
353	var started;
354	
355	wrap.show();
356	var w = target.width();
357	var h = target.height();
358	
359	var setPause;
360		
361	$(window).on('resize pageshow',function(){
362		if(started == true) {
363			resizeImage();
364		}
365		$('ul', thumbs).animate({'margin-top':0},0,thumbnailPos);
366		if(!elem.hasClass('paused')){
367			elem.addClass('paused');
368			if($('.camera_stop',camera_thumbs_wrap).length){
369				$('.camera_stop',camera_thumbs_wrap).hide()
370				$('.camera_play',camera_thumbs_wrap).show();
371				if(loader!='none'){
372					$('#'+pieID).hide();
373				}
374			} else {
375				if(loader!='none'){
376					$('#'+pieID).hide();
377				}
378			}
379			clearTimeout(setPause);
380			setPause = setTimeout(function(){
381				elem.removeClass('paused');
382				if($('.camera_play',camera_thumbs_wrap).length){
383					$('.camera_play',camera_thumbs_wrap).hide();
384					$('.camera_stop',camera_thumbs_wrap).show();
385					if(loader!='none'){
386						$('#'+pieID).fadeIn();
387					}
388				} else {
389					if(loader!='none'){
390						$('#'+pieID).fadeIn();
391					}
392				}
393			},1500);
394		}
395	});
396	
397	function resizeImage(){	
398		var res;
399		function resizeImageWork(){
400			w = wrap.width();
401			if(opts.height.indexOf('%')!=-1) {
402				var startH = Math.round(w / (100/parseFloat(opts.height)));
403				if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){
404					h = parseFloat(opts.minHeight);
405				} else {
406					h = startH;
407				}
408				wrap.css({height:h});
409			} else if (opts.height=='auto') {
410				h = wrap.height();
411			} else {
412				h = parseFloat(opts.height);
413				wrap.css({height:h});
414			}
415			$('.camerarelative',target).css({'width':w,'height':h});
416			$('.imgLoaded',target).each(function(){
417				var t = $(this),
418					wT = t.attr('width'),
419					hT = t.attr('height'),
420					imgLoadIn = t.index(),
421					mTop,
422					mLeft,
423					alignment = t.attr('data-alignment'),
424					portrait =  t.attr('data-portrait');
425					
426					if(typeof alignment === 'undefined' || alignment === false || alignment === ''){
427						alignment = opts.alignment;
428					}
429					
430					if(typeof portrait === 'undefined' || portrait === false || portrait === ''){
431						portrait = opts.portrait;
432					}
433										
434					if(portrait==false||portrait=='false'){
435						if((wT/hT)<(w/h)) {
436							var r = w / wT;
437							var d = (Math.abs(h - (hT*r)))*0.5;
438							switch(alignment){
439								case 'topLeft':
440									mTop = 0;
441									break;
442								case 'topCenter':
443									mTop = 0;
444									break;
445								case 'topRight':
446									mTop = 0;
447									break;
448								case 'centerLeft':
449									mTop = '-'+d+'px';
450									break;
451								case 'center':
452									mTop = '-'+d+'px';
453									break;
454								case 'centerRight':
455									mTop = '-'+d+'px';
456									break;
457								case 'bottomLeft':
458									mTop = '-'+d*2+'px';
459									break;
460								case 'bottomCenter':
461									mTop = '-'+d*2+'px';
462									break;
463								case 'bottomRight':
464									mTop = '-'+d*2+'px';
465									break;
466							}
467							t.css({
468								'height' : hT*r,
469								'margin-left' : 0,
470								'margin-right' : 0,
471								'margin-top' : mTop,
472								'position' : 'absolute',
473								'visibility' : 'visible',
474								'width' : w
475							});
476						}
477						else {
478							var r = h / hT;
479							var d = (Math.abs(w - (wT*r)))*0.5;
480							switch(alignment){
481								case 'topLeft':
482									mLeft = 0;
483									break;
484								case 'topCenter':
485									mLeft = '-'+d+'px';
486									break;
487								case 'topRight':
488									mLeft = '-'+d*2+'px';
489									break;
490								case 'centerLeft':
491									mLeft = 0;
492									break;
493								case 'center':
494									mLeft = '-'+d+'px';
495									break;
496								case 'centerRight':
497									mLeft = '-'+d*2+'px';
498									break;
499								case 'bottomLeft':
500									mLeft = 0;
501									break;
502								case 'bottomCenter':
503									mLeft = '-'+d+'px';
504									break;
505								case 'bottomRight':
506									mLeft = '-'+d*2+'px';
507									break;
508							}
509							t.css({
510								'height' : h,
511								'margin-left' : mLeft,
512								'margin-right' : mLeft,
513								'margin-top' : 0,
514								'position' : 'absolute',
515								'visibility' : 'visible',
516								'width' : wT*r
517							});
518						}
519					} else {
520						if((wT/hT)<(w/h)) {
521							var r = h / hT;
522							var d = (Math.abs(w - (wT*r)))*0.5;
523							switch(alignment){
524								case 'topLeft':
525									mLeft = 0;
526									break;
527								case 'topCenter':
528									mLeft = d+'px';
529									break;
530								case 'topRight':
531									mLeft = d*2+'px';
532									break;
533								case 'centerLeft':
534									mLeft = 0;
535									break;
536								case 'center':
537									mLeft = d+'px';
538									break;
539								case 'centerRight':
540									mLeft = d*2+'px';
541									break;
542								case 'bottomLeft':
543									mLeft = 0;
544									break;
545								case 'bottomCenter':
546									mLeft = d+'px';
547									break;
548								case 'bottomRight':
549									mLeft = d*2+'px';
550									break;
551							}
552							t.css({
553								'height' : h,
554								'margin-left' : mLeft,
555								'margin-right' : mLeft,
556								'margin-top' : 0,
557								'position' : 'absolute',
558								'visibility' : 'visible',
559								'width' : wT*r
560							});
561						}
562						else {
563							var r = w / wT;
564							var d = (Math.abs(h - (hT*r)))*0.5;
565							switch(alignment){
566								case 'topLeft':
567									mTop = 0;
568									break;
569								case 'topCenter':
570									mTop = 0;
571									break;
572								case 'topRight':
573									mTop = 0;
574									break;
575								case 'centerLeft':
576									mTop = d+'px';
577									break;
578								case 'center':
579									mTop = d+'px';
580									break;
581								case 'centerRight':
582									mTop = d+'px';
583									break;
584								case 'bottomLeft':
585									mTop = d*2+'px';
586									break;
587								case 'bottomCenter':
588									mTop = d*2+'px';
589									break;
590								case 'bottomRight':
591									mTop = d*2+'px';
592									break;
593							}
594							t.css({
595								'height' : hT*r,
596								'margin-left' : 0,
597								'margin-right' : 0,
598								'margin-top' : mTop,
599								'position' : 'absolute',
600								'visibility' : 'visible',
601								'width' : w
602							});
603						}
604					}
605			});
606		}
607		if (started == true) {
608			clearTimeout(res);
609			res = setTimeout(resizeImageWork,200);
610		} else {
611			resizeImageWork();
612		}
613		
614		started = true;
615	}
616	
617	
618	var u,
619		setT;
620
621	var clickEv,
622		autoAdv,
623		navHover,
624		commands,
625		pagination;
626
627	var videoHover,
628		videoPresent;
629		
630	if(isMobile() && opts.mobileAutoAdvance!=''){
631		autoAdv = opts.mobileAutoAdvance;
632	} else {
633		autoAdv = opts.autoAdvance;
634	}
635	
636	if(autoAdv==false){
637		elem.addClass('paused');
638	}
639
640	if(isMobile() && opts.mobileNavHover!=''){
641		navHover = opts.mobileNavHover;
642	} else {
643		navHover = opts.navigationHover;
644	}
645
646	if(elem.length!=0){
647			
648		var selector = $('.cameraSlide',target);
649		selector.wrapInner('<div class="camerarelative" />');
650		
651		var navSlide;
652			
653		var barDirection = opts.barDirection;
654	
655		var camera_thumbs_wrap = wrap;
656
657
658		$('iframe',fakeHover).each(function(){
659			var t = $(this);
660			var src = t.attr('src');
661			t.attr('data-src',src);
662			var divInd = t.parent().index('.camera_src > div');
663			$('.camera_target_content .cameraContent:eq('+divInd+')',wrap).append(t);
664		});
665		function imgFake() {
666				$('iframe',fakeHover).each(function(){
667					$('.camera_caption',fakeHover).show();
668					var t = $(this);
669					var cloneSrc = t.attr('data-src');
670					t.attr('src',cloneSrc);
671					var imgFakeUrl = opts.imagePath+'blank.gif';
672					var imgFake = new Image();
673					imgFake.src = imgFakeUrl;
674					if(opts.height.indexOf('%')!=-1) {
675						var startH = Math.round(w / (100/parseFloat(opts.height)));
676						if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){
677							h = parseFloat(opts.minHeight);
678						} else {
679							h = startH;
680						}
681					} else if (opts.height=='auto') {
682						h = wrap.height();
683					} else {
684						h = parseFloat(opts.height);
685					}
686					t.after($(imgFake).attr({'class':'imgFake','width':w,'height':h}));
687					var clone = t.clone();
688					t.remove();
689					$(imgFake).on('click',function(){
690						if($(this).css('position')=='absolute') {
691							$(this).remove();
692							if(cloneSrc.indexOf('vimeo') != -1 || cloneSrc.indexOf('youtube') != -1) {
693								if(cloneSrc.indexOf('?') != -1){
694									autoplay = '&autoplay=1';
695								} else {
696									autoplay = '?autoplay=1';
697								}
698							} else if(cloneSrc.indexOf('dailymotion') != -1) {
699								if(cloneSrc.indexOf('?') != -1){
700									autoplay = '&autoPlay=1';
701								} else {
702									autoplay = '?autoPlay=1';
703								}
704							}
705							clone.attr('src',cloneSrc+autoplay);
706							videoPresent = true;
707						} else {
708							$(this).css({position:'absolute',top:0,left:0,zIndex:10}).after(clone);
709							clone.css({position:'absolute',top:0,left:0,zIndex:9});
710						}
711					});
712				});
713		}
714		
715		imgFake();
716		
717		
718		if(opts.hover==true){
719			if(!isMobile()){
720				fakeHover.on('mouseenter', function(){
721					elem.addClass('hovered');
722				},function(){
723					elem.removeClass('hovered');
724				});
725			}
726		}
727
728		if(navHover==true){
729			$(prevNav,wrap).animate({opacity:0}
729,0);
730			$(nextNav,wrap).animate({opacity:0},0);
731			$(commands,wrap).animate({opacity:0},0);
732			if(isMobile()){
733				$("body").on('vmouseover',fakeHoverSelector,function(){
734					$(prevNav,wrap).animate({opacity:1},200);
735					$(nextNav,wrap).animate({opacity:1},200);
736					$(commands,wrap).animate({opacity:1},200);
737				});
738				$("body").on('vmouseout',fakeHoverSelector,function(){
739					$(prevNav,wrap).delay(500).animate({opacity:0},200);
740					$(nextNav,wrap).delay(500).animate({opacity:0},200);
741					$(commands,wrap).delay(500).animate({opacity:0},200);
742				});
743			} else {
744				fakeHover.on('mouseenter', function(){
745					$(prevNav,wrap).animate({opacity:1},200);
746					$(nextNav,wrap).animate({opacity:1},200);
747					$(commands,wrap).animate({opacity:1},200);
748				},function(){
749					$(prevNav,wrap).animate({opacity:0},200);
750					$(nextNav,wrap).animate({opacity:0},200);
751					$(commands,wrap).animate({opacity:0},200);
752				});
753			}
754		}
755		
756	
757		camera_thumbs_wrap.on('click','.camera_stop',function(){
758			autoAdv = false;
759			elem.addClass('paused');
760			if($('.camera_stop',camera_thumbs_wrap).length){
761				$('.camera_stop',camera_thumbs_wrap).hide()
762				$('.camera_play',camera_thumbs_wrap).show();
763				if(loader!='none'){
764					$('#'+pieID).hide();
765				}
766			} else {
767				if(loader!='none'){
768					$('#'+pieID).hide();
769				}
770			}
771		});
772	
773		camera_thumbs_wrap.on('click','.camera_play',function(){
774			autoAdv = true;
775			elem.removeClass('paused');
776			if($('.camera_play',camera_thumbs_wrap).length){
777				$('.camera_play',camera_thumbs_wrap).hide();
778				$('.camera_stop',camera_thumbs_wrap).show();
779				if(loader!='none'){
780					$('#'+pieID).show();
781				}
782			} else {
783				if(loader!='none'){
784					$('#'+pieID).show();
785				}
786			}
787		});
788	
789		if(opts.pauseOnClick==true){
790			$('.camera_target_content',fakeHover).on('mouseup', function(){
791				autoAdv = false;
792				elem.addClass('paused');
793				$('.camera_stop',camera_thumbs_wrap).hide()
794				$('.camera_play',camera_thumbs_wrap).show();
795				$('#'+pieID).hide();
796			});
797		}
798		$('.cameraContent, .imgFake',fakeHover).on('mouseenter', function(){
799			videoHover = true;
800		},function(){
801			videoHover = false;
802		});
803		
804		$('.cameraContent, .imgFake',fakeHover).on('click',function(){
805			if(videoPresent == true && videoHover == true) {
806				autoAdv = false;
807				$('.camera_caption',fakeHover).hide();
808				elem.addClass('paused');
809				$('.camera_stop',camera_thumbs_wrap).hide()
810				$('.camera_play',camera_thumbs_wrap).show();
811				$('#'+pieID).hide();
812			}
813		});
814		
815		
816	}
817	
818	
819		function shuffle(arr) {
820			for(
821			  var j, x, i = arr.length; i;
822			  j = parseInt(Math.random() * i),
823			  x = arr[--i], arr[i] = arr[j], arr[j] = x
824			);
825			return arr;
826		}
827	
828		function isInteger(s) {
829			return Math.ceil(s) == Math.floor(s);
830		}	
831	
832		if (loader != 'pie') {
833			barContainer.append('<span class="camera_bar_cont" />');
834			$('.camera_bar_cont',barContainer)
835				.animate({opacity:opts.loaderOpacity},0)
836				.css({'position':'absolute', 'left':0, 'right':0, 'top':0, 'bottom':0, 'background-color':opts.loaderBgColor})
837				.append('<span id="'+pieID+'" />');
838			$('#'+pieID).animate({opacity:0}
838,0);
839			var canvas = $('#'+pieID);
840			canvas.css({'position':'absolute', 'background-color':opts.loaderColor});
841			switch(opts.barPosition){
842				case 'left':
843					barContainer.css({right:'auto',width:opts.loaderStroke});
844					break;
845				case 'right':
846					barContainer.css({left:'auto',width:opts.loaderStroke});
847					break;
848				case 'top':
849					barContainer.css({bottom:'auto',height:opts.loaderStroke});
850					break;
851				case 'bottom':
852					barContainer.css({top:'auto',height:opts.loaderStroke});
853					break;
854			}
855			switch(barDirection){
856				case 'leftToRight':
857					canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding});
858					break;
859				case 'rightToLeft':
860					canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding});
861					break;
862				case 'topToBottom':
863					canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0});
864					break;
865				case 'bottomToTop':
866					canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0});
867					break;
868			}
869		} else {
870			pieContainer.append('<canvas id="'+pieID+'"></canvas>');
871			var G_vmlCanvasManager;
872			var canvas = document.getElementById(pieID);
873			canvas.setAttribute("width", opts.pieDiameter);
874			canvas.setAttribute("height", opts.pieDiameter);
875			var piePosition;
876			switch(opts.piePosition){
877				case 'leftTop' :
878					piePosition = 'left:0; top:0;';
879					break;
880				case 'rightTop' :
881					piePosition = 'right:0; top:0;';
882					break;
883				case 'leftBottom' :
884					piePosition = 'left:0; bottom:0;';
885					break;
886				case 'rightBottom' :
887					piePosition = 'right:0; bottom:0;';
888					break;
889			}
890			canvas.setAttribute("style", "position:absolute; z-index:1002; "+piePosition);
891			var rad;
892			var radNew;
893	
894			if (canvas && canvas.getContext) {
895				var ctx = canvas.getContext("2d");
896				ctx.rotate(Math.PI*(3/2));
897				ctx.translate(-opts.pieDiameter,0);
898			}
899		
900		}
901		if(loader=='none' || autoAdv==false) {
902			$('#'+pieID).hide();
903			$('.camera_canvas_wrap',camera_thumbs_wrap).hide();
904		}
905		
906		if($(pagination).length) {
907			$(pagination).append('<ul class="camera_pag_ul" />');
908			var li;
909			for (li = 0; li < amountSlide; li++){
910				$('.camera_pag_ul',wrap).append('<li class="pag_nav_'+li+'" style="position:relative; z-index:1002"><span><span>'+li+'</span></span></li>');
911			}
912			$('.camera_pag_ul li',wrap).on('mouseenter', function(){
913				$(this).addClass('camera_hover');
914				if($('.camera_thumb',this).length){
915					var wTh = $('.camera_thumb',this).outerWidth(),
916					hTh = $('.camera_thumb',this).outerHeight(),
917					wTt = $(this).outerWidth();
918					$('.camera_thumb',this).show().css({'top':'-'+hTh+'px','left':'-'+(wTh-wTt)/2+'px'}).animate({'opacity':1,'margin-top':'-3px'},200);
919					$('.thumb_arrow',this).show().animate({'opacity':1,'margin-top':'-3px'},200);
920				}
921			},function(){
922				$(this).removeClass('camera_hover');
923				$('.camera_thumb',this).animate({'margin-top':'-20px','opacity':0},200,function(){
924					$(this).css({marginTop:'5px'}).hide();
925				});
926				$('.thumb_arrow',this).animate({'margin-top':'-20px','opacity':0},200,function(){
927					$(this).css({marginTop:'5px'}).hide();
928				});
929			});
930		}
931			
932	
933	
934		if($(thumbs).length) {
935			var thumbUrl;
936			if(!$(pagination).length) {
937				$(thumbs).append('<div />');
938				$(thumbs).before('<div class="camera_prevThumbs hideNav"><div></div></div>').before('<div class="camera_nextThumbs hideNav"><div></div></div>');
939				$('> div',thumbs).append('<ul />');
940				$.each(allThumbs, function(i, val) {
941					if($('> div', elem).eq(i).attr('data-thumb')!='') {
942						var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'),
943							newImg = new Image();
944						newImg.src = thumbUrl;
945						$('ul',thumbs).append('<li class="pix_thumb pix_thumb_'+i+'" />');
946						$('li.pix_thumb_'+i,thumbs).append($(newImg).attr('class','camera_thumb'));
947					}
948				});
949			} else {
950				$.each(allThumbs, function(i, val) {
951					if($('> div', elem).eq(i).attr('data-thumb')!='') {
952						var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'),
953							newImg = new Image();
954						newImg.src = thumbUrl;
955						$('li.pag_nav_'+i,pagination).append($(newImg).attr('class','camera_thumb').css({'position':'absolute'}).animate({opacity:0}
955,0));
956						$('li.pag_nav_'+i+' > img',pagination).after('<div class="thumb_arrow" />');
957						$('li.pag_nav_'+i+' > .thumb_arrow',pagination).animate({opacity:0},0);
958					}
959				});
960				wrap.css({marginBottom:$(pagination).outerHeight()});
961			}
962		} else if(!$(thumbs).length && $(pagination).length) {
963			wrap.css({marginBottom:$(pagination).outerHeight()});
964		}
965
966	
967		var firstPos = true;
968
969		function thumbnailPos() {
970			if($(thumbs).length && !$(pagination).length) {
971				var wTh = $(thumbs).outerWidth(),
972					owTh = $('ul > li',thumbs).outerWidth(),
973					pos = $('li.cameracurrent', thumbs).length ? $('li.cameracurrent', thumbs).position() : '',
974					ulW = ($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth()),
975					offUl = $('ul', thumbs).offset().left,
976					offDiv = $('> div', thumbs).offset().left,
977					ulLeft;
978
979					if(offUl<0){
980						ulLeft = '-'+ (offDiv-offUl);
981					} else {
982						ulLeft = offDiv-offUl;
983					}
984					
985					
986					
987				if(firstPos == true) {
988					$('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth());
989					if($(thumbs).length && !$(pagination).lenght) {
990						wrap.css({marginBottom:$(thumbs).outerHeight()});
991					}
992					thumbnailVisible();
993					/*I repeat this two lines because of a problem with iPhones*/
994					$('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth());
995					if($(thumbs).length && !$(pagination).lenght) {
996						wrap.css({marginBottom:$(thumbs).outerHeight()});
997					}
998					/*...*/
999				}
1000				firstPos = false;
1001				
1002					var left = $('li.cameracurrent', thumbs).length ? pos.left : '',
1003						right = $('li.cameracurrent', thumbs).length ? pos.left+($('li.cameracurrent', thumbs).outerWidth()) : '';
1004					if(left<$('li.cameracurrent', thumbs).outerWidth()) {
1005						left = 0;
1006					}
1007					if(right-ulLeft>wTh){
1008						if((left+wTh)<ulW){
1009							$('ul', thumbs).animate({'margin-left':'-'+(left)+'px'},500,thumbnailVisible);
1010						} else {
1011							$('ul', thumbs).animate({'margin-left':'-'+($('ul', thumbs).outerWidth()-wTh)+'px'},500,thumbnailVisible);
1012						}
1013					} else if(left-ulLeft<0) {
1014						$('ul', thumbs).animate({'margin-left':'-'+(left)+'px'},500,thumbnailVisible);
1015					} else {
1016						$('ul', thumbs).css({'margin-left':'auto', 'margin-right':'auto'});
1017						setTimeout(thumbnailVisible,100);
1018					}
1019					
1020			}
1021		}
1022
1023		if($(commands).length) {
1024			$(commands).append('<div class="camera_play"></div>').append('<div class="camera_stop"></div>');
1025			if(autoAdv==true){
1026				$('.camera_play',camera_thumbs_wrap).hide();
1027				$('.camera_stop',camera_thumbs_wrap).show();
1028			} else {
1029				$('.camera_stop',camera_thumbs_wrap).hide();
1030				$('.camera_play',camera_thumbs_wrap).show();
1031			}
1032			
1033		}
1034			
1035			
1036		function canvasLoader() {
1037			rad = 0;
1038			var barWidth = $('.camera_bar_cont',camera_thumbs_wrap).width(),
1039				barHeight = $('.camera_bar_cont',camera_thumbs_wrap).height();
1040
1041			if (loader != 'pie') {
1042				switch(barDirection){
1043					case 'leftToRight':
1044						$('#'+pieID).css({'right':barWidth});
1045						break;
1046					case 'rightToLeft':
1047						$('#'+pieID).css({'left':barWidth});
1048						break;
1049					case 'topToBottom':
1050						$('#'+pieID).css({'bottom':barHeight});
1051						break;
1052					case 'bottomToTop':
1053						$('#'+pieID).css({'top':barHeight});
1054						break;
1055				}
1056			} else {
1057				ctx.clearRect(0,0,opts.pieDiameter,opts.pieDiameter); 
1058			}
1059		}
1060		
1061		
1062		canvasLoader();
1063		
1064		
1065		$('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom',fakeHover).each(function(){
1066			$(this).css('visibility','hidden');
1067		});
1068		
1069		opts.onStartLoading.call(this);
1070		
1071		nextSlide();
1072		
1073	
1074	/*************************** FUNCTION nextSlide() ***************************/
1075	
1076	function nextSlide(navSlide){ 
1077		elem.addClass('camerasliding');
1078		
1079		videoPresent = false;
1080		var vis = parseFloat($('div.cameraSlide.cameracurrent',target).index());
1081
1082		if(navSlide>0){ 
1083			var slideI = navSlide-1;
1084		} else if (vis == amountSlide-1) { 
1085			var slideI = 0;
1086		} else {
1087			var slideI = vis+1;
1088		}
1089		
1090				
1091		var slide = $('.cameraSlide:eq('+slideI+')',target);
1092		var slideNext = $('.cameraSlide:eq('+(slideI+1)+')',target).addClass('cameranext');
1093		if( vis != slideI+1 ) {
1094			slideNext.hide();
1095		}
1096		$('.cameraContent',fakeHover).fadeOut(600);
1097		$('.camera_caption',fakeHover).show();
1098		
1099		$('.camerarelative',slide).append($('> div ',elem).eq(slideI).find('> div.camera_effected'));
1100
1101		$('.camera_target_content .cameraContent:eq('+slideI+')',wrap).append($('> div ',elem).eq(slideI).find('> div'));
1102		
1103		if(!$('.imgLoaded',slide).length){
1104			var imgUrl = allImg[slideI];
1105			var imgLoaded = new Image();
1106			imgLoaded.src = imgUrl +"?"+ new Date().getTime();
1107			slide.css('visibility','hidden');
1108			slide.prepend($(imgLoaded).attr('class','imgLoaded').css('visibility','hidden'));
1109			var wT, hT;
1110			if (!$(imgLoaded).get(0).complete || wT == '0' || hT == '0' || typeof wT === 'undefined' || wT === false || typeof hT === 'undefined' || hT === false) {
1111				$('.camera_loader',wrap).delay(500).fadeIn(400);
1112				imgLoaded.onload = function() {
1113					wT = imgLoaded.naturalWidth;
1114					hT = imgLoaded.naturalHeight;
1115					$(imgLoaded).attr('data-alignment',allAlign[slideI]).attr('data-portrait',allPor[slideI]);
1116					$(imgLoaded).attr('width',wT);
1117					$(imgLoaded).attr('height',hT);
1118					target.find('.cameraSlide_'+slideI).hide().css('visibility','visible');
1119					resizeImage();
1120					nextSlide(slideI+1);
1121				};
1122			}
1123		} else {
1124			if( allImg.length > (slideI+1) && !$('.imgLoaded',slideNext).length ){
1125				var imgUrl2 = allImg[(slideI+1)];
1126				var imgLoaded2 = new Image();
1127				imgLoaded2.src = imgUrl2 +"?"+ new Date().getTime();
1128				slideNext.prepend($(imgLoaded2).attr('class','imgLoaded').css('visibility','hidden'));
1129				imgLoaded2.onload = function() {
1130					wT = imgLoaded2.naturalWidth;
1131					hT = imgLoaded2.naturalHeight;
1132					$(imgLoaded2).attr('data-alignment',allAlign[slideI+1]).attr('data-portrait',allPor[slideI+1]);
1133					$(imgLoaded2).attr('width',wT);
1134					$(imgLoaded2).attr('height',hT);
1135					resizeImage();
1136				};
1137			}
1138			opts.onLoaded.call(this);
1139			if($('.camera_loader',wrap).is(':visible')){
1140				$('.camera_loader',wrap).fadeOut(400);
1141			} else {
1142				$('.camera_loader',wrap).css({'visibility':'hidden'});
1143				$('.camera_loader',wrap).fadeOut(400,function(){
1144					$('.camera_loader',wrap).css({'visibility':'visible'});
1145				});
1146			}
1147			var rows = opts.rows,
1148				cols = opts.cols,
1149				couples = 1,
1150				difference = 0,
1151				dataSlideOn,
1152				time,
1153				transPeriod,
1154				fx,
1155				easing,
1156				randomFx = new Array('simpleFade','curtainTopLeft','curtainTopRight','curtainBottomLeft','curtainBottomRight','curtainSliceLeft','curtainSliceRight','blindCurtainTopLeft','blindCurtainTopRight','blindCurtainBottomLeft','blindCurtainBottomRight','blindCurtainSliceBottom','blindCurtainSliceTop','stampede','mosaic','mosaicReverse','mosaicRandom','mosaicSpiral','mosaicSpiralReverse','topLeftBottomRight','bottomRightTopLeft','bottomLeftTopRight','topRightBottomLeft','scrollLeft','scrollRight','scrollTop','scrollBottom','scrollHorz');
1157				marginLeft = 0,
1158				marginTop = 0,
1159				opacityOnGrid = 0;
1160				
1161				if(opts.opacityOnGrid==true){
1162					opacityOnGrid = 0;
1163				} else {
1164					opacityOnGrid = 1;
1165				}
1166 
1167			
1168			
1169			var dataFx = $(' > div',elem).eq(slideI).attr('data-fx');
1170				
1171			if(isMobile()&&opts.mobileFx!=''&&opts.mobileFx!='default'){
1172				fx = opts.mobileFx;
1173			} else {
1174				if(typeof dataFx !== 'undefined' && dataFx!== false && dataFx!== 'default'){
1175					fx = dataFx;
1176				} else {
1177					fx = opts.fx;
1178				}
1179			}
1180			
1181			if(fx=='random') {
1182				fx = shuffle(randomFx);
1183				fx = fx[0];
1184			} else {
1185				fx = fx;
1186				if(fx.indexOf(',')>0){
1187					fx = fx.replace(/ /g,'');
1188					fx = fx.split(',');
1189					fx = shuffle(fx);
1190					fx = fx[0];
1191				}
1192			}
1193			
1194			dataEasing = $(' > div',elem).eq(slideI).attr('data-easing');
1195			mobileEasing = $(' > div',elem).eq(slideI).attr('data-mobileEasing');
1196
1197			if(isMobile()&&opts.mobileEasing!=''&&opts.mobileEasing!='default'){
1198				if(typeof mobileEasing !== 'undefined' && mobileEasing!== false && mobileEasing!== 'default') {
1199					easing = mobileEasing;
1200				} else {
1201					easing = opts.mobileEasing;
1202				}
1203			} else {
1204				if(typeof dataEasing !== 'undefined' && dataEasing!== false && dataEasing!== 'default') {
1205					easing = dataEasing;
1206				} else {
1207					easing = opts.easing;
1208				}
1209			}
1210	
1211			dataSlideOn = $(' > div',elem).eq(slideI).attr('data-slideOn');
1212			if(typeof dataSlideOn !== 'undefined' && dataSlideOn!== false){
1213				slideOn = dataSlideOn;
1214			} else {
1215				if(opts.slideOn=='random'){
1216					var slideOn = new Array('next','prev');
1217					slideOn = shuffle(slideOn);
1218					slideOn = slideOn[0];
1219				} else {
1220					slideOn = opts.slideOn;
1221				}
1222			}
1223				
1224			var dataTime = $(' > div',elem).eq(slideI).attr('data-time');
1225			if(typeof dataTime !== 'undefined' && dataTime!== false && dataTime!== ''){
1226				time = parseFloat(dataTime);
1227			} else {
1228				time = opts.time;
1229			}
1230				
1231			var dataTransPeriod = $(' > div',elem).eq(slideI).attr('data-transPeriod');
1232			if(typeof dataTransPeriod !== 'undefined' && dataTransPeriod!== fal
1232se && dataTransPeriod!== ''){
1233				transPeriod = parseFloat(dataTransPeriod);
1234			} else {
1235				transPeriod = opts.transPeriod;
1236			}
1237				
1238			if(!$(elem).hasClass('camerastarted')){
1239				fx = 'simpleFade';
1240				slideOn = 'next';
1241				easing = '';
1242				transPeriod = 400;
1243				$(elem).addClass('camerastarted')
1244			}
1245	
1246			switch(fx){
1247				case 'simpleFade':
1248					cols = 1;
1249					rows = 1;
1250						break;
1251				case 'curtainTopLeft':
1252					if(opts.slicedCols == 0) {
1253						cols = opts.cols;
1254					} else {
1255						cols = opts.slicedCols;
1256					}
1257					rows = 1;
1258						break;
1259				case 'curtainTopRight':
1260					if(opts.slicedCols == 0) {
1261						cols = opts.cols;
1262					} else {
1263						cols = opts.slicedCols;
1264					}
1265					rows = 1;
1266						break;
1267				case 'curtainBottomLeft':
1268					if(opts.slicedCols == 0) {
1269						cols = opts.cols;
1270					} else {
1271						cols = opts.slicedCols;
1272					}
1273					rows = 1;
1274						break;
1275				case 'curtainBottomRight':
1276					if(opts.slicedCols == 0) {
1277						cols = opts.cols;
1278					} else {
1279						cols = opts.slicedCols;
1280					}
1281					rows = 1;
1282						break;
1283				case 'curtainSliceLeft':
1284					if(opts.slicedCols == 0) {
1285						cols = opts.cols;
1286					} else {
1287						cols = opts.slicedCols;
1288					}
1289					rows = 1;
1290						break;
1291				case 'curtainSliceRight':
1292					if(opts.slicedCols == 0) {
1293						cols = opts.cols;
1294					} else {
1295						cols = opts.slicedCols;
1296					}
1297					rows = 1;
1298						break;
1299				case 'blindCurtainTopLeft':
1300					if(opts.slicedRows == 0) {
1301						rows = opts.rows;
1302					} else {
1303						rows = opts.slicedRows;
1304					}
1305					cols = 1;
1306						break;
1307				case 'blindCurtainTopRight':
1308					if(opts.slicedRows == 0) {
1309						rows = opts.rows;
1310					} else {
1311						rows = opts.slicedRows;
1312					}
1313					cols = 1;
1314						break;
1315				case 'blindCurtainBottomLeft':
1316					if(opts.slicedRows == 0) {
1317						rows = opts.rows;
1318					} else {
1319						rows = opts.slicedRows;
1320					}
1321					cols = 1;
1322						break;
1323				case 'blindCurtainBottomRight':
1324					if(opts.slicedRows == 0) {
1325						rows = opts.rows;
1326					} else {
1327						rows = opts.slicedRows;
1328					}
1329					cols = 1;
1330						break;
1331				case 'blindCurtainSliceTop':
1332					if(opts.slicedRows == 0) {
1333						rows = opts.rows;
1334					} else {
1335						rows = opts.slicedRows;
1336					}
1337					cols = 1;
1338						break;
1339				case 'blindCurtainSliceBottom':
1340					if(opts.slicedRows == 0) {
1341						rows = opts.rows;
1342					} else {
1343						rows = opts.slicedRows;
1344					}
1345					cols = 1;
1346						break;
1347				case 'stampede':
1348					difference = '-'+transPeriod;
1349						break;
1350				case 'mosaic':
1351					difference = opts.gridDifference;
1352						break;
1353				case 'mosaicReverse':
1354					difference = opts.gridDifference;
1355						break;
1356				case 'mosaicRandom':
1357						break;
1358				case 'mosaicSpiral':
1359					difference = opts.gridDifference;
1360					couples = 1.7;
1361						break;
1362				case 'mosaicSpiralReverse':
1363					difference = opts.gridDifference;
1364					couples = 1.7;
1365						break;
1366				case 'topLeftBottomRight':
1367					difference = opts.gridDifference;
1368					couples = 6;
1369						break;
1370				case 'bottomRightTopLeft':
1371					difference = opts.gridDifference;
1372					couples = 6;
1373						break;
1374				case 'bottomLeftTopRight':
1375					difference = opts.gridDifference;
1376					couples = 6;
1377						break;
1378				case 'topRightBottomLeft':
1379					difference = opts.gridDifference;
1380					couples = 6;
1381						break;
1382				case 'scrollLeft':
1383					cols = 1;
1384					rows = 1;
1385						break;
1386				case 'scrollRight':
1387					cols = 1;
1388					rows = 1;
1389						break;
1390				case 'scrollTop':
1391					cols = 1;
1392					rows = 1;
1393						break;
1394				case 'scrollBottom':
1395					cols = 1;
1396					rows = 1;
1397						break;
1398				case 'scrollHorz':
1399					cols = 1;
1400					rows = 1;
1401						break;
1402			}
1403			
1404			var cycle = 0;
1405			var blocks = rows*cols;
1406			var leftScrap = w-(Math.floor(w/cols)*cols);
1407			var topScrap = h-(Math.floor(h/rows)*rows);
1408			var addLeft;
1409			var addTop;
1410			var tAppW = 0;	
1411			var tAppH = 0;
1412			var arr = new Array();
1413			var delay = new Array();
1414			var order = new Array();
1415			while(cycle < blocks){
1416				arr.push(cycle);
1417				delay.push(cycle);
1418				cameraCont.append('<div class="cameraappended" style="display:none; overflow:hidden; position:absolute; z-index:1000" />');
1419				var tApp = $('.cameraappended:eq('+cycle+')',target);
1420				if(fx=='scrollLeft' || fx=='scrollRight' || fx=='scrollTop' || fx=='scrollBottom' || fx=='scrollHorz'){
1421					selector.eq(slideI).clone().show().appendTo(tApp);
1422				} else {
1423					if(slideOn=='next'){
1424						selector.eq(slideI).clone().show().appendTo(tApp);
1425					} else {
1426						selector.eq(vis).clone().show().appendTo(tApp);
1427					}
1428				}
1429
1430				if(cycle%cols<leftScrap){
1431					addLeft = 1;
1432				} else {
1433					addLeft = 0;
1434				}
1435				if(cycle%cols==0){
1436					tAppW = 0;
1437				}
1438				if(Math.floor(cycle/cols)<topScrap){
1439					addTop = 1;
1440				} else {
1441					addTop = 0;
1442				}
1443				tApp.css({
1444					'height': Math.floor((h/rows)+addTop+1),
1445					'left': tAppW,
1446					'top': tAppH,
1447					'width': Math.floor((w/cols)+addLeft+1)
1448				});
1449				$('> .cameraSlide', tApp).css({
1450					'height': h,
1451					'margin-left': '-'+tAppW+'px',
1452					'margin-top': '-'+tAppH+'px',
1453					'width': w
1454				});
1455				tAppW = tAppW+tApp.width()-1;
1456				if(cycle%cols==cols-1){
1457					tAppH = tAppH + tApp.height() - 1;
1458				}
1459				cycle++;
1460			}
1461			
1462
1463			
1464			switch(fx){
1465				case 'curtainTopLeft':
1466						break;
1467				case 'curtainBottomLeft':
1468						break;
1469				case 'curtainSliceLeft':
1470						break;
1471				case 'curtainTopRight':
1472					arr = arr.reverse();
1473						break;
1474				case 'curtainBottomRight':
1475					arr = arr.reverse();
1476						break;
1477				case 'curtainSliceRight':
1478					arr = arr.reverse();
1479						break;
1480				case 'blindCurtainTopLeft':
1481						break;
1482				case 'blindCurtainBottomLeft':
1483					arr = arr.reverse();
1484						break;
1485				case 'blindCurtainSliceTop':
1486						break;
1487				case 'blindCurtainTopRight':
1488						break;
1489				case 'blindCurtainBottomRight':
1490					arr = arr.reverse();
1491						break;
1492				case 'blindCurtainSliceBottom':
1493					arr = arr.reverse();
1494						break;
1495				case 'stampede':
1496					arr = shuffle(arr);
1497						break;
1498				case 'mosaic':
1499						break;
1500				case 'mosaicReverse':
1501					arr = arr.reverse();
1502						break;
1503				case 'mosaicRandom':
1504					arr = shuffle(arr);
1505						break;
1506				case 'mosaicSpiral':
1507					var rows2 = rows/2, x, y, z, n=0;
1508						for (z = 0; z < rows2; z++){
1509							y = z;
1510							for (x = z; x < cols - z - 1; x++) {
1511								order[n++] = y * cols + x;
1512							}
1513							x = cols - z - 1;
1514							for (y = z; y < rows - z - 1; y++) {
1515								order[n++] = y * cols + x;
1516							}
1517							y = rows - z - 1;
1518							for (x = cols - z - 1; x > z; x--) {
1519								order[n++] = y * cols + x;
1520							}
1521							x = z;
1522							for (y = rows - z - 1; y > z; y--) {
1523								order[n++] = y * cols + x;
1524							}
1525						}
1526						
1527						arr = order;
1528
1529						break;
1530				case 'mosaicSpiralReverse':
1531					var rows2 = rows/2, x, y, z, n=blocks-1;
1532						for (z = 0; z < rows2; z++){
1533							y = z;
1534							for (x = z; x < cols - z - 1; x++) {
1535								order[n--] = y * cols + x;
1536							}
1537							x = cols - z - 1;
1538							for (y = z; y < rows - z - 1; y++) {
1539								order[n--] = y * cols + x;
1540							}
1541							y = rows - z - 1;
1542							for (x = cols - z - 1; x > z; x--) {
1543								order[n--] = y * cols + x;
1544							}
1545							x = z;
1546							for (y = rows - z - 1; y > z; y--) {
1547								order[n--] = y * cols + x;
1548							}
1549						}
1550
1551						arr = order;
1552						
1553						break;
1554				case 'topLeftBottomRight':
1555					for (var y = 0; y < rows; y++)
1556					for (var x = 0; x < cols; x++) {
1557						order.push(x + y);
1558					}
1559						delay = order;
1560						break;
1561				case 'bottomRightTopLeft':
1562					for (var y = 0; y < rows; y++)
1563					for (var x = 0; x < cols; x++) {
1564						order.push(x + y);
1565					}
1566						delay = order.reverse();
1567						break;
1568				case 'bottomLeftTopRight':
1569					for (var y = rows; y > 0; y--)
1570					for (var x = 0; x < cols; x++) {
1571						order.push(x + y);
1572					}
1573						delay = order;
1574						break;
1575				case 'topRightBottomLeft':
1576					for (var y = 0; y < rows; y++)
1577					for (var x = cols; x > 0; x--) {
1578						order.push(x + y);
1579					}
1580						delay = order;
1581						break;
1582			}
1583			
1584			
1585						
1586			$.each(arr, function(index, value) {
1587
1588				if(value%cols<leftScrap){
1589					addLeft = 1;
1590				} else {
1591					addLeft = 0;
1592				}
1593				if(value%cols==0){
1594					tAppW = 0;
1595				}
1596				if(Math.floor(value/cols)<topScrap){
1597					addTop = 1;
1598				} else {
1599					addTop = 0;
1600				}
1601							
1602				switch(fx){
1603					case 'simpleFade':
1604						height = h;
1605						width = w;
1606						opacityOnGrid = 0;
1607							break;
1608					case 'curtainTopLeft':
1609						height = 0,
1610						width = Math.floor((w/cols)+addLeft+1),
1611						marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';
1612							break;
1613					case 'curtainTopRight':
1614						height = 0,
1615						width = Math.floor((w/cols)+addLeft+1),
1616						marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';
1617							break;
1618					case 'curtainBottomLeft':
1619						height = 0,
1620						width = Math.floor((w/cols)+addLeft+1),
1621						marginTop = Math.floor((h/rows)+addTop+1)+'px';
1622							break;
1623					case 'curtainBottomRight':
1624						height = 0,
1625						width = Math.floor((w/cols)+addLeft+1),
1626						marginTop = Math.floor((h/rows)+addTop+1)+'px';
1627							break;
1628					case 'curtainSliceLeft':
1629						height = 0,
1630						width = Math.floor((w/cols)+addLeft+1);
1631						if(value%2==0){
1632							marginTop = Math.floor((h/rows)+addTop+1)+'px';					
1633						} else {
1634							marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';					
1635						}
1636							break;
1637					case 'curtainSliceRight':
1638						height = 0,
1639						width = Math.floor((w/cols)+addLeft+1);
1640						if(value%2==0){
1641							marginTop = Math.floor((h/rows)+addTop+1)+'px';					
1642						} else {
1643							marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';					
1644						}
1645							break;
1646					case 'blindCurtainTopLeft':
1647						height = Math.floor((h/rows)+addTop+1),
1648						width = 0,
1649						marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
1650							break;
1651					case 'blindCurtainTopRight':
1652						height = Math.floor((h/rows)+addTop+1),
1653						width = 0,
1654						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
1655							break;
1656					case 'blindCurtainBottomLeft':
1657						height = Math.floor((h/rows)+addTop+1),
1658						width = 0,
1659						marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
1660							break;
1661					case 'blindCurtainBottomRight':
1662						height = Math.floor((h/rows)+addTop+1),
1663						width = 0,
1664						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
1665							break;
1666					case 'blindCurtainSliceBottom':
1667						height = Math.floor((h/rows)+addTop+1),
1668						width = 0;
1669						if(value%2==0){
1670							marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
1671						} else {
1672							marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
1673						}
1674							break;
1675					case 'blindCurtainSliceTop':
1676						height = Math.floor((h/rows)+addTop+1),
1677						width = 0;
1678						if(value%2==0){
1679							marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
1680						} else {
1681							marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
1682						}
1683							break;
1684					case 'stampede':
1685						height = 0;
1686						width = 0;					
1687						marginLeft = (w*0.2)*(((index)%cols)-(cols-(Math.floor(cols/2))))+'px';					
1688						marginTop = (h*0.2)*((Math.floor(index/cols)+1)-(rows-(Math.floor(rows/2))))+'px';	
1689							break;
1690					case 'mosaic':
1691						height = 0;
1692						width = 0;					
1693							break;
1694					case 'mosaicReverse':
1695						height = 0;
1696						width = 0;					
1697						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';					
1698						marginTop = Math.floor((h/rows)+addTop+1)+'px';					
1699							break;
1700					case 'mosaicRandom':
1701						height = 0;
1702						width = 0;					
1703						marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px';					
1704						marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px';					
1705							break;
1706					case 'mosaicSpiral':
1707						height = 0;
1708						width = 0;
1709						marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px';					
1710						marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px';					
1711							break;
1712					case 'mosaicSpiralReverse':
1713						height = 0;
1714						width = 0;
1715						marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px';					
1716						marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px';					
1717							break;
1718					case 'topLeftBottomRight':
1719						height = 0;
1720						width = 0;					
1721							break;
1722					case 'bottomRightTopLeft':
1723						height = 0;
1724						width = 0;					
1725						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';					
1726						marginTop = Math.floor((h/rows)+addTop+1)+'px';					
1727							break;
1728					case 'bottomLeftTopRight':
1729						height = 0;
1730						width = 0;					
1731						marginLeft = 0;					
1732						marginTop = Math.floor((h/rows)+addTop+1)+'px';					
1733							break;
1734					case 'topRightBottomLeft':
1735						height = 0;
1736						width = 0;					
1737						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';					
1738						marginTop = 0;					
1739							break;
1740					case 'scrollRight':
1741						height = h;
1742						width = w;
1743						marginLeft = -w;					
1744							break;
1745					case 'scrollLeft':
1746						height = h;
1747						width = w;
1748						marginLeft = w;					
1749							break;
1750					case 'scrollTop':
1751						height = h;
1752						width = w;
1753						marginTop = h;					
1754							break;
1755					case 'scrollBottom':
1756						height = h;
1757						width = w;
1758						marginTop = -h;					
1759							break;
1760					case 'scrollHorz':
1761						height = h;
1762						width = w;
1763						if(vis==0 && slideI==amountSlide-1) {
1764							marginLeft = -w;	
1765						} else if(vis<slideI  || (vis==amountSlide-1 && slideI==0)) {
1766							marginLeft = w;	
1767						} else {
1768							marginLeft = -w;	
1769						}
1770							break;
1771					}
1772					
1773			
1774				var tApp = $('.cameraappended:eq('+value+')',target);
1775								
1776				if(typeof u !== 'undefined'){
1777					clearInterval(u);
1778					clearTimeout(setT);
1779					setT = setTimeout(canvasLoader,transPeriod+difference);
1780				}
1781				
1782				
1783				if($(pagination).length){
1784					$('.camera_pag li',wrap).removeClass('cameracurrent');
1785					$('.camera_pag li',wrap).eq(slideI).addClass('cameracurrent');
1786				}
1787						
1788				if($(thumbs).length){
1789					$('li', thumbs).removeClass('cameracurrent');
1790					$('li', thumbs).eq(slideI).addClass('cameracurrent');
1791					$('li', thumbs).not('.cameracurrent').find('img').animate({opacity:.5},0);
1792					$('li.cameracurrent img', thumbs).animate({opacity:1},0);
1793					$('li', thumbs).on('mouseenter', function(){
1794						$('img',this).stop(true,false).animate({opacity:1},150);
1795					},function(){
1796						if(!$(this).hasClass('cameracurrent')){
1797							$('img',this).stop(true,false).animate({opacity:.5},150);
1798						}
1799					});
1800				}
1801								
1802						
1803				var easedTime = parseFloat(transPeriod)+parseFloat(difference);
1804				
1805				function cameraeased() {
1806
1807					$(this).addClass('cameraeased');
1808					if($('.cameraeased',target).length>=0){
1809						$(thumbs).css({visibility:'visible'});
1810					}
1811					if($('.cameraeased',target).length==blocks){
1812						
1813						thumbnailPos();
1814						
1815						$('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom',fakeHover).each(function(){
1816							$(this).css('visibility','hidden');
1817						});
1818		
1819						selector.eq(slideI).show().css('z-index','999').removeClass('cameranext').addClass('cameracurrent');
1820						selector.eq(vis).css('z-index','1').removeClass('cameracurrent');
1821						$('.cameraContent',fakeHover).eq(slideI).addClass('cameracurrent');
1822						if (vis >= 0) {
1823							$('.cameraContent',fakeHover).eq(vis).removeClass('cameracurrent');
1824						}
1825						
1826						opts.onEndTransition.call(this);
1827						
1828						if($('> div', elem).eq(slideI).attr('data-video')!='hide' && $('.cameraContent.cameracurrent .imgFake',fakeHover).length ){
1829							$('.cameraContent.cameracurrent .imgFake',fakeHover).click();
1830						}
1831
1832						
1833						var lMoveIn = selector.eq(slideI).find('.fadeIn').length;
1834						var lMoveInContent = $('.cameraContent',fakeHover).eq(slideI).find('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom').length;
1835						
1836						if (lMoveIn!=0){
1837							$('.cameraSlide.cameracurrent .fadeIn',fakeHover).each(function(){
1838								if($(this).attr('data-easing')!=''){
1839									var easeMove = $(this).attr('data-easing');
1840								} else {
1841									var easeMove = easing;
1842								}
1843								var t = $(this);
1844								if(typeof t.attr('data-outerWidth') === 'undefined' || t.attr('data-outerWidth') === false || t.attr('data-outerWidth') === '') {
1845									var wMoveIn = t.outerWidth();
1846									t.attr('data-outerWidth',wMoveIn);
1847								} else {
1848									var wMoveIn = t.attr('data-outerWidth');
1849								}
1850								if(typeof t.attr('data-outerHeight') === 'undefined' || t.attr('data-outerHeight') === false || t.attr('data-outerHeight') === '') {
1851									var hMoveIn = t.outerHeight();
1852									t.attr('data-outerHeight',hMoveIn);
1853								} else {
1854									var hMoveIn = t.attr('data-outerHeight');
1855								}
1856								//t.css('width',wMoveIn);
1857								var pos = t.position();
1858								var left = pos.left;
1859								var top = pos.top;
1860								var tClass = t.attr('class');
1861								var ind = t.index();
1862								var hRel = t.parents('.camerarelative').outerHeight();
1863								var wRel = t.parents('.camerarelative').outerWidth();
1864								if(tClass.indexOf("fadeIn") != -1) {
1865									t.animate({opacity:0}
1865,0).css('visibility','visible').delay((time/lMoveIn)*(0.1*(ind-1))).animate({opacity:1},(time/lMoveIn)*0.15,easeMove);
1866								} else {
1867									t.css('visibility','visible');
1868								}
1869							});
1870						}
1871
1872						$('.cameraContent.cameracurrent',fakeHover).show();
1873						if (lMoveInContent!=0){
1874							
1875							$('.cameraContent.cameracurrent .moveFromLeft, .cameraContent.cameracurrent .moveFromRight, .cameraContent.cameracurrent .moveFromTop, .cameraContent.cameracurrent .moveFromBottom, .cameraContent.cameracurrent .fadeIn, .cameraContent.cameracurrent .fadeFromLeft, .cameraContent.cameracurrent .fadeFromRight, .cameraContent.cameracurrent .fadeFromTop, .cameraContent.cameracurrent .fadeFromBottom',fakeHover).each(function(){
1876								if($(this).attr('data-easing')!=''){
1877									var easeMove = $(this).attr('data-easing');
1878								} else {
1879									var easeMove = easing;
1880								}
1881								var t = $(this);
1882								var pos = t.position();
1883								var left = pos.left;
1884								var top = pos.top;
1885								var tClass = t.attr('class');
1886								var ind = t.index();
1887								var thisH = t.outerHeight();
1888								if(tClass.indexOf("moveFromLeft") != -1) {
1889									t.css({'left':'-'+(w)+'px','right':'auto'});
1890									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left},(time/lMoveInContent)*0.15,easeMove);
1891								} else if(tClass.indexOf("moveFromRight") != -1) {
1892									t.css({'left':w+'px','right':'auto'});
1893									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left},(time/lMoveInContent)*0.15,easeMove);
1894								} else if(tClass.indexOf("moveFromTop") != -1) {
1895									t.css({'top':'-'+h+'px','bottom':'auto'});
1896									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top},(time/lMoveInContent)*0.15,easeMove,function(){
1897										t.css({top:'auto',bottom:0});
1898									});
1899								} else if(tClass.indexOf("moveFromBottom") != -1) {
1900									t.css({'top':h+'px','bottom':'auto'});
1901									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top},(time/lMoveInContent)*0.15,easeMove);
1902								} else if(tClass.indexOf("fadeFromLeft") != -1) {
1903									t.animate({opacity:0}
1903,0).css({'left':'-'+(w)+'px','right':'auto'});
1904									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left,opacity:1},(time/lMoveInContent)*0.15,easeMove);
1905								} else if(tClass.indexOf("fadeFromRight") != -1) {
1906									t.animate({opacity:0},0).css({'left':(w)+'px','right':'auto'});
1907									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left,opacity:1},(time/lMoveInContent)*0.15,easeMove);
1908								} else if(tClass.indexOf("fadeFromTop") != -1) {
1909									t.animate({opacity:0},0).css({'top':'-'+(h)+'px','bottom':'auto'});
1910									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top,opacity:1},(time/lMoveInContent)*0.15,easeMove,function(){
1911										t.css({top:'auto',bottom:0});
1912									});
1913								} else if(tClass.indexOf("fadeFromBottom") != -1) {
1914									t.animate({opacity:0},0).css({'bottom':'-'+thisH+'px'});
1915									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'bottom':'0',opacity:1},(time/lMoveInContent)*0.15,easeMove);
1916								} else if(tClass.indexOf("fadeIn") != -1) {
1917									t.animate({opacity:0}
1917,0).css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({opacity:1},(time/lMoveInContent)*0.15,easeMove);
1918								} else {
1919									t.css('visibility','visible');
1920								}
1921							});
1922						}
1923
1924						
1925						$('.cameraappended',target).remove();
1926						elem.removeClass('camerasliding');	
1927							selector.eq(vis).hide();
1928							var barWidth = $('.camera_bar_cont',camera_thumbs_wrap).width(),
1929								barHeight = $('.camera_bar_cont',camera_thumbs_wrap).height(),
1930								radSum;
1931							if (loader != 'pie') {
1932								radSum = 0.05;
1933							} else {
1934								radSum = 0.005;
1935							}
1936							$('#'+pieID).animate({opacity:opts.loaderOpacity},200);
1937							u = setInterval(
1938								function(){
1939									if(elem.hasClass('stopped')){
1940										clearInterval(u);
1941									}
1942									if (loader != 'pie') {
1943										if(rad<=1.002 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')){
1944											rad = (rad+radSum);
1945										} else if (rad<=1 && (elem.hasClass('stopped') || elem.hasClass('paused') || elem.hasClass('stopped') || elem.hasClass('hovered'))){
1946											rad = rad;
1947										} else {
1948											if(!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
1949												clearInterval(u);
1950												imgFake();
1951												$('#'+pieID).animate({opacity:0}
1951,200,function(){
1952													clearTimeout(setT);
1953													setT = setTimeout(canvasLoader,easedTime);
1954													nextSlide();
1955													opts.onStartLoading.call(this);
1956												});
1957											}
1958										}
1959										switch(barDirection){
1960											case 'leftToRight':
1961												$('#'+pieID).animate({'right':barWidth-(barWidth*rad)},(time*radSum),'linear');
1962												break;
1963											case 'rightToLeft':
1964												$('#'+pieID).animate({'left':barWidth-(barWidth*rad)},(time*radSum),'linear');
1965												break;
1966											case 'topToBottom':
1967												$('#'+pieID).animate({'bottom':barHeight-(barHeight*rad)},(time*radSum),'linear');
1968												break;
1969											case 'bottomToTop':
1970												$('#'+pieID).animate({'bottom':barHeight-(barHeight*rad)},(time*radSum),'linear');
1971												break;
1972										}
1973										
1974									} else {
1975										radNew = rad;
1976										ctx.clearRect(0,0,opts.pieDiameter,opts.pieDiameter);
1977										ctx.globalCompositeOperation = 'destination-over';
1978										ctx.beginPath();
1979										ctx.arc((opts.pieDiameter)/2, (opts.pieDiameter)/2, (opts.pieDiameter)/2-opts.loaderStroke,0,Math.PI*2,false);
1980										ctx.lineWidth = opts.loaderStroke;
1981										ctx.strokeStyle = opts.loaderBgColor;
1982										ctx.stroke();
1983										ctx.closePath();
1984										ctx.globalCompositeOperation = 'source-over';
1985										ctx.beginPath();
1986										ctx.arc((opts.pieDiameter)/2, (opts.pieDiameter)/2, (opts.pieDiameter)/2-opts.loaderStroke,0,Math.PI*2*radNew,false);
1987										ctx.lineWidth = opts.loaderStroke-(opts.loaderPadding*2);
1988										ctx.strokeStyle = opts.loaderColor;
1989										ctx.stroke();
1990										ctx.closePath();
1991												
1992										if(rad<=1.002 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')){
1993											rad = (rad+radSum);
1994										} else if (rad<=1 && (elem.hasClass('stopped') || elem.hasClass('paused') || elem.hasClass('hovered'))){
1995											rad = rad;
1996										} else {
1997											if(!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
1998												clearInterval(u);
1999												imgFake();
2000												$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
2000,200,function(){
2001													clearTimeout(setT);
2002													setT = setTimeout(canvasLoader,easedTime);
2003													nextSlide();
2004													opts.onStartLoading.call(this);
2005												});
2006											}
2007										}
2008									}
2009								},time*radSum
2010							);
2011						}
2012
2013				}
2014
2015
2016				
2017				if(fx=='scrollLeft' || fx=='scrollRight' || fx=='scrollTop' || fx=='scrollBottom' || fx=='scrollHorz'){
2018					opts.onStartTransition.call(this);
2019					easedTime = 0;
2020					tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({
2021							'display' : 'block',
2022							'height': height,
2023							'margin-left': marginLeft,
2024							'margin-top': marginTop,
2025							'width': width
2026						}).animate({
2027							'height': Math.floor((h/rows)+addTop+1),
2028							'margin-top' : 0,
2029							'margin-left' : 0,
2030							'width' : Math.floor((w/cols)+addLeft+1)
2031						},(transPeriod-difference),easing,cameraeased);
2032					selector.eq(vis).delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).animate({
2033							'margin-left': marginLeft*(-1),
2034							'margin-top': marginTop*(-1)
2035						},(transPeriod-difference),easing,function(){
2036							$(this).css({'margin-top' : 0,'margin-left' : 0});
2037						});
2038				} else {
2039					opts.onStartTransition.call(this);
2040					easedTime = parseFloat(transPeriod)+parseFloat(difference);
2041					if(slideOn=='next'){
2042						tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({
2043								'display' : 'block',
2044								'height': height,
2045								'margin-left': marginLeft,
2046								'margin-top': marginTop,
2047								'width': width,
2048								'opacity' : opacityOnGrid
2049							}).animate({
2050								'height': Math.floor((h/rows)+addTop+1),
2051								'margin-top' : 0,
2052								'margin-left' : 0,
2053								'opacity' : 1,
2054								'width' : Math.floor((w/cols)+addLeft+1)
2055							},(transPeriod-difference),easing,cameraeased);
2056					} else {
2057						selector.eq(slideI).show().css('z-index','999').addClass('cameracurrent');
2058						selector.eq(vis).css('z-index','1').removeClass('cameracurrent');
2059						$('.cameraContent',fakeHover).eq(slideI).addClass('cameracurrent');
2060						$('.cameraContent',fakeHover).eq(vis).removeClass('cameracurrent');
2061						tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({
2062								'display' : 'block',
2063								'height': Math.floor((h/rows)+addTop+1),
2064								'margin-top' : 0,
2065								'margin-left' : 0,
2066								'opacity' : 1,
2067								'width' : Math.floor((w/cols)+addLeft+1)
2068							}).animate({
2069								'height': height,
2070								'margin-left': marginLeft,
2071								'margin-top': marginTop,
2072								'width': width,
2073								'opacity' : opacityOnGrid
2074							},(transPeriod-difference),easing,cameraeased);
2075					}
2076				}
2077
2078
2079
2080
2081
2082			});
2083				
2084				
2085				
2086	 
2087		}
2088	}
2089
2090
2091				if($(prevNav).length){
2092					$(prevNav).on('click', function(){
2093						if(!elem.hasClass('camerasliding')){
2094							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index());
2095							clearInterval(u);
2096							imgFake();
2097							$('#'+pieID+', .camera_canvas_wrap',wrap).animate({opacity:0}
2097,0);
2098							canvasLoader();
2099							if(idNum!=0){
2100								nextSlide(idNum);
2101							} else {
2102								nextSlide(amountSlide);
2103						   }
2104						   opts.onStartLoading.call(this);
2105						}
2106					});
2107				}
2108			
2109				if($(nextNav).length){
2110					$(nextNav).on('click', function(){
2111						if(!elem.hasClass('camerasliding')){
2112							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 
2113							clearInterval(u);
2114							imgFake();
2115							$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0);
2116							canvasLoader();
2117							if(idNum==amountSlide-1){
2118								nextSlide(1);
2119							} else {
2120								nextSlide(idNum+2);
2121						   }
2122						   opts.onStartLoading.call(this);
2123						}
2124					});
2125				}
2126
2127
2128				if(isMobile()){
2129					fakeHover.on('swipeleft',function(event){
2130						if(!elem.hasClass('camerasliding')){
2131							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 
2132							clearInterval(u);
2133							imgFake();
2134							$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0);
2135							canvasLoader();
2136							if(idNum==amountSlide-1){
2137								nextSlide(1);
2138							} else {
2139								nextSlide(idNum+2);
2140						   }
2141						   opts.onStartLoading.call(this);
2142						}
2143					});
2144					fakeHover.on('swiperight',function(event){
2145						if(!elem.hasClass('camerasliding')){
2146							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index());
2147							clearInterval(u);
2148							imgFake();
2149							$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
2149,0);
2150							canvasLoader();
2151							if(idNum!=0){
2152								nextSlide(idNum);
2153							} else {
2154								nextSlide(amountSlide);
2155						   }
2156						   opts.onStartLoading.call(this);
2157						}
2158					});
2159				}
2160
2161				if($(pagination).length){
2162					$('.camera_pag li',wrap).on('click', function(){
2163						if(!elem.hasClass('camerasliding')){
2164							var idNum = parseFloat($(this).index());
2165							var curNum = parseFloat($('.cameraSlide.cameracurrent',target).index());
2166							if(idNum!=curNum) {
2167								clearInterval(u);
2168								imgFake();
2169								$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0);
2170								canvasLoader();
2171								nextSlide(idNum+1);
2172								opts.onStartLoading.call(this);
2173							}
2174						}
2175					});
2176				}
2177
2178				if($(thumbs).length) {
2179
2180					$('.pix_thumb img',thumbs).on('click', function(){
2181						if(!elem.hasClass('camerasliding')){
2182							var idNum = parseFloat($(this).parents('li').index());
2183							var curNum = parseFloat($('.cameracurrent',target).index());
2184							if(idNum!=curNum) {
2185								clearInterval(u);
2186								imgFake();
2187								$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
2187,0);
2188								$('.pix_thumb',thumbs).removeClass('cameracurrent');
2189								$(this).parents('li').addClass('cameracurrent');
2190								canvasLoader();
2191								nextSlide(idNum+1);
2192								thumbnailPos();
2193								opts.onStartLoading.call(this);
2194							}
2195						}
2196					});
2197
2198					$('.camera_thumbs_cont .camera_prevThumbs',camera_thumbs_wrap).on('mouseenter', function(){
2199						$(this).stop(true,false).animate({opacity:1},250);
2200					},function(){
2201						$(this).stop(true,false).animate({opacity:.7},250);
2202					});
2203					$('.camera_prevThumbs',camera_thumbs_wrap).on('click', function(){
2204						var sum = 0,
2205							wTh = $(thumbs).outerWidth(),
2206							offUl = $('ul', thumbs).offset().left,
2207							offDiv = $('> div', thumbs).offset().left,
2208							ulLeft = offDiv-offUl;
2209							$('.camera_visThumb',thumbs).each(function(){
2210								var tW = $(this).outerWidth();
2211								sum = sum+tW;
2212							});
2213							if(ulLeft-sum>0){
2214								$('ul', thumbs).animate({'margin-left':'-'+(ulLeft-sum)+'px'},500,thumbnailVisible);
2215							} else {
2216								$('ul', thumbs).animate({'margin-left':0},500,thumbnailVisible);
2217							}
2218					});
2219
2220					$('.camera_thumbs_cont .camera_nextThumbs',camera_thumbs_wrap).on('mouseenter', function(){
2221						$(this).stop(true,false).animate({opacity:1},250);
2222					},function(){
2223						$(this).stop(true,false).animate({opacity:.7},250);
2224					});
2225					$('.camera_nextThumbs',camera_thumbs_wrap).on('click', function(){
2226						var sum = 0,
2227							wTh = $(thumbs).outerWidth(),
2228							ulW = $('ul', thumbs).outerWidth(),
2229							offUl = $('ul', thumbs).offset().left,
2230							offDiv = $('> div', thumbs).offset().left,
2231							ulLeft = offDiv-offUl;
2232							$('.camera_visThumb',thumbs).each(function(){
2233								var tW = $(this).outerWidth();
2234								sum = sum+tW;
2235							});
2236							if(ulLeft+sum+sum<ulW){
2237								$('ul', thumbs).animate({'margin-left':'-'+(ulLeft+sum)+'px'},500,thumbnailVisible);
2238							} else {
2239								$('ul', thumbs).animate({'margin-left':'-'+(ulW-wTh)+'px'},500,thumbnailVisible);
2240							}
2241					});
2242
2243				}
2244		
2245		
2246	
2247}
2248
2249})(jQuery);
2250
2251;(function($){$.fn.cameraStop = function() {
2252	var wrap = $(this),
2253		elem = $('.camera_src',wrap),
2254		pieID = 'pie_'+wrap.index();
2255	elem.addClass('stopped');
2256	if($('.camera_showcommands').length) {
2257		var camera_thumbs_wrap = $('.camera_thumbs_wrap',wrap);
2258	} else {
2259		var camera_thumbs_wrap = wrap;
2260	}
2261}
2262})(jQuery);
2263
2264;(function($){$.fn.cameraPause = function() {
2265	var wrap = $(this);
2266	var elem = $('.camera_src',wrap);
2267	elem.addClass('paused');
2268}
2269})(jQuery);
2270
2271;(function($){$.fn.cameraResume = function() {
2272	var wrap = $(this);
2273	var elem = $('.camera_src',wrap);
2274	if(typeof autoAdv === 'undefined' || autoAdv!==true){
2275		elem.removeClass('paused');
2276	}
2277}
2278})(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.