$(document).ready(
	function()
	{
		/**
		 * By default, all the versions are visible.
		 * JS makes the versions unvisible if there are more than one versions. 
		 */

		$('.version_link').click(
			function()
			{
				var id = $(this).attr('id').substring(8);
				var versionPricing = '#version_' + id + '_pricing';

				$(versionPricing).toggle();
				refreshSeePriceButton(id);

				return false;
			}
		);

		$('.version_link').each(function(){
			var id = $(this).attr('id').substring(8);
			refreshSeePriceButton(id);
		});
		
	}
);

function refreshSeePriceButton(id)
{
	var versionPricing = '#version_' + id + '_pricing';
	var seePricesButton = '#version_' + id;

	if ($(versionPricing).css('display') == 'none') {
		$(seePricesButton).text('see prices');
	} else {
		$(seePricesButton).text('hide prices');
	}
}

