// Create the tooltips only on document load
$(document).ready(function() {
	// Match all link elements with href attributes within the content div
	$('td.displayImage').each(function() {
		$(this).qtip({
			content : {
				text : '<img src="' + $(this).attr('title') + '" />',
				url : false, //$(this).attr('title'),
				title : {
					text : $(this).attr('name'),
					button : 'Close'
				}
			},

			position : {
				my : 'top left', // Position my top left...
				at : 'top left', // at the bottom right of...
				target : $('.displayImage'), // my target
				adjust : {
					x : 80
				}
			},

			show : {
				event: 'click',
				solo : true, // And hide all other tooltips
				modal: true
			},

			hide : {
				fixed : true,
				when : {
					event : 'unfocus'
				},
			},

			style : {
				tip : {
					corner : false
				},
				classes: 'ui-tooltip-dark ui-tooltip-jtools',
				width: parseInt($(this).attr('wsize')) + 19
			}

		})

	});
});
