$(document).ready(function()
{
	// if the institution type radio button value
	// is changed then display either 
	// the corporate or academic fields
	
	$('.academic_field').hide();
	$('.corporate_field').hide();
	$('#institution_field').hide();


	$('.institution_type_select').click(function()
	{
		var institution_type = $(this).attr('value');
		if (institution_type == 'Academic')
		{
			$('.academic_field').show();
			$('.corporate_field').hide();
			$('#institution_field').show();
			$("input[name='institution_type']").val('Academic');
		}
		else if (institution_type == 'Corporate')
		{
			$('.academic_field').hide();
			$('.corporate_field').show();
			$('#institution_field').show();
			$("input[name='institution_type']").val('Corporate'); 
		}
	});

	// IE Fix to ensure that the the correct institution type is
	// clicked and the proper items are visible when the user
	// clicks the <back> button to come back to the guest access
	// page.
	$("input[name='institution_type_select']:checked").trigger('click'); 
});

