/*Eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('l 3s={45:n(9){6.9=2L.2F({2v:2n,2e:3i.34.30,1V:2K,2I:2K,1Q:1m,2t:1m,2o:2i,2d:3m,1h:0.8,1J:2i,2w:\'2T\',2Q:0,2O:0,2M:\'44\',2G:\'42\',1d:\'\'},9||{});b(x.3S&&z.3I=="3G"){6.9.1Q=14}6.1H=[];$1w(z.3r,n(m){b(m.1a&&m.1a.3k(/^3h/i)){m.Z=6.2q.26(m,6);6.1H.24(m)}},6);6.21=6.20.2Z(6);6.1R=6.1N.P(6);6.12=c v(\'L\').M(\'t\',\'43\').r(z.1b);6.C=c v(\'L\').M(\'t\',\'40\').1p({s:6.9.1V+\'G\',o:6.9.2I+\'G\',1o:\'-\'+(6.9.1V/2)+\'G\',D:\'1e\'}).r(z.1b);6.p=c v(\'L\').M(\'t\',\'3M\').r(6.C);6.19=c v(\'a\').13({t:\'3F\',K:\'#\'}).1I(\'D\',\'1e\').r(6.p);6.V=6.19.3x().M(\'t\',\'3w\').r(6.p);6.19.Z=6.1G.P(6);6.V.Z=6.1B.P(6);6.U=c v(\'L\').M(\'t\',\'3o\').1I(\'D\',\'1e\').r(z.1b);6.B=c v(\'L\').M(\'t\',\'3n\').r(6.U);c v(\'a\').13({t:\'3l\',K:\'#\'}).r(6.B).Z=6.12.Z=6.1E.P(6);b(6.9.2Q&&6.9.1d)c v(\'a\').13({t:\'3j\',K:\'#\'}).r(6.B).Z=6.1C.P(6,\'3g\');b(6.9.2O&&6.9.1d)c v(\'a\').13({t:\'3f\',K:\'#\'}).r(6.B).Z=6.1C.P(6,\'3e\');6.28=c v(\'L\').M(\'t\',\'3c\').r(6.B);6.2j=c v(\'L\').M(\'t\',\'38\').r(6.B);c v(\'L\').1I(\'35\',\'33\').r(6.B);l O=6.O.P(6);6.H={12:6.12.1M(\'1h\',{1g:6.9.1J}).2u(),1S:6.C.31({1g:6.9.2v,2Y:6.9.2e,1U:O}),Y:6.p.1M(\'1h\',{1g:6.9.1J,1U:O}),B:6.U.1M(\'o\',{1g:2n,1U:O})};6.2B=c 1O();6.2C=c 1O()},2q:n(R){b(R.1a.W==8)y 6.2P(R.K,R.1u,R.E);l j,I,e=[];6.1H.1w(n(m){b(m.1a==R.1a){2N(j=0;j<e.W;j++)b(e[j][0]==m.K&&e[j][2]==m.E)11;b(j==e.W){e.24([m.K,m.1u,m.E]);b(m.K==R.K&&m.E==R.E)I=j}}},6);y 6.Q(e,I)},2P:n(17,1u,E){y 6.Q([[17,1u,E]],0)},Q:n(e,I){6.e=e;6.1N();6.1T(1m);l 1t=(x.1k()==0)?x.2J():x.1k();l 1s=z.1b.1r||z.2H.1r;6.X=1s+(1t/15);6.C.1p({X:6.X+\'G\',D:\'\'});6.H.12.16(6.9.1h);y 6.1q(I)},1N:n(){l 2E=(x.2D()==0)?x.3Z()-22:x.2D();l 1t=(x.1k()==0)?x.2J():x.1k();l 1s=z.1b.1r||z.2H.1r;6.12.1p({X:1s+\'G\',o:1t+\'G\',s:2E+\'G\'})},1T:n(Q){l 1P=$A(z.2A(\'3X\'));1P.2F(z.2A(x.3W?\'3U\':\'3T\'));1P.1w(n(m){b(Q)m.2y=m.k.2x;m.k.2x=Q?\'3P\':m.2y});l 1v=Q?\'3O\':\'3N\';x[1v](\'3L\',6.1R)[1v](\'3K\',6.1R);z[1v](\'3J\',6.21);6.J=0},20:n(2s){2r(2s.3H){F 27:F 3E:F 3D:6.1E();11;F 37:F 3A:6.1G();11;F 39:F 3y:6.1B()}},1G:n(){y 6.1q(6.u-1)},1B:n(){y 6.1q(6.u+1)},1q:n(I){b(6.J||(I<0)||(I>=6.e.W))y 14;6.J=1;6.u=I;6.U.k.D=6.19.k.D=6.V.k.D=\'1e\';6.H.Y.2u();6.C.2k=\'3v\';6.1x();l 17=6.e[6.u][0];l E=6.e[6.u][2];l 2g=/\\.(3u?g|3t|3q|3p)/i;b(17.1i(2g)){6.7=c 1O();6.7.1n=\'Y\';6.7.w=6.1c(E,c 1l("s=(\\\\d+%?)","i"),-1);6.7.h=6.1c(E,c 1l("o=(\\\\d+%?)","i"),-1);6.7.2c=6.O.P(6);6.7.N=17}1D{6.7=c 2L();6.7.1n=\'2b\';6.7.w=6.1c(E,c 1l("s=(\\\\d+)","i"),6.9.2o);6.7.h=6.1c(E,c 1l("o=(\\\\d+)","i"),6.9.2d);6.7.N=17;6.O()}y 14},O:n(){2r(6.J++){F 1:6.C.2k=\'\';b(6.7.1n==\'Y\'){l 1F=(6.7.w==-1)?6.7.s.1j():6.7.w.1j();l 1A=(6.7.h==-1)?6.7.o.1j():6.7.h.1j();6.T=(q=1F.1i(/(\\d+)%/))?q[1]*6.7.s*0.2z:1F;6.S=(q=1A.1i(/(\\d+)%/))?q[1]*6.7.o*0.2z:1A;c v(\'3d\').13({t:\'2h\',N:6.7.N,s:6.T,o:6.S}).r(6.p);6.V.k.2f=\'\'}1D{6.T=6.7.w;6.S=6.7.h;6.1z="3b"+c 3a().3z();c v(\'2b\').13({t:6.1z,s:6.T,o:6.S,36:0,3B:6.9.2w,N:6.7.N}).r(6.p);6.V.k.2f=\'3C\'}6.p.k.s=6.B.k.s=6.T+\'G\';6.p.k.o=6.19.k.o=6.V.k.o=6.S+\'G\';6.28.2l(6.e[6.u][1]||\'\');6.2j.2l((!6.9.2t||(6.e==1))?\'\':6.9.2M+\' \'+(6.u+1)+\' \'+6.9.2G+\' \'+6.e.W);b(6.u)6.2B.N=6.e[6.u-1][0];b(6.u!=(6.e.W-1))6.2C.N=6.e[6.u+1][0];b(6.C.1y!=6.p.1f){l 25=(6.S==6.p.1y)?6.p.1f:2m(6.S)+18;6.H.1S.16({o:25});11}6.J++;F 2:b(6.C.2p!=6.p.23){l 1K=(6.T==6.p.2p)?6.p.23:2m(6.T)+18;6.H.1S.16({s:1K,1o:-1K/2});11}6.J++;F 3:6.U.1p({X:(6.X+6.C.1y)+\'G\',o:\'32\',1o:6.C.k.1o,s:6.C.k.s,D:\'\'});6.H.Y.16(1);11;F 4:b(6.9.1Q){6.H.B.16(0,6.B.1f+10);11}6.U.k.o=(6.B.1f+10)+\'G\';F 5:b(6.u){6.19.k.D=\'\'}b(6.u!=(6.e.W-1)){6.V.k.D=\'\'}6.J=0}},1E:n(){b(6.J<0)y;6.J=-1;6.1x();2N(l f 3Q 6.H)6.H[f].3R();6.C.k.D=6.U.k.D=\'1e\';6.H.12.2X(6.1T.26(14,6)).16(0);y 14},1C:n(1L){b(6.9.1d){l 2W=x.Q(6.9.1d+\'?1L=\'+1L+\'&Y=\'+6.e[6.u][0],\'3V\',\'2V=0,X=0,s=\'+(1Z(6.p.k.s))+\',o=\'+(1Z(6.p.k.o))+\',2U=0,3Y=1\');y 14}y 1m},1x:n(){b(6.7){b(6.7.1n==\'Y\'){$(\'2h\').1Y();6.7.2c=2S.2R}1D{$(6.1z).1Y()}6.7=41}},1c:n(1X,29,2a){l 1W=1X.1i(29);y 1W?1W[1]:2a}};',62,254,'||||||this|preload||options||if|new||items||||||style|var|el|function|height|canvas||injectInside|width|id|activeItem|Element||window|return|document||bottom|center|display|rev|case|px|fx|itemNumber|step|href|div|setProperty|src|nextEffect|bind|open|link|p_height|p_width|bottomContainer|nextLink|length|top|image|onclick||break|overlay|setProperties|false||start|url||prevLink|rel|body|matchOrDefault|psScriptPath|none|offsetHeight|duration|opacity|match|toString|getHeight|RegExp|true|datatype|marginLeft|setStyles|changeItem|scrollTop|st|wh|title|fn|each|removeCurrentItem|clientHeight|iframeId|hs|next|printOrSave|else|close|ws|previous|anchors|setStyle|opacityDuration|ow|mode|effect|position|Image|elements|animateCaption|eventPosition|resizeCenter|setup|onComplete|initialWidth|hasQuery|str|remove|parseInt|keyboardListener|eventKeyDown||offsetWidth|push|oh|pass||caption|re|val|iframe|onload|defaultIframeHeight|resizeTransition|right|re_imageURL|lbImage|500|number|className|setHTML|eval|400|defaultIframeWidth|clientWidth|click|switch|event|showNumbers|hide|resizeDuration|iframeScrolling|visibility|lbBackupStyle|01|getElementsByTagName|preloadPrev|preloadNext|getWidth|ww|extend|llOf|documentElement|initialHeight|getScrollHeight|250|Object|llPage|for|enableSaveButton|show|enablePrintButton|empty|Class|auto|toolbar|left|myRef|chain|transition|bindAsEventListener|sineInOut|effects|0px|both|Transitions|clear|frameBorder||lbNumber||Date|lbFrame_|lbCaption|img|save|lbSaveLink|print|lightbox|Fx|lbPrintLink|test|lbCloseLink|300|lbBottom|lbBottomContainer|bmp|gif|links|Lightbox|png|jpe|lbLoading|lbNextLink|clone|78|getTime|80|scrolling|25px|67|88|lbPrevLink|BackCompat|keyCode|compatMode|keydown|resize|scroll|lbCanvas|removeEvent|addEvent|hidden|in|stop|ie6|embed|select|printsave|ie|object|resizable|getScrollWidth|lbCenter|null|of|lbOverlay|Page|init'.split('|'),0,{}))
*/

/*
	Slimbox (Extended Version 1.3.1.2, 2007-06-07)
	by Peter Klein
	-	Added localization of text values
	-	Support for setting different opacitylevel
	-	Support for changing IFRAME scrolling parameter
	-	Added TYPO3 specific Print & Save options.
	-	Fixed problems with page reload in Print & Save function.
	-	Fixed SWFObject incompability.
	-	Added option to disable numbers.
		
	Slimbox (Extended Version 1.3.1, 2007-02-21)
	by Yukio Arita (http://homepage.mac.com/yukikun/software/slimbox_ex/)
	- 	Support to show external content using iframe.
	- 	Support to set content size. You can add width/height parameters 
		in rev attribute of the anchor url.
		ex1) <a href="image.jpg" rev="width=50%, height=50%" rel="lightbox"><img src="image_thumb.jpg" alt="image"></a>
		ex2) <a href="text.html" rev="width=500, height=300" rel="lightbox">some text here</a>
	- 	Some rendering problem with IE6 is fixed. Now you can use Slimbox in 
		valid XHTML document with XML prolog.
	- Of course, license is same as original.

	Based on:
	Slimbox v1.3 - The ultimate lightweight Lightbox clone
	by Christophe Beyls (http://www.digitalia.be) - MIT-style license.
	Inspired by the original Lightbox v2 by Lokesh Dhakar.
*/

var Lightbox = {
	init: function(options){
		this.options = Object.extend({
			resizeDuration: 400,
			resizeTransition: Fx.Transitions.sineInOut,
			initialWidth: 250,
			initialHeight: 250,
			animateCaption: true,
			showNumbers: true,
			defaultIframeWidth : 500, 
			defaultIframeHeight: 300,
			opacity: 0.8,
			opacityDuration: 500,	
			iframeScrolling: 'auto',
			enablePrintButton: 0,
			enableSaveButton: 0,
			llPage: 'Page',
			llOf: 'of',
			psScriptPath: ''
		}, options || {});

		// IE 6 - XML prolog problem
		if(window.ie6 && document.compatMode=="BackCompat"){
			this.options.animateCaption = false;
		}

		this.anchors = [];
		$each(document.links, function(el){
			if (el.rel && el.rel.test(/^lightbox/i)){
				el.onclick = this.click.pass(el, this);
				this.anchors.push(el);
			}
		}, this);
		this.eventKeyDown = this.keyboardListener.bindAsEventListener(this);
		this.eventPosition = this.position.bind(this);

		/*	Build float panel
			<div id="lbOverlay"></div>
			<div id="lbCenter">
				<div id="lbCanvas">
					<a id="lbPrevLink"></a>
					<a id="lbNextLink"></a>
					<!-- img or iframe element is inserted here -->
				</div>
			</div>
			<div id="lbBottomContainer">
				<div id="lbBottom">
					<a id="lbCloseLink"></a>
					<div id="lbCaption"></div>
					<div id="lbNumber"></div>
					<div style="clear:both;"></div>
				</div>
			</div>
		*/

		this.overlay = new Element('div').setProperty('id', 'lbOverlay').injectInside(document.body);

		this.center = new Element('div').setProperty('id', 'lbCenter').setStyles({width: this.options.initialWidth+'px', height: this.options.initialHeight+'px', marginLeft: '-'+(this.options.initialWidth/2)+'px', display: 'none'}).injectInside(document.body);
		this.canvas = new Element('div').setProperty('id', 'lbCanvas').injectInside(this.center);
		this.prevLink = new Element('a').setProperties({id: 'lbPrevLink', href: '#'}).setStyle('display', 'none').injectInside(this.canvas);
		this.nextLink = this.prevLink.clone().setProperty('id', 'lbNextLink').injectInside(this.canvas);
		this.prevLink.onclick = this.previous.bind(this);
		this.nextLink.onclick = this.next.bind(this);

		this.bottomContainer = new Element('div').setProperty('id', 'lbBottomContainer').setStyle('display', 'none').injectInside(document.body);
		this.bottom = new Element('div').setProperty('id', 'lbBottom').injectInside(this.bottomContainer);
		new Element('a').setProperties({id: 'lbCloseLink', href: '#'}).injectInside(this.bottom).onclick = this.overlay.onclick = this.close.bind(this);

		if (this.options.enablePrintButton && this.options.psScriptPath) new Element('a').setProperties({id: 'lbPrintLink', href: '#'}).injectInside(this.bottom).onclick = this.printOrSave.bind(this,'print');
		if (this.options.enableSaveButton && this.options.psScriptPath) new Element('a').setProperties({id: 'lbSaveLink', href: '#'}).injectInside(this.bottom).onclick = this.printOrSave.bind(this,'save');

		this.caption = new Element('div').setProperty('id', 'lbCaption').injectInside(this.bottom);
		this.number = new Element('div').setProperty('id', 'lbNumber').injectInside(this.bottom);
		new Element('div').setStyle('clear', 'both').injectInside(this.bottom);

		/* Build effects */
		var nextEffect = this.nextEffect.bind(this);

		this.fx = {
			overlay: this.overlay.effect('opacity', {duration: this.options.opacityDuration}).hide(),
			resizeCenter: this.center.effects({duration: this.options.resizeDuration, transition: this.options.resizeTransition, onComplete: nextEffect}),
			image: this.canvas.effect('opacity', {duration: this.options.opacityDuration, onComplete: nextEffect}),
			bottom: this.bottomContainer.effect('height', {duration: 400, onComplete: nextEffect})
		};

		this.preloadPrev = new Image();
		this.preloadNext = new Image();
	},

	click: function(link){
				
		// kijken of ik hier de xfade kan pauzeren
		
		if( typeof( window[ 'ixf' ] ) != "undefined" ) { // als object ixf (image crossfader) bestaat, pauzeer het
			clearInterval(blah);
		//	alert(typeof(blah));
		//	return false;
		}
		
		// einde 15-5-2008 12:27:09 //

		if (link.rel.length == 8) return this.show(link.href, link.title, link.rev);

		var j, itemNumber, items = [];
		this.anchors.each(function(el){
			if (el.rel == link.rel){
				for (j = 0; j < items.length; j++) if(items[j][0] == el.href && items[j][2] == el.rev) break;
				if (j == items.length){
					items.push([el.href, el.title, el.rev]);
					if (el.href == link.href && el.rev == link.rev) itemNumber = j;
				}
			}
		}, this);
		return this.open(items, itemNumber);
	},

	show: function(url, title, rev){

		return this.open([[url, title, rev]], 0);
	},

	open: function(items, itemNumber){
		this.items = items;
		this.position();
		this.setup(true);
		var wh = (window.getHeight() == 0) ? window.getScrollHeight() : window.getHeight();
		var st = document.body.scrollTop  || document.documentElement.scrollTop;
		this.top = st + (wh / 15);
		this.center.setStyles({top: this.top+'px', display: ''});
		this.fx.overlay.start(this.options.opacity);
		return this.changeItem(itemNumber);
	},

	position: function(){
		//IE6 - XML prolog problem.
		var ww = (window.getWidth() == 0) ? window.getScrollWidth()-22 : window.getWidth();
		var wh = (window.getHeight() == 0) ? window.getScrollHeight() : window.getHeight();
		var st = document.body.scrollTop  || document.documentElement.scrollTop;
		this.overlay.setStyles({top: st+'px', height: wh+'px', width:ww+'px'});
	},
/*
	setup: function(open){
		var elements = $A(document.getElementsByTagName('object'));
		if (window.ie) elements.extend(document.getElementsByTagName('select'));
		elements.each(function(el){ el.style.visibility = open ? 'hidden' : ''; });
		var fn = open ? 'addEvent' : 'removeEvent';
		window[fn]('scroll', this.eventPosition)[fn]('resize', this.eventPosition);
		document[fn]('keydown', this.eventKeyDown);
		this.step = 0;
	},
*/
	setup: function(open){
		var elements = $A(document.getElementsByTagName('object'));
		elements.extend(document.getElementsByTagName(window.ie ? 'select' : 'embed'));
		elements.each(function(el){
			if (open) el.lbBackupStyle = el.style.visibility;
			el.style.visibility = open ? 'hidden' : el.lbBackupStyle;
		});
		var fn = open ? 'addEvent' : 'removeEvent';
		window[fn]('scroll', this.eventPosition)[fn]('resize', this.eventPosition);
		document[fn]('keydown', this.eventKeyDown);
		this.step = 0;
	},

	keyboardListener: function(event){
		switch (event.keyCode){
			case 27: case 88: case 67: this.close(); break;
			case 37: case 80: this.previous(); break;	
			case 39: case 78: this.next();
		}
	},

	previous: function(){
		return this.changeItem(this.activeItem-1);
	},

	next: function(){
		return this.changeItem(this.activeItem+1);
	},

	changeItem: function(itemNumber){
		if (this.step || (itemNumber < 0) || (itemNumber >= this.items.length)) return false;
		this.step = 1;
		this.activeItem = itemNumber;

		this.bottomContainer.style.display = this.prevLink.style.display = this.nextLink.style.display = 'none';
		this.fx.image.hide();
		this.center.className = 'lbLoading';

		// discard previous content by clicking
		this.removeCurrentItem();
		
		// check item type
		var url = this.items[this.activeItem][0];
		var rev = this.items[this.activeItem][2];
		
		var re_imageURL = /\.(jpe?g|png|gif|bmp)/i;
		if( url.match(re_imageURL) ) {
			this.preload = new Image();	// JavaScript native Object
			this.preload.datatype = 'image';
			this.preload.w = this.matchOrDefault(rev, new RegExp("width=(\\d+%?)", "i"), -1); //-1 if use original size.
			this.preload.h = this.matchOrDefault(rev, new RegExp("height=(\\d+%?)", "i"), -1);
			this.preload.onload = this.nextEffect.bind(this);
			this.preload.src = url;
		}else{
			this.preload = new Object ();	// JavaScript native Object
			this.preload.datatype = 'iframe';
			this.preload.w =  this.matchOrDefault(rev, new RegExp("width=(\\d+)", "i"), this.options.defaultIframeWidth);
			this.preload.h = this.matchOrDefault(rev, new RegExp("height=(\\d+)", "i"), this.options.defaultIframeHeight);
			this.preload.src = url;
			this.nextEffect(); //asynchronous loading
		}

		return false;
	},

	nextEffect: function(){
		switch (this.step++){
		case 1:
			this.center.className = '';

			// create HTML element
			if( this.preload.datatype == 'image' ) {
				var ws = (this.preload.w == -1) ? this.preload.width.toString() : this.preload.w.toString();
				var hs = (this.preload.h == -1) ? this.preload.height.toString() : this.preload.h.toString();
				this.p_width = ( q = ws.match(/(\d+)%/) ) ? q[1] * this.preload.width * 0.01 : ws;
				this.p_height = ( q = hs.match(/(\d+)%/) ) ? q[1] * this.preload.height * 0.01 : hs;
				new Element('img').setProperties({id: 'lbImage', src:this.preload.src, width:this.p_width, height:this.p_height}).injectInside(this.canvas);
				this.nextLink.style.right = '';
			}else{
				this.p_width = this.preload.w;
				this.p_height = this.preload.h;
				// Safari would not update iframe content that has static id.
				this.iframeId = "lbFrame_"+new Date().getTime();
				new Element('iframe').setProperties({id: this.iframeId, width: this.p_width, height: this.p_height, frameBorder:0, scrolling:this.options.iframeScrolling, src:this.preload.src}).injectInside(this.canvas);
				this.nextLink.style.right = '25px';
			}
			this.canvas.style.width = this.bottom.style.width = this.p_width+'px';
			this.canvas.style.height = this.prevLink.style.height = this.nextLink.style.height = this.p_height+'px';

			this.caption.setHTML(this.items[this.activeItem][1] || '');
			this.number.setHTML( (!this.options.showNumbers || (this.items == 1)) ? '' : this.options.llPage + ' ' + (this.activeItem+1) + ' ' + this.options.llOf + ' ' + this.items.length );

			if (this.activeItem) this.preloadPrev.src = this.items[this.activeItem-1][0];
			if (this.activeItem != (this.items.length - 1)) this.preloadNext.src = this.items[this.activeItem+1][0];
			if (this.center.clientHeight != this.canvas.offsetHeight){
				var oh = (this.p_height == this.canvas.clientHeight) ? this.canvas.offsetHeight : eval(this.p_height)+18; // fix for ie
				this.fx.resizeCenter.start({height: oh});
				break;
			}

			this.step++;
		case 2:
			if (this.center.clientWidth != this.canvas.offsetWidth){
				var ow = (this.p_width == this.canvas.clientWidth) ? this.canvas.offsetWidth : eval(this.p_width)+18; // fix for ie
				this.fx.resizeCenter.start({width: ow, marginLeft: -ow/2});
				break;
			}
			this.step++;
		case 3:
			this.bottomContainer.setStyles({top: (this.top + this.center.clientHeight)+'px', height:'0px', marginLeft: this.center.style.marginLeft, width:this.center.style.width, display: ''});
			this.fx.image.start(1);
			break;
		case 4:
			if (this.options.animateCaption){
				// This is not smooth animation in IE 6 with XML prolog.
				// If your site is XHTML strict with XML prolog, disable this option.
				this.fx.bottom.start(0,this.bottom.offsetHeight+10);
				break;
			}
			this.bottomContainer.style.height = (this.bottom.offsetHeight+10)+'px';
		case 5:
			if (this.activeItem){
				this.prevLink.style.display = '';
			}
			if (this.activeItem != (this.items.length - 1)){
				this.nextLink.style.display = '';
			}
			this.step = 0;
		}
	},

	close: function(){
		if (this.step < 0) return;
		this.step = -1;
		this.removeCurrentItem();	// discard content
		for (var f in this.fx) this.fx[f].stop();
		this.center.style.display = this.bottomContainer.style.display = 'none';
		this.fx.overlay.chain(this.setup.pass(false, this)).start(0);
		hopp();
		return false;
	},

	printOrSave: function(mode){
		if (this.options.psScriptPath) {
			var myRef = window.open(this.options.psScriptPath+'?mode='+mode+'&image='+this.items[this.activeItem][0],'printsave', 'left=0,top=0,width='+(parseInt(this.canvas.style.width))+',height='+ (parseInt(this.canvas.style.height)) +',toolbar=0,resizable=1');
			return false; // needed to prevent the calling page to reload
		}
		return true;
	},
	
	removeCurrentItem: function(){
		if (this.preload){
			if( this.preload.datatype == 'image' ) {
				$('lbImage').remove();
				this.preload.onload = Class.empty;
			}else{
				$(this.iframeId).remove();
			}
			this.preload = null;
		}		
	},

	matchOrDefault: function(str, re, val){
		var hasQuery = str.match(re);
		return hasQuery ? hasQuery[1] : val;
	}

};

//window.addEvent('domready', Lightbox.init.bind(Lightbox));
