$(document).ready(function() {
		
	$('.helpInfo:not(.helpInfoBlock)').prepend('<span>Help - </span> ');
	$('.helpInfoBlock').prepend('<span>Help</span><br /><br />');

	//initially hide all help items
	$('.helpInfo').hide();
	
	// append a question mark on any object that needs help displayed
	$('.help').each(function(index) {
		link = '<a href="#" class="helpButton" onclick="return toggleHelp(' + index;
		link += ');"><span>?</span></a>';
		$(this).after(link);
	});

	// if there is an extra float class, place absolute positioning on the
	// helpInfo
	$('.helpInfo.helpInfoFloat').each(function(index) {
		var posLeft = $('.helpButton:eq(' + index + ')').position().left + 40;
		$(this).css('position', 'absolute');
		$(this).css('z-index', '1000');
		$(this).css('left', posLeft);
	});
	
	$('.helpInfo.helpInfoFloatLeft').each(function(index) {
		var posLeft = $('.help:eq(' + index + ')').position().left + 170;
		$(this).css('position', 'absolute');
		$(this).css('left', posLeft);
	});

	$('.helpInfo.helpInfoBlock.helpInfoFloat.largeInfo').each(function(index) {
		var posLeft = $('.help:eq(' + index + ')').position().left + parseInt($(this).css('width')) + 20;
		$(this).css('position', 'absolute');
		$(this).css('left', posLeft);
	});
});


function toggleHelp(index)
{
	// hide all of the help before any are shown
	$('.helpInfo:not(:eq(' + index + '))').hide();

	if($('.helpInfo:eq(' + index + ')').css('display') == 'none')
	{
		$('.helpInfo:eq(' + index + ')').show();
	}
	else
	{
		$('.helpInfo:eq(' + index + ')').hide();
	}

	return false;
}

