/* OLD CODE - BEFORE FORM WAS CHANGED 20110926
$(document).ready(function(){	
	//Add a new input field that sets the payment method type to free as default
	$('<input type="radio" value="10" id="free" name="PaymentMethodType" selected="true" style="display:none;"C/><input type="radio" value="1" id="creditCard" name="PaymentMethodType" selected="true"  style="display:none;"C />').appendTo("table.webform");

	function hideFields(){   
		//change the payment method type to free
		$("input#free").attr("checked",true);
		$("input#creditCard").attr("checked",false);
		//Hide credit card fields
		$("input#CardName").parent().parent().hide("slow");
		$("input#CardNumber").parent().parent().hide("slow");
		$("select#CardExpiryMonth").parent().parent().hide("slow");
		$("input#CardCCV").parent().parent().hide("slow");
		$("select#CardType").parent().parent().hide("slow");
		$("input#Amount").parent().parent().hide("slow");
		//Hide ticket number fields
		$("input#CAT_Custom_107537").parent().parent().hide("slow");		
		//Hide member name
		$("input#CAT_Custom_107538").parent().parent().hide("slow");
		//Hide Promo Code
		$("input#CAT_Custom_107539").parent().parent().hide("slow");
	};
	
	function showVipTicketHolder(){    
			hideFields();
		 //show the ticket number fields
			$("input#CAT_Custom_107537").parent().parent().show("slow");
	};
	
	function showMemberGuest(){    
			hideFields();
		 //show the member name field
			$("input#CAT_Custom_107538").parent().parent().show("slow");
	};
		function showGuest(){    
		hideFields();
		//change the payment method type to credit card
		$("input#free").attr("checked",false);
		$("input#creditCard").attr("checked",true);
		 //show the hidden fields
		 	$("input#CardName").parent().parent().show("slow");
			$("input#CardNumber").parent().parent().show("slow");
			$("select#CardExpiryMonth").parent().parent().show("slow");
			$("input#CardCCV").parent().parent().show("slow");
			$("select#CardType").parent().parent().show("slow");
			$("input#Amount").parent().parent().show("slow");
			$("input#CAT_Custom_107539").parent().parent().show("slow");	
	};
	
	//Run the hide function so the cc fields are hidden initailly
	hideFields();
	
	//Detect changes in the "attendee type" radio buttons
	$("input#CAT_Custom_107536_0").click(function(){ showGuest() });
	 $("input#CAT_Custom_107536_1").click(function(){ showVipTicketHolder() });
	 $("input#CAT_Custom_107536_2").click(function(){ showMemberGuest() });
	 	 
});
*/
$(document).ready(function(){	
	//Add a new input field that sets the payment method type to free as default
	$('<input type="radio" value="10" id="free" name="PaymentMethodType" selected="true" style="display:none;"C/><input type="radio" value="1" id="creditCard" name="PaymentMethodType" selected="true"  style="display:none;"C />').appendTo("table.webform");

	function hideFields(){   
		//change the payment method type to free
		$("input#free").attr("checked",true);
		$("input#creditCard").attr("checked",false);
		//Hide credit card fields
		$("input#CardName").parent().parent().hide("slow");
		$("input#CardNumber").parent().parent().hide("slow");
		$("select#CardExpiryMonth").parent().parent().hide("slow");
		$("input#CardCCV").parent().parent().hide("slow");
		$("select#CardType").parent().parent().hide("slow");
		$("input#Amount").parent().parent().hide("slow");
		//Hide ticket number fields
		$("input#CAT_Custom_128683").parent().parent().hide("slow");		
		//Hide member name
		$("input#CAT_Custom_128684").parent().parent().hide("slow");
		//Hide Promo Code
		$("input#CAT_Custom_128685").parent().parent().hide("slow");
	};
	
	function showVipTicketHolder(){    
			hideFields();
		 //show the ticket number fields
			$("input#CAT_Custom_128683").parent().parent().show("slow");
	};
	
	function showMemberGuest(){    
			hideFields();
		 //show the member name field
			$("input#CAT_Custom_128684").parent().parent().show("slow");
	};
		function showGuest(){    
		hideFields();
		//change the payment method type to credit card
		$("input#free").attr("checked",false);
		$("input#creditCard").attr("checked",true);
		 //show the hidden fields
		 	$("input#CardName").parent().parent().show("slow");
			$("input#CardNumber").parent().parent().show("slow");
			$("select#CardExpiryMonth").parent().parent().show("slow");
			$("input#CardCCV").parent().parent().show("slow");
			$("select#CardType").parent().parent().show("slow");
			$("input#Amount").parent().parent().show("slow");
			$("input#CAT_Custom_107539").parent().parent().show("slow");	
	};
	
	//Run the hide function so the cc fields are hidden initailly
	hideFields();
	
	//Detect changes in the "attendee type" radio buttons
	$("input#CAT_Custom_128686_0").click(function(){ showGuest() });
	 $("input#CAT_Custom_128686_1").click(function(){ showVipTicketHolder() });
	 $("input#CAT_Custom_128686_2").click(function(){ showMemberGuest() });
	 	 
});
