window.addEvent('load', function() {
	ReMooz.assign();

	$$('a[title$=lightbox]').each(function(element) {
		srcPath = element.title.replace( /:lightbox$/, '' );
		element.title = '';
		element.rel = srcPath;
		 
		element.addEvent( 'ckick', function (){
			alert('ok');
		});
		
		new ReMooz(element, {
			'shadow': 'onOpenEnd',
			'resizeFactor': 0.8, 
			'cutOut': false, 
			'opacityResize': 0.4, 
			'dragging': false, 
			'centered': true,
			'onBuild': function (){
				//console.info( $(this.box) );				 	
				this.box.getElement('.remooz-body').addEvent('click', function(){
					// window.open( this, this, '');
					popupWin = 	window.open( this, this, '');
					popupWin.focus();
					//console.info( 'a');
				}.bind( this.element.rel ));				
			} 
						
		});
 
    });

});
