/******************************************************************************
Name:    Highslide JS
Version: 3.3.12 (Feb 29 2008)
Config:  default -captions -overlays -navigation -preloading -multiple -hideelements +unobtrusive +iframe +packed
Author:  Torstein Hønsi
Support: http://vikjavev.no/highslide/forum

Licence:
Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
License (http://creativecommons.org/licenses/by-nc/2.5/).

You are free:
	* to copy, distribute, display, and perform the work
	* to make derivative works

Under the following conditions:
	* Attribution. You must attribute the work in the manner  specified by  the
	  author or licensor.
	* Noncommercial. You may not use this work for commercial purposes.

* For  any  reuse  or  distribution, you  must make clear to others the license
  terms of this work.
* Any  of  these  conditions  can  be  waived  if  you  get permission from the 
  copyright holder.

Your fair use and other rights are in no way affected by the above.
******************************************************************************/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('m j={3Q:\'L/6p/\',5W:\'6o.6n\',5y:10,4t:5B,4N:10,4K:5B,4a:15,43:15,3p:15,2A:15,31:6q,3R:\'4z Q 1y 1v, 6r 6u 6t Q 26\',4P:\'6s...\',4Z:\'4z Q 6m\',4I:0.75,1X:2,3V:3,4Y:\'6l\',5f:\'6f\',4H:\'6e\',4E:\'6d\',4D:\'4z Q 1y\',4G:\'6g\',3B:11,3U:J,2U:J,1Z:\'33\',5Z:H,1M:5n,29:5n,3t:J,1a:\'6h-6k\',3y:\'L-W\',N:[],4b:[\'3t\',\'1a\',\'1X\',\'5T\',\'G\',\'F\',\'3B\',\'3U\',\'2U\',\'22\',\'2u\',\'35\',\'1Z\',\'3y\',\'1M\',\'29\',\'5Z\',\'2E\',\'5x\',\'5z\'],2V:{},2v:[],4i:{},14:(Z.6j&&!2e.3P),2D:/6i/.1W(3m.63),4M:/6v.+6w:1\\.[0-8].+6J/.1W(3m.63),$:r(1c){E Z.6I(1c)},53:r(2P,5g){2P[2P.1x]=5g},S:r(3s,2Q,27,2S,5V){m q=Z.S(3s);k(2Q)j.5K(q,2Q);k(5V)j.Y(q,{5R:0,5r:\'1F\',6H:0});k(27)j.Y(q,27);k(2S)2S.1w(q);E q},5K:r(q,2Q){1g(m x 4r 2Q)q[x]=2Q[x]},Y:r(q,27){1g(m x 4r 27){1d{k(j.14&&x==\'2T\')q.u.58=(27[x]==1)?\'\':\'6K(2T=\'+(27[x]*2H)+\')\';X q.u[x]=27[x]}1e(e){}}},3G:r(){m 2P=3m.6N.6M("6G");E 2P[1]?6c(2P[1]):H},4d:r(){m 39=Z.5o&&Z.5o!="6F"?Z.4B:Z.V;m G=j.14?39.4F:(Z.4B.4F||55.6z),F=j.14?39.6y:55.6x;E{G:G,F:F,3n:j.14?39.3n:6A,3q:j.14?39.3q:6B}},16:r(q){m p={x:q.4J,y:q.3Y};3i(q.4Q){q=q.4Q;p.x+=q.4J;p.y+=q.3Y;k(q!=Z.V&&q!=Z.4B){p.x-=q.3n;p.y-=q.3q}}E p},61:r(a,1m,2r){k(a.2I)E 1m;1d{3H j.36(a,1m,2r);E 11}1e(e){E J}},4U:r(a,1m,2r){k(a.2I)E 1m;1g(m i=0;i<j.2v.1x;i++){k(j.2v[i]&&j.2v[i].a==a){j.2v[i].59();j.2v[i]=H;E 11}}1d{j.6E=J;3H j.36(a,1m,2r,\'2x\');E 11}1e(e){E J}},3z:r(q,4l,R){m 1p=q.4f(4l);1g(m i=0;i<1p.1x;i++){k(1p[i].R==R){E 1p[i]}}E H},5O:r(){m s=\'<U 2i="L-6D"><4O>\'+\'<23 2i="L-4W"><a 1L="E j.4W(f)" 25="#">\'+j.4Y+\'</a></23>\'+\'<23 2i="L-5d"><a 1L="E j.5d(f)" 25="#">\'+j.5f+\'</a></23>\'+\'<23 2i="L-26"><a 25="#" 1L="E 11">\'+j.4H+\'</a></23>\'+\'<23 2i="L-1y"><a 1L="E j.1y(f)" 3a="\'+j.4D+\'" 25="#">\'+j.4E+\'</a></23>\'+\'</4O></U>\'+\'<U 2i="L-V"></U>\'+\'<U 2i="L-6C"><U>\'+\'<B 2i="L-2p" 3a="\'+j.4G+\'"><B></B></B>\'+\'</U></U>\';E j.S(\'U\',{R:\'L-2x-K\',3f:s})},4j:r(){m 1p=Z.4f(\'A\');1g(m i=0;i<1p.1x;i++){k(/^L$/.1W(1p[i].3j)){1p[i].1L=r(){E j.61(f)};1p[i].4T(\'3j\')}m 2c=/^L-(69|M)$/.6b(1p[i].3j);k(2c){(r(){m t=2c[1];1p[i].1L=r(){E j.4U(f,{22:t})}})();1p[i].4T(\'3j\')}}k(!j.5I)2l(j.4j,50)},65:r(a,34){a.2I=a.1L;m p=a.2I?a.2I():H;a.2I=H;E(p&&1E p[34]!=\'2R\')?p[34]:(1E j[34]!=\'2R\'?j[34]:H)},2Y:r(a){m 1k=j.65(a,\'1k\');k(1k)E 1k;E a.25},5S:r(1c){m 13=j.$(1c),2k=j.4i[1c],a={};k(!13&&!2k)E H;k(!2k){2k=13.4c(J);2k.1c=\'\';j.4i[1c]=2k;E 13}X{E 2k.4c(J)}},3J:r(d){k(!j.14)E;m a=d.6a,i,l,n;k(a){l=a.1x;1g(m i=0;i<l;i+=1){n=a[i].2d;k(1E d[n]===\'r\'){d[n]=H}}}a=d.5C;k(a){l=a.1x;1g(m i=0;i<l;i+=1){j.3J(d.5C[i])}}},5w:r(4k){m q,4y=/^L-W-([0-9]+)$/;q=4k;3i(q.1I){k(q.1c&&4y.1W(q.1c))E q.1c.3D(4y,"$1");q=q.1I}q=4k;3i(q.1I){k(q.4l&&j.5Q(q)){1g(m P=0;P<j.N.1x;P++){m C=j.N[P];k(C&&C.a==q)E P}}q=q.1I}E H},4u:r(q){k(1E q==\'2R\')E j.N[j.1U]||H;k(1E q==\'67\')E j.N[q]||H;k(1E q==\'68\')q=j.$(q);E j.N[j.5w(q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,21);q.7u(\'2W\'+1B,21)}1e(e){q[\'2W\'+1B]=21}}},4g:r(q,1B,21){1d{q.4g(1B,21,11)}1e(e){1d{q.57(\'2W\'+1B,21)}1e(e){q[\'2W\'+1B]=H}}},40:r(){k(!j.1H){j.1H=j.S(\'U\',H,{16:\'1S\',12:0,1i:0,G:\'2H%\',1C:j.31},Z.V,J);j.1f=j.S(\'a\',{R:\'L-1f\',3a:j.4Z,3f:j.4P,25:\'7K:7y(0)\'},{16:\'1S\',2T:j.4I,12:\'-37\',1C:1},j.1H);j.1K=j.S(\'U\',H,{5G:\'5p\',7w:\'7s\'},H,J);1O.7t=r(t,b,c,d){E c*t/d+b};1O.5a=r(t,b,c,d){E c*(t/=d)*t+b}}},1y:r(q){1d{j.4u(q).1y()}1e(e){}E 11}};j.3K=r(1a,2y){f.2y=2y;f.1a=1a;m v=j.3G(),3v;f.3M=j.14&&v>=5.5&&v<7;k(!1a){k(2y)2y();E}j.40();f.19=j.S(\'19\',{7J:0},{1n:\'1s\',16:\'1S\',7M:\'7I\'},j.1H,J);f.4w=j.S(\'4w\',H,H,f.19,1);f.1h=[];1g(m i=0;i<=8;i++){k(i%3==0)3v=j.S(\'3v\',H,{F:\'1A\'},f.4w,J);f.1h[i]=j.S(\'1h\',H,H,3v,J);m u=i!=4?{6P:0,7E:0}:{16:\'2q\'};j.Y(f.1h[i],u)}f.1h[4].R=1a;f.5c()};j.3K.4R={5c:r(){m 1k=j.3Q+(j.7F||"7G/")+f.1a+".7q";m 51=j.2D?j.1H:H;f.2g=j.S(\'1b\',H,{16:\'1S\',12:\'-37\',1i:\'-37\'},51,J);m 52=f;f.2g.2F=r(){52.4X()};f.2g.1k=1k},4X:r(){m o=f.1J=f.2g.G/4,1T=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],3h={F:(2*o)+\'D\',G:(2*o)+\'D\'};1g(m i=0;i<=8;i++){k(1T[i]){k(f.3M){m w=(i==1||i==7)?\'2H%\':f.2g.G+\'D\';m U=j.S(\'U\',H,{G:\'2H%\',F:\'2H%\',16:\'2q\',2M:\'1s\'},f.1h[i],J);j.S(\'U\',H,{58:"72:71.70.73(74=77, 1k=\'"+f.2g.1k+"\')",16:\'1S\',G:w,F:f.2g.F+\'D\',12:(1T[i][0]*o)+\'D\',1i:(1T[i][1]*o)+\'D\'},U,J)}X{j.Y(f.1h[i],{5e:\'5Y(\'+f.2g.1k+\') \'+(1T[i][0]*o)+\'D \'+(1T[i][1]*o)+\'D\'})}k(2e.3P&&(i==3||i==5))j.S(\'U\',H,3h,f.1h[i],J);j.Y(f.1h[i],3h)}}j.2V[f.1a]=f;k(f.2y)f.2y()},2J:r(C,x,y,w,h,54){k(54)f.19.u.1n=(h>=4*f.1J)?\'30\':\'1s\';f.19.u.12=(x-f.1J)+\'D\';f.19.u.1i=(y-f.1J)+\'D\';f.19.u.G=(w+2*(C.1R+f.1J))+\'D\';w+=2*(C.1R-f.1J);h+=+2*(C.2w-f.1J);f.1h[4].u.G=w>=0?w+\'D\':0;f.1h[4].u.F=h>=0?h+\'D\':0;k(f.3M)f.1h[3].u.F=f.1h[5].u.F=f.1h[4].u.F},45:r(56){k(56)f.19.u.1n=\'1s\';X{j.3J(f.19);1d{f.19.1I.3g(f.19)}1e(e){}}}};j.36=r(a,1m,2r,2f){f.a=a;f.2r=2r;f.2f=2f||\'1v\';f.1Y=(2f==\'2x\');f.3F=!f.1Y;j.40();m P=f.P=j.N.1x;1g(m i=0;i<j.4b.1x;i++){m 2d=j.4b[i];f[2d]=1m&&1E 1m[2d]!=\'2R\'?1m[2d]:j[2d]}m q=f.3x=((1m&&1m.4V)?j.$(1m.4V):H)||a.4f(\'1b\')[0]||a;f.7r=q.1c||a.1c;1g(m i=0;i<j.N.1x;i++){k(j.N[i]&&j.N[i].a==a){j.N[i].2G();E 11}}1g(m i=0;i<j.N.1x;i++){k(j.N[i]&&j.N[i].3x!=q&&!j.N[i].3u){j.N[i].3S()}}j.N[f.P]=f;k(j.N[P-1])j.N[P-1].1y();k(1E j.1U!=\'2R\'&&j.N[j.1U])j.N[j.1U].1y();m 1T=j.16(q);f.1t=q.G?q.G:q.1j;f.1G=q.F?q.F:q.18;f.24=1T.x;f.2j=1T.y;f.2O=(f.3x.1j-f.1t)/2;f.32=(f.3x.18-f.1G)/2;f.W=j.S(\'U\',{1c:\'L-W-\'+f.P,R:f.3y},{1n:\'1s\',16:\'1S\',1C:j.31++},H,J);k(f.2f==\'1v\'&&f.1X==2)f.1X=0;k(j.2V[f.1a]){f.44();f[f.2f+\'41\']()}X k(!f.1a){f[f.2f+\'41\']()}X{f.3r();m C=f;3H j.3K(f.1a,r(){C.44();C[C.2f+\'41\']()})}E J};j.36.4R={44:r(x,y){m w=j.2V[f.1a];f.T=w;w.19.u.1C=f.W.u.1C;j.2V[f.1a]=H},3r:r(){k(f.3u||f.1f)E;f.3W=f.a.u.1Q;f.a.u.1Q=\'6Z\';f.1f=j.1f;m C=f;f.1f.1L=r(){C.3S()};f.1f.u.1i=(f.2j+(f.1G-f.1f.18)/2)+\'D\';m C=f,12=(f.24+f.2O+(f.1t-f.1f.1j)/2)+\'D\';2l(r(){k(C.1f)C.1f.u.12=12},2H)},6Y:r(){m C=f;m 1b=Z.S(\'1b\');f.K=1b;1b.2F=r(){k(j.N[C.P])C.3c()};k(j.6S)1b.6R=r(){E 11};1b.R=\'L-1v\';1b.u.1n=\'1s\';1b.u.1D=\'49\';1b.u.16=\'1S\';1b.u.5t=\'1F\';1b.u.1C=3;1b.3a=j.3R;k(j.2D)j.1H.1w(1b);k(j.14&&j.6Q)1b.1k=H;1b.1k=j.2Y(f.a);f.3r()},6T:r(){f.4p=j.S(\'U\',{R:f.3y},{5R:\'0 \'+j.43+\'D 0 \'+j.4a+\'D\',1n:\'1s\'},j.1H);f.K=j.5S(f.5T);k(!f.K)f.K=j.5O();f.O=f.K;k(f.3A||f.22==\'M\')f.3T(f.O);f.4p.1w(f.O);j.Y(f.O,{16:\'2q\',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I,f.x.B,f.y.B)},1y:r(){k(f.2Z||!f.4h)E;f.2Z=J;1d{k(f.1Y)f.4S();f.K.u.1Q=\'6W\';f.42(0,{x:f.x.I,y:f.y.I,w:f.x.B,h:1r(f.K.u.F),2z:f.x.5N,o:f.T?f.T.1J:0},{x:f.24-f.1R+f.2O,y:f.2j-f.2w+f.32,w:f.1t,h:f.1G,2z:f.1t,o:j.3V},j.4K,j.4N)}1e(e){f.3X()}},4S:r(){k(j.4M){k(!j.3b)j.3b=j.S(\'U\',H,{16:\'1S\'},j.1H);j.Y(j.3b,{G:f.x.B+\'D\',F:f.y.B+\'D\',12:f.x.I+\'D\',1i:f.y.I+\'D\',1D:\'49\'})}k(f.1Z==\'4e\'&&!f.2U)f.5b();k(f.1l&&f.1l!=f.2L)f.1l.u.2M=\'1s\'},5b:r(){k(j.14&&f.M)1d{f.M.3N.Z.V.3f=\'\'}1e(e){}f.V.3f=\'\'},60:r(){k(f.T)f.T.19.R=\'L-1D-1F\';f.1V=H;f.W.R+=\' L-1D-1F\';j.53(j.2v,f)},59:r(){j.N[f.P]=f;k(j.1U!=f.P){1d{j.N[j.1U].1y()}1e(e){}}f.W.R=f.W.R.3D(/L-1D-1F/,\'\');m z=j.31++;f.W.u.1C=z;f.2Z=11;m o=f.T||0;k(o){k(!f.1X)o.19.u.1n=\'1s\';o.19.R=H;o.19.u.1C=z}f.48()},3X:r(){f.a.R=f.a.R.3D(\'L-5l-5u\',\'\');k(f.1Y&&f.2U)f.60();X{k(f.T&&f.1X)f.T.45();j.3J(f.W);k(j.14&&j.3G()<5.5)f.W.3f=\'\';X f.W.1I.3g(f.W)}k(j.3b)j.3b.u.1D=\'1F\';j.N[f.P]=H}};m 6O=j.36;j.2m(Z,\'4v\',j.46);j.2m(Z,\'4L\',j.46);j.2m(2e,\'6L\',r(){j.5I=J});j.4j();',62,483,'|||||||||||||||this||||hs|if||var||||el|function|||style|||||||span|exp|px|return|height|width|null|min|true|content|highslide|iframe|expanders|innerContent|key|to|className|createElement|objOutline|div|body|wrapper|else|setStyles|document||false|left|node|ie||position||offsetHeight|table|outlineType|img|id|try|catch|loading|for|td|top|offsetWidth|src|scrollerDiv|params|visibility|newWidth|els|newHeight|parseInt|hidden|thumbWidth|marginMin|image|appendChild|length|close|dragArgs|auto|event|zIndex|display|typeof|none|thumbHeight|container|parentNode|offset|clearing|onclick|minWidth|minSpan|Math|wDiff|cursor|offsetBorderW|absolute|pos|focusKey|releaseMask|test|outlineWhileAnimating|isHtml|objectLoadTime|from|func|objectType|li|thumbLeft|href|move|styles|up|minHeight|type|hDiff|match|name|window|contentType|graphic|ratio|class|thumbTop|clone|setTimeout|addEventListener|clientSpan|marginMax|resize|relative|custom|doc|scroll|objectWidth|sleeping|offsetBorderH|html|onLoad|imgW|marginBottom|allowReduce|cNode|safari|easing|onload|focus|100|getParams|setPosition|justify|scrollingContent|overflow|size|thumbOffsetBorderW|arr|attribs|undefined|parent|opacity|preserveContent|pendingOutlines|on|styleRestoreCursor|getSrc|isClosing|visible|zIndexCounter|thumbOffsetBorderH|before|param|objectHeight|Expander|9999px|mediumContent|iebody|title|mask|contentLoaded|page|hasDragged|innerHTML|removeChild|dim|while|rel|changed|target|navigator|scrollLeft|ruler|marginTop|scrollTop|displayLoading|tag|allowSizeReduction|onLoadStarted|tr|kdeBugCorr|thumb|wrapperClassName|getElementByClass|swfObject|allowWidthReduction|currentStyle|replace|dX|isImage|ieVersion|new|op|purge|Outline|dY|hasAlphaImageLoader|contentWindow|dragHandler|opera|graphicsDir|restoreTitle|cancelLoading|setObjContainerSize|allowHeightReduction|outlineStartOffset|originalCursor|afterClose|offsetTop|htmlGetSize|genContainer|Create|changeSize|marginRight|connectOutline|destroy|mouseClickHandler|distance|show|block|marginLeft|overrides|cloneNode|getPageSize|after|getElementsByTagName|removeEventListener|isExpanded|clones|setClickEvents|element|tagName|hasMovedMin|thumbSpan|correctIframeSize|tempContainer|dur|in|steps|expandDuration|getExpander|mousedown|tbody|writeExtendedContent|re|Click|hasFocused|documentElement|DIV|closeTitle|closeText|clientWidth|resizeTitle|moveText|loadingOpacity|offsetLeft|restoreDuration|mouseup|geckoMac|restoreSteps|ul|loadingText|offsetParent|prototype|htmlPrepareClose|removeAttribute|htmlExpand|thumbnailId|previous|onGraphicLoad|previousText|loadingTitle||appendTo|pThis|push|vis|self|hide|detachEvent|filter|awake|easeInQuad|destroyObject|preloadGraphic|next|background|nextText|val|contentDocument|preventDefault|afterExpand|location|active|mousemove|200|compatMode|both|htmlSizeOperations|border|prepareNextOutline|maxWidth|anchor|round|getWrapperKey|easingClose|expandSteps|fadeInOut|correctRatio|250|childNodes|setSize|pI|tmpMin|clear|blur|pageLoaded|clickY|setAttribs|clientY|modMarginRight|imgSpan|getSelfRendered|pow|isHsAnchor|padding|getNode|contentId|hasExtendedContent|nopad|restoreCursor|hsIframe|url|slideshowGroup|sleep|expand|pointer|userAgent|clickX|getParam|clientX|number|string|ajax|attributes|exec|parseFloat|Close|Move|Next|Resize|drop|Safari|all|shadow|Previous|cancel|cur|zoomout|graphics|1001|click|Loading|drag|and|Macintosh|rv|innerHeight|clientHeight|innerWidth|pageXOffset|pageYOffset|footer|header|hasHtmlexpanders|BackCompat|MSIE|margin|getElementById|Gecko|alpha|load|split|appVersion|HsExpander|lineHeight|flushImgSize|oncontextmenu|blockRightClick|htmlCreate|fullExpandWidth|oldRight|default|fullExpandHeight|imageCreate|wait|Microsoft|DXImageTransform|progid|AlphaImageLoader|sizingMethod||toString|scale|oldBottom|loadTime|KDE|vendor|boolean|isNaN|tgt|tmpHeight|tmpWidth|insertBefore|nodeName|allowTransparency|frameBorder|hand|flash|write|caption|300px|png|thumbsUserSetId|1px|linearTween|attachEvent|button|paddingTop|form|void|xpand|srcElement|htmlE|dragSensitivity|sqrt|fontSize|outlinesDir|outlines|white|collapse|cellSpacing|javascript|01|borderCollapse'.split('|'),0,{}))
r (i = 0; i < hs.expanders.length; i++) {
		if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
			hs.expanders[i].cancelLoading();
		}
	}
	// check if already open
	for (i = 0; i < hs.expanders.length; i++) {
		if (hs.expanders[i] && hs.expanders[i].thumb == el) {
			hs.expanders[i].focus();
			return false;
		}		
	}

	if (!hs.allowMultipleInstances) {
		var prev = hs.expandedImagesCounter - 1;
		if (hs.expanders[prev]) hs.expanders[prev].doClose();
	}
	
	var key = this.key = hs.expandedImagesCounter++;
	hs.expanders[this.key] = this;
	if (contentType == 'html') {
		this.isHtml = true;
		this.contentType = 'html';
	} else {
		this.isImage = true;
		this.contentType = 'image';
	}
	this.a = a;
	
	this.thumbsUserSetId = el.id || a.id;
	this.thumb = el;		
	
	this.overlays = new Array();

	var pos = hs.position(el); 
	
	// instanciate the wrapper
	this.wrapper = hs.createElement(
		'div',
		{
			id: 'highslide-wrapper-'+ this.key,
			className: this.wrapperClassName
		},
		{
			visibility: 'hidden',
			position: 'absolute',
			zIndex: hs.zIndexCounter++
		}, null, true );
	this.wrapper.onmouseover = function (e) { 
    	try { hs.expanders[key].onMouseOver(); } catch (e) {} 
    };
    this.wrapper.onmouseout = function (e) { 
    	try { hs.expanders[key].onMouseOut(); } catch (e) {}
	};
	
	// store properties of thumbnail
	this.thumbWidth = el.width ? el.width : el.offsetWidth;		
	this.thumbHeight = el.height ? el.height : el.offsetHeight;
	this.thumbLeft = pos.x;
	this.thumbTop = pos.y;
	
	// thumb borders
	this.thumbOffsetBorderW = (this.thumb.offsetWidth - this.thumbWidth) / 2;
	this.thumbOffsetBorderH = (this.thumb.offsetHeight - this.thumbHeight) / 2;
	
	// get the wrapper
	hs.genContainer();
	if (hs.pendingOutlines[this.outlineType]) {
		this.connectOutline();
		this[this.contentType +'Create']();
	} else if (!this.outlineType) {
		this[this.contentType +'Create']();
	} else {
		this.displayLoading();
		var pThis = this;
		new HsOutline(this.outlineType, 
			function () { 
				pThis.connectOutline();
				pThis[pThis.contentType +'Create']();
			} 
		);
	}
	
};

HsExpander.prototype.connectOutline = function(x, y) {	
	var w = hs.pendingOutlines[this.outlineType];
	this.objOutline = w;
	hs.pendingOutlines[this.outlineType] = null;
};

HsExpander.prototype.displayLoading = function() {
	if (this.onLoadStarted || this.loading) return;
		
	this.originalCursor = this.a.style.cursor;
	this.a.style.cursor = 'wait';
	
	if (!hs.loading) {
		hs.loading = hs.createElement('a',
			{
				className: 'highslide-loading',
				title: hs.loadingTitle,
				innerHTML: hs.loadingText
			},
			{
				position: 'absolute',
				opacity: hs.loadingOpacity
			}, hs.container
		);
	}
	
	this.loading = hs.loading;
	this.loading.href = 'javascript:hs.expanders['+ this.key +'].cancelLoading()';
	this.loading.visibility = 'visible';		
	
	this.loading.style.left = (this.thumbLeft + this.thumbOffsetBorderW 
		+ (this.thumbWidth - this.loading.offsetWidth) / 2) +'px';
	this.loading.style.top = (this.thumbTop 
		+ (this.thumbHeight - this.loading.offsetHeight) / 2) +'px';
	setTimeout(
		"if (hs.expanders["+ this.key +"] && hs.expanders["+ this.key +"].loading) "
		+ "hs.expanders["+ this.key +"].loading.style.visibility = 'visible';", 
		100
	);
};

HsExpander.prototype.imageCreate = function() {
	var key = this.key;

	var img = document.createElement('img');
    this.content = img;
    img.onload = function () { try { hs.expanders[key].onLoad(); } catch (e) {} };
    img.className = 'highslide-image';
    img.style.visibility = 'hidden'; // prevent flickering in IE
    img.style.display = 'block';
	img.style.position = 'absolute';
    img.style.zIndex = 3;
    img.title = hs.restoreTitle;
    if (hs.safari) hs.container.appendChild(img);
    // uncomment this to flush img size:
    // if (hs.ie) img.src = null;
	img.src = hs.getSrc(this.a);
	
	this.displayLoading();
};

HsExpander.prototype.onLoad = function() {	
	try { 
	
		if (!this.content) return;
		if (this.onLoadStarted) return; // old Gecko loop
		else this.onLoadStarted = true;
		
			   
		if (this.loading) {
			this.loading.style.visibility = 'hidden';
			this.loading = null;
			this.a.style.cursor = this.originalCursor || '';
		}
		if (this.isImage) {			
			this.newWidth = this.content.width;
			this.newHeight = this.content.height;
			this.fullExpandWidth = this.newWidth;
			this.fullExpandHeight = this.newHeight;
			
			this.content.width = this.thumbWidth;
			this.content.height = this.thumbHeight;
			
		} else if (this.htmlGetSize) this.htmlGetSize();
		
		// identify caption div
		var modMarginBottom = hs.marginBottom;
		if (!this.captionId && this.thumbsUserSetId)  this.captionId = 'caption-for-'+ this.thumbsUserSetId;
		if (this.captionId) {
			this.caption = hs.cloneNode(this.captionId);
		}
		if (this.captionTemplateId) {
			var s = (this.caption) ? this.caption.innerHTML : '';
			this.caption = hs.cloneNode(this.captionTemplateId);
			if (this.caption) this.caption.innerHTML
				= this.caption.innerHTML.replace(/\s/g, ' ').replace('{caption}', s);
		}
		
		var modMarginBottom = hs.marginBottom;
		if (this.caption) modMarginBottom += this.spaceForCaption;
		
		this.wrapper.appendChild(this.content);
		this.content.style.position = 'relative'; // Saf
		if (this.caption) this.wrapper.appendChild(this.caption);
		this.wrapper.style.left = this.thumbLeft +'px';
		this.wrapper.style.top = this.thumbTop +'px';
		hs.container.appendChild(this.wrapper);
		
		// correct for borders
		this.offsetBorderW = (this.content.offsetWidth - this.thumbWidth) / 2;
		this.offsetBorderH = (this.content.offsetHeight - this.thumbHeight) / 2;
		var modMarginRight = hs.marginRight + 2 * this.offsetBorderW;
		modMarginBottom += 2 * this.offsetBorderH;
		
		var ratio = this.newWidth / this.newHeight;
		var minWidth = this.allowSizeReduction ? this.minWidth : this.newWidth;
		var minHeight = this.allowSizeReduction ? this.minHeight : this.newHeight;
		
		var justify = { x: 'auto', y: 'auto' };
		if (this.align == 'center') {
			justify.x = 'center';
			justify.y = 'center';
		} else {
			if (this.anchor.match(/^top/)) justify.y = null;
			if (this.anchor.match(/right$/)) justify.x = 'max';
			if (this.anchor.match(/^bottom/)) justify.y = 'max';
			if (this.anchor.match(/left$/)) justify.x = null;
		}
		
		client = new hs.clientInfo();		
		
		// justify
		this.x = { 
			min: parseInt(this.thumbLeft) - this.offsetBorderW + this.thumbOffsetBorderW,
			span: this.newWidth,
			minSpan: this.newWidth < minWidth ? this.newWidth : minWidth,
			justify: justify.x,
			target: this.targetX,
			marginMin: hs.marginLeft, 
			marginMax: modMarginRight,
			scroll: client.scrollLeft,
			clientSpan: client.width,
			thumbSpan: this.thumbWidth
		};
		var oldRight = this.x.min + parseInt(this.thumbWidth);
		this.x = this.justify(this.x);
		this.y = { 
			min: parseInt(this.thumbTop) - this.offsetBorderH + this.thumbOffsetBorderH,
			span: this.newHeight,
			minSpan: this.newHeight < minHeight ? this.newHeight : minHeight,
			justify: justify.y,
			target: this.targetY,
			marginMin: hs.marginTop, 
			marginMax: modMarginBottom, 
			scroll: client.scrollTop,
			clientSpan: client.height,
			thumbSpan: this.thumbHeight
		};
		var oldBottom = this.y.min + parseInt(this.thumbHeight);
		this.y = this.justify(this.y);
		
		if (this.isHtml) this.htmlSizeOperations();	
		if (this.isImage) this.correctRatio(ratio);

		var x = this.x;
		var y = this.y;
		
		this.show();
	} catch (e) {
		if (hs.expanders[this.key] && hs.expanders[this.key].a) 
			window.location.href = hs.getSrc(hs.expanders[this.key].a);
	}
};

HsExpander.prototype.show = function () {
	// Selectbox bug
	var imgPos = {x: this.x.min - 20, y: this.y.min - 20, w: this.x.span + 40, h: this.y.span + 40 + this.spaceForCaption};
	hs.hideSelects = (hs.ie && hs.ieVersion() < 7);
	if (hs.hideSelects) this.showHideElements('SELECT', 'hidden', imgPos);
	// Iframes bug
	hs.hideIframes = (window.opera || navigator.vendor == 'KDE' || (hs.ie && hs.ieVersion() < 5.5));
	if (hs.hideIframes) this.showHideElements('IFRAME', 'hidden', imgPos);
	
	// Make outline ready	
	if (this.objOutline && !this.outlineWhileAnimating) this.positionOutline(this.x.min, this.y.min, this.x.span, this.y.span);
	var o2 = this.objOutline ? this.objOutline.offset : 0;
	
	// Apply size change		
	this.changeSize(
		1,
		this.thumbLeft + this.thumbOffsetBorderW - this.offsetBorderW,
		this.thumbTop + this.thumbOffsetBorderH - this.offsetBorderH,
		this.thumbWidth,
		this.thumbHeight,
		this.x.min,
		this.y.min,
		this.x.span,
		this.y.span, 
		hs.expandDuration,
		hs.expandSteps,
		hs.outlineStartOffset,
		o2
	);
};

HsExpander.prototype.justify = function (p) {
	
	var tgt, dim = p == this.x ? 'x' : 'y';
	if (p.target && p.target.match(/ /)) {
		tgt = p.target.split(' ');
		p.target = tgt[0];
	}
	if (p.target && hs.$(p.target)) {
		p.min = hs.position(hs.$(p.target))[dim];
		if (tgt && tgt[1] && tgt[1].match(/^[-]?[0-9]+px$/)) p.min += parseInt(tgt[1]);
		
	} else if (p.justify == 'auto' || p.justify == 'center') {
		var hasMovedMin = false;
		var allowReduce = true;
		
		// calculate p.min
		if (p.justify == 'center') p.min = Math.round(p.scroll + (p.clientSpan - p.span - p.marginMax) / 2);
		else p.min = Math.round(p.min - ((p.span - p.thumbSpan) / 2)); // auto
		
		if (p.min < p.scroll + p.marginMin) {
			p.min = p.scroll + p.marginMin;
			hasMovedMin = true;		
		}
		
		if (p.span < p.minSpan) {
			p.span = p.minSpan;
			allowReduce = false;
		}
		// calculate right/newWidth
		if (p.min + p.span > p.scroll + p.clientSpan - p.marginMax) {
			if (hasMovedMin && allowReduce) p.span = p.clientSpan - p.marginMin - p.marginMax; // can't expand more
			else if (p.span < p.clientSpan - p.marginMin - p.marginMax) { // move newTop up
				p.min = p.scroll + p.clientSpan - p.span - p.marginMin - p.marginMax;
			} else { // image larger than client
				p.min = p.scroll + p.marginMin;
				if (allowReduce) p.span = p.clientSpan - p.marginMin - p.marginMax;
			}
			
		}
		
		if (p.span < p.minSpan) {
			p.span = p.minSpan;
			allowReduce = false;
		}
		
	} else if (p.justify == 'max') {
		p.min = Math.floor(p.min - p.span + p.thumbSpan);
	}
		
	if (p.min < p.marginMin) {
		tmpMin = p.min;
		p.min = p.marginMin; 
		if (allowReduce) p.span = p.span - (p.min - tmpMin);
	}
	return p;
};

HsExpander.prototype.correctRatio = function(ratio) {
	var x = this.x;
	var y = this.y;
	var changed = false;
	if (x.span / y.span > ratio) { // width greater
		var tmpWidth = x.span;
		x.span = y.span * ratio;
		if (x.span < x.minSpan) { // below minWidth
			x.span = x.minSpan;	
			y.span = x.span / ratio;
		}
		changed = true;
	
	} else if (x.span / y.span < ratio) { // height greater
		var tmpHeight = y.span;
		y.span = x.span / ratio;
		changed = true;
	}
	
	if (changed) {
		x.min = parseInt(this.thumbLeft) - this.offsetBorderW + this.thumbOffsetBorderW;
		x.minSpan = x.span;
		this.x = this.justify(x);
		
		y.min = parseInt(this.thumbTop) - this.offsetBorderH + this.thumbOffsetBorderH;
		y.minSpan = y.span;
		this.y = this.justify(y);
	}
};

HsExpander.prototype.changeSize = function(dir, x1, y1, w1, h1, x2, y2, w2, h2, dur, steps, oo1, oo2) {
	dW = (w2 - w1) / steps;
	dH = (h2 - h1) / steps;
	dX = (x2 - x1) / steps;
	dY = (y2 - y1) / steps;
	dOo = (oo2 - oo1) /steps;
	for (i = 1; i <= steps; i++) {
		w1 += dW;
		h1 += dH;
		x1 += dX;
		y1 += dY;
		oo1 += dOo;
		
		var obj = "hs.expanders["+ this.key +"]";
		var s = "try {";
		if (i == 1) {
			s += obj +".content.style.visibility = 'visible';"
				+ "if ("+ obj +".thumb.tagName == 'IMG' && hs.hideThumbOnExpand) "+ obj +".thumb.style.visibility = 'hidden';"
		}
		if (i == steps) {
			w1 = w2;
			h1 = h2;
			x1 = x2;
			y1 = y2;
			oo1 = oo2;
		}
		s += obj +"."+ this.contentType +"SetSize("+ Math.round(w1) +", "+ Math.round(h1) +", "
			+ Math.round(x1) +", "+ Math.round(y1) +", "+ Math.round(oo1);
		if (i == steps) s += ', '+ dir;
		s += ");} catch (e) {}";
		setTimeout(s, Math.round(i * (dur / steps)));
	}
};

HsExpander.prototype.imageSetSize = function (w, h, x, y, offset, end) {
	try {
		this.content.width = w;
		this.content.height = h;
		
		if (this.objOutline && this.outlineWhileAnimating) {
			var o = this.objOutline.offset - offset;
			this.positionOutline(x + o, y + o, w - 2 * o, h - 2 * o, 1);
		}
		
		hs.setStyles ( this.wrapper,
			{
				'visibility': 'visible',
				'left': x +'px',
				'top': y +'px'
			}
		);
		
		var exp = 'hs.expanders['+ this.key +']';
		if (end == 1) setTimeout('if ('+ exp +')'+ exp +'.onExpanded()', 0); // jerk in IE
		else if (end == -1) setTimeout('if ('+ exp +')'+ exp +'.onEndClose()', 0);
	} catch (e) {
		window.location.href = hs.getSrc(this.a);
	}
};

HsExpander.prototype.positionOutline = function(x, y, w, h, vis) {
	if (!this.objOutline) return;
	var o = this.objOutline;
	if (vis) o.table.style.visibility = 'visible';
	o.table.style.left = (x - o.offset) +'px';
	o.table.style.top = (y - o.offset) +'px';
	o.table.style.width = (w + 2 * (this.offsetBorderW + o.offset)) +'px';
	w += 2 * (this.offsetBorderW - o.offset);
	h += + 2 * (this.offsetBorderH - o.offset);
	o.td[4].style.width = w >= 0 ? w +'px' : 0;
	o.td[4].style.height = h >= 0 ? h +'px' : 0;
	if (o.hasAlphaImageLoader) o.td[3].style.height = o.td[5].style.height = o.td[4].style.height;
};

HsExpander.prototype.onExpanded = function() {
	if (this.objOutline) this.objOutline.table.style.visibility = 'visible';
	this.isExpanded = true;
	this.focus();
	if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
	this.createCustomOverlays();
	if (hs.showCredits) this.writeCredits();
	
	if (this.caption) this.writeCaption();
	
	if (this.fullExpandWidth > this.x.span) this.createFullExpand();
	if (!this.caption) this.onDisplayFinished();
};

HsExpander.prototype.onDisplayFinished = function() {
	var key = this.key;
	var outlineType = this.outlineType;
	new HsOutline(outlineType, function () { 
		try { hs.expanders[key].preloadNext();	} catch (e) {}
	});
};

HsExpander.prototype.preloadNext = function() {
	var next = hs.getAdjacentAnchor(this.key, 1);	
	if (next.onclick.toString().match(/hs\.expand/)) 
		var img = hs.createElement('img', { src: hs.getSrc(next) });
};

HsExpander.prototype.cancelLoading = function() {
	this.a.style.cursor = this.originalCursor;	
	if (this.loading) hs.loading.style.visibility = 'hidden';		
	hs.expanders[this.key] = null;
};

HsExpander.prototype.writeCredits = function () {
	var credits = hs.createElement('a',
		{
			href: hs.creditsHref,
			className: 'highslide-credits',
			innerHTML: hs.creditsText,
			title: hs.creditsTitle
		}
	);
	this.createOverlay(credits, 'top left');
};

HsExpander.prototype.writeCaption = function() {
	try {
		this.wrapper.style.width = this.wrapper.offsetWidth +'px';	
		this.caption.style.visibility = 'hidden';
		this.caption.className += ' highslide-display-block';
		
		var height;
		if (hs.ie && (hs.ieVersion() < 6 || document.compatMode == 'BackCompat')) {
			height = this.caption.offsetHeight;
		} else {
			var temp = hs.createElement('div', {innerHTML: this.caption.innerHTML}, 
				null, null, true); // to get height
			this.caption.innerHTML = '';
			this.caption.appendChild(temp);	
			height = this.caption.childNodes[0].offsetHeight;//parseInt(hs.getStyle(this.caption, 'height'));
			this.caption.innerHTML = this.caption.childNodes[0].innerHTML;
		}
		this.caption.style.overflow = 'hidden';
		this.caption.style.height = 0;
		
		this.caption.style.zIndex = 2;
		
		if (hs.captionSlideSpeed) {
			step = Math.round(height/50);
			if (step == 0) step = 1;
			step = step * hs.captionSlideSpeed;
		} else step = height;

		var t = 0;
		for (var h = height % step; h <= height; h += step, t += 10) {
			var end = (h == height) ? 1 : 0;
			var eval = "try { "
				+ "hs.expanders["+ this.key +"].placeCaption("+ h +", "+ end +");"
				+ "} catch (e) {}";			
			setTimeout (eval, t);
		}
	
	} catch (e) {}	
};

HsExpander.prototype.placeCaption = function(height, end) {
	if (!this.caption) return;
	this.caption.style.height = height +'px';
	this.caption.style.visibility = 'visible';
	var o = this.objOutline;
	if (o) {
		o.td[4].style.height = (this.wrapper.offsetHeight - 2 * this.objOutline.offset) +'px';
		if (o.hasAlphaImageLoader) o.td[3].style.height = o.td[5].style.height = o.td[4].style.height;
	}
	if (end) this.onDisplayFinished();
};

HsExpander.prototype.showHideElements = function (tagName, visibility, imgPos) {
	var els = document.getElementsByTagName(tagName);
	if (els) {			
		for (i = 0; i < els.length; i++) {
			if (els[i].nodeName == tagName) {  
				var hiddenBy = els[i].getAttribute('hidden-by');
				 
				if (visibility == 'visible' && hiddenBy) {
					hiddenBy = hiddenBy.replace('['+ this.key +']', '');
					els[i].setAttribute('hidden-by', hiddenBy);
					if (!hiddenBy) els[i].style.visibility = 'visible';				
					
				} else if (visibility == 'hidden') { // hide if behind
					var elPos = hs.position(els[i]);
					elPos.w = els[i].offsetWidth;
					elPos.h = els[i].offsetHeight;
				
					var clearsX = (elPos.x + elPos.w < imgPos.x || elPos.x > imgPos.x + imgPos.w);
					var clearsY = (elPos.y + elPos.h < imgPos.y || elPos.y > imgPos.y + imgPos.h);
					var wrapperKey = hs.getWrapperKey(els[i]);
					if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
						if (!els[i].currentStyle || (els[i].currentStyle && els[i].currentStyle['visibility'] != 'hidden')) { // IE
							if (!hiddenBy) {
								els[i].setAttribute('hidden-by', '['+ this.key +']');
							} else if (!hiddenBy.match('['+ this.key +']')) {
								els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
							}
							els[i].style.visibility = 'hidden';	  
						}
					} else if (hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey) { // on move
						els[i].setAttribute('hidden-by', '');
						els[i].style.visibility = 'visible';
					} else if (hiddenBy && hiddenBy.match('['+ this.key +']')) {
						els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
					}
				}   
			}
		}
	}
};

HsExpander.prototype.focus = function() {
	// blur others
	for (i = 0; i < hs.expanders.length; i++) {
		if (hs.expanders[i] && i == hs.focusKey) {
			var blurExp = hs.expanders[i];
			blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
			if (blurExp.caption) {
				hs.setId(blurExp.caption, '-hsBlur'+i);
				blurExp.caption.className += ' highslide-caption-blur';
			}
			if (blurExp.isImage) {
				blurExp.content.style.cursor = hs.ie ? 'hand' : 'pointer';
				blurExp.content.title = hs.focusTitle;	
			} else { hs.setId(blurExp.innerContent, '-hsBlur'+i); }
		}
	}
	
	// focus this
	this.wrapper.style.zIndex = hs.zIndexCounter++;
	if (this.objOutline) this.objOutline.table.style.zIndex = this.wrapper.style.zIndex;
	
	this.content.className = 'highslide-'+ this.contentType;
	if (this.caption) {
		hs.setId(this.caption, '-hsBlur' + this.key, 1);
		this.caption.className = this.caption.className.replace(' highslide-caption-blur', '');
	}
	
	if (this.isImage) {
		this.content.title = hs.restoreTitle;
		
		hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
		if (hs.ie && hs.ieVersion() < 6) hs.styleRestoreCursor = 'hand';
		this.content.style.cursor = hs.styleRestoreCursor;
	} else {
		hs.setId(this.innerContent, '-hsBlur' + this.key, 1);
	}
	
	hs.focusKey = this.key;	
	hs.addEventListener(document, 'keydown', hs.keyHandler);
	
};

HsExpander.prototype.onClick = function() {
	this.doClose();
};

HsExpander.prototype.doClose = function() {
	hs.removeEventListener(document, 'keydown', hs.keyHandler);
	try {
		this.isClosing = true;
		
		var x = parseInt(this.wrapper.style.left);
		var y = parseInt(this.wrapper.style.top);
		var w = (this.isImage) ? this.content.width : parseInt(this.content.style.width);
		var h = (this.isImage) ? this.content.height : parseInt(this.content.style.height);
		
		if (this.objOutline) {
			if (this.outlineWhileAnimating) this.positionOutline(x, y, w, h);
			else if (this.preserveContent) this.objOutline.table.style.visibility = 'hidden';
			else this.objOutline.destroy();
		}
		
		// remove children
		var n = this.wrapper.childNodes.length;
		for (i = n - 1; i >= 0 ; i--) {
			var child = this.wrapper.childNodes[i];
			if (child != this.content) {
				hs.purge(this.wrapper.childNodes[i]);
				this.wrapper.removeChild(this.wrapper.childNodes[i]);
			}
		}
		if (this.isHtml) this.htmlOnClose();
		
		this.wrapper.style.width = 'auto';
		this.content.style.cursor = 'default';
		var o2 = this.objOutline ? this.objOutline.offset : 0;
		
		this.changeSize(
			-1,
			x,
			y,
			w,
			h,
			this.thumbLeft - this.offsetBorderW + this.thumbOffsetBorderW,
			this.thumbTop - this.offsetBorderH + this.thumbOffsetBorderH,
			this.thumbWidth,
			this.thumbHeight, 
			hs.restoreDuration,
			hs.restoreSteps,
			o2,
			hs.outlineStartOffset
		);
		
	} catch (e) {
		this.onEndClose();
	} 
};

HsExpander.prototype.onEndClose = function () {
	this.thumb.style.visibility = 'visible';
	
	if (hs.hideSelects) this.showHideElements('SELECT', 'visible');
	if (hs.hideIframes) this.showHideElements('IFRAME', 'visible');
	
	if (this.preserveContent) this.sleep();
	else {
		if (this.objOutline && this.outlineWhileAnimating) this.objOutline.destroy();
	
		hs.purge(this.wrapper);
		this.wrapper.parentNode.removeChild(this.wrapper);
	}
	hs.expanders[this.key] = null;

	hs.cleanUp();
	forceRepaint(); // Added this to force a repaint of the browser window
};

HsExpander.prototype.createOverlay = function (el, position, hideOnMouseOut, opacity) {
	if (typeof el == 'string') el = hs.cloneNode(el);
	if (!el || typeof el == 'string' || !this.isImage) return;
	
	if (!opacity) opacity = 1;
	if (!position) position = 'center center';
	var overlay = hs.createElement(
		'div',
		null,
		{
			'left' : 0,
			'top' : 0,
			'position' : 'absolute',
			'zIndex' : 3,
			'visibility' : 'hidden',
			'opacity' : opacity
		},
		this.wrapper,
		true
	);
	el.className += ' highslide-display-block';
	overlay.appendChild(el);	
	
	var left = this.offsetBorderW;
	var dLeft = this.content.width - overlay.offsetWidth;
	var top = this.offsetBorderH;
	var dTop = this.content.height - overlay.offsetHeight;
	
	if (position.match(/^bottom/)) top += dTop;
	if (position.match(/^center/)) top += dTop / 2;
	if (position.match(/right$/)) left += dLeft;
	if (position.match(/center$/)) left += dLeft / 2;
	overlay.style.left = left +'px';
	overlay.style.top = top +'px';
	
	if (hideOnMouseOut) overlay.setAttribute('hideOnMouseOut', true);
	overlay.setAttribute('opacity', opacity);
	hs.fade(overlay, 0, opacity, 1);
	
	hs.push(this.overlays, overlay);
};

HsExpander.prototype.createCustomOverlays = function() {
	for (i = 0; i < hs.overlays.length; i++) {
		var o = hs.overlays[i];
		if (o.thumbnailId == null || o.thumbnailId == this.thumbsUserSetId) {
			this.createOverlay(o.overlayId, o.position, o.hideOnMouseOut, o.opacity);
		}
	}
};

HsExpander.prototype.onMouseOver = function () {
	for (i = 0; i < this.overlays.length; i++) {
		hs.fade(this.overlays[i], 0, this.overlays[i].getAttribute('opacity'), 1);
	}
};

HsExpander.prototype.onMouseOut = function() {
	var hideThese = new Array();
	var j = 0;
	for (i = 0; i < this.overlays.length; i++) {
		if (this.overlays[i].getAttribute('hideOnMouseOut')) {
			hideThese[j] = this.overlays[i];
			j++;
		}
	}
	for (i = 0; i < hideThese.length; i++) {		
		hs.fade(hideThese[i], hideThese[i].getAttribute('opacity'), 0, -1);
	}
};


HsExpander.prototype.createFullExpand = function () {
	var a = hs.createElement(
		'a',
		{
			href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
			title: hs.fullExpandTitle
		},
		{
			background: 'url('+ hs.graphicsDir + hs.fullExpandIcon+')',
			display: 'block',
			margin: '0 10px 10px 0',
			width: '45px',
			height: '44px'
		}, null, true
	);
	
	this.createOverlay(a, 'bottom right', true, 0.75);
	this.fullExpandIcon = a;
};

HsExpander.prototype.doFullExpand = function () {
	try {
		hs.purge(this.fullExpandIcon);
		this.fullExpandIcon.parentNode.removeChild(this.fullExpandIcon);
		this.focus();
		
		this.x.min = parseInt(this.wrapper.style.left) - (this.fullExpandWidth - this.content.width) / 2;
		if (this.x.min < hs.marginLeft) this.x.min = hs.marginLeft;		
		this.wrapper.style.left = this.x.min +'px';
		
		var borderOffset = this.wrapper.offsetWidth - this.content.width;		
		
		this.content.width = this.fullExpandWidth;
		this.content.height = this.fullExpandHeight;
		
		this.x.span = this.content.width;
		this.wrapper.style.width = (this.x.span + borderOffset) +'px';
		
		this.y.span = this.wrapper.offsetHeight - 2 * this.offsetBorderH;
		this.positionOutline(this.x.min, this.y.min, this.x.span, this.y.span);
		
		// reposition overlays
		for (var i = 0; i < this.overlays.length; i++) {
			hs.purge(this.overlays[i]);
			this.overlays[i].parentNode.removeChild(this.overlays[i]);
		}	
		if (hs.showCredits) this.writeCredits();
		this.createCustomOverlays();
		
		this.redoShowHide();
	
	} catch (e) {
		window.location.href = this.content.src;
	}
};

// on end move and resize
HsExpander.prototype.redoShowHide = function() {
	var imgPos = {
		x: parseInt(this.wrapper.style.left) - 20, 
		y: parseInt(this.wrapper.style.top) - 20, 
		w: this.content.offsetWidth + 40, 
		h: this.content.offsetHeight + 40 + this.spaceForCaption
	};
	if (hs.hideSelects) this.showHideElements('SELECT', 'hidden', imgPos);
	if (hs.hideIframes) this.showHideElements('IFRAME', 'hidden', imgPos);

};

// Show and hide hs.repaintDivID, is it exists, forcing the browser to repaint the window. 
function forceRepaint() { 
   if (document.getElementById(hs.repaintDivID)){ 
      closeCurtain(); 
      setTimeout('openCurtain()',10); 
      return true; 
       
   } else{ 
      return false; 
   } 
} 

// Make hs.repaintDivID element visible, covering the entire window very briefly 
function closeCurtain(){ 
   document.getElementById(hs.repaintDivID).style.display='block'; 
   return true;    
} 

// Hide hs.repaintDivID element, forcing a repaint of the browser window. 
function openCurtain(){ 
   document.getElementById(hs.repaintDivID).style.display='none'; 
   return true; 
} 

// if hs.repaintDivID has been set, we create a div by that id, which we'll display in order to 
//   force a browser repaint after closing highslide elements.  This helps erase any srtefacts left 
//   by some browsers (primarly Gecko-based Mac OS browsers). 
function createRepaintDiv(){ 
   if (hs.repaintDivID) { 
      var cleanSlate = document.createElement('div'); 
      cleanSlate.setAttribute('id', hs.repaintDivID); 
      cleanSlate.setAttribute('style', 'width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; z-index: 10000; background: url(' + hs.graphicsDir + 'clear.gif); display: none;'); 
    
      window.document.body.appendChild(cleanSlate); 
    
   } 
} 

hs.addEventListener(window, 'load', createRepaintDiv); // Try to create the repaint div on load

// set handlers
hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
hs.addEventListener(window, 'load', hs.preloadImages);