/**
 * @author tibork
 */
var QtipInit = function(){
	$('#items-repeater .corner-item[rel]').each(function(){
		$(this).qtip({
			content: {
				prerender: true,
				// Set the text to an image HTML string with the correct src URL to the loading image you want to use
				text: "<img src='/images/loading.gif' alt='Loading...' />",
				url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load
				title: {
					text: 'SUMAR:', // + $(this).text(), // Give the tooltip a title using each elements text
					button: 'Close' // Show a close link in the title
				}
			},
			position: {
				corner: {
					target: 'bottomMiddle', // Position the tooltip above the link
					tooltip: 'topMiddle'
				},
				//scroll:true,
				adjust: {
					screen: true // Keep the tooltip on-screen at all times
				}
			},
			show: {
				delay: 100,
				when: 'click',
				solo: true // Only show one tooltip at a time
			},
			hide:  {
				delay: 300,
				fixed: true,
				when: 'mouseout'
			},
			style: {
				tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
				border: {
					width: 3,
					radius: 6
				},
				name: 'light', // Use the default light style
				width: 570 // Set the tooltip width
			}
		})
	});
}
