	$(document).ready(function() {
	  // The below code will re-position the dynamic and fixed registration elements
	  $teamSizeInput = $("#teamSize").outerHTML();
	  $("#teamSize").remove();
	  $("#formInputs").prepend($teamSizeInput);

	  $teamLengthInput = $("#QUESTION_4").outerHTML();
	  $("#QUESTION_4").remove();
	  $("#formInputs").prepend($teamLengthInput);

	  $teamChallangeInput = $("#QUESTION_3").outerHTML();
	  $("#QUESTION_3").remove();
	  $("#formInputs").prepend($teamChallangeInput);

	  $teamNameInput = $("#QUESTION_2").outerHTML();
	  $("#QUESTION_2").remove();
	  $("#formInputs").prepend($teamNameInput);

	  // adding h3 header for first team member details (size, name, event)
	  $("#QUESTION_6").before("<h3>First Team Member Details:</h3>");

	  // adding h3 header for additional team details (size, name, event)
	  $("#QUESTION_9").prepend("<h3>Additional Team Details (if more than 2 members):</h3>");

	  // adding a h3 header for the payment info
	  $("#QUESTION_18").before("<h3>Payment Details:</h3>");

	  $("#formInputs").append("PLEDGE CHALLENGE - the system will ask you to submit payment after you have registered; please ignore this request. CHEQUES - Please send cheque payments to Halifax Regional Search & Rescue, 71 Juniper Way, Hubley, NS, B3Z 0A2.");

	  // The below code handles the show/hide of team member inputs based on team size
	  $("#num_people").change(function()
	  {
		  var $teamSize =  $('select#num_people option:selected').val();

		  if( $teamSize == 2 )
		  {
			  	$("#QUESTION_9").hide();
			  	$("#QUESTION_10").hide();
			  	$("#QUESTION_11").hide();

		  		$("#QUESTION_12").hide();
		  		$("#QUESTION_13").hide();
		  		$("#QUESTION_14").hide();

		  		$("#QUESTION_15").hide();
		  		$("#QUESTION_16").hide();
		  		$("#QUESTION_17").hide();
		  }
		  else if( $teamSize == 3 )
		  {
		  		$("#QUESTION_9").show();
		  		$("#QUESTION_10").show();
		  		$("#QUESTION_11").show();

		  		$("#QUESTION_12").hide();
		  		$("#QUESTION_13").hide();
		  		$("#QUESTION_14").hide();

		  		$("#QUESTION_15").hide();
		  		$("#QUESTION_16").hide();
		  		$("#QUESTION_17").hide();
		  }
		  else if( $teamSize == 4 )
		  {
		  		$("#QUESTION_9").show();
		  		$("#QUESTION_10").show();
		  		$("#QUESTION_11").show();

		  		$("#QUESTION_12").show();
		  		$("#QUESTION_13").show();
		  		$("#QUESTION_14").show();

		  		$("#QUESTION_15").hide();
		  		$("#QUESTION_16").hide();
		  		$("#QUESTION_17").hide();
		  }
		  else if( $teamSize == 5 )
		  {
			  	$("#QUESTION_9").show();
		  		$("#QUESTION_10").show();
		  		$("#QUESTION_11").show();

		  		$("#QUESTION_12").show();
		  		$("#QUESTION_13").show();
		  		$("#QUESTION_14").show();

		  		$("#QUESTION_15").show();
		  		$("#QUESTION_16").show();
		  		$("#QUESTION_17").show();
		  }
	  });
  });

