$(document).ready(function ()
{
	// 1) Push the text into links attributes
	$('.studies_lightscreenable').each(function ()
	{
		var text = '';
		
		var parent_class = $(this).parent().attr('class');
		switch (parent_class)
		{
			case 'studies_title': // <h2 class="studies_title">
			case 'studies_thumbnail': // <div class="studies_thumbnail">
				text = $('.studies_text input[name=studies_text]', $(this).parent().parent()).val();
				break;
			case 'studies_text': // <div class="studies_text">
				text = $('input[name="studies_text"]', $(this).parent()).val();
				break;
		}
		
		$(this).attr('rel', text);		
	});
	
	// 2) Active the bind
	// No grouping !
	$('.studies_lightscreenable').each(function()
	{
		$(this).lightBox({
			imageLoading: '/img/notext/lightbox-ico-loading.gif',
			imageBtnClose: '/img/notext/lightbox-btn-close.gif',
			imageBlank: '/img/notext/lightbox-blank.gif',
			textContener: 'rel' /* Patch by KEWEGO, hide title native tooltip */
		});
	});
});
