if('undefined' == typeof Emv.Videode.Callback) {
	
	Emv.Videode.Callback = {};
}

/**
 * this callback loads an overlay on coverflow click
 * image source is taken from event object and modified with lokal imgMode to get Fullsize image url
 *
 */
Emv.Videode.Callback.Fullpage = function(overlayId) {
	
	this.overlayId = overlayId;
	
	/**
	 * mode, for imageserver - those mode is used for overlay image size
	 * @param string - imageserver mode
	 */
	this.imgMode   = 'b600x400';
	this.lastEvent = null;

	this.imageClicked = function(event) {
		
		this.showOverlayForEvent(event);
	};

	this.showOverlayForEvent = function(event) {
        
		var imageUrl = event.params.imageUrl;
        var copy     = (event.params.copyright != '' ) ? ' (Foto: ' + event.params.copyright +')' : '';

        //replace default fpc image size with needed mode
        imageUrl = imageUrl.replace(new RegExp("[bfwmh0-9]*\.jpg",  "gi"), this.imgMode + ".jpg");

        Emv.Effects.Overlay.Image.show(this.overlayId, imageUrl, event.params.text + copy);

        var overlaySubtitle = document.getElementById(this.overlayId + '_subtitle');
        if (overlaySubtitle) {

            overlaySubtitle.innerHTML = unescape(event.params.text + copy);
        }
    };

    this.showImageForLastEvent = function() {
    	
    	this.showOverlayForEvent(this.lastEvent);
    };

    this.imageLoaded = function(event) {
        
    	this.lastEvent = event;
    };

};
