$(document).ready(function(){		
	
	//Weekly
	$('#EvaluationRepTestType1').click(function() {
		$('#invoiceCriteria1').show();
		$('#invoiceCriteria2').show();
	});
	
	//Monthly 
	$('#EvaluationRepTestType2').click(function() {
		$('#invoiceCriteria1').show();
		$('#invoiceCriteria2').hide();
	});	
	
	//Annually
	$('#EvaluationRepTestType3').click(function() {
		$('#invoiceCriteria1').hide();
		$('#invoiceCriteria2').hide();
	});	
	
	
  $('#submitRepTest').click(function() {
	customerx = $('#select-customer').val();
	teamx = $('#select-team').val(); 
	if( $('#EvaluationRepTestType1').is(":not(':checked')") && $('#EvaluationRepTestType2').is(":not(':checked')")
		&& $('#EvaluationRepTestType3').is(":not(':checked')")) 
	{
		alert('Please select an Report Test criteria.');
		return false
	}
	else
	{	
		//Criteria 1 - Weekly
		if($('#EvaluationRepTestType1').is(':checked'))
		{
			if (!$('#EvaluationReportTestDateYear').val()) {
				alert('Please select a Year.');
				return false			
			}
			if (!$('#EvaluationReportTestDateMonth').val()) {
				alert('Please select a Month.');
				return false			
			}
			if (!$('#EvaluationWeekDay').val()) {
				alert('Please enter a Week Day.');
				return false			
			}				
		}
		else
		{
			//Criteria 2 - Monthly
			if($('#EvaluationRepTestType2').is(':checked'))
			{
				if (!$('#EvaluationReportTestDateYear').val()) {
					alert('Please select a Year.');
					return false			
				}
				if (!$('#EvaluationReportTestDateMonth').val()) {
					alert('Please select a Month.');
					return false			
				}
			}
			else
			//Criteria 3 - Annually
			if($('#EvaluationRepTestType3').is(':checked'))
			{
				if (!$('#EvaluationReportTestDateYear').val()) {
					alert('Please select a Year.');
					return false			
				}
			}			
		}		
		$('#EvaluationEvalFrequencyForm').submit();
	} 
  });
	
 
});