PageSourceSearch

https://littoral-airlines.com/modules/mod_rokgallery/templates/slideshow/slideshow.js

js littoral-airlines.com collected 2026-10-07 05:59:45 UTC 25,023 bytes, 1,074 lines download raw bytes

1
2(function(){
3
4	if (typeof this.RokGallery == 'undefined') this.RokGallery = {};
5
6	Element.implement({
7		sumStyles: function(){
8			var styles = this.getStyles(arguments), sum = 0;
9
10			for (var style in styles) sum += styles[style].toInt();
11
12			return sum;
13		}
14	});
15
16	Elements.implement({
17		sumStyles: function(styles){
18			var sum = 0;
19
20			this.each(function(element){
21				sum += element.sumStyles(styles);
22			}, this);
23
24			return sum;
25		}
26	});
27
28	this.RokGallery.Slideshow = new Class({
29
30		Implements: [Options, Events],
31
32		options: {
33			/*
34				onJump:		function(index){}
35			*/
36			onJump: function(index){
37				this.animation.index = this.current;
38				this.animation.setBackground(this.slices[index].getElement('img').get('src'));
39				this.animation.setAnimation(this.options.animation);
40				this.animation.play();
41
42				if (this.captions.length){
43					if (this.current == index){
44						this.captions[index].fade('in');
45					} else {
46						this.captions[this.current].fade('out');
47						this.captions[index].fade('in');
48					}
49				}
50			},
51
52			animation: 'random',
53			duration: 500,
54
55			autoplay: {
56				enabled: true,
57				delay: 5000,
58				complete: function(){
59					this.progress.reset();
60					this.next();
61				}
62			}
63		},
64
65		initialize: function(element, options){
66			this.setOptions(options);
67
68			this.element = document.id(element) || document.getElement(element) || null;
69			this.rtl = document.id(document.body).getStyle('direction') == 'rtl';
70
71			if (!this.element) return false;
72
73			this.current = 0;
74
75			this.container = this.element.getElement('.rg-ss-slice-container');
76			this.slices = this.element.getElements('.rg-ss-slice');
77			this.captions = this.element.getElements('.rg-ss-info');
78			this.arrows = this.element.getElements('.rg-ss-controls .next, .rg-ss-controls .prev');
79			this.scrollerContainer = this.element.getElement('.rg-ss-thumb-scroller');
80
81			this.loaderBar = this.element.getElement('.rg-ss-loader');
82			this.progressBar = this.element.getElement('.rg-ss-progress');
83
84			this.slices[0].setStyle('position', 'relative');
85
86			if (this.options.autoplay.enabled){
87				this.progress = new RokGallery.Slideshow.Progress(this.progressBar, {
88					duration: this.options.autoplay.delay,
89					container: this.container,
90					width: this.loaderBar ? this.loaderBar.getSize().x : 0,
91					onComplete: this.options.autoplay.complete.bind(this)
92				}).play();
93
94				this.bounds = {
95					progress: {
96						'mouseenter': this.progress.pause.bind(this.progress),
97						'mouseleave': this.progress.resume.bind(this.progress)
98					}
99				};
100
101				this.element.addEvents(this.bounds.progress);
102			} else {
103				if (this.loaderBar) this.loaderBar.setStyle('display', 'none');
104			}
105
106			this.setup();
107
108			if (this.arrows.length) this.setArrows();
109			if (this.scrollerContainer) this.setNavigation();
110
111			if (Browser.Features.Touch){
112				this.container.addEvent('swipe', function(event){
113					event.preventDefault();
114					this[event.direction == 'right' ? 'previous' : 'next']();
115				}.bind(this));
116			}
117
118			// fix for webkit and thumbnails
119			/*if (((Browser.Engine && Browser.Engine.webkit) || Browser.safari) && this.scrollerContainer){
120				window.addEvent('load', function(){
121					this.refreshThumbs(this.current);
122				}.bind(this));
123			}*/
124			setTimeout(function(){
125				this.refreshThumbs(this.current);
126			}.bind(this), Number.random(4, 400));
127		},
128		setup: function(){
129			this.animation = new RokGallery.Slideshow.Animations(this.element, {
130				container: this.container,
131				width: this.container.getSize().x,
132				height: this.container.getSize().y,
133				duration: this.options.duration,
134				transition: 'quad:in:out',
135				onStart: function(){
136					if (this.options.autoplay.enabled) this.progress.pause();
137				}.bind(this),
138				onComplete: function(){
139					this.slices[this.current].setStyle('display', 'block');
140					if (this.current != this.animation.index) this.slices[this.animation.index].setStyles({'display': 'none', 'position': 'absolute'});
141					this.slices[this.current].setStyle('position', 'relative');
142
143					this.animation.clean();
144
145					if (this.options.autoplay.enabled) this.progress.play();
146				}.bind(this)
147			});
148
149			if (this.captions.length){
150				this.captions.setStyles({display: 'block', 'opacity': 0, 'visibility': 'hidden'});
151				//this.captions[this.current].setStyles({display: 'block', 'opacity': 1, 'visibility': 'visible'});
152				this.captions.set('tween', {duration: this.options.duration, transition: 'quad:in:out'});
153			}
154
155			this.fireEvent('setup');
156		},
157
158		setArrows: function(){
159			var action;
160			this.arrows.each(function(arrow){
161				action = arrow.className.contains('next') ? 'next' : 'previous';
162				arrow.addEvent('click', this[action].bind(this));
163			}, this);
164		},
165
166		setNavigation: function(){
167			this.scroller = new RokGallery.Slideshow.Thumbnails(this.element, this, {});
168		},
169
170		next: function(){
171			var next = this.getNext();
172			this.jump(next);
173
174			if (this.options.autoplay.enabled && !this.progress.isPaused) this.progress.play();
175
176			return this;
177		},
178
179		previous: function(){
180			var previous = this.getPrevious();
181			this.jump(previous);
182
183			return this;
184		},
185
186		jump: function(index, force){
187			if (index == this.current && !force) return this;
188			if (this.animation.timer) return this;
189
190			this.fireEvent('jump', index);
191
192			this.refreshThumbs(index);
193
194			this.current = index;
195
196			return this;
197		},
198
199		refreshThumbs: function(index){
200			if (this.scrollerContainer){
201				this.scroller.setActive(index);
202				this.scroller.toThumb(index);
203			}
204		},
205
206		getNext: function(){
207			return (this.current + 1 >= this.slices.length) ? 0 : this.current + 1;
208		},
209
210		getPrevious: function(){
211			return (this.current - 1 < 0) ? this.slices.length - 1 : this.current - 1;
212		}
213
214	});
215
216	this.RokGallery.Slideshow.Progress = new Class({
217
218		Extends: Fx,
219
220		options: {
221			container: null,
222			transition: 'linear',
223			fps: 24,
224			width: 100
225		},
226
227		initialize: function(element, options){
228			this.element = document.id(element);
229			this.isPaused = false;
230
231			this.parent(options);
232		},
233
234		set: function(now){
235			if (this.element) this.element.setStyle('width', now);
236
237			return this;
238		},
239
240		reset: function(){
241			this.set(0);
242
243			return this;
244		},
245
246		play: function(){
247			this.options.width = this.options.container.getSize().x;
248			this.start(0, this.options.width);
249
250			return this;
251		},
252
253		pause: function(){
254			this.isPaused = true;
255			return this.parent();
256		},
257
258		resume: function(){
259			this.isPaused = false;
260			return this.parent();
261		}
262
263	});
264
265	this.RokGallery.Slideshow.Thumbnails = new Class({
266
267		Implements: [Options, Events],
268
269		options: {
270			/*
271			onClickElement:		function(thumb, index){}
272			*/
273			onClickElement: function(thumb, index){
274				if (this.base.animation.timer) return this;
275				this.base.jump(index);
276				this.setActive(index);
277
278				return this;
279			},
280
281			scroller: {
282				duration: 300,
283				transition: Fx.Transitions.Expo.easeInOut
284			}
285		},
286
287		initialize: function(element, base, options){
288			this.setOptions(options);
289
290			this.base = base;
291			this.element = element;
292			this.thumbSize = 0;
293
294			this.wrapper = this.element.getElement('.rg-ss-navigation-container');
295			this.container = this.wrapper.getElement('.rg-ss-thumb-scroller');
296			this.arrows = this.wrapper.getElements('.rg-ss-arrow-left, .rg-ss-arrow-right');
297			this.list = this.wrapper.getElement('.rg-ss-thumb-list');
298			this.thumbsWrapper = this.wrapper.getElements('.rg-ss-thumb-list .rg-ss-thumb');
299			this.thumbs = this.wrapper.getElements('.rg-ss-thumb-list .rg-ss-thumb img');
300
301			this.arrowsSize = this.arrows.sumStyles('width');
302
303			this.scroller = new Fx.Scroll(this.container, this.options.scroller);
304			this.scroller.set(0, 0);
305
306			this.setup();
307			this.attach();
308
309			return this;
310		},
311
312		attach: function(){
313			this.thumbsWrapper.each(function(thumb, i){
314
315				thumb.bounds = {
316					'click': function(event){
317						this.clickElement(event, thumb);
318					}.bind(this)
319				};
320
321				thumb.addEvents(thumb.bounds);
322
323			}, this);
324
325			this.arrows.each(function(arrow, i) {
326
327				arrow.bounds = {
328					'click': function(event){
329						this.arrowsClick(event, arrow, (!i ? 'left' : 'right'));
330					}.bind(this)
331				};
332
333				arrow.addEvent('dblclick', function(e){ e.stop(); });
334				arrow.addEvents(arrow.bounds);
335
336			}, this);
337		},
338
339		detach: function(){
340			this.thumbsWrapper.each(function(thumb, i){
341				thumb.removeEvents(thumb.bounds);
342			}, this);
343
344			this.arrows.removeEvents(this.bounds.arrows);
345		},
346
347		arrowsClick: function(event, arrow, direction){
348			event.stop();
349
350			var amount = this.container.scrollLeft + (direction == 'left' ? -this.thumbSize : +this.thumbSize),
351				total = this.container.scrollWidth - this.container.offsetWidth,
352				actual = this.container.scrollLeft + this.thumbSize;
353
354			if (total - actual < this.thumbSize) amount += total - actual;
355			if (actual - this.thumbSize * 2 < this.thumbSize && direction == 'left') amount = 0;
356
357			this.scroller.start(amount, 0);
358		},
359
360		toThumb: function(index){
361			//var styles = [];
362			//['padding-%x', 'border-%x-width', 'margin-%x'].each(function(style){
363			//	['left', 'right'].each(function(direction){
364			//		styles.push(style.replace(/%x/g, direction));
365			//	});
366			//});
367			//this.thumbSize = this.thumbsWrapper[index].sumStyles(styles) + (this.thumbs[index].offsetWidth ? this.thumbsWrapper[index].offsetWidth : this.thumbs[index].get('width').toInt());
368
369			this.setup();
370			this.scroller.start(this.thumbSize * index, 0);
371		},
372
373		clickElement: function(event, thumb){
374			if (event) event.stop();
375
376
377			var index = this.thumbsWrapper.indexOf(thumb);
378
379			this.fireEvent('clickElement', [thumb, index]);
380		},
381
382		setup: function(){
383			var size = 0, styles = [];
384
385			['padding-%x', 'border-%x-width', 'margin-%x'].each(function(style){
386				['left', 'right'].each(function(direction){
387					styles.push(style.replace(/%x/g, direction));
388				});
389			});
390
391			this.thumbs.each(function(thumb, i){
392				this.thumbSize = this.thumbsWrapper[i].sumStyles(styles) + (thumb.offsetWidth ? this.thumbsWrapper[i].offsetWidth : (thumb.get('width') || this.thumbsWrapper[i].offsetWidth || 0).toInt());
393				size += this.thumbSize;
394			}, this);
395
396			this.list.setStyle('width', size);
397
398			if (size < this.wrapper.offsetWidth - this.arrowsSize){
399				this.wrapper.removeClass('arrows-enabled');
400			} else {
401				this.wrapper.addClass('arrows-enabled');
402			}
403		},
404
405		setActive: function(index){
406			this.thumbsWrapper.removeClass('active');
407			this.thumbsWrapper[index].addClass('active');
408		}
409
410	});
411
412
413	this.RokGallery.Slideshow.Animations = new Class({
414
415		Extends: Fx.CSS,
416
417		options: {
418			duration: 1000,
419			transition: 'expo:in:out',
420
421			animation: 'crossfade',
422			container: '',
423			background: '',
424			width: 0,
425			height: 0,
426
427			blinds: 24,
428			boxes: {
429				rows: 5,
430				cols: 10
431			}
432		},
433
434		animations: {},
435		animationsKeys: [],
436
437		initialize: function(elements, options){
438			this.isPaused = false;
439
440			this.parent(options);
441
442			this.slides = [];
443
444			this.originalDuration = this.options.duration;
445			this.delay = 0;
446			this.type = 'blinds';
447			this.background = this.options.background;
448			this.blinds = 1;
449			this.boxes = {rows: 1, cols: 1};
450			this.properties = {};
451			this.direction = 'right';
452			this.reorder = false;
453
454			this.container = new Element('div', {
455				'class': 'rg-ss-slice-animations'
456			}).inject(this.options.container);
457
458			this.setAnimation(this.options.animation);
459		},
460
461		build: function(type){
462			this.container.empty();
463			this.slides.empty();
464
465			this['build' + type.capitalize()]();
466
467			this.elements = $$(this.slides);
468		},
469
470		addAnimation: function(name, props){
471			if (!this.animations[name]) this.animations[name] = props;
472			this.animationsKeys.include(name);
473		},
474
475		setAnimation: function(name){
476			// debug
477			// refractored: blindsDownLeft , blindsDownRight, boxesMirror
478
479			if (name == 'random') name = this.animationsKeys.getRandom();
480			if (!this.animations[name]) this.setOptions({animation: 'crossfade'});
481			if (Browser.ie8) name = 'crossfade';
482
483			this.properties = {};
484			for (var prop in this.animations[name]){
485				this[prop] = this.animations[name][prop];
486			}
487
488			if (!this.animations[name]['blinds']) this.blinds = this.options.blinds;
489			if (!this.animations[name]['boxes']) this.boxes = this.options.boxes;
490			if (!this.animations[name]['reorder']) this.reorder = false;
491
492			this.build(this.type);
493		},
494
495		buildBlinds: function(){
496			var containerSize = this.options.container.getSize(),
497				size = {
498					width: containerSize.x,
499					height: containerSize.y
500				},
501				background = this.background,
502				blinds = background.length ? this.blinds : 0,
503				width = Math.round(size.width / blinds);
504
505			this.sliceSize = {width: width, height: size.height};
506
507			(blinds).times(function(i){
508
509				var position = ((width + (i * width)) - width);
510				var blind = new Element('div', {
511					styles: {
512						opacity: 0,
513						position: 'absolute',
514						top: 0,
515						zIndex: 2,
516						left: (width * i) + 'px',
517						height: size.height + 'px',
518						width: (i == blinds - 1) ? size.width - (width * i) : width,
519						background: 'url(' + background + ') no-repeat -' + position + 'px 0%',
520						backgroundSize: size.width + 'px ' + size.height + 'px'
521					}
522				}).inject(this.container);
523
524				if (Browser.ie8){
525					blind.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+background+"',sizingMethod='scale')";
526				}
527
528				this.slides.push(blind);
529
530			}, this);
531		},
532
533		buildBoxes: function(){
534			var containerSize = this.options.container.getSize(),
535				size = {
536					width: containerSize.x,
537					height: containerSize.y
538				},
539				background = this.background,
540				boxes = background.length ? this.boxes : {cols: 0, rows: 0},
541				boxSize = {width: Math.round(size.width / boxes.cols), height: Math.round(size.height / boxes.rows)};
542
543			this.sliceSize = {width: boxSize.width, height: boxSize.height};
544
545			(boxes.rows).times(function(row){
546				(boxes.cols).times(function(col){
547					var position = {
548						x: (boxSize.width + (col * boxSize.width)) - boxSize.width,
549						y: (boxSize.height + (row * boxSize.height)) - boxSize.height
550					};
551
552					var box = new Element('div', {
553						styles: {
554							opacity: 0,
555							position: 'absolute',
556							zIndex: 2,
557							top: (boxSize.height * row) + 'px',
558							left: (boxSize.width * col) + 'px',
559							width: (col == boxes.cols - 1) ? size.width - (boxSize.width * col) : boxSize.width,
560							height: boxSize.height,
561							background: 'url(' + background + ') no-repeat -' + position.x + 'px -' + position.y + 'px',
562							backgroundSize: size.width + 'px ' + size.height + 'px'
563						}
564					}).inject(this.container);
565
566					this.slides.push(box);
567
568				}, this);
569			}, this);
570		},
571
572		setBackground: function(background){
573			this.background = background;
574		},
575
576		compute: function(from, to, delta){
577			var now = {};
578
579			for (var i in from){
580				var iFrom = from[i], iTo = to[i], iNow = now[i] = {};
581				for (var p in iFrom){
582					iNow[p] = this.parent(iFrom[p], iTo[p], delta);
583				}
584			}
585
586			return now;
587		},
588
589		set: function(now, force){
590			var buffer = this.buffer = 0;
591			for (var i in now){
592				if (!this.elements[i]) continue;
593
594				var iNow = now[i];
595				for (var p in iNow) this.render.delay(force ? 0 : buffer, this, [this.elements[i], p, iNow[p], this.options.unit]);
596
597				buffer += this.delay;
598			}
599
600			this.buffer = buffer;
601
602			return this;
603		},
604
605		step: function(){
606			var time = Date.now();
607			var expected = (this.delay || 1) * this.slides.length + this.options.duration;
608
609			if (time < this.time + this.options.duration){
610				var delta = this.transition((time - this.time) / this.options.duration);
611				this.set(this.compute(this.from, this.to, delta));
612			} else {
613				if (time > this.time + expected){
614					this.set(this.compute(this.from, this.to, 1));
615					this.complete();
616				}
617			}
618		},
619
620		start: function(obj){
621			if (!this.check(obj)) return this;
622			var from = {}, to = {};
623
624			for (var i in obj){
625				if (!this.elements[i]) continue;
626
627				var iProps = obj[i], iFrom = from[i] = {}, iTo = to[i] = {};
628
629				for (var p in iProps){
630					var parsed = this.prepare(this.elements[i], p, iProps[p]);
631					iFrom[p] = parsed.from;
632					iTo[p] = parsed.to;
633				}
634			}
635
636			var duration = this.options.duration;
637			this.options.duration = Fx.Durations[duration] || duration.toInt();
638			this.from = from;
639			this.to = to;
640			this.time = 0;
641			this.transition = this.getTransition();
642			this.startTimer();
643			this.onStart();
644			return this;
645			//return this.parent(from, to);
646		},
647
648		reset: function(properties, force){
649			var obj = {};
650			(this.elements.length).times(function(index){
651				obj[index] = properties;
652			}, this);
653
654			this.set(obj, force);
655		},
656
657		play: function(properties){
658			var obj = {}, anims = {from: {}, to: {}};properties = properties || Object.clone(this.properties);
659
660			if (this.direction == 'left') this.elements.reverse();
661			if (this.reorder){
662				this.elements = this.reorder.bind(this, [this.elements])();
663			}
664
665			for (var prop in properties){
666				switch (typeof properties[prop]){
667					case 'object': case 'array':
668							var values = properties[prop];
669							values.each(function(value, i){
670								if (typeof value == 'string')
671								properties[prop][i] = value.replace('%height2%', this.sliceSize.height * 2).replace('%width2%', this.sliceSize.width * 2)
672													.replace('%height%', this.sliceSize.height).replace('%width%', this.sliceSize.width).toInt();
673
674								anims[!i ? 'from' : 'to'][prop] = properties[prop][i];
675							}, this);
676						break;
677					case 'string':
678						properties[prop] = properties[prop].replace('%height2%', this.sliceSize.height * 2).replace('%width2%', this.sliceSize.width * 2)
679														.replace('%height%', this.sliceSize.height).replace('%width%', this.sliceSize.width).toInt();
680						anims['to'][prop] = properties[prop];
681						break;
682				}
683			}
684
685
686			//(this.elements.length).times(function(index){
687			//	obj[index] = properties;
688//
689					//var anim = {
690					//	from: {}
691					//	to: {}
692					//};
693					//for (var p in obj[index]){
694					//	anim[from] = obj[index][p]
695					//	console.log(p, obj[index][p]);
696					//}
697			//	(function(){
698			//		moofx(this.elements[index]).animate(obj[index]);
699			//	}).delay(this.delay * index, this);
700			//}, this);
701
702			//(this.elements.length).times(function(index){
703			//	obj[index] = properties;
704			//}, this);
705//
706			//this.start(obj);
707
708			var settings;
709
710			this.time = 0;
711			this.transition = this.getTransition();
712			this.startTimer();
713			this.onStart();
714
715			//moofx(this.elements).style(anims['from']);
716			(this.elements.length).times(function(index){
717				(function(){
718					if (index != this.elements.length - 1) settings = {duration: this.options.duration, equation: 'cubic-bezier(0.37,0.61,0.59,0.87)'};
719					else settings = {duration: this.options.duration, equation: 'cubic-bezier(0.37,0.61,0.59,0.87)', callback: function(){ this.complete(); }.bind(this)};
720
721					if (this.elements[index]) moofx(this.elements[index]).animate(anims['to'], settings);
722				}).delay(this.delay * index, this);
723			}, this);
724
725			return this;
726		},
727
728		complete: function(){
729			if (this.stopTimer()) this.onComplete();
730			return this;
731		},
732
733		cancel: function(){
734			if (this.stopTimer()) this.onCancel();
735			return this;
736		},
737
738		onStart: function(){
739			this.fireEvent('start', this.subject);
740		},
741
742		onComplete: function(){
743			this.fireEvent('complete', this.subject);
744			if (!this.callChain()) this.fireEvent('chainComplete', this.subject);
745		},
746
747		onCancel: function(){
748			this.fireEvent('cancel', this.subject).clearChain();
749		},
750
751		pause: function(){
752			this.isPaused = true;
753			this.stopTimer();
754			return this;
755		},
756
757		resume: function(){
758			this.isPaused = false;
759			this.startTimer();
760			return this;
761		},
762
763		clean: function(){
764			$$(this.slides).dispose();
765			this.slides.empty();
766
767			return this;
768		},
769
770		stopTimer: function(){
771			if (!this.timer) return false;
772			this.time = Date.now() - this.time;
773			this.timer = removeInstance(this);
774			return true;
775		},
776
777		startTimer: function(){
778			if (this.timer) return false;
779			this.time = Date.now() - this.time;
780			this.timer = addInstance(this);
781			return true;
782		}
783
784	});
785	// global timers
786
787	var instances = {}, timers = {};
788
789	var loop = function(){
790		for (var i = this.length; i--;){
791			if (this[i]) this[i].step();
792		}
793	};
794
795	var addInstance = function(instance){
796		var fps = instance.options.fps,
797			list = instances[fps] || (instances[fps] = []);
798		list.push(instance);
799		if (!timers[fps]) timers[fps] = loop.periodical(Math.round(1000 / fps), list);
800		return true;
801	};
802
803	var removeInstance = function(instance){
804		var fps = instance.options.fps,
805			list = instances[fps] || [];
806		list.erase(instance);
807		if (!list.length && timers[fps]) timers[fps] = clearInterval(timers[fps]);
808		return false;
809	};
810
811
812	// animations
813
814	var animations = {
815
816		'crossfade': {
817			type: 'blinds',
818			blinds: 1,
819			delay: 0,
820			direction: 'right',
821			properties: {
822				'opacity': [0, 1]
823			}
824		},
825
826		'blindsRight': {
827			type: 'blinds',
828			direction: 'right',
829			delay: 50,
830			properties: {
831				'opacity': [0, 1]
832			}
833		},
834
835		'blindsLeft': {
836			type: 'blinds',
837			direction: 'left',
838			delay: 50,
839			properties: {
840				'opacity': [0, 1]
841			}
842		},
843
844		'blindsDownLeft': {
845			type: 'blinds',
846			direction: 'left',
847			delay: 50,
848			properties: {
849				height: [0, '%height%'],
850				opacity: [0, 1]
851			}
852		},
853
854		'blindsDownRight': {
855			type: 'blinds',
856			direction: 'right',
857			delay: 50,
858			properties: {
859				height: [0, '%height%'],
860				opacity: [0, 1]
861			}
862		},
863
864		'boxesOpacityRight': {
865			type: 'boxes',
866			direction: 'right',
867			delay: 6,
868			properties: {
869				opacity: [0, 1]
870			}
871		},
872
873		'boxesOpacityLeft': {
874			type: 'boxes',
875			direction: 'left',
876			delay: 6,
877			properties: {
878				opacity: [0, 1]
879			}
880		},
881
882		'slideDown': {
883			type: 'boxes',
884			boxes: {
885				cols: 1,
886				rows: 1
887			},
888			direction: 'right',
889			delay: 200,
890			properties: {
891				height: [0, '%height%'],
892				opacity: [0, 1]
893			}
894		},
895
896		'slideUp': {
897			type: 'boxes',
898			boxes: {
899				cols: 1,
900				rows: 1
901			},
902			direction: 'right',
903			delay: 200,
904			properties: {
905				top: ['%height%', 0],
906				opacity: [0, 1]
907			}
908		},
909
910		'slideLeft': {
911			type: 'boxes',
912			boxes: {
913				cols: 1,
914				rows: 1
915			},
916			direction: 'left',
917			delay: 200,
918			properties: {
919				left: ['-%width%', 0],
920				opacity: [0, 1]
921			}
922		},
923
924		'slideRight': {
925			type: 'boxes',
926			boxes: {
927				cols: 1,
928				rows: 1
929			},
930			direction: 'right',
931			delay: 200,
932			properties: {
933				left: ['%width%', 0],
934				opacity: [0, 1]
935			}
936		},
937
938		'boxesRight': {
939			type: 'boxes',
940			direction: 'right',
941			delay: 6,
942			properties: {
943				width: [0, '%width%'],
944				height: [0, '%height%'],
945				opacity: [0, 1]
946			}
947		},
948
949		'boxesLeft': {
950			type: 'boxes',
951			direction: 'left',
952			delay: 6,
953			properties: {
954				width: [0, '%width%'],
955				height: [0, '%height%'],
956				opacity: [0, 1]
957			}
958		},
959
960		'boxesMirror': {
961			type: 'boxes',
962			direction: 'left',
963			reorder: function(elements){
964				var boxes = [];
965
966				for (var i = 0, j = elements.length - 1; i < elements.length / 2;i++,j--){
967					boxes.push(elements[i]);
968					boxes.push(elements[j]);
969				}
970
971				return $$(boxes);
972			},
973			delay: 6,
974			properties: {
975				opacity: [0, 1],
976				width: [0, '%width%']
977			}
978		},
979
980		'boxesRandom': {
981			type: 'boxes',
982			direction: 'right',
983			reorder: function(elements){
984				var boxes = elements;
985
986				boxes.sort(function() {
987					return 0.5 - Math.random();
988				});
989
990				return $$(boxes);
991			},
992			delay: 4,
993			properties: {
994				opacity: [0, 1]
995			}
996		},
997
998		'blindsMirrorIn': {
999			type: 'blinds',
1000			blinds: 12,
1001			direction: 'left',
1002			reorder: function(elements){
1003				var boxes = [];
1004
1005				for (var i = 0, j = elements.length - 1; i < elements.length / 2;i++,j--){
1006					boxes.push(elements[i]);
1007					boxes.push(elements[j]);
1008				}
1009
1010				return $$(boxes);
1011			},
1012			delay: 50,
1013			properties: {
1014				opacity: [0, 1],
1015				width: [0, '%width%'],
1016				height: [0, '%height%']
1017			}
1018		},
1019
1020		'blindsMirrorOut': {
1021			type: 'blinds',
1022			blinds: 12,
1023			direction: 'left',
1024			reorder: function(elements){
1025				var boxes = [];
1026
1027				for (var i = 0, j = elements.length - 1; i < elements.length / 2;i++,j--){
1028					boxes.push(elements[i]);
1029					boxes.push(elements[j]);
1030				}
1031
1032				boxes.reverse();
1033
1034				return $$(boxes);
1035			},
1036			delay: 50,
1037			properties: {
1038				opacity: [0, 1],
1039				width: [0, '%width%'],
1040				height: [0, '%height%']
1041			}
1042		},
1043
1044		'blindsRandom': {
1045			type: 'blinds',
1046			blinds: 12,
1047			direction: 'right',
1048			reorder: function(elements){
1049				var boxes = elements;
1050
1051				boxes.sort(function() {
1052					return 0.5 - Math.random();
1053				});
1054
1055				return $$(boxes);
1056			},
1057			delay: 35,
1058			properties: {
1059				opacity: [0, 1]
1060			}
1061		}
1062
1063	};
1064
1065	for (var animation in animations){
1066		this.RokGallery.Slideshow.Animations.prototype.addAnimation(animation, animations[animation]);
1067	}
1068
1069}());
1070
1071RokGallery.Slideshow.prototype.options.onSetup = function(){
1072	var current = this.captions[this.current];
1073	if (current) current.setStyles({display: 'block', 'opacity': 1, 'visibility': 'visible'});
1074};

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.