<%@ LANGUAGE="JSCRIPT" %><% // 02-Jun-08 rbd Fix updating, was passing elements not IDs to vfp() // 23-Dec-08 rbd New DB caching hack // 18-Oct-09 rbd Add autofocus checkbox // 28-Nov-10 rbd 3.3 GEM:398 Protect against apostrophes in status and fail messages // by double-quoting them in form ASP code. // 20-Jan-11 rbd GEM:571 - Set our parent iframe's height. // 22-Jan-10 rbd GEM:571 - Do this when receiving POST responses as well. // Make IE fudge distance a manifest constant. Increase IE // fudge to 18. Add manifest constant for extra display dist. // 06-Feb-12 rbd GEM:296 - Enhance for creating new Observations. // 31-Oct-12 rbd Fix displayed numbers and counts for GEM:296. // No GEM (found testing ACP 7) // 22-Jan-14 rbd GEM:1083 No more DBRelay hack :-) // 16-Nov-14 rbd GEM:1251 HA limits +/- 12 hours not +/- 6. GEM:1221 change // suggestion for Moon Avoid to 120 and 14. // 16-Dec-14 rbd GEM:1055 Add Duplicate Observation button and logic for // duplicating Observations // 24-Jan-15 rbd GEM:1055 Improvements in ide/Show when running/not // 30-Jan-15 rbd GEM:1184 Accept , as decimal point. Numeric strings have // already been validated at POST time. // 11-Jun-16 rbd GEM:1410 Improve behavior of Immediately After checkbox and // the Time Spacing / Time Tolerance fields. New "alt" attribute // in form validation. // 17-Jan-19 rbd GEM:1660 Modern DOCTYPE and HTML declarations // GEM:1661 Input and display of solar system objects by name // and elements. // 18-Jan-19 rbd GEM:1663 Modernize alerting with SweetAlert. // 19-Jan-19 rbd GEM:1664 Fix validation, needed an additional call on chained validations. // 21-Jan-19 rbd GEM:1661 Oops, add Orbital Tracking checkbox for solar system objects // 07-Feb-18 rbd GEM:1766 Change usage of => to equivalent function() syntax for IE11 // 16-Aug-22 rbd GEM:1891 Index constraints by name not index in list. The addition of the // AltAzRotation constraint caused numeric indexing to fail. // var DB = Scheduler.Database; var formid = Request.Form("id").Item; // Both GET and POST have (at least) &id= var O, PStatus; var newObs = "no"; if(formid.substr(0, 3) == "NOB") { // If new, NOBnnnn where nnnn is PLAN ID var planID = formid.substr(3); PStatus = DB.Plan(planID).Status; if(PStatus != 2) { newObs = "yes"; O = DB.AddNewObservation(planID); O.Name = "New Observation " + O.ID; O.Update(false); } else { Response.Write("Cannot create new Observation in running Plan"); Response.End(); } } else { O = DB.Observation(formid); PStatus = O.Plan.Status; } var cList = O.Constraints; // Allow indexing constraints by name var cDict = {}; for(var i = 0; i < cList.Length; i++) { var C = cList.Item(i); cDict[C.Name] = C; } function makeCoordList() { var buf; var curVal = 1; // Assume J2000 if(O.Elements !== "") { curVal = 3; } else if (O.Planet !== "") { curVal = 2; } buf = '