Your IP : 216.73.216.164


Current Path : /var/www/html/soar-backup/wp-content/plugins/gravityforms/js/
Upload File :
Current File : /var/www/html/soar-backup/wp-content/plugins/gravityforms/js/form_editor.min.js

function MakeNoFieldsDroppable(){jQuery("#no-fields").droppable({over:function(a,b){jQuery("#gform_fields").height(jQuery(this).height()),jQuery(this).hide()},out:function(a,b){jQuery(this).show()}})}function CloseStatus(){jQuery(".updated_base, .error_base").slideUp()}function InitializeFieldSettings(){jQuery("#field_max_file_size").on("input propertychange",function(){var a=jQuery(this),b=parseInt(a.val());SetFieldProperty("maxFileSize",b||"")}).on("change",function(){var a=GetSelectedField(),b=a.maxFileSize?a.maxFileSize:"",c=""===b?"":b+"MB";this.value=c}),jQuery(document).on("input propertychange",".field_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(document).on("input propertychange",".field_placeholder, .field_placeholder_textarea",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_choices").on("change",".field-choice-price",function(){var a=GetSelectedField(),b=jQuery(this).parent("li").index(),c=a.choices[b].price;this.value=c}),jQuery(".field_input_choices").on("input propertychange","input",function(){var a=jQuery(this).closest("li"),b=a.data("index");SetInputChoice(a.data("input_id"),b,a.find(".field-choice-value").val(),a.find(".field-choice-text").val())}).on("click keypress","input:radio, input:checkbox",function(){var a=jQuery(this).closest("li"),b=a.data("index");SetInputChoice(a.data("input_id"),b,a.find(".field-choice-value").val(),a.find(".field-choice-text").val())}).on("click keypress",".field-input-insert-choice",function(){var a=jQuery(this).closest("li"),b=a.closest("ul"),c=a.data("index");InsertInputChoice(b,a.data("input_id"),c+1)}).on("click keypress",".field-input-delete-choice",function(){var a=jQuery(this).closest("li"),b=a.closest("ul"),c=a.data("index");DeleteInputChoice(b,a.data("input_id"),c)}),jQuery(".field_input_choice_values_enabled").on("click keypress",function(){var a=jQuery(this).parent().siblings(".gfield_settings_input_choices_container");ToggleInputChoiceValue(a,this.checked),SetInputChoices(a.find("ul"))}),jQuery(".input_placeholders_setting").on("input propertychange",".input_placeholder",function(){var a=jQuery(this).closest(".input_placeholder_row").data("input_id");SetInputPlaceholder(this.value,a)}).on("input propertychange","#field_single_placeholder",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_rich_text_editor").on("click keypress",function(){var a=GetSelectedField();if(this.checked){var b=!0;HasConditionalLogicDependency(a.id,a.value)&&(confirm(gf_vars.conditionalLogicRichTextEditorWarning)||(jQuery("#field_rich_text_editor").prop("checked",!1),b=!1)),b&&(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block"))}else jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none")}),jQuery(".prepopulate_field_setting").on("input propertychange",".field_input_name",function(){var a=jQuery(this).closest(".field_input_name_row").data("input_id");SetInputName(this.value,a)}).on("input propertychange","#field_input_name",function(){SetInputName(this.value)}),jQuery(".custom_inputs_setting, .custom_inputs_sub_setting, .sub_labels_setting").on("click keypress",".input_active_icon",function(){var a=jQuery(this).closest(".field_custom_input_row").data("input_id");ToggleInputHidden(this,a)}).on("input propertychange",".field_custom_input_default_label",function(){var a=jQuery(this).closest(".field_custom_input_row").data("input_id");SetInputCustomLabel(this.value,a)}).on("input propertychange","#field_single_custom_label",function(){SetInputCustomLabel(this.value)}),jQuery(".default_input_values_setting").on("input propertychange",".default_input_value",function(){var a=jQuery(this).closest(".default_input_value_row").data("input_id");SetInputDefaultValue(this.value,a)}).on("input","#field_single_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(".choices_setting, .columns_setting").on("input propertychange",".field-choice-input",function(a){var b=jQuery(this),c=b.closest("li.field-choice-row");SetFieldChoice(c.data("input_type"),c.data("index")),(b.hasClass("field-choice-text")||b.hasClass("field-choice-value"))&&(CheckChoiceConditionalLogicDependency(this),a.stopPropagation())}),jQuery("#field_enable_copy_values_option").on("click keypress",function(){SetCopyValuesOptionProperties(this.checked),ToggleCopyValuesOption(!1),0==this.checked&&ToggleCopyValuesActivated(!1)}),jQuery("#field_copy_values_option_label").on("input propertychange",function(){SetCopyValuesOptionLabel(this.value)}),jQuery("#field_copy_values_option_field").on("change",function(){SetFieldProperty("copyValuesOptionField",jQuery(this).val())}),jQuery("#field_copy_values_option_default").on("change",function(){SetFieldProperty("copyValuesOptionDefault",1==this.checked?1:0),ToggleCopyValuesActivated(this.checked)}),jQuery("#field_label").on("input propertychange",function(){SetFieldLabel(this.value)}),jQuery("#field_description").on("blur",function(){GetSelectedField().description!=this.value&&(SetFieldDescription(this.value),RefreshSelectedFieldPreview())}),jQuery("#field_content").on("input propertychange",function(){SetFieldProperty("content",this.value)}),jQuery("#next_button_text_input, #next_button_image_url").on("input propertychange",function(){SetPageButton("next")}),jQuery("#previous_button_image_url, #previous_button_text_input").on("input propertychange",function(){SetPageButton("previous")}),jQuery("#field_custom_field_name_text").on("input propertychange",function(){SetFieldProperty("postCustomFieldName",this.value)}),jQuery("#field_customfield_content_template").on("input propertychange",function(){SetCustomFieldTemplate()}),jQuery("#gfield_calendar_icon_url").on("input propertychange",function(){SetFieldProperty("calendarIconUrl",this.value)}),jQuery("#field_max_files").on("input propertychange",function(){SetFieldProperty("maxFiles",this.value)}),jQuery("#field_maxrows").on("input propertychange",function(){SetFieldProperty("maxRows",this.value)}),jQuery("#field_mask_text").on("input propertychange",function(){SetFieldProperty("inputMaskValue",this.value)}),jQuery("#field_file_extension").on("input propertychange",function(){SetFieldProperty("allowedExtensions",this.value)}),jQuery("#field_maxlen").on("keypress",function(a){return ValidateKeyPress(a,GetMaxLengthPattern(),!1)}).on("change keyup",function(){SetMaxLength(this)}),jQuery("#field_range_min").on("input propertychange",function(){SetFieldProperty("rangeMin",this.value)}),jQuery("#field_range_max").on("input propertychange",function(){SetFieldProperty("rangeMax",this.value)}),jQuery("#field_calculation_formula").on("input propertychange",function(){SetFieldProperty("calculationFormula",this.value.trim())}),jQuery("#field_error_message").on("input propertychange",function(){SetFieldProperty("errorMessage",this.value)}),jQuery("#field_css_class").on("input propertychange",function(){SetFieldProperty("cssClass",this.value)}),jQuery("#field_admin_label").on("input propertychange",function(){SetFieldProperty("adminLabel",this.value)}),jQuery("#field_add_icon_url").on("input propertychange",function(){SetFieldProperty("addIconUrl",this.value)}),jQuery("#field_delete_icon_url").on("input propertychange",function(){SetFieldProperty("deleteIconUrl",this.value)})}function InitializeForm(a){a.fields.length>0&&jQuery("#no-fields").detach().appendTo("#no-fields-stash"),a.lastPageButton&&"image"===a.lastPageButton.type?jQuery("#last_page_button_image").prop("checked",!0):a.lastPageButton&&"image"===a.lastPageButton.type||jQuery("#last_page_button_text").prop("checked",!0),jQuery("#last_page_button_text_input").val(a.lastPageButton?a.lastPageButton.text:gf_vars.previousLabel),jQuery("#last_page_button_image_url").val(a.lastPageButton?a.lastPageButton.imageUrl:""),TogglePageButton("last_page",!0),a.postStatus&&jQuery("#field_post_status").val(a.postStatus),a.postAuthor&&jQuery("#field_post_author").val(a.postAuthor),void 0===a.useCurrentUserAsAuthor&&(a.useCurrentUserAsAuthor=!0),jQuery("#gfield_current_user_as_author").prop("checked",!!a.useCurrentUserAsAuthor),a.postCategory&&jQuery("#field_post_category").val(a.postCategory),a.postFormat&&jQuery("#field_post_format").val(a.postFormat),a.postContentTemplateEnabled?(jQuery("#gfield_post_content_enabled").prop("checked",!0),jQuery("#field_post_content_template").val(a.postContentTemplate)):(jQuery("#gfield_post_content_enabled").prop("checked",!1),jQuery("#field_post_content_template").val("")),TogglePostContentTemplate(!0),a.postTitleTemplateEnabled?(jQuery("#gfield_post_title_enabled").prop("checked",!0),jQuery("#field_post_title_template").val(a.postTitleTemplate)):(jQuery("#gfield_post_title_enabled").prop("checked",!1),jQuery("#field_post_title_template").val("")),TogglePostTitleTemplate(!0),jQuery("#gform_last_page_settings").click(function(){FieldClick(this)}),jQuery("#gform_pagination").click(function(){FieldClick(this)}),jQuery("#gform_fields").on("click",".gfield",function(){FieldClick(this)});var b=a.pagination&&a.pagination.type?a.pagination.type:"percentage",c="steps"===b,d="percentage"===b,e="none"===b;c?jQuery("#pagination_type_steps").prop("checked",!0):d?jQuery("#pagination_type_percentage").prop("checked",!0):e&&jQuery("#pagination_type_none").prop("checked",!0),jQuery("#first_page_css_class").val(a.firstPageCssClass),jQuery("#field_settings, #last_page_settings, #pagination_settings").tabs({selected:0}),TogglePageBreakSettings(),InitPaginationOptions(!0),InitializeFields()}function LoadFieldSettings(){field=GetSelectedField();var a=GetInputType(field);jQuery("#field_label").val(field.label),"html"==field.type?(jQuery(".tooltip_form_field_label_html").show(),jQuery(".tooltip_form_field_label").hide()):(jQuery(".tooltip_form_field_label_html").hide(),jQuery(".tooltip_form_field_label").show()),jQuery("#field_admin_label").val(field.adminLabel),jQuery("#field_content").val(void 0==field.content?"":field.content),jQuery("#post_custom_field_type").val(field.inputType),jQuery("#post_tag_type").val(field.inputType),jQuery("#field_size").val(field.size),jQuery("#field_required").prop("checked",1==field.isRequired),jQuery("#field_margins").prop("checked",1==field.disableMargins),jQuery("#field_no_duplicates").prop("checked",1==field.noDuplicates),jQuery("#field_default_value").val(void 0==field.defaultValue?"":field.defaultValue),jQuery("#field_default_value_textarea").val(void 0==field.defaultValue?"":field.defaultValue),jQuery("#field_description").val(void 0==field.description?"":field.description),jQuery("#field_css_class").val(void 0==field.cssClass?"":field.cssClass),jQuery("#field_range_min").val(void 0==field.rangeMin||!1===field.rangeMin?"":field.rangeMin),jQuery("#field_range_max").val(void 0==field.rangeMax||!1===field.rangeMax?"":field.rangeMax),jQuery("#field_name_format").val(field.nameFormat),jQuery("#field_force_ssl").prop("checked",!!field.forceSSL),jQuery("#credit_card_style").val(field.creditCardStyle?field.creditCardStyle:"style1"),field.useRichTextEditor?(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block")):(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none")),void 0===field.labelPlacement&&(field.labelPlacement=""),void 0===field.descriptionPlacement&&(field.descriptionPlacement=""),void 0===field.subLabelPlacement&&(field.subLabelPlacement=""),jQuery("#field_label_placement").val(field.labelPlacement),jQuery("#field_description_placement").val(field.descriptionPlacement),jQuery("#field_sub_label_placement").val(field.subLabelPlacement),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?jQuery("#field_description_placement_container").hide():jQuery("#field_description_placement_container").show(),SetFieldVisibility(field.visibility,!0),void 0===field.placeholder&&(field.placeholder=""),jQuery("#field_placeholder, #field_placeholder_textarea").val(field.placeholder),jQuery("#field_file_extension").val(void 0==field.allowedExtensions?"":field.allowedExtensions),jQuery("#field_multiple_files").prop("checked",!!field.multipleFiles),jQuery("#field_max_files").val(field.maxFiles?field.maxFiles:""),jQuery("#field_max_file_size").val(field.maxFileSize?field.maxFileSize+"MB":""),ToggleMultiFile(!0),jQuery("#field_phone_format").val(field.phoneFormat),jQuery("#field_error_message").val(field.errorMessage),jQuery("#field_select_all_choices").prop("checked",!!field.enableSelectAll),jQuery("#field_other_choice").prop("checked",!!field.enableOtherChoice),jQuery("#field_add_icon_url").val(field.addIconUrl?field.addIconUrl:""),jQuery("#field_delete_icon_url").val(field.deleteIconUrl?field.deleteIconUrl:""),jQuery("#gfield_enable_enhanced_ui").prop("checked",!!field.enableEnhancedUI),jQuery("#gfield_password_strength_enabled").prop("checked",1==field.passwordStrengthEnabled),jQuery("#gfield_min_strength").val(void 0==field.minPasswordStrength?"":field.minPasswordStrength),TogglePasswordStrength(!0),jQuery("#gfield_email_confirm_enabled").prop("checked",1==field.emailConfirmEnabled),field.numberFormat?jQuery("#field_number_format_blank").remove():0==jQuery("#field_number_format #field_number_format_blank").length&&jQuery("#field_number_format").prepend("<option id='field_number_format_blank' value=''>"+gf_vars.selectFormat+"</option>"),jQuery("#field_number_format").val(field.numberFormat?field.numberFormat:""),"product"==field.type&&"calculation"==field.inputType?(field.enableCalculation=!0,jQuery(".field_calculation_rounding").hide(),jQuery(".field_enable_calculation").hide()):(jQuery(".field_enable_calculation").show(),"number"==field.type&&"currency"==field.numberFormat?jQuery(".field_calculation_rounding").hide():jQuery(".field_calculation_rounding").show()),jQuery("#field_enable_calculation").prop("checked",!!field.enableCalculation),ToggleCalculationOptions(field.enableCalculation,field),jQuery("#field_calculation_formula").val(field.calculationFormula);var b=gformIsNumber(field.calculationRounding)?field.calculationRounding:"norounding";jQuery("#field_calculation_rounding").val(b),jQuery("#option_field_type").val(field.inputType);var c=jQuery("#product_field_type");if(c.val(field.inputType),has_entry(field.id)?c.prop("disabled",!0):c.prop("disabled",!1),jQuery("#donation_field_type").val(field.inputType),jQuery("#quantity_field_type").val(field.inputType),"hiddenproduct"==field.inputType||"singleproduct"==field.inputType||"singleshipping"==field.inputType||"calculation"==field.inputType){var d=void 0==field.basePrice?"":field.basePrice;jQuery("#field_base_price").val(void 0==field.basePrice?"":field.basePrice),SetBasePrice(d)}jQuery("#shipping_field_type").val(field.inputType),jQuery("#field_disable_quantity").prop("checked",1==field.disableQuantity),SetDisableQuantity(1==field.disableQuantity);var e=!!field.enablePasswordInput;jQuery("#field_password").prop("checked",!!e),jQuery("#field_maxlen").val(void 0===field.maxLength?"":field.maxLength),jQuery("#field_maxrows").val(void 0===field.maxRows?"":field.maxRows);var f=void 0==field.addressType?"international":field.addressType;jQuery("#field_address_type").val(f),"address"==field.type&&(field=UpgradeAddressField(field)),"email"!=field.type&&"email"!=field.inputType||(field=UpgradeEmailField(field)),"password"!=field.type&&"password"!=field.inputType||(field=UpgradePasswordField(field));var g=void 0==field.defaultState?"":field.defaultState,h=void 0==field.defaultProvince?"":field.defaultProvince,i="canadian"==f&&""==g?h:g;jQuery("#field_address_default_state_"+f).val(i),jQuery("#field_address_default_country_"+f).val(void 0==field.defaultCountry?"":field.defaultCountry),SetAddressType(!0),jQuery("#gfield_display_title").prop("checked",1==field.displayTitle),jQuery("#gfield_display_caption").prop("checked",1==field.displayCaption),jQuery("#gfield_display_description").prop("checked",1==field.displayDescription);var j=CustomFieldExists(field.postCustomFieldName);jQuery("#field_custom_field_name_select")[0].selectedIndex=0,jQuery("#field_custom_field_name_text").val(""),j?jQuery("#field_custom_field_name_select").val(field.postCustomFieldName):jQuery("#field_custom_field_name_text").val(field.postCustomFieldName),j?jQuery("#field_custom_existing").prop("checked",!0):jQuery("#field_custom_new").prop("checked",!0),ToggleCustomField(!0),jQuery("#gfield_customfield_content_enabled").prop("checked",!!field.customFieldTemplateEnabled),jQuery("#field_customfield_content_template").val(field.customFieldTemplateEnabled?field.customFieldTemplate:""),ToggleCustomFieldTemplate(!0),field.displayAllCategories?jQuery("#gfield_category_all").prop("checked",!0):jQuery("#gfield_category_select").prop("checked",!0),ToggleCategory(!0),jQuery("#gfield_post_category_initial_item_enabled").prop("checked",!!field.categoryInitialItemEnabled),jQuery("#field_post_category_initial_item").val(field.categoryInitialItemEnabled?field.categoryInitialItem:""),TogglePostCategoryInitialItem(!0);var k=!!field.postFeaturedImage;jQuery("#gfield_featured_image").prop("checked",k);var l=IsStandardMask(field.inputMaskValue);if(jQuery("#field_input_mask").prop("checked",!!field.inputMask),l?(jQuery("#field_mask_standard").prop("checked",!0),jQuery("#field_mask_select").val(field.inputMaskValue)):(jQuery("#field_mask_custom").prop("checked",!0),jQuery("#field_mask_text").val(field.inputMaskValue)),ToggleInputMask(!0),ToggleInputMaskOptions(!0),"creditcard"==a){field=UpgradeCreditCardField(field),(!field.creditCards||field.creditCards.length<=0)&&(field.creditCards=["amex","visa","discover","mastercard"]);for(p in field.creditCards)field.creditCards.hasOwnProperty(p)&&jQuery("#field_credit_card_"+field.creditCards[p]).prop("checked",!0)}"date"==a&&(field=UpgradeDateField(field)),"time"==a&&(field=UpgradeTimeField(field)),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateCustomizeInputsUI(field),CreateInputLabelsUI(field),field.dateType||"date"!=a||(field.dateType="datepicker"),jQuery("#field_date_input_type").val(field.dateType),jQuery("#gfield_calendar_icon_url").val(void 0==field.calendarIconUrl?"":field.calendarIconUrl),jQuery("#field_date_format").val("dmy"==field.dateFormat?"dmy":field.dateFormat),jQuery("#field_time_format").val("24"==field.timeFormat?"24":"12"),SetCalendarIconType(field.calendarIconType,!0),ToggleDateCalendar(!0),LoadDateInputs(),LoadTimeInputs(),field.allowsPrepopulate=!!field.allowsPrepopulate,field.useRichTextEditor=!!field.useRichTextEditor,jQuery("#field_prepopulate").prop("checked",!!field.allowsPrepopulate),jQuery("#field_rich_text_editor").prop("checked",!!field.useRichTextEditor),has_entry(field.id)?jQuery("#field_rich_text_editor").prop("disabled",!0):jQuery("#field_rich_text_editor").prop("disabled",!1),CreateInputNames(field),ToggleInputName(!0);var m=GetFirstRuleField()>0;"page"==field.type?(LoadFieldConditionalLogic(m,"next_button"),LoadFieldConditionalLogic(m,"page")):LoadFieldConditionalLogic(m,"field"),jQuery("#field_enable_copy_values_option").prop("checked",1==field.enableCopyValuesOption),jQuery("#field_copy_values_option_default").prop("checked",1==field.copyValuesOptionDefault);var n=GetCopyValuesFieldsOptions(field.copyValuesFieldId,field);n.length>0?(jQuery("#field_enable_copy_values_option").prop("disabled",!1),jQuery("#field_copy_values_disabled").hide(),jQuery("#field_copy_values_option_field").html(n)):(jQuery("#field_enable_copy_values_option").prop("disabled",!0),jQuery("#field_copy_values_disabled").show()),ToggleCopyValuesOption(field.enableCopyValuesOption,!0),field.nextButton&&("image"==field.nextButton.type?jQuery("#next_button_image").prop("checked",!0):jQuery("#next_button_text").prop("checked",!0),jQuery("#next_button_text_input").val(field.nextButton.text),jQuery("#next_button_image_url").val(field.nextButton.imageUrl)),field.previousButton&&("image"==field.previousButton.type?jQuery("#previous_button_image").prop("checked",!0):jQuery("#previous_button_text").prop("checked",!0),jQuery("#previous_button_text_input").val(field.previousButton.text),jQuery("#previous_button_image_url").val(field.previousButton.imageUrl)),TogglePageButton("next",!0),TogglePageButton("previous",!0),jQuery(".gfield_category_checkbox").each(function(){if(field.choices)for(var a=0;a<field.choices.length;a++)if(this.value==field.choices[a].value)return void(this.checked=!0);this.checked=!1}),has_entry(field.id)?jQuery("#field_type, #field_multiple_files").prop("disabled",!0):jQuery("#field_type, #field_multiple_files").prop("disabled",!1),jQuery("#field_custom_field_name").val(field.postCustomFieldName),jQuery("#field_columns_enabled").prop("checked",!!field.enableColumns),LoadFieldChoices(field),jQuery(".field_setting").hide();var o=fieldSettings[field.type];field.inputType&&"post_category"!=field.type&&(o+=","+fieldSettings[field.inputType]),jQuery(o).show();for(var p=0;p<form.fields.length;p++)if("post_category"==form.fields[p].type){jQuery(".post_category_setting").hide();break}"post_category"==field.type&&"select"!=a&&(jQuery(".post_category_initial_item_setting").hide(),jQuery("#gfield_post_category_initial_item_enabled").prop("checked",!1),SetCategoryInitialItem()),"quantity"==field.type&&jQuery(".calculation_setting").hide(),jQuery("#post_category_field_type").val(field.inputType);var q=void 0==field.simpleCaptchaFontColor?"":field.simpleCaptchaFontColor;jQuery("#field_captcha_fg").val(q),SetColorPickerColor("field_captcha_fg",q);var r=void 0==field.simpleCaptchaBackgroundColor?"":field.simpleCaptchaBackgroundColor;if(jQuery("#field_captcha_bg").val(r),SetColorPickerColor("field_captcha_bg",r),jQuery("#field_captcha_type").val(void 0==field.captchaType?"captcha":field.captchaType),jQuery("#field_captcha_size").val(void 0==field.simpleCaptchaSize?"medium":field.simpleCaptchaSize),"captcha"==field.type){var s=".captcha_language_setting, .captcha_theme_setting",t=".captcha_size_setting, .captcha_fg_setting, .captcha_bg_setting";"simple_captcha"==field.captchaType||"math"==field.captchaType?(jQuery(t).show(),jQuery(s).hide()):(jQuery(t).hide(),jQuery(s).show());var u=void 0==field.captchaTheme||["blackglass","dark"].indexOf(field.captchaTheme)<0?"light":"dark";jQuery("#field_captcha_theme").val(u).show();var v=void 0==field.captchaLanguage?"en":field.captchaLanguage;jQuery("#field_captcha_language").val(v).show(),jQuery('#field_captcha_type option[value="captcha"]').length<1&&jQuery("#field_captcha_type").prepend('<option value="captcha">reCAPTCHA</option>')}("post_custom_field"==field.type&&"textarea"==field.inputType||"text"==field.inputType)&&jQuery(".customfield_content_template_setting").show(),"name"==field.type&&(void 0===field.nameFormat||"advanced"!=field.nameFormat?field=MaybeUpgradeNameField(field):SetUpAdvancedNameField(),"simple"==field.nameFormat?(jQuery(".default_value_setting").show(),jQuery(".size_setting").show(),jQuery("#field_name_fields_container").html("").hide(),jQuery(".sub_label_placement_setting").hide(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".default_value_setting").show()):"extended"==field.nameFormat&&(jQuery(".name_format_setting").show(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".input_placeholders_setting").hide())),-1!=jQuery.inArray(field.type,["product","option","shipping"])&&jQuery(".other_choice_setting").hide(),field.enableCalculation&&jQuery("li.range_setting").hide(),"text"==field.type&&(field.inputMask?jQuery(".maxlen_setting").hide():jQuery(".maxlen_setting").show()),"product"==field.type&&("singleproduct"==field.inputType?jQuery(".admin_label_setting").hide():jQuery(".admin_label_setting").show()),"date"==a&&ToggleDateSettings(field),"email"==a&&ToggleEmailSettings(field),jQuery(document).trigger("gform_load_field_settings",[field,form]),jQuery("#field_settings").appendTo(".field_selected"),jQuery("#field_settings").tabs("option","active",0),ShowSettings("field_settings"),gform.doAction("gform_post_load_field_settings",[field,form]),SetProductField(field);var w=[];0==jQuery("#gform_tab_3 li.field_setting").filter(function(){return jQuery(this).is(":hidden")&&"none"!=jQuery(this).css("display")}).length&&w.push(1),0==jQuery("#gform_tab_2 li.field_setting").filter(function(){return jQuery(this).is(":hidden")&&"none"!=jQuery(this).css("display")}).length&&w.push(2),w.length>0?jQuery("#field_settings").tabs({disabled:w}):jQuery("#field_settings").tabs({disabled:[]}),Placeholders.enable()}function ToggleDateSettings(a){var b="datefield"==a.dateType,c="datepicker"==a.dateType,d="datedropdown"==a.dateType;jQuery(".placeholder_setting").toggle(c),jQuery(".default_value_setting").toggle(c),jQuery(".sub_label_placement_setting").toggle(b),jQuery(".sub_labels_setting").toggle(b),jQuery(".default_input_values_setting").toggle(d||b),jQuery(".input_placeholders_setting").toggle(d||b)}function SetUpAdvancedNameField(){field=GetSelectedField(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").show(),jQuery(".name_prefix_choices_setting").show();var a=GetCustomizeInputsUI(field);jQuery("#field_name_fields_container").html(a).show();var b=GetInput(field,field.id+".2"),c=GetInputChoices(b);jQuery("#field_prefix_choices").html(c),ToggleNamePrefixUI(!b.isHidden),jQuery(".name_setting .custom_inputs_setting").on("click",".input_active_icon",function(){jQuery(this).data("input_id").toString().indexOf(".2")>=0&&ToggleNamePrefixUI(this.src.indexOf("active1.png")>=0)}),jQuery(".default_value_setting").hide(),jQuery(".default_input_values_setting").show(),jQuery(".input_placeholders_setting").show(),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputNames(field)}function GetCopyValuesFieldsOptions(a,b){for(var c,d,e,f,g=[],h=GetInputType(b),i=0;i<form.fields.length;i++)d=form.fields[i],d.id==b.id||GetInputType(d)!=h||d.enableCopyValuesOption||(c=GetLabel(d),f=a==d.id?'selected="selected"':"",e='<option value="'+d.id+'" '+f+">"+c+"</option>",g.push(e));return g.join("")}function ToggleNamePrefixUI(a){jQuery(".name_prefix_choices_setting").toggle(a)}function TogglePageBreakSettings(){HasPageBreak()?(jQuery("#gform_last_page_settings").show(),jQuery("#gform_pagination").show()):(jQuery("#gform_last_page_settings").hide(),jQuery("#gform_pagination").hide())}function SetDisableQuantity(a){SetFieldProperty("disableQuantity",a),a?jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").hide():jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").show()}function SetBasePrice(a){a||(a=0);var b=GetCurrentCurrency(),c=b.toMoney(a);0==c&&(c=0),jQuery("#field_base_price").val(c),SetFieldProperty("basePrice",c),jQuery(".field_selected .ginput_product_price, .field_selected .ginput_shipping_price").html(c),jQuery(".field_selected .ginput_amount").val(c)}function ChangeAddressType(){if(field=GetSelectedField(),"address"==field.type){var a=jQuery("#field_address_type").val(),b=GetInput(field,field.id+".6"),c=jQuery("#field_address_country_"+a).val();b.isHidden=""!=c,SetAddressType(!1)}}function SetAddressType(a){if(field=GetSelectedField(),"address"==field.type){SetAddressProperties(),jQuery(".gfield_address_type_container").hide();var b=a?"":"slow";jQuery("#address_type_container_"+jQuery("#field_address_type").val()).show(b),CreatePlaceholdersUI(field)}}function UpdateAddressFields(){var a=jQuery("#field_address_type").val();field=GetSelectedField();var b=GetCustomizeInputsUI(field);jQuery("#field_address_fields_container").html(b);var c=GetInput(field,field.id+".5"),d=jQuery("#field_address_zip_label_"+a).val();jQuery("#field_custom_input_default_label_"+field.id+"_5").text(d),jQuery("#field_custom_input_label_"+field.id+"\\.5").attr("placeholder",d),c.customLabel||jQuery(".field_selected #input_"+field.id+"_5_label").html(d);var e=GetInput(field,field.id+".4"),f=jQuery("#field_address_state_label_"+a).val();if(jQuery("#field_custom_input_default_label_"+field.id+"_4").text(f),jQuery("#field_custom_input_label_"+field.id+"\\.4").attr("placeholder",f),e.customLabel||jQuery(".field_selected #input_"+field.id+"_4_label").html(f),""!=jQuery("#field_address_country_"+a).val()?(jQuery(".field_selected #input_"+field.id+"_6_container").hide(),jQuery(".field_custom_input_row_input_"+field.id+"_6").hide()):(jQuery(".field_selected #input_"+field.id+"_6").val(jQuery("#field_address_default_country_"+a).val()),jQuery(".field_selected #input_"+field.id+"_6_container").show(),jQuery(".field_selected .field_custom_input_row_input_"+field.id+"_6").show()),""!=jQuery("#field_address_has_states_"+a).val()){jQuery(".field_selected .state_text").hide();var g=jQuery("#field_address_default_state_"+a).val(),h=jQuery(".field_selected .state_dropdown");h.append(jQuery("<option></option>").val(g).html(g)),h.val(g).show()}else jQuery(".field_selected .state_dropdown").hide(),jQuery(".field_selected .state_text").show()}function SetAddressProperties(){field=GetSelectedField();var a=jQuery("#field_address_type").val();SetFieldProperty("addressType",a),SetFieldProperty("defaultState",jQuery("#field_address_default_state_"+a).val()),SetFieldProperty("defaultProvince","");var b=jQuery("#field_address_country_"+a).val();""==b&&(b=jQuery("#field_address_default_country_"+a).val()),SetFieldProperty("defaultCountry",b),UpdateAddressFields()}function MaybeUpgradeNameField(a){return(void 0===a.nameFormat||""==a.nameFormat||"normal"==a.nameFormat||"simple"==a.nameFormat&&!has_entry(a.id))&&(a=UpgradeNameField(a,!0,!0,!0)),a}function UpgradeNameField(a,b,c,d){return a.nameFormat="advanced",a.inputs=MergeInputArrays(GetAdvancedNameFieldInputs(a,b,c,d),a.inputs),RefreshSelectedFieldPreview(function(){SetUpAdvancedNameField()}),a}function UpgradeDateField(a){return"date"!=a.type&&"date"!=a.inputType?a:(void 0===a.dateType||"datepicker"==a.dateType||a.inputs||(a.inputs=GetDateFieldInputs(a)),a)}function UpgradeTimeField(a){return"time"!=a.type&&"time"!=a.inputType?a:(a.inputs||(a.inputs=GetTimeFieldInputs(a)),a)}function UpgradeEmailField(a){return"email"!=a.type&&"email"!=a.inputType?a:(a.emailConfirmEnabled&&!a.inputs&&(a.inputs=GetEmailFieldInputs(a),a.inputs[0].placeholder=a.placeholder),a)}function UpgradePasswordField(a){return"password"!=a.type&&"password"!=a.inputType?a:(a.inputs||(a.inputs=GetPasswordFieldInputs(a),a.inputs[0].placeholder=a.placeholder),a)}function UpgradeAddressField(a){if(a.hideCountry){GetInput(a,a.id+".6").isHidden=!0}if(delete a.hideCountry,a.hideAddress2){GetInput(a,a.id+".2").isHidden=!0}if(delete a.hideAddress2,a.hideState){GetInput(a,a.id+".4").isHidden=!0}return delete a.hideState,a}function TogglePasswordStrength(a){var b=a?"":"slow";jQuery("#gfield_password_strength_enabled").is(":checked")?jQuery("#gfield_min_strength_container").show(b):jQuery("#gfield_min_strength_container").hide(b)}function ToggleCategory(a){var b=a?"":"slow";jQuery("#gfield_category_all").is(":checked")?(jQuery("#gfield_settings_category_container").hide(b),SetFieldProperty("displayAllCategories",!0),SetFieldProperty("choices",new Array)):(jQuery("#gfield_settings_category_container").show(b),SetFieldProperty("displayAllCategories",!1))}function SetCopyValuesOptionLabel(a){SetFieldProperty("copyValuesOptionLabel",a),jQuery(".field_selected .copy_values_option_label").html(a)}function SetCustomFieldTemplate(){var a=jQuery("#gfield_customfield_content_enabled").is(":checked");SetFieldProperty("customFieldTemplate",a?jQuery("#field_customfield_content_template").val():null),SetFieldProperty("customFieldTemplateEnabled",a)}function SetCategoryInitialItem(){
var a=jQuery("#gfield_post_category_initial_item_enabled").is(":checked");SetFieldProperty("categoryInitialItem",a?jQuery("#field_post_category_initial_item").val():null),SetFieldProperty("categoryInitialItemEnabled",a)}function PopulateContentTemplate(a){if(0==jQuery("#"+a).val().length){var b=GetSelectedField();jQuery("#"+a).val("{"+b.label+":"+b.id+"}")}}function TogglePostContentTemplate(a){var b=a?"":"slow";jQuery("#gfield_post_content_enabled").is(":checked")?(jQuery("#gfield_post_content_container").show(b),a||PopulateContentTemplate("field_post_content_template")):jQuery("#gfield_post_content_container").hide(b)}function TogglePostTitleTemplate(a){var b=a?"":"slow";jQuery("#gfield_post_title_enabled").is(":checked")?(jQuery("#gfield_post_title_container").show(b),a||PopulateContentTemplate("field_post_title_template")):jQuery("#gfield_post_title_container").hide(b)}function ToggleCustomFieldTemplate(a){var b=a?"":"slow";jQuery("#gfield_customfield_content_enabled").is(":checked")?(jQuery("#gfield_customfield_content_container").show(b),a||PopulateContentTemplate("field_customfield_content_template")):jQuery("#gfield_customfield_content_container").hide(b)}function ToggleInputName(a){var b=a?"":"slow";jQuery("#field_prepopulate").is(":checked")?jQuery("#field_input_name_container").show(b):(jQuery("#field_input_name_container").hide(b),jQuery("#field_input_name").val(""))}function SetFieldColumns(){SetFieldChoices()}function ToggleChoiceValue(a){var b=GetSelectedField(),c=b.enablePrice?"_and_price":"",d=jQuery("#gfield_settings_choices_container");d.removeClass("choice_with_price choice_with_value choice_with_value_and_price"),jQuery("#field_choice_values_enabled").is(":checked")?d.addClass("choice_with_value"+c):b.enablePrice&&d.addClass("choice_with_price")}function ToggleInputChoiceValue(a,b){void 0===b&&(b=!1);var c=GetSelectedField(),d=a.find("li").data("input_id");GetInput(c,d).enableChoiceValue=b,a.removeClass("choice_with_value"),b&&a.addClass("choice_with_value")}function ToggleCopyValuesActivated(a){jQuery(".field_selected .copy_values_activated").prop("checked",a);var b=GetSelectedField();jQuery("#input_"+b.id).toggle(!a)}function TogglePageButton(a,b){var c=jQuery("#"+a+"_button_text").is(":checked");show_element=c?"#"+a+"_button_text_container":"#"+a+"_button_image_container",hide_element=c?"#"+a+"_button_image_container":"#"+a+"_button_text_container",b?(jQuery(hide_element).hide(),jQuery(show_element).show()):(jQuery(hide_element).hide(),jQuery(show_element).fadeIn(800))}function SetPageButton(a){field=GetSelectedField();var b=jQuery("#"+a+"_button_image").is(":checked")?"image":"text";field[a+"Button"].type=b,"image"==b?(field[a+"Button"].text="",field[a+"Button"].imageUrl=jQuery("#"+a+"_button_image_url").val()):(field[a+"Button"].text=jQuery("#"+a+"_button_text_input").val(),field[a+"Button"].imageUrl="")}function ToggleCustomField(a){var b=jQuery("#field_custom_existing").is(":checked");show_element=b?"#field_custom_field_name_select":"#field_custom_field_name_text",hide_element=b?"#field_custom_field_name_text":"#field_custom_field_name_select";var c="";jQuery(hide_element).hide(c),jQuery(show_element).show(c)}function ToggleInputMask(a){var b=a?"":"slow";jQuery("#field_input_mask").is(":checked")?(jQuery("#gform_input_mask").show(b),jQuery(".maxlen_setting").hide(),SetFieldProperty("inputMask",!0),jQuery("#field_maxlen").val(""),SetFieldProperty("maxLength","")):(jQuery("#gform_input_mask").hide(b),jQuery(".maxlen_setting").show(),SetFieldProperty("inputMask",!1),SetFieldProperty("inputMaskValue",""))}function ToggleInputMaskOptions(a){var b=jQuery("#field_mask_standard").is(":checked");show_element=b?"#field_mask_select":"#field_mask_text, .mask_text_description",hide_element=b?"#field_mask_text, .mask_text_description":"#field_mask_select";var c="";jQuery(hide_element).val("").hide(c),jQuery(show_element).show(c),a||SetFieldProperty("inputMaskValue","")}function ToggleAutoresponder(){jQuery("#form_autoresponder_enabled").is(":checked")?jQuery("#form_autoresponder_container").show("slow"):jQuery("#form_autoresponder_container").hide("slow")}function ToggleMultiFile(a){var b=a?"":"slow";if(jQuery("#field_multiple_files").prop("checked")){jQuery("#gform_multiple_files_options").show(b);var c=jQuery(".gform_fileupload_multifile"),d=c.data("settings");d&&void 0!==d.chunk_size&&jQuery("#gform_server_max_file_size_notice").hide(),SetFieldProperty("multipleFiles",!0)}else jQuery("#gform_multiple_files_options").hide(b),SetFieldProperty("multipleFiles",!1),jQuery("#field_max_files").val(""),SetFieldProperty("maxFiles","");if(!a){var e=GetSelectedField();jQuery("#field_settings").slideUp(function(){StartChangeInputType("fileupload",e)})}}function HasPostContentField(){for(var a=0;a<form.fields.length;a++){if("post_content"==form.fields[a].type)return!0}return!1}function HasPostTitleField(){for(var a=0;a<form.fields.length;a++){if("post_title"==form.fields[a].type)return!0}return!1}function HasCustomField(){for(var a=0;a<form.fields.length;a++){if("post_custom_field"==form.fields[a].type)return!0}return!1}function HasPageBreak(){for(var a=0;a<form.fields.length;a++){if("page"==form.fields[a].type)return!0}return!1}function SetNextButtonConditionalLogic(a){GetSelectedField().nextButton.conditionalLogic=a?new ConditionalLogic:null}function UpdateFormObject(){if(form.postContentTemplateEnabled=!1,form.postTitleTemplateEnabled=!1,form.postTitleTemplate="",form.postContentTemplate="",HasPostField()&&(form.postAuthor=jQuery("#field_post_author").val()?jQuery("#field_post_author").val():"",form.useCurrentUserAsAuthor=jQuery("#gfield_current_user_as_author").is(":checked"),form.postCategory=jQuery("#field_post_category").val(),form.postFormat=0!=jQuery("#field_post_format").length?jQuery("#field_post_format").val():0,form.postStatus=jQuery("#field_post_status").val()),jQuery("#gfield_post_content_enabled").is(":checked")&&HasPostContentField()&&(form.postContentTemplateEnabled=!0,form.postContentTemplate=jQuery("#field_post_content_template").val()),jQuery("#gfield_post_title_enabled").is(":checked")&&HasPostTitleField()&&(form.postTitleTemplateEnabled=!0,form.postTitleTemplate=jQuery("#field_post_title_template").val()),jQuery("#gform_last_page_settings").is(":visible")?(form.lastPageButton=new Button,form.lastPageButton.type=jQuery("#last_page_button_text").is(":checked")?"text":"image","image"==form.lastPageButton.type?(form.lastPageButton.text="",form.lastPageButton.imageUrl=jQuery("#last_page_button_image_url").val()):(form.lastPageButton.text=jQuery("#last_page_button_text_input").val(),form.lastPageButton.imageUrl="")):form.lastPageButton=null,jQuery("#gform_pagination").is(":visible")){form.pagination=new Object;var a=jQuery('input[name="pagination_type"]:checked').val();form.pagination.type=a;var b=jQuery(".gform_page_names input");form.pagination.pages=new Array;for(var c=0;c<b.length;c++)form.pagination.pages.push(jQuery(b[c]).val());"percentage"==a?(form.pagination.style=jQuery("#percentage_style").val(),form.pagination.backgroundColor="custom"==form.pagination.style?jQuery("#percentage_style_custom_bgcolor").val():null,form.pagination.color="custom"==form.pagination.style?jQuery("#percentage_style_custom_color").val():null,form.pagination.display_progressbar_on_confirmation=jQuery("#percentage_confirmation_display").is(":checked"),form.pagination.progressbar_completion_text=jQuery("#percentage_confirmation_display").is(":checked")?jQuery("#percentage_confirmation_page_name").val():null):(form.pagination.backgroundColor=null,form.pagination.color=null,form.pagination.display_progressbar_on_confirmation=null,form.pagination.progressbar_completion_text=null),form.firstPageCssClass=jQuery("#first_page_css_class").val()}else form.pagination=null,form.firstPageCssClass=null;SortFields(),window.gform_before_update&&(form=window.gform_before_update(form),window.console&&console.log('"gform_before_update" is deprecated since version 1.7! Use the "gform_pre_form_editor_save" filter instead.')),form=gform.applyFilters("gform_pre_form_editor_save",form)}function EndUpdateForm(a){jQuery("#please_wait_container").hide(),jQuery("#after_update_dialog").hide(),jQuery("#after_update_error_dialog").hide(),a?jQuery("#after_update_dialog").slideDown():jQuery("#after_update_error_dialog").slideDown(),setTimeout(function(){jQuery("#after_update_dialog").slideUp()},5e3)}function SortFields(){var a=new Array;jQuery(".gfield").each(function(){id=this.id.substr(6),a.push(GetFieldById(id))}),form.fields=a}function DeleteField(a){var b=jQuery(a)[0].id.split("_")[2];if((HasConditionalLogicDependency(b)||confirm(gf_vars.confirmationDeleteField))&&(!HasConditionalLogicDependency(b)||confirm(gf_vars.conditionalLogicDependency))){form.deletedFields||(form.deletedFields=[]),form.deletedFields.push(b);for(var c=0;c<form.fields.length;c++)if(form.fields[c].id==b){form.fields.splice(c,1),jQuery("#field_settings").insertBefore("#gform_fields"),jQuery("#field_"+b).fadeOut("slow",function(){jQuery("#field_"+b).remove(),0===form.fields.length&&jQuery("#no-fields").detach().appendTo("#gform_fields").show()}),HideSettings("field_settings");break}TogglePageBreakSettings(),jQuery(document).trigger("gform_field_deleted",[form,b])}}function HasConditionalLogicDependencyLegwork(a,b){if(form.button&&ObjectHasConditionalLogicDependency(form.button,a,b))return!0;for(i in form.confirmations)if(form.confirmations.hasOwnProperty(i)&&ObjectHasConditionalLogicDependency(form.confirmations[i],a,b))return!0;for(i in form.notifications)if(form.notifications.hasOwnProperty(i)&&ObjectHasConditionalLogicDependency(form.notifications[i],a,b))return!0;for(i in form.fields)if(form.fields.hasOwnProperty(i)){var c=form.fields[i];if(ObjectHasConditionalLogicDependency(c,a,b))return!0;if("page"==GetInputType(c)&&ObjectHasConditionalLogicDependency(c.nextButton,a,b))return!0}return!1}function HasConditionalLogicDependency(a,b){var c=HasConditionalLogicDependencyLegwork(a,b);return gform.applyFilters("gform_has_conditional_logic_dependency",c,a,b)}function ObjectHasConditionalLogicDependency(a,b,c){if(!a.conditionalLogic)return!1;if(void 0===c)var c=!1;var d=a.conditionalLogic.rules;for(i in d)if(d.hasOwnProperty(i)){var e=d[i];if(e.fieldId==b&&(!1===c||e.value==c)){if(!c&&!e.value){var f=GetFieldById(b);if(f&&f.choices&&f.placeholder)continue}return!0}}return!1}function HasDependentRule(a,b,c){void 0===c&&(c=!1);for(i in a)if(a.hasOwnProperty(i)){var d=a[i];if(d.fieldId==b&&(!1===c||d.value==c))return!0}return!1}function CheckChoiceConditionalLogicDependency(a){var b=GetSelectedField(),c=jQuery(a).data("previousValue");if(void 0==c&&(c=""),HasConditionalLogicDependency(b.id,c)){if(confirm(gf_vars.conditionalLogicDependencyChoiceEdit))return;jQuery(a).val(c).trigger("keyup"),jQuery(a).data("previousValue",c)}}function StartDuplicateField(a){var b=jQuery(a)[0].id.split("_")[2];for(fieldIndex in form.fields)if(form.fields.hasOwnProperty(fieldIndex)&&form.fields[fieldIndex].id==b){var c=Copy(form.fields[fieldIndex]);if(c.id=GetNextFieldId(),null!=c.inputs){for(inputIndex in c.inputs)if(c.inputs.hasOwnProperty(inputIndex)){var d=c.inputs[inputIndex].id+"";c.inputs[inputIndex].id=d.replace(/(\d+\.)/,c.id+".")}}return c=gform.applyFilters("gform_duplicate_field",c,form),c=gform.applyFilters("gform_duplicate_field_{0}".format(GetInputType(c)),c,form),form.fields.splice(fieldIndex,0,c),void DuplicateField(c,b)}}function EndDuplicateField(a,b,c){jQuery("#gform_fields li#field_"+c).after(b),jQuery("#field_"+a.id).animate({backgroundColor:"#FFFBCC"},"fast",function(){jQuery(this).animate({backgroundColor:"#FFF"},"fast",function(){jQuery(this).css("background-color","")})}),HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),TogglePageBreakSettings(),InitializeFields()}function GetFieldsByType(a){for(var b=new Array,c=0;c<form.fields.length;c++)IndexOf(a,form.fields[c].type)>=0&&b.push(form.fields[c]);return b}function GetNextFieldId(){for(var a=0,b=0;b<form.fields.length;b++)parseFloat(form.fields[b].id)>a&&(a=parseFloat(form.fields[b].id));if(form.deletedFields)for(var b=0;b<form.deletedFields.length;b++)parseFloat(form.deletedFields[b])>a&&(a=parseFloat(form.deletedFields[b]));return parseFloat(a)+1}function EndAddField(a,b,c){gf_vars.currentlyAddingField=!1,jQuery("#gform_adding_field_spinner").remove(),void 0!==c?(form.fields.splice(c,0,a),0===c?jQuery("#gform_fields").prepend(b):jQuery("#gform_fields").children().eq(c-1).after(b)):(jQuery("#gform_fields").append(b),form.fields.push(a));var d=jQuery("#field_"+a.id);d.animate({backgroundColor:"#FFFBCC"},"fast",function(){jQuery(this).animate({backgroundColor:"#FFF"},"fast",function(){jQuery(this).css("background-color","")})}),0===jQuery("#no-fields-stash li").length&&jQuery("#no-fields").detach().appendTo("#no-fields-stash"),jQuery(".selectable").removeClass("field_selected"),HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),d.addClass("field_selected"),SetFieldSize(a.size),TogglePageBreakSettings(),InitializeFields(),d.removeClass("field_selected"),jQuery(document).trigger("gform_field_added",[form,a])}function StartChangeNameFormat(a){field=GetSelectedField(),UpgradeNameField(field,!1,!0,!1)}function StartChangeCaptchaType(a){field=GetSelectedField(),field.captchaType=a,SetFieldProperty("captchaType",a),jQuery("#field_settings").slideUp(function(){StartChangeInputType(field.type,field)}),ResetRecaptcha()}function ResetRecaptcha(){field=GetSelectedField(),field.captchaLanguage="en",field.captchaTheme="light"}function StartChangeProductType(a){return field=GetSelectedField(),"singleproduct"==a||"hiddenproduct"==a||"calculation"==field.inputType?field.enablePrice=null:field.enablePrice=!0,StartChangeInputType(a,field)}function StartChangeDonationType(a){return field=GetSelectedField(),field.enablePrice="donation"!=a||null,StartChangeInputType(a,field)}function StartChangeShippingType(a){return field=GetSelectedField(),"singleshipping"!=a&&(field.enablePrice=!0),StartChangeInputType(a,field)}function StartChangePostCategoryType(a){return"dropdown"==a?jQuery(".post_category_initial_item_setting").hide():jQuery(".post_category_initial_item_setting").show(),field=GetSelectedField(),StartChangeInputType(a,field)}function EndChangeInputType(a){var b=a.id,c=a.type,d=a.fieldString;jQuery("#field_"+b).html(d);var e=GetFieldById(b);e.inputType=e.type!=c?c:"",SetDefaultValues(e),SetFieldLabel(e.label),SetFieldSize(e.size),SetFieldDefaultValue(e.defaultValue),SetFieldDescription(e.description),SetFieldRequired(e.isRequired),InitializeFields(),LoadFieldSettings()}function InitializeFields(){jQuery(".selectable").hover(function(){jQuery(this).addClass("field_hover")},function(){jQuery(this).removeClass("field_hover")}).focus(function(){jQuery(".field_hover").removeClass("field_hover"),jQuery(this).addClass("field_hover")}),jQuery(".field_delete_icon, .field_duplicate_icon").click(function(a){a.stopPropagation()}),jQuery("#field_settings, #form_settings, #last_page_settings, #pagination_settings, .captcha_message, .form_delete_icon, .all-merge-tags").click(function(a){a.stopPropagation()})}function FieldClick(a){if(gforms_dragging==a.id)return void(gforms_dragging=0);if(jQuery("input#gform_force_focus").focus(),jQuery(a).hasClass("field_selected")){var b="";switch(a.id){case"gform_heading":b="#form_settings",jQuery(".gf_form_toolbar_settings a").removeClass("gf_toolbar_active");break;case"gform_last_page_settings":b="#last_page_settings";break;case"gform_pagination":b="#pagination_settings";break;default:b="#field_settings"}return void jQuery(b).slideUp(function(){jQuery(a).removeClass("field_selected").addClass("field_hover"),HideSettings("field_settings")})}jQuery(".selectable").removeClass("field_selected"),jQuery(a).removeClass("field_hover").addClass("field_selected"),"gform_heading"==a.id?(HideSettings("field_settings"),HideSettings("last_page_settings"),HideSettings("pagination_settings"),InitializeFormConditionalLogic(),ShowSettings("form_settings"),jQuery(".gf_form_toolbar_settings a").addClass("gf_toolbar_active")):"gform_last_page_settings"==a.id?(HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("pagination_settings"),ShowSettings("last_page_settings")):"gform_pagination"==a.id?(HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),InitPaginationOptions(),ShowSettings("pagination_settings")):(HideSettings("form_settings"),HideSettings("last_page_settings"),HideSettings("pagination_settings"),LoadFieldSettings())}function TogglePercentageStyle(a){var b=a?"":"slow";"custom"==jQuery("#percentage_style").val()?jQuery(".percentage_custom_container").show(b):jQuery(".percentage_custom_container").hide(b)}function TogglePercentageConfirmationText(a){var b=a?"":"slow";jQuery("#percentage_confirmation_display").is(":checked")?jQuery(".percentage_confirmation_page_name_setting").show(b):jQuery(".percentage_confirmation_page_name_setting").hide(b)}function CustomFieldExists(a){if(!a)return!0;for(var b=jQuery("#field_custom_field_name_select option"),c=0;c<b.length;c++)if(b[c].value==a)return!0;return!1}function IsStandardMask(a){if(!a)return!0;for(var b=jQuery("#field_mask_select option"),c=0;c<b.length;c++)if(b[c].value==a)return!0;return!1}function LoadFieldChoices(a){jQuery("#field_choice_values_enabled").prop("checked",!!a.enableChoiceValue),ToggleChoiceValue();var b="list"==GetInputType(a)?"field_columns":"field_choices";jQuery("#"+b).html(GetFieldChoices(a)),LoadBulkChoices(a),jQuery(document).trigger("gform_load_field_choices",[a]),gform.doAction("gform_load_field_choices",[a])}function LoadInputChoices(a,b){var c=a.parent();c.find(".field_input_choice_values_enabled").prop("checked",!!b.enableChoiceValue),ToggleInputChoiceValue(c,b.enableChoiceValue),jQuery(a).html(GetInputChoices(b))}function LoadBulkChoices(a){if(LoadCustomChoices(),a.choices){for(var b,c=new Array,d=0;d<a.choices.length;d++)b=a.choices[d].text==a.choices[d].value?a.choices[d].text:a.choices[d].text+"|"+a.choices[d].value,a.enablePrice&&""!=a.choices[d].price&&(b+="|:"+a.choices[d].price),c.push(b);c=gform.applyFilters("gform_choices_post_bulk_load",c,a.choices),jQuery("#gfield_bulk_add_input").val(c.join("\n"))}}function DisplayCustomMessage(a){jQuery("#bulk_custom_message").html(a).slideDown(),setTimeout(function(){jQuery("#bulk_custom_message").slideUp()},2e3)}function LoadCustomChoices(){if(jQuery(".choice_section_header, .bulk_custom_choice").remove(),!IsEmpty(gform_custom_choices)){var a="<li class='choice_section_header'>"+gf_vars.customChoices+"</li>";for(key in gform_custom_choices)if(gform_custom_choices.hasOwnProperty(key)){var b='SelectCustomChoice( jQuery(this).data("key") );';a+="<li class='bulk_custom_choice'><a href='javascript:void(0);' data-key='"+escapeAttr(key)+"' onclick='"+b+"' onkeypress='"+b+"' class='bulk-choice bulk_custom_choice'>"+escapeHtml(key)+"</a></li>"}a+="<li class='choice_section_header'>"+gf_vars.predefinedChoices+"</li>",jQuery("#bulk_items").prepend(a)}}function escapeAttr(a){return String(a).replace(/["']/g,function(a){return entityMap[a]})}function escapeHtml(a){return String(a).replace(/[&<>"'`=\/]/g,function(a){return entityMap[a]})}function SelectCustomChoice(a){jQuery("#gfield_bulk_add_input").val(gform_custom_choices[a].join("\n")),gform_selected_custom_choice=a,InitBulkCustomPanel()}function SelectPredefinedChoice(a){jQuery("#gfield_bulk_add_input").val(gform_predefined_choices[a].join("\n")),gform_selected_custom_choice="",InitBulkCustomPanel()}function InsertBulkChoices(a){field=GetSelectedField(),field.choices=new Array;for(var b=!1,c=0;c<a.length;c++){if(text_price=a[c].split("|:"),text_value=text_price[0],price="",text_price.length>1){var d=GetCurrentCurrency();price=d.toMoney(text_price[1])}text_value=text_value.split("|"),field.choices.push(new Choice(jQuery.trim(text_value[0]),jQuery.trim(text_value[text_value.length-1]),jQuery.trim(price))),text_value.length>1&&(b=!0)}gform.doAction("gform_bulk_insert_choices",field),b&&(field.enableChoiceValue=!0,jQuery("#field_choice_values_enabled").prop("checked",!0),ToggleChoiceValue()),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InitBulkCustomPanel(){0==gform_selected_custom_choice.length?CloseCustomChoicesPanel():LoadCustomChoicesPanel()}function LoadCustomChoicesPanel(a,b){a?(jQuery("#custom_choice_name").val(""),jQuery("#bulk_save_button").html(gf_vars.save),jQuery("#bulk_cancel_link").show(),jQuery("#bulk_delete_link").hide()):(jQuery("#custom_choice_name").val(gform_selected_custom_choice),jQuery("#bulk_save_button").html(gf_vars.update),jQuery("#bulk_cancel_link").hide(),jQuery("#bulk_delete_link").show()),b||(b=""),jQuery("#bulk_save_as").hide(b),jQuery("#bulk_custom_edit").show(b)}function CloseCustomChoicesPanel(a){a||(a=""),jQuery("#bulk_save_as").show(a),jQuery("#bulk_custom_edit").hide(a)}function IsEmpty(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0}function SetFieldChoice(a,b){var c=jQuery("#"+a+"_choice_text_"+b).val(),d=jQuery("#"+a+"_choice_value_"+b).val(),e=jQuery("#"+a+"_choice_price_"+b).val();if(field=GetSelectedField(),field.choices[b].text=c,field.choices[b].value=field.enableChoiceValue?d:c,field.enablePrice){var f=GetCurrentCurrency(),e=f.toMoney(e);e||(e=""),field.choices[b].price=e}jQuery("#field_choices :radio, #field_choices :checkbox").each(function(a){field.choices[a].isSelected=this.checked}),LoadBulkChoices(field),UpdateFieldChoices(GetInputType(field))}function SetInputChoice(a,b,c,d){var e=GetSelectedField(),f=GetInput(e,a);a=a.toString().replace(".","_"),f.choices[b].text=d,f.choices[b].value=f.enableChoiceValue?c:d,jQuery(".field-input-choice-"+a+":radio, .field-input-choice-"+a+":checkbox").each(function(a){f.choices[a].isSelected=this.checked}),UpdateInputChoices(f)}function UpdateFieldChoices(a){var b="",c="";"checkbox"==a&&(field.inputs=new Array);var d=0;switch(GetInputType(field)){case"select":for(var e=0;e<field.choices.length;e++){selected=field.choices[e].isSelected?"selected='selected'":"";b+="<option value='"+(field.choices[e].value?field.choices[e].value:field.choices[e].text).replace(/'/g,"&#039;")+"' "+selected+">"+field.choices[e].text+"</option>"}break;case"checkbox":for(var e=0;e<field.choices.length;e++){(e+1+d)%10==0&&d++;var f=field.id+"."+(e+1+d);field.inputs.push(new Input(f,field.choices[e].text));var g="choice_"+field.id+"_"+e;checked=field.choices[e].isSelected?"checked":"",e<5&&(b+="<li><input type='"+a+"' "+checked+" id='"+g+"' disabled='disabled'><label for='"+g+"'>"+field.choices[e].text+"</label></li>")}field.choices.length>5&&(b+="<li class='gchoice_total'>"+gf_vars.editToViewAll.replace("%d",field.choices.length)+"</li>");break;case"radio":for(var e=0;e<field.choices.length;e++){var g="choice_"+field.id+"_"+e;checked=field.choices[e].isSelected?"checked":"",e<5&&(b+="<li><input type='"+a+"' "+checked+" id='"+g+"' disabled='disabled'><label for='"+g+"'>"+field.choices[e].text+"</label></li>")}b+=field.enableOtherChoice?"<li><input type='"+a+"' "+checked+" id='"+g+"' disabled='disabled'><input type='text' value='"+gf_vars.otherChoiceValue+"'  disabled='disabled' /></li>":"",field.choices.length>5&&(b+="<li class='gchoice_total'>"+gf_vars.editToViewAll.replace("%d",field.choices.length)+"</li>");break;case"list":var h=null!=field.choices;columns=h?field.choices:[[]];var i="";if(h){b+="<thead><tr>";for(var e=0;e<columns.length;e++)b+="<th>"+columns[e].text+"</th>";b+="<th>&nbsp;</th></tr></thead>"}else i="class='gf_list_one_column'";b+="<tbody>",b+="<tr>";for(var j=0;j<columns.length;j++)b+="<td "+i+"><input type='text' disabled='disabled'  /></td>";b+="<td><img src='"+gf_vars.baseUrl+"/images/add.png' class='add_list_item' style='cursor:pointer; margin:0 3px;' /></td>",b+="</tr></tbody>"}c=".gfield_"+a,jQuery(".field_selected "+c).html(b)}function UpdateInputChoices(a){for(var b="",c=0;c<a.choices.length;c++){var d=a.choices[c].isSelected?"selected='selected'":"";b+="<option value='"+(a.choices[c].value?a.choices[c].value:a.choices[c].text).replace(/'/g,"&#039;")+"' "+d+">"+a.choices[c].text+"</option>"}var e=a.id.toString().replace(".","_");jQuery(".field_selected #input_"+e).html(b)}function InsertFieldChoice(a){field=GetSelectedField();var b=field.enablePrice?"0.00":"",c=new Choice("","",b);window["gform_new_choice_"+field.type]&&(c=window["gform_new_choice_"+field.type](field,c)),field.choices.splice(a,0,c),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InsertInputChoice(a,b,c){var d=GetSelectedField(),e=GetInput(d,b),f=new Choice("","");e.choices.splice(c,0,f),LoadInputChoices(a,e),UpdateInputChoices(e)}function DeleteFieldChoice(a){field=GetSelectedField();var b=jQuery("#"+GetInputType(field)+"_choice_value_"+a).val();HasConditionalLogicDependency(field.id,b)&&!confirm(gf_vars.conditionalLogicDependencyChoice)||(field.choices.splice(a,1),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field)))}function DeleteInputChoice(a,b,c){var d=GetSelectedField(),e=GetInput(d,b);e.choices.splice(c,1),LoadInputChoices(a,e),UpdateInputChoices(e)}function MoveFieldChoice(a,b){field=GetSelectedField();var c=field.choices[a];field.choices.splice(a,1),field.choices.splice(b,0,c),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function MoveInputChoice(a,b,c,d){var e=GetSelectedField(),f=GetInput(e,b),g=f.choices[c];f.choices.splice(c,1),f.choices.splice(d,0,g),LoadInputChoices(a,f),UpdateInputChoices(f)}function GetFieldType(a){return a.substr(0,a.lastIndexOf("_"))}function GetSelectedField(){var a=jQuery(".field_selected");if(a.length<=0)return!1;var b=a[0].id.substr(6);return GetFieldById(b)}function SetPasswordProperty(a){SetFieldProperty("enablePasswordInput",a)}function ToggleDateCalendar(a){var b=a?"":"slow",c=jQuery("#field_date_input_type").val();"datefield"==c||"datedropdown"==c?(jQuery("#date_picker_container").hide(b),SetCalendarIconType("none")):jQuery("#date_picker_container").show(b)}function ToggleCalendarIconUrl(a){var b=a?"":"slow";jQuery("#gsetting_icon_custom").is(":checked")?jQuery("#gfield_icon_url_container").show(b):(jQuery("#gfield_icon_url_container").hide(b),jQuery("#gfield_calendar_icon_url").val(""),SetFieldProperty("calendarIconUrl",""))}function SetTimeFormat(a){SetFieldProperty("timeFormat",a),LoadTimeInputs()}function LoadTimeInputs(){var a=GetSelectedField();if("time"==a.type||"time"==a.inputType){"24"==jQuery("#field_time_format").val()?(jQuery("#input_default_value_row_input_"+a.id+"_3").hide(),jQuery(".field_selected .gfield_time_ampm").hide()):(jQuery("#input_default_value_row_input_"+a.id+"_3").show(),jQuery(".field_selected .gfield_time_ampm").show()),jQuery("#input_placeholder_row_input_"+a.id+"_3").hide(),jQuery(".field_custom_input_row_"+a.id+"_3").hide()}}function SetDateFormat(a){SetFieldProperty("dateFormat",a),LoadDateInputs()}function LoadDateInputs(){var a=jQuery("#field_date_input_type").val(),b=jQuery("#field_date_format").val(),c=b?b.substr(0,3):"mdy";if("datefield"==a){switch(c){case"ymd":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day"),jQuery(".field_selected #gfield_input_date_year").remove().insertBefore(".field_selected #gfield_input_date_month");break;case"mdy":jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day");break;case"dmy":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_month")}jQuery(".field_selected .ginput_date").show(),jQuery(".field_selected .ginput_date_dropdown").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else if("datedropdown"==a){switch(c){case"ymd":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day"),jQuery(".field_selected #gfield_dropdown_date_year").remove().insertBefore(".field_selected #gfield_dropdown_date_month");break;case"mdy":jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day");break;case"dmy":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_month")}jQuery(".field_selected .ginput_date_dropdown").css("display","inline"),jQuery(".field_selected .ginput_date").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else jQuery(".field_selected .ginput_date").hide(),jQuery(".field_selected .ginput_date_dropdown").hide(),jQuery(".field_selected #gfield_input_datepicker").show(),jQuery("#gsetting_icon_calendar").is(":checked")?jQuery(".field_selected #gfield_input_datepicker_icon").show():jQuery(".field_selected #gfield_input_datepicker_icon").hide()}function SetCalendarIconType(a,b){field=GetSelectedField(),"date"==GetInputType(field)&&(void 0==a&&(a="none"),"none"==a?jQuery("#gsetting_icon_none").prop("checked",!0):"calendar"==a?jQuery("#gsetting_icon_calendar").prop("checked",!0):"custom"==a&&jQuery("#gsetting_icon_custom").prop("checked",!0),SetFieldProperty("calendarIconType",a),ToggleCalendarIconUrl(b),LoadDateInputs())}function SetDateInputType(a){field=GetSelectedField(),"date"==GetInputType(field)&&(field.dateType=a,field.inputs=GetDateFieldInputs(field),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputLabelsUI(field),ToggleDateSettings(field),ResetDefaultInputValues(field),ResetInputPlaceholders(field),ToggleDateCalendar(),LoadDateInputs())}function SetPostImageMeta(){var a=jQuery(".field_selected #gfield_display_title").is(":checked"),b=jQuery(".field_selected #gfield_display_caption").is(":checked"),c=jQuery(".field_selected #gfield_display_description").is(":checked"),d=a||b||c;SetFieldProperty("displayTitle",a),SetFieldProperty("displayCaption",b),SetFieldProperty("displayDescription",c),jQuery(".field_selected .ginput_post_image_title").css("display",a?"block":"none"),jQuery(".field_selected .ginput_post_image_caption").css("display",b?"block":"none"),jQuery(".field_selected .ginput_post_image_description").css("display",c?"block":"none"),jQuery(".field_selected .ginput_post_image_file").css("display",d?"block":"none")}function SetFeaturedImage(){if(jQuery("#gfield_featured_image").is(":checked")){for(i in form.fields)form.fields.hasOwnProperty(i)&&(form.fields[i].postFeaturedImage=!1);SetFieldProperty("postFeaturedImage",!0)}else SetFieldProperty("postFeaturedImage",!1)}function SetFieldProperty(a,b){void 0==b&&(b=""),GetSelectedField()[a]=b}function SetInputName(a,b){var c=GetSelectedField();if(a&&(a=a.trim()),b){for(var d=0;d<c.inputs.length;d++)if(c.inputs[d].id==b)return void(c.inputs[d].name=a)}else c.inputName=a}function SetInputDefaultValue(a,b){var c,d=GetSelectedField();a&&(a=a.trim());for(var e=0;e<d.inputs.length;e++)if(d.inputs[e].id==b)return d.inputs[e].defaultValue=a,void jQuery('[name="input_'+b+'"], #input_'+b.toString().replace(".","_")).each(function(){"INPUT"==this.nodeName?jQuery(this).val(a):(c=jQuery(this),a=a.toLowerCase(),c.val("").children().each(function(){if(this.value.toLowerCase()==a)return c.val(this.value),!1}))})}function SetInputPlaceholder(a,b){var c=GetSelectedField();a&&(a=a.trim())
;for(var d=0;d<c.inputs.length;d++)if(c.inputs[d].id==b)return c.inputs[d].placeholder=a,void jQuery('[name="input_'+b+'"], #input_'+b.toString().replace(".","_")).each(function(){var b=this.nodeName;"INPUT"==b?jQuery(this).prop("placeholder",a):"SELECT"==b&&jQuery(this).find('option[value=""]').text(a)})}function ResetInputPlaceholders(a){a||(a=GetSelectedField()),a.inputs&&jQuery(a.inputs).each(function(){SetInputPlaceholder(void 0!==this.placeholder?this.placeholder:"",this.id)})}function ResetDefaultInputValues(a){a||(a=GetSelectedField()),a.inputs&&jQuery(a.inputs).each(function(){SetInputDefaultValue(void 0!==this.defaultValue?this.defaultValue:"",this.id)})}function SetInputCustomLabel(a,b){var c,d,e,f=GetSelectedField();a&&(a=a.trim());for(var g=0;g<f.inputs.length;g++)if(e=f.inputs[g],e.id==b)return""==a?(delete e.customLabel,d=void 0!==e.defaultLabel?e.defaultLabel:e.label):(e.customLabel=a,d=a),c="input_"+f.inputs[g].id,c=c.replace(".","_"),c=".ginput_container label[for="+c+"]",void jQuery(c).text(d)}function SetInputHidden(a,b){for(var c=GetSelectedField(),d=0;d<c.inputs.length;d++)if(c.inputs[d].id==b)return c.inputs[d].isHidden=a,b=b.toString().replace(".","_"),void jQuery("#input_"+b+"_container").toggle(!a)}function SetSelectedCategories(){var a=GetSelectedField();a.choices=new Array,jQuery(".gfield_category_checkbox").each(function(){this.checked&&a.choices.push(new Choice(this.name,this.value))}),a.choices.sort(function(a,b){return a.text.toLowerCase()>b.text.toLowerCase()})}function SetFieldLabel(a){var b=jQuery(".field_selected .gfield_required")[0];jQuery(".field_selected .gfield_label, .field_selected .gsection_title").text(a).append(b),SetFieldProperty("label",a)}function SetCaptchaTheme(a,b){jQuery(".field_selected .gfield_captcha").attr("src",b),SetFieldProperty("captchaTheme",a)}function SetCaptchaSize(a){var b=jQuery("#field_captcha_type").val();SetFieldProperty("simpleCaptchaSize",a),RedrawCaptcha(),jQuery(".field_selected .gfield_captcha_input_container").removeClass(b+"_small").removeClass(b+"_medium").removeClass(b+"_large").addClass(b+"_"+a)}function SetCaptchaFontColor(a){SetFieldProperty("simpleCaptchaFontColor",a),RedrawCaptcha()}function SetCaptchaBackgroundColor(a){SetFieldProperty("simpleCaptchaBackgroundColor",a),RedrawCaptcha()}function RedrawCaptcha(){"math"==jQuery("#field_captcha_type").val()?(url_1=GetCaptchaUrl(1),url_2=GetCaptchaUrl(2),url_3=GetCaptchaUrl(3),jQuery(".field_selected .gfield_captcha:eq(0)").attr("src",url_1),jQuery(".field_selected .gfield_captcha:eq(1)").attr("src",url_2),jQuery(".field_selected .gfield_captcha:eq(2)").attr("src",url_3)):(url=GetCaptchaUrl(),jQuery(".field_selected .gfield_captcha").attr("src",url))}function SetFieldSize(a){jQuery(".field_selected .small, .field_selected .medium, .field_selected .large").removeClass("small").removeClass("medium").removeClass("large").addClass(a),SetFieldProperty("size",a)}function SetFieldLabelPlacement(a){var b=a||form.labelPlacement;SetFieldProperty("labelPlacement",a),jQuery(".field_selected").removeClass("top_label").removeClass("right_label").removeClass("left_label").removeClass("hidden_label").addClass(b),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?(jQuery("#field_description_placement").val(""),SetFieldProperty("descriptionPlacement",""),jQuery("#field_description_placement_container").hide("slow")):jQuery("#field_description_placement_container").show("slow"),SetFieldProperty("labelPlacement",a),RefreshSelectedFieldPreview()}function SetFieldDescriptionPlacement(a){var b="above"==a||""==a&&"above)"==form.descriptionPlacement;SetFieldProperty("descriptionPlacement",a),RefreshSelectedFieldPreview(function(){b?jQuery(".field_selected").addClass("description_above"):jQuery(".field_selected").removeClass("description_above")})}function SetFieldSubLabelPlacement(a){SetFieldProperty("subLabelPlacement",a),RefreshSelectedFieldPreview()}function SetFieldVisibility(a,b,c){if(!c&&"administrative"==a&&HasConditionalLogicDependency(field.id)&&!confirm(gf_vars.conditionalLogicDependencyAdminOnly))return!1;for(var d=!1,e=0;e<gf_vars.visibilityOptions.length;e++)if(gf_vars.visibilityOptions[e].value==a){d=!0;break}if(d||(a="visible"),SetFieldProperty("visibility",a),b){var f=jQuery('input[name="field_visibility"]');f.prop("checked",!1),f.filter('[value="'+a+'"]').prop("checked",!0)}}function SetFieldDefaultValue(a){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").val(a),SetFieldProperty("defaultValue",a)}function SetFieldPlaceholder(a){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").each(function(){var b=this.nodeName,c=jQuery(this);if("INPUT"==b||"TEXTAREA"==b)jQuery(this).prop("placeholder",a);else if("SELECT"==b){var d=c.find('option[value=""]');d.length>0?a.length>0?d.text(a):d.remove():(c.prepend('<option value="">'+a+"</option>"),c.val(""))}}),SetFieldProperty("placeholder",a)}function SetFieldDescription(a){void 0==a&&(a=""),SetFieldProperty("description",a)}function SetPasswordStrength(a){a?jQuery(".field_selected .gfield_password_strength").show():(jQuery(".field_selected .gfield_password_strength").hide(),jQuery("#gfield_min_strength").val(""),SetFieldProperty("minPasswordStrength","")),SetFieldProperty("passwordStrengthEnabled",a)}function ToggleEmailSettings(a){var b=void 0!==a.emailConfirmEnabled&&1==a.emailConfirmEnabled;jQuery(".placeholder_setting").toggle(!b),jQuery(".default_value_setting").toggle(!b),jQuery(".sub_label_placement_setting").toggle(b),jQuery(".sub_labels_setting").toggle(b),jQuery(".default_input_values_setting").toggle(b),jQuery(".input_placeholders_setting").toggle(b)}function SetEmailConfirmation(a){var b=GetSelectedField();a?(jQuery(".field_selected .ginput_single_email").hide(),jQuery(".field_selected .ginput_confirm_email").show()):(jQuery(".field_selected .ginput_confirm_email").hide(),jQuery(".field_selected .ginput_single_email").show()),b.emailConfirmEnabled=a,b.inputs=GetEmailFieldInputs(b),CreateDefaultValuesUI(b),CreatePlaceholdersUI(b),CreateCustomizeInputsUI(b),CreateInputLabelsUI(b),ToggleEmailSettings(b)}function SetCardType(a,b){var c=GetSelectedField().creditCards?GetSelectedField().creditCards:new Array;if(jQuery(a).is(":checked"))-1==jQuery.inArray(b,c)&&(jQuery(".gform_card_icon_"+b).fadeIn(),c[c.length]=b);else{var d=jQuery.inArray(b,c);-1!=d&&(jQuery(".gform_card_icon_"+b).fadeOut(),c.splice(d,1))}SetFieldProperty("creditCards",c)}function SetFieldRequired(a){var b=a?"*":"";jQuery(".field_selected .gfield_required").html(b),SetFieldProperty("isRequired",a)}function SetMaxLength(a){var b=GetMaxLengthPattern(),c="",d=a.value.split("");for(i in d)d.hasOwnProperty(i)&&(b.test(d[i])||(c+=d[i]));a.value=c,SetFieldProperty("maxLength",c)}function GetMaxLengthPattern(){return/[a-zA-Z\-!@#$%^&*();'":_+=<,>.~`?\/|\[\]\{\}\\]/}function ValidateKeyPress(a,b,c){var c=void 0===c||c,d=a.which?a.which:a.keyCode,e=b.test(String.fromCharCode(d));return!!a.ctrlKey||(c?e:!e)}function IndexOf(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return c;return-1}function ToggleCalculationOptions(a,b){a?(jQuery("#calculation_options").gfSlide("down"),"product"!=b.type&&jQuery("li.range_setting").gfSlide("up")):(jQuery("#calculation_options").gfSlide("up"),"product"!=b.type&&jQuery("li.range_setting").gfSlide("down"),SetFieldProperty("calculationFormula",""),SetFieldProperty("calculationRounding","")),SetFieldProperty("enableCalculation",a)}function FormulaContentCallback(){SetFieldProperty("calculationFormula",jQuery("#field_calculation_formula").val().trim())}function SetupUnsavedChangesWarning(){UpdateFormObject(),gforms_original_json=jQuery.toJSON(form),window.onbeforeunload=function(){if(UpdateFormObject(),gforms_original_json!=jQuery.toJSON(form)&&!gf_vars.isFormTrash)return"You have unsaved changes."}}function ToggleRichTextEditor(a){var b=GetSelectedField(),c=jQuery("#input_"+b.id),d=jQuery("#input_"+b.id+"_rte_preview");a?(c.hide(),d.show()):(d.hide(),c.show()),SetFieldProperty("useRichTextEditor",a)}function iColorShow(a,b,c,d){jQuery("#iColorPicker").css({top:b-150+"px",left:a+"px",position:"absolute"}).fadeIn("fast"),jQuery("#iColorPickerBg").css({position:"absolute",top:0,left:0,width:"100%",height:"100%"}).fadeIn("fast");var e=jQuery("#"+c).val();jQuery("#colorPreview span").text(e),jQuery("#colorPreview").css("background",e),jQuery("#color").val(e);var f=jQuery("#iColorPicker");for(i=0;i<f.length;i++){var g=document.getElementById("hexSection"+i),h=g.childNodes;for(j=0;j<h.length;j++){var l=h[j].childNodes;for(k=0;k<l.length;k++)jQuery(h[j].childNodes[k]).unbind().mouseover(function(a){var b="#"+jQuery(this).attr("hx");jQuery("#colorPreview").css("background",b),jQuery("#colorPreview span").text(b)}).click(function(){var a="#"+jQuery(this).attr("hx");jQuery("#"+c).val(a),jQuery("#chip_"+c).css("background-color",a),jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut(),d&&window[d](a),jQuery(this)})}}}function SetColorPickerColor(a,b,c){jQuery("#chip_"+a).css("background-color",b),c&&window[c](b)}function SetFieldChoices(){for(var a=GetSelectedField(),b=0;b<a.choices.length;b++)SetFieldChoice(GetInputType(a),b)}function SetInputChoices(a){var b,c,d,e;GetSelectedField();a.find("li").each(function(a){b=jQuery(this),e=b.data("input_id"),c=b.find(".field-choice-value").val(),d=b.find(".field-choice-text").val(),SetInputChoice(e,a,c,d)})}function MergeInputArrays(a,b){for(var c,d,e=0;e<a.length;++e)c=a[e],(d=GetInput({inputs:b},c.id))&&(a[e]=jQuery.extend(c,d));return a}jQuery(document).ready(function(){if(setTimeout("CloseStatus();",5e3),jQuery(".field_type input").each(function(){var a=jQuery(this),b=a.data("type"),c=a.attr("onclick");void 0===b&&(c.indexOf("StartAddField")>-1&&/StartAddField\([ ]?'(.*?)[ ]?'/.test(c)&&(b=c.match(/'(.*?)'/)[1],a.data("type",b)),window.console&&console.log("Deprecated button for the "+this.value+' field. Since v1.9 the field type must be specified in the "type" data attribute.')),void 0===b||void 0!==c&&""!=c||jQuery(this).click(function(){StartAddField(b)})}),jQuery("#gform_fields").sortable({cancel:"#field_settings",handle:".gfield_admin_icons",start:function(a,b){gforms_dragging=b.item[0].id},tolerance:"pointer",over:function(a,b){if(jQuery("#no-fields").hide(),b.helper.hasClass("ui-draggable-dragging"))b.helper.data("original_width",b.helper.width()),b.helper.data("original_height",b.helper.height()),b.helper.width(b.sender.width()-25),b.helper.height(b.placeholder.height());else{var c=b.helper.height();c>300&&(c=300),b.placeholder.height(c)}},out:function(a,b){1===jQuery("#gform_fields li").length&&jQuery("#no-fields").show(),b.helper&&b.helper.hasClass("ui-draggable-dragging")&&(b.helper.width(b.helper.data("original_width")),b.helper.height(b.helper.data("original_height")))},placeholder:"field-drop-zone",beforeStop:function(a,b){jQuery("#gform_fields").height("100%");var c=b.helper.data("type");if(void 0!==c){var d=b.item.index();b.item.replaceWith("<li id='gform_adding_field_spinner'><i class='gficon-gravityforms-spinner-icon gficon-spin'></i></li>"),StartAddField(c,d)}}}),jQuery(".field_type input").draggable({connectToSortable:"#gform_fields",helper:function(){return jQuery(this).clone(!0)},revert:"invalid",cancel:!1,appendTo:"#wpbody",containment:"document",start:function(a,b){if(1==gf_vars.currentlyAddingField)return!1}}),jQuery("#field_choices, #field_columns").sortable({axis:"y",handle:".field-choice-handle",update:function(a,b){MoveFieldChoice(b.item.data("index"),b.item.index())}}),jQuery(".field_input_choices").sortable({axis:"y",handle:".field-choice-handle",update:function(a,b){var c=b.item.data("index"),d=b.item.index(),e=b.item.data("input_id");MoveInputChoice(b.item.parent(),e,c,d)}}),MakeNoFieldsDroppable(),void 0!==gf_global.view&&"settings"==gf_global.view||InitializeForm(form),jQuery(document).trigger("gform_load_form_settings",[form]),SetupUnsavedChangesWarning(),window.console){var a=jQuery(document)[0],b=jQuery.hasData(a)&&jQuery._data(a);if(b){var c=new Array("gform_load_form_settings");for(var d in b.events)-1!==jQuery.inArray(d,c)&&console.log('Gravity Forms API warning: The jQuery event "'+d+'" is deprecated on this page since version 1.7')}}jQuery(document).on("focus","#field_choices input.field-choice-text, #field_choices input.field-choice-value",function(){jQuery(this).data("previousValue",jQuery(this).val())}),InitializeFieldSettings()});var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};this.iColorPicker=function(){jQuery("input.iColorPicker").each(function(a){0==a&&(jQuery(document.createElement("div")).attr("id","iColorPicker").css("display","none").html('<table class="pickerTable" id="pickerTable0"><thead id="hexSection0"><tr><td style="background:#f00;" hx="f00"></td><td style="background:#ff0" hx="ff0"></td><td style="background:#0f0" hx="0f0"></td><td style="background:#0ff" hx="0ff"></td><td style="background:#00f" hx="00f"></td><td style="background:#f0f" hx="f0f"></td><td style="background:#fff" hx="fff"></td><td style="background:#ebebeb" hx="ebebeb"></td><td style="background:#e1e1e1" hx="e1e1e1"></td><td style="background:#d7d7d7" hx="d7d7d7"></td><td style="background:#cccccc" hx="cccccc"></td><td style="background:#c2c2c2" hx="c2c2c2"></td><td style="background:#b7b7b7" hx="b7b7b7"></td><td style="background:#acacac" hx="acacac"></td><td style="background:#a0a0a0" hx="a0a0a0"></td><td style="background:#959595" hx="959595"></td></tr><tr><td style="background:#ee1d24" hx="ee1d24"></td><td style="background:#fff100" hx="fff100"></td><td style="background:#00a650" hx="00a650"></td><td style="background:#00aeef" hx="00aeef"></td><td style="background:#2f3192" hx="2f3192"></td><td style="background:#ed008c" hx="ed008c"></td><td style="background:#898989" hx="898989"></td><td style="background:#7d7d7d" hx="7d7d7d"></td><td style="background:#707070" hx="707070"></td><td style="background:#626262" hx="626262"></td><td style="background:#555" hx="555"></td><td style="background:#464646" hx="464646"></td><td style="background:#363636" hx="363636"></td><td style="background:#262626" hx="262626"></td><td style="background:#111" hx="111"></td><td style="background:#000" hx="000"></td></tr><tr><td style="background:#f7977a" hx="f7977a"></td><td style="background:#fbad82" hx="fbad82"></td><td style="background:#fdc68c" hx="fdc68c"></td><td style="background:#fff799" hx="fff799"></td><td style="background:#c6df9c" hx="c6df9c"></td><td style="background:#a4d49d" hx="a4d49d"></td><td style="background:#81ca9d" hx="81ca9d"></td><td style="background:#7bcdc9" hx="7bcdc9"></td><td style="background:#6ccff7" hx="6ccff7"></td><td style="background:#7ca6d8" hx="7ca6d8"></td><td style="background:#8293ca" hx="8293ca"></td><td style="background:#8881be" hx="8881be"></td><td style="background:#a286bd" hx="a286bd"></td><td style="background:#bc8cbf" hx="bc8cbf"></td><td style="background:#f49bc1" hx="f49bc1"></td><td style="background:#f5999d" hx="f5999d"></td></tr><tr><td style="background:#f16c4d" hx="f16c4d"></td><td style="background:#f68e54" hx="f68e54"></td><td style="background:#fbaf5a" hx="fbaf5a"></td><td style="background:#fff467" hx="fff467"></td><td style="background:#acd372" hx="acd372"></td><td style="background:#7dc473" hx="7dc473"></td><td style="background:#39b778" hx="39b778"></td><td style="background:#16bcb4" hx="16bcb4"></td><td style="background:#00bff3" hx="00bff3"></td><td style="background:#438ccb" hx="438ccb"></td><td style="background:#5573b7" hx="5573b7"></td><td style="background:#5e5ca7" hx="5e5ca7"></td><td style="background:#855fa8" hx="855fa8"></td><td style="background:#a763a9" hx="a763a9"></td><td style="background:#ef6ea8" hx="ef6ea8"></td><td style="background:#f16d7e" hx="f16d7e"></td></tr><tr><td style="background:#ee1d24" hx="ee1d24"></td><td style="background:#f16522" hx="f16522"></td><td style="background:#f7941d" hx="f7941d"></td><td style="background:#fff100" hx="fff100"></td><td style="background:#8fc63d" hx="8fc63d"></td><td style="background:#37b44a" hx="37b44a"></td><td style="background:#00a650" hx="00a650"></td><td style="background:#00a99e" hx="00a99e"></td><td style="background:#00aeef" hx="00aeef"></td><td style="background:#0072bc" hx="0072bc"></td><td style="background:#0054a5" hx="0054a5"></td><td style="background:#2f3192" hx="2f3192"></td><td style="background:#652c91" hx="652c91"></td><td style="background:#91278f" hx="91278f"></td><td style="background:#ed008c" hx="ed008c"></td><td style="background:#ee105a" hx="ee105a"></td></tr><tr><td style="background:#9d0a0f" hx="9d0a0f"></td><td style="background:#a1410d" hx="a1410d"></td><td style="background:#a36209" hx="a36209"></td><td style="background:#aba000" hx="aba000"></td><td style="background:#588528" hx="588528"></td><td style="background:#197b30" hx="197b30"></td><td style="background:#007236" hx="007236"></td><td style="background:#00736a" hx="00736a"></td><td style="background:#0076a4" hx="0076a4"></td><td style="background:#004a80" hx="004a80"></td><td style="background:#003370" hx="003370"></td><td style="background:#1d1363" hx="1d1363"></td><td style="background:#450e61" hx="450e61"></td><td style="background:#62055f" hx="62055f"></td><td style="background:#9e005c" hx="9e005c"></td><td style="background:#9d0039" hx="9d0039"></td></tr><tr><td style="background:#790000" hx="790000"></td><td style="background:#7b3000" hx="7b3000"></td><td style="background:#7c4900" hx="7c4900"></td><td style="background:#827a00" hx="827a00"></td><td style="background:#3e6617" hx="3e6617"></td><td style="background:#045f20" hx="045f20"></td><td style="background:#005824" hx="005824"></td><td style="background:#005951" hx="005951"></td><td style="background:#005b7e" hx="005b7e"></td><td style="background:#003562" hx="003562"></td><td style="background:#002056" hx="002056"></td><td style="background:#0c004b" hx="0c004b"></td><td style="background:#30004a" hx="30004a"></td><td style="background:#4b0048" hx="4b0048"></td><td style="background:#7a0045" hx="7a0045"></td><td style="background:#7a0026" hx="7a0026"></td></tr></thead><tbody><tr><td style="border:1px solid #000;background:#fff;cursor:pointer;height:60px;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;" colspan="16" align="center" id="colorPreview"><span style="color:#000;border:1px solid rgb(0, 0, 0);padding:5px;background-color:#fff;font:11px Arial, Helvetica, sans-serif;"></span></td></tr></tbody></table><style>#iColorPicker input{margin:2px}</style>').appendTo("body"),jQuery(document.createElement("div")).attr("id","iColorPickerBg").click(function(){jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut()}).appendTo("body"),jQuery("table.pickerTable td").css({width:"12px",height:"14px",border:"1px solid #000",cursor:"pointer"}),jQuery("#iColorPicker table.pickerTable").css({"border-collapse":"collapse"}),jQuery("#iColorPicker").css({border:"1px solid #ccc",background:"#333",padding:"5px",color:"#fff","z-index":9999})),jQuery("#colorPreview").css({height:"50px"})})},jQuery(function(){iColorPicker()}),jQuery.fn.gfSlide=function(a){var b=jQuery("#field_settings").is(":visible");return"up"==a?b?this.slideUp():this.hide():b?this.slideDown():this.show(),this},gform.addFilter("gform_is_conditional_logic_field",function(a,b){return"administrative"==b.visibility?a=!1:b.id==GetSelectedField().id&&(a=!1),a});