<!--
function Verifdof(form) {

if (document.form.focal.value == ""){
      alert("\nPlease, enter Focal length in the field \"Focal Lens\".\n" +
            "It must be a real value for a 16 or 35mm lens.\n!!! NO ABERRANT VALUES PLEASE !!!")
document.form.focal.select();
return false;
   }

if (isNaN(focal))  {
alert('Error: enter a numeric value in MILLIMETER for "Focal Lens"\n(like 10.5 and not 10,5)');
document.form.focal.select();
return false;
   }

if (document.form.focal.value < 0.9)  {
alert('Error: entrer a real numeric value for "Focal Lens"\n(no inexisting value)');
document.form.focal.select()

      document.form.focal.select();
      return false;

}

if (document.form.aperture.value == ""){
      alert("\nYou must enter Aperture\n" +
            "Select Aperture from the standard values\nin the field \"Aperture\" ")
document.form.aperture.focus();
return false;
   }

if (document.form.distance.value == "" || document.form.distance.value < 0.05){
      alert('\nPlease, enter "Focus distance" in FEET\n\n(!!! No aberrant distance please !!!)')
document.form.distance.select();
return false;
   }

if (isNaN(distance))  {
alert('Error: enter a numeric value in FEET (with decimal feet) for "Focus distance".');
document.form.distance.select();
return false;
}

else{
   return true;
   }
}


function doField(form) {
distance = (form.distance.value) * .304785;
CoC = (document.form.format.options[document.form.format.selectedIndex].value) / 1000;
aperture = (form.aperture.value);
focal = (form.focal.value) / 1000;

hyperFocal = ((focal * focal) / (aperture * CoC)) + focal;
HFft= Math.floor(((hyperFocal) / .025398) / 12);
HFinch = Math.floor(((hyperFocal) / .025398) - HFft*12) + "\"" ;

dofNear = ((hyperFocal  * (distance - focal)) / (hyperFocal + (distance - focal))) + focal;

dofNearft = Math.floor(((dofNear) / .025398)/12);
dofNearinch = Math.floor(((dofNear) / .025398) - dofNearft*12) + "\"";

dofFar = ((hyperFocal * (distance - focal)) / (hyperFocal  - (distance - focal))) + focal;

dofTotal = (dofFar - dofNear);

if (isNaN(focal) || document.form.focal.value == "" || document.form.aperture.value == "" || isNaN(distance) || document.form.distance.value == "" )  { form.hyperFocal.value  = "" ; form.dofNear.value  = "" ; form.dofFar.value  = "" ; form.dofTotal.value  = "" ;}
else{
form.hyperFocal.value  = HFft + " ft " + HFinch;

form.dofNear.value = dofNearft + " ft " + dofNearinch;

if (dofFar < 0) {
form.dofFar.value  = "     Infinity";
}
else{
form.dofFar.value  = Math.floor(((dofFar) / .025398) / 12) + " ft  " + Math.floor(((dofFar) / .025398) - Math.floor(((dofFar) / .025398) / 12)*12) + "\"";
}




if (dofTotal < 0) {
form.dofTotal.value  = "    Infinity";
}
else {
if (dofTotal >= 0 && dofTotal < 0.0025398) {
form.dofTotal.value  = "< 0.1 inch ";  
}


else {
if (dofTotal >= 0 && dofTotal < 0.025398) {
form.dofTotal.value  = "< 1 inch ";  
}


else{
form.dofTotal.value = Math.floor(((dofTotal) / .025398) / 12) + " ft  " + Math.floor(((dofTotal) / .025398) - Math.floor(((dofTotal) / .025398) / 12)*12) + "\"";  
         }
      }
   }

}



   }




//  End -->

