PageSourceSearch

https://harran.edu.tr/js/camera.js

js harran.edu.tr collected 2026-09-24 20:02:42 UTC 70,728 bytes, 2,275 lines download raw bytes

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