/*
 * Kara Framework - Domain KaraJoomla15 - Class JoomlaLightbox
 *
 * (c) 2006-2009 Pete Hatton
 * 
 * JQuery Lightbox for Joomla - wraps any image with a lightbox
 * if they have the joomla_lightbox class
 */
$kjq(document).ready(function($)
{
	// Create links for the lightbox plugin
	$('img.joomla_lightbox').each(function ()
	{
		// Get URL
		url=$(this).attr('src');
		// Get caption
		caption=$(this).attr('title');
		if (caption=='')
		{
			caption=$(this).attr('alt');
		}
		// Wrap the image
		// console.log('URL is '+url);
		// console.log('caption is '+caption);
		html='<a href="'+url+'" class="joomla_lightbox" title="'+caption+'"></a>';
		$(this).wrap(html);
	});
	
	// Apply the lightbox to the images
	$('a.joomla_lightbox').lightbox(
	{
		show_linkback: false,
		ie6_upgrade: false,
		opacity:0.5
	});
	

});
