var myLMightbox = {
    lightbox: null,
    init: function(){
		var lang = $$('html')[0].getAttribute('lang');
        this.lightbox = new Lightbox(
	
		{
		loadingimg:'resource/loading.gif',
		expandimg:'resource/expand.gif',
		shrinkimg:'resource/shrink.gif',
		blankimg:'resource/blank.gif',
		previmg:'resource/prev.gif',
		nextimg:'resource/next.gif',
		closeimg:'resource/close.gif',
		effectimg:'resource/zzoop.gif',
		effectpos:{x:-40,y:-20},
		effectclass:'effectable',
		resizable:true,
		animation:true
		}

	);
		if($('bottomNavClose')){
			$$('#bottomNavClose img')[0].setAttribute('src', '/images/closelabel_'+lang+'.gif');		
		}
    },
    openZoom: function(photo,legend,targetUrl){
    		var lang = $$('html')[0].getAttribute('lang');
		new Ajax.Request(targetUrl+'?url='+encodeURIComponent(photo)+'&lang='+lang+'&cat=virt', {method: 'get', onSuccess: function(response){
			this.lightbox.start(Builder.node('a',{rel:'lightbox', href:photo, title: response.responseText}));
		}.bind(this)});
    }
}

function openZoom(photo,legend,targetUrl){
    if(targetUrl == null) targetUrl = '/xml/get_image_data.php';
    else if(targetUrl == '') targetUrl = '/xml/get_image_data.php';
    myLMightbox.openZoom(photo,legend,targetUrl);
}
Event.observe(window, 'load', function (){myLMightbox.init();});

