jQuery.fn.popUpImage = function(config)
{	
	var currentId = $(this).attr('id');
	if (currentId!=null)
	{
		pt = $("#"+currentId);
		$("img",pt.get(0)).each(function(i)
		{
			if ($(this).attr('src'))
			{
				src = $(this).attr('src');
				title = $(this).attr('title') || "";
				newSrc = src.substr(0,src.lastIndexOf('.jpg'))+'.jpg';
				$(this).before($('<a href="'+newSrc+'" title="'+title+'" rel="lightbox[gallery]"></a>').append($(this).clone()));
				$(this).remove();
			}else{
				$(this).remove();
			}
		});
	}
}
