function selectSponsor() {
	if ($("select#sponsor_type").val() == 'Rotary Club'){
		$('#club').show('fast');
		$('#company').hide();
	} else if ($("select#sponsor_type").val() == 'Company'){
		$('#company').show('fast');
		$('#club').hide();
	} else {
		$('#club').hide();
		$('#company').hide();
	}
};


$(function(){
	$(".menu input").click(function () { 
		returnMeHere = "/applications/" + $(this).val();
		$("#application_form .hiddenFields input[name='return']").val(returnMeHere);
 	});

	// Hide postal Address in application if not neeeded
	if ($("#postal_address_1").val() == ''){
		$('#postal_address').hide();
	}
	$('a#show_postal_address').click(function(){
		$('#postal_address').show('fast');
		$('a#show_postal_address').hide('fast');
	});
	$('a#hide_postal_address').click(function(){
		$('#postal_address').hide('fast');
		$('a#show_postal_address').show('fast');
	});

	// Show or hide the sponsor club or company div
	selectSponsor();
	$("select#sponsor_type").click(function () { 
		selectSponsor();
 	});
	
 });

