function magfov(form) {
var dia = eval(form.dia.value);
var tfl = eval(form.tfl.value);
var efl = eval(form.efl.value);
var afv = eval(form.afv.value);

var magnif = ((Math.round((tfl / (efl * 10)) * 100)) / 10);
var fr = ((Math.round((tfl / dia) * 10)) / 10);
var fov = ((Math.round((afv / magnif) * 100)) / 100);
var fvm = ((Math.round((fov * 60) * 100)) / 100);
var fm = ((Math.round((fvm / 30) * 10)) / 10);
var inch = ((Math.round((dia / 25.4) * 10)) / 10);
var magnit = ((Math.round(((((Math.log(dia/10))/2.4) * 5) + 8.8) * 10)) / 10);
var magnitb = ((Math.round(((((Math.log(dia/10))/2.4) * 5) + 7.6) * 10)) / 10);
var xp = ((Math.round((dia / magnif) * 100)) / 100);
var res = ((Math.round((132 / dia) * 100)) / 100);

var ORT = ((Math.round((45 / magnif) * 100)) / 100);
var ORTm = ((Math.round((ORT * 60) * 100)) / 100);
var ZOM = ((Math.round((50 / magnif) * 100)) / 100);
var ZOMm = ((Math.round((ZOM * 60) * 100)) / 100);
var PLO = ((Math.round((50 / magnif) * 100)) / 100);
var PLOm = ((Math.round((PLO * 60) * 100)) / 100);
var RAD = ((Math.round((60 / magnif) * 100)) / 100);
var RADm = ((Math.round((RAD * 60) * 100)) / 100);
var ERF = ((Math.round((65 / magnif) * 100)) / 100);
var ERFm = ((Math.round((ERF * 60) * 100)) / 100);
var SWA = ((Math.round((67 / magnif) * 100)) / 100);
var SWAm = ((Math.round((SWA * 60) * 100)) / 100);
var PAN = ((Math.round((68 / magnif) * 100)) / 100);
var PANm = ((Math.round((PAN * 60) * 100)) / 100);
var NAG = ((Math.round((82 / magnif) * 100)) / 100);
var NAGm = ((Math.round((NAG * 60) * 100)) / 100);
var UWA = ((Math.round((84 / magnif) * 100)) / 100);
var UWAm = ((Math.round((UWA * 60) * 100)) / 100);

if (magnif <= 0.00) {
msgmagnif="Error - Please Try Again!";
}
else 	{
if (magnif >= 200.0) msgmagnif = "very high";
if (magnif < 200.0) msgmagnif = "relatively high";
if (magnif < 125.0) msgmagnif = "moderate";
if (magnif < 60.00) msgmagnif = "relatively low";
if (magnif < 30.00) msgmagnif = "very low";
	}

if (fov <= 0.00) {
msgfov="Error - Please Try Again!";
}
else 	{
if (fov >= 1.00) msgfov="very wide";
if (fov < 1.00) msgfov="fairly wide";
if (fov < 0.75) msgfov="reasonably wide";
if (fov < 0.50) msgfov="moderate";
if (fov < 0.40) msgfov="reasonably narrow";
if (fov < 0.30) msgfov="fairly narrow";
if (fov < 0.20) msgfov="very narrow";
	}

form.magnit.value = magnit;
form.fr.value = ("f / " + fr);
form.magnif.value = (magnif + "×");
form.fov.value = (fov + "° (" + fvm + "’)");
form.xp.value = (xp + "mm");
form.res.value = (res + "”");
form.analysis.value = ("This " + dia + "mm (" + inch + "”) " + "f/" + fr + " telescope has a limiting magnitude¹ of " + magnit + " with a resolving power² of " + res + "” (arcsecs).\n\nA " + efl + "mm / " + afv + "° eyepiece used in this telescope will produce a " + msgmagnif + " magnification of " + magnif + "× with a " + msgfov + " field of view of " + fov + "° (" + fvm + "’), which is equivalent to approximately " + fm + " Full Moons in the eyepiece. The diameter of the exit pupil³ when using this combination will be " + xp +"mm.\n\nA different field of view can be obtained using different eyepieces. eg: \nA " + efl + "mm “Orthoscopic” eyepiece will show a field of " + ORT + "° (" + ORTm + "’)\nA “Zoom” eyepiece at " + efl + "mm will show a field of around " + ZOM + "° (" + ZOMm + "’)\nA " + efl + "mm “Plossl” eyepiece will show a field of " + PLO + "° (" + PLOm + "’)\nA " + efl + "mm “TeleVue Radian” will show a field of " + RAD + "° (" + RADm + "’)\nA " + efl + "mm “Erfle” will show a field of " + ERF + "° (" + ERFm + "’)\nA " + efl + "mm “Meade SuperWide” eyepiece will show a field of " + SWA + "° (" + SWAm + "’)\nA " + efl + "mm “TeleVue Panoptic” will show a field of " + PAN + "° (" + PANm + "’)\nA " + efl + "mm “TeleVue Nagler” will show a field of " + NAG + "° (" + NAGm + "’)\nA " + efl + "mm “Meade UltraWide” eyepiece will show a field of " + UWA + "° (" + UWAm + "’)\n\nNOTES:\n\nAge, observing experience, magnification, transparency and seeing conditions should all be taken into account when using this analysis as a guide.\n\n¹The limiting magnitude specified for this " + inch + "” telescope is achievable in theory, however only when observing under perfect transparency and seeing conditions, and when using medium to high magnifications. Use of lower magnifications may give a limiting magnitude of anywhere between " + magnitb + " and " + magnit + ".  The intrinsic background sky brightness is inversely proportional to the magnification, with higher magnifications also producing higher contrast.\n\n²The resolving power (Rayleigh Limit) of a telescope indicates the minimum angular separation or distance between two or more stars at which they can still be resolved into two separate stars.  The limit displayed here assumes a central obstruction (by secondary mirror) of 20%.\n\n³The Exit Pupil is the diameter of the cone of light that reaches your eye.  It can also be described as the image that is projected onto a particular point in space. Your eye must be positioned at that exact spot in order for you to see the full field-of-view with maximum resolution. When looking through the eyepiece at arm's length, it is the small, circular image that you can see in the eyepiece.  The average adult eye dilates to a maximum of about 7mm in extreme low light conditions, therefore for a telescope to deliver its full light gathering capability, the exit pupil must be equal to, or greater than the diameter of your pupil at any given moment.\n\nThis Analyser, including all calculations and formulas contained within, is Copyrighted in full to Lachlan MacDonald (© 2011, Lachlan MacDonald).  No part of this document may be used elsewhere than at this location, without prior express written authorisation from the author.");}
