function DetailedView(rootElement, entryData) {

	var createCarousel = function() {
	    rootElement.find(".l2_slider").jcarousel({
	    	size: entryData.images.slice(1).size(),
	    	visible: 1,
	    	scroll: 1, 
		  	wrap: 'last',
		  	itemLoadCallback: imgLoadCallbackFunc
		});
	}
		  
	var imgLoadCallbackFunc = function(carousel, state) {
	 	if (state != 'init')
			return;
			
		entryData.images.slice(1).each(function(index){		
			carousel.add(index, $(this));
		});
	}

	var closeDetailedView = function() {
		rootElement.dialog('close');
	}

	var addCloseButton = function() {
		var button = $('<div></div>').addClass("close_button").click(closeDetailedView);
		rootElement.append(button);
	}

	createCarousel();
	rootElement.dialog({ position: [ 'center', 34 ] });
	rootElement.dialog({ height: 500 });
	addCloseButton();

	
}
	
