function titleFormatCallback(data) {

	var myData = unescape(data);
	var myCaption = "<p>" + data + "</p>";
	
	dataParts = myData.split("|");
	if (dataParts.length > 1) myCaption = '<p>' + dataParts[0] + '<br /><a target="_blank" href="' + dataParts[1] + '">' + dataParts[1] + '</a></p>';
	if (dataParts.length > 2) myCaption = '<div>' + dataParts[2] + '</div>' + myCaption;
	
	return myCaption;
	
}

$(window).bind("load",function(){

	$("a.fancybox").fancybox({
		titlePosition	: 'inside',
		titleFormat		: titleFormatCallback,
		centerOnScroll	: true,
		overlayOpacity	: 0.8,
		overlayColor	: '#000'
	});

});
