$(document).ready(function() {
	var sign = '';
	$('#member-signs li.sign').mouseover(
		function()
		{
			sign = $(this);
			
			$('#tt-content #tt-logo #tt-img').attr( 'src', ttDetails[$(this).attr('rel')]['logo'] );
			$('#tt-content #tt-heading').html( ttDetails[$(this).attr('rel')]['heading'] );
			$('#tt-content #tt-description').html( ttDetails[$(this).attr('rel')]['content'] );
			
			$('#tooltip').fadeIn( { duration:100 } );
		}
	).mouseout(
		function()
		{ 
			$('#tooltip').fadeOut( { duration:0 } );
			$('#tt-content #tt-logo #tt-img').attr( 'src', '' );
			$('#tt-content #tt-heading').html( '' );
			$('#tt-content #tt-description').html( '' );
		}
	);
	$('body').mousemove(
		function(e)
		{
			mX = e.pageX;
			mY = e.pageY;
			signOffset = $(this).offset();
			tooltipWidth = $("#tooltip").width();
			$("#tooltip").css( { "left": ( mX - ( tooltipWidth/2 ) ) + "px", "top":(mY-($("#tooltip").height()+10)) + "px" } );
		}
	);
});

function elementBox(e)
{
	var tooltipOffset = e.offset();
	return { 
		top: tooltipOffset.top, 
		right: tooltipOffset.left + e.width(), 
		bottom: tooltipOffset.top + e.height(), 
		left: tooltipOffset.left
		};
}

// Tooltip details
var ttDetails = {

	'dba':{ 'logo':'/graphics/logo.tooltip.dba.gif', 'heading':'Disc Brakes Australia', 'content':'Australia\'s leader in innovative development and the production of performance disc brake rotors.' },
	'csiro':{ 'logo':'/graphics/logo.tooltip.csiro.gif', 'heading':'CSIRO', 'content':'Providing integrated engineering solutions to the automotive industry.' },
	'aits':{ 'logo':'/graphics/logo.tooltip.aits.gif', 'heading':'Air International Thermal Systems', 'content':'Powertrain cooling components and systems.' },
	'dc':{ 'logo':'/graphics/logo.tooltip.dc.gif', 'heading':'Davies, Craig', 'content':'Manufacturer and marketer of advanced automotive cooling technology.' },
	'dcr':{ 'logo':'/graphics/logo.tooltip.dcr.gif', 'heading':'DC Ross', 'content':'Australasia\'s only dedicated fine blanked component manufacturing company.' },
	'ntcp':{ 'logo':'', 'heading':'', 'content':'' },
	'tmag':{ 'logo':'/graphics/logo.tooltip.tmag.gif', 'heading':'T-Mag', 'content':'Advanced permanent-mould magnesium casting technology.' },
	'fa':{ 'logo':'/graphics/logo.tooltip.fa.gif', 'heading':'Futuris Automotive', 'content':'Advancing consumer comfort, safety and convenience through complete design.' },
	'lumen':{ 'logo':'/graphics/logo.tooltip.lumen.gif', 'heading':'Lumen Australia', 'content':'Global supplier of automotive wiring, electronics and plastic components.' },
	'clutch':{ 'logo':'/graphics/logo.tooltip.clutch.gif', 'heading':'Clutch Industries', 'content':'Manufacturers, tests, and prototypes automotive clutches.' },
	'cit':{ 'logo':'/graphics/logo.tooltip.cit.gif', 'heading':'CIT', 'content':'Manufactures advanced interior and exterior OEM coatings for automotive applications.' }
	
};
