$('document').ready(function()
{
	// This is done to allow for tooltipRemotes to use
	// inline-anchor style URLs to specify which div to load
	// ex: href='/filename.php#myDivId' will load the div with 'myDivId'
	// into the tooltip

	$('.tooltipRemote').each(function()
	{
		if($(this).attr('href').indexOf('#'))
		{
			remoteUrl = $(this).attr('href').split('#');
			remoteUrl = remoteUrl[0]+' div#'+remoteUrl[1];
		}
        
		$(this).bt(
		{
			fill: 'white',
			ajaxPath: remoteUrl,
			cssStyles: { color: 'black'},
			shrinkToFit: true,
			width: 450,
			padding: 10,
			shadow: true,
			shadowBlur: 8,
			shadowOffsetX: 3,
			shadowOffsetY: 3,
			shadowColor: 'rgba(0,0,0,.9)',
			noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
			cornerRadius: 10,
			spikeLength: 20,
			spikeGirth: 15,
			positions: ['top','bottom','right','left']
		}).click(function () { return false; });
	});

    $('.tooltipClickRemote').each(function()
	{
		if($(this).attr('href') != "")
		{
			remoteUrl = $(this).attr('href');
		}

		$(this).bt(
		{
            trigger: 'click',
			fill: 'white',
			ajaxPath: remoteUrl,
			cssStyles: { color: 'black'},
            shrinkToFit: true,
			width: 700,
			padding: 10,
            shadow: true,
			shadowBlur: 8,
			shadowOffsetX: 3,
			shadowOffsetY: 3,
			shadowColor: 'rgba(0,0,0,.9)',
			noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
			cornerRadius: 10,
            closeWhenOthersOpen: true,
			spikeLength: 20,
			spikeGirth: 15,
			positions: ['top','bottom','right','left']
		}).click(function () { return false; });
	});

	// This simply takes the title of the anchor
	//  and uses it for the tooltip

	$('.tooltipTitle').bt(
	{
	  fill: 'white',
	  cssStyles: { color: 'black'},
	  shrinkToFit: true,
	  padding: 10,
	  cornerRadius: 10,
	  spikeLength: 20,
	  spikeGirth: 15,
	  positions: ['top','bottom','right','left']
	})
});
