PageSourceSearch

https://www.e-karystos.gr/highslide/highslide-full.js

js e-karystos.gr collected 2026-10-02 13:55:19 UTC 88,382 bytes, 3,048 lines download raw bytes

1/******************************************************************************
2Name:    Highslide JS
3Version: 4.0.12 (February 4 2009)
4Config:  default +events +unobtrusive +imagemap +slideshow +positioning +transitions +inline +ajax +iframe +flash
5Author:  Torstein Hønsi
6Support: http://highslide.com/support
7
8Licence:
9Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
10License (http://creativecommons.org/licenses/by-nc/2.5/).
11
12You are free:
13	* to copy, distribute, display, and perform the work
14	* to make derivative works
15
16Under the following conditions:
17	* Attribution. You must attribute the work in the manner  specified by  the
18	  author or licensor.
19	* Noncommercial. You may not use this work for commercial purposes.
20
21* For  any  reuse  or  distribution, you  must make clear to others the license
22  terms of this work.
23* Any  of  these  conditions  can  be  waived  if  you  get permission from the 
24  copyright holder.
25
26Your fair use and other rights are in no way affected by the above.
27******************************************************************************/
28
29var hs = {
30// Language strings
31lang : {
32	cssDirection: 'ltr',
33	loadingText : 'Loading...',
34	loadingTitle : 'Click to cancel',
35	focusTitle : 'Click to bring to front',
36	fullExpandTitle : 'Expand to actual size (f)',
37	creditsText : 'Powered by <i>Highslide JS</i>',
38	creditsTitle : 'Go to the Highslide JS homepage',
39	previousText : 'Previous',
40	nextText : 'Next', 
41	moveText : 'Move',
42	closeText : 'Close', 
43	closeTitle : 'Close (esc)', 
44	resizeTitle : 'Resize',
45	playText : 'Play',
46	playTitle : 'Play slideshow (spacebar)',
47	pauseText : 'Pause',
48	pauseTitle : 'Pause slideshow (spacebar)',
49	previousTitle : 'Previous (arrow left)',
50	nextTitle : 'Next (arrow right)',
51	moveTitle : 'Move',
52	fullExpandText : 'Full size',
53	number: 'Image %1 of %2',
54	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
55},
56// See http://highslide.com/ref for examples of settings  
57graphicsDir : 'highslide/graphics/',
58expandCursor : 'zoomin.cur', // null disables
59restoreCursor : 'zoomout.cur', // null disables
60expandDuration : 250, // milliseconds
61restoreDuration : 250,
62marginLeft : 15,
63marginRight : 15,
64marginTop : 15,
65marginBottom : 15,
66zIndexCounter : 1001, // adjust to other absolutely positioned elements
67loadingOpacity : 0.75,
68allowMultipleInstances: true,
69numberOfImagesToPreload : 5,
70outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 
71outlineStartOffset : 3, // ends at 10
72padToMinWidth : false, // pad the popup width to make room for wide caption
73fullExpandPosition : 'bottom right',
74fullExpandOpacity : 1,
75showCredits : true, // you can set this to false if you want
76creditsHref : 'http://highslide.com/',
77enableKeyListener : true,
78openerTagNames : ['a', 'area'], // Add more to allow slideshow indexing
79transitions : [],
80transitionDuration: 250,
81dimmingOpacity: 0, // Lightbox style dimming background
82dimmingDuration: 50, // 0 for instant dimming
83
84allowWidthReduction : false,
85allowHeightReduction : true,
86preserveContent : true, // Preserve changes made to the content and position of HTML popups.
87objectLoadTime : 'before', // Load iframes 'before' or 'after' expansion.
88cacheAjax : true, // Cache ajax popups for instant display. Can be overridden for each popup.
89anchor : 'auto', // where the image expands from
90align : 'auto', // position in the client (overrides anchor)
91targetX: null, // the id of a target element
92targetY: null,
93dragByHeading: true,
94minWidth: 200,
95minHeight: 200,
96allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
97outlineType : 'drop-shadow', // set null to disable outlines
98wrapperClassName : 'highslide-wrapper', // for enhanced css-control
99skin : {
100	controls:
101		'<div class="highslide-controls"><ul>'+
102			'<li class="highslide-previous">'+
103				'<a href="#" title="{hs.lang.previousTitle}">'+
104				'<span>{hs.lang.previousText}</span></a>'+
105			'</li>'+
106			'<li class="highslide-play">'+
107				'<a href="#" title="{hs.lang.playTitle}">'+
108				'<span>{hs.lang.playText}</span></a>'+
109			'</li>'+
110			'<li class="highslide-pause">'+
111				'<a href="#" title="{hs.lang.pauseTitle}">'+
112				'<span>{hs.lang.pauseText}</span></a>'+
113			'</li>'+
114			'<li class="highslide-next">'+
115				'<a href="#" title="{hs.lang.nextTitle}">'+
116				'<span>{hs.lang.nextText}</span></a>'+
117			'</li>'+
118			'<li class="highslide-move">'+
119				'<a href="#" title="{hs.lang.moveTitle}">'+
120				'<span>{hs.lang.moveText}</span></a>'+
121			'</li>'+
122			'<li class="highslide-full-expand">'+
123				'<a href="#" title="{hs.lang.fullExpandTitle}">'+
124				'<span>{hs.lang.fullExpandText}</span></a>'+
125			'</li>'+
126			'<li class="highslide-close">'+
127				'<a href="#" title="{hs.lang.closeTitle}" >'+
128				'<span>{hs.lang.closeText}</span></a>'+
129			'</li>'+
130		'</ul></div>'
131	,
132	contentWrapper:
133		'<div class="highslide-header"><ul>'+
134			'<li class="highslide-previous">'+
135				'<a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)">'+
136				'<span>{hs.lang.previousText}</span></a>'+
137			'</li>'+
138			'<li class="highslide-next">'+
139				'<a href="#" title="{hs.lang.nextTitle}" onclick="return hs.next(this)">'+
140				'<span>{hs.lang.nextText}</span></a>'+
141			'</li>'+
142			'<li class="highslide-move">'+
143				'<a href="#" title="{hs.lang.moveTitle}" onclick="return false">'+
144				'<span>{hs.lang.moveText}</span></a>'+
145			'</li>'+
146			'<li class="highslide-close">'+
147				'<a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)">'+
148				'<span>{hs.lang.closeText}</span></a>'+
149			'</li>'+
150		'</ul></div>'+
151		'<div class="highslide-body"></div>'+
152		'<div class="highslide-footer"><div>'+
153			'<span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span>'+
154		'</div></div>'
155},
156// END OF YOUR SETTINGS
157
158
159// declare internal properties
160preloadTheseImages : [],
161continuePreloading: true,
162expanders : [],
163overrides : [
164	'allowSizeReduction',
165	'useBox',
166	'anchor',
167	'align',
168	'targetX',
169	'targetY',
170	'outlineType',
171	'outlineWhileAnimating',
172	'captionId',
173	'captionText',
174	'captionEval',
175	'captionOverlay',
176	'headingId',
177	'headingText',
178	'headingEval',
179	'headingOverlay',
180	'dragByHeading',
181	'autoplay',
182	'numberPosition',
183	'transitions',
184	'dimmingOpacity',
185	
186	'width',
187	'height',
188	
189	'contentId',
190	'allowWidthReduction',
191	'allowHeightReduction',
192	'preserveContent',
193	'maincontentId',
194	'maincontentText',
195	'maincontentEval',
196	'objectType',	
197	'cacheAjax',	
198	'objectWidth',
199	'objectHeight',
200	'objectLoadTime',	
201	'swfOptions',
202	'wrapperClassName',
203	'minWidth',
204	'minHeight',
205	'maxWidth',
206	'maxHeight',
207	'slideshowGroup',
208	'easing',
209	'easingClose',
210	'fadeInOut',
211	'src'
212],
213overlays : [],
214idCounter : 0,
215oPos : {
216	x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
217	y: ['above', 'top', 'middle', 'bottom', 'below']
218},
219mouse: {},
220headingOverlay: {},
221captionOverlay: {},
222swfOptions: { flashvars: {}, params: {}, attributes: {} },
223faders : [],
224
225slideshows : [],
226
227pendingOutlines : {},
228sleeping : [],
229preloadTheseAjax : [],
230cacheBindings : [],
231cachedGets : {},
232clones : {},
233ie : (document.all && !window.opera),
234safari : /Safari/.test(navigator.userAgent),
235geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
236
237$ : function (id) {
238	return document.getElementById(id);
239},
240
241push : function (arr, val) {
242	arr[arr.length] = val;
243},
244
245createElement : function (tag, attribs, styles, parent, nopad) {
246	var el = document.createElement(tag);
247	if (attribs) hs.setAttribs(el, attribs);
248	if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
249	if (styles) hs.setStyles(el, styles);
250	if (parent) parent.appendChild(el);	
251	return el;
252},
253
254setAttribs : function (el, attribs) {
255	for (var x in attribs) el[x] = attribs[x];
256},
257
258setStyles : function (el, styles) {
259	for (var x in styles) {
260		if (hs.ie && x == 'opacity') {
261			if (styles[x] > 0.99) el.style.removeAttribute('filter');
262			else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
263		}
264		else el.style[x] = styles[x];
265	}
266},
267
268ieVersion : function () {
269	var arr = navigator.appVersion.split("MSIE");
270	return arr[1] ? parseFloat(arr[1]) : null;
271},
272
273getPageSize : function () {
274	var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 
275		? d.documentElement : d.body;	
276	
277	
278	var b = d.body;
279	var xScroll = (w.innerWidth && w.scrollMaxX) 
280			? w.innerWidth + w.scrollMaxX : Math.max(b.scrollWidth, b.offsetWidth),
281		yScroll = (w.innerHeight && window.scrollMaxY) 
282			? w.innerHeight + w.scrollMaxY : Math.max(b.scrollHeight, b.offsetHeight),
283		pageWidth = hs.ie ? iebody.scrollWidth :
284			(d.documentElement.clientWidth || self.innerWidth),
285      	pageHeight = hs.ie ? Math.max(iebody.scrollHeight, iebody.clientHeight) : 
286			(d.documentElement.clientHeight || self.innerHeight);
287	
288	var width = hs.ie ? iebody.clientWidth : 
289			(d.documentElement.clientWidth || self.innerWidth),
290		height = hs.ie ? iebody.clientHeight : self.innerHeight;
291	
292	return {
293		pageWidth: Math.max(pageWidth, xScroll),
294		pageHeight: Math.max(pageHeight, yScroll),
295		width: width,
296		height: height,		
297		scrollLeft: hs.ie ? iebody.scrollLeft : pageXOffset,
298		scrollTop: hs.ie ? iebody.scrollTop : pageYOffset
299	}
300},
301
302getPosition : function(el)	{
303	if (/area/i.test(el.tagName)) {
304		var imgs = document.getElementsByTagName('img');
305		for (var i = 0; i < imgs.length; i++) {
306			var u = imgs[i].useMap;
307			if (u && u.replace(/^.*?#/, '') == el.parentNode.name) {
308				el = imgs[i];
309				break;
310			}
311		}
312	}
313	var p = { x: el.offsetLeft, y: el.offsetTop };
314	while (el.offsetParent)	{
315		el = el.offsetParent;
316		p.x += el.offsetLeft;
317		p.y += el.offsetTop;
318		if (el != document.body && el != document.documentElement) {
319			p.x -= el.scrollLeft;
320			p.y -= el.scrollTop;
321		}
322	}
323	return p;
324},
325
326expand : function(a, params, custom, type) {
327	if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
328	if (typeof a.getParams == 'function') return params;
329	if (type == 'html') {
330		for (var i = 0; i < hs.sleeping.length; i++) {
331			if (hs.sleeping[i] && hs.sleeping[i].a == a) {
332				hs.sleeping[i].awake();
333				hs.sleeping[i] = null;
334				return false;
335			}
336		}
337		hs.hasHtmlExpanders = true;
338	}	
339	try {	
340		new hs.Expander(a, params, custom, type);
341		return false;
342	} catch (e) { return true; }
343},
344
345htmlExpand : function(a, params, custom) {
346	return hs.expand(a, params, custom, 'html');
347},
348
349getSelfRendered : function() {
350	return hs.createElement('div', { 
351		className: 'highslide-html-content', 
352		innerHTML: hs.replaceLang(hs.skin.contentWrapper) 
353	});
354},
355getElementByClass : function (el, tagName, className) {
356	var els = el.getElementsByTagName(tagName);
357	for (var i = 0; i < els.length; i++) {
358    	if ((new RegExp(className)).test(els[i].className)) {
359			return els[i];
360		}
361	}
362	return null;
363},
364replaceLang : function(s) {
365	s = s.replace(/\s/g, ' ');
366	var re = /{hs\.lang\.([^}]+)\}/g,
367		matches = s.match(re),
368		lang;
369	if (matches) for (var i = 0; i < matches.length; i++) {
370		lang = matches[i].replace(re, "$1");
371		if (typeof hs.lang[lang] != 'undefined') s = s.replace(matches[i], hs.lang[lang]);
372	}
373	return s;
374},
375
376
377setClickEvents : function () {
378	var els = document.getElementsByTagName('a');
379	for (var i = 0; i < els.length; i++) {
380		var type = hs.isUnobtrusiveAnchor(els[i]);
381		if (type && !els[i].hsHasSetClick) {
382			(function(){
383				var t = type;
384				if (hs.fireEvent(hs, 'onSetClickEvent', { element: els[i], type: t })) {
385					els[i].onclick =(type == 'image') ?function() { return hs.expand(this) }:
386						function() { return hs.htmlExpand(this, { objectType: t } );};
387				}
388			})();
389			els[i].hsHasSetClick = true;	
390		}
391	}
392	if (!hs.pageLoaded) setTimeout( hs.setClickEvents, 50);
393	else hs.getAnchors();
394},
395isUnobtrusiveAnchor: function(el) {
396	if (el.rel == 'highslide') return 'image';
397	else if (el.rel == 'highslide-ajax') return 'ajax';
398	else if (el.rel == 'highslide-iframe') return 'iframe';
399	else if (el.rel == 'highslide-swf') return 'swf';
400},
401
402getCacheBinding : function (a) {
403	for (var i = 0; i < hs.cacheBindings.length; i++) {
404		if (hs.cacheBindings[i][0] == a) {
405			var c = hs.cacheBindings[i][1];
406			hs.cacheBindings[i][1] = c.cloneNode(1);
407			return c;
408		}
409	}
410	return null;
411},
412
413preloadAjax : function (e) {
414	var arr = hs.getAnchors();
415	for (var i = 0; i < arr.htmls.length; i++) {
416		var a = arr.htmls[i];
417		if (hs.getParam(a, 'objectType') == 'ajax' && hs.getParam(a, 'cacheAjax'))
418			hs.push(hs.preloadTheseAjax, a);
419	}
420	
421	hs.preloadAjaxElement(0);
422},
423
424preloadAjaxElement : function (i) {
425	if (!hs.preloadTheseAjax[i]) return;
426	var a = hs.preloadTheseAjax[i];
427	var cache = hs.getNode(hs.getParam(a, 'contentId'));
428	if (!cache) cache = hs.getSelfRendered();
429	var ajax = new hs.Ajax(a, cache, 1);	
430   	ajax.onError = function () { };
431   	ajax.onLoad = function () {
432   		hs.push(hs.cacheBindings, [a, cache]);
433   		hs.preloadAjaxElement(i + 1);
434   	};
435   	ajax.run();
436},
437
438focusTopmost : function() {
439	var topZ = 0, topmostKey = -1;
440	for (var i = 0; i < hs.expanders.length; i++) {
441		if (hs.expanders[i]) {
442			if (hs.expanders[i].wrapper.style.zIndex && hs.expanders[i].wrapper.style.zIndex > topZ) {
443				topZ = hs.expanders[i].wrapper.style.zIndex;
444				
445				topmostKey = i;
446			}
447		}
448	}
449	if (topmostKey == -1) hs.focusKey = -1;
450	else hs.expanders[topmostKey].focus();
451},
452
453getParam : function (a, param) {
454	a.getParams = a.onclick;
455	var p = a.getParams ? a.getParams() : null;
456	a.getParams = null;
457	
458	return (p && typeof p[param] != 'undefined') ? p[param] : 
459		(typeof hs[param] != 'undefined' ? hs[param] : null);
460},
461
462getSrc : function (a) {
463	var src = hs.getParam(a, 'src');
464	if (src) return src;
465	return a.href;
466},
467
468getNode : function (id) {
469	var node = hs.$(id), clone = hs.clones[id], a = {};
470	if (!node && !clone) return null;
471	if (!clone) {
472		clone = node.cloneNode(true);
473		clone.id = '';
474		hs.clones[id] = clone;
475		return node;
476	} else {
477		return clone.cloneNode(true);
478	}
479},
480
481discardElement : function(d) {
482	hs.garbageBin.appendChild(d);
483	hs.garbageBin.innerHTML = '';
484},
485dim : function(exp) {
486	if (!hs.dimmer) {
487		hs.dimmer = hs.createElement ('div', 
488			{ 
489				className: 'highslide-dimming',
490				owner: '',
491				onclick: function() {
492					if (hs.fireEvent(hs, 'onDimmerClick'))
493					 
494						hs.close();
495				}
496			}, 
497			{ position: 'absolute', left: 0 }, hs.container, true);
498		hs.addEventListener(window, 'resize', hs.setDimmerSize);
499	}
500	hs.dimmer.style.display = '';
501	hs.setDimmerSize();
502	hs.dimmer.owner += '|'+ exp.key;
503	if (hs.geckoMac && hs.dimmingGeckoFix) 
504		hs.dimmer.style.background = 'url('+ hs.graphicsDir + 'geckodimmer.png)';		
505	else
506		hs.fade(hs.dimmer, 0, exp.dimmingOpacity, hs.dimmingDuration); 
507},
508undim : function(key) {
509	if (!hs.dimmer) return;
510	if (typeof key != 'undefined') hs.dimmer.owner = hs.dimmer.owner.replace('|'+ key, '');
511	
512	if (
513		(typeof key != 'undefined' && hs.dimmer.owner != '')
514		|| (hs.upcoming && hs.getParam(hs.upcoming, 'dimmingOpacity'))
515	) return;
516	if (hs.geckoMac && hs.dimmingGeckoFix) 
517		hs.setStyles(hs.dimmer, { background: 'none', width: 0, height: 0 });
518	else hs.fade(hs.dimmer, hs.dimmingOpacity, 0, hs.dimmingDuration, function() {
519		hs.setStyles(hs.dimmer, { display: 'none', width: 0, height: 0 });
520	});
521},
522setDimmerSize : function(exp) {
523	if (!hs.dimmer) return;
524	var page = hs.getPageSize();
525	var h = (hs.ie && exp && exp.wrapper) ? 
526		parseInt(exp.wrapper.style.top) + parseInt(exp.wrapper.style.height)+ (exp.outline ? exp.outline.offset : 0) : 0; 
527	hs.setStyles(hs.dimmer, { 
528		width: page.pageWidth +'px', 
529		height: Math.max(page.pageHeight, h) +'px'
530	});
531},
532transit : function (adj, exp) {
533	hs.last = exp = exp || hs.getExpander();
534	try {
535		hs.upcoming = adj;
536		adj.onclick(); 		
537	} catch (e){
538		hs.last = hs.upcoming = null;
539	}
540	try {
541		if (!adj || exp.transitions[1] != 'crossfade')
542		exp.close();
543	} catch (e) {}
544	return false;
545},
546
547previousOrNext : function (el, op) {
548	var exp = hs.getExpander(el),
549		adj = exp.getAdjacentAnchor(op);
550	return hs.transit(adj, exp);
551},
552
553previous : function (el) {
554	return hs.previousOrNext(el, -1);
555},
556
557next : function (el) {
558	return hs.previousOrNext(el, 1);	
559},
560
561keyHandler : function(e) {
562	if (!e) e = window.event;
563	if (!e.target) e.target = e.srcElement; // ie
564	if (typeof e.target.form != 'undefined') return true; // form element has focus
565	if (!hs.fireEvent(hs, 'onKeyDown', e)) return true;
566	var exp = hs.getExpander();
567	
568	var op = null;
569	switch (e.keyCode) {
570		case 70: // f
571			if (exp) exp.doFullExpand();
572			return true;
573		case 32: // Space
574			op = 2;
575			break;
576		case 34: // Page Down
577		case 39: // Arrow right
578		case 40: // Arrow down
579			op = 1;
580			break;
581		case 8:  // Backspace
582		case 33: // Page Up
583		case 37: // Arrow left
584		case 38: // Arrow up
585			op = -1;
586			break;
587		case 27: // Escape
588		case 13: // Enter
589			op = 0;
590	}
591	if (op !== null) {if (op != 2)hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
592		if (!hs.enableKeyListener) return true;
593		
594		if (e.preventDefault) e.preventDefault();
595    	else e.returnValue = false;
596    	
597    	if (exp) {
598			if (op == 0) {
599				exp.close();
600			} else if (op == 2) {
601				if (exp.slideshow) exp.slideshow.hitSpace();
602			} else {
603				if (exp.slideshow) exp.slideshow.pause();
604				hs.previousOrNext(exp.key, op);
605			}
606			return false;
607		}
608	}
609	return true;
610},
611
612
613registerOverlay : function (overlay) {
614	hs.push(hs.overlays, overlay);
615},
616
617
618addSlideshow : function (options) {
619	var sg = options.slideshowGroup;
620	if (typeof sg == 'object') {
621		for (var i = 0; i < sg.length; i++) {
622			var o = {};
623			for (var x in options) o[x] = options[x];
624			o.slideshowGroup = sg[i];
625			hs.push(hs.slideshows, o);
626		}
627	} else {
628		hs.push(hs.slideshows, options);
629	}
630},
631
632getWrapperKey : function (element, expOnly) {
633	var el, re = /^highslide-wrapper-([0-9]+)$/;
634	// 1. look in open expanders
635	el = element;
636	while (el.parentNode)	{
637		if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
638		el = el.parentNode;
639	}
640	// 2. look in thumbnail
641	if (!expOnly) {
642		el = element;
643		while (el.parentNode)	{
644			if (el.tagName && hs.isHsAnchor(el)) {
645				for (var key = 0; key < hs.expanders.length; key++) {
646					var exp = hs.expanders[key];
647					if (exp && exp.a == el) return key;
648				}
649			}
650			el = el.parentNode;
651		}
652	}
653	return null; 
654},
655
656getExpander : function (el, expOnly) {
657	if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
658	if (typeof el == 'number') return hs.expanders[el] || null;
659	if (typeof el == 'string') el = hs.$(el);
660	return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
661},
662
663isHsAnchor : function (a) {
664	return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
665},
666
667reOrder : function () {
668	for (var i = 0; i < hs.expanders.length; i++)
669		if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
670},
671fireEvent : function (obj, evt, args) {
672	return obj && obj[evt] ? (obj[evt](obj, args) !== false) : true;
673},
674
675mouseClickHandler : function(e) 
676{	
677	if (!e) e = window.event;
678	if (e.button > 1) return true;
679	if (!e.target) e.target = e.srcElement;
680	
681	var el = e.target;
682	while (el.parentNode
683		&& !(/highslide-(image|move|html|resize)/.test(el.className)))
684	{
685		el = el.parentNode;
686	}
687	var exp = hs.getExpander(el);
688	if (exp && (exp.isClosing || !exp.isExpanded)) return true;
689		
690	if (exp && e.type == 'mousedown') {
691		if (e.target.form) return true;
692		var match = el.className.match(/highslide-(image|move|resize)/);
693		if (match) {
694			hs.dragArgs = { exp: exp , type: match[1], left: exp.x.pos, width: exp.x.size, top: exp.y.pos, 
695				height: exp.y.size, clickX: e.clientX, clickY: e.clientY };
696			
697			
698			hs.addEventListener(document, 'mousemove', hs.dragHandler);
699			if (e.preventDefault) e.preventDefault(); // FF
700			
701			if (/highslide-(image|html)-blur/.test(exp.content.className)) {
702				exp.focus();
703				hs.hasFocused = true;
704			}
705			return false;
706		}
707		else if (/highslide-html/.test(el.className) && hs.focusKey != exp.key) {
708			exp.focus();
709			exp.doShowHide('hidden');
710		}
711	} else if (e.type == 'mouseup') {
712		
713		hs.removeEventListener(document, 'mousemove', hs.dragHandler);
714		
715		if (hs.dragArgs) {
716			if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 
717				hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
718			var hasDragged = hs.dragArgs.hasDragged;
719			
720			if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
721				if (hs.fireEvent(exp, 'onImageClick'))
722				exp.close();
723			} 
724			else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
725				hs.dragArgs.exp.doShowHide('hidden');
726			}
727			
728			if (hs.dragArgs.exp.releaseMask) 
729				hs.dragArgs.exp.releaseMask.style.display = 'none';
730			
731			if (hasDragged) hs.fireEvent(hs.dragArgs.exp, 'onDrop', hs.dragArgs);
732			if (hasDragged) hs.setDimmerSize(exp);
733			
734			hs.hasFocused = false;
735			hs.dragArgs = null;
736		
737		} else if (/highslide-image-blur/.test(el.className)) {
738			el.style.cursor = hs.styleRestoreCursor;		
739		}
740	}
741	return false;
742},
743
744dragHandler : function(e)
745{
746	if (!hs.dragArgs) return true;
747	if (!e) e = window.event;
748	var a = hs.dragArgs, exp = a.exp;
749	if (exp.iframe) {		
750		if (!exp.releaseMask) exp.releaseMask = hs.createElement('div', null, 
751			{ position: 'absolute', width: exp.x.size+'px', height: exp.y.size+'px', 
752				left: exp.x.cb+'px', top: exp.y.cb+'px', zIndex: 4,	background: (hs.ie ? 'white' : 'none'), 
753				opacity: .01 }, 
754			exp.wrapper, true);
755		if (exp.releaseMask.style.display == 'none')
756			exp.releaseMask.style.display = '';
757	}
758	
759	a.dX = e.clientX - a.clickX;
760	a.dY = e.clientY - a.clickY;	
761	
762	var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
763	if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
764		|| (distance > (hs.dragSensitivity || 5));
765	
766	if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {
767		if (!hs.fireEvent(exp, 'onDrag', a)) return false;
768		
769		if (a.type == 'resize') exp.resize(a);
770		else {
771			exp.moveTo(a.left + a.dX, a.top + a.dY);
772			if (a.type == 'image') exp.content.style.cursor = 'move';
773		}
774	}
775	return false;
776},
777
778wrapperMouseHandler : function (e) {
779	try {
780		if (!e) e = window.event;
781		var over = /mouseover/i.test(e.type); 
782		if (!e.target) e.target = e.srcElement; // ie
783		if (hs.ie) e.relatedTarget = 
784			over ? e.fromElement : e.toElement; // ie
785		var exp = hs.getExpander(e.target);
786		if (!exp.isExpanded) return;
787		if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 
788			|| hs.dragArgs) return;
789		hs.fireEvent(exp, over ? 'onMouseOver' : 'onMouseOut', e);
790		for (var i = 0; i < exp.overlays.length; i++) {
791			var o = hs.$('hsId'+ exp.overlays[i]);
792			if (o && o.hideOnMouseOut) {
793				var from = over ? 0 : o.opacity,
794					to = over ? o.opacity : 0;			
795				hs.fade(o, from, to);
796			}
797		}	
798	} catch (e) {}
799},
800
801addEventListener : function (el, event, func) {
802	try {
803		el.addEventListener(event, func, false);
804	} catch (e) {
805		try {
806			el.detachEvent('on'+ event, func);
807			el.attachEvent('on'+ event, func);
808		} catch (e) {
809			el['on'+ event] = func;
810		}
811	} 
812},
813
814removeEventListener : function (el, event, func) {
815	try {
816		el.removeEventListener(event, func, false);
817	} catch (e) {
818		try {
819			el.detachEvent('on'+ event, func);
820		} catch (e) {
821			el['on'+ event] = null;
822		}
823	}
824},
825
826preloadFullImage : function (i) {
827	if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
828		var img = document.createElement('img');
829		img.onload = function() { 
830			img = null;
831			hs.preloadFullImage(i + 1);
832		};
833		img.src = hs.preloadTheseImages[i];
834	}
835},
836preloadImages : function (number) {
837	if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;
838	
839	var arr = hs.getAnchors();
840	for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
841		hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
842	}
843	
844	// preload outlines
845	if (hs.outlineType)	new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
846	else
847	
848	hs.preloadFullImage(0);
849	
850	// preload cursor
851	if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
852},
853
854
855init : function () {
856	if (!hs.container) {
857		hs.container = hs.createElement('div', {
858				className: 'highslide-container'
859			}, {
860				position: 'absolute', 
861				left: 0, 
862				top: 0, 
863				width: '100%', 
864				zIndex: hs.zIndexCounter,
865				direction: 'ltr'
866			}, 
867			document.body,
868			true
869		);
870		hs.loading = hs.createElement('a', {
871				className: 'highslide-loading',
872				title: hs.lang.loadingTitle,
873				innerHTML: hs.lang.loadingText,
874				href: 'javascript:;'
875			}, {
876				position: 'absolute',
877				top: '-9999px',
878				opacity: hs.loadingOpacity,
879				zIndex: 1
880			}, hs.container
881		);
882		hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);
883		hs.clearing = hs.createElement('div', null, 
884			{ clear: 'both', paddingTop: '1px' }, null, true);
885		
886		// http://www.robertpenner.com/easing/ 
887		Math.linearTween = function (t, b, c, d) {
888			return c*t/d + b;
889		};
890		Math.easeInQuad = function (t, b, c, d) {
891			return c*(t/=d)*t + b;
892		};
893		Math.easeInOutQuad = function (t, b, c, d) {
894			if ((t/=d/2) < 1) return c/2*t*t + b;
895			return -c/2 * ((--t)*(t-2) - 1) + b;
896		};
897		for (var x in hs.langDefaults) {
898			if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
899			else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 
900				hs.lang[x] = hs.langDefaults[x];
901		}
902		hs.ie6SSL = (hs.ie && hs.ieVersion() <= 6 && location.protocol == 'https:');
903		
904		hs.hideSelects = (hs.ie && hs.ieVersion() < 7);
905		hs.hideIframes = ((window.opera && navigator.appVersion < 9) || navigator.vendor == 'KDE' 
906			|| (hs.ie && hs.ieVersion() < 5.5));
907		hs.fireEvent(this, 'onActivate');
908	}
909},
910domReady : function() {
911	hs.isDomReady = true;
912	if (hs.onDomReady) hs.onDomReady();
913},
914
915updateAnchors : function() {
916	var el, els, all = [], images = [], htmls = [],groups = {}, re;
917		
918	for (var i = 0; i < hs.openerTagNames.length; i++) {
919		els = document.getElementsByTagName(hs.openerTagNames[i]);
920		for (var j = 0; j < els.length; j++) {
921			el = els[j];
922			re = hs.isHsAnchor(el);
923			if (re) {
924				hs.push(all, el);
925				if (re[0] == 'hs.expand') hs.push(images, el);
926				else if (re[0] == 'hs.htmlExpand') hs.push(htmls, el);
927				var g = hs.getParam(el, 'slideshowGroup') || 'none';
928				if (!groups[g]) groups[g] = [];
929				hs.push(groups[g], el);
930			}
931		}
932	}
933	hs.anchors = { all: all, groups: groups, images: images, htmls: htmls };
934	return hs.anchors;
935	
936},
937
938getAnchors : function() {
939	return hs.anchors || hs.updateAnchors();
940},
941
942
943fade : function (el, o, oFinal, dur, fn, i, dir) {
944	if (typeof i == 'undefined') { // new fader
945		if (typeof dur != 'number') dur = 250;
946		if (dur < 25) { // instant
947			hs.setStyles( el, { opacity: oFinal	});
948			if (fn) fn();
949			return;
950		}
951		i = hs.faders.length;
952		dir = oFinal > o ? 1 : -1;
953		var step = (25 / (dur - dur % 25)) * Math.abs(o - oFinal);
954	}
955	o = parseFloat(o);
956	var skip = (el.fade === 0 || el.fade === false || (el.fade == 2 && hs.ie));
957	el.style.visibility = ((skip ? oFinal : o) <= 0) ? 'hidden' : 'visible';
958	if (skip || o < 0 || (dir == 1 && o > oFinal)) { 
959		if (fn) fn();
960		return;
961	}
962	if (el.fading && el.fading.i != i) {
963		clearTimeout(hs.faders[el.fading.i]);
964		o = el.fading.o;
965	}
966	el.fading = {i: i, o: o, step: (step || el.fading.step)};
967	el.style.visibility = (o <= 0) ? 'hidden' : 'visible';
968	hs.setStyles(el, { opacity: o });
969	hs.faders[i] = setTimeout(function() {
970		hs.fade(el, o + el.fading.step * dir, oFinal, null, fn, i, dir);
971	}, 25);
972},
973
974close : function(el) {
975	var exp = hs.getExpander(el);
976	if (exp) exp.close();
977	return false;
978}
979}; // end hs object
980
981
982hs.Outline =  function (outlineType, onLoad) {
983	this.onLoad = onLoad;
984	this.outlineType = outlineType;
985	var v = hs.ieVersion(), tr;
986	
987	this.hasAlphaImageLoader = hs.ie && v >= 5.5 && v < 7;
988	if (!outlineType) {
989		if (onLoad) onLoad();
990		return;
991	}
992	
993	hs.init();
994	this.table = hs.createElement(
995		'table', { 
996			cellSpacing: 0 
997		}, {
998			visibility: 'hidden',
999			position: 'absolute',
1000			borderCollapse: 'collapse',
1001			width: 0
1002		},
1003		hs.container,
1004		true
1005	);
1006	var tbody = hs.createElement('tbody', null, null, this.table, 1);
1007	
1008	this.td = [];
1009	for (var i = 0; i <= 8; i++) {
1010		if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
1011		this.td[i] = hs.createElement('td', null, null, tr, true);
1012		var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
1013		hs.setStyles(this.td[i], style);
1014	}
1015	this.td[4].className = outlineType +' highslide-outline';
1016	
1017	this.preloadGraphic(); 
1018};
1019
1020hs.Outline.prototype = {
1021preloadGraphic : function () {
1022	var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
1023				
1024	var appendTo = hs.safari ? hs.container : null;
1025	this.graphic = hs.createElement('img', null, { position: 'absolute', 
1026		top: '-9999px' }, appendTo, true); // for onload trigger
1027	
1028	var pThis = this;
1029	this.graphic.onload = function() { pThis.onGraphicLoad(); };
1030	
1031	this.graphic.src = src;
1032},
1033
1034onGraphicLoad : function () {
1035	var o = this.offset = this.graphic.width / 4,
1036		pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
1037		dim = { height: (2*o) +'px', width: (2*o) +'px' };
1038	for (var i = 0; i <= 8; i++) {
1039		if (pos[i]) {
1040			if (this.hasAlphaImageLoader) {
1041				var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
1042				var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
1043				hs.createElement ('div', null, { 
1044						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 
1045						position: 'absolute',
1046						width: w, 
1047						height: this.graphic.height +'px',
1048						left: (pos[i][0]*o)+'px',
1049						top: (pos[i][1]*o)+'px'
1050					}, 
1051				div,
1052				true);
1053			} else {
1054				hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
1055			}
1056			
1057			if (window.opera && (i == 3 || i ==5)) 
1058				hs.createElement('div', null, dim, this.td[i], true);
1059			
1060			hs.setStyles (this.td[i], dim);
1061		}
1062	}
1063	this.graphic = null;
1064	if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
1065	hs.pendingOutlines[this.outlineType] = this;
1066	if (this.onLoad) this.onLoad();
1067},
1068	
1069setPosition : function (exp, pos, vis) {
1070	pos = pos || {
1071		x: exp.x.pos,
1072		y: exp.y.pos,
1073		w: exp.x.size + exp.x.p1 + exp.x.p2,
1074		h: exp.y.size + exp.y.p1 + exp.y.p2
1075	};
1076	if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 
1077		? 'visible' : 'hidden';
1078	hs.setStyles(this.table, {
1079		left: (pos.x - this.offset) +'px',
1080		top: (pos.y - this.offset) +'px',
1081		width: (pos.w + 2 * (exp.x.cb + this.offset)) +'px'
1082	});
1083	
1084	pos.w += 2 * (exp.x.cb - this.offset);
1085	pos.h += + 2 * (exp.y.cb - this.offset);
1086	hs.setStyles (this.td[4], {
1087		width: pos.w >= 0 ? pos.w +'px' : 0,
1088		height: pos.h >= 0 ? pos.h +'px' : 0
1089	});
1090	if (this.hasAlphaImageLoader) this.td[3].style.height 
1091		= this.td[5].style.height = this.td[4].style.height;
1092},
1093	
1094destroy : function(hide) {
1095	if (hide) this.table.style.visibility = 'hidden';
1096	else hs.discardElement(this.table);
1097}
1098};
1099
1100hs.Dimension = function(exp, dim) {
1101	this.exp = exp;
1102	this.dim = dim;
1103	this.ucwh = dim == 'x' ? 'Width' : 'Height';
1104	this.wh = this.ucwh.toLowerCase();
1105	this.uclt = dim == 'x' ? 'Left' : 'Top';
1106	this.lt = this.uclt.toLowerCase();
1107	this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
1108	this.rb = this.ucrb.toLowerCase();
1109	this.p1 = this.p2 = 0;
1110};
1111hs.Dimension.prototype = {
1112get : function(key) {
1113	switch (key) {
1114		case 'loadingPos':
1115			return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
1116		case 'loadingPosXfade':
1117			return this.pos + this.cb+ this.p1 + (this.size - hs.loading['offset'+ this.ucwh]) / 2;
1118		case 'wsize':
1119			return this.size + 2 * this.cb + this.p1 + this.p2;
1120		case 'fitsize':
1121			return this.clientSize - this.marginMin - this.marginMax;
1122		case 'opos':
1123			return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
1124		case 'osize':
1125			return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
1126		case 'imgPad':
1127			return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;
1128		
1129	}
1130},
1131calcBorders: function() {
1132	// correct for borders
1133	this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
1134	this.marginMax = hs['margin'+ this.ucrb] + 2 * this.cb;
1135},
1136calcThumb: function() {
1137	this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 
1138		this.exp.el['offset'+ this.ucwh];
1139	this.tpos = this.exp.tpos[this.dim];
1140	this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
1141	if (this.tpos == 0) {
1142		this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];		
1143	};
1144},
1145calcExpanded: function() {
1146	var exp = this.exp;
1147	this.justify = 'auto';
1148	
1149	// get alignment
1150	if (exp.align == 'center') this.justify = 'center';
1151	else if (new RegExp(this.lt).test(exp.anchor)) this.justify = null;
1152	else if (new RegExp(this.rb).test(exp.anchor)) this.justify = 'max';
1153	
1154	
1155	// size and position
1156	this.pos = this.tpos - this.cb + this.tb;
1157	this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
1158	this.minSize = exp.allowSizeReduction ? 
1159		Math.min(exp['min'+ this.ucwh], this.full) :this.full;
1160	if (exp.useBox)	{
1161		this.size = exp[this.wh];
1162		this.imgSize = this.full;
1163	}
1164	if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
1165	this.target = exp['target'+ this.dim.toUpperCase()];
1166	this.marginMin = hs['margin'+ this.uclt];
1167	this.scroll = hs.page['scroll'+ this.uclt];
1168	this.clientSize = hs.page[this.wh];
1169},
1170setSize: function(i) {
1171	var exp = this.exp;
1172	if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
1173		this.imgSize = i;
1174		this.size = Math.max(this.size, this.imgSize);
1175		exp.content.style[this.lt] = this.get('imgPad')+'px';
1176	} else
1177	this.size = i;
1178
1179	exp.content.style[this.wh] = i +'px';
1180	exp.wrapper.style[this.wh] = this.get('wsize') +'px';
1181	if (exp.outline) exp.outline.setPosition(exp);
1182	if (exp.releaseMask) exp.releaseMask.style[this.wh] = i +'px';
1183	if (exp.isHtml) {
1184		var d = exp.scrollerDiv;
1185		if (this.sizeDiff === undefined)
1186			this.sizeDiff = exp.innerContent['offset'+ this.ucwh] - d['offset'+ this.ucwh];
1187		d.style[this.wh] = (this.size - this.sizeDiff) +'px';
1188			
1189		if (this.dim == 'x') exp.mediumContent.style.width = 'auto';
1190		if (exp.body) exp.body.style[this.wh] = 'auto';		
1191	}
1192	if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
1193	if (this.dim == 'x' && exp.slideshow && exp.isImage) {
1194		if (i == this.full) exp.slideshow.disable('full-expand');
1195		else exp.slideshow.enable('full-expand');
1196	}
1197},
1198setPos: function(i) {
1199	this.pos = i;
1200	this.exp.wrapper.style[this.lt] = i +'px';	
1201	
1202	if (this.exp.outline) this.exp.outline.setPosition(this.exp);
1203	
1204}
1205};
1206
1207hs.Expander = function(a, params, custom, contentType) {
1208	if (document.readyState && hs.ie && !hs.isDomReady) {
1209		hs.onDomReady = function() {
1210			new hs.Expander(a, params, custom, contentType);
1211		};
1212		return;
1213	} 
1214	this.a = a;
1215	this.custom = custom;
1216	this.contentType = contentType || 'image';
1217	this.isHtml = (contentType == 'html');
1218	this.isImage = !this.isHtml;
1219	
1220	hs.continuePreloading = false;
1221	this.overlays = [];
1222	this.last = hs.last;
1223	hs.last = null;
1224	hs.init();
1225	var key = this.key = hs.expanders.length;
1226	
1227	// override inline parameters
1228	for (var i = 0; i < hs.overrides.length; i++) {
1229		var name = hs.overrides[i];
1230		this[name] = params && typeof params[name] != 'undefined' ?
1231			params[name] : hs[name];
1232	}
1233	if (!this.src) this.src = a.href;
1234	
1235	// get thumb
1236	var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
1237	el = this.thumb = el.getElementsByTagName('img')[0] || el;
1238	this.thumbsUserSetId = el.id || a.id;
1239	if (!hs.fireEvent(this, 'onInit')) return true;
1240	
1241	// check if already open
1242	for (var i = 0; i < hs.expanders.length; i++) {
1243		if (hs.expanders[i] && hs.expanders[i].a == a 
1244			&& !(this.last && this.transitions[1] == 'crossfade')) {
1245			hs.expanders[i].focus();
1246			return false;
1247		}
1248	}	
1249
1250	// cancel other
1251	for (var i = 0; i < hs.expanders.length; i++) {
1252		if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
1253			hs.expanders[i].cancelLoading();
1254		}
1255	}
1256	hs.expanders[this.key] = this;
1257	if (!hs.allowMultipleInstances && !hs.upcoming) {
1258		if (hs.expanders[key-1]) hs.expanders[key-1].close();
1259		if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
1260			hs.expanders[hs.focusKey].close();
1261	}
1262	
1263	// initiate metrics
1264	this.el = el;
1265	this.tpos = hs.getPosition(el);
1266	hs.page = hs.getPageSize();
1267	var x = this.x = new hs.Dimension(this, 'x');
1268	x.calcThumb();
1269	var y = this.y = new hs.Dimension(this, 'y');
1270	y.calcThumb();
1271	if (/area/i.test(el.tagName)) this.getImageMapAreaCorrection(el);
1272	
1273	// instanciate the wrapper
1274	this.wrapper = hs.createElement(
1275		'div', {
1276			id: 'highslide-wrapper-'+ this.key,
1277			className: this.wrapperClassName
1278		}, {
1279			visibility: 'hidden',
1280			position: 'absolute',
1281			zIndex: hs.zIndexCounter++
1282		}, null, true );
1283	
1284	this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
1285	if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
1286		this.outlineWhileAnimating = 0;
1287	
1288	// get the outline
1289	if (!this.outlineType 
1290		|| (this.last && this.isImage && this.transitions[1] == 'crossfade')) {
1291		this[this.contentType +'Create']();
1292	
1293	} else if (hs.pendingOutlines[this.outlineType]) {
1294		this.connectOutline();
1295		this[this.contentType +'Create']();
1296	
1297	} else {
1298		this.showLoading();
1299		var exp = this;
1300		new hs.Outline(this.outlineType, 
1301			function () {
1302				exp.connectOutline();
1303				exp[exp.contentType +'Create']();
1304			} 
1305		);
1306	}
1307	return true;
1308};
1309
1310hs.Expander.prototype = {
1311
1312connectOutline : function() {
1313	var o = this.outline = hs.pendingOutlines[this.outlineType];
1314	o.table.style.zIndex = this.wrapper.style.zIndex;
1315	hs.pendingOutlines[this.outlineType] = null;
1316},
1317
1318showLoading : function() {
1319	if (this.onLoadStarted || this.loading) return;
1320	
1321	this.loading = hs.loading;
1322	var exp = this;
1323	this.loading.onclick = function() {
1324		exp.cancelLoading();
1325	};
1326	
1327	
1328	if (!hs.fireEvent(this, 'onShowLoading')) return;
1329	var exp = this, 
1330		l = this.x.get('loadingPos') +'px',
1331		t = this.y.get('loadingPos') +'px';
1332	if (!tgt && this.last && this.transitions[1] == 'crossfade') 
1333		var tgt = this.last; 
1334	if (tgt) {
1335		l = tgt.x.get('loadingPosXfade') +'px';
1336		t = tgt.y.get('loadingPosXfade') +'px';
1337		this.loading.style.zIndex = hs.zIndexCounter++;
1338	}
1339	setTimeout(function () { 
1340		if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
1341	, 100);
1342},
1343
1344imageCreate : function() {
1345	var exp = this;
1346	
1347	var img = document.createElement('img');
1348    this.content = img;
1349    img.onload = function () {
1350    	if (hs.expanders[exp.key]) exp.contentLoaded(); 
1351	};
1352    if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
1353    img.className = 'highslide-image';
1354    hs.setStyles(img, {
1355    	visibility: 'hidden',
1356    	display: 'block',
1357    	position: 'absolute',
1358		maxWidth: '9999px',
1359		zIndex: 3
1360	});
1361    img.title = hs.lang.restoreTitle;
1362    if (hs.safari) hs.container.appendChild(img);
1363    if (hs.ie && hs.flushImgSize) img.src = null;
1364	img.src = this.src;
1365	
1366	this.showLoading();
1367},
1368
1369htmlCreate : function () {
1370	if (!hs.fireEvent(this, 'onBeforeGetContent')) return;
1371	
1372	this.content = hs.getCacheBinding(this.a);
1373	if (!this.content) 
1374		this.content = hs.getNode(this.contentId);
1375	if (!this.content) 
1376		this.content = hs.getSelfRendered();
1377	this.getInline(['maincontent']);
1378	if (this.maincontent) {
1379		var body = hs.getElementByClass(this.content, 'div', 'highslide-body');
1380		if (body) body.appendChild(this.maincontent);
1381		this.maincontent.style.display = 'block';
1382	}
1383	hs.fireEvent(this, 'onAfterGetContent');
1384	
1385	this.innerContent = this.content;
1386	
1387	if (/(swf|iframe)/.test(this.objectType)) this.setObjContainerSize(this.innerContent);
1388	
1389	// the content tree
1390	hs.container.appendChild(this.wrapper);
1391	hs.setStyles( this.wrapper, { 
1392		position: 'static',
1393		padding: '0 '+ hs.marginRight +'px 0 '+ hs.marginLeft +'px'
1394	});
1395	this.content = hs.createElement(
1396    	'div', {
1397    		className: 'highslide-html' 
1398    	}, {
1399			position: 'relative',
1400			zIndex: 3,
1401			overflow: 'hidden'
1402		},
1403		this.wrapper
1404	);
1405	this.mediumContent = hs.createElement('div', null, null, this.content, 1);
1406	this.mediumContent.appendChild(this.innerContent);
1407
1408	hs.setStyles (this.innerContent, { 
1409		position: 'relative',
1410		display: 'block',
1411		direction: hs.lang.cssDirection || ''
1412	});
1413	if (this.width) this.innerContent.style.width = this.width+'px';
1414	if (this.height) this.innerContent.style.height = this.height+'px';
1415	if (this.innerContent.offsetWidth < this.minWidth)
1416		this.innerContent.style.width = this.minWidth +'px';
1417	
1418    
1419	if (this.objectType == 'ajax' && !hs.getCacheBinding(this.a)) {
1420		this.showLoading();
1421    	var ajax = new hs.Ajax(this.a, this.innerContent);
1422    	var exp = this;
1423    	ajax.onLoad = function () {	if (hs.expanders[exp.key]) exp.contentLoaded(); };
1424    	ajax.onError = function () { location.href = exp.src; };
1425    	ajax.run();
1426	}
1427    else
1428    
1429    if (this.objectType == 'iframe' && this.objectLoadTime == 'before') {
1430		this.writeExtendedContent();
1431	}
1432    else
1433    	this.contentLoaded();
1434},
1435
1436contentLoaded : function() {
1437	try {	
1438		if (!this.content) return;
1439		this.content.onload = null;
1440		if (this.onLoadStarted) return;
1441		else this.onLoadStarted = true;
1442		
1443		var x = this.x, y = this.y;
1444		
1445		if (this.loading) {
1446			hs.setStyles(this.loading, { top: '-9999px' });
1447			this.loading = null;
1448			hs.fireEvent(this, 'onHideLoading');
1449		}
1450		
1451		hs.setStyles (this.wrapper, {
1452			left: x.tpos +'px',
1453			top: y.tpos +'px'
1454		});
1455		if (this.isImage) {	
1456			x.full = this.content.width;
1457			y.full = this.content.height;
1458			
1459			hs.setStyles(this.content, {
1460				width: this.x.t +'px',
1461				height: this.y.t +'px'
1462			});
1463			this.wrapper.appendChild(this.content);
1464			hs.container.appendChild(this.wrapper);
1465		} else if (this.htmlGetSize) this.htmlGetSize();
1466		
1467		x.calcBorders();
1468		y.calcBorders();
1469		
1470		
1471		this.initSlideshow();
1472		this.getOverlays();
1473		
1474		var ratio = x.full / y.full;
1475		
1476		x.calcExpanded();
1477		this.justify(x);
1478		
1479		y.calcExpanded();
1480		this.justify(y);
1481		if (this.isHtml) this.htmlSizeOperations();
1482		if (this.overlayBox) this.sizeOverlayBox(0, 1);
1483		
1484		if (this.allowSizeReduction) {
1485			if (this.isImage)
1486				this.correctRatio(ratio);
1487			else this.fitOverlayBox();
1488			var ss = this.slideshow;			
1489			if (ss && this.last && ss.controls && ss.fixedControls) {
1490				var pos = ss.overlayOptions.position || '', p;
1491				for (var dim in hs.oPos) for (var i = 0; i < 5; i++) {
1492					p = this[dim];
1493					if (pos.match(hs.oPos[dim][i])) {
1494						p.pos = this.last[dim].pos 
1495							+ (this.last[dim].p1 - p.p1)
1496							+ (this.last[dim].size - p.size) * [0, 0, .5, 1, 1][i];
1497						if (ss.fixedControls == 'fit') {
1498							if (p.pos + p.size + p.p1 + p.p2 > p.scroll + p.clientSize - p.marginMax)
1499								p.pos = p.scroll + p.clientSize - p.size - p.marginMin - p.marginMax - p.p1 - p.p2;
1500							if (p.pos < p.scroll + p.marginMin) p.pos = p.scroll + p.marginMin; 
1501						} 
1502					}
1503				}
1504			}
1505			if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
1506				this.createFullExpand();
1507				if (this.overlays.length == 1) this.sizeOverlayBox();
1508			}
1509		}
1510		this.show();
1511		
1512	} catch (e) {
1513		window.location.href = this.src;
1514	}
1515},
1516
1517
1518setObjContainerSize : function(parent, auto) {
1519	var c = hs.getElementByClass(parent, 'DIV', 'highslide-body');
1520	if (/(iframe|swf)/.test(this.objectType)) {
1521		if (this.objectWidth) c.style.width = this.objectWidth +'px';
1522		if (this.objectHeight) c.style.height = this.objectHeight +'px';
1523	}
1524},
1525
1526writeExtendedContent : function () {
1527	if (this.hasExtendedContent) return;
1528	var exp = this;
1529	this.body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
1530	if (this.objectType == 'iframe') {
1531		this.showLoading();
1532		var ruler = hs.clearing.cloneNode(1);
1533		this.body.appendChild(ruler);
1534		this.newWidth = this.innerContent.offsetWidth;
1535		if (!this.objectWidth) this.objectWidth = ruler.offsetWidth;
1536		var hDiff = this.innerContent.offsetHeight - this.body.offsetHeight,
1537			h = this.objectHeight || (hs.getPageSize()).height - hDiff - hs.marginTop - hs.marginBottom,
1538			onload = this.objectLoadTime == 'before' ? 
1539				' onload="if (hs.expanders['+ this.key +']) hs.expanders['+ this.key +'].contentLoaded()" ' : '';
1540		
1541		this.body.innerHTML += '<iframe name="hs'+ (new Date()).getTime() +'" frameborder="0" key="'+ this.key +'" '
1542			+' allowtransparency="true" style="width:'+ this.objectWidth +'px; height:'+ h +'px" '
1543			+ onload +' src="'+ this.src +'"></iframe>';
1544		this.ruler = this.body.getElementsByTagName('div')[0];
1545		this.iframe = this.body.getElementsByTagName('iframe')[0];
1546		
1547		if (this.objectLoadTime == 'after') this.correctIframeSize();
1548		
1549	}
1550	if (this.objectType == 'swf') {
1551		this.body.id = this.body.id || 'hs-flash-id-' + this.key;
1552		var a = this.swfOptions;
1553		if (typeof a.params.wmode == 'undefined') a.params.wmode = 'transparent';
1554		if (swfobject) swfobject.embedSWF(this.src, this.body.id, this.objectWidth, this.objectHeight, 
1555			a.version || '7', a.expressInstallSwfurl, a.flashvars, a.params, a.attributes);
1556	}
1557	this.hasExtendedContent = true;
1558},
1559htmlGetSize : function() {
1560	if (this.iframe && !this.objectHeight) { // loadtime before		
1561		this.iframe.style.height = this.body.style.height = this.getIframePageHeight() +'px';
1562	}
1563	this.innerContent.appendChild(hs.clearing);
1564	if (!this.x.full) this.x.full = this.innerContent.offsetWidth;
1565    this.y.full = this.innerContent.offsetHeight;
1566    this.innerContent.removeChild(hs.clearing);
1567    if (hs.ie && this.newHeight > parseInt(this.innerContent.currentStyle.height)) { // ie css bug
1568		this.newHeight = parseInt(this.innerContent.currentStyle.height);
1569	}
1570	hs.setStyles( this.wrapper, { position: 'absolute',	padding: '0'});
1571	hs.setStyles( this.content, { width: this.x.t +'px',	height: this.y.t +'px'});
1572},
1573
1574getIframePageHeight : function() {
1575	var h;
1576	try {
1577		var doc = this.iframe.contentDocument || this.iframe.contentWindow.document;
1578		var clearing = doc.createElement('div');
1579		clearing.style.clear = 'both';
1580		doc.body.appendChild(clearing);
1581		h = clearing.offsetTop;
1582		if (hs.ie) h += parseInt(doc.body.currentStyle.marginTop) 
1583			+ parseInt(doc.body.currentStyle.marginBottom) - 1;
1584	} catch (e) { // other domain
1585		h = 300;
1586	}
1587	return h;
1588},
1589correctIframeSize : function () {
1590	var wDiff = this.innerContent.offsetWidth - this.ruler.offsetWidth;
1591	if (wDiff < 0) wDiff = 0;
1592	
1593	var hDiff = this.innerContent.offsetHeight - this.iframe.offsetHeight;
1594	hs.setStyles(this.iframe, { width: (this.x.size - wDiff) +'px', 
1595		height: (this.y.size - hDiff) +'px' });
1596    hs.setStyles(this.body, { width: this.iframe.style.width, 
1597    	height: this.iframe.style.height });
1598    	
1599    this.scrollingContent = this.iframe;
1600    this.scrollerDiv = this.scrollingContent;
1601},
1602htmlSizeOperations : function () {
1603	
1604	this.setObjContainerSize(this.innerContent);
1605	
1606	
1607	if (this.objectType == 'swf' && this.objectLoadTime == 'before') this.writeExtendedContent();	
1608	
1609    // handle minimum size
1610    if (this.x.size < this.x.full && !this.allowWidthReduction) this.x.size = this.x.full;
1611    if (this.y.size < this.y.full && !this.allowHeightReduction) this.y.size = this.y.full;
1612	this.scrollerDiv = this.innerContent;
1613    hs.setStyles(this.mediumContent, { 
1614		width: this.x.size +'px',
1615		position: 'relative',
1616		left: (this.x.pos - this.x.tpos) +'px',
1617		top: (this.y.pos - this.y.tpos) +'px'
1618	});
1619    hs.setStyles(this.innerContent, { 
1620    	border: 'none',
1621    	width: 'auto',
1622    	height: 'auto'
1623    });
1624	var node = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
1625    if (node && !/(iframe|swf)/.test(this.objectType)) {
1626    	var cNode = node; // wrap to get true size
1627    	node = hs.createElement(cNode.nodeName, null, {overflow: 'hidden'}, null, true);
1628    	cNode.parentNode.insertBefore(node, cNode);
1629    	node.appendChild(hs.clearing); // IE6
1630    	node.appendChild(cNode);
1631    	
1632    	var wDiff = this.innerContent.offsetWidth - node.offsetWidth;
1633    	var hDiff = this.innerContent.offsetHeight - node.offsetHeight;
1634    	node.removeChild(hs.clearing);
1635    	
1636    	var kdeBugCorr = hs.safari || navigator.vendor == 'KDE' ? 1 : 0; // KDE repainting bug
1637    	hs.setStyles(node, { 
1638    			width: (this.x.size - wDiff - kdeBugCorr) +'px', 
1639    			height: (this.y.size - hDiff) +'px',
1640    			overflow: 'auto', 
1641    			position: 'relative' 
1642    		} 
1643    	);
1644		if (kdeBugCorr && cNode.offsetHeight > node.offsetHeight)	{
1645    		node.style.width = (parseInt(node.style.width) + kdeBugCorr) + 'px';
1646		}
1647    	this.scrollingContent = node;
1648    	this.scrollerDiv = this.scrollingContent;
1649	}
1650    if (this.iframe && this.objectLoadTime == 'before') this.correctIframeSize();
1651    if (!this.scrollingContent && this.y.size < this.mediumContent.offsetHeight) this.scrollerDiv = this.content;
1652	
1653	if (this.scrollerDiv == this.content && !this.allowWidthReduction && !/(iframe|swf)/.test(this.objectType)) {
1654		this.x.size += 17; // room for scrollbars
1655	}
1656	if (this.scrollerDiv && this.scrollerDiv.offsetHeight > this.scrollerDiv.parentNode.offsetHeight) {
1657		setTimeout("try { hs.expanders["+ this.key +"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",
1658			 hs.expandDuration);
1659	}
1660},
1661
1662getImageMapAreaCorrection : function(area) {
1663	var c = area.coords.split(',');
1664	for (var i = 0; i < c.length; i++) c[i] = parseInt(c[i]);
1665	
1666	if (area.shape.toLowerCase() == 'circle') {
1667		this.x.tpos += c[0] - c[2];
1668		this.y.tpos += c[1] - c[2];
1669		this.x.t = this.y.t = 2 * c[2];
1670	} else {
1671		var maxX, maxY, minX = maxX = c[0], minY = maxY = c[1];
1672		for (var i = 0; i < c.length; i++) {
1673			if (i % 2 == 0) {
1674				minX = Math.min(minX, c[i]);
1675				maxX = Math.max(maxX, c[i]);
1676			} else {
1677				minY = Math.min(minY, c[i]);
1678				maxY = Math.max(maxY, c[i]);
1679			}
1680		}
1681		this.x.tpos += minX;
1682		this.x.t = maxX - minX;
1683		this.y.tpos += minY;
1684		this.y.t = maxY - minY;
1685	}
1686},
1687justify : function (p, moveOnly) {
1688	var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
1689	
1690	if (tgt && tgt.match(/ /)) {
1691		tgtArr = tgt.split(' ');
1692		tgt = tgtArr[0];
1693	}
1694	if (tgt && hs.$(tgt)) {
1695		p.pos = hs.getPosition(hs.$(tgt))[dim];
1696		if (tgtArr && tgtArr[1] && tgtArr[1].match(/^[-]?[0-9]+px$/)) 
1697			p.pos += parseInt(tgtArr[1]);
1698		
1699	} else if (p.justify == 'auto' || p.justify == 'center') {
1700	
1701		var hasMovedMin = false;
1702		
1703		var allowReduce = p.exp.allowSizeReduction;
1704		if (p.justify == 'center')
1705			p.pos = Math.round(p.scroll + (p.clientSize - p.get('wsize')) / 2);
1706		else
1707			p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
1708		if (p.pos < p.scroll + p.marginMin) {
1709			p.pos = p.scroll + p.marginMin;
1710			hasMovedMin = true;		
1711		}
1712		if (!moveOnly && p.size < p.minSize) {
1713			p.size = p.minSize;
1714			allowReduce = false;
1715		}
1716		if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
1717			if (!moveOnly && hasMovedMin && allowReduce) {
1718				p.size = p.get('fitsize')- 2 * p.cb - p.p1 - p.p2; // can't expand more
1719			} else if (p.get('wsize') < p.get('fitsize')) {
1720				p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
1721			} else { // image larger than viewport
1722				p.pos = p.scroll + p.marginMin;
1723				if (!moveOnly && allowReduce) p.size = p.get('fitsize')- 2 * p.cb - p.p1 - p.p2;
1724			}			
1725		}
1726		
1727		if (!moveOnly && p.size < p.minSize) {
1728			p.size = p.minSize;
1729			allowReduce = false;
1730		}
1731		
1732	
1733	} else if (p.justify == 'max') {
1734		p.pos = Math.floor(p.pos - p.size + p.t);
1735	}
1736	
1737		
1738	if (p.pos < p.marginMin) {
1739		var tmpMin = p.pos;
1740		p.pos = p.marginMin; 
1741		
1742		if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);
1743		
1744	}
1745},
1746
1747correctRatio : function(ratio) {
1748	var x = this.x, 
1749		y = this.y,
1750		changed = false,
1751		xSize = Math.min(x.full, x.size),
1752		ySize = Math.min(y.full, y.size),
1753		useBox = (this.useBox || hs.padToMinWidth);
1754	
1755	if (xSize / ySize > ratio) { // width greater
1756		xSize = ySize * ratio;
1757		if (xSize < x.minSize) { // below minWidth
1758			xSize = x.minSize;
1759			ySize = xSize / ratio;
1760		}
1761		changed = true;
1762	
1763	} else if (xSize / ySize < ratio) { // height greater
1764		ySize = xSize / ratio;
1765		changed = true;
1766	}
1767	
1768	if (hs.padToMinWidth && x.full < x.minSize) {
1769		x.imgSize = x.full;
1770		y.size = y.imgSize = y.full;
1771	} else if (this.useBox) {
1772		x.imgSize = xSize;
1773		y.imgSize = ySize;
1774	} else {
1775		x.size = xSize;
1776		y.size = ySize;
1777	}
1778	this.fitOverlayBox(useBox ? null : ratio);
1779	if (useBox && y.size < y.imgSize) {
1780		y.imgSize = y.size;
1781		x.imgSize = y.size * ratio;
1782	}
1783	if (changed || useBox) {
1784		x.pos = x.tpos - x.cb + x.tb;
1785		x.minSize = x.size;
1786		this.justify(x, true);
1787	
1788		y.pos = y.tpos - y.cb + y.tb;
1789		y.minSize = y.size;
1790		this.justify(y, true);
1791		if (this.overlayBox) this.sizeOverlayBox();
1792	}
1793},
1794fitOverlayBox : function(ratio) {
1795	var x = this.x, y = this.y;
1796	if (this.overlayBox) {
1797		while (y.size > this.minHeight && x.size > this.minWidth 
1798				&&  y.get('wsize') > y.get('fitsize')) {
1799			y.size -= 10;
1800			if (ratio) x.size = y.size * ratio;
1801			this.sizeOverlayBox(0, 1);
1802		}
1803	}
1804},
1805
1806reflow : function () {
1807	var h = /iframe/i.test(this.scrollerDiv.tagName) ? this.getIframePageHeight() + 1 +'px' : 'auto';
1808	if (this.body) this.body.style.height = h;
1809	this.scrollerDiv.style.height = h;
1810	this.y.setSize(this.innerContent.offsetHeight);
1811},
1812
1813show : function () {
1814	this.doShowHide('hidden');
1815	hs.fireEvent(this, 'onBeforeExpand');
1816	// Apply size change
1817	this.changeSize(
1818		1,
1819		{ 
1820			xpos: this.x.tpos + this.x.tb - this.x.cb,
1821			ypos: this.y.tpos + this.y.tb - this.y.cb,
1822			xsize: this.x.t,
1823			ysize: this.y.t,
1824			xp1: 0,
1825			xp2: 0,
1826			yp1: 0,
1827			yp2: 0,
1828			ximgSize: this.x.t,
1829			ximgPad: 0,
1830			yimgSize: this.y.t,
1831			yimgPad: 0,
1832			o: hs.outlineStartOffset
1833		},
1834		{
1835			xpos: this.x.pos,
1836			ypos: this.y.pos,
1837			xsize: this.x.size,
1838			ysize: this.y.size,
1839			xp1: this.x.p1,
1840			yp1: this.y.p1,
1841			xp2: this.x.p2,
1842			yp2: this.y.p2,
1843			ximgSize: this.x.imgSize,
1844			ximgPad: this.x.get('imgPad'),
1845			yimgSize: this.y.imgSize,
1846			yimgPad: this.y.get('imgPad'),
1847			o: this.outline ? this.outline.offset : 0
1848		},
1849		hs.expandDuration
1850	);
1851},
1852
1853changeSize : function(up, from, to, dur) {
1854	// transition
1855	var trans = this.transitions,
1856	other = up ? (this.last ? this.last.a : null) : hs.upcoming,
1857	t = (trans[1] && other 
1858			&& hs.getParam(other, 'transitions')[1] == trans[1]) ?
1859		trans[1] : trans[0];
1860		
1861	if (this[t] && t != 'expand') {
1862		this[t](up, from, to);
1863		return;
1864	}
1865	if (up) hs.setStyles(this.wrapper, { opacity: 1 });
1866	
1867	if (this.outline && !this.outlineWhileAnimating) {
1868		if (up) this.outline.setPosition(this);
1869		else this.outline.destroy(
1870				(this.isHtml && this.preserveContent));
1871	}
1872	
1873	
1874	if (!up && this.overlayBox) {
1875		if (this.slideshow) {
1876			var c = this.slideshow.controls;
1877			if (c && hs.getExpander(c) == this) c.parentNode.removeChild(c);
1878		}
1879		if (this.isHtml && this.preserveContent) {
1880			this.overlayBox.style.top = '-9999px';
1881			hs.container.appendChild(this.overlayBox);
1882		} else
1883		hs.discardElement(this.overlayBox);
1884	}
1885	if (this.fadeInOut) {
1886		from.op = up ? 0 : 1;
1887		to.op = up;
1888	}
1889	var t,
1890		exp = this,
1891		easing = Math[this.easing] || Math.easeInQuad,
1892		steps = (up ? hs.expandSteps : hs.restoreSteps) || parseInt(dur / 25) || 1;
1893	if (!up) easing = Math[this.easingClose] || easing;
1894	for (var i = 1; i <= steps ; i++) {
1895		t = Math.round(i * (dur / steps));
1896		
1897		(function(){
1898			var pI = i, size = {};
1899			
1900			for (var x in from) {
1901				size[x] = easing(t, from[x], to[x] - from[x], dur);
1902				if (isNaN(size[x])) size[x] = to[x];
1903				if (!/^op$/.test(x)) size[x] = Math.round(size[x]);
1904			}
1905			setTimeout ( function() {
1906				if (up && pI == 1) {
1907					exp.content.style.visibility = 'visible';
1908					exp.a.className += ' highslide-active-anchor';
1909				}
1910				exp.setSize(size);
1911			}, t);				
1912		})();
1913	}
1914	
1915	if (up) { 
1916			
1917		setTimeout(function() {
1918			if (exp.outline) exp.outline.table.style.visibility = "visible";
1919		}, t);
1920		setTimeout(function() {
1921			exp.afterExpand();
1922		}, t + 50);
1923	}
1924	else setTimeout(function() { exp.afterClose(); }, t);
1925},
1926
1927setSize : function (to) {
1928	try {
1929		if (to.op) hs.setStyles(this.wrapper, { opacity: to.op });
1930		hs.setStyles ( this.wrapper, {
1931			width : (to.xsize +to.xp1 + to.xp2 +
1932				2 * this.x.cb) +'px',
1933			height : (to.ysize +to.yp1 + to.yp2 +
1934				2 * this.y.cb) +'px',
1935			left: to.xpos +'px',
1936			top: to.ypos +'px'
1937		});
1938		hs.setStyles(this.content, {
1939			left: (to.xp1 + to.ximgPad) +'px',
1940			top: (to.yp1 + to.yimgPad) +'px',
1941			width: (to.ximgSize ||to.xsize) +'px',
1942			height: (to.yimgSize ||to.ysize) +'px'
1943		});
1944		if (this.isHtml) {
1945			hs.setStyles(this.mediumContent, { 
1946				left: (this.x.pos - to.xpos 
1947					+ this.x.p1 - to.xp1) +'px',
1948				top: (this.y.pos - to.ypos 
1949					+ this.y.p1 - to.yp1) +'px' 
1950			});			
1951			this.innerContent.style.visibility = 'visible';
1952		}
1953		
1954		if (this.outline && this.outlineWhileAnimating) {
1955			var o = this.outline.offset - to.o;
1956			this.outline.setPosition(this, {
1957				x: to.xpos + o, 
1958				y: to.ypos + o, 
1959				w: to.xsize + to.xp1 + to.xp2 + - 2 * o, 
1960				h: to.ysize + to.yp1 + to.yp2 + - 2 * o
1961			}, 1);
1962		}
1963			
1964		this.wrapper.style.visibility = 'visible';
1965		
1966	} catch (e) {
1967		window.location.href = this.src;	
1968	}
1969},
1970
1971fade : function(up, from, to) {
1972	this.outlineWhileAnimating = false;
1973	var exp = this,	t = up ? 250 : 0;
1974	
1975	if (up) {
1976		hs.setStyles(this.wrapper, { opacity: 0 });
1977		this.setSize(to);
1978		this.content.style.visibility = 'visible';
1979
1980		hs.fade (this.wrapper, 0, 1);
1981	}
1982	
1983	if (this.outline) {
1984		this.outline.table.style.zIndex = this.wrapper.style.zIndex;
1985		var dir = up || -1;
1986		for (var i = from.o; dir * i <= dir * to.o; i += dir, t += 25) {
1987			(function() {
1988				var o = up ? to.o - i : from.o - i;
1989				setTimeout(function() {
1990					exp.outline.setPosition(exp, {
1991						x: (exp.x.pos + o), 
1992						y: (exp.y.pos + o),
1993						w: (exp.x.size - 2 * o + exp.x.p1 + exp.x.p2), 
1994						h: (exp.y.size - 2 * o + exp.y.p1 + exp.y.p2)
1995					}, 1);
1996				}, t);
1997			})();
1998		}
1999	}
2000	
2001	
2002	if (up) setTimeout(function() { exp.afterExpand(); }, t+50);
2003	else {
2004		setTimeout( function() {
2005			if (exp.outline) exp.outline.destroy(exp.preserveContent);
2006			hs.fade (exp.wrapper, 1, 0);
2007			setTimeout( function() {
2008				exp.afterClose();
2009			}, 250);
2010		}, t);		
2011	}
2012},
2013
2014crossfade : function (up, from, to) {
2015	
2016	if (!up) return;
2017	var exp = this, steps = parseInt(hs.transitionDuration / 25) || 1, last = this.last;
2018	hs.removeEventListener(document, 'mousemove', hs.dragHandler);
2019	
2020	hs.setStyles(this.content, { 
2021		width: (to.ximgSize ||to.xsize) +'px', 
2022		height: (to.yimgSize ||to.ysize) +'px'		
2023	});
2024	this.outline = this.last.outline;
2025	this.last.outline = null;
2026	this.fadeBox = hs.createElement('div', {
2027		className: 'highslide-image'
2028	}, { 
2029		position: 'absolute', 
2030		zIndex: 4,
2031		overflow: 'hidden',
2032		display: 'none'
2033	});
2034	if (this.isHtml) {
2035		hs.setStyles(this.mediumContent, { 
2036			left: '0px',
2037			top: '0px' 
2038		});
2039	}
2040	var names = { oldImg: last, newImg: this };
2041	for (var x in names) { 	
2042		this[x] = names[x].content.cloneNode(1);
2043		hs.setStyles(this[x], {
2044			position: 'absolute',
2045			border: 0,
2046			visibility: 'visible'
2047		});
2048		this.fadeBox.appendChild(this[x]);
2049	}
2050	this.wrapper.appendChild(this.fadeBox);
2051	from = {
2052		xpos: last.x.pos,
2053		xsize: last.x.size,
2054		xp1: last.x.p1,
2055		xp2: last.x.p2,
2056		ximgSize: last.x.imgSize || last.x.size,
2057		ximgPad: last.x.get('imgPad'),
2058		yimgSize: last.y.imgSize || last.y.size,
2059		yimgPad: last.y.get('imgPad'),
2060		ypos: last.y.pos,
2061		ysize: last.y.size,
2062		yp1: last.y.p1,
2063		yp2: last.y.p2,
2064		o: 1 / steps
2065	};
2066	to.ysize = this.y.size;
2067	to.o = 1;
2068	if (!to.ximgSize) to.ximgSize = to.xsize;
2069	if (!to.yimgSize) to.yimgSize = to.ysize;
2070	
2071	var t, easing = Math.easeInOutQuad;
2072	
2073	if (steps > 1) this.crossfadeStep(from);
2074	function prep() {
2075		if (exp.overlayBox) {
2076			exp.overlayBox.className = '';
2077			exp.overlayBox.style.overflow = 'visible';
2078			exp.wrapper.appendChild(exp.overlayBox);
2079				
2080			for (var i = 0; i < exp.last.overlays.length; i++) {
2081				var oDiv = hs.$('hsId'+ exp.last.overlays[i]);
2082				if (oDiv.reuse === exp.key) exp.overlayBox.appendChild(oDiv);
2083				else hs.fade(oDiv, oDiv.opacity, 0);
2084			}
2085		}
2086		exp.fadeBox.style.display = '';
2087		exp.last.content.style.display = 'none';
2088	};
2089	if (/rv:1\.[0-8].+Gecko/.test(navigator.userAgent)) setTimeout(prep, 0);
2090	else prep();
2091	if (hs.safari) {
2092		var match = navigator.userAgent.match(/Safari\/([0-9]{3})/);
2093		if (match && parseInt(match[1]) < 525) this.wrapper.style.visibility = 'visible';
2094	}  
2095	
2096	for (var i = 1; i <= steps; i++) {
2097		t = Math.round(i * (hs.transitionDuration / steps));
2098		
2099		(function(){
2100			var size = {}, pI = i;
2101			for (var x in from)	{
2102				var val = easing(t, from[x], to[x] - from[x], hs.transitionDuration);
2103				if (isNaN(val)) val = to[x];
2104				size[x] = (x != 'o') ? Math.round(val) : val;
2105			}
2106			
2107			setTimeout ( function() {
2108				exp.crossfadeStep(size);
2109			}, t);				
2110		})();
2111	}
2112	setTimeout ( function () {
2113		exp.crossfadeEnd();
2114	}, t + 100);
2115
2116},
2117
2118crossfadeStep : function (size) {
2119	try {
2120		if (this.outline) this.outline.setPosition(this, { 
2121			x: size.xpos, 
2122			y: size.ypos, 
2123			w: size.xsize + size.xp1 + size.xp2, 
2124			h: size.ysize + size.yp1 + size.yp2
2125		}, 1);
2126		this.last.wrapper.style.clip = 'rect('
2127			+ (size.ypos - this.last.y.pos)+'px, '
2128			+ (size.xsize + size.xp1 + size.xp2 + size.xpos + 2 * this.last.x.cb - this.last.x.pos) +'px, '
2129			+ (size.ysize + size.yp1 + size.yp2 + size.ypos + 2 * this.last.y.cb - this.last.y.pos) +'px, '
2130			+ (size.xpos - this.last.x.pos)+'px)';
2131			
2132			
2133		hs.setStyles(this.content, {
2134			top: (size.yp1 + this.y.get('imgPad')) +'px',
2135			left: (size.xp1 + this.x.get('imgPad')) +'px',
2136			marginTop: (this.y.pos - size.ypos) +'px',
2137			marginLeft: (this.x.pos - size.xpos) +'px'
2138		});
2139		
2140		hs.setStyles(this.wrapper, {
2141			top: size.ypos +'px',
2142			left: size.xpos +'px',
2143			width: (size.xp1 + size.xp2 + size.xsize + 2 * this.x.cb)+ 'px',
2144			height: (size.yp1 + size.yp2 + size.ysize + 2 * this.y.cb) + 'px'
2145		});
2146		hs.setStyles(this.fadeBox, {
2147			width: (size.ximgSize || size.xsize) + 'px',
2148			height: (size.yimgSize || size.ysize) +'px',
2149			left: (size.xp1 + size.ximgPad)  +'px',
2150			top: (size.yp1 + size.yimgPad) +'px',
2151			visibility: 'visible'
2152		});
2153		
2154		hs.setStyles(this.oldImg, {
2155			top: (this.last.y.pos - size.ypos + this.last.y.p1 - size.yp1 +
2156				this.last.y.get('imgPad') - size.yimgPad)+'px',
2157			left: (this.last.x.pos - size.xpos + this.last.x.p1 - size.xp1 + 
2158				this.last.x.get('imgPad') - size.ximgPad)+'px'
2159		});		
2160		
2161		hs.setStyles(this.newImg, {
2162			opacity: size.o,
2163			top: (this.y.pos - size.ypos + this.y.p1 - size.yp1 + this.y.get('imgPad') - size.yimgPad) +'px',
2164			left: (this.x.pos - size.xpos + this.x.p1 - size.xp1 + this.x.get('imgPad') - size.ximgPad) +'px'
2165		});
2166		hs.setStyles(this.overlayBox, {
2167			width: size.xsize + 'px',
2168			height: size.ysize +'px',
2169			left: (size.xp1 + this.x.cb)  +'px',
2170			top: (size.yp1 + this.y.cb) +'px'
2171		});
2172	} catch (e) {}
2173},
2174crossfadeEnd : function() {
2175	this.wrapper.style.background = this.wrapperBG || '';
2176	
2177	this.wrapper.style.visibility = this.content.style.visibility = 'visible';
2178	this.fadeBox.style.display = 'none';
2179	this.a.className += ' highslide-active-anchor';
2180	this.afterExpand();
2181	this.last.afterClose();
2182},
2183reuseOverlay : function(o, el) {
2184	if (!this.last) return false;
2185	for (var i = 0; i < this.last.overlays.length; i++) {
2186		var oDiv = hs.$('hsId'+ this.last.overlays[i]);
2187		if (oDiv && oDiv.hsId == o.hsId) {
2188			this.genOverlayBox();
2189			oDiv.reuse = this.key;
2190			hs.push(this.overlays, this.last.overlays[i]);
2191			return true;
2192		}
2193	}
2194	return false;
2195},
2196
2197
2198afterExpand : function() {
2199	this.isExpanded = true;	
2200	this.focus();
2201	
2202	if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
2203	
2204	if (this.isHtml) {
2205		if (this.iframe) {
2206			try {
2207				var exp = this,
2208					doc = this.iframe.contentDocument || this.iframe.contentWindow.document;
2209				hs.addEventListener(doc, 'mousedown', function () {
2210					if (hs.focusKey != exp.key) exp.focus();
2211				});
2212			} catch(e) {}
2213			if (hs.ie && typeof this.isClosing != 'boolean') // first open 
2214				this.iframe.style.width = (this.objectWidth - 1) +'px'; // hasLayout
2215		}
2216	}
2217	
2218	if (this.dimmingOpacity) hs.dim(this);
2219	if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
2220	this.prepareNextOutline();
2221	
2222	
2223	var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
2224	this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
2225		&& this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');
2226	
2227	if (this.overlayBox) this.showOverlays();
2228	hs.fireEvent(this, 'onAfterExpand');
2229	
2230},
2231
2232
2233prepareNextOutline : function() {
2234	var key = this.key;
2235	var outlineType = this.outlineType;
2236	new hs.Outline(outlineType, 
2237		function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
2238},
2239
2240
2241preloadNext : function() {
2242	var next = this.getAdjacentAnchor(1);
2243	if (next && next.onclick.toString().match(/hs\.expand/)) 
2244		var img = hs.createElement('img', { src: hs.getSrc(next) });
2245},
2246
2247
2248getAdjacentAnchor : function(op) {
2249	var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
2250	
2251	/*< ? if ($cfg->slideshow) : ?>s*/
2252	if (!as[current + op] && this.slideshow && this.slideshow.repeat) {
2253		if (op == 1) return as[0];
2254		else if (op == -1) return as[as.length-1];
2255	}
2256	/*< ? endif ?>s*/
2257	return as[current + op] || null;
2258},
2259
2260getAnchorIndex : function() {
2261	var arr = hs.anchors.groups[this.slideshowGroup || 'none'];
2262	for (var i = 0; i < arr.length; i++) {
2263		if (arr[i] == this.a) return i; 
2264	}
2265	return null;
2266},
2267
2268
2269getNumber : function() {
2270	if (this[this.numberPosition]) {
2271		var arr = hs.anchors.groups[this.slideshowGroup || 'none'];
2272		var s = hs.lang.number.replace('%1', this.getAnchorIndex() + 1).replace('%2', arr.length);
2273		this[this.numberPosition].innerHTML = 
2274			'<div class="highslide-number">'+ s +'</div>'+ this[this.numberPosition].innerHTML;
2275	}
2276},
2277initSlideshow : function() {
2278	if (!this.last) {
2279		for (var i = 0; i < hs.slideshows.length; i++) {
2280			var ss = hs.slideshows[i], sg = ss.slideshowGroup;
2281			if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup) 
2282				this.slideshow = new hs.Slideshow(ss);
2283		} 
2284	} else {
2285		this.slideshow = this.last.slideshow;
2286	}
2287	var ss = this.slideshow;
2288	if (!ss) return;
2289	var exp = ss.exp = this;
2290	
2291	ss.checkFirstAndLast();
2292	ss.disable('full-expand');
2293	if (ss.controls) {
2294		var o = ss.overlayOptions || {};
2295		o.overlayId = ss.controls;
2296		o.hsId = 'controls';		
2297		this.createOverlay(o);
2298	}
2299	if (!this.last && this.autoplay) ss.play(true);
2300	if (ss.autoplay) {
2301		ss.autoplay = setTimeout(function() {
2302			hs.next(exp.key);
2303		}, (ss.interval || 500));
2304	}
2305},
2306
2307cancelLoading : function() {	
2308	hs.expanders[this.key] = null;
2309	if (hs.upcoming == this.a) hs.upcoming = null;
2310	hs.undim(this.key);
2311	if (this.loading) hs.loading.style.left = '-9999px';
2312	hs.fireEvent(this, 'onHideLoading');
2313},
2314
2315writeCredits : function () {
2316	if (this.credits) return;
2317	this.credits = hs.createElement('a', {
2318		href: hs.creditsHref,
2319		className: 'highslide-credits',
2320		innerHTML: hs.lang.creditsText,
2321		title: hs.lang.creditsTitle
2322	});
2323	this.createOverlay({ 
2324		overlayId: this.credits, 
2325		position: 'top left', 
2326		hsId: 'credits' 
2327	});
2328},
2329
2330getInline : function(types, addOverlay) {
2331	for (var i = 0; i < types.length; i++) {
2332		var type = types[i], s = null;
2333		if (type == 'caption' && !hs.fireEvent(this, 'onBeforeGetCaption')) return;
2334		else if (type == 'heading' && !hs.fireEvent(this, 'onBeforeGetHeading')) return;
2335		if (!this[type +'Id'] && this.thumbsUserSetId)  
2336			this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
2337		if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
2338		if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
2339			s = eval(this[type +'Eval']);
2340		} catch (e) {}
2341		if (!this[type] && this[type +'Text']) {
2342			s = this[type +'Text'];
2343		}
2344		if (!this[type] && !s) {
2345			var next = this.a.nextSibling;
2346			while (next && !hs.isHsAnchor(next)) {
2347				if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
2348					this[type] = next.cloneNode(1);
2349					break;
2350				}
2351				next = next.nextSibling;
2352			}
2353		}
2354		if (!this[type] && !s && this.numberPosition == type) s = '\n';
2355		
2356		if (!this[type] && s) this[type] = hs.createElement('div', 
2357				{ className: 'highslide-'+ type, innerHTML: s } );
2358		
2359		if (addOverlay && this[type]) {
2360			var o = { position: (type == 'heading') ? 'above' : 'below' };
2361			for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
2362			o.overlayId = this[type];
2363			this.createOverlay(o);
2364		}
2365	}
2366},
2367
2368
2369// on end move and resize
2370doShowHide : function(visibility) {
2371	if (hs.hideSelects) this.showHideElements('SELECT', visibility);
2372	if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
2373	if (hs.geckoMac) this.showHideElements('*', visibility);
2374},
2375showHideElements : function (tagName, visibility) {
2376	var els = document.getElementsByTagName(tagName);
2377	var prop = tagName == '*' ? 'overflow' : 'visibility';
2378	for (var i = 0; i < els.length; i++) {
2379		if (prop == 'visibility' || (document.defaultView.getComputedStyle(
2380				els[i], "").getPropertyValue('overflow') == 'auto'
2381				|| els[i].getAttribute('hidden-by') != null)) {
2382			var hiddenBy = els[i].getAttribute('hidden-by');
2383			if (visibility == 'visible' && hiddenBy) {
2384				hiddenBy = hiddenBy.replace('['+ this.key +']', '');
2385				els[i].setAttribute('hidden-by', hiddenBy);
2386				if (!hiddenBy) els[i].style[prop] = els[i].origProp;
2387			} else if (visibility == 'hidden') { // hide if behind
2388				var elPos = hs.getPosition(els[i]);
2389				elPos.w = els[i].offsetWidth;
2390				elPos.h = els[i].offsetHeight;
2391				if (!this.dimmingOpacity) { // hide all if dimming
2392				
2393					var clearsX = (elPos.x + elPos.w < this.x.get('opos') 
2394						|| elPos.x > this.x.get('opos') + this.x.get('osize'));
2395					var clearsY = (elPos.y + elPos.h < this.y.get('opos') 
2396						|| elPos.y > this.y.get('opos') + this.y.get('osize'));
2397				}
2398				var wrapperKey = hs.getWrapperKey(els[i]);
2399				if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
2400					if (!hiddenBy) {
2401						els[i].setAttribute('hidden-by', '['+ this.key +']');
2402						els[i].origProp = els[i].style[prop];
2403						els[i].style[prop] = 'hidden';
2404						
2405					} else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
2406						els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
2407					}
2408				} else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
2409						&& wrapperKey != this.key) { // on move
2410					els[i].setAttribute('hidden-by', '');
2411					els[i].style[prop] = els[i].origProp || '';
2412				} else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
2413					els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
2414				}
2415						
2416			}
2417		}
2418	}
2419},
2420
2421focus : function() {
2422	this.wrapper.style.zIndex = hs.zIndexCounter++;
2423	// blur others
2424	for (var i = 0; i < hs.expanders.length; i++) {
2425		if (hs.expanders[i] && i == hs.focusKey) {
2426			var blurExp = hs.expanders[i];
2427			blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
2428			if (blurExp.isImage) {
2429				blurExp.content.style.cursor = hs.ie ? 'hand' : 'pointer';
2430				blurExp.content.title = hs.lang.focusTitle;	
2431			}	
2432			hs.fireEvent(this, 'onBlur');
2433		}
2434	}
2435	
2436	// focus this
2437	if (this.outline) this.outline.table.style.zIndex 
2438		= this.wrapper.style.zIndex;
2439	this.content.className = 'highslide-'+ this.contentType;
2440	if (this.isImage) {
2441		this.content.title = hs.lang.restoreTitle;
2442		
2443		if (hs.restoreCursor) {
2444			hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
2445			if (hs.ie && hs.ieVersion() < 6) hs.styleRestoreCursor = 'hand';
2446			this.content.style.cursor = hs.styleRestoreCursor;
2447		}
2448	}
2449	hs.focusKey = this.key;	
2450	hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);	
2451	hs.fireEvent(this, 'onFocus');	
2452},
2453moveTo: function(x, y) {
2454	this.x.setPos(x);
2455	this.y.setPos(y);
2456},
2457resize : function (e) {
2458	var w, h, r = e.width / e.height;
2459	w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
2460	if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
2461	h = this.isHtml ? e.height + e.dY : w / r;
2462	if (h < Math.min(this.minHeight, this.y.full)) {
2463		h = Math.min(this.minHeight, this.y.full);
2464		if (this.isImage) w = h * r;
2465	}
2466	this.resizeTo(w, h);
2467},
2468resizeTo: function(w, h) {
2469	this.y.setSize(h);
2470	this.x.setSize(w);
2471},
2472
2473close : function() {
2474	if (this.isClosing || !this.isExpanded) return;
2475	if (this.transitions[1] == 'crossfade' && hs.upcoming) {
2476		hs.getExpander(hs.upcoming).cancelLoading();
2477		hs.upcoming = null;
2478	}
2479	if (!hs.fireEvent(this, 'onBeforeClose')) return;
2480	this.isClosing = true;
2481	if (this.slideshow && !hs.upcoming) this.slideshow.pause();
2482	
2483	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
2484	
2485	try {
2486		if (this.isHtml) this.htmlPrepareClose();
2487		this.content.style.cursor = 'default';
2488		this.changeSize(
2489			0, {
2490				xpos: this.x.pos,
2491				ypos: this.y.pos,
2492				xsize: this.x.size,
2493				ysize: this.y.size,
2494				xp1: this.x.p1,
2495				yp1: this.y.p1,
2496				xp2: this.x.p2,
2497				yp2: this.y.p2,
2498				ximgSize: this.x.imgSize,
2499				ximgPad: this.x.get('imgPad'),
2500				yimgSize: this.y.imgSize,
2501				yimgPad: this.y.get('imgPad'),
2502				o: this.outline ? this.outline.offset : 0
2503			}, {
2504				xpos: this.x.tpos - this.x.cb + this.x.tb,
2505				ypos: this.y.tpos - this.y.cb + this.y.tb,
2506				xsize: this.x.t,
2507				ysize: this.y.t,
2508				xp1: 0,
2509				yp1: 0,
2510				xp2: 0,
2511				yp2: 0,
2512				ximgSize: this.x.imgSize ? this.x.t : null,
2513				ximgPad: 0,
2514				yimgSize: this.y.imgSize ? this.y.t : null,
2515				yimgPad: 0,
2516				o: hs.outlineStartOffset
2517			},
2518			hs.restoreDuration
2519		);
2520		
2521	} catch (e) { this.afterClose(); } 
2522},
2523
2524htmlPrepareClose : function() {
2525	if (hs.geckoMac) { // bad redraws
2526		if (!hs.mask) hs.mask = hs.createElement('div', null, 
2527			{ position: 'absolute' }, hs.container);
2528		hs.setStyles(hs.mask, { width: this.x.size +'px', height: this.y.size +'px', 
2529			left: this.x.pos +'px', top: this.y.pos +'px', display: 'block' });			
2530	}
2531	if (this.objectType == 'swf') try { hs.$(this.body.id).StopPlay(); } catch (e) {}
2532	
2533	if (this.objectLoadTime == 'after' && !this.preserveContent) this.destroyObject();		
2534	if (this.scrollerDiv && this.scrollerDiv != this.scrollingContent) 
2535		this.scrollerDiv.style.overflow = 'hidden';
2536},
2537
2538destroyObject : function () {
2539	if (hs.ie && this.iframe)
2540		try { this.iframe.contentWindow.document.body.innerHTML = ''; } catch (e) {}
2541	if (this.objectType == 'swf') swfobject.removeSWF(this.body.id);
2542	this.body.innerHTML = '';
2543},
2544
2545sleep : function() {
2546	if (this.outline) this.outline.table.style.display = 'none';
2547	this.releaseMask = null;
2548	this.wrapper.style.display = 'none';
2549	hs.push(hs.sleeping, this);
2550},
2551
2552awake : function() {try {
2553	
2554	hs.expanders[this.key] = this;
2555	
2556	if (!hs.allowMultipleInstances &&hs.focusKey != this.key) {	
2557		try { hs.expanders[hs.focusKey].close(); } catch (e){}
2558	}
2559	
2560	var z = hs.zIndexCounter++, stl = { display: '', zIndex: z };
2561	hs.setStyles (this.wrapper, stl);
2562	this.isClosing = false;
2563	
2564	var o = this.outline || 0;
2565	if (o) {
2566		if (!this.outlineWhileAnimating) stl.visibility = 'hidden';
2567		hs.setStyles (o.table, stl);		
2568	}
2569	if (this.slideshow) {
2570		this.initSlideshow();
2571	}
2572		
2573	this.show();
2574} catch (e) {}
2575
2576
2577},
2578
2579createOverlay : function (o) {
2580	var el = o.overlayId;
2581	if (typeof el == 'string') el = hs.getNode(el);
2582	if (!el || typeof el == 'string') return;
2583	if (!hs.fireEvent(this, 'onCreateOverlay', { overlay: el })) return;
2584	el.style.display = 'block';
2585	o.hsId = o.hsId || o.overlayId; 
2586	if (this.transitions[1] == 'crossfade' && this.reuseOverlay(o, el)) return;
2587	this.genOverlayBox();
2588	var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
2589	if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
2590	
2591	var overlay = hs.createElement(
2592		'div', { 
2593			id: 'hsId'+ hs.idCounter++, hsId: o.hsId
2594		}, {
2595			position: 'absolute',
2596			visibility: 'hidden',
2597			width: width,
2598			direction: hs.lang.cssDirection || ''
2599		},
2600		this.overlayBox,
2601		true
2602	);
2603	
2604	overlay.appendChild(el);
2605	hs.setAttribs(overlay, {
2606		hideOnMouseOut: o.hideOnMouseOut,
2607		opacity: o.opacity || 1,
2608		hsPos: o.position,
2609		fade: o.fade
2610	});
2611	
2612	if (this.gotOverlays) {
2613		this.positionOverlay(overlay);
2614		if (!overlay.hideOnMouseOut || this.mouseIsOver) hs.fade(overlay, 0, overlay.opacity);
2615	}
2616	hs.push(this.overlays, hs.idCounter - 1);
2617},
2618positionOverlay : function(overlay) {
2619	var p = overlay.hsPos || 'middle center';
2620	if (/left$/.test(p)) overlay.style.left = 0; 
2621	if (/center$/.test(p))	hs.setStyles (overlay, { 
2622		left: '50%',
2623		marginLeft: '-'+ Math.round(overlay.offsetWidth / 2) +'px'
2624	});	
2625	if (/right$/.test(p))	overlay.style.right = 0;
2626	
2627	if (/^leftpanel$/.test(p)) { 
2628		hs.setStyles(overlay, {
2629			right: '100%',
2630			marginRight: this.x.cb +'px',
2631			top: - this.y.cb +'px',
2632			bottom: - this.y.cb +'px',
2633			overflow: 'auto'
2634		});		 
2635		this.x.p1 = overlay.offsetWidth;
2636	
2637	} else if (/^rightpanel$/.test(p)) {
2638		hs.setStyles(overlay, {
2639			left: '100%',
2640			marginLeft: this.x.cb +'px',
2641			top: - this.y.cb +'px',
2642			bottom: - this.y.cb +'px',
2643			overflow: 'auto'
2644		});
2645		this.x.p2 = overlay.offsetWidth;
2646	}
2647	if (/^top/.test(p)) overlay.style.top = 0; 
2648	if (/^middle/.test(p))	hs.setStyles (overlay, { 
2649		top: '50%', 
2650		marginTop: '-'+ Math.round(overlay.offsetHeight / 2) +'px'
2651	});	
2652	if (/^bottom/.test(p)) overlay.style.bottom = 0;
2653	if (/^above$/.test(p)) {
2654		hs.setStyles(overlay, {
2655			left: (- this.x.p1 - this.x.cb) +'px',
2656			right: (- this.x.p2 - this.x.cb) +'px',
2657			bottom: '100%',
2658			marginBottom: this.y.cb +'px',
2659			width: 'auto'
2660		});
2661		this.y.p1 = overlay.offsetHeight;
2662	
2663	} else if (/^below$/.test(p)) {
2664		hs.setStyles(overlay, {
2665			position: 'relative',
2666			left: (- this.x.p1 - this.x.cb) +'px',
2667			right: (- this.x.p2 - this.x.cb) +'px',
2668			top: '100%',
2669			marginTop: this.y.cb +'px',
2670			width: 'auto'
2671		});
2672		this.y.p2 = overlay.offsetHeight;
2673		overlay.style.position = 'absolute';
2674	}
2675},
2676
2677getOverlays : function() {	
2678	this.getInline(['heading', 'caption'], true);
2679	this.getNumber();
2680	if (this.caption) hs.fireEvent(this, 'onAfterGetCaption');
2681	if (this.heading) hs.fireEvent(this, 'onAfterGetHeading');
2682	if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
2683	if (hs.showCredits) this.writeCredits();
2684	for (var i = 0; i < hs.overlays.length; i++) {
2685		var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
2686		if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
2687				|| (sg && sg === this.slideshowGroup)) {
2688			if (this.isImage || (this.isHtml && o.useOnHtml))
2689			this.createOverlay(o);
2690		}
2691	}
2692	var os = [];
2693	for (var i = 0; i < this.overlays.length; i++) {
2694		var o = hs.$('hsId'+ this.overlays[i]);
2695		if (/panel$/.test(o.hsPos)) this.positionOverlay(o);
2696		else hs.push(os, o);
2697	}
2698	for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
2699	this.gotOverlays = true;
2700},
2701genOverlayBox : function() {
2702	if (!this.overlayBox) this.overlayBox = hs.createElement (
2703		'div', {
2704			className: this.wrapperClassName
2705		}, {
2706			position : 'absolute',
2707			width: this.x.size ? this.x.size +'px' : this.x.full +'px',
2708			height: 0,
2709			visibility : 'hidden',
2710			overflow : 'hidden',
2711			zIndex : hs.ie ? 4 : null
2712		},
2713		hs.container,
2714		true
2715	);
2716},
2717sizeOverlayBox : function(doWrapper, doPanels) {
2718	hs.setStyles( this.overlayBox, {
2719		width: this.x.size +'px', 
2720		height: this.y.size +'px'
2721	});
2722	if (doWrapper || doPanels) {
2723		for (var i = 0; i < this.overlays.length; i++) {
2724			var o = hs.$('hsId'+ this.overlays[i]);
2725			var ie6 = (hs.ie && (hs.ieVersion() <= 6 || document.compatMode == 'BackCompat'));
2726			if (o && /^(above|below)$/.test(o.hsPos)) {
2727				if (ie6) {
2728					o.style.width = (this.overlayBox.offsetWidth + 2 * this.x.cb
2729						+ this.x.p1 + this.x.p2) +'px';
2730				}
2731				this.y[o.hsPos == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
2732			}
2733			if (o && ie6 && /^(left|right)panel$/.test(o.hsPos)) {
2734				o.style.height = (this.overlayBox.offsetHeight + 2 * this.y.cb
2735						+ this.y.p1 + this.y.p2) +'px';
2736			}
2737		}
2738	}
2739	if (doWrapper) {
2740		hs.setStyles(this.content, {
2741			top: this.y.p1 +'px'
2742		});
2743		hs.setStyles(this.overlayBox, {
2744			top: (this.y.p1 + this.y.cb) +'px'
2745		});
2746	}
2747},
2748
2749showOverlays : function() {
2750	var b = this.overlayBox;
2751	b.className = '';
2752	hs.setStyles(b, {
2753		top: (this.y.p1 + this.y.cb) +'px',
2754		left: (this.x.p1 + this.x.cb) +'px',
2755		overflow : 'visible'
2756	});
2757	if (hs.safari) b.style.visibility = 'visible';
2758	this.wrapper.appendChild (b);
2759	for (var i = 0; i < this.overlays.length; i++) {
2760		var o = hs.$('hsId'+ this.overlays[i]);
2761		o.style.zIndex = o.hsId == 'controls' ? 5 : 4;
2762		if (!o.hideOnMouseOut || this.mouseIsOver) hs.fade(o, 0, o.opacity);
2763	}
2764},
2765
2766
2767
2768createFullExpand : function () {
2769	if (this.slideshow && this.slideshow.controls) {
2770		this.slideshow.enable('full-expand');
2771		return;
2772	}
2773	this.fullExpandLabel = hs.createElement(
2774		'a', {
2775			href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
2776			title: hs.lang.fullExpandTitle,
2777			className: 'highslide-full-expand'
2778		}
2779	);
2780	if (!hs.fireEvent(this, 'onCreateFullExpand')) return;
2781	
2782	this.createOverlay({ 
2783		overlayId: this.fullExpandLabel, 
2784		position: hs.fullExpandPosition, 
2785		hideOnMouseOut: true, 
2786		opacity: hs.fullExpandOpacity
2787	});
2788},
2789
2790doFullExpand : function () {
2791	try {
2792		if (!hs.fireEvent(this, 'onDoFullExpand')) return;
2793		if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);
2794		
2795		this.focus();
2796		var xSize = this.x.size;
2797		this.resizeTo(this.x.full, this.y.full);
2798		
2799		var xpos = this.x.pos - (this.x.size - xSize) / 2;
2800		if (xpos < hs.marginLeft) xpos = hs.marginLeft;
2801		
2802		this.moveTo(xpos, this.y.pos);
2803		this.doShowHide('hidden');
2804		hs.setDimmerSize(this);
2805	
2806	} catch (e) {
2807		window.location.href = this.content.src;
2808	}
2809},
2810
2811
2812afterClose : function () {
2813	this.a.className = this.a.className.replace('highslide-active-anchor', '');
2814	
2815	this.doShowHide('visible');	
2816	
2817	if (this.isHtml && this.preserveContent
2818			 && this.transitions[1] != 'crossfade') {
2819		this.sleep();
2820	} else {
2821		if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
2822	
2823		hs.discardElement(this.wrapper);
2824	}
2825	if (hs.mask) hs.mask.style.display = 'none';
2826	if (this.dimmingOpacity) hs.undim(this.key);
2827	hs.fireEvent(this, 'onAfterClose');
2828	hs.expanders[this.key] = null;		
2829	hs.reOrder();
2830}
2831
2832};
2833
2834
2835// hs.Ajax object prototype
2836hs.Ajax = function (a, content, pre) {
2837	this.a = a;
2838	this.content = content;
2839	this.pre = pre;
2840};
2841
2842hs.Ajax.prototype = {
2843run : function () {
2844	if (!this.src) this.src = hs.getSrc(this.a);
2845	if (this.src.match('#')) {
2846		var arr = this.src.split('#');
2847		this.src = arr[0];
2848		this.id = arr[1];
2849	}
2850	if (hs.cachedGets[this.src]) {
2851		this.cachedGet = hs.cachedGets[this.src];
2852		if (this.id) this.getElementContent();
2853		else this.loadHTML();
2854		return;
2855	}
2856	try { this.xmlHttp = new XMLHttpRequest(); }
2857	catch (e) {
2858		try { this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
2859		catch (e) {
2860			try { this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
2861			catch (e) { this.onError(); }
2862		}
2863	}
2864	var pThis = this; 
2865	this.xmlHttp.onreadystatechange = function() {
2866		if(pThis.xmlHttp.readyState == 4) {
2867			if (pThis.id) pThis.getElementContent();
2868			else pThis.loadHTML();
2869		}
2870	};
2871	this.xmlHttp.open("GET", this.src, true);
2872	this.xmlHttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
2873	this.xmlHttp.send(null);
2874},
2875
2876getElementContent : function() {
2877	hs.init();
2878	var attribs = window.opera || hs.ie6SSL ? { src: 'about:blank' } : null;
2879	
2880	this.iframe = hs.createElement('iframe', attribs, 
2881		{ position: 'absolute', top: '-9999px' }, hs.container);
2882		
2883	this.loadHTML();
2884},
2885
2886loadHTML : function() {
2887	var s = this.cachedGet || this.xmlHttp.responseText;
2888	if (this.pre) hs.cachedGets[this.src] = s;
2889	if (!hs.ie || hs.ieVersion() >= 5.5) {
2890		s = s.replace(/\s/g, ' ').replace(
2891			new RegExp('<link[^>]*>', 'gi'), '').replace(
2892			new RegExp('<script[^>]*>.*?</script>', 'gi'), '');
2893
2894		if (this.iframe) {
2895			var doc = this.iframe.contentDocument;
2896			if (!doc && this.iframe.contentWindow) doc = this.iframe.contentWindow.document;
2897			if (!doc) { // Opera
2898				var pThis = this;
2899				setTimeout(function() {	pThis.loadHTML(); }, 25);
2900				return;
2901			}
2902			doc.open();
2903			doc.write(s);
2904			doc.close();
2905			try { s = doc.getElementById(this.id).innerHTML; } catch (e) {
2906				try { s = this.iframe.document.getElementById(this.id).innerHTML; } catch (e) {} // opera
2907			}
2908		} else {
2909			s = s.replace(new RegExp('^.*?<body[^>]*>(.*?)</body>.*?$', 'i'), '$1');
2910		}
2911	}
2912	hs.getElementByClass(this.content, 'DIV', 'highslide-body').innerHTML = s;
2913	this.onLoad();
2914	for (var x in this) this[x] = null;
2915}
2916};
2917
2918
2919hs.Slideshow = function (options) {
2920	if (hs.dynamicallyUpdateAnchors !== false) hs.updateAnchors();
2921	for (var x in options) this[x] = options[x];
2922	if (this.useControls) this.getControls();
2923};
2924hs.Slideshow.prototype = {
2925getControls: function() {
2926	this.controls = hs.createElement('div', { innerHTML: hs.replaceLang(hs.skin.controls) }, 
2927		null, hs.container);
2928	
2929	var buttons = ['play', 'pause', 'previous', 'next', 'move', 'full-expand', 'close'];
2930	this.btn = {};
2931	var pThis = this;
2932	for (var i = 0; i < buttons.length; i++) {
2933		this.btn[buttons[i]] = hs.getElementByClass(this.controls, 'li', 'highslide-'+ buttons[i]);
2934		this.enable(buttons[i]);
2935	}
2936	this.btn.pause.style.display = 'none';
2937	//this.disable('full-expand');
2938},
2939checkFirstAndLast: function() {
2940	if (this.repeat || !this.controls) return;
2941	var cur = this.exp.getAnchorIndex(), re = /disabled$/;
2942	if (cur == 0) 
2943		this.disable('previous');
2944	else if (re.test(this.btn.previous.getElementsByTagName('a')[0].className))
2945		this.enable('previous');
2946	if (cur + 1 == hs.anchors.groups[this.exp.slideshowGroup || 'none'].length) {
2947		this.disable('next');
2948		this.disable('play');
2949	} else if (re.test(this.btn.next.getElementsByTagName('a')[0].className)) {
2950		this.enable('next');
2951		this.enable('play');
2952	}
2953},
2954enable: function(btn) {
2955	if (!this.btn) return;
2956	var sls = this, a = this.btn[btn].getElementsByTagName('a')[0], re = /disabled$/;
2957	a.onclick = function() {
2958		sls[btn]();
2959		return false;
2960	};
2961	if (re.test(a.className)) a.className = a.className.replace(re, '');
2962},
2963disable: function(btn) {
2964	if (!this.btn) return;
2965	var a = this.btn[btn].getElementsByTagName('a')[0];
2966	a.onclick = function() { return false; };
2967	if (!/disabled$/.test(a.className)) a.className += ' disabled';
2968},
2969hitSpace: function() {
2970	if (this.autoplay) this.pause();
2971	else this.play();
2972},
2973play: function(wait) {
2974	if (this.btn) {
2975		this.btn.play.style.display = 'none';
2976		this.btn.pause.style.display = '';
2977	}
2978	
2979	this.autoplay = true;	
2980	if (!wait) hs.next(this.exp.key);
2981},
2982pause: function() {
2983	if (this.btn) {
2984		this.btn.pause.style.display = 'none';
2985		this.btn.play.style.display = '';
2986	}
2987	
2988	clearTimeout(this.autoplay);
2989	this.autoplay = null;
2990},
2991previous: function() {
2992	this.pause();
2993	hs.previous(this.btn.previous);
2994},
2995next: function() {
2996	this.pause();
2997	hs.next(this.btn.next);
2998},
2999move: function() {},
3000'full-expand': function() {
3001	hs.getExpander().doFullExpand();
3002},
3003close: function() {
3004	hs.close(this.btn.close);
3005}
3006
3007};
3008if (document.readyState && hs.ie) {
3009	(function () {
3010		try {
3011			document.documentElement.doScroll('left');
3012		} catch (e) {
3013			setTimeout(arguments.callee, 50);
3014			return;
3015		}
3016		hs.domReady();
3017	})();
3018}
3019hs.langDefaults = hs.lang;
3020// history
3021var HsExpander = hs.Expander;
3022
3023// set handlers
3024hs.addEventListener(window, 'load', function() {
3025	if (hs.expandCursor) {
3026		var sel = '.highslide img', 
3027			dec = 'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;';
3028			
3029		var style = hs.createElement('style', { type: 'text/css' }, null, 
3030			document.getElementsByTagName('HEAD')[0]);
3031	
3032		if (!hs.ie) {
3033			style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
3034		} else {
3035			var last = document.styleSheets[document.styleSheets.length - 1];
3036			if (typeof(last.addRule) == "object") last.addRule(sel, dec);
3037		}
3038	}
3039});
3040hs.addEventListener(document, 'mousemove', function(e) {
3041	hs.mouse = { x: e.clientX, y: e.clientY	};
3042});
3043hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
3044hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
3045hs.addEventListener(window, 'load', hs.preloadImages);
3046hs.addEventListener(window, 'load', hs.preloadAjax);
3047hs.addEventListener(window, 'load', function() { hs.pageLoaded = true; });
3048hs.setClickEvents();

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.