
function validate_tcsf() {
	// Validiamo il campo Lens-type
	ctrl = -1;
	for (x = (document.tcselection.lens_type.length - 1); x > -1; x--) {
		if (document.tcselection.lens_type[x].checked) {
			ctrl = x;
			x = -1;
		}
	}
	if (ctrl == -1) {
		alert("Please, select Lens Type");
		document.tcselection.lens_type[0].focus();
		return false;
	}
	
	// Validiamo il campo Fov
	ctrl2 = -1
	for (z = (document.tcselection.fov.length - 1); z > -1; z--) {
		if (document.tcselection.fov[z].checked) {
			ctrl2 = z;
			z = -1;
		}
	}
	if (ctrl2 == -1) {
		alert("Please, select Field Of View");
		document.tcselection.fov[0].focus();
		return false;
	}

	// Validiamo il campo Lens-type
	ctrl3 = 0;
	if (document.tcselection.tfov1.value != '') {
			ctrl3++;
	}
	else if (document.tcselection.tfov2.value != '') {
			ctrl3++;
	}
	else if (document.tcselection.tfov3.value != '') {
			ctrl3++;
	}
	
	if (ctrl3 == 0)	{
		alert("Please insert Target Fov value");
		return false;
	}
	
	// Validiamo i campi rimanenti
	if (document.tcselection.pixs.value == '') {
		alert("Please, insert Pixel size value");
		document.tcselection.pixs.focus();
		return false;
	}

	if (document.tcselection.pixh.value == '') {
		alert("Please, insert horizontal number of pixel");
		document.tcselection.pixh.focus();
		return false;
	}

	if (document.tcselection.pixv.value == '') {
		alert("Please, insert vertical number of pixel");
		document.tcselection.pixv.focus();
		return false;
	}
	
}
