<!--
// jQuery functions
$(document).ready(function() {
	$('.RegInput').hover(
	function() {
		$(this).addClass('BoxHover');
	},
	function() {
		$(this).removeClass('BoxHover');
	});
	$('.RegInputSm').hover(
	function() {
		$(this).addClass('BoxHoverSm');
	},
	function() {
		$(this).removeClass('BoxHoverSm');
	});
	
	//show or hide kids or adult selection boxes on page load
	//alert($("input[@name='CompetitionType']:checked").val());
	/*if ($("input[@name='CompetitionType']:checked").val() == "Kids") { 
		$(".__Kids").show(); 
		$(".__Adults").hide();
	} else {
		$(".__Kids").hide(); 
		$(".__Adults").show();
	}*/
	
	switch ($("input[@name='CompetitionType']:checked").val()) {
		case "Kids": 
			$(".__Kids").show(); 
			$(".__Men").hide();
			$(".__Women").hide();
			break;
		case "Men": 
			$(".__Kids").hide(); 
			$(".__Men").show();
			$(".__Women").hide();
			break;
		case "Women": 
			$(".__Kids").hide(); 
			$(".__Men").hide();
			$(".__Women").show();
			break;
		default : 
			$(".__Kids").show(); 
			$(".__Men").hide();
			$(".__Women").hide();
			break;
	}

	
	//click handler for kids and adults
	$("input[@name='CompetitionType']").click(function() {
		/*if ($("input[@name='CompetitionType']:checked").val() == "Kids") {
			$(".__Kids").show(); 
			$(".__Adults").hide();
		} else {
			$(".__Kids").hide(); 
			$(".__Adults").show();
			$(this).blur();
		}*/
		
		switch ($("input[@name='CompetitionType']:checked").val()) {
			case "Kids": 
				$(".__Kids").show(); 
				$(".__Men").hide();
				$(".__Women").hide();
				break;
			case "Men": 
				$(".__Kids").hide(); 
				$(".__Men").show();
				$(".__Women").hide();
				break;
			case "Women": 
				$(".__Kids").hide(); 
				$(".__Men").hide();
				$(".__Women").show();
				break;
			default : 
				$(".__Kids").show(); 
				$(".__Men").hide();
				$(".__Women").hide();
				break;
		}
	});

});

	
// check registration form
function CheckRequired() {
   	if (document.RegistrationForm.RegType.value=='') {
   	   alert('Reg Type - (empty required field)');
   	   document.RegistrationForm.RegType.focus();
   	   return false;
   	}
	if (document.RegistrationForm.UserName.value=='') {
   	   alert('User Name - (empty required field)');
   	   document.RegistrationForm.UserName.focus();
   	   return false;
   	}
	if (document.RegistrationForm.EmailAddress.value=='') {
   	   alert('Email address - (empty required field)');
   	   document.RegistrationForm.EmailAddress.focus();
   	   return false;
   	}
	if (document.RegistrationForm.FirstName.value=='') {
   	   alert('First Name - (empty required field)');
   	   document.RegistrationForm.FirstName.focus();
   	   return false;
   	}
	if (document.RegistrationForm.LastName.value=='') {
   	   alert('Last Name - (empty required field)');
   	   document.RegistrationForm.LastName.focus();
   	   return false;
   	}
	if (document.RegistrationForm.DateOfBirth.value=='') {
   	   alert('Date Of Birth - (empty required field)');
   	   document.RegistrationForm.DateOfBirth.focus();
   	   return false;
   	}
	if (document.RegistrationForm.Gender.value=='') {
   	   alert('Gender - (empty required field)');
   	   document.RegistrationForm.Gender.focus();
   	   return false;
   	}
	if (document.RegistrationForm.EmergencyName.value=='') {
   	   alert('Emergency Name - (empty required field)');
   	   document.RegistrationForm.EmergencyName.focus();
   	   return false;
   	}
	if (document.RegistrationForm.EmergencyPhone.value=='') {
   	   alert('Emergency Phone - (empty required field)');
   	   document.RegistrationForm.EmergencyPhone.focus();
   	   return false;
   	}
	return true;
}

// check registration form
function CheckRequiredStep1() {
	if (document.RegistrationForm1.FirstName.value=='') {
   	   alert('First Name - (empty required field)');
   	   document.RegistrationForm1.FirstName.focus();
   	   return false;
   	}
	if (document.RegistrationForm1.LastName.value=='') {
   	   alert('Last Name - (empty required field)');
   	   document.RegistrationForm1.LastName.focus();
   	   return false;
   	}
	if (document.RegistrationForm1.DateOfBirth.value=='') {
   	   alert('Date Of Birth - (empty required field)');
   	   document.RegistrationForm1.DateOfBirth.focus();
   	   return false;
   	}
	if (document.RegistrationForm1.Gender.value=='') {
   	   alert('Gender - (empty required field)');
   	   document.RegistrationForm1.Gender.focus();
   	   return false;
   	}
	if (document.RegistrationForm1.EmailAddress.value=='') {
   	   alert('Email address - (empty required field)');
   	   document.RegistrationForm1.EmailAddress.focus();
   	   return false;
   	}
	return true;
}

// check registration form
function CheckRequiredStep2() {
	// check competition type radio
	var f1 = document.RegistrationForm2.CompetitionType;
	var f1choice = false;
	for (counter = 0; counter < f1.length; counter++) {
		if (f1[counter].checked)
		f1choice = true; }
	if (!f1choice) {
		alert('Competition Type - (empty required field)');
		f1[0].focus();
		return (false);	}
	
	
	//alert(document.RegistrationForm2.AgeAdult.value);
	if ($("input[@name='CompetitionType']:checked").val() == "Kids") {
		// check division radio
		var f2 = document.RegistrationForm2.DivisionKids;
		var f2choice = false;
		for (counter = 0; counter < f2.length; counter++) {
			if (f2[counter].checked)
			f2choice = true; }
		if (!f2choice) {
			alert('Division - (empty required field)');
			f2[0].focus();
			return (false);	}
		
		// check age radio
		var f3 = document.RegistrationForm2.AgeKids;
		var f3choice = false;
		for (counter = 0; counter < f3.length; counter++) {
			if (f3[counter].checked)
			f3choice = true; }
		if (!f3choice) {
			alert('Age - (empty required field)');
			f3[0].focus();
			return (false);	}
		
		// check weight radio
		var f4 = document.RegistrationForm2.WeightKids;
		var f4choice = false;
		for (counter = 0; counter < f4.length; counter++) {
			if (f4[counter].checked)
			f4choice = true; }
		if (!f4choice) {
			alert('Weight - (empty required field)');
			f4[0].focus();
			return (false);	}
			
	} else {
		// check division radio
		var f2 = document.RegistrationForm2.DivisionAdults;
		var f2choice = false;
		for (counter = 0; counter < f2.length; counter++) {
			if (f2[counter].checked)
			f2choice = true; }
		if (!f2choice) {
			alert('Division - (empty required field)');
			f2[0].focus();
			return (false);	}
		
		// check age input box
		if (document.RegistrationForm2.AgeAdults.value=='') {
		   alert('Age - (empty required field)');
		   document.RegistrationForm2.AgeAdults.focus();
		   return (false); }
		
		// check weight radio
		var f4 = document.RegistrationForm2.WeightAdults;
		var f4choice = false;
		for (counter = 0; counter < f4.length; counter++) {
			if (f4[counter].checked)
			f4choice = true; }
		if (!f4choice) {
			alert('Weight - (empty required field)');
			f4[0].focus();
			return (false);	}
	}
		
	// check division count radio
	var f5 = document.RegistrationForm2.DivisionCount;
	var f5choice = false;
	for (counter = 0; counter < f5.length; counter++) {
		if (f5[counter].checked)
		f5choice = true; }
	if (!f5choice) {
		alert('Divisions You Want to Compete - (empty required field)');
		f5[0].focus();
		return (false);	}
		
	return true;
}
-->