PageSourceSearch

https://aopa.org/dist/js/aopa.js

js aopa.org collected 2026-09-24 08:31:09 UTC 1,002,459 bytes, 25,108 lines download raw bytes

1(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2"use strict";
3
4$(document).ready(function () {
5    if ($("div#divAafComplimentaryMembership").length) {
6        var aafForm;
7        var flagSearch;
8        var flagClearSearch;
9        var flagCreateCustomer;
10        var flagCreateOrder;
11        var flagLoadCreateOrder;
12        var flagSearchReturn;
13        var flagLoadCreateCustomer;
14
15        (function () {
16            var doTheSpinner = function () {
17                $("#divButtons").hide();
18                $("#divButtonContainer").append("<div class=\"spinner spinner--clockwise\" style=\"position: relative;\"></div>");
19            };
20
21            aafForm = $("#frmAAFCMF");
22            flagSearch = "Search";
23            flagClearSearch = "ClearSearch";
24            flagCreateCustomer = "CreateCustomer";
25            flagCreateOrder = "CreateOrder";
26            flagLoadCreateOrder = "LoadCreateOrder";
27            flagSearchReturn = "SearchReturn";
28            flagLoadCreateCustomer = "LoadCreateCustomer";
29
30            //
31            // Search click
32            //
33            $("#btnSearch").click(function () {
34                $("#FormMode").val(flagSearch);
35
36                if (aafForm.valid()) {
37                    doTheSpinner();
38                    aafForm.submit();
39                }
40            });
41
42            //
43            // Load Create New Customer click
44            //
45            $("#btnCreateNewCustomer").click(function () {
46                $("#FormMode").val(flagLoadCreateCustomer);
47                doTheSpinner();
48                aafForm.submit();
49            });
50
51            //
52            // Create New Customer click
53            //
54            $("#btnCreateCustomer").click(function () {
55                $("#FormMode").val(flagCreateCustomer);
56
57                if (aafForm.valid()) {
58                    doTheSpinner();
59                    aafForm.submit();
60                }
61            });
62
63            //
64            // Clear Search click
65            //
66            $("#btnClearSearch").click(function () {
67                $("#FormMode").val(flagClearSearch);
68                doTheSpinner();
69                aafForm.submit();
70            });
71
72            //
73            // Back to search
74            //
75            $(".back-to-search").click(function () {
76                $("#FormMode").val(flagSearchReturn);
77
78                if ($("div#divCreateCustomer").length) {
79                    $("#divCreateCustomer *").prop("disabled", true);
80                }
81
82                $("#divCreateCustomerSection").hide();
83                $("#divCheckSection").hide();
84                $("#divOrderData").hide();
85                $(".event-signin__process-message").hide();
86                $("#divSpinner").show();
87                aafForm.submit();
88            });
89
90            //
91            // Goto create order
92            //
93            $(document).on("click", ".create-order-button", function (e) {
94                $("#FormMode").val(flagLoadCreateOrder);
95                $("#CreateOrderMasterCustomerId").val($(this).data("mcid"));
96                $("#CreateOrderSubCustomerId").val($(this).data("scid"));
97                doTheSpinner();
98                aafForm.submit();
99            });
100
101            //
102            // Create the order
103            //
104            $(".create-registration").click(function () {
105                if (aafForm.valid()) {
106                    $("#FormMode").val(flagCreateOrder);
107                    doTheSpinner();
108                    aafForm.submit();
109                }
110            });
111        })();
112    };
113});
114
115},{}],2:[function(require,module,exports){
116"use strict";
117
118$(document).ready(function () {
119    if ($("div#divAopaCancellationForm").length) {
120        var theForm = $("#frmAopaCancellation");
121
122        $("#WantToCancel").change(function () {
123            if (this.checked) {
124                $("#btnSubmitCancel").removeClass("aopa-disable-button");
125                $("#btnSubmitCancel").prop("disabled", false);
126                $("#divCancelInfo").show();
127            } else {
128                $("#btnSubmitCancel").addClass("aopa-disable-button");
129                $("#btnSubmitCancel").prop("disabled", true);
130                $("#divCancelInfo").hide();
131            }
132        });
133
134        $(".submitAopaCancel").click(function () {
135            if (theForm.valid()) {
136                $("#divConfirmCheckBox").hide();
137                $("#btnSubmitCancel").hide();
138                $(this).hide();
139                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
140                theForm.submit();
141            }
142        });
143    }
144});
145
146},{}],3:[function(require,module,exports){
147"use strict";
148
149$(document).ready(function () {
150    if ($("div#divAccountContactInfo").length) {
151        var confirmOnPageExit;
152
153        (function () {
154            var cancelPersonal = function (theForm) {
155                $("#divPersonalInfoConfirm").hide();
156                $("#divPersonalInfoAlert").hide();
157                $("#" + theForm[0].id + " #SelectedPrefix").prop("disabled", true);
158                $("#" + theForm[0].id + " #SelectedSuffix").prop("disabled", true);
159                $("#" + theForm[0].id + " #SelectedGender").prop("disabled", true);
160                $("#" + theForm[0].id + " #SelectedPreferredCommunication").prop("disabled", true);
161                $("#" + theForm[0].id + " #SelectedMailingAddressType").prop("disabled", true);
162                $("#" + theForm[0].id + " #SelectedMailingAddressType").removeClass("input-validation-error");
163                $("#" + theForm[0].id + " #PreferredEmailSelected").prop("disabled", true);
164                $("#" + theForm[0].id + " #PreferredEmailSelected").removeClass("input-validation-error");
165                $("#" + theForm[0].id + " #PreferredPhoneSelected").prop("disabled", true);
166                $("#" + theForm[0].id + " #AllowEmailFlag").prop("disabled", true);
167                $("#" + theForm[0].id + " #AllowLabelSalesFlag").prop("disabled", true);
168                $("#" + theForm[0].id + " #AllowPhoneFlag").prop("disabled", true);
169                resetFields(theForm);
170            };
171
172            var editPersonal = function (theForm) {
173                $("#divPersonalInfoConfirm").hide();
174                $("#divPersonalInfoAlert").hide();
175                $("#" + theForm[0].id + " #SelectedPrefix").prop("disabled", false);
176                $("#" + theForm[0].id + " #SelectedSuffix").prop("disabled", false);
177                $("#" + theForm[0].id + " #SelectedGender").prop("disabled", false);
178                $("#" + theForm[0].id + " #SelectedPreferredCommunication").prop("disabled", false);
179                $("#" + theForm[0].id + " #SelectedMailingAddressType").prop("disabled", false);
180                $("#" + theForm[0].id + " #PreferredEmailSelected").prop("disabled", false);
181                $("#" + theForm[0].id + " #PreferredPhoneSelected").prop("disabled", false);
182                $("#" + theForm[0].id + " #AllowEmailFlag").prop("disabled", false);
183                $("#" + theForm[0].id + " #AllowLabelSalesFlag").prop("disabled", false);
184                $("#" + theForm[0].id + " #AllowPhoneFlag").prop("disabled", false);
185            };
186
187            var savePersonal = function (theForm, theSection) {
188                $("#divPersonalInfoConfirm").hide();
189                $("#divPersonalInfoAlert").hide();
190
191                theSection.addClass("account-spinner");
192
193                $.post("/api/ContactPersonal/ProcessPersonal", {
194                    FormData: $("#FormData").val(),
195                    Action: "U",
196                    Prefix: $("#" + theForm[0].id + " #SelectedPrefix").val(),
197                    FirstName: $("#" + theForm[0].id + " #FirstName").val(),
198                    MiddleName: $("#" + theForm[0].id + " #MiddleName").val(),
199                    LastName: $("#" + theForm[0].id + " #LastName").val(),
200                    Suffix: $("#" + theForm[0].id + " #SelectedSuffix").val(),
201                    NickName: $("#" + theForm[0].id + " #NickName").val(),
202                    Gender: $("#" + theForm[0].id + " #SelectedGender").val(),
203                    BirthDate: $("#" + theForm[0].id + " #BirthDate").val(),
204                    AllowEmail: $("#" + theForm[0].id + " #AllowEmailFlag")[0].checked,
205                    AllowPostal: $("#" + theForm[0].id + " #AllowLabelSalesFlag")[0].checked,
206                    AllowPhone: $("#" + theForm[0].id + " #AllowPhoneFlag")[0].checked,
207                    PreferredComm: $("#" + theForm[0].id + " #SelectedPreferredCommunication").val(),
208                    MailingAddressType: $("#" + theForm[0].id + " #SelectedMailingAddressType").val(),
209                    MailingStreet: $("#" + theForm[0].id + " #MailingStreet").val(),
210                    MailingCity: $("#" + theForm[0].id + " #MailingCity").val(),
211                    MailingStateProvince: $("#" + theForm[0].id + " #MailingStateProvince").val(),
212                    MailingPostalCode: $("#" + theForm[0].id + " #MailingPostalCode").val(),
213                    MailingCountry: $("#" + theForm[0].id + " #MailingCountry").val(),
214                    HomeEmail: $("#" + theForm[0].id + " #HomeEmail").val(),
215                    WorkEmail: $("#" + theForm[0].id + " #WorkEmail").val(),
216                    AlternateEmail: $("#" + theForm[0].id + " #AlternateEmail").val(),
217                    PreferredEmail: $("#" + theForm[0].id + " #PreferredEmailSelected").val(),
218                    HomePhone: $("#" + theForm[0].id + " #HomePhone").val(),
219                    MobilePhone: $("#" + theForm[0].id + " #MobilePhone").val(),
220                    WorkPhone: $("#" + theForm[0].id + " #WorkPhone").val(),
221                    OtherPhone: $("#" + theForm[0].id + " #OtherPhone").val(),
222                    PrimaryPhoneLocationCode: $("#" + theForm[0].id + " #PreferredPhoneSelected").val()
223                }, function () {}).done(function (data) {
224                    if (data.personalSuccess) {
225                        $("#divPersonalInfoConfirm").show();
226
227                        updateFields(theForm);
228
229                        theSection.removeClass("wip");
230
231                        $("#formOpen").val("false");
232                        window.onbeforeunload = null;
233                    } else {
234                        $("#divPersonalInfoAlert").show();
235                    }
236                    $("#" + theForm[0].id + " #SelectedPrefix").prop("disabled", true);
237                    $("#" + theForm[0].id + " #SelectedSuffix").prop("disabled", true);
238                    $("#" + theForm[0].id + " #SelectedGender").prop("disabled", true);
239                    $("#" + theForm[0].id + " #SelectedPreferredCommunication").prop("disabled", true);
240                    $("#" + theForm[0].id + " #SelectedMailingAddressType").prop("disabled", true);
241                    $("#" + theForm[0].id + " #AllowEmailFlag").prop("disabled", true);
242                    $("#" + theForm[0].id + " #AllowLabelSalesFlag").prop("disabled", true);
243                    $("#" + theForm[0].id + " #AllowPhoneFlag").prop("disabled", true);
244                    $("#" + theForm[0].id + " #PreferredEmailSelected").prop("disabled", true);
245                    $("#" + theForm[0].id + " #PreferredPhoneSelected").prop("disabled", true);
246                    theSection.removeClass("account-spinner");
247                }).fail(function (jqXHR, textStatus, err) {
248                    $("#divPersonalInfoAlert").show();
249                    theSection.removeClass("account-spinner");
250                });
251            };
252
253            var fieldIsEmpty = function (theField, theParent) {
254
255                var cont = theField.parents("." + theParent);
256
257                if (theField.val().trim().length) {
258                    cont[0].classList.remove("afEmpty");
259                } else {
260                    cont[0].classList.add("afEmpty");
261                }
262            };
263
264            var resetFields = function (theForm) {
265                theForm.find("input,select,textarea").not("input[type='hidden']").each(function () {
266                    if (this.type === "text" || this.type === "textarea" || this.type === "select-one") {
267                        var elem = theForm[0].elements["init" + this.id];
268
269                        $("#" + theForm[0].id + " #" + this.id).val($("#" + theForm[0].id + " #" + elem.id).val());
270                    } else if (this.type === "checkbox") {
271                        this.checked = $("#" + theForm[0].id + " #init" + this.id).val() === "true";
272                    }
273                });
274            };
275
276            var updateFields = function (theForm) {
277                theForm.find("input,select").not("input[type='hidden']").each(function () {
278                    if (this.type === "text" || this.type === "select-one") {
279                        var elem = theForm[0].elements["init" + this.id];
280
281                        $("#" + theForm[0].id + " #" + elem.id).val($("#" + theForm[0].id + " #" + this.id).val());
282                    } else if (this.type === "checkbox") {
283                        $("#" + theForm[0].id + " #init" + this.id).val(this.checked);
284                    }
285                });
286            };
287
288            var updateField = function (theForm, theField) {
289                if (theField.type === "text" || this.type === "select-one") {
290                    $("#" + theForm[0].id + " #init" + theField).val($("#" + theForm[0].id + " #" + theField).val());
291                } else if (theField.type === "checkbox") {
292                    $("#" + theForm[0].id + " #init" + theField).val(theField.checked);
293                }
294            };
295
296            // 'edit' section click handler
297            $(document).on("click", ".my_account_content a.edit", function (e) {
298                e.preventDefault();
299                e.stopPropagation();
300
301                var $theButton = $(this);
302                var $theSection = $theButton.parents("section");
303                var $theForm = $theSection.children("form");
304
305                if ($theForm[0].id.startsWith("fmPersonalInfo")) {
306                    editPersonal($theForm);
307                }
308
309                if ($("#formOpen").val() === "false") {
310
311                    // set the section to be editable
312                    $theSection.addClass("wip");
313                    $("#formOpen").val($theForm[0].id);
314                    window.onbeforeunload = confirmOnPageExit;
315                } else {
316                    alert("Another form is already open.\n\nPlease Save or Cancel before proceeding.");
317                }
318            });
319
320            // 'save' section click handler
321            $(document).on("click", ".my_account_content a.save", function (e) {
322                e.preventDefault();
323                e.stopPropagation();
324
325                var $theButton = $(this);
326                var $theSection = $theButton.parents("section");
327                var $theForm = $theSection.children("form");
328
329                if ($theForm.valid()) {
330                    if ($theForm[0].id.startsWith("fmPersonalInfo")) {
331                        savePersonal($theForm, $theSection);
332                    }
333                }
334            });
335
336            // 'cancel' section click handler
337            $(document).on("click", ".my_account_content a.cancel", function (e) {
338                e.preventDefault();
339                e.stopPropagation();
340
341                var $theButton = $(this);
342                var $theSection = $theButton.parents("section");
343                var $theForm = $theSection.children("form");
344
345                if ($theForm[0].id.startsWith("fmPersonalInfo")) {
346                    cancelPersonal($theForm);
347                }
348
349                var validator = $theForm.validate();
350                validator.hideErrors();
351                validator.resetForm();
352                validator.reset();
353
354                //reset unobtrusive field level, if it exists
355                $theForm.find("[data-valmsg-replace]").removeClass("input-validation-error").removeClass("field-validation-error").addClass("field-validation-valid").empty();
356
357                // set the section to be non-editable
358                $theSection.removeClass("wip");
359
360                $("#formOpen").val("false");
361                window.onbeforeunload = null;
362            });
363
364            // 'delete' section click handler
365            $(document).on("click", ".my_account_content a.delete", function (e) {
366                e.preventDefault();
367                e.stopPropagation();
368
369                var $theButton = $(this);
370                var $theSection = $theButton.parents("section");
371                var $theForm = $theSection.children("form");
372
373                if ($("#formOpen").val() === "false") {} else {
374                    alert("Another form is already open.\n\nPlease Save or Cancel before proceeding.");
375                }
376            });
377
378            confirmOnPageExit = function confirmOnPageExit(e) {
379                // If we haven't been passed the event get the window.event
380                e = e || window.event;
381
382                var message = "A form is open. Please Save or Cancel before proceeding.";
383
384                // For IE6-8 and Firefox prior to version 4
385                if (e) {
386                    e.returnValue = message;
387                }
388
389                // For Chrome, Safari, IE8+ and Opera 12+
390                return message;
391            };
392        })();
393    }
394});
395
396},{}],4:[function(require,module,exports){
397"use strict";
398
399$(document).ready(function () {
400    if ($("div#divAccountPilotInfo").length) {
401        var confirmOnPageExit;
402
403        (function () {
404            var resetFields = function (theForm) {
405
406                theForm.find("input,select").not("input[type='hidden']").each(function () {
407                    if (this.type === "text" || this.type === "select-one") {
408                        var elem = theForm[0].elements["init" + this.id];
409
410                        $("#" + theForm[0].id + " #" + this.id).val($("#" + theForm[0].id + " #" + elem.id).val());
411                    } else if (this.type === "checkbox") {
412                        this.checked = $("#" + theForm[0].id + " #init" + this.id).val() === "true";
413                    }
414                });
415            };
416
417            var updateFields = function (theForm) {
418
419                theForm.find("input,select").not("input[type='hidden']").each(function () {
420                    if (this.type === "text" || this.type === "select-one") {
421                        var elem = theForm[0].elements["init" + this.id];
422
423                        $("#" + theForm[0].id + " #" + elem.id).val($("#" + theForm[0].id + " #" + this.id).val());
424                    } else if (this.type === "checkbox") {
425                        $("#" + theForm[0].id + " #init" + this.id).val(this.checked);
426                    }
427                });
428            };
429
430            var updateField = function (theForm, theField) {
431                if (theField.type === "text" || theField.type === "select-one") {
432                    $("#" + theForm[0].id + " #init" + theField).val($("#" + theForm[0].id + " #" + theField).val());
433                } else if (theField.type === "checkbox") {
434                    $("#" + theForm[0].id + " #init" + theField).val(theField.checked);
435                }
436            };
437
438            var editPilotInfo = function (theForm) {
439                $("#divPilotInfoConfirm").hide();
440                $("#divPilotInfoAlert").hide();
441                $("#divPilotInfoAlert").html("");
442
443                var currentLeft = "";
444
445                $("#selLeft option").each(function () {
446                    currentLeft += $(this).val() + "|" + $(this).text() + ";";
447                });
448                if (currentLeft) {
449                    currentLeft = currentLeft.slice(0, -1);
450                }
451                $("#" + theForm[0].id + " #initRatingsSelLeft").val(currentLeft);
452
453                var currentRight = "";
454
455                $("#selRight option").each(function () {
456                    currentRight += $(this).val() + "|" + $(this).text() + ";";
457                });
458                if (currentRight) {
459                    currentRight = currentRight.slice(0, -1);
460                }
461                $("#" + theForm[0].id + " #initRatingsSelRight").val(currentRight);
462
463                $("#" + theForm[0].id + " #HighestCertLevel").prop("disabled", false);
464                $("#" + theForm[0].id + " #HoursFlownLast12Months").prop("disabled", false);
465                $("#" + theForm[0].id + " #selLeft").prop("disabled", false);
466                $("#" + theForm[0].id + " #selRight").prop("disabled", false);
467            };
468
469            var cancelPilotInfo = function (theForm) {
470                $("#divPilotInfoConfirm").hide();
471                $("#divPilotInfoAlert").hide();
472                $("#divPilotInfoAlert").html("");
473                $("#" + theForm[0].id + " #HighestCertLevel").prop("disabled", true);
474                $("#" + theForm[0].id + " #HoursFlownLast12Months").prop("disabled", true);
475                $("#" + theForm[0].id + " #selLeft").prop("disabled", true);
476                $("#" + theForm[0].id + " #selRight").prop("disabled", true);
477
478                resetFields(theForm);
479
480                $("#selLeft").empty();
481                var leftItems = $("#" + theForm[0].id + " #initRatingsSelLeft").val().split(";");
482
483                $.each(leftItems, function (index, value) {
484                    var item = value.split("|");
485                    $("#selLeft").append("<option value=\"" + item[0] + "\">" + item[1] + "</option>");
486                });
487
488                var oldRight = "";
489                $("#selRight").empty();
490                var rightItems = $("#" + theForm[0].id + " #initRatingsSelRight").val().split(";");
491                $.each(rightItems, function (index, value) {
492                    if (value) {
493                        var item = value.split("|");
494                        $("#selRight").append("<option value=\"" + item[0] + "\">" + item[1] + "</option>");
495                        oldRight += item[1] + "<br>";
496                    }
497                });
498                $("#" + theForm[0].id + " #tdRatingsList").html(oldRight);
499            };
500
501            var savePilotInfo = function (theForm, theSection) {
502                $("#divPilotInfoConfirm").hide();
503                $("#divPilotInfoAlert").hide();
504                $("#divPilotInfoAlert").html("");
505
506                theSection.addClass("account-spinner");
507
508                var currentRightVal = "";
509                var currentRightText = "";
510                $("#selRight option").each(function () {
511                    currentRightVal += $(this).val() + "|";
512                    currentRightText += $(this).text() + "<br>";
513                });
514                if (currentRightVal) {
515                    currentRightVal = currentRightVal.slice(0, -1);
516                }
517
518                $.post("/api/PilotInformation/PilotInfoUpdate", {
519                    FormData: $("#FormData").val(),
520                    HomeAirport: $("#" + theForm[0].id + " #HomeAirport").val(),
521                    HighestCertLevel: $("#" + theForm[0].id + " #HighestCertLevel").val(),
522                    HoursFlownLast12: $("#" + theForm[0].id + " #HoursFlownLast12Months").val(),
523                    Cerfifications: currentRightVal
524                }, function () {}).done(function (data) {
525                    if (data.homeAiportSuccess && data.pilotInfoSuccess) {
526                        $("#divPilotInfoConfirm").show();
527
528                        updateFields(theForm);
529
530                        theSection.removeClass("wip");
531
532                        $("#formOpen").val("false");
533
534                        $("#" + theForm[0].id + " #HighestCertLevel").prop("disabled", true);
535                        $("#" + theForm[0].id + " #HoursFlownLast12Months").prop("disabled", true);
536                        $("#" + theForm[0].id + " #selLeft").prop("disabled", true);
537                        $("#" + theForm[0].id + " #selRight").prop("disabled", true);
538                        $("#" + theForm[0].id + " #tdRatingsList").html(currentRightText);
539
540                        window.onbeforeunload = null;
541                    } else {
542                        var theError = "The following items ( ";
543                        var hadError = false;
544
545                        if (!data.homeAiportSuccess) {
546                            hadError = true;
547                            theError += "Home Airport";
548                        } else {
549                            updateField(theForm, $("#" + theForm[0].id + " #HomeAirport"));
550                        }
551                        if (!data.pilotInfoSuccess) {
552                            if (hadError) theError += ", ";
553                            hadError = true;
554                            theError += "Highest Cert Level, Hours Flown, Certificates and Ratings";
555                        } else {
556                            updateField(theForm, $("#" + theForm[0].id + " #HighestCertLevel"));
557                            updateField(theForm, $("#" + theForm[0].id + " #HoursFlownLast12Months"));
558                        }
559
560                        theError += " ) did not save.";
561
562                        $("#divPilotInfoAlert").html(theError);
563
564                        $("#divPilotInfoAlert").show();
565                    }
566                    theSection.removeClass("account-spinner");
567                }).fail(function (jqXHR, textStatus, err) {
568                    $("#divPilotInfoAlert").html("There was an error saving your pilot information.");
569                    $("#divPilotInfoAlert").show();
570                    theSection.removeClass("account-spinner");
571                });
572            };
573
574            var addAircraft = function (theForm) {
575                $("#divAircraftConfirm").hide();
576                $("#divAircraftConfirm").html("");
577                $("#divAircraftAlert").hide();
578                $("#divAircraftAlert").html("");
579                resetFields(theForm);
580            };
581
582            var editAircraft = function (theForm) {
583                $("#divAircraftConfirm").hide();
584                $("#divAircraftConfirm").html("");
585                $("#divAircraftAlert").hide();
586                $("#divAircraftAlert").html("");
587            };
588
589            var cancelAircraft = function (theForm) {
590                $("#divAircraftConfirm").hide();
591                $("#divAircraftConfirm").html("");
592                $("#divAircraftAlert").hide();
593                $("#divAircraftAlert").html("");
594                resetFields(theForm);
595            };
596
597            var saveAircraft = function (theForm, theSection) {
598                $("#divAircraftConfirm").hide();
599                $("#divAircraftConfirm").html("");
600                $("#divAircraftAlert").hide();
601                $("#divAircraftAlert").html("");
602
603                theSection.addClass("account-spinner");
604                $.post("/api/CustomerAircraft/ProcessAircraft", {
605                    FormData: $("#FormData").val(),
606                    Action: theForm[0].id === "fmAircraft" ? "A" : "U",
607                    NNumber: $("#" + theForm[0].id + " #NNumber").val(),
608                    SerialNumber: $("#" + theForm[0].id + " #SerialNumber").val(),
609                    InsuranceCarrier: $("#" + theForm[0].id + " #InsuranceCarrier").val(),
610                    InsuranceExpireDate: $("#" + theForm[0].id + " #InsuranceExpireDate").val() }, function () {}).done(function (data) {
611                    if (data.aircraftSuccess) {
612                        //
613                        // Handle Add
614                        //
615                        if (theForm[0].id === "fmAircraft") {
616                            // clone the section
617                            var newAircraft = theSection.clone()[0];
618
619                            // fix id and classes
620                            newAircraft.id = "";
621                            newAircraft.classList.remove("add");
622                            newAircraft.classList.remove("aircraft");
623                            newAircraft.classList.remove("wip");
624                            newAircraft.classList.remove("account-spinner");
625                            newAircraft.removeChild(newAircraft.getElementsByTagName("h2")[0]);
626                            newAircraft.getElementsByTagName("form")[0].id += $("#" + theForm[0].id + " #AircraftCount").val();
627                            var newFormId = newAircraft.getElementsByTagName("form")[0].id;
628
629                            // add the delete button
630                            var del = document.createElement("a");
631                            del.classList.add("button");
632                            del.classList.add("bg--trash");
633                            del.classList.add("delete");
634                            var delText = document.createTextNode("DELETE");
635                            del.appendChild(delText);
636                            newAircraft.getElementsByTagName("footer")[0].appendChild(del);
637
638                            // add the cloned section to the document
639                            theSection.before(newAircraft);
640
641                            // update the init value fields for cancel functionality
642                            $("#" + newFormId + " #initNNumber").val($("#" + newFormId + " #NNumber").val());
643                            $("#" + newFormId + " #initSerialNumber").val($("#" + newFormId + " #SerialNumber").val());
644                            $("#" + newFormId + " #initInsuranceCarrier").val($("#" + newFormId + " #InsuranceCarrier").val());
645                            $("#" + newFormId + " #initInsuranceExpireDate").val($("#" + newFormId + " #InsuranceExpireDate").val());
646
647                            // Fix the NNumber table cell
648                            var node = $("#" + newFormId + " #NNumber").parent("td");
649                            $("#" + newFormId + " #NNumber")[0].type = "hidden";
650                            node[0].appendChild(document.createTextNode($("#" + newFormId + " #NNumber").val()));
651
652                            // Update the aircraft counter
653                            $("#" + theForm[0].id + " #AircraftCount").val(parseInt($("#" + theForm[0].id + " #AircraftCount").val()) + 1);
654
655                            // reparse the validation
656                            $.validator.unobtrusive.parse($("#" + newFormId));
657
658                            // reset the add form fields
659                            resetFields(theForm);
660
661                            // exit editing
662                            $("#secAircraftAdd").removeClass("wip");
663                        } else {
664                            // exit editing
665                            theSection[0].classList.remove("wip");
666
667                            // update the init value fields for cancel functionality
668                            updateFields(theForm);
669                        }
670
671                        // confirm success
672                        $("#divAircraftConfirm").html("Aircraft saved successfully.");
673                        $("#divAircraftConfirm").show();
674
675                        // take care of form open
676                        $("#formOpen").val("false");
677                        window.onbeforeunload = null;
678                    } else {
679                        $("#divAircraftAlert").html("Aircraft was not added.");
680                        $("#divAircraftAlert").show();
681                    }
682                    theSection.removeClass("account-spinner");
683                }).fail(function (jqXHR, textStatus, err) {
684                    $("#divAircraftAlert").html("There was an error trying to add the aircraft.");
685                    $("#divAircraftAlert").show();
686                    theSection.removeClass("account-spinner");
687                });
688            };
689
690            var deleteAircraft = function (theForm, theSection) {
691                $("#divAircraftConfirm").hide();
692                $("#divAircraftConfirm").html("");
693                $("#divAircraftAlert").hide();
694                $("#divAircraftAlert").html("");
695
696                theSection.addClass("account-spinner");
697                $.post("/api/CustomerAircraft/ProcessAircraft", {
698                    FormData: $("#FormData").val(),
699                    Action: "D",
700                    NNumber: $("#" + theForm[0].id + " #NNumber").val()
701                }, function () {}).done(function (data) {
702                    if (data.aircraftSuccess) {
703                        $("#divAircraftConfirm").html("Aircraft deleted successfully.");
704                        $("#divAircraftConfirm").show();
705
706                        theSection.removeClass("account-spinner");
707                        theSection.remove();
708
709                        $("#formOpen").val("false");
710                        window.onbeforeunload = null;
711                    } else {
712                        $("#divAircraftAlert").html("Aircraft was not deleted.");
713                        $("#divAircraftAlert").show();
714                        theSection.removeClass("account-spinner");
715                    }
716                }).fail(function (jqXHR, textStatus, err) {
717                    $("#divAircraftAlert").html("There was an error trying to delete the aircraft.");
718                    $("#divAircraftAlert").show();
719                    theSection.removeClass("account-spinner");
720                });
721            };
722
723            var addMedical = function (theForm) {
724                $("#divMedicalConfirm").hide();
725                $("#divMedicalConfirm").html("");
726                $("#divMedicalAlert").hide();
727                $("#divMedicalAlert").html("");
728                resetFields(theForm);
729            };
730
731            var editMedical = function (theForm) {
732                $("#divMedicalConfirm").hide();
733                $("#divMedicalConfirm").html("");
734                $("#divMedicalAlert").hide();
735                $("#divMedicalAlert").html("");
736                $("#" + theForm[0].id + " #SelectedMedicalCode").prop("disabled", false);
737            };
738
739            var cancelMedical = function (theForm) {
740                $("#divMedicalConfirm").hide();
741                $("#divMedicalConfirm").html("");
742                $("#divMedicalAlert").hide();
743                $("#divMedicalAlert").html("");
744                $("#" + theForm[0].id + " #SelectedMedicalCode").prop("disabled", true);
745                resetFields(theForm);
746            };
747
748            var saveMedical = function (theForm, theSection) {
749                $("#divMedicalConfirm").hide();
750                $("#divMedicalConfirm").html("");
751                $("#divMedicalAlert").hide();
752                $("#divMedicalAlert").html("");
753
754                theSection.addClass("account-spinner");
755                $.post("/api/CustomerMedical/ProcessMedical", {
756                    FormData: $("#FormData").val(),
757                    Action: theForm[0].id === "fmMedical" ? "A" : "U",
758                    Id: $("#" + theForm[0].id + " #MedicalId").val(),
759                    MedicalClassCode: $("#" + theForm[0].id + " #SelectedMedicalCode").val(),
760                    BirthDate: $("#" + theForm[0].id + " #BirthDate").val(),
761                    IssuanceDate: $("#" + theForm[0].id + " #IssuanceDate").val(),
762                    UserExpireDate: $("#" + theForm[0].id + " #UserExpireDate").val(),
763                    ExpirationReminder: $("#" + theForm[0].id + " #ExpirationReminder")[0].checked
764                }, function () {}).done(function (data) {
765                    if (data.medicalSuccess) {
766                        //
767                        // Handle Add
768                        //
769                        if (theForm[0].id === "fmMedical") {
770                            // clone the section
771                            var newMedical = theSection.clone()[0];
772
773                            // fix id and classes
774                            newMedical.id = "";
775                            newMedical.classList.remove("add");
776                            newMedical.classList.remove("wip");
777                            newMedical.classList.remove("account-spinner");
778                            newMedical.removeChild(newMedical.getElementsByTagName("h2")[0]);
779                            newMedical.getElementsByTagName("form")[0].id += $("#" + theForm[0].id + " #MedicalCount").val();
780                            var newFormId = newMedical.getElementsByTagName("form")[0].id;
781
782                            // add the delete button
783                            var del = document.createElement("a");
784                            del.classList.add("button");
785                            del.classList.add("bg--trash");
786                            del.classList.add("delete");
787                            var delText = document.createTextNode("DELETE");
788                            del.appendChild(delText);
789                            newMedical.getElementsByTagName("footer")[0].appendChild(del);
790
791                            var calc = newMedical.querySelector("#spCalcExp");
792                            calc.innerHTML = "Calculated " + data.calculateExpireDate;
793
794                            // add the cloned section to the document
795                            theSection.before(newMedical);
796
797                            $("#" + newFormId + " #SelectedMedicalCode").val($("#" + theForm[0].id + " #SelectedMedicalCode").val());
798
799                            // update the init value fields for cancel functionality
800                            $("#" + newFormId + " #initSelectedMedicalCode").val($("#" + newFormId + " #SelectedMedicalCode").val());
801                            $("#" + newFormId + " #initBirthDate").val($("#" + newFormId + " #BirthDate").val());
802                            $("#" + newFormId + " #initIssuanceDate").val($("#" + newFormId + " #IssuanceDate").val());
803                            $("#" + newFormId + " #initUserExpireDate").val($("#" + newFormId + " #UserExpireDate").val());
804                            $("#" + newFormId + " #initExpirationReminder").val($("#" + newFormId + " #ExpirationReminder")[0].checked);
805                            $("#" + newFormId + " #MedicalId").val(data.id);
806
807                            // Update the medical counter
808                            $("#" + theForm[0].id + " #MedicalCount").val(parseInt($("#" + theForm[0].id + " #MedicalCount").val()) + 1);
809
810                            // reparse the validation
811                            $.validator.unobtrusive.parse($("#" + newFormId));
812
813                            // reset the add form fields
814                            resetFields(theForm);
815
816                            $("#" + newFormId + " #SelectedMedicalCode").prop("disabled", true);
817
818                            // exit editing
819                            $("#secMedicalAdd").removeClass("wip");
820                        } else {
821                            // exit editing
822                            theSection[0].classList.remove("wip");
823
824                            var calc = theSection[0].querySelector("#spCalcExp");
825                            calc.innerHTML = "Calculated " + data.calculateExpireDate;
826
827                            // update the init value fields for cancel functionality
828                            updateFields(theForm);
829
830                            $("#" + theForm[0].id + " #SelectedMedicalCode").prop("disabled", true);
831                        }
832
833                        // confirm success
834                        $("#divMedicalConfirm").html("Medical saved successfully.");
835                        $("#divMedicalConfirm").show();
836
837                        // take care of form open
838                        $("#formOpen").val("false");
839                        window.onbeforeunload = null;
840                    } else {
841                        $("#divMedicalAlert").html("Medical was not added.");
842                        $("#divMedicalAlert").show();
843                    }
844                    theSection.removeClass("account-spinner");
845                }).fail(function (jqXHR, textStatus, err) {
846                    $("#divMedicalAlert").html("There was an error trying to add the medical.");
847                    $("#divMedicalAlert").show();
848                    theSection.removeClass("account-spinner");
849                });
850            };
851
852            var deleteMedical = function (theForm, theSection) {
853                $("#divMedicalConfirm").hide();
854                $("#divMedicalConfirm").html("");
855                $("#divMedicalAlert").hide();
856                $("#divMedicalAlert").html("");
857
858                theSection.addClass("account-spinner");
859                $.post("/api/CustomerMedical/ProcessMedical", {
860               
860     FormData: $("#FormData").val(),
861                    Action: "D",
862                    Id: $("#" + theForm[0].id + " #MedicalId").val()
863                }, function () {}).done(function (data) {
864                    if (data.medicalSuccess) {
865                        $("#divMedicalConfirm").html("Medical deleted successfully.");
866                        $("#divMedicalConfirm").show();
867
868                        theSection.removeClass("account-spinner");
869                        theSection.remove();
870
871                        $("#formOpen").val("false");
872                        window.onbeforeunload = null;
873                    } else {
874                        $("#divMedicalAlert").html("Medical was not deleted.");
875                        $("#divMedicalAlert").show();
876                        theSection.removeClass("account-spinner");
877                    }
878                }).fail(function (jqXHR, textStatus, err) {
879                    $("#divMedicalAlert").html("There was an error trying to delete the medical.");
880                    $("#divMedicalAlert").show();
881                    theSection.removeClass("account-spinner");
882                });
883            };
884
885            var setDate = function (theSection, theForm) {
886                var bDate = Date.parse($("#" + theForm[0].id + " #BirthDate").val());
887                var iDate = Date.parse($("#" + theForm[0].id + " #IssuanceDate").val());
888                var code = $("#" + theForm[0].id + " #SelectedMedicalCode").val();
889
890                if (code !== "") {
891
892                    if (!isNaN(iDate)) {
893
894                        var bD;
895                        if (!isNaN(bDate)) {
896                            bD = $("#" + theForm[0].id + " #BirthDate").val();
897                        } else {
898                            bD = "1/1/0001";
899                        }
900
901                        $.getJSON("/api/MedicalExpire/Get/?medicalType=" + code + "&birthDate=" + bD + "&issueDate=" + $("#" + theForm[0].id + " #IssuanceDate").val()).done(function (data) {
902                            var calc = theSection[0].querySelector("#spCalcExp");
903                            calc.innerHTML = "Calculated " + data;
904                        }).fail(function (jqXHR, textStatus, err) {
905                            var calc = theSection[0].querySelector("#spCalcExp");
906                            calc.innerHTML = "Calculated --/--/----";
907                        });
908                    } else {
909                        var calc = theSection[0].querySelector("#spCalcExp");
910                        calc.innerHTML = "Calculated --/--/----";
911                    }
912                } else {
913                    var calc = theSection[0].querySelector("#spCalcExp");
914                    calc.innerHTML = "Calculated --/--/----";
915                }
916            };
917
918            // 'edit' section click handler
919            $(document).on("click", ".my_account_content a.edit", function (e) {
920                e.preventDefault();
921                e.stopPropagation();
922
923                var $theButton = $(this);
924                var $theSection = $theButton.parents("section");
925                var $theForm = $theSection.children("form");
926
927                if ($("#formOpen").val() === "false") {
928                    if ($theForm[0].id.startsWith("fmPilotInfo")) {
929                        editPilotInfo($theForm);
930                    } else if ($theForm[0].id.startsWith("fmMedical")) {
931                        editMedical($theForm);
932                    } else if ($theForm[0].id.startsWith("fmAircraft")) {
933                        editAircraft($theForm);
934                    }
935
936                    // set the section to be editable
937                    $theSection.addClass("wip");
938                    $("#formOpen").val($theForm[0].id);
939                    window.onbeforeunload = confirmOnPageExit;
940                } else {
941                    alert("Another form is already open.\n\nPlease Save or Cancel before proceeding.");
942                }
943            });
944
945            // 'save' section click handler
946            $(document).on("click", ".my_account_content a.save", function (e) {
947                e.preventDefault();
948                e.stopPropagation();
949
950                var $theButton = $(this);
951                var $theSection = $theButton.parents("section");
952                var $theForm = $theSection.children("form");
953
954                if ($theForm.valid()) {
955                    if ($theForm[0].id.startsWith("fmPilotInfo")) {
956                        savePilotInfo($theForm, $theSection);
957                    } else if ($theForm[0].id.startsWith("fmAircraft")) {
958                        saveAircraft($theForm, $theSection);
959                    } else if ($theForm[0].id.startsWith("fmMedical")) {
960                        saveMedical($theForm, $theSection);
961                    }
962                }
963            });
964
965            // 'cancel' section click handler
966            $(document).on("click", ".my_account_content a.cancel", function (e) {
967                e.preventDefault();
968                e.stopPropagation();
969
970                var $theButton = $(this);
971                var $theSection = $theButton.parents("section");
972                var $theForm = $theSection.children("form");
973
974                if ($theForm[0].id.startsWith("fmPilotInfo")) {
975                    cancelPilotInfo($theForm);
976                } else if ($theForm[0].id.startsWith("fmAircraft")) {
977                    cancelAircraft($theForm);
978                } else if ($theForm[0].id.startsWith("fmMedical")) {
979                    cancelMedical($theForm);
980                }
981
982                var validator = $theForm.validate();
983                validator.hideErrors();
984                validator.resetForm();
985                validator.reset();
986
987                //reset unobtrusive field level, if it exists
988                $theForm.find("[data-valmsg-replace]").removeClass("field-validation-error").addClass("field-validation-valid").empty();
989
990                // set the section to be non-editable
991                $theSection.removeClass("wip");
992
993                $("#formOpen").val("false");
994                window.onbeforeunload = null;
995            });
996
997            // 'delete' section click handler
998            $(document).on("click", ".my_account_content a.delete", function (e) {
999                e.preventDefault();
1000                e.stopPropagation();
1001
1002                var $theButton = $(this);
1003                var $theSection = $theButton.parents("section");
1004                var $theForm = $theSection.children("form");
1005
1006                if ($("#formOpen").val() === "false") {
1007                    if ($theForm[0].id.startsWith("fmAircraft")) {
1008                        deleteAircraft($theForm, $theSection);
1009                    } else if ($theForm[0].id.startsWith("fmMedical")) {
1010                        deleteMedical($theForm, $theSection);
1011                    }
1012                } else {
1013                    alert("Another form is already open.\n\nPlease Save or Cancel before proceeding.");
1014                }
1015            });
1016
1017            // 'add' section click handler
1018            $("section.add").on("click", function () {
1019                var $theForm = $(this).children("form");
1020
1021                if ($("#formOpen").val() === "false") {
1022                    if ($theForm[0].id.startsWith("fmAircraft")) {
1023                        addAircraft($theForm);
1024                    } else if ($theForm[0].id.startsWith("fmMedical")) {
1025                        addMedical($theForm);
1026                    }
1027
1028                    $("#formOpen").val($theForm[0].id);
1029                    $(this).addClass("wip").find("input, select").removeAttr("disabled").removeAttr("readonly");
1030                    window.onbeforeunload = confirmOnPageExit;
1031                } else {
1032                    if ($theForm[0].id !== $("#formOpen").val()) {
1033                        alert("Another form is already open.\n\nPlease Save or Cancel before proceeding.");
1034                    }
1035                }
1036            });
1037
1038            $("#btnMoveRight").click(function () {
1039                var result = !$("#selLeft option:selected").remove().prop("selected", false).appendTo("#selRight");
1040
1041                var rightItems = "";
1042                $("#selRight option").each(function () {
1043                    rightItems += $(this).text() + "<br>";
1044                });
1045
1046                var $theButton = $(this);
1047                var $theSection = $theButton.parents("section");
1048                var $theForm = $theSection.children("form");
1049                $("#" + $theForm[0].id + " #tdRatingsList").html(rightItems);
1050                return result;
1051            });
1052
1053            $("#btnMoveLeft").click(function () {
1054                var result = !$("#selRight option:selected").remove().prop("selected", false).appendTo("#selLeft");
1055                var rightItems = "";
1056                $("#selRight option").each(function () {
1057                    rightItems += $(this).text() + "<br>";
1058                });
1059                var $theButton = $(this);
1060                var $theSection = $theButton.parents("section");
1061                var $theForm = $theSection.children("form");
1062                $("#" + $theForm[0].id + " #tdRatingsList").html(rightItems);
1063                return result;
1064            });
1065
1066            /*
1067            $('.medBDt').on('change', function () {
1068                var $theSection = $(this).parents("section");
1069                var $theForm = $(this).parents("form");
1070                setDate($theSection, $theForm);
1071            });
1072              $('.medIDt').on('change', function () {
1073                var $theSection = $(this).parents("section");
1074                var $theForm = $(this).parents("form");
1075                setDate($theSection, $theForm);
1076            });
1077              $('.medMSel').on('change', function () {
1078                var $theSection = $(this).parents("section");
1079                var $theForm = $(this).parents("form");
1080                setDate($theSection, $theForm);
1081            });
1082            */
1083
1084            $(document).on("change", ".medBDt", function () {
1085                var $theSection = $(this).parents("section");
1086                var $theForm = $(this).parents("form");
1087                setDate($theSection, $theForm);
1088            });
1089
1090            $(document).on("change", ".medIDt", function () {
1091                var $theSection = $(this).parents("section");
1092                var $theForm = $(this).parents("form");
1093                setDate($theSection, $theForm);
1094            });
1095
1096            $(document).on("change", ".medMSel", function () {
1097                var $theSection = $(this).parents("section");
1098                var $theForm = $(this).parents("form");
1099                setDate($theSection, $theForm);
1100            });
1101
1102            confirmOnPageExit = function confirmOnPageExit(e) {
1103                // If we haven't been passed the event get the window.event
1104                e = e || window.event;
1105
1106                var message = "A form is open. Please Save or Cancel before proceeding.";
1107
1108                // For IE6-8 and Firefox prior to version 4
1109                if (e) {
1110                    e.returnValue = message;
1111                }
1112
1113                // For Chrome, Safari, IE8+ and Opera 12+
1114                return message;
1115            };
1116        })();
1117    }
1118});
1119
1120},{}],5:[function(require,module,exports){
1121"use strict";
1122
1123$(document).ready(function () {
1124    if ($("div#divSsoAccountCreate").length) {
1125        var theForm = $("#frmSsoAccountCreate");
1126
1127        $(".ssoRegisterButton").click(function () {
1128            if (theForm.valid()) {
1129                $(this).hide();
1130                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1131                theForm.submit();
1132            } else {
1133                var firstInstance = $(".input-validation-error").first();
1134                var offsetTop = firstInstance.offset().top - 100;
1135
1136                $("html, body").animate({ scrollTop: offsetTop }, 500);
1137            }
1138        });
1139    }
1140});
1141
1142},{}],6:[function(require,module,exports){
1143"use strict";
1144
1145$(document).ready(function () {
1146    if ($("div#divIntlAddressFields").length) {
1147        (function () {
1148            var setAddressLine = function (data, line, field) {
1149                var theLine = $.grep(data, function (n, i) {
1150                    return n.name === line;
1151                });
1152
1153                if (line === "COUNTRY_DESCR" || theLine[0].required) {
1154                    $("#divCFI" + field + "Label").html("<strong>" + theLine[0].label + "</strong><span class=\"redCopy\">*</span>");
1155
1156                    if (line === "STATE") {
1157                        if ($("#" + field + " option").length > 1) {
1158                            $("#" + field + "Required").val(theLine[0].required);
1159                            $("#" + field + "TextRequired").val("False");
1160                        } else {
1161                            $("#" + field + "Required").val("False");
1162                            $("#" + field + "TextRequired").val(theLine[0].required);
1163                        }
1164                    } else {
1165                        $("#" + field + "Required").val("True");
1166                    }
1167                } else {
1168                    $("#divCFI" + field + "Label").html("<strong>" + theLine[0].label + "</strong>");
1169                    $("#" + field + "Required").val("False");
1170                    if (line === "STATE") {
1171                        $("#" + field + "TextRequired").val("False");
1172                    }
1173                }
1174                if (line !== "COUNTRY_DESCR") {
1175                    if (line === "STATE") {
1176                        $("#" + field + "Text").attr("maxlength", theLine[0].length);
1177                    } else {
1178                        $("#" + field).attr("maxlength", theLine[0].length);
1179                    }
1180                }
1181
1182                if (theLine[0].show) {
1183                    if (field !== "COUNTRY_DESCR") {
1184                        $("#div" + field).css({ visibility: "visible" });
1185                        $("#div" + field).css({ display: "block" });
1186                    }
1187
1188                    if (line === "STATE") {
1189                        if ($("#" + field + " option").length > 1) {
1190                            $("#" + field + "UsesDropDown").val("True");
1191                            $("#div" + field + "DropDown").css({ visibility: "visible" });
1192                            $("#div" + field + "DropDown").css({ display: "block" });
1193                            $("#div" + field + "Text").css({ visibility: "hidden" });
1194                            $("#div" + field + "Text").css({ display: "none" });
1195                        } else {
1196                            $("#" + field + "UsesDropDown").val("False");
1197                            $("#div" + field + "DropDown").css({ visibility: "hidden" });
1198                            $("#div" + field + "DropDown").css({ display: "none" });
1199                            $("#div" + field + "Text").css({ visibility: "visible" });
1200                            $("#div" + field + "Text").css({ display: "block" });
1201                        }
1202                    }
1203                } else {
1204                    if (line !== "COUNTRY_DESCR") {
1205                        $("#div" + field).css({ visibility: "hidden" });
1206                        $("#div" + field).css({ display: "none" });
1207                        $("#" + field).val("");
1208                    }
1209
1210                    if (line === "STATE") {
1211                        $("#State").empty();
1212                        var $option = $("<option />");
1213                        $option.attr("value", "0").text("- No State/Province -");
1214                        $("#State").append($option);
1215                    }
1216                }
1217
1218                $("#" + field).valid();
1219            };
1220
1221            $("#Country").change(function () {
1222                var option = $(this).find("option:selected").val();
1223                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
1224                    $("#State").empty();
1225                    $.each(data, function (key, item) {
1226                        var $option = $("<option />");
1227                        if (item.value === "") {
1228                            $option.attr("value", item.value).text("- Select -");
1229                        } else {
1230                            $option.attr("value", item.value).text(item.text);
1231                        }
1232                        $("#State").append($option);
1233                    });
1234
1235                    $.getJSON("/api/AddressStructure/GetAddressStructure/?countryCode=" + option).done(function (data) {
1236                        if (!jQuery.isEmptyObject(data)) {
1237                            setAddressLine(data, "ADDRESS_1", "Address1");
1238                            setAddressLine(data, "ADDRESS_2", "Address2");
1239                            setAddressLine(data, "ADDRESS_3", "Address3");
1240                            setAddressLine(data, "ADDRESS_4", "Address4");
1241                            setAddressLine(data, "CITY", "City");
1242                            setAddressLine(data, "STATE", "State");
1243                            setAddressLine(data, "COUNTY", "County");
1244                            setAddressLine(data, "POSTAL_CODE", "PostalCode");
1245                            setAddressLine(data, "COUNTRY_DESCR", "Country");
1246                        } else {
1247                            $.getJSON("/api/AddressStructure/GetAddressStructure/?countryCode=[ALL]").done(function (data) {
1248                                setAddressLine(data, "ADDRESS_1", "Address1");
1249                                setAddressLine(data, "ADDRESS_2", "Address2");
1250                                setAddressLine(data, "ADDRESS_3", "Address3");
1251                                setAddressLine(data, "ADDRESS_4", "Address4");
1252                                setAddressLine(data, "CITY", "City");
1253                                setAddressLine(data, "STATE", "State");
1254                                setAddressLine(data, "COUNTY", "County");
1255                                setAddressLine(data, "POSTAL_CODE", "PostalCode");
1256                                setAddressLine(data, "COUNTRY_DESCR", "Country");
1257                            }).fail(function (jqXHR, textStatus, err) {});
1258                        }
1259                    }).fail(function (jqXHR, textStatus, err) {});
1260                }).fail(function (jqXHR, textStatus, err) {
1261                    $("#State").empty();
1262                    var $option = $("<option />");
1263                    $options.attr("value", "").text("- Error -");
1264                    $("#State").append($option);
1265                });
1266            });
1267        })();
1268    }
1269});
1270
1271},{}],7:[function(require,module,exports){
1272"use strict";
1273
1274$(document).ready(function () {
1275    $(document).on("change", ".afCountrySelector", function () {
1276        var $theForm = $(this).parents("form");
1277        var $theSection = $(this).parents("section");
1278
1279        var option = $(this).find("option:selected").val();
1280
1281        $theSection.addClass("account-spinner");
1282        $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
1283            var $states = $("#" + $theForm[0].id + " #State");
1284            $states.empty();
1285
1286            $.each(data, function (key, item) {
1287                var $option = $("<option />");
1288                if (item.value === "") {
1289                    $option.attr("value", item.value).text("- Select -");
1290                } else {
1291                    $option.attr("value", item.value).text(item.text);
1292                    if (item.value === $("#" + $theForm[0].id + " #initState").val()) {
1293                        $option.attr("selected", "selected");
1294                    }
1295                }
1296                $states.append($option);
1297            });
1298            $.getJSON("/api/AddressStructure/GetAddressStructure/?countryCode=" + option).done(function (data) {
1299                if (!jQuery.isEmptyObject(data)) {
1300                    setAddressLine(data, $theForm, "ADDRESS_1", "Address1");
1301                    setAddressLine(data, $theForm, "ADDRESS_2", "Address2");
1302                    setAddressLine(data, $theForm, "ADDRESS_3", "Address3");
1303                    setAddressLine(data, $theForm, "ADDRESS_4", "Address4");
1304                    setAddressLine(data, $theForm, "CITY", "City");
1305                    setAddressLine(data, $theForm, "STATE", "State");
1306                    setAddressLine(data, $theForm, "COUNTY", "County");
1307                    setAddressLine(data, $theForm, "POSTAL_CODE", "PostalCode");
1308                    setAddressLine(data, $theForm, "COUNTRY_DESCR", "Country");
1309                } else {
1310                    $.getJSON("/api/AddressStructure/GetAddressStructure/?countryCode=[ALL]").done(function (data) {
1311                        setAddressLine(data, $theForm, "ADDRESS_1", "Address1");
1312                        setAddressLine(data, $theForm, "ADDRESS_2", "Address2");
1313                        setAddressLine(data, $theForm, "ADDRESS_3", "Address3");
1314                        setAddressLine(data, $theForm, "ADDRESS_4", "Address4");
1315                        setAddressLine(data, $theForm, "CITY", "City");
1316                        setAddressLine(data, $theForm, "STATE", "State");
1317                        setAddressLine(data, $theForm, "COUNTY", "County");
1318                        setAddressLine(data, $theForm, "POSTAL_CODE", "PostalCode");
1319                        setAddressLine(data, $theForm, "COUNTRY_DESCR", "Country");
1320                    }).fail(function (jqXHR, textStatus, err) {});
1321                }
1322            }).fail(function (jqXHR, textStatus, err) {});
1323            $theSection.removeClass("account-spinner");
1324        }).fail(function (jqXHR, textStatus, err) {
1325            $("#" + $theForm[0].id + " #State").empty();
1326            var $option = $("<option />");
1327            $options.attr("value", "").text("- Error -");
1328            $("#" + $theForm[0].id + " #State").appe
1328nd($option);
1329            $theSection.removeClass("account-spinner");
1330        });
1331    });
1332
1333    function setAddressLine(data, theForm, line, field) {
1334        var theLine = $.grep(data, function (n, i) {
1335            return n.name === line;
1336        });
1337
1338        //
1339        // Get the Container
1340        //
1341        var conDiv;
1342        var conDivOffState;
1343
1344        if (line === "STATE") {
1345            if ($("#" + theForm[0].id + " #" + field + " option").length > 1) {
1346                conDiv = $("#" + theForm[0].id).find(".af" + field + "Dropdown");
1347                conDivOffState = $("#" + theForm[0].id).find(".af" + field + "Text");
1348            } else {
1349                conDiv = $("#" + theForm[0].id).find(".af" + field + "Text");
1350                conDivOffState = $("#" + theForm[0].id).find(".af" + field + "Dropdown");
1351            }
1352        } else {
1353            conDiv = $("#" + theForm[0].id).find(".af" + field);
1354        }
1355
1356        var lbl = conDiv.children("label");
1357        if (line === "COUNTRY_DESCR" || theLine[0].required) {
1358            lbl.html(theLine[0].label + "<span class=\"redCopy\">*</span>");
1359            if (line === "STATE") {
1360                if ($("#" + theForm[0].id + " #" + field + " option").length > 1) {
1361                    $("#" + theForm[0].id + " #" + field + "Required").val(theLine[0].required);
1362                    $("#" + theForm[0].id + " #" + field + "TextRequired").val("False");
1363                } else {
1364                    $("#" + theForm[0].id + " #" + field + "Required").val("False");
1365                    $("#" + theForm[0].id + " #" + field + "TextRequired").val(theLine[0].required);
1366                }
1367            } else {
1368                $("#" + theForm[0].id + " #" + field + "Required").val("True");
1369            }
1370        } else {
1371            lbl.html(theLine[0].label);
1372            $("#" + theForm[0].id + "#" + field + "Required").val("False");
1373            if (line === "STATE") {
1374                $("#" + theForm[0].id + " #" + field + "TextRequired").val("False");
1375            }
1376        }
1377
1378        if (line !== "COUNTRY_DESCR") {
1379            if (line === "STATE") {
1380                $("#" + theForm[0].id + " #" + field + "Text").attr("maxlength", theLine[0].length);
1381            } else {
1382                $("#" + theForm[0].id + " #" + field).attr("maxlength", theLine[0].length);
1383            }
1384        }
1385
1386        if (theLine[0].show) {
1387            if (field !== "COUNTRY_DESCR") {
1388                conDiv.show();
1389            }
1390
1391            if (line === "STATE") {
1392                if ($("#" + theForm[0].id + " #" + field + " option").length > 1) {
1393                    $("#" + theForm[0].id + " #" + field + "UsesDropDown").val("True");
1394                } else {
1395                    $("#" + theForm[0].id + " #" + field + "UsesDropDown").val("False");
1396                }
1397                conDiv.show();
1398                conDivOffState.hide();
1399            }
1400        } else {
1401            if (line !== "COUNTRY_DESCR") {
1402                conDiv.hide();
1403                $("#" + theForm[0].id + " #" + field).val("");
1404            }
1405
1406            if (line === "STATE") {
1407                conDivOffState.hide();
1408                $("#" + theForm[0].id + " #State").empty();
1409                var $option = $("<option />");
1410                $option.attr("value", "0").text("- No State/Province -");
1411                $("#" + theForm[0].id + " #State").append($option);
1412            }
1413        }
1414    }
1415});
1416
1417},{}],8:[function(require,module,exports){
1418"use strict";
1419
1420$(document).ready(function () {
1421    if ($("div#divAddUpdateAar").length) {
1422
1423        var aareStripe = Stripe($("#sapik").val());
1424
1425        var aareElements = aareStripe.elements();
1426        var aareStyle = {
1427            base: {
1428                backgroundColor: "#ffffff",
1429                fontSize: "0.9375rem",
1430                fontFamily: "Roboto, Helvetica Neue, sans-serif",
1431                lineHeight: "42px",
1432                ":focus": {
1433                    border: "10px solid black"
1434                }
1435            }
1436        };
1437        var aareCardNumberElement = aareElements.create("card", { style: aareStyle, hidePostalCode: true, disableLink: true });
1438        aareCardNumberElement.mount("#card-element");
1439
1440        aareCardNumberElement.on("change", function (event) {
1441            var displayError = document.getElementById("card-errors");
1442            if (event.error) {
1443                displayError.textContent = event.error.message;
1444            } else {
1445                displayError.textContent = "";
1446            }
1447
1448            $("#CardBrand").val(event.brand);
1449        });
1450
1451        var cardElement = document.getElementById("card-element");
1452
1453        var checkCardFields = function () {
1454            var isValid = false;
1455
1456            isValid = cardElement.classList.contains("StripeElement--complete");
1457
1458            var brand = $("#CardBrand").val();
1459
1460            if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
1461                $("#card-errors").html("");
1462            } else {
1463                if ($("#card-errors").is(":empty")) {
1464                    $("#card-errors").html("Please check your credit card information.");
1465                }
1466            }
1467
1468            return isValid;
1469        };
1470
1471        $(".submitButtonAARE").click(function () {
1472            var theForm = $(this).closest("form");
1473
1474            var ccValid = checkCardFields();
1475
1476            if (theForm.valid() && ccValid) {
1477                $("#btnEnroll").hide();
1478                $(this).hide();
1479                $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
1480
1481                aareStripe.createToken(aareCardNumberElement, { name: $("#CardName").val() }).then(function (result) {
1482                    if (result.token !== null) {
1483                        $("#CardToken").val(JSON.stringify(result.token));
1484                        theForm.submit();
1485                    } else {
1486                        if ($("#card-errors").is(":empty")) {
1487                            $("#card-errors").html("Please check your credit card information.");
1488                        }
1489                        var spinner = document.getElementById("aopaSpinner");
1490                        spinner.parentElement.removeChild(spinner);
1491                        $(this).show();
1492                        $("#btnEnroll").show();
1493                    }
1494                });
1495            }
1496        });
1497    }
1498});
1499
1500},{}],9:[function(require,module,exports){
1501"use strict";
1502
1503$(document).ready(function () {
1504    if ($("div#divAddUpdatePps").length) {
1505
1506        $("#SelectedPpsRateCode").change(function () {
1507            var ppsrate = $("#SelectedPpsRateCode").val().split("|");
1508
1509            $.getJSON("/api/PpsProrate/Get/?ppsProductId=" + $("#PpsProductId").val() + "&rateCode=" + ppsrate[1] + "&cycleBeginDate=" + $("#NextCycleBeginDate").val()).done(function (data) {
1510                $(".formSubmitButton").prop("disabled", false);
1511                $("#ProratedAmount").val(data.toFixed(2));
1512                $("#divProratedAmount").text("$" + data.toFixed(2));
1513
1514                if ($("#DiscountType").val() === "P") {
1515                    $("#ProratedDiscount").val((data.toFixed(2) * ($("#DiscountAmount").val() / 100)).toFixed(2));
1516                    $("#ProductDiscount").val(parseFloat(ppsrate[2]) * ($("#DiscountAmount").val() / 100).toFixed(2));
1517                }
1518
1519                if ($("#AddAmounts").val() === "True" || $("#AddAmounts").val() === "true") {
1520                    $("#divPDA").text("-$" + parseFloat($("#ProductDiscount").val()).toFixed(2));
1521                    $("#divPrDA").text("-$" + parseFloat($("#ProratedDiscount").val()).toFixed(2));
1522                    var theRate1 = data + parseFloat(ppsrate[2]) - parseFloat($("#ProratedDiscount").val()) - parseFloat($("#ProductDiscount").val());
1523                    $(".pps-total strong").text("$" + theRate1.toFixed(2));
1524                } else {
1525                    $("#divPrDA").text("-$" + parseFloat($("#ProratedDiscount").val()).toFixed(2));
1526                    var theRate2 = data - parseFloat($("#ProratedDiscount").val());
1527                    $(".pps-total strong").text("$" + theRate2.toFixed(2));
1528                }
1529            }).fail(function (jqXHR, textStatus, err) {
1530                $(".formSubmitButton").prop("disabled", true);
1531                $("#ProratedAmount").val("-.--");
1532                $("#divProratedAmount").text("$-.--");
1533                $(".pps-total strong").text("$-.--");
1534            });
1535        });
1536
1537        $("input[name=SelectedPaymentOption]").on("change", function () {
1538            if ($("input[name=SelectedPaymentOption]:checked").val() === "UseCardOnFile") {
1539                $("#divPayment").css({ visibility: "hidden" });
1540                $("#divPayment").css({ display: "none" });
1541                $("#SelectedCreditCardType").val("VISA");
1542                $("#SelectedCreditCardExpMonth").val("12");
1543                var d = new Date();
1544                $("#SelectedCreditCardExpYear").val(d.getFullYear() + 5);
1545                $("#CcNumber").val("4111111111111111");
1546                $("#Cvv").val("123");
1547                $("#NameOnCard").val("xxxx");
1548            } else {
1549                $("#SelectedCreditCardType").val("");
1550                $("#SelectedCreditCardExpMonth").val("");
1551                $("#SelectedCreditCardExpYear").val("");
1552                $("#CcNumber").val("");
1553                $("#Cvv").val("");
1554                $("#NameOnCard").val("");
1555                $("#divPayment").css({ visibility: "visible" });
1556                $("#divPayment").css({ display: "block" });
1557            }
1558        });
1559    }
1560});
1561
1562},{}],10:[function(require,module,exports){
1563"use strict";
1564
1565$(document).ready(function () {
1566    if ($("div#divAftaAopaUserAdminForm").length) {
1567        var theForm = $("#frmAftaAopaUserAdmin");
1568
1569        $(".lookupButtonAftaAopaUser").click(function () {
1570            if (theForm.valid()) {
1571                $("#FormMode").val("Lookup");
1572
1573                $("#btnSearch").hide();
1574                $(".afta-aopauser-process").hide();
1575                $(this).hide();
1576                $(".clsLookup").append("<div class=\"spinner spinner--clockwise\"></div>");
1577                theForm.submit();
1578            }
1579        });
1580
1581        $(".processButtonAftaAopaUser").click(function () {
1582            if (theForm.valid()) {
1583                $("#FormMode").val("Process");
1584
1585                $("#btnSearch").hide();
1586                $("#btnProcess").hide();
1587                $(this).hide();
1588                $(".clsProcess").append("<div class=\"spinner spinner--clockwise\"></div>");
1589                theForm.submit();
1590            }
1591        });
1592    }
1593});
1594
1595},{}],11:[function(require,module,exports){
1596"use strict";
1597
1598$(document).ready(function () {
1599    if ($("div#divAftaBusinessContactForm").length) {
1600        var theForm = $("#frmAftaBusinessContact");
1601
1602        $("#QQHaveIpadSelected").change(function () {
1603            if ($("#QQHaveIpadSelected").val() === "QQHaveIpad|Yes") {
1604                $("#divAftaQualQuestion2").show();
1605            } else {
1606                $("#divAftaQualQuestion2").hide();
1607                $("#divAftaQualQuestion3").hide();
1608
1609                $("#QQTypeOfTrainingSelected").val("").change();
1610                $("#QQPart61or141Selected").val("").change();
1611            }
1612        });
1613
1614        $("#QQPart61or141Selected").change(function () {
1615            if ($("#QQPart61or141Selected").val() === "QQPart61or141|Part 61") {
1616                $("#divAftaQualQuestion3").show();
1617            } else {
1618                $("#divAftaQualQuestion3").hide();
1619                $("#QQTypeOfTrainingSelected").val("").change();
1620            }
1621        });
1622
1623        $(".afta-qq-select").change(function () {
1624            var option = $(this).find("option:selected").val();
1625
1626            $(".afta-qq-text[data-qq-code=\"" + $(this).data("qq-code") + "\"]").hide();
1627
1628            $(".afta-qq-text[data-qq-value=\"" + option + "\"]").show();
1629        });
1630
1631        $(".submitbuttonaftabizcontact").click(function () {
1632            if (theForm.valid()) {
1633                $("#btnEnroll").hide();
1634                $(this).hide();
1635                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1636                theForm.submit();
1637            }
1638        });
1639    }
1640});
1641
1642},{}],12:[function(require,module,exports){
1643"use strict";
1644
1645$(document).ready(function () {
1646    if ($("div#divAftaFlightInstructorAdminForm").length) {
1647        var getLastDayOfYearAndMonth = function (year, month) {
1648            return new Date(new Date(year, month + 1, 1) - 1).getDate();
1649        };
1650
1651        var theForm = $("#frmAftaFlightInstructorAdmin");
1652
1653        $("#DateOfBirth").datepicker({
1654            //beforeShowDay: function (date) {
1655            //    if (date.getDate() === getLastDayOfYearAndMonth(date.getFullYear(), date.getMonth())) {
1656            //        return [true, ''];
1657            //    }
1658            //    return [false, ''];
1659            //},
1660            changeMonth: true,
1661            changeYear: true,
1662            yearRange: new Date().getFullYear() - 110 + ":" + new Date().getFullYear()
1663        });
1664
1665        $(".submitbuttonaftaflightinstructor").click(function () {
1666            if (theForm.valid()) {
1667                $("#btnEnroll").hide();
1668                $(this).hide();
1669                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1670                theForm.submit();
1671            }
1672        });
1673    }
1674});
1675
1676},{}],13:[function(require,module,exports){
1677"use strict";
1678
1679$(document).ready(function () {
1680    if ($("div#divAftaFlightInstructorPublicForm").length) {
1681        var theForm;
1682        var autocomplete;
1683        var initAutocomplete;
1684        var clearValidation;
1685
1686        (function () {
1687            var fillInAddress = function () {
1688                // Get the place details from the autocomplete object.
1689                var place = autocomplete.getPlace();
1690                var address1 = "";
1691                var postcode = "";
1692
1693                $("#MailingStreet").val("");
1694                $("#MailingCity").val("");
1695                $("#MailingStateProvince").val("");
1696                $("#MailingPostalCode").val("");
1697
1698                // Get each component of the address from the place details,
1699                // and then fill-in the corresponding field on the form.
1700                // place.address_components are google.maps.GeocoderAddressComponent objects
1701                // which are documented at http://goo.gle/3l5i5Mr
1702                place.address_components.forEach(function (component) {
1703                    var componentType = component.types[0];
1704
1705                    switch (componentType) {
1706                        case "street_number":
1707                            {
1708                                address1 = "" + component.long_name + " " + address1;
1709                                break;
1710                            }
1711
1712                        case "route":
1713                            {
1714                                address1 += component.short_name;
1715                                break;
1716                            }
1717
1718                        case "postal_code":
1719                            {
1720                                postcode = "" + component.long_name + "" + postcode;
1721                                break;
1722                            }
1723
1724                        case "postal_code_suffix":
1725                            {
1726                                postcode = "" + postcode + "-" + component.long_name;
1727                                break;
1728                            }
1729                        case "locality":
1730                            $("#MailingCity").val(component.long_name);
1731                            clearValidation("MailingCity");
1732                            break;
1733                        case "administrative_area_level_1":
1734                            {
1735                                $("#MailingStateProvince").val(component.short_name);
1736                                clearValidation("MailingStateProvince");
1737                                break;
1738                            }
1739                    }
1740                });
1741
1742                $("#MailingStreet").val(address1);
1743                clearValidation("MailingStreet");
1744                $("#MailingPostalCode").val(postcode);
1745                clearValidation("MailingPostalCode");
1746                $("#MailingStreet").focus();
1747            };
1748
1749            theForm = $("#frmAftaFlightInstructorPublic");
1750
1751            initAutocomplete = function () {
1752                // Create the autocomplete object, restricting the search predictions to
1753                autocomplete = new google.maps.places.Autocomplete(AddressLookup, {
1754                    fields: ["address_components"],
1755                    types: ["address"] });
1756                autocomplete.setComponentRestrictions({
1757                    country: ["us"]
1758                });
1759                // When the user selects an address from the drop-down, populate the
1760                // address fields in the form.
1761                autocomplete.addListener("place_changed", fillInAddress);
1762            };
1763
1764            initAutocomplete();
1765
1766            ;
1767
1768            clearValidation = function (field) {
1769                var theField = $("#" + field);
1770                if (theField.val()) {
1771                    theField.removeClass("input-validation-error").addClass("valid");
1772                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
1773                    $("span[data-valmsg-for='" + field + "']").empty();
1774                }
1775            };
1776
1777            $("#DateOfBirth").datepicker({
1778
1779                changeMonth: true,
1780                changeYear: true,
1781                yearRange: new Date().getFullYear() - 110 + ":" + new Date().getFullYear()
1782            });
1783
1784            $(".submitbuttonaftaflightinstructor").click(function () {
1785                if (theForm.valid()) {
1786                    $("#btnEnroll").hide();
1787                    $(this).hide();
1788                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1789                    theForm.submit();
1790                } else {
1791                    var firstInstance = $(".input-validation-error").first();
1792                    var offsetTop = firstInstance.offset().top - 100;
1793
1794                    $("html, body").animate({
1795                        scrollTop: offsetTop
1796                    }, 500);
1797                }
1798            });
1799
1800            $(".submitbuttonaftafip").click(function () {
1801                if (theForm.valid()) {
1802                    $("#btnSubmitSchool").hide();
1803                    $(this).hide();
1804                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1805                    theForm.submit();
1806                } else {
1807                    var firstInstance = $(".input-validation-error").first();
1808                    var offsetTop = firstInstance.offset().top - 100;
1809
1810                    $("html, body").animate({
1811                        scrollTop: offsetTop
1812                    }, 500);
1813                }
1814            });
1815        })();
1816    }
1817});
1818
1819},{}],14:[function(require,module,exports){
1820"use strict";
1821
1822$(document).ready(function () {
1823    if ($("div#divAftaFlightSchoolAdminForm").length) {
1824        var theForm = $("#frmAftaFlightSchoolAdmin");
1825
1826        $(".submitbuttonaftaflightschool").click(function () {
1827            if (theForm.valid()) {
1828                $("#btnenrollaftaflightschool").hide();
1829                $(this).hide();
1830                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1831                theForm.submit();
1832            }
1833        });
1834    }
1835});
1836
1837},{}],15:[function(require,module,exports){
1838"use strict";
1839
1840$(document).ready(function () {
1841    if ($("div#divAftaSchoolEmployeeAdminForm").length) {
1842        var theForm = $("#frmAftaSchoolEmployeeAdmin");
1843
1844        $(".submitButtonAftaSchoolEmployee").click(function () {
1845            if (theForm.valid()) {
1846                $("#btnEnroll").hide();
1847                $(this).hide();
1848                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1849                theForm.submit();
1850            }
1851        });
1852    }
1853});
1854
1855},{}],16:[function(require,module,exports){
1856"use strict";
1857
1858$(document).ready(function () {
1859    if ($("div#divAftaSchooleEmployeePublicForm").length) {
1860        var theForm = $("#frmAftaSchoolEmployeePublic");
1861
1862        $(".afta-fs-add-request").click(function () {
1863            $("#FormMode").val("SUBMITSCHOOL");
1864            $("#frmEnroll").hide();
1865            $("#frmSubmitSchool").show();
1866            $("#divfiInfoEnroll").hide();
1867            $("#divSchoolInfoSubmit").show();
1868        });
1869
1870        $(".submitbuttonaftaschoolemployeepublic").click(function () {
1871            if (theForm.valid()) {
1872                $("#btnEnroll").hide();
1873                $(this).hide();
1874                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1875                theForm.submit();
1876            } else {
1877                var firstInstance = $(".input-validation-error").first();
1878                var offsetTop = firstInstance.offset().top - 100;
1879
1880                $("html, body").animate({
1881                    scrollTop: offsetTop
1882                }, 500);
1883            }
1884        });
1885
1886        $(".submitbuttonaftasep").click(function () {
1887            if (theForm.valid()) {
1888                $("#btnSubmitSchool").hide();
1889                $(this).hide();
1890                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1891                theForm.submit();
1892            } else {
1893                var firstInstance = $(".input-validation-error").first();
1894                var offsetTop = firstInstance.offset().top - 100;
1895
1896                $("html, body").animate({
1897                    scrollTop: offsetTop
1898                }, 500);
1899            }
1900        });
1901    }
1902});
1903
1904},{}],17:[function(require,module,exports){
1905"use strict";
1906
1907$(document).ready(function () {
1908    if ($("div#divAftaStudentAdminForm").length) {
1909        var getLastDayOfYearAndMonth = function (year, month) {
1910            return new Date(new Date(year, month + 1, 1) - 1).getDate();
1911        };
1912
1913        var theForm = $("#frmAftaStudentAdmin");
1914
1915        $("#DateOfBirth").datepicker({
1916            //beforeShowDay: function (date) {
1917            //    if (date.getDate() === getLastDayOfYearAndMonth(date.getFullYear(), date.getMonth())) {
1918            //        return [true, ''];
1919            //    }
1920            //    return [false, ''];
1921            //},
1922            changeMonth: true,
1923            changeYear: true,
1924            yearRange: new Date().getFullYear() - 110 + ":" + new Date().getFullYear()
1925        });
1926
1927        //$('#AddTestDemographic').change(function () {
1928        //    if (this.checked) {
1929        //        $('#divPaymentInfo').hide();
1930        //    } else {
1931        //        $('#divPaymentInfo').show();
1932        //    }
1933        //});
1934
1935        $(".submitButtonAftaStudent").click(function () {
1936            if (theForm.valid()) {
1937                $("#btnEnroll").hide();
1938                $(this).hide();
1939                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
1940                theForm.submit();
1941            }
1942        });
1943    }
1944});
1945
1946},{}],18:[function(require,module,exports){
1947"use strict";
1948
1949$(document).ready(function () {
1950    if ($("div#divAftaStudentPublicForm").length) {
1951        var theForm;
1952        var aspfStripe;
1953        var aspfElements;
1954        var aspfStyle;
1955        var aspfCardElement;
1956        var autocomplete;
1957        var initAutocomplete;
1958        var clearValidation;
1959        var checkCardFields;
1960
1961        (function () {
1962            var fillInAddress = function () {
1963                // Get the place details from the autocomplete object.
1964                var place = autocomplete.getPlace();
1965                var address1 = "";
1966                var postcode = "";
1967
1968                $("#MailingStreet").val("");
1969                $("#MailingCity").val("");
1970                $("#MailingStateProvince").val("");
1971                $("#MailingPostalCode").val("");
1972
1973                // Get each component of the address from the place details,
1974                // and then fill-in the corresponding field on the form.
1975                // place.address_components are google.maps.GeocoderAddressComponent objects
1976                // which are documented at http://goo.gle/3l5i5Mr
1977                place.address_components.forEach(function (component) {
1978                    var componentType = component.types[0];
1979
1980                    switch (componentType) {
1981                        case "street_number":
1982                            {
1983                                address1 = "" + component.long_name + " " + address1;
1984                                break;
1985                            }
1986
1987                        case "route":
1988                            {
1989                                address1 += component.short_name;
1990                                break;
1991                            }
1992
1993                        case "postal_code":
1994                            {
1995                                postcode = "" + component.long_name + "" + postcode;
1996                                break;
1997                            }
1998
1999                        case "postal_code_suffix":
2000                            {
2001                                postcode = "" + postcode + "-" + component.long_name;
2002                                break;
2003                            }
2004                        case "locality":
2005                            $("#MailingCity").val(component.long_name);
2006                            clearValidation("MailingCity");
2007                            break;
2008                        case "administrative_area_level_1":
2009                            {
2010                                $("#MailingStateProvince").val(component.short_name);
2011                                clearValidation("MailingStateProvince");
2012                                break;
2013                            }
2014                    }
2015                });
2016
2017                $("#MailingStreet").val(address1);
2018                clearValidation("MailingStreet");
2019                $("#MailingPostalCode").val(postcode);
2020                clearValidation("MailingPostalCode");
2021                $("#MailingStreet").focus();
2022            };
2023
2024            theForm = $("#frmAftaStudentPublic");
2025            aspfStripe = Stripe($("#sapik").val());
2026            aspfElements = aspfStripe.elements();
2027            aspfStyle = {
2028                base: {
2029                    backgroundColor: "#eeeded",
2030                    fontSize: "15px",
2031                    fontFamily: "Roboto, Helvetica Neue, sans-serif",
2032                    lineHeight: "42px",
2033                    ":focus": {
2034                        border: "1px solid #c1c2c3"
2035                    }
2036                }
2037            };
2038            aspfCardElement = aspfElements.create("card", { style: aspfStyle, hidePostalCode: true, disableLink: true });
2039
2040            aspfCardElement.mount("#card-element");
2041
2042            aspfCardElement.on("change", function (event) {
2043                var displayError = document.getElementById("card-errors");
2044                if (event.error) {
2045                    displayError.textContent = event.error.message;
2046                } else {
2047                    displayError.textContent = "";
2048                }
2049
2050                $("#CardBrand").val(event.brand);
2051            });
2052
2053            initAutocomplete = function () {
2054                // Create the autocomplete object, restricting the search predictions to
2055                autocomplete = new google.maps.places.Autocomplete(AddressLookup, {
2056                    fields: ["address_components"],
2057                    types: ["address"] });
2058                autocomplete.setComponentRestrictions({
2059                    country: ["us"]
2060                });
2061                // When the user selects an address from the drop-down, populate the
2062                // address fields in the form.
2063                autocomplete.addListener("place_changed", fillInAddress);
2064            };
2065
2066            initAutocomplete();
2067
2068            ;
2069
2070            clearValidation = function (field) {
2071                var theField = $("#" + field);
2072                if (theField.val()) {
2073                    theField.removeClass("input-validation-error").addClass("val
2073id");
2074                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
2075                    $("span[data-valmsg-for='" + field + "']").empty();
2076                }
2077            };
2078
2079            $("#DateOfBirth").datepicker({
2080                changeMonth: true,
2081                changeYear: true,
2082                yearRange: new Date().getFullYear() - 110 + ":" + new Date().getFullYear()
2083            });
2084
2085            $("input[type=radio][name=PaymentOptionSelected]").change(function () {
2086                if (this.value == "USECARDONFILE") {
2087                    $("#divCardFields").hide();
2088                } else {
2089                    $("#divCardFields").show();
2090                }
2091            });
2092
2093            $("#AARAgree").change(function () {
2094                //if (this.checked && $("#TermsOfService").val() === "ACCEPTED") {
2095                if (this.checked) {
2096                    $("#btnEnroll").removeClass("afta-disable-button");
2097                    $("#btnEnroll").prop("disabled", false);
2098                } else {
2099                    $("#btnEnroll").addClass("afta-disable-button");
2100                    $("#btnEnroll").prop("disabled", true);
2101                }
2102            });
2103
2104            $(".submitbuttonaftastudentschoolsubmit").click(function () {
2105                if (theForm.valid()) {
2106                    $("#bnSubmitSchool").hide();
2107                    $(this).hide();
2108                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
2109                    theForm.submit();
2110                }
2111            });
2112
2113            checkCardFields = function () {
2114                var isValid = false;
2115
2116                if ($("#ShowStripeForm").val() === "True") {
2117                    var cardElement = document.querySelector("#card-element");
2118
2119                    isValid = cardElement.classList.contains("StripeElement--complete");
2120
2121                    var brand = $("#CardBrand").val();
2122
2123                    if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
2124                        $("#card-errors").html("");
2125                    } else {
2126                        if ($("#card-errors").is(":empty")) {
2127                            $("#card-errors").html("Please check your credit card information.");
2128                        }
2129                    }
2130                } else {
2131                    isValid = true;
2132                }
2133
2134                return isValid;
2135            };
2136
2137            $(".submitbuttonaftastudent").click(function () {
2138                var ccValid = checkCardFields();
2139                var progressBar = new Sfpb_progressBar();
2140
2141                if (theForm.valid() && ccValid) {
2142                    $("#btnEnroll").hide();
2143                    $(this).hide();
2144                    $("body").addClass("progressbar-modal");
2145                    progressBar.start();
2146                    $(".clsSubmitButton").append("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
2147
2148                    if ($("#ShowStripeForm").val() === "True") {
2149                        aspfStripe.createToken(aspfCardElement, { name: $("#CardName").val() }).then(function (result) {
2150                            if (result.token !== null) {
2151                                $("#CardToken").val(JSON.stringify(result.token));
2152                                theForm.submit();
2153                            } else {
2154                                if ($("#card-errors").is(":empty")) {
2155                                    $("#card-errors").html("Please check your credit card information.");
2156                                }
2157                                var spinner = document.getElementById("aopaSpinner");
2158                                spinner.parentElement.removeChild(spinner);
2159                                $(this).show();
2160                                progressBar.kill();
2161                                $("body").removeClass("progressbar-modal");
2162                                $("#btnEnroll").show();
2163                            }
2164                        });
2165                    } else {
2166                        theForm.submit();
2167                    }
2168                } else {
2169                    var firstInstance = $(".input-validation-error").first();
2170                    var offsetTop = firstInstance.offset().top - 100;
2171
2172                    $("html, body").animate({
2173                        scrollTop: offsetTop
2174                    }, 500);
2175                }
2176            });
2177        })();
2178    }
2179});
2180
2181},{}],19:[function(require,module,exports){
2182"use strict";
2183
2184$(document).ready(function () {
2185    if ($("div#divAftaStudentPurchaseForm").length) {
2186        var theForm;
2187
2188        (function () {
2189            var loadProductOptions = function () {
2190                var products = JSON.parse($("#MembershipOptions").val());
2191
2192                var selected = $("#SelectedMembershipOption").val();
2193
2194                $("#SelectedMembershipOption").empty();
2195                $.each(products.membershipOptions, function () {
2196                    var option = document.createElement("option");
2197
2198                    option.value = this.product;
2199                    if ($("#MembershipTerm").val() === "ANNUAL") {
2200                        option.text = this.annualDescription;
2201                    } else {
2202                        option.text = this.monthlyDescription;
2203                    }
2204                    if (option.value === selected) {
2205                        option.selected = true;
2206                    }
2207
2208                    $("#SelectedMembershipOption").append(option);
2209                });
2210            };
2211
2212            var loadMagazineOptions = function () {
2213                var productData = JSON.parse($("#ProductOptions").val());
2214
2215                var selectedProduct = $("#SelectedMembershipOption").val();
2216                if ($("#MembershipTerm").val() === "MONTHLY") {
2217                    selectedProduct = "MO_" + selectedProduct;
2218                }
2219
2220                var prd = productData.find(function (o) {
2221                    return o.productCode === selectedProduct;
2222                });
2223                var rateData = prd.rateCodes;
2224
2225                if ($("#IsDomestic").val() === "True") {
2226                    rateData = prd.rateCodes.filter(function (o) {
2227                        return o.isDomestic;
2228                    });
2229                }
2230
2231                var selected = $("#SelectedMagazineOption").val();
2232                var found = false;
2233                $("#SelectedMagazineOption").empty();
2234                $.each(rateData, function () {
2235                    var option = document.createElement("option");
2236
2237                    option.value = this.rateCode;
2238                    option.text = this.dropDownText;
2239                    if (option.value === selected) {
2240                        option.selected = true;
2241                        found = true;
2242                    }
2243                    $("#SelectedMagazineOption").append(option);
2244                });
2245
2246                if (!found) {
2247                    $("#SelectedMagazineOption").val($("#SelectedMagazineOption option:first").val());
2248                }
2249            };
2250
2251            var setSummaryTotal = function (updateAar) {
2252                var products = JSON.parse($("#MembershipOptions").val());
2253                var productData = JSON.parse($("#ProductOptions").val());
2254                var selectedProduct = $("#SelectedMembershipOption").val();
2255                if ($("#MembershipTerm").val() === "MONTHLY") {
2256                    selectedProduct = "MO_" + selectedProduct;
2257                }
2258                var prd = productData.find(function (o) {
2259                    return o.productCode === selectedProduct;
2260                });
2261                var rt = prd.rateCodes.find(function (o) {
2262                    return o.rateCode === $("#SelectedMagazineOption").val();
2263                });
2264
2265                $("#afta-purchase-data_summary_membership").html(prd.summaryText);
2266                $("#afta-purchase-data_summary_membership_price").html("$" + parseFloat(rt.price).toFixed(2));
2267                $("#afta-purchase-data_summary_mag").html(rt.summaryDescription);
2268
2269                if (updateAar) {
2270                    if ($("#MembershipTerm").val() === "ANNUAL") {
2271                        $(".aopa-annual-membership-price").html("$" + parseFloat(rt.price).toFixed(2));
2272                        $(".aopa-monthly-membership-price").html("--.--");
2273                        $("input[type=\"checkbox\"][id=\"AARAgree\"]").prop("checked", false).change();
2274                        $("input[type=\"checkbox\"][id=\"IncludeAar\"]").prop("checked", false).change();
2275                        $("#divAarAftaAndMonthly").hide();
2276                        $("#divAarAftaOnly").show();
2277                    } else {
2278                        $(".aopa-annual-membership-price").html("--.--");
2279                        $(".aopa-monthly-membership-price").html("$" + parseFloat(rt.price).toFixed(2));
2280                        $("input[type=\"checkbox\"][id=\"AARAgree\"]").prop("checked", false).change();
2281                        $("input[type=\"checkbox\"][id=\"IncludeAar\"]").prop("checked", false).change();
2282                        $("#divAarAftaAndMonthly").show();
2283                        $("#divAarAftaOnly").hide();
2284                    }
2285                }
2286
2287                var total = 0;
2288                total += parseFloat($("#AftaPrice").val());
2289                total += rt.price;
2290                if ($("#MembershipTerm").val() === "ANNUAL" && $("#DiscountAmount").val() > 0) {
2291                    total -= $("#DiscountAmount").val();
2292                }
2293                $("#OrderTotal").val(total);
2294                $("#afta-purchase-data_summary_total").html("$" + parseFloat(total).toFixed(2));
2295
2296                var annualProd = productData.find(function (o) {
2297                    return o.productCode === $("#SelectedMembershipOption").val();
2298                });
2299                var annRate = annualProd.rateCodes.find(function (o) {
2300                    return o.rateCode === $("#SelectedMagazineOption").val();
2301                });
2302
2303                if ($("#DiscountAmount").val() > 0) {
2304                    $("#btnAnnual").html("<span class=\"joinv4-form-data__strikethrough\">$" + parseFloat(annRate.price) + "</span> $" + parseFloat(annRate.price - $("#DiscountAmount").val()) + " Per Year");
2305                } else {
2306                    $("#btnAnnual").text("$" + parseFloat(annRate.price) + " Per Year");
2307                }
2308
2309                if ($("#IsDomestic").val() === "True") {
2310                    var monthlyProd = productData.find(function (o) {
2311                        return o.productCode === "MO_" + $("#SelectedMembershipOption").val();
2312                    });
2313                    var mthRate = monthlyProd.rateCodes.find(function (o) {
2314                        return o.rateCode === $("#SelectedMagazineOption").val();
2315                    });
2316                    $("#btnMonthly").text("$" + parseFloat(mthRate.price).toFixed(2) + " Per Month");
2317                }
2318            };
2319
2320            var setAAR = function () {
2321                if ($("#MembershipTerm").val() === "ANNUAL") {
2322                    $("#divAAROptional").show();
2323
2324                    if ($("#IncludeAar").is(":checked")) {
2325                        $("#afta-purchase-data_summary_aar").html("YES");
2326                    } else {
2327                        $("#afta-purchase-data_summary_aar").html("NO");
2328                    }
2329                } else {
2330                    $("#divAAROptional").hide();
2331
2332                    $("#afta-purchase-data_summary_aar").html("YES");
2333                }
2334            };
2335
2336            theForm = $("#frmAftaStudentPurchase");
2337
2338            $(".afta-purchase-button").click(function () {
2339                $("#MembershipTerm").val($(this).data("term"));
2340
2341                switch ($(this).data("term")) {
2342                    case "ANNUAL":
2343                        $("#btnAnnual").removeClass("afta-purchase-button__inactive");
2344                        $("#btnMonthly").addClass("afta-purchase-button__inactive");
2345                        break;
2346                    case "MONTHLY":
2347                        $("#btnAnnual").addClass("afta-purchase-button__inactive");
2348                        $("#btnMonthly").removeClass("afta-purchase-button__inactive");
2349                        break;
2350                }
2351                $("input[type=\"checkbox\"][id=\"IncludeAar\"]").prop("checked", false).change();
2352
2353                loadProductOptions();
2354                loadMagazineOptions();
2355                setSummaryTotal(true);
2356                setAAR();
2357            });
2358
2359            $("#SelectedMembershipOption").change(function () {
2360                loadMagazineOptions();
2361                setSummaryTotal(true);
2362                setAAR();
2363            });
2364
2365            $("#SelectedMagazineOption").change(function () {
2366                setSummaryTotal(false);
2367                setAAR();
2368            });
2369
2370            $("#IncludeAar").change(function () {
2371                if (this.checked) {
2372                    $("#afta-purchase-data_summary_aar").html("YES");
2373                } else {
2374                    $("#afta-purchase-data_summary_aar").html("NO");
2375                }
2376            });
2377
2378            $("input[type=radio][name=PaymentOptionSelected]").change(function () {
2379                if (this.value == "USECARDONFILE") {
2380                    $("#divCardFields").hide();
2381                } else {
2382                    $("#divCardFields").show();
2383                }
2384            });
2385
2386            $("#AARAgree").change(function () {
2387                if (this.checked && $("#TermsOfService").val() === "ACCEPTED") {
2388                    $("#btnEnroll").removeClass("afta-disable-button");
2389                    $("#btnEnroll").prop("disabled", false);
2390                } else {
2391                    $("#btnEnroll").addClass("afta-disable-button");
2392                    $("#btnEnroll").prop("disabled", true);
2393                }
2394            });
2395
2396            $(".submitbuttonaftapurchase").click(function () {
2397                if (theForm.valid()) {
2398                    $("#btnEnroll").hide();
2399                    $(this).hide();
2400                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
2401                    theForm.submit();
2402                }
2403            });
2404        })();
2405    }
2406});
2407
2408},{}],20:[function(require,module,exports){
2409"use strict";
2410
2411$(document).ready(function () {
2412    if (!$("body.in-sitecore").length) {
2413        $("h2.aircraftDetailSectionTitle").click(function () {
2414            $(this).toggleClass("is-open");
2415        });
2416    }
2417});
2418
2419},{}],21:[function(require,module,exports){
2420"use strict";
2421
2422$(document).ready(function () {
2423    if ($("div#divAOPAAircraftInformationUpdate").length) {
2424        $("#InsuranceExpireDate").datepicker({
2425            changeMonth: true,
2426            changeYear: true
2427        });
2428    }
2429});
2430
2431},{}],22:[function(require,module,exports){
2432"use strict";
2433
2434$(document).ready(function () {
2435    if ($("div#divAircraftShowcaseForm").length) {
2436        var theForm;
2437
2438        (function () {
2439            var QuestionnaireReset = function (product) {
2440                var data = JSON.parse(decodeURIComponent($("#" + product + "QuestionnaireData").val()));
2441                for (var i = 0; i < data.length; i++) {
2442                    switch (data[i].type) {
2443                        case "Select":
2444                            $("#ScQuestionSelect" + data[i].qid + " option[value=\"" + data[i].qa + "\"]").prop("selected", true);
2445                            break;
2446                        case "CB":
2447                            var answers = data[i].qa.split(",");
2448                            $.each(answers, function (index, obj) {
2449                                $("input.ScQuestionCB" + data[i].qid + "[value=\"" + obj + "\"]").prop("checked", true);
2450                            });
2451                            break;
2452                    }
2453                }
2454            };
2455
2456            var SummaryVolunteerSection = function (section, cssclass, show) {
2457                if (show && ($("input:radio[name=" + section + "Day1VolunteerJobsSelected]:checked").val() || $("input:radio[name=" + section + "Day2VolunteerJobsSelected]:checked").val() || $("input:radio[name=" + section + "Day3VolunteerJobsSelected]:checked").val())) {
2458                    $(".hsse-" + cssclass + "-volunteer-section").show();
2459                } else {
2460                    $(".hsse-" + cssclass + "-volunteer-section").hide();
2461                }
2462            };
2463
2464            var validateDiv = function (div) {
2465                var validator = theForm.data("validator");
2466                var returnValue = true;
2467
2468                $("#" + div + " :input").each(function (e) {
2469                    if (!$(this).is(":button") && this.id.length) {
2470                        if (!validator.element($("#" + this.id))) returnValue = false;
2471                    }
2472                });
2473
2474                return returnValue;
2475            };
2476
2477            var infoDivs = function (page) {
2478                switch (page) {
2479                    case "asPage1":
2480                        $("#asProductName").show();
2481                        $("#asMainInfo").show();
2482                        $("#divEventSummary").show();
2483                        $("#asVolunteerInfo").show();
2484                        break;
2485                    case "asPage2":
2486                        $("#asProductName").show();
2487                        $("#asMainInfo").show();
2488                        $("#divEventSummary").show();
2489                        $("#asVolunteerInfo").show();
2490                        break;
2491                    case "asPage3":
2492                        $("#asProductName").show();
2493                        $("#asMainInfo").show();
2494                        $("#divEventSummary").show();
2495                        $("#asVolunteerInfo").show();
2496                        break;
2497                    case "asPage4":
2498                        $("#asProductName").hide();
2499                        $("#asMainInfo").hide();
2500                        $("#divEventSummary").hide();
2501                        $("#asVolunteerInfo").hide();
2502                        break;
2503                }
2504            };
2505
2506            var calculateTotal = function () {
2507
2508                var total = 0;
2509
2510                var primaryTotal = parseInt($("#AttendeeCountSelected").val(), 10) * parseFloat($("#TicketPrice").val());
2511                var secondaryTotal = parseInt($("#SecondaryCountSelected").val(), 10) * parseFloat($("#SecondaryPrice").val());
2512
2513                total += primaryTotal + secondaryTotal;
2514
2515                $("#divSummaryAttendeeCount").text($("#AttendeeCountSelected").val());
2516                $("#divSummaryLineTotal").text("$" + primaryTotal.toFixed(2));
2517
2518                $("#divSummarySecondaryCount").text($("#SecondaryCountSelected").val());
2519                $("#divSummarySecondaryLineTotal").text("$" + secondaryTotal.toFixed(2));
2520
2521                $("#OrderTotal").val(total);
2522                $(".event-payment-total__price").text("$" + total.toFixed(2));
2523            };
2524
2525            theForm = $("#frmAircraftShowcase");
2526
2527            //
2528            // Camping Handler
2529            //
2530            $("#Camping").click(function () {
2531                var cb = document.getElementById(this.id);
2532                if (cb.checked) {
2533                    $(".sc-camping-section").show();
2534                } else {
2535                    $(".sc-camping-section").hide();
2536                }
2537            });
2538
2539            //
2540            // Reset the questionnaire fields on page load
2541            //
2542            if ($("#ShowcaseQuestionnaireData").val()) {
2543                QuestionnaireReset("Showcase");
2544            }
2545            if ($("#CampingQuestionnaireData").val()) {
2546                QuestionnaireReset("Camping");
2547            }
2548
2549            $(".ScQuestionSelect").change(function () {
2550                var instance = $(this).data("instance");
2551                var data = JSON.parse(decodeURIComponent($("#" + instance + "QuestionnaireData").val()));
2552                var qid = this.id.replace("ScQuestionSelect", "");
2553                var idx = -1;
2554                var ct = 0;
2555
2556                $.each(data, function () {
2557                    if (this.qid.toString() === qid) {
2558                        idx = ct;
2559                        return false;
2560                    }
2561                    ct++;
2562                });
2563
2564                if (idx != -1) {
2565                    data[idx].qa = this.value;
2566                }
2567
2568                $("#" + instance + "QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
2569            });
2570
2571            $(".ScQuestionCB").change(function () {
2572                var instance = $(this).data("instance");
2573                var data = JSON.parse(decodeURIComponent($("#ScQuestionnaireData").val()));
2574                var cbid = this.id;
2575                var qid = this.name.replace(instance + "QuestionCB", "");
2576                var anslist = "";
2577                var idx = -1;
2578                var ct = 0;
2579
2580                $.each(data, function () {
2581                    if (this.qid.toString() === qid) {
2582                        idx = ct;
2583                        return false;
2584                    }
2585                    ct++;
2586                });
2587
2588                $("." + cbid).each(function (index, obj) {
2589                    if (this.checked) {
2590                        anslist += this.value + ",";
2591                    }
2592                });
2593                anslist = anslist.slice(0, -1);
2594
2595                if (idx != -1) {
2596                    data[idx].qa = anslist;
2597                }
2598
2599                $("#" + instance + "QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
2600            });
2601
2602            $(".aircraftshowcasecontinuebutton").click(function () {
2603                if (validateDiv($(this).data("thispage"))) {
2604                    var btn = document.getElementById(this.id);
2605                    var nextpage = $(this).data("nextpage");
2606
2607                    if (btn != null && btn.hasAttribute("data-nextpage-choice")) {
2608                        var cb = document.getElementById($(this).data("nextpage-choice"));
2609                        if (!cb.checked) {
2610                            nextpage = $(this).data("alt-nextpage");
2611                        }
2612                    }
2613
2614                    $("#" + $(this).data("thispage")).hide();
2615                    $("#" + nextpage).show();
2616                    infoDivs(nextpage);
2617                    window.scrollTo(0, 0);
2618                }
2619            });
2620
2621            $(".aircraftshowcasebackbutton").click(function () {
2622                var btn = document.getElementById(this.id);
2623                var prevpage = $(this).data("prevpage");
2624
2625                if (btn != null && btn.hasAttribute("data-prevpage-choice")) {
2626                    var cb = document.getElementById($(this).data("prevpage-choice"));
2627                    if (!cb.checked) {
2628                        prevpage = $(this).data("alt-prevpage");
2629                    }
2630                }
2631
2632                $("#" + $(this).data("thispage")).hide();
2633                $("#" + prevpage).show();
2634                infoDivs(prevpage);
2635                window.scrollTo(0, 0);
2636            });
2637
2638            $("#VolunteerChoice").click(function () {
2639                var cb = document.getElementById(this.id);
2640                if (cb.checked) {
2641                    if ($("#AttendeeCountSelected").val() == "2") {
2642                        $("#divGuestVolunteerQuestion").show();
2643                    } else {
2644                        $("#divGuestVolunteerQuestion").hide();
2645                        var cb = document.getElementById("GuestVolunteerChoice");
2646                        cb.checked = false;
2647                    }
2648
2649                    $("." + $(this).data("reveal-cls")).show();
2650
2651                    SummaryVolunteerSection("Main", "main", true);
2652                } else {
2653                    $("." + $(this).data("reveal-cls")).hide();
2654
2655                    $("#divGuestVolunteerQuestion").hide();
2656                    var cb = document.getElementById("GuestVolunteerChoice");
2657                    cb.checked = false;
2658
2659                    SummaryVolunteerSection("Main", "main", false);
2660                    SummaryVolunteerSection("Guest", "guest", false);
2661                }
2662            });
2663
2664            $("#GuestVolunteerChoice").click(function () {
2665                var cb = document.getElementById(this.id);
2666                if (cb.checked) {
2667                    SummaryVolunteerSection("Guest", "guest", true);
2668                } else {
2669                    SummaryVolunteerSection("Guest", "guest", false);
2670                }
2671            });
2672
2673            $(".aircraft-showcase-guest-u").change(function () {
2674                var cb = document.getElementById("VolunteerChoice");
2675
2676                if ($(this).val() == "2") {
2677                    $("#divGuestInformation").show();
2678                    if (cb.checked) {
2679                        $("#divGuestVolunteerQuestion").show();
2680                    }
2681                } else {
2682                    $("#divGuestInformation").hide();
2683                    $("#divGuestVolunteerQuestion").hide();
2684                    var cb = document.getElementById("GuestVolunteerChoice");
2685                    cb.checked = false;
2686                }
2687                calculateTotal();
2688            });
2689
2690            $(".aircraft-showcase-secondary-u").change(function () {
2691                if ($(this).val() !== "0") {
2692                    $("#divSecondaryRate").show();
2693                } else {
2694                    $("#divSecondaryRate").hide();
2695                }
2696                calculateTotal();
2697            });
2698
2699            $("#VolunteerCertifiedPilot").click(function () {
2700                var cb = document.getElementById(this.id);
2701                if (cb.checked) {
2702                    $(".hsse-main-volunteer-airside").show();
2703                } else {
2704                    $(".hsse-main-volunteer-airside").hide();
2705
2706                    if ($("input:radio[name=MainDay1VolunteerJobsSelected]:checked").val() && $("input:radio[name=MainDay1VolunteerJobsSelected]:checked").val().indexOf("AIRSIDE") >= 0) {
2707                        $("." + $("input:radio[name=MainDay1VolunteerJobsSelected]:checked").data("summary-reveal")).hide();
2708                        $("input:radio[name=MainDay1VolunteerJobsSelected]:checked").prop("checked", false);
2709                        SummaryVolunteerSection("Main", "main", true);
2710                    }
2711
2712                    if ($("input:radio[name=MainDay2VolunteerJobsSelected]:checked").val() && $("input:radio[name=MainDay2VolunteerJobsSelected]:checked").val().indexOf("AIRSIDE") >= 0) {
2713                        $("." + $("input:radio[name=MainDay2VolunteerJobsSelected]:checked").data("summary-reveal")).hide();
2714                        $("input:radio[name=MainDay2VolunteerJobsSelected]:checked").prop("checked", false);
2715                        SummaryVolunteerSection("Main", "main", true);
2716                    }
2717
2718                    if ($("input:radio[name=MainDay3VolunteerJobsSelected]:checked").val() && $("input:radio[name=MainDay3VolunteerJobsSelected]:checked").val().indexOf("AIRSIDE") >= 0) {
2719                        $("." + $("input:radio[name=MainDay3VolunteerJobsSelected]:checked").data("summary-reveal")).hide();
2720                        $("input:radio[name=MainDay3VolunteerJobsSelected]:checked").prop("checked", false);
2721                        SummaryVolunteerSection("Main", "main", true);
2722                    }
2723                }
2724            });
2725
2726            $("#GuestVolunteerCertifiedPilot").click(function () {
2727                var cb = document.getElementById(this.id);
2728                if (cb.checked) {
2729                    $(".hsse-guest-volunteer-airside").show();
2730                } else {
2731                    $(".hsse-guest-volunteer-airside").hide();
2732
2733                    if ($("input:radio[name=GuestDay1VolunteerJobsSelected]:checked").val() && $("input:radio[name=GuestDay1VolunteerJobsSelected]:checked").val().indexOf("AIRSIDE") >= 0) {
2734                        $("." + $("input:radio[name=GuestDay1VolunteerJobsSelected]:checked").data("summary-reveal")).hide();
2735                        $("input:radio[name=GuestDay1VolunteerJobsSelected]:checked").prop("checked", false);
2736                        SummaryVolunteerSection("Guest", "guest", false);
2737                    }
2738
2739                    if ($("input:radio[name=GuestDay2VolunteerJobsSelected]:checked").val() && $("input:radio[name=GuestDay2VolunteerJobsSelected]:checked").val().indexOf("AIRSIDE") >= 0) {
2740                        $("." + $("input:radio[name=GuestDay2VolunteerJobsSelected]:checked").data("summary-reveal")).hide();
2741                        $("input:radio[name=GuestDay2VolunteerJobsSelected]:checked").prop("checked", false);
2742                        SummaryVolunteerSection("Guest", "guest", false);
2743                    }
2744
2745                    if ($("input:radio[name=GuestDay3VolunteerJobsSelected]:checked").val() && $("input:radio[name=GuestDay3VolunteerJobsSelected]:checked").val().indexOf("AIRSIDE") >= 0) {
2746                        $("." + $("input:radio[name=GuestDay3VolunteerJobsSelected]:checked").data("summary-reveal")).hide();
2747                        $("input:radio[name=GuestDay3VolunteerJobsSelected]:checked").prop("checked", false);
2748                        SummaryVolunteerSection("Guest", "guest", false);
2749                    }
2750                }
2751            });
2752
2753            $(".hss-volunteer-rb").click(function () {
2754                var rb = document.getElementById(this.id);
2755
2756                if (rb.checked) {
2757                    $("." + $(this).data("clear-class")).hide();
2758                    $("." + $(this).data("summary-reveal")).show();
2759
2760                    var ty = $(this).data("summary-reveal").split("-")[1];
2761
2762                    SummaryVolunteerSection(ty.charAt(0).toUpperCase() + ty.slice(1), ty, true);
2763                }
2764            });
2765
2766            $("#MainVolunteerShirtSizeSelected").change(function () {
2767                $("#divMainVolunteerShirtSummary").text("Volunteer Shirt (" + $("#MainVolunteerShirtSizeSelected option:selected").text() + ")");
2768            });
2769
2770            $("#GuestVolunteerShirtSizeSelected").change(function () {
2771                $("#divGuestVolunteerShirtSummary").text("Volunteer Shirt (" + $("#GuestVolunteerShirtSizeSelected option:selected").text() + ")");
2772            });
2773
2774            $(".asRegisterButton").click(function () {
2775                if (theForm.valid()) {
2776                    $(".btn_final_cancelback").hide();
2777                    $(this).hide();
2778                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
2779                    theForm.submit();
2780                }
2781            });
2782        })();
2783    }
2784});
2785
2786},{}],23:[function(require,module,exports){
2787"use strict";
2788
2789var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
2790
2791/*
2792 * AOPA custom JS
2793 */
2794
2795require("./shared/aopa-shared");
2796
2797require("./itemlist/itemlist");
2798
2799require("./bookmarks/bookmarks");
2800
2801require("./contentwizard/contentwizard");
2802
2803require("./weather/weather");
2804
2805require("./customformvalidation/ccexpdatevalidation");
2806
2807require("./customformvalidation/ccexpdatevalidation2");
2808
2809require("./customformvalidation/ccnumbercheckvalidation");
2810
2811require("./customformvalidation/radiotextvalidator");
2812
2813require("./customformvalidation/eitherorrequiredvalidation");
2814
2815require("./customformvalidation/usernamevalidation");
2816
2817require("./customformvalidation/airportcodevalidation");
2818
2819require("./customformvalidation/optionalselectcheck");
2820
2821require("./customformvalidation/phonenumbervalidation");
2822
2823require("./customformvalidation/checkboxlistrequiredvalidation");
2824
2825require("./wffm/wffm");
2826
2827require("./financeform/financeform");
2828
2829require("./asnairportsearch/asnairportsearch");
2830
2831require("./asnnominationform/asnnominationform");
2832
2833require("./expandableads/expandableads");
2834
2835require("./oneclickdonation/oneclickdonation");
2836
2837require("./addupdatepps/addupdateppsform");
2838
2839require("./event/jquery-ui-timepicker-addon");
2840
2841require("./scrolldownarrow/scrolldownarrow");
2842
2843require("./comparisontable/comparisontable");
2844
2845require("./timedatepicker/timedatepicker");
2846
2847require("./ppsupgrade/ppsupgrade");
2848
2849require("./optinout/optinout");
2850
2851require("./donationrsvp/donationrsvp");
2852
2853require("./ooyalashare/ooyalashare");
2854
2855require("./statenet/statenetdatafeed");
2856
2857require("./usernameandpassword/usernameandpassword");
2858
2859require("./medicalinformationupdate/medicalinformationupdate");
2860
2861require("./aircraftinformationupdate/aircraftinformationupdate");
2862
2863require("./lspattorneyinformation/lspattorneyinformation");
2864
2865require("./cfiinformationupdate/cfiinformationupdate");
2866
2867require("./customformvalidation/cfiexpirationdatevalidation");
2868
2869require("./customformvalidation/cficertificatenumbervalidation");
2870
2871require("./signupsubscribe/signupsubscribe");
2872
2873require("./customformvalidation/requiredoptionalvalidation");
2874
2875require("./donationrail/donationrail");
2876
2877require("./addressfields/addressfields");
2878
2879require("./forms/forms");
2880
2881require("./globalmemberupgrade/globalmemberupgrade");
2882
2883require("./customformvalidation/aopaccvalidation");
2884
2885require("./genericproductpurchase/genericproductpurchase");
2886
2887require("./eventsearch/eventsearch");
2888
2889require("./ppsmaintenance/ppsmaintenance");
2890
2891require("./pacdonationrail/pacdonationrail");
2892
2893require("./eventregistration/eventregistration");
2894
2895require("./homepagecomponents/crop-image");
2896
2897require("./homepagecomponents/widget-nav");
2898
2899require("./homepagecomponents/jquery.easy-autocomplete.min");
2900
2901require("./homepagecomponents/widget-airport");
2902
2903require("./homepagecomponents/widget-weather");
2904
2905require("./homepagecomponents/partners");
2906
2907require("./homepagecomponents/image-gallery");
2908
2909require("./joincheckout/joincheckout");
2910
2911require("./accountpages/pilotinfoform");
2912
2913require("./accountpages/contactinfoform");
2914
2915require("./freemembership/freemembership");
2916
2917require("./addressfields/addressfieldsaccountform");
2918
2919require("./lspeventregistration/lspeventregistration");
2920
2921require("./rustypilotregistration/rustypilotregistration");
2922
2923require("./eventsignin/rustypilotsignin");
2924
2925require("./flyinregistration/flyinregistration");
2926
2927require("./highschoolworkshopregistration/highschoolworkshopregistration");
2928
2929require("./ftgatedcontent/ftgatedcontent");
2930
2931require("./customformvalidation/attendancecountvalidation");
2932
2933require("./eventsignin/volunteerform");
2934
2935require("./highschoolsymposiumexhibitor/highschoolsymposiumexhibitor");
2936
2937require("./iflightplanner/iflightplanner");
2938
2939require("./picmodal/picmodal");
2940
2941require("./islandguides/islandguides");
2942
2943require("./highschoolsymposiumattendee/highschoolsymposiumattendee");
2944
2945require("./pilotworkshops/pilotworkshops");
2946
2947require("./aopamodal/aopamodal");
2948
2949require("./ycfmodal/ycfmodal");
2950
2951require("./aftapages/aftastudentadmin");
2952
2953require("./aftapages/aftaflightinstructoradmin");
2954
2955require("./aftapages/aftaschoolemployeeadmin");
2956
2957require("./aftapages/aftaaopauseradmin");
2958
2959require("./aftapages/aftaflightschooladmin");
2960
2961require("./oneclickdonationcombined/oneclickdonationcombined");
2962
2963require("./aopajoinformv4/aopajoinformv4");
2964
2965require("./aftapages/aftaflightinstructorpublic");
2966
2967require("./aircraft/aircraft");
2968
2969require("./aftapages/aftastudentpublic");
2970
2971require("./aftapages/aftabusinesscontact");
2972
2973require("./highschoolasaoffer/highschoolasaoffer");
2974
2975require("./aftapages/aftaschoolemployeepublic");
2976
2977require("./accountpages/aopacancellationform");
2978
2979require("./contactus/contactus");
2980
2981require("./aircraftshowcaseregistration/aircraftshowcaseregistration");
2982
2983require("./aftapages/aftastudentpurchase");
2984
2985require("./eventsignin/aviatorshowcasesignin");
2986
2987require("./aoparenewformv2/aoparenewformv2");
2988
2989require("./customformvalidation/dropdowntextvalidator");
2990
2991require("./membershipupgrade/membershipupgradev3");
2992
2993require("./oneclickpacdonation/oneclickpacdonation");
2994
2995require("./customformvalidation/radiotextvalidator2");
2996
2997require("./subscriptions/subscriptions");
2998
2999require("./aafcomplimentarymembership/aafcomplimentarymembership");
3000
3001require("./accountpages/ssoaccountcreate");
3002
3003require("./addupdateaar/addupdateaar");
3004
3005require("./creditcardofrecordupdate/creditcardofrecordupdate");
3006
3007require("./aoparenewformv2/aoparenewformGSv2");
3008
3009require("./efircpurchase/efircpurchase");
3010
3011var toggleHeaderDropdown = _interopRequire(require("./header/toggleHeaderDropdown"));
3012
3013var toggleMobile = _interopRequire(require("./header/toggleMobile"));
3014
3015var stickyHeader = _interopRequire(require("./header/stickyHeader"));
3016
3017var toggleSearch = _interopRequire(require("./header/toggleSearch"));
3018
3019require("./formaccountcreate/formaccountcreate");
3020
3021require("./globalactivationform/globalactivationform");
3022
3023require("./customformvalidation/nousvalidator");
3024
3025require("./textmessageoptinout/textmessageoptinout");
3026
3027require("./newslettersignup/newslettersignup");
3028
3029require("./customformvalidation/emailselectionvalidation");
3030
3031require("./customformvalidation/asnvolunteercheckvalidation");
3032
3033require("./studentoffer/studentoffer");
3034
3035require("./customformvalidation/optionalselect2check");
3036
3037/* get current breakpoint from CSS
3038 * Needs to be global and isn't jQuery, so stick it out here
3039 * Credit goes to https://www.lullabot.com/articles/importing-css-breakpoints-into-javascript
3040 */
3041var breakpoint = {};
3042breakpoint.refreshValue = function () {
3043  this.value = window.getComputedStyle(document.querySelector("body"), ":before").getPropertyValue("content").replace(/\"/g, "");
3044};
3045breakpoint.refreshValue();
3046
3047var hasRefreshNav = $(".js-refresh-nav").length;
3048if (hasRefreshNav) {
3049  document.addEventListener("DOMContentLoaded", function () {
3050    toggleHeaderDropdown();
3051    toggleMobile();
3052    stickyHeader();
3053    toggleSearch();
3054  });
3055}
3056
3057(function ($) {
3058  $(document).ready(function () {
3059    if (!hasRefreshNav) {
3060      /* ***************************************************** */
3061      /* Safe to run in Sitecore */
3062
3063      /* Main Nav columns and right align functionality */
3064      /* 1/20/17   [email protected]   */
3065
3066      (function ($) {
3067
3068        "use strict";
3069
3070        // only do this on larger viewports (not the tablet nav)
3071        if (window.innerWidth >= 1111) {
3072
3073          // number of items at which we split the sub-menu into 2 columns.
3074          var menuItemsPerCol = 6;
3075
3076          // check sub-menu item count for each main nav item
3077          // if greater than menuItemsPerCol, add the wrapping class.
3078
3079          $(".header__nav-main-list li ul").each(function () {
3080            var m = $(this);
3081            if (m.children("li").length > menuItemsPerCol) {
3082              m.addClass("wrapNav");
3083            }
3084          });
3085
3086          // on wrapping-nav-item hover, check to see if the multi-column
3087          // arrangement will cause the menu to collide with the RH edge
3088          // of the viewport. If so, add the .edge class to realign it.
3089
3090          $(".header__nav-sub-list").parent().hover(function () {
3091
3092            var d = $(this),
3093                // the top-level menu item
3094            sM = $(this).find(".header__nav-sub-list"),
3095                // the sub-menu
3096            l = parseInt(d.position().left, 10),
3097                // the left position of the parent menu item
3098            vW = $("body").width(),
3099                // viewport width
3100            w = 0; // variable to hold the drop down width, to use is we need to float it right
3101
3102            // width of sub-menu item
3103            if (sM.hasClass("wrapNav")) {
3104              w = 500;
3105            } else {
3106              w = 250;
3107            }
3108
3109            // if the left position of the dropdown, plus its width, is greater than
3110            // the viewport width, add negative left margin to the drop down menu
3111            // Margin is equal to the negative of the sub-menu with minus its parent's width
3112
3113            if (vW <= 1111 || l + w <= vW) {
3114              sM.css("margin-left", "");
3115            } else {
3116              sM.css("margin-left", (w - d.width()) * -1);
3117            }
3118          });
3119        }
3120      })(jQuery);
3121    }
3122
3123    /* Fix hidden H4 elements in newsletter footers */
3124
3125    if (window.location.href.indexOf("news-and-media/all-news/") > -1) {
3126      $("td h4").css("display", "block");
3127    }
3128
3129    /* Alert close */
3130
3131    //create cookie for alerts
3132    var alertcookie = [];
3133    var tempCookie = getCookie("alertscookie").split(",");
3134    /* Alert close */
3135    /* State currently isn't kept */
3136    $(".alert__close").click(function () {
3137      $(this).parents(".alert").slideUp();
3138      var alertid = $(this).attr("data");
3139      var found = $.inArray(alertid, tempCookie);
3140      if (found < 0) {
3141        alertcookie.push(tempCookie);
3142        alertcookie.push(alertid);
3143      } else {
3144        alertcookie.push(tempCookie);
3145      }
3146
3147      document.cookie = "alertscookie=" + alertcookie.toString() + "; path=/";
3148    });
3149
3150    /* Jump links */
3151    var $jumpLinkContainers = $(".jumplink");
3152
3153    $jumpLinkContainers.each(function () {
3154      var jumpersOutputString = "";
3155
3156      $(this).find(".jumplink__title").each(function () {
3157        var jumperTitle = $(this).data("jumptitle") ? $(this).data("jumptitle") : $(this).html();
3158
3159        jumpersOutputString += "<div class=\"l-column column-373\"><a class=\"jumplink__jumper\" href=\"#" + $(this).parent().attr("id") + "\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#jumplink-arrow\"></use></svg>" + jumperTitle + "</a></div>";
3160      });
3161
3162      $(this).find(".jumplink__jumpers").html(jumpersOutputString);
3163    });
3164
3165    if (!hasRefreshNav) {
3166      var $jumpLinks = $(".jumplink__jumper");
3167      $jumpLinks.click(function () {
3168
3169        var headerOffset = 0;
3170
3171        /*
3172         * If the header's stickieable get its height or at least give it a default
3173         * of 60, the approximate height of a single-line sticky header
3174         */
3175        if ($(".sticky-header-wrapper").length) {
3176          headerOffset = $(".sticky-header-wrapper").height() ? $(".sticky-header-wrapper").height() : 60;
3177        }
3178
3179        $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top - headerOffset }, "slow");
3180        return false;
3181      });
3182    }
3183
3184    /* Jump Links(anchor links) to the Accordion section */
3185
3186    var $accordionContainers = $(".accordion");
3187    $accordionContainers.each(function () {
3188
3189      //create variable based off the hashtag in the url
3190      var hashTag = window.location.hash.substring(1).toLowerCase();
3191      if (hashTag.length > 0) {
3192        //create varible based off the hashtag name if it matches an element name property
3193        //both halves of the equality must be converted to lowercase to make it case-insensitive
3194        var $anchorTag = $(".accordion__item").filter(function () {
3195          return $(this).attr("name").toLowerCase() == hashTag;
3196        });
3197
3198        $.each($anchorTag, function () {
3199          //$(this) refers to the current $anchorTag element
3200          //have the page scroll to the element that has a name that matches the hashtag
3201          $("html, body").animate({ scrollTop: $(this).offset().top - 60 }, 1000);
3202          $(".accordion__body", this).show();
3203        });
3204      }
3205    });
3206
3207    /* ***************************************************** */
3208    /* Only run if not in Sitecore */
3209    if (!$("body.in-sitecore").length) {
3210      var setCaretPosition =
3211
3212      /* Search: search modal */
3213
3214      function (ctrl, pos) {
3215        if (ctrl.setSelectionRange) {
3216          ctrl.focus();
3217          ctrl.setSelectionRange(pos, pos);
3218        } else if (ctrl.createTextRange) {
3219          var range = ctrl.createTextRange();
3220          range.collapse(true);
3221          range.moveEnd("character", pos);
3222          range.moveStart("character", pos);
3223          range.select();
3224        }
3225      };
3226
3227      var breakpointDebounced = debounce(breakpoint.refreshValue, debounceLength);
3228      window.addEventListener("resize", breakpointDebounced);
3229
3230      /* Set vars */
3231      var showBackToTopAt = 200;
3232      var transitionLength = 1000;
3233      var debounceLength = 250;
3234
3235      /* Compatibility: Deal with object-fit cover in older browsers */
3236      $("html.no-objectfit div.promo-block").each(function () {
3237        shimCentercrop($(this));
3238      });
3239
3240      $("html.no-objectfit div.hero__wrapper").each(function () {
3241        if ($(this).children("picture").length) {
3242          shimCentercrop($(this));
3243        } else {
3244          $(this).find(".hero__small-top, .hero__small-bottom, .hero__left, .hero__right").each(function () {
3245            shimCentercrop($(this));
3246          });
3247        }
3248      });
3249
3250      /* Forms: Pretty select boxes; select2 settings */
3251      $("select.custom-select").select2({
3252        minimumResultsForSearch: -1,
3253        width: "100%"
3254      }).hide();
3255
3256      /* Drawers: Item list & Accordion drawers */
3257      $(".item-list:not(.media-gallery) .item-list__toggle").click(function () {
3258        $(this).siblings(".item-list__drawer").slideToggle("slow");
3259        $(this).parent().toggleClass("is-open");
3260      });
3261
3262      $(".accordion__heading").click(function () {
3263        var $thisAccordion = $(this);
3264        var $thisAccordionsParent = $thisAccordion.parent();
3265        var $thisAccordionsOpen = $thisAccordionsParent.siblings(".is-open");
3266
3267        $thisAccordionsOpen.removeClass("is-open").find(".accordion__body").slideUp("slow");
3268        $thisAccordion.siblings(".accordion__body").slideToggle("slow", function () {
3269          var scrollAdjustment = $(".sticky-header-wrapper").height();
3270          var scrollTo = $thisAccordion.offset().top - scrollAdjustment;
3271
3272          if (!$thisAccordion.siblings(".accordion__body").find(".video--scaled-wrapper").length) {
3273            $thisAccordion.siblings(".accordion__body").find(".video").each(videoSizer);
3274          }
3275
3276          $("html,body").animate({ scrollTop: scrollTo }, "slow");
3277        });
3278        $thisAccordionsParent.toggleClass("is-open");
3279      });
3280
3281      /* Homepage: size hero if necessary */
3282
3283      if (breakpoint.value === "xx-small" || breakpoint.value === "x-small" || breakpoint.value === "small" || breakpoint.value === "medium") {
3284        $("#hero-homepage #ooyalaplayer").remove();
3285      } else {
3286        var homepageHeroSizer = function homepageHeroSizer() {
3287          var $outerHomeHeroWrapper = $("#hero-homepage").find(".hero-homepage__outer-wrapper");
3288          var $innerHomeHeroWrapper = $("#hero-homepage").find(".hero-homepage__inner-wrapper");
3289
3290          var innerHomeHeroWrapperWidth = $outerHomeHeroWrapper.width() > $outerHomeHeroWrapper.height() * 16 / 9 ? $outerHomeHeroWrapper.width() : $outerHomeHeroWrapper.height() * 16 / 9;
3291
3292          var innerHomeHeroWrapperHeight = $outerHomeHeroWrapper.height() > $outerHomeHeroWrapper.width() * 9 / 16 ? $outerHomeHeroWrapper.height() : $outerHomeHeroWrapper.width() * 9 / 16;
3293
3294          var innerHomeHeroWrapperMarginTop = ($outerHomeHeroWrapper.height() - innerHomeHeroWrapperHeight) / 2;
3295          var innerHomeHeroWrapperMarginLeft = ($outerHomeHeroWrapper.width() - innerHomeHeroWrapperWidth) / 2;
3296
3297          $innerHomeHeroWrapper.width(innerHomeHeroWrapperWidth);
3298          $innerHomeHeroWrapper.height(innerHomeHeroWrapperHeight);
3299          $innerHomeHeroWrapper.css({
3300            marginTop: innerHomeHeroWrapperMarginTop,
3301            marginLeft: innerHomeHeroWrapperMarginLeft
3302          });
3303        };
3304
3305        homepageHeroSizer();
3306
3307        var homepageHeroDebounced = debounce(homepageHeroSizer, debounceLength);
3308        window.addEventListener("resize", homepageHeroDebounced);
3309      }
3310
3311      /* Images: Captioned images from RTE */
3312      $(".captioned").each(function () {
3313        var alt = $(this).find("img").attr("alt");
3314        if (alt !== undefined) {
3315          var width = $(this).find("img").width() ? $(this).find("img").width() : 320;
3316          $(this).css({
3317            width: width
3318          });
3319
3320          $(this).append("<div class=\"image-zoomable__caption\">" + alt + "</div>");
3321        }
3322      });
3323
3324      /* Modals: Image zoom */
3325      /* Initial setup; no point in doing this if there are no zoomables on the page */
3326      var $zoomIns = $(".js-image-zoomable__zoom--in");
3327      if ($zoomIns.length) {
3328
3329        /* If image is zoomed, resize it on window resize */
3330        var zoomDebounced = debounce(unzoomResize, debounceLength);
3331        window.addEventListener("resize", zoomDebounced);
3332
3333        $zoomIns.click(function (e) {
3334          e.stopPropagation();
3335          e.preventDefault();
3336
3337          $("body").append("<div id=\"modal\"></div>");
3338          /* grab large image from data-src */
3339          var $extantImg = $(this).siblings("img");
3340          $(this).siblings(".image-zoomable__bigimg").children("img").attr("src", $extantImg.data("src"));
3341
3342          zoomImage("in", $(this).parents(".image-zoomable"));
3343        });
3344
3345        $(".js-image-zoomable__zoom--out").click(function (e) {
3346          e.stopPropagation();
3347          e.preventDefault();
3348
3349          zoomImage("out", $(this).parents(".image-zoomable"));
3350        });
3351
3352        $("#modal").click(function (e) {
3353          if ($(".image-zoomable.is-zoomed")) {
3354            e.stopPropagation();
3355            e.preventDefault();
3356
3357            zoomImage("out", $(".image-zoomable.is-zoomed"));
3358          }
3359        });
3360      }
3361
3362      /* Navigation: Back to top link */
3363      scrollCheck($(this).scrollTop(), showBackToTopAt);
3364
3365      $("#back-to-top").click(function () {
3366        /* Pretty scroll */
3367        $("html,body").animate({ scrollTop: 0 }, "slow");
3368        return false;
3369      });
3370
3371      $(document).scroll(function () {
3372        scrollCheck($(this).scrollTop(), showBackToTopAt);
3373      });
3374
3375      /* Navigation: Selectifier for link lists, left nav */
3376      var $linkLists = $(".link-list");
3377      var $leftNavs = $(".leftnav");
3378
3379      $linkLists.each(function () {
3380        if ($(this).find(".link-list__item").length > 6) {
3381          selectifier($(this), "link-list--list", ".link-list__items", ".link-list__item", "Select link from list...");
3382        }
3383      });
3384
3385      var leftnavCheck = function leftnavCheck() {
3386        /* force breakpoint refresh */
3387        breakpoint.refreshValue();
3388
3389        $leftNavs.each(function () {
3390          if (breakpoint.value === "xx-small" || breakpoint.value === "x-small" || breakpoint.value === "small" || breakpoint.value === "medium") {
3391            if (!$(this).hasClass("selectifier")) {
3392              selectifier($(this), "", ".leftnav__main-list", ".leftnav__main-list-item", "Within this section");
3393            }
3394          } else {
3395            if ($(this).hasClass("selectifier")) {
3396              unselectifier($(this), "");
3397            }
3398          }
3399        });
3400      };
3401
3402      leftnavCheck();
3403
3404      var leftnavDebounced = debounce(leftnavCheck, debounceLength);
3405      window.addEventListener("resize", leftnavDebounced);
3406
3407      if (!hasRefreshNav) {
3408        /* Navigation: Sticky nav */
3409        var headerCheck = function headerCheck() {
3410          /* force breakpoint refresh */
3411          breakpoint.refreshValue();
3412
3413          if (breakpoint.value === "large" || breakpoint.value === "x-large" || breakpoint.value === "xx-large" || breakpoint.value === "xxx-large") {
3414
3415            var headerHeight = $("#header").height();
3416
3417            // prevent header from becoming sticky in Experience Editor
3418            if ($("body").hasClass("in-sitecore")) {
3419              return;
3420            }
3421
3422            if (!$(".sticky-header-wrapper").length) {
3423              $("#header").wrap("<div class=\"sticky-header-wrapper\"></div>");
3424            }
3425
3426            if ($(window).scrollTop() > headerTopOffset && !$(".is-sticky").length) {
3427              $(".sticky-header-wrapper").css("height", headerHeight);
3428              $(".sticky-header-wrapper").addClass("is-sticky");
3429              $("#header").css({ top: "-" + $("#header").height() + "px" });
3430              $("#header").animate({ top: "0" });
3431            } else if ($(window).scrollTop() <= headerTopOffset && $(".is-sticky").length) {
3432              $(".sticky-header-wrapper").css("height", "auto");
3433              $(".sticky-header-wrapper").removeClass("is-sticky");
3434              $("#header").css({ top: "-" + $("#header").height() + "px" });
3435            }
3436          }
3437        };
3438
3439        var scrollTop = $(window).scrollTop();
3440        var headerTopOffset = 0;
3441        if ($(".header__nav-main-list").length > 0) {
3442          headerTopOffset = $(".header__nav-main-list").offset().top + $(".header__nav-main-list").height();
3443        }
3444
3445        $(window).scroll(function () {
3446          headerCheck();
3447        });
3448
3449        headerCheck();
3450
3451        var headerDebounced = debounce(headerCheck, debounceLength);
3452        window.addEventListener("resize", headerDebounced);
3453
3454        var $NavLisWithChildren = $("#header--mobile").find("li").has("ul");
3455
3456        $NavLisWithChildren.find("span").click(function (e) {
3457          e.stopPropagation();
3458          e.preventDefault();
3459
3460          $(this).parent("a").parent("li").toggleClass("is-open");
3461          $(this).parent("a").parent("li").children("ul").slideToggle("slow");
3462        });
3463      }
3464
3465      /* Navigation: Left Nav */
3466      $(".leftnav li svg").click(function (e) {
3467        e.stopPropagation();
3468        e.preventDefault();
3469
3470        $(this).parents("li").children("ul").slideToggle();
3471        $(this).parents("li").toggleClass("is-open");
3472      });
3473
3474      if (!hasRefreshNav) {
3475        /* Navigation: Top nav */
3476        var timer;
3477        $(".header__nav-main-list > li", "#header").hover(function () {
3478          var $this = $(this);
3479          timer = setTimeout(function () {
3480            $this.children(".header__nav-sub-list").show();
3481            $this.addClass("is-open");
3482          }, 300);
3483        }, function () {
3484          clearTimeout(timer);
3485          $(".header__nav-sub-list").hide();
3486          $(".header__nav-main-list > li").removeClass("is-open");
3487        });
3488        $(".header__nav-main-list > li > a", ".touchevents #header").on("touchend", function (e) {
3489          if ($(this).parent().data("open") && $(this).attr("href")) {
3490            window.location.href = $(this).attr("href");
3491          } else {
3492            e.stopPropagation();
3493            e.preventDefault();
3494
3495            $(this).parent().siblings().data("open", false);
3496            $(this).parent().siblings().removeClass("is-open");
3497            $(this).parent().siblings().children(".header__nav-sub-list").hide();
3498            $(this).parent().data("open", true);
3499            $(this).parent().children(".header__nav-sub-list").show();
3500            $(this).parent().addClass("is-open");
3501          }
3502        });
3503
3504        $(".header__nav-sub-list-close", "#header").click(function (e) {
3505          e.stopPropagation();
3506          e.preventDefault();
3507
3508          $(this).parents(".is-open").data("open", false).removeClass("is-open");
3509          $(this).parent().hide();
3510        });
3511
3512        $(".header__user", "#header").hover(function () {
3513          $(this).children(".header__profile").show();
3514        }, function () {
3515          $(this).children(".header__profile").hide();
3516        });
3517
3518        $(".header__user", "#header").click(function (e) {
3519          if (breakpoint.value === "medium" && $(".header__profile").length) {
3520            e.stopPropagation();
3521            e.preventDefault();
3522
3523            $(this).children(".header__profile").toggle();
3524          }
3525        });
3526
3527        $(".header__burger", "#header--mobile").click(function () {
3528          $(".header__drawer", "#header--mobile").slideDown(transitionLength, function () {
3529            $(".header__toggle\t", "#header--mobile").hide();
3530          });
3531        });
3532
3533        $(".header__close", "#header--mobile").click(function () {
3534          $(".header__drawer", "#header--mobile").slideUp(transitionLength);
3535          $(".header__toggle\t", "#header--mobile").show();
3536        });
3537        $(".mobile-account-drawer").click(function () {
3538          $(".mobile-account-info .header__profile").slideToggle("slow");
3539          $(".mobile-account-drawer").toggleClass("rotated");
3540        });
3541      }
3542
3543      /* Scrollbars: Trigger custom scrollbars */
3544      $(".js-custom-scroller").mCustomScrollbar({
3545        theme: "light-thick"
3546      });
3547
3548      if (!hasRefreshNav) {
3549        $("#header").find(".header__search").click(function (e) {
3550          e.stopPropagation();
3551          e.preventDefault();
3552
3553          $("body").append("<div id=\"modal\" class=\"modal modal--search search\"><div id=\"search__close\" class=\"modal__close\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#x\"></use></svg></div><div class=\"search__form\"><div class=\"search__box\"><div class=\"placeholder\">What Can We Help You Find?</div><input id=\"keywordInput\" type=\"text\" name=\"keyword\"><button class=\"button\">Search<svg><use xlink:href=\"/dist/assets/svg-sprite.svg#rightarrow\"></use></svg></button></div></div>");
3554
3555          $("#keywordInput").focus();
3556
3557          $("#keywordInput").keypress(function () {
3558            $("#modal .placeholder").hide();
3559          });
3560
3561          $("#keywordInput").keyup(function () {
3562            e.preventDefault();
3563            e.stopPropagation();
3564            var keyword = $("#keywordInput").val();
3565            var url = "https://www.aopa.org/search" + "#q=" + keyword;
3566            if (event.keyCode == 13) {
3567              window.location.href = url;
3568            }
3569          });
3570
3571          $("#keywordInput").blur(function () {
3572            if (!$("#keywordInput").val()) {
3573              $("#modal .placeholder").show();
3574            }
3575          });
3576
3577          $("#search__close").click(function () {
3578            $("#modal").remove();
3579          });
3580          $(".button").click(function () {
3581            e.stopPropagation();
3582            e.preventDefault();
3583            var keyword = $("#keywordInput").val();
3584            var url = "https://www.aopa.org/search" + "#q=" + keyword;
3585            window.location.href = url;
3586          });
3587        });
3588      }
3589
3590      /* Slideshows: Content Sliders */
3591      var $contentSliders = $(".content-slider");
3592      $contentSliders.each(function () {
3593        $(this).data("slideWidth", $(this).find(".content-slider__item:last-child").outerWidth());
3594        //content-slider--videos was original class, class name was changed to content-slider--videos--added-to-remove-popup  to remove popup from content slider video
3595        if ($(this).hasClass("content-slider--videos--added-to-remove-popup")) {
3596          $(this).find(".content-slider__item").click(function (e) {
3597
3598            if (!(breakpoint.value === "xx-small" || breakpoint.value === "x-small" || breakpoint.value === "small")) {
3599              e.stopPropagation();
3600              e.preventDefault();
3601
3602              $("body").append("<div id=\"modal\"></div>");
3603              $("#modal").addClass("modal--fade");
3604
3605              $("#modal").html("<div class=\"modal__close\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#x\"></use></svg></div><div class=\"modal__content-wrapper\"><div class=\"modal__media-wrapper\"><div class=\"video\">" + $(this).data("popcontent") + "</div></div></div>");
3606
3607              addthis.update("share", "url", $("#modal .addthis_modal_sharing_toolbox").data("url"));
3608              addthis.toolbox(".addthis_modal_sharing_toolbox");
3609
3610              $(".modal__close").click(function () {
3611                $("#modal").removeClass("modal--fade");
3612                $("#modal").remove();
3613              });
3614            }
3615          });
3616        }
3617      });
3618
3619      $contentSliders.find(".content-slider__viewport").mCustomScrollbar({
3620        theme: "light-thick",
3621        axis: "x",
3622        updateOnContentResize: true,
3623        callbacks: {
3624          onTotalScroll: function onTotalScroll() {
3625            $(this).parent().find(".content-slider__next").fadeOut();
3626          },
3627          onTotalScrollBack: function onTotalScrollBack() {
3628            $(this).parent().find(".content-slider__prev").fadeOut();
3629          },
3630          whileScrolling: function whileScrolling() {
3631            $(this).parent().find(".content-slider__prev").fadeIn();
3632            $(this).parent().find(".content-slider__next").fadeIn();
3633          },
3634          onInit: function onInit() {
3635            $(this).parent().find(".content-slider__prev").fadeOut();
3636          }
3637        }
3638      });
3639
3640      $contentSliders.find(".content-slider__prev").click(function () {
3641        var $sliderContainer = $(this).parents(".content-slider");
3642        var $sliderSlider = $sliderContainer.find(".content-slider__viewport");
3643        var $sliderOffsetElement = $sliderContainer.find(".mCSB_container");
3644        var slideWidth = $sliderContainer.data("slideWidth");
3645
3646        var scrollTo = parseInt($sliderOffsetElement.css("left")) + Math.max(Math.floor($sliderContainer.width() / slideWidth), 1) * slideWidth;
3647
3648        scrollTo = scrollTo <= 0 ? scrollTo : 0;
3649
3650        $sliderSlider.mCustomScrollbar("scrollTo", scrollTo, {});
3651      });
3652
3653      $contentSliders.find(".content-slider__next").click(function () {
3654        var $sliderContainer = $(this).parents(".content-slider");
3655        var $sliderSlider = $sliderContainer.find(".content-slider__viewport");
3656        var $sliderOffsetElement = $sliderContainer.find(".mCSB_container");
3657        var slideWidth = $sliderContainer.data("slideWidth");
3658
3659        var scrollTo = parseInt($sliderOffsetElement.css("left")) - Math.max(Math.floor($sliderContainer.width() / slideWidth), 1) * slideWidth;
3660
3661        $sliderSlider.mCustomScrollbar("scrollTo", scrollTo, {});
3662      });
3663
3664      var scrollerCheck = function scrollerCheck() {
3665        $contentSliders.each(function () {
3666          if ($(this).find(".mCustomScrollBox").width() >= $(this).find(".content-slider__content").width()) {
3667            $(this).find(".content-slider__controls").hide();
3668          } else {
3669            $(this).find(".content-slider__controls").show();
3670          }
3671        });
3672      };
3673
3674      scrollerCheck();
3675
3676      var scrollerDebounced = debounce(scrollerCheck, debounceLength);
3677      window.addEventListener("resize", scrollerDebounced);
3678
3679      /* Slideshows: Feature sliders */
3680      var $heroSlider = $(".hero-feature__slider").slick({
3681        arrows: false,
3682        dots: true,
3683        speed: 1000,
3684        fade: true,
3685        easing: "swing",
3686        customPaging: function customPaging(slider, i) {
3687          var $slideObject = $(slider.$slides[i]).find(".hero-feature__teaser");
3688          var slideTeaser = $slideObject.prop("outerHTML").toString();
3689          return slideTeaser;
3690        } });
3691
3692      if ($heroSlider.length) {
3693        var slideReloader = function slideReloader() {
3694          $heroSlider.slick("slickSetOption", "draggable", true, true);
3695        };
3696
3697        var reloadSliderDebounced = debounce(slideReloader, debounceLength);
3698        window.addEventListener("resize", reloadSliderDebounced);
3699      }
3700
3701      /* Slideshows: Slideshow components */
3702      $(".slideshow__wrapper").slick({
3703        arrows: true,
3704        dots: true,
3705        speed: 1000,
3706        easing: "swing",
3707        nextArrow: "<div  class=\"slick-next\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#rightarrow\"></use></svg></div>",
3708        prevArrow: "<div class=\"slick-prev\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#leftarrow\"></use></svg></div>",
3709        customPaging: function customPaging(slider, i) {
3710          var $slideObject = $(slider.$slides[i]).find("img");
3711          var slideTeaser = $slideObject.prop("outerHTML").toString();
3712          return slideTeaser;
3713        } }).on("beforeChange", function (e, slick, currentSlide, nextSlide) {
3714        var $dotsWrapper = $(this).find(".slideshow__dots-wrapper");
3715        var $targetDot = $(this).find(".slick-dots li:nth-child(" + (nextSlide + 1) + ")");
3716        var currentScroll = $dotsWrapper.scrollLeft();
3717        var targetWidth = $targetDot.outerWidth(true);
3718        var targetPosition = $targetDot.position().left;
3719        var marginModifier = targetWidth - $targetDot.outerWidth();
3720
3721        /* only scroll if outside of view */
3722        if (targetPosition + currentScroll < currentScroll || targetPosition + targetWidth + currentScroll > currentScroll + $dotsWrapper.width()) {
3723          $dotsWrapper.animate({ scrollLeft: targetPosition + marginModifier + currentScroll }, transitionLength);
3724        }
3725      });
3726
3727      var arrowRelocator = function arrowRelocator() {
3728        $(".slideshow__wrapper .slick-arrow").css({
3729          top: function top() {
3730            return $(this).parent().width() * 9 / 16 / 2 + "px";
3731          }
3732        });
3733      };
3734
3735      arrowRelocator();
3736
3737      var arrowsDebounced = debounce(arrowRelocator, debounceLength);
3738      window.addEventListener("resize", arrowsDebounced);
3739
3740      $(".slideshow__wrapper .slick-dots").wrap("<div class=\"slideshow__arrow-wrapper\"><div class=\"slideshow__dots-wrapper\"></div></div>").before("<div class=\"slideshow__prev slideshow__arrow\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#leftarrow\"></use></svg></div>").after("<div  class=\"slideshow__next slideshow__arrow\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#rightarrow\"></use></svg></div>");
3741
3742      $(".slideshow__dots-wrapper").scrollLeft(0);
3743
3744      $(".slideshow__prev").click(function () {
3745        var $parentContainer = $(this).parent();
3746        var dotWidth = $parentContainer.find("li:last-child").outerWidth(true);
3747        /* don't cut off images on the scroll */
3748        var scrollValue = $parentContainer.parent().width() * -1 + $parentContainer.scrollLeft();
3749        scrollValue = Math.floor(scrollValue / dotWidth) * dotWidth;
3750        $parentContainer.animate({ scrollLeft: scrollValue }, transitionLength);
3751      });
3752      $(".slideshow__next").click(function () {
3753        var $parentContainer = $(this).parent();
3754        var dotWidth = $parentContainer.find("li:last-child").outerWidth(true);
3755        /* don't cut off images on the scroll */
3756        var scrollValue = $parentContainer.parent().width() + $parentContainer.scrollLeft();
3757        scrollValue = Math.floor(scrollValue / dotWidth) * dotWidth;
3758        $parentContainer.animate({ scrollLeft: scrollValue }, transitionLength);
3759      });
3760
3761      $(".slideshow__zoom").click(function () {
3762        var $thisSlideshow = $(this).parents(".slideshow");
3763        $thisSlideshow.wrap("<div id=\"slideshow__zoom-placeholder\"></div>");
3764        $("#slideshow__zoom-placeholder").height($thisSlideshow.outerHeight());
3765        $("body").append("<div id=\"modal\" class=\"modal modal--fade\"><div class=\"l-wrapper\"><div id=\"slideshow__sizer\"></div></div></div>");
3766
3767        $("#modal").mCustomScrollbar({
3768          theme: "light-thick"
3769        });
3770
3771        $thisSlideshow.detach().appendTo("#modal .l-wrapper");
3772        $thisSlideshow.find(".slideshow__wrapper").slick("setPosition");
3773        arrowRelocator();
3774      });
3775
3776      $(".slideshow__close").click(function () {
3777        var $thisSlideshow = $(this).parents(".slideshow");
3778        $thisSlideshow.detach().appendTo("#slideshow__zoom-placeholder");
3779        $("#modal").remove();
3780        $thisSlideshow.unwrap();
3781        $thisSlideshow.find(".slideshow__wrapper").slick("setPosition");
3782        arrowRelocator();
3783      });
3784
3785      /* Tabs: Tab controls */
3786
3787      var $tab = $(".tab");
3788
3789      /* pick out only the things that are actually in large enough columns */
3790      $tab = $tab.filter(function () {
3791        return $(this).width() > 620;
3792      });
3793
3794      $tab.each(function () {
3795        $(this).addClass("js-tabbable");
3796
3797        var listString = "<ul class=\"tab__tabs\">";
3798
3799        $(this).find("h3.tab__heading").each(function () {
3800          listString += "<li>" + $(this).html() + "</li>";
3801        });
3802
3803        listString += "</ul>";
3804
3805        $(this).children(".tab__items").before(listString);
3806
3807        /* Open the first tab so that something's showing to start */
3808        /* But only if we're in tab mode */
3809        //if ($(window).width() > 880) {
3810        if (breakpoint.value === "large" || breakpoint.value === "x-large" || breakpoint.value === "xx-large" || breakpoint.value === "xxx-large") {
3811          $(this).find(".tab__item:first-child").addClass("is-open");
3812          $(this).find(".tab__tabs li:first-child").addClass("is-open");
3813        }
3814      });
3815
3816      var tabsDebounced = debounce(tabResizer, debounceLength);
3817      window.addEventListener("resize", tabsDebounced);
3818
3819      $tab.find(".tab__tabs li").click(function () {
3820        /* Handles multiple tabsets per page, so the pattern's a little unusual */
3821        var pattern = ".tab__item:nth-child(" + ($(this).index() + 1) + ")";
3822        $(this).siblings(".tab__tabs li").removeClass("is-open");
3823        $(this).parents(".tab").find(".tab__item").removeClass("is-open");
3824        $(this).addClass("is-open");
3825        $(this).parents(".tab").find(pattern).addClass("is-open");
3826
3827        $(this).parents(".tab").find(pattern).find(".video").each(videoSizer);
3828      });
3829
3830      /* Truncation: Deal with truncation on promos */
3831      $(".promo-block__cta--secondary a, .promo-block__title, .promo-block__cta--primary a").dotdotdot({
3832        watch: true
3833      });
3834
3835      /* Manually bootstrap angular to deal with cases where there are multiple Item Lists in a page */
3836      $(".item-list").each(function () {
3837        angular.bootstrap($(this), ["AopaItemList"]);
3838      });
3839      $(".breadcrumbs__bookmark").each(function () {
3840        angular.bootstrap($(this), ["AopaBookmarks"]);
3841      });
3842      $(".js-aopa-content-wizard").each(function () {
3843        angular.bootstrap($(this), ["AopaContentWizard"]);
3844      });
3845
3846      /* Replace Default SVG when AddThis loads */
3847      var onAddThisReady = function onAddThisReady() {
3848        var addThisCounter = 0;
3849
3850        /*
3851         * AddThis' addthis.ready is supposed to trigger
3852         * when AddThis is 100% ready, but it tends to fire
3853         * early.  So have it trigger a set interval to wait
3854         * to replace the SVG
3855         */
3856        var addThisInterval = setInterval(function () {
3857          /* Ideally, replace the SVG if it exists to replace */
3858          if ($(".at-svc-email").length) {
3859            $(".at-svc-email svg").replaceWith("<svg><use xlink:href=\"/dist/assets/svg-sprite.svg#email\"></use></svg>");
3860            $(".at-svc-print svg").replaceWith("<svg><use xlink:href=\"/dist/assets/svg-sprite.svg#print\"></use></svg>");
3861            clearInterval(addThisInterval);
3862          }
3863          addThisCounter++;
3864
3865          /* or give up eventually and leave the default SVG */
3866          if (addThisCounter > 30) {
3867            clearInterval(addThisInterval);
3868          }
3869        }, 10);
3870      };
3871
3872      $("div.video").each(videoSizer);
3873
3874      if (typeof addthis !== "undefined") {
3875        addthis.addEventListener("addthis.ready", onAddThisReady);
3876      }
3877
3878      /* Add flex behavior for leftnav line only when leftnav exists */
3879      $(".leftnav").each(function () {
3880        $(this).parent().parent(".l-wrapper").addClass("leftnav--flexify");
3881      });
3882
3883      /* Fix issue with old style ads */
3884      $("#js-old-ad-code").parents(".richtext").addClass("no-clearfix");
3885
3886      /* Trigger SVG backfill for older browsers */
3887      /* Should remain as last item called to catch SVG inserted by javascript */
3888      svg4everybody();
3889    }
3890  });
3891
3892  /* ***************************************************** */
3893  /* Shared functions */
3894
3895  /*
3896   * Deboucer borrowed from underscore.js
3897   */
3898  function debounce(func, wait, immediate) {
3899    var timeout;
3900    return function () {
3901      var context = this,
3902          args = arguments;
3903      var later = function later() {
3904        timeout = null;
3905        if (!immediate) func.apply(context, args);
3906      };
3907      var callNow = immediate && !timeout;
3908      clearTimeout(timeout);
3909      timeout = setTimeout(later, wait);
3910      if (callNow) func.apply(context, args);
3911    };
3912  };
3913
3914  /*
3915   * getCookie
3916   */
3917  function getCookie(cname) {
3918    var name = cname + "=";
3919    var ca = document.cookie.split(";");
3920    for (var i = 0; i < ca.length; i++) {
3921      var c = ca[i];
3922      while (c.charAt(0) == " ") {
3923        c = c.substring(1);
3924      }
3925      if (c.indexOf(name) != -1) {
3926        return c.substring(name.length, c.length);
3927      }
3928    }
3929    return "";
3930  }
3931
3932  /*
3933   * scrollCheck
3934   * y: current scroll position of object to check
3935   * triggerPoint: scroll position to trigger at
3936   */
3937  function scrollCheck(y, triggerPoint) {
3938    if (y > triggerPoint) {
3939      $("#back-to-top a").fadeIn();
3940    } else {
3941      $("#back-to-top a").fadeOut();
3942    }
3943  }
3944
3945  /*
3946   * selectifier
3947   * turn list of links (divs or lis) into "select box" type dropdown
3948   */
3949  function selectifier($thisElement, removeClass, selectorItems, selectorItem, instructions) {
3950    $thisElement.addClass("selectifier").removeClass(removeClass);
3951    $thisElement.find(selectorItems).prepend("<div class=\"selectifier__instructions\">" + instructions + "<span><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#downarrow\"></use></svg></span></div>").find(selectorItem).wrapAll("<div class=\"selectifier__drawer\"></div>");
3952
3953    $thisElement.on("click", ".selectifier__instructions", function () {
3954      $(this).toggleClass("is-open");
3955      $(this).siblings(".selectifier__drawer").toggle();
3956    });
3957  }
3958
3959  /*
3960   * unselectifier
3961   * reverse selectifier
3962   */
3963  function unselectifier($thisElement, addClass) {
3964    $thisElement.addClass(addClass).removeClass("selectifier");
3965    $thisElement.find(".selectifier__instructions").remove();
3966    $thisElement.find(".selectifier__drawer").children().unwrap();
3967  }
3968
3969  /*
3970   * tabResizer
3971   * Debounce function for tabs to accordions
3972   */
3973  function tabResizer() {
3974    /* If we're in tabs, we need to only show one item */
3975    // if ($(window).width() > 880) {
3976    if (breakpoint.value === "large" || breakpoint.value === "x-large" || breakpoint.value === "xx-large" || breakpoint.value === "xxx-large") {
3977      /* Can remove all the style attrs added by jQuery */
3978      $(".tab__item .tab__body").removeAttr("style");
3979
3980      /* But otherwise we need to be careful to keep open at least one tab,
3981        and preferably one that the user opened */
3982      $(".js-tabbable .tab").each(function () {
3983        var $keepTab = $(this).find("li.is-open").first().length ? $(this).find("li.is-open").first() : $(this).find("li:first-child");
3984        var patternBody = ".tab__item:nth-child(" + ($(this).index() + 1) + ")";
3985        var patternTab = ".tab__tabs:nth-child(" + ($(this).index() + 1) + ")";
3986        $(this).find(".tab__item").removeClass("is-open");
3987        $(this).find(".tab__tabs").removeClass("is-open");
3988        $(this).find(patternBody).addClass("is-open");
3989        $(this).find(patternTab).addClass("is-open");
3990      });
3991    }
3992  }
3993
3994  /*
3995   * unzoomResize
3996   * Debounce funtion for zoomed images
3997   */
3998  function unzoomResize() {
3999    if ($(".is-zoomed").length) {
4000      zoomImage("adjust", $(".is-zoomed"));
4001    }
4002  }
4003
4004  /*
4005   * zoomImage
4006   * Shared function to zoom in, out, and adjust on resize
4007   */
4008  function zoomImage(direction) {
4009    var $zoomedWrapper = arguments[1] === undefined ? null : arguments[1];
4010
4011    var zoomLength = 500;
4012    var top = $zoomedWrapper.offset().top - $(window).scrollTop();
4013    top = top > 0 ? top : 0;
4014    var startWidth = $(".is-zoomed").width();
4015    var $modal = $("#modal");
4016
4017    /* Max-width animation seems buggy in jQuery, so improvise */
4018    var maxWidth = breakpoint.value === "xx-large" || breakpoint.value === "xxx-large" ? $(window).width() + "px" : $(".l-wrapper").width() + "px";
4019
4020    /* dimensions and positioning of zoomed image */
4021    var wideObject = {
4022      width: maxWidth,
4023      opacity: "1",
4024      top: "50%",
4025      left: "50%"
4026    };
4027
4028    /* dimensions and positioning of small image */
4029    var startObject = {
4030      width: startWidth,
4031      opacity: "0",
4032      top: top + $zoomedWrapper.height() / 2 + "px",
4033      left: $zoomedWrapper.offset().left + $zoomedWrapper.width() / 2 + "px"
4034    };
4035
4036    if (direction === "in") {
4037      /* move it forward enough to cover the ooyala player, which is z-index greedy */
4038      $zoomedWrapper.find(".image-zoomable__bigimg").css({ "z-index": 10003 });
4039      $zoomedWrapper.find(".image-zoomable__bigimg").css(startObject).animate(wideObject, zoomLength);
4040      $zoomedWrapper.find(".image-zoomable__bigimg").attr("data-zoomed", "zoomed");
4041      $zoomedWrapper.addClass("is-zoomed");
4042      $modal.addClass("modal--fade");
4043    } else if (direction === "adjust") {
4044      if ($(".is-zoomed").length) {
4045        $(".is-zoomed .image-zoomable__bigimg").animate(wideObject, zoomLength);
4046      }
4047    } else {
4048      $zoomedWrapper.find(".image-zoomable__bigimg").css(wideObject).animate(startObject, zoomLength, function () {
4049        $zoomedWrapper.find(".image-zoomable__bigimg").css({ "z-index": -1 });
4050      });
4051      $zoomedWrapper.find(".image-zoomable__bigimg").removeAttr("data-zoomed");
4052      $zoomedWrapper.removeClass("is-zoomed");
4053      $modal.removeClass("modal--fade");
4054      $("#modal").remove();
4055    }
4056  }
4057
4058  /*
4059   * shimCentercrop
4060   * Fallback for object-fit in older browsers
4061   * Grabs picture sources and applies them to three divs as background images; the divs are then
4062   *	hidden or displayed via CSS media queries.
4063   */
4064  function shimCentercrop($wrapper) {
4065    var bigimg = $wrapper.find("source:first-child").attr("srcset");
4066    var midimg = $wrapper.find("source:nth-child(2)").attr("srcset");
4067    var smlimg = $wrapper.find("img").attr("src");
4068
4069    if (!midimg) {
4070      midimg = smlimg;
4071    }
4072    if (!bigimg) {
4073      bigimg = smlimg;
4074    }
4075
4076    $wrapper.prepend("<div class=\"centercrop-shim centercrop-shim--bigimg\" style=\"background-image: url(" + bigimg + ")\"></div><div class=\"centercrop-shim centercrop-shim--midimg\" style=\"background-image: url(" + midimg + ")\"></div><div class=\"centercrop-shim centercrop-shim--smlimg\" style=\"background-image: url(" + smlimg + ")\"></div>");
4077  }
4078
4079  function videoSizer() {
4080
4081    var width = $(this).width();
4082    var height = $(this).height();
4083
4084    if (width > 0) {
4085      var padding = height / width * 100 + "%";
4086
4087      $(this).wrap("<div class=\"video--scaled-wrapper\" style=\"padding-bottom: " + padding + "\"></div>");
4088      $(this).addClass("video--scaled");
4089      /* Override Ooyala settings; can't do that in the CSS because it messes up the calculations above */
4090      $(this).find(".innerWrapper").css({
4091        height: "100%",
4092        width: "100%"
4093      });
4094
4095      $(this).find(".innerWrapper").parent().css({
4096        height: "100%",
4097        width: "100%"
4098      });
4099    }
4100  }
4101
4102  $(".formSubmitButton").click(function () {
4103    var form = $(this).closest("form");
4104    if (form.valid()) {
4105      $("div.clsSubmit").find(".button").hide();
4106      $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
4107    }
4108  });
4109
4110  $(".formSubmitButton2").click(function () {
4111    var form = $(this).closest("form");
4112    if (form.valid()) {
4113      $(".formButtons").hide();
4114      $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
4115    }
4116  });
4117
4118  $(".js-premium-alert__close").click(function () {
4119    $(this).closest(".premium-alert").addClass("premium-alert__hide");
4120  });
4121
4122  if (!hasRefreshNav) {
4123    // hot-fix for iPad nav
4124    $(".header__user .header__profile a").click(function () {
4125      window.location = $(this).attr("href");
4126    });
4127  }
4128
4129  /* Hide .advertisement background if no ad is served */
4130  /* Only run if not in Sitecore */
4131  if (!$("body.in-sitecore").length) {
4132    $(".advertisement .l-wrapper .l-column").each(function () {
4133      if ($(this).children().length <= 1) {
4134        $(this).parents(".advertisement").css("background-image", "none").css("padding", "0");
4135      }
4136    });
4137  }
4138})(jQuery);
4139
4140},{"./aafcomplimentarymembership/aafcomplimentarymembership":1,"./accountpages/aopacancellationform":2,"./accountpages/contactinfoform":3,"./accountpages/pilotinfoform":4,"./accountpages/ssoaccountcreate":5,"./addressfields/addressfields":6,"./addressfields/addressfieldsaccountform":7,"./addupdateaar/addupdateaar":8,"./addupdatepps/addupdateppsform":9,"./aftapages/aftaaopauseradmin":10,"./aftapages/aftabusinesscontact":11,"./aftapages/aftaflightinstructoradmin":12,"./aftapages/aftaflightinstructorpublic":13,"./aftapages/aftaflightschooladmin":14,"./aftapages/aftaschoolemployeeadmin":15,"./aftapages/aftaschoolemployeepublic":16,"./aftapages/aftastudentadmin":17,"./aftapages/aftastudentpublic":18,"./aftapages/aftastudentpurchase":19,"./aircraft/aircraft":20,"./aircraftinformationupdate/aircraftinformationupdate":2
41401,"./aircraftshowcaseregistration/aircraftshowcaseregistration":22,"./aopajoinformv4/aopajoinformv4":24,"./aopamodal/aopamodal":25,"./aoparenewformv2/aoparenewformGSv2":26,"./aoparenewformv2/aoparenewformv2":27,"./asnairportsearch/asnairportsearch":28,"./asnnominationform/asnnominationform":29,"./bookmarks/bookmarks":30,"./cfiinformationupdate/cfiinformationupdate":32,"./comparisontable/comparisontable":33,"./contactus/contactus":34,"./contentwizard/contentwizard":35,"./creditcardofrecordupdate/creditcardofrecordupdate":37,"./customformvalidation/airportcodevalidation":38,"./customformvalidation/aopaccvalidation":39,"./customformvalidation/asnvolunteercheckvalidation":40,"./customformvalidation/attendancecountvalidation":41,"./customformvalidation/ccexpdatevalidation":42,"./customformvalidation/ccexpdatevalidation2":43,"./customformvalidation/ccnumbercheckvalidation":44,"./customformvalidation/cficertificatenumbervalidation":45,"./customformvalidation/cfiexpirationdatevalidation":46,"./customformvalidation/checkboxlistrequiredvalidation":47,"./customformvalidation/dropdowntextvalidator":48,"./customformvalidation/eitherorrequiredvalidation":49,"./customformvalidation/emailselectionvalidation":50,"./customformvalidation/nousvalidator":51,"./customformvalidation/optionalselect2check":52,"./customformvalidation/optionalselectcheck":53,"./customformvalidation/phonenumbervalidation":54,"./customformvalidation/radiotextvalidator":55,"./customformvalidation/radiotextvalidator2":56,"./customformvalidation/requiredoptionalvalidation":57,"./customformvalidation/usernamevalidation":58,"./donationrail/donationrail":59,"./donationrsvp/donationrsvp":60,"./efircpurchase/efircpurchase":61,"./event/jquery-ui-timepicker-addon":62,"./eventregistration/eventregistration":63,"./eventsearch/eventsearch":66,"./eventsignin/aviatorshowcasesignin":70,"./eventsignin/rustypilotsignin":71,"./eventsignin/volunteerform":72,"./expandableads/expandableads":73,"./financeform/financeform":74,"./flyinregistration/flyinregistration":75,"./formaccountcreate/formaccountcreate":76,"./forms/forms":77,"./freemembership/freemembership":78,"./ftgatedcontent/ftgatedcontent":79,"./genericproductpurchase/genericproductpurchase":80,"./globalactivationform/globalactivationform":81,"./globalmemberupgrade/globalmemberupgrade":82,"./header/stickyHeader":83,"./header/toggleHeaderDropdown":84,"./header/toggleMobile":85,"./header/toggleSearch":86,"./highschoolasaoffer/highschoolasaoffer":87,"./highschoolsymposiumattendee/highschoolsymposiumattendee":88,"./highschoolsymposiumexhibitor/highschoolsymposiumexhibitor":89,"./highschoolworkshopregistration/highschoolworkshopregistration":90,"./homepagecomponents/crop-image":91,"./homepagecomponents/image-gallery":92,"./homepagecomponents/jquery.easy-autocomplete.min":93,"./homepagecomponents/partners":94,"./homepagecomponents/widget-airport":95,"./homepagecomponents/widget-nav":96,"./homepagecomponents/widget-weather":97,"./iflightplanner/iflightplanner":98,"./islandguides/islandguides":99,"./itemlist/itemlist":113,"./joincheckout/joincheckout":114,"./lspattorneyinformation/lspattorneyinformation":115,"./lspeventregistration/lspeventregistration":116,"./medicalinformationupdate/medicalinformationupdate":117,"./membershipupgrade/membershipupgradev3":118,"./newslettersignup/newslettersignup":119,"./oneclickdonation/oneclickdonation":120,"./oneclickdonationcombined/oneclickdonationcombined":121,"./oneclickpacdonation/oneclickpacdonation":122,"./ooyalashare/ooyalashare":123,"./optinout/optinout":124,"./pacdonationrail/pacdonationrail":125,"./picmodal/picmodal":126,"./pilotworkshops/pilotworkshops":127,"./ppsmaintenance/ppsmaintenance":128,"./ppsupgrade/ppsupgrade":129,"./rustypilotregistration/rustypilotregistration":130,"./scrolldownarrow/scrolldownarrow":131,"./shared/aopa-shared":132,"./signupsubscribe/signupsubscribe":134,"./statenet/statenetdatafeed":135,"./studentoffer/studentoffer":136,"./subscriptions/subscriptions":137,"./textmessageoptinout/textmessageoptinout":138,"./timedatepicker/timedatepicker":139,"./usernameandpassword/usernameandpassword":140,"./weather/weather":144,"./wffm/wffm":145,"./ycfmodal/ycfmodal":146}],24:[function(require,module,exports){
4141"use strict";
4142
4143$(document).ready(function () {
4144    if ($("div#divAopaJoinFormV4").length) {
4145        var autocomplete;
4146        var jfStripe;
4147        var jfElements;
4148        var jfStyle;
4149        var jfCardElement;
4150        var initAutocomplete;
4151        var clearValidation;
4152        var setAAR;
4153        var enableJoinButton;
4154        var disableJoinButton;
4155        var checkCardFields;
4156        var setMem;
4157        var setPps;
4158        var setIpf;
4159        var updateTerms;
4160        var setTotal;
4161
4162        (function () {
4163            var fillInAddress = function () {
4164                // Get the place details from the autocomplete object.
4165                var place = autocomplete.getPlace();
4166                var address1 = "";
4167                var postcode = "";
4168
4169                $("#MailingStreet").val("");
4170                $("#MailingCity").val("");
4171                $("#MailingStateProvince").val("");
4172                $("#MailingPostalCode").val("");
4173                $("#MailingCountry").val("");
4174
4175                // Get each component of the address from the place details,
4176                // and then fill-in the corresponding field on the form.
4177                // place.address_components are google.maps.GeocoderAddressComponent objects
4178                // which are documented at http://goo.gle/3l5i5Mr
4179                place.address_components.forEach(function (component) {
4180                    var componentType = component.types[0];
4181
4182                    switch (componentType) {
4183                        case "street_number":
4184                            {
4185                                address1 = "" + component.long_name + " " + address1;
4186                                break;
4187                            }
4188
4189                        case "route":
4190                            {
4191                                address1 += component.short_name;
4192                                break;
4193                            }
4194
4195                        case "postal_code":
4196                            {
4197                                postcode = "" + component.long_name + "" + postcode;
4198                                break;
4199                            }
4200
4201                        case "postal_code_suffix":
4202                            {
4203                                postcode = "" + postcode + "-" + component.long_name;
4204                                break;
4205                            }
4206                        case "locality":
4207                            $("#MailingCity").val(component.long_name);
4208                            clearValidation("MailingCity");
4209                            break;
4210                        case "administrative_area_level_1":
4211                            {
4212                                $("#MailingStateProvince").val(component.short_name);
4213                                clearValidation("MailingStateProvince");
4214                                break;
4215                            }
4216                        case "country":
4217                            $("#MailingCountry").val(component.long_name);
4218                            if (component.short_name === "US") {
4219                                $("#rdoMailingCountryUS").prop("checked", true);
4220                                $("#divMailingCountry").hide();
4221                                $("#IsDomestic").val("True");
4222                                $("#IsInternational").val("False");
4223                            } else {
4224                                $("#rdoMailingCountryOther").prop("checked", true);
4225                                $("#divMailingCountry").show();
4226                                $("#IsDomestic").val("False");
4227                                $("#IsInternational").val("True");
4228                                $("#MembershipTerm").val("ANNUAL");
4229                                $("#btnAnnual").removeClass("joinv4-term-button__inactive");
4230                                $("#btnMonthly").addClass("joinv4-term-button__inactive");
4231                            }
4232                            clearValidation("MailingCountry");
4233                            break;
4234
4235                    }
4236                });
4237
4238                $("#MailingStreet").val(address1);
4239                clearValidation("MailingStreet");
4240                $("#MailingPostalCode").val(postcode);
4241                clearValidation("MailingPostalCode");
4242                $("#MailingStreet").focus();
4243                setAAR();
4244                setTotal();
4245            };
4246
4247            jfStripe = Stripe($("#sapik").val());
4248            jfElements = jfStripe.elements();
4249            jfStyle = {
4250                base: {
4251                    backgroundColor: "#ffffff",
4252                    fontSize: "0.9375rem",
4253                    fontFamily: "Roboto, Helvetica Neue, sans-serif",
4254                    lineHeight: "42px",
4255                    ":focus": {
4256                        border: "10px solid black"
4257                    }
4258                }
4259            };
4260            jfCardElement = jfElements.create("card", { style: jfStyle, hidePostalCode: true, disableLink: true });
4261
4262            jfCardElement.mount("#card-element");
4263
4264            jfCardElement.on("change", function (event) {
4265                var displayError = document.getElementById("card-errors");
4266                if (event.error) {
4267                    displayError.textContent = event.error.message;
4268                } else {
4269                    displayError.textContent = "";
4270                }
4271
4272                $("#CardBrand").val(event.brand);
4273            });
4274
4275            initAutocomplete = function () {
4276                // Create the autocomplete object, restricting the search predictions to
4277                autocomplete = new google.maps.places.Autocomplete(AddressLookup, {
4278                    fields: ["address_components"],
4279                    types: ["address"] });
4280                // When the user selects an address from the drop-down, populate the
4281                // address fields in the form.
4282                autocomplete.addListener("place_changed", fillInAddress);
4283            };
4284
4285            initAutocomplete();
4286
4287            ;
4288
4289            clearValidation = function (field) {
4290                var theField = $("#" + field);
4291                if (theField.val()) {
4292                    theField.removeClass("input-validation-error").addClass("valid");
4293                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
4294                    $("span[data-valmsg-for='" + field + "']").empty();
4295                }
4296            };
4297
4298            $("input[type=radio][name=rdoMailingCountry]").change(function () {
4299                if ($("input[name=\"rdoMailingCountry\"]:checked").val() === "US") {
4300                    $("#IsDomestic").val("True");
4301                    $("#IsInternational").val("False");
4302                    $("#divMailingCountry").hide();
4303                    $("#MailingCountry").val("United States");
4304                } else {
4305                    $("#IsDomestic").val("False");
4306                    $("#IsInternational").val("True");
4307                    $("#divMailingCountry").show();
4308                    $("#MembershipTerm").val("ANNUAL");
4309                    $("#btnAnnual").removeClass("joinv4-term-button__inactive");
4310                    $("#btnMonthly").addClass("joinv4-term-button__inactive");
4311                    $("#MailingCountry").val("");
4312                }
4313                setAAR();
4314                setTotal();
4315            });
4316
4317            $("#BirthDate").datepicker({
4318                changeMonth: true,
4319                changeYear: true,
4320                yearRange: new Date().getFullYear() - 110 + ":" + new Date().getFullYear(),
4321                minDate: new Date(new Date().getFullYear() - 110, new Date().getMonth(), new Date().getDate()),
4322                maxDate: new Date()
4323            });
4324
4325            $("#BirthDate").change(function () {
4326
4327                if ($("#BirthDate").val()) {
4328                    var bthDt = new Date($("#BirthDate").val());
4329                    var dtNow = new Date();
4330                    var age = dtNow.getFullYear() - bthDt.getFullYear();
4331
4332                    if (dtNow.getMonth() < bthDt.getMonth() || dtNow.getMonth() === bthDt.getMonth() && dtNow.getDate() < bthDt.getDate()) {
4333                        age -= 1;
4334                    }
4335
4336                    if (age >= 75) {
4337                        $("#Is75Plus").val("True");
4338                    } else {
4339                        $("#Is75Plus").val("False");
4340                    }
4341                } else {
4342                    $("#Is75Plus").val("False");
4343                }
4344                setTotal();
4345            });
4346
4347            $("#lnkKeyCode").click(function () {
4348                $("#divKeycodeForm").show();
4349            });
4350
4351            $(".joinv4-term-button").click(function () {
4352                $("#MembershipTerm").val($(this).data("term"));
4353                setAAR();
4354                setTotal();
4355            });
4356
4357            $("#btnJoinKeyCode").click(function () {
4358                var form = $(this).closest("form");
4359                if ($("#KeyCodeEntered").val() && $("#KeyCodeEntered").val().toUpperCase() !== $("#KeyCode").val().toUpperCase()) {
4360                    $.getJSON("/api/JoinKeyCodeV4/Get/?keycode=" + $("#KeyCodeEntered").val()).done(function (data) {
4361                        $("#KeyCode").val(data.keycode);
4362                        if (data.promoCodeActive) {
4363                            $("#PromoCodeId").val(data.promoCodeId);
4364                            $("#PromoCode").val(data.promoCode);
4365                            $("#DiscountProduct").val(data.productCode);
4366                            $("#DiscountPercentage").val(data.discount);
4367
4368                            if (data.productCode && data.discount == 0) {
4369                                $("#AarKeyCodeProductText").val(data.productName);
4370                                $("#AarKeyCodeProductCode").val(data.productCode);
4371                                $("#AarUseKeyCodeIncentive").val("True");
4372                                $("#divAarIncentiveText").html(decodeURIComponent($("#AarBaseIncentiveText").val().replace(/\+/g, " ").replace("**X**", data.productName)));
4373                                $("#divAarIncentiveSummaryText").html(data.productName);
4374                                document.getElementById("imgAarIncentive").src = decodeURIComponent($("#AarBasePremiumUrl").val().replace("**X**", data.productCode));
4375                            } else {
4376                                $("#AarKeyCodeProductText").val("");
4377                                $("#AarKeyCodeProductCode").val("");
4378                                $("#AarUseKeyCodeIncentive").val("False");
4379                                $("#divAarIncentiveText").html(decodeURIComponent($("#AarDefaultIncentiveText").val().replace(/\+/g, " ")));
4380                                $("#divAarIncentiveSummaryText").html(decodeURIComponent($("#AarDefaultIncentiveSummaryText").val()));
4381                                document.getElementById("imgAarIncentive").src = decodeURIComponent($("#AarDefaultIncentiveImgUrl").val());
4382                            }
4383                        } else {
4384                            $("#PromoCodeId").val("");
4385                            $("#PromoCode").val("");
4386                            $("#DiscountProduct").val("");
4387                            $("#DiscountPercentage").val("");
4388                            $("#AarKeyCodeProductText").val("");
4389                            $("#AarKeyCodeProductCode").val("");
4390                            $("#AarUseKeyCodeIncentive").val("False");
4391                            $("#divAarIncentiveText").html(decodeURIComponent($("#AarDefaultIncentiveText").val().replace(/\+/g, " ")));
4392                            $("#divAarIncentiveSummaryText").html(decodeURIComponent($("#AarDefaultIncentiveSummaryText").val()));
4393                            document.getElementById("imgAarIncentive").src = decodeURIComponent($("#AarDefaultIncentiveImgUrl").val());
4394                        }
4395                        $("#divKeyCodeFail").hide();
4396                        $("#divKeyCodeSuccess").show();
4397                        setTotal();
4398                    }).fail(function (jqXHR, textStatus, err) {
4399                        $("#divKeyCodeFail").show();
4400                        $("#divKeyCodeSuccess").hide();
4401                    });
4402                } else if ($("#KeyCodeEntered").val() && $("#KeyCodeEntered").val().toUpperCase() === $("#KeyCode").val().toUpperCase()) {
4403                    $("#divKeyCodeFail").hide();
4404                    $("#divKeyCodeSuccess").show();
4405                }
4406            });
4407
4408            $("#SelectedMagazineOption").change(function () {
4409                $("#joinv4-form-data_summary_mag").html($("#SelectedMagazineOption option:selected").text() + " Magazine");
4410
4411                setTotal();
4412            });
4413
4414            $("#AarAnnualInterested").change(function () {
4415                setAAR();
4416            });
4417
4418            $("#IncludeAnnualAar").change(function () {
4419                setAAR();
4420            });
4421
4422            $("#AarIncentiveOptOut").change(function () {
4423                setAAR();
4424            });
4425
4426            setAAR = function () {
4427                if ($("#MembershipTerm").val() === "ANNUAL") {
4428                    $("#divAAROptional").show();
4429                    $("#divAARRequired").hide();
4430
4431                    if ($("#AarAnnualInterested").is(":checked")) {
4432                        $("#divAAROptionalDisplay").show();
4433
4434                        if ($("#IncludeAnnualAar").is(":checked")) {
4435                            $("#joinv4-form-data_summary_aar").html("YES");
4436
4437                            $("#divAarIncentiveOptOut").show();
4438
4439                            if ($("#AarIncentiveShowOptOut").val() === "True") {
4440                                if ($("#AarIncentiveOptOut").is(":checked")) {
4441                                    $("#joinv4-form-data_summary_aar_incentive_row").hide();
4442                                } else {
4443                                    $("#joinv4-form-data_summary_aar_incentive_row").show();
4444                                }
4445                            } else {
4446                                $("#joinv4-form-data_summary_aar_incentive_row").show();
4447                            }
4448                        } else {
4449                            $("#joinv4-form-data_summary_aar").html("NO");
4450                            $("#divAarIncentiveOptOut").hide();
4451                            $("#joinv4-form-data_summary_aar_incentive_row").hide();
4452                        }
4453                    } else {
4454                        $("#divAAROptionalDisplay").hide();
4455                        $("#joinv4-form-data_summary_aar").html("NO");
4456                        $("#divAarIncentiveOptOut").hide();
4457                        $("#joinv4-form-data_summary_aar_incentive_row").hide();
4458                    }
4459                } else {
4460                    $("#divAAROptional").hide();
4461                    $("#divAARRequired").show();
4462
4463                    $("#joinv4-form-data_summary_aar").html("YES");
4464                    $("#joinv4-form-data_summary_aar_incentive_row").hide();
4465                }
4466            };
4467
4468            $("#IncludeMonthlyAar").change(function () {
4469                if (this.checked || $("#MembershipTerm").val() === "ANNUAL") {
4470                    enableJoinButton();
4471                } else {
4472                    disableJoinButton();
4473                }
4474            });
4475
4476            enableJoinButton = function () {
4477                $("#btnJoin").removeClass("join-disable-button");
4478                $("#btnJoin").prop("disabled", false);
4479            };
4480
4481            disableJoinButton = function () {
4482                $("#btnJoin").addClass("join-disable-button");
4483                $("#btnJoin").prop("disabled", true);
4484            };
4485
4486            checkCardFields = function () {
4487                var isValid = false;
4488
4489                if ($("#ShowStripeForm").val() === "True") {
4490                    var cardElement = document.querySelector("#card-element");
4491
4492                    isValid = cardElement.classList.contains("StripeElement--complete");
4493
4494                    var brand = $("#CardBrand").val();
4495
4496                    if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
4497                        $("#card-errors").html("");
4498                    } else {
4499                        if ($("#card-errors").is(":empty")) {
4500                            $("#card-errors").html("Please check your credit card information.");
4501                        }
4502                    }
4503                } else {
4504                    isValid = true;
4505                }
4506
4507                return isValid;
4508            };
4509
4510            $("#SelectedPpsOption").change(function () {
4511                setTotal();
4512            });
4513
4514            setMem = function (isAnnual, isMonthly, isDomestic, isInternational, isSenior, membershipOptions) {
4515                var retVal = 0;
4516                var currAnnual;
4517                var currMonthly;
4518
4519                if (isInternational) {
4520                    currAnnual = membershipOptions.filter(function (o) {
4521                        return o.isInternational === true;
4522                    })[0];
4523
4524                    currMonthly = null;
4525                } else {
4526                    currAnnual = membershipOptions.filter(function (o) {
4527                        return o.isDomestic === true && o.isAnnual === true && o.isSenior === isSenior;
4528                    })[0];
4529
4530                    currMonthly = membershipOptions.filter(function (o) {
4531                        return o.isDomestic === true && o.isMonthly === true && o.isSenior === isSenior;
4532                    })[0];
4533                }
4534
4535                if (currAnnual != null) {
4536                    var discAnnAmount = Math.round(currAnnual.price * parseFloat($("#DiscountPercentage").val()) / 100 * 100) / 100;
4537                    if (currAnnual.productCode === $("#DiscountProduct").val()) {
4538                        $("#btnAnnual").html("<span class=\"joinv4-form-data__strikethrough\">$" + currAnnual.price.toFixed(2) + "</span> $" + (currAnnual.price - discAnnAmount).toFixed(2) + " <span class=\"joinv4-term-text\">Per Year</span>");
4539                    } else {
4540                        $("#btnAnnual").html("$" + currAnnual.price.toFixed(2) + " <span class=\"joinv4-term-text\">Per Year</span>");
4541                    }
4542
4543                    if (isAnnual && currAnnual.productCode === $("#DiscountProduct").val()) {
4544                        $("#DiscountAmount").val(discAnnAmount);
4545                        $("#DiscountAmountString").val("-$" + discAnnAmount.toFixed(2));
4546                        $("#joinv4-form-data_summary_discount_amount").html("-$" + discAnnAmount.toFixed(2));
4547                        $("#divSummmaryDiscountDescription").html("Discount");
4548                        $("#DiscountDescription").val("Discount");
4549                        $("#joinv4-form-data_summary_discount_wrapper").show();
4550                        retVal -= discAnnAmount;
4551                    }
4552                    if (isAnnual && currAnnual.productCode !== $("#DiscountProduct").val()) {
4553                        $("#DiscountAmount").val(0);
4554                        $("#DiscountAmountString").val("");
4555                        $("#joinv4-form-data_summary_discount_amount").html("");
4556                        $("#divSummmaryDiscountDescription").html("");
4557                        $("#DiscountDescription").val("");
4558                        $("#joinv4-form-data_summary_discount_wrapper").hide();
4559                    }
4560                }
4561
4562                if (isDomestic && currMonthly != null) {
4563                    var discMonAmount = Math.round(currMonthly.price * parseFloat($("#DiscountPercentage").val()) / 100 * 100) / 100;
4564                    if (currMonthly.productCode === $("#DiscountProduct").val()) {
4565                        $("#btnMonthly").html("<span class=\"joinv4-form-data__strikethrough\">$" + currMonthly.price.toFixed(2) + "</span> $" + (currMonthly.price - discMonAmount).toFixed(2) + " <span class=\"joinv4-term-text\">Per Month</span>");
4566                    } else {
4567                        $("#btnMonthly").html("$" + currMonthly.price.toFixed(2) + " <span class=\"joinv4-term-text\">Per Month</span>");
4568                    }
4569
4570                    if (isMonthly && currMonthly.productCode === $("#DiscountProduct").val()) {
4571                        $("#DiscountAmount").val(discAnnAmount);
4572                        $("#DiscountAmountString").val("-$" + discAnnAmount.toFixed(2));
4573                        $("#joinv4-form-data_summary_discount_amount").html("-$" + discAnnAmount.toFixed(2));
4574                        $("#divSummmaryDiscountDescription").html("Discount");
4575                        $("#DiscountDescription").val("Discount");
4576                        $("#joinv4-form-data_summary_discount_wrapper").show();
4577                        retVal -= currMonthly;
4578                    }
4579                    if (isMonthly && currMonthly.productCode !== $("#DiscountProduct").val()) {
4580                        $("#DiscountAmount").val(0);
4581                        $("#DiscountAmountString").val("");
4582                        $("#joinv4-form-data_summary_discount_amount").html("");
4583                        $("#divSummmaryDiscountDescription").html("");
4584                        $("#DiscountDescription").val("");
4585                        $("#joinv4-form-data_summary_discount_wrapper").hide();
4586                    }
4587                } else {
4588                    $("#btnMonthly").html("$-.--");
4589                }
4590
4591                if (isAnnual) {
4592                    $("#joinv4-form-data_summary_membership").html(currAnnual.summaryDescription);
4593                    $("#spHeaderMembership").html(currAnnual.summaryDescription);
4594                    $("#joinv4-form-data_summary_membership_price").html("$" + currAnnual.price.toFixed(2));
4595                    $("#MembershipBundleSelected").val(currAnnual.bundleCode);
4596                    $("#MembershipProductSelected").val(currAnnual.productCode);
4597                    $(".joinv4-form-data__promo-section").show();
4598                    $("#btnAnnual").removeClass("joinv4-term-button__inactive");
4599                    $("#btnMonthly").addClass("joinv4-term-button__inactive");
4600                    retVal += currAnnual.price;
4601                }
4602                if (isMonthly) {
4603                    $("#joinv4-form-data_summary_membership").html(currMonthly.summaryDescription);
4604                    $("#spHeaderMembership").html(currMonthly.summaryDescription);
4605                    $("#joinv4-form-data_summary_membership_price").html("$" + currMonthly.price.toFixed(2));
4606                    $("#MembershipBundleSelected").val(currMonthly.bundleCode);
4607                    $("#MembershipProductSelected").val(currMonthly.productCode);
4608                    $(".joinv4-form-data__promo-section").hide();
4609                    $("#btnAnnual").addClass("joinv4-term-button__inactive");
4610                    $("#btnMonthly").removeClass("joinv4-term-button__inactive");
4611                    $("#divFreeGift").hide();
4612                    retVal += currMonthly.price;
4613                }
4614
4615                if (isInternational) {
4616                    $("#btnMonthlyWrapper").hide();
4617                } else {
4618                    $("#btnMonthlyWrapper").show();
4619                }
4620
4621                return retVal;
4622            };
4623
4624            setPps = function (isAnnual, isMonthly, ppsAnnualOptions, ppsMonthlyOptions) {
4625                var retVal = 0;
4626
4627                var currentSelection = $("#SelectedPpsOption").val();
4628                var itemsToAdd;
4629                if (isAnnual) {
4630                    if (currentSelection && currentSelection.startsWith("MON-")) {
4631                        currentSelection = currentSelection.replace("MON-", "");
4632                    }
4633                    itemsToAdd = ppsAnnualOptions;
4634                };
4635                if (isMonthly) {
4636                    if (currentSelection && !currentSelection.startsWith("MON-")) {
4637                        currentSelection = "MON-" + currentSelection;
4638                    }
4639                    itemsToAdd = ppsMonthlyOptions;
4640                };
4641
4642                $("#SelectedPpsOption").empty();
4643
4644                $.each(itemsToAdd, function () {
4645                    var option = document.createElement("option");
4646
4647                    option.value = this.productCode;
4648                    option.text = this.dropDownText;
4649                    if (option.value === currentSelection) {
4650                        option.selected = true;
4651                        retVal = Math.round(this.price * 100) / 100;
4652                        $("#joinv4-form-data_summary_pps").html(this.summaryDescription);
4653                        $("#joinv4-form-data_summary_pps_price").html("$" + retVal.toFixed(2));
4654                    }
4655
4656                    $("#SelectedPpsOption").append(option);
4657                });
4658
4659                if (currentSelection) {
4660                    $("#joinv4-form-data_summary_pps_wrapper").show();
4661                } else {
4662                    $("#joinv4-form-data_summary_pps_wrapper").hide();
4663                }
4664
4665                return retVal;
4666            };
4667
4668            setIpf = function (isDomestic) {
4669                var retVal = 0;
4670
4671                if (isDomestic) {
4672                    $("#joinv4-form-data_summary_ipf_wrapper").hide();
4673                } else {
4674                    if ($("#SelectedMagazineOption").val().indexOf("-PRINT-") >= 0) {
4675                        retVal = parseFloat($("#InternationalPrintFeeSummaryPrice").val());
4676                        $("#joinv4-form-data_summary_ipf_wrapper").show();
4677                    } else {
4678                        $("#joinv4-form-data_summary_ipf_wrapper").hide();
4679                    }
4680                }
4681
4682                return retVal;
4683            };
4684
4685            updateTerms = function (isAnnual, isInternational, membershipOptions, ppsAnnualOptions, ppsMonthlyOptions) {
4686                var total = 0;
4687                var currMembership = membershipOptions.filter(function (o) {
4688                    return o.bundleCode === $("#MembershipBundleSelected").val();
4689                })[0];
4690
4691                total += currMembership.price;
4692
4693                var currPps;
4694                if (isAnnual) {
4695                    currPps = ppsAnnualOptions.filter(function (o) {
4696                        return o.productCode === $("#SelectedPpsOption").val();
4697                    })[0];
4698                } else {
4699                    currPps = ppsMonthlyOptions.filter(function (o) {
4700                        return o.productCode === $("#SelectedPpsOption").val();
4701                    })[0];
4702                }
4703                total += currPps.price;
4704
4705                if (isInternational && $("#SelectedMagazineOption").val().indexOf("-PRINT-") >= 0) {
4706                    total += parseFloat($("#InternationalPrintFeeSummaryPrice").val());
4707                }
4708
4709                if (isAnnual) {
4710                    $(".aopa-annual-membership-price").html("$" + total.toFixed(2));
4711                    $(".aopa-monthly-membership-price").html("--.--");
4712                } else {
4713                    $(".aopa-annual-membership-price").html("--.--");
4714                    $(".aopa-monthly-membership-price").html("$" + total.toFixed(2));
4715                }
4716            };
4717
4718            setTotal = function () {
4719                var oldTotal = parseFloat($("#OrderTotal").val());
4720
4721                var membershipOptions = JSON.parse($("#divMembershipOptions").text());
4722                var ppsAnnualOptions = JSON.parse($("#divPpsAnnualOptions").text());
4723                var ppsMonthlyOptions = JSON.parse($("#divPpsMonthlyOptions").text());
4724                var isDomestic = $("#IsDomestic").val().toUpperCase() === "TRUE";
4725                var isInternational = $("#IsInternational").val().toUpperCase() === "TRUE";
4726                var isSenior = $("#Is75Plus").val().toUpperCase() === "TRUE";
4727                var isAnnual = $("#MembershipTerm").val() === "ANNUAL";
4728                var isMonthly = $("#MembershipTerm").val() === "MONTHLY";
4729
4730                var total = 0;
4731                total += setMem(isAnnual, isMonthly, isDomestic, isInternational, isSenior, membershipOptions);
4732                total += setIpf(isDomestic);
4733                total += setPps(isAnnual, isMonthly, ppsAnnualOptions, ppsMonthlyOptions);
4734                total = Math.round(total * 100) / 100;
4735                updateTerms(isAnnual, isInternational, membershipOptions, ppsAnnualOptions, ppsMonthlyOptions);
4736
4737                if (total !== oldTotal) {
4738                    $("input[type=\"checkbox\"][id=\"IncludeAnnualAar\"]").prop("checked", false).change();
4739                    $("input[type=\"checkbox\"][id=\"IncludeMonthlyAar\"]").prop("checked", false).change();
4740                }
4741
4742                $("#spHeaderPrice").html("$" + total.toFixed(2));
4743                $("#joinv4-form-data_summary_total").html("$" + total.toFixed(2));
4744                $("#OrderTotal").val(total);
4745            };
4746
4747            $("#UseNewCard").change(function () {
4748                if ($("#UseNewCard").is(":checked")) {
4749                    $("#ShowStripeForm").val("True");
4750                    $("#divStripe").show();
4751                    $("#divToken").hide();
4752                } else {
4753                    $("#ShowStripeForm").val("False");
4754                    $("#divStripe").hide();
4755                    $("#divToken").show();
4756                }
4757            });
4758
4759            $(".submitButtonJFV4").click(function () {
4760                var theForm = $(this).closest("form");
4761
4762                var progressBar = new Sfpb_progressBar();
4763
4764                var ccValid = checkCardFields();
4765
4766                if (theForm.valid() && ccValid && $("#OrderTotal").val() > 0) {
4767                    $("#btnJoin").hide();
4768                    $(this).hide();
4769                    $("body").addClass("progressbar-modal");
4770                    progressBar.start();
4771                    $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
4772
4773                    if ($("#ShowStripeForm").val() === "True") {
4774                        jfStripe.createToken(jfCardElement, { name: $("#CardName").val() }).then(function (result) {
4775                            if (result.token !== null) {
4776                                $("#CardToken").val(JSON.stringify(result.token));
4777                                theForm.submit();
4778                            } else {
4779                                if ($("#card-errors").is(":empty")) {
4780                                    $("#card-errors").html("Please check your credit card information.");
4781                                }
4782                                var spinner = document.getElementById("aopaSpinner");
4783                                spinner.parentElement.removeChild(spinner);
4784                                $(this).show();
4785                                progressBar.kill();
4786                                $("body").removeClass("progressbar-modal");
4787                                $("#btnJoin").show();
4788                            }
4789                        });
4790                    } else {
4791                        theForm.submit();
4792                    }
4793                } else {
4794                    var firstInstance = $(".input-validation-error").first();
4795                    var offsetTop = firstInstance.offset().top - 100;
4796
4797                    $("html, body").animate({
4798                        scrollTop: offsetTop
4799                    }, 500);
4800                }
4801            });
4802        })();
4803    }
4804});
4805
4806},{}],25:[function(require,module,exports){
4807"use strict";
4808
4809//
4810
4811},{}],26:[function(require,module,exports){
4812"use strict";
4813
4814$(document).ready(function () {
4815    if ($("div#divAopaRenewFormGSV2").length) {
4816        var theForm = $("#frmAopaRenewFormV2");
4817
4818        $("#btnGetStarted").click(function () {
4819            var progressBar = new Sfpb_progressBar();
4820            $("#btnGetStarted").hide();
4821            $(this).hide();
4822            $(".clsSubmitButton").append("<div class=\"spinner spinner--clockwise\"></div>");
4823            progressBar.start();
4824            theForm.submit();
4825        });
4826    }
4827});
4828
4829},{}],27:[function(require,module,exports){
4830"use strict";
4831
4832$(document).ready(function () {
4833    if ($("div#divAopaRenewFormV2").length) {
4834        var theForm;
4835        var rfStripe;
4836        var rfElements;
4837        var rfStyle;
4838        var rfCardElement;
4839        var currentDate;
4840        var updateAAR;
4841        var setMem;
4842        var setAddOn;
4843        var setIpf;
4844        var setIpfAddOn;
4845        var setPps;
4846        var setDonation;
4847        var setAAR;
4848        var setDiscount;
4849        var setTotal;
4850        var checkCardFields;
4851
4852        (function () {
4853            var setAddOptions = function (rate) {
4854                var hasPPS = $("#SelectedPpsOption").val() != "";
4855
4856                switch (rate) {
4857                    case "MAG-PRINT-PILOT":
4858                        setCheckBox("#AddOnPilotPrint", true);
4859                        setCheckBox("#AddOnPilotDigital", hasPPS);
4860                        setCheckBox("#AddOnTurbinePilotPrint", false);
4861                        setCheckBox("#AddOnTurbinePilotDigital", false);
4862                        setCheckBox("#AddOnFtPrint", false);
4863                        setCheckBox("#AddOnFtDigital", false);
4864                        break;
4865                    case "MAG-DIGITAL-PILOT":
4866                        setCheckBox("#AddOnPilotPrint", false);
4867                        setCheckBox("#AddOnPilotDigital", true);
4868                        setCheckBox("#AddOnTurbinePilotPrint", false);
4869                        setCheckBox("#AddOnTurbinePilotDigital", false);
4870                        setCheckBox("#AddOnFtPrint", false);
4871                        setCheckBox("#AddOnFtDigital", false);
4872                        break;
4873                    case "MAG-PRINT-PILOT-TURBINE":
4874                        setCheckBox("#AddOnPilotPrint", false);
4875                        setCheckBox("#AddOnPilotDigital", false);
4876                        setCheckBox("#AddOnTurbinePilotPrint", true);
4877                        setCheckBox("#AddOnTurbinePilotDigital", hasPPS);
4878                        setCheckBox("#AddOnFtPrint", false);
4879                        setCheckBox("#AddOnFtDigital", false);
4880                        break;
4881                    case "MAG-DIGITAL-PILOT-TURBINE":
4882                        setCheckBox("#AddOnPilotPrint", false);
4883                        setCheckBox("#AddOnPilotDigital", false);
4884                        setCheckBox("#AddOnTurbinePilotPrint", false);
4885                        setCheckBox("#AddOnTurbinePilotDigital", true);
4886                        setCheckBox("#AddOnFtPrint", false);
4887                        setCheckBox("#AddOnFtDigital", false);
4888                        break;
4889                    case "MAG-PRINT-FT":
4890                        setCheckBox("#AddOnPilotPrint", false);
4891                        setCheckBox("#AddOnPilotDigital", false);
4892                        setCheckBox("#AddOnTurbinePilotPrint", false);
4893                        setCheckBox("#AddOnTurbinePilotDigital", false);
4894                        setCheckBox("#AddOnFtPrint", true);
4895                        setCheckBox("#AddOnFtDigital", hasPPS);
4896                        break;
4897                    case "MAG-DIGITAL-FT":
4898                        setCheckBox("#AddOnPilotPrint", false);
4899                        setCheckBox("#AddOnPilotDigital", false);
4900                        setCheckBox("#AddOnTurbinePilotPrint", false);
4901                        setCheckBox("#AddOnTurbinePilotDigital", false);
4902                        setCheckBox("#AddOnFtPrint", false);
4903                        setCheckBox("#AddOnFtDigital", true);
4904                        break;
4905                }
4906            };
4907
4908            var setCheckBox = function (field, disabled) {
4909                if (disabled) {
4910                    $(field).prop("checked", false);
4911                    $(field).parent().css("color", "grey");
4912                } else {
4913                    $(field).parent().css("color", "");
4914                }
4915
4916                $(field).prop("disabled", disabled);
4917                $(field + "Disabled").val(disabled);
4918            };
4919
4920            var isDowngrade = function () {
4921                var selOption = $("#SelectedPpsOption").val();
4922
4923                switch ($("#CurrentPpsCode").val()) {
4924                    case "PPS-PLUS":
4925                        if (selOption !== "PPS-PLUS") {
4926                            return true;
4927                        }
4928
4929                        break;
4930                    case "PPS-BASIC":
4931                        if (selOption === "") {
4932                            return true;
4933                        }
4934                        break;
4935                }
4936                return false;
4937            };
4938
4939            theForm = $("#frmAopaRenewFormV2");
4940            rfStripe = Stripe($("#sapik").val());
4941            rfElements = rfStripe.elements();
4942            rfStyle = {
4943                base: {
4944                    backgroundColor: "#ffffff",
4945                    fontSize: "0.9375rem",
4946                    fontFamily: "Roboto, Helvetica Neue, sans-serif",
4947                    lineHeight: "42px",
4948                    ":focus": {
4949                        border: "10px solid black"
4950                    }
4951                }
4952            };
4953            rfCardElement = rfElements.create("card", { style: rfStyle, hidePostalCode: true, disableLink: true });
4954
4955            rfCardElement.mount("#card-element");
4956
4957            rfCardElement.on("change", function (event) {
4958                var displayError = document.getElementById("card-errors");
4959                if (event.error) {
4960                    displayError.textContent = event.error.message;
4961                } else {
4962                    displayError.textContent = "";
4963                }
4964
4965                $("#CardBrand").val(event.brand);
4966            });
4967
4968            currentDate = new Date();
4969
4970            $("#BirthDate").datepicker({
4971                changeMonth: true,
4972                changeYear: true,
4973                endDate: "currentDate",
4974                maxDate: currentDate,
4975                yearRange: new Date().getFullYear() - 100 + ":" + new Date().getFullYear()
4976            });
4977
4978            $("#BirthDate").change(function () {
4979                if ($("#BirthDate").val()) {
4980                    var bthDt = new Date($("#BirthDate").val());
4981
4982                    //var renewDate = $('#RenewalCycleBeginDate').val().split('/');
4983                    //var dtNow = new Date(renewDate[2], renewDate[0] - 1, renewDate[2]);
4984                    var dtNow = new Date($("#RenewalCycleBeginDate").val());
4985                    var age = dtNow.getFullYear() - bthDt.getFullYear();
4986
4987                    if (dtNow.getMonth() < bthDt.getMonth() || dtNow.getMonth() === bthDt.getMonth() && dtNow.getDate() < bthDt.getDate()) {
4988                        age -= 1;
4989                    }
4990
4991                    if (age >= 75) {
4992                        $("#Is75Plus").val("True");
4993                    } else {
4994                        $("#Is75Plus").val("False");
4995                    }
4996                } else {
4997                    $("#Is75Plus").val("False");
4998                }
4999                setTotal();
5000            });
5001
5002            $("#SelectedPpsOption").change(function () {
5003                setAddOptions($("#SelectedMagazineOption option:selected").val());
5004                setTotal();
5005            });
5006
5007            $("#SelectedMagazineOption").change(function () {
5008                $("#renewv2-form-data_summary_mag").html($("#SelectedMagazineOption option:selected").text() + " Magazine");
5009
5010                setAddOptions($("#SelectedMagazineOption option:selected").val());
5011                setTotal();
5012            });
5013
5014            $("#AarInterested").change(function () {
5015                updateAAR();
5016            });
5017
5018            $("#IncludeAar").change(function () {
5019                updateAAR();
5020            });
5021
5022            $("#AarIncentiveOptOut").change(function () {
5023                updateAAR();
5024            });
5025
5026            updateAAR = function () {
5027                if ($("#AarInterested").is(":checked")) {
5028                    $("#divAARDisplay").show();
5029
5030                    if ($("#IncludeAar").is(":checked")) {
5031                        $("#renewv2-form-data_summary_aar").html("YES");
5032
5033                        $("#divAarIncentiveOptOut").show();
5034
5035                        if ($("#AarIncentiveShowOptOut").val() === "True") {
5036                            if ($("#AarIncentiveOptOut").is(":checked")) {
5037                                $("#renewv2-form-data_summary_aar_incentive_row").hide();
5038                            } else {
5039                                $("#renewv2-form-data_summary_aar_incentive_row").show();
5040                            }
5041                        } else {
5042                            $("#renewv2-form-data_summary_aar_incentive_row").show();
5043                        }
5044                    } else {
5045                        $("#renewv2-form-data_summary_aar").html("NO");
5046                        $("#divAarIncentiveOptOut").hide();
5047                        $("#renewv2-form-data_summary_aar_incentive_row").hide();
5048                    }
5049                } else {
5050                    $("#divAARDisplay").hide();
5051                    $("#renewv2-form-data_summary_aar").html("NO");
5052                    $("#divAarIncentiveOptOut").hide();
5053                    $("#renewv2-form-data_summary_aar_incentive_row").hide();
5054                }
5055            };
5056
5057            $("#lnkKeyCode").click(function () {
5058                $("#divKeycodeForm").show();
5059            });
5060
5061            $("#btnRenewKeyCode").click(function () {
5062                var form = $(this).closest("form");
5063                if ($("#KeyCodeEntered").val() && $("#KeyCodeEntered").val().toUpperCase() !== $("#KeyCode").val().toUpperCase()) {
5064                    $.getJSON("/api/JoinKeyCodeV4/Get/?keycode=" + $("#KeyCodeEntered").val()).done(function (data) {
5065                        $("#KeyCode").val(data.keycode);
5066                        if (data.promoCodeActive) {
5067                            $("#PromoCodeId").val(data.promoCodeId);
5068                            $("#PromoCode").val(data.promoCode);
5069                            if (data.discount > 0) {
5070                                $("#DiscountProduct").val(data.productC
5070ode);
5071                                $("#DiscountPercentage").val(data.discount);
5072                                $("#IncludePremium").val("False");
5073                                $("#PremiumProductCode").val("");
5074                                $("#PremiumAttribute").val("");
5075                                $("#imgPremium").attr("src", "");
5076                                //$('#divPremiumSpan').html('');
5077                                //$('#divSummaryPremiumText').html('');
5078                                //$('#PremiumDescription').val('');
5079                                $("#divPremiumWrapper").hide();
5080                                $("#divSummaryPremium").hide();
5081                            } else {
5082                                $("#DiscountProduct").val("");
5083                                $("#DiscountPercentage").val("");
5084                                $("#IncludePremium").val("True");
5085                                $("#PremiumProductCode").val(data.productCode);
5086                                $("#PremiumAttribute").val(data.productAttribute);
5087                                $("#imgPremium").attr("src", $("#PremiumImageRoot").val().replace("%%PRODUCT_CODE%%", data.premiumImage));
5088                                //$('#divPremiumSpan').html(data.premiumDescription);
5089                                //$('#divSummaryPremiumText').html(data.premiumDescription);
5090                                //$('#PremiumDescription').val(data.premiumDescription);
5091                                $("#divPremiumWrapper").show();
5092                                $("#divSummaryPremium").show();
5093                            }
5094                            setTotal();
5095                        } else {
5096                            $("#PromoCodeId").val("");
5097                            $("#PromoCode").val("");
5098                            $("#DiscountProduct").val("");
5099                            $("#DiscountPercentage").val("");
5100                            $("#IncludePremium").val("False");
5101                            $("#PremiumProductCode").val("");
5102                            $("#PremiumAttribute").val("");
5103                            $("#divPremiumWrapper").hide();
5104                            $("#divSummaryPremium").hide();
5105                            $("#imgPremium").attr("src", "");
5106                            //$('#divPremiumSpan').html('');
5107                            //$('#divSummaryPremiumText').html('');
5108                            //$('#PremiumDescription').val('');
5109                            $("#divPremiumWrapper").hide();
5110                            $("#divSummaryPremium").hide();
5111                        }
5112                        $("#divKeyCodeFail").hide();
5113                        $("#divKeyCodeSuccess").show();
5114                    }).fail(function (jqXHR, textStatus, err) {
5115                        $("#divKeyCodeFail").show();
5116                        $("#divKeyCodeSuccess").hide();
5117                    });
5118                } else if ($("#KeyCodeEntered").val() && $("#KeyCodeEntered").val().toUpperCase() === $("#KeyCode").val().toUpperCase()) {
5119                    $("#divKeyCodeFail").hide();
5120                    $("#divKeyCodeSuccess").show();
5121                }
5122            });
5123
5124            $("#AddOnPilotPrint").change(function () {
5125                if (this.checked) {
5126                    $("#divAddOnPilotPrint").show();
5127                    if ($("#IsInternational").val() == "True") {
5128                        $(".AddOnPilotPrint-ipf").show();
5129                    }
5130                } else {
5131                    $("#divAddOnPilotPrint").hide();
5132                    if ($("#IsInternational").val() == "True") {
5133                        $(".AddOnPilotPrint-ipf").hide();
5134                    }
5135                }
5136                setTotal();
5137            });
5138
5139            $("#AddOnPilotDigital").change(function () {
5140                if (this.checked) {
5141                    $("#divAddOnPilotDigital").show();
5142                } else {
5143                    $("#divAddOnPilotDigital").hide();
5144                }
5145                setTotal();
5146            });
5147
5148            $("#AddOnTurbinePilotPrint").change(function () {
5149                if (this.checked) {
5150                    $("#divAddOnTurbinePilotPrint").show();
5151                    if ($("#IsInternational").val() == "True") {
5152                        $(".AddOnTurbinePilotPrint-ipf").show();
5153                    }
5154                } else {
5155                    $("#divAddOnTurbinePilotPrint").hide();
5156                    if ($("#IsInternational").val() == "True") {
5157                        $(".AddOnTurbinePilotPrint-ipf").hide();
5158                    }
5159                }
5160                setTotal();
5161            });
5162
5163            $("#AddOnTurbinePilotDigital").change(function () {
5164                if (this.checked) {
5165                    $("#divAddOnTurbinePilotDigital").show();
5166                } else {
5167                    $("#divAddOnTurbinePilotDigital").hide();
5168                }
5169                setTotal();
5170            });
5171
5172            $("#AddOnFtPrint").change(function () {
5173                if (this.checked) {
5174                    $("#divAddOnFTPrint").show();
5175                    if ($("#IsInternational").val() == "True") {
5176                        $(".AddOnFtPrint-ipf").show();
5177                    }
5178                } else {
5179                    $("#divAddOnFTPrint").hide();
5180                    if ($("#IsInternational").val() == "True") {
5181                        $(".AddOnFtPrint-ipf").hide();
5182                    }
5183                }
5184                setTotal();
5185            });
5186
5187            $("#AddOnFtDigital").change(function () {
5188                if (this.checked) {
5189                    $("#divAddOnFTDigital").show();
5190                } else {
5191                    $("#divAddOnFTDigital").hide();
5192                }
5193                setTotal();
5194            });
5195
5196            $("#SelectedDonationAmount").change(function () {
5197                var option = $(this).find("option:selected").val();
5198                var optionText = $(this).find("option:selected").text();
5199
5200                if (option !== "OTHER|0") {
5201                    if ($("#MinimumDonationAmount").length) {
5202                        $("#MinimumDonationAmount").val("");
5203                        $("#MinimumDonationAmount").valid();
5204                        $("#MinimumDonationAmount").prop("disabled", true);
5205                        $("#divOtherAmount").hide();
5206
5207                        if (option !== "0|0") {
5208                            $("#divSummaryDonationPrice").html(optionText);
5209                            $("#divSummaryDonationRow").show();
5210                        } else {
5211                            $("#divSummaryDonationRow").hide();
5212                            $("#divSummaryDonationPrice").html("");
5213                        }
5214                    }
5215                } else {
5216                    $("#MinimumDonationAmount").prop("disabled", false);
5217                    $("#divOtherAmount").show();
5218                    $("#divSummaryDonationRow").hide();
5219                    $("#divSummaryDonationPrice").html("");
5220                }
5221
5222                setTotal();
5223            });
5224
5225            $("input[name=MinimumDonationAmount]").on("change", function () {
5226                if ($("#SelectedDonationAmount").find("option:selected").val() === "OTHER|0") {
5227
5228                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
5229                        $("#divSummaryDonationPrice").html("$" + parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2));
5230                        $("#divSummaryDonationRow").show();
5231                    } else {
5232                        $("#divSummaryDonationRow").hide();
5233                        $("#divSummaryDonationPrice").html("");
5234                    }
5235
5236                    setTotal();
5237                }
5238            });
5239
5240            //$('#IncludeAar').change(function () {
5241            //    if ($('#IncludeAar').is(":checked")) {
5242            //        $('#renewv2-form-data_summary_aar').html("YES");
5243            //    } else {
5244            //        $('#renewv2-form-data_summary_aar').html("NO");
5245            //    }
5246            //});
5247
5248            $("#ShowPayment").change(function () {
5249                if ($(this).is(":checked")) {
5250                    $("#divPayment").css({ visibility: "visible" });
5251                    $("#divPayment").css({ display: "block" });
5252                    $("#ShowStripeForm").val("True");
5253                } else {
5254                    $("#divPayment").css({ visibility: "hidden" });
5255                    $("#divPayment").css({ display: "none" });
5256                    $("#ShowStripeForm").val("False");
5257                }
5258            });
5259
5260            setMem = function (isAnnual, isMonthly, isDomestic, isInternational, isSenior, membershipOptions) {
5261                var retVal = 0;
5262                var currAnnual;
5263
5264                if (isInternational) {
5265                    currAnnual = membershipOptions.filter(function (o) {
5266                        return o.isInternational === true;
5267                    })[0];
5268                } else {
5269                    currAnnual = membershipOptions.filter(function (o) {
5270                        return o.isDomestic === true && o.isAnnual === true && o.isSenior === isSenior;
5271                    })[0];
5272                }
5273
5274                if (isAnnual) {
5275                    $("#renewv2-form-data_summary_membership").html(currAnnual.summaryDescription);
5276                    $("#spHeaderMembership").html(currAnnual.summaryDescription);
5277                    $("#renewv2-form-data_summary_membership_price").html("$" + currAnnual.price.toFixed(2));
5278                    $("#MembershipBundleSelected").val(currAnnual.bundleCode);
5279                    $("#MembershipProductSelected").val(currAnnual.productC
5279ode);
5280                    retVal += currAnnual.price;
5281                }
5282
5283                return retVal;
5284            };
5285
5286            setAddOn = function (field) {
5287                var retVal = 0;
5288
5289                if ($("#" + field).is(":checked")) {
5290                    var price = parseFloat($("#" + field + "Price").val());
5291                    retVal = price;
5292                    $("#div" + field).show();
5293                } else {
5294                    $("#div" + field).hide();
5295                }
5296
5297                return retVal;
5298            };
5299
5300            setIpf = function (isDomestic) {
5301                var retVal = 0;
5302
5303                if (isDomestic) {
5304                    $("#renewv2-form-data_summary_ipf_wrapper").hide();
5305                } else {
5306                    if ($("#SelectedMagazineOption").val().indexOf("-PRINT-") >= 0) {
5307                        retVal = parseFloat($("#InternationalPrintFeeSummaryPrice").val());
5308                        $("#renewv2-form-data_summary_ipf_wrapper").show();
5309                    } else {
5310                        $("#renewv2-form-data_summary_ipf_wrapper").hide();
5311                    }
5312                }
5313
5314                return retVal;
5315            };
5316
5317            setIpfAddOn = function (field, isDomestic) {
5318                var ipf = parseFloat($("#InternationalPrintFeeSummaryPrice").val());
5319                var retVal = 0;
5320
5321                if (isDomestic) {
5322                    $("." + field).hide();
5323                } else {
5324                    if ($("#" + field).is(":checked")) {
5325                        retVal = ipf;
5326                        $("." + field + "-ipf").show();
5327                    } else {
5328                        $("." + field + "-ipf").hide();
5329                    }
5330                }
5331
5332                return retVal;
5333            };
5334
5335            setPps = function (ppsAnnualOptions) {
5336                var retVal = 0;
5337
5338                var currentSelection = $("#SelectedPpsOption").val();
5339
5340                ppsAnnualOptions.forEach(function (item) {
5341                    if (item.productCode === currentSelection) {
5342                        retVal = item.price;
5343                        $("#renewv2-form-data_summary_pps").html(item.summaryDescription);
5344                        $("#renewv2-form-data_summary_pps_price").html("$" + retVal.toFixed(2));
5345                    }
5346                });
5347
5348                if (currentSelection) {
5349                    $("#renewv2-form-data_summary_pps_wrapper").show();
5350                } else {
5351                    $("#renewv2-form-data_summary_pps_wrapper").hide();
5352                }
5353
5354                return retVal;
5355            };
5356
5357            setDonation = function () {
5358                var retVal = 0;
5359                var option = $("#SelectedDonationAmount").find("option:selected").val();
5360                if (option !== "OTHER|0") {
5361                    var amount = option.split("|");
5362                    retVal = parseFloat(amount[1], 10);
5363                } else {
5364                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
5365                        retVal = parseFloat($("#MinimumDonationAmount").val(), 10);
5366                    }
5367                }
5368
5369                return retVal;
5370            };
5371
5372            setAAR = function (total) {
5373
5374                if ($("#ShowAar").val() === "True") {
5375                    var curText = $(".aopa-annual-membership-price").html();
5376
5377                    var newText = "$" + parseFloat(total, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString();
5378
5379                    if (curText != newText) {
5380                        $(".aopa-annual-membership-price").html(newText);
5381                        $("input[type=\"checkbox\"][id=\"IncludeAar\"]").prop("checked", false).change();
5382                    }
5383                }
5384            };
5385
5386            setDiscount = function (isAnnual, isDomestic, isInternational, isSenior, membershipOptions) {
5387                var retVal = 0;
5388                var curMembership;
5389
5390                if (isInternational) {
5391                    curMembership = membershipOptions.filter(function (o) {
5392                        return o.isInternational === true;
5393                    })[0];
5394                } else {
5395                    curMembership = membershipOptions.filter(function (o) {
5396                        return o.isDomestic === true && o.isAnnual === true && o.isSenior === isSenior;
5397                    })[0];
5398                }
5399
5400                if ($("#DiscountPercentage").val()) {
5401                    var discAnnAmount = Math.round(curMembership.price * parseFloat($("#DiscountPercentage").val()) / 100 * 100) / 100;
5402
5403                    if (isAnnual && curMembership.productCode === $("#DiscountProduct").val()) {
5404                        $("#DiscountAmount").val(discAnnAmount);
5405                        $("#DiscountAmountString").val("-$" + discAnnAmount.toFixed(2));
5406                        $("#renewv2-form-data_summary_discount_amount").html("-$" + discAnnAmount.toFixed(2));
5407                        $("#divSummmaryDiscountDescription").html("Discount");
5408                        $("#DiscountDescription").val("Discount");
5409                        $("#renewv2-form-data_summary_discount_wrapper").show();
5410                        retVal -= discAnnAmount;
5411                    }
5412                    if (isAnnual && curMembership.productCode !== $("#DiscountProduct").val()) {
5413                        $("#DiscountAmount").val(0);
5414                        $("#DiscountAmountString").val("");
5415                        $("#renewv2-form-data_summary_discount_amount").html("");
5416                        $("#divSummmaryDiscountDescription").html("");
5417                        $("#DiscountDescription").val("");
5418                        $("#renewv2-form-data_summary_discount_wrapper").hide();
5419                    }
5420                } else {
5421                    $("#DiscountAmount").val(0);
5422                    $("#DiscountAmountString").val("");
5423                    $("#renewv2-form-data_summary_discount_amount").html("");
5424                    $("#divSummmaryDiscountDescription").html("");
5425                    $("#DiscountDescription").val("");
5426                    $("#renewv2-form-data_summary_discount_wrapper").hide();
5427                }
5428
5429                return retVal;
5430            };
5431
5432            setTotal = function () {
5433                var oldTotal = parseFloat($("#OrderTotal").val());
5434
5435                var membershipOptions = JSON.parse($("#divMembershipOptions").text());
5436                var ppsAnnualOptions = JSON.parse($("#divPpsAnnualOptions").text());
5437                var isDomestic = $("#IsDomestic").val().toUpperCase() === "TRUE";
5438                var isInternational = $("#IsInternational").val().toUpperCase() === "TRUE";
5439                var isSenior = $("#Is75Plus").val().toUpperCase() === "TRUE";
5440                var isAnnual = true;
5441                var isMonthly = false;
5442
5443                var total = 0;
5444                total += setMem(isAnnual, isMonthly, isDomestic, isInternational, isSenior, membershipOptions);
5445                total += setIpf(isDomestic);
5446                total += setAddOn("AddOnPilotPrint");
5447                total += setAddOn("AddOnPilotDigital");
5448                total += setAddOn("AddOnTurbinePilotPrint");
5449                total += setAddOn("AddOnTurbinePilotDigital");
5450                total += setAddOn("AddOnFtPrint");
5451                total += setAddOn("AddOnFtDigital");
5452                total += setIpfAddOn("AddOnPilotPrint", isDomestic);
5453                total += setIpfAddOn("AddOnTurbinePilotPrint", isDomestic);
5454                total += setIpfAddOn("AddOnFtPrint", isDomestic);
5455                total += setPps(ppsAnnualOptions);
5456                setAAR(total);
5457                total += setDiscount(isAnnual, isDomestic, isInternational, isSenior, membershipOptions);
5458                $("#spHeaderPrice").html("$" + total.toFixed(2));
5459
5460                total += setDonation();
5461
5462                $("#renewv2-form-data_summary_total").html("$" + total.toFixed(2));
5463                $("#OrderTotal").val(total);
5464            };
5465
5466            checkCardFields = function () {
5467                var isValid = false;
5468
5469                if ($("#ShowStripeForm").val() === "True") {
5470
5471                    var cardElement = document.querySelector("#card-element");
5472
5473                    isValid = cardElement.classList.contains("StripeElement--complete");
5474
5475                    var brand = $("#CardBrand").val();
5476
5477                    if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
5478                        $("#card-errors").html("");
5479                    } else {
5480                        if ($("#card-errors").is(":empty")) {
5481                            $("#card-errors").html("Please check your credit card information.");
5482                        }
5483                    }
5484                } else {
5485                    isValid = true;
5486                }
5487
5488                return isValid;
5489            };
5490
5491            $(".submitButtonRFV2").click(function () {
5492
5493                var ccValid = checkCardFields();
5494
5495                if (theForm.valid() && ccValid) {
5496
5497                    var progressBar = new Sfpb_progressBar();
5498                    $("#btnRenew").hide();
5499                    $(this).hide();
5500                    $("body").addClass("progressbar-modal");
5501                    progressBar.start();
5502                    $(".clsSubmitButton").append("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
5503
5504                    if ($("#ShowStripeForm").val() === "True") {
5505                        rfStripe.createToken(rfCardElement, { name: $("#CardName").val() }).then(function (result) {
5506                            if (result.token !== null) {
5507                                $("#CardToken").val(JSON.stringify(result.token));
5508                                if (!isDowngrade()) {
5509                                    theForm.submit();
5510                                } else {
5511                                    showAOPAModal("renewalModal");
5512                                }
5513                            } else {
5514                                if ($("#card-errors").is(":empty")) {
5515                                    $("#card-errors").html("Please check your credit card information.");
5516                                }
5517                                var spinner = document.getElementById("aopaSpinner");
5518                                spinner.parentElement.removeChild(spinner);
5519                                $(this).show();
5520                                progressBar.kill();
5521                                $("body").removeClass("progressbar-modal");
5522                                $("#btnRenew").show();
5523                            }
5524                        });
5525                    } else {
5526                        if (!isDowngrade()) {
5527                            theForm.submit();
5528                        } else {
5529                            showAOPAModal("renewalModal");
5530                        }
5531                    }
5532                } else {
5533                    var firstInstance = $(".input-validation-error").first();
5534                    var offsetTop = firstInstance.offset().top - 100;
5535
5536                    $("html, body").animate({
5537                        scrollTop: offsetTop
5538                    }, 500);
5539                }
5540            });
5541        })();
5542    }
5543});
5544
5545},{}],28:[function(require,module,exports){
5546"use strict";
5547
5548$(document).ready(function () {
5549    if ($("#tblAsnResults").length) {
5550        var ct = 0;
5551        $("#tblAsnResults tfoot th").each(function () {
5552            if (ct < 5) {
5553                $(this).html("<div class=\"input-group\"><input type=\"text\" class=\"input-group__input-box\"/></div>");
5554            }
5555            ct++;
5556        });
5557
5558        $.fn.dataTable.ext.classes.sPageButton = "fg-button ui-button ui-state-default";
5559
5560        var resultTable = $("#tblAsnResults").DataTable({
5561            initComplete: function initComplete() {
5562                var r = $("#tblAsnResults tfoot tr");
5563                $("#tblAsnResults thead").append(r);
5564            },
5565            bJQueryUI: true,
5566            pagingType: "simple"
5567        });
5568
5569        resultTable.columns().eq(0).each(function (colIdx) {
5570            $("input", resultTable.column(colIdx).footer()).on("keyup change", function () {
5571                resultTable.column(colIdx).search(this.value).draw();
5572            });
5573        });
5574
5575        $("#btnMainSearch").click(function () {
5576            //resultTable.search($("#inMainSearch").val()).draw();
5577
5578            $("#divErrorMessage").hide();
5579            $("#divSearchResults").hide();
5580            $(".asn-aiport-search-loading").show();
5581
5582            $("#tblAsnResults").DataTable().clear();
5583
5584            var request = "/api/asnairportsearch/Get/?identifier=" + $("#inMainSearchCode").val() + "&city=" + $("#inMainSearchCity").val() + "&state=" + $("#inMainSearchState").val() + "&airportName=" + $("#inMainSearchAirport").val();
5585
5586            $.getJSON(request).done(function (data) {
5587                $.each(data, function (key, item) {
5588                    var volInfo;
5589
5590                    if (!item.displayName) {
5591                        volInfo = "<span class=\"red\">No Volunteer</span>&nbsp;&nbsp;<a href=\"asnnominationform?ap=" + item.airportIdentifier + "\">Sign Up &gt;</a>";
5592                    } else {
5593                        volInfo = item.displayName;
5594                    }
5595
5596                    var conId;
5597
5598                    if (item.contactId !== null && item.contactId !== "") {
5599                        conId = item.contactId;
5600                    } else {
5601                        conId = "0";
5602                    }
5603
5604                    var reportUrl = "<a href=\"" + $("#EmailURL").val() + "?refno=" + conId + "&ap=" + item.airportAccountId + "&apc=" + item.airportIdentifier + "&ch=" + item.hashKey + "\">Contact ASN &gt;</a>";
5605
5606                    $("#tblAsnResults").dataTable().fnAddData([item.airportIdentifier, item.airportCity, item.airportStateShort, item.airportName, volInfo, reportUrl]);
5607                });
5608
5609                $("#divSearchResults").show();
5610                $(".asn-aiport-search-loading").hide();
5611            }).fail(function (jqXHR, textStatus, err) {
5612                $(".asn-aiport-search-loading").hide();
5613                $("#divErrorMessage").html("There was a problem searching the volunteer information...");
5614                $("#divErrorMessage").show();
5615            });
5616        });
5617
5618        $("#inMainSearchCode").keypress(function (event) {
5619            if (event.keyCode === 13) {
5620                $("#btnMainSearch").click();
5621            }
5622        });
5623        $("#inMainSearchCity").keypress(function (event) {
5624            if (event.keyCode === 13) {
5625                $("#btnMainSearch").click();
5626            }
5627        });
5628        $("#inMainSearchState").keypress(function (event) {
5629            if (event.keyCode === 13) {
5630                $("#btnMainSearch").click();
5631            }
5632        });
5633        $("#inMainSearchAirport").keypress(function (event) {
5634            if (event.keyCode === 13) {
5635                $("#btnMainSearch").click();
5636            }
5637        });
5638
5639        $(".asn-aiport-search-loading").hide();
5640        $("#divAsnTable").show();
5641    }
5642
5643    $(".asnMessageButton").click(function () {
5644        var form = $(this).closest("form");
5645        if (form.valid()) {
5646            $(this).hide();
5647            $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
5648        }
5649    });
5650});
5651
5652},{}],29:[function(require,module,exports){
5653"use strict";
5654
5655$(document).ready(function () {
5656    if ($("div#asnNominationForm").length) {
5657        var theForm = $("#frmAsnNomination");
5658
5659        $(".asn-cur-inv").click(function () {
5660            var checkVals = $(".asn-cur-inv:checkbox:checked").map(function () {
5661                return this.dataset.checkValue;
5662            }).get();
5663
5664            $("#CurrentlyInvovledSelected").val(checkVals.join("|"));
5665        });
5666
5667        //$('#AirportAssociationSelected').change(function () {
5668        //    var option = $(this).find('option:selected').val();
5669
5670        //    if (option === "Yes") {
5671        //        $('#divAirportAssociationOther').show();
5672        //    } else {
5673        //        $('#divAirportAssociationOther').hide();
5674        //    }
5675        //});
5676
5677        $(".submitButtonAsnNom").click(function () {
5678            if (theForm.valid()) {
5679                if ($("#TermsAgreed").val() === "AGREED") {
5680                    $("#btnSubmitNomination").hide();
5681                    $(this).hide();
5682                    $(".clsSubmitButton").append("<div class=\"spinner spinner--clockwise\"></div>");
5683                    theForm.submit();
5684                } else {
5685                    LaunchTermsModal();
5686                }
5687            }
5688        });
5689    };
5690});
5691
5692},{}],30:[function(require,module,exports){
5693"use strict";
5694
5695var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
5696
5697var bookmarksController = _interopRequire(require("./controllers/bookmarksController"));
5698
5699(function (angular) {
5700	"use strict";
5701
5702	var bookmarksApp = angular.module("AopaBookmarks", ["ngMaterial"]);
5703
5704	bookmarksApp.controller("bookmarksController", ["$scope", "$http", "$attrs", bookmarksController]);
5705})(window.angular);
5706
5707},{"./controllers/bookmarksController":31}],31:[function(require,module,exports){
5708"use strict";
5709
5710module.exports = bookmarksController;
5711
5712function bookmarksController($scope, $http, $attrs) {
5713
5714	$scope.isMarked = parseInt($attrs.inimarkstate);
5715
5716	$scope.toggleBookmark = function (id) {
5717		$http.post("/api/bookmark/addupdatebookmarks?bookmarkid=" + id).then(function (response) {
5718			if (response) {
5719				$scope.isMarked = response.data.isMarked;
5720			}
5721		}, function (response) {});
5722	};
5723}
5724
5725},{}],32:[function(require,module,exports){
5726"use strict";
5727
5728$(document).ready(function () {
5729    if ($("div#divCFIInformation").length) {
5730        var theForm;
5731        var cfiAutocomplete;
5732        var initAutocomplete;
5733        var clearValidation;
5734        var fixReinstateDate;
5735        var enableSubmitButton;
5736        var disableSubmitButton;
5737
5738        (function () {
5739            var fillInAddress = function () {
5740                // Get the place details from the autocomplete object.
5741                var place = cfiAutocomplete.getPlace();
5742                var address1 = "";
5743                var postcode = "";
5744
5745                $("#MailingStreet").val("");
5746                $("#MailingCity").val("");
5747                $("#MailingStateProvince").val("");
5748                $("#MailingPostalCode").val("");
5749                $("#MailingCountry").val("");
5750
5751                // Get each component of the address from the place details,
5752                // and then fill-in the corresponding field on the form.
5753                // place.address_components are google.maps.GeocoderAddressComponent objects
5754                // which are documented at http://goo.gle/3l5i5Mr
5755                place.address_components.forEach(function (component) {
5756                    var componentType = component.types[0];
5757
5758                    switch (componentType) {
5759                        case "street_number":
5760                            {
5761                                address1 = "" + component.long_name + " " + address1;
5762                                break;
5763                            }
5764
5765                        case "route":
5766                            {
5767                                address1 += component.short_name;
5768                                break;
5769                            }
5770
5771                        case "postal_code":
5772                            {
5773                                postcode = "" + component.long_name + "" + postcode;
5774                                break;
5775                            }
5776
5777                        case "postal_code_suffix":
5778                            {
5779                                postcode = "" + postcode + "-" + component.long_name;
5780                                break;
5781                            }
5782                        case "locality":
5783                            $("#MailingCity").val(component.long_name);
5784                            clearValidation("MailingCity");
5785                            break;
5786                        case "administrative_area_level_1":
5787                            {
5788                                $("#MailingStateProvince").val(component.short_name);
5789                                clearValidation("MailingStateProvince");
5790                                break;
5791                            }
5792                        case "country":
5793                            $("#MailingCountry").val(component.long_name);
5794                            if (component.short_name === "US") {
5795                                $("#rdoMailingCountryUS").prop("checked", true);
5796                                $("#divMailingCountry").hide();
5797                                $("#IsDomestic").val("True");
5798                                $("#IsInternational").val("False");
5799                            } else {
5800                                $("#rdoMailingCountryOther").prop("checked", true);
5801                                $("#divMailingCountry").show();
5802                                $("#IsDomestic").val("False");
5803                                $("#IsInternational").val("True");
5804                                $("#MembershipTerm").val("ANNUAL");
5805                                $("#btnAnnual").removeClass("joinv4-term-button__inactive");
5806                                $("#btnMonthly").addClass("joinv4-term-button__inactive");
5807                            }
5808                            clearValidation("MailingCountry");
5809                            break;
5810
5811                    }
5812                });
5813
5814                $("#MailingStreet").val(address1);
5815                clearValidation("MailingStreet");
5816                $("#MailingPostalCode").val(postcode);
5817                clearValidation("MailingPostalCode");
5818                $("#MailingStreet").focus();
5819                setAAR();
5820                setTotal();
5821            };
5822
5823            var fixOther = function (clear) {
5824                if ($("#FormMode").val() === "EFIRC") {
5825                    if ($("input[name=SelectedCourseReason]:checked").val() === "OTHER") {
5826                        if (clear) {
5827                            $("#CourseReasonOther").val("");
5828                        }
5829                        $("#divOtherReason").css({ visibility: "visible" });
5830                        $("#divOtherReason").css({ display: "block" });
5831                    } else {
5832                        $("#divOtherReason").css({ visibility: "hidden" });
5833                        $("#divOtherReason").css({ display: "none" });
5834                        $("#CourseReasonOther").val("");
5835                    }
5836                }
5837            };
5838
5839            theForm = $("#frmCfiInfoUpdate");
5840
5841            initAutocomplete = function () {
5842                // Create the autocomplete object, restricting the search predictions to
5843                cfiAutocomplete = new google.maps.places.Autocomplete(AddressLookup, {
5844                    fields: ["address_components"],
5845                    types: ["address"] });
5846                // When the user selects an address from the drop-down, populate the
5847                // address fields in the form.
5848                cfiAutocomplete.addListener("place_changed", fillInAddress);
5849            };
5850
5851            initAutocomplete();
5852
5853            ;
5854
5855            clearValidation = function (field) {
5856                var theField = $("#" + field);
5857                if (theField.val()) {
5858                    theField.removeClass("input-validation-error").addClass("val
5858id");
5859                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
5860                    $("span[data-valmsg-for='" + field + "']").empty();
5861                }
5862            };
5863
5864            $("input[type=radio][name=rdoMailingCountry]").change(function () {
5865                if ($("input[name=\"rdoMailingCountry\"]:checked").val() === "US") {
5866                    $("#IsDomestic").val("True");
5867                    $("#IsInternational").val("False");
5868                    $("#divMailingCountry").hide();
5869                    $("#MailingCountry").val("United States");
5870                } else {
5871                    $("#IsDomestic").val("False");
5872                    $("#IsInternational").val("True");
5873                    $("#divMailingCountry").show();
5874                    $("#MailingCountry").val("");
5875                }
5876            });
5877
5878            fixOther(false);
5879
5880            $("input[name=SelectedCourseReason]").on("change", function () {
5881                fixOther(true);
5882                fixReinstateDate();
5883            });
5884
5885            $("#SelectedExpireDateMonth").on("change", function () {
5886                fixReinstateDate();
5887            });
5888
5889            $("#SelectedExpireDateYear").on("change", function () {
5890                fixReinstateDate();
5891            });
5892
5893            fixReinstateDate = function () {
5894                var expYear = parseInt($("#SelectedExpireDateYear").val());
5895                var expMonth = parseInt($("#SelectedExpireDateMonth").val());
5896
5897                if (!isNaN(expYear) && !isNaN(expMonth)) {
5898                    var rinstDate = new Date(expYear * 1, expMonth * 1 + 3, 0);
5899                    rinstDate.setDate(rinstDate.getDate() - 7);
5900
5901                    var month = rinstDate.toLocaleString("en-us", { month: "long" });
5902                    $("#spReinstatementDateString").text(month + " " + rinstDate.getFullYear());
5903
5904                    var checkVals = "FLIGHT_INSTRUCTOR_CERT|PART_141";
5905                    var crSelected = $("input[name=\"SelectedCourseReason\"]:checked").val();
5906
5907                    var now = new Date();
5908                    now.setHours(0, 0, 0, 0);
5909
5910                    if (crSelected && $("#FormMode").val() === "EFIRC" && checkVals.indexOf(crSelected) !== -1 && rinstDate <= now) {
5911                        $("#ShowReinstatementWarning").val("True");
5912                        $("#divReinstatementError").show();
5913                        disableSubmitButton();
5914                    } else {
5915                        $("#ShowReinstatementWarning").val("False");
5916                        $("#divReinstatementError").hide();
5917                        enableSubmitButton();
5918                    }
5919                } else {
5920                    $("#spReinstatementDateString").text("---");
5921                    $("#ShowReinstatementWarning").val("False");
5922                    $("#divReinstatementError").hide();
5923                    enableSubmitButton();
5924                }
5925            };
5926
5927            enableSubmitButton = function () {
5928                $(".formSubmitButtonCFI").removeClass("submit-disable-button");
5929                $(".formSubmitButtonCFI").prop("disabled", false);
5930            };
5931
5932            disableSubmitButton = function () {
5933                $(".formSubmitButtonCFI").addClass("submit-disable-button");
5934                $(".formSubmitButtonCFI").prop("disabled", true);
5935            };
5936
5937            $(".formSubmitButtonCFI").click(function () {
5938                if (theForm.valid()) {
5939                    $("#cancelButton").hide();
5940                    $(this).hide();
5941                    $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
5942                    theForm.submit();
5943                } else {
5944                    var firstInstance = $(".input-validation-error").first();
5945                    var offsetTop = firstInstance.offset().top - 100;
5946
5947                    $("html, body").animate({
5948                        scrollTop: offsetTop
5949                    }, 500);
5950                }
5951            });
5952        })();
5953    }
5954});
5955
5956},{}],33:[function(require,module,exports){
5957"use strict";
5958
5959if (document.getElementsByClassName("comparisonTable").length) {
5960  var tableSelector;
5961  var targetBreakpoint;
5962  var currentVisibleColumn;
5963  var nextButtonText;
5964  var table;
5965  var allCells;
5966  var columnHeaders;
5967  var rowHeaders;
5968  var nextButton;
5969
5970  (function () {
5971    var createButtons = function () {
5972      nextButton.textContent = nextButtonText;
5973      nextButton.style.display = "none";
5974      nextButton.className += "button";
5975
5976      table.parentNode.insertBefore(nextButton, table.nextSibling);
5977
5978      nextButton.addEventListener("click", function () {
5979        currentVisibleColumn = currentVisibleColumn + 1 > columnHeaders.length ? 1 : currentVisibleColumn + 1;
5980        showCurrentlyVisible();
5981      });
5982    };
5983
5984    var showCurrentlyVisible = function () {
5985      // Get the Items we're going to show. The :not(:empty) query here is because sometimes you have empty <th>s in <thead>
5986      var currentlyVisibleColHeader = document.querySelector("thead th:not(:empty):nth-of-type( " + currentVisibleColumn + ")");
5987      var currentlyVisibleCells = document.querySelectorAll("tbody td:nth-of-type(" + currentVisibleColumn + ")");
5988
5989      // Hide All The Cells
5990      for (var i = 0; i < allCells.length; i++) {
5991        allCells[i].style.display = "none";
5992      }
5993
5994      // Show Currently Visible Col Header
5995      currentlyVisibleColHeader.style.display = "block";
5996
5997      // Show Currently Visible Cells
5998      for (var i = 0; i < currentlyVisibleCells.length; i++) {
5999        currentlyVisibleCells[i].style.display = "block";
6000      }
6001
6002      // Show Row Headers
6003      for (var i = 0; i < rowHeaders.length; i++) {
6004        rowHeaders[i].style.display = "block";
6005      }
6006    };
6007
6008    var updateTable = function () {
6009
6010      // Get the Table's Width. Might as well go FULL Container Query over here.
6011      var tableWidth = table.getBoundingClientRect().width;
6012
6013      // If the table explodes off the viewport or is wider than the target breakpoint
6014      if (tableWidth > window.innerWidth || tableWidth < targetBreakpoint) {
6015
6016        if (table.getAttribute("data-comparing") != "active") {
6017
6018          if ($(".comparisonTable").parents(".tab__body").css("display") == "none") {} else {
6019            // Set the comparison state to "Active"
6020            table.setAttribute("data-comparing", "active");
6021
6022            // Show Next Button
6023            nextButton.style.display = "block";
6024
6025            // Show the currently visible column
6026            showCurrentlyVisible();
6027          }
6028        }
6029      } else {
6030
6031        if (table.getAttribute("data-comparing") == "active") {
6032
6033          // Turn off comparing   
6034          table.setAttribute("data-comparing", "");
6035
6036          // Hide the next button
6037          nextButton.style.display = "none";
6038
6039          // Remove styles from all cells, ergo, show all the cells
6040          for (var i = 0; i < allCells.length; i++) {
6041            allCells[i].style.display = "";
6042          }
6043
6044          // Remove styles from all row headers
6045          for (var i = 0; i < rowHeaders.length; i++) {
6046            rowHeaders[i].style.display = "";
6047          }
6048        }
6049      }
6050    };
6051
6052    //Comparison Table Resposive Adjustment
6053
6054    // CONFIGS
6055    tableSelector = "table";
6056    targetBreakpoint = 500;
6057    currentVisibleColumn = 1;
6058    nextButtonText = "Compare Next";
6059
6060    // SETUP/SELECT REUSABLE ELEMENTS
6061    table = document.querySelector(tableSelector);
6062    allCells = table.querySelectorAll("th, td");
6063    columnHeaders = table.querySelectorAll("thead th:not(:empty)");
6064    rowHeaders = table.querySelectorAll("tbody th");
6065    nextButton = document.createElement("button");
6066
6067    createButtons();
6068    updateTable();
6069    window.addEventListener("resize", updateTable);
6070  })();
6071}
6072
6073// don't add the mobile tag for elements hidden in tabs and accordion components
6074
6075},{}],34:[function(require,module,exports){
6076"use strict";
6077
6078$(document).ready(function () {
6079    if ($("div#divAopaContactUsForm").length) {
6080        var theForm = $("#frmContactUs");
6081
6082        $(".submit-contact-us").click(function () {
6083            if (theForm.valid()) {
6084                $("#btnSubmit").hide();
6085                $("#btnReset").hide();
6086                $(this).hide();
6087                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
6088                theForm.submit();
6089            }
6090        });
6091    }
6092});
6093
6094},{}],35:[function(require,module,exports){
6095"use strict";
6096
6097var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
6098
6099var contentWizardController = _interopRequire(require("./controllers/contentWizardController"));
6100
6101(function (angular) {
6102	"use strict";
6103
6104	var contentWizardApp = angular.module("AopaContentWizard", ["ngMaterial"]);
6105
6106	contentWizardApp.controller("contentWizardController", ["$scope", "$http", "$window", contentWizardController]);
6107})(window.angular);
6108
6109},{"./controllers/contentWizardController":36}],36:[function(require,module,exports){
6110"use strict";
6111
6112module.exports = contentWizardController;
6113
6114function contentWizardController($scope, $http, $window) {
6115
6116	/* Get questions from server and reorganize them a little for ease of use */
6117	var iniQuestions = function iniQuestions() {
6118		$http.get("/api/mycontentwizard/GetUserWizardData").then(function (response) {
6119			var data = response.data;
6120			$scope.allData = data;
6121			$scope.page1 = data.wizardSelections.pilotTypeData ? data.wizardSelections.pilotTypeData : {};
6122			$scope.page1.id = "page1";
6123			$scope.page2 = data.wizardSelections.contentSelectionData ? data.wizardSelections.contentSelectionData : {};
6124			$scope.page2.id = "page2";
6125			$scope.page3 = data.wizardSelections.topicsPageData ? data.wizardSelections.topicsPageData : {};
6126			$scope.page3.id = "page3";
6127			$scope.page4 = data.wizardSelections.videoTopicsPageData ? data.wizardSelections.videoTopicsPageData : {};
6128			$scope.page4.id = "page4";
6129			$scope.thanks = data.wizardSelections.lastPageData ? data.wizardSelections.lastPageData : {};
6130			$scope.thanks.id = "thanks";
6131			$scope.bookmarks = data.bookmarks; // Is this needed?  Not seeing it in the tickets
6132			$scope.state = $scope.page1;
6133		}, function (response) {
6134			$scope.error = "There was a problem contacting the server.";
6135		});
6136	};
6137
6138	// Send state back to server
6139	var saveState = function saveState() {
6140		var postObj = $scope.allData;
6141		postObj.wizardSelections.pilotTypeData = $scope.page1;
6142		postObj.wizardSelections.contentSelectionData = $scope.page2;
6143		postObj.wizardSelections.topicsPageData = $scope.page3;
6144		postObj.wizardSelections.videoTopicsPageData = $scope.page4;
6145		postObj.wizardSelections.lastPageData = $scope.thanks;
6146		$http.post("/api/mycontentwizard/UpdateUserWizardData", postObj).then(function (response) {}, function (response) {});
6147	};
6148
6149	/* Ini */
6150	$scope.allData = {};
6151	$scope.page1 = {};
6152	$scope.page2 = {};
6153	$scope.page3 = {};
6154	$scope.page4 = {};
6155	$scope.thanks = {};
6156	$scope.selected = {};
6157	iniQuestions();
6158
6159	$scope.validateAirportCode = function () {
6160		if ($scope.page2.textBasedQuestions[0].answer != "") {
6161			$http.get("/api/AirportFinder/GetAirportByCode?includePrivate=true&code=" + $scope.page2.textBasedQuestions[0].answer).then(function (response) {
6162				if (!response.data) {
6163					alert("Airport ID is not valid. Please enter valid airport ID");
6164				} else {
6165					$scope["continue"]("page3");
6166				}
6167			}, function (response) {
6168				$scope.error = "Airport code not valid";
6169			});
6170		} else {
6171			$scope["continue"]("page3");
6172		}
6173	};
6174
6175	$scope["continue"] = function (next) {
6176		$scope.state = $scope[next];
6177		$window.scrollTo(0, 0);
6178		saveState();
6179	};
6180
6181	$scope.resetAll = function (toReset) {
6182		toReset = toReset.map(function (item) {
6183			item.isSelected = false;
6184			return item;
6185		});
6186	};
6187}
6188
6189},{}],37:[function(require,module,exports){
6190"use strict";
6191
6192$(document).ready(function () {
6193    if ($("div#divCreditCardOfRecordUpdate").length) {
6194
6195        var ccorStripe = Stripe($("#sapik").val());
6196
6197        var ccorElements = ccorStripe.elements();
6198        var ccorStyle = {
6199            base: {
6200                backgroundColor: "#ffffff",
6201                fontSize: "0.9375rem",
6202                fontFamily: "Roboto, Helvetica Neue, sans-serif",
6203                lineHeight: "42px",
6204                ":focus": {
6205                    border: "10px solid black"
6206                }
6207            }
6208        };
6209        var ccorCardNumberElement = ccorElements.create("card", { style: ccorStyle, hidePostalCode: true, disableLink: true });
6210        ccorCardNumberElement.mount("#card-element");
6211
6212        ccorCardNumberElement.on("change", function (event) {
6213            var displayError = document.getElementById("card-errors");
6214            if (event.error) {
6215                displayError.textContent = event.error.message;
6216            } else {
6217                displayError.textContent = "";
6218            }
6219
6220            $("#CardBrand").val(event.brand);
6221        });
6222
6223        var cardElement = document.getElementById("card-element");
6224
6225        var checkCardFields = function () {
6226            var isValid = false;
6227
6228            isValid = cardElement.classList.contains("StripeElement--complete");
6229
6230            var brand = $("#CardBrand").val();
6231
6232            if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
6233                $("#card-errors").html("");
6234            } else {
6235                if ($("#card-errors").is(":empty")) {
6236                    $("#card-errors").html("Please check your credit card information.");
6237                }
6238            }
6239
6240            return isValid;
6241        };
6242
6243        $(".submitButtonCCOR").click(function () {
6244            var theForm = $(this).closest("form");
6245
6246            var ccValid = checkCardFields();
6247
6248            if (theForm.valid() && ccValid) {
6249                $("#btnUpdate").hide();
6250                $(this).hide();
6251                $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
6252
6253                ccorStripe.createToken(ccorCardNumberElement, { name: $("#CardName").val() }).then(function (result) {
6254                    if (result.token !== null) {
6255                        $("#CardToken").val(JSON.stringify(result.token));
6256                        theForm.submit();
6257                    } else {
6258                        if ($("#card-errors").is(":empty")) {
6259                            $("#card-errors").html("Please check your credit card information.");
6260                        }
6261                        var spinner = document.getElementById("aopaSpinner");
6262                        spinner.parentElement.removeChild(spinner);
6263                        $(this).show();
6264                        $("#btnUpdate").show();
6265                    }
6266                });
6267            }
6268        });
6269    }
6270});
6271
6272},{}],38:[function(require,module,exports){
6273/*
6274Custom script for validating CC Expiration Date
6275*/
6276"use strict";
6277
6278(function ($) {
6279    $.validator.addMethod("airportcodecheck", function (value, element, params) {
6280
6281        var result = false;
6282
6283        var data = $.trim(value);
6284
6285        if (data.length > 0) {
6286            if (value.length >= 3) {
6287                $.ajax({
6288                    url: "/api/AirportCodeValidator?airportCode=" + data,
6289                    async: false,
6290                    dataType: "json",
6291                    success: function success(returnData) {
6292                        result = returnData.data;
6293                    }
6294                });
6295            }
6296        } else {
6297            result = true;
6298        }
6299
6300        return result;
6301    });
6302
6303    $.validator.unobtrusive.adapters.addBool("airportcodecheck");
6304})(jQuery);
6305
6306},{}],39:[function(require,module,exports){
6307/*
6308Custom script for required optional validation
6309*/
6310"use strict";
6311
6312(function ($) {
6313    $.validator.addMethod("aopacccheck", function (value, element, params) {
6314        var isRequired = $("#" + params.requiredoptionalfield).val().toUpperCase();
6315
6316        if (isRequired === "TRUE" && value && !value.startsWith(params.bincheck)) {
6317            return false;
6318        }
6319        return true;
6320    });
6321
6322    jQuery.validator.unobtrusive.adapters.add("aopacccheck", ["requiredoptionalfield", "bincheck"], function (options) {
6323        options.rules.aopacccheck = {
6324            requiredoptionalfield: options.params.requiredoptionalfield,
6325            bincheck: options.params.bincheck
6326        };
6327        options.messages.aopacccheck = options.message;
6328    });
6329})(jQuery);
6330
6331},{}],40:[function(require,module,exports){
6332/*
6333Custom script for validating CC Expiration Date
6334*/
6335"use strict";
6336
6337(function ($) {
6338    $.validator.addMethod("asnvolunteercheck", function (value, element, params) {
6339
6340        var result = true;
6341
6342        var doCheck = $("#" + params.checkforexistingfield).val();
6343
6344        var data = $.trim(value);
6345
6346        if (doCheck === "True" && data.length >= 3 && data.length <= 5) {
6347            $.ajax({
6348                url: "/api/asnairportsearch?identifier=" + data,
6349                async: false,
6350                dataType: "json",
6351                success: function success(returnData) {
6352                    if (returnData && returnData.length === 1 && returnData[0].contactId) {
6353                        result = false;
6354                    }
6355                }
6356            });
6357        }
6358
6359        return result;
6360    });
6361
6362    jQuery.validator.unobtrusive.adapters.add("asnvolunteercheck", ["checkforexistingfield"], function (options) {
6363        options.rules.asnvolunteercheck = {
6364            checkforexistingfield: options.params.checkforexistingfield
6365        };
6366        options.messages.asnvolunteercheck = options.message;
6367    });
6368})(jQuery);
6369
6370},{}],41:[function(require,module,exports){
6371/*
6372Custom script for required optional validation
6373*/
6374"use strict";
6375
6376(function ($) {
6377    $.validator.addMethod("attendancecountcheck", function (value, element, params) {
6378
6379        var fValue = parseInt(value, 10);
6380        var oValue = parseInt($("#" + params).val(), 10);
6381
6382        if (fValue !== NaN && oValue !== NaN) {
6383            if (fValue + oValue <= 0) {
6384                return false;
6385            }
6386        } else {
6387            return false;
6388        }
6389
6390        return true;
6391    });
6392
6393    $.validator.unobtrusive.adapters.addSingleVal("attendancecountcheck", "additionalfield");
6394})(jQuery);
6395
6396},{}],42:[function(require,module,exports){
6397/*
6398Custom script for validating CC Expiration Date
6399*/
6400"use strict";
6401
6402(function ($) {
6403    $.validator.addMethod("ccexpdatecheck", function (value, element, params) {
6404        var otherProp = $("#" + params);
6405
6406        if (parseInt(value) == parseInt(new Date().getFullYear())) {
6407            if (parseInt(otherProp.val()) < new Date().getMonth() + 1) {
6408                return false;
6409            }
6410        }
6411        return true;
6412    });
6413
6414    $.validator.unobtrusive.adapters.addSingleVal("ccexpdatecheck", "expiremonth");
6415})(jQuery);
6416
6417},{}],43:[function(require,module,exports){
6418/*
6419Custom script for validating CC Expiration Date
6420*/
6421"use strict";
6422
6423(function ($) {
6424    $.validator.addMethod("ccexpdatechecktwo", function (value, element, params) {
6425
6426        var patt = new RegExp("^[0-1][0-9]/[0-9]{4}$");
6427
6428        if (patt.test(value)) {
6429            var vals = value.split("/");
6430
6431            if (parseInt(vals[1]) >= parseInt(new Date().getFullYear()) && parseInt(vals[0]) >= 1 && parseInt(vals[0]) <= 12) {
6432                if (parseInt(vals[1]) == parseInt(new Date().getFullYear())) {
6433                    if (parseInt(vals[0]) < new Date().getMonth() + 1) {
6434                        return false;
6435                    }
6436                }
6437            } else {
6438                return false;
6439            }
6440        } else {
6441            return false;
6442        }
6443
6444        return true;
6445    });
6446
6447    $.validator.unobtrusive.adapters.addBool("ccexpdatechecktwo");
6448})(jQuery);
6449
6450},{}],44:[function(require,module,exports){
6451/*
6452Custom script for validating CC Expiration Date
6453*/
6454"use strict";
6455
6456(function ($) {
6457    $.validator.addMethod("ccnumbercheck", function (value, element, params) {
6458
6459        var patt = new RegExp("^[2,3,4,5,6].*$");
6460
6461        if (!patt.test(value)) {
6462            return false;
6463        }
6464
6465        return true;
6466    });
6467
6468    $.validator.unobtrusive.adapters.addBool("ccnumbercheck");
6469})(jQuery);
6470
6471},{}],45:[function(require,module,exports){
6472/*
6473Custom script for validating CFI Certificate Number
6474*/
6475"use strict";
6476
6477(function ($) {
6478    $.validator.addMethod("cficertificatenumbercheck", function (value, element, params) {
6479        var crSelected = $("input[name=" + params.coursereason + "]:checked").val();
6480
6481        if (crSelected) {
6482            if (params.requiredreasons.indexOf(crSelected) !== -1) {
6483                if (!value) {
6484                    return false;
6485                }
6486            }
6487        }
6488
6489        return true;
6490    });
6491
6492    jQuery.validator.unobtrusive.adapters.add("cficertificatenumbercheck", ["coursereason", "requiredreasons"], function (options) {
6493        options.rules.cficertificatenumbercheck = {
6494            coursereason: options.params.coursereason,
6495            requiredreasons: options.params.requiredreasons
6496        };
6497        options.messages.cficertificatenumbercheck = options.message;
6498    });
6499})(jQuery);
6500
6501},{}],46:[function(require,module,exports){
6502/*
6503Custom script for validating CFI Expiration Date
6504*/
6505"use strict";
6506
6507(function ($) {
6508    $.validator.addMethod("cfiexpiredatecheck", function (value, element, params) {
6509        var expYear = value;
6510        var expMonth = $("#SelectedExpireDateMonth").val();
6511        var crSelected = $("input[name=" + params.coursereason + "]:checked").val();
6512        var fMode = $("#" + params.formmode).val();
6513
6514        if (fMode === "EFIRC" && crSelected) {
6515            if (params.requiredreasons.indexOf(crSelected) !== -1) {
6516                if (!isNaN(expYear) && !isNaN(expMonth)) {
6517                    var expDate = new Date(expYear * 1, expMonth * 1 + 3, 0);
6518                    expDate.setDate(expDate.getDate() - 7);
6519
6520                    var now = new Date();
6521                    now.setHours(0, 0, 0, 0);
6522                    if (expDate <= now) {
6523                        return false;
6524                    }
6525                } else {
6526                    return false;
6527                }
6528            }
6529        }
6530
6531        return true;
6532    });
6533
6534    jQuery.validator.unobtrusive.adapters.add("cfiexpiredatecheck", ["coursereason", "requiredreasons", "expiremonth", "formmode"], function (options) {
6535        options.rules.cfiexpiredatecheck = {
6536            coursereason: options.params.coursereason,
6537            requiredreasons: options.params.requiredreasons,
6538            expiremonth: options.params.expiremonth,
6539            formmode: options.params.formmode };
6540        options.messages.cfiexpiredatecheck = options.message;
6541    });
6542})(jQuery);
6543
6544},{}],47:[function(require,module,exports){
6545/*
6546Custom script for validating CC Expiration Date
6547*/
6548"use strict";
6549
6550(function ($) {
6551    $.validator.addMethod("aopacheckboxlistreq", function (value, element, params) {
6552
6553        if ($("." + element.id + ":checked").length === 0) {
6554            return false;
6555        }
6556
6557        return true;
6558    });
6559
6560    $.validator.unobtrusive.adapters.addBool("aopacheckboxlistreq");
6561})(jQuery);
6562
6563},{}],48:[function(require,module,exports){
6564"use strict";
6565
6566(function ($) {
6567    $.validator.addMethod("dropdowntextcheck", function (value, element, params) {
6568        var valSelected = $("#" + params.dropdownfield).find("option:selected").val();
6569
6570        if (valSelected === params.dropdownvalue && value === "") {
6571            return false;
6572        }
6573
6574        if (valSelected === params.dropdownvalue && params.datacheck.trim()) {
6575            switch (params.datacheck) {
6576                case "Integer":
6577                    var theMin = parseInt($("#" + params.minimumamountfield).val(), 10);
6578                    var theValue = parseInt(value, 10);
6579
6580                    if (isNaN(theMin) || isNaN(theValue) || theValue.toString() !== value || theMin.toString() !== $("#" + params.minimumamountfield).val() || theValue < theMin) {
6581                        return false;
6582                    }
6583                    break;
6584            }
6585        }
6586
6587        return true;
6588    });
6589
6590    jQuery.validator.unobtrusive.adapters.add("dropdowntextcheck", ["dropdownfield", "dropdownvalue", "datacheck", "minimumamountfield"], function (options) {
6591        options.rules.dropdowntextcheck = {
6592            dropdownfield: options.params.dropdownfield,
6593            dropdownvalue: options.params.dropdownvalue,
6594            datacheck: options.params.datacheck,
6595            minimumamountfield: options.params.minimumamountfield
6596        };
6597        options.messages.dropdowntextcheck = options.message;
6598    });
6599})(jQuery);
6600
6601},{}],49:[function(require,module,exports){
6602/*
6603Custom script for checking if one field or another is filled in
6604*/
6605"use strict";
6606
6607(function ($) {
6608    $.validator.addMethod("eitherorequiredcheck", function (value, element, params) {
6609        var otherField = $("#" + params);
6610
6611        if (!value.length && !otherField.val()) {
6612            return false;
6613        }
6614        return true;
6615    });
6616
6617    $.validator.unobtrusive.adapters.addSingleVal("eitherorequiredcheck", "field2");
6618})(jQuery);
6619
6620},{}],50:[function(require,module,exports){
6621"use strict";
6622
6623(function ($) {
6624    $.validator.addMethod("emailselectioncheck", function (value, element, params) {
6625        var valSelected = $("#" + params.selectfield).find("option:selected").val();
6626
6627        if (!valSelected) {
6628            return true;
6629        }
6630
6631        if (params.emailtype && valSelected === params.emailtype && !value) {
6632            return false;
6633        }
6634
6635        return true;
6636    });
6637
6638    jQuery.validator.unobtrusive.adapters.add("emailselectioncheck", ["selectfield", "emailtype"], function (options) {
6639        options.rules.emailselectioncheck = {
6640            selectfield: options.params.selectfield,
6641            emailtype: options.params.emailtype
6642        };
6643        options.messages.emailselectioncheck = options.message;
6644    });
6645})(jQuery);
6646
6647},{}],51:[function(require,module,exports){
6648/*
6649Custom script for validation not US Address
6650*/
6651"use strict";
6652
6653(function ($) {
6654    $.validator.addMethod("mvcforeignonly", function (value, element, params) {
6655
6656        var testValue = value.toUpperCase().trim();
6657
6658        if (testValue === "UNITED STATES" || testValue === "UNITED STATES OF AMERICA" || testValue === "US" || testValue === "USA" || testValue === "US OF A" || testValue === "AMERICA" || testValue === "ESTADOS UNIDOS" || testValue === "ESTADOS UNIDOS DE AMERICA") {
6659            return false;
6660        }
6661
6662        return true;
6663    });
6664
6665    $.validator.unobtrusive.adapters.addBool("mvcforeignonly");
6666})(jQuery);
6667
6668},{}],52:[function(require,module,exports){
6669/*
6670Custom script for required optional validation
6671*/
6672"use strict";
6673
6674(function ($) {
6675    $.validator.addMethod("optionalselecttwocheck", function (value, element, params) {
6676        var isRequired = $("#" + params).val();
6677
6678        if (isRequired) {
6679            if (!value) {
6680                return false;
6681            }
6682        }
6683        return true;
6684    });
6685
6686    $.validator.unobtrusive.adapters.addSingleVal("optionalselecttwocheck", "textboxfield");
6687})(jQuery);
6688
6689},{}],53:[function(require,module,exports){
6690/*
6691Custom script for required optional validation
6692*/
6693"use strict";
6694
6695(function ($) {
6696    $.validator.addMethod("optionalselectcheck", function (value, element, params) {
6697        var isRequired = $("#" + params).is(":checked");
6698
6699        if (isRequired) {
6700            if (!value) {
6701                return false;
6702            }
6703        }
6704        return true;
6705    });
6706
6707    $.validator.unobtrusive.adapters.addSingleVal("optionalselectcheck", "checkboxfield");
6708})(jQuery);
6709
6710},{}],54:[function(require,module,exports){
6711/*
6712Custom script for validating CC Expiration Date
6713*/
6714"use strict";
6715
6716(function ($) {
6717    $.validator.addMethod("phonenumbercheck", function (value, element, params) {
6718
6719        var patt = new RegExp("^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$");
6720
6721        if (value) {
6722            if (!patt.test(value)) {
6723                return false;
6724            }
6725        }
6726
6727        return true;
6728    });
6729
6730    $.validator.unobtrusive.adapters.addBool("phonenumbercheck");
6731})(jQuery);
6732
6733},{}],55:[function(require,module,exports){
6734"use strict";
6735
6736(function ($) {
6737    $.validator.addMethod("radiotextcheck", function (value, element, params) {
6738
6739        var rdFields = params.radiofield.split(",");
6740        var rv = "";
6741
6742        // Iterate through each value
6743        for (var i = 0; i < rdFields.length; i++) {
6744            if ($("input[name=" + rdFields[i] + "]").is(":checked")) {
6745                if ($("input[name=" + rdFields[i] + "]:checked").val() === params.radiovalue) {
6746                    rv = params.radiovalue;
6747                }
6748            }
6749        }
6750
6751        if (rv === params.radiovalue && value === "") {
6752            return false;
6753        }
6754
6755        if (rv === params.radiovalue && params.datacheck.trim()) {
6756            switch (params.datacheck) {
6757                case "Integer":
6758                    var theMin = parseInt($("#" + params.minimumamountfield).val(), 10);
6759                    var theValue = parseInt(value, 10);
6760
6761                    if (isNaN(theMin) || isNaN(theValue) || theValue.toString() !== value || theMin.toString() !== $("#" + params.minimumamountfield).val() || theValue < theMin) {
6762                        return false;
6763                    }
6764                    break;
6765            }
6766        }
6767
6768        return true;
6769    });
6770
6771    jQuery.validator.unobtrusive.adapters.add("radiotextcheck", ["radiofield", "radiovalue", "datacheck", "minimumamountfield"], function (options) {
6772        options.rules.radiotextcheck = {
6773            radiofield: options.params.radiofield,
6774            radiovalue: options.params.radiovalue,
6775            datacheck: options.params.datacheck,
6776            minimumamountfield: options.params.minimumamountfield
6777        };
6778        options.messages.radiotextcheck = options.message;
6779    });
6780})(jQuery);
6781
6782},{}],56:[function(require,module,exports){
6783"use strict";
6784
6785(function ($) {
6786    $.validator.addMethod("radiotextchecktwo", function (value, element, params) {
6787
6788        var rdFields = params.radiofield.split(",");
6789        var rv = "";
6790
6791        // Iterate through each value
6792        for (var i = 0; i < rdFields.length; i++) {
6793            if ($("input[name=" + rdFields[i] + "]").is(":checked")) {
6794                if ($("input[name=" + rdFields[i] + "]:checked").val() === params.radiovalue) {
6795                    rv = params.radiovalue;
6796                }
6797            }
6798        }
6799
6800        if (rv === params.radiovalue && value === "") {
6801            return false;
6802        }
6803
6804        if (rv === params.radiovalue && params.datacheck.trim()) {
6805            switch (params.datacheck) {
6806                case "Integer":
6807                    var theMin = parseInt($("#" + params.minimumamountfield).val(), 10);
6808                    var theMax = parseInt($("#" + params.maximumamountfield).val(), 10);
6809                    var theValue = parseInt(value, 10);
6810
6811                    if (isNaN(theMin) || isNaN(theValue) || theValue.toString() !== value || theMin.toString() !== $("#" + params.minimumamountfield).val() || theValue < theMin) {
6812                        return false;
6813                    }
6814
6815                    if (isNaN(theMax) || isNaN(theValue) || theValue.toString() !== value || theMax.toString() !== $("#" + params.maximumamountfield).val() || theValue > theMax) {
6816                        return false;
6817                    }
6818                    break;
6819            }
6820        }
6821
6822        return true;
6823    });
6824
6825    jQuery.validator.unobtrusive.adapters.add("radiotextchecktwo", ["radiofield", "radiovalue", "datacheck", "minimumamountfield", "maximumamountfield"], function (options) {
6826        options.rules.radiotextchecktwo = {
6827            radiofield: options.params.radiofield,
6828            radiovalue: options.params.radiovalue,
6829            datacheck: options.params.datacheck,
6830            minimumamountfield: options.params.minimumamountfield,
6831            maximumamountfield: options.params.maximumamountfield
6832        };
6833        options.messages.radiotextchecktwo = options.message;
6834    });
6835})(jQuery);
6836
6837},{}],57:[function(require,module,exports){
6838/*
6839Custom script for required optional validation
6840*/
6841"use strict";
6842
6843(function ($) {
6844    $.validator.addMethod("requiredoptionalcheck", function (value, element, params) {
6845        var isRequired = $("#" + params).val().toUpperCase();
6846
6847        if (isRequired === "TRUE") {
6848            if (!value) {
6849                return false;
6850            }
6851        }
6852        return true;
6853    });
6854
6855    $.validator.unobtrusive.adapters.addSingleVal("requiredoptionalcheck", "requiredoptionalfield");
6856})(jQuery);
6857
6858},{}],58:[function(require,module,exports){
6859/*
6860Custom script for validating Username
6861*/
6862"use strict";
6863
6864(function ($) {
6865    $.validator.addMethod("usernamevalidator", function (value, element, params) {
6866        try {
6867            return true;
6868            //if ( !value ) return false;
6869            //return $.getJSON("/api/UsernameCheck/CheckUsername/?newUsername=" + value + "&mcid=" + mcid);
6870        } catch (e) {
6871            return false;
6872        }
6873    });
6874
6875    $.validator.unobtrusive.adapters.addBool("usernamevalidator");
6876})(jQuery);
6877
6878},{}],59:[function(require,module,exports){
6879"use strict";
6880
6881$(document).ready(function () {
6882    if ($("div#divDonationRailForm").length) {
6883        (function () {
6884            var fixPremiumsDRF = function () {
6885                var $option;
6886                if ($("#HasPremiumsAvailable").val().toUpperCase() === "TRUE" && $("#ShowPremiumList").val().toUpperCase() === "TRUE") {
6887                    if ($("input[name=AcceptPremium]:checked").val() !== "true") {
6888                        $("#divPremium").css({ visibility: "hidden" });
6889                        $("#divPremium").css({ display: "none" });
6890                        $("#SelectedPremiumItem").val($("#SelectedPremiumItem option:last-child").val());
6891                        $("#SelectedPremiumRateCode").empty();
6892                        $option = $("<option />");
6893                        $option.attr("value", "x").text("x");
6894                        $("#SelectedPremiumRateCode").append($option);
6895                        $("#SelectedPremiumRateCode").val("x");
6896                    } else {
6897                        $("#divPremium").css({ visibility: "visible" });
6898                        $("#divPremium").css({ display: "block" });
6899                        $("#SelectedPremiumItem").val("");
6900                        $("#SelectedPremiumRateCode").empty();
6901                        $option = $("<option />");
6902                        $option.attr("value", "").text($("#PremiumRateSelect").val());
6903                        $("#SelectedPremiumRateCode").append($option);
6904                        $("#SelectedPremiumRateCode").val("");
6905                    }
6906                }
6907            };
6908
6909            var calculateTotal = function () {
6910                if ($("#IsPledge").val() === "True") {
6911
6912                    var selectedAmount = 0;
6913                    if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
6914                        var amount = $("input[name=SelectedDonationAmount]:checked").val().split("|");
6915                        selectedAmount = parseFloat(amount[1], 10).toFixed(2);
6916                        $("#DonationTotal").val(parseFloat(amount[1], 10).toFixed(2));
6917                    } else {
6918                        if ($.isNumeric($("#MinimumDonationAmount").val())) {
6919                            selectedAmount = parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2);
6920                            $("#DonationTotal").val(parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2));
6921                        } else {
6922                            selectedAmount = 0;
6923                            $("#DonationTotal").val(0);
6924                        }
6925                    }
6926
6927                    switch ($("input[name=SelectedDonationFrequency]:checked").val()) {
6928                        case "IMMEDIATE":
6929                            $("#PaymentTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
6930                            break;
6931                        case "MONTHLY":
6932                            selectedAmount = selectedAmount / 12;
6933                            $("#PaymentTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
6934                            break;
6935                        case "QUARTERLY":
6936                            selectedAmount = selectedAmount / 4;
6937                            $("#PaymentTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
6938                            break;
6939                    }
6940
6941                    var totaltext = "$" + parseFloat(selectedAmount, 10).toFixed(2).toLocaleString();
6942                    $("#divPaymentAmount").html($.parseHTML(totaltext));
6943                }
6944
6945                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
6946                    var amount = $("input[name=SelectedDonationAmount]:checked").val().split("|");
6947                    $("#DonationTotal").val(parseFloat(amount[1], 10).toFixed(2));
6948                } else {
6949                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
6950                        $("#DonationTotal").val(parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2));
6951                    } else {
6952                        $("#DonationTotal").val(0);
6953                    }
6954                }
6955            };
6956
6957            var appealPremiumsUpdate = function () {
6958                var total = parseFloat($("#DonationTotal").val(), 10);
6959                var hasQualPremiums = false;
6960                var qualVal = 0;
6961
6962                for (var i = 1; i <= 3; i++) {
6963                    if ($("#OfferPremium" + i + "QualValue").val()) {
6964                        qualVal = parseFloat($("#OfferPremium" + i + "QualValue").val(), 10);
6965                        if (qualVal <= total) {
6966                            hasQualPremiums = true;
6967                            $(".divAppealPremiumItem" + i).show();
6968                            $("#OfferPremium" + i + "Show").val("True");
6969                        } else {
6970                            $(".divAppealPremiumItem" + i).hide();
6971                            $("#OfferPremium" + i + "Show").val("False");
6972                        }
6973                    } else {
6974                        $(".divAppealPremiumItem" + i).hide();
6975                        $("#OfferPremium" + i).prop("checked", false);
6976                        $("#OfferPremium" + i + "Show").val("False");
6977                    }
6978                }
6979
6980                if (hasQualPremiums) {
6981                    $(".divAppealPremium").show();
6982                } else {
6983                    $(".divAppealPremium").hide();
6984                }
6985
6986                $("#hasQualifiedOfferPremium").val(hasQualPremiums);
6987            };
6988
6989            if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
6990                $("#divOtherAmount").css({ visibility: "hidden" });
6991                $("#divOtherAmount").css({ display: "none" });
6992            } else {
6993                $("#divOtherAmount").css({ visibility: "visible" });
6994                $("#divOtherAmount").css({ display: "block" });
6995            }
6996
6997            fixPremiumsDRF();
6998
6999            $("input[name=AcceptPremium]").on("change", function () {
7000                fixPremiumsDRF();
7001            });
7002
7003            $("input[name=SelectedDonationAmount]").on("change", function () {
7004                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
7005                    if ($("#MinimumDonationAmount").length) {
7006                        $("#MinimumDonationAmount").val("");
7007                        $("#MinimumDonationAmount").valid();
7008                        $("#MinimumDonationAmount").prop("disabled", true);
7009                        $("#divOtherAmount").css({ visibility: "hidden" });
7010                        $("#divOtherAmount").css({ display: "none" });
7011                    }
7012                } else {
7013                    $("#MinimumDonationAmount").prop("disabled", false);
7014                    $("#divOtherAmount").css({ visibility: "visible" });
7015                    $("#divOtherAmount").css({ display: "block" });
7016                }
7017                calculateTotal();
7018                appealPremiumsUpdate();
7019            });
7020
7021            $("#SelectedPremiumItem").change(function () {
7022                var option = $(this).find("option:selected").val().split("|");
7023                $.getJSON("/api/OneClickPremium/Get/?productId=" + option[0]).done(function (data) {
7024                    $("#SelectedPremiumRateCode").empty();
7025                    var $option = $("<option />");
7026                    $option.attr("value", "").text($("#PremiumRateSelect").val());
7027                    $("#SelectedPremiumRateCode").append($option);
7028                    $.each(data, function (key, item) {
7029                        var $option = $("<option />");
7030                        $option.attr("value", item.value).text(item.text);
7031                        $("#SelectedPremiumRateCode").append($option);
7032                    });
7033                }).fail(function (jqXHR, textStatus, err) {
7034                    $("#SelectedPremiumRateCode").empty();
7035                    var $option = $("<option />");
7036                    $options.attr("value", "").text("- Error -");
7037                    $("#SelectedPremiumRateCode").append($option);
7038                });
7039            });
7040
7041            $("#SelectedCountry").change(function () {
7042                var option = $(this).find("option:selected").val();
7043                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
7044                    $("#SelectedState").empty();
7045                    $.each(data, function (key, item) {
7046                        var $option = $("<option />");
7047                        $option.attr("value", item.value).text(item.text);
7048                        $("#SelectedState").append($option);
7049                    });
7050                }).fail(function (jqXHR, textStatus, err) {
7051                    $("#SelectedState").empty();
7052                    var $option = $("<option />");
7053                    $options.attr("value", "").text("- Error -");
7054                    $("#SelectedState").append($option);
7055                });
7056            });
7057
7058            $(".donateButton").click(function () {
7059                var form = $(this).closest("form");
7060                if (form.valid()) {
7061                    $(this).hide();
7062                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
7063                }
7064            });
7065
7066            $("input[name=SelectedDonationFrequency]").on("change", function () {
7067                calculateTotal();
7068            });
7069
7070            $("input[name=MinimumDonationAmount]").on("change", function () {
7071                if ($("input[name=SelectedDonationAmount]:checked").val() === "OTHER|0") {
7072                    calculateTotal();
7073                    appealPremiumsUpdate();
7074                }
7075            });
7076        })();
7077    }
7078});
7079
7080},{}],60:[function(require,module,exports){
7081"use strict";
7082
7083$(document).ready(function () {
7084    if ($("div#divDonationRsvp").length) {
7085        var d;
7086
7087        (function () {
7088            var calculateTotal = function () {
7089                if ($("#DonationType").val() !== "Pledge") {
7090                    if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
7091                        var amount = $("input[name=SelectedDonationAmount]:checked").val().split("|");
7092                        $("#PaymentTotal").val(parseFloat(amount[1], 10).toFixed(2));
7093                    } else {
7094                        if ($.isNumeric($("#MinimumDonationAmount").val())) {
7095                            $("#PaymentTotal").val(parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2));
7096                        } else {
7097                            $("#PaymentTotal").val(0);
7098                        }
7099                    }
7100                } else {
7101                    var selectedamount = $("input[name=SelectedDonationAmount]:checked").val().split("|")[1];
7102
7103                    switch ($("input[name=SelectedDonationFrequency]:checked").val()) {
7104                        case "IMMEDIATE":
7105                            $("#PaymentTotal").val(parseFloat(selectedamount, 10).toFixed(2));
7106                            break;
7107                        case "MONTHLY":
7108                            selectedamount = selectedamount / 12;
7109                            $("#PaymentTotal").val(parseFloat(selectedamount, 10).toFixed(2));
7110                            break;
7111                        case "QUARTERLY":
7112                            selectedamount = selectedamount / 4;
7113                            $("#PaymentTotal").val(parseFloat(selectedamount, 10).toFixed(2));
7114                            break;
7115                    }
7116
7117                    var totaltext = "$" + parseFloat(selectedamount, 10).toFixed(2).toLocaleStr
7117ing();
7118                    $("#divPaymentAmount").html($.parseHTML(totaltext));
7119                }
7120            };
7121
7122            var fixGuest = function () {
7123                if ($("input[name=SelectedGuestOption]:checked").val() === "YES") {
7124                    $("#GuestFirstName").val("");
7125                    $("#GuestLastName").val("");
7126                    $("#divGuestName").css({ visibility: "visible" });
7127                    $("#divGuestName").css({ display: "block" });
7128                } else {
7129                    $("#divGuestName").css({ visibility: "hidden" });
7130                    $("#divGuestName").css({ display: "none" });
7131                    $("#GuestFirstName").val("abc");
7132                    $("#GuestLastName").val("abc");
7133                }
7134            };
7135
7136            var fixRates = function () {
7137                if ($("input[name=SelectedGuestOption]:checked").val() === "YES") {
7138                    $("#SelectedDonationAmount0").attr("disabled", true);
7139                    $("#SelectedDonationAmount1").prop("checked", true).trigger("change");
7140                    $("#SelectedDonationAmount0").closest("div").hide();
7141                } else {
7142                    $("#SelectedDonationAmount0").attr("disabled", false);
7143                    $("#SelectedDonationAmount0").prop("checked", true).trigger("change");
7144                    $("#SelectedDonationAmount0").closest("div").show();
7145                }
7146            };
7147
7148            fixGuest();
7149            fixRates();
7150
7151            if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
7152                $("#divOtherAmount").css({ visibility: "hidden" });
7153                $("#divOtherAmount").css({ display: "none" });
7154            } else {
7155                $("#divOtherAmount").css({ visibility: "visible" });
7156                $("#divOtherAmount").css({ display: "block" });
7157            }
7158
7159            if ($("input[name=SelectedDonationAmount]:checked").val() === "NONE|0") {
7160                $("#divPaymentInfo").css({ visibility: "hidden" });
7161                $("#divPaymentInfo").css({ display: "none" });
7162                $("#SelectedCreditCardType").val("VISA");
7163                $("#SelectedCreditCardExpMonth").val("12");
7164                d = new Date();
7165
7166                $("#SelectedCreditCardExpYear").val(d.getFullYear() + 5);
7167                $("#CcNumber").val("4111111111111111");
7168                $("#Cvv").val("123");
7169                $("#NameOnCard").val("xxxx");
7170            } else {
7171                $("#SelectedCreditCardType").val("");
7172                $("#SelectedCreditCardExpMonth").val("");
7173                $("#SelectedCreditCardExpYear").val("");
7174                $("#CcNumber").val("");
7175                $("#Cvv").val("");
7176                $("#NameOnCard").val("");
7177                $("#divPaymentInfo").css({ visibility: "visible" });
7178                $("#divPaymentInfo").css({ display: "block" });
7179            }
7180
7181            $(".donateButton").click(function () {
7182                var form = $(this).closest("form");
7183                if (form.valid()) {
7184                    $(this).hide();
7185                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
7186                }
7187            });
7188
7189            $("#SelectedCountry").change(function () {
7190                var option = $(this).find("option:selected").val();
7191                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
7192                    $("#SelectedState").empty();
7193                    $.each(data, function (key, item) {
7194                        var $option = $("<option />");
7195                        $option.attr("value", item.value).text(item.text);
7196                        $("#SelectedState").append($option);
7197                    });
7198                }).fail(function (jqXHR, textStatus, err) {
7199                    $("#SelectedState").empty();
7200                    var $option = $("<option />");
7201                    $options.attr("value", "").text("- Error -");
7202                    $("#SelectedState").append($option);
7203                });
7204            });
7205
7206            $("#KeyCodeEntered").focusout(function () {
7207                $.getJSON("/api/OneClickKeyCode/Get/?keycode=" + $(this).val()).done(function (data) {
7208                    if (data.keyCode) {
7209                        $("#KeyCode").val(data.keyCode);
7210                        $("#ListCode").val(data.listCode);
7211                        $("#MarketCode").val(data.marketCode);
7212                    } else {
7213                        $("#KeyCodeEntered").val($("#UrlKeyCode").val());
7214                        $("#KeyCode").val($("#UrlKeyCode").val());
7215                        $("#ListCode").val($("#UrlListCode").val());
7216                        $("#MarketCode").val($("#UrlMarketCode").val());
7217                    }
7218                }).fail(function (jqXHR, textStatus, err) {
7219                    $("#KeyCodeEntered").val($("#UrlKeyCode").val());
7220                    $("#KeyCode").val($("#UrlKeyCode").val());
7221                    $("#ListCode").val($("#UrlListCode").val());
7222                    $("#MarketCode").val($("#UrlMarketCode").val());
7223                });
7224            });
7225
7226            $("input[name=SelectedDonationAmount]").on("change", function () {
7227                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
7228                    if ($("#MinimumDonationAmount").length) {
7229                        $("#MinimumDonationAmount").val("");
7230                        $("#MinimumDonationAmount").valid();
7231                        $("#MinimumDonationAmount").prop("disabled", true);
7232                        $("#divOtherAmount").css({ visibility: "hidden" });
7233                        $("#divOtherAmount").css({ display: "none" });
7234                    }
7235                } else {
7236                    $("#MinimumDonationAmount").prop("disabled", false);
7237                    $("#divOtherAmount").css({ visibility: "visible" });
7238                    $("#divOtherAmount").css({ display: "block" });
7239                }
7240                if ($("input[name=SelectedDonationAmount]:checked").val() === "NONE|0") {
7241                    $("#divPaymentInfo").css({ visibility: "hidden" });
7242                    $("#divPaymentInfo").css({ display: "none" });
7243                    $("#SelectedCreditCardType").val("VISA");
7244                    $("#SelectedCreditCardExpMonth").val("12");
7245                    var d = new Date();
7246                    $("#SelectedCreditCardExpYear").val(d.getFullYear() + 5);
7247                    $("#CcNumber").val("4111111111111111");
7248                    $("#Cvv").val("123");
7249                    $("#NameOnCard").val("xxxx");
7250                } else {
7251                    $("#SelectedCreditCardType").val("");
7252                    $("#SelectedCreditCardExpMonth").val("");
7253                    $("#SelectedCreditCardExpYear").val("");
7254                    $("#CcNumber").val("");
7255                    $("#Cvv").val("");
7256                    $("#NameOnCard").val("");
7257                    $("#divPaymentInfo").css({ visibility: "visible" });
7258                    $("#divPaymentInfo").css({ display: "block" });
7259                }
7260                calculateTotal();
7261            });
7262
7263            $("input[name=SelectedDonationFrequency]").on("change", function () {
7264                calculateTotal();
7265            });
7266
7267            $("input[name=MinimumDonationAmount]").on("change", function () {
7268                if ($("input[name=SelectedDonationAmount]:checked").val() === "OTHER|0") {
7269                    calculateTotal();
7270                }
7271            });
7272
7273            $("input[name=SelectedGuestOption]").on("change", function () {
7274                fixGuest();
7275                fixRates();
7276            });
7277        })();
7278    }
7279});
7280
7281},{}],61:[function(require,module,exports){
7282"use strict";
7283
7284$(document).ready(function () {
7285    if ($("div#divEFIRCPurchaseForm").length) {
7286        var theForm = $("#frmEFIRCPurchase");
7287
7288        var efStripe = Stripe($("#sapik").val());
7289
7290        var efElements = efStripe.elements();
7291        var efStyle = {
7292            base: {
7293                backgroundColor: "#ffffff",
7294                fontSize: "0.9375rem",
7295                fontFamily: "Roboto, Helvetica Neue, sans-serif",
7296                lineHeight: "42px",
7297                ":focus": {
7298                    border: "10px solid black"
7299                }
7300            }
7301        };
7302        var efCardElement = efElements.create("card", { style: efStyle, hidePostalCode: true, disableLink: true });
7303        efCardElement.mount("#card-element");
7304
7305        efCardElement.on("change", function (event) {
7306            var displayError = document.getElementById("card-errors");
7307            if (event.error) {
7308                displayError.textContent = event.error.message;
7309            } else {
7310                displayError.textContent = "";
7311            }
7312
7313            $("#CardBrand").val(event.brand);
7314        });
7315
7316        var cardElement = document.getElementById("card-element");
7317
7318        var checkCardFields = function () {
7319            var isValid = false;
7320
7321            if ($("#ShowStripeForm").val() === "True") {
7322                var cardElement = document.querySelector("#card-element");
7323
7324                isValid = cardElement.classList.contains("StripeElement--complete");
7325
7326                var brand = $("#CardBrand").val();
7327
7328                if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
7329                    $("#card-errors").html("");
7330                } else {
7331                    if ($("#card-errors").is(":empty")) {
7332                        $("#card-errors").html("Please check your credit card information.");
7333                    }
7334                }
7335            } else {
7336                isValid = true;
7337            }
7338
7339            return isValid;
7340        };
7341
7342        $(".formSubmitButtonEFP").click(function () {
7343            var progressBar = new Sfpb_progressBar();
7344            if (cardElement !== null) {
7345                var ccValid = checkCardFields();
7346
7347                if (theForm.valid() && ccValid) {
7348
7349                    $(this).hide();
7350                    $("body").addClass("progressbar-modal");
7351                    progressBar.start();
7352                    $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
7353
7354                    efStripe.createToken(efCardElement, { name: $("#CardName").val() }).then(function (result) {
7355                        if (result.token !== null) {
7356                            $("#CardToken").val(JSON.stringify(result.token));
7357                            theForm.submit();
7358                        } else {
7359                            if ($("#card-errors").is(":empty")) {
7360                                $("#card-errors").html("Please check your credit card information.");
7361                            }
7362                            var spinner = document.getElementById("aopaSpinner");
7363                            spinner.parentElement.removeChild(spinner);
7364                            progressBar.kill();
7365                            $("body").removeClass("progressbar-modal");
7366                            $(this).show();
7367                        }
7368                    });
7369                }
7370            } else {
7371                if (theForm.valid()) {
7372                    $(this).hide();
7373                    progressBar.start();
7374                    $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
7375                    theForm.submit();
7376                }
7377            }
7378        });
7379    }
7380});
7381
7382},{}],62:[function(require,module,exports){
7383/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
7384* http://trentrichardson.com/examples/timepicker
7385* Copyright (c) 2016 Trent Richardson; Licensed MIT */
7386"use strict";
7387
7388(function (factory) {
7389	if (typeof define === "function" && define.amd) {
7390		define(["jquery", "jquery-ui"], factory);
7391	} else {
7392		factory(jQuery);
7393	}
7394})(function ($) {
7395
7396	/*
7397 * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
7398 */
7399	$.ui.timepicker = $.ui.timepicker || {};
7400	if ($.ui.timepicker.version) {
7401		return;
7402	}
7403
7404	/*
7405 * Extend jQueryUI, get it started with our version number
7406 */
7407	$.extend($.ui, {
7408		timepicker: {
7409			version: "1.6.3"
7410		}
7411	});
7412
7413	/*
7414 * Timepicker manager.
7415 * Use the singleton instance of this class, $.timepicker, to interact with the time picker.
7416 * Settings for (groups of) time pickers are maintained in an instance object,
7417 * allowing multiple different settings on the same page.
7418 */
7419	var Timepicker = function Timepicker() {
7420		this.regional = []; // Available regional settings, indexed by language code
7421		this.regional[""] = { // Default regional settings
7422			currentText: "Now",
7423			closeText: "Done",
7424			amNames: ["AM", "A"],
7425			pmNames: ["PM", "P"],
7426			timeFormat: "HH:mm",
7427			timeSuffix: "",
7428			timeOnlyTitle: "Choose Time",
7429			timeText: "Time",
7430			hourText: "Hour",
7431			minuteText: "Minute",
7432			secondText: "Second",
7433			millisecText: "Millisecond",
7434			microsecText: "Microsecond",
7435			timezoneText: "Time Zone",
7436			isRTL: false
7437		};
7438		this._defaults = { // Global defaults for all the datetime picker instances
7439			showButtonPanel: true,
7440			timeOnly: false,
7441			timeOnlyShowDate: false,
7442			showHour: null,
7443			showMinute: null,
7444			showSecond: null,
7445			showMillisec: null,
7446			showMicrosec: null,
7447			showTimezone: null,
7448			showTime: true,
7449			stepHour: 1,
7450			stepMinute: 1,
7451			stepSecond: 1,
7452			stepMillisec: 1,
7453			stepMicrosec: 1,
7454			hour: 0,
7455			minute: 0,
7456			second: 0,
7457			millisec: 0,
7458			microsec: 0,
7459			timezone: null,
7460			hourMin: 0,
7461			minuteMin: 0,
7462			secondMin: 0,
7463			millisecMin: 0,
7464			microsecMin: 0,
7465			hourMax: 23,
7466			minuteMax: 59,
7467			secondMax: 59,
7468			millisecMax: 999,
7469			microsecMax: 999,
7470			minDateTime: null,
7471			maxDateTime: null,
7472			maxTime: null,
7473			minTime: null,
7474			onSelect: null,
7475			hourGrid: 0,
7476			minuteGrid: 0,
7477			secondGrid: 0,
7478			millisecGrid: 0,
7479			microsecGrid: 0,
7480			alwaysSetTime: true,
7481			separator: " ",
7482			altFieldTimeOnly: true,
7483			altTimeFormat: null,
7484			altSeparator: null,
7485			altTimeSuffix: null,
7486			altRedirectFocus: true,
7487			pickerTimeFormat: null,
7488			pickerTimeSuffix: null,
7489			showTimepicker: true,
7490			timezoneList: null,
7491			addSliderAccess: false,
7492			sliderAccessArgs: null,
7493			controlType: "slider",
7494			oneLine: false,
7495			defaultValue: null,
7496			parse: "strict",
7497			afterInject: null
7498		};
7499		$.extend(this._defaults, this.regional[""]);
7500	};
7501
7502	$.extend(Timepicker.prototype, {
7503		$input: null,
7504		$altInput: null,
7505		$timeObj: null,
7506		inst: null,
7507		hour_slider: null,
7508		minute_slider: null,
7509		second_slider: null,
7510		millisec_slider: null,
7511		microsec_slider: null,
7512		timezone_select: null,
7513		maxTime: null,
7514		minTime: null,
7515		hour: 0,
7516		minute: 0,
7517		second: 0,
7518		millisec: 0,
7519		microsec: 0,
7520		timezone: null,
7521		hourMinOriginal: null,
7522		minuteMinOriginal: null,
7523		secondMinOriginal: null,
7524		millisecMinOriginal: null,
7525		microsecMinOriginal: null,
7526		hourMaxOriginal: null,
7527		minuteMaxOriginal: null,
7528		secondMaxOriginal: null,
7529		millisecMaxOriginal: null,
7530		microsecMaxOriginal: null,
7531		ampm: "",
7532		formattedDate: "",
7533		formattedTime: "",
7534		formattedDateTime: "",
7535		timezoneList: null,
7536		units: ["hour", "minute", "second", "millisec", "microsec"],
7537		support: {},
7538		control: null,
7539
7540		/*
7541  * Override the default settings for all instances of the time picker.
7542  * @param  {Object} settings  object - the new settings to use as defaults (anonymous object)
7543  * @return {Object} the manager object
7544  */
7545		setDefaults: function setDefaults(settings) {
7546			extendRemove(this._defaults, settings || {});
7547			return this;
7548		},
7549
7550		/*
7551  * Create a new Timepicker instance
7552  */
7553		_newInst: function _newInst($input, opts) {
7554			var tp_inst = new Timepicker(),
7555			    inlineSettings = {},
7556			    fns = {},
7557			    overrides,
7558			    i;
7559
7560			for (var attrName in this._defaults) {
7561				if (this._defaults.hasOwnProperty(attrName)) {
7562					var attrValue = $input.attr("time:" + attrName);
7563					if (attrValue) {
7564						try {
7565							inlineSettings[attrName] = eval(attrValue);
7566						} catch (err) {
7567							inlineSettings[attrName] = attrValue;
7568						}
7569					}
7570				}
7571			}
7572
7573			overrides = {
7574				beforeShow: function beforeShow(input, dp_inst) {
7575					if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
7576						return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
7577					}
7578				},
7579				onChangeMonthYear: function onChangeMonthYear(year, month, dp_inst) {
7580					// Update the time as well : this prevents the time from disappearing from the $input field.
7581					// tp_inst._updateDateTime(dp_inst);
7582					if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
7583						tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
7584					}
7585				},
7586				onClose: function onClose(dateText, dp_inst) {
7587					if (tp_inst.timeDefined === true && $input.val() !== "") {
7588						tp_inst._updateDateTime(dp_inst);
7589					}
7590					if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
7591						tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
7592					}
7593				}
7594			};
7595			for (i in overrides) {
7596				if (overrides.hasOwnProperty(i)) {
7597					fns[i] = opts[i] || this._defaults[i] || null;
7598				}
7599			}
7600
7601			tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
7602				evnts: fns,
7603				timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
7604			});
7605			tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
7606				return val.toUpperCase();
7607			});
7608			tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
7609				return val.toUpperCase();
7610			});
7611
7612			// detect which units are supported
7613			tp_inst.support = detectSupport(tp_inst._defaults.timeFormat + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : "") + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ""));
7614
7615			// controlType is string - key to our this._controls
7616			if (typeof tp_inst._defaults.controlType === "string") {
7617				if (tp_inst._defaults.controlType === "slider" && typeof $.ui.slider === "undefined") {
7618					tp_inst._defaults.controlType = "select";
7619				}
7620				tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
7621			}
7622			// controlType is an object and must implement create, options, value methods
7623			else {
7624				tp_inst.control = tp_inst._defaults.controlType;
7625			}
7626
7627			// prep the timezone options
7628			var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
7629			if (tp_inst._defaults.timezoneList !== null) {
7630				timezoneList = tp_inst._defaults.timezoneList;
7631			}
7632			var tzl = timezoneList.length,
7633			    tzi = 0,
7634			    tzv = null;
7635			if (tzl > 0 && typeof timezoneList[0] !== "object") {
7636				for (; tzi < tzl; tzi++) {
7637					tzv = timezoneList[tzi];
7638					timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
7639				}
7640			}
7641			tp_inst._defaults.timezoneList = timezoneList;
7642
7643			// set the default units
7644			tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : new Date().getTimezoneOffset() * -1;
7645			tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
7646			tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
7647			tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
7648			tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
7649			tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
7650			tp_inst.ampm = "";
7651			tp_inst.$input = $input;
7652
7653			if (tp_inst._defaults.altField) {
7654				tp_inst.$altInput = $(tp_inst._defaults.altField);
7655				if (tp_inst._defaults.altRedirectFocus === true) {
7656					tp_inst.$altInput.css({
7657						cursor: "pointer"
7658					}).focus(function () {
7659						$input.trigger("focus");
7660					});
7661				}
7662			}
7663
7664			if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
7665				tp_inst._defaults.minDate = new Date();
7666			}
7667			if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
7668				tp_inst._defaults.maxDate = new Date();
7669			}
7670
7671			// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
7672			if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
7673				tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
7674			}
7675			if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
7676				tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
7677			}
7678			if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
7679				tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
7680			}
7681			if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
7682				tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
7683			}
7684			tp_inst.$input.bind("focus", function () {
7685				tp_inst._onFocus();
7686			});
7687
7688			return tp_inst;
7689		},
7690
7691		/*
7692  * add our sliders to the calendar
7693  */
7694		_addTimePicker: function _addTimePicker(dp_inst) {
7695			var currDT = $.trim(this.$altInput && this._defaults.altFieldTimeOnly ? this.$input.val() + " " + this.$altInput.val() : this.$input.val());
7696
7697			this.timeDefined = this._parseTime(currDT);
7698			this._limitMinMaxDateTime(dp_inst, false);
7699			this._injectTimePicker();
7700			this._afterInject();
7701		},
7702
7703		/*
7704  * parse the time string from input value or _setTime
7705  */
7706		_parseTime: function _parseTime(timeString, withDate) {
7707			if (!this.inst) {
7708				this.inst = $.datepicker._getInst(this.$input[0]);
7709			}
7710
7711			if (withDate || !this._defaults.timeOnly) {
7712				var dp_dateFormat = $.datepicker._get(this.inst, "dateFormat");
7713				try {
7714					var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
7715					if (!parseRes.timeObj) {
7716						return false;
7717					}
7718					$.extend(this, parseRes.timeObj);
7719				} catch (err) {
7720					$.timepicker.log("Error parsing the date/time string: " + err + "\ndate/time string = " + timeString + "\ntimeFormat = " + this._defaults.timeFormat + "\ndateFormat = " + dp_dateFormat);
7721					return false;
7722				}
7723				return true;
7724			} else {
7725				var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
7726				if (!timeObj) {
7727					return false;
7728				}
7729				$.extend(this, timeObj);
7730				return true;
7731			}
7732		},
7733
7734		/*
7735  * Handle callback option after injecting timepicker
7736  */
7737		_afterInject: function _afterInject() {
7738			var o = this.inst.settings;
7739			if ($.isFunction(o.afterInject)) {
7740				o.afterInject.call(this);
7741			}
7742		},
7743
7744		/*
7745  * generate and inject html for timepicker into ui datepicker
7746  */
7747		_injectTimePicker: function _injectTimePicker() {
7748			var $dp = this.inst.dpDiv,
7749			    o = this.inst.settings,
7750			    tp_inst = this,
7751			    litem = "",
7752			    uitem = "",
7753			    show = null,
7754			    max = {},
7755			    gridSize = {},
7756			    size = null,
7757			    i = 0,
7758			    l = 0;
7759
7760			// Prevent displaying twice
7761			if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
7762				var noDisplay = " ui_tpicker_unit_hide",
7763				    html = "<div class=\"ui-timepicker-div" + (o.isRTL ? " ui-timepicker-rtl" : "") + (o.oneLine && o.controlType === "select" ? " ui-timepicker-oneLine" : "") + "\"><dl>" + "<dt class=\"ui_tpicker_time_label" + (o.showTime ? "" : noDisplay) + "\">" + o.timeText + "</dt>" + "<dd class=\"ui_tpicker_time " + (o.showTime ? "" : noDisplay) + "\"><input class=\"ui_tpicker_time_input\" " + (o.timeInput ? "" : "disabled") + "/></dd>";
7764
7765				// Create the markup
7766				for (i = 0, l = this.units.length; i < l; i++) {
7767					litem = this.units[i];
7768					uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
7769					show = o["show" + uitem] !== null ? o["show" + uitem] : this.support[litem];
7770
7771					// Added by Peter Medeiros:
7772					// - Figure out what the hour/minute/second max should be based on the step values.
7773					// - Example: if stepMinute is 15, then minMax is 45.
7774					max[litem] = parseInt(o[litem + "Max"] - (o[litem + "Max"] - o[litem + "Min"]) % o["step" + uitem], 10);
7775					gridSize[litem] = 0;
7776
7777					html += "<dt class=\"ui_tpicker_" + litem + "_label" + (show ? "" : noDisplay) + "\">" + o[litem + "Text"] + "</dt>" + "<dd class=\"ui_tpicker_" + litem + (show ? "" : noDisplay) + "\"><div class=\"ui_tpicker_" + litem + "_slider" + (show ? "" : noDisplay) + "\"></div>";
7778
7779					if (show && o[litem + "Grid"] > 0) {
7780						html += "<div style=\"padding-left: 1px\"><table class=\"ui-tpicker-grid-label\"><tr>";
7781
7782						if (litem === "hour") {
7783							for (var h = o[litem + "Min"]; h <= max[litem]; h += parseInt(o[litem + "Grid"], 10)) {
7784								gridSize[litem]++;
7785								var tmph = $.datepicker.formatTime(this.support.ampm ? "hht" : "HH", { hour: h }, o);
7786								html += "<td data-for=\"" + litem + "\">" + tmph + "</td>";
7787							}
7788						} else {
7789							for (var m = o[litem + "Min"]; m <= max[litem]; m += parseInt(o[litem + "Grid"], 10)) {
7790								gridSize[litem]++;
7791								html += "<td data-for=\"" + litem + "\">" + (m < 10 ? "0" : "") + m + "</td>";
7792							}
7793						}
7794
7795						html += "</tr></table></div>";
7796					}
7797					html += "</dd>";
7798				}
7799
7800				// Timezone
7801				var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
7802				html += "<dt class=\"ui_tpicker_timezone_label" + (showTz ? "" : noDisplay) + "\">" + o.timezoneText + "</dt>";
7803				html += "<dd class=\"ui_tpicker_timezone" + (showTz ? "" : noDisplay) + "\"></dd>";
7804
7805				// Create the elements from string
7806				html += "</dl></div>";
7807				var $tp = $(html);
7808
7809				// if we only want time picker...
7810				if (o.timeOnly === true) {
7811					$tp.prepend("<div class=\"ui-widget-header ui-helper-clearfix ui-corner-all\">" + "<div class=\"ui-datepicker-title\">" + o.timeOnlyTitle + "</div>" + "</div>");
7812					$dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide();
7813				}
7814
7815				// add sliders, adjust grids, add events
7816				for (i = 0, l = tp_inst.units.length; i < l; i++) {
7817					litem = tp_inst.units[i];
7818					uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
7819					show = o["show" + uitem] !== null ? o["show" + uitem] : this.support[litem];
7820
7821					// add the slider
7822					tp_inst[litem + "_slider"] = tp_inst.control.create(tp_inst, $tp.find(".ui_tpicker_" + litem + "_slider"), litem, tp_inst[litem], o[litem + "Min"], max[litem], o["step" + uitem]);
7823
7824					// adjust the grid and add click event
7825					if (show && o[litem + "Grid"] > 0) {
7826						size = 100 * gridSize[litem] * o[litem + "Grid"] / (max[litem] - o[litem + "Min"]);
7827						$tp.find(".ui_tpicker_" + litem + " table").css({
7828							width: size + "%",
7829							marginLeft: o.isRTL ? "0" : size / (-2 * gridSize[litem]) + "%",
7830							marginRight: o.isRTL ? size / (-2 * gridSize[litem]) + "%" : "0",
7831							borderCollapse: "collapse"
7832						}).find("td").click(function (e) {
7833							var $t = $(this),
7834							    h = $t.html(),
7835							    n = parseInt(h.replace(/[^0-9]/g), 10),
7836							    ap = h.replace(/[^apm]/ig),
7837							    f = $t.data("for"); // loses scope, so we use data-for
7838
7839							if (f === "hour") {
7840								if (ap.indexOf("p") !== -1 && n < 12) {
7841									n += 12;
7842								} else {
7843									if (ap.indexOf("a") !== -1 && n === 12) {
7844										n = 0;
7845									}
7846								}
7847							}
7848
7849							tp_inst.control.value(tp_inst, tp_inst[f + "_slider"], litem, n);
7850
7851							tp_inst._onTimeChange();
7852							tp_inst._onSelectHandler();
7853						}).css({
7854							cursor: "pointer",
7855							width: 100 / gridSize[litem] + "%",
7856							textAlign: "center",
7857							overflow: "hidden"
7858						});
7859					} // end if grid > 0
7860				} // end for loop
7861
7862				// Add timezone options
7863				this.timezone_select = $tp.find(".ui_tpicker_timezone").append("<select></select>").find("select");
7864				$.fn.append.apply(this.timezone_select, $.map(o.timezoneList, function (val, idx) {
7865					return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
7866				}));
7867				if (typeof this.timezone !== "undefined" && this.timezone !== null && this.timezone !== "") {
7868					var local_timezone = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12).getTimezoneOffset() * -1;
7869					if (local_timezone === this.timezone) {
7870						selectLocalTimezone(tp_inst);
7871					} else {
7872						this.timezone_select.val(this.timezone);
7873					}
7874				} else {
7875					if (typeof this.hour !== "undefined" && this.hour !== null && this.hour !== "") {
7876						this.timezone_select.val(o.timezone);
7877					} else {
7878						selectLocalTimezone(tp_inst);
7879					}
7880				}
7881				this.timezone_select.change(function () {
7882					tp_inst._onTimeChange();
7883					tp_inst._onSelectHandler();
7884					tp_inst._afterInject();
7885				});
7886				// End timezone options
7887
7888				// inject timepicker into datepicker
7889				var $buttonPanel = $dp.find(".ui-datepicker-buttonpane");
7890				if ($buttonPanel.length) {
7891					$buttonPanel.before($tp);
7892				} else {
7893					$dp.append($tp);
7894				}
7895
7896				this.$timeObj = $tp.find(".ui_tpicker_time_input");
7897				this.$timeObj.change(function () {
7898					var timeFormat = tp_inst.inst.settings.timeFormat;
7899					var parsedTime = $.datepicker.parseTime(timeFormat, this.value);
7900					var update = new Date();
7901					if (parsedTime) {
7902						update.setHours(parsedTime.hour);
7903						update.setMinutes(parsedTime.minute);
7904						update.setSeconds(parsedTime.second);
7905						$.datepicker._setTime(tp_inst.inst, update);
7906					} else {
7907						this.value = tp_inst.formattedTime;
7908						this.blur();
7909					}
7910				});
7911
7912				if (this.inst !== null) {
7913					var timeDefined = this.timeDefined;
7914					this._onTimeChange();
7915					this.timeDefined = timeDefined;
7916				}
7917
7918				// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
7919				if (this._defaults.addSliderAccess) {
7920					var sliderAccessArgs = this._defaults.sliderAccessArgs,
7921					    rtl = this._defaults.isRTL;
7922					sliderAccessArgs.isRTL = rtl;
7923
7924					setTimeout(function () {
7925						// fix for inline mode
7926						if ($tp.find(".ui-slider-access").length === 0) {
7927							$tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);
7928
7929							// fix any grids since sliders are shorter
7930							var sliderAccessWidth = $tp.find(".ui-slider-access:eq(0)").outerWidth(true);
7931							if (sliderAccessWidth) {
7932								$tp.find("table:visible").each(function () {
7933									var $g = $(this),
7934									    oldWidth = $g.outerWidth(),
7935									    oldMarginLeft = $g.css(rtl ? "marginRight" : "marginLeft").toString().replace("%", ""),
7936									    newWidth = oldWidth - sliderAccessWidth,
7937									    newMarginLeft = oldMarginLeft * newWidth / oldWidth + "%",
7938									    css = { width: newWidth, marginRight: 0, marginLeft: 0 };
7939									css[rtl ? "marginRight" : "marginLeft"] = newMarginLeft;
7940									$g.css(css);
7941								});
7942							}
7943						}
7944					}, 10);
7945				}
7946				// end slideAccess integration
7947
7948				tp_inst._limitMinMaxDateTime(this.inst, true);
7949			}
7950		},
7951
7952		/*
7953  * This function tries to limit the ability to go outside the
7954  * min/max date range
7955  */
7956		_limitMinMaxDateTime: function _limitMinMaxDateTime(dp_inst, adjustSliders) {
7957			var o = this._defaults,
7958			    dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
7959
7960			if (!this._defaults.showTimepicker) {
7961				return;
7962			} // No time so nothing to check here
7963
7964			if ($.datepicker._get(dp_inst, "minDateTime") !== null && $.datepicker._get(dp_inst, "minDateTime") !== undefined && dp_date) {
7965				var minDateTime = $.datepicker._get(dp_inst, "minDateTime"),
7966				    minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
7967
7968				if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
7969					this.hourMinOriginal = o.hourMin;
7970					this.minuteMinOriginal = o.minuteMin;
7971					this.secondMinOriginal = o.secondMin;
7972					this.millisecMinOriginal = o.millisecMin;
7973					this.microsecMinOriginal = o.microsecMin;
7974				}
7975
7976				if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
7977					this._defaults.hourMin = minDateTime.getHours();
7978					if (this.hour <= this._defaults.hourMin) {
7979						this.hour = this._defaults.hourMin;
7980						this._defaults.minuteMin = minDateTime.getMinutes();
7981						if (this.minute <= this._defaults.minuteMin) {
7982							this.minute = this._defaults.minuteMin;
7983							this._defaults.secondMin = minDateTime.getSeconds();
7984							if (this.second <= this._defaults.secondMin) {
7985								this.second = this._defaults.secondMin;
7986								this._defaults.millisecMin = minDateTime.getMilliseconds();
7987								if (this.millisec <= this._defaults.millisecMin) {
7988									this.millisec = this._defaults.millisecMin;
7989									this._defaults.microsecMin = minDateTime.getMicroseconds();
7990								} else {
7991									if (this.microsec < this._defaults.microsecMin) {
7992										this.microsec = this._defaults.microsecMin;
7993									}
7994									this._defaults.microsecMin = this.microsecMinOriginal;
7995								}
7996							} else {
7997								this._defaults.millisecMin = this.millisecMinOriginal;
7998								this._defaults.microsecMin = this.microsecMinOriginal;
7999							}
8000						} else {
8001							this._defaults.secondMin = this.secondMinOriginal;
8002							this._defaults.millisecMin = this.millisecMinOriginal;
8003							this._defaults.microsecMin = this.microsecMinOriginal;
8004						}
8005					} else {
8006						this._defaults.minuteMin = this.minuteMinOriginal;
8007						this._defaults.secondMin = this.secondMinOriginal;
8008						this._defaults.millisecMin = this.millisecMinOriginal;
8009						this._defaults.microsecMin = this.microsecMinOriginal;
8010					}
8011				} else {
8012					this._defaults.hourMin = this.hourMinOriginal;
8013					this._defaults.minuteMin = this.minuteMinOriginal;
8014					this._defaults.secondMin = this.secondMinOriginal;
8015					this._defaults.millisecMin = this.millisecMinOriginal;
8016					this._defaults.microsecMin = this.microsecMinOriginal;
8017				}
8018			}
8019
8020			if ($.datepicker._get(dp_inst, "maxDateTime") !== null && $.datepicker._get(dp_inst, "maxDateTime") !== undefined && dp_date) {
8021				var maxDateTime = $.datepicker._get(dp_inst, "maxDateTime"),
8022				    maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
8023
8024				if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
8025					this.hourMaxOriginal = o.hourMax;
8026					this.minuteMaxOriginal = o.minuteMax;
8027					this.secondMaxOriginal = o.secondMax;
8028					this.millisecMaxOriginal = o.millisecMax;
8029					this.microsecMaxOriginal = o.microsecMax;
8030				}
8031
8032				if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
8033					this._defaults.hourMax = maxDateTime.getHours();
8034					if (this.hour >= this._defaults.hourMax) {
8035						this.hour = this._defaults.hourMax;
8036						this._defaults.minuteMax = maxDateTime.getMinutes();
8037						if (this.minute >= this._defaults.minuteMax) {
8038							this.minute = this._defaults.minuteMax;
8039							this._defaults.secondMax = maxDateTime.getSeconds();
8040							if (this.second >= this._defaults.secondMax) {
8041								this.second = this._defaults.secondMax;
8042								this._defaults.millisecMax = maxDateTime.getMilliseconds();
8043								if (this.millisec >= this._defaults.millisecMax) {
8044									this.millisec = this._defaults.millisecMax;
8045									this._defaults.microsecMax = maxDateTime.getMicroseconds();
8046								} else {
8047									if (this.microsec > this._defaults.microsecMax) {
8048										this.microsec = this._defaults.microsecMax;
8049									}
8050									this._defaults.microsecMax = this.microsecMaxOriginal;
8051								}
8052							} else {
8053								this._defaults.millisecMax = this.millisecMaxOriginal;
8054								this._defaults.microsecMax = this.microsecMaxOriginal;
8055							}
8056						} else {
8057							this._defaults.secondMax = this.secondMaxOriginal;
8058							this._defaults.millisecMax = this.millisecMaxOriginal;
8059							this._defaults.microsecMax = this.microsecMaxOriginal;
8060						}
8061					} else {
8062						this._defaults.minuteMax = this.minuteMaxOriginal;
8063						this._defaults.secondMax = this.secondMaxOriginal;
8064						this._defaults.millisecMax = this.millisecMaxOriginal;
8065						this._defaults.microsecMax = this.microsecMaxOriginal;
8066					}
8067				} else {
8068					this._defaults.hourMax = this.hourMaxOriginal;
8069					this._defaults.minuteMax = this.minuteMaxOriginal;
8070					this._defaults.secondMax = this.secondMaxOriginal;
8071					this._defaults.millisecMax = this.millisecMaxOriginal;
8072					this._defaults.microsecMax = this.microsecMaxOriginal;
8073				}
8074			}
8075
8076			if (dp_inst.settings.minTime !== null) {
8077				var tempMinTime = new Date("01/01/1970 " + dp_inst.settings.minTime);
8078				if (this.hour < tempMinTime.getHours()) {
8079					this.hour = this._defaults.hourMin = tempMinTime.getHours();
8080					this.minute = this._defaults.minuteMin = tempMinTime.getMinutes();
8081				} else if (this.hour === tempMinTime.getHours() && this.minute < tempMinTime.getMinutes()) {
8082					this.minute = this._defaults.minuteMin = tempMinTime.getMinutes();
8083				} else {
8084					if (this._defaults.hourMin < tempMinTime.getHours()) {
8085						this._defaults.hourMin = tempMinTime.getHours();
8086						this._defaults.minuteMin = tempMinTime.getMinutes();
8087					} else if (this._defaults.hourMin === tempMinTime.getHours() === this.hour && this._defaults.minuteMin < tempMinTime.getMinutes()) {
8088						this._defaults.minuteMin = tempMinTime.getMinutes();
8089					} else {
8090						this._defaults.minuteMin = 0;
8091					}
8092				}
8093			}
8094
8095			if (dp_inst.settings.maxTime !== null) {
8096				var tempMaxTime = new Date("01/01/1970 " + dp_inst.settings.maxTime);
8097				if (this.hour > tempMaxTime.getHours()) {
8098					this.hour = this._defaults.hourMax = tempMaxTime.getHours();
8099					this.minute = this._defaults.minuteMax = tempMaxTime.getMinutes();
8100				} else if (this.hour === tempMaxTime.getHours() && this.minute > tempMaxTime.getMinutes()) {
8101					this.minute = this._defaults.minuteMax = tempMaxTime.getMinutes();
8102				} else {
8103					if (this._defaults.hourMax > tempMaxTime.getHours()) {
8104						this._defaults.hourMax = tempMaxTime.getHours();
8105						this._defaults.minuteMax = tempMaxTime.getMinutes();
8106					} else if (this._defaults.hourMax === tempMaxTime.getHours() === this.hour && this._defaults.minuteMax > tempMaxTime.getMinutes()) {
8107						this._defaults.minuteMax = tempMaxTime.getMinutes();
8108					} else {
8109						this._defaults.minuteMax = 59;
8110					}
8111				}
8112			}
8113
8114			if (adjustSliders !== undefined && adjustSliders === true) {
8115				var hourMax = parseInt(this._defaults.hourMax - (this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour, 10),
8116				    minMax = parseInt(this._defaults.minuteMax - (this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute, 10),
8117				    secMax = parseInt(this._defaults.secondMax - (this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond, 10),
8118				    millisecMax = parseInt(this._defaults.millisecMax - (this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec, 10),
8119				    microsecMax = parseInt(this._defaults.microsecMax - (this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec, 10);
8120
8121				if (this.hour_slider) {
8122					this.control.options(this, this.hour_slider, "hour", { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });
8123					this.control.value(this, this.hour_slider, "hour", this.hour - this.hour % this._defaults.stepHour);
8124				}
8125				if (this.minute_slider) {
8126					this.control.options(this, this.minute_slider, "minute", { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });
8127					this.control.value(this, this.minute_slider, "minute", this.minute - this.minute % this._defaults.stepMinute);
8128				}
8129				if (this.second_slider) {
8130					this.control.options(this, this.second_slider, "second", { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });
8131					this.control.value(this, this.second_slider, "second", this.second - this.second % this._defaults.stepSecond);
8132				}
8133				if (this.millisec_slider) {
8134					this.control.options(this, this.millisec_slider, "millisec", { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });
8135					this.control.value(this, this.millisec_slider, "millisec", this.millisec - this.millisec % this._defaults.stepMillisec);
8136				}
8137				if (this.microsec_slider) {
8138					this.control.options(this, this.microsec_slider, "microsec", { min: this._defaults.microsec
8138Min, max: microsecMax, step: this._defaults.stepMicrosec });
8139					this.control.value(this, this.microsec_slider, "microsec", this.microsec - this.microsec % this._defaults.stepMicrosec);
8140				}
8141			}
8142		},
8143
8144		/*
8145  * when a slider moves, set the internal time...
8146  * on time change is also called when the time is updated in the text field
8147  */
8148		_onTimeChange: function _onTimeChange() {
8149			if (!this._defaults.showTimepicker) {
8150				return;
8151			}
8152			var hour = this.hour_slider ? this.control.value(this, this.hour_slider, "hour") : false,
8153			    minute = this.minute_slider ? this.control.value(this, this.minute_slider, "minute") : false,
8154			    second = this.second_slider ? this.control.value(this, this.second_slider, "second") : false,
8155			    millisec = this.millisec_slider ? this.control.value(this, this.millisec_slider, "millisec") : false,
8156			    microsec = this.microsec_slider ? this.control.value(this, this.microsec_slider, "microsec") : false,
8157			    timezone = this.timezone_select ? this.timezone_select.val() : false,
8158			    o = this._defaults,
8159			    pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
8160			    pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
8161
8162			if (typeof hour === "object") {
8163				hour = false;
8164			}
8165			if (typeof minute === "object") {
8166				minute = false;
8167			}
8168			if (typeof second === "object") {
8169				second = false;
8170			}
8171			if (typeof millisec === "object") {
8172				millisec = false;
8173			}
8174			if (typeof microsec === "object") {
8175				microsec = false;
8176			}
8177			if (typeof timezone === "object") {
8178				timezone = false;
8179			}
8180
8181			if (hour !== false) {
8182				hour = parseInt(hour, 10);
8183			}
8184			if (minute !== false) {
8185				minute = parseInt(minute, 10);
8186			}
8187			if (second !== false) {
8188				second = parseInt(second, 10);
8189			}
8190			if (millisec !== false) {
8191				millisec = parseInt(millisec, 10);
8192			}
8193			if (microsec !== false) {
8194				microsec = parseInt(microsec, 10);
8195			}
8196			if (timezone !== false) {
8197				timezone = timezone.toString();
8198			}
8199
8200			var ampm = o[hour < 12 ? "amNames" : "pmNames"][0];
8201
8202			// If the update was done in the input field, the input field should not be updated.
8203			// If the update was done using the sliders, update the input field.
8204			var hasChanged = hour !== parseInt(this.hour, 10) || // sliders should all be numeric
8205			minute !== parseInt(this.minute, 10) || second !== parseInt(this.second, 10) || millisec !== parseInt(this.millisec, 10) || microsec !== parseInt(this.microsec, 10) || this.ampm.length > 0 && hour < 12 !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1) || this.timezone !== null && timezone !== this.timezone.toString() // could be numeric or "EST" format, so use toString()
8206			;
8207
8208			if (hasChanged) {
8209
8210				if (hour !== false) {
8211					this.hour = hour;
8212				}
8213				if (minute !== false) {
8214					this.minute = minute;
8215				}
8216				if (second !== false) {
8217					this.second = second;
8218				}
8219				if (millisec !== false) {
8220					this.millisec = millisec;
8221				}
8222				if (microsec !== false) {
8223					this.microsec = microsec;
8224				}
8225				if (timezone !== false) {
8226					this.timezone = timezone;
8227				}
8228
8229				if (!this.inst) {
8230					this.inst = $.datepicker._getInst(this.$input[0]);
8231				}
8232
8233				this._limitMinMaxDateTime(this.inst, true);
8234			}
8235			if (this.support.ampm) {
8236				this.ampm = ampm;
8237			}
8238
8239			// Updates the time within the timepicker
8240			this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
8241			if (this.$timeObj) {
8242				if (pickerTimeFormat === o.timeFormat) {
8243					this.$timeObj.val(this.formattedTime + pickerTimeSuffix);
8244				} else {
8245					this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
8246				}
8247				if (this.$timeObj[0].setSelectionRange) {
8248					var sPos = this.$timeObj[0].selectionStart;
8249					var ePos = this.$timeObj[0].selectionEnd;
8250					this.$timeObj[0].setSelectionRange(sPos, ePos);
8251				}
8252			}
8253
8254			this.timeDefined = true;
8255			if (hasChanged) {
8256				this._updateDateTime();
8257				//this.$input.focus(); // may automatically open the picker on setDate
8258			}
8259		},
8260
8261		/*
8262  * call custom onSelect.
8263  * bind to sliders slidestop, and grid click.
8264  */
8265		_onSelectHandler: function _onSelectHandler() {
8266			var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
8267			var inputEl = this.$input ? this.$input[0] : null;
8268			if (onSelect && inputEl) {
8269				onSelect.apply(inputEl, [this.formattedDateTime, this]);
8270			}
8271		},
8272
8273		/*
8274  * update our input with the new date time..
8275  */
8276		_updateDateTime: function _updateDateTime(dp_inst) {
8277			dp_inst = this.inst || dp_inst;
8278			var dtTmp = dp_inst.currentYear > 0 ? new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) : new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay),
8279			    dt = $.datepicker._daylightSavingAdjust(dtTmp),
8280			   
8281			//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
8282			//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
8283			dateFmt = $.datepicker._get(dp_inst, "dateFormat"),
8284			    formatCfg = $.datepicker._getFormatConfig(dp_inst),
8285			    timeAvailable = dt !== null && this.timeDefined;
8286			this.formattedDate = $.datepicker.formatDate(dateFmt, dt === null ? new Date() : dt, formatCfg);
8287			var formattedDateTime = this.formattedDate;
8288
8289			// if a slider was changed but datepicker doesn't have a value yet, set it
8290			if (dp_inst.lastVal === "") {
8291				dp_inst.currentYear = dp_inst.selectedYear;
8292				dp_inst.currentMonth = dp_inst.selectedMonth;
8293				dp_inst.currentDay = dp_inst.selectedDay;
8294			}
8295
8296			/*
8297   * remove following lines to force every changes in date picker to change the input value
8298   * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
8299   * If the user manually empty the value in the input field, the date picker will never change selected value.
8300   */
8301			//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
8302			//	return;
8303			//}
8304
8305			if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
8306				formattedDateTime = this.formattedTime;
8307			} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable) || this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true) {
8308				formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
8309			}
8310
8311			this.formattedDateTime = formattedDateTime;
8312
8313			if (!this._defaults.showTimepicker) {
8314				this.$input.val(this.formattedDate);
8315			} else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
8316				this.$altInput.val(this.formattedTime);
8317				this.$input.val(this.formattedDate);
8318			} else if (this.$altInput) {
8319				this.$input.val(formattedDateTime);
8320				var altFormattedDateTime = "",
8321				    altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
8322				    altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
8323
8324				if (!this._defaults.timeOnly) {
8325					if (this._defaults.altFormat) {
8326						altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, dt === null ? new Date() : dt, formatCfg);
8327					} else {
8328						altFormattedDateTime = this.formattedDate;
8329					}
8330
8331					if (altFormattedDateTime) {
8332						altFormattedDateTime += altSeparator;
8333					}
8334				}
8335
8336				if (this._defaults.altTimeFormat !== null) {
8337					altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
8338				} else {
8339					altFormattedDateTime += this.formattedTime + altTimeSuffix;
8340				}
8341				this.$altInput.val(altFormattedDateTime);
8342			} else {
8343				this.$input.val(formattedDateTime);
8344			}
8345
8346			this.$input.trigger("change");
8347		},
8348
8349		_onFocus: function _onFocus() {
8350			if (!this.$input.val() && this._defaults.defaultValue) {
8351				this.$input.val(this._defaults.defaultValue);
8352				var inst = $.datepicker._getInst(this.$input.get(0)),
8353				    tp_inst = $.datepicker._get(inst, "timepicker");
8354				if (tp_inst) {
8355					if (tp_inst._defaults.timeOnly && inst.input.val() !== inst.lastVal) {
8356						try {
8357							$.datepicker._updateDatepicker(inst);
8358						} catch (err) {
8359							$.timepicker.log(err);
8360						}
8361					}
8362				}
8363			}
8364		},
8365
8366		/*
8367  * Small abstraction to control types
8368  * We can add more, just be sure to follow the pattern: create, options, value
8369  */
8370		_controls: {
8371			// slider methods
8372			slider: {
8373				create: function create(tp_inst, obj, unit, val, min, max, step) {
8374					var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
8375					return obj.prop("slide", null).slider({
8376						orientation: "horizontal",
8377						value: rtl ? val * -1 : val,
8378						min: rtl ? max * -1 : min,
8379						max: rtl ? min * -1 : max,
8380						step: step,
8381						slide: function slide(event, ui) {
8382							tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
8383							tp_inst._onTimeChange();
8384						},
8385						stop: function stop(event, ui) {
8386							tp_inst._onSelectHandler();
8387						}
8388					});
8389				},
8390				options: function options(tp_inst, obj, unit, opts, val) {
8391					if (tp_inst._defaults.isRTL) {
8392						if (typeof opts === "string") {
8393							if (opts === "min" || opts === "max") {
8394								if (val !== undefined) {
8395									return obj.slider(opts, val * -1);
8396								}
8397								return Math.abs(obj.slider(opts));
8398							}
8399							return obj.slider(opts);
8400						}
8401						var min = opts.min,
8402						    max = opts.max;
8403						opts.min = opts.max = null;
8404						if (min !== undefined) {
8405							opts.max = min * -1;
8406						}
8407						if (max !== undefined) {
8408							opts.min = max * -1;
8409						}
8410						return obj.slider(opts);
8411					}
8412					if (typeof opts === "string" && val !== undefined) {
8413						return obj.slider(opts, val);
8414					}
8415					return obj.slider(opts);
8416				},
8417				value: function value(tp_inst, obj, unit, val) {
8418					if (tp_inst._defaults.isRTL) {
8419						if (val !== undefined) {
8420							return obj.slider("value", val * -1);
8421						}
8422						return Math.abs(obj.slider("value"));
8423					}
8424					if (val !== undefined) {
8425						return obj.slider("value", val);
8426					}
8427					return obj.slider("value");
8428				}
8429			},
8430			// select methods
8431			select: {
8432				create: function create(tp_inst, obj, unit, val, min, max, step) {
8433					var sel = "<select class=\"ui-timepicker-select ui-state-default ui-corner-all\" data-unit=\"" + unit + "\" data-min=\"" + min + "\" data-max=\"" + max + "\" data-step=\"" + step + "\">",
8434					    format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
8435
8436					for (var i = min; i <= max; i += step) {
8437						sel += "<option value=\"" + i + "\"" + (i === val ? " selected" : "") + ">";
8438						if (unit === "hour") {
8439							sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, "")), { hour: i }, tp_inst._defaults);
8440						} else if (unit === "millisec" || unit === "microsec" || i >= 10) {
8441							sel += i;
8442						} else {
8443							sel += "0" + i.toString();
8444						}
8445						sel += "</option>";
8446					}
8447					sel += "</select>";
8448
8449					obj.children("select").remove();
8450
8451					$(sel).appendTo(obj).change(function (e) {
8452						tp_inst._onTimeChange();
8453						tp_inst._onSelectHandler();
8454						tp_inst._afterInject();
8455					});
8456
8457					return obj;
8458				},
8459				options: function options(tp_inst, obj, unit, opts, val) {
8460					var o = {},
8461					    $t = obj.children("select");
8462					if (typeof opts === "string") {
8463						if (val === undefined) {
8464							return $t.data(opts);
8465						}
8466						o[opts] = val;
8467					} else {
8468						o = opts;
8469					}
8470					return tp_inst.control.create(tp_inst, obj, $t.data("unit"), $t.val(), o.min >= 0 ? o.min : $t.data("min"), o.max || $t.data("max"), o.step || $t.data("step"));
8471				},
8472				value: function value(tp_inst, obj, unit, val) {
8473					var $t = obj.children("select");
8474					if (val !== undefined) {
8475						return $t.val(val);
8476					}
8477					return $t.val();
8478				}
8479			}
8480		} // end _controls
8481
8482	});
8483
8484	$.fn.extend({
8485		/*
8486  * shorthand just to use timepicker.
8487  */
8488		timepicker: function timepicker(o) {
8489			o = o || {};
8490			var tmp_args = Array.prototype.slice.call(arguments);
8491
8492			if (typeof o === "object") {
8493				tmp_args[0] = $.extend(o, {
8494					timeOnly: true
8495				});
8496			}
8497
8498			return $(this).each(function () {
8499				$.fn.datetimepicker.apply($(this), tmp_args);
8500			});
8501		},
8502
8503		/*
8504  * extend timepicker to datepicker
8505  */
8506		datetimepicker: function datetimepicker(o) {
8507			o = o || {};
8508			var tmp_args = arguments;
8509
8510			if (typeof o === "string") {
8511				if (o === "getDate" || o === "option" && tmp_args.length === 2 && typeof tmp_args[1] === "string") {
8512					return $.fn.datepicker.apply($(this[0]), tmp_args);
8513				} else {
8514					return this.each(function () {
8515						var $t = $(this);
8516						$t.datepicker.apply($t, tmp_args);
8517					});
8518				}
8519			} else {
8520				return this.each(function () {
8521					var $t = $(this);
8522					$t.datepicker($.timepicker._newInst($t, o)._defaults);
8523				});
8524			}
8525		}
8526	});
8527
8528	/*
8529 * Public Utility to parse date and time
8530 */
8531	$.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
8532		var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
8533		if (parseRes.timeObj) {
8534			var t = parseRes.timeObj;
8535			parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
8536			parseRes.date.setMicroseconds(t.microsec);
8537		}
8538
8539		return parseRes.date;
8540	};
8541
8542	/*
8543 * Public utility to parse time
8544 */
8545	$.datepicker.parseTime = function (timeFormat, timeString, options) {
8546		var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
8547		    iso8601 = timeFormat.replace(/\'.*?\'/g, "").indexOf("Z") !== -1;
8548
8549		// Strict parse requires the timeString to match the timeFormat exactly
8550		var strictParse = function strictParse(f, s, o) {
8551
8552			// pattern for standard and localized AM/PM markers
8553			var getPatternAmpm = function getPatternAmpm(amNames, pmNames) {
8554				var markers = [];
8555				if (amNames) {
8556					$.merge(markers, amNames);
8557				}
8558				if (pmNames) {
8559					$.merge(markers, pmNames);
8560				}
8561				markers = $.map(markers, function (val) {
8562					return val.replace(/[.*+?|()\[\]{}\\]/g, "\\$&");
8563				});
8564				return "(" + markers.join("|") + ")?";
8565			};
8566
8567			// figure out position of time elements.. cause js cant do named captures
8568			var getFormatPositions = function getFormatPositions(timeFormat) {
8569				var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),
8570				    orders = {
8571					h: -1,
8572					m: -1,
8573					s: -1,
8574					l: -1,
8575					c: -1,
8576					t: -1,
8577					z: -1
8578				};
8579
8580				if (finds) {
8581					for (var i = 0; i < finds.length; i++) {
8582						if (orders[finds[i].toString().charAt(0)] === -1) {
8583							orders[finds[i].toString().charAt(0)] = i + 1;
8584						}
8585					}
8586				}
8587				return orders;
8588			};
8589
8590			var regstr = "^" + f.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
8591				var ml = match.length;
8592				switch (match.charAt(0).toLowerCase()) {
8593					case "h":
8594						return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
8595					case "m":
8596						return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
8597					case "s":
8598						return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
8599					case "l":
8600						return "(\\d?\\d?\\d)";
8601					case "c":
8602						return "(\\d?\\d?\\d)";
8603					case "z":
8604						return "(z|[-+]\\d\\d:?\\d\\d|\\S+)?";
8605					case "t":
8606						return getPatternAmpm(o.amNames, o.pmNames);
8607					default:
8608						// literal escaped in quotes
8609						return "(" + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) {
8610							return "\\" + m;
8611						}) + ")?";
8612				}
8613			}).replace(/\s/g, "\\s?") + o.timeSuffix + "$",
8614			    order = getFormatPositions(f),
8615			    ampm = "",
8616			    treg;
8617
8618			treg = s.match(new RegExp(regstr, "i"));
8619
8620			var resTime = {
8621				hour: 0,
8622				minute: 0,
8623				second: 0,
8624				millisec: 0,
8625				microsec: 0
8626			};
8627
8628			if (treg) {
8629				if (order.t !== -1) {
8630					if (treg[order.t] === undefined || treg[order.t].length === 0) {
8631						ampm = "";
8632						resTime.ampm = "";
8633					} else {
8634						ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x, i) {
8635							return x.toUpperCase();
8636						})) !== -1 ? "AM" : "PM";
8637						resTime.ampm = o[ampm === "AM" ? "amNames" : "pmNames"][0];
8638					}
8639				}
8640
8641				if (order.h !== -1) {
8642					if (ampm === "AM" && treg[order.h] === "12") {
8643						resTime.hour = 0; // 12am = 0 hour
8644					} else {
8645						if (ampm === "PM" && treg[order.h] !== "12") {
8646							resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
8647						} else {
8648							resTime.hour = Number(treg[order.h]);
8649						}
8650					}
8651				}
8652
8653				if (order.m !== -1) {
8654					resTime.minute = Number(treg[order.m]);
8655				}
8656				if (order.s !== -1) {
8657					resTime.second = Number(treg[order.s]);
8658				}
8659				if (order.l !== -1) {
8660					resTime.millisec = Number(treg[order.l]);
8661				}
8662				if (order.c !== -1) {
8663					resTime.microsec = Number(treg[order.c]);
8664				}
8665				if (order.z !== -1 && treg[order.z] !== undefined) {
8666					resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);
8667				}
8668
8669				return resTime;
8670			}
8671			return false;
8672		}; // end strictParse
8673
8674		// First try JS Date, if that fails, use strictParse
8675		var looseParse = function looseParse(f, s, o) {
8676			try {
8677				var d = new Date("2012-01-01 " + s);
8678				if (isNaN(d.getTime())) {
8679					d = new Date("2012-01-01T" + s);
8680					if (isNaN(d.getTime())) {
8681						d = new Date("01/01/2012 " + s);
8682						if (isNaN(d.getTime())) {
8683							throw "Unable to parse time with native Date: " + s;
8684						}
8685					}
8686				}
8687
8688				return {
8689					hour: d.getHours(),
8690					minute: d.getMinutes(),
8691					second: d.getSeconds(),
8692					millisec: d.getMilliseconds(),
8693					microsec: d.getMicroseconds(),
8694					timezone: d.getTimezoneOffset() * -1
8695				};
8696			} catch (err) {
8697				try {
8698					return strictParse(f, s, o);
8699				} catch (err2) {
8700					$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
8701				}
8702			}
8703			return false;
8704		}; // end looseParse
8705
8706		if (typeof o.parse === "function") {
8707			return o.parse(timeFormat, timeString, o);
8708		}
8709		if (o.parse === "loose") {
8710			return looseParse(timeFormat, timeString, o);
8711		}
8712		return strictParse(timeFormat, timeString, o);
8713	};
8714
8715	/**
8716  * Public utility to format the time
8717  * @param {string} format format of the time
8718  * @param {Object} time Object not a Date for timezones
8719  * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm
8720  * @returns {string} the formatted time
8721  */
8722	$.datepicker.formatTime = function (format, time, options) {
8723		options = options || {};
8724		options = $.extend({}, $.timepicker._defaults, options);
8725		time = $.extend({
8726			hour: 0,
8727			minute: 0,
8728			second: 0,
8729			millisec: 0,
8730			microsec: 0,
8731			timezone: null
8732		}, time);
8733
8734		var tmptime = format,
8735		    ampmName = options.amNames[0],
8736		    hour = parseInt(time.hour, 10);
8737
8738		if (hour > 11) {
8739			ampmName = options.pmNames[0];
8740		}
8741
8742		tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
8743			switch (match) {
8744				case "HH":
8745					return ("0" + hour).slice(-2);
8746				case "H":
8747					return hour;
8748				case "hh":
8749					return ("0" + convert24to12(hour)).slice(-2);
8750				case "h":
8751					return convert24to12(hour);
8752				case "mm":
8753					return ("0" + time.minute).slice(-2);
8754				case "m":
8755					return time.minute;
8756				case "ss":
8757					return ("0" + time.second).slice(-2);
8758				case "s":
8759					return time.second;
8760				case "l":
8761					return ("00" + time.millisec).slice(-3);
8762				case "c":
8763					return ("00" + time.microsec).slice(-3);
8764				case "z":
8765					return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
8766				case "Z":
8767					return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
8768				case "T":
8769					return ampmName.charAt(0).toUpperCase();
8770				case "TT":
8771					return ampmName.toUpperCase();
8772				case "t":
8773					return ampmName.charAt(0).toLowerCase();
8774				case "tt":
8775					return ampmName.toLowerCase();
8776				default:
8777					return match.replace(/'/g, "");
8778			}
8779		});
8780
8781		return tmptime;
8782	};
8783
8784	/*
8785 * the bad hack :/ override datepicker so it doesn't close on select
8786 // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
8787 */
8788	$.datepicker._base_selectDate = $.datepicker._selectDate;
8789	$.datepicker._selectDate = function (id, dateStr) {
8790		var inst = this._getInst($(id)[0]),
8791		    tp_inst = this._get(inst, "timepicker"),
8792		    was_inline;
8793
8794		if (tp_inst && inst.settings.showTimepicker) {
8795			tp_inst._limitMinMaxDateTime(inst, true);
8796			was_inline = inst.inline;
8797			inst.inline = inst.stay_open = true;
8798			//This way the onSelect handler called from calendarpicker get the full dateTime
8799			this._base_selectDate(id, dateStr);
8800			inst.inline = was_inline;
8801			inst.stay_open = false;
8802			this._notifyChange(inst);
8803			this._updateDatepicker(inst);
8804		} else {
8805			this._base_selectDate(id, dateStr);
8806		}
8807	};
8808
8809	/*
8810 * second bad hack :/ override datepicker so it triggers an event when changing the input field
8811 * and does not redraw the datepicker on every selectDate event
8812 */
8813	$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
8814	$.datepicker._updateDatepicker = function (inst) {
8815
8816		// don't popup the datepicker if there is another instance already opened
8817		var input = inst.input[0];
8818		if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
8819			return;
8820		}
8821
8822		if (typeof inst.stay_open !== "boolean" || inst.stay_open === false) {
8823
8824			this._base_updateDatepicker(inst);
8825
8826			// Reload the time control when changing something in the input text field.
8827			var tp_inst = this._get(inst, "timepicker");
8828			if (tp_inst) {
8829				tp_inst._addTimePicker(inst);
8830			}
8831		}
8832	};
8833
8834	/*
8835 * third bad hack :/ override datepicker so it allows spaces and colon in the input field
8836 */
8837	$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
8838	$.datepicker._doKeyPress = function (event) {
8839		var inst = $.datepicker._getInst(event.target),
8840		    tp_inst = $.datepicker._get(inst, "timepicker");
8841
8842		if (tp_inst) {
8843			if ($.datepicker._get(inst, "constrainInput")) {
8844				var ampm = tp_inst.support.ampm,
8845				    tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
8846				    dateChars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")),
8847				    datetimeChars = tp_inst._defaults.timeFormat.toString().replace(/[hms]/g, "").replace(/TT/g, ampm ? "APM" : "").replace(/Tt/g, ampm ? "AaPpMm" : "").replace(/tT/g, ampm ? "AaPpMm" : "").replace(/T/g, ampm ? "AP" : "").replace(/tt/g, ampm ? "apm" : "").replace(/t/g, ampm ? "ap" : "") + " " + tp_inst._defaults.separator + tp_inst._defaults.timeSuffix + (tz ? tp_inst._defaults.timezoneList.join("") : "") + tp_inst._defaults.amNames.join("") + tp_inst._defaults.pmNames.join("") + dateChars,
8848				    chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
8849				return event.ctrlKey || (chr < " " || !dateChars || datetimeChars.indexOf(chr) > -1);
8850			}
8851		}
8852
8853		return $.datepicker._base_doKeyPress(event);
8854	};
8855
8856	/*
8857 * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
8858 * Update any alternate field to synchronise with the main field.
8859 */
8860	$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
8861	$.datepicker._updateAlternate = function (inst) {
8862		var tp_inst = this._get(inst, "timepicker");
8863		if (tp_inst) {
8864			var altField = tp_inst._defaults.altField;
8865			if (altField) {
8866				// update alternate field too
8867				var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
8868				    date = this._getDate(inst),
8869				    formatCfg = $.datepicker._getFormatConfig(inst),
8870				    altFormattedDateTime = "",
8871				    altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
8872				    altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
8873				    altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
8874
8875				altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
8876				if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
8877					if (tp_inst._defaults.altFormat) {
8878						altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
8879					} else {
8880						altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
8881					}
8882				}
8883				$(altField).val(inst.input.val() ? altFormattedDateTime : "");
8884			}
8885		} else {
8886			$.datepicker._base_updateAlternate(inst);
8887		}
8888	};
8889
8890	/*
8891 * Override key up event to sync manual input changes.
8892 */
8893	$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
8894	$.datepicker._doKeyUp = function (event) {
8895		var inst = $.datepicker._getInst(event.target),
8896		    tp_inst = $.datepicker._get(inst, "timepicker");
8897
8898		if (tp_inst) {
8899			if (tp_inst._defaults.timeOnly && inst.input.val() !== inst.lastVal) {
8900				try {
8901					$.datepicker._updateDatepicker(inst);
8902				} catch (err) {
8903					$.timepicker.log(err);
8904				}
8905			}
8906		}
8907
8908		return $.datepicker._base_doKeyUp(event);
8909	};
8910
8911	/*
8912 * override "Today" button to also grab the time and set it to input field.
8913 */
8914	$.datepicker._base_gotoToday = $.datepicker._gotoToday;
8915	$.datepicker._gotoToday = function (id) {
8916		var inst = this._getInst($(id)[0]);
8917		this._base_gotoToday(id);
8918		var tp_inst = this._get(inst, "timepicker");
8919		if (!tp_inst) {
8920			return;
8921		}
8922
8923		var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);
8924		var now = new Date();
8925		now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));
8926		this._setTime(inst, now);
8927		this._setDate(inst, now);
8928		tp_inst._onSelectHandler();
8929	};
8930
8931	/*
8932 * Disable & enable the Time in the datetimepicker
8933 */
8934	$.datepicker._disableTimepickerDatepicker = function (target) {
8935		var inst = this._getInst(target);
8936		if (!inst) {
8937			return;
8938		}
8939
8940		var tp_inst = this._get(inst, "timepicker");
8941		$(target).datepicker("getDate"); // Init selected[Year|Month|Day]
8942		if (tp_inst) {
8943			inst.settings.showTimepicker = false;
8944			tp_inst._defaults.showTimepicker = false;
8945			tp_inst._updateDateTime(inst);
8946		}
8947	};
8948
8949	$.datepicker._enableTimepickerDatepicker = function (target) {
8950		var inst = this._getInst(target);
8951		if (!inst) {
8952			return;
8953		}
8954
8955		var tp_inst = this._get(inst, "timepicker");
8956		$(target).datepicker("getDate"); // Init selected[Year|Month|Day]
8957		if (tp_inst) {
8958			inst.settings.showTimepicker = true;
8959			tp_inst._defaults.showTimepicker = true;
8960			tp_inst._addTimePicker(inst); // Could be disabled on page load
8961			tp_inst._updateDateTime(inst);
8962		}
8963	};
8964
8965	/*
8966 * Create our own set time function
8967 */
8968	$.datepicker._setTime = function (inst, date) {
8969		var tp_inst = this._get(inst, "timepicker");
8970		if (tp_inst) {
8971			var defaults = tp_inst._defaults;
8972
8973			// calling _setTime with no date sets time to defaults
8974			tp_inst.hour = date ? date.getHours() : defaults.hour;
8975			tp_inst.minute = date ? date.getMinutes() : defaults.minute;
8976			tp_inst.second = date ? date.getSeconds() : defaults.second;
8977			tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
8978			tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
8979
8980			//check if within min/max times..
8981			tp_inst._limitMinMaxDateTime(inst, true);
8982
8983			tp_inst._onTimeChange();
8984			tp_inst._updateDateTime(inst);
8985		}
8986	};
8987
8988	/*
8989 * Create new public method to set only time, callable as $().datepicker('setTime', date)
8990 */
8991	$.datepicker._setTimeDatepicker = function (target, date, withDate) {
8992		var inst = this._getInst(target);
8993		if (!inst) {
8994			return;
8995		}
8996
8997		var tp_inst = this._get(inst, "timepicker");
8998
8999		if (tp_inst) {
9000			this._setDateFromField(inst);
9001			var tp_date;
9002			if (date) {
9003				if (typeof date === "string") {
9004					tp_inst._parseTime(date, withDate);
9005					tp_date = new Date();
9006					tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
9007					tp_date.setMicroseconds(tp_inst.microsec);
9008				} else {
9009					tp_date = new Date(date.getTime());
9010					tp_date.setMicroseconds(date.getMicroseconds());
9011				}
9012				if (tp_date.toString() === "Invalid Date") {
9013					tp_date = undefined;
9014				}
9015				this._setTime(inst, tp_date);
9016			}
9017		}
9018	};
9019
9020	/*
9021 * override setDate() to allow setting time too within Date object
9022 */
9023	$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
9024	$.datepicker._setDateDatepicker = function (target, _date) {
9025		var inst = this._getInst(target);
9026		var date = _date;
9027		if (!inst) {
9028			return;
9029		}
9030
9031		if (typeof _date === "string") {
9032			date = new Date(_date);
9033			if (!date.getTime()) {
9034				this._base_setDateDatepicker.apply(this, arguments);
9035				date = $(target).datepicker("getDate");
9036			}
9037		}
9038
9039		var tp_inst = this._get(inst, "timepicker");
9040		var tp_date;
9041		if (date instanceof Date) {
9042			tp_date = new Date(date.getTime());
9043			tp_date.setMicroseconds(date.getMicroseconds());
9044		} else {
9045			tp_date = date;
9046		}
9047
9048		// This is important if you are using the timezone option, javascript's Date
9049		// object will only return the timezone offset for the current locale, so we
9050		// adjust it accordingly.  If not using timezone option this won't matter..
9051		// If a timezone is different in tp, keep the timezone as is
9052		if (tp_inst && tp_date) {
9053			// look out for DST if tz wasn't specified
9054			if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
9055				tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
9056			}
9057			date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);
9058			tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone);
9059		}
9060
9061		this._updateDatepicker(inst);
9062		this._base_setDateDatepicker.apply(this, arguments);
9063		this._setTimeDatepicker(target, tp_date, true);
9064	};
9065
9066	/*
9067 * override getDate() to allow getting time too within Date object
9068 */
9069	$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
9070	$.datepicker._getDateDatepicker = function (target, noDefault) {
9071		var inst = this._getInst(target);
9072		if (!inst) {
9073			return;
9074		}
9075
9076		var tp_inst = this._get(inst, "timepicker");
9077
9078		if (tp_inst) {
9079			// if it hasn't yet been defined, grab from field
9080			if (inst.lastVal === undefined) {
9081				this._setDateFromField(inst, noDefault);
9082			}
9083
9084			var date = this._getDate(inst);
9085
9086			var currDT = null;
9087
9088			if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {
9089				currDT = tp_inst.$input.val() + " " + tp_inst.$altInput.val();
9090			} else if (tp_inst.$input.get(0).tagName !== "INPUT" && tp_inst.$altInput) {
9091				/**
9092     * in case the datetimepicker has been applied to a non-input tag for inline UI,
9093     * and the user has not configured the plugin to display only time in altInput,
9094     * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
9095     *
9096     * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values
9097     */
9098				currDT = tp_inst.$altInput.val();
9099			} else {
9100				currDT = tp_inst.$input.val();
9101			}
9102
9103			if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {
9104				date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
9105				date.setMicroseconds(tp_inst.microsec);
9106
9107				// This is important if you are using the timezone option, javascript's Date
9108				// object will only return the timezone offset for the current locale, so we
9109				// adjust it accordingly.  If not using timezone option this won't matter..
9110				if (tp_inst.timezone != null) {
9111					// look out for DST if tz wasn't specified
9112					if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
9113						tp_inst.timezone = date.getTimezoneOffset() * -1;
9114					}
9115					date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()));
9116				}
9117			}
9118			return date;
9119		}
9120		return this._base_getDateDatepicker(target, noDefault);
9121	};
9122
9123	/*
9124 * override parseDate() because UI 1.8.14 throws an error about "Extra characters"
9125 * An option in datapicker to ignore extra format characters would be nicer.
9126 */
9127	$.datepicker._base_parseDate = $.datepicker.parseDate;
9128	$.datepicker.parseDate = function (format, value, settings) {
9129		var date;
9130		try {
9131			date = this._base_parseDate(format, value, settings);
9132		} catch (err) {
9133			// Hack!  The error message ends with a colon, a space, and
9134			// the "extra" characters.  We rely on that instead of
9135			// attempting to perfectly reproduce the parsing algorithm.
9136			if (err.indexOf(":") >= 0) {
9137				date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(":") - 2)), settings);
9138				$.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
9139			} else {
9140				throw err;
9141			}
9142		}
9143		return date;
9144	};
9145
9146	/*
9147 * override formatDate to set date with time to the input
9148 */
9149	$.datepicker._base_formatDate = $.datepicker._formatDate;
9150	$.datepicker._formatDate = function (inst, day, month, year) {
9151		var tp_inst = this._get(inst, "timepicker");
9152		if (tp_inst) {
9153			tp_inst._updateDateTime(inst);
9154			return tp_inst.$input.val();
9155		}
9156		return this._base_formatDate(inst);
9157	};
9158
9159	/*
9160 * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
9161 */
9162	$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
9163	$.datepicker._optionDatepicker = function (target, name, value) {
9164		var inst = this._getInst(target),
9165		    name_clone;
9166		if (!inst) {
9167			return null;
9168		}
9169
9170		var tp_inst = this._get(inst, "timepicker");
9171		if (tp_inst) {
9172			var min = null,
9173			    max = null,
9174			    onselect = null,
9175			    overrides = tp_inst._defaults.evnts,
9176			    fns = {},
9177			    prop,
9178			    ret,
9179			    oldVal,
9180			    $target;
9181			if (typeof name === "string") {
9182				// if min/max was set with the string
9183				if (name === "minDate" || name === "minDateTime") {
9184					min = value;
9185				} else if (name === "maxDate" || name === "maxDateTime") {
9186					max = value;
9187				} else if (name === "onSelect") {
9188					onselect = value;
9189				} else if (overrides.hasOwnProperty(name)) {
9190					if (typeof value === "undefined") {
9191						return overrides[name];
9192					}
9193					fns[name] = value;
9194					name_clone = {}; //empty results in exiting function after overrides updated
9195				}
9196			} else if (typeof name === "object") {
9197				//if min/max was set with the JSON
9198				if (name.minDate) {
9199					min = name.minDate;
9200				} else if (name.minDateTime) {
9201					min = name.minDateTime;
9202				} else if (name.maxDate) {
9203					max = name.maxDate;
9204				} else if (name.maxDateTime) {
9205					max = name.maxDateTime;
9206				}
9207				for (prop in overrides) {
9208					if (overrides.hasOwnProperty(prop) && name[prop]) {
9209						fns[prop] = name[prop];
9210					}
9211				}
9212			}
9213			for (prop in fns) {
9214				if (fns.hasOwnProperty(prop)) {
9215					overrides[prop] = fns[prop];
9216					if (!name_clone) {
9217						name_clone = $.extend({}, name);
9218					}
9219					delete name_clone[prop];
9220				}
9221			}
9222			if (name_clone && isEmptyObject(name_clone)) {
9223				return;
9224			}
9225			if (min) {
9226				//if min was set
9227				if (min === 0) {
9228					min = new Date();
9229				} else {
9230					min = new Date(min);
9231				}
9232				tp_inst._defaults.minDate = min;
9233				tp_inst._defaults.minDateTime = min;
9234			} else if (max) {
9235				//if max was set
9236				if (max === 0) {
9237					max = new Date();
9238				} else {
9239					max = new Date(max);
9240				}
9241				tp_inst._defaults.maxDate = max;
9242				tp_inst._defaults.maxDateTime = max;
9243			} else if (onselect) {
9244				tp_inst._defaults.onSelect = onselect;
9245			}
9246
9247			// Datepicker will override our date when we call _base_optionDatepicker when
9248			// calling minDate/maxDate, so we will first grab the value, call
9249			// _base_optionDatepicker, then set our value back.
9250			if (min || max) {
9251				$target = $(target);
9252				oldVal = $target.datetimepicker("getDate");
9253				ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
9254				$target.datetimepicker("setDate", oldVal);
9255				return ret;
9256			}
9257		}
9258		if (value === undefined) {
9259			return this._base_optionDatepicker.call($.datepicker, target, name);
9260		}
9261		return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
9262	};
9263
9264	/*
9265 * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
9266 * it will return false for all objects
9267 */
9268	var isEmptyObject = function isEmptyObject(obj) {
9269		var prop;
9270		for (prop in obj) {
9271			if (obj.hasOwnProperty(prop)) {
9272				return false;
9273			}
9274		}
9275		return true;
9276	};
9277
9278	/*
9279 * jQuery extend now ignores nulls!
9280 */
9281	var extendRemove = function extendRemove(target, props) {
9282		$.extend(target, props);
9283		for (var name in props) {
9284			if (props[name] === null || props[name] === undefined) {
9285				target[name] = props[name];
9286			}
9287		}
9288		return target;
9289	};
9290
9291	/*
9292 * Determine by the time format which units are supported
9293 * Returns an object of booleans for each unit
9294 */
9295	var detectSupport = function detectSupport(timeFormat) {
9296		var tf = timeFormat.replace(/'.*?'/g, "").toLowerCase(),
9297		    // removes literals
9298		isIn = function isIn(f, t) {
9299			// does the format contain the token?
9300			return f.indexOf(t) !== -1 ? true : false;
9301		};
9302		return {
9303			hour: isIn(tf, "h"),
9304			minute: isIn(tf, "m"),
9305			second: isIn(tf, "s"),
9306			millisec: isIn(tf, "l"),
9307			microsec: isIn(tf, "c"),
9308			timezone: isIn(tf, "z"),
9309			ampm: isIn(tf, "t") && isIn(timeFormat, "h"),
9310			iso8601: isIn(timeFormat, "Z")
9311		};
9312	};
9313
9314	/*
9315 * Converts 24 hour format into 12 hour
9316 * Returns 12 hour without leading 0
9317 */
9318	var convert24to12 = function convert24to12(hour) {
9319		hour %= 12;
9320
9321		if (hour === 0) {
9322			hour = 12;
9323		}
9324
9325		return String(hour);
9326	};
9327
9328	var computeEffectiveSetting = function computeEffectiveSetting(settings, property) {
9329		return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];
9330	};
9331
9332	/*
9333 * Splits datetime string into date and time substrings.
9334 * Throws exception when date can't be parsed
9335 * Returns {dateString: dateString, timeString: timeString}
9336 */
9337	var splitDateTime = function splitDateTime(dateTimeString, timeSettings) {
9338		// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
9339		// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
9340		var separator = computeEffectiveSetting(timeSettings, "separator"),
9341		    format = computeEffectiveSetting(timeSettings, "timeFormat"),
9342		    timeParts = format.split(separator),
9343		    // how many occurrences of separator may be in our format?
9344		timePartsLen = timeParts.length,
9345		    allParts = dateTimeString.split(separator),
9346		    allPartsLen = allParts.length;
9347
9348		if (allPartsLen > 1) {
9349			return {
9350				dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
9351				timeString: allParts.splice(0, timePartsLen).join(separator)
9352			};
9353		}
9354
9355		return {
9356			dateString: dateTimeString,
9357			timeString: ""
9358		};
9359	};
9360
9361	/*
9362 * Internal function to parse datetime interval
9363 * Returns: {date: Date, timeObj: Object}, where
9364 *   date - parsed date without time (type Date)
9365 *   timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional
9366 */
9367	var parseDateTimeInternal = function parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
9368		var date, parts, parsedTime;
9369
9370		parts = splitDateTime(dateTimeString, timeSettings);
9371		date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);
9372
9373		if (parts.timeString === "") {
9374			return {
9375				date: date
9376			};
9377		}
9378
9379		parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);
9380
9381		if (!parsedTime) {
9382			throw "Wrong time format";
9383		}
9384
9385		return {
9386			date: date,
9387			timeObj: parsedTime
9388		};
9389	};
9390
9391	/*
9392 * Internal function to set timezone_select to the local timezone
9393 */
9394	var selectLocalTimezone = function selectLocalTimezone(tp_inst, date) {
9395		if (tp_inst && tp_inst.timezone_select) {
9396			var now = date || new Date();
9397			tp_inst.timezone_select.val(-now.getTimezoneOffset());
9398		}
9399	};
9400
9401	/*
9402 * Create a Singleton Instance
9403 */
9404	$.timepicker = new Timepicker();
9405
9406	/**
9407  * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
9408  * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned
9409  * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45"
9410  * @return {string}
9411  */
9412	$.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {
9413		if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
9414			return tzMinutes;
9415		}
9416
9417		var off = tzMinutes,
9418		    minutes = off % 60,
9419		    hours = (off - minutes) / 60,
9420		    iso = iso8601 ? ":" : "",
9421		    tz = (off >= 0 ? "+" : "-") + ("0" + Math.abs(hours)).slice(-2) + iso + ("0" + Math.abs(minutes)).slice(-2);
9422
9423		if (tz === "+00:00") {
9424			return "Z";
9425		}
9426		return tz;
9427	};
9428
9429	/**
9430  * Get the number in minutes that represents a timezone string
9431  * @param  {string} tzString formatted like "+0500", "-1245", "Z"
9432  * @return {number} the offset minutes or the original string if it doesn't match expectations
9433  */
9434	$.timepicker.timezoneOffsetNumber = function (tzString) {
9435		var normalized = tzString.toString().replace(":", ""); // excuse any iso8601, end up with "+1245"
9436
9437		if (normalized.toUpperCase() === "Z") {
9438			// if iso8601 with Z, its 0 minute offset
9439			return 0;
9440		}
9441
9442		if (!/^(\-|\+)\d{4}$/.test(normalized)) {
9443			// possibly a user defined tz, so just give it back
9444			return parseInt(tzString, 10);
9445		}
9446
9447		return (normalized.substr(0, 1) === "-" ? -1 : 1) * (parseInt(normalized.substr(1, 2), 10) * 60 + // hours (converted to minutes)
9448		parseInt(normalized.substr(3, 2), 10)); // minutes
9449	};
9450
9451	/**
9452  * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
9453  * @param  {Date} date
9454  * @param  {string} fromTimezone formatted like "+0500", "-1245"
9455  * @param  {string} toTimezone formatted like "+0500", "-1245"
9456  * @return {Date}
9457  */
9458	$.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) {
9459		var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);
9460		var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
9461		if (!isNaN(toTz)) {
9462			date.setMinutes(date.getMinutes() + -fromTz - -toTz);
9463		}
9464		return date;
9465	};
9466
9467	/**
9468  * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
9469  * enforce date range limits.
9470  * n.b. The input value must be correctly formatted (reformatting is not supported)
9471  * @param  {Element} startTime
9472  * @param  {Element} endTime
9473  * @param  {Object} options Options for the timepicker() call
9474  * @return {jQuery}
9475  */
9476	$.timepicker.timeRange = function (startTime, endTime, options) {
9477		return $.timepicker.handleRange("timepicker", startTime, endTime, options);
9478	};
9479
9480	/**
9481  * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
9482  * enforce date range limits.
9483  * @param  {Element} startTime
9484  * @param  {Element} endTime
9485  * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
9486  *   a boolean value that can be used to reformat the input values to the `dateFormat`.
9487  * @param  {string} method Can be used to specify the type of picker to be added
9488  * @return {jQuery}
9489  */
9490	$.timepicker.datetimeRange = function (startTime, endTime, options) {
9491		$.timepicker.handleRange("datetimepicker", startTime, endTime, options);
9492	};
9493
9494	/**
9495  * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to
9496  * enforce date range limits.
9497  * @param  {Element} startTime
9498  * @param  {Element} endTime
9499  * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
9500  *   a boolean value that can be used to reformat the input values to the `dateFormat`.
9501  * @return {jQuery}
9502  */
9503	$.timepicker.dateRange = function (startTime, endTime, options) {
9504		$.timepicker.handleRange("datepicker", startTime, endTime, options);
9505	};
9506
9507	/**
9508  * Calls `method` on the `startTime` and `endTime` elements, and configures them to
9509  * enforce date range limits.
9510  * @param  {string} method Can be used to specify the type of picker to be added
9511  * @param  {Element} startTime
9512  * @param  {Element} endTime
9513  * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
9514  *   a boolean value that can be used to reformat the input values to the `dateFormat`.
9515  * @return {jQuery}
9516  */
9517	$.timepicker.handleRange = function (method, startTime, endTime, options) {
9518		options = $.extend({}, {
9519			minInterval: 0, // min allowed interval in milliseconds
9520			maxInterval: 0, // max allowed interval in milliseconds
9521			start: {}, // options for start picker
9522			end: {} // options for end picker
9523		}, options);
9524
9525		// for the mean time this fixes an issue with calling getDate with timepicker()
9526		var timeOnly = false;
9527		if (method === "timepicker") {
9528			timeOnly = true;
9529			method = "datetimepicker";
9530		}
9531
9532		function checkDates(changed, other) {
9533			var startdt = startTime[method]("getDate"),
9534			    enddt = endTime[method]("getDate"),
9535			    changeddt = changed[method]("getDate");
9536
9537			if (startdt !== null) {
9538				var minDate = new Date(startdt.getTime()),
9539				    maxDate = new Date(startdt.getTime());
9540
9541				minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
9542				maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);
9543
9544				if (options.minInterval > 0 && minDate > enddt) {
9545					// minInterval check
9546					endTime[method]("setDate", minDate);
9547				} else if (options.maxInterval > 0 && maxDate < enddt) {
9548					// max interval check
9549					endTime[method]("setDate", maxDate);
9550				} else if (startdt > enddt) {
9551					other[method]("setDate", changeddt);
9552				}
9553			}
9554		}
9555
9556		function selected(changed, other, option) {
9557			if (!changed.val()) {
9558				return;
9559			}
9560			var date = changed[method].call(changed, "getDate");
9561			if (date !== null && options.minInterval > 0) {
9562				if (option === "minDate") {
9563					date.setMilliseconds(date.getMilliseconds() + options.minInterval);
9564				}
9565				if (option === "maxDate") {
9566					date.setMilliseconds(date.getMilliseconds() - options.minInterval);
9567				}
9568			}
9569
9570			if (date.getTime) {
9571				other[method].call(other, "option", option, date);
9572			}
9573		}
9574
9575		$.fn[method].call(startTime, $.extend({
9576			timeOnly: timeOnly,
9577			onClose: function onClose(dateText, inst) {
9578				checkDates($(this), endTime);
9579			},
9580			onSelect: function onSelect(selectedDateTime) {
9581				selected($(this), endTime, "minDate");
9582			}
9583		}, options, options.start));
9584		$.fn[method].call(endTime, $.extend({
9585			timeOnly: timeOnly,
9586			onClose: function onClose(dateText, inst) {
9587				checkDates($(this), startTime);
9588			},
9589			onSelect: function onSelect(selectedDateTime) {
9590				selected($(this), startTime, "maxDate");
9591			}
9592		}, options, options.end));
9593
9594		checkDates(startTime, endTime);
9595
9596		selected(startTime, endTime, "minDate");
9597		selected(endTime, startTime, "maxDate");
9598
9599		return $([startTime.get(0), endTime.get(0)]);
9600	};
9601
9602	/**
9603  * Log error or data to the console during error or debugging
9604  * @param  {Object} err pass any type object to log to the console during error or debugging
9605  * @return {void}
9606  */
9607	$.timepicker.log = function () {
9608		// Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first.
9609		if (window.console && window.console.log && window.console.log.apply) {
9610			window.console.log.apply(window.console, Array.prototype.slice.call(arguments));
9611		}
9612	};
9613
9614	/*
9615  * Add util object to allow access to private methods for testability.
9616  */
9617	$.timepicker._util = {
9618		_extendRemove: extendRemove,
9619		_isEmptyObject: isEmptyObject,
9620		_convert24to12: convert24to12,
9621		_detectSupport: detectSupport,
9622		_selectLocalTimezone: selectLocalTimezone,
9623		_computeEffectiveSetting: computeEffectiveSetting,
9624		_splitDateTime: splitDateTime,
9625		_parseDateTimeInternal: parseDateTimeInternal
9626	};
9627
9628	/*
9629 * Microsecond support
9630 */
9631	if (!Date.prototype.getMicroseconds) {
9632		Date.prototype.microseconds = 0;
9633		Date.prototype.getMicroseconds = function () {
9634			return this.microseconds;
9635		};
9636		Date.prototype.setMicroseconds = function (m) {
9637			this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));
9638			this.microseconds = m % 1000;
9639			return this;
9640		};
9641	}
9642
9643	/*
9644 * Keep up with the version
9645 */
9646	$.timepicker.version = "1.6.3";
9647});
9648// plus or minus
9649
9650},{}],63:[function(require,module,exports){
9651"use strict";
9652
9653$(document).ready(function () {
9654    if ($("div#divEventRegistrationForm").length) {
9655        var selectedPaperApplicationMessage;
9656        var selectedCurrentMemberMessage;
9657        var selectedPilotMessage;
9658        var selectedTakeoffsLandingsMessage;
9659        var selectedHearAboutMessage;
9660
9661        (function () {
9662            var getLastDayOfYearAndMonth = function (year, month) {
9663                return new Date(new Date(year, month + 1, 1) - 1).getDate();
9664            };
9665
9666            var checkRadioButton = function (mainSelector, message) {
9667                if ($("#" + mainSelector + "0").length) {
9668                    if ($("input[name=" + mainSelector + "]:checked").length === 0) {
9669                        $("span[data-valmsg-for='" + mainSelector + "']").removeClass("field-validation-valid");
9670                        $("span[data-valmsg-for='" + mainSelector + "']").addClass("field-validation-error");
9671                        $("span[data-valmsg-for='" + mainSelector + "']").html(message);
9672                        $("span[data-valmsg-for='" + mainSelector + "']").show();
9673                        return false;
9674                    } else {
9675                        $("span[data-valmsg-for='" + mainSelector + "']").addClass("field-validation-valid");
9676                        $("span[data-valmsg-for='" + mainSelector + "']").removeClass("field-validation-error");
9677                        $("span[data-valmsg-for='" + mainSelector + "']").html("");
9678                        $("span[data-valmsg-for='" + mainSelector + "']").hide();
9679                        return true;
9680                    }
9681                } else {
9682                    return true;
9683                }
9684            };
9685
9686            selectedPaperApplicationMessage = "Please select application preference.";
9687            selectedCurrentMemberMessage = "Please select if you are a member.";
9688            selectedPilotMessage = "Please select if you are a pilot.";
9689            selectedTakeoffsLandingsMessage = "Please select takeoff and landings currency.";
9690            selectedHearAboutMessage = "Please select how you heard about the seminar.";
9691
9692            $("#CfiExpireDate").datepicker({
9693                beforeShowDay: function beforeShowDay(date) {
9694                    if (date.getDate() === getLastDayOfYearAndMonth(date.getFullYear(), date.getMonth())) {
9695                        return [true, ""];
9696                    }
9697                    return [false, ""];
9698                },
9699                changeMonth: true,
9700                changeYear: true
9701            });
9702
9703            $("#btnRsvp").click(function (e) {
9704                var form = $(this).closest("form");
9705                var isValid = true;
9706
9707                if (form.valid()) {
9708                    if (!checkRadioButton("SelectedPaperApplication", selectedPaperApplicationMessage)) {
9709                        isValid = false;
9710                    }
9711                    if (!checkRadioButton("SelectedCurrentMember", selectedCurrentMemberMessage)) {
9712                        isValid = false;
9713                    }
9714                    if (!checkRadioButton("SelectedPilot", selectedPilotMessage)) {
9715                        isValid = false;
9716                    }
9717                    if (!checkRadioButton("SelectedTakeoffsLandings", selectedTakeoffsLandingsMessage)) {
9718                        isValid = false;
9719                    }
9720                    if (!checkRadioButton("SelectedHearAbout", selectedHearAboutMessage)) {
9721                        isValid = false;
9722                    }
9723                } else {
9724                    isValid = false;
9725                    checkRadioButton("SelectedPaperApplication", selectedPaperApplicationMessage);
9726                    checkRadioButton("SelectedCurrentMember", selectedCurrentMemberMessage);
9727                    checkRadioButton("SelectedPilot", selectedPilotMessage);
9728                    checkRadioButton("SelectedTakeoffsLandings", selectedTakeoffsLandingsMessage);
9729                    checkRadioButton("SelectedHearAbout", selectedHearAboutMessage);
9730                }
9731
9732                if (isValid) {
9733                    $(this).hide();
9734                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
9735                } else {
9736                    e.preventDefault();
9737                }
9738            });
9739
9740            $("input[name=SelectedPaperApplication]").on("change", function () {
9741                checkRadioButton("SelectedPaperApplication", selectedPaperApplicationMessage);
9742            });
9743            $("input[name=SelectedCurrentMember]").on("change", function () {
9744                checkRadioButton("SelectedCurrentMember", selectedCurrentMemberMessage);
9745            });
9746            $("input[name=SelectedPilot]").on("change", function () {
9747                checkRadioButton("SelectedPilot", selectedPilotMessage);
9748            });
9749            $("input[name=SelectedTakeoffsLandings]").on("change", function () {
9750                checkRadioButton("SelectedTakeoffsLandings", selectedTakeoffsLandingsMessage);
9751            });
9752            $("input[name=SelectedHearAbout]").on("change", function () {
9753                checkRadioButton("SelectedHearAbout", selectedHearAboutMessage);
9754            });
9755        })();
9756    }
9757});
9758
9759},{}],64:[function(require,module,exports){
9760"use strict";
9761
9762var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
9763
9764var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
9765
9766var Event = (function () {
9767    function Event($filter, $sce, eventService) {
9768        var _this = this;
9769
9770        _classCallCheck(this, Event);
9771
9772        this.$filter = $filter;
9773        this.$sce = $sce;
9774        this.eventService = eventService;
9775        this.templateUrl = "/js/aopa/eventsearch/templates/event.html";
9776        this.restrict = "E";
9777        this.scope = {
9778            event: "="
9779        };
9780        this.controller = ["$scope", function ($scope) {
9781            // Initialize scope methods
9782            $scope.formatDate = function () {
9783                return _this.formatDate($scope);
9784            };
9785            $scope.formatAddress = function () {
9786                return _this.formatAddress($scope);
9787            };
9788            $scope.getDescription = function () {
9789                return _this.getDescription($scope);
9790            };
9791            $scope.getLink = function () {
9792                return _this.getLink($scope);
9793            };
9794        }];
9795    }
9796
9797    _createClass(Event, {
9798        formatDate: {
9799            value: function formatDate($scope) {
9800                var _$scope$event = $scope.event;
9801                var startDate = _$scope$event.startDate;
9802                var endDate = _$scope$event.endDate;
9803                var timeZone = _$scope$event.timeZone;
9804
9805                var dateFormat = "MMM d, y";
9806                var timeFormat = "h:mm a";
9807                var formatted = {
9808                    startDate: this.$filter("date")(startDate, dateFormat, timeZone),
9809                    startTime: this.$filter("date")(startDate, timeFormat, timeZone),
9810                    endDate: this.$filter("date")(endDate, dateFormat, timeZone),
9811                    endTime: this.$filter("date")(endDate, timeFormat, timeZone)
9812                };
9813                if (formatted.startDate === formatted.endDate) {
9814                    if (formatted.startTime === formatted.endTime) {
9815                        return formatted.startDate + " " + formatted.startTime;
9816                    }
9817                    return formatted.startDate + " " + formatted.startTime + " - " + formatted.endTime;
9818                }
9819                return formatted.startDate + " " + formatted.startTime + " - " + formatted.endDate + " " + formatted.endTime;
9820            }
9821        },
9822        formatAddress: {
9823            value: function formatAddress($scope) {
9824                var _ref = $scope.event.address || {};
9825
9826                var line1 = _ref.line1;
9827                var line2 = _ref.line2;
9828                var city = _ref.city;
9829                var state = _ref.state;
9830                var zip = _ref.zip;
9831
9832                var parts = [line1, line2, city, state, zip];
9833                return parts.filter(function (v) {
9834                    return v;
9835                }).join(", ");
9836            }
9837        },
9838        getDescription: {
9839            value: function getDescription($scope) {
9840                return this.$sce.trustAsHtml($scope.event.description);
9841            }
9842        },
9843        getLink: {
9844            value: function getLink($scope) {
9845                return this.eventService.getEventUrl($scope.event);
9846            }
9847        },
9848        isSameDay: {
9849            value: function isSameDay(d1, d2) {
9850                return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate();
9851            }
9852        }
9853    }, {
9854        directiveFactory: {
9855            value: function directiveFactory($filter, $sce, eventService) {
9856                Event.instance = new Event($filter, $sce, eventService);
9857                return Event.instance;
9858            }
9859        }
9860    });
9861
9862    return Event;
9863})();
9864
9865Event.directiveFactory.$inject = ["$filter", "$sce", "eventService"];
9866
9867module.exports = Event;
9868
9869},{}],65:[function(require,module,exports){
9870"use strict";
9871
9872var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
9873
9874var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
9875
9876var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
9877
9878var EventSearch = (function () {
9879    function EventSearch($q, $http, $timeout, $filter, airportService, eventService, googleService, NgMap) {
9880        var _this = this;
9881
9882        _classCallCheck(this, EventSearch);
9883
9884        this.$q = $q;
9885        this.$http = $http;
9886        this.$timeout = $timeout;
9887        this.$filter = $filter;
9888        this.airportService = airportService;
9889        this.eventService = eventService;
9890        this.googleService = googleService;
9891        this.NgMap = NgMap;
9892        this.templateUrl = "/js/aopa/eventsearch/templates/event-search.html";
9893        this.restrict = "E";
9894        this.scope = {
9895            perPage: "="
9896        };
9897        this.controller = ["$scope", function ($scope) {
9898            // Initialize scope variables
9899            $scope.query = "";
9900            $scope.googleMapsUrl = "https://maps.googleapis.com/ma
9900ps/api/js?key=" + Aopa.GOOGLE_MAPS_API_KEY + "&libraries=places";
9901            $scope.states = [];
9902            $scope.selectedStates = [];
9903            $scope.selectedAirports = [];
9904            $scope.location = null;
9905            $scope.RADIUS = 100;
9906            $scope.currentPage = 1;
9907            $scope.pageSize = 10;
9908            $scope.totalResults = 0;
9909
9910            // Initialize scope methods
9911            $scope.onSearchKeyUp = function ($event) {
9912                return _this.onSearchKeyUp($scope, $event);
9913            };
9914            $scope.onSearchBlur = function () {
9915                return _this.onSearchBlur($scope);
9916            };
9917            $scope.onClickSearch = function () {
9918                return _this.onClickSearch($scope);
9919            };
9920            $scope.selectedItemChange = function (item) {
9921                return _this.selectedItemChange($scope, item);
9922            };
9923            $scope.querySearch = function (query) {
9924                return _this.querySearch($scope, query);
9925            };
9926            $scope.onSelectState = function (state) {
9927                return _this.onSelectState($scope, state);
9928            };
9929            $scope.onDeselectState = function (state) {
9930                return _this.onDeselectState($scope, state);
9931            };
9932            $scope.stateSearch = function (query) {
9933                return _this.stateSearch($scope, query);
9934            };
9935            $scope.onSelectAirport = function (item) {
9936                return _this.onSelectAirport($scope, item);
9937            };
9938            $scope.onDeselectAirport = function (item) {
9939                return _this.onDeselectAirport($scope, item);
9940            };
9941            $scope.airportSearch = function (query) {
9942                return _this.airportSearch($scope, query);
9943            };
9944            $scope.onToggleRegion = function (region) {
9945                return _this.onToggleRegion($scope, region);
9946            };
9947            $scope.onToggleCategory = function (category) {
9948                return _this.onToggleCategory($scope, category);
9949            };
9950            $scope.onSelectDateRange = function () {
9951                return _this.onSelectDateRange($scope);
9952            };
9953            $scope.clearDateRange = function () {
9954                return _this.clearDateRange($scope);
9955            };
9956            $scope.pageChanged = function (newPage) {
9957                return _this.pageChanged($scope, newPage);
9958            };
9959            $scope.onMarkerClick = function (clickEvent, event) {
9960                return _this.onMarkerClick($scope, clickEvent, event);
9961            };
9962
9963            // Initialize regions
9964            _this.initRegions($scope);
9965
9966            // Initialize event categories
9967            _this.initCategories($scope);
9968
9969            // Initialize date range
9970            $scope.dateRange = { dateStart: null, dateEnd: null };
9971            $scope.isDisabledDate = function (d) {
9972                // Prevent selecting dates before today
9973                return new Date(d.toDateString()) < new Date(new Date().toDateString());
9974            };
9975
9976            // Initialize Google Maps
9977            var d = $q.defer();
9978            NgMap.getMap().then(function (map) {
9979                d.resolve(map);
9980                _this.googleService.init(map);
9981                _this.initMap($scope, map);
9982                _this.load($scope);
9983            })["catch"](function (err) {
9984                d.reject(err);
9985                $scope.error = "An error occurred initializing the map. Please try again later.";
9986            });
9987            $scope.mapPromise = d.promise;
9988
9989            // Initialize states
9990            $scope.statePromise = $http.get("/api/CountryState/GetStates?countryCode=USA").then(function (states) {
9991                $scope.states = states.data.slice(1);
9992                return $scope.states;
9993            });
9994
9995            // TEMP: Watch for query changes
9996            $scope.$watch("query", function (q) {
9997                return _this.onQueryChanged($scope);
9998            });
9999        }];
10000    }
10001
10002    _createClass(EventSearch, {
10003        link: {
10004            value: function link($scope, $element, $attributes) {}
10005        },
10006        clear: {
10007            value: function clear($scope) {
10008                $scope.events = null;
10009                $scope.error = null;
10010                $scope.loading = false;
10011            }
10012        },
10013        initRegions: {
10014            value: function initRegions($scope) {
10015                $scope.regions = null;
10016                $scope.regionsError = false;
10017                $scope.regionsLoading = true;
10018                $scope.regionsPromise = this.$http.get("/api/CountryState/GetRegionStates").then(function (response) {
10019                    $scope.regions = _.chain(response.data).groupBy("regionId").map(function (g) {
10020                        return {
10021                            name: g[0].regionName,
10022                            states: _.chain(g).map(function (state) {
10023                                return {
10024                                    code: state.stateCode,
10025                                    name: state.stateName
10026                                };
10027                            }).sortBy("name").value()
10028                        };
10029                    }).sortBy("name").value();
10030                })["catch"](function (e) {
10031                    console.error("Error loading region states", e);
10032                    $scope.regionsError = true;
10033                })["finally"](function () {
10034                    $scope.regionsLoading = false;
10035                });
10036                return $scope.regionsPromise;
10037            }
10038        },
10039        initCategories: {
10040            value: function initCategories($scope) {
10041                $scope.eventCategories = null;
10042                $scope.eventCategoriesError = false;
10043                $scope.eventCategoriesLoading = true;
10044                return this.eventService.getEventCategories().then(function (categories) {
10045                    $scope.eventCategories = categories;
10046                })["catch"](function (e) {
10047                    console.error("Error loading event categories", e);
10048                    $scope.eventCategoriesError = true;
10049                })["finally"](function () {
10050                    $scope.eventCategoriesLoading = false;
10051                });
10052            }
10053        },
10054        initMap: {
10055            value: function initMap($scope, map) {
10056                $scope.map = map;
10057                $scope.autocomplete = new google.maps.places.AutocompleteService();
10058            }
10059        },
10060        load: {
10061            value: function load($scope) {
10062                this.clear($scope);
10063                this.search($scope);
10064            }
10065        },
10066        onQueryChanged: {
10067            value: function onQueryChanged($scope) {
10068                if (!this.googleService.ready || !$scope.query) {
10069                    return;
10070                }
10071            }
10072        },
10073        onSearchKeyUp: {
10074            value: function onSearchKeyUp($scope, $event) {
10075                if ($event.keyCode === 13) {
10076                    this.search($scope);
10077                }
10078            }
10079        },
10080        onSearchBlur: {
10081            value: function onSearchBlur($scope) {
10082                this.search($scope);
10083            }
10084        },
10085        onClickSearch: {
10086            value: function onClickSearch($scope) {
10087                var query = ($scope.query || "").trim();
10088                if (!query) {
10089                    var searchField = document.getElementById("event-search-query");
10090                    $(searchField).find("input").focus();
10091                    return;
10092                }
10093                this.search($scope);
10094            }
10095        },
10096        selectedItemChange: {
10097            value: function selectedItemChange($scope, item) {
10098                var _this = this;
10099
10100                if (!item) {
10101                    return;
10102                }
10103                if (item.type !== "result") {
10104                    this.clearSelectedItem($scope);
10105                    return;
10106                }
10107                if (item.subtype === "event") {
10108                    this.clearSelectedItem($scope);
10109                    var url = this.getEventUrl(item.event);
10110                    if (url) {
10111                        window.location.href = url;
10112                    }
10113                }
10114                if (item.subtype === "airport") {
10115                    this.clearSelectedItem($scope);
10116                    $scope.location = null;
10117                    $scope.selectedAirports = [];
10118                    $scope.selectedStates = [];
10119                    this.onSelectAirport($scope, item);
10120                }
10121                if (item.subtype === "location") {
10122                    this.clearSelectedItem($scope);
10123                    this.googleService.geocode({ placeId: item.location.place_id }).then(function (results) {
10124                        if (results && results.length) {
10125                            var result = results[0];
10126                            // If result is a US state, then populate it as a selected state in the filters area
10127                            if (result.types && result.types.some(function (v) {
10128                                return v === "administrative_area_level_1";
10129                            }) && result.address_components && result.address_components.length) {
10130                                var cmp = result.address_components[0];
10131                                var stateCode = cmp.short_name;
10132                                var stateName = cmp.long_name;
10133                                if (stateCode) {
10134                                    $scope.selectedAirports = [];
10135                                    $scope.location = null;
10136                                    _this.onSelectState($scope, {
10137                                        value: stateCode,
10138                                        text: stateName
10139                                    });
10140                                    return;
10141                                }
10142                            }
10143                            // Otherwise, perform a radius search around the geocoded lat/lon of the selected result.
10144                            if (result.geometry && result.geometry.location) {
10145                                var location = result.geometry.location;
10146                                $scope.location = {
10147                                    lat: location.lat(),
10148                                    lon: location.lng()
10149                                };
10150                                $scope.selectedAirports = [];
10151                                $scope.selectedStates = [];
10152                                _this.search($scope);
10153                            }
10154                        }
10155                    });
10156                }
10157            }
10158        },
10159        zoomEvents: {
10160            value: function zoomEvents($scope, events) {
10161                if (!events || events.length < 1) {
10162                    return;
10163                }
10164
10165                // Calculate the minimum extent that fits all event locations
10166                var bounds = new google.maps.LatLngBounds();
10167                events.forEach(function (event) {
10168                    var loc = event.location;
10169                    if (loc) {
10170                        var pos = new google.maps.LatLng(loc.lat, loc.lon);
10171                        bounds.extend(pos);
10172                    }
10173                });
10174
10175                // Add an offset around the center so as to establish a maximum zoom
10176                var offset = 0.002;
10177                var center = bounds.getCenter();
10178                bounds.extend(new google.maps.LatLng(center.lat() + offset, center.lng() + offset));
10179                bounds.extend(new google.maps.LatLng(center.lat() - offset, center.lng() - offset));
10180
10181                // Apply the bounds to the map view
10182                $scope.map.fitBounds(bounds);
10183            }
10184        },
10185        clearSelectedItem: {
10186            value: function clearSelectedItem($scope) {
10187                $scope.query = "";
10188                $scope.selectedItem = undefined;
10189                // Close autocomplete menu by focusing the search button. This causes the search field itself
10190                // to lose focus, causing the autocomplete menu to close. A bit of a hack, but couldn't find a
10191                // straightforward way to do this that actually worked...
10192                this.$timeout(function () {
10193                    $("#event-search-btn").focus();
10194                }, 100);
10195            }
10196        },
10197        search: {
10198            value: function search($scope) {
10199                var _this = this;
10200
10201                var resetPage = arguments[1] === undefined ? true : arguments[1];
10202
10203                Promise.all([$scope.statePromise, $scope.regionsPromise]).then(function () {
10204                    if (resetPage) {
10205                        $scope.currentPage = 1;
10206                    }
10207                    var dateFormat = "yyyy-MM-dd";
10208                    var query = {
10209                        content: $scope.query || "",
10210                        states: _this.getStateQuery($scope) || [],
10211                        airports: _this.getAirportQuery($scope) || [],
10212                        categories: ($scope.eventCategories || []).filter(function (c) {
10213                            return c.selected;
10214                        }).map(function (c) {
10215                            return c.id;
10216                        }) || [],
10217                        offset: ($scope.currentPage - 1) * $scope.pageSize,
10218                        limit: $scope.pageSize
10219                    };
10220                    if ($scope.location) {
10221                        query.lat = $scope.location.lat;
10222                        query.lon = $scope.location.lon;
10223                        query.radius = $scope.RADIUS;
10224                    }
10225                    if ($scope.dateRange.dateStart) {
10226                        query.startDate = _this.$filter("date")($scope.dateRange.dateStart, dateFormat);
10227                    }
10228                    if ($scope.dateRange.dateEnd) {
10229                        query.endDate = _this.$filter("date")($scope.dateRange.dateEnd, dateFormat);
10230                    }
10231                    console.log("Search:", query);
10232                    $scope.loading = true;
10233                    $scope.error = false;
10234                    _this.eventService.search(query).then(function (result) {
10235                        $scope.totalResults = result.total;
10236                        $scope.events = result.data;
10237                        _this.zoomEvents($scope, $scope.events);
10238                    })["catch"](function (err) {
10239                        $scope.error = true;
10240                    })["finally"](function () {
10241                        $scope.loading = false;
10242                    });
10243                });
10244            }
10245        },
10246        getStateQuery: {
10247            value: function getStateQuery($scope) {
10248                if ($scope.selectedStates && $scope.selectedStates.length) {
10249                    return $scope.selectedStates.map(function (s) {
10250                        return s.value;
10251                    });
10252                }
10253                var selectedRegions = $scope.regions.filter(function (r) {
10254                    return r.selected;
10255                });
10256                return _.flatten(selectedRegions.map(function (r) {
10257                    return r.states.map(function (s) {
10258                        return s.code;
10259                    });
10260                }));
10261            }
10262        },
10263        getAirportQuery: {
10264            value: function getAirportQuery($scope) {
10265                var airports = [];
10266                $scope.selectedAirports.forEach(function (item) {
10267                    var _item$airport = item.airport;
10268                    var icaoId = _item$airport.icaoId;
10269                    var faaId = _item$airport.faaId;
10270
10271                    if (icaoId) {
10272                        airports.push(icaoId);
10273                    }
10274                    if (faaId) {
10275                        airports.push(faaId);
10276                    }
10277                });
10278                return airports;
10279            }
10280        },
10281        querySearch: {
10282            value: function querySearch($scope, query) {
10283                var _this = this;
10284
10285                if (!this.googleService.ready || !query || query.length < 3) {
10286                    return [];
10287                }
10288                return this.allSettled([this.eventService.search({ content: query }), this.airportService.search(query), this.googleService.getPlacePredictions({
10289                    input: query,
10290                    types: ["geocode"],
10291                    componentRestrictions: {
10292                        country: "us"
10293                    }
10294                })]).then(function (_ref) {
10295                    var _ref2 = _slicedToArray(_ref, 3);
10296
10297                    var eventResult = _ref2[0];
10298                    var airportResult = _ref2[1];
10299                    var googleResult = _ref2[2];
10300
10301                    return [{
10302                        id: null,
10303                        type: "category",
10304                        category: "Events:",
10305                        display: ""
10306                    }].concat(_this.convertEventResults(eventResult)).concat({
10307                        id: null,
10308                        type: "category",
10309                        category: "Airports:",
10310                        display: ""
10311                    }).concat(_this.convertAirportResults(airportResult, 5))
10312                    //.concat({
10313                    //    id: null,
10314                    //    type: 'category',
10315                    //    category: 'Locations:',
10316                    //    display: '',
10317                    //    attribution: 'Powered by Google',
10318                    //    attributionUrl: '/dist/images/google-attribution/desktop/powered_by_google_on_white.png'
10319                    //})
10320                    //.concat(this.convertGoogleResults(googleResult));
10321                    ;
10322                });
10323            }
10324        },
10325        allSettled: {
10326            value: function allSettled(promises) {
10327                var mapValues = function mapValues(obj, callback) {
10328                    if (angular.isArray(obj)) {
10329                        return obj.map(callback);
10330                    }
10331                    var ret = {};
10332                    Object.keys(obj).forEach(function (key, val) {
10333                        ret[key] = callback(obj[key], key);
10334                    });
10335                    return ret;
10336                };
10337
10338                return this.$q.all(mapValues(promises, function (promiseOrValue) {
10339                    if (!promiseOrValue.then) {
10340                        return { state: "fulfilled", value: promiseOrValue };
10341                    }
10342                    return promiseOrValue.then(function (value) {
10343                        return { state: "fulfilled", value: value };
10344                    }, function (reason) {
10345                        return { state: "rejected", reason: reason };
10346                    });
10347                }));
10348            }
10349        },
10350        convertEventResults: {
10351            value: function convertEventResults(result) {
10352                if (result.state === "fulfilled") {
10353                    var events = result.value.data;
10354                    if (events && events.length) {
10355                        return events.slice(0, 5).map(function (event) {
10356                            var display = event.name;
10357                            var address = event.address;
10358                            if (address && address.city && address.state) {
10359                                display = display + " (" + address.city + ", " + address.state + ")";
10360                            }
10361                            return {
10362                                id: event.id,
10363                                type: "result",
10364                                subtype: "event",
10365                                event: event,
10366                                display: display
10367                            };
10368                        });
10369                    }
10370                    return {
10371                        id: null,
10372                        type: "placeholder",
10373                        message: "No events found matching your query."
10374                    };
10375                } else {
10376                    console.error("Event search failed:", result);
10377                    return {
10378                        id: null,
10379                        type: "error",
10380                        message: "An error occurred searching events. Please try again later."
10381                    };
10382                }
10383            }
10384        },
10385        convertAirportResults: {
10386            value: function convertAirportResults(result, maxAirports) {
10387                if (result.state === "fulfilled") {
10388                    var airports = result.value;
10389                    if (airports && airports.length) {
10390                        return airports.slice(0, maxAirports).map(function (airport) {
10391                            var display = (airport.icaoId || airport.faaId || "") + ": " + airport.name + (" (" + airport.city + ", " + airport.stateProvince + ")");
10392                            return {
10393                                id: airport.airportId,
10394                                type: "result",
10395                                subtype: "airport",
10396                                airport: airport,
10397                                display: display
10398                            };
10399                        });
10400                    }
10401                    return {
10402                        id: null,
10403                        type: "placeholder",
10404                        message: "No airports found matching your query."
10405                    };
10406                } else {
10407                    console.error("Airport search failed:", result);
10408                    return {
10409                        id: null,
10410                        type: "error",
10411                        message: "An error occurred searching airports. Please try again later."
10412                    };
10413                }
10414            }
10415        },
10416        convertGoogleResults: {
10417            value: function convertGoogleResults(result) {
10418                if (result.state === "fulfilled") {
10419                    var locations = result.value;
10420                    if (locations && locations.length) {
10421                        return locations.slice(0, 5).map(function (r) {
10422                            return {
10423                                id: r.id,
10424                                type: "result",
10425                                subtype: "location",
10426                                location: r,
10427                                display: r.description
10428                            };
10429                        });
10430                    }
10431                    return {
10432                        id: null,
10433                        type: "placeholder",
10434                        message: "No locations found matching your query."
10435                    };
10436                } else {
10437                    console.error("Google search failed:", result);
10438                    return {
10439                        id: null,
10440                        type: "error",
10441                        message: "An error occurred searching locations. Please try again later."
10442                    };
10443                }
10444            }
10445        },
10446        getEventUrl: {
10447            value: function getEventUrl(event) {
10448                if (!event) {
10449                    return null;
10450                }
10451                var baseUrl = "https://hangar.aopa.org/events/item";
10452                if (event.groupId) {
10453                    return "" + baseUrl + "/" + event.groupId + "/" + event.categoryId + "/" + event.id;
10454                }
10455                return "" + baseUrl + "/" + event.categoryId + "/" + event.id;
10456            }
10457        },
10458        onSelectState: {
10459            value: function onSelectState($scope, state) {
10460                if (state && $scope.selectedStates.indexOf(state) === -1) {
10461                    $scope.selectedAirports = [];
10462                    $scope.airportQuery = "";
10463                    this.clearRegions($scope);
10464                    state.selected = true;
10465                    $scope.selectedStates.push(state);
10466                    this.search($scope);
10467                }
10468            }
10469        },
10470        onDeselectState: {
10471            value: function onDeselectState($scope, state) {
10472                state.selected = false;
10473                var i = $scope.selectedStates.indexOf(state);
10474                if (i >= 0) {
10475                    $scope.selectedStates.splice(i, 1);
10476                    this.search($scope);
10477                }
10478            }
10479        },
10480        stateSearch: {
10481            value: function stateSearch($scope, query) {
10482                return $scope.statePromise.then(function (states) {
10483                    if (query) {
10484                        var _ret = (function () {
10485                            var lowercaseQuery = angular.lowercase(query);
10486                            return {
10487                                v: states.filter(function (state) {
10488                                    var code = (state.value || "").toLowerCase();
10489                                    var name = code ? (state.text || "").toLowerCase() : "";
10490                                    return code.indexOf(lowercaseQuery) === 0 || name.indexOf(lowercaseQuery) === 0;
10491                                })
10492                            };
10493                        })();
10494
10495                        if (typeof _ret === "object") return _ret.v;
10496                    }
10497                    return $scope.states;
10498                });
10499            }
10500        },
10501        onSelectAirport: {
10502            value: function onSelectAirport($scope, item) {
10503                if (item && $scope.selectedAirports.indexOf(item) === -1) {
10504                    $scope.selectedStates = [];
10505                    $scope.stateQuery = "";
10506                    this.clearRegions($scope);
10507                    item.selected = true;
10508                    $scope.selectedAirports.push(item);
10509                    this.search($scope);
10510                }
10511            }
10512        },
10513        onDeselectAirport: {
10514            value: function onDeselectAirport($scope, item) {
10515                item.selected = false;
10516                var i = $scope.selectedAirports.indexOf(item);
10517                if (i >= 0) {
10518                    $scope.selectedAirports.splice(i, 1);
10519                    this.search($scope);
10520                }
10521            }
10522        },
10523        airportSearch: {
10524            value: function airportSearch($scope, query) {
10525                var _this = this;
10526
10527                if (!query || query.length < 3) {
10528                    return [];
10529                }
10530                return this.airportService.search(query).then(function (airportResults) {
10531                    return _this.convertAirportResults({ state: "fulfilled", value: airportResults }, 10);
10532                });
10533            }
10534        },
10535        clearRegions: {
10536            value: function clearRegions($scope) {
10537                $scope.regions.forEach(function (region) {
10538                    return region.selected = false;
10539                });
10540            }
10541        },
10542        onToggleRegion: {
10543            value: function onToggleRegion($scope, region) {
10544                if (region.selected) {
10545                    $scope.selectedAirports = [];
10546                    $scope.airportQuery = "";
10547                    $scope.selectedStates = [];
10548                    $scope.stateQuery = "";
10549                }
10550                this.search($scope);
10551            }
10552        },
10553        onToggleCategory: {
10554            value: function onToggleCategory($scope, category) {
10555                this.search($scope);
10556            }
10557        },
10558        onSelectDateRange: {
10559            value: function onSelectDateRange($scope) {
10560                this.search($scope);
10561            }
10562        },
10563        clearDateRange: {
10564            value: function clearDateRange($scope) {
10565                $scope.dateRange.selectedTemplate = null;
10566                $scope.dateRange.selectedTemplateName = null;
10567                $scope.dateRange.dateStart = null;
10568                $scope.dateRange.dateEnd = null;
10569                this.search($scope);
10570            }
10571        },
10572        pageChanged: {
10573            value: function pageChanged($scope, newPage) {
10574                $scope.currentPage = newPage;
10575                this.search($scope, false);
10576            }
10577        },
10578        onMarkerClick: {
10579            value: function onMarkerClick($scope, clickEvent, event) {
10580                var url = this.eventService.getEventUrl(event);
10581                if (url) {
10582                    window.open(url);
10583                }
10584            }
10585        }
10586    }, {
10587        directiveFactory: {
10588            value: function directiveFactory($q, $http, $timeout, $filter, airportService, eventService, googleService, NgMap) {
10589                EventSearch.instance = new EventSearch($q, $http, $timeout, $filter, airportService, eventService, googleService, NgMap);
10590                return EventSearch.instance;
10591            }
10592        }
10593    });
10594
10595    return EventSearch;
10596})();
10597
10598EventSearch.directiveFactory.$inject = ["$q", "$http", "$timeout", "$filter", "airportService", "eventService", "googleService", "NgMap"];
10599
10600module.exports = EventSearch;
10601
10602},{}],66:[function(require,module,exports){
10603"use strict";
10604
10605var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
10606
10607var AirportService = _interopRequire(require("./services/AirportService"));
10608
10609var EventService = _interopRequire(require("./services/EventService"));
10610
10611var GoogleService = _interopRequire(require("./services/GoogleService"));
10612
10613var EventSearch = _interopRequire(require("./directives/EventSearch"));
10614
10615var Event = _interopRequire(require("./directives/Event"));
10616
10617(function (angular) {
10618    "use strict";
10619
10620    var eventApp = angular.module("AopaEventSearch", ["ngMaterial", "ngMap", "ngMaterialDateRangePicker", "angularUtils.directives.dirPagination", "aopa.shared"]);
10621
10622    eventApp.service("airportService", AirportService);
10623    eventApp.service("eventService", EventService);
10624    eventApp.service("googleService", GoogleService);
10625    eventApp.directive("eventSearch", EventSearch.directiveFactory);
10626    eventApp.directive("event", Event.directiveFactory);
10627})(window.angular);
10628
10629},{"./directives/Event":64,"./directives/EventSearch":65,"./services/AirportService":67,"./services/EventService":68,"./services/GoogleService":69}],67:[function(require,module,exports){
10630"use strict";
10631
10632var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
10633
10634var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
10635
10636/**
10637 * AOPA Airports API proxy.
10638 */
10639
10640var AirportService = (function () {
10641    function AirportService($http, $q) {
10642        _classCallCheck(this, AirportService);
10643
10644        this.baseUrl = Aopa.AIRPORTS_API_URL;
10645        this.$http = $http;
10646        this.$q = $q;
10647    }
10648
10649    _createClass(AirportService, {
10650        search: {
10651
10652            /**
10653             * Returns autocomplete suggestsions for airports
10654             * @param {String} query
10655             * @returns {Array<Object>} Airports
10656             */
10657
10658            value: function search(query) {
10659                var _this = this;
10660
10661                return this.$q(function (resolve, reject) {
10662                    try {
10663                        _this.$http.get("" + _this.baseUrl + "/airportsautocomplete/" + encodeURIComponent(query)).then(function (response) {
10664                            return resolve(response.data);
10665                        })["catch"](function (e) {
10666                            return reject(e);
10667                        });
10668                    } catch (e) {
10669                        reject(e);
10670                    }
10671                });
10672            }
10673        }
10674    });
10675
10676    return AirportService;
10677})();
10678
10679AirportService.$inject = ["$http", "$q"];
10680
10681module.exports = AirportService;
10682
10683},{}],68:[function(require,module,exports){
10684"use strict";
10685
10686var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
10687
10688var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
10689
10690/**
10691 * AOPA Event Service proxy.
10692 */
10693
10694var EventService = (function () {
10695    function EventService($http, $q) {
10696        _classCallCheck(this, EventService);
10697
10698        this.baseUrl = Aopa.AERIUM_API_URL;
10699        this.$http = $http;
10700        this.$q = $q;
10701    }
10702
10703    _createClass(EventService, {
10704        getEvents: {
10705
10706            /**
10707             * Returns all events from the API (note the results are paginated).
10708             * @returns {Array<Object>} Events
10709             */
10710
10711            value: function getEvents() {
10712                var _this = this;
10713
10714                return this.$q(function (resolve, reject) {
10715                    try {
10716                        _this.$http.get("" + _this.baseUrl + "/events").then(function (response) {
10717                            return resolve(response.data);
10718                        })["catch"](function (e) {
10719                            return reject(e);
10720                        });
10721                    } catch (e) {
10722                        reject(e);
10723                    }
10724                });
10725            }
10726        },
10727        getEventCategories: {
10728
10729            /**
10730             * Returns all event categories from the API (note the results are paginated).
10731             * @returns {Array<Object>} Event categories
10732             */
10733
10734            value: function getEventCategories() {
10735                var _this = this;
10736
10737                return this.$q(function (resolve, reject) {
10738                    try {
10739                        _this.$http.get("" + _this.baseUrl + "/event-categories").then(function (response) {
10740                            return resolve(response.data);
10741                        })["catch"](function (e) {
10742                            return reject(e);
10743                        });
10744                    } catch (e) {
10745                        reject(e);
10746                    }
10747                });
10748            }
10749        },
10750        search: {
10751
10752            /**
10753             * Searches for events matching the specified parameters.
10754             * @param params {Object} Event search parameters. This should be an object that has one or more of
10755             *   the following properties:
10756             *      - name {String}: Event name
10757             *      - description {String}: Event description
10758             *      - content {String}: Pseudo-property representing either event name or description.
10759             *      - startDate {String}: Event start date
10760             *      - endDate {String}: Event end date
10761             *      - categories {Array<String>}: Event category IDs
10762             *      - states {Array<String>}: State codes
10763             *      - airports {Array<String>}: Airport identifiers
10764             *      - lat {Number}: Latitude. When specified, lon and radius are also required.
10765             *      - lon {Number}: Longitude. When specified, lat and radius are also required.
10766             *      - radius {Number}: Radius in miles. When specified, lat/lon are also required.
10767             *      - offset {Number}: Pagination offset
10768             *      - limit {Number}: Pagination limit
10769             * @returns {Array<Object>} Events matching the supplied search parameters
10770             */
10771
10772            value: function search(params) {
10773                var _this = this;
10774
10775                return this.$q(function (resolve, reject) {
10776                    try {
10777                        params.offset = params.offset || 0;
10778                        params.limit = params.limit || 10;
10779                        var lat = params.lat;
10780                        var lon = params.lon;
10781                        var radius = params.radius;
10782
10783                        if (Object.keys(params).every(function (k) {
10784                            return !params[k];
10785                        })) {
10786                            throw new Error("At least one search parameter is required.");
10787                        }
10788                        if ((lat || lon || radius) && !(lat && lon && radius)) {
10789                            throw new Error("When lat, lon, or radius are specified, all three parameters are required.");
10790                        }
10791                        var query = _this.encodeParams(params);
10792                        _this.$http.get("" + _this.baseUrl + "/events/search?" + query).then(function (response) {
10793                            resolve({
10794                                total: response.headers("X-Pagination-Total"),
10795                                data: response.data
10796                            });
10797                        })["catch"](function (e) {
10798                            return reject(e);
10799                        });
10800                    } catch (e) {
10801                        reject(e);
10802                    }
10803                });
10804            }
10805        },
10806        getEventUrl: {
10807
10808            /**
10809             * Returns the event URL for the given event.
10810             */
10811
10812            value: function getEventUrl(event) {
10813                var groupId = event.groupId;
10814                var categoryId = event.categoryId;
10815                var id = event.id;
10816
10817                if (groupId) {
10818                    return "https://hangar.aopa.org/groups/events/item/" + groupId + "/" + categoryId + "/" + id;
10819                }
10820                return "https://hangar.aopa.org/events/item/" + categoryId + "/" + id;
10821            }
10822        },
10823        encodeParams: {
10824
10825            /**
10826             * Encodes an object's keys and values as a URL query parameter.
10827             */
10828
10829            value: function encodeParams(params) {
10830                var ret = [];
10831                for (var d in params) {
10832                    (function (d) {
10833                        var k = encodeURIComponent(d);
10834                        var v = params[d];
10835                        if (_.isArray(v)) {
10836                            v.forEach(function (item) {
10837                                return ret.push(k + "=" + encodeURIComponent(item));
10838                            });
10839                        } else {
10840                            ret.push(k + "=" + encodeURIComponent(v));
10841                        }
10842                    })(d);
10843                }
10844                return ret.join("&");
10845            }
10846        }
10847    });
10848
10849    return EventService;
10850})();
10851
10852EventService.$inject = ["$http", "$q"];
10853
10854module.exports = EventService;
10855
10856},{}],69:[function(require,module,exports){
10857"use strict";
10858
10859var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
10860
10861var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
10862
10863/**
10864 * Google Maps API proxy
10865 */
10866
10867var GoogleService = (function () {
10868    function GoogleService($http, $q) {
10869        _classCallCheck(this, GoogleService);
10870
10871        this._initialized = false;
10872        this.$http = $http;
10873        this.$q = $q;
10874    }
10875
10876    _createClass(GoogleService, {
10877        ready: {
10878
10879            /**
10880             * Returns true if the service has been initialized.
10881             */
10882
10883            get: function () {
10884                return this._initialized;
10885            }
10886        },
10887        init: {
10888
10889            /**
10890             * Initializes the service. This method should only be called when the Google Maps API
10891             * has finished loading.
10892             */
10893
10894            value: function init(map) {
10895                if (typeof google === "undefined") {
10896                    throw new Error("Google Maps API not loaded.");
10897                }
10898                this._map = map;
10899                this._autocomplete = new google.maps.places.AutocompleteService();
10900                this._geocoder = new google.maps.Geocoder();
10901                this._initialized = true;
10902            }
10903        },
10904        getPlacePredictions: {
10905
10906            /**
10907             * Retrieves place autocomplete predictions based on the supplied autocomplete request.
10908             * @param {google.maps.places.AutocompletionRequest} query
10909             * @returns {Promise<google.maps.places.AutocompletePrediction[]>}
10910             */
10911
10912            value: function getPlacePredictions(query) {
10913                var d = this.$q.defer();
10914                this._autocomplete.getPlacePredictions(query, function (results, status) {
10915                    if (status === "ZERO_RESULTS") {
10916                        return d.resolve([]);
10917                    }
10918                    if (status === "OK") {
10919                        d.resolve(results);
10920                    } else d.reject(status);
10921                });
10922                return d.promise;
10923            }
10924        },
10925        geocode: {
10926
10927            /**
10928             * Returns the geographical location of the given geocode query.
10929             * @param {google.maps.GeocoderRequest} query
10930             * @returns {Promise<GeocoderResult[]>}
10931             */
10932
10933            value: function geocode(query) {
10934                var d = this.$q.defer();
10935                this._geocoder.geocode(query, function (results, status) {
10936                    if (status === "ZERO_RESULTS") {
10937                        return d.resolve([]);
10938                    }
10939                    if (status === "OK") {
10940                        d.resolve(results);
10941                    } else d.reject(status);
10942                });
10943                return d.promise;
10944            }
10945        }
10946    });
10947
10948    return GoogleService;
10949})();
10950
10951GoogleService.$inject = ["$http", "$q"];
10952
10953module.exports = GoogleService;
10954
10955},{}],70:[function(require,module,exports){
10956"use strict";
10957
10958$(document).ready(function () {
10959    if ($("div#divAviatorShowcaseSignIn").length) {
10960        var rpForm = $("#frmAviatorShowcaseSignIn");
10961        var flagSearch = "Search";
10962        var flagCheckIn = "CheckIn";
10963        var flagCheckInAll = "CheckInAll";
10964        var flagClearSearch = "ClearSearch";
10965        var flagSearchReturn = "SearchReturn";
10966        var flagLoadCheckin = "LoadCheckin";
10967
10968        //
10969        // Search click
10970        //
10971        $("#btnSearch").click(function () {
10972            $("#FormMode").val(flagSearch);
10973
10974            if (rpForm.valid()) {
10975                rpForm.submit();
10976            }
10977        });
10978
10979        //
10980        // Clear Search click
10981        //
10982        $("#btnClearSearch").click(function () {
10983            $("#FormMode").val(flagClearSearch);
10984            rpForm.submit();
10985        });
10986
10987        //
10988        // Back to search
10989        //
10990        $(".back-to-search").click(function () {
10991            $("#FormMode").val(flagSearchReturn);
10992
10993            if ($("div#divQuestionnaire").length) {
10994                $("#divQuestionnaire *").prop("disabled", true);
10995            }
10996
10997            if ($("div#divCreateCustomer").length) {
10998                $("#divCreateCustomer *").prop("disabled", true);
10999            }
11000
11001            rpForm.submit();
11002        });
11003
11004        //
11005        // Goto checkin
11006        //
11007        $(document).on("click", ".view-checkin-button", function (e) {
11008            $("#FormMode").val(flagLoadCheckin);
11009            $("#CheckinMasterCustomerId").val($(this).data("mcid"));
11010            $("#CheckInSubCustomerId").val($(this).data("scid"));
11011            $("#CheckinOrderNumber").val($(this).data("ordnum"));
11012            $("#CheckinProductCode").val($("#RPEvent").val());
11013            rpForm.submit();
11014        });
11015
11016        //
11017        // Process checkin
11018        //
11019        $(document).on("click", ".checkin-action-button", function (e) {
11020            $("#FormMode").val(flagCheckIn);
11021            $("#CheckInOrderLineNumber").val($(this).data("lineno"));
11022            $("#CheckInBadgeSequence").val($(this).data("badgeseq"));
11023            rpForm.submit();
11024        });
11025
11026        // Process checkin
11027        //
11028        $(document).on("click", ".checkinall-action-button", function (e) {
11029            $("#FormMode").val(flagCheckInAll);
11030            $("#CheckinAllList").val($(this).data("cialllist"));
11031            rpForm.submit();
11032        });
11033    };
11034});
11035
11036},{}],71:[function(require,module,exports){
11037"use strict";
11038
11039$(document).ready(function () {
11040    if ($("div#divRustyPilotSignIn").length) {
11041        var rpForm = $("#frmRustyPilotSignIn");
11042        var flagSearch = "Search";
11043        var flagCheckIn = "CheckIn";
11044        var flagClearSearch = "ClearSearch";
11045        var flagCreateCustomer = "CreateCustomer";
11046        var flagCreateOrder = "CreateOrder";
11047        var flagLoadCreateOrder = "LoadCreateOrder";
11048        var flagSearchReturn = "SearchReturn";
11049        var flagLoadCheckin = "LoadCheckin";
11050        var flagLoadCreateCustomer = "LoadCreateCustomer";
11051
11052        //
11053        // Search click
11054        //
11055        $("#btnSearch").click(function () {
11056            $("#FormMode").val(flagSearch);
11057
11058            if (rpForm.valid()) {
11059                rpForm.submit();
11060            }
11061        });
11062
11063        //
11064        // Load Create New Customer click
11065        //
11066        $("#btnCreateNewCustomer").click(function () {
11067            $("#FormMode").val(flagLoadCreateCustomer);
11068
11069            rpForm.submit();
11070        });
11071
11072        //
11073        // Create New Customer click
11074        //
11075        $("#btnCreateCustomer").click(function () {
11076            $("#FormMode").val(flagCreateCustomer);
11077
11078            if (rpForm.valid()) {
11079                rpForm.submit();
11080            }
11081        });
11082
11083        //
11084        // Clear Search click
11085        //
11086        $("#btnClearSearch").click(function () {
11087            $("#FormMode").val(flagClearSearch);
11088            rpForm.submit();
11089        });
11090
11091        //
11092        // Back to search
11093        //
11094        $(".back-to-search").click(function () {
11095            $("#FormMode").val(flagSearchReturn);
11096
11097            if ($("div#divQuestionnaire").length) {
11098                $("#divQuestionnaire *").prop("disabled", true);
11099            }
11100
11101            if ($("div#divCreateCustomer").length) {
11102                $("#divCreateCustomer *").prop("disabled", true);
11103            }
11104
11105            rpForm.submit();
11106        });
11107
11108        //
11109        // Goto checkin
11110        //
11111        $(document).on("click", ".view-checkin-button", function (e) {
11112            $("#FormMode").val(flagLoadCheckin);
11113            $("#CheckinMasterCustomerId").val($(this).data("mcid"));
11114            $("#CheckInSubCustomerId").val($(this).data("scid"));
11115            $("#CheckinOrderNumber").val($(this).data("ordnum"));
11116            $("#CheckinProductCode").val($("#RPEvent").val());
11117            rpForm.submit();
11118        });
11119
11120        //
11121        // Process checkin
11122        //
11123        $(document).on("click", ".checkin-action-button", function (e) {
11124            $("#FormMode").val(flagCheckIn);
11125            $("#CheckInOrderLineNumber").val($(this).data("lineno"));
11126            rpForm.submit();
11127        });
11128
11129        //
11130        // Goto create order
11131        //
11132        $(document).on("click", ".create-order-button", function (e) {
11133            $("#FormMode").val(flagLoadCreateOrder);
11134            $("#CreateOrderMasterCustomerId").val($(this).data("mcid"));
11135            $("#CreateOrderSubCustomerId").val($(this).data("scid"));
11136            $("#CreateOrderProductCode").val($("#RPEvent").val());
11137            rpForm.submit();
11138        });
11139
11140        //
11141        // Create the order
11142        //
11143        $(".create-registration").click(function () {
11144            if (rpForm.valid()) {
11145                $("#FormMode").val(flagCreateOrder);
11146                rpForm.submit();
11147            }
11148        });
11149
11150        //
11151        // Questionnaire fields
11152        //
11153        //
11154        // Reset the questionnaire fields on page load
11155        //
11156        if ($("#QuestionnaireData").val()) {
11157            var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
11158            for (var i = 0; i < data.length; i++) {
11159                switch (data[i].type) {
11160                    case "Select":
11161                        $("#MPQuestionSelect" + data[i].qid + " option[value=\"" + data[i].qa + "\"]").prop("selected", true);
11162                        break;
11163                    case "CB":
11164                        var answers = data[i].qa.split(",");
11165                        $.each(answers, function (index, obj) {
11166                            $("input.MPQuestionCB" + data[i].qid + "[value=\"" + obj + "\"]").prop("checked", true);
11167                        });
11168                        break;
11169                }
11170            }
11171        }
11172
11173        $(".MPQuestionSelect").change(function () {
11174            var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
11175            var qid = this.id.replace("MPQuestionSelect", "");
11176            var idx = -1;
11177            var ct = 0;
11178
11179            $.each(data, function () {
11180                if (this.qid.toString() === qid) {
11181                    idx = ct;
11182                    return false;
11183                }
11184                ct++;
11185            });
11186
11187            if (idx != -1) {
11188                data[idx].qa = this.value;
11189            }
11190
11191            $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
11192        });
11193
11194        $(".MPQuestionCB").change(function () {
11195            var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
11196            var cbid = this.id;
11197            var qid = this.id.replace("MPQuestionCB", "");
11198            var anslist = "";
11199            var idx = -1;
11200            var ct = 0;
11201
11202            $.each(data, function () {
11203                if (this.qid.toString() === qid) {
11204                    idx = ct;
11205                    return false;
11206                }
11207                ct++;
11208            });
11209
11210            $("." + cbid).each(function (index, obj) {
11211                if (this.checked) {
11212                    anslist += this.value + ",";
11213                }
11214            });
11215            anslist = anslist.slice(0, -1);
11216
11217            if (idx != -1) {
11218                data[idx].qa = anslist;
11219            }
11220
11221            $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
11222        });
11223    };
11224});
11225
11226},{}],72:[function(require,module,exports){
11227"use strict";
11228
11229$(document).ready(function () {
11230    if ($("div#divVolunteerForm").length) {
11231        var volForm = $("#frmVolunteerForm");
11232        var flagSearch = "Search";
11233        var flagSearchReturn = "SearchReturn";
11234        var flagClearSearch = "ClearSearch";
11235        var flagLoadCreateCustomer = "LoadCreateCustomer";
11236        var flagCreateCustomer = "CreateCustomer";
11237        var flagLoadVolunteer = "LoadVolunteer";
11238        var flagVolunteer = "Volunteer";
11239        var flagProcessVolunteer = "ProcessVolunteer";
11240
11241        //
11242        // Search click
11243        //
11244        $("#btnSearch").click(function () {
11245            $("#FormMode").val(flagSearch);
11246
11247            if (volForm.valid()) {
11248                volForm.submit();
11249            }
11250        });
11251
11252        //
11253        // Load Create New Customer click
11254        //
11255        $("#btnCreateNewCustomer").click(function () {
11256            $("#FormMode").val(flagLoadCreateCustomer);
11257
11258            volForm.submit();
11259        });
11260
11261        //
11262        // Create New Customer click
11263        //
11264        $("#btnCreateCustomer").click(function () {
11265            $("#FormMode").val(flagCreateCustomer);
11266
11267            if (volForm.valid()) {
11268                volForm.submit();
11269            }
11270        });
11271
11272        //
11273        // Clear Search click
11274        //
11275        $("#btnClearSearch").click(function () {
11276            $("#FormMode").val(flagClearSearch);
11277            volForm.submit();
11278        });
11279
11280        //
11281        // Back to search
11282        //
11283        $(".back-to-search").click(function () {
11284            $("#FormMode").val(flagSearchReturn);
11285
11286            if ($("div#divCreateCustomer").length) {
11287                $("#divCreateCustomer *").prop("disabled", true);
11288            }
11289
11290            volForm.submit();
11291        });
11292
11293        //
11294        // Goto Volunteer
11295        //
11296        $(document).on("click", ".view-checkin-button", function (e) {
11297            $("#FormMode").val(flagLoadVolunteer);
11298            $("#VolunteerMasterCustomerId").val($(this).data("mcid"));
11299            $("#VolunteerSubCustomerId").val($(this).data("scid"));
11300            volForm.submit();
11301        });
11302
11303        //
11304        // Process Volunteer
11305        //
11306        $("#btnProcessVolunteer").click(function () {
11307            $("#FormMode").val(flagProcessVolunteer);
11308
11309            if (volForm.valid()) {
11310                $("#btnSearch").hide();
11311                $("#btnCreateNewCustomer").hide();
11312                $("#btnClearSearch").hide();
11313                $("#btnBackToSearch1").hide();
11314                $("#btnBackToSearch3").hide();
11315                $("#btnCreateCustomer").hide();
11316                $("#btnProcessVolunteer").hide();
11317                $(".search-center").append("<div class=\"spinner spinner--clockwise\"></div>");
11318                volForm.submit();
11319            }
11320        });
11321
11322        //
11323        // Update existing job
11324        //
11325        $(".vol-job-selection-sel").on("change", function () {
11326            var job = document.getElementById(this.id);
11327
11328            var jobid = parseInt($(this).data("vejid"), 10);
11329
11330            var options = JSON.parse(decodeURIComponent($("#VolunteerData").val()));
11331
11332            $.each(options, function (i, v) {
11333                if (v.VolunteerEventJobId === jobid) {
11334                    v.AssignmentStatusCode = job.value;
11335                    v.Updated = true;
11336                }
11337            });
11338
11339            $("#VolunteerData").val(encodeURIComponent(JSON.stringify(options)));
11340        });
11341
11342        //
11343        // Update Available Job
11344        //
11345        $(".vol-job-selection-cb").click(function () {
11346            var cb = document.getElementById(this.id);
11347            var jobid = parseInt($(this).data("vejid"), 10);
11348
11349            var options = JSON.parse(decodeURIComponent($("#VolunteerData").val()));
11350
11351            $.each(options, function (i, v) {
11352                if (v.VolunteerEventJobId === jobid) {
11353                    if (cb.checked) {
11354                        v.AssignmentStatusCode = cb.value;
11355                        v.Updated = true;
11356                    } else {
11357                        v.AssignmentStatusCode = "";
11358                        v.Updated = false;
11359                    }
11360                }
11361            });
11362
11363            $("#VolunteerData").val(encodeURIComponent(JSON.stringify(options)));
11364        });
11365
11366        $(".event-signin__search-button").click(function () {
11367            if (volForm.valid()) {
11368                $("#btnSearch").hide();
11369                $("#btnCreateNewCustomer").hide();
11370                $("#btnClearSearch").hide();
11371                $("#btnBackToSearch1").hide();
11372                $("#btnBackToSearch3").hide();
11373                $("#btnCreateCustomer").hide();
11374                $("#btnProcessVolunteer").hide();
11375                $(".search-center").append("<div class=\"spinner spinner--clockwise\"></div>");
11376            }
11377        });
11378    };
11379});
11380
11381},{}],73:[function(require,module,exports){
11382// JavaScript Document
11383
11384//old banner dropdown	
11385"use strict";
11386
11387$(".expanding").mouseenter(function () {
11388	$(".hideAd").fadeIn(300);
11389});
11390$(".adClose").click(function () {
11391	$(".hideAd").fadeOut(300);
11392});
11393
11394//sidebar dropdown
11395$(".hideAdHover").each(function (i) {
11396	$(this).position({
11397		my: "right top",
11398		at: "right top",
11399		of: $(this).parent("div.expandingHover"),
11400		collision: "none"
11401	});
11402});
11403
11404$("div.expandingHover").each(function (i) {
11405	$(this).bind({
11406		mouseenter: function mouseenter() {
11407			$(".hideAdHover").stop(true, true).fadeIn(400).removeClass("hiddenAd");
11408			return false;
11409		},
11410
11411		mouseleave: function mouseleave() {
11412			$(".hideAdHover").stop(true, true).fadeOut(400).addClass("hiddenAd");
11413			return false;
11414		}
11415	});
11416});
11417
11418//Banner Dropdown
11419$("#banner-expand").mouseenter(function () {
11420	$("#expanded-ad").stop(true, true).slideDown();
11421});
11422$("#expanded-ad").mouseleave(function () {
11423	$(this).stop(true, true).slideUp();
11424});
11425
11426},{}],74:[function(require,module,exports){
11427// AOPA Aviation Finance Form
11428//Creating the click function to show the form
11429"use strict";
11430
11431var showHiddenForm = (function (_showHiddenForm) {
11432  var _showHiddenFormWrapper = function showHiddenForm() {
11433    return _showHiddenForm.apply(this, arguments);
11434  };
11435
11436  _showHiddenFormWrapper.toString = function () {
11437    return _showHiddenForm.toString();
11438  };
11439
11440  return _showHiddenFormWrapper;
11441})(function () {
11442  $(".hiddenFinanceForm").slideDown(400);
11443  $(".activateForm").unbind("click", showHiddenForm); //unbind the click function
11444  if ($(window).width() >= 500) {
11445    $(".visibleFinanceForm__wrapper .ctaBtns button:first-child").css({ "background-color": "#00a3e0", color: "#ffffff", float: "right" }).removeClass("activateForm");
11446  } else {
11447    $(".visibleFinanceForm__wrapper .ctaBtns button:first-child").css({ "background-color": "#00a3e0", color: "#ffffff" }).removeClass("activateForm");
11448  }
11449  findFormSize();
11450});
11451//bind the click function to the button
11452$(".activateForm").bind("click", showHiddenForm);
11453//close the form is mouse clicked anywhere outside of it's wrapper
11454$(document).mouseup(function (e) {
11455  var container = $(".hiddenFinanceForm");
11456
11457  if (!container.is(e.target) // if the target of the click isn't the container...
11458   && container.has(e.target).length === 0) // ... nor a descendant of the container
11459    {
11460      container.slideUp(400);
11461      //bind the click function when the form closes and re-add it's styles
11462      $(".activateForm").bind("click", showHiddenForm);
11463
11464      if ($(window).width() >= 500) {
11465        $(".visibleFinanceForm__wrapper .ctaBtns button:first-child").css({ "background-color": "transparent", color: "#00a3e0", float: "right" }).addClass("activateForm");
11466      } else {
11467        $(".visibleFinanceForm__wrapper .ctaBtns button:first-child").css({ "background-color": "transparent", color: "#00a3e0" }).addClass("activateForm");
11468      }
11469    }
11470});
11471
11472// Listen to message from child IFrame window
11473function findFormSize() {
11474  // Here "addEventListener" is for standards-compliant web browsers and "attachEvent" is for IE Browsers.
11475  var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
11476  var eventer = window[eventMethod];
11477
11478  // Now...
11479  // if
11480  //    "attachEvent", then we need to select "onmessage" as the event.
11481  // if
11482  //    "addEventListener", then we need to select "message" as the event
11483
11484  var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
11485
11486  eventer(messageEvent, function (e) {
11487    console.log(e.data);
11488    var financeFormHeight = e.data;
11489
11490    //find the scroll height and dynamically change the iframe height
11491    $("#frameId").height(financeFormHeight + 100);
11492    //When the form is completed it sends a height of 0 to AOPA.org so that the user
11493    //is scrolled to the top of the page to read the thankyou message. Then a new post
11494    //message is sent as the thankyou page loads and runs the parent function again.
11495    if (financeFormHeight == 0) {
11496      $("html,body").animate({ scrollTop: 0 }, "slow");
11497      findFormSize();
11498      console.log("the form height is 0 which means the user clicked submit");
11499    }
11500  }, false);
11501};
11502
11503//resize the iframe when page loads and resizes
11504$(window).on("load resize", function () {
11505  findFormSize();
11506});
11507
11508//JSON script of makes and models of planes turned into an object
11509var jsonData = {
11510  Planes: [{
11511    ID: 1,
11512    Make: "Aeronca",
11513    Model: "Champ",
11514    Engine: "Piston",
11515    "Engine Number": "Single Engine",
11516    Category: "Airplane"
11517  }, {
11518    ID: 2,
11519    Make: "Aerostar",
11520    Model: "600",
11521    Engine: "Piston",
11522    "Engine Number": "Twin Engine",
11523    Category: "Airplane"
11524  }, {
11525    ID: 3,
11526    Make: "Aerostar",
11527    Model: "601",
11528    Engine: "Piston",
11529    "Engine Number": "Twin Engine",
11530    Category: "Airplane"
11531  }, {
11532    ID: 4,
11533    Make: "Aerostar",
11534    Model: "602",
11535    Engine: "Piston",
11536    "Engine Number": "Twin Engine",
11537    Category: "Airplane"
11538  }, {
11539    ID: 5,
11540    Make: "Aerostar",
11541    Model: "700",
11542    Engine: "Piston",
11543    "Engine Number": "Twin Engine",
11544    Category: "Airplane"
11545  }, {
11546    ID: 6,
11547    Make: "Agusta",
11548    Model: "Koala A119 KE",
11549    Engine: "Turbine",
11550    "Engine Number": "Single Engine",
11551    Category: "Helicopter"
11552  }, {
11553    ID: 7,
11554    Make: "Agusta",
11555    Model: "A109",
11556    Engine: "Turbine",
11557    "Engine Number": "Twin Engine",
11558    Category: "Helicopter"
11559  }, {
11560    ID: 8,
11561    Make: "Agusta",
11562    Model: "Aw139",
11563    Engine: "Turbine",
11564    "Engine Number": "Twin Engine",
11565    Category: "Helicopter"
11566  }, {
11567    ID: 9,
11568    Make: "AMD",
11569    Model: "Zodiac XL",
11570    Engine: "Piston",
11571    "Engine Number": "Single Engine",
11572    Category: "Airplane"
11573  }, {
11574    ID: 10,
11575    Make: "American Champion",
11576    Model: "Citabria",
11577    Engine: "Piston",
11578    "Engine Number": "Single Engine",
11579    Category: "Airplane"
11580  }, {
11581    ID: 11,
11582    Make: "American Champion",
11583    Model: "Scout",
11584    Engine: "Piston",
11585    "Engine Number": "Single Engine",
11586    Category: "Airplane"
11587  }, {
11588    ID: 12,
11589    Make: "American Champion",
11590    Model: "Decathlon",
11591    Engine: "Piston",
11592    "Engine Number": "Single Engine",
11593    Category: "Airplane"
11594  }, {
11595    ID: 13,
11596    Make: "American General",
11597    Model: "Yankee",
11598    Engine: "Piston",
11599    "Engine Number": "Single Engine",
11600    Category: "Airplane"
11601  }, {
11602    ID: 14,
11603    Make: "American General",
11604    Model: "Cheetah",
11605    Engine: "Piston",
11606    "Engine Number": "Single Engine",
11607    Category: "Airplane"
11608  }, {
11609    ID: 15,
11610    Make: "American General",
11611    Model: "Tiger",
11612    Engine: "Piston",
11613    "Engine Number": "Single Engine",
11614    Category: "Airplane"
11615  }, {
11616    ID: 16,
11617    Make: "American General",
11618    Model: "Cougar",
11619    Engine: "Piston",
11620    "Engine Number": "Twin Engine",
11621    Category: "Airplane"
11622  }, {
11623    ID: 17,
11624    Make: "American Legend",
11625    Model: "Legend Cub",
11626    Engine: "Piston",
11627    "Engine Number": "Single Engine",
11628    Category: "Airplane"
11629  }, {
11630    ID: 18,
11631    Make: "Aviat",
11632    Model: "Husky",
11633    Engine: "Piston",
11634    "Engine Number": "Single Engine",
11635    Category: "Airplane"
11636  }, {
11637    ID: 19,
11638    Make: "Aviat",
11639    Model: "Pitts S2B",
11640    Engine: "Piston",
11641    "Engine Number": "Single Engine",
11642    Category: "Airplane"
11643  }, {
11644    ID: 20,
11645    Make: "Beech",
11646    Model: "Skipper 77",
11647    Engine: "Piston",
11648    "Engine Number": "Single Engine",
11649    Category: "Airplane"
11650  }, {
11651    ID: 21,
11652    Make: "Beech",
11653    Model: "Sport 19",
11654    Engine: "Piston",
11655    "Engine Number": "Single Engine",
11656    Category: "Airplane"
11657  }, {
11658    ID: 22,
11659    Make: "Beech",
11660    Model: "Musketeer",
11661    Engine: "Piston",
11662    "Engine Number": "Single Engine",
11663    Category: "Airplane"
11664  }, {
11665    ID: 23,
11666    Make: "Beech",
11667    Model: "Sundowner",
11668    Engine: "Piston",
11669    "Engine Number": "Single Engine",
11670    Category: "Airplane"
11671  }, {
11672    ID: 24,
11673    Make: "Beech",
11674    Model: "Sierra",
11675    Engine: "Piston",
11676    "Engine Number": "Single Engine",
11677    Category: "Airplane"
11678  }, {
11679    ID: 25,
11680    Make: "Beech",
11681    Model: "Debonair",
11682    Engine: "Piston",
11683    "Engine Number": "Single Engine",
11684    Category: "Airplane"
11685  }, {
11686    ID: 26,
11687    Make: "Beech",
11688    Model: "Bonanza 33",
11689    Engine: "Piston",
11690    "Engine Number": "Single Engine",
11691    Category: "Airplane"
11692  }, {
11693    ID: 27,
11694    Make: "Beech",
11695    Model: "Bonanza 35",
11696    Engine: "Piston",
11697    "Engine Number": "Single Engine",
11698    Category: "Airplane"
11699  }, {
11700    ID: 28,
11701    Make: "Beech",
11702    Model: "Bonanza A36",
11703    Engine: "Piston",
11704    "Engine Number": "Single Engine",
11705    Category: "Airplane"
11706  }, {
11707    ID: 29,
11708    Make: "Beech",
11709    Model: "Twin Bonanza",
11710    Engine: "Piston",
11711    "Engine Number": "Twin Engine",
11712    Category: "Airplane"
11713  }, {
11714    ID: 30,
11715    Make: "Beech",
11716    Model: "Duchess 76",
11717    Engine: "Piston",
11718    "Engine Number": "Twin Engine",
11719    Category: "Airplane"
11720  }, {
11721    ID: 31,
11722    Make: "Beech",
11723    Model: "Travel Air",
11724    Engine: "Piston",
11725    "Engine Number": "Twin Engine",
11726    Category: "Airplane"
11727  }, {
11728    ID: 32,
11729    Make: "Beech",
11730    Model: "Baron 55",
11731    Engine: "Piston",
11732    "Engine Number": "Twin Engine",
11733    Category: "Airplane"
11734  }, {
11735    ID: 33,
11736    Make: "Beech",
11737    Model: "Baron 58",
11738    Engine: "Piston",
11739    "Engine Number": "Twin Engine",
11740    Category: "Airplane"
11741  }, {
11742    ID: 34,
11743    Make: "Beech",
11744    Model: "Duke 60",
11745    Engine: "Piston",
11746    "Engine Number": "Twin Engine",
11747    Category: "Airplane"
11748  }, {
11749    ID: 35,
11750    Make: "Beech",
11751    Model: "Model 18",
11752    Engine: "Piston",
11753    "Engine Number": "Twin Engine",
11754    Category: "Airplane"
11755  }, {
11756    ID: 36,
11757    Make: "Beech",
11758    Model: "Queen Air",
11759    Engine: "Piston",
11760    "Engine Number": "Twin Engine",
11761    Category: "Airplane"
11762  }, {
11763    ID: 37,
11764    Make: "Beech",
11765    Model: "King Air 90",
11766    Engine: "Turbine",
11767    "Engine Number": "Twin Engine",
11768    Category: "Airplane"
11769  }, {
11770    ID: 38,
11771    Make: "Beech",
11772    Model: "King Air A 100",
11773    Engine: "Turbine",
11774    "Engine Number": "Twin Engine",
11775    Category: "Airplane"
11776  }, {
11777    ID: 39,
11778    Make: "Beech",
11779    Model: "King Air B 200",
11780    Engine: "Turbine",
11781    "Engine Number": "Twin Engine",
11782    Category: "Airplane"
11783  }, {
11784    ID: 40,
11785    Make: "Beech",
11786    Model: "King Air 250",
11787    Engine: "Turbine",
11788    "Engine Number": "Twin Engine",
11789    Category: "Airplane"
11790  }, {
11791    ID: 41,
11792    Make: "Beech",
11793    Model: "King Air 300",
11794    Engine: "Turbine",
11795    "Engine Number": "Twin Engine",
11796    Category: "Airplane"
11797  }, {
11798    ID: 42,
11799    Make: "Beech",
11800    Model: "King Air 350",
11801    Engine: "Turbine",
11802    "Engine Number": "Twin Engine",
11803    Category: "Airplane"
11804  }, {
11805    ID: 43,
11806    Make: "Beech",
11807    Model: "Premier I 390",
11808    Engine: "Turbine",
11809    "Engine Number": "Twin Engine",
11810    Category: "Airplane"
11811  }, {
11812    ID: 44,
11813    Make: "Beech",
11814    Model: "Beechjet 400 ",
11815    Engine: "Turbine",
11816    "Engine Number": "Twin Engine",
11817    Category: "Airplane"
11818  }, {
11819    ID: 45,
11820    Make: "Bell",
11821    Model: "Jetranger",
11822    Engine: "Turbine",
11823    "Engine Number": "Single Engine",
11824    Category: "Helicopter"
11825  }, {
11826    ID: 46,
11827    Make: "Bell",
11828    Model: "Longranger ",
11829    Engine: "Turbine",
11830    "Engine Number": "Single Engine",
11831    Category: "Helicopter"
11832  }, {
11833    ID: 47,
11834    Make: "Bell",
11835    Model: "407",
11836    Engine: "Turbine",
11837    "Engine Number": "Single Engine",
11838    Category: "Helicopter"
11839  }, {
11840    ID: 48,
11841    Make: "Bell",
11842    Model: "212",
11843    Engine: "Turbine",
11844    "Engine Number": "Twin Engine",
11845    Category: "Helicopter"
11846  }, {
11847    ID: 49,
11848    Make: "Bell",
11849    Model: "222",
11850    Engine: "Turbine",
11851    "Engine Number": "Twin Engine",
11852    Category: "Helicopter"
11853  }, {
11854    ID: 50,
11855    Make: "Bell",
11856    Model: "230",
11857    Engine: "Turbine",
11858    "Engine Number": "Twin Engine",
11859    Category: "Helicopter"
11860  }, {
11861    ID: 51,
11862    Make: "Bell",
11863    Model: "412",
11864    Engine: "Turbine",
11865    "Engine Number": "Twin Engine",
11866    Category: "Helicopter"
11867  }, {
11868    ID: 52,
11869    Make: "Bell",
11870    Model: "427",
11871    Engine: "Turbine",
11872    "Engine Number": "Twin Engine",
11873    Category: "Helicopter"
11874  }, {
11875    ID: 53,
11876    Make: "Bell",
11877    Model: "429",
11878    Engine: "Turbine",
11879    "Engine Number": "Twin Engine",
11880    Category: "Helicopter"
11881  }, {
11882    ID: 54,
11883    Make: "Bell",
11884    Model: "430",
11885    Engine: "Turbine",
11886    "Engine Number": "Twin Engine",
11887    Category: "Helicopter"
11888  }, {
11889    ID: 55,
11890    Make: "Bellanca",
11891    Model: "Viking",
11892    Engine: "Piston",
11893    "Engine Number": "Single Engine",
11894    Category: "Airplane"
11895  }, {
11896    ID: 56,
11897    Make: "Bellanca",
11898    Model: "Super Viking",
11899    Engine: "Piston",
11900    "Engine Number": "Single Engine",
11901    Category: "Airplane"
11902  }, {
11903    ID: 57,
11904    Make: "Boeing",
11905    Model: "Stearman",
11906    Engine: "Piston",
11907    "Engine Number": "Single Engine",
11908    Category: "Airplane"
11909  }, {
11910    ID: 58,
11911    Make: "Bombardier",
11912    Model: "Challenger 600",
11913    Engine: "Turbine",
11914    "Engine Number": "Twin Engine",
11915    Category: "Airplane"
11916  }, {
11917    ID: 59,
11918    Make: "Bombardier",
11919    Model: "Challenger 300",
11920    Engine: "Turbine",
11921    "Engine Number": "Twin Engine",
11922    Category: "Airplane"
11923  }, {
11924    ID: 60,
11925    Make: "Bombardier",
11926    Model: "Challenger 601 ",
11927    Engine: "Turbine",
11928    "Engine Number": "Twin Engine",
11929    Category: "Airplane"
11930  }, {
11931    ID: 61,
11932    Make: "Bombardier",
11933    Model: "Challenger 604",
11934    Engine: "Turbine",
11935    "Engine Number": "Twin Engine",
11936    Category: "Airplane"
11937  }, {
11938    ID: 62,
11939    Make: "Bombardier",
11940    Model: "Challenger 605",
11941    Engine: "Turbine",
11942    "Engine Number": "Twin Engine",
11943    Category: "Airplane"
11944  }, {
11945    ID: 63,
11946    Make: "Bombardier",
11947    Model: "Challenger 850",
11948    Engine: "Turbine",
11949    "Engine Number": "Twin Engine",
11950    Category: "Airplane"
11951  }, {
11952    ID: 64,
11953    Make: "Bombardier",
11954    Model: "Global Express ",
11955    Engine: "Turbine",
11956    "Engine Number": "Twin Engine",
11957    Category: "Airplane"
11958  }, {
11959    ID: 65,
11960    Make: "Bombardier",
11961    Model: "Global 6000",
11962    Engine: "Turbine",
11963    "Engine Number": "Twin Engine",
11964    Category: "Airplane"
11965  }, {
11966    ID: 66,
11967    Make: "Cessna",
11968    Model: "120/140",
11969    Engine: "Piston",
11970    "Engine Number": "Single Engine",
11971    Category: "Airplane"
11972  }, {
11973    ID: 67,
11974    Make: "Cessna",
11975    Model: "150 /152",
11976    Engine: "Piston",
11977    "Engine Number": "Single Engine",
11978    Category: "Airplane"
11979  }, {
11980    ID: 68,
11981    Make: "Cessna",
11982    Model: "162 Skycatcher",
11983    Engine: "Piston",
11984    "Engine Number": "Single Engine",
11985    Category: "Airplane"
11986  }, {
11987    ID: 69,
11988    Make: "Cessna",
11989    Model: "170",
11990    Engine: "Piston",
11991    "Engine Number": "Single Engine",
11992    Category: "Airplane"
11993  }, {
11994    ID: 70,
11995    Make: "Cessna",
11996    Model: "172 Skyhawk",
11997    Engine: "Piston",
11998    "Engine Number": "Single Engine",
11999    Category: "Airplane"
12000  }, {
12001    ID: 71,
12002    Make: "Cessna",
12003    Model: "175 Skylark",
12004    Engine: "Piston",
12005    "Engine Number": "Single Engine",
12006    Category: "Airplane"
12007  }, {
12008    ID: 72,
12009    Make: "Cessna",
12010    Model: "177 Cardinal",
12011    Engine: "Piston",
12012    "Engine Number": "Single Engine",
12013    Category: "Airplane"
12014  }, {
12015    ID: 73,
12016    Make: "Cessna",
12017    Model: "180 Skywagon",
12018    Engine: "Piston",
12019    "Engine Number": "Single Engine",
12020    Category: "Airplane"
12021  }, {
12022    ID: 74,
12023    Make: "Cessna",
12024    Model: "182 Skylane",
12025    Engine: "Piston",
12026    "Engine Number": "Single Engine",
12027    Category: "Airplane"
12028  }, {
12029    ID: 75,
12030    Make: "Cessna",
12031    Model: "185 Skywagon",
12032    Engine: "Piston",
12033    "Engine Number": "Single Engine",
12034    Category: "Airplane"
12035  }, {
12036    ID: 76,
12037    Make: "Cessna",
12038    Model: "188 Ag Wagon",
12039    Engine: "Piston",
12040    "Engine Number": "Single Engine",
12041    Category: "Airplane"
12042  }, {
12043    ID: 77,
12044    Make: "Cessna",
12045    Model: "190/195",
12046    Engine: "Piston",
12047    "Engine Number": "Single Engine",
12048    Category: "Airplane"
12049  }, {
12050    ID: 78,
12051    Make: "Cessna",
12052    Model: "205",
12053    Engine: "Piston",
12054    "Engine Number": "Single Engine",
12055    Category: "Airplane"
12056  }, {
12057    ID: 79,
12058    Make: "Cessna",
12059    Model: "206 Stationair",
12060    Engine: "Piston",
12061    "Engine Number": "Single Engine",
12062    Category: "Airplane"
12063  }, {
12064    ID: 80,
12065    Make: "Cessna",
12066    Model: "207 Skywagon",
12067    Engine: "Piston",
12068    "Engine Number": "Single Engine",
12069    Category: "Airplane"
12070  }, {
12071    ID: 81,
12072    Make: "Cessna",
12073    Model: "208 Caravan",
12074    Engine: "Turbine",
12075    "Engine Number": "Single Engine",
12076    Category: "Airplane"
12077  }, {
12078    ID: 82,
12079    Make: "Cessna",
12080    Model: "210 Centurion",
12081    Engine: "Piston",
12082    "Engine Number": "Single Engine",
12083    Category: "Airplane"
12084  }, {
12085    ID: 83,
12086    Make: "Cessna",
12087    Model: "300-400 Corvalis",
12088    Engine: "Piston",
12089    "Engine Number": "Single Engine",
12090    Category: "Airplane"
12091  }, {
12092    ID: 84,
12093    Make: "Cessna",
12094    Model: "TTX",
12095    Engine: "Piston",
12096    "Engine Number": "Single Engine",
12097    Category: "Airplane"
12098  }, {
12099    ID: 85,
12100    Make: "Cessna",
12101    Model: "303 Crusader",
12102    Engine: "Piston",
12103    "Engine Number": "Twin Engine",
12104    Category: "Airplane"
12105  }, {
12106    ID: 86,
12107    Make: "Cessna",
12108    Model: "310",
12109    Engine: "Piston",
12110    "Engine Number": "Twin Engine",
12111    Category: "Airplane"
12112  }, {
12113    ID: 87,
12114    Make: "Cessna",
12115    Model: "320 Skyknight",
12116    Engine: "Piston",
12117    "Engine Number": "Twin Engine",
12118    Category: "Airplane"
12119  }, {
12120    ID: 88,
12121    Make: "Cessna",
12122    Model: "337 Skymaster",
12123    Engine: "Piston",
12124    "Engine Number": "Twin Engine",
12125    Category: "Airplane"
12126  }, {
12127    ID: 89,
12128    Make: "Cessna",
12129    Model: "340",
12130    Engine: "Piston",
12131    "Engine Number": "Twin Engine",
12132    Category: "Airplane"
12133  }, {
12134    ID: 90,
12135    Make: "Cessna",
12136    Model: "401",
12137    Engine: "Piston",
12138    "Engine Number": "Twin Engine",
12139    Category: "Airplane"
12140  }, {
12141    ID: 91,
12142    Make: "Cessna",
12143    Model: "402",
12144    Engine: "Piston",
12145    "Engine Number": "Twin Engine",
12146    Category: "Airplane"
12147  }, {
12148    ID: 92,
12149    Make: "Cessna",
12150    Model: "404 Titan",
12151    Engine: "Piston",
12152    "Engine Number": "Twin Engine",
12153    Category: "Airplane"
12154  }, {
12155    ID: 93,
12156    Make: "Cessna",
12157    Model: "411",
12158    Engine: "Piston",
12159    "Engine Number": "Twin Engine",
12160    Category: "Airplane"
12161  }, {
12162    ID: 94,
12163    Make: "Cessna",
12164    Model: "414 Chancellor",
12165    Engine: "Piston",
12166    "Engine Number": "Twin Engine",
12167    Category: "Airplane"
12168  }, {
12169    ID: 95,
12170    Make: "Cessna",
12171    Model: "421 Golden Eagle",
12172    Engine: "Piston",
12173    "Engine Number": "Twin Engine",
12174    Category: "Airplane"
12175  }, {
12176    ID: 96,
12177    Make: "Cessna",
12178    Model: "425 Conquest I",
12179    Engine: "Turbine",
12180    "Engine Number": "Twin Engine",
12181    Category: "Airplane"
12182  }, {
12183    ID: 97,
12184    Make: "Cessna",
12185    Model: "441 Conquest II",
12186    Engine: "Turbine",
12187    "Engine Number": "Twin Engine",
12188    Category: "Airplane"
12189  }, {
12190    ID: 98,
12191    Make: "Cessna",
12192    Model: "CJ",
12193    Engine: "Turbine",
12194    "Engine Number": "Twin Engine",
12195    Category: "Airplane"
12196  }, {
12197    ID: 99,
12198    Make: "Cessna",
12199    Model: "CJ 2",
12200    Engine: "Turbine",
12201    "Engine Number": "Twin Engine",
12202    Category: "Airplane"
12203  }, {
12204    ID: 100,
12205    Make: "Cessna",
12206    Model: "CJ 3",
12207    Engine: "Turbine",
12208    "Engine Number": "Twin Engine",
12209    Category: "Airplane"
12210  }, {
12211    ID: 101,
12212    Make: "Cessna",
12213    Model: "CJ 4",
12214    Engine: "Turbine",
12215    "Engine Number": "Twin Engine",
12216    Category: "Airplane"
12217  }, {
12218    ID: 102,
12219    Make: "Cessna",
12220    Model: "Citation Mustang
12220 ",
12221    Engine: "Turbine",
12222    "Engine Number": "Twin Engine",
12223    Category: "Airplane"
12224  }, {
12225    ID: 103,
12226    Make: "Cessna",
12227    Model: "Citation M2",
12228    Engine: "Turbine",
12229    "Engine Number": "Twin Engine",
12230    Category: "Airplane"
12231  }, {
12232    ID: 104,
12233    Make: "Cessna",
12234    Model: "Citation I",
12235    Engine: "Turbine",
12236    "Engine Number": "Twin Engine",
12237    Category: "Airplane"
12238  }, {
12239    ID: 105,
12240    Make: "Cessna",
12241    Model: "Citation II",
12242    Engine: "Turbine",
12243    "Engine Number": "Twin Engine",
12244    Category: "Airplane"
12245  }, {
12246    ID: 106,
12247    Make: "Cessna",
12248    Model: "Citation III",
12249    Engine: "Turbine",
12250    "Engine Number": "Twin Engine",
12251    Category: "Airplane"
12252  }, {
12253    ID: 107,
12254    Make: "Cessna",
12255    Model: "Citation V",
12256    Engine: "Turbine",
12257    "Engine Number": "Twin Engine",
12258    Category: "Airplane"
12259  }, {
12260    ID: 108,
12261    Make: "Cessna",
12262    Model: "Citation VI",
12263    Engine: "Turbine",
12264    "Engine Number": "Twin Engine",
12265    Category: "Airplane"
12266  }, {
12267    ID: 109,
12268    Make: "Cessna",
12269    Model: "Citation VII",
12270    Engine: "Turbine",
12271    "Engine Number": "Twin Engine",
12272    Category: "Airplane"
12273  }, {
12274    ID: 110,
12275    Make: "Cessna",
12276    Model: "Citation SII",
12277    Engine: "Turbine",
12278    "Engine Number": "Twin Engine",
12279    Category: "Airplane"
12280  }, {
12281    ID: 111,
12282    Make: "Cessna",
12283    Model: "Citation X",
12284    Engine: "Turbine",
12285    "Engine Number": "Twin Engine",
12286    Category: "Airplane"
12287  }, {
12288    ID: 112,
12289    Make: "Cessna",
12290    Model: "Citation Bravo",
12291    Engine: "Turbine",
12292    "Engine Number": "Twin Engine",
12293    Category: "Airplane"
12294  }, {
12295    ID: 113,
12296    Make: "Cessna",
12297    Model: "Citation Encore",
12298    Engine: "Turbine",
12299    "Engine Number": "Twin Engine",
12300    Category: "Airplane"
12301  }, {
12302    ID: 114,
12303    Make: "Cessna",
12304    Model: "Citation Excel",
12305    Engine: "Turbine",
12306    "Engine Number": "Twin Engine",
12307    Category: "Airplane"
12308  }, {
12309    ID: 115,
12310    Make: "Cessna",
12311    Model: "Citation Ultra",
12312    Engine: "Turbine",
12313    "Engine Number": "Twin Engine",
12314    Category: "Airplane"
12315  }, {
12316    ID: 116,
12317    Make: "Cessna",
12318    Model: "Citation Sovereign",
12319    Engine: "Turbine",
12320    "Engine Number": "Twin Engine",
12321    Category: "Airplane"
12322  }, {
12323    ID: 117,
12324    Make: "Cirrus",
12325    Model: "SR20",
12326    Engine: "Piston",
12327    "Engine Number": "Single Engine",
12328    Category: "Airplane"
12329  }, {
12330    ID: 118,
12331    Make: "Cirrus",
12332    Model: "SR22",
12333    Engine: "Piston",
12334    "Engine Number": "Single Engine",
12335    Category: "Airplane"
12336  }, {
12337    ID: 119,
12338    Make: "Cirrus",
12339    Model: "Vision Jet",
12340    Engine: "Turbine",
12341    "Engine Number": "Single Engine",
12342    Category: "Airplane"
12343  }, {
12344    ID: 120,
12345    Make: "Commander",
12346    Model: "112",
12347    Engine: "Piston",
12348    "Engine Number": "Single Engine",
12349    Category: "Airplane"
12350  }, {
12351    ID: 121,
12352    Make: "Commander",
12353    Model: "114",
12354    Engine: "Piston",
12355    "Engine Number": "Single Engine",
12356    Category: "Airplane"
12357  }, {
12358    ID: 122,
12359    Make: "Cubcrafters",
12360    Model: "Top Cub",
12361    Engine: "Piston",
12362    "Engine Number": "Single Engine",
12363    Category: "Airplane"
12364  }, {
12365    ID: 123,
12366    Make: "Cubcrafters",
12367    Model: "Sport Cub S2",
12368    Engine: "Piston",
12369    "Engine Number": "Single Engine",
12370    Category: "Airplane"
12371  }, {
12372    ID: 124,
12373    Make: "Cubcrafters",
12374    Model: "Carbon Cub",
12375    Engine: "Piston",
12376    "Engine Number": "Single Engine",
12377    Category: "Airplane"
12378  }, {
12379    ID: 125,
12380    Make: "Cubcrafters",
12381    Model: "Xcub",
12382    Engine: "Piston",
12383    "Engine Number": "Single Engine",
12384    Category: "Airplane"
12385  }, {
12386    ID: 126,
12387    Make: "Cruiser Aircraft",
12388    Model: "SportCruiser",
12389    Engine: "Piston",
12390    "Engine Number": "Single Engine",
12391    Category: "Airplane"
12392  }, {
12393    ID: 334,
12394    Make: "De Havilland",
12395    Model: "Beaver",
12396    Engine: "Piston",
12397    "Engine Number": "Single Engine",
12398    Category: "Airplane"
12399  }, {
12400    ID: 335,
12401    Make: "De Havilland",
12402    Model: "Chipmunk",
12403    Engine: "Piston",
12404    "Engine Number": "Single Engine",
12405    Category: "Airplane"
12406  }, {
12407    ID: 127,
12408    Make: "Diamond",
12409    Model: "DA20",
12410    Engine: "Piston",
12411    "Engine Number": "Single Engine",
12412    Category: "Airplane"
12413  }, {
12414    ID: 128,
12415    Make: "Diamond",
12416    Model: "DA40",
12417    Engine: "Piston",
12418    "Engine Number": "Single Engine",
12419    Category: "Airplane"
12420  }, {
12421    ID: 129,
12422    Make: "Diamond",
12423    Model: "DA42",
12424    Engine: "Piston",
12425    "Engine Number": "Twin Engine",
12426    Category: "Airplane"
12427  }, {
12428    ID: 130,
12429    Make: "Diamond",
12430    Model: "DA62",
12431    Engine: "Piston",
12432    "Engine Number": "Twin Engine",
12433    Category: "Airplane"
12434  }, {
12435    ID: 131,
12436    Make: "Eclipse",
12437    Model: "500/550",
12438    Engine: "Turbine",
12439    "Engine Number": "Twin Engine",
12440    Category: "Airplane"
12441  }, {
12442    ID: 132,
12443    Make: "Embraer",
12444    Model: "Phenom 100",
12445    Engine: "Turbine",
12446    "Engine Number": "Twin Engine",
12447    Category: "Airplane"
12448  }, {
12449    ID: 133,
12450    Make: "Embraer",
12451    Model: "Phenom 300",
12452    Engine: "Turbine",
12453    "Engine Number": "Twin Engine",
12454    Category: "Airplane"
12455  }, {
12456    ID: 134,
12457    Make: "Embraer",
12458    Model: "Legacy ",
12459    Engine: "Turbine",
12460    "Engine Number": "Twin Engine",
12461    Category: "Airplane"
12462  }, {
12463    ID: 135,
12464    Make: "Ercoupe",
12465    Model: "Ercoupe",
12466    Engine: "Piston",
12467    "Engine Number": "Single Engine",
12468    Category: "Airplane"
12469  }, {
12470    ID: 136,
12471    Make: "Eurocopter",
12472    Model: "Astar AS350 ",
12473    Engine: "Turbine",
12474    "Engine Number": "Single Engine",
12475    Category: "Helicopter"
12476  }, {
12477    ID: 137,
12478    Make: "Eurocopter",
12479    Model: "EC120",
12480    Engine: "Turbine",
12481    "Engine Number": "Single Engine",
12482    Category: "Helicopter"
12483  }, {
12484    ID: 138,
12485    Make: "Eurocopter",
12486    Model: "EC130 ",
12487    Engine: "Turbine",
12488    "Engine Number": "Single Engine",
12489    Category: "Helicopter"
12490  }, {
12491    ID: 139,
12492    Make: "Eurocopter",
12493    Model: "Twinstar AS355",
12494    Engine: "Turbine",
12495    "Engine Number": "Twin Engine",
12496    Category: "Helicopter"
12497  }, {
12498    ID: 140,
12499    Make: "Eurocopter",
12500    Model: "Dauphin AS365",
12501    Engine: "Turbine",
12502    "Engine Number": "Twin Engine",
12503    Category: "Helicopter"
12504  }, {
12505    ID: 141,
12506    Make: "Eurocopter",
12507    Model: "BK117",
12508    Engine: "Turbine",
12509    "Engine Number": "Twin Engine",
12510    Category: "Helicopter"
12511  }, {
12512    ID: 142,
12513    Make: "Eurocopter",
12514    Model: "EC135",
12515    Engine: "Turbine",
12516    "Engine Number": "Twin Engine",
12517    Category: "Helicopter"
12518  }, {
12519    ID: 143,
12520    Make: "Eurocopter",
12521    Model: "EC145",
12522    Engine: "Turbine",
12523    "Engine Number": "Twin Engine",
12524    Category: "Helicopter"
12525  }, {
12526    ID: 144,
12527    Make: "Eurocopter",
12528    Model: "EC155",
12529    Engine: "Turbine",
12530    "Engine Number": "Twin Engine",
12531    Category: "Helicopter"
12532  }, {
12533    ID: 145,
12534    Make: "Eurofox",
12535    Model: "Eurofox",
12536    Engine: "Piston",
12537    "Engine Number": "Single Engine",
12538    Category: "Airplane"
12539  }, {
12540    ID: 146,
12541    Make: "Evektor",
12542    Model: "Sportstar",
12543    Engine: "Piston",
12544    "Engine Number": "Single Engine",
12545    Category: "Airplane"
12546  }, {
12547    ID: 147,
12548    Make: "Experimental",
12549    Model: "Air Cam",
12550    Engine: "Piston",
12551    "Engine Number": "Single Engine",
12552    Category: "Airplane"
12553  }, {
12554    ID: 148,
12555    Make: "Experimental",
12556    Model: "Christen Eagle",
12557    Engine: "Piston",
12558    "Engine Number": "Single Engine",
12559    Category: "Airplane"
12560  }, {
12561    ID: 149,
12562    Make: "Experimental",
12563    Model: "Cozy",
12564    Engine: "Piston",
12565    "Engine Number": "Single Engine",
12566    Category: "Airplane"
12567  }, {
12568    ID: 150,
12569    Make: "Experimental",
12570    Model: "GlaStar",
12571    Engine: "Piston",
12572    "Engine Number": "Single Engine",
12573    Category: "Airplane"
12574  }, {
12575    ID: 151,
12576    Make: "Experimental",
12577    Model: "Harmon Rocket",
12578    Engine: "Piston",
12579    "Engine Number": "Single Engine",
12580    Category: "Airplane"
12581  }, {
12582    ID: 152,
12583    Make: "Experimental",
12584    Model: "SeaRey",
12585    Engine: "Piston",
12586    "Engine Number": "Single Engine",
12587    Category: "Airplane"
12588  }, {
12589    ID: 153,
12590    Make: "Experimental",
12591    Model: "Skybolt",
12592    Engine: "Piston",
12593    "Engine Number": "Single Engine",
12594    Category: "Airplane"
12595  }, {
12596    ID: 154,
12597    Make: "Experimental",
12598    Model: "Sonex",
12599    Engine: "Piston",
12600    "Engine Number": "Single Engine",
12601    Category: "Airplane"
12602  }, {
12603    ID: 155,
12604    Make: "Experimental",
12605    Model: "Zenith",
12606    Engine: "Piston",
12607    "Engine Number": "Single Engine",
12608    Category: "Airplane"
12609  }, {
12610    ID: 156,
12611    Make: "Experimental",
12612    Model: "Zodiac",
12613    Engine: "Piston",
12614    "Engine Number": "Single Engine",
12615    Category: "Airplane"
12616  }, {
12617    ID: 157,
12618    Make: "Experimental",
12619    Model: "Other",
12620    Engine: "Piston",
12621    "Engine Number": "Single Engine",
12622    Category: "Airplane"
12623  }, {
12624    ID: 158,
12625    Make: "Fairchild",
12626    Model: "Merlin II",
12627    Engine: "Turbine",
12628    "Engine Number": "Twin Engine",
12629    Category: "Airplane"
12630  }, {
12631    ID: 159,
12632    Make: "Fairchild",
12633    Model: "Merlin III",
12634    Engine: "Turbine",
12635    "Engine Number": "Twin Engine",
12636    Category: "Airplane"
12637  }, {
12638    ID: 160,
12639    Make: "Fairchild",
12640    Model: "Merlin IV",
12641    Engine: "Turbine",
12642    "Engine Number": "Twin Engine",
12643    Category: "Airplane"
12644  }, {
12645    ID: 161,
12646    Make: "Fairchild",
12647    Model: "Metro",
12648    Engine: "Turbine",
12649    "Engine Number": "Twin Engine",
12650    Category: "Airplane"
12651  }, {
12652    ID: 162,
12653    Make: "Falcon",
12654    Model: "10",
12655    Engine: "Turbine",
12656    "Engine Number": "Twin Engine",
12657    Category: "Airplane"
12658  }, {
12659    ID: 163,
12660    Make: "Falcon",
12661    Model: "100",
12662    Engine: "Turbine",
12663    "Engine Number": "Twin Engine",
12664    Category: "Airplane"
12665  }, {
12666    ID: 164,
12667    Make: "Falcon",
12668    Model: "20",
12669    Engine: "Turbine",
12670    "Engine Number": "Twin Engine",
12671    Category: "Airplane"
12672  }, {
12673    ID: 165,
12674    Make: "Falcon",
12675    Model: "200",
12676    Engine: "Turbine",
12677    "Engine Number": "Twin Engine",
12678    Category: "Airplane"
12679  }, {
12680    ID: 166,
12681    Make: "Falcon",
12682    Model: "2000",
12683    Engine: "Turbine",
12684    "Engine Number": "Twin Engine",
12685    Category: "Airplane"
12686  }, {
12687    ID: 167,
12688    Make: "Falcon",
12689    Model: "50",
12690    Engine: "Turbine",
12691    "Engine Number": "Tri Engine",
12692    Category: "Airplane"
12693  }, {
12694    ID: 168,
12695    Make: "Falcon",
12696    Model: "900 -B",
12697    Engine: "Turbine",
12698    "Engine Number": "Tri Engine",
12699    Category: "Airplane"
12700  }, {
12701    ID: 169,
12702    Make: "Falcon",
12703    Model: "7X",
12704    Engine: "Turbine",
12705    "Engine Number": "Tri Engine",
12706    Category: "Airplane"
12707  }, {
12708    ID: 170,
12709    Make: "Flight Design",
12710    Model: "CTSW",
12711    Engine: "Piston",
12712    "Engine Number": "Single Engine",
12713    Category: "Airplane"
12714  }, {
12715    ID: 171,
12716    Make: "Flight Design",
12717    Model: "CTLS",
12718    Engine: "Piston",
12719    "Engine Number": "Single Engine",
12720    Category: "Airplane"
12721  }, {
12722    ID: 172,
12723    Make: "Gippsaero",
12724    Model: "GA 8",
12725    Engine: "Piston",
12726    "Engine Number": "Single Engine",
12727    Category: "Airplane"
12728  }, {
12729    ID: 173,
12730    Make: "Glasair",
12731    Model: "Sportsman",
12732    Engine: "Piston",
12733    "Engine Number": "Single Engine",
12734    Category: "Airplane"
12735  }, {
12736    ID: 174,
12737    Make: "Glasair",
12738    Model: "Legacy",
12739    Engine: "Piston",
12740    "Engine Number": "Single Engine",
12741    Category: "Airplane"
12742  }, {
12743    ID: 175,
12744    Make: "Glasair",
12745    Model: "Merlin LSA",
12746    Engine: "Piston",
12747    "Engine Number": "Single Engine",
12748    Category: "Airplane"
12749  }, {
12750    ID: 176,
12751    Make: "Gobosh",
12752    Model: "700S 800XP",
12753    Engine: "Piston",
12754    "Engine Number": "Single Engine",
12755    Category: "Airplane"
12756  }, {
12757    ID: 177,
12758    Make: "Gulfstream",
12759    Model: "G 159",
12760    Engine: "Turbine",
12761    "Engine Number": "Twin Engine",
12762    Category: "Airplane"
12763  }, {
12764    ID: 178,
12765    Make: "Gulfstream",
12766    Model: "Astrajet 1125",
12767    Engine: "Turbine",
12768    "Engine Number": "Twin Engine",
12769    Category: "Airplane"
12770  }, {
12771    ID: 179,
12772    Make: "Gulfstream",
12773    Model: "G150",
12774    Engine: "Turbine",
12775    "Engine Number": "Twin Engine",
12776    Category: "Airplane"
12777  }, {
12778    ID: 180,
12779    Make: "Gulfstream",
12780    Model: "G200",
12781    Engine: "Turbine",
12782    "Engine Number": "Twin Engine",
12783    Category: "Airplane"
12784  }, {
12785    ID: 181,
12786    Make: "Gulfstream",
12787    Model: "G280",
12788    Engine: "Turbine",
12789    "Engine Number": "Twin Engine",
12790    Category: "Airplane"
12791  }, {
12792    ID: 182,
12793    Make: "Gulfstream",
12794    Model: "GII",
12795    Engine: "Turbine",
12796    "Engine Number": "Twin Engine",
12797    Category: "Airplane"
12798  }, {
12799    ID: 183,
12800    Make: "Gulfstream",
12801    Model: "GIII",
12802    Engine: "Turbine",
12803    "Engine Number": "Twin Engine",
12804    Category: "Airplane"
12805  }, {
12806    ID: 184,
12807    Make: "Gulfstream",
12808    Model: "GIV",
12809    Engine: "Turbine",
12810    "Engine Number": "Twin Engine",
12811    Category: "Airplane"
12812  }, {
12813    ID: 185,
12814    Make: "Gulfstream",
12815    Model: "G350/G450",
12816    Engine: "Turbine",
12817    "Engine Number": "Twin Engine",
12818    Category: "Airplane"
12819  }, {
12820    ID: 186,
12821    Make: "Gulfstream",
12822    Model: "GV",
12823    Engine: "Turbine",
12824    "Engine Number": "Twin Engine",
12825    Category: "Airplane"
12826  }, {
12827    ID: 187,
12828    Make: "Gulfstream",
12829    Model: "G500/G550",
12830    Engine: "Turbine",
12831    "Engine Number": "Twin Engine",
12832    Category: "Airplane"
12833  }, {
12834    ID: 188,
12835    Make: "Gulfstream",
12836    Model: "G650",
12837    Engine: "Turbine",
12838    "Engine Number": "Twin Engine",
12839    Category: "Airplane"
12840  }, {
12841    ID: 189,
12842    Make: "Hawker",
12843    Model: "Beechcraft 125",
12844    Engine: "Turbine",
12845    "Engine Number": "Twin Engine",
12846    Category: "Airplane"
12847  }, {
12848    ID: 190,
12849    Make: "Hawker",
12850    Model: "Beechcraft 125-400 ",
12851    Engine: "Turbine",
12852    "Engine Number": "Twin Engine",
12853    Category: "Airplane"
12854  }, {
12855    ID: 191,
12856    Make: "Hawker",
12857    Model: "Beechcraft 125-600 ",
12858    Engine: "Turbine",
12859    "Engine Number": "Twin Engine",
12860    Category: "Airplane"
12861  }, {
12862    ID: 192,
12863    Make: "Hawker",
12864    Model: "Beechcraft 125-700 ",
12865    Engine: "Turbine",
12866    "Engine Number": "Twin Engine",
12867    Category: "Airplane"
12868  }, {
12869    ID: 193,
12870    Make: "Hawker",
12871    Model: "Beechcraft 750",
12872    Engine: "Turbine",
12873    "Engine Number": "Twin Engine",
12874    Category: "Airplane"
12875  }, {
12876    ID: 194,
12877    Make: "Hawker",
12878    Model: "Beechcraft 125-800",
12879    Engine: "Turbine",
12880    "Engine Number": "Twin Engine",
12881    Category: "Airplane"
12882  }, {
12883    ID: 195,
12884    Make: "Hawker",
12885    Model: "Beechcraft 900XP",
12886    Engine: "Turbine",
12887    "Engine Number": "Twin Engine",
12888    Category: "Airplane"
12889  }, {
12890    ID: 196,
12891    Make: "Hawker",
12892    Model: "Beechcraft 125-1000",
12893    Engine: "Turbine",
12894    "Engine Number": "Twin Engine",
12895    Category: "Airplane"
12896  }, {
12897    ID: 197,
12898    Make: "Hawker",
12899    Model: "Beechcraft 4000",
12900    Engine: "Turbine",
12901    "Engine Number": "Twin Engine",
12902    Category: "Airplane"
12903  }, {
12904    ID: 198,
12905    Make: "IAI",
12906    Model: "1121 A/B",
12907    Engine: "Turbine",
12908    "Engine Number": "Twin Engine",
12909    Category: "Airplane"
12910  }, {
12911    ID: 199,
12912    Make: "IAI",
12913    Model: "Westwind 1123",
12914    Engine: "Turbine",
12915    "Engine Number": "Twin Engine",
12916    Category: "Airplane"
12917  }, {
12918    ID: 200,
12919    Make: "IAI",
12920    Model: "Westwind 1124",
12921    Engine: "Turbine",
12922    "Engine Number": "Twin Engine",
12923    Category: "Airplane"
12924  }, {
12925    ID: 336,
12926    Make: "Icon",
12927    Model: "A5",
12928    Engine: "Piston",
12929    "Engine Number": "Single Engine",
12930    Category: "Airplane"
12931  }, {
12932    ID: 201,
12933    Make: "Jabiru",
12934    Model: "Jabiru",
12935    Engine: "Piston",
12936    "Engine Number": "Single Engine",
12937    Category: "Airplane"
12938  }, {
12939    ID: 202,
12940    Make: "Kitfox",
12941    Model: "Supersport",
12942    Engine: "Piston",
12943    "Engine Number": "Single Engine",
12944    Category: "Airplane"
12945  }, {
12946    ID: 203,
12947    Make: "Lake",
12948    Model: "Buccaneer",
12949    Engine: "Piston",
12950    "Engine Number": "Single Engine",
12951    Category: "Airplane"
12952  }, {
12953    ID: 204,
12954    Make: "Lake",
12955    Model: "Renegade",
12956    Engine: "Piston",
12957    "Engine Number": "Single Engine",
12958    Category: "Airplane"
12959  }, {
12960    ID: 205,
12961    Make: "Lancair",
12962    Model: "320-360",
12963    Engine: "Piston",
12964    "Engine Number": "Single Engine",
12965    Category: "Airplane"
12966  }, {
12967    ID: 206,
12968    Make: "Lancair",
12969    Model: "IV",
12970    Engine: "Piston",
12971    "Engine Number": "Single Engine",
12972    Category: "Airplane"
12973  }, {
12974    ID: 207,
12975    Make: "Lancair",
12976    Model: "Legacy",
12977    Engine: "Piston",
12978    "Engine Number": "Single Engine",
12979    Category: "Airplane"
12980  }, {
12981    ID: 208,
12982    Make: "Lancair",
12983    Model: "ES",
12984    Engine: "Piston",
12985    "Engine Number": "Single Engine",
12986    Category: "Airplane"
12987  }, {
12988    ID: 209,
12989    Make: "Lancair",
12990    Model: "Evolution",
12991    Engine: "Piston",
12992    "Engine Number": "Single Engine",
12993    Category: "Airplane"
12994  }, {
12995    ID: 210,
12996    Make: "Lancair",
12997    Model: "Evolution (Turbine)",
12998    Engine: "Turbine",
12999    "Engine Number": "Single Engine",
13000    Category: "Airplane"
13001  }, {
13002    ID: 211,
13003    Make: "Learjet",
13004    Model: "23",
13005    Engine: "Turbine",
13006    "Engine Number": "Twin Engine",
13007    Category: "Airplane"
13008  }, {
13009    ID: 212,
13010    Make: "Learjet",
13011    Model: "24",
13012    Engine: "Turbine",
13013    "Engine Number": "Twin Engine",
13014    Category: "Airplane"
13015  }, {
13016    ID: 213,
13017    Make: "Learjet",
13018    Model: "25",
13019    Engine: "Turbine",
13020    "Engine Number": "Twin Engine",
13021    Category: "Airplane"
13022  }, {
13023    ID: 214,
13024    Make: "Learjet",
13025    Model: "31",
13026    Engine: "Turbine",
13027    "Engine Number": "Twin Engine",
13028    Category: "Airplane"
13029  }, {
13030    ID: 215,
13031    Make: "Learjet",
13032    Model: "35/36",
13033    Engine: "Turbine",
13034    "Engine Number": "Twin Engine",
13035    Category: "Airplane"
13036  }, {
13037    ID: 216,
13038    Make: "Learjet",
13039    Model: "40",
13040    Engine: "Turbine",
13041    "Engine Number": "Twin Engine",
13042    Category: "Airplane"
13043  }, {
13044    ID: 217,
13045    Make: "Learjet",
13046    Model: "45",
13047    Engine: "Turbine",
13048    "Engine Number": "Twin Engine",
13049    Category: "Airplane"
13050  }, {
13051    ID: 218,
13052    Make: "Learjet",
13053    Model: "55",
13054    Engine: "Turbine",
13055    "Engine Number": "Twin Engine",
13056    Category: "Airplane"
13057  }, {
13058    ID: 219,
13059    Make: "Learjet",
13060    Model: "60",
13061    Engine: "Turbine",
13062    "Engine Number": "Twin Engine",
13063    Category: "Airplane"
13064  }, {
13065    ID: 220,
13066    Make: "Learjet",
13067    Model: "70 75",
13068    Engine: "Turbine",
13069    "Engine Number": "Twin Engine",
13070    Category: "Airplane"
13071  }, {
13072    ID: 221,
13073    Make: "Liberty",
13074    Model: "Xl2",
13075    Engine: "Piston",
13076    "Engine Number": "Single Engine",
13077    Category: "Airplane"
13078  }, {
13079    ID: 222,
13080    Make: "Lockheed",
13081    Model: "Jetstar II",
13082    Engine: "Turbine",
13083    "Engine Number": "Quad Engine",
13084    Category: "Airplane"
13085  }, {
13086    ID: 223,
13087    Make: "Lockheed",
13088    Model: "Jetstar 6/8",
13089    Engine: "Turbine",
13090    "Engine Number": "Quad Engine",
13091    Category: "Airplane"
13092  }, {
13093    ID: 224,
13094    Make: "Lockheed",
13095    Model: "Jetstar 731 II",
13096    Engine: "Turbine",
13097    "Engine Number": "Quad Engine",
13098    Category: "Airplane"
13099  }, {
13100    ID: 225,
13101    Make: "Luscombe",
13102    Model: "Silvaire 8 ",
13103    Engine: "Piston",
13104    "Engine Number": "Single Engine",
13105    Category: "Airplane"
13106  }, {
13107    ID: 226,
13108    Make: "Maule",
13109    Model: "M-4/5",
13110    Engine: "Piston",
13111    "Engine Number": "Single Engine",
13112    Category: "Airplane"
13113  }, {
13114    ID: 227,
13115    Make: "Maule",
13116    Model: "M-6/7",
13117    Engine: "Piston",
13118    "Engine Number": "Single Engine",
13119    Category: "Airplane"
13120  }, {
13121    ID: 228,
13122    Make: "MD",
13123    Model: "500",
13124    Engine: "Turbine",
13125    "Engine Number": "Single Engine",
13126    Category: "Helicopter"
13127  }, {
13128    ID: 229,
13129    Make: "MD",
13130    Model: "520",
13131    Engine: "Turbine",
13132    "Engine Number": "Single Engine",
13133    Category: "Helicopter"
13134  }, {
13135    ID: 230,
13136    Make: "MD",
13137    Model: "530",
13138    Engine: "Turbine",
13139    "Engine Number": "Single Engine",
13140    Category: "Helicopter"
13141  }, {
13142    ID: 231,
13143    Make: "MD",
13144    Model: "600",
13145    Engine: "Turbine",
13146    "Engine Number": "Single Engine",
13147    Category: "Helicopter"
13148  }, {
13149    ID: 232,
13150    Make: "MD",
13151    Model: "Explorer 902",
13152    Engine: "Turbine",
13153    "Engine Number": "Twin Engine",
13154    Category: "Helicopter"
13155  }, {
13156    ID: 233,
13157    Make: "Meyers",
13158    Model: "200 A-D",
13159    Engine: "Piston",
13160    "Engine Number": "Single Engine",
13161    Category: "Airplane"
13162  }, {
13163    ID: 234,
13164    Make: "Mitsubishi",
13165    Model: "MU-2",
13166    Engine: "Turbine",
13167    "Engine Number": "Twin Engine",
13168    Category: "Airplane"
13169  }, {
13170    ID: 235,
13171    Make: "Mitsubishi",
13172    Model: "MU-300",
13173    Engine: "Turbine",
13174    "Engine Number": "Twin Engine",
13175    Category: "Airplane"
13176  }, {
13177    ID: 236,
13178    Make: "Mooney",
13179    Model: "Cadet M10",
13180    Engine: "Piston",
13181    "Engine Number": "Single Engine",
13182    Category: "Airplane"
13183  }, {
13184    ID: 237,
13185    Make: "Mooney",
13186    Model: "Mite M18",
13187    Engine: "Piston",
13188    "Engine Number": "Single Engine",
13189    Category: "Airplane"
13190  }, {
13191    ID: 238,
13192    Make: "Mooney",
13193    Model: "M20A-F",
13194    Engine: "Piston",
13195    "Engine Number": "Single Engine",
13196    Category: "Airplane"
13197  }, {
13198    ID: 239,
13199    Make: "Mooney",
13200    Model: "M20J",
13201    Engine: "Piston",
13202    "Engine Number": "Single Engine",
13203    Category: "Airplane"
13204  }, {
13205    ID: 240,
13206    Make: "Mooney",
13207    Model: "M20K",
13208    Engine: "Piston",
13209    "Engine Number": "Single Engine",
13210    Category: "Airplane"
13211  }, {
13212    ID: 241,
13213    Make: "Mooney",
13214    Model: "M20L",
13215    Engine: "Piston",
13216    "Engine Number": "Single Engine",
13217    Category: "Airplane"
13218  }, {
13219    ID: 242,
13220    Make: "Mooney",
13221    Model: "TLS",
13222    Engine: "Piston",
13223    "Engine Number": "Single Engine",
13224    Category: "Airplane"
13225  }, {
13226    ID: 243,
13227    Make: "Mooney",
13228    Model: "Ovation",
13229    Engine: "Piston",
13230    "Engine Number": "Single Engine",
13231    Category: "Airplane"
13232  }, {
13233    ID: 244,
13234    Make: "Mooney",
13235    Model: "Acclaim",
13236    Engine: "Piston",
13237    "Engine Number": "Single Engine",
13238    Category: "Airplane"
13239  }, {
13240    ID: 245,
13241    Make: "Mooney",
13242    Model: "Eagle",
13243    Engine: "Piston",
13244    "Engine Number": "Single Engine",
13245    Category: "Airplane"
13246  }, {
13247    ID: 246,
13248    Make: "Mooney",
13249    Model: "Mustang M22",
13250    Engine: "Piston",
13251    "Engine Number": "Single Engine",
13252    Category: "Airplane"
13253  }, {
13254    ID: 247,
13255    Make: "Navion",
13256    Model: "Rangemaster",
13257    Engine: "Piston",
13258    "Engine Number": "Single Engine",
13259    Category: "Airplane"
13260  }, {
13261    ID: 248,
13262    Make: "Nextant",
13263    Model: "400XTI",
13264    Engine: "Turbine",
13265    "Engine Number": "Twin Engine",
13266    Category: "Airplane"
13267  }, {
13268    ID: 249,
13269    Make: "North American",
13270    Model: "Trojan T28",
13271    Engine: "Piston",
13272    "Engine Number": "Single Engine",
13273    Category: "Airplane"
13274  }, {
13275    ID: 250,
13276    Make: "North American",
13277    Model: "T6",
13278    Engine: "Piston",
13279    "Engine Number": "Single Engine",
13280    Category: "Airplane"
13281  }, {
13282    ID: 251,
13283    Make: "Paradise",
13284    Model: "P1",
13285    Engine: "Piston",
13286    "Engine Number": "Single Engine",
13287    Category: "Airplane"
13288  }, {
13289    ID: 252,
13290    Make: "Piaggio",
13291    Model: "Avanti P180",
13292    Engine: "Turbine",
13293    "Engine Number": "Twin Engine",
13294    Category: "Airplane"
13295  }, {
13296    ID: 253,
13297    Make: "Pilatus",
13298    Model: "PC 12",
13299    Engine: "Turbine",
13300    "Engine Number": "Single Engine",
13301    Category: "Airplane"
13302  }, {
13303    ID: 254,
13304    Make: "Pilatus",
13305    Model: "PC 24",
13306    Engine: "Turbine",
13307    "Engine Number": "Twin Engine",
13308    Category: "Airplane"
13309  }, {
13310    ID: 255,
13311    Make: "Piper",
13312    Model: "Sport",
13313    Engine: "Piston",
13314    "Engine Number": "Single Engine",
13315    Category: "Airplane"
13316  }, {
13317    ID: 256,
13318    Make: "Piper",
13319    Model: "J3 Cub",
13320    Engine: "Piston",
13321    "Engine Number": "Single Engine",
13322    Category: "Airplane"
13323  }, {
13324    ID: 257,
13325    Make: "Piper",
13326    Model: "Super Cruiser",
13327    Engine: "Piston",
13328    "Engine Number": "Single Engine",
13329    Category: "Airplane"
13330  }, {
13331    ID: 258,
13332    Make: "Piper",
13333    Model: "Super Cub",
13334    Engine: "Piston",
13335    "Engine Number": "Single Engine",
13336    Category: "Airplane"
13337  }, {
13338    ID: 259,
13339    Make: "Piper",
13340    Model: "Tomahawk",
13341    Engine: "Piston",
13342    "Engine Number": "Single Engine",
13343    Category: "Airplane"
13344  }, {
13345    ID: 260,
13346    Make: "Piper",
13347    Model: "Tri-Pacer",
13348    Engine: "Piston",
13349    "Engine Number": "Single Engine",
13350    Category: "Airplane"
13351  }, {
13352    ID: 261,
13353    Make: "Piper",
13354    Model: "Comanche",
13355    Engine: "Piston",
13356    "Engine Number": "Single Engine",
13357    Category: "Airplane"
13358  }, {
13359    ID: 262,
13360    Make: "Piper",
13361    Model: "Pawnee/Brave",
13362    Engine: "Piston",
13363    "Engine Number": "Single Engine",
13364    Category: "Airplane"
13365  }, {
13366    ID: 263,
13367    Make: "Piper",
13368    Model: "Cherokee",
13369    Engine: "Piston",
13370    "Engine Number": "Single Engine",
13371    Category: "Airplane"
13372  }, {
13373    ID: 264,
13374    Make: "Piper",
13375    Model: "Warrior",
13376    Engine: "Piston",
13377    "Engine Number": "Single Engine",
13378    Category: "Airplane"
13379  }, {
13380    ID: 265,
13381    Make: "Piper",
13382    Model: "Archer",
13383    Engine: "Piston",
13384    "Engine Number": "Single Engine",
13385    Category: "Airplane"
13386  }, {
13387    ID: 266,
13388    Make: "Piper",
13389    Model: "Arrow",
13390    Engine: "Piston",
13391    "Engine Number": "Single Engine",
13392    Category: "Airplane"
13393  }, {
13394    ID: 267,
13395    Make: "Piper",
13396    Model: "Dakota",
13397    Engine: "Piston",
13398    "Engine Number": "Single Engine",
13399    Category: "Airplane"
13400  }, {
13401    ID: 268,
13402    Make: "Piper",
13403    Model: "Cherokee Six",
13404    Engine: "Piston",
13405    "Engine Number": "Single Engine",
13406    Category: "Airplane"
13407  }, {
13408    ID: 269,
13409    Make: "Piper",
13410    Model: "Lance",
13411    Engine: "Piston",
13412    "Engine Number": "Single Engine",
13413    Category: "Airplane"
13414  }, {
13415    ID: 270,
13416    Make: "Piper",
13417    Model: "6X",
13418    Engine: "Piston",
13419    "Engine Number": "Single Engine",
13420    Category: "Airplane"
13421  }, {
13422    ID: 271,
13423    Make: "Piper",
13424    Model: "Saratoga",
13425    Engine: "Piston",
13426    "Engine Number": "Single Engine",
13427    Category: "Airplane"
13428  }, {
13429    ID: 272,
13430    Make: "Piper",
13431    Model: "Malibu",
13432    Engine: "Piston",
13433    "Engine Number": "Single Engine",
13434    Category: "Airplane"
13435  }, {
13436    ID: 273,
13437    Make: "Piper",
13438    Model: "Malibu Mirage",
13439    Engine: "Piston",
13440    "Engine Number": "Single Engine",
13441    Category: "Airplane"
13442  }, {
13443    ID: 274,
13444    Make: "Piper",
13445    Model: "Matrix",
13446    Engine: "Piston",
13447    "Engine Number": "Single Engine",
13448    Category: "Airplane"
13449  }, {
13450    ID: 275,
13451    Make: "Piper",
13452    Model: "Meridian",
13453    Engine: "Turbine",
13454    "Engine Number": "Single Engine",
13455    Category: "Airplane"
13456  }, {
13457    ID: 276,
13458    Make: "Piper",
13459    Model: "Seminole",
13460    Engine: "Piston",
13461    "Engine Number": "Twin Engine",
13462    Category: "Airplane"
13463  }, {
13464    ID: 277,
13465    Make: "Piper",
13466    Model: "Apache",
13467    Engine: "Piston",
13468    "Engine Number": "Twin Engine",
13469    Category: "Airplane"
13470  }, {
13471    ID: 278,
13472    Make: "Piper",
13473    Model: "Aztec",
13474    Engine: "Piston",
13475    "Engine Number": "Twin Engine",
13476    Category: "Airplane"
13477  }, {
13478    ID: 279,
13479    Make: "Piper",
13480    Model: "Twin Comanche",
13481    Engine: "Piston",
13482    "Engine Number": "Twin Engine",
13483    Category: "Airplane"
13484  }, {
13485    ID: 280,
13486    Make: "Piper",
13487    Model: "Seneca",
13488    Engine: "Piston",
13489    "Engine Number": "Twin Engine",
13490    Category: "Airplane"
13491  }, {
13492    ID: 281,
13493    Make: "Piper",
13494    Model: "Navajo",
13495    Engine: "Piston",
13496    "Engine Number": "Twin Engine",
13497    Category: "Airplane"
13498  }, {
13499    ID: 282,
13500    Make: "Piper",
13501    Model: "Navajo Chieftain",
13502    Engine: "Piston",
13503    "Engine Number": "Twin Engine",
13504    Category: "Airplane"
13505  }, {
13506    ID: 283,
13507    Make: "Piper",
13508    Model: "Mojave",
13509    Engine: "Piston",
13510    "Engine Number": "Twin Engine",
13511    Category: "Airplane"
13512  }, {
13513    ID: 284,
13514    Make: "Piper",
13515    Model: "Cheyenne",
13516    Engine: "Turbine",
13517    "Engine Number": "Twin Engine",
13518    Category: "Airplane"
13519  }, {
13520    ID: 285,
13521    Make: "Quest",
13522    Model: "Kodiak",
13523    Engine: "Turbine",
13524    "Engine Number": "Single Engine",
13525    Category: "Airplane"
13526  }, {
13527    ID: 286,
13528    Make: "Remos",
13529    Model: "G3 ",
13530    Engine: "Piston",
13531    "Engine Number": "Single Engine",
13532    Category: "Airplane"
13533  }, {
13534    ID: 287,
13535    Make: "Robinson",
13536    Model: "R22",
13537    Engine: "Piston",
13538    "Engine Number": "Single Engine",
13539    Category: "Helicopter"
13540  }, {
13541    ID: 288,
13542    Make: "Robinson",
13543    Model: "R44",
13544    Engine: "Piston",
13545    "Engine Number": "Single Engine",
13546    Category: "Helicopter"
13547  }, {
13548    ID: 289,
13549    Make: "Robinson",
13550    Model: "R66",
13551    Engine: "Turbine",
13552    "Engine Number": "Single Engine",
13553    Category: "Helicopter"
13554  }, {
13555    ID: 290,
13556    Make: "Rockwell",
13557    Model: "Commander 100",
13558    Engine: "Piston",
13559    "Engine Number": "Single Engine",
13560    Category: "Airplane"
13561  }, {
13562    ID: 291,
13563    Make: "Sabreliner",
13564    Model: "40",
13565    Engine: "Turbine",
13566    "Engine Number": "Twin Engine",
13567    Category: "Airplane"
13568  }, {
13569    ID: 292,
13570    Make: "Sabreliner",
13571    Model: "60",
13572    Engine: "Turbine",
13573    "Engine Number": "Twin Engine",
13574    Category: "Airplane"
13575  }, {
13576    ID: 293,
13577    Make: "Sabreliner",
13578    Model: "65",
13579    Engine: "Turbine",
13580    "Engine Number": "Twin Engine",
13581    Category: "Airplane"
13582  }, {
13583    ID: 294,
13584    Make: "Sabreliner",
13585    Model: "75",
13586    Engine: "Turbine",
13587    "Engine Number": "Twin Engine",
13588    Category: "Airplane"
13589  }, {
13590    ID: 295,
13591    Make: "Sabreliner",
13592    Model: "75",
13593    Engine: "Turbine",
13594    "Engine Number": "Twin Engine",
13595    Category: "Airplane"
13596  }, {
13597    ID: 296,
13598    Make: "Sikorsky",
13599    Model: "300C 269C",
13600    Engine: "Piston",
13601    "Engine Number": "Single Engine",
13602    Category: "Helicopter"
13603  }, {
13604    ID: 297,
13605    Make: "Sikorsky",
13606    Model: "333",
13607    Engine: "Turbine",
13608    "Engine Number": "Single Engine",
13609    Category: "Helicopter"
13610  }, {
13611    ID: 298,
13612    Make: "Sikorsky",
13613    Model: "S-76 ",
13614    Engine: "Turbine",
13615    "Engine Number": "Twin Engine",
13616    Category: "Helicopter"
13617  }, {
13618    ID: 299,
13619    Make: "Socata",
13620    Model: "Tampico",
13621    Engine: "Piston",
13622    "Engine Number": "Single Engine",
13623    Category: "Airplane"
13624  }, {
13625    ID: 300,
13626    Make: "Socata",
13627    Model: "Tobago",
13628    Engine: "Piston",
13629    "Engine Number": "Single Engine",
13630    Category: "Airplane"
13631  }, {
13632    ID: 301,
13633    Make: "Socata",
13634    Model: "Trinidad",
13635    Engine: "Piston",
13636    "Engine Number": "Single Engine",
13637    Category: "Airplane"
13638  }, {
13639    ID: 302,
13640    Make: "Socata",
13641    Model: "TBM 700",
13642    Engine: "Turbine",
13643    "Engine Number": "Single Engine",
13644    Category: "Airplane"
13645  }, {
13646    ID: 303,
13647    Make: "Socata",
13648    Model: "TBM 850",
13649    Engine: "Turbine",
13650    "Engine Number": "Single Engine",
13651    Category: "Airplane"
13652  }, {
13653    ID: 304,
13654    Make: "Socata",
13655    Model: "TBM 930",
13656    Engine: "Turbine",
13657    "Engine Number": "Single Engine",
13658    Category: "Airplane"
13659  }, {
13660    ID: 305,
13661    Make: "Stingsport",
13662    Model: "Stingsport",
13663    Engine: "Piston",
13664    "Engine Number": "Single Engine",
13665    Category: "Airplane"
13666  }, {
13667    ID: 306,
13668    Make: "Stinson",
13669    Model: "108",
13670    Engine: "Piston",
13671    "Engine Number": "Single Engine",
13672    Category: "Airplane"
13673  }, {
13674    ID: 353,
13675    Make: "Super Petrel USA",
13676    Model: "Super Petrel LS",
13677    Engine: "Piston",
13678    "Engine Number": "Single Engine",
13679    Category: "Airplane"
13680  }, {
13681    ID: 307,
13682    Make: "Symphony",
13683    Model: "SA 160",
13684    Engine: "Piston",
13685    "Engine Number": "Single Engine",
13686    Category: "Airplane"
13687  }, {
13688    ID: 308,
13689    Make: "Taylorcraft",
13690    Model: "Taylorcraft",
13691    Engine: "Piston",
13692    "Engine Number": "Single Engine",
13693    Category: "Airplane"
13694  }, {
13695    ID: 309,
13696    Make: "Tecnam",
13697    Model: "Astore",
13698    Engine: "Piston",
13699    "Engine Number": "Single Engine",
13700    Category: "Airplane"
13701  }, {
13702    ID: 310,
13703    Make: "Tecnam",
13704    Model: "Tecnam",
13705    Engine: "Piston",
13706    "Engine Number": "Single Engine",
13707    Category: "Airplane"
13708  }, {
13709    ID: 311,
13710    Make: "Tecnam",
13711    Model: "P92",
13712    Engine: "Piston",
13713    "Engine Number": "Single Engine",
13714    Category: "Airplane"
13715  }, {
13716    ID: 312,
13717    Make: "Tecnam",
13718    Model: "P2002",
13719    Engine: "Piston",
13720    "Engine Number": "Single Engine",
13721    Category: "Airplane"
13722  }, {
13723    ID: 313,
13724    Make: "Tecnam",
13725    Model: "P2006",
13726    Engine: "Piston",
13727    "Engine Number": "Twin Engine",
13728    Category: "Airplane"
13729  }, {
13730    ID: 314,
13731    Make: "Tecnam",
13732    Model: "P2008",
13733    Engine: "Piston",
13734    "Engine Number": "Twin Engine",
13735    Category: "Airplane"
13736  }, {
13737    ID: 315,
13738    Make: "Tecnam",
13739    Model: "P2010",
13740    Engine: "Piston",
13741    "Engine Number": "Twin Engine",
13742    Category: "Airplane"
13743  }, {
13744    ID: 316,
13745    Make: "Tecnam",
13746    Model: "P2012",
13747    Engine: "Piston",
13748    "Engine Number": "Twin Engine",
13749    Category: "Airplane"
13750  }, {
13751    ID: 317,
13752    Make: "Tiger",
13753    Model: "AG5B",
13754    Engine: "Piston",
13755    "Engine Number": "Single Engine",
13756    Category: "Airplane"
13757  }, {
13758    ID: 318,
13759    Make: "Twin Commander",
13760    Model: "500",
13761    Engine: "Piston",
13762    "Engine Number": "Twin Engine",
13763    Category: "Airplane"
13764  }, {
13765    ID: 319,
13766    Make: "Twin Commander",
13767    Model: "Shrike 500 S",
13768    Engine: "Piston",
13769    "Engine Number": "Twin Engine",
13770    Category: "Airplane"
13771  }, {
13772    ID: 320,
13773    Make: "Twin Commander",
13774    Model: "520",
13775    Engine: "Piston",
13776    "Engine Number": "Twin Engine",
13777    Category: "Airplane"
13778  }, {
13779    ID: 321,
13780    Make: "Twin Commander",
13781    Model: "560",
13782    Engine: "Piston",
13783    "Engine Number": "Twin Engine",
13784    Category: "Airplane"
13785  }, {
13786    ID: 322,
13787    Make: "Twin Commander",
13788    Model: "680",
13789    Engine: "Piston",
13790    "Engine Number": "Twin Engine",
13791    Category: "Airplane"
13792  }, {
13793    ID: 323,
13794    Make: "Twin Commander",
13795    Model: "681 /B",
13796    Engine: "Turbine",
13797    "Engine Number": "Twin Engine",
13798    Category: "Airplane"
13799  }, {
13800    ID: 324,
13801    Make: "Twin Commander",
13802    Model: "685",
13803    Engine: "Piston",
13804    "Engine Number": "Twin Engine",
13805    Category: "Airplane"
13806  }, {
13807    ID: 325,
13808    Make: "Twin Commander",
13809    Model: "Fuji 700",
13810    Engine: "Piston",
13811    "Engine Number": "Twin Engine",
13812    Category: "Airplane"
13813  }, {
13814    ID: 326,
13815    Make: "Twin Commander",
13816    Model: "690",
13817    Engine: "Turbine",
13818    "Engine Number": "Twin Engine",
13819    Category: "Airplane"
13820  }, {
13821    ID: 327,
13822    Make: "Twin Commander",
13823    Model: "840",
13824    Engine: "Turbine",
13825    "Engine Number": "Twin Engine",
13826    Category: "Airplane"
13827  }, {
13828    ID: 328,
13829    Make: "Twin Commander",
13830    Model: "900",
13831    Engine: "Turbine",
13832    "Engine Number": "Twin Engine",
13833    Category: "Airplane"
13834  }, {
13835    ID: 329,
13836    Make: "Twin Commander",
13837    Model: "980",
13838    Engine: "Turbine",
13839    "Engine Number": "Twin Engine",
13840    Category: "Airplane"
13841  }, {
13842    ID: 330,
13843    Make: "Twin Commander",
13844    Model: "1000",
13845    Engine: "Turbine",
13846    "Engine Number": "Twin Engine",
13847    Category: "Airplane"
13848  }, {
13849    ID: 331,
13850    Make: "Vans",
13851    Model: "RV 3-10",
13852    Engine: "Piston",
13853    "Engine Number": "Single Engine",
13854    Category: "Airplane"
13855  }, {
13856    ID: 332,
13857    Make: "Vans",
13858    Model: "RV 12 LSA",
13859    Engine: "Piston",
13860    "Engine Number": "Single Engine",
13861    Category: "Airplane"
13862  }, {
13863    ID: 333,
13864    Make: "Varga",
13865    Model: "Kachina 2150",
13866    Engine: "Piston",
13867    "Engine Number": "Single Engine",
13868    Category: "Airplane"
13869  }, {
13870    ID: 337,
13871    Make: "Other",
13872    Model: "BearHawk LSA",
13873    Engine: "Piston",
13874    "Engine Number": "Single Engine",
13875    Category: "Airplane"
13876  }, {
13877    ID: 338,
13878    Make: "Other",
13879    Model: "E
13879xtra 300-330",
13880    Engine: "Piston",
13881    "Engine Number": "Single Engine",
13882    Category: "Airplane"
13883  }, {
13884    ID: 339,
13885    Make: "Other",
13886    Model: "Great Lakes",
13887    Engine: "Piston",
13888    "Engine Number": "Single Engine",
13889    Category: "Airplane"
13890  }, {
13891    ID: 340,
13892    Make: "Other",
13893    Model: "Hatz Biplane",
13894    Engine: "Piston",
13895    "Engine Number": "Single Engine",
13896    Category: "Airplane"
13897  }, {
13898    ID: 341,
13899    Make: "Other",
13900    Model: "Just Aircraft",
13901    Engine: "Piston",
13902    "Engine Number": "Single Engine",
13903    Category: "Airplane"
13904  }, {
13905    ID: 342,
13906    Make: "Other",
13907    Model: "Nanchang",
13908    Engine: "Piston",
13909    "Engine Number": "Single Engine",
13910    Category: "Airplane"
13911  }, {
13912    ID: 343,
13913    Make: "Other",
13914    Model: "Other",
13915    Engine: "Piston",
13916    "Engine Number": "Single Engine",
13917    Category: "Airplane"
13918  }, {
13919    ID: 344,
13920    Make: "Other",
13921    Model: "Rans",
13922    Engine: "Piston",
13923    "Engine Number": "Single Engine",
13924    Category: "Airplane"
13925  }, {
13926    ID: 345,
13927    Make: "Other",
13928    Model: "Sling",
13929    Engine: "Piston",
13930    "Engine Number": "Single Engine",
13931    Category: "Airplane"
13932  }, {
13933    ID: 346,
13934    Make: "Other",
13935    Model: "Stinson",
13936    Engine: "Piston",
13937    "Engine Number": "Single Engine",
13938    Category: "Airplane"
13939  }, {
13940    ID: 347,
13941    Make: "Other",
13942    Model: "T-34",
13943    Engine: "Piston",
13944    "Engine Number": "Single Engine",
13945    Category: "Airplane"
13946  }, {
13947    ID: 348,
13948    Make: "Other",
13949    Model: "T-6",
13950    Engine: "Piston",
13951    "Engine Number": "Single Engine",
13952    Category: "Airplane"
13953  }, {
13954    ID: 349,
13955    Make: "Other",
13956    Model: "Thorp",
13957    Engine: "Piston",
13958    "Engine Number": "Single Engine",
13959    Category: "Airplane"
13960  }, {
13961    ID: 350,
13962    Make: "Other",
13963    Model: "Waco",
13964    Engine: "Piston",
13965    "Engine Number": "Single Engine",
13966    Category: "Airplane"
13967  }, {
13968    ID: 351,
13969    Make: "Other",
13970    Model: "Yak",
13971    Engine: "Piston",
13972    "Engine Number": "Single Engine",
13973    Category: "Airplane"
13974  }, {
13975    ID: 352,
13976    Make: "Vashon Aircraft",
13977    Model: "Ranger",
13978    Engine: "Piston",
13979    "Engine Number": "Single Engine",
13980    Category: "Airplane"
13981  }] };
13982//Hide Member Number
13983$("#memberNumber").hide();
13984//If member, show member number field
13985$("#00N6100000BdnRt").change(function () {
13986  if ($("#00N6100000BdnRt").val() == "Yes") {
13987    $("#memberNumber").toggle();
13988  } else {
13989    $("#memberNumber").hide();
13990  };
13991});
13992
13993//hide other financing needs
13994
13995$("#otherFinanceNeeds").hide();
13996//if other type of financing needs, show the field
13997$("#00N6100000BdnS8").change(function () {
13998  if ($("#00N6100000BdnS8").val() == "Other") {
13999    $("#otherFinanceNeeds").toggle();
14000  } else {
14001    $("#otherFinanceNeeds").hide();
14002  };
14003});
14004//show the list of make's from the json script
14005var listItems = "<option selected=\"selected\" value=\"0\">Select Make</option>";
14006
14007for (var i = 0; i < jsonData.Planes.length; i++) {
14008  listItems += "<option value='" + jsonData.Planes[i].Make + "'>" + jsonData.Planes[i].Make + "</option>";
14009};
14010
14011// clear the model listing if a new make is chosen
14012$("#00N6100000BdnT6").html(listItems); //id is make
14013var previousOption;
14014$("select[name=00N6100000BdnT6] option").each(function () {
14015  if (this.text == previousOption) $(this).remove();
14016  previousOption = this.text;
14017});
14018//show the list of models if a particular make is chosen
14019$("#00N6100000BdnT6").change(function () {
14020  //id is make
14021  $("#00N6100000BdnTG").empty().append($("<option></option>").val("Select Model").html("Select Model")); //id is model
14022  var matchVal = $("#00N6100000BdnT6 option:selected").text(); //id is make
14023  jsonData.Planes.filter(function (plane) {
14024    if (plane.Make == matchVal) {
14025      $("#00N6100000BdnTG").append($("<option value ='" + plane.Model + "'></option>").html(plane.Model)); //id is model
14026    }
14027  });
14028});
14029// support the placeholder in IE 7 and 8
14030(function ($) {
14031  $.support.placeholder = "placeholder" in document.createElement("input");
14032})($);
14033
14034//fix for IE7 and IE8
14035$(function () {
14036  if (!$.support.placeholder) {
14037    $("[placeholder]").focus(function () {
14038      if ($(this).val() == $(this).attr("placeholder")) $(this).val("");
14039    }).blur(function () {
14040      if ($(this).val() == "") $(this).val($(this).attr("placeholder"));
14041    }).blur();
14042
14043    $("[placeholder]").parents("form").submit(function () {
14044      $(this).find("[placeholder]").each(function () {
14045        if ($(this).val() == $(this).attr("placeholder")) {
14046          $(this).val("");
14047        }
14048      });
14049    });
14050  }
14051});
14052
14053},{}],75:[function(require,module,exports){
14054"use strict";
14055
14056$(document).ready(function () {
14057    if ($("div#divFlyInRegistrationForm").length) {
14058        var theForm;
14059
14060        (function () {
14061            var validateDiv = function (div) {
14062                var validator = theForm.data("validator");
14063                var returnValue = true;
14064
14065                $("#" + div + " :input").each(function (e) {
14066                    if (!$(this).is(":button") && this.id.length) {
14067                        if (!validator.element($("#" + this.id))) returnValue = false;
14068                    }
14069                });
14070
14071                if (div === "fiPage2") {
14072                    if ($("input[name=MembershipSelected]:checked").val() === undefined || $("input[name=MembershipSelected]:checked").val() === "") {
14073                        $("#divMemberSelectValid").show();
14074                    } else {
14075                        $("#divMemberSelectValid").hide();
14076                    }
14077                }
14078
14079                return returnValue;
14080            };
14081
14082            var infoDivs = function (page) {
14083                switch (page) {
14084                    case "fiPage1":
14085                        $("#fiProductName").show();
14086                        $("#fiMainInfo").show();
14087                        $("#fiMealInfo").hide();
14088                        $("#fiVolunteerInfo").hide();
14089                        $("#fiCareerFairInfo").hide();
14090                        $("#fiWorkshopInfo").hide();
14091                        $("#fiPRustyPilotInfo").hide();
14092                        $("#fiCampingInfo").hide();
14093                        $("#divEventSummary").show();
14094
14095                        break;
14096                    case "fiPage2":
14097                        $("#fiProductName").show();
14098                        $("#fiMainInfo").show();
14099                        $("#fiMealInfo").hide();
14100                        $("#fiVolunteerInfo").hide();
14101                        $("#fiCareerFairInfo").hide();
14102                        $("#fiWorkshopInfo").hide();
14103                        $("#fiPRustyPilotInfo").hide();
14104                        $("#fiCampingInfo").hide();
14105                        $("#divEventSummary").show();
14106                        break;
14107                    case "fiPage3":
14108                        $("#fiProductName").show();
14109                        $("#fiMainInfo").show();
14110                        $("#fiMealInfo").show();
14111                        $("#fiVolunteerInfo").hide();
14112                        $("#fiCareerFairInfo").hide();
14113                        $("#fiWorkshopInfo").hide();
14114                        $("#fiPRustyPilotInfo").hide();
14115                        $("#fiCampingInfo").hide();
14116                        $("#divEventSummary").show();
14117                        break;
14118                    case "fiPage4":
14119                        $("#fiProductName").show();
14120                        $("#fiMainInfo").hide();
14121                        $("#fiMealInfo").hide();
14122                        $("#fiVolunteerInfo").show();
14123                        $("#fiCareerFairInfo").hide();
14124                        $("#fiWorkshopInfo").hide();
14125                        $("#fiPRustyPilotInfo").hide();
14126                        $("#fiCampingInfo").hide();
14127                        $("#divEventSummary").show();
14128                        break;
14129                    case "fiPage5":
14130                        $("#fiProductName").show();
14131                        $("#fiMainInfo").hide();
14132                        $("#fiMealInfo").hide();
14133                        $("#fiVolunteerInfo").show();
14134                        $("#fiCareerFairInfo").hide();
14135                        $("#fiWorkshopInfo").hide();
14136                        $("#fiPRustyPilotInfo").hide();
14137                        $("#fiCampingInfo").hide();
14138                        $("#divEventSummary").show();
14139                        break;
14140                    case "fiPage6":
14141                        $("#fiProductName").show();
14142                        $("#fiMainInfo").hide();
14143                        $("#fiMealInfo").hide();
14144                        $("#fiVolunteerInfo").hide();
14145                        $("#fiCareerFairInfo").show();
14146                        $("#fiWorkshopInfo").show();
14147                        $("#fiPRustyPilotInfo").show();
14148                        $("#fiCampingInfo").hide();
14149                        $("#divEventSummary").show();
14150                        break;
14151                    case "fiPage7":
14152                        $("#fiProductName").show();
14153                        $("#fiMainInfo").hide();
14154                        $("#fiMealInfo").hide();
14155                        $("#fiVolunteerInfo").hide();
14156                        $("#fiCareerFairInfo").hide();
14157                        $("#fiWorkshopInfo").hide();
14158                        $("#fiPRustyPilotInfo").hide();
14159                        $("#fiCampingInfo").show();
14160                        $("#divEventSummary").show();
14161                        break;
14162                    case "fiPage8":
14163                        $("#fiProductName").hide();
14164                        $("#fiMainInfo").hide();
14165                        $("#fiMealInfo").hide();
14166                        $("#fiVolunteerInfo").hide();
14167                        $("#fiCareerFairInfo").hide();
14168                        $("#fiWorkshopInfo").hide();
14169                        $("#fiPRustyPilotInfo").hide();
14170                        $("#fiCampingInfo").hide();
14171                        $("#divEventSummary").hide();
14172                        break;
14173                }
14174            };
14175
14176            var calculateTotal = function () {
14177                SetSummary();
14178
14179                var total = 0;
14180
14181                total += parseInt($("#GateFeeAdultCount").val(), 10) * parseFloat($("#GateFeeAdultPrice").val());
14182                total += parseInt($("#GateFeeChildCount").val(), 10) * parseFloat($("#GateFeeChildPrice").val());
14183
14184                total += parseInt($("#BreakfastFridayAdult").val(), 10) * parseFloat($("#FridayBreakfastAdultPrice").val());
14185                total += parseInt($("#BreakfastFridayChild").val(), 10) * parseFloat($("#FridayBreakfastChildPrice").val());
14186                total += parseInt($("#DinnerFridayAdult").val(), 10) * parseFloat($("#FridayDinnerAdultPrice").val());
14187                total += parseInt($("#DinnerFridayChild").val(), 10) * parseFloat($("#FridayDinnerChildPrice").val());
14188                total += parseInt($("#BreakfastSaturdayAdult").val(), 10) * parseFloat($("#SaturdayBreakfastAdultPrice").val());
14189                total += parseInt($("#BreakfastSaturdayChild").val(), 10) * parseFloat($("#SaturdayBreakfastChildPrice").val());
14190
14191                if (document.getElementById("WorkshopChoice").checked) {
14192                    total += parseInt($("#WorkshopCount").val(), 10) * parseFloat($("#WorkshopPrice").val());
14193                }
14194
14195                if (document.getElementById("RustyPilotChoice").checked) {
14196                    total += parseFloat($("#RustyPilotPrice").val());
14197                }
14198
14199                if (document.getElementById("CampingChoice").checked) {
14200                    total += parseFloat($("#CampingPrice").val());
14201                }
14202
14203                $("#OrderTotal").val(total);
14204                if (total === 0) {
14205                    $(".event-payment-total__price").text("FREE");
14206                } else {
14207                    $(".event-payment-total__price").text("$" + total.toFixed(2));
14208                }
14209
14210                if (total > 0) {
14211                    $("#fiPaymentSection").show();
14212                } else {
14213                    $("#fiPaymentSection").hide();
14214                }
14215            };
14216
14217            var SetSummary = function () {
14218
14219                if ($("#GateFeeAdultCount").val() > 0) {
14220                    $("#dqtyMainAdult").text(parseInt($("#GateFeeAdultCount").val(), 10));
14221                    var adTotal = parseInt($("#GateFeeAdultCount").val(), 10) * parseFloat($("#GateFeeAdultPrice").val());
14222                    if (adTotal > 0) {
14223                        $("#spMainAdult").text("$" + adTotal.toFixed(2));
14224                    } else {
14225                        $("#spMainAdult").text("FREE");
14226                    }
14227                    $("#dsrMainAdult").show();
14228                } else {
14229                    $("#dsrMainAdult").hide();
14230                }
14231
14232                if ($("#GateFeeChildCount").val() > 0) {
14233                    $("#dqtyMainChild").text(parseInt($("#GateFeeChildCount").val(), 10));
14234                    $("#spMainChild").text("$" + (parseInt($("#GateFeeChildCount").val(), 10) * parseFloat($("#GateFeeChildPrice").val())).toFixed(2));
14235                    $("#dsrMainChild").show();
14236                } else {
14237                    $("#dsrMainChild").hide();
14238                }
14239
14240                if (document.getElementById("WorkshopChoice").checked && parseInt($("#WorkshopCount").val(), 10) > 0) {
14241                    $("#dqtyWorkshop").text($("#WorkshopCount").val());
14242                    $("#spWorkshop").text("$" + (parseInt($("#WorkshopCount").val(), 10) * parseFloat($("#WorkshopPrice").val())).toFixed(2));
14243                    $("#dsrWorkshop").show();
14244                } else {
14245                    $("#dsrWorkshop").hide();
14246                }
14247
14248                if (document.getElementById("CampingChoice").checked) {
14249                    $("#dsrCamping").show();
14250                } else {
14251                    $("#dsrCamping").hide();
14252                }
14253
14254                if (document.getElementById("CareerFairChoice").checked) {
14255                    $("#dsrCareerFair").show();
14256                } else {
14257                    $("#dsrCareerFair").hide();
14258                }
14259
14260                var showWednesday = false;
14261                var showThursday = false;
14262                var showFriday = false;
14263                var showSaturday = false;
14264                var showSunday = false;
14265
14266                $("#WEDNESDAY").hide();
14267                $("#THURSDAY").hide();
14268                $("#FRIDAY").hide();
14269                $("#SATURDAY").hide();
14270                $("#SUNDAY").hide();
14271
14272                showFriday = MealSet("Friday", "Breakfast", "Adult", showFriday);
14273                showFriday = MealSet("Friday", "Breakfast", "Child", showFriday);
14274                showFriday = MealSet("Friday", "Dinner", "Adult", showFriday);
14275                showFriday = MealSet("Friday", "Dinner", "Child", showFriday);
14276                showSaturday = MealSet("Saturday", "Breakfast", "Adult", showSaturday);
14277                showSaturday = MealSet("Saturday", "Breakfast", "Child", showSaturday);
14278
14279                if (parseInt($("#BreakfastFridayAdult").val(), 10) === 0 && parseInt($("#BreakfastFridayChild").val(), 10) === 0) {
14280                    $("#dsrFridayBreakfastMain").hide();
14281                }
14282                if (parseInt($("#DinnerFridayAdult").val(), 10) === 0 && parseInt($("#DinnerFridayChild").val(), 10) === 0) {
14283                    $("#dsrFridayDinnerMain").hide();
14284                }
14285                if (parseInt($("#BreakfastSaturdayAdult").val(), 10) === 0 && parseInt($("#BreakfastSaturdayChild").val(), 10) === 0) {
14286                    $("#dsrSaturdayBreakfastMain").hide();
14287                }
14288
14289                if (document.getElementById("RustyPilotChoice").checked) {
14290                    $("#dsrRustyPilots").show();
14291                    showSaturday = true;
14292                } else {
14293                    $("#dsrRustyPilots").hide();
14294                }
14295
14296                var volcbs = document.getElementsByClassName("vol-job-selection-cb");
14297
14298                for (var i = 0; i < volcbs.length; i++) {
14299                    if (volcbs[i].checked) {
14300                        $("#dsr" + volcbs[i].value).show();
14301                        switch ($("#" + volcbs[i].id).data("day")) {
14302                            case "WEDNESDAY":
14303                                showWednesday = true;
14304                                break;
14305                            case "THURSDAY":
14306                                showThursday = true;
14307                                break;
14308                            case "FRIDAY":
14309                                showFriday = true;
14310                                break;
14311                            case "SATURDAY":
14312                                showSaturday = true;
14313                                break;
14314                            case "SUNDAY":
14315                                showSunday = true;
14316                                break;
14317                        }
14318                    } else {
14319                        $("#dsr" + volcbs[i].value).hide();
14320                    }
14321                }
14322
14323                if (showWednesday) $("#WEDNESDAY").show();
14324                if (showThursday) $("#THURSDAY").show();
14325                if (showFriday) $("#FRIDAY").show();
14326                if (showSaturday) $("#SATURDAY").show();
14327                if (showSunday) $("#SUNDAY").show();
14328            };
14329
14330            var MealSet = function (day, meal, person, showDay) {
14331                var show = false;
14332                if (parseInt($("#" + meal + day + person).val(), 10) > 0) {
14333                    $("#dsr" + day + meal + "Main").show();
14334                    $("#dsr" + day + meal + person).show();
14335                    $("#dqty" + day + meal + person).text(parseInt($("#" + meal + day + person).val(), 10));
14336                    $("#sp" + day + meal + person).text("$" + (parseInt($("#" + meal + day + person).val(), 10) * parseFloat($("#" + day + meal + person + "Price").val())).toFixed(2));
14337                    show = true;
14338                } else {
14339                    $("#dsr" + day + meal + person).hide();
14340                }
14341
14342                return showDay || show;
14343            };
14344
14345            theForm = $("#frmFlyInRegistration");
14346
14347            $(".btnCancel").click(function () {
14348                window.location.href = "https://www.aopa.org";
14349            });
14350
14351            $(".flyincontinuebutton").click(function () {
14352                if (validateDiv($(this).data("thispage"))) {
14353                    var btn = document.getElementById(this.id);
14354                    var nextpage = $(this).data("nextpage");
14355
14356                    if (btn != null && btn.hasAttribute("data-nextpage-choice")) {
14357                        var cb = document.getElementById($(this).data("nextpage-choice"));
14358                        if (!cb.checked) {
14359                            nextpage = $(this).data("alt-nextpage");
14360                        }
14361                    }
14362
14363                    $("#" + $(this).data("thispage")).hide();
14364                    $("#" + nextpage).show();
14365                    infoDivs(nextpage);
14366                    window.scrollTo(0, 0);
14367                }
14368            });
14369
14370            $(".flyinbackbutton").click(function () {
14371                var btn = document.getElementById(this.id);
14372                var prevpage = $(this).data("prevpage");
14373
14374                if (btn != null && btn.hasAttribute("data-prevpage-choice")) {
14375                    var cb = document.getElementById($(this).data("prevpage-choice"));
14376                    if (!cb.checked) {
14377                        prevpage = $(this).data("alt-prevpage");
14378                    }
14379                }
14380
14381                $("#" + $(this).data("thispage")).hide();
14382                $("#" + prevpage).show();
14383                infoDivs(prevpage);
14384                window.scrollTo(0, 0);
14385            });
14386
14387            $(".fi-control-cb").click(function () {
14388                var cb = document.getElementById(this.id);
14389                if (cb.checked) {
14390                    $("#" + $(this).data("reveal-div")).show();
14391                    calculateTotal();
14392                } else {
14393                    $("#" + $(this).data("reveal-div")).hide();
14394                    calculateTotal();
14395                }
14396            });
14397
14398            $(".fly-in-guest-u").change(function () {
14399                var ok = true;
14400                var ac = 0;
14401                var ct = parseInt($("#GateFeeAdultCount").val(), 10);
14402                if (ct !== NaN && ct >= 0) {
14403                    ac += ct;
14404                } else {
14405                    ok = false;
14406                }
14407                ct = parseInt($("#GateFeeChildCount").val(), 10);
14408                if (ct !== NaN && ct >= 0) {
14409                    ac += ct;
14410                } else {
14411                    ok = false;
14412                }
14413                if (ok) {
14414                    calculateTotal();
14415                    $("#AttendeeCount").val(ac);
14416                }
14417            });
14418
14419            $(".fly-in-meal-u").change(function () {
14420                var ct = parseInt($("#" + this.id).val(), 10);
14421                if (ct !== NaN && ct >= 0) {
14422                    calculateTotal();
14423                }
14424            });
14425
14426            $(".fly-in-workshop-u").change(function () {
14427                var ct = parseInt($("#" + this.id).val(), 10);
14428                if (ct !== NaN && ct >= 0) {
14429                    calculateTotal();
14430                }
14431            });
14432
14433            $("#TravelOptionsSelected").change(function () {
14434                var option = $(this).find("option:selected").val();
14435
14436                if (option === "FLY") {
14437                    $(".fly-in-travel-fly").show();
14438                } else {
14439                    $(".fly-in-travel-fly").hide();
14440                }
14441            });
14442
14443            $(".fiRegisterButton").click(function () {
14444                if (theForm.valid()) {
14445                    $(".btn_final_cancelback").hide();
14446                    $(this).hide();
14447                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
14448                    theForm.submit();
14449                }
14450            });
14451
14452            $(".vol-selection-update").change(function () {
14453                var nextButton = document.getElementById("btnPage5Forward");
14454
14455                var daylist = "";
14456                $(".VolunteerDaySelected").each(function (index, obj) {
14457                    if ($(this).prop("checked")) {
14458                        daylist += this.value + ",";
14459                    }
14460                });
14461                var choices = [];
14462                if (daylist !== "") daylist = daylist.slice(0, -1);
14463                if (daylist !== "" && $("input[name=VolunteerIntensitySelected]:checked").val() !== "" && $("#VolunteerCertifiedPilotSelected").val() !== "") {
14464                    $.each(daylist.split(","), function (di, dv) {
14465                        $.each($("#VolunteerCertifiedPilotSelected").val().split("|"), function (pi, pv) {
14466                            choices.push(dv + pv + $("input[name=VolunteerIntensitySelected]:checked").val());
14467                        });
14468                    });
14469                }
14470
14471                if (choices.length > 0) {
14472
14473                    var found = false;
14474                    $.each(choices, function (di, dv) {
14475                        if ($("#VolunteerOptionsAvailable").val().includes(dv)) {
14476                            found = true;
14477                        }
14478                    });
14479
14480                    if (!found) {
14481                        $("#divVolunteerFilter").show();
14482                        nextButton.disabled = true;
14483                        $("#btnPage5Forward").addClass("fly-in-disable-button");
14484                    } else {
14485                        $(".fly-in-vol-airside").hide();
14486                        $(".fly-in-vol-showside").hide();
14487                        $(".fly-in-volunteer-day-wrapper").hide();
14488
14489                        $(".fly-in-volunteer-checkbox").each(function (i, obj) {
14490                            if ($(this).data("vol-category-code") === $("input[name=VolunteerIntensitySelected]:checked").val() && $("#VolunteerCertifiedPilotSelected").val().includes($(this).data("vol-level-code"))) {
14491
14492                                $("." + $(this).data("vol-level-code").toLowerCase() + "-" + $(this).data("vol-item-day")).show();
14493                                if (daylist.indexOf($(this).data("vol-item-day").toUpperCase()) >= 0) {
14494                                    $(".fly-in-vol-day-" + $(this).data("vol-item-day")).show();
14495                                }
14496                                $(this).show();
14497                            } else {
14498                                $(this).hide();
14499                            }
14500                        });
14501
14502                        $("#divVolunteerFilter").hide();
14503                        nextButton.disabled = false;
14504                        $("#btnPage5Forward").removeClass("fly-in-disable-button");
14505                    }
14506                }
14507            });
14508
14509            $(".vol-job-selection-cb").change(function () {
14510                var cb = document.getElementById(this.id);
14511                if ($("#VolunteerJobsSelected").val().length) {
14512                    var items = $.map($("#VolunteerJobsSelected").val().split(","), function (value) {
14513                        return parseInt(value, 10);
14514                    });
14515
14516                    var index = items.indexOf(parseInt(cb.value, 10));
14517
14518                    if (cb.checked) {
14519                        if (index === -1) {
14520                            items.push(parseInt(cb.value, 10));
14521                        }
14522                    } else {
14523                        if (index > -1) {
14524                            items.splice(index, 1);
14525                        }
14526                    }
14527
14528                    $("#VolunteerJobsSelected").val(items.join(","));
14529                } else {
14530                    if (cb.checked) $("#VolunteerJobsSelected").val(cb.value);
14531                }
14532
14533                SetSummary();
14534            });
14535
14536            $("#GateFeeAdultCount").change(function () {
14537                $("#GateFeeAdultCount").valid();
14538                $("#GateFeeChildCount").valid();
14539            });
14540
14541            $("#GateFeeChildCount").change(function () {
14542                $("#GateFeeAdultCount").valid();
14543                $("#GateFeeChildCount").valid();
14544            });
14545
14546            $(".fi-membership-options").change(function () {
14547                var nextButton = document.getElementById("btnPage3Forward");
14548                $("#divMemberSelectValid").hide();
14549                if ($("input[name=MembershipSelected]:checked").val() === "YES") {
14550                    $(".fi-non-member-text").hide();
14551                    nextButton.disabled = false;
14552                    $("#btnPage3Forward").removeClass("fly-in-disable-button");
14553                } else {
14554                    $(".fi-non-member-text").show();
14555                    nextButton.disabled = true;
14556                    $("#btnPage3Forward").addClass("fly-in-disable-button");
14557                }
14558            });
14559        })();
14560    }
14561});
14562
14563},{}],76:[function(require,module,exports){
14564"use strict";
14565
14566$(document).ready(function () {
14567    if ($("div#divFormAccountCreate").length) {
14568        var theForm = $("#frmFormAccountCreate");
14569
14570        $(".actionSubmitButton").click(function () {
14571
14572            var progressBar = new Sfpb_progressBar();
14573
14574            if (theForm.valid()) {
14575                $("#btnAction").hide();
14576                $(this).hide();
14577                $("body").addClass("progressbar-modal");
14578                progressBar.start();
14579                $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
14580                theForm.submit();
14581            } else {
14582                var firstInstance = $(".input-validation-error").first();
14583                var offsetTop = firstInstance.offset().top - 100;
14584
14585                $("html, body").animate({
14586                    scrollTop: offsetTop
14587                }, 500);
14588            }
14589        });
14590    }
14591});
14592
14593},{}],77:[function(require,module,exports){
14594"use strict";
14595
14596$(document).ready(function () {
14597    if ($("div#divButtonSubmit").length) {
14598        $(".submitButton").click(function () {
14599            var form = $(this).closest("form");
14600            if (form.valid()) {
14601                $(this).hide();
14602                $(".clsSubmitButton").append("<div class=\"spinner spinner--clockwise\"></div>");
14603            }
14604        });
14605    }
14606
14607    if ($("div#divButtonSubmit2").length) {
14608        $(".submitButton").click(function () {
14609            var form = $(this).closest("form");
14610            if (form.valid()) {
14611                $(this).hide();
14612                $(".backBtn").hide();
14613                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
14614            }
14615        });
14616    }
14617
14618    // extend jquery range validator to work for required checkboxes
14619    var defaultRangeValidator = $.validator.methods.range;
14620    $.validator.methods.range = function (value, element, param) {
14621        if (element.type === "checkbox") {
14622            // if it's a checkbox return true if it is checked
14623            return element.checked;
14624        } else {
14625            // otherwise run the default validation function
14626            return defaultRangeValidator.call(this, value, element, param);
14627        }
14628    };
14629});
14630
14631},{}],78:[function(require,module,exports){
14632"use strict";
14633
14634$(document).ready(function () {
14635    if ($("div#divFreeMembeshipForm").length) {
14636        var autocomplete;
14637        var jfStripe;
14638        var jfElements;
14639        var jfStyle;
14640        var jfCardElement;
14641        var initAutocomplete;
14642        var clearValidation;
14643        var checkCardFields;
14644
14645        (function () {
14646            var fillInAddress = function () {
14647                // Get the place details from the autocomplete object.
14648                var place = autocomplete.getPlace();
14649                var address1 = "";
14650                var postcode = "";
14651
14652                $("#MailingStreet").val("");
14653                $("#MailingCity").val("");
14654                $("#MailingStateProvince").val("");
14655                $("#MailingPostalCode").val("");
14656
14657                // Get each component of the address from the place details,
14658                // and then fill-in the corresponding field on the form.
14659                // place.address_components are google.maps.GeocoderAddressComponent objects
14660                // which are documented at http://goo.gle/3l5i5Mr
14661                place.address_components.forEach(function (component) {
14662                    var componentType = component.types[0];
14663
14664                    switch (componentType) {
14665                        case "street_number":
14666                            {
14667                                address1 = "" + component.long_name + " " + address1;
14668                                break;
14669                            }
14670
14671                        case "route":
14672                            {
14673                                address1 += component.short_name;
14674                                break;
14675                            }
14676
14677                        case "postal_code":
14678                            {
14679                                postcode = "" + component.long_name + "" + postcode;
14680                                break;
14681                            }
14682
14683                        case "postal_code_suffix":
14684                            {
14685                                postcode = "" + postcode + "-" + component.long_name;
14686                                break;
14687                            }
14688                        case "locality":
14689                            $("#MailingCity").val(component.long_name);
14690                            clearValidation("MailingCity");
14691                            break;
14692                        case "administrative_area_level_1":
14693                            {
14694                                $("#MailingStateProvince").val(component.short_name);
14695                                clearValidation("MailingStateProvince");
14696                                break;
14697                            }
14698                    }
14699                });
14700
14701                $("#MailingStreet").val(address1);
14702                clearValidation("MailingStreet");
14703                $("#MailingPostalCode").val(postcode);
14704                clearValidation("MailingPostalCode");
14705                $("#MailingStreet").focus();
14706            };
14707
14708            var page1Valid = function (form) {
14709                var validator = form.data("validator");
14710                var returnValue = true;
14711
14712                if ($("#IsAuthenticated").val() === "False" && $("#IsHkey").val() === "False" && !$("#MasterCustomerId").val()) {
14713                    if (!validator.element($("#SelectedRateCode"))) returnValue = false;
14714                    if (!validator.element($("#EmailAddress"))) returnValue = false;
14715                    if (!validator.element($("#UserName"))) returnValue = false;
14716                    if (!validator.element($("#Password"))) returnValue = false;
14717                    if (!validator.element($("#ConfirmPassword"))) returnValue = false;
14718                    if ($("#FormMode").val() === "FTFREE") {
14719                        if (!validator.element($("#FirstName"))) returnValue = false;
14720                        if (!validator.element($("#LastName"))) returnValue = false;
14721                    } else if ($("#FormMode").val() === "AV8RS") {
14722                        if (!validator.element($("#BirthDate"))) returnValue = false;
14723                    }
14724                }
14725                return returnValue;
14726            };
14727
14728            var page2Valid = function (form) {
14729                var validator = form.data("validator");
14730                var returnValue = true;
14731
14732                if ($("#IsAuthenticated").val() === "False" && $("#IsHkey").val() === "False") {
14733                    if ($("#FormMode").val() !== "FTFREE") {
14734                        if (!validator.element($("#FirstName"))) returnValue = false;
14735                        if (!validator.element($("#LastName"))) returnValue = false;
14736                    }
14737                    if (!validator.element($("#MailingStreet"))) returnValue = false;
14738                    if (!validator.element($("#MailingCity"))) returnValue = false;
14739                    if (!validator.element($("#MailingStateProvince"))) returnValue = false;
14740                    if (!validator.element($("#MailingPostalCode"))) returnValue = false;
14741                    if (!validator.element($("#NameOnCard"))) returnValue = false;
14742                }
14743                return returnValue;
14744            };
14745
14746            jfStripe = Stripe($("#sapik").val());
14747            jfElements = jfStripe.elements();
14748            jfStyle = {
14749                base: {
14750                    backgroundColor: "#eeeded",
14751                    fontSize: "15px",
14752                    fontFamily: "Roboto, Helvetica Neue, sans-serif",
14753                    lineHeight: "42px",
14754                    ":focus": {
14755                        border: "1px solid #c1c2c3"
14756                    }
14757                }
14758            };
14759            jfCardElement = jfElements.create("card", { style: jfStyle, hidePostalCode: true, disableLink: true });
14760
14761            jfCardElement.mount("#card-element");
14762
14763            jfCardElement.on("change", function (event) {
14764                var displayError = document.getElementById("card-errors");
14765                if (event.error) {
14766                    displayError.textContent = event.error.message;
14767                } else {
14768                    displayError.textContent = "";
14769                }
14770
14771                $("#CardBrand").val(event.brand);
14772            });
14773
14774            initAutocomplete = function () {
14775                // Create the autocomplete object, restricting the search predictions to
14776                autocomplete = new google.maps.places.Autocomplete(AddressLookup, {
14777                    fields: ["address_components"],
14778                    types: ["address"] });
14779                autocomplete.setComponentRestrictions({
14780                    country: ["us"]
14781                });
14782                // When the user selects an address from the drop-down, populate the
14783                // address fields in the form.
14784                autocomplete.addListener("place_changed", fillInAddress);
14785            };
14786
14787            initAutocomplete();
14788
14789            ;
14790
14791            clearValidation = function (field) {
14792                var theField = $("#" + field);
14793                if (theField.val()) {
14794                    theField.removeClass("input-validation-error").addClass("valid");
14795                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
14796                    $("span[data-valmsg-for='" + field + "']").empty();
14797                }
14798            };
14799
14800            $("#BirthDate").datepicker({
14801                changeMonth: true,
14802                changeYear: true,
14803                minDate: new Date(new Date().getFullYear() - 21, new Date().getMonth(), new Date().getDate() + 1),
14804                maxDate: "-13Y"
14805            });
14806
14807            $("#BirthDateFTF").datepicker({
14808                changeMonth: true,
14809                changeYear: true,
14810                yearRange: new Date().getFullYear() - 110 + ":" + new Date().getFullYear(),
14811                minDate: new Date(new Date().getFullYear() - 110, new Date().getMonth(), new Date().getDate()),
14812                maxDate: new Date()
14813            });
14814
14815            $("#IncludeAar").change(function () {
14816                if (this.checked) {
14817                    $("#divFinalize").show();
14818                } else {
14819                    $("#divFinalize").hide();
14820                }
14821            });
14822
14823            $(".backBtn").click(function () {
14824                var form = $(this).closest("form");
14825
14826                if (page1Valid(form)) {
14827                    $("#freejoinPage2").css({ visibility: "hidden" });
14828                    $("#freejoinPage2").css({ display: "none" });
14829                    $("#freejoinPage1").css({ visibility: "visible" });
14830                    $("#freejoinPage1").css({ display: "block" });
14831                    $("#LoadPage").val("1");
14832                }
14833            });
14834
14835            $(".btnContinue").click(function () {
14836                var form = $(this).closest("form");
14837
14838                if (page1Valid(form)) {
14839
14840                    if ($("#FormMode").val() === "FTFREE" && $("#IsAuthenticated").val() === "False" && $("#IsHkey").val() === "False") {
14841                        $.post("/api/FormTracking/ProcessTracking", {
14842                            recordTypeName: $("#ltype").val(),
14843                            leadSource: $("#lsource").val(),
14844                            leadId: $("#lid").val(),
14845                            status: "New",
14846                            firstName: $("#FirstName").val(),
14847                            lastName: $("#LastName").val(),
14848                            emailAddress: $("#EmailAddress").val(),
14849                            preferredEmail: $("#lemail").val(),
14850                            description: "Step 1 Complete"
14851                        }, function () {}).done(function (data) {
14852                            $("#lid").val(data);
14853                        }).fail(function (jqXHR, textStatus, err) {});
14854                    }
14855
14856                    $("#freejoinPage1").css({ visibility: "hidden" });
14857                    $("#freejoinPage1").css({ display: "none" });
14858                    $("#freejoinPage2").css({ visibility: "visible" });
14859                    $("#freejoinPage2").css({ display: "block" });
14860                    $("#LoadPage").val("2");
14861                }
14862            });
14863
14864            checkCardFields = function () {
14865                var isValid = false;
14866
14867                if ($("#ShowStripeForm").val() === "True") {
14868                    var cardElement = document.querySelector("#card-element");
14869
14870                    isValid = cardElement.classList.contains("StripeElement--complete");
14871
14872                    var brand = $("#CardBrand").val();
14873
14874                    if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
14875                        $("#card-errors").html("");
14876                    } else {
14877                        if ($("#card-errors").is(":empty")) {
14878                            $("#card-errors").html("Please check your credit card information.");
14879                        }
14880                    }
14881                } else {
14882                    isValid = true;
14883                }
14884
14885                return isValid;
14886            };
14887
14888            $(".submitButtonFMF").click(function () {
14889                var form = $(this).closest("form");
14890
14891                var progressBar = new Sfpb_progressBar();
14892
14893                if (page1Valid(form) && page2Valid(form)) {
14894
14895                    if ($("#FormMode").val() === "FTFREE") {
14896
14897                        var ccValid = checkCardFields();
14898
14899                        if (ccValid) {
14900                            $("#btnJoin").hide();
14901                            $(this).hide();
14902                            $(".backBtn").hide();
14903                            $("body").addClass("progressbar-modal");
14904                            progressBar.start();
14905                            $(".clsSubmitButton").append("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
14906
14907                            $.post("/api/FormTracking/ProcessTracking", {
14908                                recordTypeName: $("#ltype").val(),
14909                                leadSource: $("#lsource").val(),
14910                                leadId: $("#lid").val(),
14911                                status: "New",
14912                                firstName: $("#FirstName").val(),
14913                                lastName: $("#LastName").val(),
14914                                emailAddress: $("#EmailAddress").val(),
14915                                preferredEmail: $("#lemail").val(),
14916                                description: "Step 2 Complete"
14917                            }, function () {}).done(function (data) {}).fail(function (jqXHR, textStatus, err) {});
14918
14919                            if ($("#ShowStripeForm").val() === "True") {
14920                                jfStripe.createToken(jfCardElement, { name: $("#CardName").val() }).then(function (result) {
14921                                    if (result.token !== null) {
14922                                        $("#CardToken").val(JSON.stringify(result.token));
14923                                        form.submit();
14924                                    } else {
14925                                        if ($("#card-errors").is(":empty")) {
14926                                            $("#card-errors").html("Please check your credit card information.");
14927                                        }
14928                                        var spinner = document.getElementById("aopaSpinner");
14929                                        spinner.parentElement.removeChild(spinner);
14930                                        $(this).show();
14931                                        $(".backBtn").show();
14932                                        progressBar.kill();
14933                                        $("body").removeClass("progressbar-modal");
14934                                        $("#btnJoin").show();
14935                                    }
14936                                });
14937                            } else {
14938                                form.submit();
14939                            }
14940                        }
14941                    } else {
14942                        $("#btnJoin").hide();
14943                        $(this).hide();
14944                        $(".backBtn").hide();
14945                        $("body").addClass("progressbar-modal");
14946                        progressBar.start();
14947                        $(".clsSubmitButton").append("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
14948                        form.submit();
14949                    }
14950                }
14951            });
14952        })();
14953    }
14954});
14955
14956},{}],79:[function(require,module,exports){
14957"use strict";
14958
14959if ($(".ftgatedcontent .main .column-860").length) {
14960  $(".ftgatedcontent .main .column-860").wrapInner("<div class='lockedContent'></div>");
14961  $(".ftgatedmessage").appendTo(".ftgatedcontent .main .column-860");
14962}
14963
14964},{}],80:[function(require,module,exports){
14965"use strict";
14966
14967$(document).ready(function () {
14968    if ($("div#divGenericProductPurchase").length) {
14969
14970        window.onload = function () {
14971            $("input.CheckBoxListHelper").prop("disabled", false);
14972
14973            if ($("#ItemCount").val() === "1") {
14974                $("input.CheckBoxListHelper").prop("readonly", "readonly");
14975            }
14976        };
14977
14978        if ($("#ShowShippingAddress").val() === "True") {
14979            if ($("#ShippingSameAsBilling")[0].checked) {
14980                $("#FirstNameRequired").val("False");
14981                $("#LastNameRequired").val("False");
14982                var sop = $("#State option:first-child");
14983                if (sop) {
14984                    sop.val("0");
14985                    sop.attr("selected", "selected");
14986                }
14987            } else {
14988                $("#FirstNameRequired").val("True");
14989                $("#LastNameRequired").val("True");
14990                var sop = $("#State option:first-child");
14991                if (sop) {
14992                    sop.val("");
14993                    sop.attr("selected", "selected");
14994                }
14995            }
14996        }
14997
14998        $("#ShippingSameAsBilling").change(function () {
14999            if (this.checked === true) {
15000                $("#divShipperData").css({ visibility: "hidden" });
15001                $("#divShipperData").css({ display: "none" });
15002                $("#FirstNameRequired").val("False");
15003                $("#LastNameRequired").val("False");
15004                $("#Address1Required").val("False");
15005                $("#Address2Required").val("False");
15006                $("#Address3Required").val("False");
15007                $("#Address4Required").val("False");
15008                $("#CityRequired").val("False");
15009                $("#PostalCodeRequired").val("False");
15010                $("#CountyRequired").val("False");
15011                var sop = $("#State option:first-child");
15012                if (sop) {
15013                    sop.val("0");
15014                    sop.attr("selected", "selected");
15015                }
15016            } else {
15017                $("#divShipperData").css({ visibility: "visible" });
15018                $("#divShipperData").css({ display: "block" });
15019                $("#FirstNameRequired").val("True");
15020                $("#LastNameRequired").val("True");
15021                var sop = $("#State option:first-child");
15022                if (sop) {
15023                    sop.val("");
15024                    sop.attr("selected", "selected");
15025                }
15026                $("#Country").trigger("change");
15027            }
15028        });
15029
15030        if ($("#ItemCount").val() === "1") {
15031            $("input.CheckBoxListHelper").prop("readonly", "readonly");
15032        }
15033
15034        $(document.body).delegate("[type=\"checkbox\"][readonly=\"readonly\"]", "click", function (e) {
15035            e.preventDefault();
15036        });
15037
15038        $("input[name^='ProductListItems']").change(function () {
15039            var count = 0;
15040            var total = 0;
15041            var productList = "";
15042            var summary = "";
15043            $("#divFormSummary").html("");
15044
15045            $("input:checkbox[name^='ProductListItems']").each(function () {
15046                if (this.checked) {
15047                    var cb = this.name.split(".")[0];
15048                    var itemData = $("[id=\"" + cb + ".ID\"]").val().split("|");
15049
15050                    summary += "<div class=\"l-wrapper\">";
15051                    summary += "<div class=\"l-column column-860 left-side\">";
15052                    summary += $("[id=\"" + cb + ".Display\"]").val();
15053                    summary += "</div>";
15054                    summary += "<div class=\"l-column column-300 right-side\">";
15055                    summary += "$" + parseFloat(itemData[3]).toFixed(2);
15056                    summary += "</div>";
15057                    summary += "</div>";
15058
15059                    total += parseFloat(itemData[3]);
15060
15061                    productList += itemData[0] + "|" + itemData[2] + ",";
15062                }
15063            });
15064
15065            if ($("#CalculateTax").val() === "True") {
15066                if (productList.length > 0) {
15067                    $.getJSON("/api/OrderCalculateTax/Get/?validCode=" + $("#ValidCode").val() + "&productList=" + productList.slice(0, -1) + "&quantity=" + $("#Quantity").val()).done(function (data) {
15068                        if (data.success && parseFloat(data.taxAmount) > 0) {
15069                            summary += "<div class=\"l-wrapper\">";
15070                            summary += "<div class=\"l-column column-860 left-side\">Tax</div>";
15071                            summary += "<div class=\"l-column column-300 right-side\">";
15072                            summary += "$" + parseFloat(data.taxAmount).toFixed(2);
15073                            summary += "</div>";
15074                            summary += "</div>";
15075
15076                            total += parseFloat(data.taxAmount);
15077                        }
15078
15079                        $("#TaxTotal").val(0);
15080                        $("#OrderTotal").val(total.toFixed(2));
15081                        $("#divFormSummary").html(summary);
15082                        $("#divFormTotal").html("$" + total.toFixed(2));
15083                    }).fail(function (jqXHR, textStatus, err) {
15084                        $("#TaxTotal").val(0);
15085                        $("#OrderTotal").val(total.toFixed(2));
15086                        $("#divFormSummary").html(summary);
15087                        $("#divFormTotal").html("$" + total.toFixed(2));
15088                    });
15089                } else {
15090                    $("#TaxTotal").val(0);
15091                    $("#OrderTotal").val(0);
15092                    $("#divFormSummary").html(summary);
15093                    $("#divFormTotal").html("$" + total.toFixed(2));
15094                }
15095            } else {
15096                $("#TaxTotal").val(0);
15097                $("#OrderTotal").val(total.toFixed(2));
15098                $("#divFormSummary").html(summary);
15099                $("#divFormTotal").html("$" + total.toFixed(2));
15100            }
15101
15102            if (productList.length === 0) {
15103                $("#divProductSelectionError").css({ visibility: "visible" });
15104                $("#divProductSelectionError").css({ display: "block" });
15105                $("#btnFormSubmit").prop("disabled", true);
15106            } else {
15107                $("#divProductSelectionError").css({ visibility: "hidden" });
15108                $("#divProductSelectionError").css({ display: "none" });
15109                $("#btnFormSubmit").prop("disabled", false);
15110            }
15111        });
15112
15113        $("#productQuantityUpdate").click(function () {
15114            var qty = parseInt($("#productQuantity").val());
15115            if (!isNaN(qty)) {
15116                if (qty < 1 || qty > 99) {
15117                    $("#productQuantity").val($("#Quantity").val());
15118                    qty = parseInt($("#Quantity").val());
15119                }
15120            } else {
15121                $("#productQuantity").val($("#Quantity").val());
15122                qty = parseInt($("#Quantity").val());
15123            }
15124
15125            $("#Quantity").val(qty);
15126
15127            var prod = $("input:checkbox[name^='ProductListItems']:checked:first");
15128            var cb = prod[0].name.split(".")[0];
15129            var itemData = $("[id=\"" + cb + ".ID\"]").val().split("|");
15130
15131            var lineTotal = qty * parseFloat(itemData[3]);
15132
15133            $("#productTotal_" + itemData[0]).html("$" + lineTotal.toFixed(2));
15134
15135            $("#OrderTotal").val(lineTotal.toFixed(2));
15136
15137            $("#divFormTotal").html("$" + lineTotal.toFixed(2));
15138        });
15139    }
15140});
15141
15142},{}],81:[function(require,module,exports){
15143"use strict";
15144
15145$(document).ready(function () {
15146    if ($("div#divGlobalMemberSignup").length) {
15147        var theForm;
15148        var autocomplete;
15149        var initAutocomplete;
15150        var clearValidation;
15151
15152        (function () {
15153            var fillInAddress = function () {
15154                // Get the place details from the autocomplete object.
15155                var place = autocomplete.getPlace();
15156                var address1 = "";
15157                var postcode = "";
15158
15159                $("#MailingStreet").val("");
15160                $("#MailingCity").val("");
15161                $("#MailingStateProvince").val("");
15162                $("#MailingPostalCode").val("");
15163                $("#MailingCountry").val("");
15164
15165                // Get each component of the address from the place details,
15166                // and then fill-in the corresponding field on the form.
15167                // place.address_components are google.maps.GeocoderAddressComponent objects
15168                // which are documented at http://goo.gle/3l5i5Mr
15169                place.address_components.forEach(function (component) {
15170                    var componentType = component.types[0];
15171
15172                    switch (componentType) {
15173                        case "street_number":
15174                            {
15175                                address1 = "" + component.long_name + " " + address1;
15176                                break;
15177                            }
15178
15179                        case "route":
15180                            {
15181                                address1 += component.short_name;
15182                                break;
15183                            }
15184
15185                        case "postal_code":
15186                            {
15187                                postcode = "" + component.long_name + "" + postcode;
15188                                break;
15189                            }
15190
15191                        case "postal_code_suffix":
15192                            {
15193                                postcode = "" + postcode + "-" + component.long_name;
15194                                break;
15195                            }
15196                        case "locality":
15197                            $("#MailingCity").val(component.long_name);
15198                            clearValidation("MailingCity");
15199                            break;
15200                        case "administrative_area_level_1":
15201                            {
15202                                $("#MailingStateProvince").val(component.short_name);
15203                                clearValidation("MailingStateProvince");
15204                                break;
15205                            }
15206                        case "country":
15207                            $("#MailingCountry").val(component.long_name);
15208                            if (component.short_name === "US") {} else {
15209                                $("#rdoMailingCountryOther").prop("checked", true);
15210                                $("#divMailingCountry").show();
15211                                $("#IsDomestic").val("False");
15212                                $("#IsInternational").val("True");
15213                            }
15214                            clearValidation("MailingCountry");
15215                            break;
15216
15217                    }
15218                });
15219
15220                $("#MailingStreet").val(address1);
15221                clearValidation("MailingStreet");
15222                $("#MailingPostalCode").val(postcode);
15223                clearValidation("MailingPostalCode");
15224                $("#MailingStreet").focus();
15225            };
15226
15227            theForm = $("#frmGlobalActivation");
15228
15229            initAutocomplete = function () {
15230                // Create the autocomplete object, restricting the search predictions to
15231                autocomplete = new google.maps.places.Autocomplete(AddressLookup, {
15232                    fields: ["address_components"],
15233                    types: ["address"] });
15234                // When the user selects an address from the drop-down, populate the
15235                // address fields in the form.
15236                autocomplete.addListener("place_changed", fillInAddress);
15237            };
15238
15239            initAutocomplete();
15240
15241            ;
15242
15243            clearValidation = function (field) {
15244                var theField = $("#" + field);
15245                if (theField.val()) {
15246                    theField.removeClass("input-validation-error").addClass("valid");
15247                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
15248                    $("span[data-valmsg-for='" + field + "']").empty();
15249                }
15250            };
15251
15252            $(".gaSubmit").click(function () {
15253                if (theForm.valid()) {
15254                    $(".gaSubmit").hide();
15255                    $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
15256                    theForm.submit();
15257                } else {
15258                    var firstInstance = $(".input-validation-error").first();
15259                    var offsetTop = firstInstance.offset().top - 100;
15260
15261                    $("html, body").animate({
15262                        scrollTop: offsetTop
15263                    }, 500);
15264                }
15265            });
15266        })();
15267    }
15268});
15269
15270/*$("#MailingCountry").val("Error");*/
15271
15272},{}],82:[function(require,module,exports){
15273"use strict";
15274
15275$(document).ready(function () {
15276    if ($("div#divGlobalMemberUpgrade").length) {
15277
15278        $("#SelectedRateCode").change(function () {
15279            var rateSel = $(this).find("option:selected").val().split("|");
15280            var total = parseFloat(rateSel[1]);
15281            $("#FinalPrice").val(parseFloat(total, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
15282            var totaltext = "$" + parseFloat(total, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString();
15283            $("#order-total").html($.parseHTML(totaltext));
15284        });
15285    }
15286});
15287
15288},{}],83:[function(require,module,exports){
15289"use strict";
15290
15291var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
15292
15293var jquery = _interopRequire(require("../../vendor/jquery-1.10.2.min.js"));
15294
15295module.exports = function () {
15296  jquery(document).ready(function () {
15297    var breakpoint = {};
15298    var lastScrollPos = 0;
15299    breakpoint.refreshValue = function () {
15300      this.value = window.getComputedStyle(document.querySelector("body"), ":before").getPropertyValue("content").replace(/\"/g, "");
15301    };
15302    breakpoint.refreshValue();
15303
15304    var navWrapper = document.querySelector(".js-refresh-nav");
15305    jquery(window).scroll(function () {
15306      if (breakpoint.value === "large" || breakpoint.value === "x-large" || breakpoint.value === "xx-large" || breakpoint.value === "xxx-large") {
15307
15308        var curScrollPos = window.scrollY;
15309
15310        if (curScrollPos > lastScrollPos) {
15311          navWrapper.classList.remove("is-scrolling-up");
15312        } else {
15313          navWrapper.classList.add("is-scrolling-up");
15314        }
15315        lastScrollPos = curScrollPos;
15316
15317        if (jquery(window).scrollTop() >= 1) {
15318          navWrapper.classList.add("sticky-header");
15319        } else {
15320          navWrapper.classList.remove("sticky-header");
15321        }
15322      }
15323    });
15324  });
15325};
15326
15327},{"../../vendor/jquery-1.10.2.min.js":147}],84:[function(require,module,exports){
15328"use strict";
15329
15330module.exports = function () {
15331  var primaryLinks = document.querySelectorAll(".primary-link");
15332  var secondaryLinks = document.querySelectorAll(".js-dropdownBtn");
15333
15334  // Detect any click on the doc, and close all open Global Header menus if the click is outside an open menu
15335  document.addEventListener("click", function (e) {
15336    if (!e.target.closest(".primary-item") && !e.target.closest(".secondary-item") && !e.target.closest(".header__nav-main-list") && !e.target.closest(".header__nav-sub-list") && !e.target.closest(".js-dropdownBtn")) {
15337      closeOpenMenus();
15338    }
15339  });
15340
15341  primaryLinks.forEach(function (el) {
15342    el.addEventListener("click", function (e) {
15343      e.preventDefault();
15344
15345      var wasOpen = el.classList.contains("primary-link--clicked");
15346
15347      closeOpenMenus();
15348
15349      if (!wasOpen) {
15350        el.classList.add("primary-link--clicked");
15351        el.parentElement.classList.add("primary-underline");
15352        el.nextElementSibling.classList.remove("hidden");
15353        el.querySelector(".primary-link > .primary-arrow").classList.add("arrow-rotate");
15354      }
15355    });
15356  });
15357
15358  secondaryLinks.forEach(function (el) {
15359    el.addEventListener("click", function () {
15360      var wasOpen = el.classList.contains("js-dropdownBtn--clicked");
15361
15362      closeOpenMenus();
15363
15364      if (!wasOpen) {
15365        el.classList.add("js-dropdownBtn--clicked");
15366        el.nextElementSibling.classList.add("js-dropdown--open");
15367        el.nextElementSibling.classList.remove("hidden");
15368        el.querySelector(".js-dropdownBtn > .dropdown-arrow").classList.add("arrow-rotate");
15369      }
15370    });
15371  });
15372
15373  var closeOpenMenus = function () {
15374    primaryLinks.forEach(function (link) {
15375      link.classList.remove("primary-link--clicked");
15376      link.parentElement.classList.remove("primary-underline");
15377      link.nextElementSibling.classList.add("hidden");
15378      link.querySelector(".primary-link > .primary-arrow").classList.remove("arrow-rotate");
15379    });
15380    secondaryLinks.forEach(function (button) {
15381      button.classList.remove("js-dropdownBtn--clicked");
15382      button.nextElementSibling.classList.remove("js-dropdown--open");
15383      button.nextElementSibling.classList.add("hidden");
15384      button.querySelector(".js-dropdownBtn > .dropdown-arrow").classList.remove("arrow-rotate");
15385    });
15386  };
15387};
15388
15389},{}],85:[function(require,module,exports){
15390"use strict";
15391
15392module.exports = function () {
15393  var burgerBtn = document.getElementById("mobileToggle");
15394  var mobileDrawer = document.getElementById("mobileDrawer");
15395  var burgerIcon = document.getElementById("burgerIcon");
15396  var closeIcon = document.getElementById("closeIcon");
15397
15398  burgerBtn.addEventListener("click", function () {
15399    burgerBtn.classList.toggle("js-mobileBtn--clicked");
15400
15401    if (burgerBtn.classList.contains("js-mobileBtn--clicked")) {
15402      burgerIcon.classList.add("hidden");
15403      closeIcon.classList.remove("hidden");
15404      mobileDrawer.classList.remove("hidden");
15405    } else {
15406      burgerIcon.classList.remove("hidden");
15407      closeIcon.classList.add("hidden");
15408      mobileDrawer.classList.remove("js-dropdown--open");
15409      mobileDrawer.classList.add("hidden");
15410    }
15411  });
15412};
15413
15414},{}],86:[function(require,module,exports){
15415"use strict";
15416
15417module.exports = function () {
15418  var searchBtn = document.getElementById("search-btn");
15419  var searchForm = document.getElementById("search-form");
15420  var searchInput = document.getElementById("Keyword");
15421  var closeSearch = document.getElementById("clear-search");
15422
15423  searchBtn.addEventListener("click", function () {
15424    searchBtn.classList.toggle("js-search--clicked");
15425    if (searchBtn.classList.contains("js-search--clicked")) {
15426      searchBtn.classList.add("hidden");
15427      searchForm.classList.remove("hidden");
15428      searchForm.classList.add("header__search--shown");
15429    } else {
15430      searchForm.classList.remove("header__search--shown");
15431      searchForm.classList.add("hidden");
15432    }
15433  });
15434
15435  searchBtn.addEventListener("mouseup", function () {
15436    setTimeout(function () {
15437      return searchInput.focus();
15438    }, 50);
15439  });
15440
15441  closeSearch.addEventListener("click", function () {
15442    if (searchForm.classList.contains("header__search--shown")) {
15443      searchForm.classList.remove("header__search--shown");
15444      searchForm.classList.add("hidden");
15445      searchBtn.classList.remove("hidden");
15446      searchBtn.classList.remove("js-search--clicked");
15447    }
15448  });
15449};
15450
15451},{}],87:[function(require,module,exports){
15452"use strict";
15453
15454$(document).ready(function () {
15455    if ($("div#divHSAsaOfferForm").length) {
15456        var theForm;
15457
15458        (function () {
15459            var calculateTotal = function () {
15460                var total = 0;
15461                var tCb = document.getElementById("AddTeacherProduct");
15462
15463                if ($("#ShowTeacherProduct").val() === "True" && tCb.checked) {
15464                    total += parseFloat($("#TeacherPrice").val());
15465                }
15466                var studentTotal = parseInt($("#StudentQuantity").val(), 10) * parseFloat($("#StudentPrice").val());
15467                $("#StudentTotal").val(studentTotal.toFixed(2));
15468
15469                total += studentTotal;
15470
15471                if (studentTotal > 0) {
15472                    $("#hsAsaStudentProductRow").show();
15473                } else {
15474                    $("#hsAsaStudentProductRow").hide();
15475                }
15476
15477                $("#divStudentQuantity").text($("#StudentQuantity").val());
15478                $("#divStudentTotal").text("$" + studentTotal.toFixed(2));
15479
15480                $("#divAsaSummaryTotal").text("$" + total.toFixed(2));
15481                $("#OrderTotal").val(total.toFixed(2));
15482
15483                if (total > 0) {
15484                    $("#hsAsaPaymentSection").show();
15485                } else {
15486                    $("#hsAsaPaymentSection").hide();
15487                }
15488
15489                var subButton = document.getElementById("btnAsaRegister");
15490                if (parseInt($("#StudentQuantity").val(), 10) > 0) {
15491                    $("#btnAsaRegister").removeClass("hs-asa-button--disable");
15492                    subButton.disabled = false;
15493                } else {
15494                    if ($("#ShowTeacherProduct").val() === "True" && tCb.checked) {
15495                        $("#btnAsaRegister").removeClass("hs-asa-button--disable");
15496                        subButton.disabled = false;
15497                    } else {
15498                        $("#btnAsaRegister").addClass("hs-asa-button--disable");
15499                        subButton.disabled = true;
15500                    }
15501                }
15502            };
15503
15504            theForm = $("#frmHSAsaOffer");
15505
15506            $("input[name=PayingBySelected]").on("change", function () {
15507                if ($("input[name=PayingBySelected]:checked").val() === "CREDIT") {
15508                    $("#hswCCFields").show();
15509                    $("#hswPOFields").hide();
15510                } else {
15511                    $("#hswCCFields").hide();
15512                    $("#hswPOFields").show();
15513                }
15514            });
15515
15516            $("#AddTeacherProduct").click(function () {
15517                var cb = document.getElementById(this.id);
15518                if (cb.checked) {
15519                    $("#hsAsaTeacherProductRow").show();
15520                    calculateTotal(true);
15521                } else {
15522                    $("#hsAsaTeacherProductRow").hide();
15523                    calculateTotal(false);
15524                }
15525            });
15526
15527            $("#StudentQuantity").change(function () {
15528                var ct = parseInt($("#StudentQuantity").val(), 10);
15529                if (ct !== NaN && ct >= 0) {
15530                    calculateTotal();
15531                }
15532            });
15533
15534            $("#SchoolSelected").on("change", function () {
15535                var school = document.getElementById(this.id);
15536                if (school.value === "") {
15537                    $("#BillingContactEmailAddress").val("");
15538                    $("#BillingContactName").val("");
15539                } else {
15540                    var options = JSON.parse(decodeURIComponent($("#BillingOptions").val()));
15541
15542                    $.each(options, function (i, v) {
15543                        if (v.Id === school.value) {
15544                            $("#BillingContactEmailAddress").val(v.BCEmail);
15545                            $("#BillingContactName").val(v.BCName);
15546                        }
15547                    });
15548                }
15549            });
15550
15551            $(".hs-asa-button").click(function () {
15552                if (theForm.valid()) {
15553                    $("#btnAsaRegister").hide();
15554                    $(this).hide();
15555                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
15556                    theForm.submit();
15557                }
15558            });
15559        })();
15560    }
15561});
15562
15563},{}],88:[function(require,module,exports){
15564"use strict";
15565
15566$(document).ready(function () {
15567    if ($("div#divHSSARegistrationForm").length) {
15568        var theForm;
15569        var data;
15570        var i;
15571        var answers;
15572
15573        (function () {
15574            var calculateTotal = function (addOptional) {
15575                var total = 0;
15576                total += parseFloat($("#AttendeePrice").val());
15577                if (addOptional) {
15578                    total += parseFloat($("#TourPrice").val());
15579                }
15580
15581                $("#OrderTotal").val(total);
15582                $(".event-payment-total__price").text("$" + total.toFixed(2));
15583            };
15584
15585            var validateDiv = function (div) {
15586                var validator = theForm.data("validator");
15587                var returnValue = true;
15588
15589                $("#" + div + " :input").each(function (e) {
15590                    if (!$(this).is(":button") && this.id.length) {
15591                        if (!validator.element($("#" + this.id))) returnValue = false;
15592                    }
15593                });
15594
15595                return returnValue;
15596            };
15597
15598            theForm = $("#frmHSSymposiumAttendeeRegistration");
15599
15600            $(".btnCancel").click(function () {
15601                window.location.href = "https://www.aopa.org";
15602            });
15603
15604            $(".hssacontinuebutton").click(function () {
15605                if (validateDiv($(this).data("thispage"))) {
15606                    var nextpage = $(this).data("nextpage");
15607                    $("#" + $(this).data("thispage")).hide();
15608                    $("#" + nextpage).show();
15609                    window.scrollTo(0, 0);
15610                }
15611            });
15612
15613            $(".hssabackbutton").click(function () {
15614                var prevpage = $(this).data("prevpage");
15615                $("#" + $(this).data("thispage")).hide();
15616                $("#" + prevpage).show();
15617                window.scrollTo(0, 0);
15618            });
15619
15620            $(".hssaRegisterButton").click(function () {
15621                if (theForm.valid()) {
15622                    $("#btnRegister").hide();
15623                    $(".btn_final_cancelback").hide();
15624                    $(this).hide();
15625                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
15626                    theForm.submit();
15627                }
15628            });
15629
15630            $(".hssa-control-cb").click(function () {
15631                var cb = document.getElementById(this.id);
15632                if (cb.checked) {
15633                    $("#" + $(this).data("reveal-div")).show();
15634                    calculateTotal(true);
15635                } else {
15636                    $("#" + $(this).data("reveal-div")).hide();
15637                    calculateTotal(false);
15638                }
15639            });
15640
15641            $("input[name=PayingBySelected]").on("change", function () {
15642                if ($("input[name=PayingBySelected]:checked").val() === "CREDIT") {
15643                    $("#hssaCCFields").show();
15644                    $("#hssaPOFields").hide();
15645                    if ($("input[name=CCDomainSelected]:checked").val() === "PERSONAL") {
15646                        $("#hssaCAFields").hide();
15647                    } else {
15648                        $("#hssaCAFields").show();
15649                    }
15650                } else {
15651                    $("#hssaCCFields").hide();
15652                    $("#hssaPOFields").show();
15653                    $("#hssaCAFields").show();
15654                }
15655            });
15656
15657            $("input[name=CCDomainSelected]").on("change", function () {
15658                if ($("input[name=CCDomainSelected]:checked").val() === "PERSONAL") {
15659                    $("#hssaCCFields").show();
15660                    $("#hssaPOFields").hide();
15661                    $("#hssaCAFields").hide();
15662                } else {
15663                    if ($("input[name=PayingBySelected]:checked").val() === "CREDIT") {
15664                        $("#hssaCCFields").show();
15665                        $("#hssaPOFields").hide();
15666                    } else {
15667                        $("#hssaCCFields").hide();
15668                        $("#hssaPOFields").show();
15669                    }
15670                    $("#hssaCAFields").show();
15671                }
15672            });
15673
15674            //
15675            // Reset the questionnaire fields on page load
15676            //
15677            if ($("#QuestionnaireData").val()) {
15678                data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
15679
15680                for (i = 0; i < data.length; i++) {
15681                    switch (data[i].type) {
15682                        case "SELECT":
15683                            $("#MPQuestionSelect" + data[i].qid + " option[value=\"" + data[i].qa + "\"]").prop("selected", true);
15684                            break;
15685                        case "CB":
15686                            answers = data[i].qa.split(",");
15687
15688                            $.each(answers, function (index, obj) {
15689                                $("input.MPQuestionCB" + data[i].qid + "[value=\"" + obj + "\"]").prop("checked", true);
15690                            });
15691                            break;
15692                        case "TEXTBOX":
15693                            $("#MPQuestionText" + data[i].qid).val(data[i].qa);
15694                            break;
15695                    }
15696                }
15697            }
15698
15699            $(".MPQuestionSelect").change(function () {
15700                var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
15701                var qid = this.id.replace("MPQuestionSelect", "");
15702                var idx = -1;
15703                var ct = 0;
15704
15705                $.each(data, function () {
15706                    if (this.qid.toString() === qid) {
15707                        idx = ct;
15708                        return false;
15709                    }
15710                    ct++;
15711                });
15712
15713                if (idx != -1) {
15714                    data[idx].qa = this.value;
15715                }
15716
15717                $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
15718            });
15719
15720            $(".MPQuestionCB").change(function () {
15721                var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
15722                var cbid = this.id;
15723                var qid = this.name.replace("MPQuestionCB", "");
15724                var anslist = "";
15725                var idx = -1;
15726                var ct = 0;
15727
15728                $.each(data, function () {
15729                    if (this.qid.toString() === qid) {
15730                        idx = ct;
15731                        return false;
15732                    }
15733                    ct++;
15734                });
15735
15736                $("." + cbid).each(function (index, obj) {
15737                    if (this.checked) {
15738                        anslist += this.value + ",";
15739                    }
15740                });
15741                anslist = anslist.slice(0, -1);
15742
15743                if (idx != -1) {
15744                    data[idx].qa = anslist;
15745                }
15746
15747                $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
15748            });
15749
15750            $(".MPQuestionText").change(function () {
15751                var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
15752                var qid = this.id.replace("MPQuestionText", "");
15753                var idx = -1;
15754                var ct = 0;
15755
15756                $.each(data, function () {
15757                    if (this.qid.toString() === qid) {
15758                        idx = ct;
15759                        return false;
15760                    }
15761                    ct++;
15762                });
15763
15764                if (idx != -1) {
15765                    data[idx].qa = this.value;
15766                }
15767
15768                $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
15769            });
15770        })();
15771    }
15772});
15773
15774},{}],89:[function(require,module,exports){
15775"use strict";
15776
15777$(document).ready(function () {
15778    if ($("div#divHSSERegistrationForm").length) {
15779        var theForm;
15780
15781        (function () {
15782            var validateDiv = function (div) {
15783                var validator = theForm.data("validator");
15784                var returnValue = true;
15785
15786                $("#" + div + " :input").each(function (e) {
15787                    if (!$(this).is(":button") && this.id.length) {
15788                        if (!validator.element($("#" + this.id))) returnValue = false;
15789                    }
15790                });
15791
15792                return returnValue;
15793            };
15794
15795            theForm = $("#frmHSSymposiumExhibitorRegistration");
15796
15797            $(".btnCancel").click(function () {
15798                window.location.href = "https://www.aopa.org";
15799            });
15800
15801            $(".hssecontinuebutton").click(function () {
15802                if (validateDiv($(this).data("thispage"))) {
15803                    var nextpage = $(this).data("nextpage");
15804                    $("#" + $(this).data("thispage")).hide();
15805                    $("#" + nextpage).show();
15806                    window.scrollTo(0, 0);
15807                }
15808            });
15809
15810            $(".hssebackbutton").click(function () {
15811                var prevpage = $(this).data("prevpage");
15812                $("#" + $(this).data("thispage")).hide();
15813                $("#" + prevpage).show();
15814                window.scrollTo(0, 0);
15815            });
15816
15817            $(".hsseRegisterButton").click(function () {
15818                if (theForm.valid()) {
15819                    $("#btnRegister").hide();
15820                    $(".btn_final_cancelback").hide();
15821                    $(this).hide();
15822                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
15823                    theForm.submit();
15824                }
15825            });
15826
15827            $("input[name=PayingBySelected]").on("change", function () {
15828                if ($("input[name=PayingBySelected]:checked").val() === "CREDIT") {
15829                    $("#hsseCCFields").show();
15830                    $("#hssePOFields").hide();
15831                } else {
15832                    $("#hsseCCFields").hide();
15833                    $("#hssePOFields").show();
15834                }
15835            });
15836
15837            $("input[name=BoothTypeSelected]").on("change", function () {
15838                var elem = document.getElementById(this.id);
15839
15840                if (elem.checked) {
15841                    var rcds = JSON.parse(decodeURIComponent($("#RateDescriptions").val()));
15842
15843                    $.each(rcds, function (i, v) {
15844                        if (v.rateCode === elem.value) {
15845                            $("#hsseBoothDesc").html(v.shortDescription);
15846                            $("#hsseBoothPrice").html(v.priceString);
15847                            $("#hsseOrderTotal").html(v.priceString);
15848                            $("#OrderTotal").val(v.price);
15849                        }
15850                    });
15851                }
15852            });
15853        })();
15854    }
15855});
15856
15857},{}],90:[function(require,module,exports){
15858"use strict";
15859
15860$(document).ready(function () {
15861    if ($("div#divHSWorkshopRegistrationForm").length) {
15862        var theForm;
15863
15864        (function () {
15865            var fixOtherSelect = function (excludeValue, selectToUpdate) {
15866                var othSel = document.getElementById(selectToUpdate);
15867
15868                if (othSel) {
15869                    var curSel = othSel.value;
15870                    var items = $("#ValidRates").val().split("|");
15871
15872                    $("#" + selectToUpdate).empty();
15873                    var fop = $("<option />");
15874                    fop.attr("value", "").text("- Not Attending -");
15875                    $("#" + selectToUpdate).append(fop);
15876
15877                    items.forEach(function (data) {
15878                        var item = data.split(",");
15879
15880                        if (item[0] !== excludeValue) {
15881                            var ni = $("<option />");
15882                            ni.attr("value", item[0]).text(item[1]);
15883                            $("#" + selectToUpdate).append(ni);
15884                        }
15885                    });
15886                    $("#" + selectToUpdate).val(curSel);
15887                }
15888            };
15889
15890            var calculateTotal = function () {
15891                var total = 0;
15892
15893                var fdk = document.getElementById("FrederickSelected");
15894                if (fdk && fdk.value !== "") {
15895                    $("#fdkSumGrade").html(fdk.selectedOptions[0].label);
15896                    total += parseFloat($("#FrederickPrice").val());
15897                }
15898
15899                var okc = document.getElementById("OklahomaSelected");
15900                if (okc && okc.value !== "") {
15901                    $("#okcSumGrade").html(okc.selectedOptions[0].label);
15902                    total += parseFloat($("#OklahomaPrice").val());
15903                }
15904
15905                var regButton = document.getElementById("btnRegister");
15906                if (total > 0) {
15907                    $("#hswPaymentSection").show();
15908                    $("#OrderTotal").val(total);
15909                    $(".event-payment-total__price").text("$" + total.toFixed(2));
15910                    regButton.disabled = false;
15911                    $("#btnRegister").removeClass("hsw-disable-button");
15912                } else {
15913                    $("#hswPaymentSection").hide();
15914                    $("#OrderTotal").val(-1);
15915                    $(".event-payment-total__price").text("$0.00");
15916                    regButton.disabled = true;
15917                    $("#btnRegister").addClass("hsw-disable-button");
15918                }
15919            };
15920
15921            theForm = $("#frmHSWorkshopRegistration");
15922
15923            $("#VaccineAcknowledge").on("change", function () {
15924                if ($(this).is(":checked")) {
15925                    $("#divVaccineAckowledge").hide();
15926                } else {
15927                    $("#divVaccineAckowledge").show();
15928                }
15929            });
15930
15931            $("input[name=PayingBySelected]").on("change", function () {
15932                if ($("input[name=PayingBySelected]:checked").val() === "CREDIT") {
15933                    $("#hswCCFields").show();
15934                    $("#hswPOFields").hide();
15935                    if ($("input[name=CCDomainSelected]:checked").val() === "PERSONAL") {
15936                        $("#hswCAFields").hide();
15937                    } else {
15938                        $("#hswCAFields").show();
15939                    }
15940                } else {
15941                    $("#hswCCFields").hide();
15942                    $("#hswPOFields").show();
15943                    $("#hswCAFields").show();
15944                }
15945            });
15946
15947            $("input[name=CCDomainSelected]").on("change", function () {
15948                if ($("input[name=CCDomainSelected]:checked").val() === "PERSONAL") {
15949                    $("#hswCCFields").show();
15950                    $("#hswPOFields").hide();
15951                    $("#hswCAFields").hide();
15952                } else {
15953                    if ($("input[name=PayingBySelected]:checked").val() === "CREDIT") {
15954                        $("#hswCCFields").show();
15955                        $("#hswPOFields").hide();
15956                    } else {
15957                        $("#hswCCFields").hide();
15958                        $("#hswPOFields").show();
15959                    }
15960                    $("#hswCAFields").show();
15961                }
15962            });
15963
15964            $(".hsw-class-choice").on("change", function () {
15965                var workshopClass = document.getElementById(this.id);
15966
15967                if (workshopClass.value !== "") {
15968                    $("." + $(this).data("seminar-selected")).show();
15969                } else {
15970                    $("." + $(this).data("seminar-selected")).hide();
15971                }
15972
15973                fixOtherSelect(workshopClass.value, $(this).data("other-select"));
15974
15975                calculateTotal();
15976            });
15977
15978            $(".hswRegisterButton").click(function () {
15979                var fdk = document.getElementById("FrederickSelected");
15980                var vr = document.getElementById("VaccineAcknowledge");
15981
15982                if (theForm.valid() && (fdk === null || fdk.value === "" || fdk.value !== "" && vr.checked)) {
15983                    $("#btnRegister").hide();
15984                    $(this).hide();
15985                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
15986                    theForm.submit();
15987                } else {
15988                    $("#divVaccineAckowledge").show();
15989                }
15990            });
15991        })();
15992    }
15993});
15994
15995},{}],91:[function(require,module,exports){
15996"use strict";
15997
15998var cropArticleImage = function cropArticleImage(pic) {
15999  var wrapper = arguments[1] === undefined ? "img-smallCrop" : arguments[1];
16000  var h = $(pic).height(),
16001      w = $(pic).width();if ($(pic).parent(wrapper).length === 0) {
16002    $(pic).wrap("<div class=\"" + wrapper + "\"></div>");
16003  }
16004  if (h > w) {
16005    $(pic).addClass("portrait");var m = -(h / w * 100 - 100) / 2;if (wrapper == "img-smallCrop") {
16006      $(pic).css("margin-top", m + "%");
16007    }
16008  } else if (w > h) {
16009    $(pic).addClass("landscape");var m = -(w / h * 100 - 100) / 2;if (wrapper == "img-smallCrop") {
16010      $(pic).css("margin-left", m + "%");
16011    }
16012  } else {
16013    $(pic).addClass("square");
16014  }
16015};
16016cropArticleImage(".cards__one-two .cards__column:last-of-type .cards__column--half img, .most-popular .card img");cropArticleImage(".cards__one-one .cards__column:first-of-type img", "img-bigCrop");
16017
16018},{}],92:[function(require,module,exports){
16019"use strict";
16020
16021(function ($) {
16022    $(document).ready(function () {
16023
16024        if ($(".divImageGallery").length) {
16025
16026            // Lazy load
16027            // https://github.com/verlok/lazyload
16028
16029            //    var lazyLoadInstance = new LazyLoad({
16030            //        elements_selector: ".lazyload",
16031            //        load_delay: 500
16032            //        // ... more custom settings?
16033            //    });
16034
16035            // Lazy load
16036            // https://github.com/verlok/lazyload
16037
16038            var lazyLoadInstance = new LazyLoad({
16039                elements_selector: ".lazyload"
16040            });
16041
16042            // Need the height to position the caption depending on image height.
16043            // todo get on load + update on resize
16044            var wHeight = $(window).height();
16045            // console.log( 'wHeight is ' + wHeight )
16046
16047            // First click on an image
16048            $("section img").click(function () {
16049
16050                $(".masonry__lightbox").fadeIn(300).append("<img src='" + $(this).attr("src") + "' alt='" + $(this).attr("alt") + "' />");
16051
16052                $(".masonry__lightbox .filter").css("background-image", "url(" + $(this).attr("src") + ")");
16053
16054                $(".masonry__lightbox .caption").append("<p>" + $(this).attr("alt") + "</p>");
16055                $("html").css("overflow", "hidden");
16056                if ($(this).is(":last-child")) {
16057                    $(".masonry__lightbox .arrowr").css("display", "none");
16058                    $(".masonry__lightbox .arrowl").css("display", "block");
16059                } else if ($(this).is(":first-child")) {
16060                    $(".masonry__lightbox .arrowr").css("display", "block");
16061                    $(".masonry__lightbox .arrowl").css("display", "none");
16062                } else {
16063                    $(".masonry__lightbox .arrowr").css("display", "block");
16064                    $(".masonry__lightbox .arrowl").css("display", "block");
16065                }
16066            });
16067
16068            // Closing the lightbox via click
16069            $(".close").click(function () {
16070                $(".masonry__lightbox").fadeOut(300);
16071                $(".masonry__lightbox .caption p").remove();
16072                $(".masonry__lightbox img").remove();
16073                $("html").css("overflow", "auto");
16074            });
16075
16076            // Closing the lightbox using ESC
16077            $(document).keyup(function (e) {
16078                if (e.keyCode == 27) {
16079                    $(".masonry__lightbox").fadeOut(300);
16080                    $(".masonry__lightbox img").remove();
16081                    $(".masonry__lightbox .caption p").remove();
16082                    $("html").css("overflow", "auto");
16083                }
16084            });
16085
16086            // Navigating the lightbox
16087            $(".masonry__lightbox .arrowr").click(function () {
16088                var imgSrc = $(".masonry__lightbox img").attr("src");
16089                var search = $("section").find("img[src$='" + imgSrc + "']");
16090                var newImage = search.next().attr("src");
16091                var newAlt = search.next().attr("alt");
16092
16093                $(".masonry__lightbox img").attr("src", newImage);
16094                $(".masonry__lightbox .caption").html("<p>" + newAlt + "</p>");
16095                $(".masonry__lightbox .filter").css("background-image", "url(" + newImage + ")");
16096
16097                // If the image is to tall, we need to reposition the caption
16098                var newImgHeight = $(".masonry__lightbox img")[0].clientHeight;
16099                if (newImgHeight > 0.8 * wHeight) {
16100
16101                    $(".masonry__lightbox .caption").css("top", "98%");
16102                } else {
16103                    $(".masonry__lightbox .caption").css("top", "90%");
16104                }
16105
16106                // Hiding arrows for last item 
16107                if (!search.next().is(":last-child")) {
16108                    $(".masonry__lightbox .arrowl").css("display", "block");
16109                } else {
16110                    $(".masonry__lightbox .arrowr").css("display", "none");
16111                }
16112            });
16113
16114            $(".masonry__lightbox .arrowl").click(function () {
16115                var imgSrc = $(".masonry__lightbox img").attr("src");
16116                var search = $("section").find("img[src$='" + imgSrc + "']");
16117                var newImage = search.prev().attr("src");
16118                var newAlt = search.prev().attr("alt");
16119
16120                $(".masonry__lightbox img").attr("src", newImage);
16121                $(".masonry__lightbox .caption").html("<p>" + newAlt + "</p>");
16122                $(".masonry__lightbox .filter").css("background-image", "url(" + newImage 
16122+ ")");
16123
16124                // If the image is to tall, we need to reposition the caption
16125                var newImgHeight = $(".masonry__lightbox img")[0].clientHeight;
16126                if (newImgHeight > 0.9 * wHeight) {
16127                    $(".masonry__lightbox .caption").css("top", "98%");
16128                } else {
16129                    $(".masonry__lightbox .caption").css("top", "90%");
16130                }
16131
16132                // Hiding arrows for first item 
16133                if (!search.prev().is(":first-child")) {
16134                    $(".masonry__lightbox .arrowr").css("display", "block");
16135                } else {
16136                    $(".masonry__lightbox .arrowl").css("display", "none");
16137                }
16138            });
16139        }
16140    });
16141})(jQuery);
16142
16143},{}],93:[function(require,module,exports){
16144/*
16145 * easy-autocomplete
16146 * jQuery plugin for autocompletion
16147 * 
16148 * @author Łukasz Pawełczak (http://github.com/pawelczak)
16149 * @version 1.3.5
16150 * Copyright  License: 
16151 */
16152
16153"use strict";
16154
16155var EasyAutocomplete = (function (a) {
16156  return (a.Configuration = function (a) {
16157    function b() {
16158      if (("xml" === a.dataType && (a.getValue || (a.getValue = function (a) {
16159        return $(a).text();
16160      }), a.list || (a.list = {}), a.list.sort || (a.list.sort = {}), a.list.sort.method = function (b, c) {
16161        return (b = a.getValue(b), c = a.getValue(c), c > b ? -1 : b > c ? 1 : 0);
16162      }, a.list.match || (a.list.match = {}), a.list.match.method = function (a, b) {
16163        return a.search(b) > -1;
16164      }), void 0 !== a.categories && a.categories instanceof Array)) {
16165        for (var b = [], c = 0, d = a.categories.length; d > c; c += 1) {
16166          var e = a.categories[c];for (var f in h.categories[0]) void 0 === e[f] && (e[f] = h.categories[0][f]);b.push(e);
16167        }a.categories = b;
16168      }
16169    }function c() {
16170      function b(a, c) {
16171        var d = a || {};for (var e in a) void 0 !== c[e] && null !== c[e] && ("object" != typeof c[e] || c[e] instanceof Array ? d[e] = c[e] : b(a[e], c[e]));return (void 0 !== c.data && null !== c.data && "object" == typeof c.data && (d.data = c.data), d);
16172      }h = b(h, a);
16173    }function d() {
16174      if ("list-required" !== h.url && "function" != typeof h.url) {
16175        var b = h.url;h.url = function () {
16176          return b;
16177        };
16178      }if (void 0 !== h.ajaxSettings.url && "function" != typeof h.ajaxSettings.url) {
16179        var b = h.ajaxSettings.url;h.ajaxSettings.url = function () {
16180          return b;
16181        };
16182      }if ("string" == typeof h.listLocation) {
16183        var c = h.listLocation;"XML" === h.dataType.toUpperCase() ? h.listLocation = function (a) {
16184          return $(a).find(c);
16185        } : h.listLocation = function (a) {
16186          return a[c];
16187        };
16188      }if ("string" == typeof h.getValue) {
16189        var d = h.getValue;h.getValue = function (a) {
16190          return a[d];
16191        };
16192      }void 0 !== a.categories && (h.categoriesAssigned = !0);
16193    }function e() {
16194      void 0 !== a.ajaxSettings && "object" == typeof a.ajaxSettings ? h.ajaxSettings = a.ajaxSettings : h.ajaxSettings = {};
16195    }function f(a) {
16196      return void 0 !== h[a] && null !== h[a];
16197    }function g(a, b) {
16198      function c(b, d) {
16199        for (var e in d) void 0 === b[e] && a.log("Property '" + e + "' does not exist in EasyAutocomplete options API."), "object" == typeof b[e] && -1 === $.inArray(e, i) && c(b[e], d[e]);
16200      }c(h, b);
16201    }var h = { data: "list-required", url: "list-required", dataType: "json", listLocation: function listLocation(a) {
16202        return a;
16203      }, xmlElementName: "", getValue: function getValue(a) {
16204        return a;
16205      }, autocompleteOff: !0, placeholder: !1, ajaxCallback: function ajaxCallback() {}, matchResponseProperty: !1, list: { sort: { enabled: !1, method: function method(a, b) {
16206            return (a = h.getValue(a), b = h.getValue(b), b > a ? -1 : a > b ? 1 : 0);
16207          } }, maxNumberOfElements: 6, hideOnEmptyPhrase: !0, match: { enabled: !1, caseSensitive: !1, method: function method(a, b) {
16208            return a.search(b) > -1;
16209          } }, showAnimation: { type: "normal", time: 400, callback: function callback() {} }, hideAnimation: { type: "normal", time: 400, callback: function callback() {} }, onClickEvent: function onClickEvent() {}, onSelectItemEvent: function onSelectItemEvent() {}, onLoadEvent: function onLoadEvent() {}, onChooseEvent: function onChooseEvent() {}, onKeyEnterEvent: function onKeyEnterEvent() {}, onMouseOverEvent: function onMouseOverEvent() {}, onMouseOutEvent: function onMouseOutEvent() {}, onShowListEvent: function onShowListEvent() {}, onHideListEvent: function onHideListEvent() {} }
16209, highlightPhrase: !0, theme: "", cssClasses: "", minCharNumber: 0, requestDelay: 0, adjustWidth: !0, ajaxSettings: {}, preparePostData: function preparePostData(a, b) {
16210        return a;
16211      }, loggerEnabled: !0, template: "", categoriesAssigned: !1, categories: [{ maxNumberOfElements: 4 }] },
16212        i = ["ajaxSettings", "template"];this.get = function (a) {
16213      return h[a];
16214    }, this.equals = function (a, b) {
16215      return !(!f(a) || h[a] !== b);
16216    }, this.checkDataUrlProperties = function () {
16217      return "list-required" !== h.url || "list-required" !== h.data;
16218    }, this.checkRequiredProperties = function () {
16219      for (var a in h) if ("required" === h[a]) return (logger.error("Option " + a + " must be defined"), !1);return !0;
16220    }, this.printPropertiesThatDoesntExist = function (a, b) {
16221      g(a, b);
16222    }, b(), c(), h.loggerEnabled === !0 && g(console, a), e(), d();
16223  }, a);
16224})(EasyAutocomplete || {}),
16225    EasyAutocomplete = (function (a) {
16226  return (a.Logger = function () {
16227    this.error = function (a) {
16228      console.log("ERROR: " + a);
16229    }, this.warning = function (a) {
16230      console.log("WARNING: " + a);
16231    };
16232  }, a);
16233})(EasyAutocomplete || {}),
16234    EasyAutocomplete = (function (a) {
16235  return (a.Constans = function () {
16236    var a = { CONTAINER_CLASS: "easy-autocomplete-container", CONTAINER_ID: "eac-container-", WRAPPER_CSS_CLASS: "easy-autocomplete" };this.getValue = function (b) {
16237      return a[b];
16238    };
16239  }, a);
16240})(EasyAutocomplete || {}),
16241    EasyAutocomplete = (function (a) {
16242  return (a.ListBuilderService = function (a, b) {
16243    function c(b, c) {
16244      function d() {
16245        var d,
16246            e = {};return (void 0 !== b.xmlElementName && (e.xmlElementName = b.xmlElementName), void 0 !== b.listLocation ? d = b.listLocation : void 0 !== a.get("listLocation") && (d = a.get("listLocation")), void 0 !== d ? "string" == typeof d ? e.data = $(c).find(d) : "function" == typeof d && (e.data = d(c)) : e.data = c, e);
16247      }function e() {
16248        var a = {};return (void 0 !== b.listLocation ? "string" == typeof b.listLocation ? a.data = c[b.listLocation] : "function" == typeof b.listLocation && (a.data = b.listLocation(c)) : a.data = c, a);
16249      }var f = {};if ((f = "XML" === a.get("dataType").toUpperCase() ? d() : e(), void 0 !== b.header && (f.header = b.header), void 0 !== b.maxNumberOfElements && (f.maxNumberOfElements = b.maxNumberOfElements), void 0 !== a.get("list").maxNumberOfElements && (f.maxListSize = a.get("list").maxNumberOfElements), void 0 !== b.getValue)) if ("string" == typeof b.getValue) {
16250        var g = b.getValue;f.getValue = function (a) {
16251          return a[g];
16252        };
16253      } else "function" == typeof b.getValue && (f.getValue = b.getValue);else f.getValue = a.get("getValue");return f;
16254    }function d(b) {
16255      var c = [];return (void 0 === b.xmlElementName && (b.xmlElementName = a.get("xmlElementName")), $(b.data).find(b.xmlElementName).each(function () {
16256        c.push(this);
16257      }), c);
16258    }this.init = function (b) {
16259      var c = [],
16260          d = {};return (d.data = a.get("listLocation")(b), d.getValue = a.get("getValue"), d.maxListSize = a.get("list").maxNumberOfElements, c.push(d), c);
16261    }, this.updateCategories = function (b, d) {
16262      if (a.get("categoriesAssigned")) {
16263        b = [];for (var e = 0; e < a.get("categories").length; e += 1) {
16264          var f = c(a.get("categories")[e], d);b.push(f);
16265        }
16266      }return b;
16267    }, this.convertXml = function (b) {
16268      if ("XML" === a.get("dataType").toUpperCase()) for (var c = 0; c < b.length; c += 1) b[c].data = d(b[c]);return b;
16269    }, this.processData = function (c, d) {
16270      for (var e = 0, f = c.length; f > e; e += 1) c[e].data = b(a, c[e], d);return c;
16271    }, this.checkIfDataExists = function (a) {
16272      for (var b = 0, c = a.length; c > b; b += 1) if (void 0 !== a[b].data && a[b].data instanceof Array && a[b].data.length > 0) return !0;return !1;
16273    };
16274  }, a);
16275})(EasyAutocomplete || {}),
16276    EasyAutocomplete = (function (a) {
16277  return (a.proccess = function (b, c, d) {
16278    function e(a, c) {
16279      var d = [],
16280          e = "";if (b.get("list").match.enabled) for (var g = 0, h = a.length; h > g; g += 1) e = b.get("getValue")(a[g]), f(e, c) && d.push(a[g]);else d = a;return d;
16281    }function f(a, c) {
16282      return (b.get("list").match.caseSensitive || ("string" == typeof a && (a = a.toLowerCase()), c = c.toLowerCase()), !!b.get("list").match.method(a, c));
16283    }
16283function g(a) {
16284      return (void 0 !== c.maxNumberOfElements && a.length > c.maxNumberOfElements && (a = a.slice(0, c.maxNumberOfElements)), a);
16285    }function h(a) {
16286      return (b.get("list").sort.enabled && a.sort(b.get("list").sort.method), a);
16287    }a.proccess.match = f;var i = c.data,
16288        j = d;return (i = e(i, j), i = g(i), i = h(i));
16289  }, a);
16290})(EasyAutocomplete || {}),
16291    EasyAutocomplete = (function (a) {
16292  return (a.Template = function (a) {
16293    var b = { basic: { type: "basic", method: function method(a) {
16294          return a;
16295        }, cssClass: "" }, description: { type: "description", fields: { description: "description" }, method: function method(a) {
16296          return a + " - description";
16297        }, cssClass: "eac-description" }, iconLeft: { type: "iconLeft", fields: { icon: "" }, method: function method(a) {
16298          return a;
16299        }, cssClass: "eac-icon-left" }, iconRight: { type: "iconRight", fields: { iconSrc: "" }, method: function method(a) {
16300          return a;
16301        }, cssClass: "eac-icon-right" }, links: { type: "links", fields: { link: "" }, method: function method(a) {
16302          return a;
16303        }, cssClass: "" }, custom: { type: "custom", method: function method() {}, cssClass: "" } },
16304        c = (function (_c) {
16305      var _cWrapper = function c(_x) {
16306        return _c.apply(this, arguments);
16307      };
16308
16309      _cWrapper.toString = function () {
16310        return _c.toString();
16311      };
16312
16313      return _cWrapper;
16314    })(function (a) {
16315      var c,
16316          d = a.fields;return "description" === a.type ? (c = b.description.method, "string" == typeof d.description ? c = function (a, b) {
16317        return a + " - <span>" + b[d.description] + "</span>";
16318      } : "function" == typeof d.description && (c = function (a, b) {
16319        return a + " - <span>" + d.description(b) + "</span>";
16320      }), c) : "iconRight" === a.type ? ("string" == typeof d.iconSrc ? c = function (a, b) {
16321        return a + "<img class='eac-icon' src='" + b[d.iconSrc] + "' />";
16322      } : "function" == typeof d.iconSrc && (c = function (a, b) {
16323        return a + "<img class='eac-icon' src='" + d.iconSrc(b) + "' />";
16324      }), c) : "iconLeft" === a.type ? ("string" == typeof d.iconSrc ? c = function (a, b) {
16325        return "<img class='eac-icon' src='" + b[d.iconSrc] + "' />" + a;
16326      } : "function" == typeof d.iconSrc && (c = function (a, b) {
16327        return "<img class='eac-icon' src='" + d.iconSrc(b) + "' />" + a;
16328      }), c) : "links" === a.type ? ("string" == typeof d.link ? c = function (a, b) {
16329        return "<a href='" + b[d.link] + "' >" + a + "</a>";
16330      } : "function" == typeof d.link && (c = function (a, b) {
16331        return "<a href='" + d.link(b) + "' >" + a + "</a>";
16332      }), c) : "custom" === a.type ? a.method : b.basic.method;
16333    }),
16334        d = function d(a) {
16335      return a && a.type && a.type && b[a.type] ? c(a) : b.basic.method;
16336    },
16337        e = function e(a) {
16338      var c = function c() {
16339        return "";
16340      };return a && a.type && a.type && b[a.type] ? (function () {
16341        var c = b[a.type].cssClass;return function () {
16342          return c;
16343        };
16344      })() : c;
16345    };this.getTemplateClass = e(a), this.build = d(a);
16346  }, a);
16347})(EasyAutocomplete || {}),
16348    EasyAutocomplete = (function (a) {
16349  return (a.main = function (b, c) {
16350    function d() {
16351      return 0 === t.length ? void p.error("Input field doesn't exist.") : o.checkDataUrlProperties() ? o.checkRequiredProperties() ? (e(), void g()) : void p.error("Will not work without mentioned properties.") : void p.error("One of options variables 'data' or 'url' must be defined.");
16352    }function e() {
16353      function a() {
16354        var a = $("<div>"),
16355            c = n.getValue("WRAPPER_CSS_CLASS");o.get("theme") && "" !== o.get("theme") && (c += " eac-" + o.get("theme")), o.get("cssClasses") && "" !== o.get("cssClasses") && (c += " " + o.get("cssClasses")), "" !== q.getTemplateClass() && (c += " " + q.getTemplateClass()), a.addClass(c), t.wrap(a), o.get("adjustWidth") === !0 && b();
16356      }function b() {
16357        var a = t.outerWidth();t.parent().css("width", a);
16358      }function c() {
16359        t.unwrap();
16360      }function d() {
16361        var a = $("<div>").addClass(n.getValue("CONTAINER_CLASS"));a.attr("id", f()).prepend($("<ul>")), (function () {
16362          a.on("show.eac", function () {
16363            switch (o.get("list").showAnimation.type) {case "slide":
16364                var b = o.get("list").showAnimation.time,
16365                    c = o.get("list").showAnimation.callback;a.find("ul").slideDown(b, c);break;case "fade":
16366                var b = o.get("list").showAnimation.time,
16367                    c = o.get("list").showAnimation.callback;a.find("ul").fadeIn(b), c;break;default:
16368                a.find("ul").show();}o.get("list").onShowListEvent();
16369          }).on("hide.eac", function () {
16370            switch (o.get("list").hideAnimation.type) {case "slide":
16371                var b = o.get("list").hideAnimation.time,
16372                    c = o.get("list").hideAnimation.callback;a.find("ul").slideUp(b, c);break;case "fade":
16373                var b = o.get("list").hideAnimation.time,
16374                    c = o.get("list").hideAnimation.callback;a.find("ul").fadeOut(b, c);break;default:
16375                a.find("ul").hide();}o.get("list").onHideListEvent();
16376          }).on("selectElement.eac", function () {
16377            a.find("ul li").removeClass("selected"), a.find("ul li").eq(w).addClass("selected"), o.get("list").onSelectItemEvent();
16378          }).on("loadElements.eac", function (b, c, d) {
16379            var e = "",
16380                f = a.find("ul");f.empty().detach(), v = [];for (var h = 0, i = 0, k = c.length; k > i; i += 1) {
16381              var l = c[i].data;if (0 !== l.length) {
16382                void 0 !== c[i].header && c[i].header.length > 0 && f.append("<div class='eac-category' >" + c[i].header + "</div>");for (var m = 0, n = l.length; n > m && h < c[i].maxListSize; m += 1) e = $("<li><div class='eac-item'></div></li>"), (function () {
16383                  var a = m,
16384                      b = h,
16385                      f = c[i].getValue(l[a]);e.find(" > div").on("click", function () {
16386                    t.val(f).trigger("change"), w = b, j(b), o.get("list").onClickEvent(), o.get("list").onChooseEvent();
16387                  }).mouseover(function () {
16388                    w = b, j(b), o.get("list").onMouseOverEvent();
16389                  }).mouseout(function () {
16390                    o.get("list").onMouseOutEvent();
16391                  }).html(q.build(g(f, d), l[a]));
16392                })(), f.append(e), v.push(l[m]), h += 1;
16393              }
16394            }a.append(f), o.get("list").onLoadEvent();
16395          });
16396        })(), t.after(a);
16397      }function e() {
16398        t.next("." + n.getValue("CONTAINER_CLASS")).remove();
16399      }function g(a, b) {
16400        return o.get("highlightPhrase") && "" !== b ? i(a, b) : a;
16401      }function h(a) {
16402        return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
16403      }function i(a, b) {
16404        var c = h(b);return (a + "").replace(new RegExp("(" + c + ")", "gi"), "<b>$1</b>");
16405      }t.parent().hasClass(n.getValue("WRAPPER_CSS_CLASS")) && (e(), c()), a(), d(), u = $("#" + f()), o.get("placeholder") && t.attr("placeholder", o.get("placeholder"));
16406    }function f() {
16407      var a = t.attr("id");return a = n.getValue("CONTAINER_ID") + a;
16408    }function g() {
16409      function a() {
16410        s("autocompleteOff", !0) && n(), b(), c(), d(), e(), f(), g();
16411      }function b() {
16412        t.focusout(function () {
16413          var a,
16414              b = t.val();o.get("list").match.caseSensitive || (b = b.toLowerCase());for (var c = 0, d = v.length; d > c; c += 1) if ((a = o.get("getValue")(v[c]), o.get("list").match.caseSensitive || (a = a.toLowerCase()), a === b)) return (w = c, void j(w));
16415        });
16416      }function c() {
16417        t.off("keyup").keyup(function (a) {
16418          function b(a) {
16419            function b() {
16420              var a = {},
16421                  b = o.get("ajaxSettings") || {};for (var c in b) a[c] = b[c];return a;
16422            }function c(a, b) {
16423              return o.get("matchResponseProperty") !== !1 ? "string" == typeof o.get("matchResponseProperty") ? b[o.get("matchResponseProperty")] === a : "function" == typeof o.get("matchResponseProperty") ? o.get("matchResponseProperty")(b) === a : !0 : !0;
16424            }if (!(a.length < o.get("minCharNumber"))) {
16425              if ("list-required" !== o.get("data")) {
16426                var d = o.get("data"),
16427                    e = r.init(d);e = r.updateCategories(e, d), e = r.processData(e, a), k(e, a), t.parent().find("li").length > 0 ? h() : i();
16428              }var f = b();void 0 !== f.url && "" !== f.url || (f.url = o.get("url")), void 0 !== f.dataType && "" !== f.dataType || (f.dataType = o.get("dataType")), void 0 !== f.url && "list-required" !== f.url && (f.url = f.url(a), f.data = o.get("preparePostData")(f.data, a), $.ajax(f).done(function (b) {
16429                var d = r.init(b);d = r.updateCategories(d, b), d = r.convertXml(d), c(a, b) && (d = r.processData(d, a), k(d, a)), r.checkIfDataExists(d) && t.parent().find("li").length > 0 ? h() : i(), o.get("ajaxCallback")();
16430              }).fail(function () {
16431                p.warning("Fail to load response data");
16432              }).always(function () {}));
16433            }
16434          }switch (a.keyCode) {case 27:
16435              i(), l();break;case 38:
16436              a.preventDefault(), v.length > 0 && w > 0 && (w -= 1, t.val(o.get("getValue")(v[w])), j(w));break;case 40:
16437              a.preventDefault(), v.length > 0 && w < v.length - 1 && (w += 1, t.val(o.get("getValue")(v[w])), j(w));break;default:
16438              if (a.keyCode > 40 || 8 === a.keyCode) {
16439                var c = t.val();o.get("list").hideOnEmptyPhrase !== !0 || 8 !== a.keyCode || "" !== c ? o.get("requestDelay") > 0 ? (void 0 !== m && clearTimeout(m), m = setTimeout(function () {
16440                  b(c);
16441                }, o.get("requestDelay"))) : b(c) : i();
16442              }}
16443        });
16444      }function d() {
16445        t.on("keydown", function (a) {
16446          a = a || window.event;var b = a.keyCode;return 38 === b ? (suppressKeypress = !0, !1) : void 0;
16447        }).keydown(function (a) {
16448          13 === a.keyCode && w > -1 && (t.val(o.get("getValue")(v[w])), o.get("list").onKeyEnterEvent(), o.get("list").onChooseEvent(), w = -1, i(), a.preventDefault());
16449        });
16450      }function e() {
16451        t.off("keypress");
16452      }function f() {
16453        t.focus(function () {
16454          "" !== t.val() && v.length > 0 && (w = -1, h());
16455        });
16456      }function g() {
16457        t.blur(function () {
16458          setTimeout(function () {
16459            w = -1, i();
16460          }, 250);
16461        });
16462      }function n() {
16463        t.attr("autocomplete", "off");
16464      }a();
16465    }function h() {
16466      u.trigger("show.eac");
16467    }function i() {
16468      u.trigger("hide.eac");
16469    }function j(a) {
16470      u.trigger("selectElement.eac", a);
16471    }function k(a, b) {
16472      u.trigger("loadElements.eac", [a, b]);
16473    }function l() {
16474      t.trigger("blur");
16475    }var m,
16476        n = new a.Constans(),
16477        o = new a.Configuration(c),
16478        p = new a.Logger(),
16479        q = new a.Template(c.template),
16480        r = new a.ListBuilderService(o, a.proccess),
16481        s = o.equals,
16482        t = b,
16483        u = "",
16484        v = [],
16485        w = -1;a.consts = n, this.getConstants = function () {
16486      return n;
16487    }, this.getConfiguration = function () {
16488      return o;
16489    }, this.getContainer = function () {
16490      return u;
16491    }, this.getSelectedItemIndex = function () {
16492      return w;
16493    }, this.getItems = function () {
16494      return v;
16495    }, this.getItemData = function (a) {
16496      return v.length < a || void 0 === v[a] ? -1 : v[a];
16497    }, this.getSelectedItemData = function () {
16498      return this.getItemData(w);
16499    }, this.build = function () {
16500      e();
16501    }, this.init = function () {
16502      d();
16503    };
16504  }, a.eacHandles = [], a.getHandle = function (b) {
16505    return a.eacHandles[b];
16506  }, a.inputHasId = function (a) {
16507    return void 0 !== $(a).attr("id") && $(a).attr("id").length > 0;
16508  }, a.assignRandomId = function (b) {
16509    var c = "";do c = "eac-" + Math.floor(10000 * Math.random()); while (0 !== $("#" + c).length);elementId = a.consts.getValue("CONTAINER_ID") + c, $(b).attr("id", c);
16510  }, a.setHandle = function (b, c) {
16511    a.eacHandles[c] = b;
16512  }, a);
16513})(EasyAutocomplete || {});!(function (a) {
16514  a.fn.easyAutocomplete = function (b) {
16515    return this.each(function () {
16516      var c = a(this),
16517          d = new EasyAutocomplete.main(c, b);EasyAutocomplete.inputHasId(c) || EasyAutocomplete.assignRandomId(c), d.init(), EasyAutocomplete.setHandle(d, c.attr("id"));
16518    });
16519  }, a.fn.getSelectedItemIndex = function () {
16520    var b = a(this).attr("id");return void 0 !== b ? EasyAutocomplete.getHandle(b).getSelectedItemIndex() : -1;
16521  }, a.fn.getItems = function () {
16522    var b = a(this).attr("id");return void 0 !== b ? EasyAutocomplete.getHandle(b).getItems() : -1;
16523  }, a.fn.getItemData = function (b) {
16524    var c = a(this).attr("id");return void 0 !== c && b > -1 ? EasyAutocomplete.getHandle(c).getItemData(b) : -1;
16525  }, a.fn.getSelectedItemData = function () {
16526    var b = a(this).attr("id");return void 0 !== b ? EasyAutocomplete.getHandle(b).getSelectedItemData() : -1;
16527  };
16528})(jQuery);
16529
16530},{}],94:[function(require,module,exports){
16531"use strict";
16532
16533var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
16534
16535var partnersTier1 = [{ imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-aerospace.png", url: "https://www.aopa.org/about/aopa-partners/aero-space-reports" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-aircraft-spruce.png", url: "https://www.aopa.org/about/aopa-partners/aircraft-spruce" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-jeppesen.png", url: "https://www.aopa.org/about/aopa-partners/jeppesen" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-sirius-xm.png", url: "http://www.aopa.org/siriusxm" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-mastercard.png", url: "http://www.aopa.org/creditcard" }];var partnersTier2 = [{ imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-pilot-workshops.png", url: "http://www.aopa.org/pilotworkshops" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-avis.png", url: "http://www.avis.com/aopa" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-CAU.png", url: "http://www.aopa.org/cau" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-enterprise.png", url: "https://partners.rentalcar.com/aopa2" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-Hertz.png", url: "https://link.hertz.com/link.html" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-jsfirm.png", url: "https://www.aopa.org/About/HR/Aviation-Job-Postings" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-priceline.png", url: "http://www.aopa.org/hotels" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-red-bull.png", url: "http://www.aopa.org/rbar" }, { imagesrc: "https://www.aopa.org/-/media/images/aopa-main/HP2019/partners/AOPA-partners-sportys.png", url: "http://www.aopa.org/sportys" }];function shuffle(a) {
16536  for (var i = a.length; i; i--) {
16537    var j = Math.floor(Math.random() * i);var _ref = [a[j], a[i - 1]];
16538
16539    var _ref2 = _slicedToArray(_ref, 2);
16540
16541    a[i - 1] = _ref2[0];
16542    a[j] = _ref2[1];
16543  }
16544}
16545shuffle(partnersTier1);jQuery(partnersTier1.slice(0, 3)).each(function (i, obj) {
16546  jQuery("#img-grid").append("<a href=" + obj.url + "><img src=" + obj.imagesrc + "/></a>");
16547});shuffle(partnersTier2);jQuery(partnersTier2.slice(0, 2)).each(function (i, obj) {
16548  jQuery("#img-grid").append("<a href=" + obj.url + "><img src=" + obj.imagesrc + "/></a>");
16549});
16550
16551},{}],95:[function(require,module,exports){
16552"use strict";
16553
16554(function ($) {
16555    "use strict";
16556    var airportId = "KFDK";
16557
16558    var options = {
16559        url: function url(phrase) {
16560            return "https://webapp.aopa.org/AirportsAPI/airportsautocomplete/" + phrase;
16561        },
16562        getValue: function getValue(element) {
16563            var toDisplay = undefined,
16564                airportId = undefined;
16565            var icaoId = $(element).prop("icaoId");
16566            var faaId = $(element).prop("faaId");
16567            if (icaoId) {
16568                airportId = icaoId;
16569            } else {
16570                airportId = faaId;
16571            }
16572            toDisplay = airportId + ": " + $(element).prop("name") + " - " + $(element).prop("city");
16573            return toDisplay;
16574        },
16575        requestDelay: 200,
16576        list: {
16577            onChooseEvent: function onChooseEvent() {
16578                // when a user chooses an element from the list
16579                var selectedAirport = $("#searchAirport").getSelectedItemData();
16580
16581                if (selectedAirport) {
16582                    var faaId = selectedAirport.faaId;
16583                    var icaoId = selectedAirport.icaoId;
16584
16585                    if (icaoId) {
16586                        airportId = icaoId;
16587                    } else {
16588                        airportId = faaId;
16589                    }
16590                    updateAirportId();
16591                    $("#airportForm").submit();
16592                } else {
16593                    $("#searchAirport").val("");
16594                }
16595            },
16596            maxNumberOfElements: 10,
16597            sort: {
16598                enabled: false
16599            },
16600            match: {
16601                // show only the elements that match the query
16602                enabled: true
16603            },
16604            showAnimation: {
16605                type: "slide", //normal|slide|fade
16606                time: 200,
16607                callback: function callback() {}
16608            },
16609            hideAnimation: {
16610                type: "slide",
16611                time: 400,
16612                callback: function callback() {}
16613            }
16614        }
16615
16616    };
16617
16618    $("#searchAirport").easyAutocomplete(options);
16619
16620    function updateAirportId() {
16621        var airportUrl = "https://www.aopa.org/destinations/airports/" + airportId + "/detail
16621s";
16622        airportUrl = encodeURI(airportUrl);
16623
16624        var airportform = document.getElementById("airportForm");
16625        airportform.action = airportUrl;
16626    }
16627
16628    $("#searchAirport").focus(function () {
16629        $("#searchAirport").val("");
16630    });
16631
16632    // Atttempted to make the following 2 sections a function,
16633    // but for whatever reason could never get the keydown and click events to call the function
16634    // so ended up giving up and doing a cut and paste, yuck
16635    // if hit enter but no selection send to first suggestion
16636    $("#searchAirport").keydown(function (e) {
16637        if (e.which == 13) {
16638            // pressed enter key
16639            if ($("#searchAirport").val().length === 0) {
16640                // is query is empty take them to destinations search page
16641                var airportform = document.getElementById("airportForm");
16642                airportform.method = "get";
16643                airportform.elements.namedItem("q").value = "";
16644                airportform.action = "https://www.aopa.org/destinations/";
16645                $("#airportForm").submit();
16646            } else if ($(".easy-autocomplete-container .eac-item").length === 1) {
16647                // if only 1 airport returned in list, take them to that airport
16648                $(".easy-autocomplete-container ul li:first .eac-item").
16648click();
16649            } else {
16650                // perform a search on the destinations map page using the query
16651                var airportform = document.getElementById("airportForm");
16652                airportform.method = "get";
16653                airportform.elements.namedItem("public").value = "0";
16654                airportform.elements.namedItem("q").value = $("#searchAirport").val();
16655                airportform.action = "https://www.aopa.org/destinations/search";
16656                $("#airportForm").submit();
16657            }
16658        }
16659    });
16660
16661    // if click search button but no selection send to first suggestion
16662    $("#airportSearchButton").click(function (e) {
16663        if ($("#searchAirport").val().length === 0) {
16664            // is query is empty take them to destinations search page
16665            var airportform = document.getElementById("airportForm");
16666            airportform.method = "get";
16667            airportform.elements.namedItem("q").value = "";
16668            airportform.action = "https://www.aopa.org/destinations/";
16669            $("#airportForm").submit();
16670        } else if ($(".easy-autocomplete-container .eac-item").length === 1) {
16671            // if only 1 airport returned in list, take them to that airport
16672            $(".easy-autocomplete-container ul li:first .eac-item").
16672click();
16673        } else {
16674            // perform a search on the destinations map page using the query
16675            var airportform = document.getElementById("airportForm");
16676            airportform.method = "get";
16677            airportform.elements.namedItem("public").value = "0";
16678            airportform.elements.namedItem("q").value = $("#searchAirport").val();
16679            // airportform.action = 'https://www.aopa.org/destinations/search?q=' + $("#searchAirport").val() + '&public=0';
16680            airportform.action = "https://www.aopa.org/destinations/search";
16681            $("#airportForm").submit();
16682            // window.open(airportform.action, '_blank');
16683        }
16684    });
16685})(jQuery);
16686
16687},{}],96:[function(require,module,exports){
16688"use strict";
16689
16690(function ($) {
16691  "use strict";$(document).ready(function () {
16692    if (!$("body.in-sitecore").length) {
16693      $(".hp-widgets__tools nav li").on("click", function () {
16694        $(this).addClass("active").siblings().removeClass("active");$(".hp-widgets__tools .nav-marker").css("left", Math.floor($(this).position().left) + 28);$(".widget-content").css("left", $(this).index() * -1 * 100 + "%");
16695      });
16696    }
16697  });
16698})(jQuery);
16699
16700},{}],97:[function(require,module,exports){
16701"use strict";
16702
16703var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
16704
16705var wxWidget = {};
16706
16707$(document).ready(function () {
16708
16709    // determine if we HAVE an airport code already
16710    wxWidget.airport_id = $.trim($("#weatherwidgetdiv").text());
16711
16712    wxWidget.wxData = {};
16713
16714    if (wxWidget.airport_id) {
16715        getLocationFromAirportId();
16716    } else {}
16717
16718    function getWxData(data) {
16719        var parsedMetar = parseMetar(data),
16720            wxMappings = initWxMappings(),
16721            local_data_options = { hour: "numeric", minute: "numeric", hour12: true };
16722        var wxData = {};
16723        wxData.city = parsedMetar.city;
16724        wxData.state = parsedMetar.state;
16725        wxData.location_name = parsedMetar.name;
16726        wxData.location_ident = parsedMetar.ident;
16727        wxData.temp = parsedMetar.temp_c;
16728        wxData.dewpoint = parsedMetar.dewpoint_c;
16729        wxData.wind = formatWind(parsedMetar);
16730        wxData.ceiling = getCeiling(parsedMetar.sky_conditions_trans);
16731        wxData.viz = parsedMetar.visibility ? parsedMetar.visibility : 10;
16732        wxData.flight_category = parsedMetar.flight_category;
16733        wxData.wx_icon = getIcon(data);
16734        wxData.wx_icon_tooltip = getTooltip(data);
16735        wxData.obs_date = new Date(parsedMetar.observation_time);
16736        wxData.obs_date_local = new Date(parsedMetar.observation_time).toLocaleString("en-US", local_data_options);
16737
16738        console.dir(parsedMetar);
16739        return wxData;
16740    }
16741    function populate_widget_fields() {
16742        var wxData = wxWidget.wxData;
16743        $("#wx_location_name_ident").html(wxData.location_ident);
16744        $("#wx_location_city_state").html(wxData.city + ", " + wxData.state);
16745        $("#wx_observation_time").html("<strong>Obsv:</strong> " + wxData.obs_date_local + " (" + wxData.obs_date.getUTCHours() + "" + wxData.obs_date.getUTCMinutes() + "Z)");
16746        $("#wx_temperature_dew_point").html("<strong>" + wxData.temp + "</strong>&deg;/<strong>" + wxData.dewpoint + "</strong>&deg;");
16747        $("#wx_wind").html("<strong>" + wxData.wind + "</strong>");
16748        $("#wx_ceiling").html("<strong>" + wxData.ceiling + "</strong>");
16749        $("#wx_visibility").html("<strong>" + wxData.viz + "</strong>SM");
16750        $(".wxIcon").addClass(getIcon(wxData)).addClass(wxData.flight_category.toLowerCase());
16751    }
16752    function dateToUTC(date) {
16753        return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
16754    }
16755    function formatWind(data) {
16756        if (!data) {
16757            return "";
16758        }
16759
16760        if (data.wind_speed) {
16761            if (data.wind_gust) {
16762                return data.wind_dir + "&deg; @ " + data.wind_speed + "-" + data.wind_gust + " kts";
16763            }
16764
16765            return data.wind_dir + "&deg; @ " + data.wind_speed + " kts";
16766        }
16767
16768        return "CALM";
16769    }
16770    function getCeiling(skc) {
16771        if (!skc || skc.length < 1) {
16772            return "CLR";
16773        }
16774
16775        // If vertical visibility is reported, use the vertical visibility value as the ceiling
16776        var vv = skc.find(function (layer) {
16777            return layer.sky_cover === "Vertical Visibility";
16778        });
16779        if (vv) {
16780            return parseInt(vv.cloud_base) + " ft";
16781        }
16782
16783        // Extract the altitudes of all broken and overcast layers
16784        var layers = skc.filter(function (layer) {
16785            return layer.sky_cover === "Overcast" || layer.sky_cover === "Broken clouds";
16786        }).map(function (layer) {
16787            return parseInt(layer.cloud_base);
16788        });
16789        if (layers.length < 1) {
16790            return "CLR";
16791        }
16792
16793        // Return minimum altitude of broken/overcast layers
16794        return Math.min.apply(Math, _toConsumableArray(layers)) + " ft";
16795    }
16796    function parseMetar(d) {
16797        return {
16798            ident: d.icao_code,
16799            name: d.name,
16800            city: d.city,
16801            state: d.state,
16802            latitude: d.latitude,
16803            longitude: d.longitude,
16804            elevation: d.elevation_m * 3.28084,
16805            observation_time: new Date(d.observation_time),
16806            raw_text: d.raw_text,
16807            flight_category: d.flight_category,
16808            visibility: d.visibility_statute_mi,
16809            ceiling: getCeiling(d.sky_conditions_trans),
16810            wind_speed: d.wind_speed_kt,
16811            wind_gust: d.wind_gust_kt,
16812            wind_dir: d.wind_dir_degrees,
16813            temp_c: d.temp_c,
16814            temp_f: d.temp_f,
16815            dewpoint_c: d.dewpoint_c,
16816            dewpoint_f: d.dewpoint_f,
16817            wx_string: d.wx_string,
16818            wx_string_trans: d.wx_string_trans,
16819            sky_conditions_trans: d.sky_conditions_trans
16820        };
16821    }
16822    function getIcon(data) {
16823        // Return neutral icon if no data is loaded
16824        if (!data) {
16825            return "wi-na";
16826        }
16827
16828        // If significant weather phenomena are present, return the icon associated with that
16829        // phenomena.
16830        var type = getWxType(data.wx_string);
16831        if (type != null) {
16832            return type.icon;
16833        }
16834
16835        // Otherwise, return icon for cloudy, partly cloudy, or sunny depending on what cloud
16836        // layers are present.
16837        var skc = data.sky_conditions_trans;
16838        if (skc && skc.length >= 1) {
16839            var layers = skc.map(function (layer) {
16840                return layer.sky_cover;
16841            });
16842
16843            // Return cloudy if there is at least one overcast or broken cloud layer
16844            if (layers.indexOf("Overcast") >= 0 || layers.indexOf("Broken clouds") >= 0) {
16845                return "wi-cloudy";
16846            }
16847
16848            // Return partly sunny if there is at least one scattered/few cloud layer
16849            if (layers.indexOf("Scattered clouds") >= 0 || layers.indexOf("Few clouds") >= 0) {
16850                return "wi-day-cloudy";
16851            }
16852        }
16853
16854        // Otherwise, return sunny
16855        return "wi-day-sunny";
16856    }
16857    function getTooltip(data) {
16858        var wx = translateWx(data.wx_string),
16859            clouds = getCloudLayersText(data.sky_conditions_trans);
16860        return [wx, clouds].filter(function (t) {
16861            return t;
16862        }).join(", ") || null;
16863    }
16864    function getLocationFromAirportId() {
16865        // TODO: Error handling on airport ident search
16866        toggleSpinner(true);
16867        // execute the REST API call
16868        $.ajax({
16869            url: "https://www.aopa.org/AirportsAPI/wx/widgetdata",
16870            data: {
16871                query: "" + wxWidget.airport_id + ""
16872            } }).fail(function () {
16873            weatherFail();
16874        }).done(function (data) {
16875
16876            wxWidget.wxData = getWxData(data);
16877            populate_widget_fields();
16878            toggleSpinner(false);
16879        });
16880    }
16881    function getLocationFromCoords() {
16882
16883        // TODO: Error handling on coordinate location search
16884        toggleSpinner(true);
16885        navigator.geolocation.getCurrentPosition(function processPosition(position) {
16886
16887            $.ajax({
16888                url: "https://www.aopa.org/AirportsAPI/wx/widgetdata",
16889                data: {
16890                    latitude: "" + position.coords.latitude + "",
16891                    longitude: "" + position.coords.longitude + ""
16892                } }).fail(function () {
16893                weatherFail();
16894            }).done(function (data) {
16895                wxWidget.wxData = getWxData(data);
16896                populate_widget_fields();
16897                toggleSpinner(false);
16898            });
16899        });
16900    }
16901    function translateWx(wx_string) {
16902        var types = getWxTypes(wx_string);
16903        if (types && types.length > 0) {
16904            return types.map(function (t) {
16905                return t.text;
16906            }).join(", ");
16907        }
16908
16909        return null;
16910    }
16911    function getWxType(wx_string) {
16912        if (!wx_string) {
16913            return null;
16914        }
16915
16916        return getWxTypes(wx_string)[0] || null;
16917    }
16918    function getCloudLayersText(skc) {
16919        if (skc && skc.length >= 1) {
16920            var layers = skc.map(function (layer) {
16921                var text = layer.sky_cover;
16922                if (layer.cloud_base && layer.cloud_base !== "None") {
16923                    text += " " + layer.cloud_base;
16924                }
16925                return {
16926                    alt: parseInt(layer.cloud_base),
16927                    text: text
16928                };
16929            });
16930
16931            return layers.sort(function (a, b) {
16932                return a.alt - b.alt;
16933            }).map(function (layer) {
16934                return layer.text;
16935            }).join(", ");
16936        }
16937
16938        return null;
16939    }
16940    function getWxTypes(wx_string) {
16941        if (!wx_string) {
16942            return [];
16943        }
16944
16945        var elems = wx_string.split(" ");
16946
16947        var wxItems = initWxMappings();
16948
16949        return wxItems.filter(function (t) {
16950            // See if entire wx_string matches one of the keys exactly (e.g., "RA SN" should
16951            // match the item with priority 25).
16952            if (t.keys.indexOf(wx_string) >= 0) {
16953                return true;
16954            }
16955
16956            // Otherwise, split on space and see if any of the individual elements (e.g., "RA"
16957            // or "SN") match one of the keys.
16958            if (elems.some(function (elem) {
16959                return t.keys.indexOf(elem) >= 0;
16960            })) {
16961                return true;
16962            }
16963
16964            return false;
16965        }).sort(function (a, b) {
16966            return a.priority - b.priority;
16967        });
16968    }
16969    function initWxMappings() {
16970
16971        var wxMappings = [{
16972            priority: 1,
16973            keys: ["FC", "+FC"],
16974            text: "Funnel cloud",
16975            icon: "wi-tornado"
16976        }, {
16977            priority: 2,
16978            keys: ["SQ"],
16979            text: "Squall",
16980            icon: "wi-strong-wind"
16981        }, {
16982            priority: 3,
16983            keys: ["FU"],
16984            text: "Smoke",
16985            icon: "wi-smoke"
16986        }, {
16987            priority: 3,
16988            keys: ["VA"],
16989            text: "Volcanic ash",
16990            icon: "wi-volcano"
16991        }, {
16992            priority: 5,
16993            keys: ["+TSGS", "+TSGR"],
16994            text: "Thunderstorm / Heavy hail",
16995            icon: "wi-thunderstorm"
16996        }, {
16997            priority: 6,
16998            keys: ["+TSRA"],
16999            text: "Thunderstorm / Heavy rain",
17000            icon: "wi-thunderstorm"
17001        }, {
17002            priority: 6,
17003            keys: ["+TSSN"],
17004            text: "Thunderstorm / Heavy snow",
17005            icon: "wi-thunderstorm"
17006        }, {
17007            priority: 6,
17008            keys: ["+TSPL"],
17009            text: "Thunderstorm / Ice pellets",
17010            icon: "wi-thunderstorm"
17011        }, {
17012            priority: 7,
17013            keys: ["TSGR", "TSGS"],
17014            text: "Thunderstorm / Hail",
17015            icon: "wi-thunderstorm"
17016        }, {
17017            priority: 8,
17018            keys: ["TSRA"],
17019            text: "Thunderstorm / Rain",
17020            icon: "wi-thunderstorm"
17021        }, {
17022            priority: 8,
17023            keys: ["TSSN"],
17024            text: "Thunderstorm / Snow",
17025            icon: "wi-storm-showers"
17026        }, {
17027            priority: 8,
17028            keys: ["TSPL"],
17029            text: "Thunderstorm / Ice pellets",
17030            icon: "wi-storm-showers"
17031        }, {
17032            priority: 9,
17033            keys: ["PO", "VCPO"],
17034            text: "Dust/sand whirls",
17035            icon: "wi-dust"
17036        }, {
17037            priority: 10,
17038            keys: ["+SS"],
17039            text: "Heavy sandstorm",
17040            icon: "wi-sandstorm"
17041        }, {
17042            priority: 10,
17043            keys: ["+DS"],
17044            text: "Heavy dust storm",
17045            icon: "wi-dust"
17046        }, {
17047            priority: 11,
17048            keys: ["SS"],
17049            text: "Sandstorm",
17050            icon: "wi-sandstorm"
17051        }, {
17052            priority: 11,
17053            keys: ["DS"],
17054            text: "Dust storm",
17055            icon: "wi-dust"
17056        }, {
17057            priority: 11,
17058            keys: ["DRSA"],
17059            text: "Drifting sand",
17060            icon: "wi-sandstorm"
17061        }, {
17062            priority: 11,
17063            keys: ["DRDU"],
17064            text: "Drifting dust",
17065            icon: "wi-dust"
17066        }, {
17067            priority: 12,
17068            keys: ["VCSS"],
17069            text: "Sandstorm in vicinity",
17070            icon: "wi-sandstorm"
17071        }, {
17072            priority: 12,
17073            keys: ["VCDS"],
17074            text: "Dust storm in vicinity",
17075            icon: "wi-dust"
17076        }, {
17077            priority: 13,
17078            keys: ["SA"],
17079            text: "Sand",
17080            icon: "wi-sandstorm"
17081        }, {
17082            priority: 13,
17083            keys: ["BLSA"],
17084            text: "Blowing sand",
17085            icon: "wi-sandstorm"
17086        }, {
17087            priority: 13,
17088            keys: ["VCBLSA"],
17089            text: "Blowing sand in vicinity",
17090            icon: "wi-sandstorm"
17091        }, {
17092            priority: 13,
17093            keys: ["BLDU"],
17094            text: "Blowing dust",
17095            icon: "wi-dust"
17096        }, {
17097            priority: 13,
17098            keys: ["VCBLDU"],
17099            text: "Blowing dust in vicinity",
17100            icon: "wi-dust"
17101        }, {
17102            priority: 13,
17103            keys: ["BLPY"],
17104            text: "Blowing spray",
17105            icon: "wi-dust"
17106        }, {
17107            priority: 14,
17108            keys: ["DU"],
17109            text: "Dust",
17110            icon: "wi-dust"
17111        }, {
17112            priority: 15,
17113            keys: ["GR", "SHGR", "+GR", "+SHGR"],
17114            text: "Hail",
17115            icon: "wi-hail"
17116        }, {
17117            priority: 16,
17118            keys: ["GS", "SHGS", "+GS", "+SHGS"],
17119            text: "Hail / Snow pellets",
17120            icon: "wi-hail"
17121        }, {
17122            priority: 17,
17123            keys: ["-GR", "-SHGR"],
17124            text: "Light hail",
17125            icon: "wi-hail"
17126        }, {
17127            priority: 18,
17128            keys: ["-GS", "-SHGS"],
17129            text: "Light hail / Snow pellets",
17130            icon: "wi-hail"
17131        }, {
17132            priority: 19,
17133            keys: ["SG"],
17134            text: "Snow grains",
17135            icon: "wi-snow"
17136        }, {
17137            priority: 20,
17138            keys: ["PL"],
17139            text: "Ice pellets",
17140            icon: "wi-sleet"
17141        }, {
17142            priority: 20,
17143            keys: ["PL", "PE", "SHPL", "SHPE"],
17144            text: "Ice pellets",
17145            icon: "wi-sleet"
17146        }, {
17147            priority: 21,
17148            keys: ["FZDZ", "+FZDZ"],
17149            text: "Freezing drizzle",
17150            icon: "wi-sleet"
17151        }, {
17152            priority: 22,
17153            keys: ["-FZDZ"],
17154            text: "Light freezing drizzle",
17155            icon: "wi-sleet"
17156        }, {
17157            priority: 23,
17158            keys: ["FZRA", "+FZRA"],
17159            text: "Freezing rain",
17160            icon: "wi-sleet"
17161        }, {
17162            priority: 24,
17163            keys: ["-FZRA"],
17164            text: "Light freezing rain",
17165            icon: "wi-sleet"
17166        }, {
17167            priority: 25,
17168            keys: ["RA SN"],
17169            text: "Rain / Snow",
17170            icon: "wi-sleet"
17171        }, {
17172            priority: 25,
17173            keys: ["+RA SN"],
17174            text: "Heavy rain / Snow",
17175            icon: "wi-sleet"
17176        }, {
17177            priority: 25,
17178            keys: ["RA +SN"],
17179            text: "Rain / Heavy snow",
17180            icon: "wi-sleet"
17181        }, {
17182            priority: 25,
17183            keys: ["+RA +SN"],
17184            text: "Heavy rain / Heavy snow",
17185            icon: "wi-sleet"
17186        }, {
17187            priority: 25,
17188            keys: ["DZ SN"],
17189            text: "Drizze / Snow",
17190            icon: "wi-sleet"
17191        }, {
17192            priority: 25,
17193            keys: ["+DZ SN"],
17194            text: "Heavy drizzle / Snow",
17195            icon: "wi-sleet"
17196        }, {
17197            priority: 25,
17198            keys: ["DZ +SN"],
17199            text: "Drizzle / Heavy snow",
17200            icon: "wi-sleet"
17201        }, {
17202            priority: 25,
17203            keys: ["+DZ +SN"],
17204            text: "Heavy drizzle / Snow",
17205            icon: "wi-sleet"
17206        }, {
17207            priority: 26,
17208            keys: ["-RA -SN"],
17209            text: "Light rain / Light snow",
17210            icon: "wi-sleet"
17211        }, {
17212            priority: 26,
17213            keys: ["-RA SN"],
17214            text: "Light rain / Snow",
17215            icon: "wi-sleet"
17216        }, {
17217            priority: 26,
17218            keys: ["-DZ -SN"],
17219            text: "Light drizzle / Light snow",
17220            icon: "wi-sleet"
17221        }, {
17222            priority: 26,
17223            keys: ["-DZ SN"],
17224            text: "Light drizzle / Snow",
17225            icon: "wi-sleet"
17226        }, {
17227            priority: 27,
17228            keys: ["SHRA SN"],
17229            text: "Rain showers / Snow",
17230            icon: "wi-rain-mix"
17231        }, {
17232            priority: 27,
17233            keys: ["SHSN RA"],
17234            text: "Snow showers / Rain",
17235            icon: "wi-rain-mix"
17236        }, {
17237            priority: 27,
17238            keys: ["+SHRA SN"],
17239            text: "Heavy rain showers / Snow",
17240            icon: "wi-rain-mix"
17241        }, {
17242            priority: 27,
17243            keys: ["+SHSN RA"],
17244            text: "Heavy snow showers / Rain",
17245            icon: "wi-rain-mix"
17246        }, {
17247            priority: 28,
17248            keys: ["-SHRA SN"],
17249            text: "Light rain showers / Snow",
17250            icon: "wi-rain-mix"
17251        }, {
17252            priority: 28,
17253            keys: ["-SHSN RA"],
17254            text: "Light snow showers / Rain",
17255            icon: "wi-rain-mix"
17256        }, {
17257            priority: 28,
17258            keys: ["-SHRA -SN"],
17259            text: "Light rain showers / Light snow",
17260            icon: "wi-rain-mix"
17261        }, {
17262            priority: 28,
17263            keys: ["-SHSN -RA"],
17264            text: "Light snow showers / Light rain",
17265            icon: "wi-rain-mix"
17266        }, {
17267            priority: 29,
17268            keys: ["SHSN"],
17269            text: "Snow showers",
17270            icon: "wi-snow"
17271        }, {
17272            priority: 29,
17273            keys: ["+SHSN"],
17274            text: "Heavy snow showers",
17275            icon: "wi-snow"
17276        }, {
17277            priority: 30,
17278            keys: ["-SHSN"],
17279            text: "Light snow showers",
17280            icon: "wi-snow"
17281        }, {
17282            priority: 31,
17283            keys: ["IC"],
17284            text: "Ice crystals",
17285            icon: "wi-snowflake-cold"
17286        }, {
17287            priority: 32,
17288            keys: ["UP"],
17289            text: "Unknown precipitation",
17290            icon: "wi-sprinkle"
17291        }, {
17292            priority: 33,
17293            keys: ["TS"],
17294            text: "Thunderstorm",
17295            icon: "wi-thunderstorm"
17296        }, {
17297            priority: 34,
17298            keys: ["DZ RA"],
17299            text: "Drizzle / Rain",
17300            icon: "wi-rain-mix"
17301        }, {
17302            priority: 34,
17303            keys: ["+DZ RA"],
17304            text: "Heavy drizzle / Rain",
17305            icon: "wi-rain-mix"
17306        }, {
17307            priority: 34,
17308            keys: ["DZ +RA"],
17309            text: "Drizzle / Heavy rain",
17310            icon: "wi-rain-mix"
17311        }, {
17312            priority: 34,
17313            keys: ["+DZ +RA"],
17314            text: "Heavy drizzle / Heavy rain",
17315            icon: "wi-rain-mix"
17316        }, {
17317            priority: 35,
17318            keys: ["DZ -RA"],
17319            text: "Drizzle / Light rain",
17320            icon: "wi-rain-mix"
17321        }, {
17322            priority: 35,
17323            keys: ["-DZ RA"],
17324            text: "Light drizzle / Rain",
17325            icon: "wi-rain-mix"
17326        }, {
17327            priority: 35,
17328            keys: ["-DZ -RA"],
17329            text: "Light drizzle / Light rain",
17330            icon: "wi-rain-mix"
17331        }, {
17332            priority: 36,
17333            keys: ["+SN"],
17334            text: "Heavy snow",
17335            icon: "wi-snow"
17336        }, {
17337            priority: 37,
17338            keys: ["+RA"],
17339            text: "Heavy rain",
17340            icon: "wi-rain"
17341        }, {
17342            priority: 38,
17343            keys: ["SH"],
17344            text: "Showers",
17345            icon: "wi-showers"
17346        }, {
17347            priority: 38,
17348            keys: ["+SH"],
17349            text: "Heavy showers",
17350            icon: "wi-showers"
17351        }, {
17352            priority: 38,
17353            keys: ["SHRA"],
17354            text: "Rain showers",
17355            icon: "wi-showers"
17356        }, {
17357            priority: 38,
17358            keys: ["+SHRA"],
17359            text: "Heavy rain showers",
17360            icon: "wi-showers"
17361        }, {
17362            priority: 39,
17363            keys: ["+DZ"],
17364            text: "Heavy drizzle",
17365            icon: "wi-sleet"
17366        }, {
17367            priority: 40,
17368            keys: ["SN"],
17369            text: "Snow",
17370            icon: "wi-snow"
17371        }, {
17372            priority: 41,
17373            keys: ["RA"],
17374            text: "Rain",
17375            icon: "wi-rain"
17376        }, {
17377            priority: 42,
17378            keys: ["DZ"],
17379            text: "Drizzle",
17380            icon: "wi-sprinkle"
17381        }, {
17382            priority: 43,
17383            keys: ["-SN"],
17384            text: "Light snow",
17385            icon: "wi-snow"
17386        }, {
17387            priority: 44,
17388            keys: ["-RA"],
17389            text: "Light rain",
17390            icon: "wi-showers"
17391        }, {
17392            priority: 45,
17393            keys: ["-SH"],
17394            text: "Light showers",
17395            icon: "wi-showers"
17396        }, {
17397            priority: 45,
17398            keys: ["-SHRA"],
17399            text: "Light rain showers",
17400            icon: "wi-showers"
17401        }, {
17402            priority: 46,
17403            keys: ["-DZ"],
17404            text: "Light drizzle",
17405            icon: "wi-sprinkle"
17406        }, {
17407            priority: 47,
17408            keys: ["DRSN"],
17409            text: "Drifting snow",
17410            icon: "wi-sandstorm"
17411        }, {
17412            priority: 48,
17413            keys: ["BLSN"],
17414            text: "Blowing snow",
17415            icon: "wi-sandstorm"
17416        }, {
17417            priority: 48,
17418            keys: ["VCBLSN"],
17419            text: "Blowing snow in vicinity",
17420            icon: "wi-sandstorm"
17421        }, {
17422            priority: 49,
17423            keys: ["FZFG"],
17424            text: "Freezing fog",
17425            icon: "wi-fog"
17426        }, {
17427            priority: 50,
17428            keys: ["VCTS"],
17429            text: "Thunderstorm in vicinity",
17430            icon: "wi-thunderstorm"
17431        }, {
17432            priority: 51,
17433            keys: ["VCSH"],
17434            text: "Showers in vicinity",
17435            icon: "wi-showers"
17436        }, {
17437            priority: 52,
17438            keys: ["FG"],
17439            text: "Fog",
17440            icon: "wi-fog"
17441        }, {
17442            priority: 53,
17443            keys: ["PRFG"],
17444            text: "Partial fog",
17445            icon: "wi-fog"
17446        }, {
17447            priority: 54,
17448            keys: ["BCFG"],
17449            text: "Patchy fog",
17450            icon: "wi-fog"
17451        }, {
17452            priority: 55,
17453            keys: ["VCFG"],
17454            text: "Fog in vicinity",
17455            icon: "wi-fog"
17456        }, {
17457            priority: 56,
17458            keys: ["MIFG"],
17459            text: "Shallow fog",
17460            icon: "wi-fog"
17461        }, {
17462            priority: 57,
17463            keys: ["VIRGA"],
17464            text: "Virga",
17465            icon: "wi-rain-wind"
17466        }, {
17467            priority: 58,
17468            keys: ["BR"],
17469            text: "Mist",
17470            icon: "wi-fog"
17471        }, {
17472            priority: 59,
17473            keys: ["HZ"],
17474            text: "Haze",
17475            icon: "wi-fog"
17476        }];
17477
17478        return wxMappings;
17479    }
17480    function toggleSpinner(state) {
17481
17482        var elementsToToggle = $("#airport_ident, #detect_location,#wx_location_city_state,#wx_location_name_ident,#wx_observation_time,#weather_metrics");
17483        var wxContainer = $("#airport_ident").parent("section");
17484
17485        if (state) {
17486            elementsToToggle.css("transition", "opacity .3s ease").css("opacity", "0");
17487            wxContainer.prepend("<div class=\"wxLoading\"><img src=\"https://www.aopa.org/assets/images/preloader_dark.png\"></div>");
17488        } else {
17489            $(".wxLoading").remove();
17490            elementsToToggle.css("transition", "opacity .3s ease").css("opacity", "1");
17491        }
17492    }
17493    function weatherFail() {
17494        var wxContainer = $("#airport_ident").parent("section");
17495        $("#detect_location").css({ opacity: "1" });
17496        $(".wxLoading").remove();
17497        wxContainer.prepend("<div class=\"wxError\">There was a problem retrieving your weather.</div>");
17498    }
17499    // Detect my location click handleRange
17500    $("#detect_location").click(function () {
17501        $(".wxError").detach();
17502        getLocationFromCoords();
17503    });
17504});
17505
17506// getLocationFromCoords();
17507
17508},{}],98:[function(require,module,exports){
17509"use strict";
17510
17511$(document).ready(function () {
17512    if ($("div#divIFlightPlanner").length) {
17513        var theForm = $("#frmFlightPlanner");
17514
17515        $(".fp-button").click(function () {
17516            $("#FormMode").val($(this).data("mode"));
17517            theForm.submit();
17518        });
17519    }
17520});
17521
17522},{}],99:[function(require,module,exports){
17523"use strict";
17524
17525$(document).ready(function () {
17526    if ($("div#divIslandGuidesForm").length) {
17527        var theForm;
17528        var igdStripe;
17529        var igdElements;
17530        var igdStyle;
17531        var igdCardElement;
17532        var checkCardFields;
17533        var igAutocomplete;
17534        var initAutocomplete;
17535        var clearValidation;
17536
17537        (function () {
17538            var fillInAddress = function () {
17539                // Get the place details from the autocomplete object.
17540                var place = igAutocomplete.getPlace();
17541                var address1 = "";
17542                var postcode = "";
17543
17544                $("#MailingStreet").val("");
17545                $("#MailingCity").val("");
17546                $("#MailingStateProvince").val("");
17547                $("#MailingPostalCode").val("");
17548                $("#MailingCountry").val("");
17549
17550                // Get each component of the address from the place details,
17551                // and then fill-in the corresponding field on the form.
17552                // place.address_components are google.maps.GeocoderAddressComponent objects
17553                // which are documented at http://goo.gle/3l5i5Mr
17554                place.address_components.forEach(function (component) {
17555                    var componentType = component.types[0];
17556
17557                    switch (componentType) {
17558                        case "street_number":
17559                            {
17560                                address1 = "" + component.long_name + " " + address1;
17561                                break;
17562                            }
17563
17564                        case "route":
17565                            {
17566                                address1 += component.short_name;
17567                                break;
17568                            }
17569
17570                        case "postal_code":
17571                            {
17572                                postcode = "" + component.long_name + "" + postcode;
17573                                break;
17574                            }
17575
17576                        case "postal_code_suffix":
17577                            {
17578                                postcode = "" + postcode + "-" + component.long_name;
17579                                break;
17580                            }
17581                        case "locality":
17582                            $("#MailingCity").val(component.long_name);
17583                            clearValidation("MailingCity");
17584                            break;
17585                        case "administrative_area_level_1":
17586                            {
17587                                $("#MailingStateProvince").val(component.short_name);
17588                                clearValidation("MailingStateProvince");
17589                                break;
17590                            }
17591                        case "country":
17592                            $("#MailingCountry").val(component.long_name);
17593                            if (component.short_name === "US") {
17594                                $("#rdoMailingCountryUS").prop("checked", true);
17595                                $("#divMailingCountry").hide();
17596                                $("#IsDomestic").val("True");
17597                                $("#IsInternational").val("False");
17598                            } else {
17599                                $("#rdoMailingCountryOther").prop("checked", true);
17600                                $("#divMailingCountry").show();
17601                                $("#IsDomestic").val("False");
17602                                $("#IsInternational").val("True");
17603                            }
17604                            clearValidation("MailingCountry");
17605                            break;
17606
17607                    }
17608                });
17609
17610                $("#MailingStreet").val(address1);
17611                clearValidation("MailingStreet");
17612                $("#MailingPostalCode").val(postcode);
17613                clearValidation("MailingPostalCode");
17614                $("#MailingStreet").focus();
17615            };
17616
17617            var validateDiv = function (div) {
17618                var validator = theForm.data("validator");
17619                var returnValue = true;
17620
17621                $("#" + div + " :input").each(function (e) {
17622                    if (!$(this).is(":button") && this.id.length) {
17623                        if (!validator.element($("#" + this.id))) returnValue = false;
17624                    }
17625                });
17626
17627                return returnValue;
17628            };
17629
17630            theForm = $("#frmIslandGuides");
17631            igdStripe = Stripe($("#sapik").val());
17632            igdElements = igdStripe.elements();
17633            igdStyle = {
17634                base: {
17635                    backgroundColor: "#efefef",
17636                    fontSize: "0.9375rem",
17637                    fontFamily: "Roboto, Helvetica Neue, sans-serif",
17638                    lineHeight: "42px",
17639                    ":focus": {
17640                        border: "10px solid black"
17641                    }
17642                }
17643            };
17644            igdCardElement = igdElements.create("card", { style: igdStyle, hidePostalCode: true, disableLink: true });
17645
17646            igdCardElement.mount("#card-element");
17647
17648            igdCardElement.on("change", function (event) {
17649                var displayError = document.getElementById("card-errors");
17650                if (event.error) {
17651                    displayError.textContent = event.error.message;
17652                } else {
17653                    displayError.textContent = "";
17654                }
17655
17656                $("#CardBrand").val(event.brand);
17657            });
17658
17659            checkCardFields = function () {
17660                var isValid = false;
17661
17662                var cardElement = document.querySelector("#card-element");
17663
17664                isValid = cardElement.classList.contains("StripeElement--complete");
17665
17666                var brand = $("#CardBrand").val();
17667
17668                if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
17669                    $("#card-errors").html("");
17670                } else {
17671                    if ($("#card-errors").is(":empty")) {
17672                        $("#card-errors").html("Please check your credit card information.");
17673                    }
17674                }
17675
17676                return isValid;
17677            };
17678
17679            initAutocomplete = function () {
17680                // Create the autocomplete object, restricting the search predictions to
17681                igAutocomplete = new google.maps.places.Autocomplete(AddressLookup, {
17682                    fields: ["address_components"],
17683                    types: ["address"] });
17684                // When the user selects an address from the drop-down, populate the
17685                // address fields in the form.
17686                igAutocomplete.addListener("place_changed", fillInAddress);
17687            };
17688
17689            initAutocomplete();
17690
17691            ;
17692
17693            clearValidation = function (field) {
17694                var theField = $("#" + field);
17695                if (theField.val()) {
17696                    theField.removeClass("input-validation-error").addClass("val
17696id");
17697                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
17698                    $("span[data-valmsg-for='" + field + "']").empty();
17699                }
17700            };
17701
17702            $("input[type=radio][name=rdoMailingCountry]").change(function () {
17703                if ($("input[name=\"rdoMailingCountry\"]:checked").val() === "US") {
17704                    $("#IsDomestic").val("True");
17705                    $("#IsInternational").val("False");
17706                    $("#divMailingCountry").hide();
17707                    $("#MailingCountry").val("United States");
17708                } else {
17709                    $("#IsDomestic").val("False");
17710                    $("#IsInternational").val("True");
17711                    $("#divMailingCountry").show();
17712                    $("#MailingCountry").val("");
17713                }
17714            });
17715
17716            $(document.body).delegate("[type=\"checkbox\"][readonly=\"readonly\"]", "click", function (e) {
17717                e.preventDefault();
17718            });
17719
17720            $(".igcontinuebutton").click(function () {
17721                if ($(this).data("thispage") !== "igPage3") {
17722                    if (validateDiv($(this).data("thispage"))) {
17723                        var nextpage = $(this).data("nextpage");
17724                        $("#" + $(this).data("thispage")).hide();
17725                        $("#" + nextpage).show();
17726                        window.scrollTo(0, 0);
17727                    }
17728                } else {
17729                    var nextpage = $(this).data("nextpage");
17730                    $("#" + $(this).data("thispage")).hide();
17731                    $("#" + nextpage).show();
17732                }
17733            });
17734
17735            $(".btnCancel").click(function () {
17736                window.location.href = "https://www.aopa.org";
17737            });
17738
17739            $(".igbackbutton").click(function () {
17740                var prevpage = $(this).data("prevpage");
17741                $("#" + $(this).data("thispage")).hide();
17742                $("#" + prevpage).show();
17743                window.scrollTo(0, 0);
17744            });
17745
17746            $(".igSubmitButton").click(function () {
17747
17748                var progressBar = new Sfpb_progressBar();
17749                var ccValid = checkCardFields();
17750
17751                if (theForm.valid() && ccValid) {
17752
17753                    $("#divButtonSubmit").removeClass("clsSubmitFloatRight");
17754                    $("#divButtonSubmit").addClass("clsSubmitNoFloatRight");
17755                    $("#divIGOrderButton").addClass("clsAddHeight");
17756                    $("#btnRegister").hide();
17757                    $(".btn_final_cancelback").hide();
17758                    $(this).hide();
17759                    $("body").addClass("progressbar-modal");
17760                    progressBar.start();
17761                    $(".clsSubmit").append("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
17762
17763                    igdStripe.createToken(igdCardElement, { name: $("#CardName").val() }).then(function (result) {
17764                        if (result.token !== null) {
17765                            $("#CardToken").val(JSON.stringify(result.token));
17766                            theForm.submit();
17767                        } else {
17768                            if ($("#card-errors").is(":empty")) {
17769                                $("#card-errors").html("Please check your credit card information.");
17770                            }
17771                            var spinner = document.getElementById("aopaSpinner");
17772                            spinner.parentElement.removeChild(spinner);
17773                            $(this).show();
17774                            progressBar.kill();
17775                            $("body").removeClass("progressbar-modal");
17776                            $("#divButtonSubmit").removeClass("clsSubmitNoFloatRight");
17777                            $("#divButtonSubmit").addClass("clsSubmitFloatRight");
17778                            $("#divIGOrderButton").removeClass("clsAddHeight");
17779                            $("#btnRegister").show();
17780                            $(".btn_final_cancelback").show();
17781                        }
17782                    });
17783                }
17784            });
17785
17786            $("input[name^='ProductListItems']").change(function () {
17787                var total = 0;
17788                $(".ig-product-row").hide();
17789
17790                $("input:checkbox[name^='ProductListItems']").each(function () {
17791                    if (this.checked) {
17792                        var cb = this.name.split(".")[0];
17793                        var itemData = $("[id=\"" + cb + ".ID\"]").val().split("|");
17794                        total += parseFloat(itemData[3]);
17795
17796                        $("#div" + itemData[0]).show();
17797                    }
17798                });
17799
17800                $("#OrderTotal").val(total);
17801                $("#igOrderTotal").html("$" + total.toFixed(2));
17802
17803                var nextButton = document.getElementById("btnPage4Forward");
17804                var regButton = document.getElementById("btnRegister");
17805                if (total > 0) {
17806                    nextButton.disabled = false;
17807                    regButton.disabled = false;
17808                    $("#btnPage4Forward").removeClass("ig-disable-button");
17809                    $("#btnRegister").removeClass("ig-disable-button");
17810                } else {
17811                    nextButton.disabled = true;
17812                    regButton.disabled = true;
17813                    $("#btnPage4Forward").addClass("ig-disable-button");
17814                    $("#btnRegister").addClass("ig-disable-button");
17815                }
17816            });
17817        })();
17818    }
17819});
17820
17821},{}],100:[function(require,module,exports){
17822"use strict";
17823
17824module.exports = itemListApp;
17825
17826function itemListApp($scope, $http, $attrs) {
17827    /*
17828     * Controller: itemListController
17829     * Primary item list and media gallery controller
17830     */
17831
17832    $scope.rendering = JSON.parse($attrs.rendering); /* Initial search values */
17833
17834    if (!$scope.rendering.api) {
17835        $scope.rendering.api = "ItemList";
17836    }
17837
17838    var baseDataUrl = "/api/" + $scope.rendering.api + "/Results";
17839    var airportsUrl = "/api/AirportFinder/GetAirports?name=";
17840    var locationsUrl = "/api/EventListingLocation/Results";
17841
17842    if ($attrs.testurl) {
17843        baseDataUrl = $attrs.testurl;
17844    }
17845
17846    if ($attrs.airportsurl) {
17847        airportsUrl = $attrs.airportsurl;
17848    }
17849
17850    if ($attrs.locationsurl) {
17851        locationsUrl = $attrs.locationsurl;
17852    }
17853
17854    $scope.rawrendering = $scope.rendering;
17855    $scope.displaynum = Number($attrs.displaynum);
17856    $scope.allTags = [];
17857    $scope.toggle = $scope.rendering.api == "EventListing" ? false : true;
17858    $scope.currSort = $scope.rendering.api == "EventListing" ? "asc" : "desc";
17859    $scope.currStart = 1;
17860    $scope.currEnd = $scope.displaynum;
17861    $scope.currDate = "";
17862    $scope.currEndDate = "";
17863    $scope.dontShowLoading = false;
17864    $scope.event = { limit: false };
17865    $scope.special = {
17866        locations: { items: new Array() },
17867        airports: { items: new Array() },
17868        airport: "",
17869        radius: ""
17870    };
17871    $scope.disableRadDrop = true;
17872
17873    $scope.radii = [{ label: "< 50 miles", value: 50 }, { label: "100 miles", value: 100 }, { label: "200 miles", value: 200 }];
17874
17875    $scope.special.radius = $scope.radii[0];
17876
17877    /* Initial content load */
17878    postHelper($scope, $http, baseDataUrl, collapseParams($scope));
17879
17880    $scope.tags = [];
17881
17882    /*
17883     * addAirport
17884     * adds airport to post and updates content
17885     */
17886    $scope.addAirport = function (newAirport) {
17887        $scope.disableRadDrop = false;
17888        $scope.special.airport = newAirport;
17889        if ($scope.special.radius !== "") {
17890            postHelper($scope, $http, baseDataUrl, collapseParams($scope));
17891        }
17892    };
17893
17894    /*
17895     * addDate
17896     * updates current start and end dates and updates content
17897     */
17898    $scope.addDate = function () {
17899        $scope.currDate = $scope.filter.date.date;
17900        $scope.currEndDate = $scope.filter.date.enddate;
17901        postHelper($scope, $http, baseDataUrl, collapseParams($scope));
17902    };
17903
17904    /*
17905     * addTag
17906     * adds a tag to the visual listing and updates content
17907     */
17908    $scope.addTag = function (newTag) {
17909        if (newTag) {
17910            if (tagIndex($scope.allTags, newTag.guid) === -1) {
17911                $scope.allTags.push(newTag);
17912            }
17913            $scope.tags = $scope.allTags.sort(tagCompare);
17914            postHelper($scope, $http, baseDataUrl, collapseParams($scope));
17915        }
17916    };
17917
17918    /*
17919     * clearAll
17920     * clears all user updated content and updates content
17921     */
17922    $scope.clearAll = function () {
17923        if ($scope.rendering.filters != null) {
17924            $scope.rendering.filters.forEach(function (filter) {
17925                if (filter.style == "checkbox") {
17926                    filter.items.forEach(function (item) {
17927                        item.checked = false;
17928                    });
17929                } else if (filter.style == "radio") {
17930                    filter.checkbox = {};
17931                }
17932            });
17933        }
17934
17935        $scope.event.limit = false;
17936        $scope.special.airport = "";
17937        $scope.special.airports = { items: [] };
17938        $scope.special.locations = { items: [] };
17939        $scope.special.radius = $scope.radii[0];
17940        $scope.disableRadDrop = true;
17941        $scope.allTags = [];
17942        $scope.currDate = "";
17943        $scope.tags = [];
17944
17945        postHelper($scope, $http, baseDataUrl, collapseParams($scope));
17946    };
17947
17948    /*
17949     * disableRadius
17950     */
17951    $scope.disableRadius = function () {
17952        return $scope.disableRadDrop;
17953    };
17954
17955    /*
17956     * getAirports
17957     */
17958    $scope.getAirports = function (searchtext) {
17959        if (searchtext.length >= 3) {
17960            $http.get(airportsUrl + searchtext).then(function (response) {
17961                $scope.special.airports.items = response.data.items.map(function (item) {
17962                    return {
17963                        guid: item.guid,
17964                        name: item.name,
17965                        type: item.type,
17966                        value: angular.lowercase(item.name)
17967                    };
17968                });
17969            }, function (response) {
17970                $scope.error = "There was a problem contacting the server.";
17971            });
17972        }
17973    };
17974
17975    /*
17976     * getLocations
17977     */
17978    $scope.getLocations = function () {
17979        if ($scope.special.locations.items.length < 1) {
17980            $http.post(locationsUrl).then(function (response) {
17981                $scope.special.locations.items = response.data.items.map(function (item) {
17982                    return {
17983                        guid: item.guid,
17984                        name: item.name,
17985                        type: item.type,
17986                        value: angular.lowercase(item.name)
17987                    };
17988                });
17989            }, function (response) {
17990                $scope.error = "There was a problem contacting the server.";
17991            });
17992        }
17993    };
17994
17995    /*
17996     * removeTag
17997     * removes single tag from visual list and updates content
17998     */
17999    $scope.removeTag = function (remTag) {
18000        var post = arguments[1] === undefined ? true : arguments[1];
18001
18002        remTag.checked = false;
18003
18004        if ($scope.rendering.filters != null) {
18005            $scope.rendering.filters.forEach(function (filter) {
18006                if (filter.style == "radio") {
18007                    filter.items.forEach(function (item) {
18008                        if (remTag.guid === item.guid) {
18009                            filter.checkbox = {};
18010                        }
18011                    });
18012                }
18013            });
18014        }
18015
18016        $scope.allTags.splice(tagIndex($scope.allTags, remTag.guid), 1);
18017        $scope.tags = $scope.allTags;
18018
18019        if (post) {
18020            postHelper($scope, $http, baseDataUrl, collapseParams($scope));
18021        }
18022    };
18023
18024    /*
18025     * showMore
18026     * loads an additional "page" of content
18027     */
18028    $scope.showMore = function () {
18029        /* Can't use the helper here because of the data concat */
18030        $scope.dontShowLoading = false;
18031        $http.post(baseDataUrl, collapseParams($scope, "more")).then(function (response) {
18032            var data = response.data;
18033            $scope.error = "";
18034            $scope.items = $scope.items.concat(data.items);
18035            $scope.shown = $scope.items.length;
18036            $scope.shown = $scope.shown <= data.total ? $scope.shown : data.total;
18037            $scope.total = data.total;
18038            $scope.dontShowLoading = true;
18039        }, function (response) {
18040            $scope.error = response;
18041            $scope.dontShowLoading = true;
18042        });
18043    };
18044
18045    $scope.showMoreSlick = function () {};
18046
18047    $scope.showMoreSlick = function () {};
18048
18049    /*
18050     * showFilters
18051     * counts up visible filters to see if we have any
18052     */
18053
18054    $scope.showFilters = function () {
18055        var countVisible = 0;
18056
18057        if ($scope.rendering.filters != null) {
18058            $scope.rendering.filters.forEach(function (filter) {
18059                if (filter.items.length > 1) {
18060                    countVisible += filter.items.length;
18061                }
18062            });
18063        }
18064
18065        if (countVisible > 0) {
18066            return true;
18067        }
18068
18069        return false;
18070    };
18071
18072    /*
18073     * toggleDateOrder
18074     * Swaps sort order values and makes post call
18075     */
18076    $scope.toggleDateOrder = function (toggle) {
18077        $scope.currSort = toggle ? "desc" : "asc";
18078
18079        postHelper($scope, $http, baseDataUrl, collapseParams($scope));
18080    };
18081
18082    /*
18083     * toggleType
18084     * Handles adding and removing of new checkbox tags
18085     * Determines checkbox state and calls add or remove function
18086     * Also handles visual show and clear
18087     */
18088    $scope.toggleType = function (newTag) {
18089        if (tagIndex($scope.allTags, newTag.guid) === -1) {
18090            newTag.checked = true;
18091            $scope.allTags.push(newTag);
18092        } else {
18093            $scope.removeTag(newTag);
18094        }
18095        $scope.tags = $scope.allTags;
18096        postHelper($scope, $http, baseDataUrl, collapseParams($scope));
18097    };
18098
18099    /*
18100     * toggleRadio
18101     * Handles adding and removing of new radio tags
18102     * Determines radio state and calls add or remove function for appropriate tags
18103     */
18104    $scope.toggleRadio = function (tagParent, newTag) {
18105        tagParent.items.forEach(function (item) {
18106            if (item.guid === newTag.guid) {
18107                newTag.checked = true;
18108                $scope.allTags.push(newTag);
18109            } else {
18110                item.checked = false;
18111
18112                if (tagIndex($scope.allTags, item.guid) > -1) {
18113                    $scope.allTags.splice(tagIndex($scope.allTags, item.guid), 1);
18114                }
18115            }
18116        });
18117
18118        $scope.tags = $scope.allTags;
18119
18120        postHelper($scope, $http, baseDataUrl, collapseParams($scope));
18121    };
18122
18123    /*
18124     * setLimit
18125     */
18126    $scope.setLimit = function () {
18127        $scope.event.limit = !$scope.event.limit;
18128        postHelper($scope, $http, baseDataUrl, collapseParams($scope));
18129    };
18130
18131    /*
18132     * setRadius
18133     */
18134    $scope.setRadius = function () {
18135        if ($scope.special.airport !== "") {
18136            postHelper($scope, $http, baseDataUrl, collapseParams($scope));
18137        }
18138    };
18139}
18140
18141/* Helper Functions */
18142
18143/*
18144 * collapseParams
18145 * fold all parameters into a single object to pass through post
18146 */
18147var collapseParams = function collapseParams($scope) {
18148    var loadtype = arguments[1] === undefined ? "" : arguments[1];
18149
18150    var adjStart = $scope.currStart,
18151        adjEnd = $scope.currEnd;
18152
18153    if (loadtype === "more") {
18154        adjStart = adjEnd + 1;
18155        adjEnd = adjEnd + $scope.displaynum;
18156    }
18157
18158    $scope.currEnd = adjEnd;
18159
18160    var sDate = !isNaN(new Date($scope.currDate)) ? new Date($scope.currDate).toJSON() : "",
18161        eDate = !isNaN(new Date($scope.currEndDate)) ? new Date($scope.currEndDate).toJSON() : "";
18162
18163    var paramObj = {};
18164    paramObj.rendering = $scope.rawrendering;
18165    paramObj.sort = $scope.currSort;
18166    paramObj.start = adjStart;
18167    paramObj.end = adjEnd;
18168    paramObj.startdate = sDate;
18169    paramObj.enddate = eDate;
18170    paramObj.tags = $scope.allTags;
18171    paramObj.limit = $scope.event.limit;
18172    paramObj.radius = "";
18173    paramObj.airport = "";
18174    if ($scope.special.radius != "" && $scope.special.airport != "") {
18175        paramObj.radius = $scope.special.radius;
18176        paramObj.airport = $scope.special.airport;
18177    }
18178
18179    return paramObj;
18180};
18181
18182/*
18183 * postHelper
18184 * Make all post calls (except loadMore, which appends rather than replacing the data)
18185 */
18186var postHelper = function postHelper($scope, $http, dataUrl, dataObj) {
18187    $http.post(dataUrl, dataObj).then(function (response) {
18188        var data = response.data;
18189        $scope.error = "";
18190        $scope.items = data.items;
18191        $scope.shown = data.items.length;
18192        $scope.total = data.total;
18193        $scope.dontShowLoading = true;
18194    }, function (response) {
18195        $scope.error = "There was a problem contacting the server.";
18196    });
18197};
18198
18199/*
18200 * tagCompare
18201 * Sort behavior for tags
18202 */
18203var tagCompare = function tagCompare(a, b) {
18204    return a.name.localeCompare(b.name);
18205};
18206
18207/*
18208 * tagIndex
18209 * Indicate if tag exists in array of tags
18210 * checks on guid
18211 * returns location if found, -1 otherwise
18212 */
18213var tagIndex = function tagIndex(tagArray, searchTag) {
18214    for (var i = 0; i < tagArray.length; i++) {
18215        if (tagArray[i].guid === searchTag) {
18216            return i;
18217        }
18218    }
18219    return -1;
18220};
18221
18222},{}],101:[function(require,module,exports){
18223"use strict";
18224
18225module.exports = typeAhead;
18226
18227function typeAhead($timeout, $q, $log, $attrs, $scope) {
18228	/* 
18229  * controller: typeAhead
18230  * Manages typeahead function with md-autocomplete
18231  */
18232
18233	var self = this;
18234	self.simulateQuery = false;
18235	self.isDisabled = false;
18236	self.querySearch = querySearch;
18237
18238	/* 
18239  * querySearch
18240  * Builds typeahead list
18241  */
18242	function querySearch(query, allterms) {
18243		var results = query ? allterms.filter(createFilterFor(query)) : allterms,
18244		    deferred;
18245		return results;
18246	}
18247
18248	/* 
18249  * typeAheadInit
18250  * normalize values of typeahead for ease of comparison
18251  */
18252	$scope.typeAheadInit = function (initValue) {
18253		return initValue.items.map(function (item) {
18254			item.value = item.name.toLowerCase();
18255			return item;
18256		});
18257	};
18258
18259	/* 
18260  * createFilterFor
18261  * Filter function for typeahead list
18262  */
18263	function createFilterFor(query) {
18264		var lowercaseQuery = angular.lowercase(query);
18265		return function filterFn(item) {
18266			return item.value.indexOf(lowercaseQuery) !== -1;
18267		};
18268	}
18269}
18270
18271},{}],102:[function(require,module,exports){
18272"use strict";
18273
18274module.exports = clearall;
18275
18276function clearall() {
18277	/* 
18278  * Directive: Clear All
18279  * Clears datepicker information
18280  * Because datepicker is a jquery plugin, we need to be able to
18281  *    clear its value using jquery. 
18282  */
18283
18284	return {
18285		restrict: "A",
18286		link: function link(scope, element, attrs, ngModelCtrl) {
18287			$(function () {
18288				element.click(function () {
18289					var $datePickers = $(this).parents(".item-list__drawer").find(".datepicker");
18290
18291					$datePickers.each(function () {
18292						if ($(this).datepicker("getDate")) {
18293							$(this).datepicker("setDate", null);
18294						}
18295						$(this).datepicker("option", "minDate", null);
18296						$(this).datepicker("option", "maxDate", null);
18297					});
18298
18299					var $radiusList = $(this).parents(".item-list__drawer").find(".js-event-radius");
18300					$radiusList.select2({
18301						data: { id: null, text: null },
18302						minimumResultsForSearch: -1,
18303						width: "100%" });
18304
18305					$(this).parents(".item-list__drawer").find("#ang-app-airports").val("");
18306				});
18307			});
18308		}
18309	};
18310}
18311
18312},{}],103:[function(require,module,exports){
18313"use strict";
18314
18315module.exports = datepickerbutton;
18316
18317function datepickerbutton() {
18318	/* 
18319  * Directive: datepickerbutton
18320  * Make a click on datepicker's sibling button trigger the picker
18321  */
18322	return {
18323		restrict: "A",
18324		link: function link(scope, element, attrs, ngModelCtrl) {
18325			$(function () {
18326				element.click(function () {
18327					$(this).siblings("input").datepicker("show");
18328				});
18329			});
18330		}
18331	};
18332}
18333
18334},{}],104:[function(require,module,exports){
18335"use strict";
18336
18337module.exports = datepickerend;
18338
18339function datepickerend() {
18340	/* 
18341  * Directive: datepickerend
18342  * Call datepicker on end date field
18343  * This directive also ascertains that when an end date is picked, the
18344  * start date cannot be later than the end date (onSelect function)
18345  */
18346
18347	return {
18348		restrict: "A",
18349		require: "ngModel",
18350		link: function link(scope, element, attrs, ngModelCtrl) {
18351			$(function () {
18352				element.datepicker({
18353					nextText: "<svg class=\"aopa-icon-button\"><use xlink:href=\"/dist/assets/svg-sprite.svg#righttriangle\"></use></svg>",
18354					prevText: "<svg class=\"aopa-icon-button\"><use xlink:href=\"/dist/assets/svg-sprite.svg#lefttriangle\"></use></svg>",
18355					onSelect: function onSelect(date) {
18356						var maxDate = new Date(Date.parse(date));
18357						$(this).parents("label").siblings(".item-list__datepicker-start").find(".datepicker").datepicker("option", "maxDate", maxDate);
18358						ngModelCtrl.$setViewValue(date);
18359						scope.$apply();
18360					},
18361					onClose: function onClose() {
18362						$(this).siblings("button").data("open", false);
18363					}
18364				});
18365			});
18366		}
18367	};
18368}
18369
18370},{}],105:[function(require,module,exports){
18371"use strict";
18372
18373module.exports = datepickerstart;
18374
18375function datepickerstart() {
18376	/* 
18377  * Directive: datepickerstart
18378  * Call datepicker on start date field
18379  * This directive also ascertains that when a start date is picked, the
18380  * end date cannot be earlier than the start date (onSelect function)
18381  */
18382
18383	return {
18384		restrict: "A",
18385		require: "ngModel",
18386		link: function link(scope, element, attrs, ngModelCtrl) {
18387			$(function () {
18388				element.datepicker({
18389					nextText: "<svg class=\"aopa-icon-button\"><use xlink:href=\"/dist/assets/svg-sprite.svg#righttriangle\"></use></svg>",
18390					prevText: "<svg class=\"aopa-icon-button\"><use xlink:href=\"/dist/assets/svg-sprite.svg#lefttriangle\"></use></svg>",
18391					onSelect: function onSelect(date) {
18392						var minDate = new Date(Date.parse(date));
18393						$(this).parents("label").siblings(".item-list__datepicker-end").find(".datepicker").datepicker("option", "minDate", minDate);
18394						ngModelCtrl.$setViewValue(date);
18395						scope.$apply();
18396					},
18397					onClose: function onClose() {
18398						$(this).siblings("button").data("open", false);
18399					}
18400				});
18401			});
18402		}
18403	};
18404}
18405
18406},{}],106:[function(require,module,exports){
18407"use strict";
18408
18409module.exports = popcontent;
18410
18411function popcontent() {
18412	/* 
18413  * Directive: popcontent
18414  * Handle any popup content (media gallery)
18415  */
18416	return {
18417		restrict: "A",
18418		link: function link(scope, element, attrs, ngModelCtrl) {
18419			$(function () {
18420				element.click(function (e) {
18421
18422					$("body").trigger("ooyala-player:stop");
18423
18424					var breakpoint = window.getComputedStyle(document.querySelector("body"), ":before").getPropertyValue("content").replace(/\"/g, "");
18425					var popcontent = $(this).find(".promo-grid__popcontent").html();
18426
18427					if (popcontent && !(breakpoint === "xx-small" || breakpoint === "x-small" || breakpoint === "small") || popcontent.indexOf("<img") > -1) {
18428
18429						e.stopPropagation();
18430						e.preventDefault();
18431
18432						var $modal = $("#modal");
18433						var popteaser = $(this).find(".promo-grid__teaser").length > 0 ? $(this).find(".promo-grid__teaser")[0].outerHTML : "";
18434						var poptitle = $(this).find(".promo-grid__title").length > 0 ? $(this).find(".promo-grid__title")[0].outerHTML : "";
18435
18436						if (!$modal.length) {
18437							$("body").append("<div id=\"modal\"></div>");
18438							$modal = $("#modal");
18439						}
18440
18441						$modal.addClass("modal--fade");
18442
18443						$modal.html("<div class=\"modal__close\"><svg><use xlink:href=\"/dist/assets/svg-sprite.svg#x\"></use></svg></div><div class=\"modal__content-wrapper\"><div class=\"modal__media-wrapper\">" + popcontent + "</div><div class=\"modal__text-wrapper\">" + poptitle + popteaser + "</div></div>");
18444
18445						addthis.update("share", "url", $("#modal .addthis_modal_sharing_toolbox").data("url"));
18446						addthis.toolbox(".addthis_modal_sharing_toolbox");
18447
18448						$(".modal__close").click(function () {
18449							$("#modal").removeClass("modal--fade");
18450							$("#modal").html("");
18451						});
18452
18453						$(".modal__content-wrapper").mCustomScrollbar({
18454							theme: "light-thick"
18455						});
18456					}
18457				});
18458			});
18459		}
18460	};
18461}
18462
18463},{}],107:[function(require,module,exports){
18464"use strict";
18465
18466module.exports = select2watcher;
18467
18468function select2watcher($timeout) {
18469	/* 
18470  * Directive: select2watcher
18471  * Updates select 2 value
18472  */
18473	return function (scope, element, attrs) {
18474		scope.$watch("radii", function () {
18475			$timeout(function () {
18476				$("select").trigger("change");
18477			});
18478		});
18479	};
18480}
18481
18482},{}],108:[function(require,module,exports){
18483"use strict";
18484
18485module.exports = showgrid;
18486
18487function showgrid() {
18488	/* 
18489  * Directive: showgrid
18490  * Class changes for grid view
18491  */
18492	return {
18493		restrict: "A",
18494		link: function link(scope, element) {
18495			$(function () {
18496				element.click(function () {
18497					$(".js-display-list").removeClass("is-active");
18498					$(this).addClass("is-active");
18499					$(this).parents(".item-list__results").removeClass("is-list");
18500				});
18501			});
18502		}
18503	};
18504}
18505
18506},{}],109:[function(require,module,exports){
18507"use strict";
18508
18509module.exports = showlist;
18510
18511function showlist() {
18512	/* 
18513  * Directive: showlist
18514  * Class changes for list view
18515  */
18516	return {
18517		restrict: "A",
18518		link: function link(scope, element) {
18519			$(function () {
18520				element.click(function () {
18521					$(".js-display-grid").removeClass("is-active");
18522					$(this).addClass("is-active");
18523					$(this).parents(".item-list__results").addClass("is-list");
18524				});
18525			});
18526		}
18527	};
18528}
18529
18530},{}],110:[function(require,module,exports){
18531"use strict";
18532
18533module.exports = slickSlider;
18534
18535function slickSlider() {
18536    return {
18537        restrict: "A",
18538        scope: { data: "=" },
18539        link: function link(scope, element, attrs) {
18540            var isInitialized = false;
18541            scope.$watch("data", function (newVal, oldVal) {
18542                if (newVal.length > 0 && !isInitialized) {
18543                    $(element).slick(scope.$eval(attrs.slickSlider));
18544                    isInitialized = true;
18545                }
18546            });
18547        }
18548    };
18549}
18550
18551},{}],111:[function(require,module,exports){
18552"use strict";
18553
18554module.exports = svgwatcher;
18555
18556function svgwatcher() {
18557	/* 
18558  * Directive: svgwatcher
18559  * Triggers SVG 4 Everybody on newly loaded items
18560  */
18561	return function (scope, element, attrs) {
18562		scope.$watch("items", function () {
18563			svg4everybody();
18564		});
18565	};
18566}
18567
18568},{}],112:[function(require,module,exports){
18569"use strict";
18570
18571module.exports = sanitize;
18572
18573function sanitize($sce) {
18574	return function (htmlCode) {
18575		return $sce.trustAsHtml(htmlCode);
18576	};
18577}
18578
18579},{}],113:[function(require,module,exports){
18580"use strict";
18581
18582var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
18583
18584var itemListController = _interopRequire(require("./controllers/itemListController"));
18585
18586var typeAhead = _interopRequire(require("./controllers/typeAhead"));
18587
18588var clearall = _interopRequire(require("./directives/clearall"));
18589
18590var datepickerbutton = _interopRequire(require("./directives/datepickerbutton"));
18591
18592var datepickerend = _interopRequire(require("./directives/datepickerend"));
18593
18594var datepickerstart = _interopRequire(require("./directives/datepickerstart"));
18595
18596var popcontent = _interopRequire(require("./directives/popcontent"));
18597
18598var select2watcher = _interopRequire(require("./directives/select2watcher"));
18599
18600var showlist = _interopRequire(require("./directives/showlist"));
18601
18602var showgrid = _interopRequire(require("./directives/showgrid"));
18603
18604var svgwatcher = _interopRequire(require("./directives/svgwatcher"));
18605
18606var slickSlider = _interopRequire(require("./directives/slickSlider"));
18607
18608var sanitize = _interopRequire(require("./filters/sanitize"));
18609
18610(function (angular) {
18611	"use strict";
18612
18613	var itemListApp = angular.module("AopaItemList", ["ngMaterial"]);
18614
18615	itemListApp.controller("itemListController", ["$scope", "$http", "$attrs", itemListController]);
18616	itemListApp.controller("typeAhead", ["$timeout", "$q", "$log", "$attrs", "$scope", typeAhead]);
18617
18618	itemListApp.directive("clearall", clearall);
18619	itemListApp.directive("datepickerbutton", datepickerbutton);
18620	itemListApp.directive("datepickerend", datepickerend);
18621	itemListApp.directive("datepickerstart", datepickerstart);
18622	itemListApp.directive("popcontent", popcontent);
18623	itemListApp.directive("select2watcher", ["$timeout", select2watcher]);
18624	itemListApp.directive("showlist", showlist);
18625	itemListApp.directive("showgrid", showgrid);
18626	itemListApp.directive("svgwatcher", svgwatcher);
18627	itemListApp.directive("slickSlider", slickSlider);
18628
18629	itemListApp.filter("sanitize", ["$sce", sanitize]);
18630})(window.angular);
18631
18632},{"./controllers/itemListController":100,"./controllers/typeAhead":101,"./directives/clearall":102,"./directives/datepickerbutton":103,"./directives/datepickerend":104,"./directives/datepickerstart":105,"./directives/popcontent":106,"./directives/select2watcher":107,"./directives/showgrid":108,"./directives/showlist":109,"./directives/slickSlider":110,"./directives/svgwatcher":111,"./filters/sanitize":112}],114:[function(require,module,exports){
18633"use strict";
18634
18635$(document).ready(function () {
18636    if ($("div#divJoinCheckoutControl").length) {
18637
18638        $(".btnCancel").click(function () {
18639            window.location.href = "https://www.aopa.org";
18640        });
18641
18642        $(".submitButtonMpf").click(function () {
18643            var form = $(this).closest("form");
18644            if (form.valid() && $("#FinalPrice").val() !== "Error") {
18645                $(this).hide();
18646                $(".clsSubmitButton").append("<div class=\"spinner spinner--clockwise\"></div>");
18647                form.submit();
18648            }
18649        });
18650
18651        $(".btnPage2Back").click(function () {
18652            window.location.href = $("#BackUrl").val();
18653        });
18654
18655        $("#Country").change(function () {
18656
18657            if ($("#RateCodeHelper").val().length && $("#SelectedRateCode").val().includes("_PRINT")) {
18658
18659                var option = $(this).find("option:selected").val();
18660
18661                $.getJSON("/api/JoinCheckoutRateHelper/Get/?country=" + option + "&rateCode=" + $("#SelectedRateCode").val() + "&rateHelper=" + $("#RateCodeHelper").val()).done(function (data) {
18662                    $("#Price").val("$" + parseFloat(data.price).toFixed(2));
18663                    $("#spPrice").html("$" + parseFloat(data.price).toFixed(2));
18664                    $("#spRateDescription").html(data.description);
18665                    $("#SelectedRateCode").val(data.rateCode);
18666                    var fa = parseFloat(data.price) - parseFloat($("#DiscountAmount").val());
18667                    $("#FinalPrice").val(fa.toFixed(0));
18668                    $("#join-total").html("$" + fa.toFixed(2));
18669                }).fail(function (jqXHR, textStatus, err) {
18670                    $("#Price").val("");
18671                    $("#spPrice").html("Error");
18672                    $("#FinalPrice").val("Error");
18673                    $("#spRateDescription").html("Error");
18674                    $("#join-total").html("Error");
18675                });
18676            }
18677        });
18678    }
18679});
18680
18681},{}],115:[function(require,module,exports){
18682"use strict";
18683
18684$(document).ready(function () {
18685    if ($("div#divLSPAttorneyInformation").length) {
18686        (function () {
18687            var SetSelected = function (theElement) {
18688                var sts = "";
18689
18690                $("#ul" + theElement + " li").each(function (i, li) {
18691                    if (sts.length) {
18692                        sts += "|" + $(li).text();
18693                    } else {
18694                        sts = $(li).text();
18695                    }
18696                });
18697
18698                $("#Lsp" + theElement).val(sts);
18699
18700                if (sts !== "") {
18701                    $("#div" + theElement).show();
18702                } else {
18703                    $("#div" + theElement).hide();
18704                }
18705            };
18706
18707            var SetSelectedPractice = function (stateprov) {
18708                var sts = "";
18709
18710                $("#ulPractice" + stateprov + " li").each(function (i, li) {
18711                    if (sts.length) {
18712                        sts += "|" + $(li).text();
18713                    } else {
18714                        sts = $(li).text();
18715                    }
18716                });
18717
18718                $("#LspPractice" + stateprov).val(sts);
18719
18720                if (sts !== "") {
18721                    $("#divPractice" + stateprov).show();
18722                } else {
18723                    $("#divPractice" + stateprov).hide();
18724                }
18725            };
18726
18727            $(".lsp-country-select").change(function () {
18728                var option = $(this).find("option:selected").val();
18729                var stateId = $(this).data("lsp-state");
18730
18731                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
18732                    $("#" + stateId).empty();
18733                    $.each(data, function (key, item) {
18734                        var $option = $("<option />");
18735                        $option.attr("value", item.value).text(item.text.replace("Error", "Select"));
18736                        $("#" + stateId).append($option);
18737                    });
18738                }).fail(function (jqXHR, textStatus, err) {
18739                    $("#" + stateId).empty();
18740                    var $option = $("<option />");
18741                    $options.attr("value", "").text("- Select -");
18742                    $("#" + stateId).append($option);
18743                });
18744            });
18745
18746            $(".add-action-clear").click(function () {
18747                $("#LspPracticeAreasTemp option:selected").removeAttr("selected");
18748                $("#LspPracticeStateTemp option:selected").removeAttr("selected");
18749                $("#LspFaaCertificationsTemp option:selected").removeAttr("selected");
18750            });
18751
18752            $(".add-action-button").click(function () {
18753                var theElement = $(this).data("add-element");
18754                $("#Lsp" + theElement + "Temp option:selected").each(function () {
18755                    var selval = $(this)[0].value;
18756
18757                    var exists = false;
18758                    var lis = document.getElementById("ul" + theElement).getElementsByTagName("li");
18759
18760                    for (var i = 0; i < lis.length; i++) {
18761                        if (lis[i].innerHTML.replace("&amp;", "&") === selval) {
18762                            exists = true;
18763                        }
18764                    }
18765
18766                    if (!exists) {
18767                        $("#ul" + theElement).append("<li data-add-element=\"" + theElement + "\">" + selval + "</li>");
18768                    }
18769                });
18770                $("#Lsp" + theElement + "Temp option:selected").removeAttr("selected");
18771                SetSelected(theElement);
18772            });
18773
18774            $(".add-action-ul").on("click", "li", function () {
18775                var theElement = $(this).data("add-element");
18776                $(this).remove();
18777                SetSelected(theElement);
18778            });
18779
18780            $("#btnPSAdd").click(function () {
18781                $("#LspPracticeStateTemp option:selected").each(function () {
18782                    var selval = $(this)[0].value.split("|");
18783
18784                    if (selval[0] === "USA") {
18785                        var exists = $("#ulPracticeStates li:contains(" + selval[1] + ")").length;
18786                        if (!exists) {
18787                            $("#ulPracticeStates").append("<li>" + selval[1] + "</li>");
18788                        }
18789                    } else {
18790                        var exists = $("#ulPracticeProvinces li:contains(" + selval[1] + ")").length;
18791                        if (!exists) {
18792                            $("#ulPracticeProvinces").append("<li>" + selval[1] + "</li>");
18793                        }
18794                    }
18795                });
18796                $("#LspPracticeStateTemp option:selected").removeAttr("selected");
18797                SetSelectedPractice("States");
18798                SetSelectedPractice("Provinces");
18799            });
18800
18801            $("#ulPracticeStates").on("click", "li", function () {
18802                $(this).remove();
18803                SetSelectedPractice("States");
18804            });
18805
18806            $("#ulPracticeProvinces").on("click", "li", function () {
18807                $(this).remove();
18808                SetSelectedPractice("Provinces");
18809            });
18810
18811            $(".alt-addr-button-add").click(function () {
18812                var theAlt = $(this).data("alt-addr");
18813
18814                $("#btn" + theAlt + "AddressAdd").hide();
18815                $("#btn" + theAlt + "AddressRemove").show();
18816                $("#div" + theAlt + "Address").show();
18817
18818                $("#" + theAlt + "AddressRemove").val("False");
18819            });
18820
18821            $(".alt-addr-button-remove").click(function () {
18822                var theAlt = $(this).data("alt-addr");
18823                $("#btn" + theAlt + "AddressAdd").show();
18824                $("#btn" + theAlt + "AddressRemove").hide();
18825                $("#div" + theAlt + "Address").hide();
18826
18827                if ($("#" + theAlt + "AddressId").val() !== "" && $("#" + theAlt + "AddressId").val() !== "0") {
18828                    $("#" + theAlt + "AddressRemove").val("True");
18829                } else {
18830                    $("#" + theAlt + "AddressId").val("");
18831                    $("#" + theAlt + "Address1").val("");
18832                    $("#" + theAlt + "Address2").val("");
18833                    $("#" + theAlt + "City").val("");
18834                    $("#" + theAlt + "Country").val("").change();
18835                    $("#" + theAlt + "PostalCode").val("");
18836                    $("#" + theAlt + "AddressRemove").val("False");
18837                }
18838            });
18839        })();
18840    }
18841});
18842
18843},{}],116:[function(require,module,exports){
18844"use strict";
18845
18846$(document).ready(function () {
18847    if ($("div#divLspEventRegistrationForm").length) {
18848        var data;
18849        var i;
18850
18851        (function () {
18852            var setTotal = function () {
18853                var data = JSON.parse(decodeURIComponent($("#OptionalData").val()));
18854                var total = parseFloat($("#PrimaryProductPrice").val());
18855
18856                $.each(data, function () {
18857                    if (this.sel) {
18858                        total = total + this.pr;
18859                    }
18860                });
18861
18862                $(".event-payment-total__price").html("$" + total.toFixed(2));
18863                $("#OrderTotal").val(total);
18864            };
18865
18866            //
18867            // Reset the dynamic fields on page load
18868            //
18869            data = JSON.parse(decodeURIComponent($("#OptionalData").val()));
18870
18871            for (i = 0; i < data.length; i++) {
18872                if (!data[i].sel) {
18873                    $("#oicb" + data[i].pid).prop("checked", false);
18874
18875                    $(".event-payment-oi__" + data[i].pid).hide();
18876                    if (data[i].hass) {
18877                        $("#oi__" + data[i].pid).attr("disabled", "disabled");
18878
18879                        $("#oi__" + data[i].pid + " option[value=\"" + data[i].selr + "\"]").prop("selected", "selected");
18880                    }
18881                }
18882            }
18883
18884            $("input.checkbox.oicb").change(function () {
18885                var data = JSON.parse(decodeURIComponent($("#OptionalData").val()));
18886                var pid = this.id.replace("oicb", "");
18887                var idx = -1;
18888                var ct = 0;
18889
18890                $.each(data, function () {
18891                    if (this.pid.toString() === pid) {
18892                        idx = ct;
18893                        return false;
18894                    }
18895                    ct++;
18896                });
18897
18898                if (idx != -1) {
18899                    if ($(this).is(":checked")) {
18900                        data[idx].sel = true;
18901                        $(".event-payment-oi__" + pid).show();
18902                        if (data[idx].hass) {
18903                            $("#oi__" + pid).removeAttr("disabled");
18904                        }
18905                    } else {
18906                        data[idx].sel = false;
18907                        $(".event-payment-oi__" + pid).hide();
18908                        if (data[idx].hass) {
18909                            $("#oi__" + pid).attr("disabled", "disabled");
18910                        }
18911                    }
18912                }
18913
18914                $("#OptionalData").val(encodeURIComponent(JSON.stringify(data)));
18915                setTotal();
18916            });
18917
18918            $(".oisb").change(function () {
18919                var data = JSON.parse(decodeURIComponent($("#OptionalData").val()));
18920                var pid = this.id.replace("oi__", "");
18921                var idx = -1;
18922                var ct = 0;
18923
18924                $.each(data, function () {
18925                    if (this.pid.toString() === pid) {
18926                        idx = ct;
18927                        return false;
18928                    }
18929                    ct++;
18930                });
18931
18932                if (idx != -1) {
18933                    data[idx].selr = this.value;
18934                }
18935
18936                $("#OptionalData").val(encodeURIComponent(JSON.stringify(data)));
18937            });
18938
18939            if ($("div#divLspRegisterButton").length) {
18940                $(".lspRegisterButton").click(function () {
18941                    var form = $(this).closest("form");
18942                    if (form.valid()) {
18943                        $(this).hide();
18944                        $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
18945                    }
18946                });
18947            }
18948        })();
18949    }
18950});
18951
18952},{}],117:[function(require,module,exports){
18953"use strict";
18954
18955$(document).ready(function () {
18956    if ($("div#divAOPAMedicalInformationUpdate").length) {
18957        (function () {
18958            var setDate = function () {
18959                var mt = $("#SelectedMedicalCode").find("option:selected").val();
18960
18961                if (mt !== "") {
18962                    var issDt = Date.parse($("#IssuanceDate").val());
18963
18964                    if (!isNaN(issDt)) {
18965                        var birDt = Date.parse($("#BirthDate").val());
18966
18967                        var bD;
18968                        if (!isNaN(birDt)) {
18969                            bD = $("#BirthDate").val();
18970                        } else {
18971                            bD = "1/1/0001";
18972                        }
18973
18974                        $.getJSON("/api/MedicalExpire/Get/?medicalType=" + mt + "&birthDate=" + bD + "&issueDate=" + $("#IssuanceDate").val()).done(function (data) {
18975                            $("#spCalcExpire").text(data);
18976                        }).fail(function (jqXHR, textStatus, err) {
18977                            $("#spCalcExpire").text("--/--/----");
18978                        });
18979                    } else {
18980                        $("#spCalcExpire").text("--/--/----");
18981                    }
18982                } else {
18983                    $("#spCalcExpire").text("--/--/----");
18984                }
18985            };
18986
18987            $("#BirthDate").datepicker({
18988                changeMonth: true,
18989                changeYear: true
18990            });
18991            $("#IssuanceDate").datepicker({
18992                changeMonth: true,
18993                changeYear: true
18994            });
18995            $("#UserExpireDate").datepicker({
18996                changeMonth: true,
18997                changeYear: true
18998            });
18999
19000            $("#BirthDate").change(function () {
19001                setDate();
19002            });
19003
19004            $("#IssuanceDate").change(function () {
19005                setDate();
19006            });
19007
19008            $("#SelectedMedicalCode").change(function () {
19009                setDate();
19010            });
19011        })();
19012    }
19013});
19014
19015},{}],118:[function(require,module,exports){
19016"use strict";
19017
19018$(document).ready(function () {
19019    if ($("div#divMembershipUpgradeV3").length) {
19020        var theForm = $("#frmMembershipUpgradeV3");
19021
19022        var ufStripe = Stripe($("#sapik").val());
19023
19024        var ufElements = ufStripe.elements();
19025        var ufStyle = {
19026            base: {
19027                backgroundColor: "#ffffff",
19028                fontSize: "0.9375rem",
19029                fontFamily: "Roboto, Helvetica Neue, sans-serif",
19030                lineHeight: "42px",
19031                ":focus": {
19032                    border: "10px solid black"
19033                }
19034            }
19035        };
19036        var ufCardElement = ufElements.create("card", { style: ufStyle, hidePostalCode: true, disableLink: true });
19037        ufCardElement.mount("#card-element");
19038
19039        ufCardElement.on("change", function (event) {
19040            var displayError = document.getElementById("card-errors");
19041            if (event.error) {
19042                displayError.textContent = event.error.message;
19043            } else {
19044                displayError.textContent = "";
19045            }
19046
19047            $("#CardBrand").val(event.brand);
19048        });
19049
19050        $("input[name=SelectedPpsOption]").on("change", function () {
19051            var ppsAnnualOptions = JSON.parse($("#divPpsAnnualOptions").text());
19052
19053            var ppsSelected = $("input[name=SelectedPpsOption]:checked").val();
19054
19055            var selectedPpsOption;
19056
19057            ppsAnnualOptions.forEach(function (item) {
19058                if (item.productCode === ppsSelected) {
19059                    selectedPpsOption = item;
19060                }
19061            });
19062
19063            $("#divUpgradePpsSummaryText").html(selectedPpsOption.summaryDescription);
19064            $("#divUpgradePpsPrice").html("$" + selectedPpsOption.price.toFixed(2));
19065            $("#spDueToday").html("$" + selectedPpsOption.proratedPrice.toFixed(2));
19066            $("#OrderTotal").html("$" + selectedPpsOption.proratedPrice.toFixed(2));
19067
19068            var total = 0;
19069
19070            total += parseFloat($("#UpgradedCostNoPps").val(), 10);
19071            total += selectedPpsOption.price;
19072            $("#divRenewalTotal").html("$" + total.toFixed(2));
19073
19074            $(".aopa-annual-membership-price").html("$" + total.toFixed(2));
19075            $("input[type=\"checkbox\"][id=\"IncludeAar\"]").prop("checked", false).change();
19076        });
19077
19078        $("#ShowPayment").change(function () {
19079            if ($(this).is(":checked")) {
19080                $("#divPayment").css({ visibility: "visible" });
19081                $("#divPayment").css({ display: "block" });
19082            } else {
19083                $("#divPayment").css({ visibility: "hidden" });
19084                $("#divPayment").css({ display: "none" });
19085            }
19086        });
19087
19088        $("#IncludeAar").change(function () {
19089            if (this.checked) {
19090                $("#divRenewalAutoRenewal").html("YES");
19091            } else {
19092                $("#divRenewalAutoRenewal").html("NO");
19093            }
19094        });
19095
19096        var checkCardFields = function () {
19097            var isValid = false;
19098
19099            if ($("#ShowPayment").val() === "True") {
19100                var cardElement = document.querySelector("#card-element");
19101
19102                isValid = cardElement.classList.contains("StripeElement--complete");
19103
19104                var brand = $("#CardBrand").val();
19105
19106                if (isValid && (brand === "visa" || brand === "mastercard" || brand === "amex" || brand === "discover")) {
19107                    $("#card-errors").html("");
19108                } else {
19109                    if ($("#card-errors").is(":empty")) {
19110                        $("#card-errors").html("Please check your credit card information.");
19111                    }
19112                }
19113            } else {
19114                isValid = true;
19115            }
19116
19117            return isValid;
19118        };
19119
19120        $(".submitButtonUFV3").click(function () {
19121            var ccValid = checkCardFields();
19122
19123            var progressBar = new Sfpb_progressBar();
19124
19125            if (theForm.valid() && ccValid) {
19126                $(this).hide();
19127                $("body").addClass("progressbar-modal");
19128                progressBar.start();
19129                $(".clsSubmitButton").append("<div class=\"spinner spinner--clockwise\"></div>");
19130
19131                if ($("#ShowPayment").val() === "True") {
19132                    ufStripe.createToken(ufCardElement, { name: $("#CardName").val() }).then(function (result) {
19133                        if (result.token !== null) {
19134                            $("#CardToken").val(JSON.stringify(result.token));
19135                            theForm.submit();
19136                        } else {
19137                            if ($("#card-errors").is(":empty")) {
19138                                $("#card-errors").html("Please check your credit card information.");
19139                            }
19140                            var spinner = document.getElementById("aopaSpinner");
19141                            spinner.parentElement.removeChild(spinner);
19142                            $(this).show();
19143                            progressBar.kill();
19144                            $("body").removeClass("progressbar-modal");
19145                            $(this).show();
19146                        }
19147                    });
19148                } else {
19149                    theForm.submit();
19150                }
19151            } else {
19152                var firstInstance = $(".input-validation-error").first();
19153                var offsetTop = firstInstance.offset().top - 100;
19154
19155                $("html, body").animate({
19156                    scrollTop: offsetTop
19157                }, 500);
19158            }
19159        });
19160    }
19161});
19162
19163},{}],119:[function(require,module,exports){
19164"use strict";
19165
19166$(document).ready(function () {
19167    if ($("div#divNewsletterSignup").length) {
19168        var theForm = $("#frmNewsletterSignup");
19169        $("#btnSubmit").click(function () {
19170            if (theForm.valid()) {
19171                $("#btnSubmit").hide();
19172                $(this).hide();
19173                $(".clsSubmitButton").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
19174                theForm.submit();
19175            } else {
19176                var firstInstance = $(".input-validation-error").first();
19177                var offsetTop = firstInstance.offset().top - 100;
19178
19179                $("html, body").animate({
19180                    scrollTop: offsetTop
19181                }, 500);
19182            }
19183        });
19184    }
19185});
19186
19187},{}],120:[function(require,module,exports){
19188"use strict";
19189
19190$(document).ready(function () {
19191    if ($("div#divOneClickDonation").length) {
19192        (function () {
19193            var specialText = function () {
19194                if ($("#GiftSpecialList").val() !== "") {
19195                    var sel = $("input[name=SelectedDonationAmount]:checked").val().split("|");
19196                    if ($("#GiftSpecialList").val().indexOf(sel[0]) >= 0) {
19197                        $("#divSpecialGift").css({ visibility: "visible" });
19198                        $("#divSpecialGift").css({ display: "block" });
19199                    } else {
19200                        $("#divSpecialGift").css({ visibility: "hidden" });
19201                        $("#divSpecialGift").css({ display: "none" });
19202                    }
19203                }
19204            };
19205
19206            var fixPremiums = function () {
19207                var $option;
19208                if ($("#HasPremiumsAvailable").val().toUpperCase() === "TRUE" && $("#ShowPremiumList").val().toUpperCase() === "TRUE") {
19209                    if ($("input[name=AcceptPremium]:checked").val() !== "true") {
19210                        $("#divPremium").css({ visibility: "hidden" });
19211                        $("#divPremium").css({ display: "none" });
19212                        $("#SelectedPremiumItem").val($("#SelectedPremiumItem option:last-child").val());
19213                        $("#SelectedPremiumRateCode").empty();
19214                        $option = $("<option />");
19215                        $option.attr("value", "x").text("x");
19216                        $("#SelectedPremiumRateCode").append($option);
19217                        $("#SelectedPremiumRateCode").val("x");
19218                    } else {
19219                        $("#divPremium").css({ visibility: "visible" });
19220                        $("#divPremium").css({ display: "block" });
19221                        $("#SelectedPremiumItem").val("");
19222                        $("#SelectedPremiumRateCode").empty();
19223                        $option = $("<option />");
19224                        $option.attr("value", "").text($("#PremiumRateSelect").val());
19225                        $("#SelectedPremiumRateCode").append($option);
19226                        $("#SelectedPremiumRateCode").val("");
19227                    }
19228                }
19229            };
19230
19231            var calculateTotal = function () {
19232                var use1 = true;
19233
19234                if ($("#ShowDonationSelector").val() === "True") {
19235                    var option = $("input[name=SelectedDonationSelector]:checked").val().split("|");
19236                    if (option[0] == "2") {
19237                        use1 = false;
19238                    }
19239                }
19240
19241                if (use1) {
19242                    if ($("#DonationType").val() !== "Pledge") {
19243                        if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
19244                            var amount = $("input[name=SelectedDonationAmount]:checked").val().split("|");
19245                            $("#PaymentTotal").val(parseFloat(amount[1], 10).toFixed(2));
19246                            $("#DonationTotal").val(parseFloat(amount[1], 10).toFixed(2));
19247                        } else {
19248                            if ($.isNumeric($("#MinimumDonationAmount").val())) {
19249                                $("#PaymentTotal").val(parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2));
19250                                $("#DonationTotal").val(parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2));
19251                            } else {
19252                                $("#PaymentTotal").val(0);
19253                                $("#DonationTotal").val(0);
19254                            }
19255                        }
19256                    } else {
19257                        var selectedAmount = 0;
19258
19259                        if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
19260                            var amount = $("input[name=SelectedDonationAmount]:checked").val().split("|");
19261                            selectedAmount = parseFloat(amount[1], 10).toFixed(2);
19262                        } else {
19263                            if ($.isNumeric($("#MinimumDonationAmount").val())) {
19264                                selectedAmount = parseFloat($("#MinimumDonationAmount").val(), 10).toFixed(2);
19265                            } else {
19266                                selectedAmount = 0;
19267                            }
19268                        }
19269
19270                        $("#DonationTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
19271
19272                        switch ($("input[name=SelectedDonationFrequency]:checked").val()) {
19273                            case "IMMEDIATE":
19274                                $("#PaymentTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
19275                                break;
19276                            case "MONTHLY":
19277                                selectedAmount = selectedAmount / 12;
19278                                $("#PaymentTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
19279                                break;
19280                            case "QUARTERLY":
19281                                selectedAmount = selectedAmount / 4;
19282                                $("#PaymentTotal").val(parseFloat(selectedAmount, 10).toFixed(2));
19283                                break;
19284                        }
19285
19286                        var totaltext = "$" + parseFloat(selectedAmount, 10).toFixed(2).toLocaleString();
19287                        $("#divPaymentAmount").html($.parseHTML(totaltext));
19288                    }
19289                } else {
19290                    if ($("input[name=SelectedDonationAmount2]:checked").val() !== "OTHER|0") {
19291                        var amount = $("input[name=SelectedDonationAmount2]:checked").val().split("|");
19292                        $("#PaymentTotal").val(parseFloat(amount[1], 10).toFixed(2));
19293                        $("#DonationTotal").val(parseFloat(amount[1], 10).toFixed(2));
19294                    } else {
19295                        if ($.isNumeric($("#MinimumDonationAmount2").val())) {
19296                            $("#PaymentTotal").val(parseFloat($("#MinimumDonationAmount2").val(), 10).toFixed(2));
19297                            $("#DonationTotal").val(parseFloat(amount[1], 10).toFixed(2));
19298                        } else {
19299                            $("#PaymentTotal").val(parseFloat($("#MinimumDonationAmount2").val(), 10).toFixed(2));
19300                            $("#DonationTotal").val(0);
19301                        }
19302                    }
19303                }
19304            };
19305
19306            var appealPremiumsUpdate = function () {
19307                var total = parseFloat($("#DonationTotal").val(), 10);
19308                var hasQualPremiums = false;
19309                var qualVal = 0;
19310
19311                for (var i = 1; i <= 3; i++) {
19312                    if ($("#OfferPremium" + i + "QualValue").val()) {
19313                        qualVal = parseFloat($("#OfferPremium" + i + "QualValue").val(), 10);
19314                        if (qualVal <= total) {
19315                            hasQualPremiums = true;
19316                            $(".divAppealPremiumItem" + i).show();
19317                            $("#OfferPremium" + i + "Show").val("True");
19318                        } else {
19319                            $(".divAppealPremiumItem" + i).hide();
19320                            $("#OfferPremium" + i + "Show").val("False");
19321                        }
19322                    } else {
19323                        $(".divAppealPremiumItem" + i).hide();
19324                        $("#OfferPremium" + i).prop("checked", false);
19325                        $("#OfferPremium" + i + "Show").val("False");
19326                    }
19327                }
19328
19329                if (hasQualPremiums) {
19330                    $(".divAppealPremium").show();
19331                } else {
19332                    $(".divAppealPremium").hide();
19333                }
19334
19335                $("#hasQualifiedOfferPremium").val(hasQualPremiums);
19336            };
19337
19338            if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
19339                $("#divOtherAmount").css({ visibility: "hidden" });
19340                $("#divOtherAmount").css({ display: "none" });
19341            } else {
19342                $("#divOtherAmount").css({ visibility: "visible" });
19343                $("#divOtherAmount").css({ display: "block" });
19344            }
19345
19346            if ($("input[name=SelectedDonationAmount2]:checked").val() !== "OTHER|0") {
19347                $("#divOtherAmount2").css({ visibility: "hidden" });
19348                $("#divOtherAmount2").css({ display: "none" });
19349            } else {
19350                $("#divOtherAmount2").css({ visibility: "visible" });
19351                $("#divOtherAmount2").css({ display: "block" });
19352            }
19353
19354            specialText();
19355
19356            fixPremiums();
19357
19358            $("input[name=AcceptPremium]").on("change", function () {
19359                fixPremiums();
19360            });
19361
19362            $("#SelectedPremiumItem").change(function () {
19363                var option = $(this).find("option:selected").val().split("|");
19364                $.getJSON("/api/OneClickPremium/Get/?productId=" + option[0]).done(function (data) {
19365                    $("#SelectedPremiumRateCode").empty();
19366                    var $option = $("<option />");
19367                    $option.attr("value", "").text($("#PremiumRateSelect").val());
19368                    $("#SelectedPremiumRateCode").append($option);
19369                    $.each(data, function (key, item) {
19370                        var $option = $("<option />");
19371                        $option.attr("value", item.value).text(item.text);
19372                        $("#SelectedPremiumRateCode").append($option);
19373                    });
19374                }).fail(function (jqXHR, textStatus, err) {
19375                    $("#SelectedPremiumRateCode").empty();
19376                    var $option = $("<option />");
19377                    $options.attr("value", "").text("- Error -");
19378                    $("#SelectedPremiumRateCode").append($option);
19379                });
19380            });
19381
19382            $(".donateButton").click(function () {
19383                var form = $(this).closest("form");
19384                if (form.valid()) {
19385                    $(this).hide();
19386                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
19387                }
19388            });
19389
19390            $("#SelectedCountry").change(function () {
19391                var option = $(this).find("option:selected").val();
19392                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
19393                    $("#SelectedState").empty();
19394                    $.each(data, function (key, item) {
19395                        var $option = $("<option />");
19396                        $option.attr("value", item.value).text(item.text);
19397                        $("#SelectedState").append($option);
19398                    });
19399                }).fail(function (jqXHR, textStatus, err) {
19400                    $("#SelectedState").empty();
19401                    var $option = $("<option />");
19402                    $options.attr("value", "").text("- Error -");
19403                    $("#SelectedState").append($option);
19404                });
19405            });
19406
19407            $("#KeyCodeEntered").focusout(function () {
19408                $.getJSON("/api/DonationAppealOffer/Get/?keycode=" + $(this).val()).done(function (data) {
19409                    if (data.keyCode) {
19410                        $("#KeyCode").val(data.keyCode);
19411                        $("#ListCode").val(data.listCode);
19412                        $("#MarketCode").val(data.marketCode);
19413
19414                        $(".divAppealPremiumItem" + i).hide();
19415
19416                        if (data.premiums) {
19417                            $.each(data.premiums, function (i, prem) {
19418                                var x = i + 1;
19419                                $("#OfferPremium" + x).prop("checked", true);
19420                                $("#OfferPremium" + x + "Disclaimer").val(prem.disclaimer);
19421                                $("#OfferPremium" + x + "Value").val(prem.productId);
19422                                $("#OfferPremium" + x + "QualValue").val(prem.qualifyingAmount);
19423                                $("#OfferPremium" + x + "Show").val("True");
19424
19425                                $(".spOfferPremium" + x + "Text").html(prem.productName);
19426                            });
19427                            for (var i = 1; i <= 3; i++) {
19428                                if (!$("#OfferPremium" + i + "Value").val()) {
19429                                    $("#OfferPremium" + i).prop("checked", false);
19430                                    $("#OfferPremium" + i + "Disclaimer").val("");
19431                                    $("#OfferPremium" + i + "Value").val("");
19432                                    $("#OfferPremium" + i + "QualValue").val("");
19433                                    $("#OfferPremium" + i + "Show").val("False");
19434                                    $(".spOfferPremium" + i + "Text").html("");
19435                                }
19436                            }
19437                        } else {
19438                            for (var i = 1; i <= 3; i++) {
19439                                $("#OfferPremium" + i).prop("checked", false);
19440                                $("#OfferPremium" + i + "Disclaimer").val("");
19441                                $("#OfferPremium" + i + "Value").val("");
19442                                $("#OfferPremium" + i + "QualValue").val("");
19443                                $("#OfferPremium" + i + "Show").val("False");
19444                                $(".spOfferPremium" + i + "Text").html("");
19445                            }
19446                        }
19447
19448                        appealPremiumsUpdate();
19449                    } else {
19450                        $("#KeyCodeEntered").val($("#KeyCode").val());
19451                    }
19452                }).fail(function (jqXHR, textStatus, err) {
19453                    $("#KeyCodeEntered").val($("#KeyCode").val());
19454                });
19455            });
19456
19457            $("input[name=SelectedDonationAmount]").on("change", function () {
19458                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
19459                    if ($("#MinimumDonationAmount").length) {
19460                        $("#MinimumDonationAmount").val("");
19461                        $("#MinimumDonationAmount").valid();
19462                        $("#MinimumDonationAmount").prop("disabled", true);
19463                        $("#divOtherAmount").css({ visibility: "hidden" });
19464                        $("#divOtherAmount").css({ display: "none" });
19465                    }
19466                } else {
19467                    $("#MinimumDonationAmount").prop("disabled", false);
19468                    $("#divOtherAmount").css({ visibility: "visible" });
19469                    $("#divOtherAmount").css({ display: "block" });
19470                }
19471                calculateTotal();
19472                specialText();
19473                appealPremiumsUpdate();
19474            });
19475
19476            $("input[name=SelectedDonationAmount2]").on("change", function () {
19477                if ($("input[name=SelectedDonationAmount2]:checked").val() !== "OTHER|0") {
19478                    if ($("#MinimumDonationAmount2").length) {
19479                        $("#MinimumDonationAmount2").val("");
19480                        $("#MinimumDonationAmount2").valid();
19481                        $("#MinimumDonationAmount2").prop("disabled", true);
19482                        $("#divOtherAmount2").css({ visibility: "hidden" });
19483                        $("#divOtherAmount2").css({ display: "none" });
19484                    }
19485                } else {
19486                    $("#MinimumDonationAmount2").prop("disabled", false);
19487                    $("#divOtherAmount2").css({ visibility: "visible" });
19488                    $("#divOtherAmount2").css({ display: "block" });
19489                }
19490                calculateTotal();
19491                specialText();
19492                appealPremiumsUpdate();
19493            });
19494
19495            $("input[name=SelectedRedirectAmount]").on("change", function () {
19496                var theValue = $("input[name=SelectedRedirectAmount]:checked").val();
19497                $("input[name=SelectedRedirectAmount]").prop("checked", false);
19498                if ($("#DonateRedirectForm").val().indexOf("?") >= 0) {
19499                    window.location.href = $("#DonateRedirectForm").val() + "&dra=" + theValue;
19500                } else {
19501                    window.location.href = $("#DonateRedirectForm").val() + "?dra=" + theValue;
19502                }
19503            });
19504
19505            $("input[name=SelectedDonationFrequency]").on("change", function () {
19506                calculateTotal();
19507            });
19508
19509            $("input[name=MinimumDonationAmount]").on("change", function () {
19510                if ($("input[name=SelectedDonationAmount]:checked").val() === "OTHER|0") {
19511                    calculateTotal();
19512                    appealPremiumsUpdate();
19513                }
19514            });
19515
19516            $("input[name=MinimumDonationAmount2]").on("change", function () {
19517                if ($("input[name=SelectedDonationAmount2]:checked").val() === "OTHER|0") {
19518                    calculateTotal();
19519                    appealPremiumsUpdate();
19520                }
19521            });
19522
19523            $("input[name=SelectedDonationSelector]").on("change", function () {
19524                var option = $("input[name=SelectedDonationSelector]:checked").val().split("|");
19525                if (option[0] == "1") {
19526                    $("#donate1").css({ visibility: "visible" });
19527                    $("#donate1").css({ display: "block" });
19528                    $("#donate2").css({ visibility: "hidden" });
19529                    $("#donate2").css({ display: "none" });
19530                } else {
19531                    $("#donate1").css({ visibility: "hidden" });
19532                    $("#donate1").css({ display: "none" });
19533                    $("#donate2").css({ visibility: "visible" });
19534                    $("#donate2").css({ display: "block" });
19535                }
19536                calculateTotal();
19537                appealPremiumsUpdate();
19538            });
19539        })();
19540    }
19541});
19542
19543},{}],121:[function(require,module,exports){
19544"use strict";
19545
19546$(document).ready(function () {
19547    if ($("div#divOneClickDonationCombined").length) {
19548        (function () {
19549            var calculateTotal = function () {
19550                var theType = "REGULAR";
19551                var theAmount = 0;
19552                var thePayments = 1;
19553
19554                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER") {
19555                    var data = $("input[name=SelectedDonationAmount]:checked").val().split("|");
19556                    theType = data[1];
19557                    theAmount = data[0];
19558
19559                    if (data[1] === "PLEDGE") {
19560                        var info = $("input[name=SelectedPledgeDonationFrequency]:checked").val().split("|");
19561                        thePayments = info[1];
19562                    }
19563                } else {
19564                    var data = JSON.parse($("#OtherAmountsString").val());
19565
19566                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19567                        theAmount = parseInt($("#MinimumDonationAmount").val());
19568                        $.each(data, function () {
19569                            if (this.otherMinimum <= theAmount && this.otherMaximum > theAmount) {
19570                                theType = this.amountType;
19571
19572                                if (this.amountType === "PLEDGE") {
19573                                    var info = $("input[name=SelectedPledgeDonationFrequency]:checked").val().split("|");
19574                                    thePayments = info[1];
19575                                }
19576                            }
19577                        });
19578                    }
19579                }
19580
19581                $("#PaymentTotal").val(parseFloat(theAmount / thePayments, 10).toFixed(2));
19582                $("#DonationTotal").val(parseFloat(theAmount).toFixed(2));
19583                $("#divPaymentAmount").html("$" + parseFloat(theAmount / thePayments, 10).toFixed(2));
19584            };
19585
19586            var appealPremiumsUpdate = function () {
19587                var total = parseFloat($("#DonationTotal").val(), 10);
19588                var hasQualPremiums = false;
19589                var qualVal = 0;
19590
19591                for (var i = 1; i <= 3; i++) {
19592                    if ($("#OfferPremium" + i + "QualValue").val()) {
19593                        qualVal = parseFloat($("#OfferPremium" + i + "QualValue").val(), 10);
19594                        if (qualVal <= total) {
19595                            hasQualPremiums = true;
19596                            $(".divAppealPremiumItem" + i).show();
19597                            $("#OfferPremium" + i + "Show").val("True");
19598                        } else {
19599                            $(".divAppealPremiumItem" + i).hide();
19600                            $("#OfferPremium" + i + "Show").val("False");
19601                        }
19602                    } else {
19603                        $(".divAppealPremiumItem" + i).hide();
19604                        $("#OfferPremium" + i).prop("checked", false);
19605                        $("#OfferPremium" + i + "Show").val("False");
19606                    }
19607                }
19608
19609                if (hasQualPremiums) {
19610                    $(".divAppealPremium").show();
19611                } else {
19612                    $(".divAppealPremium").hide();
19613                }
19614                $("#hasQualifiedOfferPremium").val(hasQualPremiums);
19615            };
19616
19617            var fixFrequency = function (valSelected) {
19618                if (valSelected !== "OTHER") {
19619                    var data = valSelected.split("|");
19620
19621                    if (data[1] === "REGULAR") {
19622                        $(".occ-frequency-selection[data-freq-type=\"REGULAR\"]").show();
19623                        $(".occ-frequency-selection[data-freq-type=\"PLEDGE\"]").hide();
19624                    }
19625                    if (data[1] === "PLEDGE") {
19626                        $(".occ-frequency-selection[data-freq-type=\"REGULAR\"]").hide();
19627                        $(".occ-frequency-selection[data-freq-type=\"PLEDGE\"]").show();
19628                    }
19629                } else {
19630                    var data = JSON.parse($("#OtherAmountsString").val());
19631
19632                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19633                        var amount = parseInt($("#MinimumDonationAmount").val());
19634
19635                        $.each(data, function () {
19636
19637                            if (this.otherMinimum <= amount && this.otherMaximum > amount) {
19638                                if (this.amountType === "REGULAR") {
19639                                    $(".occ-frequency-selection[data-freq-type=\"REGULAR\"]").show();
19640                                    $(".occ-frequency-selection[data-freq-type=\"PLEDGE\"]").hide();
19641                                }
19642                                if (this.amountType === "PLEDGE") {
19643                                    $(".occ-frequency-selection[data-freq-type=\"REGULAR\"]").hide();
19644                                    $(".occ-frequency-selection[data-freq-type=\"PLEDGE\"]").show();
19645                                }
19646                            }
19647                        });
19648                    } else {
19649                        $(".occ-frequency-selection[data-freq-type=\"REGULAR\"]").show();
19650                        $(".occ-frequency-selection[data-freq-type=\"PLEDGE\"]").hide();
19651                    }
19652                }
19653            };
19654
19655            var fixAdditionalText = function (valSelected) {
19656                if (valSelected !== "OTHER") {
19657                    var data = valSelected.split("|");
19658
19659                    $(".occ-addtional-text-wrapper").each(function () {
19660                        if ($(this).data("text-type") === data[2]) {
19661                            $(this).show();
19662                        } else {
19663                            $(this).hide();
19664                        }
19665                    });
19666                } else {
19667                    var data = JSON.parse($("#OtherAmountsString").val());
19668
19669                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19670                        var amount = parseInt($("#MinimumDonationAmount").val());
19671
19672                        $.each(data, function () {
19673                            if (this.otherMinimum <= amount && this.otherMaximum > amount) {
19674                                var theData = this;
19675                                $(".occ-addtional-text-wrapper").each(function () {
19676                                    if ($(this).data("text-type") === theData.additionalTextType) {
19677                                        $(this).show();
19678                                    } else {
19679                                        $(this).hide();
19680                                    }
19681                                });
19682                            }
19683                        });
19684                    } else {}
19685                }
19686            };
19687
19688            var fixProductPremiums = function (valSelected) {
19689                if (valSelected !== "OTHER") {
19690                    var data = valSelected.split("|");
19691
19692                    $(".occ-product-premium-wrapper").each(function () {
19693                        if ($(this).data("prem-section") === data[3]) {
19694                            $(this).show();
19695                        } else {
19696                            $(this).hide();
19697                        }
19698                    });
19699                } else {
19700                    var data = JSON.parse($("#OtherAmountsString").val());
19701
19702                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19703                        var amount = parseInt($("#MinimumDonationAmount").val());
19704
19705                        $.each(data, function () {
19706                            if (this.otherMinimum <= amount && this.otherMaximum > amount) {
19707                                var theData = this;
19708                                $(".occ-product-premium-wrapper").each(function () {
19709                                    if ($(this).data("prem-section") === theData.premiumSectionType) {
19710                                        $(this).show();
19711                                    } else {
19712                                        $(this).hide();
19713                                    }
19714                                });
19715                            }
19716                        });
19717                    } else {
19718                        $(".occ-product-premium-wrapper").hide();
19719                    }
19720                }
19721            };
19722
19723            var fixDonationAmount = function (valSelected) {
19724                if (valSelected !== "OTHER") {
19725                    var data = valSelected.split("|");
19726
19727                    if (data[1] === "REGULAR") {
19728                        $(".occ-donation-type-pledge").hide();
19729                    } else {
19730                        $(".occ-donation-type-pledge").show();
19731                    }
19732                } else {
19733                    var data = JSON.parse($("#OtherAmountsString").val());
19734
19735                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19736                        var amount = parseInt($("#MinimumDonationAmount").val());
19737
19738                        $.each(data, function () {
19739                            if (this.otherMinimum <= amount && this.otherMaximum > amount) {
19740                                if (this.amountType === "REGULAR") {
19741                                    $(".occ-donation-type-pledge").hide();
19742                                } else {
19743                                    $(".occ-donation-type-pledge").show();
19744                                }
19745                            }
19746                        });
19747                    } else {
19748                        $(".occ-donation-type-pledge").hide();
19749                    }
19750                }
19751            };
19752
19753            $("input[name=AcceptPremium]").on("change", function () {
19754                var $option;
19755                if ($("#HasPremiumsAvailable").val().toUpperCase() === "TRUE" && $("#ShowPremiumList").val().toUpperCase() === "TRUE") {
19756                    if ($("input[name=AcceptPremium]:checked").val() !== "true") {
19757                        $("#divPremium").hide();
19758                    } else {
19759                        $("#divPremium").show();
19760                    }
19761                }
19762            });
19763
19764            $("#SelectedPremiumItem").change(function () {
19765                var option = $(this).find("option:selected").val().split("|");
19766                $.getJSON("/api/OneClickPremium/Get/?productId=" + option[0]).done(function (data) {
19767                    $("#SelectedPremiumRateCode").empty();
19768                    var $option = $("<option />");
19769                    $option.attr("value", "").text($("#PremiumRateSelect").val());
19770                    $("#SelectedPremiumRateCode").append($option);
19771                    $.each(data, function (key, item) {
19772                        var $option = $("<option />");
19773                        $option.attr("value", item.value).text(item.text);
19774                        $("#SelectedPremiumRateCode").append($option);
19775                    });
19776                }).fail(function (jqXHR, textStatus, err) {
19777                    $("#SelectedPremiumRateCode").empty();
19778                    var $option = $("<option />");
19779                    $options.attr("value", "").text("- Error -");
19780                    $("#SelectedPremiumRateCode").append($option);
19781                });
19782            });
19783
19784            $(".donateButton").click(function () {
19785                var form = $(this).closest("form");
19786                if (form.valid()) {
19787                    $(this).hide();
19788                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
19789                }
19790            });
19791
19792            $("#SelectedCountry").change(function () {
19793                var option = $(this).find("option:selected").val();
19794                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
19795                    $("#SelectedState").empty();
19796                    $.each(data, function (key, item) {
19797                        var $option = $("<option />");
19798                        $option.attr("value", item.value).text(item.text);
19799                        $("#SelectedState").append($option);
19800                    });
19801                }).fail(function (jqXHR, textStatus, err) {
19802                    $("#SelectedState").empty();
19803                    var $option = $("<option />");
19804                    $options.attr("value", "").text("- Error -");
19805                    $("#SelectedState").append($option);
19806                });
19807            });
19808
19809            $("input[name=SelectedDonationAmount]").on("change", function () {
19810                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER") {
19811                    if ($("#MinimumDonationAmount").length) {
19812                        $("#MinimumDonationAmount").val("");
19813                        $("#MinimumDonationAmount").valid();
19814                        $("#MinimumDonationAmount").prop("disabled", true);
19815                        $("#divOtherAmount").hide();
19816                    }
19817                } else {
19818                    $("#MinimumDonationAmount").prop("disabled", false);
19819                    $("#divOtherAmount").show();
19820                }
19821
19822                fixFrequency($("input[name=SelectedDonationAmount]:checked").val());
19823                fixAdditionalText($("input[name=SelectedDonationAmount]:checked").val());
19824                calculateTotal();
19825                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19826                fixProductPremiums($("input[name=SelectedDonationAmount]:checked").val());
19827                appealPremiumsUpdate();
19828            });
19829
19830            $("input[name=MinimumDonationAmount]").on("change", function () {
19831                fixFrequency($("input[name=SelectedDonationAmount]:checked").val());
19832                fixAdditionalText($("input[name=SelectedDonationAmount]:checked").val());
19833                calculateTotal();
19834                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19835                fixProductPremiums($("input[name=SelectedDonationAmount]:checked").val());
19836                appealPremiumsUpdate();
19837            });
19838
19839            $("input[name=SelectedRegularDonationFrequency]").on("change", function () {
19840                calculateTotal();
19841                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19842                fixProductPremiums($("input[name=SelectedDonationAmount]:checked").val());
19843                appealPremiumsUpdate();
19844            });
19845
19846            $("input[name=SelectedPledgeDonationFrequency]").on("change", function () {
19847                calculateTotal();
19848                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19849                fixProductPremiums($("input[name=SelectedDonationAmount]:checked").val());
19850                appealPremiumsUpdate();
19851            });
19852        })();
19853    }
19854});
19855
19856//$('.occ-addtional-text-wrapper').hide();
19857
19858},{}],122:[function(require,module,exports){
19859"use strict";
19860
19861$(document).ready(function () {
19862    if ($("div#divOneClickPacDonation").length) {
19863        (function () {
19864            var calculateTotal = function () {
19865                var theType = "REGULAR";
19866                var theAmount = 0;
19867                var thePayments = 1;
19868
19869                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER") {
19870                    var data = $("input[name=SelectedDonationAmount]:checked").val().split("|");
19871                    theType = data[1];
19872                    theAmount = data[0];
19873                } else {
19874                    var data = JSON.parse($("#OtherAmountsString").val());
19875
19876                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19877                        theAmount = parseInt($("#MinimumDonationAmount").val());
19878                        $.each(data, function () {
19879                            if (this.otherMinimum <= theAmount && this.otherMaximum > theAmount) {
19880                                theType = this.amountType;
19881                            }
19882                        });
19883                    }
19884                }
19885
19886                $("#PaymentTotal").val(parseFloat(theAmount / thePayments, 10).toFixed(2));
19887                $("#DonationTotal").val(parseFloat(theAmount).toFixed(2));
19888                $("#divPaymentAmount").html("$" + parseFloat(theAmount / thePayments, 10).toFixed(2));
19889            };
19890
19891            var fixAdditionalText = function (valSelected) {
19892                if (valSelected !== "OTHER") {
19893                    var data = valSelected.split("|");
19894
19895                    $(".ocd-addtional-text-wrapper").each(function () {
19896                        if ($(this).data("text-type") === data[2]) {
19897                            $(this).show();
19898                        } else {
19899                            $(this).hide();
19900                        }
19901                    });
19902                } else {
19903                    var data = JSON.parse($("#OtherAmountsString").val());
19904
19905                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19906                        var amount = parseInt($("#MinimumDonationAmount").val());
19907
19908                        $.each(data, function () {
19909                            if (this.otherMinimum <= amount && this.otherMaximum > amount) {
19910                                var theData = this;
19911                                $(".ocd-addtional-text-wrapper").each(function () {
19912                                    if ($(this).data("text-type") === theData.additionalTextType) {
19913                                        $(this).show();
19914                                    } else {
19915                                        $(this).hide();
19916                                    }
19917                                });
19918                            }
19919                        });
19920                    }
19921                }
19922            };
19923
19924            var fixDonationAmount = function (valSelected) {
19925                if (valSelected !== "OTHER") {
19926                    var data = valSelected.split("|");
19927                } else {
19928                    var data = JSON.parse($("#OtherAmountsString").val());
19929
19930                    if ($.isNumeric($("#MinimumDonationAmount").val())) {
19931                        var amount = parseInt($("#MinimumDonationAmount").val());
19932                    }
19933                }
19934            };
19935
19936            $(".donateButton").click(function () {
19937                var form = $(this).closest("form");
19938                if (form.valid()) {
19939                    $(this).hide();
19940                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
19941                }
19942            });
19943
19944            $("#SelectedCountry").change(function () {
19945                var option = $(this).find("option:selected").val();
19946                $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
19947                    $("#SelectedState").empty();
19948                    $.each(data, function (key, item) {
19949                        var $option = $("<option />");
19950                        $option.attr("value", item.value).text(item.text);
19951                        $("#SelectedState").append($option);
19952                    });
19953                }).fail(function (jqXHR, textStatus, err) {
19954                    $("#SelectedState").empty();
19955                    var $option = $("<option />");
19956                    $options.attr("value", "").text("- Error -");
19957                    $("#SelectedState").append($option);
19958                });
19959            });
19960
19961            $("input[name=SelectedDonationAmount]").on("change", function () {
19962                if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER") {
19963                    if ($("#MinimumDonationAmount").length) {
19964                        $("#MinimumDonationAmount").val("");
19965                        $("#MinimumDonationAmount").valid();
19966                        $("#MinimumDonationAmount").prop("disabled", true);
19967                        $("#divOtherAmount").hide();
19968                    }
19969                } else {
19970                    $("#MinimumDonationAmount").prop("disabled", false);
19971                    $("#divOtherAmount").show();
19972                }
19973
19974                fixAdditionalText($("input[name=SelectedDonationAmount]:checked").val());
19975                calculateTotal();
19976                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19977            });
19978
19979            $("input[name=MinimumDonationAmount]").on("change", function () {
19980                fixAdditionalText($("input[name=SelectedDonationAmount]:checked").val());
19981                calculateTotal();
19982                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19983            });
19984
19985            $("input[name=SelectedRegularDonationFrequency]").on("change", function () {
19986                calculateTotal();
19987                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19988            });
19989
19990            $("input[name=SelectedPledgeDonationFrequency]").on("change", function () {
19991                calculateTotal();
19992                fixDonationAmount($("input[name=SelectedDonationAmount]:checked").val());
19993            });
19994        })();
19995    }
19996});
19997
19998},{}],123:[function(require,module,exports){
19999"use strict";
20000
20001$(document).ready(function () {
20002	//added timeout so that it not only loads after the dom is ready,
20003	//but after other functions are ready that add the class of .at-share-btn
20004	//they also seem to load after the dom, but before this function
20005	setTimeout(function () {
20006		$(".at-share-btn").click(function () {
20007			var imgurl = $("#ImageUrl").val();
20008			$("head").append("<meta property='og:image' content='" + imgurl + "' /> <meta property='og:image:width' content='500' />
20008  <meta property='og:image:height' content='500' /> ");
20009		});
20010	}, 1000);
20011});
20012
20013},{}],124:[function(require,module,exports){
20014"use strict";
20015
20016$(document).ready(function () {
20017    if ($("div#divAOPAOptInOutForm").length) {
20018
20019        $(":checkbox").change(function () {
20020            if (this.closest("form").action.toLowerCase().indexOf("/account/optinoutpreferences") >= 0) {
20021
20022                $("input[type='checkbox']").attr("disabled", "disabled");
20023
20024                $(this).closest("label").addClass("theActive");
20025                $(this).closest("label").css("color", "blue");
20026
20027                $.getJSON("/api/OptInOut/Get/?input=" + this.name + "&ischecked=" + this.checked + "&validcode=" + $("#ValidCode").val()).done(function (data) {
20028                    $("input[type='checkbox']").removeAttr("disabled");
20029                    $("label.theActive").css("color", "green");
20030                    $("label.theActive").removeClass("theActive");
20031                }).fail(function (jqXHR, textStatus, err) {
20032                    $("input[type='checkbox']").removeAttr("disabled");
20033                    $("label.theActive").css("color", "red");
20034                    $("label.theActive").removeClass("theActive");
20035                });
20036            }
20037        });
20038    }
20039});
20040
20041},{}],125:[function(require,module,exports){
20042"use strict";
20043
20044$(document).ready(function () {
20045    if ($("div#divPacDonationRailForm").length) {
20046
20047        if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
20048            $("#divOtherAmount").css({ visibility: "hidden" });
20049            $("#divOtherAmount").css({ display: "none" });
20050        } else {
20051            $("#divOtherAmount").css({ visibility: "visible" });
20052            $("#divOtherAmount").css({ display: "block" });
20053        }
20054
20055        $("input[name=SelectedDonationAmount]").on("change", function () {
20056            if ($("input[name=SelectedDonationAmount]:checked").val() !== "OTHER|0") {
20057                if ($("#MinimumDonationAmount").length) {
20058                    $("#MinimumDonationAmount").val("");
20059                    $("#MinimumDonationAmount").valid();
20060                    $("#MinimumDonationAmount").prop("disabled", true);
20061                    $("#divOtherAmount").css({ visibility: "hidden" });
20062                    $("#divOtherAmount").css({ display: "none" });
20063                }
20064            } else {
20065                $("#MinimumDonationAmount").prop("disabled", false);
20066                $("#divOtherAmount").css({ visibility: "visible" });
20067                $("#divOtherAmount").css({ display: "block" });
20068            }
20069        });
20070
20071        $(".donateButton").click(function () {
20072            var form = $(this).closest("form");
20073            if (form.valid()) {
20074                $(this).hide();
20075                $("#divDonationButton").append("<div class=\"spinner spinner--clockwise\"></div>");
20076            }
20077        });
20078
20079        $(".petitionButton").click(function () {
20080            $(this).hide();
20081            $("#divPetitionStatus").hide();
20082            $("#divPetitionButton").append("<div id=\"divPetitionSpinner\" class=\"spinner spinner--clockwise\"></div>");
20083
20084            $.post("/api/PacPetitionSign/Sign", { data: $("#PetitionInfo").val() }, function () {}).done(function (data) {
20085                if (data) {
20086                    $("#divPetitionStatus").html("<center><span class=\"greenCopy\">" + $("#SignatureAcknowledge").val() + "</span></center>");
20087                    $("#divPetitionStatus").show();
20088                    $("#divPetitionThankYou").show();
20089                    $("#divPetitionSpinner").remove();
20090                    $("#divPetitionButton").hide();
20091                } else {
20092                    $("#divPetitionStatus").html("<center><span class=\"redCopy\">" + $("#SignatureError").val() + "</span></center>");
20093                    $("#divPetitionStatus").show();
20094                    $("#divPetitionSpinner").remove();
20095                    $(".petitionButton").show();
20096                }
20097                $("#divDonate").show();
20098
20099                $("#divPetitionSpinner").remove();
20100            }).fail(function (jqXHR, textStatus, err) {
20101                $("#divPetitionSpinner").remove();
20102                $(".petitionButton").show();
20103                $("#divPetitionStatus").html("<center><span class=\"redCopy\">" + $("#SignatureError").val() + "</span></center>");
20104                $("#divPetitionStatus").show();
20105                $("#divDonate").show();
20106            });
20107        });
20108    }
20109});
20110
20111},{}],126:[function(require,module,exports){
20112"use strict";
20113
20114},{}],127:[function(require,module,exports){
20115"use strict";
20116
20117$(document).ready(function () {
20118    if ($("div#divPilotWorkshopsForm").length) {
20119        var theForm;
20120
20121        (function () {
20122            var SetTotal = function () {
20123                var st = document.getElementById("State").value;
20124                var shipSt = document.getElementById("ShippingState").value;
20125                var same = document.getElementById("ShippingAddressSame");
20126
20127                var total = 0;
20128                total += parseFloat($("#ProductPrice").val());
20129                total += parseFloat($("#ShippingAmount").val());
20130
20131                if (same.checked) {
20132                    if (st === "TN") {
20133                        //total += parseFloat($('#TennesseTax').val());
20134                        //$('#divTennTax').show();
20135                        $(".pws-payment-section").hide();
20136                        $(".pws-tennessee-restrict").show();
20137                        $(".pwsSubmitButton").hide();
20138                    } else {
20139                        //$('#divTennTax').hide();
20140                        $(".pws-payment-section").show();
20141                        $(".pws-tennessee-restrict").hide();
20142                        $(".pwsSubmitButton").show();
20143                    }
20144                } else {
20145                    if (shipSt === "TN") {
20146                        //total += parseFloat($('#TennesseTax').val());
20147                        //$('#divTennTax').show();
20148                        $(".pws-payment-section").hide();
20149                        $(".pws-tennessee-restrict").show();
20150                        $(".pwsSubmitButton").hide();
20151                    } else {
20152                        //$('#divTennTax').hide();
20153                        $(".pws-payment-section").show();
20154                        $(".pws-tennessee-restrict").hide();
20155                        $(".pwsSubmitButton").show();
20156                    }
20157                }
20158                $("#OrderTotal").val(total);
20159                $(".form-payment-total__price").text("$" + total.toFixed(2));
20160            };
20161
20162            var validateDiv = function (div) {
20163                var validator = theForm.data("validator");
20164                var returnValue = true;
20165
20166                $("#" + div + " :input").each(function (e) {
20167                    if (!$(this).is(":button") && this.id.length) {
20168                        if (!validator.element($("#" + this.id))) returnValue = false;
20169                    }
20170                });
20171
20172                return returnValue;
20173            };
20174
20175            theForm = $("#frmPilotWorkShops");
20176
20177            $(document.body).delegate("[type=\"checkbox\"][readonly=\"readonly\"]", "click", function (e) {
20178                e.preventDefault();
20179            });
20180
20181            $(".pwscontinuebutton").click(function () {
20182                if (validateDiv($(this).data("thispage"))) {
20183                    var btn = document.getElementById(this.id);
20184                    var nextpage = $(this).data("nextpage");
20185
20186                    if (btn != null && btn.hasAttribute("data-nextpage-choice")) {
20187                        var cb = document.getElementById($(this).data("nextpage-choice"));
20188                        if (cb.checked) {
20189                            nextpage = $(this).data("alt-nextpage");
20190                        }
20191                    }
20192
20193                    $("#" + $(this).data("thispage")).hide();
20194                    $("#" + nextpage).show();
20195                    window.scrollTo(0, 0);
20196                }
20197            });
20198
20199            $(".btnCancel").click(function () {
20200                window.location.href = "https://www.aopa.org";
20201            });
20202
20203            $(".pwsbackbutton").click(function () {
20204                var btn = document.getElementById(this.id);
20205                var prevpage = $(this).data("prevpage");
20206
20207                if (btn != null && btn.hasAttribute("data-prevpage-choice")) {
20208                    var cb = document.getElementById($(this).data("prevpage-choice"));
20209                    if (cb.checked) {
20210                        prevpage = $(this).data("alt-prevpage");
20211                    }
20212                }
20213
20214                $("#" + $(this).data("thispage")).hide();
20215                $("#" + prevpage).show();
20216                window.scrollTo(0, 0);
20217            });
20218
20219            $(".pwsSubmitButton").click(function () {
20220                if (theForm.valid()) {
20221                    $("#btnRegister").hide();
20222                    $(".btn_final_cancelback").hide();
20223                    $(this).hide();
20224                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
20225                    theForm.submit();
20226                }
20227            });
20228
20229            $("#State").change(function () {
20230                SetTotal();
20231            });
20232
20233            $("#ShippingState").change(function () {
20234                SetTotal();
20235            });
20236
20237            $("#ShippingAddressSame").change(function () {
20238                SetTotal();
20239            });
20240        })();
20241    }
20242});
20243
20244},{}],128:[function(require,module,exports){
20245"use strict";
20246
20247$(document).ready(function () {
20248    if ($("div#divAOPAPPSMaintenance").length) {
20249
20250        $("input[name=SelectedPpsRateCode]").on("change", function () {
20251            var ppsSel = $("input[name=SelectedPpsRateCode]:checked").val().split("|");
20252
20253            $("#sProratedAmount").text("$" + parseFloat(ppsSel[3]).toFixed(2));
20254            $("#sProratedAmount2").text("$" + parseFloat(ppsSel[3]).toFixed(2));
20255        });
20256
20257        $("input[name=SelectedPaymentOption]").on("change", function () {
20258            if ($("input[name=SelectedPaymentOption]:checked").val() === "UseCardOnFile") {
20259                $("#divPayment").css({ visibility: "hidden" });
20260                $("#divPayment").css({ display: "none" });
20261                $("#CCExpireDate").val("12/2100");
20262                var d = new Date();
20263                $("#SelectedCreditCardExpYear").val(d.getFullYear() + 5);
20264                $("#CcNumber").val("4111111111111111");
20265                $("#Cvv").val("123");
20266                $("#NameOnCard").val("xxxx");
20267            } else {
20268                $("#CCExpireDate").val("");
20269                $("#CcNumber").val("");
20270                $("#Cvv").val("");
20271                $("#NameOnCard").val("");
20272                $("#divPayment").css({ visibility: "visible" });
20273                $("#divPayment").css({ display: "block" });
20274            }
20275        });
20276
20277        $(".joinButton").click(function () {
20278            var form = $(this).closest("form");
20279            if (form.valid()) {
20280                $(this).hide();
20281                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
20282            }
20283        });
20284    }
20285});
20286
20287},{}],129:[function(require,module,exports){
20288"use strict";
20289
20290$(document).ready(function () {
20291    if ($("div#divAOPAPPSUpgrade").length) {
20292        $(".joinButton").click(function () {
20293            var form = $(this).closest("form");
20294            if (form.valid()) {
20295                $(this).hide();
20296                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
20297            }
20298        });
20299
20300        $("input[name=SelectedPaymentOption]").on("change", function () {
20301            if ($("input[name=SelectedPaymentOption]:checked").val() === "UseCardOnFile") {
20302                $("#divPayment").css({ visibility: "hidden" });
20303                $("#divPayment").css({ display: "none" });
20304                $("#SelectedCreditCardType").val("VISA");
20305                $("#SelectedCreditCardExpMonth").val("12");
20306                var d = new Date();
20307                $("#SelectedCreditCardExpYear").val(d.getFullYear() + 5);
20308                $("#CcNumber").val("4111111111111111");
20309                $("#Cvv").val("123");
20310                $("#NameOnCard").val("xxxx");
20311            } else {
20312                $("#SelectedCreditCardType").val("");
20313                $("#SelectedCreditCardExpMonth").val("");
20314                $("#SelectedCreditCardExpYear").val("");
20315                $("#CcNumber").val("");
20316                $("#Cvv").val("");
20317                $("#NameOnCard").val("");
20318                $("#divPayment").css({ visibility: "visible" });
20319                $("#divPayment").css({ display: "block" });
20320            }
20321        });
20322    }
20323});
20324
20325},{}],130:[function(require,module,exports){
20326"use strict";
20327
20328$(document).ready(function () {
20329    if ($("div#divRustyPilotRegistrationForm").length) {
20330        var theForm;
20331        var data;
20332        var i;
20333        var answers;
20334
20335        (function () {
20336            var validateDiv = function (form, div) {
20337                var validator = form.data("validator");
20338                var returnValue = true;
20339
20340                $("#" + div + " :input").each(function (e) {
20341
20342                    //if ($('#' + this.id).is(":visible")) {
20343                    if (!$(this).is(":button")) {
20344                        if (!validator.element($("#" + this.id))) returnValue = false;
20345                    }
20346                });
20347                return returnValue;
20348            };
20349
20350            theForm = $("#btnRegister").closest("form");
20351
20352            theForm.data("validator").settings.ignore = "";
20353
20354            //
20355            // Reset the questionnaire fields on page load
20356            //
20357            if ($("#QuestionnaireData").val()) {
20358                data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
20359
20360                for (i = 0; i < data.length; i++) {
20361                    switch (data[i].type) {
20362                        case "Select":
20363                            $("#MPQuestionSelect" + data[i].qid + " option[value=\"" + data[i].qa + "\"]").prop("selected", true);
20364                            break;
20365                        case "CB":
20366                            answers = data[i].qa.split(",");
20367
20368                            $.each(answers, function (index, obj) {
20369                                $("input.MPQuestionCB" + data[i].qid + "[value=\"" + obj + "\"]").prop("checked", true);
20370                            });
20371                            break;
20372                    }
20373                }
20374            }
20375
20376            $(".MPQuestionSelect").change(function () {
20377                var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
20378                var qid = this.id.replace("MPQuestionSelect", "");
20379                var idx = -1;
20380                var ct = 0;
20381
20382                $.each(data, function () {
20383                    if (this.qid.toString() === qid) {
20384                        idx = ct;
20385                        return false;
20386                    }
20387                    ct++;
20388                });
20389
20390                if (idx != -1) {
20391                    data[idx].qa = this.value;
20392                }
20393
20394                $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
20395            });
20396
20397            $(".MPQuestionCB").change(function () {
20398                var data = JSON.parse(decodeURIComponent($("#QuestionnaireData").val()));
20399                var cbid = this.id;
20400                var qid = this.name.replace("MPQuestionCB", "");
20401                var anslist = "";
20402                var idx = -1;
20403                var ct = 0;
20404
20405                $.each(data, function () {
20406                    if (this.qid.toString() === qid) {
20407                        idx = ct;
20408                        return false;
20409                    }
20410                    ct++;
20411                });
20412
20413                $("." + cbid).each(function (index, obj) {
20414                    if (this.checked) {
20415                        anslist += this.value + ",";
20416                    }
20417                });
20418                anslist = anslist.slice(0, -1);
20419
20420                if (idx != -1) {
20421                    data[idx].qa = anslist;
20422                }
20423
20424                $("#QuestionnaireData").val(encodeURIComponent(JSON.stringify(data)));
20425            });
20426
20427            $(".btnCancel").click(function () {
20428                window.location.href = "https://www.aopa.org";
20429            });
20430
20431            $(".btnPage2Forward").click(function () {
20432                var form = $(this).closest("form");
20433
20434                $("#rprPage1").css({ visibility: "hidden" });
20435                $("#rprPage1").css({ display: "none" });
20436                $("#rprPage2").css({ visibility: "visible" });
20437                $("#rprPage2").css({ display: "block" });
20438                window.scrollTo(0, 0);
20439            });
20440            $(".btnPage3Forward").click(function () {
20441                var form = $(this).closest("form");
20442
20443                if (validateDiv(form, "rprPage2")) {
20444                    $("#rprPage2").css({ visibility: "hidden" });
20445                    $("#rprPage2").css({ display: "none" });
20446                    $("#rprPage3").css({ visibility: "visible" });
20447                    $("#rprPage3").css({ display: "block" });
20448                    window.scrollTo(0, 0);
20449                }
20450            });
20451            $(".btnPage4Forward").click(function () {
20452                var form = $(this).closest("form");
20453
20454                if (validateDiv(form, "rprPage3")) {
20455                    $("#rprPage3").css({ visibility: "hidden" });
20456                    $("#rprPage3").css({ display: "none" });
20457                    $("#rprPage4").css({ visibility: "visible" });
20458                    $("#rprPage4").css({ display: "block" });
20459                    window.scrollTo(0, 0);
20460                }
20461            });
20462
20463            $(".btnPage1Back").click(function () {
20464                var form = $(this).closest("form");
20465
20466                $("#rprPage2").css({ visibility: "hidden" });
20467                $("#rprPage2").css({ display: "none" });
20468                $("#rprPage1").css({ visibility: "visible" });
20469                $("#rprPage1").css({ display: "block" });
20470                window.scrollTo(0, 0);
20471            });
20472            $(".btnPage2Back").click(function () {
20473                var form = $(this).closest("form");
20474
20475                $("#rprPage3").css({ visibility: "hidden" });
20476                $("#rprPage3").css({ display: "none" });
20477                $("#rprPage2").css({ visibility: "visible" });
20478                $("#rprPage2").css({ display: "block" });
20479                window.scrollTo(0, 0);
20480            });
20481            $(".btnPage3Back").click(function () {
20482                var form = $(this).closest("form");
20483
20484                $("#rprPage4").css({ visibility: "hidden" });
20485                $("#rprPage4").css({ display: "none" });
20486                $("#rprPage3").css({ visibility: "visible" });
20487                $("#rprPage3").css({ display: "block" });
20488                window.scrollTo(0, 0);
20489            });
20490
20491            $(".rpRegisterButton").click(function () {
20492                var form = $(this).closest("form");
20493                if (form.valid()) {
20494                    $(".btn_final_cancelback").hide();
20495                    $(this).hide();
20496                    $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
20497                    form.submit();
20498                }
20499            });
20500        })();
20501    }
20502});
20503
20504},{}],131:[function(require,module,exports){
20505"use strict";
20506
20507/*
20508// Scroll down arrow
20509// operate the entire functionality if it's on a desktop
20510
20511if($(window).width() > 881 && $('body.in-sitecore').length == 0){
20512	
20513	var headerOffset = $(".header__nav-main-list").offset().top + $(".header__nav-main-list").height();
20514	var contentHeight = $("footer").offset().top + $("footer").height();
20515			
20516	//add the div to the page on load
20517	$("body").append("<div class='scrollarrow'><div class='scrollarrow__wrapper'><p class='downarrow'>scroll to more content</p><svg><use xmlns:xlink='http://www.w3.org/1999/xlink' xlink:href='/dist/assets/svg-sprite.svg#downarrow'></use></svg></div></div>");
20518
20519	function pulse() {
20520        // This will make sure the button only animates 
20521        // when the user is at the top of the page
20522		
20523        if ($(window).scrollTop() <= headerOffset) {
20524			//if the window isn't log enough to need this box, hide it.
20525			if(contentHeight < 1500){
20526				$('.scrollarrow').clearQueue();
20527				$('.scrollarrow').css("display", "none");
20528			} else {
20529				$('.downarrow, .scrollarrow svg').fadeTo(400,1).fadeTo(600, 0.6, pulse );
20530				$('.scrollarrow').fadeIn("slow");
20531			}
20532        }
20533		
20534    }
20535	// This will trigger the animation on when document is ready
20536    setTimeout(pulse, 3000);
20537	
20538
20539    $(window).scroll(function(){              
20540        if ($(this).scrollTop() > headerOffset) {
20541            // This will stop the animation
20542            $('.scrollarrow').clearQueue();
20543            // This will hide the bar
20544            $('.scrollarrow').fadeOut("slow");
20545        }else{
20546            $('.scrollarrow').clearQueue();
20547            // This will restart the animation when the user scrolls back to the top of the page
20548            setTimeout(pulse, 5000);
20549        } 
20550    });
20551	
20552	
20553};
20554*/
20555
20556},{}],132:[function(require,module,exports){
20557"use strict";
20558
20559var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
20560
20561var ReadMore = _interopRequire(require("./directives/ReadMore"));
20562
20563(function (angular) {
20564    "use strict";
20565
20566    var sharedModule = angular.module("aopa.shared", ["ngMaterial", "angularUtils.directives.dirPagination"]).config(config);
20567
20568    config.$inject = ["$provide", "paginationTemplateProvider"];
20569
20570    sharedModule.directive("readMore", ReadMore.directiveFactory);
20571
20572    function config($provide, paginationTemplateProvider) {
20573        // Set pagination template
20574        paginationTemplateProvider.setPath("/js/aopa/shared/templates/paginator.html");
20575
20576        // add additional functionality to md-autocomplete
20577        // https://codepen.io/jensbodal/post/extending-an-angular-ddo-directive-definition-object
20578        $provide.decorator("mdAutocompleteDirective", mdAutoCompleteDirectiveOverride);
20579
20580        mdAutoCompleteDirectiveOverride.$inject = ["$delegate"];
20581
20582        function mdAutoCompleteDirectiveOverride($delegate) {
20583            // grab the directive
20584            var directive = $delegate[0];
20585
20586            // need to append to base compile function
20587            var compile = directive.compile;
20588
20589            // add our custom attribute to the directive's scope
20590            angular.extend(directive.scope, {
20591                menuContainerClass: "@?mdMenuContainerClass"
20592            });
20593
20594            // recompile directive and add our class to the virtual container
20595            directive.compile = function (element, attr) {
20596                var template = compile.apply(this, arguments);
20597                var menuContainerClass = attr.mdMenuContainerClass ? attr.mdMenuContainerClass : "";
20598                var menuContainer = element.find("md-virtual-repeat-container");
20599
20600                menuContainer.addClass(menuContainerClass);
20601
20602                // recompile the template
20603                return function (e, a) {
20604                    template.apply(this, arguments);
20605                };
20606            };
20607
20608            return $delegate;
20609        }
20610    }
20611})(window.angular);
20612
20613},{"./directives/ReadMore":133}],133:[function(require,module,exports){
20614"use strict";
20615
20616var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
20617
20618var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
20619
20620var ReadMore = (function () {
20621    function ReadMore($interval) {
20622        _classCallCheck(this, ReadMore);
20623
20624        this.$interval = $interval;
20625        this.restrict = "A";
20626        this.scope = {
20627            readMoreHeight: "@"
20628        };
20629        this.transclude = true;
20630        this.templateUrl = "/js/aopa/shared/templates/read-more.html";
20631        this.controller = ["$scope", function ($scope) {
20632            $scope.$interval = $interval;
20633        }];
20634    }
20635
20636    _createClass(ReadMore, {
20637        link: {
20638            value: function link($scope, $element, $attrs) {
20639                $scope.expanded = false;
20640
20641                $scope.$interval(function () {
20642                    renderStyles();
20643                }, 300);
20644
20645                $scope.expandable = false;
20646
20647                function renderStyles() {
20648                    if ($element.height() >= $scope.readMoreHeight && $scope.expanded === false) {
20649                        $scope.expandable = true;
20650                    }
20651                }
20652
20653                $scope.showLessStyle = {
20654                    "max-height": $scope.readMoreHeight + "px",
20655                    overflow: "hidden"
20656                };
20657            }
20658        }
20659    }, {
20660        directiveFactory: {
20661            value: function directiveFactory($interval) {
20662                ReadMore.instance = new ReadMore($interval);
20663                return ReadMore.instance;
20664            }
20665        }
20666    });
20667
20668    return ReadMore;
20669})();
20670
20671ReadMore.directiveFactory.$inject = ["$interval"];
20672
20673module.exports = ReadMore;
20674
20675},{}],134:[function(require,module,exports){
20676"use strict";
20677
20678$(document).ready(function () {
20679    if ($("div#divSignupSubscribeForm").length) {
20680
20681        $("#SelectedCountry").change(function () {
20682            var option = $(this).find("option:selected").val();
20683            $.getJSON("/api/CountryState/GetStates/?countryCode=" + option).done(function (data) {
20684                $("#SelectedState").empty();
20685                $.each(data, function (key, item) {
20686                    var $option = $("<option />");
20687                    $option.attr("value", item.value).text(item.text);
20688                    $("#SelectedState").append($option);
20689                });
20690            }).fail(function (jqXHR, textStatus, err) {
20691                $("#SelectedState").empty();
20692                var $option = $("<option />");
20693                $options.attr("value", "").text("- Error -");
20694                $("#SelectedState").append($option);
20695            });
20696        });
20697
20698        $(".joinButton").click(function () {
20699            var form = $(this).closest("form");
20700            if (form.valid()) {
20701                $(this).hide();
20702                $(".clsSubmit").append("<div class=\"spinner spinner--clockwise\"></div>");
20703            }
20704        });
20705    }
20706});
20707
20708},{}],135:[function(require,module,exports){
20709"use strict";
20710
20711;(function ($) {
20712
20713    "use strict";
20714
20715    $(document).ready(function () {
20716
20717        if ($(".statenetContainer").length) {
20718
20719            $.ajax({
20720                type: "GET",
20721                url: "/landing%20pages/statenet/lexisnexis.xml",
20722                dataType: "xml"
20723            }).done(function (xml) {
20724
20725                var stateResults = [],
20726                    messageStr = "",
20727                    resultCount = 0;
20728
20729                $(xml).find("bill_profile").each(function () {
20730
20731                    if ($(this).find("state").text() == state) {
20732
20733                        stateResults.push({
20734                            bill_number: $(this).find("bill_number").text(),
20735                            legtype: $(this).find("legtype").text(),
20736                            bill_name: $(this).find("bill_title").text(),
20737                            author_text: $(this).find("authors author name").text(),
20738                            intro_date: $(this).find("intro_date").text(),
20739                            summary: $(this).find("bill_summary").text(),
20740                            aopa_pos: $(this).find("heading:contains(\"AOPA_Position\")").next("tag").text() });
20741                    }
20742                });
20743
20744                if (resultCount = stateResults.length) {
20745
20746                    messageStr = "There is currently " + resultCount + " bill affecting your state.";
20747                    if (resultCount > 1) {
20748                        messageStr = messageStr.replace("is", "are").replace("bill", "bills");
20749                    }
20750
20751                    $(stateResults).each(function () {
20752
20753                        $("<div class=\"bill\"></div>").html("<div class=\"billId\">" + state + $(this)[0].legtype + $(this)[0].bill_number + "</div><h1 class=\"bill_name\">" + $(this)[0].bill_name + "</h1><div class=\"details\"><div><span>Introduced:</span>" + $(this)[0].intro_date + "</div><div><span>Author:</span>" + $(this)[0].author_text + "</div><div><span>AOPA Position:</span>" + $(this)[0].aopa_pos + "</div></div><div class=\"summary\">" + $(this)[0].summary + "</div>").appendTo("#update-target");
20754                    });
20755                } else {
20756
20757                    messageStr = "Currently, there is no bill activity affecting your state.";
20758                }
20759
20760                $("<p></p>").html(messageStr).prependTo("#update-target");
20761            }).fail(function () {
20762                $("<p></p>").html("There was a problem loading the data feed.").prependTo("#update-target");
20763            });
20764        }
20765    });
20766})(jQuery);
20767
20768},{}],136:[function(require,module,exports){
20769"use strict";
20770
20771$(document).ready(function () {
20772    if ($("div#divStudentOfferForm").length) {
20773        var autocomplete;
20774        var initAutocomplete;
20775        var enableEnrollButton;
20776        var disableEnrollButton;
20777        var clearValidation;
20778
20779        (function () {
20780            var fillInAddress = function () {
20781                // Get the place details from the autocomplete object.
20782                var place = autocomplete.getPlace();
20783                var address1 = "";
20784                var postcode = "";
20785
20786                $("#MailingStreet").val("");
20787                $("#MailingCity").val("");
20788                $("#MailingStateProvince").val("");
20789                $("#MailingPostalCode").val("");
20790
20791                // Get each component of the address from the place details,
20792                // and then fill-in the corresponding field on the form.
20793                // place.address_components are google.maps.GeocoderAddressComponent objects
20794                // which are documented at http://goo.gle/3l5i5Mr
20795                place.address_components.forEach(function (component) {
20796                    var componentType = component.types[0];
20797
20798                    switch (componentType) {
20799                        case "street_number":
20800                            {
20801                                address1 = "" + component.long_name + " " + address1;
20802                                break;
20803                            }
20804
20805                        case "route":
20806                            {
20807                                address1 += component.short_name;
20808                                break;
20809                            }
20810
20811                        case "postal_code":
20812                            {
20813                                postcode = "" + component.long_name + "" + postcode;
20814                                break;
20815                            }
20816
20817                        case "postal_code_suffix":
20818                            {
20819                                postcode = "" + postcode + "-" + component.long_name;
20820                                break;
20821                            }
20822                        case "locality":
20823                            $("#MailingCity").val(component.long_name);
20824                            clearValidation("MailingCity");
20825                            break;
20826                        case "administrative_area_level_1":
20827                            {
20828                                $("#MailingStateProvince").val(component.short_name);
20829                                clearValidation("MailingStateProvince");
20830                                break;
20831                            }
20832                    }
20833                });
20834
20835                $("#MailingStreet").val(address1);
20836                clearValidation("MailingStreet");
20837                $("#MailingPostalCode").val(postcode);
20838                clearValidation("MailingPostalCode");
20839                $("#MailingStreet").focus();
20840            };
20841
20842            initAutocomplete = function () {
20843                // Create the autocomplete object, restricting the search predictions to
20844                autocomplete = new google.maps.places.Autocomplete(AddressLookup, {
20845                    fields: ["address_components"],
20846                    types: ["address"] });
20847                autocomplete.setComponentRestrictions({
20848                    country: ["us"]
20849                });
20850                // When the user selects an address from the drop-down, populate the
20851                // address fields in the form.
20852                autocomplete.addListener("place_changed", fillInAddress);
20853            };
20854
20855            initAutocomplete();
20856
20857            ;
20858
20859            $("#SelectedFSState").change(function () {
20860                $.getJSON("/api/bulkmagazines/cities", { state: $("#SelectedFSState").val() }).done(function (data) {
20861                    $("#SelectedFSCity").empty();
20862                    var opt = new Option("-- Select --", "", true, true);
20863                    $("#SelectedFSCity").append(opt);
20864                    $.each(data, function (index, item) {
20865                        var opt = new Option(item, item);
20866                        $("#SelectedFSCity").append(opt);
20867                    });
20868                }).fail(function (jqXHR, textStatus, err) {
20869                    $("#SelectedFSCity").empty();
20870                    var opt1 = new Option("--", "", true, true);
20871                    $("#SelectedFSCity").append(opt1);
20872                });
20873
20874                $("#SelectedFlightSchool").empty();
20875                var clearOption = new Option("--", "", true, true);
20876                $("#SelectedFlightSchool").append(clearOption);
20877            });
20878
20879            $("#SelectedFSCity").change(function () {
20880                $.getJSON("/api/bulkmagazines/flightschools", { state: $("#SelectedFSState").val(), city: $("#SelectedFSCity").val() }).done(function (data) {
20881                    $("#SelectedFlightSchool").empty();
20882                    var opt = new Option("-- Select --", "", true, true);
20883                    $("#SelectedFlightSchool").append(opt);
20884                    $.each(data, function (index, item) {
20885                        var opt = new Option(item.name, item.id);
20886                        $("#SelectedFlightSchool").append(opt);
20887                    });
20888                }).fail(function (jqXHR, textStatus, err) {
20889                    $("#SelectedFlightSchool").empty();
20890                    var opt1 = new Option("--", "", true, true);
20891                    $("#SelectedFlightSchool").append(opt1);
20892                });
20893            });
20894
20895            $("input:radio[name=\"SchoolLookup\"]").change(function () {
20896                if ($(this).val() == "Lookup") {
20897                    $("#fsOther").hide();
20898                    $("#fsLookup").show();
20899                } else {
20900                    $("#fsLookup").hide();
20901                    $("#fsOther").show();
20902                }
20903            });
20904
20905            $("#FlightStudentConfirm").change(function () {
20906                if (this.checked) {
20907                    enableEnrollButton();
20908                } else {
20909                    disableEnrollButton();
20910                }
20911            });
20912
20913            enableEnrollButton = function () {
20914                $("#btnEnroll").removeClass("join-disable-button");
20915                $("#btnEnroll").prop("disabled", false);
20916            };
20917
20918            disableEnrollButton = function () {
20919                $("#btnEnroll").addClass("join-disable-button");
20920                $("#btnEnroll").prop("disabled", true);
20921            };
20922
20923            clearValidation = function (field) {
20924                var theField = $("#" + field);
20925                if (theField.val()) {
20926                    theField.removeClass("input-validation-error").addClass("valid");
20927                    $("span[data-valmsg-for='" + field + "']").removeClass("field-validation-error").addClass("field-validation-valid");
20928                    $("span[data-valmsg-for='" + field + "']").empty();
20929                }
20930            };
20931
20932            $(".submitButtonSO").click(function () {
20933                var theForm = $(this).closest("form");
20934
20935                if (theForm.valid()) {
20936                    var progressBar = new Sfpb_progressBar();
20937
20938                    $("#btnEnroll").hide();
20939                    $(this).hide();
20940                    $("body").addClass("progressbar-modal");
20941                    progressBar.start();
20942                    $(".clsSubmitButton").append("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise\"></div>");
20943                    theForm.submit();
20944                } else {
20945                    var firstInstance = $(".input-validation-error").first();
20946                    var offsetTop = firstInstance.offset().top - 100;
20947
20948                    $("html, body").animate({
20949                        scrollTop: offsetTop
20950                    }, 500);
20951                }
20952            });
20953        })();
20954    }
20955});
20956
20957},{}],137:[function(require,module,exports){
20958"use strict";
20959
20960$(document).ready(function () {
20961    if ($(".aopa-subscription").length) {
20962
20963        $(".aopa-subscribe-button").click(function () {
20964            var instance = $(this).data("instance");
20965            $(".subscription-msg").hide();
20966
20967            $("#btn" + instance + "Subscribe").addClass("button--spinner");
20968
20969            $.post("/api/SubscriptionApi/ProcessSubscription", {
20970                data: $("#hdn" + instance + "Data").val(),
20971                status: true
20972            }, function () {}).done(function (data) {
20973                $("#btn" + instance + "SubcribeContainer").hide();
20974                $("#btn" + instance + "UnsubscribeContainer").show();
20975                $("#div" + instance + "SubscribeSucceed").show();
20976            }).fail(function (jqXHR, textStatus, err) {
20977                $("#div" + instance + "SubscribeFailed").show();
20978            }).always(function () {
20979                $("#btn" + instance + "Subscribe").removeClass("button--spinner");
20980                $("#btn" + instance + "Subscribe").prop("disabled", false);
20981            });
20982        });
20983
20984        $(".aopa-unsubscribe-button").click(function () {
20985            var instance = $(this).data("instance");
20986            $(".subscription-msg").hide();
20987
20988            $("#btn" + instance + "Unsubscribe").addClass("button--spinner");
20989
20990            $.post("/api/SubscriptionApi/ProcessSubscription", {
20991                data: $("#hdn" + instance + "Data").val(),
20992                status: false
20993            }, function () {}).done(function (data) {
20994                $("#btn" + instance + "UnsubscribeContainer").hide();
20995                $("#btn" + instance + "SubcribeContainer").show();
20996                $("#div" + instance + "UnsubscribeSucceed").show();
20997            }).fail(function (jqXHR, textStatus, err) {
20998                $("#div" + instance + "UnsubscribeFailed").show();
20999            }).always(function () {
21000                $("#btn" + instance + "Unsubscribe").removeClass("button--spinner");
21001                $("#btn" + instance + "Unsubscribe").prop("disabled", false);
21002            });
21003        });
21004    }
21005});
21006
21007},{}],138:[function(require,module,exports){
21008"use strict";
21009
21010$(document).ready(function () {
21011    if ($("div#divTextMessageOptInOut").length) {
21012        var theForm = $("#frmMobileOptInOut");
21013
21014        $("#btnOptIn").click(function () {
21015            if (theForm.valid()) {
21016                $("#btnOptIn").hide();
21017                $(".tm-optinout-buttons").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise tm-optinout-spinner\"></div>");
21018                $(".tm-optinout-status").hide();
21019
21020                var input = {
21021                    action: "OptIn",
21022                    formData: $("#FormData").val(),
21023                    mobilePhoneNumber: $("#MobilePhoneNumber").val(),
21024                    setPreferredPhone: $("#SetPreferredPhone").val()
21025                };
21026
21027                $.ajax({
21028                    url: "/api/TextMessageOptInApi/ProcessOptInOut",
21029                    type: "post",
21030                    data: input,
21031                    success: function success(data, status, jqXHR) {
21032                        if (jqXHR.status == 200 || jqXHR.status == 204) {
21033                            $(".tm-optinout-optinsuccess").show();
21034                            $("#btnOptOut").show();
21035                            $("#btnUpdateOnly").show();
21036                        } else {
21037                            $(".tm-optinout-optinfailed").show();
21038                            $("#btnOptIn").show();
21039                        }
21040                    },
21041                    error: function error(jqXHR, exception) {
21042                        $(".tm-optinout-optinfailed").show();
21043                        $("#btnOptIn").show();
21044                    },
21045                    complete: function complete(jqHXR, status) {
21046                        var spinner = document.getElementById("aopaSpinner");
21047                        spinner.parentElement.removeChild(spinner);
21048                    }
21049
21050                });
21051            }
21052        });
21053
21054        $("#btnOptOut").click(function () {
21055            $("#btnOptOut").hide();
21056            $("#btnUpdateOnly").hide();
21057            $(".tm-optinout-buttons").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise  tm-optinout-spinner\"></div>");
21058            $(".tm-optinout-status").hide();
21059
21060            var input = {
21061                action: "OptOut",
21062                formData: $("#FormData").val() };
21063
21064            $.ajax({
21065                url: "/api/TextMessageOptInApi/ProcessOptInOut",
21066                type: "post",
21067                data: input,
21068                success: function success(data, status, jqXHR) {
21069                    if (jqXHR.status == 200 || jqXHR.status == 204) {
21070                        $(".tm-optinout-optoutsuccess").show();
21071                        $("#btnOptIn").show();
21072                    } else {
21073                        $(".tm-optinout-optoutfailed").show();
21074                        $("#btnOptOut").show();
21075                        $("#btnUpdateOnly").show();
21076                    }
21077                },
21078                error: function error(jqXHR, exception) {
21079                    $(".tm-optinout-optoutfailed").show();
21080                    $("#btnOptOut").show();
21081                    $("#btnUpdateOnly").show();
21082                },
21083                complete: function complete(jqHXR, status) {
21084                    var spinner = document.getElementById("aopaSpinner");
21085                    spinner.parentElement.removeChild(spinner);
21086                }
21087
21088            });
21089        });
21090
21091        $("#btnUpdateOnly").click(function () {
21092            if (theForm.valid()) {
21093                $("#btnOptOut").hide();
21094                $("#btnUpdateOnly").hide();
21095                $(".tm-optinout-buttons").prepend("<div id=\"aopaSpinner\" class=\"spinner spinner--clockwise  tm-optinout-spinner\"></div>");
21096                $(".tm-optinout-status").hide();
21097
21098                var input = {
21099                    action: "UpdateOnly",
21100                    formData: $("#FormData").val(),
21101                    mobilePhoneNumber: $("#MobilePhoneNumber").val(),
21102                    setPreferredPhone: $("#SetPreferredPhone").val()
21103                };
21104
21105                $.ajax({
21106                    url: "/api/TextMessageOptInApi/ProcessOptInOut",
21107                    type: "post",
21108                    data: input,
21109                    success: function success(data, status, jqXHR) {
21110                        if (jqXHR.status == 200 || jqXHR.status == 204) {
21111                            $(".tm-optinout-updatesuccess").show();
21112                            $("#btnOptOut").show();
21113                            $("#btnUpdateOnly").show();
21114                        } else {
21115                            $(".tm-optinout-updatefailed").show();
21116                            $("#btnOptOut").show();
21117                            $("#btnUpdateOnly").show();
21118                        }
21119                    },
21120                    error: function error(jqXHR, exception) {
21121                        $(".tm-optinout-updatefailed").show();
21122                        $("#btnOptOut").show();
21123                        $("#btnUpdateOnly").show();
21124                    },
21125                    complete: function complete(jqHXR, status) {
21126                        var spinner = document.getElementById("aopaSpinner");
21127                        spinner.parentElement.removeChild(spinner);
21128                    }
21129
21130                });
21131            }
21132        });
21133    }
21134});
21135
21136},{}],139:[function(require,module,exports){
21137"use strict";
21138
21139$("#AirportId").each(function (i) {
21140                $("this").change(function () {
21141                                $.getJSON("/api/AirportFinder/GetAirportByCode?includePrivate=true&code=" + $(this).val()).done(function (data) {
21142                                                if (!data) {
21143                                                                // remove invalid airport id and set focus on airport id field
21144                                                                $("#AirportId").val("");
21145                                                                $("#AirportId").focus();
21146                                                                alert("Airport ID is not val
21146id. Please enter valid Airport ID");
21147                                                }
21148                                }).fail(function (xhr, status, error) {
21149                                                console.error("error:", xhr, status, error);
21150                                });
21151                });
21152});
21153$("#StartDate").each(function (i) {
21154                $(this).datetimepicker({
21155                                controlType: "select",
21156                                timeFormat: "hh:mm tt"
21157                });
21158});
21159$("#EndDate").each(function (i) {
21160                $(this).datetimepicker({
21161                                controlType: "select",
21162                                timeFormat: "hh:mm tt"
21163                });
21164});
21165
21166},{}],140:[function(require,module,exports){
21167"use strict";
21168
21169$(document).ready(function () {
21170    if ($("div#divUsernameandPasswordUpdate").length) {};
21171});
21172
21173},{}],141:[function(require,module,exports){
21174"use strict";
21175
21176var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
21177
21178var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
21179
21180var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
21181
21182var MockWeatherService = _interopRequire(require("../services/MockWeatherService"));
21183
21184var WeatherWidget = (function () {
21185    function WeatherWidget($q, weatherService) {
21186        var _this = this;
21187
21188        _classCallCheck(this, WeatherWidget);
21189
21190        this.$q = $q;
21191        this.weatherService = weatherService;
21192        this.templateUrl = "/js/aopa/weather/templates/weather.html";
21193        this.restrict = "E";
21194        this.scope = {
21195            mock: "=",
21196            ident: "@",
21197            lat: "=?",
21198            lon: "=?"
21199        };
21200        this.controller = ["$scope", function ($scope) {
21201            $scope.formatWind = function () {
21202                return _this.formatWind($scope);
21203            };
21204            $scope.getIcon = function () {
21205                return _this.getIcon($scope);
21206            };
21207            $scope.getCategoryIcon = function () {
21208                return _this.getCategoryIcon($scope);
21209            };
21210            $scope.getTooltip = function () {
21211                return _this.getTooltip($scope);
21212            };
21213            $scope.geolocationEnabled = "geolocation" in navigator;
21214            $scope.getLocation = function () {
21215                return _this.getLocation($scope);
21216            };
21217            _this.load($scope);
21218        }];
21219    }
21220
21221    _createClass(WeatherWidget, {
21222        link: {
21223            value: function link($scope, $element, $attributes) {}
21224        },
21225        clear: {
21226            value: function clear($scope) {
21227                $scope.data = null;
21228                $scope.error = null;
21229                $scope.loading = false;
21230                $scope.iconCls = "wi-na";
21231                $scope.tooltip = null;
21232            }
21233        },
21234        load: {
21235            value: function load($scope) {
21236                var _this = this;
21237
21238                this.clear($scope);
21239
21240                if ($scope.mock) {
21241                    $scope.data = MockWeatherService.getMetar();
21242                    $scope.iconCls = this.getIcon($scope);
21243                    $scope.tooltip = this.getTooltip($scope);
21244                    return;
21245                }
21246
21247                var query = undefined;
21248                if ($scope.lat && $scope.lon) {
21249                    query = this.weatherService.getMetarByLatLon($scope.lat, $scope.lon);
21250                } else if ($scope.ident) {
21251                    query = this.weatherService.getMetarByIdent($scope.ident);
21252                }
21253
21254                if (query) {
21255                    $scope.loading = true;
21256                    query.then(function (data) {
21257                        $scope.data = data;
21258                        $scope.iconCls = _this.getIcon($scope);
21259                        $scope.tooltip = _this.getTooltip($scope);
21260                    })["catch"](function (err) {
21261                        $scope.error = err.message;
21262                    })["finally"](function () {
21263                        $scope.loading = false;
21264                    });
21265                }
21266            }
21267        },
21268        formatWind: {
21269            value: function formatWind($scope) {
21270                if (!$scope.data) {
21271                    return "";
21272                }
21273
21274                if ($scope.data.wind_speed) {
21275                    if ($scope.data.wind_gust) {
21276                        return "" + $scope.data.wind_speed + " - " + $scope.data.wind_gust;
21277                    }
21278
21279                    return String($scope.data.wind_speed);
21280                }
21281
21282                return "CALM";
21283            }
21284        },
21285        getIcon: {
21286            value: function getIcon($scope) {
21287                // Return neutral icon if no data is loaded
21288                if (!$scope.data) {
21289                    return "wi-na";
21290                }
21291
21292                // If significant weather phenomena are present, return the icon associated with that
21293                // phenomena.
21294                var type = this.weatherService.getWxType($scope.data.wx_string);
21295                if (type != null) {
21296                    return type.icon;
21297                }
21298
21299                // Otherwise, return icon for cloudy, partly cloudy, or sunny depending on what cloud
21300                // layers are present.
21301                var skc = $scope.data.sky_conditions_trans;
21302                if (skc && skc.length >= 1) {
21303                    var layers = skc.map(function (layer) {
21304                        return layer.sky_cover;
21305                    });
21306
21307                    // Return cloudy if there is at least one overcast or broken cloud layer
21308                    if (layers.indexOf("Overcast") >= 0 || layers.indexOf("Broken clouds") >= 0) {
21309                        return "wi-cloudy";
21310                    }
21311
21312                    // Return partly sunny if there is at least one scattered/few cloud layer
21313                    if (layers.indexOf("Scattered clouds") >= 0 || layers.indexOf("Few clouds") >= 0) {
21314                        return "wi-day-cloudy";
21315                    }
21316                }
21317
21318                // Otherwise, return sunny
21319                return "wi-day-sunny";
21320            }
21321        },
21322        getCategoryIcon: {
21323            value: function getCategoryIcon($scope) {
21324                if ($scope.error) {
21325                    return "error";
21326                }
21327
21328                if ($scope.loading) {
21329                    return "loading";
21330                }
21331
21332                if (!$scope.data || !$scope.data.flight_category) {
21333                    return "na";
21334                }
21335
21336                return $scope.data.flight_category.toLowerCase();
21337            }
21338        },
21339        getTooltip: {
21340            value: function getTooltip($scope) {
21341                var wx = this.weatherService.translateWx($scope.data.wx_string);
21342                var clouds = this.weatherService.getCloudLayersText($scope.data.sky_conditions_trans);
21343                return [wx, clouds].filter(function (t) {
21344                    return t;
21345                }).join(", ") || null;
21346            }
21347        },
21348        getLocation: {
21349            value: function getLocation($scope) {
21350                var _this = this;
21351
21352                navigator.geolocation.getCurrentPosition(function (pos) {
21353                    $scope.lat = pos.coords.latitude;
21354                    $scope.lon = pos.coords.longitude;
21355                    _this.load($scope);
21356                }, function (error) {
21357                    $scope.$apply(function () {
21358                        _this.clear($scope);
21359                        $scope.error = "Unable to detect location: " + (error.message || "An unknown error occurred while attempting to use the browser's geolocation service.");
21360                    });
21361                });
21362            }
21363        }
21364    }, {
21365        directiveFactory: {
21366            value: function directiveFactory($q, weatherService) {
21367                WeatherWidget.instance = new WeatherWidget($q, weatherService);
21368                return WeatherWidget.instance;
21369            }
21370        }
21371    });
21372
21373    return WeatherWidget;
21374})();
21375
21376WeatherWidget.directiveFactory.$inject = ["$q", "weatherService"];
21377
21378module.exports = WeatherWidget;
21379
21380},{"../services/MockWeatherService":142}],142:[function(require,module,exports){
21381"use strict";
21382
21383var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
21384
21385var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
21386
21387/**
21388* Mock weather service that returns dummy data for testing.
21389*/
21390
21391var MockWeatherService = (function () {
21392    function MockWeatherService() {
21393        _classCallCheck(this, MockWeatherService);
21394    }
21395
21396    _createClass(MockWeatherService, null, {
21397        getMetar: {
21398            value: function getMetar() {
21399                return {
21400                    ident: "KBOS",
21401                    name: "General Edward Lawrence Logan International",
21402                    city: "Boston",
21403                    state: "MA",
21404                    latitude: 42.37,
21405                    longitude: -71.02,
21406                    elevation_m: 6,
21407                    metar_type: "METAR",
21408                    observation_time: "2016-01-26T21:54:00Z",
21409                    raw_text: "KBOS 262154Z 22016KT 10SM SCT130 BKN200 OVC280 08/02 A2983 RMK AO2 SLP099 T00830017",
21410                    flight_category: "VFR",
21411                    visibility: 10,
21412                    ceiling: 7000,
21413                    wind_speed: 16,
21414                    wind_gust: 25,
21415                    wind_dir_degrees: 220,
21416                    altim_in_hg: 29.828741,
21417                    temp_c: 8.3,
21418                    temp_f: 47,
21419                    dewpoint_c: 1.7,
21420                    dewpoint_f: 35,
21421                    wx_string: "-SN BR",
21422                    wx_string_trans: "Light Snow, Mist",
21423                    sky_conditions_trans: [{
21424                        sky_cover: "Scattered clouds",
21425                        cloud_base: "13000' AGL"
21426                    }, {
21427                        sky_cover: "Broken clouds",
21428                        cloud_base: "20000' AGL"
21429                    }, {
21430                        sky_cover: "Overcast",
21431                        cloud_base: "28000' AGL"
21432                    }]
21433                };
21434            }
21435        }
21436    });
21437
21438    return MockWeatherService;
21439})();
21440
21441module.exports = MockWeatherService;
21442
21443},{}],143:[function(require,module,exports){
21444"use strict";
21445
21446var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
21447
21448var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
21449
21450var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
21451
21452/**
21453* AOPA Weather Service proxy.
21454*/
21455
21456var WeatherService = (function () {
21457    function WeatherService($http, $q) {
21458        _classCallCheck(this, WeatherService);
21459
21460        this.baseUrl = "https://www.aopa.org/webservices/wx/v1/index.cfm";
21461        this.$http = $http;
21462        this.$q = $q;
21463        this.initWxMappings();
21464    }
21465
21466    _createClass(WeatherService, {
21467        getMetarByIdent: {
21468
21469            /**
21470             * Returns the METAR weather report for the given airport identifier.
21471             * @param {String} ident Airport identifier
21472             * @returns {Object} Object containing latest METAR weather data for the given airport.
21473             */
21474
21475            value: function getMetarByIdent(ident) {
21476                var _this = this;
21477
21478                return this.$q(function (resolve, reject) {
21479                    if (!ident) {
21480                        reject({
21481                            error: "MISSING_LOCATION",
21482                            message: "Could not retrieve weather (missing airport identifier)."
21483                        });
21484                        return;
21485                    }
21486                    _this.$http.get(_this.baseUrl + ("/metar?body={\"identifier\":\"" + ident + "\"}")).then(function (response) {
21487                        return resolve(_this.parseMetar(response.data));
21488                    })["catch"](function (response) {
21489                        return reject(_this.handleError(response, { ident: ident }));
21490                    });
21491                });
21492            }
21493        },
21494        getMetarByLatLon: {
21495
21496            /**
21497             * Returns the METAR weather report for the nearest airport based on location.
21498             * @param {Double} lat Latitude
21499             * @param {Double} lon Longitude
21500             * @returns {Object} Object containing latest METAR weather data for the nearest
21501             * airport.
21502             */
21503
21504            value: function getMetarByLatLon(lat, lon) {
21505                var _this = this;
21506
21507                return this.$q(function (resolve, reject) {
21508                    if (!lat || !lon) {
21509                        reject({
21510                            error: "MISSING_LOCATION",
21511                            message: "Could not retrieve weather (missing location)."
21512                        });
21513                        return;
21514                    }
21515                    _this.$http.get(_this.baseUrl + ("/metar?body={\"latitude\":" + lat + ",\"longitude\":" + lon + "}")).then(function (response) {
21516                        return resolve(_this.parseMetar(response.data));
21517                    })["catch"](function (response) {
21518                        return reject(_this.handleError(response, { lat: lat, lon: lon }));
21519                    });
21520                });
21521            }
21522        },
21523        handleError: {
21524            value: function handleError(response) {
21525                var _ref = arguments[1] === undefined ? {} : arguments[1];
21526
21527                var _ref$ident = _ref.ident;
21528                var ident = _ref$ident === undefined ? null : _ref$ident;
21529                var _ref$lat = _ref.lat;
21530                var lat = _ref$lat === undefined ? null : _ref$lat;
21531                var _ref$lon = _ref.lon;
21532                var lon = _ref$lon === undefined ? null : _ref$lon;
21533
21534                switch (response.status) {
21535                    case 404:
21536                        var message = undefined;
21537                        if (ident !== null) {
21538                            message = "Could not retrieve weather for identifier " + ident + ". The identifier may be invalid, or the station does not report weather.";
21539                        } else if (lat !== null && lon !== null) {
21540                            message = "Could not retrieve weather based on geographic position (latitude: " + lat + ", longitude: " + lon + "). The service returned \"Not Found\".";
21541                        } else {
21542                            message = "Could not retrieve weather for the specified location.";
21543                        }
21544                        return {
21545                            error: "INVALID_LOCATION",
21546                            message: message
21547                        };
21548                }
21549
21550                return {
21551                    error: "UNKNOWN",
21552                    message: "An error occurred retrieving the weather. Please try again later."
21553                };
21554            }
21555        },
21556        parseMetar: {
21557            value: function parseMetar(d) {
21558                return {
21559                    ident: d.icao_code,
21560                    name: d.name,
21561                    city: d.city,
21562                    state: d.state,
21563                    latitude: d.latitude,
21564                    longitude: d.longitude,
21565                    elevation: d.elevation_m * 3.28084,
21566                    observation_time: new Date(d.observation_time),
21567                    raw_text: d.raw_text,
21568                    flight_category: d.flight_category,
21569                    visibility: d.visibility_statute_mi,
21570                    ceiling: this.getCeiling(d.sky_conditions_trans),
21571                    wind_speed: d.wind_speed_kt,
21572                    wind_gust: d.wind_gust_kt,
21573                    wind_dir: d.wind_dir_degrees,
21574                    temp_c: d.temp_c,
21575                    temp_f: d.temp_f,
21576                    dewpoint_c: d.dewpoint_c,
21577                    dewpoint_f: d.dewpoint_f,
21578                    wx_string: d.wx_string,
21579                    wx_string_trans: d.wx_string_trans,
21580                    sky_conditions_trans: d.sky_conditions_trans
21581                };
21582            }
21583        },
21584        getCeiling: {
21585
21586            /**
21587             * Returns the AGL altitude of the lowest broken or overcast cloud layer based on the given
21588             * sky conditions array.
21589             * @param skc Sky condition array as returned by the AOPA weather service API.
21590             * @returns {Number|null} Ceiling altitude in feet AGL, or null.
21591             */
21592
21593            value: function getCeiling(skc) {
21594                if (!skc || skc.length < 1) {
21595                    return null;
21596                }
21597
21598                // If vertical visibility is reported, use the vertical visibility value as the ceiling
21599                var vv = skc.find(function (layer) {
21600                    return layer.sky_cover === "Vertical Visibility";
21601                });
21602                if (vv) {
21603                    return parseInt(vv.cloud_base);
21604                }
21605
21606                // Extract the altitudes of all broken and overcast layers
21607                var layers = skc.filter(function (layer) {
21608                    return layer.sky_cover === "Overcast" || layer.sky_cover === "Broken clouds";
21609                }).map(function (layer) {
21610                    return parseInt(layer.cloud_base);
21611                });
21612                if (layers.length < 1) {
21613                    return null;
21614                }
21615
21616                // Return minimum altitude of broken/overcast layers
21617                return Math.min.apply(Math, _toConsumableArray(layers));
21618            }
21619        },
21620        getWxType: {
21621
21622            /**
21623             * Returns highest priority weather type (icon/text) based on raw weather string
21624             * @param {String} wx_string Raw weather string (e.g., "TSRA BR")
21625             * @returns {Object} Object containing the icon and tooltip text that should be displayed
21626             * in the widget. The icon and text should correspond to the highest priority weather
21627             * condition present in the weather string (i.e., thunderstorm should take priority over
21628             * mist).
21629             */
21630
21631            value: function getWxType(wx_string) {
21632                if (!wx_string) {
21633                    return null;
21634                }
21635
21636                return this.getWxTypes(wx_string)[0] || null;
21637            }
21638        },
21639        translateWx: {
21640
21641            /**
21642             * Returns a textual description of all weather phenomena present based on raw
21643             * weather string. Each weather phenomenon will appear in order of descending priority and
21644             * will be separated by a comma.
21645             * @param {String} wx_string Raw weather string (e.g., "+TSRA BR")
21646             * @returns {String} Textual weather description (e.g., "Thunderstorm / Heavy rain, Mist")
21647             */
21648
21649            value: function translateWx(wx_string) {
21650                var types = this.getWxTypes(wx_string);
21651                if (types && types.length > 0) {
21652                    return types.map(function (t) {
21653                        return t.text;
21654                    }).join(", ");
21655                }
21656
21657                return null;
21658            }
21659        },
21660        getCloudLayersText: {
21661
21662            /**
21663             * Returns a textual description of all cloud layers, in
21663 order of ascending altitude.
21664             * @param skc Sky condition array as returned by the AOPA weather service API.
21665             * @returns {String} Textual description of cloud layers
21666             */
21667
21668            value: function getCloudLayersText(skc) {
21669                if (skc && skc.length >= 1) {
21670                    var layers = skc.map(function (layer) {
21671                        var text = layer.sky_cover;
21672                        if (layer.cloud_base && layer.cloud_base !== "None") {
21673                            text += " " + layer.cloud_base;
21674                        }
21675                        return {
21676                            alt: parseInt(layer.cloud_base),
21677                            text: text
21678                        };
21679                    });
21680
21681                    return layers.sort(function (a, b) {
21682                        return a.alt - b.alt;
21683                    }).map(function (layer) {
21684                        return layer.text;
21685                    }).join(", ");
21686                }
21687
21688                return null;
21689            }
21690        },
21691        getWxTypes: {
21692
21693            /**
21694             * Returns all matched weather type items (icon, text description, priority) based on raw
21695             * weather string, in order of priority.
21696             * @param {String} wx_string Raw weather string (e.g., "TSRA BR")
21697             * @returns {Object} Array of objects, each containing the icon and tooltip text associated
21698             * with that weather phenomenon.
21699             */
21700
21701            value: function getWxTypes(wx_string) {
21702                if (!wx_string) {
21703                    return [];
21704                }
21705
21706                var elems = wx_string.split(" ");
21707
21708                return this.wxMappings.filter(function (t) {
21709                    // See if entire wx_string matches one of the keys exactly (e.g., "RA SN" should
21710                    // match the item with priority 25).
21711                    if (t.keys.indexOf(wx_string) >= 0) {
21712                        return true;
21713                    };
21714
21715                    // Otherwise, split on space and see if any of the individual elements (e.g., "RA"
21716                    // or "SN") match one of the keys.
21717                    if (elems.some(function (elem) {
21718                        return t.keys.indexOf(elem) >= 0;
21719                    })) {
21720                        return true;
21721                    }
21722
21723                    return false;
21724                }).sort(function (a, b) {
21725                    return a.priority - b.priority;
21726                });
21727            }
21728        },
21729        initWxMappings: {
21730            value: function initWxMappings() {
21731                // Initializes the mapping from METAR weather codes (e.g., "RA") to the associated icon
21732                // from the weather icon font. Also stores the priority for each weather condition so we
21733                // can determine which icon should be displayed in the event multiple weather conditions
21734                // are present (more severe weather types have higher priority).
21735                //
21736                // Priorities are derived from the ADDS document titled "Present Weather (METAR
21737                // text-to-symbol matching)", which can be located here:
21738                // https://aviationweather.gov/static/adds/docs/metars/wxSymbols_anno2.pdf
21739                //
21740                // Note: We are only using the above document for how they define priorities of various
21741                // weather phenomena, and not for the specific icons themselves.
21742
21743                this.wxMappings = [{
21744                    priority: 1,
21745                    keys: ["FC", "+FC"],
21746                    text: "Funnel cloud",
21747                    icon: "wi-tornado"
21748                }, {
21749                    priority: 2,
21750                    keys: ["SQ"],
21751                    text: "Squall",
21752                    icon: "wi-strong-wind"
21753                }, {
21754                    priority: 3,
21755                    keys: ["FU"],
21756                    text: "Smoke",
21757                    icon: "wi-smoke"
21758                }, {
21759                    priority: 3,
21760                    keys: ["VA"],
21761                    text: "Volcanic ash",
21762                    icon: "wi-volcano"
21763                }, {
21764                    priority: 5,
21765                    keys: ["+TSGS", "+TSGR"],
21766                    text: "Thunderstorm / Heavy hail",
21767                    icon: "wi-thunderstorm"
21768                }, {
21769                    priority: 6,
21770                    keys: ["+TSRA"],
21771                    text: "Thunderstorm / Heavy rain",
21772                    icon: "wi-thunderstorm"
21773                }, {
21774                    priority: 6,
21775                    keys: ["+TSSN"],
21776                    text: "Thunderstorm / Heavy snow",
21777                    icon: "wi-thunderstorm"
21778                }, {
21779                    priority: 6,
21780                    keys: ["+TSPL"],
21781                    text: "Thunderstorm / Ice pellets",
21782                    icon: "wi-thunderstorm"
21783                }, {
21784                    priority: 7,
21785                    keys: ["TSGR", "TSGS"],
21786                    text: "Thunderstorm / Hail",
21787                    icon: "wi-thunderstorm"
21788                }, {
21789                    priority: 8,
21790                    keys: ["TSRA"],
21791                    text: "Thunderstorm / Rain",
21792                    icon: "wi-thunderstorm"
21793                }, {
21794                    priority: 8,
21795                    keys: ["TSSN"],
21796                    text: "Thunderstorm / Snow",
21797                    icon: "wi-storm-showers"
21798                }, {
21799                    priority: 8,
21800                    keys: ["TSPL"],
21801                    text: "Thunderstorm / Ice pellets",
21802                    icon: "wi-storm-showers"
21803                }, {
21804                    priority: 9,
21805                    keys: ["PO", "VCPO"],
21806                    text: "Dust/sand whirls",
21807                    icon: "wi-dust"
21808                }, {
21809                    priority: 10,
21810                    keys: ["+SS"],
21811                    text: "Heavy sandstorm",
21812                    icon: "wi-sandstorm"
21813                }, {
21814                    priority: 10,
21815                    keys: ["+DS"],
21816                    text: "Heavy dust storm",
21817                    icon: "wi-dust"
21818                }, {
21819                    priority: 11,
21820                    keys: ["SS"],
21821                    text: "Sandstorm",
21822                    icon: "wi-sandstorm"
21823                }, {
21824                    priority: 11,
21825                    keys: ["DS"],
21826                    text: "Dust storm",
21827                    icon: "wi-dust"
21828                }, {
21829                    priority: 11,
21830                    keys: ["DRSA"],
21831                    text: "Drifting sand",
21832                    icon: "wi-sandstorm"
21833                }, {
21834                    priority: 11,
21835                    keys: ["DRDU"],
21836                    text: "Drifting dust",
21837                    icon: "wi-dust"
21838                }, {
21839                    priority: 12,
21840                    keys: ["VCSS"],
21841                    text: "Sandstorm in vicinity",
21842                    icon: "wi-sandstorm"
21843                }, {
21844                    priority: 12,
21845                    keys: ["VCDS"],
21846                    text: "Dust storm in vicinity",
21847                    icon: "wi-dust"
21848                }, {
21849                    priority: 13,
21850                    keys: ["SA"],
21851                    text: "Sand",
21852                    icon: "wi-sandstorm"
21853                }, {
21854                    priority: 13,
21855                    keys: ["BLSA"],
21856                    text: "Blowing sand",
21857                    icon: "wi-sandstorm"
21858                }, {
21859                    priority: 13,
21860                    keys: ["VCBLSA"],
21861                    text: "Blowing sand in vicinity",
21862                    icon: "wi-sandstorm"
21863                }, {
21864                    priority: 13,
21865                    keys: ["BLDU"],
21866                    text: "Blowing dust",
21867                    icon: "wi-dust"
21868                }, {
21869                    priority: 13,
21870                    keys: ["VCBLDU"],
21871                    text: "Blowing dust in vicinity",
21872                    icon: "wi-dust"
21873                }, {
21874                    priority: 13,
21875                    keys: ["BLPY"],
21876                    text: "Blowing spray",
21877                    icon: "wi-dust"
21878                }, {
21879                    priority: 14,
21880                    keys: ["DU"],
21881                    text: "Dust",
21882                    icon: "wi-dust"
21883                }, {
21884                    priority: 15,
21885                    keys: ["GR", "SHGR", "+GR", "+SHGR"],
21886                    text: "Hail",
21887                    icon: "wi-hail"
21888                }, {
21889                    priority: 16,
21890                    keys: ["GS", "SHGS", "+GS", "+SHGS"],
21891                    text: "Hail / Snow pellets",
21892                    icon: "wi-hail"
21893                }, {
21894                    priority: 17,
21895                    keys: ["-GR", "-SHGR"],
21896                    text: "Light hail",
21897                    icon: "wi-hail"
21898                }, {
21899                    priority: 18,
21900                    keys: ["-GS", "-SHGS"],
21901                    text: "Light hail / Snow pellets",
21902                    icon: "wi-hail"
21903                }, {
21904                    priority: 19,
21905                    keys: ["SG"],
21906                    text: "Snow grains",
21907                    icon: "wi-snow"
21908                }, {
21909                    priority: 20,
21910                    keys: ["PL"],
21911                    text: "Ice pellets",
21912                    icon: "wi-sleet"
21913                }, {
21914                    priority: 20,
21915                    keys: ["PL", "PE", "SHPL", "SHPE"],
21916                    text: "Ice pellets",
21917                    icon: "wi-sleet"
21918                }, {
21919                    priority: 21,
21920                    keys: ["FZDZ", "+FZDZ"],
21921                    text: "Freezing drizzle",
21922                    icon: "wi-sleet"
21923                }, {
21924                    priority: 22,
21925                    keys: ["-FZDZ"],
21926                    text: "Light freezing drizzle",
21927                    icon: "wi-sleet"
21928                }, {
21929                    priority: 23,
21930                    keys: ["FZRA", "+FZRA"],
21931                    text: "Freezing rain",
21932                    icon: "wi-sleet"
21933                }, {
21934                    priority: 24,
21935                    keys: ["-FZRA"],
21936                    text: "Light freezing rain",
21937                    icon: "wi-sleet"
21938                }, {
21939                    priority: 25,
21940                    keys: ["RA SN"],
21941                    text: "Rain / Snow",
21942                    icon: "wi-sleet"
21943                }, {
21944                    priority: 25,
21945                    keys: ["+RA SN"],
21946                    text: "Heavy rain / Snow",
21947                    icon: "wi-sleet"
21948                }, {
21949                    priority: 25,
21950                    keys: ["RA +SN"],
21951                    text: "Rain / Heavy snow",
21952                    icon: "wi-sleet"
21953                }, {
21954                    priority: 25,
21955                    keys: ["+RA +SN"],
21956                    text: "Heavy rain / Heavy snow",
21957                    icon: "wi-sleet"
21958                }, {
21959                    priority: 25,
21960                    keys: ["DZ SN"],
21961                    text: "Drizze / Snow",
21962                    icon: "wi-sleet"
21963                }, {
21964                    priority: 25,
21965                    keys: ["+DZ SN"],
21966                    text: "Heavy drizzle / Snow",
21967                    icon: "wi-sleet"
21968                }, {
21969                    priority: 25,
21970                    keys: ["DZ +SN"],
21971                    text: "Drizzle / Heavy snow",
21972                    icon: "wi-sleet"
21973                }, {
21974                    priority: 25,
21975                    keys: ["+DZ +SN"],
21976                    text: "Heavy drizzle / Snow",
21977                    icon: "wi-sleet"
21978                }, {
21979                    priority: 26,
21980                    keys: ["-RA -SN"],
21981                    text: "Light rain / Light snow",
21982                    icon: "wi-sleet"
21983                }, {
21984                    priority: 26,
21985                    keys: ["-RA SN"],
21986                    text: "Light rain / Snow",
21987                    icon: "wi-sleet"
21988                }, {
21989                    priority: 26,
21990                    keys: ["-DZ -SN"],
21991                    text: "Light drizzle / Light snow",
21992                    icon: "wi-sleet"
21993                }, {
21994                    priority: 26,
21995                    keys: ["-DZ SN"],
21996                    text: "Light drizzle / Snow",
21997                    icon: "wi-sleet"
21998                }, {
21999                    priority: 27,
22000                    keys: ["SHRA SN"],
22001                    text: "Rain showers / Snow",
22002                    icon: "wi-rain-mix"
22003                }, {
22004                    priority: 27,
22005                    keys: ["SHSN RA"],
22006                    text: "Snow showers / Rain",
22007                    icon: "wi-rain-mix"
22008                }, {
22009                    priority: 27,
22010                    keys: ["+SHRA SN"],
22011                    text: "Heavy rain showers / Snow",
22012                    icon: "wi-rain-mix"
22013                }, {
22014                    priority: 27,
22015                    keys: ["+SHSN RA"],
22016                    text: "Heavy snow showers / Rain",
22017                    icon: "wi-rain-mix"
22018                }, {
22019                    priority: 28,
22020                    keys: ["-SHRA SN"],
22021                    text: "Light rain showers / Snow",
22022                    icon: "wi-rain-mix"
22023                }, {
22024                    priority: 28,
22025                    keys: ["-SHSN RA"],
22026                    text: "Light snow showers / Rain",
22027                    icon: "wi-rain-mix"
22028                }, {
22029                    priority: 28,
22030                    keys: ["-SHRA -SN"],
22031                    text: "Light rain showers / Light snow",
22032                    icon: "wi-rain-mix"
22033                }, {
22034                    priority: 28,
22035                    keys: ["-SHSN -RA"],
22036                    text: "Light snow showers / Light rain",
22037                    icon: "wi-rain-mix"
22038                }, {
22039                    priority: 29,
22040                    keys: ["SHSN"],
22041                    text: "Snow showers",
22042                    icon: "wi-snow"
22043                }, {
22044                    priority: 29,
22045                    keys: ["+SHSN"],
22046                    text: "Heavy snow showers",
22047                    icon: "wi-snow"
22048                }, {
22049                    priority: 30,
22050                    keys: ["-SHSN"],
22051                    text: "Light snow showers",
22052                    icon: "wi-snow"
22053                }, {
22054                    priority: 31,
22055                    keys: ["IC"],
22056                    text: "Ice crystals",
22057                    icon: "wi-snowflake-cold"
22058                }, {
22059                    priority: 32,
22060                    keys: ["UP"],
22061                    text: "Unknown precipitation",
22062                    icon: "wi-sprinkle"
22063                }, {
22064                    priority: 33,
22065                    keys: ["TS"],
22066                    text: "Thunderstorm",
22067                    icon: "wi-thunderstorm"
22068                }, {
22069                    priority: 34,
22070                    keys: ["DZ RA"],
22071                    text: "Drizzle / Rain",
22072                    icon: "wi-rain-mix"
22073                }, {
22074                    priority: 34,
22075                    keys: ["+DZ RA"],
22076                    text: "Heavy drizzle / Rain",
22077                    icon: "wi-rain-mix"
22078                }, {
22079                    priority: 34,
22080                    keys: ["DZ +RA"],
22081                    text: "Drizzle / Heavy rain",
22082                    icon: "wi-rain-mix"
22083                }, {
22084                    priority: 34,
22085                    keys: ["+DZ +RA"],
22086                    text: "Heavy drizzle / Heavy rain",
22087                    icon: "wi-rain-mix"
22088                }, {
22089                    priority: 35,
22090                    keys: ["DZ -RA"],
22091                    text: "Drizzle / Light rain",
22092                    icon: "wi-rain-mix"
22093                }, {
22094                    priority: 35,
22095                    keys: ["-DZ RA"],
22096                    text: "Light drizzle / Rain",
22097                    icon: "wi-rain-mix"
22098                }, {
22099                    priority: 35,
22100                 
22100   keys: ["-DZ -RA"],
22101                    text: "Light drizzle / Light rain",
22102                    icon: "wi-rain-mix"
22103                }, {
22104                    priority: 36,
22105                    keys: ["+SN"],
22106                    text: "Heavy snow",
22107                    icon: "wi-snow"
22108                }, {
22109                    priority: 37,
22110                    keys: ["+RA"],
22111                    text: "Heavy rain",
22112                    icon: "wi-rain"
22113                }, {
22114                    priority: 38,
22115                    keys: ["SH"],
22116                    text: "Showers",
22117                    icon: "wi-showers"
22118                }, {
22119                    priority: 38,
22120                    keys: ["+SH"],
22121                    text: "Heavy showers",
22122                    icon: "wi-showers"
22123                }, {
22124                    priority: 38,
22125                    keys: ["SHRA"],
22126                    text: "Rain showers",
22127                    icon: "wi-showers"
22128                }, {
22129                    priority: 38,
22130                    keys: ["+SHRA"],
22131                    text: "Heavy rain showers",
22132                    icon: "wi-showers"
22133                }, {
22134                    priority: 39,
22135                    keys: ["+DZ"],
22136                    text: "Heavy drizzle",
22137                    icon: "wi-sleet"
22138                }, {
22139                    priority: 40,
22140                    keys: ["SN"],
22141                    text: "Snow",
22142                    icon: "wi-snow"
22143                }, {
22144                    priority: 41,
22145                    keys: ["RA"],
22146                    text: "Rain",
22147                    icon: "wi-rain"
22148                }, {
22149                    priority: 42,
22150                    keys: ["DZ"],
22151                    text: "Drizzle",
22152                    icon: "wi-sprinkle"
22153                }, {
22154                    priority: 43,
22155                    keys: ["-SN"],
22156                    text: "Light snow",
22157                    icon: "wi-snow"
22158                }, {
22159                    priority: 44,
22160                    keys: ["-RA"],
22161                    text: "Light rain",
22162                    icon: "wi-showers"
22163                }, {
22164                    priority: 45,
22165                    keys: ["-SH"],
22166                    text: "Light showers",
22167                    icon: "wi-showers"
22168                }, {
22169                    priority: 45,
22170                    keys: ["-SHRA"],
22171                    text: "Light rain showers",
22172                    icon: "wi-showers"
22173                }, {
22174                    priority: 46,
22175                    keys: ["-DZ"],
22176                    text: "Light drizzle",
22177                    icon: "wi-sprinkle"
22178                }, {
22179                    priority: 47,
22180                    keys: ["DRSN"],
22181                    text: "Drifting snow",
22182                    icon: "wi-sandstorm"
22183                }, {
22184                    priority: 48,
22185                    keys: ["BLSN"],
22186                    text: "Blowing snow",
22187                    icon: "wi-sandstorm"
22188                }, {
22189                    priority: 48,
22190                    keys: ["VCBLSN"],
22191                    text: "Blowing snow in vicinity",
22192                    icon: "wi-sandstorm"
22193                }, {
22194                    priority: 49,
22195                    keys: ["FZFG"],
22196                    text: "Freezing fog",
22197                    icon: "wi-fog"
22198                }, {
22199                    priority: 50,
22200                    keys: ["VCTS"],
22201                    text: "Thunderstorm in vicinity",
22202                    icon: "wi-thunderstorm"
22203                }, {
22204                    priority: 51,
22205                    keys: ["VCSH"],
22206                    text: "Showers in vicinity",
22207                    icon: "wi-showers"
22208                }, {
22209                    priority: 52,
22210                    keys: ["FG"],
22211                    text: "Fog",
22212                    icon: "wi-fog"
22213                }, {
22214                    priority: 53,
22215                    keys: ["PRFG"],
22216                    text: "Partial fog",
22217                    icon: "wi-fog"
22218                }, {
22219                    priority: 54,
22220                    keys: ["BCFG"],
22221                    text: "Patchy fog",
22222                    icon: "wi-fog"
22223                }, {
22224                    priority: 55,
22225                    keys: ["VCFG"],
22226                    text: "Fog in vicinity",
22227                    icon: "wi-fog"
22228                }, {
22229                    priority: 56,
22230                    keys: ["MIFG"],
22231                    text: "Shallow fog",
22232                    icon: "wi-fog"
22233                }, {
22234                    priority: 57,
22235                    keys: ["VIRGA"],
22236                    text: "Virga",
22237                    icon: "wi-rain-wind"
22238                }, {
22239                    priority: 58,
22240                    keys: ["BR"],
22241                    text: "Mist",
22242                    icon: "wi-fog"
22243                }, {
22244                    priority: 59,
22245                    keys: ["HZ"],
22246                    text: "Haze",
22247                    icon: "wi-fog"
22248                }];
22249            }
22250        }
22251    });
22252
22253    return WeatherService;
22254})();
22255
22256WeatherService.$inject = ["$http", "$q"];
22257
22258module.exports = WeatherService;
22259
22260},{}],144:[function(require,module,exports){
22261"use strict";
22262
22263var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
22264
22265var WeatherService = _interopRequire(require("./services/WeatherService"));
22266
22267var WeatherWidget = _interopRequire(require("./directives/WeatherWidget"));
22268
22269(function (angular) {
22270    "use strict";
22271
22272    var weatherApp = angular.module("AopaWeatherWidget", ["ngMaterial"]);
22273
22274    weatherApp.service("weatherService", WeatherService);
22275    weatherApp.directive("weatherWidget", WeatherWidget.directiveFactory);
22276})(window.angular);
22277
22278},{"./directives/WeatherWidget":141,"./services/WeatherService":143}],145:[function(require,module,exports){
22279//Add span Classes to the Checkbox and Radio buttons for Web Forms for Marketers
22280"use strict";
22281
22282$("<span></span>").insertAfter(".radio label input");
22283$("<span></span>").insertAfter(".checkbox label input");
22284$(".form-group:has(select)").addClass("form-group--select");
22285$(".form-control.datepicker").datepicker({ dateFormat: "dd-M-yy" });
22286
22287},{}],146:[function(require,module,exports){
22288
22289// Applies only to URLs within Training and Safety section   
22290"use strict";
22291
22292if (window.location.href.indexOf("/training-and-safety") > 0) {
22293    // Excludes /cfis and /lapsed-pilots sections
22294    if (window.location.href.indexOf("/cfis") == -1 && window.location.href.indexOf("/lapsed-pilots") == -1) {
22295        var ycfHTML;
22296
22297        (function () {
22298            var AOPAModal =
22299
22300            // Begin PPS Modal --------------------------------------------------------- //
22301
22302            // Default constructor for AOPAModal class
22303            function (params) {
22304
22305                // Properties from params parameter
22306                var properties = jQuery.extend({
22307                    id: null,
22308                    title: null,
22309                    bodyText: null,
22310                    imageURL: null,
22311                    customContent: null,
22312                    customContentPages: [],
22313                    widthPercent: null,
22314                    maxWidthPixels: null,
22315                    anchored: null,
22316                    useNavButtons: false,
22317                    ctaButtonText: null,
22318                    ctaRedirectURL: null,
22319                    ctaFunction: null,
22320                    ctaLeaveOpen: false,
22321                    cancelButtonText: null,
22322                    ctaButtons: [],
22323                    setupFunction: null,
22324                    checkCookie: false,
22325                    cookieName: null,
22326                    cookieDuration: null,
22327                    cookieSetAction: [],
22328                    customData: null
22329                }, params);
22330
22331                // Setup default properties
22332                this.id = properties.id;
22333                this.title = properties.title;
22334                this.bodyText = properties.bodyText;
22335                this.imageURL = properties.imageURL;
22336                this.customContent = properties.customContent;
22337                this.customContentPages = properties.customContentPages;
22338                this.widthPercent = properties.widthPercent;
22339                this.maxWidthPixels = properties.maxWidthPixels;
22340                this.anchored = properties.anchored;
22341                this.useNavButtons = properties.useNavButtons;
22342                this.ctaButtonText = properties.ctaButtonText;
22343                this.ctaRedirectURL = properties.ctaRedirectURL;
22344                this.ctaFunction = properties.ctaFunction;
22345                this.ctaLeaveOpen = properties.ctaLeaveOpen;
22346                this.cancelButtonText = properties.cancelButtonText;
22347                this.ctaButtons = properties.ctaButtons;
22348                this.setupFunction = properties.setupFunction;
22349                this.checkCookie = properties.checkCookie;
22350                this.cookieName = properties.cookieName;
22351                this.cookieDuration = properties.cookieDuration; // int (Days)
22352                this.cookieSetAction = properties.cookieSetAction;
22353                this.customData = properties.customData;
22354
22355                var anchored = this.anchored ? "aopaModalAnchored" : "aopaM
22355odalCentered";
22356                var title = this.title ? "<h3>" + this.title + "</h3>" : "";
22357                var navButtons = this.useNavButtons ? "<a class=\"aopaModal-backButton\">&lt; Back</a><a class=\"aopaModal-nextButton\">Next &gt;</a>" : "";
22358                var dataCookieName = this.cookieName ? "data-cookiename=\"" + this.cookieName + "\"" : "";
22359                var dataCookieDuration = this.cookieDuration ? "data-cookieduration=\"" + this.cookieDuration + "\"" : "";
22360
22361                // Cookie Set Actions are: show, dismiss, cta, all
22362                var dataCookieSetAction = "data-cookiesetaction='[" + arrayToDataString(this.cookieSetAction) + "]'";
22363
22364                // Default HTML of modal window / additional elements will be appended below
22365                var modalDivHTML = "<div class=\"aopaModal-overlay\" id=\"" + this.id + "\" data-checkcookie=\"" + this.checkCookie + "\" " + dataCookieName + " " + dataCookieDuration + " " + dataCookieSetAction + "> \n<div class=\"aopaModal " + anchored + "\">    <div class=\"aopaModal-headerBar\">        <div class=\"aopaModal-pageButtons\">            " + navButtons + "        </div>        <div class=\"aopaModal-close\">            <svg id=\"x\" viewBox=\"-291 253 56 56\">                <path d=\"M-280.4,294.1l13.1-13.1l-13.1-13.1l4.4-4.4l13.1,13.1l13.1-13.1l4.4,4.4l-13.1,13.1l13.1,13.1l-4.4,4.4l-13.1-13.1  l-13.1,13.1L-280.4,294.1z\"></path>            </svg>        </div>    </div>    <div class=\"aopaModal-main\">        <div class=\"aopaModal-imageContainer\"></div>        <div class=\"aopaModal-contentContainer\">            " + title + "        </div>        <div class=\"aopaModal-customContainer\"></div>        <div class=\"aopaModal-actionContainer\"></div>    </div></div></div>";
22366
22367                // Append modal div html (above) to HTML body, and hide
22368                var modalDiv = jQuery(modalDivHTML).appendTo("body").hide();
22369                $(modalDiv).data("setupobject", self);
22370
22371                // Passable data container for "this" context, to handle passing to private methods
22372                var self = this;
22373
22374                if (this.imageURL) {
22375                    // Image, if any, to display above heading
22376                    jQuery("#" + this.id + " .aopaModal-imageContainer").append("<img src=\"" + this.imageURL + "\">");
22377                }
22378                if (this.bodyText) {
22379                    // Body text of modal: default single <p> tag / use customContent below for longer content
22380                    jQuery("#" + this.id + " .aopaModal-contentContainer").append("<p>" + this.bodyText + "</p>");
22381                }
22382
22383                if (this.widthPercent) {
22384                    // Percent width modal will try to hit, at pixel sizes narrower than max-width (below)
22385                    jQuery("#" + this.id + " .aopaModal").css("width", "" + this.widthPercent + "%");
22386                }
22387                if (this.maxWidthPixels) {
22388                    // Max width in pixels, overrides widthPercent above, at larger screens
22389                    jQuery("#" + this.id + " .aopaModal").css("max-width", "" + this.maxWidthPixels + "px");
22390                }
22391                if (this.customContent) {
22392                    // If custom content HTML is provided, append that HTML to a div inside .aopaModal-customContainer
22393                    //jQuery(`#${this.id} .aopaModal-customContainer`).append(`<div class="customContainer">${this.customContent}</div>`);
22394                    page = { content: this.customContent };
22395                    AddPage(self, page);
22396                }
22397
22398                jQuery(".aopaModal").click(function (event) {
22399                    event.stopPropagation(); // Stop clickthrough on modal content
22400                });
22401
22402                // Close / Close-button click
22403                jQuery("#" + this.id + " .aopaModal .aopaModal-close").click(function () {
22404                    //jQuery(`#${self.id}`).hide();
22405                    hideAOPAModal(self.id);
22406                });
22407
22408                // If a default button is provided by the constructor (ctaButtonText, ctaRedirectURL, ctaFunction), set it up here
22409                // (only ctaButtonText is required for this to be set up)
22410                if (this.ctaButtonText) {
22411
22412                    // Add a default button with this label
22413                    defaultButton = {
22414                        text: this.ctaButtonText,
22415                        "function": this.ctaFunction,
22416                        url: this.ctaRedirectURL,
22417                        //newWindow: true               // If link should open in new window
22418                        leaveOpen: this.ctaLeaveOpen // If clicking the CTA should not close the modal
22419                    };
22420                    // Add this button to the first index of this modal's ctaButtons array
22421                    this.ctaButtons.unshift(defaultButton);
22422                }
22423
22424                // Create a CTA button for each button parameter passed to the ctaButtons array in the modal constructor
22425                var i = 0;
22426                if (this.ctaButtons.length > 0) {
22427                    this.ctaButtons.forEach(function (button) {
22428                        CreateCTAButton(self, button, i);
22429                        i++;
22430                    });
22431                }
22432
22433                // Create a cancel button if text is provided (closes the modal with no extra functions)
22434                if (this.cancelButtonText) {
22435                    jQuery("#" + this.id + " .aopaModal-actionContainer").append("<button class=\"aopaModal-action modal
22435-cancelAction\" data-aopaModal-id=\"" + this.id + "\">" + this.cancelButtonText + "</button>");
22436                }
22437
22438                var j = 0;
22439                if (this.customContentPages.length > 0) {
22440                    this.customContentPages.forEach(function (page) {
22441                        AddPage(self, page);
22442                        j++;
22443                    });
22444
22445                    totalPageCount = $("#" + this.id + " .aopaModal-customContainer .customContainer").size();
22446
22447                    percent = 0;
22448                    for (var i = 0; i < totalPageCount; i++) {
22449                        var left = percent + 100 * i;
22450                        $("#" + this.id + " .aopaModal-customContainer .customContainer").eq(i).css("left", "" + left + "%").css("position", "absolute").css("top", "0").attr("data-left", "" + left).css("width", "100%").attr("data-modalpage", "" + i).hide();
22451                        if (i == 0) $("#" + this.id + " .aopaModal-customContainer .customContainer").eq(i).css("position", "relative");
22452                    }
22453
22454                    // Show first page by default
22455                    $("#" + this.id + " .aopaModal-customContainer .customContainer").eq(0).show();
22456                    $("#" + this.id + " .aopaModal").addClass("aopaModalPaginated");
22457                }
22458
22459                jQuery("#" + this.id).attr("data-currentpage", 0);
22460                jQuery("#" + this.id).attr("data-totalpagecount", $("#" + this.id + " .aopaModal-customContainer .customContainer").size());
22461
22462                // Close / Background click
22463                jQuery("#" + this.id + ".aopaModal-overlay, .modal-cancelAction").click(function () {
22464                    //jQuery(`#${self.id}`).hide();
22465                    hideAOPAModal("" + self.id);
22466                });
22467
22468                // Call passed setup function while still inside the loop
22469                // Allows for data bindings, event handlers, etc., inside the setup context (after objects have been instantiated)
22470                if (this.setupFunction) {
22471                    this.setupFunction();
22472                }
22473            };
22474
22475            var AddPage =
22476
22477            // Setup function for addition custom content pages
22478            function (modalData, pageData) {
22479                jQuery("#" + modalData.id + " .aopaModal-customContainer").first().append("<div class=\"customContainer\">" + pageData.content + "</div>");
22480            };
22481
22482            var CreateCTAButton =
22483
22484            // Setup function for modal CTA buttons
22485            function (modalData, buttonData, i) {
22486                var hide = arguments[3] === undefined ? true : arguments[3];
22487
22488                // Create button element in .aopaModal-actionContainer
22489                jQuery("#" + modalData.id + " .aopaModal-actionContainer").append("<button class=\"aopaModal-action aopaModal-ctaButton\" id=\"" + modalData.id + "-btn" + i + "\" data-aopaModal-id=\"" + modalData.id + "\" data-button-id=\"" + i + "\">" + buttonData.text + "</button>");
22490
22491                // Set up click eventHandler
22492                jQuery("#" + modalData.id + " .aopaModal #" + modalData.id + "-btn" + i).click(function () {
22493
22494                    // Hide modal by default
22495                    if (!buttonData.leaveOpen) {
22496                        jQuery("#" + modalData.id).hide();
22497                    }
22498
22499                    // ID of this particular button, from data-button-id attribute
22500                    var buttonID = jQuery(this).attr("data-button-id");
22501
22502                    // Function and URL are optional parameters, will attempt both functions if both are present
22503                    //  function:    Calls any function passed to this modal as a parameter in its constructor
22504                    //  url:         Redirects window to url after calling function
22505
22506                    // Call any function attached
22507                    if (modalData.ctaButtons[buttonID]["function"]) {
22508                        modalData.ctaButtons[buttonID]["function"]();
22509                        CheckCookieSetAction(modalData.id, "cta");
22510                    }
22511
22512                    // Redirect, if URL is not null
22513                    if (modalData.ctaButtons[buttonID].url) {
22514                        // Open new window if "newWindow" was set to true
22515                        if (modalData.ctaButtons[buttonID].newWindow) {
22516                            window.open(modalData.ctaButtons[buttonID].url, "_blank");
22517                        } else {
22518                            window.location.href = modalData.ctaButtons[buttonID].url;
22519                        }
22520                    }
22521
22522                    // Console log error message if neither button function is attached
22523                    if (!modalData.ctaButtons[buttonID].url && !modalData.ctaButtons[buttonID]["function"]) {
22524                        console.log("Warning: no CTA function or CTA Redirect URL provided");
22525                    }
22526                });
22527            };
22528
22529            var AOPAModalGoToPage =
22530
22531            // Go to AOPA Modal page by modal id, to provided page index
22532            function (modalID, pageIndex) {
22533
22534                var pageContainers = $("#" + modalID + " .aopaModal-customContainer .customContainer");
22535                var pageCount = pageContainers.size();
22536                var page = pageContainers.eq(pageIndex);
22537
22538                var pageCurrentOffset = page.attr("data-left");
22539                var pageDelta = 0 - pageCurrentOffset;
22540
22541                var heights = new Array();
22542                for (var i = 0; i < pageCount; i++) {
22543                    heights[i] = pageContainers.eq(i).height();
22544                    pageContainers.eq(i).show();
22545                }
22546                pageContainers.parent().animate({
22547                    height: "" + page.height() + "px"
22548                }, 350, "swing");
22549
22550                $("#" + modalID + " .aopaModal-main").animate({
22551                    scrollTop: 0
22552                }, 350, "swing");
22553
22554                var percent = 0;
22555                for (i = 0; i < pageCount; i++) {
22556                    var thisPage = pageContainers.eq(i);
22557                    var dataLeft = thisPage.attr("data-left");
22558                    var end = parseInt(dataLeft) + pageDelta;
22559                    thisPage.attr("data-left", end);
22560                    thisPage.animate({
22561                        left: "" + end + "%"
22562                    }, {
22563                        duration: 350,
22564                        easing: "swing",
22565                        done: function done() {
22566                            // Functionality after page transition
22567                            if ($(this).attr("data-left") == 0) {
22568                                $(this).css("position", "relative");
22569                            } else {
22570                                $(this).hide().css("position", "absolute");
22571                            }
22572                        }
22573                    });
22574                }
22575
22576                $("#" + modalID).attr("data-currentpage", pageIndex);
22577                if (pageIndex > 0) {
22578                    $("#" + modalID + " .aopaModal-backButton").show();
22579                } else {
22580                    $("#" + modalID + " .aopaModal-backButton").hide();
22581                }
22582            };
22583
22584            var AOPAModalNextPage =
22585
22586            // Next and previous pages, invoking AOPAModalGoToPage with gated increment/decrement
22587            function (modalID) {
22588
22589                // Current page and total page count, from the data-currentpage attr of the modal parent
22590                currentPage = parseInt($("#" + modalID).attr("data-currentpage"));
22591                totalPages = parseInt($("#" + modalID).attr("data-totalpagecount"));
22592
22593                // Check range before advancing
22594                if (currentPage + 1 >= totalPages) return;
22595                AOPAModalGoToPage(modalID, currentPage + 1);
22596            };
22597
22598            var AOPAModalPrevPage = function (modalID) {
22599
22600                // Current page, from the data-currentpage attr of the modal parent
22601                currentPage = parseInt($("#" + modalID).attr("data-currentpage"));
22602
22603                // Check range before reversing
22604                if (currentPage - 1 < 0) return;
22605                AOPAModalGoToPage(modalID, currentPage - 1);
22606            };
22607
22608            var showAOPAModal =
22609
22610            // Show Modal, register Esc key eventlistener
22611            function (id) {
22612
22613                // Set the vertical scroll value to a document style property, to return to
22614                // (For fixed background, below)
22615                var scrollY = "" + window.scrollY + "px";
22616
22617                // Check for existing cookie, exit if found
22618                if (CheckCookie(id)) {
22619                    //console.log("Cookie already set.");
22620                    return;
22621                }
22622
22623                jQuery("#" + id).show();
22624
22625                // Set explicit width for any customContainers, to prevent resizing during page transition
22626                //$('.aopaModal-customContainer .customContainer').outerWidth($('.aopaModal-customContainer .customContainer').outerWidth());
22627
22628                // Hide modal on Esc press, unregister listener
22629                $(document).on("keyup", function (evt) {
22630                    if (evt.keyCode == 27) {
22631                        // Esc key event
22632                        hideAOPAModal(id);
22633                        // Unregister Esc key listener if pressed
22634                        $(document).off("keyup");
22635                    }
22636                });
22637
22638                // Set fixed background on the page, while modal is active
22639                var body = document.body;
22640                body.style.position = "fixed";
22641                body.style.width = "100%";
22642                body.style.paddingRight = "17px";
22643                body.style.top = "-" + scrollY;
22644
22645                CheckCookieSetAction(id, "show");
22646            };
22647
22648            var CheckCookie =
22649
22650            // Check if cookie is set on client -- returns true (found) or false (not found)
22651            function (id) {
22652
22653                // Exit if data-checkcookie is false (not checking for cookies) / This is set up in the constructor
22654                var checkCookie = jQuery("#" + id).data("checkcookie");
22655                if (!checkCookie) return false;
22656
22657                // Check for data-cookiename, set up in constructor / Exit if none is provided (cannot check)
22658                var cookieName = jQuery("#" + id).data("cookiename");
22659                if (!cookieName) return false;
22660
22661                // Check for cookie and return found value (true) or false
22662                return ClientGetCookie(cookieName);
22663            };
22664
22665            var CheckCookieSetAction =
22666
22667            // Check if there is a cookieSetAction matching this keyword, and set cookie if found
22668            // Keywords are 'show', 'dismiss', 'cta', and 'all' -- Every case passes if 'all' is provided
22669            function (id, keyword) {
22670
22671                var cookieSetAction = jQuery("#" + id).data("cookiesetaction");
22672                if (cookieSetAction.includes(keyword) || cookieSetAction.includes("all")) {
22673                    SetCookie(id);
22674                }
22675            };
22676
22677            var SetCookie =
22678
22679            // Set cookie by Modal ID
22680            function (id) {
22681                var cookieName = $("#" + id).data("cookiename");
22682                var duration = $("#" + id).data("cookieduration");;
22683                if (cookieName && duration) {
22684                    ClientSetCookie(cookieName, duration, true);
22685                }
22686            };
22687
22688            var ClientSetCookie =
22689
22690            // Store cookie (string), duration(days), value (boolean)
22691            function (cookiename, duration, val) {
22692                var expiryDate = new Date();
22693                expiryDate.setTime(expiryDate.getTime() + duration * 24 * 60 * 60 * 1000);
22694                expiryDate = expiryDate.toUTCString();
22695                console.log("Cookie " + cookiename + " set, expires: " + expiryDate);
22696                document.cookie = "" + cookiename + " = " + val + "; expires = " + expiryDate;
22697            };
22698
22699            var ClientGetCookie =
22700
22701            // Retrieve cookie if set
22702            function (cookieName) {
22703                var name = cookieName + "=";
22704                var decodedCookie = decodeURIComponent(document.cookie);
22705                var decodedArray = decodedCookie.split(";");
22706                for (var i = 0; i < decodedArray.length; i++) {
22707                    var decodedIndex = decodedArray[i];
22708                    while (decodedIndex.charAt(0) == " ") {
22709                        decodedIndex = decodedIndex.substring(1);
22710                    }
22711                    if (decodedIndex.indexOf(name) == 0) {
22712                        return decodedIndex.substring(name.length, decodedIndex.length);
22713                    }
22714                }
22715                return false;
22716            };
22717
22718            var ClientCheckCookie =
22719
22720            // Check for existing cookie by name (global)
22721            function (cookiename) {
22722                return ClientGetCookie(cookiename);
22723            };
22724
22725            var hideAOPAModal =
22726
22727            // Hide Modal, unset fixed scrolling, invoke "dismiss" cookie action if set
22728            function (id) {
22729
22730                jQuery("#" + id).hide();
22731
22732                var body = document.body;
22733                var scrollY = body.style.top;
22734                body.style.position = "";
22735                body.style.top = "";
22736                body.style.paddingRight = "";
22737                window.scrollTo(0, parseInt(scrollY || "0") * -1);
22738
22739                CheckCookieSetAction(id, "dismiss");
22740            };
22741
22742            var arrayToDataString = function (array) {
22743                var dataArray = new Array();
22744                for (var i = 0; i < array.length; i++) {
22745                    dataArray.push("\"" + array[i].toString() + "\"");
22746                }
22747                return dataArray.join(",");
22748            };
22749
22750            // End AOPA Modal ---------------------------------------------------------- //
22751
22752            ycfHTML = "\n<div id=\"ycf-form\">    <div class=\"ebook-right\">        <h2>You Can Fly!</h2>        <p class=\"ycf-specialissue-intro\">Get instant access to Flight Training's special issue titled You Can Fly: Your Path to Become a Pilot. This beginning pilots' resource guide explains what you can expect from your introductory flight through initial training—and how to turn your dream of flying into reality. Simply enter your name and email address.</p>        <div class=\"overflow-container\">            <img class=\"ycf-covers\" src=\"/-/media/Images/You-Can-Fly/Promo-Images/YCF-Special-Issue-Covers.png\">            <img class=\"ycf-sticker\" src=\"/-/media/Images/You-Can-Fly/Promo-Images/YCF-Special-Issue-Sticker.png\">        </div>        <div class=\"formcon\">            <h4>Get Your Free Guide Here!</h4>            <form action=\"https://cl.s10.exct.net/DEManager.aspx\" name=\"YCFSpecialEdForm\" id=\"YCFSpecialEdForm\" method=\"post\">                <input type=\"hidden\" name=\"_clientID\" value=\"100020598\">                <input type=\"hidden\" name=\"_deExternalKey\" value=\"F33DA1B0-06F3-4DBE-9C35-3708A2F0D7E1\">                <input type=\"hidden\" name=\"_action\" value=\"add\">                <input type=\"hidden\" name=\"_returnXML\" value=\"0\">                <input type=\"hidden\" name=\"_successURL\" value=\"https://www.nxtbook.com/nxtbooks/aopa/ft_202004/\">                <input type=\"hidden\" name=\"_errorURL\" value=\"https://www.aopa.org/landing-pages/flight-training-ycf-special-edition/flight-training-ycf-special-edition-error\">                <input type=\"hidden\" name=\"Source_Form\" value=\"YCFSpecialEdForm\">                <div class=\"formRow\">
22752                    <span>                        <label for=\"First_Name\">First Name <sup>*</sup></label>                        <input type=\"text\" name=\"First_Name\" id=\"recipient_first_name\" maxlength=\"50\" minlength=\"2\" style=\"background-repeat: no-repeat; background-attachment: scroll; background-size: 16px 18px;\" class=\"completed\">                    </span>                    <span>                        <label for=\"Last_Name\">Last Name <sup>*</sup></label>                        <input type=\"text\" name=\"Last_Name\" id=\"recipient_last_name\" maxlength=\"50\" minlength=\"2\" class=\"completed\">                    </span>                    <span>                        <label for=\"Email_Address\">Email Address <sup>*</sup></label>                        <input type=\"email\" name=\"Email_Address\" id=\"recipient_email\" maxlength=\"100\" class=\"skipped completed\">                    </span>                    <a class=\"ycf-submit button\">Submit</a>                    <p class=\"privacypolicy\">Please review AOPA’s <a href=\"https://www.aopa.org/privacy-policy\" target=\"_blank\">privacy policy</a> to learn more about how your information is used.</p>                </div>                <input style=\"display: none\" type=\"submit\" value=\"Read Now\" name=\"set\" class=\"button subbutton\" onclick=\"dataLayer.push({'event':'GTMEvent','EventCategory':'Click Tracking | FT Special Edition','EventAction':'Get Your Free Guide Here','EventLabel':'Read Now |CTA'});\">            </form>        </div>    </div></div>";
22753
22754            // YCF Modal
22755            jQuery(document).ready(function () {
22756
22757                function YCFModalSetupFunction() {
22758                    $(ycfHTML).appendTo("#aopaYCFModal .aopaModal-customContainer");
22759                }
22760
22761                function ValidateForm(id) {
22762                    var formID = $("#" + id + " #ycf-form");
22763                    var formComplete = true;
22764                    $("#" + id + " #ycf-form input").each(function (index) {
22765                        if ($(this).val()) {
22766                            $(this).removeClass("aopaModal-form-input-error");
22767                        } else {
22768                            formComplete = false;
22769                            $(this).addClass("aopaModal-form-input-error");
22770                        }
22771                    });
22772                    if (!formComplete) {
22773                        $("#" + id + " .errorMessage").show();
22774                    } else {
22775                        $("#" + id + " .errorMessage").hide();
22776                    }
22777                    return formComplete;
22778                }
22779
22780                function SubmitYCFModalForm() {
22781                    if (ValidateForm("aopaYCFModal")) {
22782                        SetCookie("aopaYCF-special");
22783                        $("#aopaYCFModal .aopaModal-customContainer form input[type=submit]").trigger("click");
22784                        //alert("Would submit form here");
22785                    }
22786                }
22787
22788                var modalYCF = new AOPAModal({
22789                    id: "aopaYCFModal",
22790                    widthPercent: 80,
22791                    maxWidthPixels: 900,
22792                    anchored: true,
22793                    checkCookie: "true",
22794                    cookieName: "aopaYCF-special",
22795                    cookieSetAction: ["all"],
22796                    cookieDuration: 14,
22797                    setupFunction: YCFModalSetupFunction
22798                });
22799
22800                $("#aopaYCFModal .aopaModal-contentContainer").css("padding", "0");
22801
22802                jQuery("#ycf-modal-test").click(function (event) {
22803                    showAOPAModal("aopaYCFModal");
22804                });
22805                jQuery("#aopaYCFModal.aopaModal-customContainer form input[type=submit]").click(function (e) {
22806                    e.preventDefault();
22807                });
22808                jQuery(".ycf-submit").click(function (event) {
22809                    SubmitYCFModalForm();
22810                });
22811
22812                jQuery("#clearCookie").click(function (event) {
22813                    document.cookie = "aopaYCF-special" + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
22814                });
22815                $("#ycf-form input").keyup(function () {
22816                    $(this).removeClass("aopaModal-form-input-error");
22817                });
22818
22819                setTimeout(function () {
22820                    showAOPAModal("aopaYCFModal");
22821                }, 2000);
22822            });
22823        })();
22824    }
22825}
22826
22827},{}],147:[function(require,module,exports){
22828/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
22829
22830*/
22831"use strict";
22832
22833(function (e, t) {
22834  var n,
22835      r,
22836      i = typeof t,
22837      o = e.location,
22838      a = e.document,
22839      s = a.documentElement,
22840      l = e.jQuery,
22841      u = e.$,
22842      c = {},
22843      p = [],
22844      f = "1.10.2",
22845      d = p.concat,
22846      h = p.push,
22847      g = p.slice,
22848      m = p.indexOf,
22849      y = c.toString,
22850      v = c.hasOwnProperty,
22851      b = f.trim,
22852      x = (function (_x) {
22853    var _xWrapper = function x(_x2, _x3) {
22854      return _x.apply(this, arguments);
22855    };
22856
22857    _xWrapper.toString = function () {
22858      return _x.toString();
22859    };
22860
22861    return _xWrapper;
22862  })(function (e, t) {
22863    return new x.fn.init(e, t, r);
22864  }),
22865      w = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
22866      T = /\S+/g,
22867      C = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
22868      N = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
22869      k = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
22870      E = /^[\],:{}\s]*$/,
22871      S = /(?:^|:|,)(?:\s*\[)+/g,
22872      A = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
22873      j = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
22874      D = /^-ms-/,
22875      L = /-([\da-z])/gi,
22876      H = function H(e, t) {
22877    return t.toUpperCase();
22878  },
22879      q = function q(e) {
22880    (a.addEventListener || "load" === e.type || "complete" === a.readyState) && (_(), x.ready());
22881  },
22882      _ = function _() {
22883    a.addEventListener ? (a.removeEventListener("DOMContentLoaded", q, !1), e.removeEventListener("load", q, !1)) : (a.detachEvent("onreadystatechange", q), e.detachEvent("onload", q));
22884  };x.fn = x.prototype = { jquery: f, constructor: x, init: function init(e, n, r) {
22885      var i, o;if (!e) {
22886        return this;
22887      }if ("string" == typeof e) {
22888        if ((i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : N.exec(e), !i || !i[1] && n)) {
22889          return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e);
22890        }if (i[1]) {
22891          if ((n = n instanceof x ? n[0] : n, x.merge(this, x.parseHTML(i[1], n && n.nodeType ? n.ownerDocument || n : a, !0)), k.test(i[1]) && x.isPlainObject(n))) for (i in n) x.isFunction(this[i]) ? this[i](n[i]) : this.attr(i, n[i]);return this;
22892        }if ((o = a.getElementById(i[2]), o && o.parentNode)) {
22893          if (o.id !== i[2]) {
22894            return r.find(e);
22895          }this.length = 1, this[0] = o;
22896        }return (this.context = a, this.selector = e, this);
22897      }return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : x.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), x.makeArray(e, this));
22898    }, selector: "", length: 0, toArray: function toArray() {
22899      return g.call(this);
22900    }, get: function get(e) {
22901      return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e];
22902    }, pushStack: function pushStack(e) {
22903      var t = x.merge(this.constructor(), e);return (t.prevObject = this, t.context = this.context, t);
22904    }, each: function each(e, t) {
22905      return x.each(this, e, t);
22906    }, ready: function ready(e) {
22907      return (x.ready.promise().done(e), this);
22908    }, slice: function slice() {
22909      return this.pushStack(g.apply(this, arguments));
22910    }, first: function first() {
22911      return this.eq(0);
22912    }, last: function last() {
22913      return this.eq(-1);
22914    }, eq: function eq(e) {
22915      var t = this.length,
22916          n = +e + (0 > e ? t : 0);return this.pushStack(n >= 0 && t > n ? [this[n]] : []);
22917    }, map: function map(e) {
22918      return this.pushStack(x.map(this, function (t, n) {
22919        return e.call(t, n, t);
22920      }));
22921    }, end: function end() {
22922      return this.prevObject || this.constructor(null);
22923    }, push: h, sort: [].sort, splice: [].splice }, x.fn.init.prototype = x.fn, x.extend = x.fn.extend = function () {
22924    var e,
22925        n,
22926        r,
22927        i,
22928        o,
22929        a,
22930        s = arguments[0] || {},
22931        l = 1,
22932        u = arguments.length,
22933        c = !1;for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, l = 2), "object" == typeof s || x.isFunction(s) || (s = {}), u === l && (s = this, --l); u > l; l++) if (null != (o = arguments[l])) for (i in o) e = s[i], r = o[i], s !== r && (c && r && (x.isPlainObject(r) || (n = x.isArray(r))) ? (n ? (n = !1, a = e && x.isArray(e) ? e : []) : a = e && x.isPlainObject(e) ? e : {}, s[i] = x.extend(c, a, r)) : r !== t && (s[i] = r));return s;
22934  }, x.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), noConflict: function noConflict(t) {
22935      return (e.$ === x && (e.$ = u), t && e.jQuery === x && (e.jQuery = l), x);
22936    }, isReady: !1, readyWait: 1, holdReady: function holdReady(e) {
22937      e ? x.readyWait++ : x.ready(!0);
22938    }, ready: function ready(e) {
22939      if (e === !0 ? ! --x.readyWait : !x.isReady) {
22940        if (!a.body) {
22941          return setTimeout(x.ready);
22942        }x.isReady = !0, e !== !0 && --x.readyWait > 0 || (n.resolveWith(a, [x]), x.fn.trigger && x(a).trigger("ready").off("ready"));
22943      }
22944    }, isFunction: function isFunction(e) {
22945      return "function" === x.type(e);
22946    }, isArray: Array.isArray || function (e) {
22947      return "array" === x.type(e);
22948    }, isWindow: function isWindow(e) {
22949      return null != e && e == e.window;
22950    }, isNumeric: function isNumeric(e) {
22951      return !isNaN(parseFloat(e)) && isFinite(e);
22952    }, type: function type(e) {
22953      return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? c[y.call(e)] || "object" : typeof e;
22954    }, isPlainObject: function isPlainObject(e) {
22955      var n;if (!e || "object" !== x.type(e) || e.nodeType || x.isWindow(e)) {
22956        return !1;
22957      }try {
22958        if (e.constructor && !v.call(e, "constructor") && !v.call(e.constructor.prototype, "isPrototypeOf")) return !1;
22959      } catch (r) {
22960        return !1;
22961      }if (x.support.ownLast) for (n in e) return v.call(e, n);for (n in e);return n === t || v.call(e, n);
22962    }, isEmptyObject: function isEmptyObject(e) {
22963      var t;for (t in e) return !1;return !0;
22964    }, error: function error(e) {
22965      throw Error(e);
22966    }, parseHTML: function parseHTML(e, t, n) {
22967      if (!e || "string" != typeof e) {
22968        return null;
22969      }"boolean" == typeof t && (n = t, t = !1), t = t || a;var r = k.exec(e),
22970          i = !n && [];return r ? [t.createElement(r[1])] : (r = x.buildFragment([e], t, i), i && x(i).remove(), x.merge([], r.childNodes));
22971    }, parseJSON: function parseJSON(n) {
22972      return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = x.trim(n), n && E.test(n.replace(A, "@").replace(j, "]").replace(S, ""))) ? Function("return " + n)() : (x.error("Invalid JSON: " + n), t);
22973    }, parseXML: function parseXML(n) {
22974      var r, i;if (!n || "string" != typeof n) {
22975        return null;
22976      }try {
22977        e.DOMParser ? (i = new DOMParser(), r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n));
22978      } catch (o) {
22979        r = t;
22980      }return (r && r.documentElement && !r.getElementsByTagName("parsererror").length || x.error("Invalid XML: " + n), r);
22981    }, noop: function noop() {}, globalEval: function globalEval(t) {
22982      t && x.trim(t) && (e.execScript || function (t) {
22983        e.eval.call(e, t);
22984      })(t);
22985    }
22985, camelCase: function camelCase(e) {
22986      return e.replace(D, "ms-").replace(L, H);
22987    }, nodeName: function nodeName(e, t) {
22988      return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase();
22989    }, each: function each(e, t, n) {
22990      var r,
22991          i = 0,
22992          o = e.length,
22993          a = M(e);if (n) {
22994        if (a) {
22995          for (; o > i; i++) if ((r = t.apply(e[i], n), r === !1)) break;
22996        } else for (i in e) if ((r = t.apply(e[i], n), r === !1)) break;
22997      } else if (a) {
22998        for (; o > i; i++) if ((r = t.call(e[i], i, e[i]), r === !1)) break;
22999      } else for (i in e) if ((r = t.call(e[i], i, e[i]), r === !1)) break;return e;
23000    }, trim: b && !b.call(" ") ? function (e) {
23001      return null == e ? "" : b.call(e);
23002    } : function (e) {
23003      return null == e ? "" : (e + "").replace(C, "");
23004    }, makeArray: function makeArray(e, t) {
23005      var n = t || [];return (null != e && (M(Object(e)) ? x.merge(n, "string" == typeof e ? [e] : e) : h.call(n, e)), n);
23006    }, inArray: function inArray(e, t, n) {
23007      var r;if (t) {
23008        if (m) {
23009          return m.call(t, e, n);
23010        }for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) {
23011          return n;
23012        }
23013      }return -1;
23014    }, merge: function merge(e, n) {
23015      var r = n.length,
23016          i = e.length,
23017          o = 0;if ("number" == typeof r) for (; r > o; o++) e[i++] = n[o];else while (n[o] !== t) e[i++] = n[o++];return (e.length = i, e);
23018    }, grep: function grep(e, t, n) {
23019      var r,
23020          i = [],
23021          o = 0,
23022          a = e.length;for (n = !!n; a > o; o++) r = !!t(e[o], o), n !== r && i.push(e[o]);return i;
23023    }, map: function map(e, t, n) {
23024      var r,
23025          i = 0,
23026          o = e.length,
23027          a = M(e),
23028          s = [];if (a) for (; o > i; i++) r = t(e[i], i, n), null != r && (s[s.length] = r);else for (i in e) r = t(e[i], i, n), null != r && (s[s.length] = r);return d.apply([], s);
23029    }, guid: 1, proxy: function proxy(e, n) {
23030      var r, i, o;return ("string" == typeof n && (o = e[n], n = e, e = o), x.isFunction(e) ? (r = g.call(arguments, 2), i = function () {
23031        return e.apply(n || this, r.concat(g.call(arguments)));
23032      }, i.guid = e.guid = e.guid || x.guid++, i) : t);
23033    }, access: function access(e, n, r, i, o, a, s) {
23034      var l = 0,
23035          u = e.length,
23036          c = null == r;if ("object" === x.type(r)) {
23037        o = !0;for (l in r) x.access(e, n, l, r[l], !0, a, s);
23038      } else if (i !== t && (o = !0, x.isFunction(i) || (s = !0), c && (s ? (n.call(e, i), n = null) : (c = n, n = function (e, t, n) {
23039        return c.call(x(e), n);
23040      })), n)) for (; u > l; l++) n(e[l], r, s ? i : i.call(e[l], l, n(e[l], r)));return o ? e : c ? n.call(e) : u ? n(e[0], r) : a;
23041    }, now: function now() {
23042      return new Date().getTime();
23043    }, swap: function swap(e, t, n, r) {
23044      var i,
23045          o,
23046          a = {};for (o in t) a[o] = e.style[o], e.style[o] = t[o];i = n.apply(e, r || []);for (o in t) e.style[o] = a[o];return i;
23047    } }), x.ready.promise = function (t) {
23048    if (!n) if ((n = x.Deferred(), "complete" === a.readyState)) setTimeout(x.ready);else if (a.addEventListener) a.addEventListener("DOMContentLoaded", q, !1), e.addEventListener("load", q, !1);else {
23049      a.attachEvent("onreadystatechange", q), e.attachEvent("onload", q);var r = !1;try {
23050        r = null == e.frameElement && a.documentElement;
23051      } catch (i) {}r && r.doScroll && (function o() {
23052        if (!x.isReady) {
23053          try {
23054            r.doScroll("left");
23055          } catch (e) {
23056            return setTimeout(o, 50);
23057          }_(), x.ready();
23058        }
23059      })();
23060    }return n.promise(t);
23061  }, x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) {
23062    c["[object " + t + "]"] = t.toLowerCase();
23063  });function M(e) {
23064    var t = e.length,
23065        n = x.type(e);return x.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e);
23066  }r = x(a), (function (e, t) {
23067    var n,
23068        r,
23069        i,
23070        o,
23071        a,
23072        s,
23073        l,
23074        u,
23075        c,
23076        p,
23077        f,
23078        d,
23079        h,
23080        g,
23081        m,
23082        y,
23083        v,
23084        b = "sizzle" + -new Date(),
23085        w = e.document,
23086        T = 0,
23087        C = 0,
23088        N = st(),
23089        k = st(),
23090        E = st(),
23091        S = !1,
23092        A = function A(e, t) {
23093      return e === t ? (S = !0, 0) : 0;
23094    },
23095        j = typeof t,
23096        D = 1 << 31,
23097        L = ({}).hasOwnProperty,
23098        H = [],
23099        q = H.pop,
23100        _ = H.push,
23101        M = H.push,
23102        O = H.slice,
23103        F = H.indexOf || function (e) {
23104      var t = 0,
23105          n = this.length;for (; n > t; t++) if (this[t] === e) return t;return -1;
23106    },
23107        B = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
23108        P = "[\\x20\\t\\r\\n\\f]",
23109        R = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
23110        W = R.replace("w", "w#"),
23111        $ = "\\[" + P + "*(" + R + ")" + P + "*(?:([*^$|!~]?=)" + P + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + W + ")|)|)" + P + "*\\]",
23112        I = ":(" + R + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + $.replace(3, 8) + ")*)|.*)\\)|)",
23113        z = RegExp("^" + P + "+|((?:^|[^\\\\])(?:\\\\.)*)" + P + "+$", "g"),
23114        X = RegExp("^" + P + "*," + P + "*"),
23115        U = RegExp("^" + P + "*([>+~]|" + P + ")" + P + "*"),
23116        V = RegExp(P + "*[+~]"),
23117        Y = RegExp("=" + P + "*([^\\]'\"]*)" + P + "*\\]", "g"),
23118        J = RegExp(I),
23119        G = RegExp("^" + W + "$"),
23120        Q = { ID: RegExp("^#(" + R + ")"), CLASS: RegExp("^\\.(" + R + ")"), TAG: RegExp("^(" + R.replace("w", "w*") + ")"), ATTR: RegExp("^" + $), PSEUDO: RegExp("^" + I), CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + P + "*(even|odd|(([+-]|)(\\d*)n|)" + P + "*(?:([+-]|)" + P + "*(\\d+)|))" + P + "*\\)|)", "i"), bool: RegExp("^(?:" + B + ")$", "i"), needsContext: RegExp("^" + P + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + P + "*((?:-\\d)?\\d*)" + P + "*\\)|)(?=[^-]|$)", "i") },
23121        K = /^[^{]+\{\s*\[native \w/,
23122        Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
23123        et = /^(?:input|select|textarea|button)$/i,
23124        tt = /^h\d$/i,
23125        nt = /'|\\/g,
23126        rt = RegExp("\\\\([\\da-f]{1,6}" + P + "?|(" + P + ")|.)", "ig"),
23127        it = function it(e, t, n) {
23128      var r = "0x" + t - 65536;return r !== r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(55296 | r >> 10, 56320 | 1023 & r);
23129    };try {
23130      M.apply(H = O.call(w.childNodes), w.childNodes), H[w.childNodes.length].nodeType;
23131    } catch (ot) {
23132      M = { apply: H.length ? function (e, t) {
23133          _.apply(e, O.call(t));
23134        } : function (e, t) {
23135          var n = e.length,
23136              r = 0;while (e[n++] = t[r++]);e.length = n - 1;
23137        } };
23138    }function at(e, t, n, i) {
23139      var o, a, s, l, u, c, d, m, y, x;if (((t ? t.ownerDocument || t : w) !== f && p(t), t = t || f, n = n || [], !e || "string" != typeof e)) {
23140        return n;
23141      }if (1 !== (l = t.nodeType) && 9 !== l) {
23142        return [];
23143      }if (h && !i) {
23144        if (o = Z.exec(e)) if (s = o[1]) {
23145          if (9 === l) {
23146            if ((a = t.getElementById(s), !a || !a.parentNode)) {
23147              return n;
23148            }if (a.id === s) {
23149              return (n.push(a), n);
23150            }
23151          } else if (t.ownerDocument && (a = t.ownerDocument.getElementById(s)) && v(t, a) && a.id === s) {
23152            return (n.push(a), n);
23153          }
23154        } else {
23155          if (o[2]) {
23156            return (M.apply(n, t.getElementsByTagName(e)), n);
23157          }if ((s = o[3]) && r.getElementsByClassName && t.getElementsByClassName) {
23158            return (M.apply(n, t.getElementsByClassName(s)), n);
23159          }
23160        }if (r.qsa && (!g || !g.test(e))) {
23161          if ((m = d = b, y = t, x = 9 === l && e, 1 === l && "object" !== t.nodeName.toLowerCase())) {
23162            c = mt(e), (d = t.getAttribute("id")) ? m = d.replace(nt, "\\$&") : t.setAttribute("id", m), m = "[id='" + m + "'] ", u = c.length;while (u--) c[u] = m + yt(c[u]);y = V.test(e) && t.parentNode || t, x = c.join(",");
23163          }if (x) try {
23164            return (M.apply(n, y.querySelectorAll(x)), n);
23165          } catch (T) {} finally {
23166            d || t.removeAttribute("id");
23167          }
23168        }
23169      }return kt(e.replace(z, "$1"), t, n, i);
23170    }function st() {
23171      var e = [];function t(n, r) {
23172        return (e.push(n += " ") > o.cacheLength && delete t[e.shift()], t[n] = r);
23173      }return t;
23174    }function lt(e) {
23175      return (e[b] = !0, e);
23176    }function ut(e) {
23177      var t = f.createElement("div");try {
23178        return !!e(t);
23179      } catch (n) {
23180        return !1;
23181      } finally {
23182        t.parentNode && t.parentNode.removeChild(t), t = null;
23183      }
23184    }function ct(e, t) {
23185      var n = e.split("|"),
23186          r = e.length;while (r--) o.attrHandle[n[r]] = t;
23187    }function pt(e, t) {
23188      var n = t && e,
23189          r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || D) - (~e.sourceIndex || D);if (r) {
23190        return r;
23191      }if (n) while (n = n.nextSibling) if (n === t) {
23192        return -1;
23193      }return e ? 1 : -1;
23194    }function ft(e) {
23195      return function (t) {
23196        var n = t.nodeName.toLowerCase();return "input" === n && t.type === e;
23197      };
23198    }function dt(e) {
23199      return function (t) {
23200        var n = t.nodeName.toLowerCase();return ("input" === n || "button" === n) && t.type === e;
23201      };
23202    }function ht(e) {
23203      return lt(function (t) {
23204        return (t = +t, lt(function (n, r) {
23205          var i,
23206              o = e([], n.length, t),
23207              a = o.length;while (a--) n[i = o[a]] && (n[i] = !(r[i] = n[i]));
23208        }));
23209      });
23210    }s = at.isXML = function (e) {
23211      var t = e && (e.ownerDocument || e).documentElement;return t ? "HTML" !== t.nodeName : !1;
23212    }, r = at.support = {}, p = at.setDocument = function (e) {
23213      var n = e ? e.ownerDocument || e : w,
23214          i = n.defaultView;return n !== f && 9 === n.nodeType && n.documentElement ? (f = n, d = n.documentElement, h = !s(n), i && i.attachEvent && i !== i.top && i.attachEvent("onbeforeunload", function () {
23215        p();
23216      }), r.attributes = ut(function (e) {
23217        return (e.className = "i", !e.getAttribute("className"));
23218      }), r.getElementsByTagName = ut(function (e) {
23219        return (e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length);
23220      }), r.getElementsByClassName = ut(function (e) {
23221        return (e.innerHTML = "<div class='a'></div><div class='a i'></div>", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length);
23222      }), r.getById = ut(function (e) {
23223        return (d.appendChild(e).id = b, !n.getElementsByName || !n.getElementsByName(b).length);
23224      }), r.getById ? (o.find.ID = function (e, t) {
23225        if (typeof t.getElementById !== j && h) {
23226          var n = t.getElementById(e);return n && n.parentNode ? [n] : [];
23227        }
23228      }, o.filter.ID = function (e) {
23229        var t = e.replace(rt, it);return function (e) {
23230          return e.getAttribute("id") === t;
23231        };
23232      }) : (delete o.find.ID, o.filter.ID = function (e) {
23233        var t = e.replace(rt, it);return function (e) {
23234          var n = typeof e.getAttributeNode !== j && e.getAttributeNode("id");return n && n.value === t;
23235        };
23236      }), o.find.TAG = r.getElementsByTagName ? function (e, n) {
23237        return typeof n.getElementsByTagName !== j ? n.getElementsByTagName(e) : t;
23238      } : function (e, t) {
23239        var n,
23240            r = [],
23241            i = 0,
23242            o = t.getElementsByTagName(e);if ("*" === e) {
23243          while (n = o[i++]) 1 === n.nodeType && r.push(n);return r;
23244        }return o;
23245      }, o.find.CLASS = r.getElementsByClassName && function (e, n) {
23246        return typeof n.getElementsByClassName !== j && h ? n.getElementsByClassName(e) : t;
23247      }, m = [], g = [], (r.qsa = K.test(n.querySelectorAll)) && (ut(function (e) {
23248        e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || g.push("\\[" + P + "*(?:value|" + B + ")"), e.querySelectorAll(":checked").length || g.push(":checked");
23249      }), ut(function (e) {
23250        var t = n.createElement("input");t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && g.push("[*^$]=" + P + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:");
23251      })), (r.matchesSelector = K.test(y = d.webkitMatchesSelector || d.mozMatchesSelector || d.oMatchesSelector || d.msMatchesSelector)) && ut(function (e) {
23252        r.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), m.push("!=", I);
23253      }), g = g.length && RegExp(g.join("|")), m = m.length && RegExp(m.join("|")), v = K.test(d.contains) || d.compareDocumentPosition ? function (e, t) {
23254        var n = 9 === e.nodeType ? e.documentElement : e,
23255            r = t && t.parentNode;return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r)));
23256      } : function (e, t) {
23257        if (t) while (t = t.parentNode) if (t === e) return !0;return !1;
23258      }, A = d.compareDocumentPosition ? function (e, t) {
23259        if (e === t) return (S = !0, 0);var i = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t);return i ? 1 & i || !r.sortDetached && t.compareDocumentPosition(e) === i ? e === n || v(w, e) ? -1 : t === n || v(w, t) ? 1 : c ? F.call(c, e) - F.call(c, t) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1;
23260      } : function (e, t) {
23261        var r,
23262            i = 0,
23263            o = e.parentNode,
23264            a = t.parentNode,
23265            s = [e],
23266            l = [t];if (e === t) return (S = !0, 0);if (!o || !a) return e === n ? -1 : t === n ? 1 : o ? -1 : a ? 1 : c ? F.call(c, e) - F.call(c, t) : 0;if (o === a) return pt(e, t);r = e;while (r = r.parentNode) s.unshift(r);r = t;while (r = r.parentNode) l.unshift(r);while (s[i] === l[i]) i++;return i ? pt(s[i], l[i]) : s[i] === w ? -1 : l[i] === w ? 1 : 0;
23267      }, n) : f;
23268    }, at.matches = function (e, t) {
23269      return at(e, null, null, t);
23270    }, at.matchesSelector = function (e, t) {
23271      if (((e.ownerDocument || e) !== f && p(e), t = t.replace(Y, "='$1']"), !(!r.matchesSelector || !h || m && m.test(t) || g && g.test(t)))) try {
23272        var n = y.call(e, t);if (n || r.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n;
23273      } catch (i) {}return at(t, f, null, [e]).length > 0;
23274    }, at.contains = function (e, t) {
23275      return ((e.ownerDocument || e) !== f && p(e), v(e, t));
23276    }, at.attr = function (e, n) {
23277      (e.ownerDocument || e) !== f && p(e);var i = o.attrHandle[n.toLowerCase()],
23278          a = i && L.call(o.attrHandle, n.toLowerCase()) ? i(e, n, !h) : t;return a === t ? r.attributes || !h ? e.getAttribute(n) : (a = e.getAttributeNode(n)) && a.specified ? a.value : null : a;
23279    }, at.error = function (e) {
23280      throw Error("Syntax error, unrecognized expression: " + e);
23281    }, at.uniqueSort = function (e) {
23282      var t,
23283          n = [],
23284          i = 0,
23285          o = 0;if ((S = !r.detectDuplicates, c = !r.sortStable && e.slice(0), e.sort(A), S)) {
23286        while (t = e[o++]) t === e[o] && (i = n.push(o));while (i--) e.splice(n[i], 1);
23287      }return e;
23288    }, a = at.getText = function (e) {
23289      var t,
23290          n = "",
23291          r = 0,
23292          i = e.nodeType;if (i) {
23293        if (1 === i || 9 === i || 11 === i) {
23294          if ("string" == typeof e.textContent) return e.textContent;for (e = e.firstChild; e; e = e.nextSibling) n += a(e);
23295        } else if (3 === i || 4 === i) return e.nodeValue;
23296      } else for (; t = e[r]; r++) n += a(t);return n;
23297    }, o = at.selectors = { cacheLength: 50, createPseudo: lt, match: Q, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function ATTR(e) {
23298          return (e[1] = e[1].replace(rt, it), e[3] = (e[4] || e[5] || "").replace(rt, it), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4));
23299        }, CHILD: function CHILD(e) {
23300          return (e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || at.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && at.error(e[0]), e);
23301        }, PSEUDO: function PSEUDO(e) {
23302          var n,
23303              r = !e[5] && e[2];return Q.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : r && J.test(r) && (n = mt(r, !0)) && (n = r.indexOf(")", r.length - n) - r.length) && (e[0] = e[0].slice(0, n), e[2] = r.slice(0, n)), e.slice(0, 3));
23304        } }, filter: { TAG: function TAG(e) {
23305          var t = e.replace(rt, it).toLowerCase();return "*" === e ? function () {
23306            return !0;
23307          } : function (e) {
23308            return e.nodeName && e.nodeName.toLowerCase() === t;
23309          };
23310        }, CLASS: function CLASS(e) {
23311          var t = N[e + " "];return t || (t = RegExp("(^|" + P + ")" + e + "(" + P + "|$)")) && N(e, function (e) {
23312            return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== j && e.getAttribute("class") || "");
23313          });
23314        }, ATTR: function ATTR(e, t, n) {
23315          return function (r) {
23316            var i = at.attr(r, e);return null == i ? "!=" === t : t ? (i += "", "=" === t ? i === n : "!=" === t ? i !== n : "^=" === t ? n && 0 === i.indexOf(n) : "*=" === t ? n && i.indexOf(n) > -1 : "$=" === t ? n && i.slice(-n.length) === n : "~=" === t ? (" " + i + " ").indexOf(n) > -1 : "|=" === t ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0;
23317          };
23318        }, CHILD: function CHILD(e, t, n, r, i) {
23319          var o = "nth" !== e.slice(0, 3),
23320              a = "last" !== e.slice(-4),
23321              s = "of-type" === t;return 1 === r && 0 === i ? function (e) {
23322            return !!e.parentNode;
23323          } : function (t, n, l) {
23324            var u,
23325                c,
23326                p,
23327                f,
23328                d,
23329                h,
23330                g = o !== a ? "nextSibling" : "previousSibling",
23331                m = t.parentNode,
23332                y = s && t.nodeName.toLowerCase(),
23333                v = !l && !s;if (m) {
23334              if (o) {
23335                while (g) {
23336                  p = t;while (p = p[g]) if (s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) return !1;h = g = "only" === e && !h && "nextSibling";
23337                }return !0;
23338              }if ((h = [a ? m.firstChild : m.lastChild], a && v)) {
23339                c = m[b] || (m[b] = {}), u = c[e] || [], d = u[0] === T && u[1], f = u[0] === T && u[2], p = d && m.childNodes[d];while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if (1 === p.nodeType && ++f && p === t) {
23340                  c[e] = [T, d, f];break;
23341                }
23342              } else if (v && (u = (t[b] || (t[b] = {}))[e]) && u[0] === T) f = u[1];else while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if ((s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) && ++f && (v && ((p[b] || (p[b] = {}))[e] = [T, f]), p === t)) break;return (f -= i, f === r || 0 === f % r && f / r >= 0);
23343            }
23344          };
23345        }, PSEUDO: function PSEUDO(e, t) {
23346          var n,
23347              r = o.pseudos[e] || o.setFilters[e.toLowerCase()] || at.error("unsupported pseudo: " + e);return r[b] ? r(t) : r.length > 1 ? (n = [e, e, "", t], o.setFilters.hasOwnProperty(e.toLowerCase()) ? lt(function (e, n) {
23348            var i,
23349                o = r(e, t),
23350                a = o.length;while (a--) i = F.call(e, o[a]), e[i] = !(n[i] = o[a]);
23351          }) : function (e) {
23352            return r(e, 0, n);
23353          }) : r;
23354        } }, pseudos: { not: lt(function (e) {
23355          var t = [],
23356              n = [],
23357              r = l(e.replace(z, "$1"));return r[b] ? lt(function (e, t, n, i) {
23358            var o,
23359                a = r(e, null, i, []),
23360                s = e.length;while (s--) (o = a[s]) && (e[s] = !(t[s] = o));
23361          }) : function (e, i, o) {
23362            return (t[0] = e, r(t, null, o, n), !n.pop());
23363          };
23364        }), has: lt(function (e) {
23365          return function (t) {
23366            return at(e, t).length > 0;
23367          };
23368        }), contains: lt(function (e) {
23369          return function (t) {
23370            return (t.textContent || t.innerText || a(t)).indexOf(e) > -1;
23371          };
23372        }), lang: lt(function (e) {
23373          return (G.test(e || "") || at.error("unsupported lang: " + e), e = e.replace(rt, it).toLowerCase(), function (t) {
23374            var n;do if (n = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-")); while ((t = t.parentNode) && 1 === t.nodeType);return !1;
23375          });
23376        }), target: function target(t) {
23377          var n = e.location && e.location.hash;return n && n.slice(1) === t.id;
23378        }, root: function root(e) {
23379          return e === d;
23380        }, focus: function focus(e) {
23381          return e === f.activeElement && (!f.hasFocus || f.hasFocus()) && !!(e.type || e.href || ~e.tabIndex);
23382        }, enabled: function enabled(e) {
23383          return e.disabled === !1;
23384        }, disabled: function disabled(e) {
23385          return e.disabled === !0;
23386        }, checked: function checked(e) {
23387          var t = e.nodeName.toLowerCase();return "input" === t && !!e.checked || "option" === t && !!e.selected;
23388        }, selected: function selected(e) {
23389          return (e.parentNode && e.parentNode.selectedIndex, e.selected === !0);
23390        }, empty: function empty(e) {
23391          for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeName >
23391 "@" || 3 === e.nodeType || 4 === e.nodeType) {
23392            return !1;
23393          }return !0;
23394        }, parent: function parent(e) {
23395          return !o.pseudos.empty(e);
23396        }, header: function header(e) {
23397          return tt.test(e.nodeName);
23398        }, input: function input(e) {
23399          return et.test(e.nodeName);
23400        }, button: function button(e) {
23401          var t = e.nodeName.toLowerCase();return "input" === t && "button" === e.type || "button" === t;
23402        }, text: function text(e) {
23403          var t;return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type);
23404        }, first: ht(function () {
23405          return [0];
23406        }), last: ht(function (e, t) {
23407          return [t - 1];
23408        }), eq: ht(function (e, t, n) {
23409          return [0 > n ? n + t : n];
23410        }), even: ht(function (e, t) {
23411          var n = 0;for (; t > n; n += 2) e.push(n);return e;
23412        }), odd: ht(function (e, t) {
23413          var n = 1;for (; t > n; n += 2) e.push(n);return e;
23414        }), lt: ht(function (e, t, n) {
23415          var r = 0 > n ? n + t : n;for (; --r >= 0;) e.push(r);return e;
23416        }), gt: ht(function (e, t, n) {
23417          var r = 0 > n ? n + t : n;for (; t > ++r;) e.push(r);return e;
23418        }) } }, o.pseudos.nth = o.pseudos.eq;for (n in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) o.pseudos[n] = ft(n);for (n in { submit: !0, reset: !0 }) o.pseudos[n] = dt(n);function gt() {}gt.prototype = o.filters = o.pseudos, o.setFilters = new gt();function mt(e, t) {
23419      var n,
23420          r,
23421          i,
23422          a,
23423          s,
23424          l,
23425          u,
23426          c = k[e + " "];if (c) {
23427        return t ? 0 : c.slice(0);
23428      }s = e, l = [], u = o.preFilter;while (s) {
23429        (!n || (r = X.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(i = [])), n = !1, (r = U.exec(s)) && (n = r.shift(), i.push({ value: n, type: r[0].replace(z, " ") }), s = s.slice(n.length));for (a in o.filter) !(r = Q[a].exec(s)) || u[a] && !(r = u[a](r)) || (n = r.shift(), i.push({ value: n, type: a, matches: r }), s = s.slice(n.length));if (!n) break;
23430      }return t ? s.length : s ? at.error(e) : k(e, l).slice(0);
23431    }function yt(e) {
23432      var t = 0,
23433          n = e.length,
23434          r = "";for (; n > t; t++) r += e[t].value;return r;
23435    }function vt(e, t, n) {
23436      var r = t.dir,
23437          o = n && "parentNode" === r,
23438          a = C++;return t.first ? function (t, n, i) {
23439        while (t = t[r]) if (1 === t.nodeType || o) return e(t, n, i);
23440      } : function (t, n, s) {
23441        var l,
23442            u,
23443            c,
23444            p = T + " " + a;if (s) {
23445          while (t = t[r]) if ((1 === t.nodeType || o) && e(t, n, s)) return !0;
23446        } else while (t = t[r]) if (1 === t.nodeType || o) if ((c = t[b] || (t[b] = {}), (u = c[r]) && u[0] === p)) {
23447          if ((l = u[1]) === !0 || l === i) return l === !0;
23448        } else if ((u = c[r] = [p], u[1] = e(t, n, s) || i, u[1] === !0)) return !0;
23449      };
23450    }function bt(e) {
23451      return e.length > 1 ? function (t, n, r) {
23452        var i = e.length;while (i--) if (!e[i](t, n, r)) return !1;return !0;
23453      } : e[0];
23454    }function xt(e, t, n, r, i) {
23455      var o,
23456          a = [],
23457          s = 0,
23458          l = e.length,
23459          u = null != t;for (; l > s; s++) (o = e[s]) && (!n || n(o, r, i)) && (a.push(o), u && t.push(s));return a;
23460    }function wt(e, t, n, r, i, o) {
23461      return (r && !r[b] && (r = wt(r)), i && !i[b] && (i = wt(i, o)), lt(function (o, a, s, l) {
23462        var u,
23463            c,
23464            p,
23465            f = [],
23466            d = [],
23467            h = a.length,
23468            g = o || Nt(t || "*", s.nodeType ? [s] : s, []),
23469            m = !e || !o && t ? g : xt(g, f, e, s, l),
23470            y = n ? i || (o ? e : h || r) ? [] : a : m;if ((n && n(m, y, s, l), r)) {
23471          u = xt(y, d), r(u, [], s, l), c = u.length;while (c--) (p = u[c]) && (y[d[c]] = !(m[d[c]] = p));
23472        }if (o) {
23473          if (i || e) {
23474            if (i) {
23475              u = [], c = y.length;while (c--) (p = y[c]) && u.push(m[c] = p);i(null, y = [], u, l);
23476            }c = y.length;while (c--) (p = y[c]) && (u = i ? F.call(o, p) : f[c]) > -1 && (o[u] = !(a[u] = p));
23477          }
23478        } else y = xt(y === a ? y.splice(h, y.length) : y), i ? i(null, a, y, l) : M.apply(a, y);
23479      }));
23480    }function Tt(e) {
23481      var t,
23482          n,
23483          r,
23484          i = e.length,
23485          a = o.relative[e[0].type],
23486          s = a || o.relative[" "],
23487          l = a ? 1 : 0,
23488          c = vt(function (e) {
23489        return e === t;
23490      }, s, !0),
23491          p = vt(function (e) {
23492        return F.call(t, e) > -1;
23493      }, s, !0),
23494          f = [function (e, n, r) {
23495        return !a && (r || n !== u) || ((t = n).nodeType ? c(e, n, r) : p(e, n, r));
23496      }];for (; i > l; l++) if (n = o.relative[e[l].type]) f = [vt(bt(f), n)];else {
23497        if ((n = o.filter[e[l].type].apply(null, e[l].matches), n[b])) {
23498          for (r = ++l; i > r; r++) if (o.relative[e[r].type]) break;return wt(l > 1 && bt(f), l > 1 && yt(e.slice(0, l - 1).concat({ value: " " === e[l - 2].type ? "*" : "" })).replace(z, "$1"), n, r > l && Tt(e.slice(l, r)), i > r && Tt(e = e.slice(r)), i > r && yt(e));
23499        }f.push(n);
23500      }return bt(f);
23501    }function Ct(e, t) {
23502      var n = 0,
23503          r = t.length > 0,
23504          a = e.length > 0,
23505          s = (function (_s) {
23506        var _sWrapper = function s(_x, _x2, _x3, _x4, _x5) {
23507          return _s.apply(this, arguments);
23508        };
23509
23510        _sWrapper.toString = function () {
23511          return _s.toString();
23512        };
23513
23514        return _sWrapper;
23515      })(function (s, l, c, p, d) {
23516        var h,
23517            g,
23518            m,
23519            y = [],
23520            v = 0,
23521            b = "0",
23522            x = s && [],
23523            w = null != d,
23524            C = u,
23525            N = s || a && o.find.TAG("*", d && l.parentNode || l),
23526            k = T += null == C ? 1 : Math.random() || 0.1;
23526for (w && (u = l !== f && l, i = n); null != (h = N[b]); b++) {
23527          if (a && h) {
23528            g = 0;while (m = e[g++]) if (m(h, l, c)) {
23529              p.push(h);break;
23530            }w && (T = k, i = ++n);
23531          }r && ((h = !m && h) && v--, s && x.push(h));
23532        }if ((v += b, r && b !== v)) {
23533          g = 0;while (m = t[g++]) m(x, y, l, c);if (s) {
23534            if (v > 0) while (b--) x[b] || y[b] || (y[b] = q.call(p));y = xt(y);
23535          }M.apply(p, y), w && !s && y.length > 0 && v + t.length > 1 && at.uniqueSort(p);
23536        }return (w && (T = k, u = C), x);
23537      });return r ? lt(s) : s;
23538    }l = at.compile = function (e, t) {
23539      var n,
23540          r = [],
23541          i = [],
23542          o = E[e + " "];if (!o) {
23543        t || (t = mt(e)), n = t.length;while (n--) o = Tt(t[n]), o[b] ? r.push(o) : i.push(o);o = E(e, Ct(i, r));
23544      }return o;
23545    };function Nt(e, t, n) {
23546      var r = 0,
23547          i = t.length;for (; i > r; r++) at(e, t[r], n);return n;
23548    }function kt(e, t, n, i) {
23549      var a,
23550          s,
23551          u,
23552          c,
23553          p,
23554          f = mt(e);if (!i && 1 === f.length) {
23555        if ((s = f[0] = f[0].slice(0), s.length > 2 && "ID" === (u = s[0]).type && r.getById && 9 === t.nodeType && h && o.relative[s[1].type])) {
23556          if ((t = (o.find.ID(u.matches[0].replace(rt, it), t) || [])[0], !t)) {
23557            return n;
23558          }e = e.slice(s.shift().value.length);
23559        }a = Q.needsContext.test(e) ? 0 : s.length;while (a--) {
23560          if ((u = s[a], o.relative[c = u.type])) break;if ((p = o.find[c]) && (i = p(u.matches[0].replace(rt, it), V.test(s[0].type) && t.parentNode || t))) {
23561            if ((s.splice(a, 1), e = i.length && yt(s), !e)) {
23562              return (M.apply(n, i), n);
23563            }break;
23564          }
23565        }
23566      }return (l(e, f)(i, t, !h, n, V.test(e)), n);
23567    }r.sortStable = b.split("").sort(A).join("") === b, r.detectDuplicates = S, p(), r.sortDetached = ut(function (e) {
23568      return 1 & e.compareDocumentPosition(f.createElement("div"));
23569    }), ut(function (e) {
23570      return (e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href"));
23571    }) || ct("type|href|height|width", function (e, n, r) {
23572      return r ? t : e.getAttribute(n, "type" === n.toLowerCase() ? 1 : 2);
23573    }), r.attributes && ut(function (e) {
23574      return (e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value"));
23575    }) || ct("value", function (e, n, r) {
23576      return r || "input" !== e.nodeName.toLowerCase() ? t : e.defaultValue;
23577    }), ut(function (e) {
23578      return null == e.getAttribute("disabled");
23579    }) || ct(B, function (e, n, r) {
23580      var i;return r ? t : (i = e.getAttributeNode(n)) && i.specified ? i.value : e[n] === !0 ? n.toLowerCase() : null;
23581    }), x.find = at, x.expr = at.selectors, x.expr[":"] = x.expr.pseudos, x.unique = at.uniqueSort, x.text = at.getText, x.isXMLDoc = at.isXML, x.contains = at.contains;
23582  })(e);var O = {};function F(e) {
23583    var t = O[e] = {};return (x.each(e.match(T) || [], function (e, n) {
23584      t[n] = !0;
23585    }), t);
23586  }x.Callbacks = function (e) {
23587    e = "string" == typeof e ? O[e] || F(e) : x.extend({}, e);var n,
23588        r,
23589        i,
23590        o,
23591        a,
23592        s,
23593        l = [],
23594        u = !e.once && [],
23595        c = (function (_c) {
23596      var _cWrapper = function c(_x) {
23597        return _c.apply(this, arguments);
23598      };
23599
23600      _cWrapper.toString = function () {
23601        return _c.toString();
23602      };
23603
23604      return _cWrapper;
23605    })(function (t) {
23606      for (r = e.memory && t, i = !0, a = s || 0, s = 0, o = l.length, n = !0; l && o > a; a++) if (l[a].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
23607        r = !1;break;
23608      }n = !1, l && (u ? u.length && c(u.shift()) : r ? l = [] : p.disable());
23609    }),
23610        p = { add: function add() {
23611        if (l) {
23612          var t = l.length;(function i(t) {
23613            x.each(t, function (t, n) {
23614              var r = x.type(n);"function" === r ? e.unique && p.has(n) || l.push(n) : n && n.length && "string" !== r && i(n);
23615            });
23616          })(arguments), n ? o = l.length : r && (s = t, c(r));
23617        }return this;
23618      }, remove: function remove() {
23619        return (l && x.each(arguments, function (e, t) {
23620          var r;while ((r = x.inArray(t, l, r)) > -1) l.splice(r, 1), n && (o >= r && o--, a >= r && a--);
23621        }), this);
23622      }, has: function has(e) {
23623        return e ? x.inArray(e, l) > -1 : !(!l || !l.length);
23624      }, empty: function empty() {
23625        return (l = [], o = 0, this);
23626      }, disable: function disable() {
23627        return (l = u = r = t, this);
23628      }, disabled: function disabled() {
23629        return !l;
23630      }, lock: function lock() {
23631        return (u = t, r || p.disable(), this);
23632      }, locked: function locked() {
23633        return !u;
23634      }, fireWith: function fireWith(e, t) {
23635        return (!l || i && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : c(t)), this);
23636      }, fire: function fire() {
23637        return (p.fireWith(this, arguments), this);
23638      }, fired: function fired() {
23639        return !!i;
23640      } };return p;
23641  }, x.extend({ Deferred: function Deferred(e) {
23642      var t = [["resolve", "done", x.Callbacks("once memory"), "resolved"], ["reject", "fail", x.Callbacks("once memory"), "rejected"], ["notify", "progress", x.Callbacks("memory")]],
23643          n = "pending",
23644          r = { state: function state() {
23645          return n;
23646        }, always: function always() {
23647          return (i.done(arguments).fail(arguments), this);
23648        }, then: function then() {
23649          var e = arguments;return x.Deferred(function (n) {
23650            x.each(t, function (t, o) {
23651              var a = o[0],
23652                  s = x.isFunction(e[t]) && e[t];i[o[1]](function () {
23653                var e = s && s.apply(this, arguments);e && x.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments);
23654              });
23655            }), e = null;
23656          }).promise();
23657        }, promise: function promise(e) {
23658          return null != e ? x.extend(e, r) : r;
23659        } },
vendor: 6,156 bytes, lines 23660-23722
23660          i = {};return (r.pipe = r.then, x.each(t, function (e, o) {
23661        var a = o[2],
23662            s = o[3];r[o[1]] = a.add, s && a.add(function () {
23663          n = s;
23664        }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () {
23665          return (i[o[0] + "With"](this === i ? r : this, arguments), this);
23666        }, i[o[0] + "With"] = a.fireWith;
23667      }), r.promise(i), e && e.call(i, i), i);
23668    }, when: function when(e) {
23669      var t = 0,
23670          n = g.call(arguments),
23671          r = n.length,
23672          i = 1 !== r || e && x.isFunction(e.promise) ? r : 0,
23673          o = 1 === i ? e : x.Deferred(),
23674          a = function a(e, t, n) {
23675        return function (r) {
23676          t[e] = this, n[e] = arguments.length > 1 ? g.call(arguments) : r, n === s ? o.notifyWith(t, n) : --i || o.resolveWith(t, n);
23677        };
23678      },
23679          s,
23680          l,
23681          u;if (r > 1) for (s = Array(r), l = Array(r), u = Array(r); r > t; t++) n[t] && x.isFunction(n[t].promise) ? n[t].promise().done(a(t, u, n)).fail(o.reject).progress(a(t, l, s)) : --i;return (i || o.resolveWith(u, n), o.promise());
23682    } }), x.support = (function (t) {
23683    var n,
23684        r,
23685        o,
23686        s,
23687        l,
23688        u,
23689        c,
23690        p,
23691        f,
23692        d = a.createElement("div");if ((d.setAttribute("className", "t"), d.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = d.getElementsByTagName("*") || [], r = d.getElementsByTagName("a")[0], !r || !r.style || !n.length)) return t;s = a.createElement("select"), u = s.appendChild(a.createElement("option")), o = d.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== d.className, t.leadingWhitespace = 3 === d.firstChild.nodeType, t.tbody = !d.getElementsByTagName("tbody").length, t.htmlSerialize = !!d.getElementsByTagName("link").length, t.style = /top/.test(r.getAttribute("style")), t.hrefNormalized = "/a" === r.getAttribute("href"), t.opacity = /^0.5/.test(r.style.opacity), t.cssFloat = !!r.style.cssFloat, t.checkOn = !!o.value, t.optSelected = u.selected, t.enctype = !!a.createElement("form").enctype, t.html5Clone = "<:nav></:nav>" !== a.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, o.checked = !0, t.noCloneChecked = o.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !u.disabled;try {
23693      delete d.test;
23694    } catch (h) {
23695      t.deleteExpando = !1;
23696    }o = a.createElement("input"), o.setAttribute("value", ""), t.input = "" === o.getAttribute("value"), o.value = "t", o.setAttribute("type", "radio"), t.radioValue = "t" === o.value, o.setAttribute("checked", "t"), o.setAttribute("name", "t"), l = a.createDocumentFragment(), l.appendChild(o), t.appendChecked = o.checked, t.checkClone = l.cloneNode(!0).cloneNode(!0).lastChild.checked, d.attachEvent && (d.attachEvent("onclick", function () {
23697      t.noCloneEvent = !1;
23698    }), d.cloneNode(!0).click());for (f in { submit: !0, change: !0, focusin: !0 }) d.setAttribute(c = "on" + f, "t"), t[f + "Bubbles"] = c in e || d.attributes[c].expando === !1;d.style.backgroundClip = "content-box", d.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === d.style.backgroundClip;for (f in x(t)) break;return (t.ownLast = "0" !== f, x(function () {
23699      var n,
23700          r,
23701          o,
23702          s = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
23703          l = a.getElementsByTagName("body")[0];l && (n = a.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", l.appendChild(n).appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", o = d.getElementsByTagName("td"), o[0].style.cssText = "padding:0;margin:0;border:0;display:none", p = 0 === o[0].offsetHeight, o[0].style.display = "", o[1].style.display = "none", t.reliableHiddenOffsets = p && 0 === o[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", x.swap(l, null != l.style.zoom ? { zoom: 1 } : {}, function () {
23704        t.boxSizing = 4 === d.offsetWidth;
23705      }), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(d, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(d, null) || { width: "4px" }).width, r = d.appendChild(a.createElement("div")), r.style.cssText = d.style.cssText = s, r.style.marginRight = r.style.width = "0", d.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof d.style.zoom !== i && (d.innerHTML = "", d.style.cssText = s + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== d.offsetWidth, t.inlineBlockNeedsLayout && (l.style.zoom = 1)), l.removeChild(n), n = d = o = r = null);
23706    }), n = s = l = u = r = o = null, t);
23707  })({});var B = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
23708      P = /([A-Z])/g;function R(e, n, r, i) {
23709    if (x.acceptData(e)) {
23710      var o,
23711          a,
23712          s = x.expando,
23713          l = e.nodeType,
23714          u = l ? x.cache : e,
23715          c = l ? e[s] : e[s] && s;if (c && u[c] && (i || u[c].data) || r !== t || "string" != typeof n) {
23716        return (c || (c = l ? e[s] = p.pop() || x.guid++ : s), u[c] || (u[c] = l ? {} : { toJSON: x.noop }), ("object" == typeof n || "function" == typeof n) && (i ? u[c] = x.extend(u[c], n) : u[c].data = x.extend(u[c].data, n)), a = u[c], i || (a.data || (a.data = {}), a = a.data), r !== t && (a[x.camelCase(n)] = r), "string" == typeof n ? (o = a[n], null == o && (o = a[x.camelCase(n)])) : o = a, o);
23717      }
23718    }
23719  }function W(e, t, n) {
23720    if (x.acceptData(e)) {
23721      var r,
23722          i,
23723          o = e.nodeType,
23724          a = o ? x.cache : e,
23725          s = o ? e[x.expando] : x.expando;if (a[s]) {
23726        if (t && (r = n ? a[s] : a[s].data)) {
23727          x.isArray(t) ? t = t.concat(x.map(t, x.camelCase)) : t in r ? t = [t] : (t = x.camelCase(t), t = t in r ? [t] : t.split(" ")), i = t.length;while (i--) delete r[t[i]];if (n ? !I(r) : !x.isEmptyObject(r)) {
23728            return;
23729          }
23730        }(n || (delete a[s].data, I(a[s]))) && (o ? x.cleanData([e], !0) : x.support.deleteExpando || a != a.window ? delete a[s] : a[s] = null);
23731      }
23732    }
23733  }x.extend({ cache: {}, noData: { applet: !0, embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function hasData(e) {
23734      return (e = e.nodeType ? x.cache[e[x.expando]] : e[x.expando], !!e && !I(e));
23735    }, data: function data(e, t, n) {
23736      return R(e, t, n);
23737    }, removeData: function removeData(e, t) {
23738      return W(e, t);
23739    }, _data: function _data(e, t, n) {
23740      return R(e, t, n, !0);
23741    }, _removeData: function _removeData(e, t) {
23742      return W(e, t, !0);
23743    }, acceptData: function acceptData(e) {
23744      if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) {
23745        return !1;
23746      }var t = e.nodeName && x.noData[e.nodeName.toLowerCase()];return !t || t !== !0 && e.getAttribute("classid") === t;
23747    } }), x.fn.extend({ data: function data(e, n) {
23748      var r,
23749          i,
23750          o = null,
23751          a = 0,
23752          s = this[0];if (e === t) {
23753        if (this.length && (o = x.data(s), 1 === s.nodeType && !x._data(s, "parsedAttrs"))) {
23754          for (r = s.attributes; r.length > a; a++) i = r[a].name, 0 === i.indexOf("data-") && (i = x.camelCase(i.slice(5)), $(s, i, o[i]));x._data(s, "parsedAttrs", !0);
23755        }return o;
23756      }return "object" == typeof e ? this.each(function () {
23757        x.data(this, e);
23758      }) : arguments.length > 1 ? this.each(function () {
23759        x.data(this, e, n);
23760      }) : s ? $(s, e, x.data(s, e)) : null;
23761    }, removeData: function removeData(e) {
23762      return this.each(function () {
23763        x.removeData(this, e);
23764      });
23765    } });function $(e, n, r) {
23766    if (r === t && 1 === e.nodeType) {
23767      var i = "data-" + n.replace(P, "-$1").toLowerCase();if ((r = e.getAttribute(i), "string" == typeof r)) {
23768        try {
23769          r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : B.test(r) ? x.parseJSON(r) : r;
23770        } catch (o) {}x.data(e, n, r);
23771      } else r = t;
23772    }return r;
23773  }function I(e) {
23774    var t;for (t in e) if (("data" !== t || !x.isEmptyObject(e[t])) && "toJSON" !== t) {
23775      return !1;
23776    }return !0;
23777  }x.extend({ queue: function queue(e, n, r) {
23778      var i;return e ? (n = (n || "fx") + "queue", i = x._data(e, n), r && (!i || x.isArray(r) ? i = x._data(e, n, x.makeArray(r)) : i.push(r)), i || []) : t;
23779    }, dequeue: function dequeue(e, t) {
23780      t = t || "fx";var n = x.queue(e, t),
23781          r = n.length,
23782          i = n.shift(),
23783          o = x._queueHooks(e, t),
23784          a = function a() {
23785        x.dequeue(e, t);
23786      };"inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, a, o)), !r && o && o.empty.fire();
23787    }, _queueHooks: function _queueHooks(e, t) {
23788      var n = t + "queueHooks";return x._data(e, n) || x._data(e, n, { empty: x.Callbacks("once memory").add(function () {
23789          x._removeData(e, t + "queue"), x._removeData(e, n);
23790        }) });
23791    } }), x.fn.extend({ queue: function queue(e, n) {
23792      var r = 2;return ("string" != typeof e && (n = e, e = "fx", r--), r > arguments.length ? x.queue(this[0], e) : n === t ? this : this.each(function () {
23793        var t = x.queue(this, e, n);x._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && x.dequeue(this, e);
23794      }));
23795    }, dequeue: function dequeue(e) {
23796      return this.each(function () {
23797        x.dequeue(this, e);
23798      });
23799    }, delay: function delay(e, t) {
23800      return (e = x.fx ? x.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) {
23801        var r = setTimeout(t, e);n.stop = function () {
23802          clearTimeout(r);
23803        };
23804      }));
23805    }, clearQueue: function clearQueue(e) {
23806      return this.queue(e || "fx", []);
23807    }, promise: function promise(e, n) {
23808      var r,
23809          i = 1,
23810          o = x.Deferred(),
23811          a = this,
23812          s = this.length,
23813          l = function l() {
23814        --i || o.resolveWith(a, [a]);
23815      };"string" != typeof e && (n = e, e = t), e = e || "fx";while (s--) r = x._data(a[s], e + "queueHooks"), r && r.empty && (i++, r.empty.add(l));return (l(), o.promise(n));
23816    } });var z,
23817      X,
23818      U = /[\t\r\n\f]/g,
23819      V = /\r/g,
23820      Y = /^(?:input|select|textarea|button|object)$/i,
23821      J = /^(?:a|area)$/i,
23822      G = /^(?:checked|selected)$/i,
23823      Q = x.support.getSetAttribute,
23824      K = x.support.input;x.fn.extend({ attr: function attr(e, t) {
23825      return x.access(this, x.attr, e, t, arguments.length > 1);
23826    }, removeAttr: function removeAttr(e) {
23827      return this.each(function () {
23828        x.removeAttr(this, e);
23829      });
23830    }, prop: function prop(e, t) {
23831      return x.access(this, x.prop, e, t, arguments.length > 1);
23832    }, removeProp: function removeProp(e) {
23833      return (e = x.propFix[e] || e, this.each(function () {
23834        try {
23835          this[e] = t, delete this[e];
23836        } catch (n) {}
23837      }));
23838    }, addClass: function addClass(e) {
23839      var t,
23840          n,
23841          r,
23842          i,
23843          o,
23844          a = 0,
23845          s = this.length,
23846          l = "string" == typeof e && e;if (x.isFunction(e)) {
23847        return this.each(function (t) {
23848          x(this).addClass(e.call(this, t, this.className));
23849        });
23850      }if (l) for (t = (e || "").match(T) || []; s > a; a++) if ((n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : " "))) {
23851        o = 0;while (i = t[o++]) 0 > r.indexOf(" " + i + " ") && (r += i + " ");n.className = x.trim(r);
23852      }return this;
23853    }, removeClass: function removeClass(e) {
23854      var t,
23855          n,
23856          r,
23857          i,
23858          o,
23859          a = 0,
23860          s = this.length,
23861          l = 0 === arguments.length || "string" == typeof e && e;if (x.isFunction(e)) {
23862        return this.each(function (t) {
23863          x(this).removeClass(e.call(this, t, this.className));
23864        });
23865      }if (l) for (t = (e || "").match(T) || []; s > a; a++) if ((n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : ""))) {
23866        o = 0;while (i = t[o++]) while (r.indexOf(" " + i + " ") >= 0) r = r.replace(" " + i + " ", " ");n.className = e ? x.trim(r) : "";
23867      }return this;
23868    }, toggleClass: function toggleClass(e, t) {
23869      var n = typeof e;return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : x.isFunction(e) ? this.each(function (n) {
23870        x(this).toggleClass(e.call(this, n, this.className, t), t);
23871      }) : this.each(function () {
23872        if ("string" === n) {
23873          var t,
23874              r = 0,
23875              o = x(this),
23876              a = e.match(T) || [];while (t = a[r++]) o.hasClass(t) ? o.removeClass(t) : o.addClass(t);
23877        } else (n === i || "boolean" === n) && (this.className && x._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : x._data(this, "__className__") || "");
23878      });
23879    }, hasClass: function hasClass(e) {
23880      var t = " " + e + " ",
23881          n = 0,
23882          r = this.length;for (; r > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(U, " ").indexOf(t) >= 0) {
23883        return !0;
23884      }return !1;
23885    }, val: function val(e) {
23886      var n,
23887          r,
23888          i,
23889          o = this[0];{
23890        if (arguments.length) {
23891          return (i = x.isFunction(e), this.each(function (n) {
23892            var o;1 === this.nodeType && (o = i ? e.call(this, n, x(this).val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : x.isArray(o) && (o = x.map(o, function (e) {
23893              return null == e ? "" : e + "";
23894            })), r = x.valHooks[this.type] || x.valHooks[this.nodeName.toLowerCase()], r && "set" in r && r.set(this, o, "value") !== t || (this.value = o));
23895          }));
23896        }if (o) {
23897          return (r = x.valHooks[o.type] || x.valHooks[o.nodeName.toLowerCase()], r && "get" in r && (n = r.get(o, "value")) !== t ? n : (n = o.value, "string" == typeof n ? n.replace(V, "") : null == n ? "" : n));
23898        }
23899      }
23900    } }), x.extend({ valHooks: { option: { get: function get(e) {
23901          var t = x.find.attr(e, "value");return null != t ? t : e.text;
23902        } }, select: { get: function get(e) {
23903          var t,
23904              n,
23905              r = e.options,
23906              i = e.selectedIndex,
23907              o = "select-one" === e.type || 0 > i,
23908              a = o ? null : [],
23909              s = o ? i + 1 : r.length,
23910              l = 0 > i ? s : o ? i : 0;for (; s > l; l++) if ((n = r[l], !(!n.selected && l !== i || (x.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && x.nodeName(n.parentNode, "optgroup")))) {
23911            if ((t = x(n).val(), o)) {
23912              return t;
23913            }a.push(t);
23914          }return a;
23915        }, set: function set(e, t) {
23916          var n,
23917              r,
23918              i = e.options,
23919              o = x.makeArray(t),
23920              a = i.length;while (a--) r = i[a], (r.selected = x.inArray(x(r).val(), o) >= 0) && (n = !0);return (n || (e.selectedIndex = -1), o);
23921        } } }, attr: function attr(e, n, r) {
23922      var o,
23923          a,
23924          s = e.nodeType;if (e && 3 !== s && 8 !== s && 2 !== s) {
23925        return typeof e.getAttribute === i ? x.prop(e, n, r) : (1 === s && x.isXMLDoc(e) || (n = n.toLowerCase(), o = x.attrHooks[n] || (x.expr.match.bool.test(n) ? X : z)), r === t ? o && "get" in o && null !== (a = o.get(e, n)) ? a : (a = x.find.attr(e, n), null == a ? t : a) : null !== r ? o && "set" in o && (a = o.set(e, r, n)) !== t ? a : (e.setAttribute(n, r + ""), r) : (x.removeAttr(e, n), t));
23926      }
23927    }, removeAttr: function removeAttr(e, t) {
23928      var n,
23929          r,
23930          i = 0,
23931          o = t && t.match(T);if (o && 1 === e.nodeType) while (n = o[i++]) r = x.propFix[n] || n, x.expr.match.bool.test(n) ? K && Q || !G.test(n) ? e[r] = !1 : e[x.camelCase("default-" + n)] = e[r] = !1 : x.attr(e, n, ""), e.removeAttribute(Q ? n : r);
23932    }, attrHooks: { type: { set: function set(e, t) {
23933          if (!x.support.radioValue && "radio" === t && x.nodeName(e, "input")) {
23934            var n = e.value;return (e.setAttribute("type", t), n && (e.value = n), t);
23935          }
23936        } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function prop(e, n, r) {
23937      var i,
23938          o,
23939          a,
23940          s = e.nodeType;if (e && 3 !== s && 8 !== s && 2 !== s) {
23941        return (a = 1 !== s || !x.isXMLDoc(e), a && (n = x.propFix[n] || n, o = x.propHooks[n]), r !== t ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : e[n] = r : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n]);
23942      }
23943    }, propHooks: { tabIndex: { get: function get(e) {
23944          var t = x.find.attr(e, "tabindex");return t ? parseInt(t, 10) : Y.test(e.nodeName) || J.test(e.nodeName) && e.href ? 0 : -1;
23945        } } } }), X = { set: function set(e, t, n) {
23946      return (t === !1 ? x.removeAttr(e, n) : K && Q || !G.test(n) ? e.setAttribute(!Q && x.propFix[n] || n, n) : e[x.camelCase("default-" + n)] = e[n] = !0, n);
23947    } }, x.each(x.expr.match.bool.source.match(/\w+/g), function (e, n) {
23948    var r = x.expr.attrHandle[n] || x.find.attr;x.expr.attrHandle[n] = K && Q || !G.test(n) ? function (e, n, i) {
23949      var o = x.expr.attrHandle[n],
23950          a = i ? t : (x.expr.attrHandle[n] = t) != r(e, n, i) ? n.toLowerCase() : null;return (x.expr.attrHandle[n] = o, a);
23951    } : function (e, n, r) {
23952      return r ? t : e[x.camelCase("default-" + n)] ? n.toLowerCase() : null;
23953    };
23954  }), K && Q || (x.attrHooks.value = { set: function set(e, n, r) {
23955      return x.nodeName(e, "input") ? (e.defaultValue = n, t) : z && z.set(e, n, r);
23956    } }), Q || (z = { set: function set(e, n, r) {
23957      var i = e.getAttributeNode(r);return (i || e.setAttributeNode(i = e.ownerDocument.createAttribute(r)), i.value = n += "", "value" === r || n === e.getAttribute(r) ? n : t);
23958    } }, x.expr.attrHandle.id = x.expr.attrHandle.name = x.expr.attrHandle.coords = function (e, n, r) {
23959    var i;return r ? t : (i = e.getAttributeNode(n)) && "" !== i.value ? i.value : null;
23960  }, x.valHooks.button = { get: function get(e, n) {
23961      var r = e.getAttributeNode(n);return r && r.specified ? r.value : t;
23962    }, set: z.set }, x.attrHooks.contenteditable = { set: function set(e, t, n) {
23963      z.set(e, "" === t ? !1 : t, n);
23964    } }, x.each(["width", "height"], function (e, n) {
23965    x.attrHooks[n] = { set: function set(e, r) {
23966        return "" === r ? (e.setAttribute(n, "auto"), r) : t;
23967      } };
23968  })), x.support.hrefNormalized || x.each(["href", "src"], function (e, t) {
23969    x.propHooks[t] = { get: function get(e) {
23970        return e.getAttribute(t, 4);
23971      } };
23972  }), x.support.style || (x.attrHooks.style = { get: function get(e) {
23973      return e.style.cssText || t;
23974    }, set: function set(e, t) {
23975      return e.style.cssText = t + "";
23976    } }), x.support.optSelected || (x.propHooks.selected = { get: function get(e) {
23977      var t = e.parentNode;return (t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null);
23978    } }), x.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
23979    x.propFix[this.toLowerCase()] = this;
23980  }), x.support.enctype || (x.propFix.enctype = "encoding"), x.each(["radio", "checkbox"], function () {
23981    x.valHooks[this] = { set: function set(e, n) {
23982        return x.isArray(n) ? e.checked = x.inArray(x(e).val(), n) >= 0 : t;
23983      } }, x.support.checkOn || (x.valHooks[this].get = function (e) {
23984      return null === e.getAttribute("value") ? "on" : e.value;
23985    });
23986  });var Z = /^(?:input|select|textarea)$/i,
23987      et = /^key/,
23988      tt = /^(?:mouse|contextmenu)|click/,
23989      nt = /^(?:focusinfocus|focusoutblur)$/,
23990      rt = /^([^.]*)(?:\.(.+)|)$/;function it() {
23991    return !0;
23992  }function ot() {
23993    return !1;
23994  }function at() {
23995    try {
23996      return a.activeElement;
23997    } catch (e) {}
23998  }x.event = { global: {}, add: function add(e, n, r, o, a) {
23999      var s,
24000          l,
24001          u,
24002          c,
24003          p,
24004          f,
24005          d,
24006          h,
24007          g,
24008          m,
24009          y,
24010          v = x._data(e);if (v) {
24011        r.handler && (c = r, r = c.handler, a = c.selector), r.guid || (r.guid = x.guid++), (l = v.events) || (l = v.events = {}), (f = v.handle) || (f = v.handle = function (e) {
24012          return typeof x === i || e && x.event.triggered === e.type ? t : x.event.dispatch.apply(f.elem, arguments);
24013        }, f.elem = e), n = (n || "").match(T) || [""], u = n.length;while (u--) s = rt.exec(n[u]) || [], g = y = s[1], m = (s[2] || "").split(".").sort(), g && (p = x.event.special[g] || {}, g = (a ? p.delegateType : p.bindType) || g, p = x.event.special[g] || {}, d = x.extend({ type: g, origType: y, data: o, handler: r, guid: r.guid, selector: a, needsContext: a && x.expr.match.needsContext.test(a), namespace: m.join(".") }, c), (h = l[g]) || (h = l[g] = [], h.delegateCount = 0, p.setup && p.setup.call(e, o, m, f) !== !1 || (e.addEventListener ? e.addEventListener(g, f, !1) : e.attachEvent && e.attachEvent("on" + g, f))), p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = r.guid)), a ? h.splice(h.delegateCount++, 0, d) : h.push(d), x.event.global[g] = !0);e = null;
24014      }
24015    }, remove: function remove(e, t, n, r, i) {
24016      var o,
24017          a,
24018          s,
24019          l,
24020          u,
24021          c,
24022          p,
24023          f,
24024          d,
24025          h,
24026          g,
24027          m = x.hasData(e) && x._data(e);if (m && (c = m.events)) {
24028        t = (t || "").match(T) || [""], u = t.length;while (u--) if ((s = rt.exec(t[u]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d)) {
24029          p = x.event.special[d] || {}, d = (r ? p.delegateType : p.bindType) || d, f = c[d] || [], s = s[2] && RegExp("(^|\\.)" + h.join(
vendor: 4,140 bytes, lines 24029-24083
24029"\\.(?:.*\\.|)") + "(\\.|$)"), l = o = f.length;while (o--) a = f[o], !i && g !== a.origType || n && n.guid !== a.guid || s && !s.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (f.splice(o, 1), a.selector && f.delegateCount--, p.remove && p.remove.call(e, a));l && !f.length && (p.teardown && p.teardown.call(e, h, m.handle) !== !1 || x.removeEvent(e, d, m.handle), delete c[d]);
24030        } else for (d in c) x.event.remove(e, d + t[u], n, r, !0);x.isEmptyObject(c) && (delete m.handle, x._removeData(e, "events"));
24031      }
24032    }, trigger: function trigger(n, r, i, o) {
24033      var s,
24034          l,
24035          u,
24036          c,
24037          p,
24038          f,
24039          d,
24040          h = [i || a],
24041          g = v.call(n, "type") ? n.type : n,
24042          m = v.call(n, "namespace") ? n.namespace.split(".") : [];if ((u = f = i = i || a, 3 !== i.nodeType && 8 !== i.nodeType && !nt.test(g + x.event.triggered) && (g.indexOf(".") >= 0 && (m = g.split("."), g = m.shift(), m.sort()), l = 0 > g.indexOf(":") && "on" + g, n = n[x.expando] ? n : new x.Event(g, "object" == typeof n && n), n.isTrigger = o ? 2 : 3, n.namespace = m.join("."), n.namespace_re = n.namespace ? RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = i), r = null == r ? [n] : x.makeArray(r, [n]), p = x.event.special[g] || {}, o || !p.trigger || p.trigger.apply(i, r) !== !1))) {
24043        if (!o && !p.noBubble && !x.isWindow(i)) {
24044          for (c = p.delegateType || g, nt.test(c + g) || (u = u.parentNode); u; u = u.parentNode) h.push(u), f = u;f === (i.ownerDocument || a) && h.push(f.defaultView || f.parentWindow || e);
24045        }d = 0;while ((u = h[d++]) && !n.isPropagationStopped()) n.type = d > 1 ? c : p.bindType || g, s = (x._data(u, "events") || {})[n.type] && x._data(u, "handle"), s && s.apply(u, r), s = l && u[l], s && x.acceptData(u) && s.apply && s.apply(u, r) === !1 && n.preventDefault();if ((n.type = g, !o && !n.isDefaultPrevented() && (!p._default || p._default.apply(h.pop(), r) === !1) && x.acceptData(i) && l && i[g] && !x.isWindow(i))) {
24046          f = i[l], f && (i[l] = null), x.event.triggered = g;try {
24047            i[g]();
24048          } catch (y) {}x.event.triggered = t, f && (i[l] = f);
24049        }return n.result;
24050      }
24051    }, dispatch: function dispatch(e) {
24052      e = x.event.fix(e);var n,
24053          r,
24054          i,
24055          o,
24056          a,
24057          s = [],
24058          l = g.call(arguments),
24059          u = (x._data(this, "events") || {})[e.type] || [],
24060          c = x.event.special[e.type] || {};if ((l[0] = e, e.delegateTarget = this, !c.preDispatch || c.preDispatch.call(this, e) !== !1)) {
24061        s = x.event.handlers.call(this, e, u), n = 0;while ((o = s[n++]) && !e.isPropagationStopped()) {
24062          e.currentTarget = o.elem, a = 0;while ((i = o.handlers[a++]) && !e.isImmediatePropagationStopped()) (!e.namespace_re || e.namespace_re.test(i.namespace)) && (e.handleObj = i, e.data = i.data, r = ((x.event.special[i.origType] || {}).handle || i.handler).apply(o.elem, l), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation()));
24063        }return (c.postDispatch && c.postDispatch.call(this, e), e.result);
24064      }
24065    }, handlers: function handlers(e, n) {
24066      var r,
24067          i,
24068          o,
24069          a,
24070          s = [],
24071          l = n.delegateCount,
24072          u = e.target;if (l && u.nodeType && (!e.button || "click" !== e.type)) for (; u != this; u = u.parentNode || this) if (1 === u.nodeType && (u.disabled !== !0 || "click" !== e.type)) {
24073        for (o = [], a = 0; l > a; a++) i = n[a], r = i.selector + " ", o[r] === t && (o[r] = i.needsContext ? x(r, this).index(u) >= 0 : x.find(r, this, null, [u]).length), o[r] && o.push(i);o.length && s.push({ elem: u, handlers: o });
24074      }return (n.length > l && s.push({ elem: this, handlers: n.slice(l) }), s);
24075    }, fix: function fix(e) {
24076      if (e[x.expando]) {
24077        return e;
24078      }var t,
24079          n,
24080          r,
24081          i = e.type,
24082          o = e,
24083          s = this.fixHooks[i];s || (this.fixHooks[i] = s = tt.test(i) ? this.mouseHooks : et.test(i) ? this.keyHooks 
24083: {}), r = s.props ? this.props.concat(s.props) : this.props, e = new x.Event(o), t = r.length;while (t--) n = r[t], e[n] = o[n];return (e.target || (e.target = o.srcElement || a), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, s.filter ? s.filter(e, o) : e);
24084    }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function filter(e, t) {
24085        return (null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e);
24086      } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function filter(e, n) {
24087        var r,
24088            i,
24089            o,
24090            s = n.button,
24091            l = n.fromElement;return (null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || a, o = i.documentElement, r = i.body, e.pageX = n.clientX + (o && o.scrollLeft || r && r.scrollLeft || 0) - (o && o.clientLeft || r && r.clientLeft || 0), e.pageY = n.clientY + (o && o.scrollTop || r && r.scrollTop || 0) - (o && o.clientTop || r && r.clientTop || 0)), !e.relatedTarget && l && (e.relatedTarget = l === e.target ? n.toElement : l), e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e);
24092      } }, special: { load: { noBubble: !0 }, focus: { trigger: function trigger() {
24093          if (this !== at() && this.focus) try {
24094            return (this.focus(), !1);
24095          } catch (e) {}
24096        }, delegateType: "focusin" }, blur: { trigger: function trigger() {
24097          return this === at() && this.blur ? (this.blur(), !1) : t;
24098        }, delegateType: "focusout" }, click: { trigger: function trigger() {
24099          return x.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : t;
24100        }, _default: function _default(e) {
24101          return x.nodeName(e.target, "a");
24102        } }, beforeunload: { postDispatch: function postDispatch(e) {
24103          e.result !== t && (e.originalEvent.returnValue = e.result);
24104        } } }, simulate: function simulate(e, t, n, r) {
24105      var i = x.extend(new x.Event(), n, { type: e, isSimulated: !0, originalEvent: {} });r ? x.event.trigger(i, null, t) : x.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault();
24106    } }, x.removeEvent = a.removeEventListener ? function (e, t, n) {
24107    e.removeEventListener && e.removeEventListener(t, n, !1);
24108  } : function (e, t, n) {
24109    var r = "on" + t;e.detachEvent && (typeof e[r] === i && (e[r] = null), e.detachEvent(r, n));
24110  }, x.Event = function (e, n) {
24111    return this instanceof x.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? it : ot) : this.type = e, n && x.extend(this, n), this.timeStamp = e && e.timeStamp || x.now(), this[x.expando] = !0, t) : new x.Event(e, n);
24112  }, x.Event.prototype = { isDefaultPrevented: ot, isPropagationStopped: ot, isImmediatePropagationStopped: ot, preventDefault: function preventDefault() {
24113      var e = this.originalEvent;this.isDefaultPrevented = it, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1);
24114    }, stopPropagation: function stopPropagation() {
24115      var e = this.originalEvent;this.isPropagationStopped = it, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0);
24116    }, stopImmediatePropagation: function stopImmediatePropagation() {
24117      this.isImmediatePropagationStopped = it, this.stopPropagation();
24118    } }, x.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (e, t) {
24119    x.event.special[e] = { delegateType: t, bindType: t, handle: function handle(e) {
24120        var n,
24121            r = this,
24122            i = e.relatedTarget,
24123            o = e.handleObj;return ((!i || i !== r && !x.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n);
24124      } };
24125  }), x.support.submitBubbles || (x.event.special.submit = { setup: function setup() {
24126      return x.nodeName(this, "form") ? !1 : (x.event.add(this, "click._submit keypress._submit", function (e) {
24127        var n = e.target,
24128            r = x.nodeName(n, "input") || x.nodeName(n, "button") ? n.form : t;r && !x._data(r, "submitBubbles") && (x.event.add(r, "submit._submit", function (e) {
24129          e._submit_bubble = !0;
24130        }), x._data(r, "submitBubbles", !0));
24131      }), t);
24132    }, postDispatch: function postDispatch(e) {
24133      e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && x.event.simulate("submit", this.parentNode, e, !0));
24134    }, teardown: function teardown() {
24135      return x.nodeName(this, "form") ? !1 : (x.event.remove(this, "._submit"), t);
24136    } }), x.support.changeBubbles || (x.event.special.change = { setup: function setup() {
24137      return Z.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (x.event.add(this, "propertychange._change", function (e) {
24138        "checked" === e.originalEvent.propertyName && (this._just_changed = !0);
24139      }), x.event.add(this, "click._change", function (e) {
24140        this._just_changed && !e.isTrigger && (this._just_changed = !1), x.event.simulate("change", this, e, !0);
24141      })), !1) : (x.event.add(this, "beforeactivate._change", function (e) {
24142        var t = e.target;
24142Z.test(t.nodeName) && !x._data(t, "changeBubbles") && (x.event.add(t, "change._change", function (e) {
24143          !this.parentNode || e.isSimulated || e.isTrigger || x.event.simulate("change", this.parentNode, e, !0);
24144        }), x._data(t, "changeBubbles", !0));
24145      }), t);
24146    }, handle: function handle(e) {
24147      var n = e.target;return this !== n || e.isSimulated || e.isTrigger || "radio" !== n.type && "checkbox" !== n.type ? e.handleObj.handler.apply(this, arguments) : t;
24148    }, teardown: function teardown() {
24149      return (x.event.remove(this, "._change"), !Z.test(this.nodeName));
24150    } }), x.support.focusinBubbles || x.each({ focus: "focusin", blur: "focusout" }, function (e, t) {
24151    var n = 0,
24152        r = function r(e) {
24153      x.event.simulate(t, e.target, x.event.fix(e), !0);
24154    };x.event.special[t] = { setup: function setup() {
24155        0 === n++ && a.addEventListener(e, r, !0);
24156      }, teardown: function teardown() {
24157        0 === --n && a.removeEventListener(e, r, !0);
24158      } };
24159  }), x.fn.extend({ on: function on(e, n, r, i, o) {
24160      var a, s;if ("object" == typeof e) {
24161        "string" != typeof n && (r = r || n, n = t);for (a in e) this.on(a, n, r, e[a], o);return this;
24162      }if ((null == r && null == i ? (i = n, r = n = t) : null == i && ("string" == typeof n ? (i = r, r = t) : (i = r, r = n, n = t)), i === !1)) i = ot;else if (!i) {
24163        return this;
24164      }return (1 === o && (s = i, i = function (e) {
24165        return (x().off(e), s.apply(this, arguments));
24166      }, i.guid = s.guid || (s.guid = x.guid++)), this.each(function () {
24167        x.event.add(this, e, i, r, n);
24168      }));
24169    }, one: function one(e, t, n, r) {
24170      return this.on(e, t, n, r, 1);
24171    }, off: function off(e, n, r) {
24172      var i, o;if (e && e.preventDefault && e.handleObj) {
24173        return (i = e.handleObj, x(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this);
24174      }if ("object" == typeof e) {
24175        for (o in e) this.off(o, n, e[o]);return this;
24176      }return ((n === !1 || "function" == typeof n) && (r = n, n = t), r === !1 && (r = ot), this.each(function () {
24177        x.event.remove(this, e, r, n);
24178      }));
24179    }, trigger: function trigger(e, t) {
24180      return this.each(function () {
24181        x.event.trigger(e, t, this);
24182      });
24183    }, triggerHandler: function triggerHandler(e, n) {
24184      var r = this[0];return r ? x.event.trigger(e, n, r, !0) : t;
24185    } });var st = /^.[^:#\[\.,]*$/,
24186      lt = /^(?:parents|prev(?:Until|All))/,
24187      ut = x.expr.match.needsContext,
24188      ct = { children: !0, contents: !0, next: !0, prev: !0 };x.fn.extend({ find: function find(e) {
24189      var t,
24190          n = [],
24191          r = this,
24192          i = r.length;if ("string" != typeof e) {
24193        return this.pushStack(x(e).filter(function () {
24194          for (t = 0; i > t; t++) if (x.contains(r[t], this)) return !0;
24195        }));
24196      }for (t = 0; i > t; t++) x.find(e, r[t], n);return (n = this.pushStack(i > 1 ? x.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n);
24197    }, has: function has(e) {
24198      var t,
24199          n = x(e, this),
24200          r = n.length;return this.filter(function () {
24201        for (t = 0; r > t; t++) if (x.contains(this, n[t])) return !0;
24202      });
24203    }, not: function not(e) {
24204      return this.pushStack(ft(this, e || [], !0));
24205    }, filter: function filter(e) {
24206      return this.pushStack(ft(this, e || [], !1));
24207    }, is: function is(e) {
24208      return !!ft(this, "string" == typeof e && ut.test(e) ? x(e) : e || [], !1).length;
24209    }, closest: function closest(e, t) {
24210      var n,
24211          r = 0,
24212          i = this.length,
24213          o = [],
24214          a = ut.test(e) || "string" != typeof e ? x(e, t || this.context) : 0;for (; i > r; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (11 > n.nodeType && (a ? a.index(n) > -1 : 1 === n.nodeType && x.find.matchesSelector(n, e))) {
24215        n = o.push(n);break;
24216      }return this.pushStack(o.length > 1 ? x.unique(o) : o);
24217    }, index: function index(e) {
24218      return e ? "string" == typeof e ? x.inArray(this[0], x(e)) : x.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
24219    }, add: function add(e, t) {
24220      var n = "string" == typeof e ? x(e, t) : x.makeArray(e && e.nodeType ? [e] : e),
24221          r = x.merge(this.get(), n);return this.pushStack(x.unique(r));
24222    }, addBack: function addBack(e) {
24223      return this.add(null == e ? this.prevObject : this.prevObject.filter(e));
24224    } });function pt(e, t) {
24225    do e = e[t]; while (e && 1 !== e.nodeType);return e;
24226  }x.each({ parent: function parent(e) {
24227      var t = e.parentNode;return t && 11 !== t.nodeType ? t : null;
24228    }, parents: function parents(e) {
24229      return x.dir(e, "parentNode");
24230    }, parentsUntil: function parentsUntil(e, t, n) {
24231      return x.dir(e, "parentNode", n);
24232    }, next: function next(e) {
24233      return pt(e, "nextSibling");
24234    }, prev: function prev(e) {
24235      return pt(e, "previousSibling");
24236    }, nextAll: function nextAll(e) {
24237      return x.dir(e, "nextSibling");
24238    }, prevAll: function prevAll(e) {
24239      return x.dir(e, "previousSibling");
24240    }, nextUntil: function nextUntil(e, t, n) {
24241      return x.dir(e, "nextSibling", n);
24242    }, prevUntil: function prevUntil(e, t, n) {
24243      return x.dir(e, "previousSibling", n);
24244    }, siblings: function siblings(e) {
24245      return x.sibling((e.parentNode || {}).firstChild, e);
24246    }, children: function children(e) {
24247      return x.sibling(e.firstChild);
24248    }, contents: function contents(e) {
24249      return x.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : x.merge([], e.childNodes);
24250    } }, function (e, t) {
24251    x.fn[e] = function (n, r) {
24252      var i = x.map(this, t, n);return ("Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (i = x.filter(r, i)), this.length > 1 && (ct[e] || (i = x.unique(i)), lt.test(e) && (i = i.reverse())), this.pushStack(i));
24253    };
24254  }), x.extend({ filter: function filter(e, t, n) {
24255      var r = t[0];return (n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? x.find.matchesSelector(r, e) ? [r] : [] : x.find.matches(e, x.grep(t, function (e) {
24256        return 1 === e.nodeType;
24257      })));
24258    }, dir: function dir(e, n, r) {
24259      var i = [],
24260          o = e[n];while (o && 9 !== o.nodeType && (r === t || 1 !== o.nodeType || !x(o).is(r))) 1 === o.nodeType && i.push(o), o = o[n];return i;
24261    }, sibling: function sibling(e, t) {
24262      var n = [];for (; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);return n;
24263    } });function ft(e, t, n) {
24264    if (x.isFunction(t)) {
24265      return x.grep(e, function (e, r) {
24266        return !!t.call(e, r, e) !== n;
24267      });
24268    }if (t.nodeType) {
24269      return x.grep(e, function (e) {
24270        return e === t !== n;
24271      });
24272    }if ("string" == typeof t) {
24273      if (st.test(t)) {
24274        return x.filter(t, e, n);
24275      }t = x.filter(t, e);
24276    }return x.grep(e, function (e) {
24277      return x.inArray(e, t) >= 0 !== n;
24278    });
24279  }function dt(e) {
24280    var t = ht.split("|"),
24281        n = e.createDocumentFragment();if (n.createElement) while (t.length) n.createElement(t.pop());return n;
24282  }var ht = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
24283      gt = / jQuery\d+="(?:null|\d+)"/g,
24284      mt = RegExp("<(?:" + ht + ")[\\s/>]", "i"),
24285      yt = /^\s+/,
24286      vt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
24287      bt = /<([\w:]+)/,
24288      xt = /<tbody/i,
24289      wt = /<|&#?\w+;/,
24290      Tt = /<(?:script|style|link)/i,
24291      Ct = /^(?:checkbox|radio)$/i,
24292      Nt = /checked\s*(?:[^=]|=\s*.checked.)/i,
24293      kt = /^$|\/(?:java|ecma)script/i,
24294      Et = /^true\/(.*)/,
24295      St = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
24296      At = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], area: [1, "<map>", "</map>"], param: [1, "<object>", "</object>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: x.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] },
24297      jt = dt(a),
24298      Dt = jt.appendChild(a.createElement("div"));At.optgroup = At.option, At.tbody = At.tfoot = At.colgroup = At.caption = At.thead, At.th = At.td, x.fn.extend({ text: function text(e) {
24299      return x.access(this, function (e) {
24300        return e === t ? x.text(this) : this.empty().append((this[0] && this[0].ownerDocument || a).createTextNode(e));
24301      }, null, e, arguments.length);
24302    }, append: function append() {
24303      return this.domManip(arguments, function (e) {
24304        if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
24305          var t = Lt(this, e);t.appendChild(e);
24306        }
24307      });
24308    }, prepend: function prepend() {
24309      return this.domManip(arguments, function (e) {
24310        if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
24311          var t = Lt(this, e);t.insertBefore(e, t.firstChild);
24312        }
24313      });
24314    }, before: function before() {
24315      return this.domManip(arguments, function (e) {
24316        this.parentNode && this.parentNode.insertBefore(e, this);
24317      });
24318    }, after: function after() {
24319      return this.domManip(arguments, function (e) {
24320        this.parentNode && this.parentNode.insertBefore(e, this.nextSibling);
24321      });
24322    }, remove: function remove(e, t) {
24323      var n,
24324          r = e ? x.filter(e, this) : this,
24325          i = 0;for (; null != (n = r[i]); i++) t || 1 !== n.nodeType || x.cleanData(Ft(n)), n.parentNode && (t && x.contains(n.ownerDocument, n) && _t(Ft(n, "script")), n.parentNode.removeChild(n));return this;
24326    }, empty: function empty() {
24327      var e,
24328          t = 0;for (; null != (e = this[t]); t++) {
24329        1 === e.nodeType && x.cleanData(Ft(e, !1));while (e.firstChild) e.removeChild(e.firstChild);e.options && x.nodeName(e, "select") && (e.options.length = 0);
24330      }return this;
24331    }, clone: function clone(e, t) {
24332      return (e = null == e ? !1 : e, t = null == t ? e : t, this.map(function () {
24333        return x.clone(this, e, t);
24334      }));
24335    }, html: function html(e) {
24336      return x.access(this, function (e) {
24337        var n = this[0] || {},
24338            r = 0,
24339            i = this.length;if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(gt, "") : t;if (!("string" != typeof e || Tt.test(e) || !x.support.htmlSerialize && mt.test(e) || !x.support.leadingWhitespace && yt.test(e) || At[(bt.exec(e) || ["", ""])[1].toLowerCase()])) {
24340          e = e.replace(vt, "<$1></$2>");try {
24341            for (; i > r; r++) n = this[r] || {}, 1 === n.nodeType && (x.cleanData(Ft(n, !1)), n.innerHTML = e);n = 0;
24342          } catch (o) {}
24343        }n && this.empty().append(e);
24344      }, null, e, arguments.length);
24345    }, replaceWith: function replaceWith() {
24346      var e = x.map(this, function (e) {
24347        return [e.nextSibling, e.parentNode];
24348      }),
24349          t = 0;return (this.domManip(arguments, function (n) {
24350        var r = e[t++],
24351            i = e[t++];i && (r && r.parentNode !== i && (r = this.nextSibling), x(this).remove(), i.insertBefore(n, r));
24352      }, !0), t ? this : this.remove());
24353    }, detach: function detach(e) {
24354      return this.remove(e, !0);
24355    }, domManip: function domManip(e, t, n) {
24356      e = d.apply([], e);var r,
24357          i,
24358          o,
24359          a,
24360          s,
24361          l,
24362          u = 0,
24363          c = this.length,
24364          p = this,
24365          f = c - 1,
24366          h = e[0],
24367          g = x.isFunction(h);if (g || !(1 >= c || "string" != typeof h || x.support.checkClone) && Nt.test(h)) {
24368        return this.each(function (r) {
24369          var i = p.eq(r);g && (e[0] = h.call(this, r, i.html())), i.domManip(e, t, n);
24370        });
24371      }if (c && (l = x.buildFragment(e, this[0].ownerDocument, !1, !n && this), r = l.firstChild, 1 === l.childNodes.length && (l = r), r)) {
24372        for (a = x.map(Ft(l, "script"), Ht), o = a.length; c > u; u++) i = l, u !== f && (i = x.clone(i, !0, !0), o && x.merge(a, Ft(i, "script"))), t.call(this[u], i, u);if (o) for (s = a[a.length - 1].ownerDocument, x.map(a, qt), u = 0; o > u; u++) i = a[u], kt.test(i.type || "") && !x._data(i, "globalEval") && x.contains(s, i) && (i.src ? x._evalUrl(i.src) : x.globalEval((i.text || i.textContent || i.innerHTML || "").replace(St, "")));l = r = null;
24373      }return this;
24374    } });function Lt(e, t) {
24375    return x.nodeName(e, "table") && x.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e;
24376  }function Ht(e) {
24377    return (e.type = (null !== x.find.attr(e, "type")) + "/" + e.type, e);
24378  }function qt(e) {
24379    var t = Et.exec(e.type);return (t ? e.type = t[1] : e.removeAttribute("type"), e);
24380  }function _t(e, t) {
24381    var n,
24382        r = 0;for (; null != (n = e[r]); r++) x._data(n, "globalEval", !t || x._data(t[r], "globalEval"));
24383  }function Mt(e, t) {
24384    if (1 === t.nodeType && x.hasData(e)) {
24385      var n,
24386          r,
24387          i,
24388          o = x._data(e),
24389          a = x._data(t, o),
24390          s = o.events;if (s) {
24391        delete a.handle, a.events = {};for (n in s) for (r = 0, i = s[n].length; i > r; r++) x.event.add(t, n, s[n][r]);
24392      }a.data && (a.data = x.extend({}, a.data));
24393    }
24394  }function Ot(e, t) {
24395    var n, r, i;if (1 === t.nodeType) {
24396      if ((n = t.nodeName.toLowerCase(), !x.support.noCloneEvent && t[x.expando])) {
24397        i = x._data(t);for (r in i.events) x.removeEvent(t, r, i.handle);t.removeAttribute(x.expando);
24398      }"script" === n && t.text !== e.text ? (Ht(t).text = e.text, qt(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), x.support.html5Clone && e.innerHTML && !x.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && Ct.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue);
24399    }
24400  }
24400x.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, t) {
24401    x.fn[e] = function (e) {
24402      var n,
24403          r = 0,
24404          i = [],
24405          o = x(e),
24406          a = o.length - 1;for (; a >= r; r++) n = r === a ? this : this.clone(!0), x(o[r])[t](n), h.apply(i, n.get());return this.pushStack(i);
24407    };
24408  });function Ft(e, n) {
24409    var r,
24410        o,
24411        a = 0,
24412        s = typeof e.getElementsByTagName !== i ? e.getElementsByTagName(n || "*") : typeof e.querySelectorAll !== i ? e.querySelectorAll(n || "*") : t;if (!s) for (s = [], r = e.childNodes || e; null != (o = r[a]); a++) !n || x.nodeName(o, n) ? s.push(o) : x.merge(s, Ft(o, n));return n === t || n && x.nodeName(e, n) ? x.merge([e], s) : s;
24413  }function Bt(e) {
24414    Ct.test(e.type) && (e.defaultChecked = e.checked);
24415  }x.extend({ clone: function clone(e, t, n) {
24416      var r,
24417          i,
24418          o,
24419          a,
24420          s,
24421          l = x.contains(e.ownerDocument, e);if ((x.support.html5Clone || x.isXMLDoc(e) || !mt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (Dt.innerHTML = e.outerHTML, Dt.removeChild(o = Dt.firstChild)), !(x.support.noCloneEvent && x.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || x.isXMLDoc(e)))) for (r = Ft(o), s = Ft(e), a = 0; null != (i = s[a]); ++a) r[a] && Ot(i, r[a]);if (t) if (n) for (s = s || Ft(e), r = r || Ft(o), a = 0; null != (i = s[a]); a++) Mt(i, r[a]);else Mt(e, o);return (r = Ft(o, "script"), r.length > 0 && _t(r, !l && Ft(e, "script")), r = s = i = null, o);
24422    }, buildFragment: function buildFragment(e, t, n, r) {
24423      var i,
24424          o,
24425          a,
24426          s,
24427          l,
24428          u,
24429          c,
24430          p = e.length,
24431          f = dt(t),
24432          d = [],
24433          h = 0;for (; p > h; h++) if ((o = e[h], o || 0 === o)) if ("object" === x.type(o)) x.merge
24433(d, o.nodeType ? [o] : o);else if (wt.test(o)) {
24434        s = s || f.appendChild(t.createElement("div")), l = (bt.exec(o) || ["", ""])[1].toLowerCase(), c = At[l] || At._default, s.innerHTML = c[1] + o.replace(vt, "<$1></$2>") + c[2], i = c[0];while (i--) s = s.lastChild;if ((!x.support.leadingWhitespace && yt.test(o) && d.push(t.createTextNode(yt.exec(o)[0])), !x.support.tbody)) {
24435          o = "table" !== l || xt.test(o) ? "<table>" !== c[1] || xt.test(o) ? 0 : s : s.firstChild, i = o && o.childNodes.length;while (i--) x.nodeName(u = o.childNodes[i], "tbody") && !u.childNodes.length && o.removeChild(u);
24436        }x.merge(d, s.childNodes), s.textContent = "";while (s.firstChild) s.removeChild(s.firstChild);s = f.lastChild;
24437      } else d.push(t.createTextNode(o));s && f.removeChild(s), x.support.appendChecked || x.grep(Ft(d, "input"), Bt), h = 0;while (o = d[h++]) if ((!r || -1 === x.inArray(o, r)) && (a = x.contains(o.ownerDocument, o), s = Ft(f.appendChild(o), "script"), a && _t(s), n)) {
24438        i = 0;while (o = s[i++]) kt.test(o.type || "") && n.push(o);
24439      }return (s = null, f);
24440    }, cleanData: function cleanData(e, t) {
24441      var n,
24442          r,
24443          o,
24444          a,
24445          s = 0,
24446          l = x.expando,
24447          u = x.cache,
24448          c = x.support.deleteExpando,
24449          f = x.event.special;for (; null != (n = e[s]); s++) if ((t || x.acceptData(n)) && (o = n[l], a = o && u[o])) {
24450        if (a.events) for (r in a.events) f[r] ? x.event.remove(n, r) : x.removeEvent(n, r, a.handle);
24451        u[o] && (delete u[o], c ? delete n[l] : typeof n.removeAttribute !== i ? n.removeAttribute(l) : n[l] = null, p.push(o));
24452      }
24453    }, _evalUrl: function _evalUrl(e) {
24454      return x.ajax({ url: e, type: "GET", dataType: "script", async: !1, global: !1, throws: !0 });
24455    } }), x.fn.extend({ wrapAll: function wrapAll(e) {
24456      if (x.isFunction(e)) {
24457        return this.each(function (t) {
24458          x(this).wrapAll(e.call(this, t));
24459        });
24460      }if (this[0]) {
24461        var t = x(e, this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode && t.insertBefore(this[0]), t.map(function () {
24462          var e = this;while (e.firstChild && 1 === e.firstChild.nodeType) e = e.firstChild;return e;
24463        }).append(this);
24464      }return this;
24465    }, wrapInner: function wrapInner(e) {
24466      return x.isFunction(e) ? this.each(function (t) {
24467        x(this).wrapInner(e.call(this, t));
24468      }) : this.each(function () {
24469        var t = x(this),
24470            n = t.contents();n.length ? n.wrapAll(e) : t.append(e);
24471      });
24472    }, wrap: function wrap(e) {
24473      var t = x.isFunction(e);return this.each(function (n) {
24474        x(this).wrapAll(t ? e.call(this, n) : e);
24475      });
24476    }, unwrap: function unwrap() {
24477      return this.parent().each(function () {
24478        x.nodeName(this, "body") || x(this).replaceWith(this.childNodes);
24479      }).end();
24480    } });var Pt,
24481      Rt,
24482      Wt,
24483      $t = /alpha\([^)]*\)/i,
24484      It = /opacity\s*=\s*([^)]*)/,
24485      zt = /^(top|right|bottom|left)$/,
24486      Xt = /^(none|table(?!-c[ea]).+)/,
24487      Ut = /^margin/,
24488      Vt = RegExp("^(" + w + ")(.*)$", "i"),
24489      Yt = RegExp("^(" + w + ")(?!px)[a-z%]+$", "i"),
24490      Jt = RegExp("^([+-])=(" + w + ")", "i"),
24491      Gt = { BODY: "block" },
24492      Qt = { position: "absolute", visibility: "hidden", display: "block" },
24493      Kt = { letterSpacing: 0, fontWeight: 400 },
24494      Zt = ["Top", "Right", "Bottom", "Left"],
24495      en = ["Webkit", "O", "Moz", "ms"];function tn(e, t) {
24496    if (t in e) {
24497      return t;
24498    }var n = t.charAt(0).toUpperCase() + t.slice(1),
24499        r = t,
24500        i = en.length;while (i--) if ((t = en[i] + n, t in e)) {
24501      return t;
24502    }return r;
24503  }function nn(e, t) {
24504    return (e = t || e, "none" === x.css(e, "display") || !x.contains(e.ownerDocument, e));
24505  }function rn(e, t) {
24506    var n,
24507        r,
24508        i,
24509        o = [],
24510        a = 0,
24511        s = e.length;for (; s > a; a++) r = e[a], r.style && (o[a] = x._data(r, "olddisplay"), n = r.style.display, t ? (o[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && nn(r) && (
24511o[a] = x._data(r, "olddisplay", ln(r.nodeName)))) : o[a] || (i = nn(r), (n && "none" !== n || !i) && x._data(r, "olddisplay", i ? n : x.css(r, "display"))));for (a = 0; s > a; a++) r = e[a], r.style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? o[a] || "" : "none"));return e;
24512  }x.fn.extend({ css: function css(e, n) {
24513      return x.access(this, function (e, n, r) {
24514        var i,
24515            o,
24516            a = {},
24517            s = 0;if (x.isArray(n)) {
24518          for (o = Rt(e), i = n.length; i > s; s++) a[n[s]] = x.css(e, n[s], !1, o);return a;
24519        }return r !== t ? x.style(e, n, r) : x.css(e, n);
24520      }, e, n, arguments.length > 1);
24521    }, show: function show() {
24522      return rn(this, !0);
24523    }, hide: function hide() {
24524      return rn(this);
24525    }, toggle: function toggle(e) {
24526      return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () {
24527        nn(this) ? x(this).show() : x(this).hide();
24528      });
24529    } }), x.extend({ cssHooks: { opacity: { get: function get(e, t) {
24530          if (t) {
24531            var n = Wt(e, "opacity");return "" === n ? "1" : n;
24532          }
24533        } } }, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { float: x.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function style(e, n, r, i) {
24534      if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
24535        var o,
24536            a,
24537            s,
24538            l = x.camelCase(n),
24539            u = e.style;if ((n = x.cssProps[l] || (x.cssProps[l] = tn(u, l)), s = x.cssHooks[n] || x.cssHooks[l], r === t)) {
24540          return s && "get" in s && (o = s.get(e, !1, i)) !== t ? o : u[n];
24541        }if ((a = typeof r, "string" === a && (o = Jt.exec(r)) && (r = (o[1] + 1) * o[2] + parseFloat(x.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || x.cssNumber[l] || (r += "px"), x.support.clearCloneStyle || "" !== r || 0 !== n.indexOf("background") || (u[n] = "inherit"), s && "set" in s && (r = s.set(e, r, i)) === t)))) try {
24542          u[n] = r;
24543        } catch (c) {}
24544      }
24545    }, css: function css(e, n, r, i) {
24546      var o,
24547          a,
24548          s,
24549          l = x.camelCase(n);return (n = x.cssProps[l] || (x.cssProps[l] = tn(e.style, l)), s = x.cssHooks[n] || x.cssHooks[l], s && "get" in s && (a = s.get(e, !0, r)), a === t && (a = Wt(e, n, i)), "normal" === a && n in Kt && (a = Kt[n]), "" === r || r ? (o = parseFloat(a), r === !0 || x.isNumeric(o) ? o || 0 : a) : a);
24550    } }), e.getComputedStyle ? (Rt = function (t) {
24551    return e.getComputedStyle(t, null);
24552  }, Wt = function (e, n, r) {
24553    var i,
24554        o,
24555        a,
24556        s = r || Rt(e),
24557        l = s ? s.getPropertyValue(n) || s[n] : t,
24558        u = e.style;return (s && ("" !== l || x.contains(e.ownerDocument, e) || (l = x.style(e, n)), Yt.test(l) && Ut.test(n) && (i = u.width, o = u.minWidth, a = u.maxWidth, u.minWidth = u.maxWidth = u.width = l, l = s.width, u.width = i, u.minWidth = o, u.maxWidth = a)), l);
24559  }) : a.documentElement.currentStyle && (Rt = function (e) {
24560    return e.currentStyle;
24561  }, Wt = function (e, n, r) {
24562    var i,
24563        o,
24564        a,
24565        s = r || Rt(e),
24566        l = s ? s[n] : t,
24567        u = e.style;return (null == l && u && u[n] && (l = u[n]), Yt.test(l) && !zt.test(n) && (i = u.left, o = e.runtimeStyle, a = o && o.left, a && (o.left = e.currentStyle.left), u.left = "fontSize" === n ? "1em" : l, l = u.pixelLeft + "px", u.left = i, a && (o.left = a)), "" === l ? "auto" : l);
24568  });function on(e, t, n) {
24569    var r = Vt.exec(t);return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t;
24570  }function an(e, t, n, r, i) {
24571    var o = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0,
24572        a = 0;for (; 4 > o; o += 2) "margin" === n && (a += x.css(e, n + Zt[o], !0, i)), r ? ("content" === n && (a -= x.css(e, "padding" + Zt[o], !0, i)), "margin" !== n && (a -= x.css(e, "border" + Zt[o] + "Width", !0, i))) : (a += x.css(e, "padding" + Zt[o], !0, i), "padding" !== n && (a += x.css(e, "border" + Zt[o] + "Width", !0, i)));return a;
24573  }function sn(e, t, n) {
24574    var r = !0,
24575        i = "width" === t ? e.offsetWidth : e.offsetHeight,
24576        o = Rt(e),
24577        a = x.support.boxSizing && "border-box" === x.css(e, "boxSizing", !1, o);if (0 >= i || null == i) {
24578      if ((i = Wt(e, t, o), (0 > i || null == i) && (i = e.style[t]), Yt.test(i))) {
24579        return i;
24580      }r = a && (x.support.boxSizingReliable || i === e.style[t]), i = parseFloat(i) || 0;
24581    }return i + an(e, t, n || (a ? "border" : "content"), r, o) + "px";
24582  }function ln(e) {
24583    var t = a,
24584        n = Gt[e];return (n || (n = un(e, t), "none" !== n && n || (Pt = (Pt || x("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(t.documentElement), t = (Pt[0].contentWindow || Pt[0].contentDocument).document, t.write("<!doctype html><html><body>"), t.close(), n = un(e, t), Pt.detach()), Gt[e] = n), n);
24585  }function un(e, t) {
24586    var n = x(t.createElement(e)).appendTo(t.body),
24587        r = x.css(n[0], "display");return (n.remove(), r);
24588  }x.each(["height", "width"], function (e, n) {
24589    x.cssHooks[n] = { get: function get(e, r, i) {
24590        return r ? 0 === e.offsetWidth && Xt.test(x.css(e, "display")) ? x.swap(e, Qt, function () {
24591          return sn(e, n, i);
24592        }) : sn(e, n, i) : t;
24593      }, set: function set(e, t, r) {
24594        var i = r && Rt(e);return on(e, t, r ? an(e, n, r, x.support.boxSizing && "border-box" === x.css(e, "boxSizing", !1, i), i) : 0);
24595      } };
24596  }), x.support.opacity || (x.cssHooks.opacity = { get: function get(e, t) {
24597      return It.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? 0.01 * parseFloat(RegExp.$1) + "" : t ? "1" : "";
24598    }, set: function set(e, t) {
24599      var n = e.style,
24600          r = e.currentStyle,
24601          i = x.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "",
24602          o = r && r.filter || n.filter || "";n.zoom = 1, (t >= 1 || "" === t) && "" === x.trim(o.replace($t, "")) && n.removeAttribute && (n.removeAttribute("filter"), "" === t || r && !r.filter) || (n.filter = $t.test(o) ? o.replace($t, i) : o + " " + i);
24603    } }), x(function () {
24604    x.support.reliableMarginRight || (x.cssHooks.marginRight = { get: function get(e, n) {
24605        return n ? x.swap(e, { display: "inline-block" }, Wt, [e, "marginRight"]) : t;
24606      } }), !x.support.pixelPosition && x.fn.position && x.each(["top", "left"], function (e, n) {
24607      x.cssHooks[n] = { get: function get(e, r) {
24608          return r ? (r = Wt(e, n), Yt.test(r) ? x(e).position()[n] + "px" : r) : t;
24609        } };
24610    });
24611  }), x.expr && x.expr.filters && (x.expr.filters.hidden = function (e) {
24612    return 0 >= e.offsetWidth && 0 >= e.offsetHeight || !x.support.reliableHiddenOffsets && "none" === (e.style && e.style.display || x.css(e, "display"));
24613  }, x.expr.filters.visible = function (e) {
24614    return !x.expr.filters.hidden(e);
24615  }), x.each({ margin: "", padding: "", border: "Width" }, function (e, t) {
24616    x.cssHooks[e + t] = { expand: function expand(n) {
24617        var r = 0,
24618            i = {},
24619            o = "string" == typeof n ? n.split(" ") : [n];for (; 4 > r; r++) i[e + Zt[r] + t] = o[r] || o[r - 2] || o[0];return i;
24620      } }, Ut.test(e) || (x.cssHooks[e + t].set = on);
24621  });var cn = /%20/g,
24622      pn = /\[\]$/,
24623      fn = /\r?\n/g,
24624      dn = /^(?:submit|button|image|reset|file)$/i,
24625      hn = /^(?:input|select|textarea|keygen)/i;x.fn.extend({ serialize: function serialize() {
24626      return x.param(this.serializeArray());
24627    }, serializeArray: function serializeArray() {
24628      return this.map(function () {
24629        var e = x.prop(this, "elements");return e ? x.makeArray(e) : this;
24630      }).filter(function () {
24631        var e = this.type;return this.name && !x(this).is(":disabled") && hn.test(this.nodeName) && !dn.test(e) && (this.checked || !Ct.test(e));
24632      }).map(function (e, t) {
24633        var n = x(this).val();return null == n ? null : x.isArray(n) ? x.map(n, function (e) {
24634          return { name: t.name, value: e.replace(fn, "\r\n") };
24635        }) : { name: t.name, value: n.replace(fn, "\r\n") };
24636      }).get();
24637    } }), x.param = function (e, n) {
24638    var r,
24639        i = [],
24640        o = function o(e, t) {
24641      t = x.isFunction(t) ? t() : null == t ? "" : t, i[i.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t);
24642    };if ((n === t && (n = x.ajaxSettings && x.ajaxSettings.traditional), x.isArray(e) || e.jquery && !x.isPlainObject(e))) x.each(e, function () {
24643      o(this.name, this.value);
24644    });else for (r in e) gn(r, e[r], n, o);return i.join("&").replace(cn, "+");
24645  };function gn(e, t, n, r) {
24646    var i;if (x.isArray(t)) x.each(t, function (t, i) {
24647      n || pn.test(e) ? r(e, i) : gn(e + "[" + ("object" == typeof i ? t : "") + "]", i, n, r);
24648    });else if (n || "object" !== x.type(t)) r(e, t);else for (i in t) gn(e + "[" + i + "]", t[i], n, r);
24649  }x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) {
24650    x.fn[t] = function (e, n) {
24651      return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t);
24652    };
24653  }), x.fn.extend({ hover: function hover(e, t) {
24654      return this.mouseenter(e).mouseleave(t || e);
24655    }, bind: function bind(e, t, n) {
24656      return this.on(e, null, t, n);
24657    }, unbind: function unbind(e, t) {
24658      return this.off(e, null, t);
24659    }, delegate: function delegate(e, t, n, r) {
24660      return this.on(t, e, n, r);
24661    }, undelegate: function undelegate(e, t, n) {
24662      return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n);
24663    } });var mn,
24664      yn,
24665      vn = x.now(),
24666      bn = /\?/,
24667      xn = /#.*$/,
24668      wn = /([?&])_=[^&]*/,
24669      Tn = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
24670      Cn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
24671      Nn = /^(?:GET|HEAD)$/,
24672      kn = /^\/\//,
24673      En = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
24674      Sn = x.fn.load,
24675      An = {},
24676      jn = {},
24677      Dn = "*/".concat("*");try {
24678    yn = o.href;
24679  } catch (Ln) {
24680    yn = a.createElement("a"), yn.href = "", yn = yn.href;
24681  }mn = En.exec(yn.toLowerCase()) || [];function Hn(e) {
24682    return function (t, n) {
24683      "string" != typeof t && (n = t, t = "*");var r,
24684          i = 0,
24685          o = t.toLowerCase().match(T) || [];if (x.isFunction(n)) while (r = o[i++]) "+" === r[0] ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n);
24686    };
24687  }function qn(e, n, r, i) {
24688    var o = {},
24689        a = e === jn;function s(l) {
24690      var u;return (o[l] = !0, x.each(e[l] || [], function (e, l) {
24691        var c = l(n, r, i);return "string" != typeof c || a || o[c] ? a ? !(u = c) : t : (n.dataTypes.unshift(c), s(c), !1);
24692      }), u);
24693    }return s(n.dataTypes[0]) || !o["*"] && s("*");
24694  }function _n(e, n) {
24695    var r,
24696        i,
24697        o = x.ajaxSettings.flatOptions || {};for (i in n) n[i] !== t && ((o[i] ? e : r || (r = {}))[i] = n[i]);return (r && x.extend(!0, e, r), e);
24698  }x.fn.load = function (e, n, r) {
24699    if ("string" != typeof e && Sn) return Sn.apply(this, arguments);var i,
24700        o,
24701        a,
24702        s = this,
24703        l = e.indexOf(" ");return (l >= 0 && (i = e.slice(l, e.length), e = e.slice(0, l)), x.isFunction(n) ? (r = n, n = t) : n && "object" == typeof n && (a = "POST"), s.length > 0 && x.ajax({ url: e, type: a, dataType: "html", data: n }).done(function (e) {
24704      o = arguments, s.html(i ? x("<div>").append(x.parseHTML(e)).find(i) : e);
24705    }).complete(r && function (e, t) {
24706      s.each(r, o || [e.responseText, t, e]);
24707    }), this);
24708  }, x.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) {
24709    x.fn[t] = function (e) {
24710      return this.on(t, e);
24711    };
24712  }), x.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: yn, type: "GET", isLocal: Cn.test(mn[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Dn, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": x.parseJSON, "text xml": x.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function ajaxSetup(e, t) {
24713      return t ? _n(_n(e, x.ajaxSettings), t) : _n(x.ajaxSettings, e);
24714    }, ajaxPrefilter: Hn(An), ajaxTransport: Hn(jn), ajax: function ajax(e, n) {
24715      "object" == typeof e && (n = e, e = t), n = n || {};var r,
24716          i,
24717          o,
24718          a,
24719          s,
24720          l,
24721          u,
24722          c,
24723          p = x.ajaxSetup({}, n),
24724          f = p.context || p,
24725          d = p.context && (f.nodeType || f.jquery) ? x(f) : x.event,
24726          h = x.Deferred(),
24727          g = x.Callbacks("once memory"),
24728          m = p.statusCode || {},
24729          y = {},
24730          v = {},
24731          b = 0,
24732          w = "canceled",
24733          C = { readyState: 0, getResponseHeader: function getResponseHeader(e) {
24734          var t;if (2 === b) {
24735            if (!c) {
24736              c = {};while (t = Tn.exec(a)) c[t[1].toLowerCase()] = t[2];
24737            }t = c[e.toLowerCase()];
24738          }return null == t ? null : t;
24739        }, getAllResponseHeaders: function getAllResponseHeaders() {
24740          return 2 === b ? a : null;
24741        }, setRequestHeader: function setRequestHeader(e, t) {
24742          var n = e.toLowerCase();return (b || (e = v[n] = v[n] || e, y[e] = t), this);
24743        }, overrideMimeType: function overrideMimeType(e) {
24744          return (b || (p.mimeType = e), this);
24745        }, statusCode: function statusCode(e) {
24746          var t;if (e) if (2 > b) for (t in e) m[t] = [m[t], e[t]];else C.always(e[C.status]);return this;
24747        }, abort: function abort(e) {
24748          var t = e || w;return (u && u.abort(t), k(0, t), this);
24749        } };if ((h.promise(C).complete = g.add, C.success = C.done, C.error = C.fail, p.url = ((e || p.url || yn) + "").replace(xn, "").replace(kn, mn[1] + "//"), p.type = n.method || n.type || p.method || p.t
24749ype, p.dataTypes = x.trim(p.dataType || "*").toLowerCase().match(T) || [""], null == p.crossDomain && (r = En.exec(p.url.toLowerCase()), p.crossDomain = !(!r || r[1] === mn[1] && r[2] === mn[2] && (r[3] || ("http:" === r[1] ? "80" : "443")) === (mn[3] || ("http:" === mn[1] ? "80" : "443")))), p.data && p.processData && "string" != typeof p.data && (p.data = x.param(p.data, p.traditional)), qn(An, p, n, C), 2 === b)) {
24750        return C;
24751      }l = p.global, l && 0 === x.active++ && x.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(), p.hasContent = !Nn.test(p.type), o = p.url, p.hasContent || (p.data && (o = p.url += (bn.test(o) ? "&" : "?") + p.data, delete p.data), p.cache === !1 && (p.url = wn.test(o) ? o.replace(wn, "$1_=" + vn++) : o + (bn.test(o) ? "&" : "?") + "_=" + vn++)), p.ifModified && (x.lastModified[o] && C.setRequestHeader("If-Modified-Since", x.lastModified[o]), x.etag[o] && C.setRequestHeader("If-None-Match", x.etag[o])), (p.data && p.hasContent && p.contentType !== !1 || n.contentType) && C.setRequestHeader("Content-Type", p.contentType), C.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + Dn + "; q=0.01" : "") : p.accepts["*"]);for (i in p.headers) C.setRequestHeader(i, p.headers[i]);if (p.beforeSend && (p.beforeSend.call(f, C, p) === !1 || 2 === b)) {
24752        return C.abort();
24753      }w = "abort";for (i in { success: 1, error: 1, complete: 1 }) C[i](p[i]);if (u = qn(jn, p, n, C)) {
24754        C.readyState = 1, l && d.trigger("ajaxSend", [C, p]), p.async && p.timeout > 0 && (s = setTimeout(function () {
24755          C.abort("timeout");
24756        }, p.timeout));try {
24757          b = 1, u.send(y, k);
24758        } catch (N) {
24759          if (!(2 > b)) throw N;k(-1, N);
24760        }
24761      } else k(-1, "No Transport");function k(e, n, r, i) {
24762        var c,
24763            y,
24764            v,
24765            w,
24766            T,
24767            N = n;2 !== b && (b = 2, s && clearTimeout(s), u = t, a = i || "", C.readyState = e > 0 ? 4 : 0, c = e >= 200 && 300 > e || 304 === e, r && (w = Mn(p, C, r)), w = On(p, w, C, c), c ? (p.ifModified && (T = C.getResponseHeader("Last-Modified"), T && (x.lastModified[o] = T), T = C.getResponseHeader("etag"), T && (x.etag[o] = T)), 204 === e || "HEAD" === p.type ? N = "nocontent" : 304 === e ? N = "notmodified" : (N = w.state, y = w.data, v = w.error, c = !v)) : (v = N, (e || !N) && (N = "error", 0 > e && (e = 0))), C.status = e, C.statusText = (n || N) + "", c ? h.resolveWith(f, [y, N, C]) : h.rejectWith(f, [C, N, v]), C.statusCode(m), m = t, l && d.trigger(c ? "ajaxSuccess" : "ajaxError", [C, p, c ? y : v]), g.fireWith(f, [C, N]), l && (d.trigger("ajaxComplete", [C, p]), --x.active || x.event.trigger("ajaxStop")));
24768      }return C;
24769    }, getJSON: function getJSON(e, t, n) {
24770      return x.get(e, t, n, "json");
24771    }, getScript: function getScript(e, n) {
24772      return x.get(e, t, n, "script");
24773    } }), x.each(["get", "post"], function (e, n) {
24774    x[n] = function (e, r, i, o) {
24775      return (x.isFunction(r) && (o = o || i, i = r, r = t), x.ajax({ url: e, type: n, dataType: o, data: r, success: i }));
24776    };
24777  });function Mn(e, n, r) {
24778    var i,
24779        o,
24780        a,
24781        s,
24782        l = e.contents,
24783        u = e.dataTypes;while ("*" === u[0]) u.shift(), o === t && (o = e.mimeType || n.getResponseHeader("Content-Type"));if (o) for (s in l) if (l[s] && l[s].test(o)) {
24784      u.unshift(s);break;
24785    }if (u[0] in r) a = u[0];else {
24786      for (s in r) {
24787        if (!u[0] || e.converters[s + " " + u[0]]) {
24788          a = s;break;
24789        }i || (i = s);
24790      }a = a || i;
24791    }return a ? (a !== u[0] && u.unshift(a), r[a]) : t;
24792  }function On(e, t, n, r) {
24793    var i,
24794        o,
24795        a,
24796        s,
24797        l,
24798        u = {},
24799        c = e.dataTypes.slice();if (c[1]) for (a in e.converters) u[a.toLowerCase()] = e.converters[a];o = c.shift();while (o) if ((e.responseFields[o] && (n[e.responseFields[o]] = t), !l && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = o, o = c.shift())) if ("*" === o) o = l;else if ("*" !== l && l !== o) {
24800      if ((a = u[l + " " + o] || u["* " + o], !a)) for (i in u) if ((s = i.split(" "), s[1] === o && (a = u[l + " " + s[0]] || u["* " + s[0]]))) {
24801        a === !0 ? a = u[i] : u[i] !== !0 && (o = s[0], c.unshift(s[1]));break;
24802      }if (a !== !0) if (a && e.throws) t = a(t);else try {
24803        t = a(t);
24804      } catch (p) {
24805        return { state: "parsererror", error: a ? p : "No conversion from " + l + " to " + o };
24806      }
24807    }return { state: "success", data: t };
24808  }x.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function textScript(e) {
24809        return (x.globalEval(e), e);
24810      } } }), x.ajaxPrefilter("script", function (e) {
24811    e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1);
24812  }), x.ajaxTransport("script", function (e) {
24813    if (e.crossDomain) {
24814      var n,
24815          r = a.head || x("head")[0] || a.documentElement;return { send: function send(t, i) {
24816          n = a.createElement("script"), n.async = !0, e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, t) {
24817            (t || !n.readyState || /loaded|complete/.test(n.readyState)) && (n.onload = n.onreadystatechange = null, n.parentNode && n.parentNode.removeChild(n), n = null, t || i(200, "success"));
24818          }, r.insertBefore(n, r.firstChild);
24819        }, abort: function abort() {
24820          n && n.onload(t, !0);
24821        } };
24822    }
24823  });var Fn = [],
24824      Bn = /(=)\?(?=&|$)|\?\?/;x.ajaxSetup({ jsonp: "callback", jsonpCallback: function jsonpCallback() {
24825      var e = Fn.pop() || x.expando + "_" + vn++;return (this[e] = !0, e);
24826    } }), x.ajaxPrefilter("json jsonp", function (n, r, i) {
24827    var o,
24828        a,
24829        s,
24830        l = n.jsonp !== !1 && (Bn.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && Bn.test(n.data) && "data");return l || "jsonp" === n.dataTypes[0] ? (o = n.jsonpCallback = x.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback, l ? n[l] = n[l].replace(Bn, "$1" + o) : n.jsonp !== !1 && (n.url += (bn.test(n.url) ? "&" : "?") + n.jsonp + "=" + o), n.converters["script json"] = function () {
24831      return (s || x.error(o + " was not called"), s[0]);
24832    }, n.dataTypes[0] = "json", a = e[o], e[o] = function () {
24833      s = arguments;
24834    }, i.always(function () {
24835      e[o] = a, n[o] && (n.jsonpCallback = r.jsonpCallback, Fn.push(o)), s && x.isFunction(a) && a(s[0]), s = a = t;
24836    }), "script") : t;
24837  });var Pn,
24838      Rn,
24839      Wn = 0,
24840      $n = e.ActiveXObject && function () {
24841    var e;for (e in Pn) Pn[e](t, !0);
24842  };function In() {
24843    try {
24844      return new e.XMLHttpRequest();
24845    } catch (t) {}
24846  }function zn() {
24847    try {
24848      return new e.ActiveXObject("Microsoft.XMLHTTP");
24849    } catch (t) {}
24850  }x.ajaxSettings.xhr = e.ActiveXObject ? function () {
24851    return !this.isLocal && In() || zn();
24852  } : In, Rn = x.ajaxSettings.xhr(), x.support.cors = !!Rn && "withCredentials" in Rn, Rn = x.support.ajax = !!Rn, Rn && x.ajaxTransport(function (n) {
24853    if (!n.crossDomain || x.support.cors) {
24854      var r;return { send: function send(i, o) {
24855          var a,
24856              s,
24857              l = n.xhr();if ((n.username ? l.open(n.type, n.url, n.async, n.username, n.password) : l.open(n.type, n.url, n.async), n.xhrFields)) for (s in n.xhrFields) l[s] = n.xhrFields[s];n.mimeType && l.overrideMimeType && l.overrideMimeType(n.mimeType), n.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");try {
24858            for (s in i) l.setRequestHeader(s, i[s]);
24859          } catch (u) {}l.send(n.hasContent && n.data || null), r = function (e, i) {
24860            var s, u, c, p;try {
24861              if (r && (i || 4 === l.readyState)) if ((r = t, a && (l.onreadystatechange = x.noop, $n && delete Pn[a]), i)) 4 !== l.readyState && l.abort();else {
24862                p = {}, s = l.status, u = l.getAllResponseHeaders(), "string" == typeof l.responseText && (p.text = l.responseText);try {
24863                  c = l.statusText;
24864                } catch (f) {
24865                  c = "";
24866                }s || !n.isLocal || n.crossDomain ? 1223 === s && (s = 204) : s = p.text ? 200 : 404;
24867              }
24868            } catch (d) {
24869              i || o(-1, d);
24870            }p && o(s, c, p, u);
24871          }, n.async ? 4 === l.readyState ? setTimeout(r) : (a = ++Wn, $n && (Pn || (Pn = {}, x(e).unload($n)), Pn[a] = r), l.onreadystatechange = r) : r();
24872        }, abort: function abort() {
24873          r && r(t, !0);
24874        } };
24875    }
24876  });var Xn,
24877      Un,
24878      Vn = /^(?:toggle|show|hide)$/,
24879      Yn = RegExp("^(?:([+-])=|)(" + w + ")([a-z%]*)$", "i"),
24880      Jn = /queueHooks$/,
24881      Gn = [nr],
24882      Qn = { "*": [function (e, t) {
24883      var n = this.createTween(e, t),
24884          r = n.cur(),
24885          i = Yn.exec(t),
24886          o = i && i[3] || (x.cssNumber[e] ? "" : "px"),
24887          a = (x.cssNumber[e] || "px" !== o && +r) && Yn.exec(x.css(n.elem, e)),
24888          s = 1,
24889          l = 20;if (a && a[3] !== o) {
24890        o = o || a[3], i = i || [], a = +r || 1;do s = s || ".5", a /= s, x.style(n.elem, e, a + o); while (s !== (s = n.cur() / r) && 1 !== s && --l);
24891      }return (i && (a = n.start = +a || +r || 0, n.unit = o, n.end = i[1] ? a + (i[1] + 1) * i[2] : +i[2]), n);
24892    }] };function Kn() {
24893    return (setTimeout(function () {
24894      Xn = t;
24895    }), Xn = x.now());
24896  }function Zn(e, t, n) {
24897    var r,
24898        i = (Qn[t] || []).concat(Qn["*"]),
24899        o = 0,
24900        a = i.length;for (; a > o; o++) if (r = i[o].call(n, t, e)) {
24901      return r;
24902    }
24903  }function er(e, t, n) {
24904    var r,
24905        i,
24906        o = 0,
24907        a = Gn.length,
24908        s = x.Deferred().always(function () {
24909      delete l.elem;
24910    }),
24911        l = (function (_l) {
24912      var _lWrapper = function l() {
24913        return _l.apply(this, arguments);
24914      };
24915
24916      _lWrapper.toString = function () {
24917        return _l.toString();
24918      };
24919
24920      return _lWrapper;
24921    })(function () {
24922      if (i) return !1;var t = Xn || Kn(),
24923          n = Math.max(0, u.startTime + u.duration - t),
24924          r = n / u.duration || 0,
24925          o = 1 - r,
24926          a = 0,
24927          l = u.tweens.length;for (; l > a; a++) u.tweens[a].run(o);return (s.notifyWith(e, [u, o, n]), 1 > o && l ? n : (s.resolveWith(e, [u]), !1));
24928    }),
24929        u = s.promise({ elem: e, props: x.extend({}, t), opts: x.extend(!0, { specialEasing: {} }, n), originalProperties: t, originalOptions: n, startTime: Xn || Kn(), duration: n.duration, tweens: [], createTween: function createTween(t, n) {
24930        var r = x.Tween(e, u.opts, t, n, u.opts.specialEasing[t] || u.opts.easing);return (u.tweens.push(r), r);
24931      }, stop: function stop(t) {
24932        var n = 0,
24933            r = t ? u.tweens.length : 0;if (i) {
24934          return this;
24935        }for (i = !0; r > n; n++) u.tweens[n].run(1);return (t ? s.resolveWith(e, [u, t]) : s.rejectWith(e, [u, t]), this);
24936      } }),
24937        c = u.props;for (tr(c, u.opts.specialEasing); a > o; o++) if (r = Gn[o].call(u, e, c, u.opts)) {
24938      return r;
24939    }return (x.map(c, Zn, u), x.isFunction(u.opts.start) && u.opts.start.call(e, u), x.fx.timer(x.extend(l, { elem: e, anim: u, queue: u.opts.queue }
24939)), u.progress(u.opts.progress).done(u.opts.done, u.opts.complete).fail(u.opts.fail).always(u.opts.always));
24940  }function tr(e, t) {
24941    var n, r, i, o, a;for (n in e) if ((r = x.camelCase(n), i = t[r], o = e[n], x.isArray(o) && (i = o[1], o = e[n] = o[0]), n !== r && (e[r] = o, delete e[n]), a = x.cssHooks[r], a && "expand" in a)) {
24942      o = a.expand(o), delete e[r];for (n in o) n in e || (e[n] = o[n], t[n] = i);
24943    } else t[r] = i;
24944  }x.Animation = x.extend(er, { tweener: function tweener(e, t) {
24945      x.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" ");var n,
24946          r = 0,
24947          i = e.length;for (; i > r; r++) n = e[r], Qn[n] = Qn[n] || [], Qn[n].unshift(t);
24948    }, prefilter: function prefilter(e, t) {
24949      t ? Gn.unshift(e) : Gn.push(e);
24950    } });function nr(e, t, n) {
24951    var r,
24952        i,
24953        o,
24954        a,
24955        s,
24956        l,
24957        u = this,
24958        c = {},
24959        p = e.style,
24960        f = e.nodeType && nn(e),
24961        d = x._data(e, "fxshow");n.queue || (s = x._queueHooks(e, "fx"), null == s.unqueued && (s.unqueued = 0, l = s.empty.fire, s.empty.fire = function () {
24962      s.unqueued || l();
24963    }), s.unqueued++, u.always(function () {
24964      u.always(function () {
24965        s.unqueued--, x.queue(e, "fx").length || s.empty.fire();
24966      });
24967    })), 1 === e.nodeType && ("height" in t || "width" in t) && (n.overflow = [p.overflow, p.overflowX, p.overflowY], "inline" === x.css(e, "display") && "none" === x.css(e, "float") && (x.support.inlineBlockNeedsLayout && "inline" !== ln(e.nodeName) ? p.zoom = 1 : p.display = "inline-block")), n.overflow && (p.overflow = "hidden", x.support.shrinkWrapBlocks || u.always(function () {
24968      p.overflow = n.overflow[0], p.overflowX = n.overflow[1], p.overflowY = n.overflow[2];
24969    }));for (r in t) if ((i = t[r], Vn.exec(i))) {
24970      if ((delete t[r], o = o || "toggle" === i, i === (f ? "hide" : "show"))) continue;c[r] = d && d[r] || x.style(e, r);
24971    }if (!x.isEmptyObject(c)) {
24972      d ? "hidden" in d && (f = d.hidden) : d = x._data(e, "fxshow", {}), o && (d.hidden = !f), f ? x(e).show() : u.done(function () {
24973        x(e).hide();
24974      }), u.done(function () {
24975        var t;x._removeData(e, "fxshow");for (t in c) x.style(e, t, c[t]);
24976      });for (r in c) a = Zn(f ? d[r] : 0, r, u), r in d || (d[r] = a.start, f && (a.end = a.start, a.start = "width" === r || "height" === r ? 1 : 0));
24977    }
24978  }function rr(e, t, n, r, i) {
24979    return new rr.prototype.init(e, t, n, r, i);
24980  }x.Tween = rr, rr.prototype = { constructor: rr, init: function init(e, t, n, r, i, o) {
24981      this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (x.cssNumber[n] ? "" : "px");
24982    }, cur: function cur() {
24983      var e = rr.propHooks[this.prop];return e && e.get ? e.get(this) : rr.propHooks._default.get(this);
24984    }, run: function run(e) {
24985      var t,
24986          n = rr.propHooks[this.prop];return (this.pos = t = this.options.duration ? x.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : rr.propHooks._default.set(this), this);
24987    } }, rr.prototype.init.prototype = rr.prototype, rr.propHooks = { _default: { get: function get(e) {
24988        var t;return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = x.css(e.elem, e.prop, ""), t && "auto" !== t ? t : 0) : e.elem[e.prop];
24989      }, set: function set(e) {
24990        x.fx.step[e.prop] ? x.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[x.cssProps[e.prop]] || x.cssHooks[e.prop]) ? x.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now;
24991      } } }, rr.propHooks.scrollTop = rr.propHooks.scrollLeft = { set: function set(e) {
24992      e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now);
24993    } }, x.each(["toggle", "show", "hide"], function (e, t) {
24994    var n = x.fn[t];x.fn[t] = function (e, r, i) {
24995      return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(ir(t, !0), e, r, i);
24996    };
24997  }), x.fn.extend({ fadeTo: function fadeTo(e, t, n, r) {
24998      return this.filter(nn).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r);
24999    }, animate: function animate(e, t, n, r) {
25000      var i = x.isEmptyObject(e),
25001          o = x.speed(t, n, r),
25002          a = function a() {
25003        var t = er(this, x.extend({}, e), o);(i || x._data(this, "finish")) && t.stop(!0);
25004      };return (a.finish = a, i || o.queue === !1 ? this.each(a) : this.queue(o.queue, a));
25005    }, stop: function stop(e, n, r) {
25006      var i = function i(e) {
25007        var t = e.stop;delete e.stop, t(r);
25008      };return ("string" != typeof e && (r = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function () {
25009        var t = !0,
25010            n = null != e && e + "queueHooks",
25011            o = x.timers,
25012            a = x._data(this);if (n) a[n] && a[n].stop && i(a[n]);else for (n in a) a[n] && a[n].stop && Jn.test(n) && i(a[n]);for (n = o.length; n--;) o[n].elem !== this || null != e && o[n].queue !== e || (o[n].anim.stop(r), t = !1, o.splice(n, 1));(t || !r) && x.dequeue(this, e);
25013      }));
25014    }, finish: function finish(e) {
25015      return (e !== !1 && (e = e || "fx"), this.each(function () {
25016        var t,
25017            n = x._data(this),
25018            r = n[e + "queue"],
25019            i = n[e + "queueHooks"],
25020            o = x.timers,
25021            a = r ? r.length : 0;for (n.finish = !0, x.queue(this, e, []), i && i.stop && i.stop.call(this, !0), t = o.length; t--;) o[t].elem === this && o[t].queue === e && (o[t].anim.stop(!0), o.splice(t, 1));for (t = 0; a > t; t++) r[t] && r[t].finish && r[t].finish.call(this);delete n.finish;
25022      }));
25023    } });function ir(e, t) {
25024    var n,
25025        r = { height: e },
25026        i = 0;for (t = t ? 1 : 0; 4 > i; i += 2 - t) n = Zt[i], r["margin" + n] = r["padding" + n] = e;return (t && (r.opacity = r.width = e), r);
25027  }x.each({ slideDown: ir("show"), slideUp: ir("hide"), slideToggle: ir("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (e, t) {
25028    x.fn[e] = function (e, n, r) {
25029      return this.animate(t, e, n, r);
25030    };
25031  }), x.speed = function (e, t, n) {
25032    var r = e && "object" == typeof e ? x.extend({}, e) : { complete: n || !n && t || x.isFunction(e) && e, duration: e, easing: n && t || t && !x.isFunction(t) && t };return (r.duration = x.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in x.fx.speeds ? x.fx.speeds[r.duration] : x.fx.speeds._default, (null == r.queue || r.queue === !0) && (r.queue = "fx"), r.old = r.complete, r.complete = function () {
25033      x.isFunction(r.old) && r.old.call(this), r.queue && x.dequeue(this, r.queue);
25034    }, r);
25035  }, x.easing = { linear: function linear(e) {
25036      return e;
25037    }, swing: function swing(e) {
25038      return 0.5 - Math.cos(e * Math.PI) / 2;
25039    } }, x.timers = [], x.fx = rr.prototype.init, x.fx.tick = function () {
25040    var e,
25041        n = x.timers,
25042        r = 0;for (Xn = x.now(); n.length > r; r++) e = n[r], e() || n[r] !== e || n.splice(r--, 1);n.length || x.fx.stop(), Xn = t;
25043  }, x.fx.timer = function (e) {
25044    e() && x.timers.push(e) && x.fx.start();
25045  }, x.fx.interval = 13, x.fx.start = function () {
25046    Un || (Un = setInterval(x.fx.tick, x.fx.interval));
25047  }, x.fx.stop = function () {
25048    clearInterval(Un), Un = null;
25049  }, x.fx.speeds = { slow: 600, fast: 200, _default: 400 }, x.fx.step = {}, x.expr && x.expr.filters && (x.expr.filters.animated = function (e) {
25050    return x.grep(x.timers, function (t) {
25051      return e === t.elem;
25052    }).length;
25053  }), x.fn.offset = function (e) {
25054    if (arguments.length) return e === t ? this : this.each(function (t) {
25055      x.offset.setOffset(this, e, t);
25056    });var n,
25057        r,
25058        o = { top: 0, left: 0 },
25059        a = this[0],
25060        s = a && a.ownerDocument;if (s) return (n = s.documentElement, x.contains(n, a) ? (typeof a.getBoundingClientRect !== i && (o = a.getBoundingClientRect()), r = or(s), { top: o.top + (r.pageYOffset || n.scrollTop) - (n.clientTop || 0), left: o.left + (r.pageXOffset || n.scrollLeft) - (n.clientLeft || 0) }) : o);
25061  }, x.offset = { setOffset: function setOffset(e, t, n) {
25062      var r = x.css(e, "position");"static" === r && (e.style.position = "relative");var i = x(e),
25063          o = i.offset(),
25064          a = x.css(e, "top"),
25065          s = x.css(e, "left"),
25066          l = ("absolute" === r || "fixed" === r) && x.inArray("auto", [a, s]) > -1,
25067          u = {},
25068          c = {},
25069          p,
25070          f;l ? (c = i.position(), p = c.top, f = c.left) : (p = parseFloat(a) || 0, f = parseFloat(s) || 0), x.isFunction(t) && (t = t.call(e, n, o)), null != t.top && (u.top = t.top - o.top + p), null != t.left && (u.left = t.left - o.left + f), "using" in t ? t.using.call(e, u) : i.css(u);
25071    } }, x.fn.extend({ position: function position() {
25072      if (this[0]) {
25073        var e,
25074            t,
25075            n = { top: 0, left: 0 },
25076            r = this[0];return ("fixed" === x.css(r, "position") ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), x.nodeName(e[0], "html") || (n = e.offset()), n.top += x.css(e[0], "borderTopWidth", !0), n.left += x.css(e[0], "borderLeftWidth", !0)), { top: t.top - n.top - x.css(r, "marginTop", !0), left: t.left - n.left - x.css(r, "marginLeft", !0) });
25077      }
25078    }, offsetParent: function offsetParent() {
25079      return this.map(function () {
25080        var e = this.offsetParent || s;while (e && !x.nodeName(e, "html") && "static" === x.css(e, "position")) e = e.offsetParent;return e || s;
25081      });
25082    } }), x.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (e, n) {
25083    var r = /Y/.test(n);x.fn[e] = function (i) {
25084      return x.access(this, function (e, i, o) {
25085        var a = or(e);return o === t ? a ? n in a ? a[n] : a.document.documentElement[i] : e[i] : (a ? a.scrollTo(r ? x(a).scrollLeft() : o, r ? o : x(a).scrollTop()) : e[i] = o, t);
25086      }, e, i, arguments.length, null);
25087    };
25088  });function or(e) {
25089    return x.isWindow(e) ? e : 9 === e.nodeType ? e.defaultView || e.parentWindow : !1;
25090  }x.each({ Height: "height", Width: "width" }, function (e, n) {
25091    x.each({ padding: "inner" + e, content: n, "": "outer" + e }, function (r, i) {
25092      x.fn[i] = function (i, o) {
25093        var a = arguments.length && (r || "boolean" != typeof i),
25094            s = r || (i === !0 || o === !0 ? "margin" : "border");return x.access(this, function (n, r, i) {
25095          var o;return x.isWindow(n) ? n.document.documentElement["client" + e] : 9 === n.nodeType ? (o = n.documentElement, Math.max(n.body["scroll" + e], o["scroll" + e], n.body["offset" + e], o["offset" + e], o["client" + e])) : i === t ? x.css(n, r, s) : x.style(n, r, i, s);
25096        }, n, a ? i : t, a, null);
25097      };
25098    });
25099  }), x.fn.size = function () {
25100    return this.length;
25101  }, x.fn.andSelf = x.fn.addBack, "object" == typeof module && module && "object" == typeof module.exports ? module.exports = x : (e.jQuery = e.$ = x, "function" == typeof define && define.amd && define("jquery", [], function () {
25102    return x;
25103  }));
25104})(window);
25105
25106},{}]},{},[23])
25107
25108//# sourceMappingURL=aopa.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.