$(function() {
	$("input:radio").change(disableNonUsedInputs);
	
	$("#generateReportButton").on("click", showMask);
});

function disableNonUsedInputs() {
	if($("input[name=typeButtonSelection]:checked").val() == "2") {
		$("#visnId").attr("disabled", false);
		$("#facilityIdText").attr("disabled", true);
		$("#facilityIdSelection").attr("disabled", true);
	}
	else if($("input[name=typeButtonSelection]:checked").val() == "3") {
		$("#visnId").attr("disabled", true);
		$("#facilityIdText").attr("disabled", false);
		$("#facilityIdSelection").attr("disabled", false);
	}
	else {
		$("#visnId").attr("disabled", true);
		$("#facilityIdText").attr("disabled", true);
		$("#facilityIdSelection").attr("disabled", true);
	}
}

function showMask() {
	$("#waitingDialog").dialog({
		minWidth: 600, 
		minHeight: 400
	});
}