function alterDisplay() {
	var value = $("input:checked").val();
	if (value == "asi") {
		$("#asi").css("display", "");
		$("#smpte").css("display", "none");
	} else {
		$("#asi").css("display", "none");
		$("#smpte").css("display", "");
	}
	if (value == "asi" && $("select[name='modulation_target']").val() == "QPSK") {
		$("#qpsk").css("display", "");
	} else {
		$("#qpsk").css("display", "none");
	}
}

function init() {
	alterDisplay();
}


function whichMR(obj) {
	if(obj.framing_mode.value == "204") {
		if (obj.modulation_target.value == "QAM64 NTSC-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_NTSC_204_A).toFixed();
		} else if (obj.modulation_target.value == "QAM256 NTSC-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_NTSC_204_A).toFixed();
		} else if (obj.modulation_target.value == "QAM64 PAL-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_PAL_204_A).toFixed();
		} else if (obj.modulation_target.value == "QAM256 PAL-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_PAL_204_A).toFixed();
		} else if (obj.modulation_target.value == "QAM64 NTSC-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_NTSC_204_B).toFixed();
		} else if (obj.modulation_target.value == "QAM256 NTSC-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_NTSC_204_B).toFixed();
		} else if (obj.modulation_target.value == "QAM64 PAL-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_PAL_204_B).toFixed();
		} else if (obj.modulation_target.value == "QAM256 PAL-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_PAL_204_B).toFixed();
		} else if (obj.modulation_target.value == "Manual") {
			obj.manual_rate.value = (CLOCK_RATE_MANUAL).toFixed();
		} else if (obj.modulation_target.value == "8PSK") {
			obj.manual_rate.value = (CLOCK_RATE_8PSK_204).toFixed();
		}
	} else {
		if (obj.modulation_target.value == "QAM64 NTSC-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_NTSC_188_A).toFixed();
		} else if (obj.modulation_target.value == "QAM256 NTSC-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_NTSC_188_A).toFixed();
		} else if (obj.modulation_target.value == "QAM64 PAL-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_PAL_188_A).toFixed();
		} else if (obj.modulation_target.value == "QAM256 PAL-A") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_PAL_188_A).toFixed();
		} else if (obj.modulation_target.value == "QAM64 NTSC-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_NTSC_188_B).toFixed();
		} else if (obj.modulation_target.value == "QAM256 NTSC-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_NTSC_188_B).toFixed();
		} else if (obj.modulation_target.value == "QAM64 PAL-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM64_PAL_188_B).toFixed();
		} else if (obj.modulation_target.value == "QAM256 PAL-B") {
			obj.manual_rate.value = (CLOCK_RATE_QAM256_PAL_188_B).toFixed();
		} else if (obj.modulation_target.value == "Manual") {
			obj.manual_rate.value = (CLOCK_RATE_MANUAL).toFixed();
		} else if (obj.modulation_target.value == "8PSK") {
			obj.manual_rate.value = (CLOCK_RATE_8PSK_188).toFixed();
		}
	}
}