function UpdateOutcomeMeasureDisplayOptions(oSelect)
{

	if (oSelect.selectedIndex == 2)
	{
		$("#pnlGradRates").hide();
		$("#pnlGradRatesOverTime").hide();
		$("#pnlGradRateGaps").show();
	}
	else if (oSelect.selectedIndex == 1)
	{
		$("#pnlGradRates").hide();
		$("#pnlGradRatesOverTime").show();
		$("#pnlGradRateGaps").hide();
	}
	else
	{
		$("#pnlGradRates").show();
		$("#pnlGradRatesOverTime").hide();
		$("#pnlGradRateGaps").hide();
	}
}

function GetOutcomeMeasureQuerystring()
{
	selectedOutcome = $("#_userOutcomeMeasureForm_cmbSelectedOutcome option:selected").val();
	
	if (selectedOutcome == 3) // Grad Rate Gaps
	{
		querystring = "om=" + selectedOutcome + "&om1=" + $("#_userOutcomeMeasureForm_cmbGroup1Race option:selected").val() + "&om2=" + $("#_userOutcomeMeasureForm_cmbGender1 option:selected").val() + "&om3=" + $("#_userOutcomeMeasureForm_cmbGroup2Race option:selected").val() + "&om4=" + $("#_userOutcomeMeasureForm_cmbGender2 option:selected").val()
	}
	else if (selectedOutcome == 2) // Grad Rates Over Time
	{
		querystring = "om=" + selectedOutcome + "&om1=" + $("#_userOutcomeMeasureForm_cmbStartYear option:selected").val() + "&om2=" + $("#_userOutcomeMeasureForm_cmbEndYear option:selected").val()
	}
	else // Grad Rate
	{
		querystring = "om=" + selectedOutcome + "&om1=" + $("#_userOutcomeMeasureForm_cmbRace option:selected").val() + "&om2=" + $("#_userOutcomeMeasureForm_cmbGender option:selected").val()
	}
	
	return querystring;
	
}

$(function(){

	$("#cmbYear").change(function (){
	
		$("#outcomeMeasureSelection .yearSelection").text($("#cmbYear option:selected").text());
		
	})
	
	$("#cmbYearRange").change(function (){
	
		$("#outcomeMeasureSelection .timeframeSelection").text($("#cmbYearRange option:selected").text());
		
	})
	
	$("#_userOutcomeMeasureForm_cmbSelectedOutcome").change(function (){
	
		UpdateOutcomeMeasureDisplayOptions(this);
		
	})
	
	UpdateOutcomeMeasureDisplayOptions($("#_userOutcomeMeasureForm_cmbSelectedOutcome").get(0));
	
	$("#outcomeMeasure").click(function(){
		if ($("#outcomeMeasure").hasClass("expandable"))
		{
			$("#outcomeMeasure").removeClass("expandable").addClass("expanded");
			$("#outcomeMeasureSelection").slideDown("normal");
		}
		else
		{
			$("#outcomeMeasure").removeClass("expanded").addClass("expandable");
			$("#outcomeMeasureSelection").slideUp("normal");
		}
	});
	
	$("#outcomeMeasureSelection .yearSelection").text($("#cmbYear option:selected").text());
	$("#outcomeMeasureSelection .timeframeSelection").text($("#cmbYearRange option:selected").text());
	
	//
	
});


