$(document).ready(function() {
	
	// Hide the default title tooltip
	$('.tooltip [title]').each( function() {
	    var $this = $(this);
	    $this.data('title',$this.attr('title'));
	    $this.removeAttr('title');
	});
	
	// Use the each() method to gain access to each elements attributes
	$('.tooltip a[rel]').each(function()
		{
			$(this).qtip(
				{
					content: {
						text: '<img class="throbber" src="/global/img/spinner.gif" alt="Loading..." />',
						url: $(this).attr('rel')
						},
					position: {
						corner: { target: 'rightMiddle', tooltip: 'leftMiddle' },
						adjust: { screen: true }
						},
					show: {
						delay: 200,
						effect: { type: 'fade', length: 260 },
						solo: true
						},
					hide: {
						delay: 100,
						effect: { type: 'fade', length: 100 }
						},
					style: {
						tip: true,
						width: 240,
						padding: 10,
						background: '#333333',
						color: '#ffffff',
						border: { width: 0, radius: 8, color: '#333333' },
						name: 'dark'
						}
				}).removeAttr('alt').removeAttr('title');				
		});
});
