$(document).ready(
function() {
	var type_program=$('input.st1inp1:radio:checked');
	if (type_program.attr("checked")==1 && $('input.st1inp2:radio:checked').attr("checked")==1) {
		$('#fst2_1,#fst2_3').hide();
		$('#fst2,#fst2_'+type_program.attr("value")).show();
	} else if (document.getElementById('fst2')) {
		if (document.getElementById('fst2').style.display!='none') document.location.replace("#step2");
	}
}
);

$(function() {
	$('.st1inp1,.st1inp2').click(function() {
		var type_program=$('input.st1inp1:radio:checked');
		if (type_program.attr("checked")==1 && $('input.st1inp2:radio:checked').attr("checked")==1) {
			$('#fst2_1,#fst2_3').hide();
			$('#fst2,#fst2_'+type_program.attr("value")).show();
			if (document.getElementById('fst2').style.display=='none') {
				document.location.replace("#step2");
			}
		} else $('#fst2,#fst2_1,#fst2_3').hide();
	});
});

$(function() {
	$('#ptbutt').click(function() {
		var type_program=$('input.st1inp1:radio:checked');
		if (type_program.attr("checked")==1 && $('input.st1inp2:radio:checked').attr("checked")==1) {
			var r;
			if (type_program.attr("value")==1) r=3;
			else if (type_program.attr("value")==3) r=1;
			$('#fst2_'+r).remove();
		}
	});
});

