function offsetcalc(form) {
var dia = eval(form.dia.value); 	// Primary Mirror Diameter (mm)
var tfl = eval(form.tfl.value); 	// Telescope Focal Length (mm)
var sec = eval(form.sec.value); 	// Secondary Mirror Minor-Axis Diameter (mm)
var sfp = eval(form.sfp.value); 	// Secondary to Focal Plane Distance (mm)

var fr = ((Math.round((tfl / dia) * 10)) / 10);			//Focal Ratio of Telescope
var inch = ((Math.round((dia / 25.4) * 10)) / 10);		//Telescope Diameter in inches
var offset = (Math.round(sec * (dia - sec) / (4 * (tfl - sfp)) * 100) / 100);		//Secondary Mirror Offset Distance from Focusser (mm offset from centre)
var offsetdot = (Math.round(sec * (dia - sec) / (4 * (tfl - sfp)) * 141.4) / 100);	//Secondary Mirror Offset-Centre dot (mm offset from geographical centre - towards focusser, top of scope)

form.offset.value = (offset + " mm");
form.offsetdot.value = (offsetdot + " mm");
form.analysis.value = ("This " + dia + "mm (" + inch + "”) " + "ƒ/" + fr + " telescope's Seconday Mirror will need to be offset by " + offset + " mm from the centre of the optical axis (away from the focusser board) to achieve optimal results.\n\nThe precise placement of the central dot on the Secondary Mirror will need to be " + offsetdot + " mm from the geographical centre (towards the front of the telescope)\n\nThis Analyser, including all calculations and formulas contained within, is Copyrighted in full to Lachlan MacDonald (© 2007, Lachlan MacDonald).  No part of this document may be used elsewhere than at this location, without prior express written authorisation from the author.");}

