Form Maker by WD – user-friendly drag & drop Form Builder plugin - Version 1.13.44

Version Description

  • Fixed: Saving Recaptcha type.
  • Fixed: Saving Select options from DB.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Form Maker by WD – user-friendly drag & drop Form Builder plugin
Version 1.13.44
Comparing to
See all releases

Code changes from version 1.13.43 to 1.13.44

admin/views/FMSelectDataFromDb.php CHANGED
@@ -45,8 +45,8 @@ class FMViewSelect_data_from_db extends FMAdminView {
45
  jQuery("#struct").removeClass("fm_loading");
46
  if (data == 1) {
47
  jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
48
- jQuery(".connect").removeAttr('disabled');
49
- jQuery("input[type='radio']").removeAttr('disabled', '');
50
  }
51
  else {
52
  jQuery("#struct").html(data.replace("<a", "<a target='_blank'"));
@@ -277,10 +277,10 @@ class FMViewSelect_data_from_db extends FMAdminView {
277
 
278
  function dis(id, x) {
279
  if (x) {
280
- jQuery('#' + id).removeAttr('disabled');
281
  }
282
  else {
283
- jQuery('#' + id).attr('disabled', 'disabled');
284
  }
285
  }
286
 
45
  jQuery("#struct").removeClass("fm_loading");
46
  if (data == 1) {
47
  jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
48
+ jQuery(".connect").prop('disabled', false);
49
+ jQuery("input[type='radio']").prop('disabled', false);
50
  }
51
  else {
52
  jQuery("#struct").html(data.replace("<a", "<a target='_blank'"));
277
 
278
  function dis(id, x) {
279
  if (x) {
280
+ jQuery('#' + id).prop('disabled', false);
281
  }
282
  else {
283
+ jQuery('#' + id).prop('disabled', true);
284
  }
285
  }
286
 
admin/views/FMSqlMapping.php CHANGED
@@ -197,10 +197,10 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
197
  ?>);
198
  function dis(id, x) {
199
  if (x) {
200
- jQuery('#' + id).removeAttr('disabled');
201
  }
202
  else {
203
- jQuery('#' + id).attr('disabled', 'disabled');
204
  }
205
  }
206
  function update_vis() {
@@ -992,8 +992,8 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
992
  jQuery("#struct").removeClass("fm_loading");
993
  if (data == 1) {
994
  jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
995
- jQuery(".connect").removeAttr('disabled');
996
- jQuery("input[type='radio']").removeAttr('disabled', '');
997
  }
998
  else {
999
  jQuery("#struct").html(data.replace("<a", "<a target='_blank'"));
@@ -1353,10 +1353,10 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1353
  ?>);
1354
  function dis(id, x) {
1355
  if (x) {
1356
- jQuery('#' + id).removeAttr('disabled');
1357
  }
1358
  else {
1359
- jQuery('#' + id).attr('disabled', 'disabled');
1360
  }
1361
  }
1362
  function update_vis() {
197
  ?>);
198
  function dis(id, x) {
199
  if (x) {
200
+ jQuery('#' + id).prop('disabled', false);
201
  }
202
  else {
203
+ jQuery('#' + id).prop('disabled', true);
204
  }
205
  }
206
  function update_vis() {
992
  jQuery("#struct").removeClass("fm_loading");
993
  if (data == 1) {
994
  jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
995
+ jQuery(".connect").prop('disabled', false);
996
+ jQuery("input[type='radio']").prop('disabled', false);
997
  }
998
  else {
999
  jQuery("#struct").html(data.replace("<a", "<a target='_blank'"));
1353
  ?>);
1354
  function dis(id, x) {
1355
  if (x) {
1356
+ jQuery('#' + id).prop('disabled', false);
1357
  }
1358
  else {
1359
+ jQuery('#' + id).prop('disabled', true);
1360
  }
1361
  }
1362
  function update_vis() {
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- * Version: 1.13.43
7
  * Author: 10Web Form Builder Team
8
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -98,8 +98,8 @@ final class WDFM {
98
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
99
  $this->front_urls = $this->get_front_urls();
100
  $this->main_file = plugin_basename(__FILE__);
101
- $this->plugin_version = '1.13.43';
102
- $this->db_version = '2.13.43';
103
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
104
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
105
  $this->menu_slug = 'manage' . $this->menu_postfix;
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ * Version: 1.13.44
7
  * Author: 10Web Form Builder Team
8
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
98
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
99
  $this->front_urls = $this->get_front_urls();
100
  $this->main_file = plugin_basename(__FILE__);
101
+ $this->plugin_version = '1.13.44';
102
+ $this->db_version = '2.13.44';
103
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
104
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
105
  $this->menu_slug = 'manage' . $this->menu_postfix;
framework/WDW_FM_Library.php CHANGED
@@ -2225,7 +2225,7 @@ class WDW_FM_Library {
2225
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().children("input:first, label:first").remove();
2226
  }
2227
  else {
2228
- if(jQuery("#wdform_' . $id1 . '_state' . $form_id . '").prop("tagName") == "SELECT") {
2229
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().append("<input type=\"text\" id=\"wdform_' . $id1 . '_state' . $form_id . '\" name=\"wdform_' . ($id1 + 3) . '_state' . $form_id . '\" value=\"' . self::get( 'wdform_' . ($id1 + 3) . '_state' . $form_id, "", 'esc_html' ) . '\" style=\"width: 100%;\" ' . $param['attributes'] . '><label class=\"mini_label\">' . $w_mini_labels[3] . '</label>");
2230
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().children("select:first, label:first").remove();
2231
  }
@@ -4124,8 +4124,8 @@ class WDW_FM_Library {
4124
  var value_ids<?php echo $form_id ?> = {};
4125
  jQuery.each( jQuery.parseJSON( inputIds<?php echo $form_id ?> ), function( key, values ) {
4126
  jQuery.each( values, function( index, input_id ) {
4127
- tagName = jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').prop("tagName");
4128
- type = jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').prop("type");
4129
  if ( tagName == 'INPUT' ) {
4130
  input_value = jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').val();
4131
  if ( jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').is(':checked') ) {
@@ -4149,7 +4149,7 @@ class WDW_FM_Library {
4149
  jQuery(document).on('change', '#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]', function() {
4150
  var id = '';
4151
  var changing_field_id = '';
4152
- if( jQuery(this).prop("tagName") == 'INPUT' ) {
4153
  if( jQuery(this).is(':checked') ) {
4154
  id = jQuery(this).val();
4155
  }
2225
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().children("input:first, label:first").remove();
2226
  }
2227
  else {
2228
+ if(jQuery("#wdform_' . $id1 . '_state' . $form_id . '").attr("tagName") == "SELECT") {
2229
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().append("<input type=\"text\" id=\"wdform_' . $id1 . '_state' . $form_id . '\" name=\"wdform_' . ($id1 + 3) . '_state' . $form_id . '\" value=\"' . self::get( 'wdform_' . ($id1 + 3) . '_state' . $form_id, "", 'esc_html' ) . '\" style=\"width: 100%;\" ' . $param['attributes'] . '><label class=\"mini_label\">' . $w_mini_labels[3] . '</label>");
2230
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().children("select:first, label:first").remove();
2231
  }
4124
  var value_ids<?php echo $form_id ?> = {};
4125
  jQuery.each( jQuery.parseJSON( inputIds<?php echo $form_id ?> ), function( key, values ) {
4126
  jQuery.each( values, function( index, input_id ) {
4127
+ tagName = jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').attr("tagName");
4128
+ type = jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').attr("type");
4129
  if ( tagName == 'INPUT' ) {
4130
  input_value = jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').val();
4131
  if ( jQuery('#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]').is(':checked') ) {
4149
  jQuery(document).on('change', '#form<?php echo $form_id ?> [id^="wdform_'+ input_id +'_elemen"]', function() {
4150
  var id = '';
4151
  var changing_field_id = '';
4152
+ if( jQuery(this).attr("tagName") == 'INPUT' ) {
4153
  if( jQuery(this).is(':checked') ) {
4154
  id = jQuery(this).val();
4155
  }
js/add_field.js CHANGED
@@ -1121,8 +1121,8 @@ function edit(id, e) {
1121
  w_choices[t] = jQuery(this).html();
1122
  w_choices_value[t] = jQuery(this).val();
1123
  w_choices_checked[t] = jQuery(this)[0].selected;
1124
- if (jQuery(this).prop('where')) {
1125
- w_choices_params[t] = jQuery(this).prop('where') + '[where_order_by]' + jQuery(this).prop('order_by') + '[db_info]' + jQuery(this).prop('db_info');
1126
  }
1127
  else {
1128
  w_choices_params[t] = '';
@@ -1148,8 +1148,8 @@ function edit(id, e) {
1148
  w_choices[t] = jQuery(this).html();
1149
  w_choices_price[t] = jQuery(this).val();
1150
  w_choices_checked[t] = jQuery(this)[0].selected;
1151
- if (jQuery(this).prop('where')) {
1152
- w_choices_params[t] = jQuery(this).prop('where') + '[where_order_by]' + jQuery(this).prop('order_by') + '[db_info]' + jQuery(this).prop('db_info');
1153
  }
1154
  else {
1155
  w_choices_params[t] = '';
@@ -2055,7 +2055,7 @@ function draggable_page_break( nextID, form_view_max ) {
2055
  if( typeof nextID === 'undefined' || nextID === null || nextID == "" || get_child_count() > 2) { // when add field button submitted not moved
2056
  return;
2057
  }
2058
- var str = jQuery("#cur_column").parent().parent().prop("id");
2059
  var endPoint = parseInt(str.substr(str.indexOf("form_id_tempform_view") + 21)); // break conteiner number
2060
 
2061
  if ( form_view_max == 2 ) { // if break first time
@@ -2161,7 +2161,7 @@ function close_window() {
2161
  if (need_enable) {
2162
  popup_ready();
2163
  /* In Firfox and Safari click action is working during the drag and drop also */
2164
- /*jQuery(".add-new-button").prop("onclick","popup_ready(); Enable(); return false;");*/
2165
  }
2166
  need_enable = true;
2167
  document.getElementById('edit_table').innerHTML = "";
@@ -2205,9 +2205,9 @@ function addRow(event, that, type, subtype) {
2205
 
2206
  function fm_add_field_button(that, subtype) {
2207
  if (jQuery(that).hasClass('wd-pro-fields') && subtype != 'stripe') {
2208
- jQuery('#edit_main_table input').prop('disabled', 'disabled');
2209
- jQuery('#edit_main_table textarea').prop('disabled', 'disabled');
2210
- jQuery('#edit_main_table .fm-input-container span.dashicons').prop('onclick', '');
2211
  jQuery('#add-button-cont').removeClass('add-button-cont').html('');
2212
  jQuery('#premium_message').removeClass('fm-hidden');
2213
  jQuery('#stripe_message').addClass('fm-hidden');
@@ -2215,9 +2215,9 @@ function fm_add_field_button(that, subtype) {
2215
  }
2216
  else {
2217
  if (subtype == 'stripe' && (is_addon_stripe_active == 0 || is_stripe_enabled == 0)) {
2218
- jQuery('#edit_main_table input').prop('disabled', 'disabled');
2219
- jQuery('#edit_main_table textarea').prop('disabled', 'disabled');
2220
- jQuery('#edit_main_table .fm-input-container span.dashicons').prop('onclick', '');
2221
  if (!jQuery(that).hasClass('wd-pro-fields') && is_stripe_enabled == 0 && is_addon_stripe_active == 1) {
2222
  jQuery('#add-button-cont').removeClass('add-button-cont').html('<div class="error"><p>' + form_maker.stripe3 + '</p></div>');
2223
  jQuery( '#premium_message' ).addClass( 'fm-hidden' );
@@ -2711,7 +2711,7 @@ function create_additional_attributes(i, w_attr_name, type) {
2711
  function add_attr(i, type) {
2712
  var el_attr_table = jQuery('#attributes');
2713
  el_attr_table.show();
2714
- j = parseInt(el_attr_table.children().last().prop('idi')) + 1;
2715
  w_attr_name = "attribute";
2716
  w_attr_value = "value";
2717
  var attr = jQuery('<div idi="' + j + '" id="attr_row_' + j + '" class="fm-width-100"><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_name' + j + '" value="' + w_attr_name + '" onChange="change_attribute_name(\'' + i + '\', this, \'' + type + '\')" /></div><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_value' + j + '" value="' + w_attr_value + '" onChange="change_attribute_value(' + i + ', ' + j + ', \'' + type + '\')" /></div><div class="fm-table-col"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_choices' + j + '_remove" onClick="remove_attr(' + j + ', ' + i + ', \'' + type + '\')"></span></div></div>');
@@ -3775,7 +3775,7 @@ function change_hidden_input_value(element_value, date_fields, id_int, id) {
3775
  jQuery("#" + id_int + "_elementform_id_temp").datepicker("setDate", new Date());
3776
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
3777
  if (element_value !== "")
3778
- element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").prop('format'), new Date(element_value));
3779
  jQuery("#" + id_int + "_elementform_id_temp").datepicker("setDate", element_value);
3780
  }
3781
  else {
@@ -3787,7 +3787,7 @@ function change_hidden_input_value(element_value, date_fields, id_int, id) {
3787
  jQuery("#" + id_int + "_elementform_id_temp").datepicker('option', date_fields, new Date());
3788
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
3789
  if (element_value !== "")
3790
- element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").prop('format'), new Date(element_value));
3791
  jQuery("#" + id_int + "_elementform_id_temp").datepicker('option', date_fields, element_value);
3792
  }
3793
  else
@@ -3820,13 +3820,13 @@ function change_hidden_input_value(element_value, date_fields, id_int, id) {
3820
  invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy", d));
3821
  }
3822
  });
3823
- var w_hide_sunday = jQuery("#" + id_int + "_show_week_days").prop('sunday') == 'yes' ? 'true' : 'day != 0';
3824
- var w_hide_monday = jQuery("#" + id_int + "_show_week_days").prop('monday') == 'yes' ? 'true' : 'day != 1';
3825
- var w_hide_tuesday = jQuery("#" + id_int + "_show_week_days").prop('tuesday') == 'yes' ? 'true' : 'day != 2';
3826
- var w_hide_wednesday = jQuery("#" + id_int + "_show_week_days").prop('wednesday') == 'yes' ? 'true' : 'day != 3';
3827
- var w_hide_thursday = jQuery("#" + id_int + "_show_week_days").prop('thursday') == 'yes' ? 'true' : 'day != 4';
3828
- var w_hide_friday = jQuery("#" + id_int + "_show_week_days").prop('friday') == 'yes' ? 'true' : 'day != 5';
3829
- var w_hide_saturday = jQuery("#" + id_int + "_show_week_days").prop('saturday') == 'yes' ? 'true' : 'day != 6';
3830
 
3831
  var day = date.getDay();
3832
  var string_days = jQuery.datepicker.formatDate("mm/dd/yy", date);
@@ -4352,24 +4352,24 @@ function refresh_sel_options(id, type) {
4352
  if (type == 'checkbox' || type == 'radio') {
4353
  if (jQuery('#el_disable_value').prop('checked')) {
4354
  jQuery('#' + id + '_value_disabledform_id_temp').val('yes');
4355
- jQuery('.el_option_value').removeAttr('disabled');
4356
  }
4357
  else {
4358
  jQuery('#' + id + '_value_disabledform_id_temp').val('no');
4359
- jQuery('.el_option_value').prop('disabled', 'disabled');
4360
  }
4361
  refresh_rowcol(id, type);
4362
  }
4363
  if (type == 'select') {
4364
  if (jQuery('#el_disable_value').prop('checked')) {
4365
  jQuery('#' + id + '_value_disabledform_id_temp').val('yes');
4366
- jQuery('.el_option_value').removeAttr('disabled');
4367
- jQuery('.el_option_dis').prop('disabled', 'disabled');
4368
  }
4369
  else {
4370
  jQuery('#' + id + '_value_disabledform_id_temp').val('no');
4371
- jQuery('.el_option_value').prop('disabled', 'disabled');
4372
- jQuery('.el_option_dis').removeAttr('disabled');
4373
  }
4374
  var select = document.getElementById(id + '_elementform_id_temp');
4375
  select.innerHTML = '';
@@ -4401,10 +4401,10 @@ function refresh_sel_options(id, type) {
4401
  });
4402
  }
4403
  if ( form_maker.is_demo ) {
4404
- jQuery('#el_choices_add').next().prop("onclick", "alert('This feature is disabled in demo.')");
4405
  }
4406
  else {
4407
- jQuery('#el_choices_add').next().prop("onclick", "tb_show('', 'admin-ajax.php?action=select_data_from_db&field_id=" + id + "&nonce=" + fm_ajax.ajaxnonce + "&field_type=" + type + "&value_disabled=" + jQuery("#" + id + "_value_disabledform_id_temp").val() + "&width=530&height=370&TB_iframe=1');return false;");
4408
  }
4409
  }
4410
 
@@ -4512,7 +4512,7 @@ function add_choise(type, num) {
4512
  function change_label_name(num, id, label, type) {
4513
  jQuery('#' + id).html(label);
4514
  if (!jQuery('#el_disable_value').prop('checked')) {
4515
- if (!jQuery('#el_choices' + num).prop('other')) {
4516
  jQuery('#el_option_value' + num).val(label);
4517
  }
4518
  if (type == 'select') {
@@ -4526,7 +4526,7 @@ function change_label_name_on_paste(num, id, label, type) {
4526
  label = elem.value;
4527
  jQuery('#' + id).html(label);
4528
  if (!jQuery('#el_disable_value').prop('checked')) {
4529
- if (!jQuery('#el_choices' + num).prop('other')) {
4530
  jQuery('#el_option_value' + num).val(label);
4531
  }
4532
  if (type == 'select') {
@@ -4800,13 +4800,13 @@ function refresh_rowcol(num, type) {
4800
  var adding = document.createElement('input');
4801
  adding.setAttribute("type", type);
4802
  adding.setAttribute("id", num + "_elementform_id_temp" + index);
4803
- if ( jQuery("#"+num + "_elementform_id_temp" + index).prop("checked") == "checked" )
4804
  adding.setAttribute("checked", "checked");
4805
  if (document.getElementById(num + "_option_left_right").value == "right")
4806
  adding.style.cssText = "float: left !important";
4807
  if (type == 'checkbox') {
4808
  adding.setAttribute("name", num + "_elementform_id_temp" + index);
4809
- if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).prop("other") == '1') {
4810
  adding.setAttribute("value", "");
4811
  adding.setAttribute("other", "1");
4812
  adding.setAttribute("onclick", "if(set_checked('" + num + "','" + index + "','form_id_temp')) show_other_input('" + num + "','form_id_temp');");
@@ -4822,7 +4822,7 @@ function refresh_rowcol(num, type) {
4822
  }
4823
  if (type == 'radio') {
4824
  adding.setAttribute("name", num + "_elementform_id_temp");
4825
- if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).prop("other") == '1') {
4826
  adding.setAttribute("value", "");
4827
  adding.setAttribute("other", "1");
4828
  adding.setAttribute("onClick", "set_default('" + num + "','" + index + "','form_id_temp'); show_other_input('" + num + "','form_id_temp');");
@@ -4877,13 +4877,13 @@ function refresh_rowcol(num, type) {
4877
  var adding = document.createElement('input');
4878
  adding.setAttribute("type", type);
4879
  adding.setAttribute("id", num + "_elementform_id_temp" + index);
4880
- if ( jQuery("#"+num + "_elementform_id_temp" + index).prop("checked") == "checked" )
4881
  adding.setAttribute("checked", "checked");
4882
  if (document.getElementById(num + "_option_left_right").value == "right")
4883
  adding.style.cssText = "float: left !important";
4884
  if (type == 'checkbox') {
4885
  adding.setAttribute("name", num + "_elementform_id_temp" + index);
4886
- if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).prop('other') == '1') {
4887
  adding.setAttribute("value", "");
4888
  adding.setAttribute("other", "1");
4889
  adding.setAttribute("onclick", "if(set_checked('" + num + "','" + index + "','form_id_temp')) show_other_input('" + num + "','form_id_temp');");
@@ -4898,7 +4898,7 @@ function refresh_rowcol(num, type) {
4898
  }
4899
  if (type == 'radio') {
4900
  adding.setAttribute("name", num + "_elementform_id_temp");
4901
- if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).prop('other') == '1') {
4902
  adding.setAttribute("other", "1");
4903
  adding.setAttribute("onClick", "set_default('" + num + "','" + index + "','form_id_temp'); show_other_input('" + num + "','form_id_temp')");
4904
  }
@@ -5504,7 +5504,7 @@ function create_recaptcha_invisible(i, w_type) {
5504
  }
5505
 
5506
  function fm_recaptcha_type(id, value) {
5507
- jQuery('#wd_recaptchaform_id_temp').prop('w_type', value);
5508
  if (value == 'invisible') {
5509
  jQuery('#recaptcha_position').show();
5510
  jQuery('#recaptcha_keys_message').show();
@@ -5512,7 +5512,7 @@ function fm_recaptcha_type(id, value) {
5512
  jQuery('#recaptcha_score').hide();
5513
 
5514
  jQuery('#'+ id + '_hide_labelform_id_temp').val('no');
5515
- jQuery('#el_hide_label').prop('checked', 'checked');
5516
  hide_label(id);
5517
  } else if(value == 'v3') {
5518
  jQuery('#recaptcha_score').show();
@@ -5521,7 +5521,7 @@ function fm_recaptcha_type(id, value) {
5521
  jQuery('#recaptcha_position').hide();
5522
 
5523
  jQuery('#'+ id + '_hide_labelform_id_temp').val('no');
5524
- jQuery('#el_hide_label').prop('checked', 'checked');
5525
  hide_label(id);
5526
  } else {
5527
  jQuery('#recaptcha_position').hide();
@@ -5562,7 +5562,7 @@ function create_recaptcha_position(i, w_position, w_type) {
5562
  }
5563
 
5564
  function fm_recaptcha_position(id, value) {
5565
- jQuery('#wd_recaptchaform_id_temp').prop('position', value);
5566
  }
5567
 
5568
  function go_to_type_recaptcha(new_id) {
@@ -10942,7 +10942,7 @@ function change_hidden_input_value_range(element_value, date_fields, start_end,
10942
  }
10943
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
10944
  if (element_value !== "") {
10945
- element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").prop('format'), new Date(element_value));
10946
  jQuery("#" + id_int + "_elementform_id_temp0").datepicker("setDate", element_value);
10947
  jQuery("#" + id_int + "_elementform_id_temp1").datepicker('option', 'minDate', element_value);
10948
  }
@@ -10965,7 +10965,7 @@ function change_hidden_input_value_range(element_value, date_fields, start_end,
10965
  }
10966
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
10967
  if (element_value !== "") {
10968
- element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").prop('format'), new Date(element_value));
10969
  jQuery("#" + id_int + "_elementform_id_temp1").datepicker("setDate", element_value);
10970
  jQuery("#" + id_int + "_elementform_id_temp0").datepicker('option', 'maxDate', new Date(element_value));
10971
  }
@@ -11010,7 +11010,7 @@ function change_hidden_input_value_range(element_value, date_fields, start_end,
11010
  }
11011
  else {
11012
  if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("w") == -1 && element_value.indexOf("y") == -1 && element_value !== "") {
11013
- element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").prop('format'), new Date(element_value));
11014
  }
11015
  if ((date_fields == "minDate" && jQuery("#default_date_start").val() == "") || (date_fields == "maxDate" && jQuery("#default_date_end").val() == "")) {
11016
  jQuery("#" + id_int + "_elementform_id_temp0").datepicker('option', date_fields, element_value);
@@ -11064,13 +11064,13 @@ function change_hidden_input_value_range(element_value, date_fields, start_end,
11064
  }
11065
  });
11066
 
11067
- var w_hide_sunday = jQuery("#" + id_int + "_show_week_days").prop('sunday') == 'yes' ? 'true' : 'day != 0';
11068
- var w_hide_monday = jQuery("#" + id_int + "_show_week_days").prop('monday') == 'yes' ? 'true' : 'day != 1';
11069
- var w_hide_tuesday = jQuery("#" + id_int + "_show_week_days").prop('tuesday') == 'yes' ? 'true' : 'day != 2';
11070
- var w_hide_wednesday = jQuery("#" + id_int + "_show_week_days").prop('wednesday') == 'yes' ? 'true' : 'day != 3';
11071
- var w_hide_thursday = jQuery("#" + id_int + "_show_week_days").prop('thursday') == 'yes' ? 'true' : 'day != 4';
11072
- var w_hide_friday = jQuery("#" + id_int + "_show_week_days").prop('friday') == 'yes' ? 'true' : 'day != 5';
11073
- var w_hide_saturday = jQuery("#" + id_int + "_show_week_days").prop('saturday') == 'yes' ? 'true' : 'day != 6';
11074
  var day = date.getDay();
11075
  var string_days = jQuery.datepicker.formatDate("mm/dd/yy", date);
11076
  return [invalid_dates_finish.indexOf(string_days) == -1 && eval(w_hide_sunday) && eval(w_hide_monday) && eval(w_hide_tuesday) && eval(w_hide_wednesday) && eval(w_hide_thursday) && eval(w_hide_friday) && eval(w_hide_saturday)];
@@ -14683,7 +14683,7 @@ function refresh_page_numbers() {
14683
  var pages = jQuery('.wdform-page-and-images');
14684
  var show_numbers = document.getElementById('pages').getAttribute('show_numbers') == 'true';
14685
  pages.each(function(index){
14686
- var id = jQuery(this).find('.form_id_tempform_view_img').prop('id').split("form_id_tempform_view_img");
14687
  j = id[1];
14688
  if (document.getElementById('page_numbersform_id_temp' + j)) {
14689
  document.getElementById("page_numbersform_id_temp" + j).innerHTML = '';
@@ -16139,8 +16139,8 @@ function gen_form_fields() {
16139
  w_choices[tt] = jQuery(this).html();
16140
  w_choices_value[tt] = jQuery(this).val();
16141
  w_choices_checked[tt] = jQuery(this)[0].selected;
16142
- if (jQuery(this).prop('where'))
16143
- w_choices_params[tt] = jQuery(this).prop('where') + '[where_order_by]' + jQuery(this).prop('order_by') + '[db_info]' + jQuery(this).prop('db_info');
16144
  else
16145
  w_choices_params[tt] = '';
16146
 
@@ -16185,8 +16185,8 @@ function gen_form_fields() {
16185
  w_choices[tt] = jQuery(this).html();
16186
  w_choices_price[tt] = jQuery(this).val();
16187
  w_choices_checked[tt] = jQuery(this)[0].selected;
16188
- if (jQuery(this).prop('where'))
16189
- w_choices_params[tt] = jQuery(this).prop('where') + '[where_order_by]' + jQuery(this).prop('order_by') + '[db_info]' + jQuery(this).prop('db_info');
16190
  else
16191
  w_choices_params[tt] = '';
16192
 
1121
  w_choices[t] = jQuery(this).html();
1122
  w_choices_value[t] = jQuery(this).val();
1123
  w_choices_checked[t] = jQuery(this)[0].selected;
1124
+ if (jQuery(this).attr('where')) {
1125
+ w_choices_params[t] = jQuery(this).attr('where') + '[where_order_by]' + jQuery(this).attr('order_by') + '[db_info]' + jQuery(this).attr('db_info');
1126
  }
1127
  else {
1128
  w_choices_params[t] = '';
1148
  w_choices[t] = jQuery(this).html();
1149
  w_choices_price[t] = jQuery(this).val();
1150
  w_choices_checked[t] = jQuery(this)[0].selected;
1151
+ if (jQuery(this).attr('where')) {
1152
+ w_choices_params[t] = jQuery(this).attr('where') + '[where_order_by]' + jQuery(this).attr('order_by') + '[db_info]' + jQuery(this).attr('db_info');
1153
  }
1154
  else {
1155
  w_choices_params[t] = '';
2055
  if( typeof nextID === 'undefined' || nextID === null || nextID == "" || get_child_count() > 2) { // when add field button submitted not moved
2056
  return;
2057
  }
2058
+ var str = jQuery("#cur_column").parent().parent().attr("id");
2059
  var endPoint = parseInt(str.substr(str.indexOf("form_id_tempform_view") + 21)); // break conteiner number
2060
 
2061
  if ( form_view_max == 2 ) { // if break first time
2161
  if (need_enable) {
2162
  popup_ready();
2163
  /* In Firfox and Safari click action is working during the drag and drop also */
2164
+ /*jQuery(".add-new-button").attr("onclick","popup_ready(); Enable(); return false;");*/
2165
  }
2166
  need_enable = true;
2167
  document.getElementById('edit_table').innerHTML = "";
2205
 
2206
  function fm_add_field_button(that, subtype) {
2207
  if (jQuery(that).hasClass('wd-pro-fields') && subtype != 'stripe') {
2208
+ jQuery('#edit_main_table input').prop('disabled', true);
2209
+ jQuery('#edit_main_table textarea').prop('disabled', true);
2210
+ jQuery('#edit_main_table .fm-input-container span.dashicons').attr('onclick', '');
2211
  jQuery('#add-button-cont').removeClass('add-button-cont').html('');
2212
  jQuery('#premium_message').removeClass('fm-hidden');
2213
  jQuery('#stripe_message').addClass('fm-hidden');
2215
  }
2216
  else {
2217
  if (subtype == 'stripe' && (is_addon_stripe_active == 0 || is_stripe_enabled == 0)) {
2218
+ jQuery('#edit_main_table input').prop('disabled', true);
2219
+ jQuery('#edit_main_table textarea').prop('disabled', true);
2220
+ jQuery('#edit_main_table .fm-input-container span.dashicons').attr('onclick', '');
2221
  if (!jQuery(that).hasClass('wd-pro-fields') && is_stripe_enabled == 0 && is_addon_stripe_active == 1) {
2222
  jQuery('#add-button-cont').removeClass('add-button-cont').html('<div class="error"><p>' + form_maker.stripe3 + '</p></div>');
2223
  jQuery( '#premium_message' ).addClass( 'fm-hidden' );
2711
  function add_attr(i, type) {
2712
  var el_attr_table = jQuery('#attributes');
2713
  el_attr_table.show();
2714
+ j = parseInt(el_attr_table.children().last().attr('idi')) + 1;
2715
  w_attr_name = "attribute";
2716
  w_attr_value = "value";
2717
  var attr = jQuery('<div idi="' + j + '" id="attr_row_' + j + '" class="fm-width-100"><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_name' + j + '" value="' + w_attr_name + '" onChange="change_attribute_name(\'' + i + '\', this, \'' + type + '\')" /></div><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_value' + j + '" value="' + w_attr_value + '" onChange="change_attribute_value(' + i + ', ' + j + ', \'' + type + '\')" /></div><div class="fm-table-col"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_choices' + j + '_remove" onClick="remove_attr(' + j + ', ' + i + ', \'' + type + '\')"></span></div></div>');
3775
  jQuery("#" + id_int + "_elementform_id_temp").datepicker("setDate", new Date());
3776
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
3777
  if (element_value !== "")
3778
+ element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").attr('format'), new Date(element_value));
3779
  jQuery("#" + id_int + "_elementform_id_temp").datepicker("setDate", element_value);
3780
  }
3781
  else {
3787
  jQuery("#" + id_int + "_elementform_id_temp").datepicker('option', date_fields, new Date());
3788
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
3789
  if (element_value !== "")
3790
+ element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").attr('format'), new Date(element_value));
3791
  jQuery("#" + id_int + "_elementform_id_temp").datepicker('option', date_fields, element_value);
3792
  }
3793
  else
3820
  invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy", d));
3821
  }
3822
  });
3823
+ var w_hide_sunday = jQuery("#" + id_int + "_show_week_days").attr('sunday') == 'yes' ? 'true' : 'day != 0';
3824
+ var w_hide_monday = jQuery("#" + id_int + "_show_week_days").attr('monday') == 'yes' ? 'true' : 'day != 1';
3825
+ var w_hide_tuesday = jQuery("#" + id_int + "_show_week_days").attr('tuesday') == 'yes' ? 'true' : 'day != 2';
3826
+ var w_hide_wednesday = jQuery("#" + id_int + "_show_week_days").attr('wednesday') == 'yes' ? 'true' : 'day != 3';
3827
+ var w_hide_thursday = jQuery("#" + id_int + "_show_week_days").attr('thursday') == 'yes' ? 'true' : 'day != 4';
3828
+ var w_hide_friday = jQuery("#" + id_int + "_show_week_days").attr('friday') == 'yes' ? 'true' : 'day != 5';
3829
+ var w_hide_saturday = jQuery("#" + id_int + "_show_week_days").attr('saturday') == 'yes' ? 'true' : 'day != 6';
3830
 
3831
  var day = date.getDay();
3832
  var string_days = jQuery.datepicker.formatDate("mm/dd/yy", date);
4352
  if (type == 'checkbox' || type == 'radio') {
4353
  if (jQuery('#el_disable_value').prop('checked')) {
4354
  jQuery('#' + id + '_value_disabledform_id_temp').val('yes');
4355
+ jQuery('.el_option_value').prop('disabled', false);
4356
  }
4357
  else {
4358
  jQuery('#' + id + '_value_disabledform_id_temp').val('no');
4359
+ jQuery('.el_option_value').prop('disabled', true);
4360
  }
4361
  refresh_rowcol(id, type);
4362
  }
4363
  if (type == 'select') {
4364
  if (jQuery('#el_disable_value').prop('checked')) {
4365
  jQuery('#' + id + '_value_disabledform_id_temp').val('yes');
4366
+ jQuery('.el_option_value').prop('disabled', false);
4367
+ jQuery('.el_option_dis').prop('disabled', true);
4368
  }
4369
  else {
4370
  jQuery('#' + id + '_value_disabledform_id_temp').val('no');
4371
+ jQuery('.el_option_value').prop('disabled', true);
4372
+ jQuery('.el_option_dis').prop('disabled', false);
4373
  }
4374
  var select = document.getElementById(id + '_elementform_id_temp');
4375
  select.innerHTML = '';
4401
  });
4402
  }
4403
  if ( form_maker.is_demo ) {
4404
+ jQuery('#el_choices_add').next().attr("onclick", "alert('This feature is disabled in demo.')");
4405
  }
4406
  else {
4407
+ jQuery('#el_choices_add').next().attr("onclick", "tb_show('', 'admin-ajax.php?action=select_data_from_db&field_id=" + id + "&nonce=" + fm_ajax.ajaxnonce + "&field_type=" + type + "&value_disabled=" + jQuery("#" + id + "_value_disabledform_id_temp").val() + "&width=530&height=370&TB_iframe=1');return false;");
4408
  }
4409
  }
4410
 
4512
  function change_label_name(num, id, label, type) {
4513
  jQuery('#' + id).html(label);
4514
  if (!jQuery('#el_disable_value').prop('checked')) {
4515
+ if (!jQuery('#el_choices' + num).attr('other')) {
4516
  jQuery('#el_option_value' + num).val(label);
4517
  }
4518
  if (type == 'select') {
4526
  label = elem.value;
4527
  jQuery('#' + id).html(label);
4528
  if (!jQuery('#el_disable_value').prop('checked')) {
4529
+ if (!jQuery('#el_choices' + num).attr('other')) {
4530
  jQuery('#el_option_value' + num).val(label);
4531
  }
4532
  if (type == 'select') {
4800
  var adding = document.createElement('input');
4801
  adding.setAttribute("type", type);
4802
  adding.setAttribute("id", num + "_elementform_id_temp" + index);
4803
+ if ( jQuery("#"+num + "_elementform_id_temp" + index).prop("checked") )
4804
  adding.setAttribute("checked", "checked");
4805
  if (document.getElementById(num + "_option_left_right").value == "right")
4806
  adding.style.cssText = "float: left !important";
4807
  if (type == 'checkbox') {
4808
  adding.setAttribute("name", num + "_elementform_id_temp" + index);
4809
+ if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).attr("other") == '1') {
4810
  adding.setAttribute("value", "");
4811
  adding.setAttribute("other", "1");
4812
  adding.setAttribute("onclick", "if(set_checked('" + num + "','" + index + "','form_id_temp')) show_other_input('" + num + "','form_id_temp');");
4822
  }
4823
  if (type == 'radio') {
4824
  adding.setAttribute("name", num + "_elementform_id_temp");
4825
+ if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).attr("other") == '1') {
4826
  adding.setAttribute("value", "");
4827
  adding.setAttribute("other", "1");
4828
  adding.setAttribute("onClick", "set_default('" + num + "','" + index + "','form_id_temp'); show_other_input('" + num + "','form_id_temp');");
4877
  var adding = document.createElement('input');
4878
  adding.setAttribute("type", type);
4879
  adding.setAttribute("id", num + "_elementform_id_temp" + index);
4880
+ if ( jQuery("#"+num + "_elementform_id_temp" + index).prop("checked") )
4881
  adding.setAttribute("checked", "checked");
4882
  if (document.getElementById(num + "_option_left_right").value == "right")
4883
  adding.style.cssText = "float: left !important";
4884
  if (type == 'checkbox') {
4885
  adding.setAttribute("name", num + "_elementform_id_temp" + index);
4886
+ if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).attr('other') == '1') {
4887
  adding.setAttribute("value", "");
4888
  adding.setAttribute("other", "1");
4889
  adding.setAttribute("onclick", "if(set_checked('" + num + "','" + index + "','form_id_temp')) show_other_input('" + num + "','form_id_temp');");
4898
  }
4899
  if (type == 'radio') {
4900
  adding.setAttribute("name", num + "_elementform_id_temp");
4901
+ if (document.getElementById(num + "_allow_otherform_id_temp").value == "yes" && jQuery(this).find('#el_choices' + index).attr('other') == '1') {
4902
  adding.setAttribute("other", "1");
4903
  adding.setAttribute("onClick", "set_default('" + num + "','" + index + "','form_id_temp'); show_other_input('" + num + "','form_id_temp')");
4904
  }
5504
  }
5505
 
5506
  function fm_recaptcha_type(id, value) {
5507
+ jQuery('#wd_recaptchaform_id_temp').attr('w_type', value);
5508
  if (value == 'invisible') {
5509
  jQuery('#recaptcha_position').show();
5510
  jQuery('#recaptcha_keys_message').show();
5512
  jQuery('#recaptcha_score').hide();
5513
 
5514
  jQuery('#'+ id + '_hide_labelform_id_temp').val('no');
5515
+ jQuery('#el_hide_label').prop('checked', true);
5516
  hide_label(id);
5517
  } else if(value == 'v3') {
5518
  jQuery('#recaptcha_score').show();
5521
  jQuery('#recaptcha_position').hide();
5522
 
5523
  jQuery('#'+ id + '_hide_labelform_id_temp').val('no');
5524
+ jQuery('#el_hide_label').prop('checked', true);
5525
  hide_label(id);
5526
  } else {
5527
  jQuery('#recaptcha_position').hide();
5562
  }
5563
 
5564
  function fm_recaptcha_position(id, value) {
5565
+ jQuery('#wd_recaptchaform_id_temp').attr('position', value);
5566
  }
5567
 
5568
  function go_to_type_recaptcha(new_id) {
10942
  }
10943
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
10944
  if (element_value !== "") {
10945
+ element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").attr('format'), new Date(element_value));
10946
  jQuery("#" + id_int + "_elementform_id_temp0").datepicker("setDate", element_value);
10947
  jQuery("#" + id_int + "_elementform_id_temp1").datepicker('option', 'minDate', element_value);
10948
  }
10965
  }
10966
  else if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("y") == -1 && element_value.indexOf("w") == -1) {
10967
  if (element_value !== "") {
10968
+ element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").attr('format'), new Date(element_value));
10969
  jQuery("#" + id_int + "_elementform_id_temp1").datepicker("setDate", element_value);
10970
  jQuery("#" + id_int + "_elementform_id_temp0").datepicker('option', 'maxDate', new Date(element_value));
10971
  }
11010
  }
11011
  else {
11012
  if (element_value.indexOf("d") == -1 && element_value.indexOf("m") == -1 && element_value.indexOf("w") == -1 && element_value.indexOf("y") == -1 && element_value !== "") {
11013
+ element_value = jQuery.datepicker.formatDate(jQuery("#" + id_int + "_buttonform_id_temp").attr('format'), new Date(element_value));
11014
  }
11015
  if ((date_fields == "minDate" && jQuery("#default_date_start").val() == "") || (date_fields == "maxDate" && jQuery("#default_date_end").val() == "")) {
11016
  jQuery("#" + id_int + "_elementform_id_temp0").datepicker('option', date_fields, element_value);
11064
  }
11065
  });
11066
 
11067
+ var w_hide_sunday = jQuery("#" + id_int + "_show_week_days").attr('sunday') == 'yes' ? 'true' : 'day != 0';
11068
+ var w_hide_monday = jQuery("#" + id_int + "_show_week_days").attr('monday') == 'yes' ? 'true' : 'day != 1';
11069
+ var w_hide_tuesday = jQuery("#" + id_int + "_show_week_days").attr('tuesday') == 'yes' ? 'true' : 'day != 2';
11070
+ var w_hide_wednesday = jQuery("#" + id_int + "_show_week_days").attr('wednesday') == 'yes' ? 'true' : 'day != 3';
11071
+ var w_hide_thursday = jQuery("#" + id_int + "_show_week_days").attr('thursday') == 'yes' ? 'true' : 'day != 4';
11072
+ var w_hide_friday = jQuery("#" + id_int + "_show_week_days").attr('friday') == 'yes' ? 'true' : 'day != 5';
11073
+ var w_hide_saturday = jQuery("#" + id_int + "_show_week_days").attr('saturday') == 'yes' ? 'true' : 'day != 6';
11074
  var day = date.getDay();
11075
  var string_days = jQuery.datepicker.formatDate("mm/dd/yy", date);
11076
  return [invalid_dates_finish.indexOf(string_days) == -1 && eval(w_hide_sunday) && eval(w_hide_monday) && eval(w_hide_tuesday) && eval(w_hide_wednesday) && eval(w_hide_thursday) && eval(w_hide_friday) && eval(w_hide_saturday)];
14683
  var pages = jQuery('.wdform-page-and-images');
14684
  var show_numbers = document.getElementById('pages').getAttribute('show_numbers') == 'true';
14685
  pages.each(function(index){
14686
+ var id = jQuery(this).find('.form_id_tempform_view_img').attr('id').split("form_id_tempform_view_img");
14687
  j = id[1];
14688
  if (document.getElementById('page_numbersform_id_temp' + j)) {
14689
  document.getElementById("page_numbersform_id_temp" + j).innerHTML = '';
16139
  w_choices[tt] = jQuery(this).html();
16140
  w_choices_value[tt] = jQuery(this).val();
16141
  w_choices_checked[tt] = jQuery(this)[0].selected;
16142
+ if (jQuery(this).attr('where'))
16143
+ w_choices_params[tt] = jQuery(this).attr('where') + '[where_order_by]' + jQuery(this).attr('order_by') + '[db_info]' + jQuery(this).attr('db_info');
16144
  else
16145
  w_choices_params[tt] = '';
16146
 
16185
  w_choices[tt] = jQuery(this).html();
16186
  w_choices_price[tt] = jQuery(this).val();
16187
  w_choices_checked[tt] = jQuery(this)[0].selected;
16188
+ if (jQuery(this).attr('where'))
16189
+ w_choices_params[tt] = jQuery(this).attr('where') + '[where_order_by]' + jQuery(this).attr('order_by') + '[db_info]' + jQuery(this).attr('db_info');
16190
  else
16191
  w_choices_params[tt] = '';
16192
 
js/form_maker_submissions.js CHANGED
@@ -187,7 +187,7 @@ function set_columns_history_checked() {
187
  if ( getFormLocalStorage().show_hide_column_ids ) {
188
  var show_hide_column_ids = getFormLocalStorage().show_hide_column_ids;
189
  var checkboxs = jQuery('#ChBDiv input[type=checkbox]');
190
- checkboxs.filter(':checkbox').removeAttr('checked');
191
  var ChBAll = document.getElementById('ChBAll');
192
  if ( checkboxs.length != show_hide_column_ids.length ) {
193
  jQuery('#ChBAll').addClass('fm-remove_before');
187
  if ( getFormLocalStorage().show_hide_column_ids ) {
188
  var show_hide_column_ids = getFormLocalStorage().show_hide_column_ids;
189
  var checkboxs = jQuery('#ChBDiv input[type=checkbox]');
190
+ checkboxs.filter(':checkbox').prop('checked', false);
191
  var ChBAll = document.getElementById('ChBAll');
192
  if ( checkboxs.length != show_hide_column_ids.length ) {
193
  jQuery('#ChBAll').addClass('fm-remove_before');
js/main_div_front_end.js CHANGED
@@ -920,7 +920,7 @@ jQuery(document).on('click','.sel-option', function() {
920
  jQuery(this).addClass('sel-ed');
921
  var tekval = jQuery(this).attr('value');
922
  tekval = typeof(tekval) != 'undefined' ? tekval : tektext;
923
- jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').children('option').removeAttr('selected').each(function() {
924
  if (jQuery(this).html() == tektext) {
925
  jQuery(this).attr('selected', 'select');
926
  }
@@ -1855,7 +1855,7 @@ function fm_submit(form_id) {
1855
  window.location.replace(after_submit_redirect_url);
1856
  return;
1857
  }
1858
- jQuery("#form" + form_id + " .button-submit").removeAttr("disabled");
1859
  jQuery('#form'+form_id+' .fm-submit-loading').hide();
1860
 
1861
  var result = jQuery(response).find('#form'+form_id).html();
@@ -2371,10 +2371,10 @@ function fm_privacy_policy_check(that) {
2371
  var element = jQuery(that);
2372
  var button = element.parents('.wdform_row').find('.button-submit');
2373
  if (element.is(':checked')) {
2374
- button.removeAttr('disabled');
2375
  }
2376
  else {
2377
- button.attr('disabled', 'disabled');
2378
  }
2379
  }
2380
  function fm_html_entities(str) {
920
  jQuery(this).addClass('sel-ed');
921
  var tekval = jQuery(this).attr('value');
922
  tekval = typeof(tekval) != 'undefined' ? tekval : tektext;
923
+ jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').children('option').prop('selected', false).each(function() {
924
  if (jQuery(this).html() == tektext) {
925
  jQuery(this).attr('selected', 'select');
926
  }
1855
  window.location.replace(after_submit_redirect_url);
1856
  return;
1857
  }
1858
+ jQuery("#form" + form_id + " .button-submit").prop("disabled", false);
1859
  jQuery('#form'+form_id+' .fm-submit-loading').hide();
1860
 
1861
  var result = jQuery(response).find('#form'+form_id).html();
2371
  var element = jQuery(that);
2372
  var button = element.parents('.wdform_row').find('.button-submit');
2373
  if (element.is(':checked')) {
2374
+ button.prop('disabled', false);
2375
  }
2376
  else {
2377
+ button.prop('disabled', true);
2378
  }
2379
  }
2380
  function fm_html_entities(str) {
js/manage-edit-scripts.min.js CHANGED
@@ -1 +1 @@
1
- function fm_admin_ready(){jQuery(".wd-header a").on("click",function(){jQuery("input[name='task']").val("add"),jQuery(this).parents("form").submit()}),set_no_items(),jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))}),jQuery(".hndle:not(.readonly), .handlediv").each(function(){jQuery(this).off("click").on("click",function(){fm_toggle_postbox(this)})}),jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function(){jQuery(this).attr("title",form_maker.add_placeholder)}),jQuery(document).on("click",".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view",function(){fm_placeholders_popup(jQuery(this).data("id"))}),fm_disabled_uninstall_btn(),jQuery(".fm-uninstall-form #check_yes").on("click",function(){fm_disabled_uninstall_btn()}),void 0!==jQuery(document).tooltip&&jQuery(document).tooltip({show:null,items:".wd-info",content:function(){if(jQuery(this).is(".wd-info"))return jQuery("#"+jQuery(this).data("id")).html()},open:function(e,t){if(void 0===e.originalEvent)return!1;var i=jQuery(t.tooltip).attr("id");jQuery("div.ui-tooltip").not("#"+i).remove()},close:function(e,t){t.tooltip.hover(function(){jQuery(this).stop(!0).fadeTo(400,1)},function(){jQuery(this).fadeOut("400",function(){jQuery(this).remove()})})},position:{my:"center top+30",at:"center top",using:function(e,t){jQuery(this).css(e),jQuery("<div>").addClass("tooltip-arrow").addClass(t.vertical).addClass(t.horizontal).appendTo(this)}}})}function wd_insert_placeholder(e,t){var i=document.getElementById(e);if("undefined"==typeof tinyMCE||(tinyMCE.get(e)&&tinyMCE.get(e).focus(),"none"!=i.style.display))if(i.focus(),document.selection)sel=document.selection.createRange(),sel.text=t;else if(i.selectionStart||"0"==i.selectionStart){var a=i.selectionStart,n=i.selectionEnd;i.value=i.value.substring(0,a)+"{"+t+"}"+i.value.substring(n,i.value.length)}else i.value+="{"+t+"}";else tinyMCE.execCommand("mceInsertContent",!1,"{"+t+"}")}function fm_toggle_postbox(e){jQuery(e).parent(".postbox").toggleClass("closed")}function fm_option_tabs_mail_validation(){return!0}function fm_clear_input_value(e){jQuery("#"+e).val("")}function set_no_items(){jQuery(".colspanchange").attr("colspan",jQuery(".wd-form table.adminlist>thead>tr>th:visible").length+jQuery(".wd-form table.adminlist>thead>tr>td:visible").length)}function search(e){var t=jQuery(e).parents("form");t.attr("action",t.attr("action")+"&paged=1&s="+jQuery("input[name='s']").val()),t.submit()}function input_search(e,t){return 13==(e.keyCode?e.keyCode:e.which)&&search(t),!0}function input_pagination(e,t){if(13==(e.keyCode?e.keyCode:e.which)){var i=jQuery(t).parents("form"),a=jQuery(t).val();if(a<=jQuery(t).parents(".pagination-links").data("pages-count")&&0<a){var n=new RegExp("&nonce_fm="+nonce_fm,"g"),l=i.attr("action").replace(n,"").replace(/&paged=(\d+)/,"")+"&paged="+a;i.attr("action",l),location.href=l}}return!0}function fm_select_value(e){e.focus(),e.select()}function fm_doNothing(e){13==(e.keyCode?e.keyCode:e.which?e.which:e.charCode)&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}function wd_bulk_action(e){var t=jQuery("select[name='bulk_action']").val();if(-1!=t){if(!jQuery("input[name^='check']").is(":checked"))return void alert(form_maker.select_at_least_one_item);if("delete"==t&&!confirm(form_maker.delete_confirmation))return!1;jQuery("input[name='task']").val(t),jQuery(e).parents("form").submit()}}function fm_ajax_save(e){var t=jQuery("#"+e).action,i=jQuery("#search_value").val(),a=jQuery("#current_id").val(),n=jQuery("#page_number").val(),l=(jQuery("#search_or_not").val(),jQuery("#ids_string").val()),d=jQuery("#image_order_by").val(),_=jQuery("#asc_or_desc").val(),r=jQuery("#ajax_task").val(),o=jQuery("#image_current_id").val();return ids_array=l.split(","),jQuery.ajax({type:"POST",url:t,data:{search_value:i,current_id:a,page_number:n,image_order_by:d,asc_or_desc:_,ids_string:l,task:"ajax_search",ajax_task:r,image_current_id:o,nonce:fm_ajax.ajaxnonce},success:function(e){var t=jQuery(e).find("#images_table").html();jQuery("#images_table").html(t);t=jQuery(e).find("#tablenav-pages").html();jQuery("#tablenav-pages").html(t),jQuery("#show_hide_weights").val("Hide order column"),fm_show_hide_weights(),fm_run_checkbox()}}),!1}function fm_run_checkbox(){jQuery("tbody").children().children(".check-column").find(":checkbox").click(function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!i)return!0;d=jQuery(i).closest("form").find(":checkbox"),f=d.index(i),j=d.index(this),h=jQuery(this).prop("checked"),0<f&&0<j&&f!=j&&d.slice(f,j).prop("checked",function(){return!!jQuery(this).closest("tr").is(":visible")&&h})}i=this;var t=jQuery(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");return jQuery(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0==t.length}),!0}),jQuery("thead, tfoot").find(".check-column :checkbox").click(function(e){var t=jQuery(this).prop("checked"),i="undefined"!=typeof toggleWithKeyboard&&toggleWithKeyboard,a=e.shiftKey||i;jQuery(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!jQuery(this).is(":hidden")&&(a?jQuery(this).prop("checked"):!!t)}),jQuery(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!a&&!!t})})}function fm_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function fm_form_submit(e,t,i,a){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function fm_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" field is required."),jQuery("#"+e).attr("style","border-color: #FF0000; border-style: solid; border-width: 1px;"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0)}function fm_show_hide_weights(){var a;"Show order column"==jQuery("#show_hide_weights").val()?(jQuery(".connectedSortable").css("cursor","default"),jQuery("#tbody_arr").find(".handle").hide(0),jQuery("#th_order").show(0),jQuery("#tbody_arr").find(".fm_order").show(0),jQuery("#show_hide_weights").val("Hide order column"),jQuery("#tbody_arr").sortable()&&jQuery("#tbody_arr").sortable("disable")):(jQuery(".connectedSortable").css("cursor","move"),a=jQuery("#page_number")&&""!=jQuery("#page_number").val()&&1!=jQuery("#page_number").val()?20*(jQuery("#page_number").val()-1)+1:1,jQuery("#tbody_arr").sortable({handle:".connectedSortable",connectWith:".connectedSortable",update:function(e,t){jQuery("#draganddrop").attr("style",""),jQuery("#draganddrop").html("<strong><p>Changes made in this table should be saved.</p></strong>");var i=a;jQuery(".fm_order").each(function(e){jQuery(this).find("input").val()&&jQuery(this).find("input").val(i++)})}}),jQuery("#tbody_arr").sortable("enable"),jQuery("#tbody_arr").find(".handle").show(0),jQuery("#tbody_arr").find(".handle").attr("class","handle connectedSortable"),jQuery("#th_order").hide(0),jQuery("#tbody_arr").find(".fm_order").hide(0),jQuery("#show_hide_weights").val("Show order column"))}function fm_popup(e){if(void 0===e)e="";var a,l,d;(a=function(){var e,t,i=jQuery("#TB_window"),a=jQuery(window).height(),n=jQuery(window).width();e=l&&l<n-90?l:n-40,t=d&&d<a-60?d:a-40,i.length&&(i.width(e).height(t),jQuery("#TB_iframeContent").width(e).height(t-27),i.css({"margin-left":"-"+parseInt(e/2,10)+"px"}),void 0!==document.body.style.maxWidth&&i.css({top:(a-t)/2,"margin-top":"0"}))})(),jQuery(window).resize(function(){a()}),jQuery("a.thickbox-preview"+e).click(function(){tb_click.call(this);var e=jQuery(this).parents(".available-theme").find(".activatelink"),t="",i=jQuery(this).attr("href");return l=(l=i.match(/&width=[0-9]+/))?parseInt(l[0].replace(/[^0-9]+/g,""),10):jQuery(window).width()-120,d=(d=i.match(/&height=[0-9]+/))?parseInt(d[0].replace(/[^0-9]+/g,""),10):jQuery(window).height()-120,t=e.length?'&nbsp; <a href="'+(e.attr("href")||"")+'" target="_top" class="tb-theme-preview-link">'+(e.attr("title")||"")+"</a>":'&nbsp; <span class="tb-theme-preview-link">'+(jQuery(this).attr("title")||"")+"</span>",jQuery("#TB_title").css({"background-color":"#222",color:"#dfdfdf"}),jQuery("#TB_closeAjaxWindow").css({float:"right"}),jQuery("#TB_ajaxWindowTitle").css({float:"left"}).html(t),jQuery("#TB_iframeContent").width("100%"),a(),!1}),jQuery(".theme-detail").click(function(){return jQuery(this).siblings(".themedetaildiv").toggle(),!1})}function bwg_inputs(){jQuery(".fm_int_input").keypress(function(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t)})}function fm_check_isnum(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||58<t)&&46!=t&&45!=t&&(t<65||70<t)&&(t<97||102<t))}function fm_change_payment_method(e){switch(e){case"paypal":jQuery(".fm_payment_option").show(),jQuery(".fm_paypal_option").show(),jQuery(".fm_payment_option_stripe").hide();break;case"stripe":jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").show();break;default:jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").hide()}}function stopRKey(e){var t=(e=e||(event||null)).target?e.target:e.srcElement?e.srcElement:null;if(13==e.keyCode&&("text"==t.type||"search"==t.type))return!1}function fmRemoveHeaderImage(e,t){jQuery("#header_image_url").val(""),jQuery("#header_image").css("background-image",""),jQuery("#header_image").addClass("fm-hide")}function fmOpenMediaUploader(e,t){void 0===t&&(t=!1),e.preventDefault();var i=wp.media({title:"Upload",button:{text:"Add Image"},multiple:!1}).on("select",function(){var e=i.state().get("selection").first().toJSON();jQuery("#header_image_url").val(e.url),jQuery("#header_image").css("background-image",'url("'+e.url+'")'),jQuery("#header_image").css("background-position","center"),jQuery("#header_image").removeClass("fm-hide")}).open();return!1}function fm_toggle_posts(e){jQuery(e).prop("checked")?jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}function fm_toggle_pages(e){jQuery(e).prop("checked")?jQuery(".fm-pages-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-pages-show").removeClass("fm-show").addClass("fm-hide")}function fm_apply_options(e){fm_set_input_value("task",e),document.getElementById("manage_form").submit()}function pp_live_search(e,t,i){var a=e,n=a.val(),l=a.data("post_type");setTimeout(function(){n===a.val()&&jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"manage_fm",task:"fm_live_search",nonce:fm_ajax.ajaxnonce,pp_live_search:n,pp_post_type:l,pp_full_content:i},beforeSend:function(e){a.css("width","95%"),a.parent().find(".fm-loading").css("display","inline-block")},success:function(e){a.css("width","100%"),a.parent().find(".fm-loading").css("display","none"),a.closest(".fm-pp").find(".pp_search_results").replaceWith(e)},error:function(e){console.log(e)}})},t)}function fm_toggle(e){jQuery(e).parent().next().toggleClass("hide")}function change_tab(e){jQuery(".fm-subscriber-header .fm-button").removeClass("active-button"),jQuery(".fm-subscriber-header ."+e).addClass("active-button"),jQuery(".fm-subscriber-content").hide(),jQuery("."+e+"-tab").show()}function change_form_type(e){jQuery("#fieldset_id").val(e),jQuery(".fm-form-types span").removeClass("active"),jQuery(".fm-form-types").find(".fm-"+e).addClass("active"),jQuery("#type_settings_fieldset .wd-group").removeClass("fm-show").addClass("fm-hide")}function change_hide_show(e){jQuery("."+e+".fm-hide").removeClass("fm-hide").addClass("fm-temporary"),jQuery("."+e+".fm-show").removeClass("fm-show").addClass("fm-hide"),jQuery("."+e+".fm-show-table").removeClass("fm-show-table").addClass("fm-hide"),jQuery("."+e+".fm-temporary").removeClass("fm-temporary").addClass("fm-show"),"fm-embedded"!=e&&(fm_toggle_posts(jQuery(".pp_display_on #pt3")),fm_toggle_pages(jQuery(".pp_display_on #pt4")))}function fm_change_radio_checkbox_text(e){var t=[];t.stripemode=["Test","Live"],t.checkout_mode=["Testmode","Production"],t.mail_mode=["Text","HTML"],t.mail_mode_user=["Text","HTML"],t.value=["1","0"],t.popover_show_on=["Page Exit","Page Load"],t.topbar_position=["Bottom","Top"],t.scrollbox_position=["Left","Right"],jQuery(e).val(t.value[jQuery(e).val()]),jQuery(e).next().val(jQuery(e).val());var i=t[jQuery(e).attr("name")];jQuery(e).find("label").html(i[jQuery(e).val()]),jQuery(e).hasClass("fm-text-yes")?(jQuery(e).removeClass("fm-text-yes").addClass("fm-text-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).removeClass("fm-text-no").addClass("fm-text-yes"),jQuery(e).find("span").animate({right:0},400,function(){}))}function fm_show_hide(e){jQuery("."+e).hasClass("fm-hide")?jQuery("."+e).removeClass("fm-hide").addClass("fm-show"):jQuery("."+e).removeClass("fm-show").addClass("fm-hide")}function fm_delete_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var i=jQuery("#blocked_ips").attr("action");jQuery.ajax({type:"POST",url:i,data:{current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"delete_blocked_ip"},success:function(e){var t=parseInt(jQuery(e).find("#total_for_paging").html());isNaN(t)||(i=i.replace(/(paged=)[^\&]+/,"$1"+t)),jQuery("#blocked_ips").parent(".wrap").load(i+" #blocked_ips",function(){window.history.pushState(null,null,i),0!=jQuery(".updated").length?jQuery(" .updated p strong").html("Items Successfully Deleted"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Deleted.</strong></p></div>").insertBefore("#blocked_ips"),set_no_items()})}})}function fm_save_ip(t){var i=jQuery("#ip"+t).val();url=jQuery("#blocked_ips").attr("action"),jQuery.ajax({type:"POST",url:url,data:{ip:i,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip"},success:function(e){jQuery("#td_ip_"+t).html('<a id="ip'+t+'" class="pointer" title="Edit" onclick="fm_edit_ip('+t+')">'+i+"</a>"),jQuery(".insert, .error").hide(),jQuery("#fm_blocked_ips_message").html("<div class='updated'><strong><p>Items Successfully Inserted.</p></strong></div>"),jQuery("#fm_blocked_ips_message").show()}})}function fm_insert_blocked_ip(){jQuery("#tr .loading").css("display","initial");var e=jQuery("#fm_ip").val(),t=window.location.href;jQuery.ajax({type:"POST",url:t,data:{ip:e,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip",last_id:1},success:function(e){jQuery("#blocked_ips").parent(".wrap").load(t+" #blocked_ips",function(){window.history.pushState(null,null,t),0!=jQuery(".updated").length?jQuery(".updated p strong").html("Items Successfully Saved"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Saved.</strong></p></div>").insertBefore("#blocked_ips")})}})}function fm_edit_ip(e){var t='<input id="ip'+e+'" class="input_th'+e+' ip_input" type="text" onkeypress="if(event.keyCode == 13){ if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); } return fm_check_isnum(event); " value="'+jQuery("#ip"+e).html()+'" name="ip'+e+'"/>';t+='<input type="button" class="button ip_save" style="margin-left: 5px" onclick="if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); return false;" value="Save"><div class="loading">',t+="<img src="+plugin_url+"/images/loading.gif></div>",jQuery("#td_ip_"+e).html(t)}function fm_enter_ip(e){if(13==e.which){if(fm_check_required("fm_ip","IP"))return!1;e.preventDefault(),fm_insert_blocked_ip()}}function fm_update_blocked_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var t=jQuery("#ip"+e).val(),i=window.location.href;jQuery.ajax({type:"POST",url:i,data:{ip:t,current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"update_blocked_ip"},success:function(e){jQuery("#fm-form-admin").load(i+" #blocked_ips",function(){0!=jQuery(".updated").length?(window.history.pushState(null,null,i),jQuery(".updated p strong").html("Items Successfully Updated")):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Updated.</strong></p></div>").insertBefore("#blocked_ips")})}})}function onEnableChange(e,t,i){var a=jQuery("#"+e+" #"+t);"1"==i?a.removeClass("hidden"):a.addClass("hidden")}function show_stats(){var e=jQuery(".fm-statistics .fm_error_sorted_label_key");""!=jQuery("#sorted_label_key").val()?(e.hide(),jQuery(".fm-div_stats-loading").addClass("is-active"),jQuery.ajax({dataType:"json",type:"POST",url:show_stats_url,data:{sorted_label_key:jQuery("#sorted_label_key").val(),startdate:jQuery("#startstats").val(),enddate:jQuery("#endstats").val(),nonce:fm_ajax.ajaxnonce},beforeSend:function(e){},error:function(e){},success:function(e){jQuery(".fm-div_stats-loading").removeClass("is-active"),e.html&&jQuery("#div_stats").html(e.html)}})):e.show()}function fm_loading_show(){jQuery("#fm_loading").show()}function fm_loading_hide(){jQuery("#fm_loading").hide(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items()}function getFormLocalStorage(){var e={};formId=getAllUrlParams().current_id;var t=localStorage.getItem("fm_form"+formId);return null!=t&&(e=jQuery.parseJSON(t)),e}function getAllUrlParams(e){var t=e?e.split("?")[1]:window.location.search.slice(1),i={};if(t)for(var a=(t=t.split("#")[0]).split("&"),n=0;n<a.length;n++){var l=a[n].split("="),d=void 0,_=l[0].replace(/\[\d*\]/,function(e){return d=e.slice(1,-1),""}),r=void 0===l[1]||l[1];_=_.toLowerCase(),r=r.toLowerCase(),i[_]?("string"==typeof i[_]&&(i[_]=[i[_]]),void 0===d?i[_].push(r):i[_][d]=r):i[_]=r}return i}function fm_disabled_uninstall_btn(){jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!0),jQuery(".fm-uninstall-form #check_yes").is(":checked")&&jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!1)}function fm_html_entities(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function fm_row_handle(e){var t=jQuery(e);t.find(".wdform_row_handle").remove();var i=jQuery('<div class="wdform_row_handle"><span class="fm-ico-draggable"></span><span title="Remove the column" class="page_toolbar fm-ico-delete" onclick="fm_remove_row_popup(this);"></span>'+"<span class=\"add-new-field\" onclick=\"jQuery('#cur_column').removeAttr('id');jQuery(this).parent().parent().attr('id', 'cur_column').val(1);popup_ready(); Enable(); return false;\">"+form_maker_manage.add_new_field+'</span><div class="fm-divider"></div></div>');t.prepend(i),i.after('<div class="fm-section-overlay"></div>')}function sortable_columns(){jQuery("#take").sortable({cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".form_id_tempform_view_img .fm-ico-draggable",items:"> .wdform-page-and-images",axis:"y",update:function(e,t){refresh_page_numbers()}}),jQuery(".wdform_page").sortable({connectWith:".wdform_page",cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".wdform_row_handle",cancel:".add-new-field, .page_toolbar",items:"> .wdform_section",create:function(e,t){jQuery(e.target).find(".wdform_section").each(function(){fm_row_handle(this)})},start:function(e,t){jQuery(".wdform_row_empty").hide()},stop:function(e,t){fm_rows_refresh(),jQuery(".wdform_row_empty").show()}}),jQuery(".wdform_column").sortable({connectWith:".wdform_column",cursor:"move",placeholder:"highlight",tolerance:"pointer",cancel:".wdform_section_handle",items:"> .wdform_row, #add_field",start:function(e,t){jQuery(".add-new-button").off("click"),jQuery(".wdform_column").removeClass("fm-hidden"),jQuery("#cur_column").removeAttr("id")},stop:function(e,t){return"add_field_cont"!=t.item.parent().attr("id")&&("add_field"==t.item.attr("id")&&"add_field_cont"!=t.item.parent().attr("id")?(fm_check_something_really_important()||(nextID=jQuery("#add_field").next(".wdform_row").attr("wdid"),jQuery("#add_field").parent().attr("id","cur_column"),popup_ready(),Enable(),jQuery(".add-new-button").removeAttr("onclick")),!1):(jQuery(".wdform_column:not(#add_field_cont):empty").addClass("fm-hidden"),void fm_columns_refresh()))}})}function all_sortable_events(){fm_rows_refresh(),fm_columns_refresh(),jQuery(".wdform_row, .wdform_tr_section_break").off("mouseover touchstart").on("mouseover touchstart",function(e){if(!jQuery(this).find(".wdform_arrows").is(":visible"))return jQuery(".wdform_arrows").hide(),jQuery(this).find(".wdform_arrows").show(),e.preventDefault(),!1}).off("mouseleave").on("mouseleave",function(){jQuery(this).find(".wdform_arrows").hide()}),jQuery(".wdform_section_handle, .wdform_row_handle").off("mouseover touchstart").on("mouseover touchstart",function(e){jQuery(this).parent().addClass("fm-hover")}).off("mouseleave").on("mouseleave",function(){jQuery(this).parent().removeClass("fm-hover")})}function fm_change_radio(e){jQuery(e).hasClass("fm-yes")?(jQuery(e).val("0"),jQuery(e).next().val("0"),jQuery(e).removeClass("fm-yes").addClass("fm-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).val("1"),jQuery(e).next().val("1"),jQuery(e).find("span").animate({right:0},400,function(){jQuery(e).removeClass("fm-no").addClass("fm-yes")})),"mail_verify"==jQuery(e).next().attr("name")&&show_verify_options(1==jQuery(e).val())}function enable_drag(){jQuery(".wdform_column").sortable("enable"),jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_field").css("cursor",""),jQuery("#add_field .wdform_field").css("cursor",""),all_sortable_events()}function refresh_(){document.getElementById("counter").value=gen,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.find("[id^=page_next_]").removeAttr("src"),e.find("[id^=page_previous_]").removeAttr("src"),e.find(".form_id_tempform_view_img").remove()}),jQuery("#take div").removeClass("ui-sortable ui-sortable-disabled ui-sortable-handle"),jQuery("#add_field_cont").remove(),document.getElementById("form_front").value=fm_base64EncodeUnicode(fm_htmlentities(document.getElementById("take").innerHTML))}function fm_base64EncodeUnicode(e){return utf8Bytes=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}),btoa(utf8Bytes)}function fm_htmlentities(e){var t=document.createElement("div"),i=document.createTextNode(e);return t.style.cssText="display:none",t.appendChild(i),t.innerHTML}function fm_add_submission_email(e,t,i,a){var n=jQuery("#"+t).val();if(n){var l=jQuery("<p>").attr("class","fm_mail_input").prependTo("#"+i);jQuery("<span>").attr("class","mail_name").text(n).appendTo(l),jQuery("<span>").attr("class","dashicons dashicons-trash").attr("onclick","fm_delete_mail(this, '"+n+"')").attr("title","Delete Email").appendTo(l),jQuery("#"+t).val(""),jQuery("#"+e).val(jQuery("#"+e).val()+n+",")}}function fm_delete_mail(e,t){jQuery(e).parent().remove(),jQuery("#mail").val(jQuery("#mail").val().replace(t+",",""))}function form_maker_options_tabs(e){return jQuery("#fieldset_id").val(e),jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive"),jQuery("#"+e+"_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+e).addClass("active"),!1}function set_type(e){switch(e){case"post":document.getElementById("post").removeAttribute("style"),document.getElementById("page").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").setAttribute("style","display:none");break;case"page":document.getElementById("page").removeAttribute("style"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").setAttribute("style","display:none");break;case"custom_text":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").removeAttribute("style"),document.getElementById("url_wrap").setAttribute("style","display:none");break;case"url_wrap":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").removeAttribute("style");break;case"none":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").setAttribute("style","display:none")}}function check_isnum(e){var t=e.which||e.keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t&&(t<35||40<t))}function fm_check_email(e){if(document.getElementById(e)&&""!=jQuery("#"+e).val()){for(var t=jQuery("#"+e).val().split(","),i=/^[\u0400-\u04FFa-zA-Z0-9.+_-]+@[\u0400-\u04FFa-zA-Z0-9.-]+\.[\u0400-\u04FFa-zA-Z]{2,61}$/,a=0;a<t.length;a++){var n=t[a].replace(/^\s+|\s+$/g,"");if(n&&!i.test(n)&&-1===n.indexOf("{")){if(alert("This is not a valid email address."),jQuery("#submenu li a").hasClass("active")){var l=jQuery("#submenu .active").attr("id");if(void 0!==(_=jQuery("#"+e).closest(".fm_fieldset_deactive").attr("id")))if(l!=(r=_.split("_fieldset")[0])){var d=l+"_fieldset";jQuery("#"+d).removeClass("fm_fieldset_active"),jQuery("#"+d).removeClass("fm_fieldset_deactive"),jQuery("#"+_).addClass("fm_fieldset_active"),jQuery("#submenu .active").removeClass("active"),jQuery("#"+r).addClass("active")}}else{var _;if(void 0!==(_=jQuery("#"+e).closest(".fm_fieldset_deactive").attr("id"))){var r=_.split("_fieldset");r=r[0],jQuery("#"+_).removeClass("fm_fieldset_deactive"),jQuery("#"+_).addClass("fm_fieldset_active"),jQuery("#"+r).addClass("active")}}return jQuery("#"+e).css("border","1px solid #FF0000"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0}}jQuery("#"+e).css("border","1px solid #ddd")}return!1}function wdhide(e){document.getElementById(e).style.display="none"}function wdshow(e){document.getElementById(e).style.display="block"}function delete_field_condition(e){var t=e.split("_");document.getElementById("condition"+t[0]).removeChild(document.getElementById("condition_div"+e))}function change_choices(e,t,i,a){switch(e=e.split("_"),global_index=e[0],id=e[1],index=e[2],ids_array=t.split("@@**@@"),types_array=i.split("@@**@@"),params_array=a.split("@@**@@"),types_array[id]){case"type_text":case"type_password":case"type_textarea":case"type_name":case"type_submitter_mail":case"type_number":case"type_phone":case"type_paypal_price":case"type_paypal_price_new":case"type_spinner":case"type_date_new":case"type_phone_new":if("type_number"==types_array[id]||"type_phone"==types_array[id])var n="return check_isnum_space(event)";else if("type_paypal_price"==types_array[id]||"type_paypal_price_new"==types_array[id])n="return check_isnum_point(event)";else n="";if("SELECT"==document.getElementById("field_value"+global_index+"_"+index).tagName){document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index));var l=document.createElement("input");l.setAttribute("id","field_value"+global_index+"_"+index),l.setAttribute("type","text"),l.setAttribute("value",""),l.setAttribute("class","fm_condition_field_input_value"),l.setAttribute("onKeyPress",n),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(l,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index))}else document.getElementById("field_value"+global_index+"_"+index).value="",document.getElementById("field_value"+global_index+"_"+index).setAttribute("onKeyPress",n);break;case"type_own_select":case"type_radio":case"type_checkbox":for("type_own_select"==types_array[id]?w_size=params_array[id].split("*:*w_size*:*"):w_size=params_array[id].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),-1!==w_size[1].indexOf("*:*w_value_disabled*:*")?(w_value_disabled=w_size[1].split("*:*w_value_disabled*:*"),w_choices_value=w_value_disabled[1].split("*:*w_choices_value*:*"),w_choices_value_array=w_choices_value[0].split("***")):w_choices_value_array=w_choices_array,(_=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+index),_.setAttribute("class","fm_condition_field_select_value"),"type_checkbox"==types_array[id]&&(_.setAttribute("multiple","multiple"),_.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){(d=document.createElement("option")).setAttribute("id","choise_"+global_index+"_"+k),d.setAttribute("value",w_choices_value_array[k]),d.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&_.appendChild(d)}document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(_,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index));break;case"type_paypal_select":case"type_paypal_radio":case"type_paypal_checkbox":case"type_paypal_shipping":for("type_paypal_select"==types_array[id]?w_size=params_array[id].split("*:*w_size*:*"):w_size=params_array[id].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),w_choices_price=w_choices[1].split("*:*w_choices_price*:*"),w_choices_price_array=w_choices_price[0].split("***"),(_=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+index),_.setAttribute("class","fm_condition_field_select_value"),"type_paypal_checkbox"==types_array[id]&&(_.setAttribute("multiple","multiple"),_.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){var d;(d=document.createElement("option")).setAttribute("id","choise_"+global_index+"_"+k),d.setAttribute("value",w_choices_array[k]+"*:*value*:*"+w_choices_price_array[k]),d.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&_.appendChild(d)}document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(_,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index));break;case"type_address":var _;countries=form_maker.countries,(_=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+m),_.setAttribute("class","fm_condition_field_select_value"),jQuery.each(countries,function(e,t){var i=document.createElement("option");_.setAttribute("id","field_value"+global_index+"_"+index),i.setAttribute("value",t),i.innerHTML=t,_.appendChild(i)}),document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(_,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index))}}function add_condition_fields(a,e,t,n,l){for(ids=e.split("@@**@@"),labels=t.split("@@**@@"),types=n.split("@@**@@"),params=l.split("@@**@@"),i=500;0<=i&&!document.getElementById("condition_div"+a+"_"+i);i--);m=i+1;var d=document.createElement("div");d.setAttribute("id","condition_div"+a+"_"+m);var _=document.createElement("select");for(_.setAttribute("id","field_labels"+a+"_"+m),_.setAttribute("onchange","change_choices(options[selectedIndex].id+'_"+m+"','"+e+"','"+n+"','"+l.replace(/\'/g,"\\'")+"')"),_.setAttribute("class","fm_condition_field_labels"),k=0;k<labels.length;k++)if(ids[k]!=document.getElementById("fields"+a).value){var r=document.createElement("option");r.setAttribute("id",a+"_"+k),r.setAttribute("value",ids[k]),r.innerHTML=labels[k],_.appendChild(r)}d.appendChild(_),d.appendChild(document.createTextNode(" "));var o=document.createElement("select");o.setAttribute("id","is_select"+a+"_"+m),o.setAttribute("class","fm_condition_is_select");var s=document.createElement("option");s.setAttribute("id","is"),s.setAttribute("value","=="),s.innerHTML="is";var u=document.createElement("option");u.setAttribute("id","is_not"),u.setAttribute("value","!="),u.innerHTML="is not";var c=document.createElement("option");c.setAttribute("id","like"),c.setAttribute("value","%"),c.innerHTML="like";var p=document.createElement("option");p.setAttribute("id","not_like"),p.setAttribute("value","!%"),p.innerHTML="not like";var f=document.createElement("option");f.setAttribute("id","empty"),f.setAttribute("value","="),f.innerHTML="empty";var y=document.createElement("option");if(y.setAttribute("id","not_empty"),y.setAttribute("value","!"),y.innerHTML="not empty",o.appendChild(s),o.appendChild(u),o.appendChild(c),o.appendChild(p),o.appendChild(f),o.appendChild(y),d.appendChild(o),d.appendChild(document.createTextNode(" ")),ids[0]!=document.getElementById("fields"+a).value)var h=0;else h=1;switch(types[h]){case"type_text":case"type_star_rating":case"type_password":case"type_textarea":case"type_name":case"type_submitter_mail":case"type_phone":case"type_number":case"type_paypal_price":case"type_paypal_price_new":case"type_spinner":case"type_date_new":case"type_phone_new":if("type_number"==types[h]||"type_phone"==types[h])var b="return check_isnum_space(event)";else if("type_paypal_price"==types[h]||"type_paypal_price_new"==types[h])b="return check_isnum_point(event)";else b="";var v=document.createElement("input");v.setAttribute("id","field_value"+a+"_"+m),v.setAttribute("type","text"),v.setAttribute("value",""),v.setAttribute("class","fm_condition_field_input_value"),v.setAttribute("onKeyPress",b),d.appendChild(v);break;case"type_checkbox":case"type_radio":case"type_own_select":for("type_own_select"==types[h]?w_size=params[h].split("*:*w_size*:*"):w_size=params[h].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),-1!==w_size[1].indexOf("*:*w_value_disabled*:*")?(w_value_disabled=w_size[1].split("*:*w_value_disabled*:*"),w_choices_value=w_value_disabled[1].split("*:*w_choices_value*:*"),w_choices_value_array=w_choices_value[0].split("***")):w_choices_value_array=w_choices_array,(g=document.createElement("select")).setAttribute("id","field_value"+a+"_"+m),g.style.cssText="vertical-align: top; width:200px;","type_checkbox"==types[h]&&(g.setAttribute("multiple","multiple"),g.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){(w=document.createElement("option")).setAttribute("id","choise_"+a+"_"+k),w.setAttribute("value",w_choices_value_array[k]),w.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&g.appendChild(w)}d.appendChild(g);break;case"type_paypal_select":case"type_paypal_checkbox":case"type_paypal_radio":case"type_paypal_shipping":for("type_paypal_select"==types[h]?w_size=params[h].split("*:*w_size*:*"):w_size=params[h].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),w_choices_price=w_choices[1].split("*:*w_choices_price*:*"),w_choices_price_array=w_choices_price[0].split("***"),(g=document.createElement("select")).setAttribute("id","field_value"+a+"_"+m),g.style.cssText="vertical-align: top; width:200px;","type_paypal_checkbox"==types[h]&&(g.setAttribute("multiple","multiple"),g.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){var w;(w=document.createElement("option")).setAttribute("id","choise_"+a+"_"+k),w.setAttribute("value",w_choices_array[k]+"*:*value*:*"+w_choices_price_array[k]),w.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&g.appendChild(w)}d.appendChild(g);break;case"type_address":var g;countries=form_maker.countries,(g=document.createElement("select")).setAttribute("id","field_value"+a+"_"+m),g.setAttribute("class","fm_condition_field_select_value"),jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("id","choise_"+a+"_"+k),i.setAttribute("value",t),i.innerHTML=t,g.appendChild(i)}),d.appendChild(g)}d.appendChild(document.createTextNode(" "));var E=document.createElement("span");E.setAttribute("class","dashicons dashicons-trash"),E.setAttribute("id","delete_condition"+a+"_"+m),E.setAttribute("onClick",'delete_field_condition("'+a+"_"+m+'")'),E.style.cssText="vertical-align: middle",d.appendChild(E),document.getElementById("condition"+a).appendChild(d)}function add_condition(e,t,a,n,l,d){for(i=500;0<=i&&!document.getElementById("condition"+i);i--);num=i+1,ids=l.split("@@**@@"),labels=d.split("@@**@@");var _=document.createElement("div");_.setAttribute("id","condition"+num),_.setAttribute("class","fm_condition");var r=document.createElement("div");r.setAttribute("id","conditional_fileds"+num);var o=document.createElement("select");o.setAttribute("id","show_hide"+num),o.setAttribute("name","show_hide"+num),o.setAttribute("class","fm_condition_show_hide");var m=document.createElement("option");m.setAttribute("value","1"),m.innerHTML="show";var s=document.createElement("option");s.setAttribute("value","0"),s.innerHTML="hide",o.appendChild(m),o.appendChild(s);var u=document.createElement("select");for(u.setAttribute("id","fields"+num),u.setAttribute("name","fields"+num),u.setAttribute("class","fm_condition_fields"),k=0;k<labels.length;k++){var c=document.createElement("option");c.setAttribute("value",ids[k]),c.innerHTML=labels[k],u.appendChild(c)}var p=document.createElement("span");p.innerHTML="if";var f=document.createElement("select");f.setAttribute("id","all_any"+num),f.setAttribute("name","all_any"+num),f.setAttribute("class","fm_condition_all_any");var y=document.createElement("option");y.setAttribute("value","and"),y.innerHTML="all";var h=document.createElement("option");h.setAttribute("value","or"),h.innerHTML="any",f.appendChild(y),f.appendChild(h);var b=document.createElement("span");b.style.maxWidth="235px",b.style.width="100%",b.style.display="inline-block",b.innerHTML="of the following match:";var v=document.createElement("span");v.setAttribute("class","dashicons dashicons-plus-alt"),v.setAttribute("onClick",'add_condition_fields("'+num+'", "'+e+'", "'+t.replace(/\'/g,"\\'").replace(/\"/g,"&quot;")+'", "'+a.replace(/\'/g,"\\'").replace(/\"/g,"&quot;")+'", "'+n.replace(/\'/g,"\\'").replace(/\"/g,"&quot;")+'")');var w=document.createElement("span");w.setAttribute("class","dashicons dashicons-trash"),w.setAttribute("onClick",'delete_condition("'+num+'")'),r.appendChild(o),r.appendChild(document.createTextNode(" ")),r.appendChild(u),r.appendChild(document.createTextNode(" ")),r.appendChild(p),r.appendChild(document.createTextNode(" ")),r.appendChild(f),r.appendChild(document.createTextNode(" ")),r.appendChild(b),r.appendChild(document.createTextNode(" ")),r.appendChild(w),r.appendChild(document.createTextNode(" ")),r.appendChild(v),_.appendChild(r),document.getElementById("conditions_fieldset_wrap").appendChild(_)}function delete_condition(e){document.getElementById("conditions_fieldset_wrap").removeChild(document.getElementById("condition"+e))}function acces_level(e){var t="";for(i=0;i<=parseInt(e);i++)document.getElementById("user_"+i).checked&&(t=t+document.getElementById("user_"+i).value+",");document.getElementById("user_id_wd").value=t}function check_isnum_space(e){var t=e.which||e.keyCode;return 32==t||!(31<t&&(t<48||57<t))}function check_isnum_point(e){var t=e.which||e.keyCode;return 46==t||!(31<t&&(t<48||57<t))}function check_stripe_required_fields(){if(jQuery("#paypal_mode2").prop("checked"))for("1"==jQuery("#stripemode").val()?(fields=["live_sec","live_pub"],fields_titles=["Live secret key","Live publishable key"]):(fields=["test_sec","test_pub"],fields_titles=["Test secret key","Test publishable key"]),i=0;i<fields.length;i++)if(!jQuery("#"+fields[i]).val())return jQuery("#"+fields[i]).focus(),alert(fields_titles[i]+" is required."),!0;return!1}function check_calculator_required_fields(){var i=0;return jQuery(jQuery("#wd_calculated_field_table").find('[id^="wdc_equation_"]')).each(function(){if(""==jQuery(this).val()){var e=jQuery(this).attr("id").replace("wdc_equation_",""),t=jQuery(jQuery("#wd_calculated_field_table").find("[data-field='"+e+"']")).html();i=1,jQuery(this).focus(),alert("Set equation for the field "+t)}if(1==i)return!1}),1==i}function set_theme(){theme_id="0"==jQuery("#theme").val()?default_theme:jQuery("#theme").val(),jQuery("#edit_css").attr("onclick","window.open('"+theme_edit_url+"&current_id="+theme_id+"'); return false;"),1==jQuery("#theme option:selected").attr("data-version")?jQuery("#old_theme_notice").show():jQuery("#old_theme_notice").hide()}jQuery(function(){fm_admin_ready()}),jQuery(document).on("fm_tab_loaded, fm_tab_email_loaded",function(){fm_admin_ready()}),jQuery(window).on("load",function(){jQuery("#fm_loading").hide(),jQuery("#fm_admin_container").show(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items(),jQuery("#fm_ask_question").parent().attr("target","_blank")}),document.onkeypress=stopRKey,jQuery(function(){jQuery(".pp_display_on #pt0").click(function(){var e=jQuery(this).prop("checked");jQuery('.pp_display_on input[type="checkbox"]').prop("checked",e),e?jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}),jQuery('.pp_display_on input[type="checkbox"]:not("#pt0")').click(function(){var e=jQuery(this).prop("checked");jQuery(".pp_display_on #pt0").prop("checked")&&!e&&jQuery(".pp_display_on #pt0").prop("checked",!1)}),jQuery(".pp_display_on #pt4").click(function(){fm_toggle_pages(this)}),jQuery(".pp_display_on #pt3").click(function(){fm_toggle_posts(this)}),jQuery("body").on("focusin",".pp_search_posts",function(){var e=jQuery(this);e.closest("ul").find(".pp_live_search").removeClass("fm-hide"),e.hasClass("already_triggered")||(e.addClass("already_triggered"),pp_live_search(e,500,!0))}),jQuery(document).click(function(){jQuery(".pp_live_search").addClass("fm-hide")}),jQuery("body").on("click",".fm-pp",function(){return!1}),jQuery("body").on("input",".pp_search_posts",function(){pp_live_search(jQuery(this),500,!0)}),jQuery("body").on("click",".pp_search_results li",function(){var e=jQuery(this);if(!e.hasClass("pp_no_res")){var t=e.text(),i=e.data("post_id"),a=e.closest(".fm-pp"),n=a.find(".pp_selected"),l=a.find(".pp_exclude"),d='<span data-post_id="'+i+'">'+t+'<span class="pp_selected_remove">x</span></span>';-1===n.html().indexOf('data-post_id="'+i+'"')&&(n.append(d),""===l.val()?l.val(i):l.val(function(e,t){return t+","+i}))}return!1}),jQuery("body").on("click",".pp_selected span.pp_selected_remove",function(){var e=jQuery(this).parent(),t=e.closest(".fm-pp").find(".pp_exclude"),i=t.val(),a=e.data("post_id");if(-1!==i.indexOf(a)){var n,l=-1!==i.indexOf(","+a)?","+a:a+",";l=-1!==i.indexOf(",")?l:a;n=i.replace(l,""),t.val(n)}return e.remove(),!1}),jQuery("body").on("click",'.pp_display_on_categories input[name="display_on_categories[]"]',function(){var e=jQuery('.pp_display_on_categories input[name="display_on_categories[]"]'),t=jQuery(".fm-display-all-categories");if("select_all_categories"==jQuery(this).val())jQuery(this).is(":checked")?e.prop("checked",!0):e.prop("checked",!1);else{var i=jQuery('input[name="display_on_categories[]"]:checked').length,a=parseInt(t.attr("data-categories-count"));jQuery(this).prop("checked")||(i-=1),t.prop("checked",!1),i==a&&t.prop("checked",!0)}})}),function(_){_.fn.serializeObject=function(){var n=this,l={},t={},d={validate:/^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/};return this.build=function(e,t,i){return e[t]=i,e},this.push_counter=function(e){return void 0===t[e]&&(t[e]=0),t[e]++},_.each(_(this).serializeArray(),function(){if(d.validate.test(this.name)){for(var e,t=this.name.match(d.key),i=this.value,a=this.name;void 0!==(e=t.pop());)a=a.replace(new RegExp("\\["+e+"\\]$"),""),e.match(d.push)?i=n.build([],n.push_counter(a),i):e.match(d.fixed)?i=n.build([],e,i):e.match(d.named)&&(i=n.build({},e,i));l=_.extend(!0,l,i)}}),l}}(jQuery),jQuery(document).on("dblclick",".wdform_row, .wdform_tr_section_break",function(){edit(jQuery(this).attr("wdid"))}),function(t){function i(e,t){if(!(1<e.originalEvent.touches.length)){e.preventDefault();var i=e.originalEvent.changedTouches[0],a=document.createEvent("MouseEvents");a.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(a)}}if(t.support.touch="ontouchend"in document,t.support.touch){var a,e=t.ui.mouse.prototype,n=e._mouseInit,l=e._mouseDestroy;e._touchStart=function(e){!a&&this._mouseCapture(e.originalEvent.changedTouches[0])&&(a=!0,this._touchMoved=!1,i(e,"mouseover"),i(e,"mousemove"),i(e,"mousedown"))},e._touchMove=function(e){a&&(this._touchMoved=!0,i(e,"mousemove"))},e._touchEnd=function(e){a&&(i(e,"mouseup"),i(e,"mouseout"),this._touchMoved||i(e,"click"),a=!1)},e._mouseInit=function(){var e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)},e._mouseDestroy=function(){var e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),l.call(e)}}}(jQuery);var gmapdata=new Array,gmapmarker=new Array,c;function if_gmap_init(e){map=document.getElementById(e+"_elementform_id_temp");var t=parseInt(map.getAttribute("zoom")),i=map.getAttribute("center_x"),a=map.getAttribute("center_y"),n=new google.maps.LatLng(a,i);return gmapdata[e]=new google.maps.Map(document.getElementById(e+"_elementform_id_temp"),{center:n,zoom:t,mapTypeId:"roadmap"}),google.maps.event.addListener(gmapdata[e],"zoom_changed",function(){document.getElementById(e+"_elementform_id_temp").setAttribute("zoom",gmapdata[e].getZoom())}),gmapmarker[e]=new Array,!1}function update_position(e,i){var t=document.getElementById("longval"+i).value,a=document.getElementById("latval"+i).value;0<t.length?1==isNaN(parseFloat(t))&&(t=2.294254):t=2.294254,0<a.length?1==isNaN(parseFloat(a))&&(a=48.858334):a=48.858334;var n=new google.maps.LatLng(a,t);gmapmarker[e][i].setPosition(n),gmapdata[e].setCenter(n),cur_zoom=gmapdata[e].getZoom(),gmapdata[e].setZoom(cur_zoom),geocoder=new google.maps.Geocoder,geocoder.geocode({latLng:gmapmarker[e][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)});var l=document.getElementById(e+"_elementform_id_temp");return l.setAttribute("long"+i,t),l.setAttribute("lat"+i,a),!1}function remove_marker(e,t){gmapmarker[e][t].setMap(null)}function add_marker_on_map(t,i,e,a,n,l){if(map=document.getElementById(t+"_elementform_id_temp"),null==e){var d=gmapdata[t].getCenter();a=gmapdata[t].getCenter().lat(),e=gmapdata[t].getCenter().lng()}else d=new google.maps.LatLng(a,e);return geocoder=new google.maps.Geocoder,gmapmarker[t][i]=new google.maps.Marker({map:gmapdata[t],position:d,draggable:l}),gmapmarker[t][i].setDraggable(l),infoW=new google.maps.InfoWindow,google.maps.event.addListener(gmapdata[t],"mouseover",function(e){document.getElementById("longval"+i)||gmapmarker[t][i].setDraggable(!1)}),google.maps.event.addListener(gmapmarker[t][i],"drag",function(){document.getElementById("longval"+i)&&(geocoder.geocode({latLng:gmapmarker[t][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)}),map.setAttribute("long"+i,gmapmarker[t][i].getPosition().lng().toFixed(6)),map.setAttribute("lat"+i,gmapmarker[t][i].getPosition().lat().toFixed(6)),document.getElementById("latval"+i).value=gmapmarker[t][i].getPosition().lat().toFixed(6),document.getElementById("longval"+i).value=gmapmarker[t][i].getPosition().lng().toFixed(6))}),google.maps.event.addListener(gmapmarker[t][i],"click",function(){infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(t+"_elementform_id_temp").getAttribute("info"+i)+"</div>");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),document.getElementById("longval"+i)&&(document.getElementById("longval"+i).value=e,document.getElementById("latval"+i).value=a,geocoder.geocode({latLng:gmapmarker[t][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)}),map.setAttribute("long"+i,e),map.setAttribute("lat"+i,a)),!1}function changeAddress(i,a){var e=document.getElementById("addrval"+a).value;geocoder.geocode({address:e},function(e,t){t==google.maps.GeocoderStatus.OK&&(gmapdata[i].setCenter(e[0].geometry.location),gmapmarker[i][a].setPosition(e[0].geometry.location),document.getElementById("latval"+a).value=gmapmarker[i][a].getPosition().lat().toFixed(6),document.getElementById("longval"+a).value=gmapmarker[i][a].getPosition().lng().toFixed(6),map.setAttribute("long"+a,gmapmarker[i][a].getPosition().lng().toFixed(6)),map.setAttribute("lat"+a,gmapmarker[i][a].getPosition().lat().toFixed(6)))})}function change_info(e,t,i){map=document.getElementById(t+"_elementform_id_temp"),map.setAttribute("info"+i,e)}function if_gmap_updateMap(e){map=document.getElementById(e+"_elementform_id_temp"),w_long=gmapdata[e].getCenter().lng(),w_lat=gmapdata[e].getCenter().lat(),map.setAttribute("center_x",w_long),map.setAttribute("center_y",w_lat)}!function(t){"function"==typeof define&&define.amd?define(["jquery"],function(e){t(e,window,document)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window,document):t(jQuery,window,document)}(function(r,_,e,l){"use strict";var d="intlTelInput",i=1,a={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customPlaceholder:null,dropdownContainer:"",excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,initialCountry:"",nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},o=38,m=40,s=13,u=27,t=43,c=65,p=90,f=32,n=9,y=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"];function h(e,t){this.telInput=r(e),this.options=r.extend({},a,t),this.ns="."+d+i++,this.isGoodBrowser=Boolean(e.setSelectionRange),this.hadInitialPlaceholder=Boolean(r(e).attr("placeholder"))}r(_).on("load",function(){r.fn[d].windowLoaded=!0}),h.prototype={_init:function(){return this.options.nationalMode&&(this.options.autoHideDialCode=!1),this.options.separateDialCode&&(this.options.autoHideDialCode=this.options.nationalMode=!1),this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(r("body").addClass("iti-mobile"),this.options.dropdownContainer||(this.options.dropdownContainer="body")),this.autoCountryDeferred=new r.Deferred,this.utilsScriptDeferred=new r.Deferred,this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests(),[this.autoCountryDeferred,this.utilsScriptDeferred]},_processCountryData:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries()},_addCountryCode:function(e,t,i){t in this.countryCodes||(this.countryCodes[t]=[]);var a=i||0;this.countryCodes[t][a]=e},_filterCountries:function(e,t){var i;for(i=0;i<e.length;i++)e[i]=e[i].toLowerCase();for(this.countries=[],i=0;i<b.length;i++)t(r.inArray(b[i].iso2,e))&&this.countries.push(b[i])},_processAllCountries:function(){this.options.onlyCountries.length?this._filterCountries(this.options.onlyCountries,function(e){return-1<e}):this.options.excludeCountries.length?this._filterCountries(this.options.excludeCountries,function(e){return-1==e}):this.countries=b},_processCountryCodes:function(){this.countryCodes={};for(var e=0;e<this.countries.length;e++){var t=this.countries[e];if(this._addCountryCode(t.iso2,t.dialCode,t.priority),t.areaCodes)for(var i=0;i<t.areaCodes.length;i++)this._addCountryCode(t.iso2,t.dialCode+t.areaCodes[i])}},_processPreferredCountries:function(){this.preferredCountries=[];for(var e=0;e<this.options.preferredCountries.length;e++){var t=this.options.preferredCountries[e].toLowerCase(),i=this._getCountryData(t,!1,!0);i&&this.preferredCountries.push(i)}},_generateMarkup:function(){this.telInput.attr("autocomplete","off");var e="intl-tel-input";this.options.allowDropdown&&(e+=" allow-dropdown"),this.options.separateDialCode&&(e+=" separate-dial-code"),this.telInput.wrap(r("<div>",{class:e})),this.flagsContainer=r("<div>",{class:"flag-container"}).insertBefore(this.telInput);var t=r("<div>",{class:"selected-flag"});t.appendTo(this.flagsContainer),this.selectedFlagInner=r("<div>",{class:"iti-flag"}).appendTo(t),this.options.separateDialCode&&(this.selectedDialCode=r("<div>",{class:"selected-dial-code"}).appendTo(t)),this.options.allowDropdown?(t.attr("tabindex","0"),r("<div>",{class:"iti-arrow"}).appendTo(t),this.countryList=r("<ul>",{class:"country-list hide"}),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"preferred"),r("<li>",{class:"divider"}).appendTo(this.countryList)),this._appendListItems(this.countries,""),this.countryListItems=this.countryList.children(".country"),this.options.dropdownContainer?this.dropdown=r("<div>",{class:"intl-tel-input iti-container"}).append(this.countryList):this.countryList.appendTo(this.flagsContainer)):this.countryListItems=r()},_appendListItems:function(e,t){for(var i="",a=0;a<e.length;a++){var n=e[a];i+="<li class='country "+t+"' data-dial-code='"+n.dialCode+"' data-country-code='"+n.iso2+"'>",i+="<div class='flag-box'><div class='iti-flag "+n.iso2+"'></div></div>",i+="<span class='country-name'>"+n.name+"</span>",i+="<span class='dial-code'>+"+n.dialCode+"</span>",i+="</li>"}this.countryList.append(i)},_setInitialState:function(){var e=this.telInput.val();this._getDialCode(e)&&!this._isRegionlessNanp(e)?this._updateFlagFromNumber(e):"auto"!==this.options.initialCountry&&(this.options.initialCountry?this._setFlag(this.options.initialCountry.toLowerCase()):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),e||this.options.nationalMode||this.options.autoHideDialCode||this.options.separateDialCode||this.telInput.val("+"+this.selectedCountryData.dialCode)),e&&this._updateValFromNumber(e)},_initListeners:function(){this._initKeyListeners(),this.options.autoHideDialCode&&this._initFocusListeners(),this.options.allowDropdown&&this._initDropdownListeners()},_initDropdownListeners:function(){var t=this,e=this.telInput.closest("label");e.length&&e.on("click"+this.ns,function(e){t.countryList.hasClass("hide")?t.telInput.focus():e.preventDefault()}),this.selectedFlagInner.parent().on("click"+this.ns,function(e){!t.countryList.hasClass("hide")||t.telInput.prop("disabled")||t.telInput.prop("readonly")||t._showDropdown()}),this.flagsContainer.on("keydown"+t.ns,function(e){!t.countryList.hasClass("hide")||e.which!=o&&e.which!=m&&e.which!=f&&e.which!=s||(e.preventDefault(),e.stopPropagation(),t._showDropdown()),e.which==n&&t._closeDropdown()})},_initRequests:function(){var e=this;this.options.utilsScript?r.fn[d].windowLoaded?r.fn[d].loadUtils(this.options.utilsScript,this.utilsScriptDeferred):r(_).on("load",function(){r.fn[d].loadUtils(e.options.utilsScript,e.utilsScriptDeferred)}):this.utilsScriptDeferred.resolve(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.autoCountryDeferred.resolve()},_loadAutoCountry:function(){r.fn[d].autoCountry?this.handleAutoCountry():r.fn[d].startedLoadingAutoCountry||(r.fn[d].startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup(function(e){r.fn[d].autoCountry=e.toLowerCase(),setTimeout(function(){r(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_initKeyListeners:function(){var e=this;this.telInput.on("keyup"+this.ns,function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()}),this.telInput.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()})})},_cap:function(e){var t=this.telInput.attr("maxlength");return t&&e.length>t?e.substr(0,t):e},_initFocusListeners:function(){var i=this;this.telInput.on("mousedown"+this.ns,function(e){i.telInput.is(":focus")||i.telInput.val()||(e.preventDefault(),i.telInput.focus())}),this.telInput.on("focus"+this.ns,function(e){i.telInput.val()||i.telInput.prop("readonly")||!i.selectedCountryData.dialCode||(i.telInput.val("+"+i.selectedCountryData.dialCode),i.telInput.one("keypress.plus"+i.ns,function(e){e.which==t&&i.telInput.val("")}),setTimeout(function(){var e=i.telInput[0];if(i.isGoodBrowser){var t=i.telInput.val().length;e.setSelectionRange(t,t)}}))});var e=this.telInput.prop("form");e&&r(e).on("submit"+this.ns,function(){i._removeEmptyDialCode()}),this.telInput.on("blur"+this.ns,function(){i._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var e=this.telInput.val();if("+"==e.charAt(0)){var t=this._getNumeric(e);t&&this.selectedCountryData.dialCode!=t||this.telInput.val("")}this.telInput.off("keypress.plus"+this.ns)},_getNumeric:function(e){return e.replace(/\D/g,"")},_showDropdown:function(){this._setDropdownPosition();var e=this.countryList.children(".active");e.length&&(this._highlightListItem(e),this._scrollTo(e)),this._bindDropdownListeners(),this.selectedFlagInner.children(".iti-arrow").addClass("up")},_setDropdownPosition:function(){var e=this;if(this.options.dropdownContainer&&this.dropdown.appendTo(this.options.dropdownContainer),this.dropdownHeight=this.countryList.removeClass("hide").outerHeight(),!this.isMobile){var t=this.telInput.offset(),i=t.top,a=r(_).scrollTop(),n=i+this.telInput.outerHeight()+this.dropdownHeight<a+r(_).height(),l=i-this.dropdownHeight>a;if(this.countryList.toggleClass("dropup",!n&&l),this.options.dropdownContainer){var d=!n&&l?0:this.telInput.innerHeight();this.dropdown.css({top:i+d,left:t.left}),r(_).on("scroll"+this.ns,function(){e._closeDropdown()})}}},_bindDropdownListeners:function(){var t=this;this.countryList.on("mouseover"+this.ns,".country",function(e){t._highlightListItem(r(this))}),this.countryList.on("click"+this.ns,".country",function(e){t._selectListItem(r(this))});var i=!0;r("html").on("click"+this.ns,function(e){i||t._closeDropdown(),i=!1});var a="",n=null;r(e).on("keydown"+this.ns,function(e){e.preventDefault(),e.which==o||e.which==m?t._handleUpDownKey(e.which):e.which==s?t._handleEnterKey():e.which==u?t._closeDropdown():(e.which>=c&&e.which<=p||e.which==f)&&(n&&clearTimeout(n),a+=String.fromCharCode(e.which),t._searchForCountry(a),n=setTimeout(function(){a=""},1e3))})},_handleUpDownKey:function(e){var t=this.countryList.children(".highlight").first(),i=e==o?t.prev():t.next();i.length&&(i.hasClass("divider")&&(i=e==o?i.prev():i.next()),this._highlightListItem(i),this._scrollTo(i))},_handleEnterKey:function(){var e=this.countryList.children(".highlight").first();e.length&&this._selectListItem(e)},_searchForCountry:function(e){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,e)){var i=this.countryList.children("[data-country-code="+this.countries[t].iso2+"]").not(".preferred");this._highlightListItem(i),this._scrollTo(i,!0);break}},_startsWith:function(e,t){return e.substr(0,t.length).toUpperCase()==t},_updateValFromNumber:function(e){if(this.options.formatOnDisplay&&_.intlTelInputUtils&&this.selectedCountryData){var t=this.options.separateDialCode||!this.options.nationalMode&&"+"==e.charAt(0)?intlTelInputUtils.numberFormat.INTERNATIONAL:intlTelInputUtils.numberFormat.NATIONAL;e=intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,t)}e=this._beforeSetNumber(e),this.telInput.val(e)},_updateFlagFromNumber:function(e){e&&this.options.nationalMode&&this.selectedCountryData&&"1"==this.selectedCountryData.dialCode&&"+"!=e.charAt(0)&&("1"!=e.charAt(0)&&(e="1"+e),e="+"+e);var t=this._getDialCode(e),i=null,a=this._getNumeric(e);if(t){var n=this.countryCodes[this._getNumeric(t)],l=this.selectedCountryData&&-1<r.inArray(this.selectedCountryData.iso2,n),d="+1"==t&&4<=a.length;if((!(this.selectedCountryData&&"1"==this.selectedCountryData.dialCode)||!this._isRegionlessNanp(a))&&(!l||d))for(var _=0;_<n.length;_++)if(n[_]){i=n[_];break}}else"+"==e.charAt(0)&&a.length?i="":e&&"+"!=e||(i=this.defaultCountry);return null!==i&&this._setFlag(i)},_isRegionlessNanp:function(e){var t=this._getNumeric(e);if("1"!=t.charAt(0))return!1;var i=t.substr(1,3);return-1<r.inArray(i,y)},_highlightListItem:function(e){this.countryListItems.removeClass("highlight"),e.addClass("highlight")},_getCountryData:function(e,t,i){for(var a=t?b:this.countries,n=0;n<a.length;n++)if(a[n].iso2==e)return a[n];if(i)return null;throw new Error("No country data for '"+e+"'")},_setFlag:function(e){var t=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?this._getCountryData(e,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedFlagInner.attr("class","iti-flag "+e);var i=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown";if(this.selectedFlagInner.parent().attr("title",i),this.options.separateDialCode){var a=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",n=this.telInput.parent();t.dialCode&&n.removeClass("iti-sdc-"+(t.dialCode.length+1)),a&&n.addClass("iti-sdc-"+a.length),this.selectedDialCode.text(a)}return this._updatePlaceholder(),this.countryListItems.removeClass("active"),e&&this.countryListItems.find(".iti-flag."+e).first().closest(".country").addClass("active"),t.iso2!==e},_updatePlaceholder:function(){var e="aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&(!0===this.options.autoPlaceholder||"polite"===this.options.autoPlaceholder);if(_.intlTelInputUtils&&e&&this.selectedCountryData){var t=intlTelInputUtils.numberType[this.options.placeholderNumberType],i=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,t):"";i=this._beforeSetNumber(i),"function"==typeof this.options.customPlaceholder&&(i=this.options.customPlaceholder(i,this.selectedCountryData)),this.telInput.attr("placeholder",i)}},_selectListItem:function(e){var t=this._setFlag(e.attr("data-country-code"));if(this._closeDropdown(),this._updateDialCode(e.attr("data-dial-code"),!0),this.telInput.focus(),this.isGoodBrowser){var i=this.telInput.val().length;this.telInput[0].setSelectionRange(i,i)}t&&this._triggerCountryChange()},_closeDropdown:function(){this.countryList.addClass("hide"),this.selectedFlagInner.children(".iti-arrow").removeClass("up"),r(e).off(this.ns),r("html").off(this.ns),this.countryList.off(this.ns),this.options.dropdownContainer&&(this.isMobile||r(_).off("scroll"+this.ns),this.dropdown.detach())},_scrollTo:function(e,t){var i=this.countryList,a=i.height(),n=i.offset().top,l=n+a,d=e.outerHeight(),_=e.offset().top,r=_+d,o=_-n+i.scrollTop(),m=a/2-d/2;if(_<n)t&&(o-=m),i.scrollTop(o);else if(l<r){t&&(o+=m);var s=a-d;i.scrollTop(o-s)}},_updateDialCode:function(e,t){var i,a=this.telInput.val();if(e="+"+e,"+"==a.charAt(0)){var n=this._getDialCode(a);i=n?a.replace(n,e):e}else{if(this.options.nationalMode||this.options.separateDialCode)return;if(a)i=e+a;else{if(!t&&this.options.autoHideDialCode)return;i=e}}this.telInput.val(i)},_getDialCode:function(e){var t="";if("+"==e.charAt(0))for(var i="",a=0;a<e.length;a++){var n=e.charAt(a);if(r.isNumeric(n)&&(i+=n,this.countryCodes[i]&&(t=e.substr(0,a+1)),4==i.length))break}return t},_getFullNumber:function(){var e=r.trim(this.telInput.val()),t=this.selectedCountryData.dialCode,i=this._getNumeric(e),a="1"==i.charAt(0)?i:"1"+i;return(this.options.separateDialCode?"+"+t:"+"!=e.charAt(0)&&"1"!=e.charAt(0)&&t&&"1"==t.charAt(0)&&4==t.length&&t!=a.substr(0,4)?t.substr(1):"")+e},_beforeSetNumber:function(e){if(this.options.separateDialCode){var t=this._getDialCode(e);if(t){null!==this.selectedCountryData.areaCodes&&(t="+"+this.selectedCountryData.dialCode);var i=" "===e[t.length]||"-"===e[t.length]?t.length+1:t.length;e=e.substr(i)}}return this._cap(e)},_triggerCountryChange:function(){this.telInput.trigger("countrychange",this.selectedCountryData)},handleAutoCountry:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=r.fn[d].autoCountry,this.telInput.val()||this.setCountry(this.defaultCountry),this.autoCountryDeferred.resolve())},handleUtils:function(){_.intlTelInputUtils&&(this.telInput.val()&&this._updateValFromNumber(this.telInput.val()),this._updatePlaceholder()),this.utilsScriptDeferred.resolve()},destroy:function(){if(this.allowDropdown&&(this._closeDropdown(),this.selectedFlagInner.parent().off(this.ns),this.telInput.closest("label").off(this.ns)),this.options.autoHideDialCode){var e=this.telInput.prop("form");e&&r(e).off(this.ns)}this.telInput.off(this.ns),this.telInput.parent().before(this.telInput).remove()},getExtension:function(){return _.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""},getNumber:function(e){return _.intlTelInputUtils?intlTelInputUtils.formatNumber(this._getFullNumber(),this.selectedCountryData.iso2,e):""},getNumberType:function(){return _.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99},getSelectedCountryData:function(){return this.selectedCountryData||{}},getValidationError:function(){return _.intlTelInputUtils?intlTelInputUtils.getValidationError(this._getFullNumber(),this.selectedCountryData.iso2):-99},isValidNumber:function(){var e=r.trim(this._getFullNumber()),t=this.options.nationalMode?this.selectedCountryData.iso2:"";return _.intlTelInputUtils?intlTelInputUtils.isValidNumber(e,t):null},setCountry:function(e){e=e.toLowerCase(),this.selectedFlagInner.hasClass(e)||(this._setFlag(e),this._updateDialCode(this.selectedCountryData.dialCode,!1),this._triggerCountryChange())},setNumber:function(e){var t=this._updateFlagFromNumber(e);this._updateValFromNumber(e),t&&this._triggerCountryChange()}},r.fn[d]=function(i){var t,a=arguments;if(i===l||"object"==typeof i){var n=[];return this.each(function(){if(!r.data(this,"plugin_"+d)){var e=new h(this,i),t=e._init();n.push(t[0]),n.push(t[1]),r.data(this,"plugin_"+d,e)}}),r.when.apply(null,n)}if("string"==typeof i&&"_"!==i[0])return this.each(function(){var e=r.data(this,"plugin_"+d);e instanceof h&&"function"==typeof e[i]&&(t=e[i].apply(e,Array.prototype.slice.call(a,1))),"destroy"===i&&r.data(this,"plugin_"+d,null)}),t!==l?t:this},r.fn[d].getCountryData=function(){return b},r.fn[d].loadUtils=function(e,t){r.fn[d].loadedUtilsScript?t&&t.resolve():(r.fn[d].loadedUtilsScript=!0,r.ajax({type:"GET",url:e,complete:function(){r(".intl-tel-input input").intlTelInput("handleUtils")},dataType:"script",cache:!0}))},r.fn[d].version="11.0.0",r.fn[d].defaults=a;for(var b=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1441"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Cote d'Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curacao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1876"],["Japan","jp","81"],["Jersey","je","44",3],["Jordan","jo","962"],["Kazakhstan","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1664"],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Reunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Saint Barthelemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin","mf","590",2],["Saint Pierre and Miquelon","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["Sao Tome and Principe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis and Futuna","wf","681"],["Western Sahara","eh","212",1],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Aland Islands","ax","358",1]],v=0;v<b.length;v++){var w=b[v];b[v]={name:w[0],iso2:w[1],dialCode:w[2],priority:w[3]||0,areaCodes:w[4]||null}}}),j=2;var need_enable=!0,a=new Array,is_addon_stripe_active,is_addon_calculator_active,nextID;if(-1!=ajaxurl.indexOf("://"))var url_for_ajax=ajaxurl;else var url_for_ajax=location.protocol+"//"+location.host+ajaxurl;function isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function disable_past_days(e,t){document.getElementById(t+"_buttonform_id_temp").setAttribute("format",e)}function set_send(e){"yes"==document.getElementById(e).value?document.getElementById(e).setAttribute("value","no"):document.getElementById(e).setAttribute("value","yes")}function show_datepicker(e){jQuery("#"+e).datepicker("show")}function hide_time(e){"no"==document.getElementById(e+"form_id_temp").value?document.getElementById(e+"form_id_temp").value="yes":document.getElementById(e+"form_id_temp").value="no"}function show_week_days(id,week_day){week_day&&(1==document.getElementById("el_show_"+week_day).checked?document.getElementById(id+"_show_week_days").setAttribute(week_day,"yes"):document.getElementById(id+"_show_week_days").setAttribute(week_day,"no")),jQuery("input[name^="+id+"_elementform_id_temp]").datepicker("option","beforeShowDay",function(date){for(var w_hide_sunday="yes"==jQuery("#"+id+"_show_week_days").attr("sunday")?"true":"day != 0",w_hide_monday="yes"==jQuery("#"+id+"_show_week_days").attr("monday")?"true":"day != 1",w_hide_tuesday="yes"==jQuery("#"+id+"_show_week_days").attr("tuesday")?"true":"day != 2",w_hide_wednesday="yes"==jQuery("#"+id+"_show_week_days").attr("wednesday")?"true":"day != 3",w_hide_thursday="yes"==jQuery("#"+id+"_show_week_days").attr("thursday")?"true":"day != 4",w_hide_friday="yes"==jQuery("#"+id+"_show_week_days").attr("friday")?"true":"day != 5",w_hide_saturday="yes"==jQuery("#"+id+"_show_week_days").attr("saturday")?"true":"day != 6",invalid_dates=jQuery("#"+id+"_invalid_dates_id_temp").val(),invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var string_days=jQuery.datepicker.formatDate("mm/dd/yy",date),day=date.getDay();return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]})}function set_sel_am_pm(e){e.options[0].selected?(e.options[0].setAttribute("selected","selected"),e.options[1].removeAttribute("selected")):(e.options[1].setAttribute("selected","selected"),e.options[0].removeAttribute("selected"))}function change_captcha_digit(e){captcha=document.getElementById("_wd_captchaform_id_temp"),document.getElementById("captcha_digit").value?(captcha.setAttribute("digit",e),captcha.setAttribute("src",url_for_ajax+"?action=formmakerwdcaptcha&digit="+e+"&i=form_id_temp"),document.getElementById("_wd_captcha_inputform_id_temp").style.width=10*document.getElementById("captcha_digit").value+15+"px"):(captcha.setAttribute("digit","6"),captcha.setAttribute("src",url_for_ajax+"?action=formmakerwdcaptcha&digit=6&i=form_id_temp"),document.getElementById("_wd_captcha_inputform_id_temp").style.width="75px")}function check_isnum_interval(e,t,i,a){var n=e.which||e.keyCode;return!(31<n&&(n<48||57<n))&&(val=""+document.getElementById(t).value+String.fromCharCode(n),!(2<val.length)&&("00"!=val&&!(val<i||val>a)))}function check_isnum_point(e){var t=e.which||e.keyCode;return 46==t||!(31<t&&(t<48||57<t))}function check_isnum_price(e,t){var i=e.which||e.keyCode;return!((""==t||-1<t.indexOf("."))&&31<i&&(i<48||57<i))&&!(31<i&&46!=i&&(i<48||57<i))}function check_isspacebar(e){return 32!=(e.which||e.keyCode)}function change_w_label(e,t){document.getElementById(e)&&(document.getElementById(e).innerHTML=t)}function change_w(e,t){document.getElementById(e).setAttribute("width",t)}function change_h(e,t){document.getElementById(e).setAttribute("height",t)}function change_key(e,t){document.getElementById("wd_recaptchaform_id_temp").setAttribute(t,e)}function captcha_refresh(e){srcArr=document.getElementById(e+"form_id_temp").src.split("&r="),document.getElementById(e+"form_id_temp").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_inputform_id_temp").value=""}function up_row(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,k=0;wdform_column.childNodes[k]&&(!wdform_column.childNodes[k].getAttribute("wdid")||e!=wdform_column.childNodes[k].getAttribute("wdid"));)k++;if(0!=k)return up=wdform_column.childNodes[k-1],down=wdform_column.childNodes[k],wdform_column.removeChild(down),void wdform_column.insertBefore(down,up);wdform_section.previousSibling&&wdform_section.previousSibling.getAttribute("type")?wdform_section.previousSibling.previousSibling.firstChild.appendChild(wdform_row):page_up(e)}function down_row(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,l=wdform_column.childNodes.length,k=0;wdform_column.childNodes[k]&&(!wdform_column.childNodes[k].getAttribute("wdid")||e!=wdform_column.childNodes[k].getAttribute("wdid"));)k++;if(k!=l-1)return up=wdform_column.childNodes[k],down=wdform_column.childNodes[k+2],wdform_column.removeChild(up),down||(down=null),void wdform_column.insertBefore(up,down);wdform_section.nextSibling.getAttribute("type")?wdform_section.nextSibling.nextSibling.firstChild.appendChild(wdform_row):page_down(e)}function right_row(e){if("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,null!=wdform_column.nextSibling)wdform_column_next=wdform_column.nextSibling,wdform_column_next.appendChild(wdform_row);else{var t=document.createElement("div");t.setAttribute("class","wdform_column"),wdform_section.appendChild(t),t.appendChild(wdform_row)}sortable_columns()}function left_row(e){"undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,null!=wdform_column.previousSibling&&(wdform_column_next=wdform_column.previousSibling,wdform_column_next.appendChild(wdform_row)),sortable_columns()}function page_up(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,wdform_page_and_images=wdform_page.parentNode;wdform_page_and_images;){if(wdform_page_and_images=wdform_page_and_images.previousSibling,!wdform_page_and_images)return void alert("Unable to move");if(jQuery(wdform_page_and_images.firstChild).is(":visible"))break}n=wdform_page_and_images.getElementsByClassName("wdform_page")[0].childNodes.length,wdform_page_and_images.getElementsByClassName("wdform_page")[0].childNodes[n-2].firstChild.appendChild(wdform_row),refresh_pages(e)}function page_down(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,wdform_page_and_images=wdform_page.parentNode;wdform_page_and_images;){if(wdform_page_and_images=wdform_page_and_images.nextSibling,!wdform_page_and_images||"add_field_cont"==wdform_page_and_images.id)return void alert("Unable to move");if(jQuery(wdform_page_and_images.firstChild).is(":visible"))break}wdform_page_and_images.getElementsByClassName("wdform_page")[0].firstChild.firstChild.insertBefore(wdform_row,wdform_page_and_images.firstChild.firstChild.firstChild.firstChild),refresh_pages(e)}function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function Disable(){}function all_labels(){for(labels=new Array,k=1;k<=form_view_max;k++)if(document.getElementById("form_id_tempform_view"+k))for(wdform_page=document.getElementById("form_id_tempform_view"+k),remove_whitespace(wdform_page),n=wdform_page.childNodes.length-2,z=0;z<=n;z++)if(!wdform_page.childNodes[z].getAttribute("wdid"))for(wdform_section=wdform_page.childNodes[z],x=0;x<wdform_section.childNodes.length;x++)if(wdform_column=wdform_section.childNodes[x],wdform_column.firstChild)for(y=0;y<wdform_column.childNodes.length;y++)wdform_row=wdform_column.childNodes[y],3!=wdform_row.nodeType&&(wdid=wdform_row.getAttribute("wdid"),wdid&&labels.push(document.getElementById(wdid+"_element_labelform_id_temp").innerHTML));return labels}function set_checked(e,t){return checking=document.getElementById(e+"_elementform_id_temp"+t),checking.checked&&checking.setAttribute("checked","checked"),!(!checking.checked&&(checking.removeAttribute("checked"),checking.getAttribute("other")&&1==checking.getAttribute("other")))||(document.getElementById(e+"_other_inputform_id_temp")&&(document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_brform_id_temp")),document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_inputform_id_temp"))),!1)}function set_default(e,t){for(k=0;k<100;k++)document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).checked?document.getElementById(e+"_elementform_id_temp"+t).setAttribute("checked","checked"):document.getElementById(e+"_elementform_id_temp"+k).removeAttribute("checked"));document.getElementById(e+"_other_inputform_id_temp")&&(document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_brform_id_temp")),document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_inputform_id_temp")))}function set_select(e){for(p=e.length-1;0<=p;p--)e.options[p].selected?e.options[p].setAttribute("selected","selected"):e.options[p].removeAttribute("selected")}function add_0(e){input=document.getElementById(e),1==input.value.length&&(input.value="0"+input.value,input.setAttribute("value",input.value))}function label_top_stripe(e){document.getElementById(e+"_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_element_sectionform_id_temp").style.display="block"}function label_left_stripe(e){document.getElementById(e+"_label_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_element_sectionform_id_temp").style.display="table-cell"}function change_value_range(e,t,i){jQuery("#"+e).datepicker("option",t,i)}function change_func(e,t){document.getElementById(e).setAttribute("onclick",t)}function change_in_value(e,t){t=(t=t.replace(/(<([^>]+)>)/gi,"")).replace(/"/g,"&quot;"),document.getElementById(e).setAttribute("value",t)}function change_size(e,t){switch(document.getElementById(t+"_elementform_id_temp").style.width=e+"px",document.getElementById(t+"_element_input")&&(document.getElementById(t+"_element_input").style.width=e+"px"),e){case"111":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","2");break;case"222":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","4");break;case"444":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","8")}}function getIFrameDocument(e){var t=null;return document.getElementById(e)&&document.getElementById(e).contentDocument?t=document.getElementById(e).contentDocument:document.getElementById(e)&&(t=document.frames[e].document),t}function format_extended(t,e,i,a,n){w_size=document.getElementById(t+"_element_firstform_id_temp").style.width,tr_name1=document.getElementById(t+"_tr_name1"),tr_name2=document.getElementById(t+"_tr_name2");var l=document.createElement("div");l.setAttribute("id",t+"_td_name_input_title"),l.style.display="table-cell";var d=document.createElement("div");d.setAttribute("id",t+"_td_name_input_middle"),d.style.display="table-cell";var _=document.createElement("div");_.setAttribute("id",t+"_td_name_label_title"),_.setAttribute("align","left"),_.style.display="table-cell";var r=document.createElement("div");r.setAttribute("id",t+"_td_name_label_middle"),r.setAttribute("align","left"),r.style.display="table-cell";var o=document.createElement("input");o.setAttribute("type","text"),o.style.cssText="margin: 0px 10px 0px 0px; padding: 0px; width:40px",o.setAttribute("id",t+"_element_titleform_id_temp"),o.setAttribute("name",t+"_element_titleform_id_temp"),e==a?o.setAttribute("value",a):o.setAttribute("value",e),o.setAttribute("title",a);var m=document.createElement("label");m.setAttribute("class","mini_label"),m.setAttribute("id",t+"_mini_label_title"),m.innerHTML=w_mini_labels[0];var s=document.createElement("input");s.setAttribute("type","text"),s.style.cssText="padding: 0px; width:"+w_size,s.setAttribute("id",t+"_element_middleform_id_temp"),s.setAttribute("name",t+"_element_middleform_id_temp"),i==n?s.setAttribute("value",n):s.setAttribute("value",i),s.setAttribute("title",n);var u=document.createElement("label");u.setAttribute("class","mini_label"),u.setAttribute("id",t+"_mini_label_middle"),u.innerHTML=w_mini_labels[3],first_input=document.getElementById(t+"_td_name_input_first"),last_input=document.getElementById(t+"_td_name_input_last"),first_label=document.getElementById(t+"_td_name_label_first"),last_label=document.getElementById(t+"_td_name_label_last"),l.appendChild(o),d.appendChild(s),tr_name1.insertBefore(l,first_input),tr_name1.insertBefore(d,null),_.appendChild(m),r.appendChild(u),tr_name2.insertBefore(_,first_label),tr_name2.insertBefore(r,null);var c=document.createTextNode("-"),p=document.createTextNode("-"),f=document.createElement("input");f.setAttribute("id","el_first_value_title"),f.setAttribute("type","text"),f.setAttribute("value",a),f.style.cssText="width:50px; margin-left:4px; margin-right:4px",f.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_titleform_id_temp')");var y=document.createElement("input");y.setAttribute("id","el_first_value_middle"),y.setAttribute("type","text"),y.setAttribute("value",n),y.style.cssText="width:100px; margin-left:4px",y.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_middleform_id_temp')"),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,parent.insertBefore(c,el_first_value_first),parent.insertBefore(f,c),parent.appendChild(p),parent.appendChild(y),refresh_attr(t,"type_name"),refresh_id_name(t,"type_name"),jQuery(function(){jQuery("label#"+t+"_mini_label_title").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.title").focus(),jQuery("input.title").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_title").text(e)})}}),jQuery("label#"+t+"_mini_label_middle").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_middle").text(e)})}})})}function format_normal(e){tr_name1=document.getElementById(e+"_tr_name1"),tr_name2=document.getElementById(e+"_tr_name2"),td_name_input1=document.getElementById(e+"_td_name_input_title"),td_name_input4=document.getElementById(e+"_td_name_input_middle"),td_name_label1=document.getElementById(e+"_td_name_label_title"),td_name_label4=document.getElementById(e+"_td_name_label_middle"),tr_name1.removeChild(td_name_input1),tr_name1.removeChild(td_name_input4),tr_name2.removeChild(td_name_label1),tr_name2.removeChild(td_name_label4),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,parent.removeChild(document.getElementById("el_first_value_title").nextSibling),parent.removeChild(document.getElementById("el_first_value_title")),parent.removeChild(document.getElementById("el_first_value_middle").previousSibling),parent.removeChild(document.getElementById("el_first_value_middle")),refresh_attr(e,"type_name"),refresh_id_name(e,"type_name")}function type_number(e,t,i,a,l,d,_,r,o,m,s,u){document.getElementById("element_type").value="type_number",delete_last_child();var c=document.createElement("div");c.setAttribute("id","edit_div");var p=document.createElement("table");p.setAttribute("id","edit_main_table"),p.setAttribute("cellpadding","3"),p.setAttribute("cellspacing","0");var f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td"),q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=(document.createElement("td"),document.createElement("td")),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("label");K.setAttribute("class","fm-field-label"),K.setAttribute("for","edit_for_label"),K.innerHTML="Field label";var U=document.createElement("textarea");U.setAttribute("id","edit_for_label"),U.setAttribute("rows","4"),U.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),U.innerHTML=t;var F=document.createElement("label");F.setAttribute("class","fm-field-label"),F.setAttribute("for","edit_for_label_size"),F.innerHTML="Field label size(px) ";var R=document.createElement("input");R.setAttribute("id","edit_for_label_size"),R.setAttribute("type","text"),R.setAttribute("value",i),R.setAttribute("onKeyPress","return check_isnum(event)"),R.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var W=document.createElement("label");W.setAttribute("class","fm-field-label"),W.innerHTML="Field label position";var V=document.createElement("input");V.setAttribute("id","edit_for_label_position_top"),V.setAttribute("type","radio"),V.setAttribute("name","edit_for_label_position"),V.setAttribute("onchange","label_left("+e+")");var $=document.createElement("label");$.setAttribute("for","edit_for_label_position_top"),$.innerHTML="Left";var G=document.createElement("input");G.setAttribute("id","edit_for_label_position_left"),G.setAttribute("type","radio"),G.setAttribute("name","edit_for_label_position"),G.setAttribute("onchange","label_top("+e+")");var Y=document.createElement("label");Y.setAttribute("for","edit_for_label_position_left"),Y.innerHTML="Top","top"==a?G.setAttribute("checked","checked"):V.setAttribute("checked","checked");var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","edit_for_input_size"),Z.innerHTML="Field size(px) ";var X=document.createElement("input");X.setAttribute("id","edit_for_input_size"),X.setAttribute("type","text"),X.setAttribute("value",l),X.setAttribute("onKeyPress","return check_isnum(event)"),X.setAttribute("onKeyUp","change_w_style('"+e+"_elementform_id_temp', this.value)");var J=document.createElement("label");J.setAttribute("class","fm-field-label"),J.setAttribute("for","el_first_value_input"),J.innerHTML="Placeholder ";var ee=document.createElement("input");ee.setAttribute("id","el_first_value_input"),ee.setAttribute("type","text"),ee.setAttribute("value",_),ee.setAttribute("onKeyUp","change_input_value(this.value,'"+e+"_elementform_id_temp');");var te=document.createElement("label");te.setAttribute("class","fm-field-label"),te.setAttribute("for","el_required"),te.innerHTML="Required";var ie=document.createElement("input");ie.setAttribute("id","el_required"),ie.setAttribute("type","checkbox"),ie.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==r&&ie.setAttribute("checked","checked");var ae=document.createElement("label");ae.setAttribute("class","fm-field-label"),ae.setAttribute("for","el_unique"),ae.innerHTML="Allow only unique values";var ne=document.createElement("input");ne.setAttribute("id","el_unique"),ne.setAttribute("type","checkbox"),ne.setAttribute("onclick","set_unique('"+e+"_uniqueform_id_temp')"),"yes"==o&&ne.setAttribute("checked","checked");var le=document.createElement("label");le.setAttribute("class","fm-field-label"),le.setAttribute("for","el_style_textarea"),le.innerHTML="Class name";var de=document.createElement("input");de.setAttribute("id","el_style_textarea"),de.setAttribute("type","text"),de.setAttribute("value",m),de.setAttribute("onChange","change_class(this.value,'"+e+"')");var _e=document.createElement("label");_e.setAttribute("class","fm-field-label"),_e.innerHTML="Additional Attributes";var re=document.createElement("img");re.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),re.style.cssText="cursor:pointer; margin-left:68px",re.setAttribute("title","add"),re.setAttribute("onClick","add_attr("+e+", 'type_text')");var oe=document.createElement("table");oe.setAttribute("id","attributes"),oe.setAttribute("border","0"),oe.style.cssText="margin-left:0px";var me=document.createElement("tr");me.setAttribute("idi","0");var se=document.createElement("th");se.style.cssText="width:100px";var ue=document.createElement("th");ue.style.cssText="width:100px";var ce=document.createElement("th");ce.style.cssText="width:10px";var pe=document.createElement("label");pe.style.cssText="color:#000; font-weight:bold; font-size: 11px",pe.innerHTML="Name";var fe=document.createElement("label");for(fe.style.cssText="color:#000; font-weight:bold; font-size: 11px",fe.innerHTML="Value",oe.appendChild(me),me.appendChild(se),me.appendChild(ue),me.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),n=s.length,j=1;j<=n;j++){var ye=document.createElement("tr");ye.setAttribute("id","attr_row_"+j),ye.setAttribute("idi",j);var he=document.createElement("td");he.style.cssText="width:100px";var be=document.createElement("td");be.style.cssText="width:100px";var ve=document.createElement("td"),we=document.createElement("input");we.setAttribute("type","text"),we.setAttribute("class","fm-field-choice"),we.setAttribute("value",s[j-1]),we.setAttribute("id","attr_name"+j),we.setAttribute("onChange","change_attribute_name("+e+", this, 'type_text')");var ge=document.createElement("input");ge.setAttribute("type","text"),ge.setAttribute("class","fm-field-choice"),ge.setAttribute("value",u[j-1]),ge.setAttribute("id","attr_value"+j),ge.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_text')");var Ee=document.createElement("img");Ee.setAttribute("id","el_choices"+j+"_remove"),Ee.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Ee.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Ee.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_text')"),oe.appendChild(ye),ye.appendChild(he),ye.appendChild(be),ye.appendChild(ve),he.appendChild(we),be.appendChild(ge),ve.appendChild(Ee)}var Ae=document.getElementById("edit_table"),je=document.createElement("br"),xe=document.createElement("br");x.appendChild(K),k.appendChild(U),P.appendChild(F),O.appendChild(R),I.appendChild(W),C.appendChild(V),C.appendChild($),C.appendChild(je),C.appendChild(G),C.appendChild(Y),B.appendChild(Z),Q.appendChild(X),T.appendChild(J),M.appendChild(ee),L.appendChild(le),z.appendChild(de),q.appendChild(te),H.appendChild(ie),S.appendChild(ae),D.appendChild(ne),N.appendChild(_e),N.appendChild(re),N.appendChild(xe),N.appendChild(oe),N.setAttribute("colspan","2"),f.appendChild(x),f.appendChild(k),A.appendChild(P),A.appendChild(O),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),E.appendChild(S),E.appendChild(D),g.appendChild(N),p.appendChild(f),p.appendChild(A),p.appendChild(y),p.appendChild(h),p.appendChild(b),p.appendChild(v),p.appendChild(w),p.appendChild(E),p.appendChild(g),c.appendChild(p),Ae.appendChild(c),add_id_and_name(e,"type_text"),element="input",type="text";var ke=document.createElement("input");ke.setAttribute("type","hidden"),ke.setAttribute("value","type_number"),ke.setAttribute("name",e+"_typeform_id_temp"),ke.setAttribute("id",e+"_typeform_id_temp");var Ie=document.createElement("input");Ie.setAttribute("type","hidden"),Ie.setAttribute("value",r),Ie.setAttribute("name",e+"_requiredform_id_temp"),Ie.setAttribute("id",e+"_requiredform_id_temp");var Ce=document.createElement("input");Ce.setAttribute("type","hidden"),Ce.setAttribute("value",o),Ce.setAttribute("name",e+"_uniqueform_id_temp"),Ce.setAttribute("id",e+"_uniqueform_id_temp");var Be=document.createElement(element);Be.setAttribute("type",type),Be.style.cssText="width:"+l+"px;",Be.setAttribute("id",e+"_elementform_id_temp"),Be.setAttribute("name",e+"_elementform_id_temp"),Be.setAttribute("value",d),Be.setAttribute("title",_),Be.setAttribute("placeholder",_),Be.setAttribute("onKeyPress","return check_isnum(event)");var Qe=document.createElement("div");Qe.setAttribute("id","main_div");var Te=document.createElement("div");Te.setAttribute("id",e+"_elemet_tableform_id_temp");var Me=document.createElement("div");Me.setAttribute("align","left"),Me.style.display="table-cell",Me.style.width=i+"px",Me.setAttribute("id",e+"_label_sectionform_id_temp");var Le=document.createElement("div");Le.setAttribute("align","left"),Le.style.display="table-cell",Le.setAttribute("id",e+"_element_sectionform_id_temp");var ze=document.createElement("span");ze.setAttribute("id",e+"_element_labelform_id_temp"),ze.innerHTML=t,ze.setAttribute("class","label"),ze.style.verticalAlign="top";var qe=document.createElement("span");qe.setAttribute("id",e+"_required_elementform_id_temp"),qe.innerHTML="",qe.setAttribute("class","required"),qe.style.verticalAlign="top","yes"==r&&(qe.innerHTML=" *");var He=document.getElementById("show_table");Me.appendChild(ze),Me.appendChild(qe),Le.appendChild(ke),Le.appendChild(Ie),Le.appendChild(Ce),Le.appendChild(Be),Te.appendChild(Me),Te.appendChild(Le),Qe.appendChild(Te),He.appendChild(Qe),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function type_wdeditor(e,t,i,a,l,d,_,r,o,m,s){document.getElementById("element_type").value="type_wdeditor",delete_last_child();var u=document.createElement("div");u.setAttribute("id","edit_div");var c=document.createElement("table");c.setAttribute("id","edit_main_table"),c.setAttribute("cellpadding","3"),c.setAttribute("cellspacing","0");var p=document.createElement("tr"),f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("td"),A=document.createElement("td"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td");C.style.cssText="padding-top:10px";var B=document.createElement("td"),Q=document.createElement("td");Q.style.cssText="padding-top:10px";var T=document.createElement("td"),M=document.createElement("td");M.style.cssText="padding-top:10px";var L=document.createElement("td"),z=document.createElement("td");z.style.cssText="padding-top:10px";var q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("label");D.setAttribute("class","fm-field-label"),D.setAttribute("for","edit_for_label"),D.innerHTML="Field label";var P=document.createElement("textarea");P.setAttribute("id","edit_for_label"),P.setAttribute("rows","4"),P.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),P.innerHTML=t;var O=document.createElement("label");O.setAttribute("class","fm-field-label"),O.setAttribute("for","edit_for_label_size"),O.innerHTML="Field label size(px) ";var K=document.createElement("input");K.setAttribute("id","edit_for_label_size"),K.setAttribute("type","text"),K.setAttribute("value",i),K.setAttribute("onKeyPress","return check_isnum(event)"),K.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var U=document.createElement("label");U.setAttribute("class","fm-field-label"),U.setAttribute("for","edit_for_label_position_top"),U.innerHTML="Field label position";var F=document.createElement("input");F.setAttribute("id","edit_for_label_position_top"),F.setAttribute("type","radio"),F.setAttribute("value","left"),F.setAttribute("name","edit_for_label_position"),F.setAttribute("onchange","label_left("+e+")"),Left=document.createTextNode("Left");var R=document.createElement("input");R.setAttribute("id","edit_for_label_position_left"),R.setAttribute("type","radio"),R.setAttribute("value","top"),R.setAttribute("name","edit_for_label_position"),R.setAttribute("onchange","label_top("+e+")"),Top=document.createTextNode("Top"),"top"==a?R.setAttribute("checked","checked"):F.setAttribute("checked","checked");var W=document.createElement("label");W.style.cssText="color:#000; font-weight:bold; font-size: 13px",W.innerHTML="Field size(px) ";var V=document.createElement("input");V.setAttribute("id","edit_for_input_size"),V.setAttribute("type","text"),V.setAttribute("value",l),V.style.cssText="margin-right:2px; width: 60px",V.setAttribute("name","edit_for_size"),V.setAttribute("onKeyPress","return check_isnum(event)"),V.setAttribute("onKeyUp","change_w_style('"+e+"_elementform_id_temp', this.value)"),X=document.createTextNode("x");var $=document.createElement("input");$.setAttribute("id","edit_for_input_size"),$.setAttribute("type","text"),$.setAttribute("value",d),$.style.cssText="margin-left:2px; width:60px",$.setAttribute("name","edit_for_size"),$.setAttribute("onKeyPress","return check_isnum(event)"),$.setAttribute("onKeyUp","change_h_style('"+e+"_elementform_id_temp', this.value)");var G=document.createElement("label");G.style.cssText="color:#000; font-weight:bold; font-size: 13px",G.innerHTML="Placeholder";var Y=document.createElement("input");Y.setAttribute("id","el_first_value_input"),Y.setAttribute("type","text"),Y.setAttribute("value",_),Y.setAttribute("onKeyUp","change_input_value(this.value,'"+e+"_elementform_id_temp')");var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","el_send"),Z.innerHTML="Required";var J=document.createElement("input");J.setAttribute("id","el_send"),J.setAttribute("type","checkbox"),J.setAttribute("value","yes"),J.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==r&&J.setAttribute("checked","checked");var ee=document.createElement("label");ee.setAttribute("class","fm-field-label"),ee.setAttribute("for","element_style"),ee.innerHTML="Class name";var te=document.createElement("input");te.setAttribute("id","element_style"),te.setAttribute("type","text"),te.setAttribute("value",o),te.setAttribute("onChange","change_class(this.value,'"+e+"')");var ie=document.createElement("label");ie.setAttribute("class","fm-field-label"),ie.setAttribute("for","el_choices_add"),ie.innerHTML="Additional Attributes";var ae=document.createElement("img");ae.setAttribute("id","el_choices_add"),ae.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),ae.style.cssText="cursor:pointer; margin-left:68px",ae.setAttribute("title","add"),ae.setAttribute("onClick","add_attr("+e+", 'type_text')");var ne=document.createElement("table");ne.setAttribute("id","attributes"),ne.setAttribute("border","0"),ne.style.cssText="margin-left:0px";var le=document.createElement("tr");le.setAttribute("idi","0");var de=document.createElement("th");de.style.cssText="width:100px";var _e=document.createElement("th");_e.style.cssText="width:100px";var re=document.createElement("th");re.style.cssText="width:10px";var oe=document.createElement("label");oe.style.cssText="color:#000; font-weight:bold; font-size: 11px",oe.innerHTML="Name";var me=document.createElement("label");for(me.style.cssText="color:#000; font-weight:bold; font-size: 11px",me.innerHTML="Value",ne.appendChild(le),le.appendChild(de),le.appendChild(_e),le.appendChild(re),de.appendChild(oe),_e.appendChild(me),n=m.length,j=1;j<=n;j++){var se=document.createElement("tr");se.setAttribute("id","attr_row_"+j),se.setAttribute("idi",j);var ue=document.createElement("td");ue.style.cssText="width:100px";var ce=document.createElement("td");ce.style.cssText="width:100px";var pe=document.createElement("td"),fe=document.createElement("input");fe.setAttribute("type","text"),fe.setAttribute("class","fm-field-choice"),fe.setAttribute("value",m[j-1]),fe.setAttribute("id","attr_name"+j),fe.setAttribute("onChange","change_attribute_name("+e+", this, 'type_text')");var ye=document.createElement("input");ye.setAttribute("type","text"),ye.setAttribute("class","fm-field-choice"),ye.setAttribute("value",s[j-1]),ye.setAttribute("id","attr_value"+j),ye.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_text')");var he=document.createElement("img");he.setAttribute("id","el_choices"+j+"_remove"),he.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),he.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",he.setAttribute("align","top"),he.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_text')"),ne.appendChild(se),se.appendChild(ue),se.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),ce.appendChild(ye),pe.appendChild(he)}var be=document.getElementById("edit_table"),ve=document.createElement("br"),we=(document.createElement("br"),document.createElement("br"),document.createElement("br")),ge=(document.createElement("br"),document.createElement("br"),document.createElement("br"));E.appendChild(D),A.appendChild(P),N.appendChild(O),S.appendChild(K),x.appendChild(U),k.appendChild(F),k.appendChild(el_label_left),k.appendChild(ve),k.appendChild(R),k.appendChild(el_label_top),I.appendChild(W),C.appendChild(V),C.appendChild(X),C.appendChild($),B.appendChild(G),Q.appendChild(Y),T.appendChild(ee),M.appendChild(te),L.appendChild(Z),z.appendChild(J),q.appendChild(ie),q.appendChild(ae),q.appendChild(ge),q.appendChild(ne),q.setAttribute("colspan","2"),p.appendChild(E),p.appendChild(A),g.appendChild(N),g.appendChild(S),f.appendChild(x),f.appendChild(k),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),c.appendChild(p),c.appendChild(g),c.appendChild(f),c.appendChild(y),c.appendChild(h),c.appendChild(b),c.appendChild(v),c.appendChild(w),u.appendChild(c),be.appendChild(u),add_id_and_name(e,"type_text"),element="editor";var Ee=document.createElement("input");Ee.setAttribute("type","hidden"),Ee.setAttribute("value","type_wdeditor"),Ee.setAttribute("name",e+"_typeform_id_temp"),Ee.setAttribute("id",e+"_typeform_id_temp");var Ae=document.createElement("input");Ae.setAttribute("type","hidden"),Ae.setAttribute("value",r),Ae.setAttribute("name",e+"_requiredform_id_temp"),Ae.setAttribute("id",e+"_requiredform_id_temp");var je=document.createElement("div");je.setAttribute("id","main_div");var xe=document.createElement("div");xe.setAttribute("id",e+"_elemet_tableform_id_temp");var ke=document.createElement("div");ke.setAttribute("align","left"),ke.style.display="table-cell",ke.style.width=i+"px",ke.setAttribute("id",e+"_label_sectionform_id_temp");var Ie=document.createElement("div");Ie.setAttribute("align","left"),Ie.style.display="table-cell",Ie.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br"),we=document.createElement("br"),document.createElement("br");var Ce=document.createElement("span");Ce.setAttribute("id",e+"_element_labelform_id_temp"),Ce.innerHTML=t,Ce.setAttribute("class","label");var Be=document.createElement("span");Be.setAttribute("id",e+"_required_elementform_id_temp"),Be.innerHTML="",Be.setAttribute("class","required"),"yes"==r&&(Be.innerHTML=" *");var Qe=document.createElement("input");Qe.setAttribute("id",e+"_elementform_id_temp"),Qe.setAttribute("name",e+"_elementform_id_temp"),Qe.setAttribute("type","hidden"),Qe.style.width=l+"px",Qe.style.height=d+"px",Qe.setAttribute("title",_);var Te=document.createElement("span");Te.style.color="red",Te.style.fontStyle="italic",Te.innerHTML="Editor doesn't display in back end",Left=document.createTextNode(e+"_editorform_id_temp");var Me=document.createElement("div");Me.style.display="none";var Le=document.getElementById("show_table");ke.appendChild(Ce),ke.appendChild(Be),Ie.appendChild(Ee),Ie.appendChild(Ae),Ie.appendChild(Qe),Ie.appendChild(Te),Me.appendChild(Left),Ie.appendChild(Me),xe.appendChild(ke),xe.appendChild(Ie),je.appendChild(xe),je.appendChild(we),Le.appendChild(je),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_text")}function change_input_range(e,t){var i="";""!=document.getElementById("el_range_"+e+"1").value&&(i=document.getElementById("el_range_"+e+"1").value),""!=document.getElementById("el_range_"+e+"2").value&&(""==document.getElementById("el_range_"+e+"1").value&&(i="0"),i=i+"."+document.getElementById("el_range_"+e+"2").value),document.getElementById(t+"_range_"+e+"form_id_temp").value=i}function explode(e,t){return 2!=arguments.length||void 0===e||void 0===t?null:""!==e&&!1!==e&&null!==e&&("function"==typeof e||"object"==typeof e||"function"==typeof t||"object"==typeof t?{0:""}:(!0===e&&(e="1"),t.toString().split(e.toString())))}function type_paypal_price(t,e,i,a,l,d,_,r,o,m,s,u,c,p,f){document.getElementById("element_type").value="type_paypal_price",delete_last_child();var y=document.createElement("div");y.setAttribute("id","edit_div");var h=document.createElement("table");h.setAttribute("id","edit_main_table"),h.setAttribute("cellpadding","3"),h.setAttribute("cellspacing","0");var b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("tr"),k=document.createElement("tr"),I=document.createElement("tr"),C=document.createElement("tr"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td");z.style.cssText="line-height:20px";var q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("td"),U=document.createElement("td"),F=document.createElement("td"),R=document.createElement("td"),W=document.createElement("td"),V=document.createElement("td"),$=document.createElement("td"),G=document.createElement("label");G.setAttribute("class","fm-field-label"),G.setAttribute("for","edit_for_label"),G.innerHTML="Field label";var Y=document.createElement("textarea");Y.setAttribute("id","edit_for_label"),Y.setAttribute("rows","4"),Y.setAttribute("onKeyUp","change_label('"+t+"_element_labelform_id_temp', this.value)"),Y.innerHTML=e;var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","edit_for_label_size"),Z.innerHTML="Field label size(px) ";var X=document.createElement("input");X.setAttribute("id","edit_for_label_size"),X.setAttribute("type","text"),X.setAttribute("value",i),X.setAttribute("onKeyPress","return check_isnum(event)"),X.setAttribute("onKeyUp","change_w_style('"+t+"_label_sectionform_id_temp', this.value)");var J=document.createElement("label");J.setAttribute("class","fm-field-label"),J.innerHTML="Field label position";var ee=document.createElement("input");ee.setAttribute("id","edit_for_label_position_top"),ee.setAttribute("type","radio"),ee.setAttribute("name","edit_for_label_position"),ee.setAttribute("onchange","label_left("+t+")");var te=document.createElement("label");te.setAttribute("for","edit_for_label_position_top"),te.innerHTML="Left";var ie=document.createElement("input");ie.setAttribute("id","edit_for_label_position_left"),ie.setAttribute("type","radio"),ie.setAttribute("name","edit_for_label_position"),ie.setAttribute("onchange","label_top("+t+")");var ae=document.createElement("label");ae.setAttribute("for","edit_for_label_position_left"),ae.innerHTML="Top","top"==a?ie.setAttribute("checked","checked"):ee.setAttribute("checked","checked"),w_range_minarray=explode(".",p),w_range_maxarray=explode(".",f);var ne=document.createElement("label");ne.setAttribute("class","fm-field-label"),ne.innerHTML="Range ";var le=document.createTextNode("Min"),de=document.createElement("input");de.setAttribute("type","text"),de.setAttribute("id","el_range_min1"),w_range_minarray[0]&&de.setAttribute("value",w_range_minarray[0]),de.style.cssText="width:60px; margin-right:4px;margin-left:8px",de.setAttribute("onKeyPress","return check_isnum(event)"),de.setAttribute("onChange","change_input_range('min', '"+t+"')");var _e=document.createTextNode("."),re=document.createElement("input");re.setAttribute("type","text"),re.setAttribute("id","el_range_min2"),w_range_minarray[1]&&re.setAttribute("value",w_range_minarray[1]),re.style.cssText="width:30px; margin-left:4px",re.setAttribute("onKeyPress","return check_isnum(event)"),re.setAttribute("onChange","change_input_range('min', '"+t+"')");var oe=document.createTextNode("Max"),me=document.createElement("input");me.setAttribute("type","text"),me.setAttribute("id","el_range_max1"),w_range_maxarray[0]&&me.setAttribute("value",w_range_maxarray[0]),me.style.cssText="width:60px; margin-right:4px; margin-left:7px",me.setAttribute("onKeyPress","return check_isnum(event)"),me.setAttribute("onChange","change_input_range('max', '"+t+"')");var se=document.createTextNode("."),ue=document.createElement("input");ue.setAttribute("type","text"),ue.setAttribute("id","el_range_max2"),w_range_maxarray[1]&&ue.setAttribute("value",w_range_maxarray[1]),ue.style.cssText="width:30px; margin-left:4px",ue.setAttribute("onKeyPress","return check_isnum(event)"),ue.setAttribute("onChange","change_input_range('max', '"+t+"')");var ce=document.createTextNode("-"),pe=document.createElement("label");pe.setAttribute("class","fm-field-label"),pe.setAttribute("for","el_first_value_first"),pe.innerHTML="Placeholder ";var fe=document.createElement("input");fe.setAttribute("id","el_first_value_first"),fe.setAttribute("type","text"),fe.setAttribute("value",d[0]),fe.style.cssText="width:120px; margin-right:4px",fe.setAttribute("onKeyPress","return check_isnum(event)"),fe.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_dollarsform_id_temp')");var ye=document.createElement("input");ye.setAttribute("id","el_first_value_last"),ye.setAttribute("type","text"),ye.setAttribute("value",d[1]),ye.style.cssText="width:67px; margin-left:4px; margin-right:4px",ye.setAttribute("onKeyPress","return check_isnum_interval(event,'"+t+"_element_centsform_id_temp',0,99)"),ye.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_centsform_id_temp')");var he=document.createElement("label");he.setAttribute("class","fm-field-label"),he.setAttribute("for","edit_for_input_size"),he.innerHTML="Field size(px) ";var be=document.createElement("input");be.setAttribute("id","edit_for_input_size"),be.setAttribute("type","text"),be.setAttribute("value",r),be.setAttribute("onKeyPress","return check_isnum(event)"),be.setAttribute("onKeyUp","change_w_style('"+t+"_element_dollarsform_id_temp', this.value);");var ve=document.createElement("label");ve.setAttribute("class","fm-field-label"),ve.setAttribute("for","el_required"),ve.innerHTML="Required";var we=document.createElement("input");we.setAttribute("id","el_required"),we.setAttribute("type","checkbox"),we.setAttribute("onclick","set_required('"+t+"_required')"),"yes"==o&&we.setAttribute("checked","checked");var ge=document.createElement("label");ge.setAttribute("class","fm-field-label"),ge.setAttribute("for","el_hide_cents"),ge.innerHTML="Hide Cents";var Ee=document.createElement("input");Ee.setAttribute("id","el_hide_cents"),Ee.setAttribute("type","checkbox"),Ee.setAttribute("onclick","hide_show_cents(this.checked, "+t+")"),"yes"==m&&Ee.setAttribute("checked","checked");var Ae=document.createElement("label");Ae.setAttribute("class","fm-field-label"),Ae.setAttribute("for","el_style_textarea"),Ae.innerHTML="Class name";var je=document.createElement("input");je.setAttribute("id","el_style_textarea"),je.setAttribute("type","text"),je.setAttribute("value",s),je.setAttribute("onChange","change_class(this.value,'"+t+"')");var xe=document.createElement("label");xe.setAttribute("class","fm-field-label"),xe.innerHTML="Additional Attributes";var ke=document.createElement("img");ke.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),ke.style.cssText="cursor:pointer; margin-left:68px",ke.setAttribute("title","add"),ke.setAttribute("onClick","add_attr("+t+", 'type_paypal_price')");var Ie=document.createElement("table");Ie.setAttribute("id","attributes"),Ie.setAttribute("border","0"),Ie.style.cssText="margin-left:0px";var Ce=document.createElement("tr");Ce.setAttribute("idi","0");var Be=document.createElement("th");Be.style.cssText="width:100px";var Qe=document.createElement("th");Qe.style.cssText="width:100px";var Te=document.createElement("th");Te.style.cssText="width:10px";var Me=document.createElement("label");Me.style.cssText="color:#000; font-weight:bold; font-size: 11px",Me.innerHTML="Name";var Le=document.createElement("label");for(Le.style.cssText="color:#000; font-weight:bold; font-size: 11px",Le.innerHTML="Value",Ie.appendChild(Ce),Ce.appendChild(Be),Ce.appendChild(Qe),Ce.appendChild(Te),Be.appendChild(Me),Qe.appendChild(Le),n=u.length,j=1;j<=n;j++){var ze=document.createElement("tr");ze.setAttribute("id","attr_row_"+j),ze.setAttribute("idi",j);var qe=document.createElement("td");qe.style.cssText="width:100px";var He=document.createElement("td");He.style.cssText="width:100px";var Ne=document.createElement("td"),Se=document.createElement("input");Se.setAttribute("type","text"),Se.setAttribute("class","fm-field-choice"),Se.setAttribute("value",u[j-1]),Se.setAttribute("id","attr_name"+j),Se.setAttribute("onChange","change_attribute_name("+t+", this, 'type_paypal_price')");var De=document.createElement("input");De.setAttribute("type","text"),De.setAttribute("class","fm-field-choice"),De.setAttribute("value",c[j-1]),De.setAttribute("id","attr_value"+j),De.setAttribute("onChange","change_attribute_value("+t+", "+j+", 'type_paypal_price')");var Pe=document.createElement("img");Pe.setAttribute("id","el_choices"+j+"_remove"),Pe.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Pe.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Pe.setAttribute("onClick","remove_attr("+j+", "+t+", 'type_paypal_price')"),Ie.appendChild(ze),ze.appendChild(qe),ze.appendChild(He),ze.appendChild(Ne),qe.appendChild(Se),He.appendChild(De),Ne.appendChild(Pe)}var Oe=document.getElementById("edit_table"),Ke=document.createElement("br"),Ue=document.createElement("br"),Fe=(document.createElement("br"),document.createElement("br"));document.createElement("br"),document.createElement("br"),document.createElement("br");B.appendChild(G),Q.appendChild(Y),V.appendChild(Z),$.appendChild(X),T.appendChild(J),M.appendChild(ee),M.appendChild(te),M.appendChild(Ke),M.appendChild(ie),M.appendChild(ae),L.appendChild(ne),z.appendChild(le),z.appendChild(de),z.appendChild(_e),z.appendChild(re),z.appendChild(Ue),z.appendChild(oe),z.appendChild(me),z.appendChild(se),z.appendChild(ue),R.appendChild(pe),W.appendChild(fe),W.appendChild(ce),W.appendChild(ye),O.appendChild(he),K.appendChild(be),q.appendChild(Ae),H.appendChild(je),N.appendChild(ve),S.appendChild(we),U.appendChild(ge),F.appendChild(Ee),D.appendChild(xe),D.appendChild(ke),D.appendChild(Fe),D.appendChild(Ie),D.setAttribute("colspan","2"),b.appendChild(B),b.appendChild(Q),C.appendChild(V),C.appendChild($),v.appendChild(T),v.appendChild(M),w.appendChild(L),w.appendChild(z),x.appendChild(O),x.appendChild(K),g.appendChild(q),g.appendChild(H),E.appendChild(N),E.appendChild(S),A.appendChild(D),A.appendChild(P),k.appendChild(U),k.appendChild(F),I.appendChild(R),I.appendChild(W),h.appendChild(b),h.appendChild(C),h.appendChild(v),h.appendChild(w),h.appendChild(I),h.appendChild(x),h.appendChild(g),h.appendChild(E),h.appendChild(k),h.appendChild(A),y.appendChild(h),Oe.appendChild(y),add_id_and_name(t,"type_name");var Re=document.createElement("input");Re.setAttribute("type","hidden"),Re.setAttribute("value","type_paypal_price"),Re.setAttribute("name",t+"_typeform_id_temp"),Re.setAttribute("id",t+"_typeform_id_temp");var We=document.createElement("input");We.setAttribute("type","hidden"),We.setAttribute("value",o),We.setAttribute("name",t+"_requiredform_id_temp"),We.setAttribute("id",t+"_requiredform_id_temp");var Ve=document.createElement("input");Ve.setAttribute("type","hidden"),Ve.setAttribute("value",p),Ve.setAttribute("name",t+"_range_minform_id_temp"),Ve.setAttribute("id",t+"_range_minform_id_temp");var $e=document.createElement("input");$e.setAttribute("type","hidden"),$e.setAttribute("value",f),$e.setAttribute("name",t+"_range_maxform_id_temp"),$e.setAttribute("id",t+"_range_maxform_id_temp");var Ge=document.createElement("div");Ge.setAttribute("id","main_div");var Ye=document.createElement("div");Ye.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),Ye.appendChild(edit_labels);var Ze=document.createElement("div");Ze.setAttribute("id",t+"_elemet_tableform_id_temp");var Xe=document.createElement("div");Xe.setAttribute("align","left"),Xe.style.display="table-cell",Xe.style.width=i+"px",Xe.setAttribute("id",t+"_label_sectionform_id_temp");var Je=document.createElement("div");Je.setAttribute("align","left"),Je.style.display="table-cell",Je.setAttribute("id",t+"_element_sectionform_id_temp");var et=document.createElement("div");et.setAttribute("id",t+"_table_price"),et.style.display="table";var tt=document.createElement("div");tt.setAttribute("id",t+"_tr_price1"),tt.style.display="table-row";var it=document.createElement("div");it.setAttribute("id",t+"_tr_price2"),it.style.display="table-row";var at=document.createElement("div");at.setAttribute("id",t+"_td_name_currency"),at.style.display="table-cell";var nt=document.createElement("div");nt.setAttribute("id",t+"_td_name_dollars"),nt.style.display="table-cell";var lt=document.createElement("div");lt.setAttribute("id",t+"_td_name_divider"),lt.style.display="table-cell";var dt=document.createElement("div");dt.setAttribute("id",t+"_td_name_cents"),dt.style.display="table-cell";var _t=document.createElement("div");_t.style.display="table-cell";var rt=document.createElement("div");rt.setAttribute("align","left"),rt.style.display="table-cell";var ot=document.createElement("div");ot.setAttribute("id",t+"_td_name_label_divider"),ot.style.display="table-cell";var mt=document.createElement("div");mt.setAttribute("align","left"),mt.setAttribute("id",t+"_td_name_label_cents"),mt.style.display="table-cell";var st=document.createElement("span");st.setAttribute("id",t+"_element_labelform_id_temp"),st.innerHTML=e,st.setAttribute("class","label"),st.style.verticalAlign="top";var ut=document.createElement("span");ut.setAttribute("id",t+"_required_elementform_id_temp"),ut.innerHTML="",ut.setAttribute("class","required"),ut.style.verticalAlign="top","yes"==o&&(ut.innerHTML=" *");var ct=document.createElement("span");ct.setAttribute("class","wdform_colon"),ct.style.cssText="font-style:bold; vertical-align:middle",ct.innerHTML="\x3c!--repstart--\x3e&nbsp;$&nbsp;\x3c!--repend--\x3e";var pt=document.createElement("label");pt.setAttribute("class","mini_label");var ft=document.createElement("input");ft.setAttribute("type","text"),ft.style.cssText="width:"+r+"px",ft.setAttribute("id",t+"_element_dollarsform_id_temp"),ft.setAttribute("name",t+"_element_dollarsform_id_temp"),ft.setAttribute("value",l[0]),ft.setAttribute("title",d[0]),ft.setAttribute("onKeyPress","return check_isnum(event)");var yt=document.createElement("label");yt.setAttribute("class","mini_label"),yt.setAttribute("id",t+"_mini_label_dollars"),yt.innerHTML=_[0];var ht=document.createElement("span");ht.setAttribute("class","wdform_colon"),ht.style.cssText="font-style:bold; vertical-align:middle",ht.innerHTML="&nbsp;.&nbsp;";var bt=document.createElement("label");bt.setAttribute("class","mini_label");var vt=document.createElement("input");vt.setAttribute("type","text"),vt.style.cssText="width:30px",vt.setAttribute("id",t+"_element_centsform_id_temp"),vt.setAttribute("name",t+"_element_centsform_id_temp"),vt.setAttribute("value",l[1]),vt.setAttribute("title",d[1]),vt.setAttribute("onBlur",'add_0("'+t+'_element_centsform_id_temp")'),vt.setAttribute("onKeyPress","return check_isnum_interval(event,'"+t+"_element_centsform_id_temp',0,99)");var wt=document.createElement("label");wt.setAttribute("class","mini_label"),wt.setAttribute("id",t+"_mini_label_cents"),wt.innerHTML=_[1];var gt=document.getElementById("show_table");Xe.appendChild(st),Xe.appendChild(ut),at.appendChild(ct),nt.appendChild(ft),lt.appendChild(ht),dt.appendChild(vt),tt.appendChild(at),tt.appendChild(nt),tt.appendChild(lt),tt.appendChild(dt),_t.appendChild(pt),rt.appendChild(yt),ot.appendChild(bt),mt.appendChild(wt),it.appendChild(_t),it.appendChild(rt),it.appendChild(ot),it.appendChild(mt),et.appendChild(tt),et.appendChild(it),Je.appendChild(Re),Je.appendChild(We),Je.appendChild(Ve),Je.appendChild($e),Je.appendChild(et),Ze.appendChild(Xe),Ze.appendChild(Je),Ge.appendChild(Ze),Ge.appendChild(Fe),Ge.appendChild(Ye),gt.appendChild(Ge),"top"==a&&label_top(t),"yes"==m&&hide_show_cents(!0,t),change_class(s,t),refresh_attr(t,"type_paypal_price"),jQuery(function(){jQuery("label#"+t+"_mini_label_dollars").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery(e).focus(),jQuery("input.dollars").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_dollars").text(e)})}}),jQuery("label#"+t+"_mini_label_cents").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.cents").focus(),jQuery("input.cents").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_cents").text(e)})}})})}function hide_show_cents(e,t){td_divider=document.getElementById(t+"_td_name_divider"),td_cents=document.getElementById(t+"_td_name_cents"),td_divider_label=document.getElementById(t+"_td_name_label_divider"),td_cents_label=document.getElementById(t+"_td_name_label_cents"),change_input_value("",t+"_element_centsform_id_temp"),document.getElementById("el_first_value_last").value="",document.getElementById(t+"_element_centsform_id_temp").value="",td_cents_label.style.display=e?(td_divider.style.display="none",td_cents.style.display="none",td_divider_label.style.display="none"):(td_divider.style.display="table-cell",td_cents.style.display="table-cell",td_divider_label.style.display="table-cell")}function type_date(e,t,i,a,l,d,_,r,o,m,s,u){document.getElementById("element_type").value="type_date",delete_last_child();var c=document.createElement("div");c.setAttribute("id","edit_div");var p=document.createElement("table");p.setAttribute("id","edit_main_table"),p.setAttribute("cellpadding","3"),p.setAttribute("cellspacing","0");var f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr");b.style.cssText="display:none;";var v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td"),q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("td"),U=document.createElement("label");U.setAttribute("for","edit_for_label"),U.setAttribute("class","fm-field-label"),U.innerHTML="Field label";var F=document.createElement("textarea");F.setAttribute("id","edit_for_label"),F.setAttribute("rows","4"),F.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),F.innerHTML=t;var R=document.createElement("label");R.setAttribute("class","fm-field-label"),R.setAttribute("for","edit_for_label_size"),R.innerHTML="Field label size(px) ";var W=document.createElement("input");W.setAttribute("id","edit_for_label_size"),W.setAttribute("type","text"),W.setAttribute("value",i),W.setAttribute("onKeyPress","return check_isnum(event)"),W.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var V=document.createElement("label");V.setAttribute("class","fm-field-label"),V.innerHTML="Field label position";var $=document.createElement("input");$.setAttribute("id","edit_for_label_position_top"),$.setAttribute("type","radio"),$.setAttribute("name","edit_for_label_position"),$.setAttribute("onchange","label_left("+e+")");var G=document.createElement("label");G.setAttribute("for","edit_for_label_position_top"),G.innerHTML="Left";var Y=document.createElement("input");Y.setAttribute("id","edit_for_label_position_left"),Y.setAttribute("type","radio"),Y.setAttribute("name","edit_for_label_position"),Y.setAttribute("onchange","label_top("+e+")");var Z=document.createElement("label");Z.setAttribute("for","edit_for_label_position_left"),Z.innerHTML="Top","top"==a?Y.setAttribute("checked","checked"):$.setAttribute("checked","checked");var X=document.createElement("label");X.setAttribute("class","fm-field-label"),X.setAttribute("for","date_format"),X.innerHTML="Date format";var J=document.createElement("input");J.setAttribute("id","date_format"),J.setAttribute("type","text"),J.setAttribute("value",r),J.setAttribute("onChange","change_date_format(this.value,'"+e+"', 'format')");var ee=document.createElement("label");ee.setAttribute("class","fm-field-label"),ee.setAttribute("for","button_value"),ee.innerHTML="Date Picker label";var te=document.createElement("input");te.setAttribute("id","button_value"),te.setAttribute("type","text"),te.setAttribute("value",o),te.style.cssText="width:150px;",te.setAttribute("onKeyUp","change_file_value(this.value,'"+e+"_buttonform_id_temp')");var ie=document.createElement("label");ie.setAttribute("class","fm-field-label"),ie.setAttribute("for","el_disable_past_days"),ie.innerHTML="Allow selecting dates starting from current day";var ae=document.createElement("input");ae.setAttribute("id","el_disable_past_days"),ae.setAttribute("type","checkbox"),ae.setAttribute("onclick","change_date_format(this.checked, '"+e+"', 'dis_days')"),"yes"==u&&ae.setAttribute("checked","checked");var ne=document.createElement("label");ne.setAttribute("class","fm-field-label"),ne.setAttribute("for","el_style_textarea"),ne.innerHTML="Class name";var le=document.createElement("input");le.setAttribute("id","el_style_textarea"),le.setAttribute("type","text"),le.setAttribute("value",_),le.setAttribute("onChange","change_class(this.value,'"+e+"')");var de=document.createElement("label");de.setAttribute("class","fm-field-label"),de.setAttribute("for","el_required"),de.innerHTML="Required";var _e=document.createElement("input");_e.setAttribute("id","el_required"),_e.setAttribute("type","checkbox"),_e.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==d&&_e.setAttribute("checked","checked");var re=document.createElement("label");re.setAttribute("class","fm-field-label"),re.innerHTML="Additional Attributes";var oe=document.createElement("img");oe.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),oe.style.cssText="cursor:pointer; margin-left:68px",oe.setAttribute("title","add"),oe.setAttribute("onClick","add_attr("+e+", 'type_date')");var me=document.createElement("table");me.setAttribute("id","attributes"),me.setAttribute("border","0"),me.style.cssText="margin-left:0px";var se=document.createElement("tr");se.setAttribute("idi","0");var ue=document.createElement("th");ue.style.cssText="width:100px";var ce=document.createElement("th");ce.style.cssText="width:100px";var pe=document.createElement("th");pe.style.cssText="width:10px";var fe=document.createElement("label");fe.style.cssText="color:#000; font-weight:bold; font-size: 11px",fe.innerHTML="Name";var ye=document.createElement("label");for(ye.style.cssText="color:#000; font-weight:bold; font-size: 11px",ye.innerHTML="Value",me.appendChild(se),se.appendChild(ue),se.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),ce.appendChild(ye),n=m.length,j=1;j<=n;j++){var he=document.createElement("tr");he.setAttribute("id","attr_row_"+j),he.setAttribute("idi",j);var be=document.createElement("td");be.style.cssText="width:100px";var ve=document.createElement("td");ve.style.cssText="width:100px";var we=document.createElement("td"),ge=document.createElement("input");ge.setAttribute("type","text"),ge.setAttribute("class","fm-field-choice"),ge.setAttribute("value",m[j-1]),ge.setAttribute("id","attr_name"+j),ge.setAttribute("onChange","change_attribute_name("+e+", this, 'type_date')");var Ee=document.createElement("input");Ee.setAttribute("type","text"),Ee.setAttribute("class","fm-field-choice"),Ee.setAttribute("value",s[j-1]),Ee.setAttribute("id","attr_value"+j),Ee.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_date')");var Ae=document.createElement("img");Ae.setAttribute("id","el_choices"+j+"_remove"),Ae.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Ae.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Ae.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_date')"),me.appendChild(he),he.appendChild(be),he.appendChild(ve),he.appendChild(we),be.appendChild(ge),ve.appendChild(Ee),we.appendChild(Ae)}var je=document.getElementById("edit_table"),xe=document.createElement("br"),ke=document.createElement("br");x.appendChild(U),k.appendChild(F),D.appendChild(R),P.appendChild(W),I.appendChild(V),C.appendChild($),C.appendChild(G),C.appendChild(xe),C.appendChild(Y),C.appendChild(Z),B.appendChild(X),Q.appendChild(J),T.appendChild(ee),M.appendChild(te),O.appendChild(ie),K.appendChild(ae),L.appendChild(ne),z.appendChild(le),q.appendChild(de),H.appendChild(_e),N.appendChild(re),N.appendChild(oe),N.appendChild(ke),N.appendChild(me),N.setAttribute("colspan","2"),f.appendChild(x),f.appendChild(k),E.appendChild(D),E.appendChild(P),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),A.appendChild(O),A.appendChild(K),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),g.appendChild(N),g.appendChild(S),p.appendChild(f),p.appendChild(E),p.appendChild(y),p.appendChild(h),p.appendChild(b),p.appendChild(A),p.appendChild(v),p.appendChild(w),p.appendChild(g),c.appendChild(p),je.appendChild(c),add_id_and_name(e,"type_text");var Ie=document.createElement("input");Ie.setAttribute("type","hidden"),Ie.setAttribute("value","type_date"),Ie.setAttribute("name",e+"_typeform_id_temp"),Ie.setAttribute("id",e+"_typeform_id_temp");var Ce=document.createElement("input");Ce.setAttribute("type","hidden"),Ce.setAttribute("value",d),Ce.setAttribute("name",e+"_requiredform_id_temp"),Ce.setAttribute("id",e+"_requiredform_id_temp");var Be=document.createElement("input");Be.setAttribute("type","hidden"),Be.setAttribute("value",u),Be.setAttribute("id",e+"_dis_past_daysform_id_temp"),Be.setAttribute("name",e+"_dis_past_daysform_id_temp");var Qe=document.createElement("div");Qe.setAttribute("id","main_div");var Te=document.createElement("div");Te.setAttribute("id",e+"_elemet_tableform_id_temp");var Me=document.createElement("div");Me.setAttribute("align","left"),Me.style.display="table-cell",Me.style.width=i+"px",Me.setAttribute("id",e+"_label_sectionform_id_temp");var Le=document.createElement("div");Le.setAttribute("align","left"),Le.style.display="table-cell",Le.setAttribute("id",e+"_element_sectionform_id_temp");var ze=document.createElement("div");ze.setAttribute("id",e+"_table_date"),ze.style.display="table";var qe=document.createElement("div");qe.setAttribute("id",e+"_tr_date1"),qe.style.display="table-row";var He=document.createElement("div");He.setAttribute("id",e+"_tr_date2"),He.style.display="table-row";var Ne=document.createElement("div");Ne.setAttribute("id",e+"_td_date_input1"),Ne.style.display="table-cell";var Se=document.createElement("div");Se.setAttribute("id",e+"_td_date_input2"),Se.style.display="table-cell";var De=document.createElement("div");De.setAttribute("id",e+"_td_date_input3"),De.style.display="table-cell";var Pe=document.createElement("div");Pe.setAttribute("id",e+"_td_date_label1"),Pe.style.display="table-cell";var Oe=document.createElement("div");Oe.setAttribute("id",e+"_td_date_label2"),Oe.style.display="table-cell";var Ke=document.createElement("div");Ke.setAttribute("id",e+"_td_date_label3"),Ke.style.display="table-cell";var Ue=document.createElement("br"),Fe=(document.createElement("br"),document.createElement("span"));Fe.setAttribute("id",e+"_element_labelform_id_temp"),Fe.innerHTML=t,Fe.setAttribute("class","label"),Fe.style.verticalAlign="top";var Re=document.createElement("span");Re.setAttribute("id",e+"_required_elementform_id_temp"),Re.innerHTML="",Re.setAttribute("class","required"),Re.style.verticalAlign="top","yes"==d&&(Re.innerHTML=" *");var We=document.createElement("input");We.setAttribute("type","text"),We.setAttribute("value",l),We.setAttribute("class","wdform-date"),We.setAttribute("id",e+"_elementform_id_temp"),We.setAttribute("name",e+"_elementform_id_temp"),We.setAttribute("maxlength","10"),We.setAttribute("size","10");var Ve=document.createElement("input");Ve.setAttribute("id",e+"_buttonform_id_temp"),Ve.setAttribute("class","button"),Ve.setAttribute("type","reset"),Ve.setAttribute("value",o),Ve.setAttribute("format",r);var $e=document.getElementById("show_table");Me.appendChild(Fe),Me.appendChild(Re),Le.appendChild(Ie),Le.appendChild(Ce),Le.appendChild(Be),Le.appendChild(We),Le.appendChild(Ve),Te.appendChild(Me),Te.appendChild(Le),Qe.appendChild(Te),Qe.appendChild(Ue),$e.appendChild(Qe),"top"==a&&label_top(e),change_class(_,e),refresh_attr(e,"type_date")}function form_maker_getElementsByAttribute(e,t,i,a){for(var n,l,d="*"==t&&e.all?e.all:e.getElementsByTagName(t),_=new Array,r=void 0!==a?new RegExp("(^|\\s)"+a+"(\\s|$)"):null,o=0;o<d.length;o++)"string"==typeof(n=(l=d[o]).getAttribute&&l.getAttribute(i))&&0<n.length&&(void 0===a||r&&r.test(n))&&_.push(l);return _}function change_element_attribute(e,t,i){"w_readonly"==i||"w_hide_field"==i?"yes"==document.getElementById(t+"_elementform_id_temp").getAttribute(i)?document.getElementById(t+"_elementform_id_temp").setAttribute(i,"no"):document.getElementById(t+"_elementform_id_temp").setAttribute(i,"yes"):document.getElementById(t+"_elementform_id_temp").setAttribute(i,e)}function change_input_style(e){document.getElementById(e+"_elementform_id_temp").getAttribute("readonly")?document.getElementById(e+"_elementform_id_temp").removeAttribute("readonly"):document.getElementById(e+"_elementform_id_temp").setAttribute("readonly","readonly")}function change_src(e,t,i){for(var a=0;a<=e;a++)document.getElementById(t+"_star_"+a).src=plugin_url+"/images/star_"+document.getElementById(t+"_star_colorform_id_temp").value+".png"}function reset_src(e,t){for(var i=0;i<=e;i++)document.getElementById(t+"_star_"+i).src=plugin_url+"/images/star.png"}function select_star_rating(e,t,i){}function change_range_width(e,t,i){document.getElementById(t+"_elementform_id_temp0").style.cssText="width:"+e+"px",document.getElementById(t+"_elementform_id_temp1").style.cssText="width:"+e+"px",document.getElementById(t+"_range_widthform_id_temp").value=e}function go_to_type_paypal_price(e){w_attr_name=[],w_attr_value=[],w_first_val=["",""],w_title=["",""],w_mini_labels=["Dollars","Cents"],type_paypal_price(e,"Amount","100","left",w_first_val,w_title,w_mini_labels,"100","no","no","",w_attr_name,w_attr_value,"","")}function go_to_type_number(e){w_attr_name=[],w_attr_value=[],type_number(e,"Number:","100","left","200","","","no","no","",w_attr_name,w_attr_value)}function go_to_type_wdeditor(e){w_attr_name=[],w_attr_value=[],type_wdeditor(e,"Editor:","100","left","380","200","","no","",w_attr_name,w_attr_value)}function go_to_type_date(e){w_attr_name=[],w_attr_value=[],type_date(e,"Date:","100","left","","no","","%Y-%m-%d","...",w_attr_name,w_attr_value,"no")}function remove_section_break(e){var t=jQuery("#wdform_field"+e).parent(),i=t.next(),a=t.prev();i.find(".wdform_column").each(function(e,t){var i=a.children().eq(e);!i||i.hasClass("wdform_column_empty")?a.find(".wdform_column_empty").before(t):jQuery(t).find(".wdform_row").each(function(e,t){i.append(t)})}),t.remove(),i.remove()}function fm_remove_section(e){var t=jQuery(".fm-row-deleting").first().closest(".wdform_section"),i=t.prev(".wdform_tr_section_break");if(!e){var a=t.prevAll(".wdform_section:first");if(a.length||(a=t.nextAll(".wdform_section:first")),!a.length)return;t.find(".wdform_column").each(function(e,t){a.append(t)})}i.remove(),t.remove()}function remove_row(e){var t=document.getElementById("wdform_field"+e).parentNode;t.parentNode.removeChild(t)}function destroyChildren(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function show_or_hide(e){jQuery("#form_id_tempform_view"+e).is(":visible")?hide_form_view(e):show_form_view(e)}function show_form_view(e){jQuery("#form_id_tempform_view"+e).show()}function hide_form_view(e){jQuery("#form_id_tempform_view"+e).hide()}function generate_buttons(e){var t;form_view_elemet=document.getElementById("form_id_tempform_view"+e),(t=document.createElement("div")).setAttribute("valign","middle"),t.setAttribute("align","left"),t.style.display="inline-block",t.style.width="40%",page_nav.appendChild(t),form_view_elemet.parentNode.previousSibling&&("DIV"==form_view_elemet.parentNode.previousSibling.tagName?table=!0:form_view_elemet.parentNode.previousSibling.previousSibling&&"DIV"==form_view_elemet.parentNode.previousSibling.previousSibling.tagName?table=!0:table=!1,table&&(form_view_elemet.getAttribute("previous_title")?(previous_title=form_view_elemet.getAttribute("previous_title"),previous_type=form_view_elemet.getAttribute("previous_type"),previous_class=form_view_elemet.getAttribute("previous_class")):(previous_title="Previous",previous_type="button",previous_class=""),next_or_previous="previous",previous=make_pagebreak_button(next_or_previous,previous_title,previous_type,previous_class,e),t.appendChild(previous))),(t=document.createElement("div")).setAttribute("id","page_numbersform_id_temp"+e),t.setAttribute("valign","middle"),t.setAttribute("align","center"),t.style.display="inline-block",t.style.width="20%",page_nav.appendChild(t),(t=document.createElement("div")).setAttribute("valign","middle"),t.setAttribute("align","right"),t.style.display="inline-block",t.style.width="40%",page_nav.appendChild(t),form_view_elemet.parentNode.nextSibling&&("DIV"==form_view_elemet.parentNode.nextSibling.tagName?table=!0:form_view_elemet.parentNode.nextSibling.nextSibling&&"DIV"==form_view_elemet.parentNode.nextSibling.nextSibling.tagName?table=!0:table=!1,table&&(form_view_elemet.getAttribute("previous_title")?(next_title=form_view_elemet.getAttribute("next_title"),next_type=form_view_elemet.getAttribute("next_type"),next_class=form_view_elemet.getAttribute("next_class")):(next_title="Next",next_type="button",next_class=""),next_or_previous="next",next=make_pagebreak_button(next_or_previous,next_title,next_type,next_class,e),t.appendChild(next)))}function generate_page_nav(e){form_view=e,document.getElementById("form_id_tempform_view"+e).parentNode.style.borderWidth="1px",jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".form_id_tempform_view_img").attr("id").split("form_id_tempform_view_img");t=e[1],page_nav=document.getElementById("form_id_temppage_nav"+t),destroyChildren(page_nav),generate_buttons(t)}),generate_page_bar(),refresh_page_numbers()}function remove_page(e){jQuery("#fm_delete_page_id").val(e),fm_popup_toggle("fm_delete_page_popup_container")}function remove_field(e,t){jQuery("#fm_delete_field_id").val(e),fm_popup_toggle("fm_delete_field_popup_container"),void 0!==t&&(t.stopPropagation(),t.preventDefault())}function fm_remove_column_popup(e){jQuery(".wdform_column").removeClass("fm-column-deleting"),jQuery(e).closest(".wdform_column").addClass("fm-column-deleting"),fm_popup_toggle("fm_delete_column_popup_container")}function fm_remove_row_popup(e){jQuery(".wdform_section").removeClass("fm-row-deleting"),jQuery(e).closest(".wdform_section").addClass("fm-row-deleting"),jQuery(e).closest(".wdform_section").find(".wdform_row").length?fm_popup_toggle("fm_delete_row_popup_container"):fm_remove_section(!1)}function fm_remove_column(){jQuery(".fm-column-deleting").remove()}function remove_page_only(){id=jQuery("#fm_delete_page_id").val(),refresh_pages_without_deleting(id)}function remove_page_all(){id=jQuery("#fm_delete_page_id").val(),form_view_elemet=document.getElementById("form_id_tempform_view"+id);var e=jQuery(".wdform-page-and-images").length;if(2==e&&(jQuery(".form_id_tempform_view_img").removeClass("form_view_show").addClass("form_view_hide"),jQuery("*[id*=form_id_temppage_nav]").empty()),1==e)return form_view_elemet.innerHTML="",tbody=form_view_elemet,tr=document.createElement("div"),tr.setAttribute("class","wdform_section"),tr.style.display="table-row",tr_page_nav=document.createElement("div"),tr_page_nav.setAttribute("valign","top"),tr_page_nav.setAttribute("class","wdform_footer"),tr_page_nav.style.width="100%",td_page_nav=document.createElement("div"),td_page_nav.style.width="100%",table_min_page_nav=document.createElement("div"),table_min_page_nav.style.width="100%",table_min_page_nav.style.display="table",tbody_min_page_nav=document.createElement("div"),tbody_min_page_nav.style.display="table-row-group",tr_min_page_nav=document.createElement("div"),tr_min_page_nav.setAttribute("id","form_id_temppage_nav"+form_view),tr_min_page_nav.style.display="table-row",table_min=document.createElement("div"),table_min.setAttribute("class","wdform_column"),tr.appendChild(table_min),tbody_min_page_nav.appendChild(tr_min_page_nav),table_min_page_nav.appendChild(tbody_min_page_nav),td_page_nav.appendChild(table_min_page_nav),tr_page_nav.appendChild(td_page_nav),tbody.appendChild(tr),void tbody.appendChild(tr_page_nav);form_view_table=form_view_elemet.parentNode,document.getElementById("take").removeChild(form_view_table),refresh_pages(id)}function refresh_pages(e){temp=1,destroyChildren(document.getElementById("pages"));var t=jQuery(".wdform-page-and-images").length;generate_page_bar(),1<t?jQuery("#page_bar").removeClass("form_view_hide"):(destroyChildren(document.getElementById("edit_page_navigation")),jQuery("#page_bar").addClass("form_view_hide"),jQuery(".wdform_page").removeAttr("style"))}function refresh_pages_without_deleting(e){var t=jQuery("#form_id_tempform_view"+e);t.find(".wdform_row");2==jQuery(".wdform-page-and-images").length&&(jQuery(".form_id_tempform_view_img").removeClass("form_view_show").addClass("form_view_hide"),jQuery("*[id*=form_id_temppage_nav]").empty());var i=t.parent(),a=i.prevAll(".wdform-page-and-images:first");a.length||(a=i.nextAll(".wdform-page-and-images:first")),a.length&&(i.find(".wdform_section").each(function(e,t){var i=a.find(".wdform_section").eq(e);i.length?jQuery(t).find(".wdform_column:not(:empty)").each(function(e,t){i.append(t)}):a.find(".wdform_row_empty").before(t)}),i.remove(),refresh_pages(e),all_sortable_events())}function make_page_steps_front(){destroyChildren(document.getElementById("pages")),show_title=document.getElementById("el_show_title_input").checked,k=0,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_id_tempform_view")[1],document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages="",k++,page_number=document.createElement("span"),page_number.setAttribute("id","page_"+j),page_number.setAttribute("onClick",'generate_page_nav("'+j+'")'),j==form_view?page_number.setAttribute("class","page_active"):page_number.setAttribute("class","page_deactive"),show_title?page_number.innerHTML=w_pages:page_number.innerHTML=k,document.getElementById("pages").appendChild(page_number)})}function make_page_percentage_front(){destroyChildren(document.getElementById("pages")),show_title=document.getElementById("el_show_title_input").checked;var e=document.createElement("div");e.setAttribute("class","page_percentage_deactive");var t=document.createElement("div");t.setAttribute("id","div_percentage"),t.setAttribute("class","page_percentage_active");var i=document.createElement("b");t.appendChild(i),k=0,cur_page_title="",jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");if(j=e.split("form_id_tempform_view")[1],document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages="",k++,j==form_view){if(show_title){var t=document.createElement("span");1==k?t.style.paddingLeft="30px":t.style.paddingLeft="5px",t.innerHTML=w_pages}page_number=k}}),i.innerHTML=Math.round((page_number-1)/k*100)+"%",t.style.width=(page_number-1)/k*100+"%",e.appendChild(t),cur_page_title&&e.appendChild(cur_page_title),document.getElementById("pages").appendChild(e)}function make_page_none_front(){var e=document.createElement("div");e.innerHTML="NO PAGE BAR",jQuery("#pages").empty(),jQuery("#pages").append(e)}function generate_page_bar(){need_enable=!1,el_page_navigation(),add(0,!1),need_enable=!0}function remove_add_(e){attr_name=new Array,attr_value=new Array;var t=document.getElementById(e);for(atr=t.attributes,v=0;v<30;v++)atr[v]&&0==atr[v].name.indexOf("add_")&&(attr_name.push(atr[v].name.replace("add_","")),attr_value.push(atr[v].value),t.removeAttribute(atr[v].name),v--);for(v=0;v<attr_name.length;v++)t.setAttribute(attr_name[v],attr_value[v])}function duplicate(e,a){if(jQuery("#wdform_field"+e).closest(".wdform_column").after("<div id='cur_column' class='wdform_column'></div>"),type=document.getElementById("wdform_field"+e).getAttribute("type"),document.getElementById(e+"_element_labelform_id_temp").innerHTML&&(w_field_label=document.getElementById(e+"_element_labelform_id_temp").innerHTML),labels=all_labels(),m=0,t=!0,"type_section_break"!=type){for(;t;)for(m++,k=0;k<labels.length&&(t=!0,labels[k]!=w_field_label+"("+m+")");k++)t=!1;w_field_label=w_field_label+"("+m+")"}switch(k=0,w_choices=new Array,w_choices_value=new Array,w_choices_params=new Array,w_choices_checked=new Array,w_choices_disabled=new Array,w_allow_other_num=0,w_property=new Array,w_property_values=new Array,w_choices_price=new Array,t=0,document.getElementById(e+"_label_sectionform_id_temp")&&("block"==document.getElementById(e+"_label_sectionform_id_temp").style.display?w_field_label_pos="top":w_field_label_pos="left"),document.getElementById(e+"_elementform_id_temp")&&(s=document.getElementById(e+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2)),document.getElementById(e+"_label_sectionform_id_temp")&&(s=document.getElementById(e+"_label_sectionform_id_temp").style.width,w_field_label_size=s.substring(0,s.length-2)),document.getElementById(e+"_requiredform_id_temp")&&(w_required=document.getElementById(e+"_requiredform_id_temp").value),document.getElementById(e+"_uniqueform_id_temp")&&(w_unique=document.getElementById(e+"_uniqueform_id_temp").value),document.getElementById(e+"_label_sectionform_id_temp")&&(w_class=document.getElementById(e+"_label_sectionform_id_temp").getAttribute("class"),w_class||(w_class="")),type){case"type_editor":w_editor=document.getElementById("wdform_field"+e).innerHTML,type_editor(gen,w_editor);break;case"type_section_break":w_editor=document.getElementById(e+"_element_sectionform_id_temp").innerHTML,type_section_break(gen,w_editor);break;case"type_send_copy":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").checked,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_send_copy(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_required,w_attr_name,w_attr_value);break;case"type_text":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,w_regExp_status=document.getElementById(e+"_regExpStatusform_id_temp").value,w_regExp_value=unescape(document.getElementById(e+"_regExp_valueform_id_temp").value),w_regExp_common=document.getElementById(e+"_regExp_commonform_id_temp").value,w_regExp_arg=document.getElementById(e+"_regArgumentform_id_temp").value,w_regExp_alert=document.getElementById(e+"_regExp_alertform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_readonly=document.getElementById(e+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,type_text(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_required,w_regExp_status,w_regExp_value,w_regExp_common,w_regExp_arg,w_regExp_alert,w_unique,w_attr_name,w_attr_value,w_readonly);break;case"type_number":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_number(gen,w_field_label,w_field_label_size,w_field_label_pos,w_size,w_first_val,w_title,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_password":w_placeholder_value=document.getElementById(e+"_elementform_id_temp").placeholder,w_verification=document.getElementById(e+"_verification_id_temp").value,document.getElementById(e+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(e+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_password(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_required,w_unique,w_class,w_verification,w_verification_label,w_placeholder_value,w_attr_name,w_attr_value);break;case"type_textarea":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_textarea(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_size_h,w_first_val,w_title,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_wdeditor":w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),w=document.getElementById(e+"_elementform_id_temp").style.width,w_size_w=w.substring(0,w.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_wdeditor(gen,w_field_label,w_field_label_size,w_field_label_pos,w_size_w,w_size_h,w_title,w_required,w_class,w_attr_name,w_attr_value);break;case"type_phone":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title],s=document.getElementById(e+"_element_lastform_id_temp").style.width,w_size=s.substring(0,s.length-2),w_mini_labels=[document.getElementById(e+"_mini_label_area_code").innerHTML,document.getElementById(e+"_mini_label_phone_number").innerHTML],atrs=return_attributes(e+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_phone(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_mini_labels,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_phone_new":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_top_country=document.getElementById(e+"_elementform_id_temp").getAttribute("top-country"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_phone_new(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_top_country,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_name":if(document.getElementById(e+"_enable_fieldsform_id_temp")){w_name_format="normal",w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title];for(var l=["title","middle"],d=0;d<2;d++)w_first_val.push(document.getElementById(e+"_element_"+l[d]+"form_id_temp")?document.getElementById(e+"_element_"+l[d]+"form_id_temp").value:""),w_title.push(document.getElementById(e+"_element_"+l[d]+"form_id_temp")?document.getElementById(e+"_element_"+l[d]+"form_id_temp").title:"")}else document.getElementById(e+"_element_middleform_id_temp")?w_name_format="extended":w_name_format="normal","normal"==w_name_format?(w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title]):(w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value,document.getElementById(e+"_element_titleform_id_temp").value,document.getElementById(e+"_element_middleform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title,document.getElementById(e+"_element_titleform_id_temp").title,document.getElementById(e+"_element_middleform_id_temp").title]);document.getElementById(e+"_mini_label_title")?w_mini_title=document.getElementById(e+"_mini_label_title").innerHTML:w_mini_title="Title",document.getElementById(e+"_mini_label_middle")?w_mini_middle=document.getElementById(e+"_mini_label_middle").innerHTML:w_mini_middle="Middle",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_mini_labels=[w_mini_title,document.getElementById(e+"_mini_label_first").innerHTML,document.getElementById(e+"_mini_label_last").innerHTML,w_mini_middle],w_name_title=document.getElementById(e+"_enable_fieldsform_id_temp")?document.getElementById(e+"_enable_fieldsform_id_temp").getAttribute("title"):"normal"==w_name_format?"no":"yes",w_name_middle=document.getElementById(e+"_enable_fieldsform_id_temp")?document.getElementById(e+"_enable_fieldsform_id_temp").getAttribute("middle"):"normal"==w_name_format?"no":"yes",w_name_fields=[w_name_title,w_name_middle],w_autofill=document.getElementById(e+"_autofillform_id_temp").value,s=document.getElementById(e+"_element_firstform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_name(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_title,w_mini_labels,w_size,w_name_format,w_required,w_unique,w_class,w_attr_name,w_attr_value,w_name_fields,w_autofill);break;case"type_paypal_price":w_first_val=[document.getElementById(e+"_element_dollarsform_id_temp").value,document.getElementById(e+"_element_centsform_id_temp").value],w_title=[document.getElementById(e+"_element_dollarsform_id_temp").title,document.getElementById(e+"_element_centsform_id_temp").title],"none"==document.getElementById(e+"_td_name_cents").style.display?w_hide_cents="yes":w_hide_cents="no",s=document.getElementById(e+"_element_dollarsform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_element_dollarsform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(e+"_range_minform_id_temp").value,w_range_max=document.getElementById(e+"_range_maxform_id_temp").value,w_mini_labels=[document.getElementById(e+"_mini_label_dollars").innerHTML,document.getElementById(e+"_mini_label_cents").innerHTML],type_paypal_price(gen,w_field_label,w_field_label_size,w_field_label_pos,w_first_val,w_title,w_mini_labels,w_size,w_required,w_hide_cents,w_class,w_attr_name,w_attr_value,w_range_min,w_range_max);break;case"type_paypal_price_new":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(e+"_range_minform_id_temp").value,w_range_max=document.getElementById(e+"_range_maxform_id_temp").value,w_readonly=document.getElementById(e+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,"none"==document.getElementById(e+"_td_name_currency").style.display?w_currency="yes":w_currency="no",type_paypal_price_new(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_title,w_size,w_required,w_class,w_attr_name,w_attr_value,w_range_min,w_range_max,w_readonly,w_currency);break;case"type_address":s=document.getElementById(e+"_div_address").style.width,w_size=s.substring(0,s.length-2),document.getElementById(e+"_mini_label_street1")?w_street1=document.getElementById(e+"_mini_label_street1").innerHTML:w_street1=document.getElementById(e+"_street1form_id_temp").value,document.getElementById(e+"_mini_label_street2")?w_street2=document.getElementById(e+"_mini_label_street2").innerHTML:w_street2=document.getElementById(e+"_street2form_id_temp").value,document.getElementById(e+"_mini_label_city")?w_city=document.getElementById(e+"_mini_label_city").innerHTML:w_city=document.getElementById(e+"_cityform_id_temp").value,document.getElementById(e+"_mini_label_state")?w_state=document.getElementById(e+"_mini_label_state").innerHTML:w_state=document.getElementById(e+"_stateform_id_temp").value,document.getElementById(e+"_mini_label_postal")?w_postal=document.getElementById(e+"_mini_label_postal").innerHTML:w_postal=document.getElementById(e+"_postalform_id_temp").value,document.getElementById(e+"_mini_label_country")?w_country=document.getElementById(e+"_mini_label_country").innerHTML:w_country=document.getElementById(e+"_countryform_id_temp").value,w_mini_labels=[w_street1,w_street2,w_city,w_state,w_postal,w_country];var _=document.getElementById(e+"_disable_fieldsform_id_temp");w_street1_dis=_.getAttribute("street1"),w_street2_dis=_.getAttribute("street2"),w_city_dis=_.getAttribute("city"),w_state_dis=_.getAttribute("state"),w_us_states_dis=_.getAttribute("us_states"),w_postal_dis=_.getAttribute("postal"),w_country_dis=_.getAttribute("country"),w_disabled_fields=[w_street1_dis,w_street2_dis,w_city_dis,w_state_dis,w_postal_dis,w_country_dis,w_us_states_dis],w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_street1form_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_address(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_mini_labels,w_disabled_fields,w_required,w_class,w_attr_name,w_attr_value);break;case"type_submitter_mail":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,w_autofill=document.getElementById(e+"_autofillform_id_temp").value,w_verification=document.getElementById(e+"_verification_id_temp").value,w_verification_placeholder=document.getElementById(e+"_1_elementform_id_temp").title,document.getElementById(e+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(e+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_submitter_mail(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_required,w_unique,w_class,w_verification,w_verification_label,w_verification_placeholder,w_attr_name,w_attr_value,w_autofill);break;case"type_checkbox":if(w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,document.getElementById(e+"_rowcol_numform_id_temp").value?(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(e+"_rowcol_numform_id_temp").value):(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,"ver"==w_flow){var r=document.getElementById(e+"_table_little");for(k=0;k<r.childNodes.length;k++){var o=r.childNodes[k];for(m=0;m<o.childNodes.length;m++){var u=o.childNodes[m].getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}}else{var c=(p=(r=document.getElementById(e+"_table_little")).childNodes)[0].childNodes;for(k=0;k<c.length;k++)for(m=0;m<p.length;m++)if(p[m].childNodes[k]){u=(o=p[m].childNodes[k]).getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_checkbox(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_checked,w_rowcol,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_value_disabled,w_choices_value,w_choices_params);break;case"type_paypal_checkbox":for(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,v=0,k=0;k<100;k++)if(document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+k).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+k).checked,document.getElementById(e+"_label_element"+k).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+k).getAttribute("db_info"):w_choices_params[t]="",t++,v=k),document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_checkbox(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_property,w_property_values,w_quantity,w_quantity_value,w_choices_params);break;case"type_radio":if(w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,document.getElementById(e+"_rowcol_numform_id_temp").value?(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(e+"_rowcol_numform_id_temp").value):(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,"ver"==w_flow){r=document.getElementById(e+"_table_little");for(k=0;k<r.childNodes.length;k++){o=r.childNodes[k];for(m=0;m<o.childNodes.length;m++){u=o.childNodes[m].getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}}else{var p;c=(p=(r=document.getElementById(e+"_table_little")).childNodes)[0].childNodes;for(k=0;k<c.length;k++)for(m=0;m<p.length;m++)if(p[m].childNodes[k]){u=(o=p[m].childNodes[k]).getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_radio(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_checked,w_rowcol,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_value_disabled,w_choices_value,w_choices_params);break;case"type_paypal_radio":for(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,v=0,k=0;k<100;k++)if(document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+k).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+k).checked,document.getElementById(e+"_label_element"+k).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+k).getAttribute("db_info"):w_choices_params[t]="",t++,v=k),document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_radio(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_property,w_property_values,w_quantity,w_quantity_value,w_choices_params);break;case"type_paypal_shipping":for(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,v=0,k=0;k<100;k++)if(document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+k).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+k).checked,document.getElementById(e+"_label_element"+k).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+k).getAttribute("db_info"):w_choices_params[t]="",t++,v=k),document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_shipping(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_property,w_property_values,w_choices_params);break;case"type_paypal_total":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_size=jQuery("#"+e+"paypal_totalform_id_temp").css("width")?jQuery("#"+e+"paypal_totalform_id_temp").css("width").substring(0,jQuery("#"+e+"paypal_totalform_id_temp").css("width").length-2):"300",type_paypal_total(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_class,w_size);break;case"type_stripe":type_stripe(gen,w_size,w_field_label_size,w_field_label_pos,w_class);break;case"type_star_rating":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_star_amount=document.getElementById(e+"_star_amountform_id_temp").value,w_field_label_col=document.getElementById(e+"_star_colorform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_star_rating(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_label_col,w_star_amount,w_required,w_class,w_attr_name,w_attr_value);break;case"type_scale_rating":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_mini_labels=[document.getElementById(e+"_mini_label_worst").innerHTML,document.getElementById(e+"_mini_label_best").innerHTML],w_scale_amount=document.getElementById(e+"_scale_amountform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_scale_rating(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_mini_labels,w_scale_amount,w_required,w_class,w_attr_name,w_attr_value);break;case"type_spinner":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(e+"_min_valueform_id_temp").value,w_field_max_value=document.getElementById(e+"_max_valueform_id_temp").value,w_field_width=document.getElementById(e+"_spinner_widthform_id_temp").value,w_field_step=document.getElementById(e+"_stepform_id_temp").value,w_field_value=document.getElementById(e+"_elementform_id_temp").getAttribute("aria-valuenow"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_spinner(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value);break;case"type_slider":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(e+"_slider_min_valueform_id_temp").value,w_field_max_value=document.getElementById(e+"_slider_max_valueform_id_temp").value,w_field_step=document.getElementById(e+"_slider_stepform_id_temp")&&document.getElementById(e+"_slider_stepform_id_temp").value?document.getElementById(e+"_slider_stepform_id_temp").value:1,w_field_width=document.getElementById(e+"_slider_widthform_id_temp").value,w_field_value=document.getElementById(e+"_slider_valueform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_slider(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value);break;case"type_range":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_range_width=document.getElementById(e+"_range_widthform_id_temp").value,w_field_range_step=document.getElementById(e+"_range_stepform_id_temp").value,w_field_value1=document.getElementById(e+"_elementform_id_temp0").getAttribute("aria-valuenow"),w_field_value2=document.getElementById(e+"_elementform_id_temp1").getAttribute("aria-valuenow"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_mini_labels=[document.getElementById(e+"_mini_label_from").innerHTML,document.getElementById(e+"_mini_label_to").innerHTML],type_range(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_range_width,w_field_range_step,w_field_value1,w_field_value2,w_mini_labels,w_required,w_class,w_attr_name,w_attr_value);break;case"type_grading":for(w_total=document.getElementById(e+"_grading_totalform_id_temp").value,w_items=[],k=0;k<100;k++)document.getElementById(e+"_label_elementform_id_temp"+k)&&w_items.push(document.getElementById(e+"_label_elementform_id_temp"+k).innerHTML);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_grading(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_items,w_total,w_required,w_class,w_attr_name,w_attr_value),refresh_grading_items(e);break;case"type_matrix":for(w_rows=[],w_rows[0]="",k=1;k<100;k++)document.getElementById(e+"_label_elementform_id_temp"+k+"_0")&&w_rows.push(document.getElementById(e+"_label_elementform_id_temp"+k+"_0").innerHTML);for(w_columns=[],w_columns[0]="",k=1;k<100;k++)document.getElementById(e+"_label_elementform_id_temp0_"+k)&&w_columns.push(document.getElementById(e+"_label_elementform_id_temp0_"+k).innerHTML);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_input_type=document.getElementById(e+"_input_typeform_id_temp").value,w_textbox_size=document.getElementById(e+"_textbox_sizeform_id_temp")?document.getElementById(e+"_textbox_sizeform_id_temp").value:"100",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_matrix(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_input_type,w_rows,w_columns,w_required,w_class,w_attr_name,w_attr_value,w_textbox_size),refresh_matrix(e);break;case"type_time":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_hhform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_hh=document.getElementById(e+"_hhform_id_temp").value,w_mm=document.getElementById(e+"_mmform_id_temp").value,document.getElementById(e+"_ssform_id_temp")?(w_ss=document.getElementById(e+"_ssform_id_temp").value,w_sec="1",w_mini_label_ss=document.getElementById(e+"_mini_label_ss").innerHTML):(w_ss="",w_sec="0",w_mini_label_ss=""),document.getElementById(e+"_am_pm_select")?(w_am_pm=document.getElementById(e+"_am_pmform_id_temp").value,w_time_type="12",w_mini_labels=[document.getElementById(e+"_mini_label_hh").innerHTML,document.getElementById(e+"_mini_label_mm").innerHTML,w_mini_label_ss,document.getElementById(e+"_mini_label_am_pm").innerHTML]):(w_am_pm=0,w_time_type="24",w_mini_labels=[document.getElementById(e+"_mini_label_hh").innerHTML,document.getElementById(e+"_mini_label_mm").innerHTML,w_mini_label_ss,"AM/PM"]),type_time(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_time_type,w_am_pm,w_sec,w_hh,w_mm,w_ss,w_mini_labels,w_required,w_class,w_attr_name,w_attr_value);break;case"type_date":atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(e+"_elementform_id_temp").value,w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no",type_date(gen,w_field_label,w_field_label_size,w_field_label_pos,w_date,w_required,w_class,w_format,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_new":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(e+"_elementform_id_temp").value,w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_start_day=document.getElementById(e+"_start_dayform_id_temp").value,w_default_date=document.getElementById(e+"_default_date_id_temp").value,w_min_date=document.getElementById(e+"_min_date_id_temp").value,w_max_date=document.getElementById(e+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(e+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(e+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(e+"_show_imageform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no";var f=document.getElementById(e+"_show_week_days");w_sunday=f.getAttribute("sunday"),w_monday=f.getAttribute("monday"),w_tuesday=f.getAttribute("tuesday"),w_wednesday=f.getAttribute("wednesday"),w_thursday=f.getAttribute("thursday"),w_friday=f.getAttribute("friday"),w_saturday=f.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],type_date_new(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_range":atrs=return_attributes(e+"_elementform_id_temp0"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date="",w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_default_date_start=document.getElementById(e+"_default_date_id_temp_start").value,w_default_date_end=document.getElementById(e+"_default_date_id_temp_end").value,w_min_date=document.getElementById(e+"_min_date_id_temp").value,w_start_day=document.getElementById(e+"_start_dayform_id_temp").value,w_max_date=document.getElementById(e+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(e+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(e+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(e+"_show_imageform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,s=document.getElementById(e+"_elementform_id_temp0").style.width,w_size=s.substring(0,s.length-2),w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no";f=document.getElementById(e+"_show_week_days");w_sunday=f.getAttribute("sunday"),w_monday=f.getAttribute("monday"),w_tuesday=f.getAttribute("tuesday"),w_wednesday=f.getAttribute("wednesday"),w_thursday=f.getAttribute("thursday"),w_friday=f.getAttribute("friday"),w_saturday=f.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],type_date_range(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date_start,w_default_date_end,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_fields":atrs=return_attributes(e+"_dayform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_day=document.getElementById(e+"_dayform_id_temp").value,w_month=document.getElementById(e+"_monthform_id_temp").value,w_year=document.getElementById(e+"_yearform_id_temp").value,w_day_type=document.getElementById(e+"_dayform_id_temp").tagName,w_month_type=document.getElementById(e+"_monthform_id_temp").tagName,w_year_type=document.getElementById(e+"_yearform_id_temp").tagName,w_day_label=document.getElementById(e+"_day_label").innerHTML,w_month_label=document.getElementById(e+"_month_label").innerHTML,w_year_label=document.getElementById(e+"_year_label").innerHTML,s=document.getElementById(e+"_dayform_id_temp").style.width,w_day_size=s.substring(0,s.length-2),s=document.getElementById(e+"_monthform_id_temp").style.width,w_month_size=s.substring(0,s.length-2),s=document.getElementById(e+"_yearform_id_temp").style.width,w_year_size=s.substring(0,s.length-2),w_from=document.getElementById(e+"_yearform_id_temp").getAttribute("from"),w_to=document.getElementById(e+"_yearform_id_temp").getAttribute("to"),w_divider=document.getElementById(e+"_separator1").innerHTML,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,type_date_fields(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_day,w_month,w_year,w_day_type,w_month_type,w_year_type,w_day_label,w_month_label,w_year_label,w_day_size,w_month_size,w_year_size,w_required,w_class,w_from,w_to,w_divider,w_attr_name,w_attr_value);break;case"type_own_select":jQuery("#"+e+"_elementform_id_temp option").each(function(){w_choices[t]=jQuery(this).html(),w_choices_value[t]=jQuery(this).val(),w_choices_checked[t]=jQuery(this)[0].selected,jQuery(this).attr("where")?w_choices_params[t]=jQuery(this).attr("where")+"[where_order_by]"+jQuery(this).attr("order_by")+"[db_info]"+jQuery(this).attr("db_info"):w_choices_params[t]="",jQuery(this).val()?w_choices_disabled[t]=!1:w_choices_disabled[t]=!0,t++}),w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_own_select(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_choices,w_choices_checked,w_required,w_value_disabled,w_class,w_attr_name,w_attr_value,w_choices_disabled,w_choices_value,w_choices_params);break;case"type_paypal_select":for(jQuery("#"+e+"_elementform_id_temp option").each(function(){w_choices[t]=jQuery(this).html(),w_choices_price[t]=jQuery(this).val(),w_choices_checked[t]=jQuery(this)[0].selected,jQuery(this).attr("where")?w_choices_params[t]=jQuery(this).attr("where")+"[where_order_by]"+jQuery(this).attr("order_by")+"[db_info]"+jQuery(this).attr("db_info"):w_choices_params[t]="",""==jQuery(this)[0].value?w_choices_disabled[t]=!0:w_choices_disabled[t]=!1,t++}),k=0;k<100;k++)if(document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_select(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_choices,w_choices_price,w_choices_checked,w_required,w_quantity,w_quantity_value,w_class,w_attr_name,w_attr_value,w_choices_disabled,w_property,w_property_values,w_choices_params);break;case"type_country":for(w_countries=[],select_=document.getElementById(e+"_elementform_id_temp"),n=select_.childNodes.length,i=0;i<n;i++)w_countries.push(select_.childNodes[i].value);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_country(gen,w_field_label,w_field_label_size,w_hide_label,w_countries,w_field_label_pos,w_size,w_required,w_class,w_attr_name,w_attr_value);break;case"type_file_upload":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_destination=document.getElementById(e+"_destination").value.replace("***destinationverj"+e+"***","").replace("***destinationskizb"+e+"***",""),w_extension=document.getElementById(e+"_extension").value.replace("***extensionverj"+e+"***","").replace("***extensionskizb"+e+"***",""),w_max_size=document.getElementById(e+"_max_size").value.replace("***max_sizeverj"+e+"***","").replace("***max_sizeskizb"+e+"***",""),w_multiple=document.getElementById(e+"_elementform_id_temp").getAttribute("multiple")?"yes":"no",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_file_upload(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_destination,w_extension,w_max_size,w_required,w_multiple,w_class,w_attr_name,w_attr_value);break;case"type_map":for(w_lat=[],w_long=[],w_info=[],w_center_x=document.getElementById(e+"_elementform_id_temp").getAttribute("center_x"),w_center_y=document.getElementById(e+"_elementform_id_temp").getAttribute("center_y"),w_zoom=document.getElementById(e+"_elementform_id_temp").getAttribute("zoom"),w_width=parseInt(document.getElementById(e+"_elementform_id_temp").style.width),w_height=parseInt(document.getElementById(e+"_elementform_id_temp").style.height),j=0;j<=20;j++)document.getElementById(e+"_elementform_id_temp").getAttribute("lat"+j)&&(w_lat.push(document.getElementById(e+"_elementform_id_temp").getAttribute("lat"+j)),w_long.push(document.getElementById(e+"_elementform_id_temp").getAttribute("long"+j)),w_info.push(document.getElementById(e+"_elementform_id_temp").getAttribute("info"+j)));atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_map(gen,w_center_x,w_center_y,w_long,w_lat,w_zoom,w_width,w_height,w_class,w_info,w_attr_name,w_attr_value);break;case"type_mark_map":w_info=document.getElementById(e+"_elementform_id_temp").getAttribute("info0"),w_long=document.getElementById(e+"_elementform_id_temp").getAttribute("long0"),w_lat=document.getElementById(e+"_elementform_id_temp").getAttribute("lat0"),w_zoom=document.getElementById(e+"_elementform_id_temp").getAttribute("zoom"),w_width=parseInt(document.getElementById(e+"_elementform_id_temp").style.width),w_height=parseInt(document.getElementById(e+"_elementform_id_temp").style.height),w_center_x=document.getElementById(e+"_elementform_id_temp").getAttribute("center_x"),w_center_y=document.getElementById(e+"_elementform_id_temp").getAttribute("center_y"),w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_mark_map(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_center_x,w_center_y,w_long,w_lat,w_zoom,w_width,w_height,w_class,w_info,w_attr_name,w_attr_value);break;case"type_submit_reset":atrs=return_attributes(e+"_element_submitform_id_temp"),w_act=!("none"==document.getElementById(e+"_element_resetform_id_temp").style.display),w_attr_name=atrs[0],w_attr_value=atrs[1],w_submit_title=document.getElementById(e+"_element_submitform_id_temp").value,w_reset_title=document.getElementById(e+"_element_resetform_id_temp").value,type_submit_reset(gen,w_submit_title,w_reset_title,w_class,w_act,w_attr_name,w_attr_value);break;case"type_button":for(w_title=new Array,w_func=new Array,t=0,v=0,k=0;k<100;k++)document.getElementById(e+"_elementform_id_temp"+k)&&(w_title[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_func[t]=document.getElementById(e+"_elementform_id_temp"+k).getAttribute("onclick"),t++,v=k);atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_button(gen,w_title,w_func,w_class,w_attr_name,w_attr_value);break;case"type_hidden":w_value=document.getElementById(e+"_elementform_id_temp").value,w_name=document.getElementById(e+"_elementform_id_temp").name,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_hidden(gen,w_name,w_value,w_attr_name,w_attr_value)}add(0,need_enable=!1),need_enable=!0,void 0!==a&&(a.stopPropagation(),a.preventDefault())}function fm_columns_refresh(){jQuery(".wdform_column:not(#add_field_cont):empty").remove(),jQuery(".fm-form-builder .wdform_column:not(#add_field_cont)").before(jQuery('<div class="wdform_column fm-hidden"></div>')),jQuery(".fm-form-builder .wdform_column:not(#add_field_cont):last-child").after(jQuery('<div class="wdform_column fm-hidden"></div>')),jQuery(".fm-form-builder .wdform_section").each(function(){var e=jQuery(this);0==e.find(".wdform_column").length&&e.append('<div class="wdform_column"></div>')}),sortable_columns()}function fm_rows_refresh(){jQuery(".wdform_page").each(function(){jQuery(this).children(".wdform_row_empty").remove(),0===jQuery(this).find(".wdform_row_empty").length&&jQuery(this).find(".wdform_footer").before(jQuery('<div class="wdform_row_empty"><div><span class="add_row_icon fm-ico-plus-circle"></span><span class="add_row_button">'+form_maker_manage.add_column+"</span></div></div>"))}),jQuery(".wdform_row_empty > div").off("click").on("click",function(){var e=jQuery('<div><div class="wdform_column"></div></div>').addClass("wdform_section");jQuery(this).closest(".wdform_row_empty").before(e),fm_row_handle(e),all_sortable_events()}),sortable_columns()}function fm_convert_form_structure(){jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.addClass("fm-form-builder");e.find(".wdform_section").length;e.find(".wdform_section").each(function(){var t=jQuery(this),a=t.find(".wdform_column").length;t.find(".wdform_column").each(function(){var e=jQuery(this),i=jQuery('<div class="wdform_section '+("fm-col-"+a)+'"></div>');e.find(".wdform_row").each(function(){var e=jQuery(this),t=jQuery('<div class="wdform_column"></div>').append(e);i.append(t)}),t.before(i),fm_row_handle(i)}),t.remove()})}),jQuery(".wdform_tr_section_break").remove(),all_sortable_events(),jQuery("#fm-edit-disable-overlay").remove()}function FormManageSubmitButton(i){for(null==i&&(i=!1,jQuery(window).off("beforeunload")),tox="",form_fields="",jQuery("#saving").html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>'),remove_whitespace(document.getElementById("take")),l_id_array=labels_id_array,l_label_array=labels_label_array,l_type_array=labels_type_array,l_id_removed=[],x=0;x<l_id_array.length;x++)l_id_removed[l_id_array[x]]=!0;if(jQuery(".wdform_page[id^='form_id_tempform_view']").each(function(){var e=jQuery(this).attr("id").replace("form_id_tempform_view","");if(document.getElementById("form_id_tempform_view"+e))for(wdform_page=document.getElementById("form_id_tempform_view"+e),remove_whitespace(wdform_page),n=wdform_page.childNodes.length-1,q=0;q<=n;q++)if(wdform_page.childNodes[q].getAttribute("wdid"))id=wdform_page.childNodes[q].getAttribute("wdid"),w_editor=document.getElementById(id+"_element_sectionform_id_temp").innerHTML,form_fields+=id+"*:*id*:*",form_fields+="type_section_break*:*type*:*",form_fields+="custom_"+id+"*:*w_field_label*:*",form_fields+=w_editor+"*:*w_editor*:*",form_fields+="*:*new_field*:*",i||(wdform_page.childNodes[q].innerHTML="%"+id+" - custom_"+id+"%");else if(-1==wdform_page.className.indexOf("fm-form-builder")||-1!=wdform_page.childNodes[q].className.indexOf("wdform_section"))for(wdform_section=wdform_page.childNodes[q],x=0;x<wdform_section.childNodes.length;x++)if(wdform_column=wdform_section.childNodes[x],wdform_column.firstChild)for(y=0;y<wdform_column.childNodes.length;y++)if(is_in_old=!1,wdform_row=wdform_column.childNodes[y],3!=wdform_row.nodeType&&(wdid=wdform_row.getAttribute("wdid"),wdid&&jQuery("#"+wdid+"_element_labelform_id_temp").length)){l_id=wdid,l_label=document.getElementById(wdid+"_element_labelform_id_temp").innerHTML,l_label=l_label.replace(/(\r\n|\n|\r)/gm," "),wdtype=wdform_row.firstChild.getAttribute("type");for(var t=0;t<l_id_array.length;t++)"type_address"==l_type_array[t]?(document.getElementById(l_id+"_mini_label_street1")||document.getElementById(l_id+"_mini_label_street2")||document.getElementById(l_id+"_mini_label_city")||document.getElementById(l_id+"_mini_label_state")||document.getElementById(l_id+"_mini_label_postal")||document.getElementById(l_id+"_mini_label_country"))&&(l_id_removed[l_id_array[t]]=!1):l_id_array[t]==wdid&&(l_id_removed[l_id]=!1);"type_address"==wdtype?(addr_id=parseInt(wdid),id_for_country=addr_id,document.getElementById(id_for_country+"_mini_label_street1")&&(tox=tox+addr_id+"#**id**#"+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+"#**label**#type_address#****#"),addr_id++,document.getElementById(id_for_country+"_mini_label_street2")&&(tox=tox+addr_id+"#**id**#"+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+"#**label**#type_address#****#"),addr_id++,document.getElementById(id_for_country+"_mini_label_city")&&(tox=tox+addr_id+"#**id**#"+document.getElementById(id_for_country+"_mini_label_city").innerHTML+"#**label**#type_address#****#"),addr_id++,document.getElementById(id_for_country+"_mini_label_state")&&(tox=tox+addr_id+"#**id**#"+document.getElementById(id_for_country+"_mini_label_state").innerHTML+"#**label**#type_address#****#"),addr_id++,document.getElementById(id_for_country+"_mini_label_postal")&&(tox=tox+addr_id+"#**id**#"+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+"#**label**#type_address#****#"),addr_id++,document.getElementById(id_for_country+"_mini_label_country")&&(tox=tox+addr_id+"#**id**#"+document.getElementById(id_for_country+"_mini_label_country").innerHTML+"#**label**#type_address#****#")):tox=tox+wdid+"#**id**#"+l_label+"#**label**#"+wdtype+"#****#",id=wdid,form_fields+=wdid+"*:*id*:*",form_fields+=wdtype+"*:*type*:*",w_choices=new Array,w_choices_value=new Array,w_choices_checked=new Array,w_choices_disabled=new Array,w_choices_params=new Array,w_allow_other_num=0,w_property=new Array,w_property_type=new Array,w_property_values=new Array,w_choices_price=new Array,document.getElementById(id+"_element_labelform_id_temp").innerHTML?w_field_label=document.getElementById(id+"_element_labelform_id_temp").innerHTML.replace(/(\r\n|\n|\r)/gm," "):w_field_label=" ",document.getElementById(id+"_label_sectionform_id_temp")&&("block"==document.getElementById(id+"_label_sectionform_id_temp").style.display?w_field_label_pos="top":w_field_label_pos="left"),document.getElementById(id+"_elementform_id_temp")&&(s=document.getElementById(id+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2)),document.getElementById(id+"_label_sectionform_id_temp")&&(s=document.getElementById(id+"_label_sectionform_id_temp").style.width,w_field_label_size=s.substring(0,s.length-2)),document.getElementById(id+"_requiredform_id_temp")&&(w_required=document.getElementById(id+"_requiredform_id_temp").value),document.getElementById(id+"_uniqueform_id_temp")&&(w_unique=document.getElementById(id+"_uniqueform_id_temp").value),document.getElementById(id+"_label_sectionform_id_temp")&&(w_class=document.getElementById(id+"_label_sectionform_id_temp").getAttribute("class"),w_class||(w_class="")),gen_form_fields(),i||(wdform_row.innerHTML="%"+id+" - "+l_label+"%")}}),(""==tox||""==form_fields)&&jQuery(".wdform_page .wdform_row").length)return alert("Form state you are trying to save is corrupted.\nPlease review your changes to identify the problem and try to save it again.\nThe form will reset now."),location.reload(),!1;for(i||(document.getElementById("label_order_current").value=fm_base64EncodeUnicode(fm_htmlentities(tox))),x=0;x<l_id_array.length;x++)l_id_removed[l_id_array[x]]&&(tox=tox+l_id_array[x]+"#**id**#"+l_label_array[x]+"#**label**#"+l_type_array[x]+"#****#");if(i||(document.getElementById("take").style.display="none",document.getElementById("page_bar").style.display="none",jQuery(".wdform_section").each(function(){var e=this;jQuery(e).find(".wdform_column").each(function(){!jQuery(this).html()&&1<jQuery(e).children().length&&jQuery(this).remove(),jQuery(this).find(".wdform_section_handle").remove()}),jQuery(this).find(".wdform_row_handle").remove(),jQuery(this).find(".wdform_column_empty").remove()}),jQuery(".wdform_row_empty").remove(),jQuery(".wdform_column:empty").remove(),jQuery(".fm-section-overlay").remove()),i||(document.getElementById("label_order").value=fm_base64EncodeUnicode(fm_htmlentities(tox)),document.getElementById("form_fields").value=fm_base64EncodeUnicode(fm_htmlentities(form_fields)),refresh_(),document.getElementById("pagination").value=document.getElementById("pages").getAttribute("type"),document.getElementById("show_title").value=document.getElementById("pages").getAttribute("show_title"),document.getElementById("show_numbers").value=document.getElementById("pages").getAttribute("show_numbers")),form_changed=!1,i){form_fields!=form_fields_initial&&(form_changed=!0),jQuery(".fm-check-change").each(function(){jQuery(this).val()!=jQuery(this).attr("data-initial-value")&&(form_changed=!0)}),"undefined"!=typeof tinyMCE&&null!=tinyMCE.get("header_description")&&tinyMCE.get("header_description").isDirty()&&(form_changed=!0);var e=decodeURIComponent(jQuery("#header_description_initial_value").val()),t=jQuery("#header_description").val();jQuery("<span>"+e+"</span>").html()!=jQuery("<span>"+t+"</span>").html()&&(form_changed=!0),jQuery("#header_hide_image").prop("checked")!=(1==jQuery("#header_hide_image").attr("data-initial-value"))&&(form_changed=!0)}return!i||!form_changed}function fm_base64EncodeUnicode(e){return utf8Bytes=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}),btoa(utf8Bytes)}function fm_htmlentities(e){var t=document.createElement("div"),i=document.createTextNode(e);return t.style.cssText="display:none",t.appendChild(i),t.innerHTML}function formOnload(rows){for(t=0;t<rows;t++)if(document.getElementById(t+"_typeform_id_temp"))if("type_map"==document.getElementById(t+"_typeform_id_temp").value||"type_mark_map"==document.getElementById(t+"_typeform_id_temp").value)for(if_gmap_init(t),q=0;q<20;q++)document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)&&(w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)),w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q)),w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q)),add_marker_on_map(t,q,w_long,w_lat,w_info,!1));else if("type_name"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("#"+myu+"_mini_label_first").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.first").focus(),jQuery("input.first").blur(function(){var e=document.getElementById("first").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_first").text(t)})}}),jQuery("label#"+myu+"_mini_label_last").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.last").focus(),jQuery("input.last").blur(function(){var e=document.getElementById("last").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_last").text(t)})}}),jQuery("label#"+myu+"_mini_label_title").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.title_").focus(),jQuery("input.title_").blur(function(){var e=document.getElementById("title_").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_title").text(t)})}}),jQuery("label#"+myu+"_mini_label_middle").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=document.getElementById("middle").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_middle").text(t)})}})})}else if("type_phone"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("label#"+myu+"_mini_label_area_code").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.area_code").focus(),jQuery("input.area_code").blur(function(){var e=document.getElementById("area_code").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_area_code").text(t)})}}),jQuery("label#"+myu+"_mini_label_phone_number").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.phone_number").focus(),jQuery("input.phone_number").blur(function(){var e=document.getElementById("phone_number").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_phone_number").text(t)})}})})}else if("type_date_fields"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("label#"+myu+"_day_label").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.day").focus(),jQuery("input.day").blur(function(){var e=document.getElementById("day").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_day_label").text(t)})}}),jQuery("label#"+myu+"_month_label").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.month").focus(),jQuery("input.month").blur(function(){var e=document.getElementById("month").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_month_label").text(t)})}}),jQuery("label#"+myu+"_year_label").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.year").focus(),jQuery("input.year").blur(function(){var e=document.getElementById("year").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_year_label").text(t)})}})})}else if("type_time"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("label#"+myu+"_mini_label_hh").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.hh").focus(),jQuery("input.hh").blur(function(){var e=document.getElementById("hh").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_hh").text(t)})}}),jQuery("label#"+myu+"_mini_label_mm").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.mm").focus(),jQuery("input.mm").blur(function(){var e=document.getElementById("mm").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_mm").text(t)})}}),jQuery("label#"+myu+"_mini_label_ss").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.ss").focus(),jQuery("input.ss").blur(function(){var e=document.getElementById("ss").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_ss").text(t)})}}),jQuery("label#"+myu+"_mini_label_am_pm").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.am_pm").focus(),jQuery("input.am_pm").blur(function(){var e=document.getElementById("am_pm").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_am_pm").text(t)})}})})}else if("type_paypal_price"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("#"+myu+"_mini_label_dollars").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.dollars").focus(),jQuery("input.dollars").blur(function(){var e=document.getElementById("dollars").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_dollars").text(t)})}}),jQuery("label#"+myu+"_mini_label_cents").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.cents").focus(),jQuery("input.cents").blur(function(){var e=document.getElementById("cents").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_cents").text(t)})}})})}else if("type_address"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("label#"+myu+"_mini_label_street1").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.street1").focus(),jQuery("input.street1").blur(function(){var e=document.getElementById("street1").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_street1").text(t)})}}),jQuery("label#"+myu+"_mini_label_street2").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.street2").focus(),jQuery("input.street2").blur(function(){var e=document.getElementById("street2").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_street2").text(t)})}}),jQuery("label#"+myu+"_mini_label_city").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.city").focus(),jQuery("input.city").blur(function(){var e=document.getElementById("city").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_city").text(t)})}}),jQuery("label#"+myu+"_mini_label_state").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.state").focus(),jQuery("input.state").blur(function(){var e=document.getElementById("state").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_state").text(t)})}}),jQuery("label#"+myu+"_mini_label_postal").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.postal").focus(),jQuery("input.postal").blur(function(){var e=document.getElementById("postal").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_postal").text(t)})}}),jQuery("label#"+myu+"_mini_label_country").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.country").focus(),jQuery("input.country").blur(function(){var e=document.getElementById("country").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_country").text(t)})}})})}else if("type_scale_rating"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(function(){jQuery("#"+myu+"_mini_label_worst").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.worst").focus(),jQuery("input.worst").blur(function(){var e=document.getElementById("worst").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_worst").text(t)})}}),jQuery("label#"+myu+"_mini_label_best").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.best").focus(),jQuery("input.best").blur(function(){var e=document.getElementById("best").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_best").text(t)})}})})}else if("type_spinner"==document.getElementById(t+"_typeform_id_temp").value){var spinner_value=document.getElementById(t+"_elementform_id_temp").value,spinner_min_value=document.getElementById(t+"_min_valueform_id_temp").value,spinner_max_value=document.getElementById(t+"_max_valueform_id_temp").value,spinner_step=document.getElementById(t+"_stepform_id_temp").value;jQuery("#"+t+"_elementform_id_temp")[0].spin=null,spinner=jQuery("#"+t+"_elementform_id_temp").spinner(),null==spinner_value&&spinner.spinner("value",""),jQuery("#"+t+"_elementform_id_temp").spinner({min:spinner_min_value}),jQuery("#"+t+"_elementform_id_temp").spinner({max:spinner_max_value}),jQuery("#"+t+"_elementform_id_temp").spinner({step:spinner_step})}else if("type_slider"==document.getElementById(t+"_typeform_id_temp").value){var slider_value=document.getElementById(t+"_slider_valueform_id_temp").value,slider_min_value=document.getElementById(t+"_slider_min_valueform_id_temp").value,slider_max_value=document.getElementById(t+"_slider_max_valueform_id_temp").value,slider_element_value=document.getElementById(t+"_element_valueform_id_temp"),slider_value_save=document.getElementById(t+"_slider_valueform_id_temp");jQuery("#"+t+"_elementform_id_temp")[0].slide=null,jQuery(function(){jQuery("#"+t+"_elementform_id_temp").slider({range:"min",value:eval(slider_value),min:eval(slider_min_value),max:eval(slider_max_value),slide:function(e,t){slider_element_value.innerHTML=""+t.value,slider_value_save.value=""+t.value}})})}else if("type_range"==document.getElementById(t+"_typeform_id_temp").value){var spinner_value0=document.getElementById(t+"_elementform_id_temp0").value,spinner_step=document.getElementById(t+"_range_stepform_id_temp").value;jQuery("#"+t+"_elementform_id_temp0")[0].spin=null,jQuery("#"+t+"_elementform_id_temp1")[0].spin=null,spinner0=jQuery("#"+t+"_elementform_id_temp0").spinner(),null==spinner_value0&&spinner0.spinner("value",""),jQuery("#"+t+"_elementform_id_temp0").spinner({step:spinner_step});var spinner_value1=document.getElementById(t+"_elementform_id_temp1").value;spinner1=jQuery("#"+t+"_elementform_id_temp1").spinner(),null==spinner_value1&&spinner1.spinner("value",""),jQuery("#"+t+"_elementform_id_temp1").spinner({step:spinner_step});var myu=t;jQuery(function(){jQuery("#"+myu+"_mini_label_from").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.from").focus(),jQuery("input.from").blur(function(){var e=document.getElementById("from").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_from").text(t)})}}),jQuery("label#"+myu+"_mini_label_to").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.to").focus(),jQuery("input.to").blur(function(){var e=document.getElementById("to").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_to").text(t)})}})})}else if("type_date_range"==document.getElementById(t+"_typeform_id_temp").value){var default_date_start=jQuery("#"+t+"_default_date_id_temp_start").val(),default_date_end=jQuery("#"+t+"_default_date_id_temp_end").val(),date_format=jQuery("#"+t+"_buttonform_id_temp").attr("format");jQuery("#"+t+"_elementform_id_temp0").datepicker(),jQuery("#"+t+"_elementform_id_temp1").datepicker(),jQuery("#"+t+"_elementform_id_temp0").datepicker("option","dateFormat",date_format),jQuery("#"+t+"_elementform_id_temp1").datepicker("option","dateFormat",date_format),"today"==default_date_start?jQuery("#"+t+"_elementform_id_temp0").datepicker("setDate",new Date):(-1==default_date_start.indexOf("d")&&-1==default_date_start.indexOf("m")&&-1==default_date_start.indexOf("y")&&-1==default_date_start.indexOf("w")&&""!==default_date_start&&(default_date_start=jQuery.datepicker.formatDate(date_format,new Date(default_date_start))),jQuery("#"+t+"_elementform_id_temp0").datepicker("setDate",default_date_start)),"today"==default_date_end?jQuery("#"+t+"_elementform_id_temp1").datepicker("setDate",new Date):(-1==default_date_end.indexOf("d")&&-1==default_date_end.indexOf("m")&&-1==default_date_end.indexOf("y")&&-1==default_date_end.indexOf("w")&&""!==default_date_end&&(default_date_end=jQuery.datepicker.formatDate(date_format,new Date(default_date_end))),jQuery("#"+t+"_elementform_id_temp1").datepicker("setDate",default_date_end))}else if("type_date_new"==document.getElementById(t+"_typeform_id_temp").value){var default_date=jQuery("#"+t+"_default_date_id_temp").val(),date_format=jQuery("#"+t+"_buttonform_id_temp").attr("format");jQuery("#"+t+"_elementform_id_temp").datepicker(),jQuery("#"+t+"_elementform_id_temp").datepicker("option","dateFormat",date_format),"today"==default_date?jQuery("#"+t+"_elementform_id_temp").datepicker("setDate",new Date):(-1==default_date.indexOf("d")&&-1==default_date.indexOf("m")&&-1==default_date.indexOf("y")&&-1==default_date.indexOf("w")&&""!==default_date&&(default_date=jQuery.datepicker.formatDate(date_format,new Date(default_date))),jQuery("#"+t+"_elementform_id_temp").datepicker("setDate",default_date))}else"type_phone_new"==document.getElementById(t+"_typeform_id_temp").value&&(jQuery("#"+t+"_elementform_id_temp").intlTelInput({nationalMode:!1,preferredCountries:[jQuery("#"+t+"_elementform_id_temp").attr("top-country")]}),jQuery("#"+t+"_elementform_id_temp").intlTelInput("setNumber",jQuery("#"+t+"_elementform_id_temp").val()));remove_whitespace(document.getElementById("take")),form_view=1,form_view_max=1;var form_view_count=jQuery(".wdform-page-and-images").length;if(jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id").split("form_id_tempform_view"),t=parseInt(e[1]);form_view_max=t>form_view_max?t:form_view_max,page_toolbar_wrap=document.createElement("div"),page_toolbar_wrap.setAttribute("id","form_id_tempform_view_img"+t),page_toolbar_wrap.setAttribute("class","form_id_tempform_view_img"),page_title=document.createElement("div"),page_title.setAttribute("class","wdform_page_title"),page_title.innerHTML='<span class="fm-ico-draggable"></span>'+document.getElementById("form_id_tempform_view"+t).getAttribute("page_title"),page_toolbar_wrap.appendChild(page_title),page_toolbar=document.createElement("div");var i="none"==document.getElementById("form_id_tempform_view"+t).style.display?"fm-ico-expand":"fm-ico-collapse",a=document.createElement("span");a.setAttribute("title","Show or hide the page"),a.setAttribute("class","page_toolbar dashicons "+i),a.setAttribute("id","show_page_img_"+t),a.setAttribute("onClick",'show_or_hide("'+t+'"); change_show_hide_icon(this);');var n=document.createElement("span");n.setAttribute("title","Delete the page"),n.setAttribute("class","page_toolbar fm-ico-delete"),n.setAttribute("onclick",'remove_page("'+t+'")');var l=document.createElement("span");l.setAttribute("title","Edit the page"),l.setAttribute("class","page_toolbar fm-ico-edit"),l.setAttribute("onclick",'edit_page_break("'+t+'")'),page_toolbar.appendChild(n),page_toolbar.appendChild(l),page_toolbar.appendChild(a),page_toolbar_wrap.appendChild(page_toolbar);var d=document.getElementById("form_id_tempform_view"+t).parentNode;d.insertBefore(page_toolbar_wrap,d.childNodes[0])}),1<form_view_count){firstid=jQuery(".wdform_page").first().attr("id"),firstid=firstid.split("form_id_tempform_view"),first_form_view=firstid[1],form_view=form_view_max,need_enable=!1,generate_page_nav(first_form_view);var icon_edit=document.createElement("span");icon_edit.setAttribute("class","fm-ico-edit"),icon_edit.setAttribute("onclick","el_page_navigation()");var edit_page_navigation=document.getElementById("edit_page_navigation");edit_page_navigation.appendChild(icon_edit),document.getElementById("page_navigation").appendChild(edit_page_navigation),jQuery("#page_bar").removeClass("form_view_hide")}else jQuery("#page_bar").addClass("form_view_hide");1==form_view_count&&jQuery(".form_id_tempform_view_img").addClass("form_view_hide")}function change_show_hide_icon(e){jQuery(e).toggleClass("fm-ico-collapse").toggleClass("fm-ico-expand")}function edit_page_break(e){enable2(),document.getElementById("editing_id").value=e,form_view_element=document.getElementById("form_id_tempform_view"+e),page_title=form_view_element.getAttribute("page_title"),form_view_element.getAttribute("next_title")?(next_title=form_view_element.getAttribute("next_title"),next_type=form_view_element.getAttribute("next_type"),next_class=form_view_element.getAttribute("next_class"),next_checkable=form_view_element.getAttribute("next_checkable"),previous_title=form_view_element.getAttribute("previous_title"),previous_type=form_view_element.getAttribute("previous_type"),previous_class=form_view_element.getAttribute("previous_class"),previous_checkable=form_view_element.getAttribute("previous_checkable"),w_title=[next_title,previous_title],w_type=[next_type,previous_type],w_class=[next_class,previous_class],w_check=[next_checkable,previous_checkable]):(w_title=["Next","Previous"],w_type=["text","text"],w_class=["",""],w_check=["true","true"]),w_attr_name=[],w_attr_value=[],type_page_break(e,page_title,w_title,w_type,w_class,w_check,w_attr_name,w_attr_value)}function fm_popup_toggle(e){jQuery("#"+e).toggleClass("hidden"),jQuery("body").toggleClass("fm-disable-scroll")}function storageAvailable(e){try{var t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==t.length}}function fm_check_something_really_important(){return is7=jQuery(".wdform_field:not([type=type_section_break])").length,9<=is7&&(fm_limitation_alert(!0),!0)}function filter(e){var t=jQuery(e).val().toLowerCase();if(jQuery(".filtered-fields .inside").html(""),""!=t){var i=!1;jQuery(".field_types_cont .postbox").addClass("hide"),jQuery(".field_types .postbox:not(.filtered-fields) .wd-button").each(function(){"-1"!=jQuery(this).html().toLowerCase().indexOf(t)&&(jQuery(".filtered-fields .inside").append(jQuery(this).clone()),i=!0)}),i||jQuery(".filtered-fields .inside").html(form_maker.nothing_found),jQuery(".field_types_cont .filtered-fields").removeClass("hide")}else jQuery(".field_types_cont .postbox").removeClass("hide"),jQuery(".field_types_cont .filtered-fields").addClass("hide")}function Enable(){for(k=1;k<=form_view_max;k++)if(document.getElementById("form_id_tempform_view"+k))for(wdform_page=document.getElementById("form_id_tempform_view"+k),remove_whitespace(wdform_page),n=wdform_page.childNodes.length-2,z=0;z<=n;z++)if(!wdform_page.childNodes[z].getAttribute("wdid"))for(wdform_section=wdform_page.childNodes[z],x=0;x<wdform_section.childNodes.length;x++)if(wdform_column=wdform_section.childNodes[x],wdform_column.firstChild)for(y=0;y<wdform_column.childNodes.length;y++)wdform_row=wdform_column.childNodes[y],wdid=wdform_row.getAttribute("wdid"),wdid}function enable2(){fm_add_field_button(),jQuery(".add-popup").slideToggle(200),jQuery(".popup-title").html(form_maker.edit_field),jQuery(".wd-add-button").html(form_maker.update),jQuery(".field_types").hide(),jQuery("#field_container").addClass("field_container_full")}function edit(e,a){switch(need_enable&&enable2(),document.getElementById("editing_id").value=e,type=document.getElementById("wdform_field"+e).getAttribute("type"),k=0,w_choices=new Array,w_choices_value=new Array,w_choices_params=new Array,w_choices_checked=new Array,w_choices_disabled=new Array,f=0,h=new Array,b=new Array,w_choices_price=new Array,t=0,document.getElementById(e+"_element_labelform_id_temp").innerHTML?w_field_label=document.getElementById(e+"_element_labelform_id_temp").innerHTML:w_field_label=" ",document.getElementById(e+"_label_sectionform_id_temp")&&("block"==document.getElementById(e+"_label_sectionform_id_temp").style.display?w_field_label_pos="top":w_field_label_pos="left"),document.getElementById(e+"_elementform_id_temp")&&(s=document.getElementById(e+"_elementform_id_temp").style.width,""==s?w_size=s:w_size=s.substring(0,s.length-2)),document.getElementById(e+"_label_sectionform_id_temp")&&(s=document.getElementById(e+"_label_sectionform_id_temp").style.width,""==s?w_field_label_size=s:w_field_label_size=s.substring(0,s.length-2)),document.getElementById(e+"_requiredform_id_temp")&&(w_required=document.getElementById(e+"_requiredform_id_temp").value),document.getElementById(e+"_uniqueform_id_temp")&&(w_unique=document.getElementById(e+"_uniqueform_id_temp").value),document.getElementById(e+"_label_sectionform_id_temp")&&(w_class=document.getElementById(e+"_label_sectionform_id_temp").getAttribute("class"),w_class||(w_class="")),type){case"type_editor":w_editor=document.getElementById("wdform_field"+e).innerHTML,type_editor(e,w_editor);break;case"type_section_break":w_editor=document.getElementById(e+"_element_sectionform_id_temp").innerHTML,type_section_break(e,w_editor);break;case"type_send_copy":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").checked,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_send_copy(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_required,w_attr_name,w_attr_value);break;case"type_text":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,w_regExp_status=document.getElementById(e+"_regExpStatusform_id_temp").value,w_regExp_value=unescape(document.getElementById(e+"_regExp_valueform_id_temp").value),w_regExp_common=document.getElementById(e+"_regExp_commonform_id_temp").value,w_regExp_arg=document.getElementById(e+"_regArgumentform_id_temp").value,w_regExp_alert=document.getElementById(e+"_regExp_alertform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_readonly=document.getElementById(e+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,type_text(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_required,w_regExp_status,w_regExp_value,w_regExp_common,w_regExp_arg,w_regExp_alert,w_unique,w_attr_name,w_attr_value,w_readonly,w_class);break;case"type_number":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_number(e,w_field_label,w_field_label_size,w_field_label_pos,w_size,w_first_val,w_title,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_password":w_placeholder_value=document.getElementById(e+"_elementform_id_temp").placeholder,w_verification=document.getElementById(e+"_verification_id_temp").value,document.getElementById(e+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(e+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_password(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_required,w_unique,w_class,w_verification,w_verification_label,w_placeholder_value,w_attr_name,w_attr_value);break;case"type_textarea":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_textarea(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_size_h,w_first_val,w_title,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_wdeditor":w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),w=document.getElementById(e+"_elementform_id_temp").style.width,w_size_w=w.substring(0,w.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_wdeditor(e,w_field_label,w_field_label_size,w_field_label_pos,w_size_w,w_size_h,w_title,w_required,w_class,w_attr_name,w_attr_value);break;case"type_phone":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title],s=document.getElementById(e+"_element_lastform_id_temp").style.width,w_size=s.substring(0,s.length-2),w_mini_labels=[document.getElementById(e+"_mini_label_area_code").innerHTML,document.getElementById(e+"_mini_label_phone_number").innerHTML],atrs=return_attributes(e+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_phone(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_mini_labels,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_phone_new":var l=jQuery("#"+e+"_elementform_id_temp").intlTelInput("getSelectedCountryData");w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_top_country=l.iso2,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_phone_new(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_top_country,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_name":if(document.getElementById(e+"_enable_fieldsform_id_temp")){w_name_format="normal",w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title];for(var d=["title","middle"],_=0;_<2;_++)w_first_val.push(document.getElementById(e+"_element_"+d[_]+"form_id_temp")?document.getElementById(e+"_element_"+d[_]+"form_id_temp").value:""),w_title.push(document.getElementById(e+"_element_"+d[_]+"form_id_temp")?document.getElementById(e+"_element_"+d[_]+"form_id_temp").title:"")}else document.getElementById(e+"_element_middleform_id_temp")?w_name_format="extended":w_name_format="normal","normal"==w_name_format?(w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title]):(w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value,document.getElementById(e+"_element_titleform_id_temp").value,document.getElementById(e+"_element_middleform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title,document.getElementById(e+"_element_titleform_id_temp").title,document.getElementById(e+"_element_middleform_id_temp").title]);document.getElementById(e+"_mini_label_title")?w_mini_title=document.getElementById(e+"_mini_label_title").innerHTML:w_mini_title="Title",document.getElementById(e+"_mini_label_middle")?w_mini_middle=document.getElementById(e+"_mini_label_middle").innerHTML:w_mini_middle="Middle",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_mini_labels=[w_mini_title,document.getElementById(e+"_mini_label_first").innerHTML,document.getElementById(e+"_mini_label_last").innerHTML,w_mini_middle],w_name_title=document.getElementById(e+"_enable_fieldsform_id_temp")?document.getElementById(e+"_enable_fieldsform_id_temp").getAttribute("title"):"normal"==w_name_format?"no":"yes",w_name_middle=document.getElementById(e+"_enable_fieldsform_id_temp")?document.getElementById(e+"_enable_fieldsform_id_temp").getAttribute("middle"):"normal"==w_name_format?"no":"yes",w_name_fields=[w_name_title,w_name_middle],w_autofill=document.getElementById(e+"_autofillform_id_temp").value,s=document.getElementById(e+"_element_firstform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_name(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_title,w_mini_labels,w_size,w_name_format,w_required,w_unique,w_class,w_attr_name,w_attr_value,w_name_fields,w_autofill);break;case"type_paypal_price":w_first_val=[document.getElementById(e+"_element_dollarsform_id_temp").value,document.getElementById(e+"_element_centsform_id_temp").value],w_title=[document.getElementById(e+"_element_dollarsform_id_temp").title,document.getElementById(e+"_element_centsform_id_temp").title],"none"==document.getElementById(e+"_td_name_cents").style.display?w_hide_cents="yes":w_hide_cents="no",s=document.getElementById(e+"_element_dollarsform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_element_dollarsform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(e+"_range_minform_id_temp").value,w_range_max=document.getElementById(e+"_range_maxform_id_temp").value,w_mini_labels=[document.getElementById(e+"_mini_label_dollars").innerHTML,document.getElementById(e+"_mini_label_cents").innerHTML],type_paypal_price(e,w_field_label,w_field_label_size,w_field_label_pos,w_first_val,w_title,w_mini_labels,w_size,w_required,w_hide_cents,w_class,w_attr_name,w_attr_value,w_range_min,w_range_max);break;case"type_paypal_price_new":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(e+"_range_minform_id_temp").value,w_range_max=document.getElementById(e+"_range_maxform_id_temp").value,w_readonly=document.getElementById(e+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,"none"==document.getElementById(e+"_td_name_currency").style.display?w_currency="yes":w_currency="no",type_paypal_price_new(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_title,w_size,w_required,w_class,w_attr_name,w_attr_value,w_range_min,w_range_max,w_readonly,w_currency);break;case"type_address":s=document.getElementById(e+"_div_address").style.width,w_size=s.substring(0,s.length-2),document.getElementById(e+"_mini_label_street1")?w_street1=document.getElementById(e+"_mini_label_street1").innerHTML:w_street1=document.getElementById(e+"_street1form_id_temp").value,document.getElementById(e+"_mini_label_street2")?w_street2=document.getElementById(e+"_mini_label_street2").innerHTML:w_street2=document.getElementById(e+"_street2form_id_temp").value,document.getElementById(e+"_mini_label_city")?w_city=document.getElementById(e+"_mini_label_city").innerHTML:w_city=document.getElementById(e+"_cityform_id_temp").value,document.getElementById(e+"_mini_label_state")?w_state=document.getElementById(e+"_mini_label_state").innerHTML:w_state=document.getElementById(e+"_stateform_id_temp").value,document.getElementById(e+"_mini_label_postal")?w_postal=document.getElementById(e+"_mini_label_postal").innerHTML:w_postal=document.getElementById(e+"_postalform_id_temp").value,document.getElementById(e+"_mini_label_country")?w_country=document.getElementById(e+"_mini_label_country").innerHTML:w_country=document.getElementById(e+"_countryform_id_temp").value,w_mini_labels=[w_street1,w_street2,w_city,w_state,w_postal,w_country];var r=document.getElementById(e+"_disable_fieldsform_id_temp");w_street1_dis=r.getAttribute("street1"),w_street2_dis=r.getAttribute("street2"),w_city_dis=r.getAttribute("city"),w_state_dis=r.getAttribute("state"),w_us_states_dis=r.getAttribute("us_states"),w_postal_dis=r.getAttribute("postal"),w_country_dis=r.getAttribute("country"),w_disabled_fields=[w_street1_dis,w_street2_dis,w_city_dis,w_state_dis,w_postal_dis,w_country_dis,w_us_states_dis],w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_street1form_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_address(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_mini_labels,w_disabled_fields,w_required,w_class,w_attr_name,w_attr_value);break;case"type_submitter_mail":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,w_autofill=document.getElementById(e+"_autofillform_id_temp").value,w_verification=document.getElementById(e+"_verification_id_temp").value,w_verification_placeholder=document.getElementById(e+"_1_elementform_id_temp").title,document.getElementById(e+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(e+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_submitter_mail(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_required,w_unique,w_class,w_verification,w_verification_label,w_verification_placeholder,w_attr_name,w_attr_value,w_autofill);break;case"type_checkbox":if(w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,document.getElementById(e+"_rowcol_numform_id_temp").value?(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(e+"_rowcol_numform_id_temp").value):(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,"ver"==w_flow){var o=document.getElementById(e+"_table_little");for(k=0;k<o.childNodes.length;k++){var u=o.childNodes[k];for(m=0;m<u.childNodes.length;m++){var c=u.childNodes[m].getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&(f=t),w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+c).value,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}}else{var p=(y=(o=document.getElementById(e+"_table_little")).childNodes)[0].childNodes;for(k=0;k<p.length;k++)for(m=0;m<y.length;m++)if(y[m].childNodes[k]){c=(u=y[m].childNodes[k]).getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&(f=t),w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+c).value,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_checkbox(e,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_checked,w_rowcol,w_required,w_randomize,w_allow_other,f,w_class,w_attr_name,w_attr_value,w_value_disabled,w_choices_value,w_choices_params);break;case"type_paypal_checkbox":document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value;var f=v=0;o=document.getElementById(e+"_table_little");for(k=0;k<o.childNodes.length;k++){u=o.childNodes[k];for(m=0;m<u.childNodes.length;m++){c=u.childNodes[m].getAttribute("idi");w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+c).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}for("hor"==w_flow&&flow_hor(e),k=0;k<100;k++)if(document.getElementById(e+"_propertyform_id_temp"+k))if(h.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(b[h.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)b[h.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else b.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_checkbox(e,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,f,w_class,w_attr_name,w_attr_value,h,b,w_quantity,w_quantity_value,w_choices_params);break;case"type_radio":if(w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,document.getElementById(e+"_rowcol_numform_id_temp").value?(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(e+"_rowcol_numform_id_temp").value):(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,"ver"==w_flow){o=document.getElementById(e+"_table_little");for(k=0;k<o.childNodes.length;k++){u=o.childNodes[k];for(m=0;m<u.childNodes.length;m++){c=u.childNodes[m].getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&(f=t),w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+c).value,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}}else{var y;p=(y=(o=document.getElementById(e+"_table_little")).childNodes)[0].childNodes;for(k=0;k<p.length;k++)for(m=0;m<y.length;m++)if(y[m].childNodes[k]){c=(u=y[m].childNodes[k]).getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+c).getAttribute("other")&&(f=t),w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+c).value,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_radio(e,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_checked,w_rowcol,w_required,w_randomize,w_allow_other,f,w_class,w_attr_name,w_attr_value,w_value_disabled,w_choices_value,w_choices_params);break;case"type_paypal_radio":document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value;f=v=0,o=document.getElementById(e+"_table_little");for(k=0;k<o.childNodes.length;k++){u=o.childNodes[k];for(m=0;m<u.childNodes.length;m++){c=u.childNodes[m].getAttribute("idi");w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+c).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}for("hor"==w_flow&&flow_hor(e),k=0;k<100;k++)if(document.getElementById(e+"_propertyform_id_temp"+k))if(h.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(b[h.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)b[h.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else b.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_radio(e,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,f,w_class,w_attr_name,w_attr_value,h,b,w_quantity,w_quantity_value,w_choices_params);break;case"type_paypal_shipping":document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value;f=v=0,o=document.getElementById(e+"_table_little");for(k=0;k<o.childNodes.length;k++){u=o.childNodes[k];for(m=0;m<u.childNodes.length;m++){c=u.childNodes[m].getAttribute("idi");w_choices[t]=document.getElementById(e+"_label_element"+c).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+c).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+c).checked,document.getElementById(e+"_label_element"+c).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+c).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+c).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+c).getAttribute("db_info"):w_choices_params[t]="",t++,v=c}}"hor"==w_flow&&flow_hor(e);var h=[],b=[];document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_shipping(e,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,f,w_class,w_attr_name,w_attr_value,h,b,w_choices_params);break;case"type_paypal_total":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_size=jQuery("#"+e+"paypal_totalform_id_temp").css("width")?jQuery("#"+e+"paypal_totalform_id_temp").css("width").substring(0,jQuery("#"+e+"paypal_totalform_id_temp").css("width").length-2):"300",type_paypal_total(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_class,w_size);break;case"type_stripe":type_stripe(e,w_size,w_field_label_size,w_field_label_pos,w_class);break;case"type_star_rating":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_star_amount=document.getElementById(e+"_star_amountform_id_temp").value,w_field_label_col=document.getElementById(e+"_star_colorform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_star_rating(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_label_col,w_star_amount,w_required,w_class,w_attr_name,w_attr_value);break;case"type_scale_rating":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_mini_labels=[document.getElementById(e+"_mini_label_worst").innerHTML,document.getElementById(e+"_mini_label_best").innerHTML],w_scale_amount=document.getElementById(e+"_scale_amountform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_scale_rating(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_mini_labels,w_scale_amount,w_required,w_class,w_attr_name,w_attr_value);break;case"type_spinner":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(e+"_min_valueform_id_temp").value,w_field_max_value=document.getElementById(e+"_max_valueform_id_temp").value,w_field_width=document.getElementById(e+"_spinner_widthform_id_temp").value,w_field_step=document.getElementById(e+"_stepform_id_temp").value,w_field_value=document.getElementById(e+"_elementform_id_temp").getAttribute("aria-valuenow"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_spinner(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value);break;case"type_slider":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(e+"_slider_min_valueform_id_temp").value,w_field_max_value=document.getElementById(e+"_slider_max_valueform_id_temp").value,w_field_step=document.getElementById(e+"_slider_stepform_id_temp")&&document.getElementById(e+"_slider_stepform_id_temp").value?document.getElementById(e+"_slider_stepform_id_temp").value:1,w_field_width=document.getElementById(e+"_slider_widthform_id_temp").value,w_field_value=document.getElementById(e+"_slider_valueform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_slider(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value);break;case"type_range":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_range_width=document.getElementById(e+"_range_widthform_id_temp").value,w_field_range_step=document.getElementById(e+"_range_stepform_id_temp").value,w_field_value1=document.getElementById(e+"_elementform_id_temp0").getAttribute("aria-valuenow"),w_field_value2=document.getElementById(e+"_elementform_id_temp1").getAttribute("aria-valuenow"),atrs=return_attributes(e+"_elementform_id_temp0"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_mini_labels=[document.getElementById(e+"_mini_label_from").innerHTML,document.getElementById(e+"_mini_label_to").innerHTML],type_range(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_range_width,w_field_range_step,w_field_value1,w_field_value2,w_mini_labels,w_required,w_class,w_attr_name,w_attr_value);break;case"type_grading":for(w_total=document.getElementById(e+"_grading_totalform_id_temp").value,w_items=[],k=0;k<100;k++)document.getElementById(e+"_label_elementform_id_temp"+k)&&w_items.push(document.getElementById(e+"_label_elementform_id_temp"+k).innerHTML);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_grading(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_items,w_total,w_required,w_class,w_attr_name,w_attr_value),refresh_grading_items(e);break;case"type_matrix":for(w_rows=[],w_rows[0]="",k=1;k<100;k++)document.getElementById(e+"_label_elementform_id_temp"+k+"_0")&&w_rows.push(document.getElementById(e+"_label_elementform_id_temp"+k+"_0").innerHTML);for(w_columns=[],w_columns[0]="",k=1;k<100;k++)document.getElementById(e+"_label_elementform_id_temp0_"+k)&&w_columns.push(document.getElementById(e+"_label_elementform_id_temp0_"+k).innerHTML);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_input_type=document.getElementById(e+"_input_typeform_id_temp").value,w_textbox_size=document.getElementById(e+"_textbox_sizeform_id_temp")?document.getElementById(e+"_textbox_sizeform_id_temp").value:"100",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_matrix(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_input_type,w_rows,w_columns,w_required,w_class,w_attr_name,w_attr_value,w_textbox_size),refresh_matrix(e);break;case"type_time":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_hhform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_hh=document.getElementById(e+"_hhform_id_temp").value,w_mm=document.getElementById(e+"_mmform_id_temp").value,document.getElementById(e+"_ssform_id_temp")?(w_ss=document.getElementById(e+"_ssform_id_temp").value,w_sec="1",w_mini_label_ss=document.getElementById(e+"_mini_label_ss").innerHTML):(w_ss="",w_sec="0",w_mini_label_ss=""),document.getElementById(e+"_am_pm_select")?(w_am_pm=document.getElementById(e+"_am_pmform_id_temp").value,w_time_type="12",w_mini_labels=[document.getElementById(e+"_mini_label_hh").innerHTML,document.getElementById(e+"_mini_label_mm").innerHTML,w_mini_label_ss,document.getElementById(e+"_mini_label_am_pm").innerHTML]):(w_am_pm=0,w_time_type="24",w_mini_labels=[document.getElementById(e+"_mini_label_hh").innerHTML,document.getElementById(e+"_mini_label_mm").innerHTML,w_mini_label_ss,"AM/PM"]),type_time(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_time_type,w_am_pm,w_sec,w_hh,w_mm,w_ss,w_mini_labels,w_required,w_class,w_attr_name,w_attr_value);break;case"type_date":atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(e+"_elementform_id_temp").value,w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no",type_date(e,w_field_label,w_field_label_size,w_field_label_pos,w_date,w_required,w_class,w_format,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_new":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(e+"_elementform_id_temp").value,w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_start_day=document.getElementById(e+"_start_dayform_id_temp").value,w_default_date=document.getElementById(e+"_default_date_id_temp").value,w_min_date=document.getElementById(e+"_min_date_id_temp").value,w_max_date=document.getElementById(e+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(e+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(e+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(e+"_show_imageform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no";var g=document.getElementById(e+"_show_week_days");w_sunday=g.getAttribute("sunday"),w_monday=g.getAttribute("monday"),w_tuesday=g.getAttribute("tuesday"),w_wednesday=g.getAttribute("wednesday"),w_thursday=g.getAttribute("thursday"),w_friday=g.getAttribute("friday"),w_saturday=g.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],type_date_new(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_range":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp0"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date="",w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,s=document.getElementById(e+"_elementform_id_temp0").style.width,w_size=s.substring(0,s.length-2),w_start_day=document.getElementById(e+"_start_dayform_id_temp").value,w_default_date_start=document.getElementById(e+"_default_date_id_temp_start").value,w_default_date_end=document.getElementById(e+"_default_date_id_temp_end").value,w_min_date=document.getElementById(e+"_min_date_id_temp").value,w_max_date=document.getElementById(e+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(e+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(e+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(e+"_show_imageform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no";g=document.getElementById(e+"_show_week_days");w_sunday=g.getAttribute("sunday"),w_monday=g.getAttribute("monday"),w_tuesday=g.getAttribute("tuesday"),w_wednesday=g.getAttribute("wednesday"),w_thursday=g.getAttribute("thursday"),w_friday=g.getAttribute("friday"),w_saturday=g.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],type_date_range(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date_start,w_default_date_end,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_fields":atrs=return_attributes(e+"_dayform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_day=document.getElementById(e+"_dayform_id_temp").value,w_month=document.getElementById(e+"_monthform_id_temp").value,w_year=document.getElementById(e+"_yearform_id_temp").value,w_day_type=document.getElementById(e+"_dayform_id_temp").tagName,w_month_type=document.getElementById(e+"_monthform_id_temp").tagName,w_year_type=document.getElementById(e+"_yearform_id_temp").tagName,w_day_label=document.getElementById(e+"_day_label").innerHTML,w_month_label=document.getElementById(e+"_month_label").innerHTML,w_year_label=document.getElementById(e+"_year_label").innerHTML,s=document.getElementById(e+"_dayform_id_temp").style.width,w_day_size=s.substring(0,s.length-2),s=document.getElementById(e+"_monthform_id_temp").style.width,w_month_size=s.substring(0,s.length-2),s=document.getElementById(e+"_yearform_id_temp").style.width,w_year_size=s.substring(0,s.length-2),w_from=document.getElementById(e+"_yearform_id_temp").getAttribute("from"),w_to=document.getElementById(e+"_yearform_id_temp").getAttribute("to"),w_divider=document.getElementById(e+"_separator1").innerHTML,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,type_date_fields(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_day,w_month,w_year,w_day_type,w_month_type,w_year_type,w_day_label,w_month_label,w_year_label,w_day_size,w_month_size,w_year_size,w_required,w_class,w_from,w_to,w_divider,w_attr_name,w_attr_value);break;case"type_own_select":jQuery("#"+e+"_elementform_id_temp option").each(function(){w_choices[t]=jQuery(this).html(),w_choices_value[t]=jQuery(this).val(),w_choices_checked[t]=jQuery(this)[0].selected,jQuery(this).prop("where")?w_choices_params[t]=jQuery(this).prop("where")+"[where_order_by]"+jQuery(this).prop("order_by")+"[db_info]"+jQuery(this).prop("db_info"):w_choices_params[t]="",jQuery(this).val()?w_choices_disabled[t]=!1:w_choices_disabled[t]=!0,t++}),w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_own_select(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_choices,w_choices_checked,w_required,w_value_disabled,w_class,w_attr_name,w_attr_value,w_choices_disabled,w_choices_value,w_choices_params);break;case"type_paypal_select":for(jQuery("#"+e+"_elementform_id_temp option").each(function(){w_choices[t]=jQuery(this).html(),w_choices_price[t]=jQuery(this).val(),w_choices_checked[t]=jQuery(this)[0].selected,jQuery(this).prop("where")?w_choices_params[t]=jQuery(this).prop("where")+"[where_order_by]"+jQuery(this).prop("order_by")+"[db_info]"+jQuery(this).prop("db_info"):w_choices_params[t]="",""==jQuery(this)[0].value?w_choices_disabled[t]=!0:w_choices_disabled[t]=!1,t++}),k=0;k<100;k++)if(document.getElementById(e+"_propertyform_id_temp"+k))if(h.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(b[h.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)b[h.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else b.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_select(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_choices,w_choices_price,w_choices_checked,w_required,w_quantity,w_quantity_value,w_class,w_attr_name,w_attr_value,w_choices_disabled,h,b,w_choices_params);break;case"type_country":for(w_countries=[],select_=document.getElementById(e+"_elementform_id_temp"),n=select_.childNodes.length,i=0;i<n;i++)w_countries.push(select_.childNodes[i].value);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_country(e,w_field_label,w_field_label_size,w_hide_label,w_countries,w_field_label_pos,w_size,w_required,w_class,w_attr_name,w_attr_value);break;case"type_file_upload":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_destination=document.getElementById(e+"_destination").value.replace("***destinationverj"+e+"***","").replace("***destinationskizb"+e+"***",""),w_extension=document.getElementById(e+"_extension").value.replace("***extensionverj"+e+"***","").replace("***extensionskizb"+e+"***",""),w_max_size=document.getElementById(e+"_max_size").value.replace("***max_sizeverj"+e+"***","").replace("***max_sizeskizb"+e+"***",""),w_multiple=document.getElementById(e+"_elementform_id_temp").getAttribute("multiple")?"yes":"no",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_file_upload(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_destination,w_extension,w_max_size,w_required,w_multiple,w_class,w_attr_name,w_attr_value);break;case"type_captcha":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_digit=document.getElementById("_wd_captchaform_id_temp").getAttribute("digit"),atrs=return_attributes("_wd_captchaform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_captcha(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_digit,w_class,w_attr_name,w_attr_value);break;case"type_arithmetic_captcha":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_count=document.getElementById("_wd_arithmetic_captchaform_id_temp").getAttribute("operations_count"),w_operations=document.getElementById("_wd_arithmetic_captchaform_id_temp").getAttribute("operations"),w_input_size=document.getElementById("_wd_arithmetic_captchaform_id_temp").getAttribute("input_size"),atrs=return_attributes("_wd_captchaform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_arithmetic_captcha(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_count,w_operations,w_class,w_input_size,w_attr_name,w_attr_value);break;case"type_recaptcha":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_type=document.getElementById("wd_recaptchaform_id_temp").getAttribute("w_type"),w_position=document.getElementById("wd_recaptchaform_id_temp").getAttribute("position"),type_recaptcha(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_type,w_position);break;case"type_map":for(w_lat=[],w_long=[],w_info=[],w_center_x=document.getElementById(e+"_elementform_id_temp").getAttribute("center_x"),w_center_y=document.getElementById(e+"_elementform_id_temp").getAttribute("center_y"),w_zoom=document.getElementById(e+"_elementform_id_temp").getAttribute("zoom"),w_width=""==document.getElementById(e+"_elementform_id_temp").style.width?"":parseInt(document.getElementById(e+"_elementform_id_temp").style.width),w_height=parseInt(document.getElementById(e+"_elementform_id_temp").style.height),j=0;j<=20;j++)document.getElementById(e+"_elementform_id_temp").getAttribute("lat"+j)&&(w_lat.push(document.getElementById(e+"_elementform_id_temp").getAttribute("lat"+j)),w_long.push(document.getElementById(e+"_elementform_id_temp").getAttribute("long"+j)),w_info.push(document.getElementById(e+"_elementform_id_temp").getAttribute("info"+j)));atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_map(e,w_center_x,w_center_y,w_long,w_lat,w_zoom,w_width,w_height,w_class,w_info,w_attr_name,w_attr_value);break;case"type_mark_map":w_info=document.getElementById(e+"_elementform_id_temp").getAttribute("info0"),w_long=document.getElementById(e+"_elementform_id_temp").getAttribute("long0"),w_lat=document.getElementById(e+"_elementform_id_temp").getAttribute("lat0"),w_zoom=document.getElementById(e+"_elementform_id_temp").getAttribute("zoom"),w_width=""==document.getElementById(e+"_elementform_id_temp").style.width?"":parseInt(document.getElementById(e+"_elementform_id_temp").style.width),w_height=parseInt(document.getElementById(e+"_elementform_id_temp").style.height),w_center_x=document.getElementById(e+"_elementform_id_temp").getAttribute("center_x"),w_center_y=document.getElementById(e+"_elementform_id_temp").getAttribute("center_y"),w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_mark_map(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_center_x,w_center_y,w_long,w_lat,w_zoom,w_width,w_height,w_class,w_info,w_attr_name,w_attr_value);break;case"type_submit_reset":atrs=return_attributes(e+"_element_submitform_id_temp"),w_act=!("none"==document.getElementById(e+"_element_resetform_id_temp").style.display),w_attr_name=atrs[0],w_attr_value=atrs[1],w_submit_title=document.getElementById(e+"_element_submitform_id_temp").value,w_reset_title=document.getElementById(e+"_element_resetform_id_temp").value,type_submit_reset(e,w_submit_title,w_reset_title,w_class,w_act,w_attr_name,w_attr_value);break;case"type_button":for(w_title=new Array,w_func=new Array,t=0,v=0,k=0;k<100;k++)document.getElementById(e+"_elementform_id_temp"+k)&&(w_title[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_func[t]=document.getElementById(e+"_elementform_id_temp"+k).getAttribute("onclick"),t++,v=k);atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_button(e,w_title,w_func,w_class,w_attr_name,w_attr_value);break;case"type_hidden":w_value=document.getElementById(e+"_elementform_id_temp").value,w_name=document.getElementById(e+"_elementform_id_temp").name,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_hidden(e,w_name,w_value,w_attr_name,w_attr_value)}void 0!==a&&(a.stopPropagation(),a.preventDefault())}function fm_add_page(){for(t=form_view_max;0<t;t--)if(document.getElementById("form_id_tempform_view"+t)){form_view=t;break}if(form_view_count=jQuery(".wdform-page-and-images").length,1==form_view_count){(a=document.createElement("span")).setAttribute("title","Edit the pagination options"),a.setAttribute("class","page_toolbar fm-ico-edit"),a.setAttribute("onclick","el_page_navigation()");var e=document.getElementById("edit_page_navigation");e.appendChild(a),document.getElementById("page_navigation").appendChild(e)}jQuery("#page_bar").removeClass("form_view_hide"),old_to_gen=form_view,form_view_max++,form_view=form_view_max,1<form_view&&jQuery(".form_id_tempform_view_img").removeClass("form_view_hide"),table=document.createElement("div"),table.setAttribute("class","wdform-page-and-images fm-form-builder"),form_tempform_view=document.createElement("div"),form_tempform_view.setAttribute("id","form_id_tempform_view"+form_view),form_tempform_view.setAttribute("page_title","Untitled Page"),form_tempform_view.setAttribute("class","wdform_page"),page_toolbar_wrap=document.createElement("div"),page_toolbar_wrap.setAttribute("id","form_id_tempform_view_img"+form_view),page_toolbar_wrap.setAttribute("class","form_id_tempform_view_img"),page_title_div=document.createElement("div"),page_title_div.setAttribute("class","wdform_page_title"),page_toolbar_wrap.appendChild(page_title_div),page_toolbar=document.createElement("div");var i=document.createElement("span");i.setAttribute("title","Show or hide the page"),i.setAttribute("class","page_toolbar fm-ico-collapse"),i.setAttribute("id","show_page_img_"+form_view),i.setAttribute("onClick",'show_or_hide("'+form_view+'"); change_show_hide_icon(this);');var a,n=document.createElement("span");n.setAttribute("title","Delete the page"),n.setAttribute("class","page_toolbar fm-ico-delete"),n.setAttribute("onclick",'remove_page("'+form_view+'")'),(a=document.createElement("span")).setAttribute("title","Edit the page"),a.setAttribute("class","page_toolbar fm-ico-edit"),a.setAttribute("onclick",'edit_page_break("'+form_view+'")'),page_toolbar.appendChild(n),page_toolbar.appendChild(a),page_toolbar.appendChild(i),page_toolbar_wrap.appendChild(page_toolbar),tr=document.createElement("div"),tr.setAttribute("class","wdform_section"),tr_page_nav=document.createElement("div"),tr_page_nav.setAttribute("valign","top"),tr_page_nav.setAttribute("class","wdform_footer"),tr_page_nav.style.width="100%",td_page_nav=document.createElement("div"),td_page_nav.style.width="100%",table_min_page_nav=document.createElement("div"),table_min_page_nav.style.width="100%",table_min_page_nav.style.display="table",tbody_min_page_nav=document.createElement("div"),tbody_min_page_nav.style.display="table-row-group",tr_min_page_nav=document.createElement("div"),tr_min_page_nav.setAttribute("id","form_id_temppage_nav"+form_view),tr_min_page_nav.style.display="table-row",table_min=document.createElement("div"),table_min.setAttribute("class","wdform_column"),table_min1=document.createElement("div"),table_min1.setAttribute("class","wdform_column"),tr.appendChild(table_min),tbody_min_page_nav.appendChild(tr_min_page_nav),table_min_page_nav.appendChild(tbody_min_page_nav),td_page_nav.appendChild(table_min_page_nav),tr_page_nav.appendChild(td_page_nav),form_tempform_view.appendChild(tr),form_tempform_view.appendChild(tr_page_nav),table.appendChild(page_toolbar_wrap),table.appendChild(form_tempform_view),document.getElementById("take").insertBefore(table,document.getElementById("add_field_cont")),form_view_element=document.getElementById("form_id_tempform_view"+form_view),form_view_element.setAttribute("next_title","Next"),form_view_element.setAttribute("next_type","text"),form_view_element.setAttribute("next_class","wdform-page-button"),form_view_element.setAttribute("next_checkable","true"),form_view_element.setAttribute("previous_title","Previous"),form_view_element.setAttribute("previous_type","text"),form_view_element.setAttribute("previous_class","wdform-page-button"),form_view_element.setAttribute("previous_checkable","false"),form_view_element.setAttribute("page_title","Untitled Page"),page_title_div.innerHTML='<span class="fm-ico-draggable"></span>Untitled Page',2==form_view_count?(generate_page_nav(form_view),generate_page_nav(old_to_gen)):generate_page_nav(form_view),all_sortable_events(),jQuery(".wdform_arrows").hide(),draggable_page_break(nextID,form_view_max),nextID="",form_view_element.scrollIntoView()}function add(e,a,d){if("type_grading"==document.getElementById("element_type").value){for(k=100;0<k&&!document.getElementById("el_items"+k);k--);m=k;var _="";for(i=0;i<=m;i++)document.getElementById("el_items"+i)&&(_=_+document.getElementById("el_items"+i).value+":");_+=document.getElementById("element_total").value,document.getElementById("editing_id").value?id=document.getElementById("editing_id").value:id=gen;var r=document.createElement("input");r.setAttribute("id",id+"_hidden_itemform_id_temp"),r.setAttribute("name",id+"_hidden_itemform_id_temp"),r.setAttribute("type","hidden"),r.setAttribute("value",_),(p=document.getElementById(id+"_element_sectionform_id_temp")).appendChild(r)}if("type_matrix"==document.getElementById("element_type").value){for(i=100;0<i&&!document.getElementById("el_rows"+i);i--);for(m=i,i=100;0<i&&!document.getElementById("el_columns"+i);i--);n=i;var o="",s="",u="",c="";for(i=1;i<=m;i++)document.getElementById("el_rows"+i)&&(o=o+document.getElementById("el_rows"+i).value+"***",u+=i+",");for(i=1;i<=n;i++)document.getElementById("el_columns"+i)&&(s=s+document.getElementById("el_columns"+i).value+"***",c+=i+",");document.getElementById("editing_id").value?id=document.getElementById("editing_id").value:id=gen;var p=document.getElementById(id+"_element_sectionform_id_temp"),f=document.createElement("input");f.setAttribute("id",id+"_hidden_rowform_id_temp"),f.setAttribute("name",id+"_hidden_rowform_id_temp"),f.setAttribute("type","hidden"),f.setAttribute("value",o);var y=document.createElement("input");y.setAttribute("id",id+"_row_idsform_id_temp"),y.setAttribute("name",id+"_row_idsform_id_temp"),y.setAttribute("type","hidden"),y.setAttribute("value",u);var h=document.createElement("input");h.setAttribute("id",id+"_hidden_columnform_id_temp"),h.setAttribute("name",id+"_hidden_columnform_id_temp"),h.setAttribute("type","hidden"),h.setAttribute("value",s);var b=document.createElement("input");b.setAttribute("id",id+"_column_idsform_id_temp"),b.setAttribute("name",id+"_column_idsform_id_temp"),b.setAttribute("type","hidden"),b.setAttribute("value",c),p.appendChild(f),p.appendChild(y),p.appendChild(h),p.appendChild(b)}if("type_section_break"==document.getElementById("element_type").value){for(form_view=0,t=form_view_max;0<t;t--)if(document.getElementById("form_id_tempform_view"+t)&&jQuery("#form_id_tempform_view"+t).is(":visible")){form_view=t;break}if(0==form_view)return void alert("The pages are closed");if(document.getElementById("editing_id").value)i=document.getElementById("editing_id").value,document.getElementById("editing_id").value="",wdform_field_in_editor=document.getElementById(i+"_element_sectionform_id_temp"),ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),"none"==document.getElementById("form_maker_editor").style.display?wdform_field_in_editor.innerHTML=ifr.body.innerHTML:wdform_field_in_editor.innerHTML=document.getElementById("form_maker_editor").value;else{i=gen,gen++,(L=document.createElement("div")).setAttribute("wdid",i),L.setAttribute("type","type_section_break"),L.setAttribute("class","wdform_tr_section_break"),(z=document.createElement("div")).setAttribute("id","wdform_field"+i),z.setAttribute("type","type_section_break"),z.setAttribute("class","wdform_field_section_break"),(q=document.createElement("div")).setAttribute("id","wdform_arrows"+i),q.setAttribute("class","wdform_arrows"),q.style.display="none",z.appendChild(q),L.appendChild(z),(x=document.createElement("div")).setAttribute("id",i+"_element_labelform_id_temp"),x.style.color="red",x.innerHTML="Section Break",L.appendChild(x),wdform_page=document.getElementById("form_id_tempform_view"+form_view);var g='<span class="wdform_arrows_basic wdform_arrows_container"><span id="edit_'+i+'" valign="middle" class="element_toolbar"><span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;'+i+'&quot;, event)" onclick="edit(&quot;'+i+'&quot;, event)"></span></span><span id="duplicate_'+i+'" valign="middle" class="element_toolbar"><span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(&quot;'+i+'&quot;, event)" onclick="duplicate(&quot;'+i+'&quot;, event)"></span></span><span id="X_'+i+'" valign="middle" align="right" class="element_toolbar"><span title="Remove the field" class="page_toolbar fm-ico-delete" onclick="remove_section_break(&quot;'+i+'&quot;)"></span></span></span>';q.innerHTML=g;var E=document.createElement("div");E.setAttribute("id",i+"_element_sectionform_id_temp"),E.setAttribute("align","left"),E.setAttribute("class","wdform_section_break"),ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),"none"==document.getElementById("form_maker_editor").style.display?E.innerHTML=ifr.body.innerHTML:E.innerHTML=document.getElementById("form_maker_editor").value,(I=document.createElement("span")).setAttribute("id",i+"_element_labelform_id_temp"),I.innerHTML="Custom HTML"+i,I.style.cssText="display:none",z.appendChild(E),beforeTr=wdform_page.lastChild,wdform_page.insertBefore(L,beforeTr),wdform_section_new=document.createElement("div"),wdform_section_new.setAttribute("class","wdform_section"),wdform_column_new=document.createElement("div"),wdform_column_new.setAttribute("class","wdform_column"),wdform_column_new1=document.createElement("div"),wdform_column_new1.setAttribute("class","wdform_column"),wdform_section_new.appendChild(wdform_column_new1),draggable_section_break(nextID,L),nextID="",j=2}return jQuery(".wdform_arrows").hide(),close_window(),void all_sortable_events()}if("type_page_navigation"==document.getElementById("element_type").value)return document.getElementById("pages").setAttribute("show_title",document.getElementById("el_show_title_input").checked),document.getElementById("pages").setAttribute("show_numbers",document.getElementById("el_show_numbers_input").checked),document.getElementById("el_pagination_steps").checked?(document.getElementById("pages").setAttribute("type","steps"),make_page_steps_front()):document.getElementById("el_pagination_percentage").checked?(document.getElementById("pages").setAttribute("type","percentage"),make_page_percentage_front()):(document.getElementById("pages").setAttribute("type","none"),make_page_none_front()),refresh_page_numbers(),void close_window();if("type_page_break"==document.getElementById("element_type").value&&document.getElementById("editing_id").value){i=document.getElementById("editing_id").value,form_view_element=document.getElementById("form_id_tempform_view"+i),page_title=document.getElementById("_div_between").getAttribute("page_title"),next_title=document.getElementById("_div_between").getAttribute("next_title"),next_type=document.getElementById("_div_between").getAttribute("next_type"),next_class=document.getElementById("_div_between").getAttribute("next_class"),next_checkable=document.getElementById("_div_between").getAttribute("next_checkable"),previous_title=document.getElementById("_div_between").getAttribute("previous_title"),previous_type=document.getElementById("_div_between").getAttribute("previous_type"),previous_class=document.getElementById("_div_between").getAttribute("previous_class"),previous_checkable=document.getElementById("_div_between").getAttribute("previous_checkable"),form_view_element.setAttribute("next_title",next_title),form_view_element.setAttribute("next_type",next_type),form_view_element.setAttribute("next_class",next_class),form_view_element.setAttribute("next_checkable",next_checkable),form_view_element.setAttribute("previous_title",previous_title),form_view_element.setAttribute("previous_type",previous_type),form_view_element.setAttribute("previous_class",previous_class),form_view_element.setAttribute("previous_checkable",previous_checkable),form_view_element.setAttribute("page_title",page_title),document.getElementById("form_id_tempform_view_img"+i).firstChild.innerHTML='<span class="fm-ico-draggable"></span>'+page_title;var A=document.getElementById("_div_between");for(atr=A.attributes,v=0;v<30;v++)atr[v]&&0==atr[v].name.indexOf("add_")&&form_view_element.setAttribute(atr[v].name,atr[v].value);return form_view_count=jQuery(".wdform-page-and-images").length,1!=form_view_count&&generate_page_nav(form_view),sortable_columns(),jQuery(".wdform_arrows").hide(),void close_window()}for(form_view=0,t=form_view_max;0<t;t--)if(document.getElementById("form_id_tempform_view"+t)&&jQuery("#form_id_tempform_view"+t).is(":visible")){form_view=t;break}if(0!=form_view){if(document.getElementById("editing_id").value||0!=e||!fm_check_something_really_important(e)){if("block"==document.getElementById("main_editor").style.display){if(document.getElementById("editing_id").value)i=document.getElementById("editing_id").value,document.getElementById("editing_id").value="",destroyChildren(z=document.getElementById("wdform_field"+i)),ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),"none"==document.getElementById("form_maker_editor").style.display?z.innerHTML=ifr.body.innerHTML:z.innerHTML=document.getElementById("form_maker_editor").value,j=2;else{var x;i=gen,gen++,(x=document.createElement("option")).setAttribute("id",i+"_sel_el_pos"),x.setAttribute("value",i),x.innerHTML="Custom HTML"+i,l=document.getElementById("form_id_tempform_view"+form_view).childNodes.length,wdform_column=document.getElementById("form_id_tempform_view"+form_view).childNodes[l-2].firstChild,(L=document.createElement("div")).setAttribute("wdid",i),L.setAttribute("class","wdform_row ui-sortable-handle"),(z=document.createElement("div")).setAttribute("id","wdform_field"+i),z.setAttribute("type","type_editor"),z.setAttribute("class","wdform_field"),z.style.cssText="margin-top:0px",(q=document.createElement("div")).setAttribute("id","wdform_arrows"+i),q.setAttribute("class","wdform_arrows"),q.style.display="none",L.appendChild(z),L.appendChild(q);var I;g='<span class="wdform_arrows_advanced wdform_arrows_container"><span id="left_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;'+i+'&quot;)"></span></span><span id="up_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row(&quot;'+i+'&quot;)"></span></span><span id="down_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row(&quot;'+i+'&quot;)"></span></span><span id="right_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row(&quot;'+i+'&quot;)"></span></span><span id="page_up_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up(&quot;'+i+'&quot;)"></span></span><span id="page_down_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down(&quot;'+i+'&quot;)"></span></span></span><span class="wdform_arrows_basic wdform_arrows_container"><span id="edit_'+i+'" valign="middle" class="element_toolbar"><span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;'+i+'&quot;, event)" onclick="edit(&quot;'+i+'&quot;, event)"></span></span><span id="duplicate_'+i+'" valign="middle" class="element_toolbar"><span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(duplicate(&quot;'+i+'&quot;, event))" onclick="duplicate(&quot;'+i+'&quot;, event)"></span></span><span id="X_'+i+'" valign="middle" align="right" class="element_toolbar"><span title="Remove the field" class="page_toolbar fm-ico-delete" ontouchend="remove_field(&quot;'+i+'&quot;, event)" onclick="remove_field(&quot;'+i+'&quot;, event)"></span></span></span>';q.innerHTML=g,ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),"none"==document.getElementById("form_maker_editor").style.display?z.innerHTML=ifr.body.innerHTML:z.innerHTML=document.getElementById("form_maker_editor").value,(I=document.createElement("span")).setAttribute("id",i+"_element_labelform_id_temp"),I.innerHTML="Custom HTML"+i,I.style.color="red",L.appendChild(I),add_field_in_position(nextID,L),nextID="",j=2}close_window()}else if(document.getElementById("show_table").innerHTML){if(document.getElementById("editing_id").value?i=document.getElementById("editing_id").value:i=gen,type=document.getElementById("element_type").value,"type_hidden"==type&&""==document.getElementById(i+"_elementform_id_temp").name)return void alert("The name of the field is required.");if("type_map"==type){if(void 0===gmapdata[i]||void 0===gmapdata[i].getCenter())return alert("Please go to Global Options to setup the Map API key. It may take up to 5 minutes for API key change to take effect."),!1;if_gmap_updateMap(i)}if("type_mark_map"==type){if(void 0===gmapdata[i]||void 0===gmapdata[i].getCenter())return alert("Please go to Global Options to setup the Map API key. It may take up to 5 minutes for API key change to take effect."),!1;if_gmap_updateMap(i)}if(!document.getElementById(i+"_element_labelform_id_temp").innerHTML)return void alert("The field label is required.");if(document.getElementById("editing_id").value){for(Disable(),i=document.getElementById("editing_id").value,in_lab=!1,labels_array=new Array,w=0;w<gen;w++)w!=i&&document.getElementById(w+"_element_labelform_id_temp")&&labels_array.push(document.getElementById(w+"_element_labelform_id_temp").innerHTML);for(t=0;t<labels_array.length;t++)if(document.getElementById(i+"_element_labelform_id_temp").innerHTML==labels_array[t]){in_lab=!0;break}if(in_lab)return void alert("Sorry, the labels must be unique.");document.getElementById("editing_id").value="",z=document.getElementById("wdform_field"+i),q=document.getElementById("wdform_arrows"+i),destroyChildren(z);var C=document.getElementById(i+"_label_sectionform_id_temp"),B=document.getElementById(i+"_element_sectionform_id_temp");if(z.appendChild(q),z.appendChild(C),z.appendChild(B),"type_submitter_mail"==type||"type_password"==type){var Q=document.createElement("br"),T=document.getElementById(i+"_1_label_sectionform_id_temp"),M=document.getElementById(i+"_1_element_sectionform_id_temp");z.appendChild(Q),z.appendChild(T),z.appendChild(M)}j=2,close_window(),call(i,e)}else{for(i=gen,in_lab=!1,labels_array=new Array,w=0;w<gen;w++)document.getElementById(w+"_element_labelform_id_temp")&&labels_array.push(document.getElementById(w+"_element_labelform_id_temp").innerHTML);for(t=0;t<labels_array.length;t++)if(document.getElementById(i+"_element_labelform_id_temp").innerHTML==labels_array[t]){in_lab=!0;break}if(in_lab)return void alert("Sorry, the labels must be unique.");var L,z,q;"type_address"==type?gen+=6:gen++,l=document.getElementById("form_id_tempform_view"+form_view).childNodes.length,wdform_column=document.getElementById("form_id_tempform_view"+form_view).childNodes[l-2].firstChild,(L=document.createElement("div")).setAttribute("wdid",i),L.setAttribute("class","wdform_row ui-sortable-handle"),(z=document.createElement("div")).setAttribute("id","wdform_field"+i),z.setAttribute("type",type),z.setAttribute("class","wdform_field"),z.style.display="table-cell",(q=document.createElement("div")).setAttribute("id","wdform_arrows"+i),q.setAttribute("class","wdform_arrows"),q.style.display="none",L.appendChild(q),L.appendChild(z);g='<span class="wdform_arrows_advanced wdform_arrows_container"><span id="left_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;'+i+'&quot;)"></span></span><span id="up_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row(&quot;'+i+'&quot;)"></span></span><span id="down_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row(&quot;'+i+'&quot;)"></span></span><span id="right_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row(&quot;'+i+'&quot;)"></span></span><span id="page_up_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up(&quot;'+i+'&quot;)"></span></span><span id="page_down_'+i+'" valign="middle" class="element_toolbar"><span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down(&quot;'+i+'&quot;)"></span></span></span><span class="wdform_arrows_basic wdform_arrows_container"><span id="edit_'+i+'" valign="middle" class="element_toolbar"><span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;'+i+'&quot;, event)" onclick="edit(&quot;'+i+'&quot;, event)"></span></span>'+("type_captcha"!=type&&"type_arithmetic_captcha"!=type&&"type_recaptcha"!=type&&"type_send_copy"!=type&&"type_stripe"!=type?'<span id="duplicate_'+i+'" valign="middle" class="element_toolbar"><span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(&quot;'+i+'&quot;, event)" onclick="duplicate(&quot;'+i+'&quot;, event)"></span></span>':"")+'<span id="X_'+i+'" valign="middle" align="right" class="element_toolbar"><span title="Remove the field" class="page_toolbar fm-ico-delete" ontouchend="remove_field(&quot;'+i+'&quot;, event)" onclick="remove_field(&quot;'+i+'&quot;, event)"></span></span></span>';q.innerHTML=g;C=document.getElementById(i+"_label_sectionform_id_temp"),B=document.getElementById(i+"_element_sectionform_id_temp");if(z.appendChild(C),z.appendChild(B),"type_submitter_mail"==type||"type_password"==type){Q=document.createElement("br"),T=document.getElementById(i+"_1_label_sectionform_id_temp"),M=document.getElementById(i+"_1_element_sectionform_id_temp");z.appendChild(Q),z.appendChild(T),z.appendChild(M)}add_field_in_position(nextID,L),nextID="",j=2,close_window(),call(i,e)}}else alert("Please select an element to add.");jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_page input[type='text'], .wdform_page input[type='password'], .wdform_page input[type='file'], .wdform_page textarea, .wdform_page input[type='checkbox'], .wdform_page input[type='radio'], .wdform_page select").prop("disabled",!0),all_sortable_events()}}else alert("The pages are closed")}function move_submit_to_end(e){var t=jQuery(e).children(":not(.fm-hidden)").last();return!!t.find("[type=type_submit_reset]").length&&t}function add_field_in_position(e,t){if(null==e||""==e){var i=jQuery("#cur_column");if(1==i.val()){var a=jQuery('<div class="wdform_column"></div>').append(t),n=move_submit_to_end(i);!1!==n?jQuery(a).insertBefore(n):i.append(a)}else i.append(t)}else beforeTr=document.getElementById("wdform_field"+e).parentNode,wdform_column=beforeTr.parentNode,wdform_column.insertBefore(t,beforeTr);jQuery(window).scrollTop(jQuery(t).offset().top-100),jQuery("#cur_column").removeAttr("id")}function draggable_page_break(e,t){var i=jQuery(".wdform_row[wdid='"+e+"']"),a="form_id_tempform_view"+t;if(!(null==e||""==e||2<get_child_count())){var n=jQuery("#cur_column").parent().parent().prop("id"),l=parseInt(n.substr(n.indexOf("form_id_tempform_view")+21));if(2==t)jQuery("#form_id_tempform_view"+t+" .wdform_section .wdform_column:first-child").append(jQuery(i.nextAll().andSelf()));else if(n==a)jQuery("#form_id_tempform_view"+t+" .wdform_section .wdform_column:first-child").append(jQuery(i.nextAll().andSelf()));else{for(var d=t-l,_=t,r=1;r<d;r++)jQuery("#form_id_tempform_view"+_+" .wdform_section .wdform_column:first-child").append(jQuery("#form_id_tempform_view"+(_-1)+" .wdform_section .wdform_column:first-child .wdform_row")),_--;jQuery("#form_id_tempform_view"+_+" .wdform_section .wdform_column:first-child").append(jQuery(i.nextAll().andSelf()))}jQuery("#cur_column").removeAttr("id")}}function get_child_count(){var e=document.getElementById("cur_column").parentNode;return child=e.children,child.length}function draggable_section_break(e,t){if(null==e||""==e)return beforeTr=wdform_page.lastChild,void wdform_page.insertBefore(wdform_section_new,beforeTr);if(2<get_child_count())return beforeTr=wdform_page.lastChild,void wdform_page.insertBefore(wdform_section_new,beforeTr);beforeTr=document.getElementById("wdform_field"+e).parentNode,wdform_column=beforeTr.parentNode,wdform_section=wdform_column.parentNode,wdform_column.insertBefore(t,beforeTr);var a=jQuery("#cur_column").find("[wdid='"+i+"']");jQuery("<div class='wdform_section curr'><div class='wdform_column ui-sortable'>").insertAfter(a.parent().parent()).append(a.nextAll().andSelf()),jQuery(".wdform_section .wdform_tr_section_break").each(function(){jQuery(this).insertBefore(jQuery(this).parent())}),jQuery("#cur_column").removeAttr("id"),jQuery(".curr").children().appendTo(".curr .wdform_column"),jQuery(".curr").append("<div class='wdform_column ui-sortable'></div>"),jQuery(".curr").removeClass("curr")}function call(e,t){need_enable=!1,after_edit=!1,0==t&&(after_edit=!0,edit(e),add("1",after_edit,e)),need_enable=!0}function popup_ready(){jQuery(".popup-title").html(form_maker.add_field),jQuery("#add-button-cont").html(""),jQuery("#field_container .fm-free-message").addClass("fm-hidden"),jQuery(".field-types-filter").val(""),filter(jQuery(".field-types-filter")),jQuery(".field_types .postbox button.wd-button").removeClass("button-primary"),jQuery(".field_types").show(),jQuery("#field_container").removeClass("field_container_full"),jQuery(".add-popup").slideToggle(200)}function close_window(){need_enable&&popup_ready(),need_enable=!0,document.getElementById("edit_table").innerHTML="",document.getElementById("show_table").innerHTML="",document.getElementById("main_editor").style.display="none",document.getElementById("form_maker_editor_ifr")&&(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=""),document.getElementById("form_maker_editor").value="",document.getElementById("editing_id").value="",document.getElementById("element_type").value=""}function addRow(e,t,i,a){if(jQuery(".field_types .postbox button.wd-button").removeClass("button-primary"),jQuery(t).addClass("button-primary"),void 0===a)a="";document.getElementById("show_table").innerHTML&&(document.getElementById("show_table").innerHTML="",document.getElementById("edit_table").innerHTML="");var n=""==jQuery("#editing_id").val()?gen:jQuery("#editing_id").val();window["el_"+i](a,n),fm_add_field_button(t,a)}function fm_add_field_button(e,t){jQuery(e).hasClass("wd-pro-fields")&&"stripe"!=t?(jQuery("#edit_main_table input").prop("disabled","disabled"),jQuery("#edit_main_table textarea").prop("disabled","disabled"),jQuery("#edit_main_table .fm-input-container span.dashicons").prop("onclick",""),jQuery("#add-button-cont").removeClass("add-button-cont").html(""),jQuery("#premium_message").removeClass("fm-hidden"),jQuery("#stripe_message").addClass("fm-hidden"),jQuery("#field_container .popup-body-col").addClass("fm-opacity-40")):"stripe"!=t||0!=is_addon_stripe_active&&0!=is_stripe_enabled?(jQuery("#add-button-cont").addClass("add-button-cont").html('<button class="button button-primary button-hero wd-add-button" onclick="add(0, false); return false;">'+form_maker.add+"</button>"),jQuery("#premium_message").addClass("fm-hidden"),jQuery("#stripe_message").addClass("fm-hidden"),jQuery("#field_container .popup-body-col").removeClass("fm-opacity-40")):(jQuery("#edit_main_table input").prop("disabled","disabled"),jQuery("#edit_main_table textarea").prop("disabled","disabled"),jQuery("#edit_main_table .fm-input-container span.dashicons").prop("onclick",""),jQuery(e).hasClass("wd-pro-fields")||0!=is_stripe_enabled||1!=is_addon_stripe_active?(jQuery("#add-button-cont").removeClass("add-button-cont").html(""),jQuery("#premium_message").addClass("fm-hidden"),jQuery("#stripe_message").removeClass("fm-hidden"),jQuery("#field_container .popup-body-col").addClass("fm-opacity-40")):(jQuery("#add-button-cont").removeClass("add-button-cont").html('<div class="error"><p>'+form_maker.stripe3+"</p></div>"),jQuery("#premium_message").addClass("fm-hidden"),jQuery("#stripe_message").addClass("fm-hidden"),jQuery("#field_container .popup-body-col").removeClass("fm-opacity-40")))}function el_text(e,t){window["go_to_type_"+e](t)}function el_checkbox(e,t){w_choices=["option 1","option 2"],w_choices_checked=[!1,!1],w_choices_value=["option 1","option 2"],w_choices_params=["",""],w_attr_name=[],w_attr_value=[],type_checkbox(t,"Multiple Choice","","top","right","no","ver",w_choices,w_choices_checked,"1","no","no","no","0","",w_attr_name,w_attr_value,"no",w_choices_value,w_choices_params)}function el_radio(e,t){w_choices=["option 1","option 2"],w_choices_checked=[!1,!1],w_choices_value=["option 1","option 2"],w_choices_params=["",""],w_attr_name=[],w_attr_value=[],type_radio(t,"Single Choice","","top","right","no","ver",w_choices,w_choices_checked,"1","no","no","no","0","",w_attr_name,w_attr_value,"no",w_choices_value,w_choices_params)}function el_survey(e,t){window["go_to_type_"+e](t)}function el_time_and_date(e,t){window["go_to_type_"+e](t)}function el_select(e,t){window["go_to_type_"+e](t)}function el_file_upload(e,t){w_attr_name=[],w_attr_value=[],type_file_upload(t,"Upload a File","","top","no","form-maker","jpg, jpeg, png, gif, bmp, tif, tiff, svg, pdf, txt, log, doc, docx, csv, xls, xlsx, pps, ppt, pptx, xml, mp3, mp4, wma, wav, mpg, wmv","2000","no","no","",w_attr_name,w_attr_value)}function el_section_break(e,t){type_section_break(t,"<div class='wdform-section-break-div' style='min-width: 300px; border-top:1px solid'></div>")}function el_page_break(e,t){w_page_title="Untitled Page",w_title=["Next","Previous"],w_type=["text","text"],w_class=["wdform-page-button","wdform-page-button"],w_check=["true","false"],w_attr_name=[],w_attr_value=[],type_page_break("0",w_page_title,w_title,w_type,w_class,w_check,w_attr_name,w_attr_value)}function el_map(e,t){w_long=["2.294254"],w_lat=["48.858334"],w_info=[""],w_attr_name=[],w_attr_value=[],type_map(t,"2.294254","48.858334",w_long,w_lat,"13","370","300","wdform_map",w_info,w_attr_name,w_attr_value)}function el_paypal(e,t){window["go_to_type_"+e](t)}function el_captcha(e,t){document.getElementById("_wd_captchaform_id_temp")||document.getElementById("_wd_arithmetic_captchaform_id_temp")||document.getElementById("wd_recaptchaform_id_temp")?alert(form_maker.captcha_created):window["go_to_type_"+e](t)}function el_button(e,t){window["go_to_type_"+e](t)}function el_editor(e,t){type_editor(t,"")}function create_option_container(e,t,i,a){var n=jQuery('<div class="fm-option-container"'+(void 0!==i?' id="'+i+'"':"")+(0==a?' style="display: none;"':"")+"></div>");if(null!=e){var l=jQuery('<div class="fm-label-container"></div>');l.append(e),n.append(l)}if(null!=t){var d=jQuery('<div class="fm-input-container'+(null==e?" fm-width-100":"")+'"></div>');d.append(t),n.append(d)}return n}function create_advanced_options_container(e,t,i){var a=jQuery("<div"+(null!=t?' id="'+t+'"':"")+' class="postbox closed"'+(0==i?' style="display: none;"':"")+"></div>"),n=jQuery('<button class="handlediv" type="button" aria-expanded="true" onclick="fm_toggle_postbox(this);"><span class="screen-reader-text">Toggle panel</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle ui-sortable-handle" onclick="fm_toggle_postbox(this);"><span>Advanced options</span></h2>');return a.append(n),a.append(e),a}function create_field_type(e){return create_option_container(null,jQuery('<span class="fm-field-label">'+jQuery(".wd-button[data-type="+e+"]").first().text()+"</span>"))}function create_label(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_label">Label</label>'),jQuery('<textarea class="fm-width-100" id="edit_for_label" rows="4" onKeyUp="change_label(\''+e+"_element_labelform_id_temp', this.value)\">"+t+"</textarea>"))}function change_label(e,t,i){t=(t=t.replace(/(<([^>]+)>)/gi,"")).replace(/"/g,"&quot;"),i?document.getElementById(i).innerHTML=t:(document.getElementById(e).innerHTML=t,document.getElementById(e).value=t)}function create_label_position(e,t){var i=jQuery('<label class="fm-field-label">Label position</label>'),a=jQuery('<input type="radio" id="edit_for_label_position_left" name="edit_for_label_position" onchange="label_left('+e+')"'+("top"==t?"":' checked="checked"')+" />"),n=jQuery('<label for="edit_for_label_position_left">Left</label>'),l=jQuery('<input type="radio" id="edit_for_label_position_top" name="edit_for_label_position" onchange="label_top('+e+')"'+("top"==t?' checked="checked"':"")+" />"),d=jQuery('<label for="edit_for_label_position_top">Top</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_label_position_stripe(e,t){var i=jQuery('<label class="fm-field-label">Label position</label>'),a=jQuery('<input type="radio" id="edit_for_label_position_left" name="edit_for_label_position" onchange="label_left_stripe('+e+')"'+("top"==t?"":' checked="checked"')+" />"),n=jQuery('<label for="edit_for_label_position_left">Left</label>'),l=jQuery('<input type="radio" id="edit_for_label_position_top" name="edit_for_label_position" onchange="label_top_stripe('+e+')"'+("top"==t?' checked="checked"':"")+" />"),d=jQuery('<label for="edit_for_label_position_top">Top</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function label_left(e){"no"==document.getElementById(e+"_hide_labelform_id_temp").value?document.getElementById(e+"_label_sectionform_id_temp").style.display="table-cell":document.getElementById(e+"_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_element_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_1_label_sectionform_id_temp")&&("yes"==document.getElementById(e+"_verification_id_temp").value?(document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none"))}function label_top(e){"no"==document.getElementById(e+"_hide_labelform_id_temp").value?(document.getElementById(e+"_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_element_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_label_sectionform_id_temp")&&("yes"==document.getElementById(e+"_verification_id_temp").value?(document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none"))):(document.getElementById(e+"_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_element_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_label_sectionform_id_temp")&&("yes"==document.getElementById(e+"_verification_id_temp").value?(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="block"):(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none")))}function create_hide_label(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_hide_label">Hide label</label>'),jQuery('<input type="checkbox" id="el_hide_label" onchange="hide_label('+e+')"'+("yes"==t?' checked="checked"':"")+" />"))}function hide_label(e){"no"==document.getElementById(e+"_hide_labelform_id_temp").value?(document.getElementById(e+"_hide_labelform_id_temp").value="yes",document.getElementById(e+"_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_elementform_id_temp")&&document.getElementById(e+"_1_elementform_id_temp").offsetParent&&(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none")):(document.getElementById("edit_for_label_position_left").checked?(document.getElementById(e+"_label_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_element_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_1_elementform_id_temp")&&document.getElementById(e+"_1_elementform_id_temp").offsetParent&&(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="table-cell")):(document.getElementById(e+"_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_element_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_elementform_id_temp")&&document.getElementById(e+"_1_elementform_id_temp").offsetParent&&(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="block")),document.getElementById(e+"_hide_labelform_id_temp").value="no")}function create_placeholder(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_first_value_input">Placeholder</label>'),jQuery('<input type="text" class="fm-width-100" id="el_first_value_input" onKeyUp="change_input_value(this.value,\''+e+'_elementform_id_temp\')" value="'+t.replace(/"/g,"&quot;")+'" />'))}function change_input_value(e,t){input=document.getElementById(t),input.title=e,input.placeholder=e}function create_required(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_required">Required</label>'),jQuery('<input type="checkbox" id="el_required" onchange="set_required(\''+e+"_required')\""+("yes"==t?' checked="checked"':"")+" />"))}function set_required(e,t){"yes"==document.getElementById(e+"form_id_temp").value?(document.getElementById(e+"form_id_temp").setAttribute("value","no"),document.getElementById(e+"_elementform_id_temp").innerHTML="",void 0!==t&&(document.getElementById(t+"_elementform_id_temp").innerHTML="")):(document.getElementById(e+"form_id_temp").setAttribute("value","yes"),document.getElementById(e+"_elementform_id_temp").innerHTML=" *",void 0!==t&&(document.getElementById(t+"_elementform_id_temp").innerHTML=" *"))}function create_field_size(e,t,i,a){return null==i&&(i="'"+e+"_elementform_id_temp'"),create_option_container(jQuery('<label class="fm-field-label" for="edit_for_input_size">Width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style('+i+", this.value, "+a+')" value="'+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function create_field_label_size(e,t,i,a){return null==i&&(i="'"+e+"_label_sectionform_id_temp'"),create_option_container(jQuery('<label class="fm-field-label" for="edit_for_label_size">Label width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_label_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style('+i+", this.value, "+a+')" value="'+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function change_w_style(e,t,i){""==t?jQuery("#"+e).css("width",t):(jQuery("#"+e).css("width",t+"px"),i&&(document.getElementById(i).style.width=t+"px"))}function change_h_style(e,t){document.getElementById(e).style.height=t+"px"}function create_readonly(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_readonly">Readonly</label>'),jQuery('<input type="checkbox" id="el_readonly" onchange="set_readonly('+e+')"'+("yes"==t?' checked="checked"':"")+" />"))}function set_readonly(e){"no"==document.getElementById(e+"_readonlyform_id_temp").value?(document.getElementById(e+"_readonlyform_id_temp").value="yes",document.getElementById(e+"_elementform_id_temp").setAttribute("readonly","readonly")):(document.getElementById(e+"_elementform_id_temp").removeAttribute("readonly"),document.getElementById(e+"_readonlyform_id_temp").value="no")}function create_unique_values(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_unique">Allow only unique values</label>'),jQuery('<input type="checkbox" id="el_unique" onchange="set_unique(\''+e+"_uniqueform_id_temp')\""+("yes"==t?' checked="checked"':"")+" />"))}function set_unique(e){"yes"==document.getElementById(e).value?document.getElementById(e).setAttribute("value","no"):document.getElementById(e).setAttribute("value","yes")}function create_regexp(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_regExp_'+e+'">Validation (RegExp.)</label>'),jQuery('<input type="checkbox" id="el_regExp_'+e+'" onchange="set_regExpStatus(\''+e+"_regExpStatus')\""+("yes"==t?' checked="checked"':"")+" />"))}function set_regExpStatus(e){jQuery("#edit_main_tr12, #edit_main_tr13, #edit_main_tr14, #edit_main_tr15").toggle(200),"yes"==document.getElementById(e+"form_id_temp").value?document.getElementById(e+"form_id_temp").setAttribute("value","no"):document.getElementById(e+"form_id_temp").setAttribute("value","yes")}function create_custom_regexp(e,t,i){return create_option_container(jQuery('<label class="fm-field-label regExp_cell" for="regExp_value'+e+'">Regular Expression</label>'),jQuery('<textarea id="regExp_value'+e+'" class="regExp_cell fm-width-100" onKeyUp="change_regExpValue('+e+", this.value , '"+e+"_regExp_valueform_id_temp', '')\">"+i+"</textarea>"),"edit_main_tr12","yes"==t)}function change_regExpValue(e,t,i,a){0<a.length?(document.getElementById("regExp_value"+e).value=a,document.getElementById(i).value=a,document.getElementById(e+"_regExp_commonform_id_temp").value=document.getElementById("common_RegExp"+e).selectedIndex):(document.getElementById(i).value=t,document.getElementById(e+"_regExp_commonform_id_temp").value=t)}function create_common_regexp(e,t,i){var a=jQuery('<label class="fm-field-label regExp_cell">Common Regular Expressions</label>'),n=jQuery('<select class="fm-width-100" id="common_RegExp'+e+'" name="common_RegExp'+e+'" onChange="change_regExpValue('+e+", ' + w_regExp_value + ', '"+e+"_regExp_valueform_id_temp', this.value)\"></select>"),l=0,d=[];for(var _ in d.Select="",d["Name(Latin letters and some symbols)"]="^[a-zA-Z'-'\\s]+$",d["Phone Number(Digits and dashes)"]="^(\\+)?[0-9]+(-[0-9]+)?(-[0-9]+)?(-[0-9]+)?$",d["Integer Number"]="^(-)?[0-9]+$",d["Decimal Number"]="^(-)?[0-9]+(\\.[0-9]+)?$",d["Latin letters and Numbers"]="^[a-z&A-Z0-9]*$",d["Credit Card (16 Digits)"]="^([0-9](\\.)?){15}[0-9]$",d["Zip Code"]="^(\\d{5}-\\d{4}|\\d{5}|\\d{9})$|^([a-zA-Z]\\d[a-zA-Z] \\d[a-zA-Z]\\d)$",d["IP Address"]="^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$",d["Date m/d/y (e.g. 12/21/2013)"]="^([0-9]|1[0,1,2])/([0-9]|[0,1,2][0-9]|3[0,1])/[0-9]{4}$",d["Date d.m.y (e.g. 21.12.2013)"]="^([0-9]|[0,1,2][0-9]|3[0,1])\\.([0-9]|1[0,1,2])\\.[0-9]{4}$",d["MySQL Date Format (2013-12-21)"]="^\\d{4}-(0[0-9]|1[0,1,2])-([0,1,2][0-9]|3[0,1])$",d)if(d.hasOwnProperty(_)){var r=jQuery('<option id="edit_for_label_common'+l+'" value="'+d[_]+'"'+(i==l?' selected="selected"':"")+">"+_+"</option>");n.append(r),l++}return create_option_container(a,n,"edit_main_tr13","yes"==t)}function create_case_sensitive(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_regArg_'+e+'">Case Insensitive</label>'),jQuery('<input type="checkbox" id="el_regArg_'+e+'" onchange="set_regExpArgument(\''+e+"_regArgument')\""+("i"==i?' checked="checked"':"")+" />"),"edit_main_tr14","yes"==t)}function set_regExpArgument(e){document.getElementById(e+"form_id_temp").value.length<=0?document.getElementById(e+"form_id_temp").setAttribute("value","i"):document.getElementById(e+"form_id_temp").setAttribute("value","")}function create_alert_message(e,t,i){return create_option_container(jQuery('<label class="fm-field-label regExp_cell" for="regExp_alert'+e+'">Alert Message</label>'),jQuery('<textarea id="regExp_alert'+e+'" class="regExp_cell fm-width-100" onKeyUp="change_regExpAlert(this.value, \''+e+"_regExp_alertform_id_temp')\">"+i+"</textarea>"),"edit_main_tr15","yes"==t)}function change_regExpAlert(e,t){document.getElementById(t).value=e}function create_additional_attributes(e,t,i){var a=jQuery('<label class="fm-field-label">Additional Attributes</label>'),l=jQuery('<span class="fm-add-attribute dashicons dashicons-plus-alt" onClick="add_attr('+e+", '"+i+'\')" title="Add"></span>'),d=jQuery('<div id="attributes" class="fm-width-100"></div>'),_=jQuery('<div idi="0" class="fm-width-100"><div class="fm-header-label fm-width-45">Name</div><div class="fm-header-label fm-width-45">Value</div><div></div></div>');for(d.append(_),d.hide(),n=t.length,j=1;j<=n;j++){var r=jQuery('<div idi="'+j+'" id="attr_row_'+j+'" class="fm-width-100"><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_name'+j+'" value="'+t[j-1]+'" onChange="change_attribute_name(\''+e+"', this, '"+i+'\')" /></div><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_value'+j+'" value="'+w_attr_value[j-1]+'" onChange="change_attribute_value('+e+", "+j+", '"+i+'\')" /></div><div class="fm-table-col"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_choices'+j+'_remove" onClick="remove_attr('+j+", "+e+", '"+i+"')\"></span></div></div>");d.append(r),d.show()}var o=a;return create_option_container(null,o=(o=o.add(l)).add(d))}function add_attr(e,t){var i=jQuery("#attributes");i.show(),j=parseInt(i.children().last().prop("idi"))+1,w_attr_name="attribute",w_attr_value="value";var a=jQuery('<div idi="'+j+'" id="attr_row_'+j+'" class="fm-width-100"><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_name'+j+'" value="'+w_attr_name+'" onChange="change_attribute_name(\''+e+"', this, '"+t+'\')" /></div><div class="fm-table-col fm-width-45"><input type="text" class="fm-field-choice" id="attr_value'+j+'" value="'+w_attr_value+'" onChange="change_attribute_value('+e+", "+j+", '"+t+'\')" /></div><div class="fm-table-col"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_choices'+j+'_remove" onClick="remove_attr('+j+", "+e+", '"+t+"')\"></span></div></div>");i.append(a),refresh_attr(e,t),jQuery("#edit_table").scrollTop(jQuery("#attributes").offset().top)}function change_attribute_name(e,t,i){if(value=t.value,value)if("style"!=value.toLowerCase())if(value!=parseInt(value)){if(-1!=value.indexOf(" ")){return value=value.replace(/\s+/g,""),t.value=value,alert("The name of the attribute cannot contain a space."),void refresh_attr(e,i)}refresh_attr(e,i)}else alert("The name of the attribute cannot be a number.");else alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');else alert("The name of the attribute is required.")}function change_attribute_value(e,t,i){document.getElementById("attr_name"+t).value?"style"!=document.getElementById("attr_name"+t).value.toLowerCase()?refresh_attr(e,i):alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.'):alert("The name of the attribute is required.")}function remove_attr(e,t,i){tr=jQuery("#attr_row_"+e),table=jQuery("#attributes"),tr.remove(),1==table.children().length&&table.hide(),refresh_attr(t,i)}function refresh_attr(e,t){switch(t){case"type_text":case"type_paypal_price_new":case"type_star_rating":case"type_scale_rating":case"type_spinner":case"type_slider":case"type_grading":case"type_matrix":id_array=Array(),id_array[0]=e+"_elementform_id_temp";break;case"type_paypal_price":id_array=Array(),id_array[0]=e+"_element_dollarsform_id_temp",id_array[1]=e+"_element_centsform_id_temp";break;case"type_range":id_array=Array(),id_array[0]=e+"_elementform_id_temp0",id_array[1]=e+"_elementform_id_temp1";break;case"type_name":id_array=Array(),id_array[0]=e+"_element_firstform_id_temp",id_array[1]=e+"_element_lastform_id_temp",id_array[2]=e+"_element_titleform_id_temp",id_array[3]=e+"_element_middleform_id_temp";break;case"type_address":id_array=Array(),id_array[0]=e+"_street1form_id_temp",id_array[1]=e+"_street2form_id_temp",id_array[2]=e+"_cityform_id_temp",id_array[3]=e+"_stateform_id_temp",id_array[4]=e+"_postalform_id_temp",id_array[5]=e+"_countryform_id_temp";break;case"type_checkbox":case"type_radio":for(id_array=Array(),z=0;z<50;z++)id_array[z]=e+"_elementform_id_temp"+z;break;case"type_time":id_array=Array(),id_array[0]=e+"_hhform_id_temp",id_array[1]=e+"_mmform_id_temp",id_array[2]=e+"_ssform_id_temp",id_array[3]=e+"_am_pmform_id_temp";break;case"type_date":id_array=Array(),id_array[0]=e+"_elementform_id_temp",id_array[1]=e+"_buttonform_id_temp";break;case"type_date_fields":id_array=Array(),id_array[0]=e+"_dayform_id_temp",id_array[1]=e+"_monthform_id_temp",id_array[2]=e+"_yearform_id_temp";break;case"type_captcha":id_array=Array(),id_array[0]="_wd_captchaform_id_temp",id_array[1]="_wd_captcha_inputform_id_temp",id_array[2]="_element_refreshform_id_temp";break;case"type_arithmetic_captcha":id_array=Array(),id_array[0]="_wd_arithmetic_captchaform_id_temp",id_array[1]="_wd_arithmetic_captcha_inputform_id_temp",id_array[2]="_element_refreshform_id_temp";break;case"type_recaptcha":id_array=Array(),id_array[0]="wd_recaptchaform_id_temp";break;case"type_submit_reset":id_array=Array(),id_array[0]=e+"_element_submitform_id_temp",id_array[1]=e+"_element_resetform_id_temp";break;case"type_page_break":id_array=Array(),id_array[0]="_div_between"}for(q=0;q<id_array.length;q++){id=id_array[q];var a=document.getElementById(id);if(a){for(atr=a.attributes,i=0;i<30;i++)atr[i]&&0==atr[i].name.indexOf("add_")&&(a.removeAttribute(atr[i].name),i--);for(i=0;i<10;i++)if(document.getElementById("attr_name"+i))try{a.setAttribute("add_"+document.getElementById("attr_name"+i).value,document.getElementById("attr_value"+i).value)}catch(e){alert("Only letters, numbers, hyphens and underscores are allowed.")}}}}function return_attributes(e){attr_names=new Array,attr_values=new Array;var t=document.getElementById(e);if(t)for(atr=t.attributes,i=0;i<30;i++)atr[i]&&0==atr[i].name.indexOf("add_")&&(attr_names.push(atr[i].name.replace("add_","")),attr_values.push(atr[i].value));return Array(attr_names,attr_values)}function go_to_type_text(e){w_attr_name=[],w_attr_value=[],type_text(e,"Text","","top","no","","","","no","no","","","","Incorrect Value","no",w_attr_name,w_attr_value,"no","")}function delete_last_child(){document.getElementById("form_maker_editor_ifr")&&(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=""),document.getElementById("main_editor").style.display="none",jQuery("#form_maker_editor").val(""),jQuery("#show_table").empty(),jQuery("#edit_table").empty()}function type_text(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b){jQuery("#element_type").val("type_text"),delete_last_child();var v=jQuery("#edit_table"),w=jQuery('<div id="edit_div"></div>');v.append(w);var g=jQuery('<div id="edit_main_table"></div>');w.append(g),g.append(create_field_type("type_text")),g.append(create_label(e,t)),g.append(create_label_position(e,a)),g.append(create_hide_label(e,n)),g.append(create_required(e,r)),g.append(create_placeholder(e,_)),g.append(create_field_size(e,l));var E=jQuery('<div class="inside"></div>');g.append(create_advanced_options_container(E)),E.append(create_field_label_size(e,i)),E.append(create_readonly(e,h)),E.append(create_unique_values(e,p)),E.append(create_regexp(e,o)),E.append(create_common_regexp(e,o,s)),E.append(create_custom_regexp(e,o,m)),E.append(create_case_sensitive(e,o,u)),E.append(create_alert_message(e,o,c)),E.append(create_class(e,b)),E.append(create_additional_attributes(e,f,"type_text")),element="input",cur_type="text";var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value","type_text"),A.setAttribute("name",e+"_typeform_id_temp"),A.setAttribute("id",e+"_typeform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",r),j.setAttribute("name",e+"_requiredform_id_temp"),j.setAttribute("id",e+"_requiredform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",h),x.setAttribute("name",e+"_readonlyform_id_temp"),x.setAttribute("id",e+"_readonlyform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",n),k.setAttribute("name",e+"_hide_labelform_id_temp"),k.setAttribute("id",e+"_hide_labelform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",p),I.setAttribute("name",e+"_uniqueform_id_temp"),I.setAttribute("id",e+"_uniqueform_id_temp");var C=document.createElement(element);C.setAttribute("type",cur_type),C.style.cssText="width:"+l+"px;",C.setAttribute("id",e+"_elementform_id_temp"),C.setAttribute("name",e+"_elementform_id_temp"),C.setAttribute("value",d),C.setAttribute("title",_),C.setAttribute("placeholder",_),"yes"==h&&C.setAttribute("readonly","readonly");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",o),B.setAttribute("name",e+"_regExpStatusform_id_temp"),B.setAttribute("id",e+"_regExpStatusform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",u),Q.setAttribute("name",e+"_regArgumentform_id_temp"),Q.setAttribute("id",e+"_regArgumentform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",s),T.setAttribute("name",e+"_regExp_commonform_id_temp"),T.setAttribute("id",e+"_regExp_commonform_id_temp");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",escape(m)),M.setAttribute("name",e+"_regExp_valueform_id_temp"),M.setAttribute("id",e+"_regExp_valueform_id_temp");var L=document.createElement("input");L.setAttribute("type","hidden"),L.setAttribute("value",c),L.setAttribute("name",e+"_regExp_alertform_id_temp"),L.setAttribute("id",e+"_regExp_alertform_id_temp");var z=document.createElement("div");z.setAttribute("id","main_div");var q=document.createElement("div");q.setAttribute("id",e+"_elemet_tableform_id_temp");var H="yes"==n?"none":"table-cell",N=document.createElement("div");N.setAttribute("align","left"),N.style.cssText="display:"+H,N.style.width=i+"px",N.setAttribute("id",e+"_label_sectionform_id_temp");var S=document.createElement("div");S.setAttribute("align","left"),S.style.display="table-cell",S.setAttribute("id",e+"_element_sectionform_id_temp");var D=document.createElement("br"),P=document.createElement("span");P.setAttribute("id",e+"_element_labelform_id_temp"),P.innerHTML=t,P.setAttribute("class","label"),P.style.verticalAlign="top";var O=document.createElement("span");O.setAttribute("id",e+"_required_elementform_id_temp"),O.innerHTML="",O.setAttribute("class","required"),O.style.verticalAlign="top","yes"==r&&(O.innerHTML=" *");var K=document.getElementById("show_table");N.appendChild(P),N.appendChild(O),S.appendChild(A),S.appendChild(j),S.appendChild(x),S.appendChild(k),S.appendChild(B),S.appendChild(M),S.appendChild(T),S.appendChild(L),S.appendChild(Q),S.appendChild(I),S.appendChild(C),q.appendChild(N),q.appendChild(S),z.appendChild(q),z.appendChild(D),K.appendChild(z),jQuery("#main_div").append(form_maker.type_text_description),"top"==a&&label_top(e),change_class(b,e),refresh_attr(e,"type_text")}function create_upload_max_size(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_max_size">Maximum size(KB)</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_max_size" onKeyPress="return check_isnum(event)" onChange="change_file_value(this.value,\''+e+"_max_size', '***max_sizeskizb"+e+"***', '***max_sizeverj"+e+'***\')" value="'+t+'" /><p class="description">'+form_maker.upload_max_size+"</p>"))}function change_file_value(e,t,i,a){void 0===i&&(a=i=""),input=document.getElementById(t),input.value=i+e+a,input.setAttribute("value",i+e+a)}function create_upload_destination(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_destination_input">Destination</label>'),jQuery('<b id="el_destination_input_info">'+upload_url.replace(fm_site_url,"")+'/</b><input type="text" class="fm-width-100" id="el_destination_input" onChange="change_file_value(this.value,\''+e+"_destination', '***destinationskizb"+e+"***', '***destinationverj"+e+'***\')" value="'+t.replace(upload_url,"")+'" />'))}function create_upload_extensions(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_extension">Allowed file extensions</label>'),jQuery('<textarea class="fm-width-100" id="edit_for_extension" rows="4" onChange="change_file_value(this.value,\''+e+"_extension', '***extensionskizb"+e+"***', '***extensionverj"+e+"***')\">"+t+"</textarea>"))}function create_class(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_style_textarea">Class name</label>'),jQuery('<input type="text" class="fm-width-100" id="el_style_textarea" onChange="change_class(this.value,'+e+')" value="'+t+'" />'))}function change_class(e,t){document.getElementById(t+"_label_sectionform_id_temp")&&document.getElementById(t+"_label_sectionform_id_temp").setAttribute("class",e),document.getElementById(t+"_element_sectionform_id_temp")&&document.getElementById(t+"_element_sectionform_id_temp").setAttribute("class",e)}function create_multiple_upload(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_multiple">Allow Uploading Multiple Files</label>'),jQuery('<input type="checkbox" id="el_multiple" onchange="set_multiple('+e+', this.checked)"'+("yes"==t?' checked="checked"':"")+" />"))}function set_multiple(e,t){t?document.getElementById(e+"_elementform_id_temp").setAttribute("multiple","multiple"):document.getElementById(e+"_elementform_id_temp").removeAttribute("multiple")}function type_file_upload(e,t,i,a,n,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_file_upload"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('<div id="edit_div"></div>');c.append(p);var f=jQuery('<div id="edit_main_table"></div>');p.append(f),f.append(create_field_type("type_file_upload")),f.append(create_label(e,t)),f.append(create_label_position(e,a)),f.append(create_hide_label(e,n)),f.append(create_required(e,r)),f.append(create_upload_extensions(e,d));var y=jQuery('<div class="inside"></div>');f.append(create_advanced_options_container(y)),y.append(create_field_label_size(e,i)),y.append(create_upload_max_size(e,_)),y.append(create_upload_destination(e,l)),y.append(create_class(e,m)),y.append(create_multiple_upload(e,o)),y.append(create_additional_attributes(e,s,"type_file_upload")),element="input",type="file";var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value","type_file_upload"),h.setAttribute("name",e+"_typeform_id_temp"),h.setAttribute("id",e+"_typeform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",r),b.setAttribute("name",e+"_requiredform_id_temp"),b.setAttribute("id",e+"_requiredform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",n),v.setAttribute("name",e+"_hide_labelform_id_temp"),v.setAttribute("id",e+"_hide_labelform_id_temp");var w=document.createElement(element);w.setAttribute("type",type),w.setAttribute("class","file_upload"),w.setAttribute("id",e+"_elementform_id_temp"),w.setAttribute("name",e+"_fileform_id_temp"),"yes"==o&&w.setAttribute("multiple","multiple");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","***max_sizeskizb"+e+"***"+_+"***max_sizeverj"+e+"***"),g.setAttribute("id",e+"_max_size"),g.setAttribute("name",e+"_max_size");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value","***destinationskizb"+e+"***"+l+"***destinationverj"+e+"***"),E.setAttribute("id",e+"_destination"),E.setAttribute("name",e+"_destination");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value","***extensionskizb"+e+"***"+d+"***extensionverj"+e+"***"),A.setAttribute("id",e+"_extension"),A.setAttribute("name",e+"_extension");var j=document.createElement("div");j.setAttribute("id","main_div");var x=document.createElement("div");x.setAttribute("id",e+"_elemet_tableform_id_temp");var k="yes"==n?"none":"table-cell",I=document.createElement("div");I.setAttribute("align","left"),I.style.display=k,I.style.width=i+"px",I.setAttribute("id",e+"_label_sectionform_id_temp");var C=document.createElement("div");C.setAttribute("align","left"),C.style.display="table-cell",C.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var B=document.createElement("br"),Q=(document.createElement("br"),document.createElement("span"));Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label"),Q.style.verticalAlign="top";var T=document.createElement("span");T.setAttribute("id",e+"_required_elementform_id_temp"),T.innerHTML="",T.setAttribute("class","required"),T.style.verticalAlign="top","yes"==r&&(T.innerHTML=" *");var M=document.getElementById("show_table");I.appendChild(Q),I.appendChild(T),C.appendChild(v),C.appendChild(h),C.appendChild(b),C.appendChild(g),C.appendChild(E),C.appendChild(A),C.appendChild(w),x.appendChild(I),x.appendChild(C),j.appendChild(x),j.appendChild(B),M.appendChild(j),jQuery("#main_div").append(form_maker.type_file_upload_description),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function go_to_type_stripe(e){if(document.getElementById("is_stripe"))return!1;type_stripe(e,"","","top","")}function type_stripe(e,t,i,a,n){jQuery("#element_type").val("type_stripe"),delete_last_child();var l=jQuery("#edit_table"),d=jQuery('<div id="edit_div"></div>');l.append(d);var _=jQuery('<div id="edit_main_table"></div>');d.append(_),_.append(create_field_type("type_stripe")),_.append(create_field_size(e,t)),_.append(create_label_position_stripe(e,a));var r=jQuery('<div class="inside"></div>');_.append(create_advanced_options_container(r)),r.append(create_field_label_size(e,i)),r.append(create_class(e,n));var o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("value","type_stripe"),o.setAttribute("name",e+"_typeform_id_temp"),o.setAttribute("id",e+"_typeform_id_temp");var m=document.createElement("div");m.setAttribute("id","main_div");var s=document.createElement("div");s.setAttribute("id",e+"_elemet_tableform_id_temp");var u=document.createElement("div");u.setAttribute("align","left"),u.style.display="table-cell",u.setAttribute("id",e+"_label_sectionform_id_temp"),u.style.width=i+"px";var c=document.createElement("div");c.setAttribute("align","left"),c.style.display="table-cell",c.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var p=document.createElement("br"),f=(document.createElement("br"),document.createElement("span"));f.setAttribute("id",e+"_element_labelform_id_temp"),f.innerHTML="stripe",f.setAttribute("class","label"),f.style.display="none";var y=document.getElementById("show_table");u.appendChild(f),c.innerHTML="<div id='"+e+"_elementform_id_temp' style='width:"+t+"px; margin:10px; border: 1px solid #000; min-width:80px;text-align:center;'> Stripe Section</div><input type='hidden' id='is_stripe' />",c.appendChild(o),s.appendChild(u),s.appendChild(c),m.appendChild(s),m.appendChild(p),y.appendChild(m),jQuery("#main_div").append(form_maker.type_stripe_description),"top"==a?label_top_stripe(e):label_left_stripe(),change_class(n,e)}function create_field_size_2(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_input_size">Size(px)</label>'),jQuery('<input type="text" class="fm-width-40" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_elementform_id_temp\', this.value)" value="'+t+'" />x<input type="text" class="fm-width-40" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_h_style(\''+e+'_elementform_id_temp\', this.value)" value="'+i+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function go_to_type_textarea(e){w_attr_name=[],w_attr_value=[],type_textarea(e,"Textarea","","top","no","","100","","","no","no","",w_attr_name,w_attr_value)}function type_textarea(e,t,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_textarea"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('<div id="edit_div"></div>');p.append(f);var y=jQuery('<div id="edit_main_table"></div>');f.append(y),y.append(create_field_type("type_textarea")),y.append(create_label(e,t)),y.append(create_label_position(e,a)),y.append(create_hide_label(e,n)),y.append(create_required(e,o)),y.append(create_placeholder(e,r)),y.append(create_field_size_2(e,l,d));var h=jQuery('<div class="inside"></div>');y.append(create_advanced_options_container(h)),h.append(create_field_label_size(e,i)),h.append(create_unique_values(e,m)),h.append(create_class(e,s)),h.append(create_additional_attributes(e,u,"type_textarea")),element="textarea";var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_textarea"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",o),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",e+"_hide_labelform_id_temp"),w.setAttribute("id",e+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",m),g.setAttribute("name",e+"_uniqueform_id_temp"),g.setAttribute("id",e+"_uniqueform_id_temp");var E=document.createElement("div");E.setAttribute("id","main_div");var A=document.createElement("div");A.setAttribute("id",e+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=i+"px",x.style.verticalAlign="top",x.setAttribute("id",e+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",e+"_element_sectionform_id_temp");var I=document.createElement("span");I.setAttribute("id",e+"_element_labelform_id_temp"),I.innerHTML=t,I.setAttribute("class","label"),I.style.verticalAlign="top";var C=document.createElement("span");C.setAttribute("id",e+"_required_elementform_id_temp"),C.innerHTML="",C.setAttribute("class","required"),C.style.verticalAlign="top","yes"==o&&(C.innerHTML=" *");var B=document.createElement(element);B.style.cssText="width:"+l+"px; height:"+d+"px;",B.setAttribute("id",e+"_elementform_id_temp"),B.setAttribute("name",e+"_elementform_id_temp"),B.setAttribute("title",r),B.setAttribute("placeholder",r),B.setAttribute("value",_),B.innerHTML=_;var Q=document.getElementById("show_table");x.appendChild(I),x.appendChild(C),k.appendChild(b),k.appendChild(v),k.appendChild(w),k.appendChild(g),k.appendChild(B),A.appendChild(x),A.appendChild(k),E.appendChild(A),Q.appendChild(E),jQuery("#main_div").append("<br>"+form_maker.type_textarea_description),"top"==a&&label_top(e),change_class(s,e),refresh_attr(e,"type_text")}function create_spinner_width(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_spinner_width">Width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_width" onKeyPress="return check_isnum(event)" onKeyUp="change_spinner_width(this.value,'+e+",'form_id_temp')\" value=\""+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function change_spinner_width(e,t,i){document.getElementById(t+"_elementform_id_temp").style.cssText="width:"+e+"px",document.getElementById(t+"_spinner_widthform_id_temp").value=e}function create_spinner_step(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_spinner_step">Step</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_step" onKeyPress="return check_isnum(event)" onKeyUp="change_spinner_step(this.value,'+e+",'form_id_temp')\" value=\""+t+'" />'))}function change_spinner_step(e,t,i){jQuery("#"+t+"_elementform_id_temp").spinner({step:e}),document.getElementById(t+"_stepform_id_temp").value=e}function create_spinner_minvalue(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_spinner_min_value">Min Value</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_min_value" onKeyPress="return check_isnum_or_minus(event)" onKeyUp="change_spinner_min_value(this.value,'+e+",'form_id_temp')\" value=\""+t+'" />'))}function change_spinner_min_value(e,t,i){jQuery("#"+t+"_elementform_id_temp").spinner({min:e}),document.getElementById(t+"_min_valueform_id_temp").value=e}function create_spinner_maxvalue(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_spinner_max_value">Max Value</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_max_value" onKeyPress="return check_isnum_or_minus(event)" onKeyUp="change_spinner_max_value(this.value,'+e+",'form_id_temp')\" value=\""+t+'" />'))}function change_spinner_max_value(e,t,i){jQuery("#"+t+"_elementform_id_temp").spinner({max:e}),document.getElementById(t+"_max_valueform_id_temp").value=e}function go_to_type_spinner(e){w_attr_name=[],w_attr_value=[],type_spinner(e,"Number","","top","no","60","","","1","","no","",w_attr_name,w_attr_value)}function type_spinner(e,t,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_spinner"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('<div id="edit_div"></div>');p.append(f);var y=jQuery('<div id="edit_main_table"></div>');f.append(y),y.append(create_field_type("type_spinner")),y.append(create_label(e,t)),y.append(create_label_position(e,a)),y.append(create_hide_label(e,n)),y.append(create_required(e,m)),y.append(create_spinner_step(e,r)),y.append(create_spinner_minvalue(e,d)),y.append(create_spinner_maxvalue(e,_)),y.append(create_spinner_width(e,l));var h=jQuery('<div class="inside"></div>');y.append(create_advanced_options_container(h)),h.append(create_field_label_size(e,i)),h.append(create_class(e,s)),h.append(create_additional_attributes(e,u,"type_spinner"));var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_spinner"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",m),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",e+"_hide_labelform_id_temp"),w.setAttribute("id",e+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",l),g.setAttribute("name",e+"_spinner_widthform_id_temp"),g.setAttribute("id",e+"_spinner_widthform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",d),E.setAttribute("id",e+"_min_valueform_id_temp"),E.setAttribute("name",e+"_min_valueform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",_),A.setAttribute("name",e+"_max_valueform_id_temp"),A.setAttribute("id",e+"_max_valueform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",r),j.setAttribute("name",e+"_stepform_id_temp"),j.setAttribute("id",e+"_stepform_id_temp");var x=document.createElement("input");x.setAttribute("type",""),x.style.cssText="width:"+l+"px",x.setAttribute("name",e+"_elementform_id_temp"),x.setAttribute("id",e+"_elementform_id_temp"),x.setAttribute("value",o),x.setAttribute("onClick","check_isnum_or_minus(event)"),x.setAttribute("onKeyPress","return check_isnum_or_minus(event)");var k=document.createElement("div");k.setAttribute("id","main_div");var I=document.createElement("div");I.setAttribute("id",e+"_elemet_tableform_id_temp");var C="yes"==n?"none":"table-cell",B=document.createElement("div");B.setAttribute("align","left"),B.style.display=C,B.style.width=i+"px",B.setAttribute("id",e+"_label_sectionform_id_temp");var Q=document.createElement("div");Q.setAttribute("align","left"),Q.style.display="table-cell",Q.setAttribute("id",e+"_element_sectionform_id_temp");var T=document.createElement("br"),M=document.createElement("span");M.setAttribute("id",e+"_element_labelform_id_temp"),M.innerHTML=t,M.setAttribute("class","label");var L=document.createElement("span");L.setAttribute("id",e+"_required_elementform_id_temp"),L.innerHTML="",L.setAttribute("class","required"),"yes"==m&&(L.innerHTML=" *");var z=document.getElementById("show_table");B.appendChild(M),B.appendChild(L),Q.appendChild(w),Q.appendChild(b),Q.appendChild(v),Q.appendChild(g),Q.appendChild(E),Q.appendChild(A),Q.appendChild(j),Q.appendChild(x),I.appendChild(B),I.appendChild(Q),k.appendChild(I),k.appendChild(T),z.appendChild(k),"top"==a&&label_top(e),change_class(s,e),refresh_attr(e,"type_spinner"),jQuery("#"+e+"_elementform_id_temp").spinner();var q=jQuery("#"+e+"_elementform_id_temp").spinner();null==o&&q.spinner("value",""),jQuery("#"+e+"_elementform_id_temp").spinner({min:d}),jQuery("#"+e+"_elementform_id_temp").spinner({max:_}),jQuery("#"+e+"_elementform_id_temp").spinner({step:r}),jQuery("#main_div").append(form_maker.type_number_description)}function create_date_format(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="date_format">Date Format</label>'),jQuery('<input class="fm-width-100" type="text" id="date_format" onChange="change_date_format(this.value, '+e+", 'format')\" value=\""+t+'" />'))}function change_date_format(e,t,i){var a=document.getElementById(t+"_buttonform_id_temp");if("format"==i){document.getElementById(t+"_dis_past_daysform_id_temp").value;a.setAttribute("format",e)}else{document.getElementById(t+"_dis_past_daysform_id_temp").value=1==e?"yes":"no";e=document.getElementById("date_format").value}jQuery("[name^="+t+"_elementform_id_temp]").datepicker("option","dateFormat",e)}function create_week_start(e,t){var i=jQuery('<label class="fm-field-label">First Day of the Week</label>'),a=jQuery('<select class="fm-width-100" id="start_day" name="start_day" onChange="change_start_day(this.value,'+e+')"></select>'),n=0,l=[];for(var d in l[0]=form_maker.sunday,l[1]=form_maker.monday,l[2]=form_maker.tuesday,l[3]=form_maker.wednesday,l[4]=form_maker.thursday,l[5]=form_maker.friday,l[6]=form_maker.saturday,l)if(l.hasOwnProperty(d)){var _=jQuery('<option value="'+d+'"'+(t==n?' selected="selected"':"")+">"+l[d]+"</option>");a.append(_),n++}return create_option_container(i,a)}function change_start_day(e,t){document.getElementById(t+"_start_dayform_id_temp").value=e,jQuery("input[name^="+t+"_elementform_id_temp]").datepicker("option","firstDay",e)}function create_default_date(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="default_date">Default Date</label>'),jQuery('<input class="fm-width-100" type="text" id="default_date" onChange="change_hidden_input_value(this.value, \'default_date\', '+e+", '"+e+'_default_date_id_temp\')" value="'+t+'" />'))}function change_hidden_input_value(element_value,date_fields,id_int,id){document.getElementById(id).value=element_value,"default_date"==date_fields?"today"==element_value?jQuery("#"+id_int+"_elementform_id_temp").datepicker("setDate",new Date):(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w")&&""!==element_value&&(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").prop("format"),new Date(element_value))),jQuery("#"+id_int+"_elementform_id_temp").datepicker("setDate",element_value)):"minDate"==date_fields||"maxDate"==date_fields?"today"==element_value?jQuery("#"+id_int+"_elementform_id_temp").datepicker("option",date_fields,new Date):(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w")&&""!==element_value&&(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").prop("format"),new Date(element_value))),jQuery("#"+id_int+"_elementform_id_temp").datepicker("option",date_fields,element_value)):jQuery("#"+id_int+"_elementform_id_temp").datepicker("option","beforeShowDay",function(date){for(var invalid_dates=element_value,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var w_hide_sunday="yes"==jQuery("#"+id_int+"_show_week_days").prop("sunday")?"true":"day != 0",w_hide_monday="yes"==jQuery("#"+id_int+"_show_week_days").prop("monday")?"true":"day != 1",w_hide_tuesday="yes"==jQuery("#"+id_int+"_show_week_days").prop("tuesday")?"true":"day != 2",w_hide_wednesday="yes"==jQuery("#"+id_int+"_show_week_days").prop("wednesday")?"true":"day != 3",w_hide_thursday="yes"==jQuery("#"+id_int+"_show_week_days").prop("thursday")?"true":"day != 4",w_hide_friday="yes"==jQuery("#"+id_int+"_show_week_days").prop("friday")?"true":"day != 5",w_hide_saturday="yes"==jQuery("#"+id_int+"_show_week_days").prop("saturday")?"true":"day != 6",day=date.getDay(),string_days=jQuery.datepicker.formatDate("mm/dd/yy",date);return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]})}function create_minimum_date(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="min_date">Minimum Date</label>'),jQuery('<input class="fm-width-100" type="text" id="min_date" onChange="'+(1==i?"change_hidden_input_value_range(this.value, 'minDate', 'start', '"+e+"', '"+e+"_min_date_id_temp')":"change_hidden_input_value(this.value, 'minDate', "+e+", '"+e+"_min_date_id_temp')")+'" value="'+t+'" />'))}function create_maximum_date(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="max_date">Maximum Date</label>'),jQuery('<input class="fm-width-100" type="text" id="max_date" onChange="'+(1==i?"change_hidden_input_value_range(this.value, 'maxDate', 'end', "+e+", '"+e+"_max_date_id_temp')":"change_hidden_input_value(this.value, 'maxDate', "+e+", '"+e+"_max_date_id_temp')")+'" value="'+t+'" />'))}function create_excluded_dates(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="invalid_dates">Dates to Exclude</label>'),jQuery('<textarea class="fm-width-100" id="invalid_dates" rows="4" onChange="'+(1==i?"change_hidden_input_value_range(this.value, 'invalide_date', '', "+e+", '"+e+"_invalid_dates_id_temp')":"change_hidden_input_value(this.value, 'invalide_date', "+e+", '"+e+"_invalid_dates_id_temp')")+'">'+t+"</textarea>"))}function create_show_date_picker_button(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_show_image">Show Date Picker Button</label>'),jQuery('<input type="checkbox" id="el_show_image" onchange="show_image_datepicker(\''+e+"_show_image', '"+i+"')\""+("yes"==t?' checked="checked"':"")+" />"))}function show_image_datepicker(e,t){"yes"==document.getElementById(e+"form_id_temp").value?("date_range"==t?(jQuery("#"+e+"dateform_id_temp0").removeClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp0").addClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp1").removeClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp1").addClass("wd-hidden")):(jQuery("#"+e+"dateform_id_temp").removeClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp").addClass("wd-hidden")),document.getElementById(e+"form_id_temp").setAttribute("value","no")):("date_range"==t?(jQuery("#"+e+"dateform_id_temp0").removeClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp0").addClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp1").removeClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp1").addClass("wd-inline-block")):(jQuery("#"+e+"dateform_id_temp").removeClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp").addClass("wd-inline-block")),document.getElementById(e+"form_id_temp").setAttribute("value","yes"))}function create_selectable_week_days(e,t){var i=jQuery('<label class="fm-field-label">Selectable Week Days</label>'),a=jQuery('<input type="checkbox" id="el_show_sunday" onclick="show_week_days('+e+", 'sunday')\""+("yes"==t[0]?' checked="checked"':"")+" />"),n=jQuery('<label for="el_show_sunday">'+form_maker.sunday+"</label>"),l=jQuery('<input type="checkbox" id="el_show_monday" onclick="show_week_days('+e+", 'monday')\""+("yes"==t[1]?' checked="checked"':"")+" />"),d=jQuery('<label for="el_show_monday">'+form_maker.monday+"</label>"),_=jQuery('<input type="checkbox" id="el_show_tuesday" onclick="show_week_days('+e+", 'tuesday')\""+("yes"==t[2]?' checked="checked"':"")+" />"),r=jQuery('<label for="el_show_tuesday">'+form_maker.tuesday+"</label>"),o=jQuery('<input type="checkbox" id="el_show_wednesday" onclick="show_week_days('+e+", 'wednesday')\""+("yes"==t[3]?' checked="checked"':"")+" />"),m=jQuery('<label for="el_show_wednesday">'+form_maker.wednesday+"</label>"),s=jQuery('<input type="checkbox" id="el_show_thursday" onclick="show_week_days('+e+", 'thursday')\""+("yes"==t[4]?' checked="checked"':"")+" />"),u=jQuery('<label for="el_show_thursday">'+form_maker.thursday+"</label>"),c=jQuery('<input type="checkbox" id="el_show_friday" onclick="show_week_days('+e+", 'friday')\""+("yes"==t[5]?' checked="checked"':"")+" />"),p=jQuery('<label for="el_show_friday">'+form_maker.friday+"</label>"),f=jQuery('<input type="checkbox" id="el_show_saturday" onclick="show_week_days('+e+", 'saturday')\""+("yes"==t[6]?' checked="checked"':"")+" />"),y=jQuery('<label for="el_show_saturday">'+form_maker.saturday+"</label>"),h=a;return create_option_container(i,h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=h.add(n)).add(jQuery("<br />"))).add(l)).add(d)).add(jQuery("<br />"))).add(_)).add(r)).add(jQuery("<br />"))).add(o)).add(m)).add(jQuery("<br />"))).add(s)).add(u)).add(jQuery("<br />"))).add(c)).add(p)).add(jQuery("<br />"))).add(f)).add(y))}function go_to_type_date_new(e){w_attr_name=[],w_attr_value=[],w_show_days=["yes","yes","yes","yes","yes","yes","yes"],type_date_new(e,"Date","","top","no","","","no","no","","mm/dd/yy","0","","","","",w_show_days,"yes","...",w_attr_name,w_attr_value,"no")}function type_date_new(i,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days){jQuery("#element_type").val("type_date_new"),delete_last_child();var t=jQuery("#edit_table"),edit_div=jQuery('<div id="edit_div"></div>');t.append(edit_div);var edit_main_table=jQuery('<div id="edit_main_table"></div>');edit_div.append(edit_main_table),edit_main_table.append(create_field_type("type_date_new")),edit_main_table.append(create_label(i,w_field_label)),edit_main_table.append(create_label_position(i,w_field_label_pos)),edit_main_table.append(create_hide_label(i,w_hide_label)),edit_main_table.append(create_required(i,w_required)),edit_main_table.append(create_field_size(i,w_size)),edit_main_table.append(create_date_format(i,w_format)),edit_main_table.append(create_week_start(i,w_start_day));var advanced_options_container=jQuery('<div class="inside"></div>');edit_main_table.append(create_advanced_options_container(advanced_options_container)),advanced_options_container.append(create_default_date(i,w_default_date)),advanced_options_container.append(create_minimum_date(i,w_min_date)),advanced_options_container.append(create_maximum_date(i,w_max_date)),advanced_options_container.append(create_excluded_dates(i,w_invalid_dates)),advanced_options_container.append(create_selectable_week_days(i,w_show_days)),advanced_options_container.append(create_field_label_size(i,w_field_label_size)),advanced_options_container.append(create_class(i,w_class)),advanced_options_container.append(create_show_date_picker_button(i,w_show_image,"new_date")),advanced_options_container.append(create_additional_attributes(i,w_attr_name,"type_date_new"));var adding_type=document.createElement("input");adding_type.setAttribute("type","hidden"),adding_type.setAttribute("value","type_date_new"),adding_type.setAttribute("name",i+"_typeform_id_temp"),adding_type.setAttribute("id",i+"_typeform_id_temp");var adding_required=document.createElement("input");adding_required.setAttribute("type","hidden"),adding_required.setAttribute("value",w_required),adding_required.setAttribute("name",i+"_requiredform_id_temp"),adding_required.setAttribute("id",i+"_requiredform_id_temp");var adding_hide_label=document.createElement("input");adding_hide_label.setAttribute("type","hidden"),adding_hide_label.setAttribute("value",w_hide_label),adding_hide_label.setAttribute("name",i+"_hide_labelform_id_temp"),adding_hide_label.setAttribute("id",i+"_hide_labelform_id_temp");var adding_dis_past_days=document.createElement("input");adding_dis_past_days.setAttribute("type","hidden"),adding_dis_past_days.setAttribute("value",w_disable_past_days),adding_dis_past_days.setAttribute("id",i+"_dis_past_daysform_id_temp"),adding_dis_past_days.setAttribute("name",i+"_dis_past_daysform_id_temp");var adding_start_day=document.createElement("input");adding_start_day.setAttribute("type","hidden"),adding_start_day.setAttribute("value",w_start_day),adding_start_day.setAttribute("name",i+"_start_dayform_id_temp"),adding_start_day.setAttribute("id",i+"_start_dayform_id_temp");var adding_default_date=document.createElement("input");adding_default_date.setAttribute("type","hidden"),adding_default_date.setAttribute("name",i+"_default_date_id_temp"),adding_default_date.setAttribute("id",i+"_default_date_id_temp"),adding_default_date.setAttribute("value",w_default_date);var adding_min_date=document.createElement("input");adding_min_date.setAttribute("type","hidden"),adding_min_date.setAttribute("name",i+"_min_date_id_temp"),adding_min_date.setAttribute("id",i+"_min_date_id_temp"),adding_min_date.setAttribute("value",w_min_date);var adding_max_date=document.createElement("input");adding_max_date.setAttribute("type","hidden"),adding_max_date.setAttribute("name",i+"_max_date_id_temp"),adding_max_date.setAttribute("id",i+"_max_date_id_temp"),adding_max_date.setAttribute("value",w_max_date);var adding_invalid_dates=document.createElement("input");adding_invalid_dates.setAttribute("type","hidden"),adding_invalid_dates.setAttribute("name",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("id",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("value",w_invalid_dates);var adding_show_days=document.createElement("input");adding_show_days.setAttribute("type","hidden"),adding_show_days.setAttribute("name",i+"_show_week_days"),adding_show_days.setAttribute("id",i+"_show_week_days"),adding_show_days.setAttribute("sunday",w_show_days[0]),adding_show_days.setAttribute("monday",w_show_days[1]),adding_show_days.setAttribute("tuesday",w_show_days[2]),adding_show_days.setAttribute("wednesday",w_show_days[3]),adding_show_days.setAttribute("thursday",w_show_days[4]),adding_show_days.setAttribute("friday",w_show_days[5]),adding_show_days.setAttribute("saturday",w_show_days[6]);var adding_show_image=document.createElement("input");adding_show_image.setAttribute("type","hidden"),adding_show_image.setAttribute("value",w_show_image),adding_show_image.setAttribute("name",i+"_show_imageform_id_temp"),adding_show_image.setAttribute("id",i+"_show_imageform_id_temp");var adding_hide_time=document.createElement("input");adding_hide_time.setAttribute("type","hidden"),adding_hide_time.setAttribute("value",w_hide_time),adding_hide_time.setAttribute("name",i+"_hide_timeform_id_temp"),adding_hide_time.setAttribute("id",i+"_hide_timeform_id_temp");var div=document.createElement("div");div.setAttribute("id","main_div");var div_field=document.createElement("div");div_field.setAttribute("id",i+"_elemet_tableform_id_temp");var display_label_div="yes"==w_hide_label?"none":"table-cell",div_label=document.createElement("div");div_label.setAttribute("align","left"),div_label.style.display=display_label_div,div_label.style.width=w_field_label_size+"px",div_label.setAttribute("id",i+"_label_sectionform_id_temp");var div_element=document.createElement("div");div_element.setAttribute("align","left"),div_element.style.display="table-cell",div_element.style.position="relative",div_element.setAttribute("id",i+"_element_sectionform_id_temp");var table_date=document.createElement("div");table_date.setAttribute("id",i+"_table_date"),table_date.style.display="table";var tr_date1=document.createElement("div");tr_date1.setAttribute("id",i+"_tr_date1"),tr_date1.style.display="table-row";var tr_date2=document.createElement("div");tr_date2.setAttribute("id",i+"_tr_date2"),tr_date2.style.display="table-row";var td_date_input1=document.createElement("div");td_date_input1.setAttribute("id",i+"_td_date_input1"),td_date_input1.style.display="table-cell";var td_date_input2=document.createElement("div");td_date_input2.setAttribute("id",i+"_td_date_input2"),td_date_input2.style.display="table-cell";var td_date_input3=document.createElement("div");td_date_input3.setAttribute("id",i+"_td_date_input3"),td_date_input3.style.display="table-cell";var td_date_label1=document.createElement("div");td_date_label1.setAttribute("id",i+"_td_date_label1"),td_date_label1.style.display="table-cell";var td_date_label2=document.createElement("div");td_date_label2.setAttribute("id",i+"_td_date_label2"),td_date_label2.style.display="table-cell";var td_date_label3=document.createElement("div");td_date_label3.setAttribute("id",i+"_td_date_label3"),td_date_label3.style.display="table-cell";var br3=document.createElement("br"),br4=document.createElement("br"),label=document.createElement("span");label.setAttribute("id",i+"_element_labelform_id_temp"),label.innerHTML=w_field_label,label.setAttribute("class","label"),label.style.verticalAlign="top";var required=document.createElement("span");required.setAttribute("id",i+"_required_elementform_id_temp"),required.innerHTML="",required.setAttribute("class","required"),required.style.verticalAlign="top","yes"==w_required&&(required.innerHTML=" *");var adding=document.createElement("input");adding.setAttribute("type","text"),adding.setAttribute("value",w_date),adding.setAttribute("id",i+"_elementform_id_temp"),adding.setAttribute("name",i+"_elementform_id_temp"),adding.style.cssText="width:"+w_size+"px;";var adding_image=document.createElement("span");adding_image.setAttribute("id",i+"_show_imagedateform_id_temp"),adding_image.setAttribute("class","dashicons dashicons-calendar-alt wd-calendar-button "+("yes"==w_show_image?"wd-inline-block":"wd-hidden")),adding_image.setAttribute("onClick","show_datepicker('"+i+"_elementform_id_temp')");var adding_desc_p=document.createElement("p"),adding_desc_b=document.createElement("b"),text_format_1=document.createTextNode("The format can be combinations of the following:"),text_format_2=document.createTextNode("d - day of month (no leading zero)"),text_format_3=document.createTextNode("dd - day of month (two digit)"),text_format_4=document.createTextNode("o - day of the year (no leading zeros)"),text_format_5=document.createTextNode("oo - day of the year (three digit)"),text_format_6=document.createTextNode("D - day name short"),text_format_7=document.createTextNode("DD - day name long"),text_format_8=document.createTextNode("m - month of year (no leading zero)"),text_format_9=document.createTextNode("mm - month of year (two digit)"),text_format_10=document.createTextNode("M - month name short"),text_format_11=document.createTextNode("MM - month name long"),text_format_12=document.createTextNode("y - year (two digit)"),text_format_13=document.createTextNode("yy - year (four digit)"),format_br_1=document.createElement("br"),format_br_2=document.createElement("br"),format_br_3=document.createElement("br"),format_br_4=document.createElement("br"),format_br_5=document.createElement("br"),format_br_6=document.createElement("br"),format_br_7=document.createElement("br"),format_br_8=document.createElement("br"),format_br_9=document.createElement("br"),format_br_10=document.createElement("br"),format_br_11=document.createElement("br"),format_br_12=document.createElement("br"),format_br_13=document.createElement("br"),adding_desc_p_2=document.createElement("p"),adding_desc_b_2=document.createElement("b"),text_default_1=document.createTextNode("Accepted values of Default, Minimum and Maximum:"),text_default_3=document.createTextNode("Date: A fixed date using the date format mm/dd/yy, e.g. 05/25/2016"),text_default_2=document.createTextNode("Empty: No default / minimum / maximum"),text_default_4=document.createTextNode("'today' : current date"),text_default_5=document.createTextNode("Relative date: A number of days/weeks/months/years from today, e.g. '-1d' will be yesterday, '+1y+3m+2w+3d' will be 1 year, 3 months, 2 weeks and 3 days from today."),adding_desc_p_3=document.createElement("p"),adding_desc_b_3=document.createElement("b"),text_default_6=document.createTextNode("Dates to exclude:"),text_default_7=document.createTextNode("Enter comma-separated list of dates and date ranges using the date format 'mm/dd/yy', e.g. 08/15/2016, 06/15/2016-06/20/2016"),default_br_1=document.createElement("br"),default_br_2=document.createElement("br"),default_br_3=document.createElement("br"),default_br_4=document.createElement("br"),default_br_5=document.createElement("br"),default_br_6=document.createElement("br"),default_br_7=document.createElement("br"),dis_past_days="yes"==w_disable_past_days,adding_button=document.createElement("input");adding_button.setAttribute("id",i+"_buttonform_id_temp"),adding_button.setAttribute("class","button"),adding_button.setAttribute("type","hidden"),adding_button.setAttribute("value",w_but_val),adding_button.setAttribute("format",w_format);var main_td=document.getElementById("show_table");div_label.appendChild(label),div_label.appendChild(required),div_element.appendChild(adding_type),div_element.appendChild(adding_required),div_element.appendChild(adding_hide_label),div_element.appendChild(adding_show_image),div_element.appendChild(adding_dis_past_days),div_element.appendChild(adding),div_element.appendChild(adding_image),adding_desc_b.appendChild(text_format_1),adding_desc_p.appendChild(adding_desc_b),adding_desc_p.appendChild(format_br_1),adding_desc_p.appendChild(text_format_2),adding_desc_p.appendChild(format_br_2),adding_desc_p.appendChild(text_format_3),adding_desc_p.appendChild(format_br_3),adding_desc_p.appendChild(text_format_4),adding_desc_p.appendChild(format_br_4),adding_desc_p.appendChild(text_format_5),adding_desc_p.appendChild(format_br_5),adding_desc_p.appendChild(text_format_6),adding_desc_p.appendChild(format_br_6),adding_desc_p.appendChild(text_format_7),adding_desc_p.appendChild(format_br_7),adding_desc_p.appendChild(text_format_8),adding_desc_p.appendChild(format_br_8),adding_desc_p.appendChild(text_format_9),adding_desc_p.appendChild(format_br_9),adding_desc_p.appendChild(text_format_10),adding_desc_p.appendChild(format_br_10),adding_desc_p.appendChild(text_format_11),adding_desc_p.appendChild(format_br_11),adding_desc_p.appendChild(text_format_12),adding_desc_p.appendChild(format_br_12),adding_desc_p.appendChild(text_format_13),adding_desc_p.appendChild(format_br_13),adding_desc_b_2.appendChild(text_default_1),adding_desc_p_2.appendChild(adding_desc_b_2),adding_desc_p_2.appendChild(default_br_1),adding_desc_p_2.appendChild(text_default_2),adding_desc_p_2.appendChild(default_br_2),adding_desc_p_2.appendChild(text_default_3),adding_desc_p_2.appendChild(default_br_3),adding_desc_p_2.appendChild(text_default_4),adding_desc_p_2.appendChild(default_br_4),adding_desc_p_2.appendChild(text_default_5),adding_desc_b_3.appendChild(text_default_6),adding_desc_p_3.appendChild(adding_desc_b_3),adding_desc_p_3.appendChild(default_br_6),adding_desc_p_3.appendChild(text_default_7),adding_desc_p_3.appendChild(default_br_7),div_element.appendChild(adding_default_date),div_element.appendChild(adding_start_day),div_element.appendChild(adding_min_date),div_element.appendChild(adding_max_date),div_element.appendChild(adding_invalid_dates),div_element.appendChild(adding_hide_time),div_element.appendChild(adding_show_days),div_element.appendChild(adding_button),div_field.appendChild(div_label),div_field.appendChild(div_element),div.appendChild(div_field),div.appendChild(br3),div.appendChild(adding_desc_p),div.appendChild(adding_desc_p_2),div.appendChild(adding_desc_p_3),main_td.appendChild(div),"top"==w_field_label_pos&&label_top(i),change_class(w_class,i),refresh_attr(i,"type_text"),jQuery("#"+i+"_elementform_id_temp").datepicker({dateFormat:"mm/dd/yy",minDate:w_min_date,maxDate:w_max_date,firstDay:w_start_day,changeMonth:!0,changeYear:!0,yearRange:"-100:+50",showOtherMonths:!0,selectOtherMonths:!0,beforeShowDay:function(date){for(var invalid_dates=w_invalid_dates,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var string_days=jQuery.datepicker.formatDate("mm/dd/yy",date),day=date.getDay(),w_hide_sunday="yes"==w_show_days[0]?"true":"day != 0",w_hide_monday="yes"==w_show_days[1]?"true":"day != 1",w_hide_tuesday="yes"==w_show_days[2]?"true":"day != 2",w_hide_wednesday="yes"==w_show_days[3]?"true":"day != 3",w_hide_thursday="yes"==w_show_days[4]?"true":"day != 4",w_hide_friday="yes"==w_show_days[5]?"true":"day != 5",w_hide_saturday="yes"==w_show_days[6]?"true":"day != 6";return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]}}),jQuery("#"+i+"_elementform_id_temp").datepicker("option","dateFormat",w_format),"today"==w_default_date?jQuery("#"+i+"_elementform_id_temp").datepicker("setDate",new Date):(-1==w_default_date.indexOf("d")&&-1==w_default_date.indexOf("m")&&-1==w_default_date.indexOf("y")&&-1==w_default_date.indexOf("w")&&""!==w_default_date&&(w_default_date=jQuery.datepicker.formatDate(w_format,new Date(w_default_date))),jQuery("#"+i+"_elementform_id_temp").datepicker("setDate",w_default_date))}function create_enable_options_value(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_disable_value">Enable option\'s value</label>'),jQuery('<input type="checkbox" id="el_disable_value" onchange="refresh_sel_options('+e+", '"+i+"')\""+("yes"==t?' checked="checked"':"")+" />"))}function refresh_sel_options(i,e){if("checkbox"!=e&&"radio"!=e||(jQuery("#el_disable_value").prop("checked")?(jQuery("#"+i+"_value_disabledform_id_temp").val("yes"),jQuery(".el_option_value").removeAttr("disabled")):(jQuery("#"+i+"_value_disabledform_id_temp").val("no"),jQuery(".el_option_value").prop("disabled","disabled")),refresh_rowcol(i,e)),"select"==e){jQuery("#el_disable_value").prop("checked")?(jQuery("#"+i+"_value_disabledform_id_temp").val("yes"),jQuery(".el_option_value").removeAttr("disabled"),jQuery(".el_option_dis").prop("disabled","disabled")):(jQuery("#"+i+"_value_disabledform_id_temp").val("no"),jQuery(".el_option_value").prop("disabled","disabled"),jQuery(".el_option_dis").removeAttr("disabled"));var a=document.getElementById(i+"_elementform_id_temp");a.innerHTML="",jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id,t=document.createElement("option");t.setAttribute("id",i+"_option"+e),jQuery("#el_disable_value").prop("checked")?t.setAttribute("value",jQuery(this).find(jQuery("input[type='text']"))[1].value):jQuery(this).find(jQuery("input[type='checkbox']")).prop("checked")?t.value="":t.setAttribute("value",jQuery(this).find(jQuery("input[type='text']"))[0].value),jQuery(this).find(jQuery(".el_option_params")).val()&&(w_params=jQuery(this).find(jQuery(".el_option_params")).val().split("[where_order_by]"),t.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),t.setAttribute("order_by",w_params[0]),t.setAttribute("db_info",w_params[1])),t.setAttribute("onselect","set_select('"+i+"_option"+e+"')"),t.innerHTML=jQuery(this).find(jQuery("input[type='text']"))[0].value,a.appendChild(t)})}form_maker.is_demo?jQuery("#el_choices_add").next().prop("onclick","alert('This feature is disabled in demo.')"):jQuery("#el_choices_add").next().prop("onclick","tb_show('', 'admin-ajax.php?action=select_data_from_db&field_id="+i+"&nonce="+fm_ajax.ajaxnonce+"&field_type="+e+"&value_disabled="+jQuery("#"+i+"_value_disabledform_id_temp").val()+"&width=530&height=370&TB_iframe=1');return false;")}function create_select_options(e,t,i,a,l,d){var _=jQuery('<label class="fm-field-label">Options</label>'),r=jQuery('<button id="el_choices_add" class="fm-add-option button-secondary" onClick="add_choise(\'select\', '+e+'); return false;" title="Add option"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>Option</button>');if(form_maker.is_demo)var o=jQuery('<button class="fm-add-option button-secondary" onClick="alert(\'This feature is disabled in demo.\') return false;" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');else o=jQuery("<button class=\"fm-add-option button-secondary\" onClick=\"tb_show('', 'admin-ajax.php?action=select_data_from_db&nonce="+fm_ajax.ajaxnonce+"&field_id="+e+"&field_type=select&value_disabled="+t+'&width=530&height=370&TB_iframe=1\'); return false;" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');var m=jQuery('<div class="fm-width-100 error">IMPORTANT! Check the "Empty value" checkbox only if you want the option to be considered as empty.</div>'),s=jQuery('<div id="choices" class="fm-width-100 ui-sortable"></div>'),u=jQuery('<div class="fm-width-100"><div class="fm-header-label fm-width-30">Name</div><div class="fm-header-label fm-width-30">Value</div><div class="fm-header-label fm-width-20">Empty value</div><div class="fm-header-label fm-width-10">Delete</div><div class="fm-header-label fm-width-10">Move</div></div>');for(s.append(u),n=i.length,j=0;j<n;j++){var c=jQuery('<div id="'+j+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-30"><input type="text" class="fm-field-choice" id="el_option'+j+'" value="'+i[j].replace(/"/g,"&quot;")+'" onKeyUp="change_label_name('+j+", '"+e+"_option"+j+"', this.value, 'select')\" onpaste=\"elem=this; change_label_name_on_paste("+j+", '"+e+"_option"+j+"', 'select')\""+(a[j]?' disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-30"><input type="text" class="fm-field-choice'+(a[j]?"":" el_option_value")+'" id="el_option_value'+j+'" value="'+l[j].replace(/"/g,"&quot;")+'" onKeyUp="change_label_value(\''+e+"_option"+j+"', this.value)\" onpaste=\"change_label_value_on_paste('"+e+"_option"+j+"', this)\""+("no"==t||a[j]?' disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-20"><input type="checkbox" title="Empty value" class="el_option_dis" id="el_option'+j+'_dis" onClick="dis_option(\''+e+"_option"+j+"', this.checked, "+j+')"'+("yes"==t?' disabled="disabled"':"")+(d[j]?' checked="checked"':"")+' /></div><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_option'+j+'_remove" onClick="remove_option('+j+", "+e+')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div><input type="hidden" class="el_option_params" id="el_option_params'+j+'" value="'+a[j]+'" /></div>');s.append(c)}var p=_;return create_option_container(null,p=(p=(p=(p=p.add(r)).add(o)).add(s)).add(m))}function add_choise(e,t){var i=0;if(jQuery(".change_pos").each(function(){var e=parseInt(jQuery(this)[0].id);i=i<e?e:i}),i+=1,"radio"==e||"checkbox"==e){var a=jQuery("#choices"),n=jQuery('<div id="'+i+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice" id="el_choices'+i+'" value="" onKeyUp="change_label_name(\''+i+"', '"+t+"_label_element"+i+"', this.value, '"+e+"'); change_label_value('"+t+"_elementform_id_temp"+i+"', jQuery('#el_option_value"+i+'\').val())" onpaste="elem=this; change_label_name_on_paste('+i+", '"+t+"_label_element"+i+"', '"+e+"'); change_label_value_on_paste('"+t+"_elementform_id_temp"+i+'\', this)" /></div><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice el_option_value" id="el_option_value'+i+'" value="" onKeyUp="change_label_value(\''+t+"_elementform_id_temp"+i+"', this.value)\" onpaste=\"change_label_value_on_paste('"+t+"_elementform_id_temp"+i+"', this)\""+(jQuery("#el_disable_value").prop("checked")?"":'disabled="disabled"')+' /></div><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_choices'+i+'_remove" onClick="remove_choise('+i+","+t+",'"+e+'\')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');a.append(n),refresh_rowcol(t,e)}if("select"==e){var l=jQuery("#"+t+"_elementform_id_temp"),d=jQuery('<option id="'+t+"_option"+i+'"></option>');l.append(d);a=jQuery("#choices"),n=jQuery('<div id="'+i+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-30"><input type="text" class="fm-field-choice" id="el_option'+i+'" value="" onKeyUp="change_label_name('+i+", '"+t+"_option"+i+"', this.value, 'select')\" onpaste=\"elem=this; change_label_name_on_paste("+i+", '"+t+"_option"+i+'\', \'select\')" /></div><div class="fm-table-col fm-width-30"><input type="text" class="fm-field-choice el_option_value" id="el_option_value'+i+'" value="" onKeyUp="change_label_value(\''+t+"_option"+i+"', this.value)\" onpaste=\"change_label_value_on_paste('"+t+"_option"+i+"', this)\""+(jQuery("#el_disable_value").prop("checked")?"":'disabled="disabled"')+' /></div><div class="fm-table-col fm-width-20"><input type="checkbox" title="Empty value" class="el_option_dis" id="el_option'+i+'_dis" onClick="dis_option(\''+t+"_option"+i+"', this.checked, "+i+')"'+(jQuery("#el_disable_value").prop("checked")?'disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_option'+i+'_remove" onClick="remove_option('+i+", "+t+')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div><input type="hidden" id="el_option_params'+i+'" class="el_option_params" value=""></div>');a.append(n)}}function change_label_name(e,t,i,a){jQuery("#"+t).html(i),jQuery("#el_disable_value").prop("checked")||(jQuery("#el_choices"+e).prop("other")||jQuery("#el_option_value"+e).val(i),"select"==a&&jQuery("#"+t).val(i))}function change_label_name_on_paste(e,t,i,a){setTimeout(function(){i=elem.value,jQuery("#"+t).html(i),jQuery("#el_disable_value").prop("checked")||(jQuery("#el_choices"+e).prop("other")||jQuery("#el_option_value"+e).val(i),"select"==a&&jQuery("#"+t).val(i))},100)}function change_label_value(e,t){document.getElementById(e).value=t}function change_label_value_on_paste(e,t){setTimeout(function(){label=t.value,document.getElementById(e).value=label},100)}function dis_option(e,t,i){t?(jQuery("#"+e).val(""),jQuery("#el_option_value"+i).val("")):(jQuery("#"+e).val(jQuery("#"+e).html()),jQuery("#el_option_value"+i).val(jQuery("#el_option"+i).val()))}function remove_option(e,t){var i=document.getElementById(t+"_elementform_id_temp"),a=document.getElementById(t+"_option"+e);i.removeChild(a);var n=document.getElementById("choices"),l=document.getElementById(e);n.removeChild(l)}function go_to_type_own_select(e){w_choices=["Select value","option 1","option 2"],w_choices_value=["","option 1","option 2"],w_choices_params=["","",""],w_choices_checked=["1","0","0"],w_choices_disabled=[!0,!1,!1],w_attr_name=[],w_attr_value=[],type_own_select(e,"Select","","top","no","",w_choices,w_choices_checked,"no","no","wdform_select",w_attr_name,w_attr_value,w_choices_disabled,w_choices_value,w_choices_params)}function type_own_select(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y){jQuery("#element_type").val("type_own_select"),delete_last_child();var h=jQuery("#edit_table"),b=jQuery('<div id="edit_div"></div>');h.append(b);var v=jQuery('<div id="edit_main_table"></div>');b.append(v),v.append(create_field_type("type_own_select")),v.append(create_label(i,e)),v.append(create_label_position(i,a)),v.append(create_hide_label(i,l)),v.append(create_required(i,o)),v.append(create_field_size(i,d)),v.append(create_select_options(i,m,_,y,f,p));var w=jQuery('<div class="inside"></div>');v.append(create_advanced_options_container(w)),w.append(create_field_label_size(i,t)),w.append(create_class(i,s)),w.append(create_enable_options_value(i,m,"select")),w.append(create_additional_attributes(i,u,"type_own_select")),n=_.length;var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","type_own_select"),g.setAttribute("name",i+"_typeform_id_temp"),g.setAttribute("id",i+"_typeform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",o),E.setAttribute("name",i+"_requiredform_id_temp"),E.setAttribute("id",i+"_requiredform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",l),A.setAttribute("name",i+"_hide_labelform_id_temp"),A.setAttribute("id",i+"_hide_labelform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",m),x.setAttribute("name",i+"_value_disabledform_id_temp"),x.setAttribute("id",i+"_value_disabledform_id_temp");var k=document.createElement("div");k.setAttribute("id","main_div");var I=document.createElement("div");I.setAttribute("id",i+"_elemet_tableform_id_temp");var C="yes"==l?"none":"table-cell",B=document.createElement("div");B.setAttribute("align","left"),B.style.display=C,B.style.width=t+"px",B.setAttribute("id",i+"_label_sectionform_id_temp");var Q=document.createElement("div");Q.setAttribute("align","left"),Q.style.display="table-cell",Q.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var T=document.createElement("br"),M=(document.createElement("br"),document.createElement("div"));M.setAttribute("id",i+"_table_little"),M.style.display="table";var L=document.createElement("div");L.setAttribute("id",i+"_element_tr1"),L.style.display="table-row";var z=document.createElement("div");z.setAttribute("id",i+"_element_tr2"),z.style.display="table-row";var q=document.createElement("div");q.setAttribute("valign","top"),q.setAttribute("id",i+"_td_little1"),q.style.display="table-cell";var H=document.createElement("div");H.setAttribute("valign","top"),H.setAttribute("id",i+"_td_little2"),H.style.display="table-cell";var N=document.createElement("span");N.setAttribute("id",i+"_element_labelform_id_temp"),N.innerHTML=e,N.setAttribute("class","label"),N.style.verticalAlign="top";var S=document.createElement("span");S.setAttribute("id",i+"_required_elementform_id_temp"),S.innerHTML="",S.setAttribute("class","required"),S.style.verticalAlign="top","yes"==o&&(S.innerHTML=" *");var D=document.createElement("select");for(D.setAttribute("id",i+"_elementform_id_temp"),D.setAttribute("name",i+"_elementform_id_temp"),D.style.cssText="width:"+d+"px",D.setAttribute("onchange","set_select(this)"),j=0;j<n;j++){var P=document.createElement("option");P.setAttribute("id",i+"_option"+j),"yes"==m?P.setAttribute("value",f[j].replace(/"/g,"&quot;")):p[j]?P.value="":P.setAttribute("value",_[j].replace(/"/g,"&quot;")),y[j]&&(w_params=y[j].split("[where_order_by]"),P.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),P.setAttribute("order_by",w_params[0]),P.setAttribute("db_info",w_params[1])),P.setAttribute("onselect","set_select('"+i+"_option"+j+"')"),P.innerHTML=_[j].replace(/"/g,"&quot;"),1==r[j]&&P.setAttribute("selected","selected"),D.appendChild(P)}var O=document.getElementById("show_table");B.appendChild(N),B.appendChild(S),Q.appendChild(A),Q.appendChild(g),Q.appendChild(E),Q.appendChild(x),Q.appendChild(D),I.appendChild(B),I.appendChild(Q),k.appendChild(I),k.appendChild(T),O.appendChild(k),"top"==a&&label_top(i),change_class(s,i),refresh_attr(i,"type_text"),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_sel_options(i,"select")}})}),jQuery("#main_div").append(form_maker.type_select_description)}function create_relative_position(e,t,i){var a=jQuery('<label class="fm-field-label">Relative Position</label>'),n=jQuery('<input type="radio" id="edit_for_flow_vertical" name="edit_for_flow" value="ver" onchange="refresh_rowcol('+e+",'"+i+"')\""+("hor"==t?"":' checked="checked"')+" />"),l=jQuery('<label for="edit_for_flow_vertical">Vertical</label>'),d=jQuery('<input type="radio" id="edit_for_flow_horizontal" name="edit_for_flow" value="hor" onchange="refresh_rowcol('+e+",'"+i+"')\""+("hor"==t?' checked="checked"':"")+" />"),_=jQuery('<label for="edit_for_flow_horizontal">Horizontal</label>'),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function refresh_rowcol(l,d){document.getElementById("edit_for_rowcol").value||(document.getElementById("edit_for_rowcol").value=1),document.getElementById(l+"_rowcol_numform_id_temp").value=document.getElementById("edit_for_rowcol").value;var _=document.getElementById(l+"_table_little");if(_.removeAttribute("for_hor"),_.innerHTML="",choeices=jQuery(".change_pos").length,1==document.getElementById("edit_for_flow_vertical").checked){var n=document.getElementById("edit_for_rowcol").value,r=parseInt((choeices+1)/n),o=0,m=1;tr_row=document.createElement("div"),tr_row.setAttribute("id",l+"_element_tr0"),tr_row.style.display="table-row",jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id;n<=o&&(o=0,tr_row=document.createElement("div"),tr_row.setAttribute("id",l+"_element_tr"+m),tr_row.style.display="table-row",m++);var t=document.createElement("div");t.setAttribute("valign","top"),t.setAttribute("id",l+"_td_little"+e),t.setAttribute("idi",e),t.style.display="table-cell";var i=document.createElement("input");i.setAttribute("type",d),i.setAttribute("id",l+"_elementform_id_temp"+e),"checked"==jQuery("#"+l+"_elementform_id_temp"+e).prop("checked")&&i.setAttribute("checked","checked"),"right"==document.getElementById(l+"_option_left_right").value&&(i.style.cssText="float: left !important"),"checkbox"==d&&(i.setAttribute("name",l+"_elementform_id_temp"+e),"yes"==document.getElementById(l+"_allow_otherform_id_temp").value&&"1"==jQuery(this).find("#el_choices"+e).prop("other")?(i.setAttribute("value",""),i.setAttribute("other","1"),i.setAttribute("onclick","if(set_checked('"+l+"','"+e+"','form_id_temp')) show_other_input('"+l+"','form_id_temp');")):("no"==document.getElementById(l+"_value_disabledform_id_temp").value?i.setAttribute("value",jQuery(this).find("#el_choices"+e).val()):i.setAttribute("value",jQuery(this).find("#el_option_value"+e).val()),i.setAttribute("onclick","set_checked('"+l+"','"+e+"','form_id_temp')"))),"radio"==d&&(i.setAttribute("name",l+"_elementform_id_temp"),"yes"==document.getElementById(l+"_allow_otherform_id_temp").value&&"1"==jQuery(this).find("#el_choices"+e).prop("other")?(i.setAttribute("value",""),i.setAttribute("other","1"),i.setAttribute("onClick","set_default('"+l+"','"+e+"','form_id_temp'); show_other_input('"+l+"','form_id_temp');")):("no"==document.getElementById(l+"_value_disabledform_id_temp").value?i.setAttribute("value",jQuery(this).find("#el_choices"+e).val()):i.setAttribute("value",jQuery(this).find("#el_option_value"+e).val()),i.setAttribute("onClick","set_default('"+l+"','"+e+"','form_id_temp')")));var a=document.createElement("label");a.setAttribute("id",l+"_label_element"+e),a.setAttribute("class","ch-rad-label"),a.setAttribute("for",l+"_elementform_id_temp"+e),a.innerHTML=jQuery(this).find("#el_choices"+e).val(),"right"==document.getElementById(l+"_option_left_right").value&&(a.style.cssText="float: none !important"),jQuery(this).find("#el_option_params"+e).val()&&(w_params=jQuery(this).find("#el_option_params"+e).val().split("[where_order_by]"),a.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),a.setAttribute("order_by",w_params[0]),a.setAttribute("db_info",w_params[1])),t.appendChild(a),t.appendChild(i),tr_row.appendChild(t),_.appendChild(tr_row),o++})}else{r=document.getElementById("edit_for_rowcol").value,n=parseInt((choeices+1)/r),o=0,m=0;jQuery(".change_pos").each(function(e){var t=jQuery(this)[0].id;o<r&&(tr_row=document.createElement("div"),tr_row.setAttribute("id",l+"_element_tr"+e),tr_row.style.display="table-row");var i=document.createElement("div");i.setAttribute("valign","top"),i.setAttribute("id",l+"_td_little"+t),i.setAttribute("idi",t),i.style.display="table-cell";var a=document.createElement("input");a.setAttribute("type",d),a.setAttribute("id",l+"_elementform_id_temp"+t),"checked"==jQuery("#"+l+"_elementform_id_temp"+t).prop("checked")&&a.setAttribute("checked","checked"),"right"==document.getElementById(l+"_option_left_right").value&&(a.style.cssText="float: left !important"),"checkbox"==d&&(a.setAttribute("name",l+"_elementform_id_temp"+t),"yes"==document.getElementById(l+"_allow_otherform_id_temp").value&&"1"==jQuery(this).find("#el_choices"+t).prop("other")?(a.setAttribute("value",""),a.setAttribute("other","1"),a.setAttribute("onclick","if(set_checked('"+l+"','"+t+"','form_id_temp')) show_other_input('"+l+"','form_id_temp');")):("no"==document.getElementById(l+"_value_disabledform_id_temp").value?a.setAttribute("value",jQuery(this).find("#el_choices"+t).val()):a.setAttribute("value",jQuery(this).find("#el_option_value"+t).val()),a.setAttribute("onclick","set_checked('"+l+"','"+t+"','form_id_temp')"))),"radio"==d&&(a.setAttribute("name",l+"_elementform_id_temp"),"yes"==document.getElementById(l+"_allow_otherform_id_temp").value&&"1"==jQuery(this).find("#el_choices"+t).prop("other")?(a.setAttribute("other","1"),a.setAttribute("onClick","set_default('"+l+"','"+t+"','form_id_temp'); show_other_input('"+l+"','form_id_temp')")):("no"==document.getElementById(l+"_value_disabledform_id_temp").value?a.setAttribute("value",jQuery(this).find("#el_choices"+t).val()):a.setAttribute("value",jQuery(this).find("#el_option_value"+t).val()),a.setAttribute("onClick","set_default('"+l+"','"+t+"','form_id_temp')")));var n=document.createElement("label");n.setAttribute("id",l+"_label_element"+t),n.setAttribute("class","ch-rad-label"),n.setAttribute("for",l+"_elementform_id_temp"+t),n.innerHTML=jQuery(this).find("#el_choices"+t).val(),"right"==document.getElementById(l+"_option_left_right").value&&(n.style.cssText="float: none !important"),jQuery(this).find("#el_option_params"+t).val()&&(w_params=jQuery(this).find("#el_option_params"+t).val().split("[where_order_by]"),n.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),n.setAttribute("order_by",w_params[0]),n.setAttribute("db_info",w_params[1])),i.appendChild(n),i.appendChild(a),o<r?(tr_row.appendChild(i),_.appendChild(tr_row)):(m==r&&(m=0),tr_row=document.getElementById(l+"_table_little").childNodes[m],tr_row.appendChild(i),m++),o++}),_.setAttribute("for_hor",l+"_hor")}refresh_attr(l,"type_"+d)}function show_other_input(t){jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id;if(document.getElementById(t+"_elementform_id_temp"+e)&&document.getElementById(t+"_elementform_id_temp"+e).getAttribute("other")&&1==document.getElementById(t+"_elementform_id_temp"+e).getAttribute("other"))return element_other=document.getElementById(t+"_elementform_id_temp"+e),!1});var e=element_other.parentNode,i=document.createElement("br");i.setAttribute("id",t+"_other_brform_id_temp");var a=document.createElement("input");a.setAttribute("id",t+"_other_inputform_id_temp"),a.setAttribute("name",t+"_other_inputform_id_temp"),a.setAttribute("type","text"),a.setAttribute("class","other_input"),e.appendChild(i),e.appendChild(a)}function create_option_label_position(e,t,i){var a=jQuery('<label class="fm-field-label">Option Label Position</label>'),n=jQuery('<input type="radio" id="edit_for_option_position_left" name="edit_for_option_position" onchange="option_left('+e+",'"+i+"')\""+("right"==t?"":' checked="checked"')+" />"),l=jQuery('<label for="edit_for_option_position_left">Left</label>'),d=jQuery('<input type="radio" id="edit_for_option_position_right" name="edit_for_option_position" onchange="option_right('+e+",'"+i+"')\""+("right"==t?' checked="checked"':"")+" />"),_=jQuery('<label for="edit_for_option_position_right">Right</label>'),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function option_right(e,t){jQuery("#"+e+"_table_little").find(jQuery(".ch-rad-label")).css("cssText","float: none !important;"),jQuery("#"+e+"_table_little").find(jQuery('#main_div input[type="'+t+'"]')).css("cssText","float: left !important;"),jQuery("#"+e+"_option_left_right").val("right")}function option_left(e,t){jQuery("#"+e+"_table_little").find(jQuery(".ch-rad-label")).css("cssText","float: left !important;"),jQuery("#"+e+"_table_little").find(jQuery('#main_div input[type="'+t+'"]')).css("cssText","float: right !important;"),jQuery("#"+e+"_option_left_right").val("left")}function create_rowcol(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_rowcol">Rows/Columns</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_rowcol" onChange="refresh_rowcol('+e+",'"+i+'\')" value="'+t+'" />'))}function create_randomize(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_randomize">Randomize in frontend</label>'),jQuery('<input type="checkbox" id="el_randomize" onclick="set_randomize(\''+e+"_randomizeform_id_temp')\""+("yes"==t?' checked="checked"':"")+" />"))}function set_randomize(e){"yes"==document.getElementById(e).value?document.getElementById(e).setAttribute("value","no"):document.getElementById(e).setAttribute("value","yes")}function create_allow_other(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_allow_other">Allow other</label>'),jQuery('<input type="checkbox" id="el_allow_other" onclick="set_allow_other('+e+",'"+i+"')\""+("yes"==t?' checked="checked"':"")+" />"))}function set_allow_other(t,i){if("yes"==document.getElementById(t+"_allow_otherform_id_temp").value)document.getElementById(t+"_allow_otherform_id_temp").setAttribute("value","no"),jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id;if(document.getElementById("el_choices"+e)&&document.getElementById("el_choices"+e).getAttribute("other")&&1==document.getElementById("el_choices"+e).getAttribute("other"))return remove_choise(e,t,i),!1});else{document.getElementById(t+"_allow_otherform_id_temp").setAttribute("value","yes");var a=0;jQuery(".change_pos").each(function(){var e=parseInt(jQuery(this)[0].id);a=a<e?e:a}),a+=1;var e=jQuery("#choices"),n=jQuery('<div id="'+a+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice" id="el_choices'+a+'" value="other" other="1" onKeyUp="change_label(\''+t+"_label_element"+a+"', this.value); change_in_value('"+t+"_elementform_id_temp"+a+'\', this.value)" /></div><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice" id="el_option_value'+a+'" value="" disabled="disabled" /></div><div class="fm-table-col fm-width-10"></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');e.append(n),refresh_rowcol(t,i)}}function create_radio_options(e,t,i,a,l,d,_,r,o){var m=jQuery('<label class="fm-field-label">Options</label>'),s=jQuery('<button id="el_choices_add" class="fm-add-option button-secondary" onClick="add_choise(\''+o+"', "+e+'); return false;" title="Add option"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>Option</button>');if(form_maker.is_demo)var u=jQuery('<button class="fm-add-option button-secondary" onClick="alert(\'This feature is disabled in demo.\')" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');else u=jQuery("<button class=\"fm-add-option button-secondary\" onClick=\"tb_show('', 'admin-ajax.php?action=select_data_from_db&field_id="+e+"&nonce="+fm_ajax.ajaxnonce+"&field_type=radio&value_disabled="+t+'&width=530&height=370&TB_iframe=1\'); return false;" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');var c=jQuery('<div id="choices" class="fm-width-100 ui-sortable"></div>'),p=jQuery('<div class="fm-width-100"><div class="fm-header-label fm-width-40">Name</div><div class="fm-header-label fm-width-40">Value</div><div class="fm-header-label fm-width-10">Delete</div><div class="fm-header-label fm-width-10">Move</div></div>');for(c.append(p),aaa=!1,n=i.length,j=0;j<n;j++){var f=jQuery('<div id="'+j+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice" id="el_choices'+j+'"'+("yes"==d&&j==_?' other="1"':"")+' value="'+i[j].replace(/"/g,"&quot;")+'" onKeyUp="change_label(\''+e+"_label_element"+j+'\', this.value)" onpaste="elem=this; change_label_name_on_paste('+j+", '"+e+"_label_element"+j+"', '"+o+"'); change_label_value_on_paste('"+e+"_elementform_id_temp"+j+"', this)\""+(a[j]?' disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice'+(a[j]||"yes"==d&&j==_?"":" el_option_value")+'" id="el_option_value'+j+'" value="'+l[j].replace(/"/g,"&quot;")+'" onKeyUp="change_label_value(\''+e+"_elementform_id_temp"+j+"', this.value)\" onpaste=\"change_label_value_on_paste('"+e+"_elementform_id_temp"+j+"', this)\""+("no"==t||a[j]||"yes"==d&&j==_?' disabled="disabled"':"")+' /><input type="hidden" id="el_option_params'+j+'" class="el_option_params" value="'+a[j]+'" /></div><div class="fm-table-col fm-width-10">'+("yes"==d&&j==_?"":'<span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_choices'+j+'_remove" onClick="remove_choise('+j+","+e+",'"+o+"')\"></span>")+'</div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');c.append(f),1==r[j]&&"yes"==d&&j==_&&(aaa=!0)}var y=m;return create_option_container(null,y=(y=(y=y.add(s)).add(u)).add(c))}function remove_choise(e,t,i){var a=document.getElementById("choices"),n=document.getElementById(e);a.removeChild(n),refresh_rowcol(t,i)}function type_radio(i,e,t,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v){jQuery("#element_type").val("type_radio"),delete_last_child();var w=jQuery("#edit_table"),g=jQuery('<div id="edit_div"></div>');w.append(g);var E=jQuery('<div id="edit_main_table"></div>');g.append(E),E.append(create_field_type("type_radio")),E.append(create_label(i,e)),E.append(create_label_position(i,a)),E.append(create_hide_label(i,l)),E.append(create_required(i,m)),E.append(create_relative_position(i,d,"radio")),E.append(create_option_label_position(i,n,"radio")),E.append(create_radio_options(i,h,_,v,b,u,c,r,"radio"));var A=jQuery('<div class="inside"></div>');E.append(create_advanced_options_container(A)),A.append(create_field_label_size(i,t)),A.append(create_class(i,p)),A.append(create_rowcol(i,o,"radio")),A.append(create_randomize(i,s)),A.append(create_enable_options_value(i,h,"radio")),A.append(create_allow_other(i,u,"radio")),A.append(create_additional_attributes(i,f,"type_radio")),element="input",type="radio";var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value","type_radio"),j.setAttribute("name",i+"_typeform_id_temp"),j.setAttribute("id",i+"_typeform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",m),x.setAttribute("name",i+"_requiredform_id_temp"),x.setAttribute("id",i+"_requiredform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",l),k.setAttribute("name",i+"_hide_labelform_id_temp"),k.setAttribute("id",i+"_hide_labelform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",i+"_randomizeform_id_temp"),I.setAttribute("id",i+"_randomizeform_id_temp");var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value",u),C.setAttribute("name",i+"_allow_otherform_id_temp"),C.setAttribute("id",i+"_allow_otherform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",o),B.setAttribute("name",i+"_rowcol_numform_id_temp"),B.setAttribute("id",i+"_rowcol_numform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",n),Q.setAttribute("id",i+"_option_left_right");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",h),T.setAttribute("name",i+"_value_disabledform_id_temp"),T.setAttribute("id",i+"_value_disabledform_id_temp");var M=document.createElement("div");M.setAttribute("id","main_div");var L=document.createElement("div");L.setAttribute("id",i+"_elemet_tableform_id_temp");var z="yes"==l?"none":"table-cell",q=document.createElement("div");q.setAttribute("align","left"),q.style.display=z,q.style.width=t+"px",q.setAttribute("id",i+"_label_sectionform_id_temp");var H=document.createElement("div");H.setAttribute("align","left"),H.style.display="table-cell",H.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var N=document.createElement("br"),S=(document.createElement("br"),document.createElement("div"));S.style.display="table";var D=document.createElement("div");D.setAttribute("id",i+"_table_little"),D.style.display="table-row-group",S.appendChild(D);var P=document.createElement("div");P.setAttribute("id",i+"_element_tr1"),P.style.display="table-row";var O=document.createElement("div");O.setAttribute("id",i+"_element_tr2"),O.style.display="table-row";var K=document.createElement("div");K.setAttribute("valign","top"),K.setAttribute("id",i+"_td_little1"),K.style.display="table-cell";var U=document.createElement("div");U.setAttribute("valign","top"),U.setAttribute("id",i+"_td_little2"),U.style.display="table-cell";var F=document.createElement("span");F.setAttribute("id",i+"_element_labelform_id_temp"),F.innerHTML=e,F.setAttribute("class","label"),F.style.verticalAlign="top";var R=document.createElement("span");R.setAttribute("id",i+"_required_elementform_id_temp"),R.innerHTML="",R.setAttribute("class","required"),R.style.verticalAlign="top","yes"==m&&(R.innerHTML=" *");var W=document.getElementById("show_table");q.appendChild(F),q.appendChild(R),H.appendChild(j),H.appendChild(x),H.appendChild(k),H.appendChild(I),H.appendChild(C),H.appendChild(B),H.appendChild(Q),H.appendChild(T),H.appendChild(S),L.appendChild(q),L.appendChild(H),M.appendChild(L),M.appendChild(N),W.appendChild(M),jQuery("#main_div").append(form_maker.type_radio_description),"top"==a&&label_top(i),change_class(p,i),refresh_rowcol(i,"radio"),aaa&&show_other_input(i),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_rowcol(i,"radio")}})})}function type_checkbox(i,e,t,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v){jQuery("#element_type").val("type_checkbox"),delete_last_child();var w=jQuery("#edit_table"),g=jQuery('<div id="edit_div"></div>');w.append(g);var E=jQuery('<div id="edit_main_table"></div>');g.append(E),E.append(create_field_type("type_checkbox")),E.append(create_label(i,e)),E.append(create_label_position(i,a)),E.append(create_hide_label(i,l)),E.append(create_required(i,m)),E.append(create_relative_position(i,d,"checkbox")),E.append(create_option_label_position(i,n,"checkbox")),E.append(create_radio_options(i,h,_,v,b,u,c,r,"checkbox"));var A=jQuery('<div class="inside"></div>');E.append(create_advanced_options_container(A)),A.append(create_field_label_size(i,t)),A.append(create_class(i,p)),A.append(create_rowcol(i,o,"checkbox")),A.append(create_randomize(i,s)),A.append(create_enable_options_value(i,h,"checkbox")),A.append(create_allow_other(i,u,"checkbox")),A.append(create_additional_attributes(i,f,"type_checkbox")),element="input",type="checkbox";var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value","type_checkbox"),j.setAttribute("name",i+"_typeform_id_temp"),j.setAttribute("id",i+"_typeform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",m),x.setAttribute("name",i+"_requiredform_id_temp"),x.setAttribute("id",i+"_requiredform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",l),k.setAttribute("name",i+"_hide_labelform_id_temp"),k.setAttribute("id",i+"_hide_labelform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",i+"_randomizeform_id_temp"),I.setAttribute("id",i+"_randomizeform_id_temp");var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value",u),C.setAttribute("name",i+"_allow_otherform_id_temp"),C.setAttribute("id",i+"_allow_otherform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",c),B.setAttribute("name",i+"_allow_other_numform_id_temp"),B.setAttribute("id",i+"_allow_other_numform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",o),Q.setAttribute("name",i+"_rowcol_numform_id_temp"),Q.setAttribute("id",i+"_rowcol_numform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",n),T.setAttribute("id",i+"_option_left_right");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",h),M.setAttribute("name",i+"_value_disabledform_id_temp"),M.setAttribute("id",i+"_value_disabledform_id_temp");var L=document.createElement("div");L.setAttribute("id","main_div");var z=document.createElement("div");z.setAttribute("id",i+"_elemet_tableform_id_temp");var q="yes"==l?"none":"table-cell",H=document.createElement("div");H.setAttribute("align","left"),H.style.display=q,H.style.width=t+"px",H.setAttribute("id",i+"_label_sectionform_id_temp");var N=document.createElement("div");N.setAttribute("align","left"),N.style.display="table-cell",N.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var S=document.createElement("br"),D=(document.createElement("br"),document.createElement("div"));D.style.display="table";var P=document.createElement("div");P.setAttribute("id",i+"_table_little"),P.style.display="table-row-group",D.appendChild(P);var O=document.createElement("span");O.setAttribute("id",i+"_element_labelform_id_temp"),O.innerHTML=e,O.setAttribute("class","label"),O.style.verticalAlign="top";var K=document.createElement("span");K.setAttribute("id",i+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),K.style.verticalAlign="top","yes"==m&&(K.innerHTML=" *");var U=document.getElementById("show_table");H.appendChild(O),H.appendChild(K),N.appendChild(j),N.appendChild(x),N.appendChild(k),N.appendChild(I),N.appendChild(C),N.appendChild(B),N.appendChild(Q),N.appendChild(T),N.appendChild(M),N.appendChild(D),z.appendChild(H),z.appendChild(N),L.appendChild(z),L.appendChild(S),U.appendChild(L),jQuery("#main_div").append(form_maker.type_checkbox_description),"top"==a&&label_top(i),change_class(p,i),refresh_rowcol(i,"checkbox"),aaa&&show_other_input(i),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_rowcol(i,"checkbox")}})})}function create_keys(e,t){jQuery('<label class="fm-field-label">Keys</label>');return create_option_container(null,jQuery('<a href="'+admin_url+'?page=options_fm" target="_blank" class="fm-field-recaptcha-label">'+t+"</a>"))}function create_recaptcha_invisible(e,t){var i=jQuery('<label class="fm-field-label">Type</label>'),a=jQuery('<input type="radio" id="edit_for_recaptcha_type_v2" name="edit_for_recaptcha_type" value="v2" onchange="fm_recaptcha_type('+e+', this.value)"'+("v2"==t?' checked="checked"':"")+" />"),n=jQuery('<label for="edit_for_recaptcha_type_v2">reCAPTCHA v2 (checkbox)</label>'),l=jQuery('<input type="radio" id="edit_for_recaptcha_type_invisible" name="edit_for_recaptcha_type" value="invisible" onchange="fm_recaptcha_type('+e+', this.value)"'+("invisible"==t?' checked="checked"':"")+" />"),d=jQuery('<label for="edit_for_recaptcha_type_invisible">reCAPTCHA v2 (invisible)</label>'),_=jQuery('<input type="radio" id="edit_for_recaptcha_type_v3" name="edit_for_recaptcha_type" value="v3" onchange="fm_recaptcha_type('+e+', this.value)"'+("v3"==t?' checked="checked"':"")+" />"),r=jQuery('<label for="edit_for_recaptcha_type_v3">reCAPTCHA v3</label>'),o=a;return create_option_container(i,o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.add(n)).add(jQuery("<br />"))).add(jQuery('<span class="fm-description">Validate users with the "I\'m not a robot" checkbox.</span>'))).add(jQuery("<br />"))).add(l)).add(d)).add(jQuery("<br />"))).add(jQuery('<span class="fm-description">Validate users in the background.</span>'))).add(jQuery("<br />"))).add(_)).add(r)).add(jQuery("<br />"))).add(jQuery('<span class="fm-description">Verify requests with a score.</span>')))}function fm_recaptcha_type(e,t){jQuery("#wd_recaptchaform_id_temp").prop("w_type",t),"invisible"==t?(jQuery("#recaptcha_position").show(),jQuery("#recaptcha_keys_message").show(),jQuery("#recaptcha_advanced").hide(),jQuery("#recaptcha_score").hide(),jQuery("#"+e+"_hide_labelform_id_temp").val("no"),jQuery("#el_hide_label").prop("checked","checked"),hide_label(e)):"v3"==t?(jQuery("#recaptcha_score").show(),jQuery("#recaptcha_keys_message").show(),jQuery("#recaptcha_advanced").hide(),jQuery("#recaptcha_position").hide(),jQuery("#"+e+"_hide_labelform_id_temp").val("no"),jQuery("#el_hide_label").prop("checked","checked"),hide_label(e)):(jQuery("#recaptcha_position").hide(),jQuery("#recaptcha_score").hide(),jQuery("#recaptcha_keys_message").hide(),jQuery("#recaptcha_advanced").show())}function create_recaptcha_score(e,t,i){return create_option_container(jQuery('<label class="fm-field-label">Score</label>'),'ReCaptcha v3 returns a score based on the user interactions with your forms. Scores range from 0.0 to 1.0, with 0.0 indicating abusive traffic and 1.0 indicating good traffic. <a href="'+admin_url+'?page=options_fm" target="_blank" class="fm-field-recaptcha-label">To change recaptcha score click here</a>',"recaptcha_score","v3"==i)}function create_recaptcha_position(e,t,i){var a=jQuery('<label class="fm-field-label">Display</label>'),n=jQuery('<input type="radio" id="edit_for_recaptcha_position_hidden" name="edit_for_recaptcha_position" value="hidden" onchange="fm_recaptcha_position('+e+', this.value)"'+("hidden"==t?' checked="checked"':"")+" />"),l=jQuery('<label for="edit_for_recaptcha_position_hidden">Hidden</label>'),d=jQuery('<input type="radio" id="edit_for_recaptcha_position_inline" name="edit_for_recaptcha_position" value="inline" onchange="fm_recaptcha_position('+e+', this.value)"'+("inline"==t?' checked="checked"':"")+" />"),_=jQuery('<label for="edit_for_recaptcha_position_inline">Inline</label>'),r=jQuery('<input type="radio" id="edit_for_recaptcha_position_bottomright" name="edit_for_recaptcha_position" value="bottomright" onchange="fm_recaptcha_position('+e+', this.value)"'+("bottomright"==t?' checked="checked"':"")+" />"),o=jQuery('<label for="edit_for_recaptcha_position_bottomright">Bottom-Right</label>'),m=jQuery('<input type="radio" id="edit_for_recaptcha_position_bottomleft" name="edit_for_recaptcha_position" value="bottomleft" onchange="fm_recaptcha_position('+e+', this.value)"'+("bottomleft"==t?' checked="checked"':"")+" />"),s=jQuery('<label for="edit_for_recaptcha_position_bottomleft">Bottom-Left</label>'),u=n;return create_option_container(a,u=(u=(u=(u=(u=(u=(u=(u=(u=(u=u.add(l)).add(jQuery("<br />"))).add(d)).add(_)).add(jQuery("<br />"))).add(r)).add(o)).add(jQuery("<br />"))).add(m)).add(s),"recaptcha_position","invisible"==i)}function fm_recaptcha_position(e,t){jQuery("#wd_recaptchaform_id_temp").prop("position",t)}function go_to_type_recaptcha(e){type_recaptcha(e,"reCAPTCHA","","top","yes","invisible","bottomright",.5)}function type_recaptcha(e,t,i,a,n,l,d,_){jQuery("#element_type").val("type_recaptcha"),delete_last_child();var r=jQuery("#edit_table"),o=jQuery('<div id="edit_div"></div>');r.append(o);var m=jQuery('<div id="edit_main_table"></div>');o.append(m),m.append(create_field_type("type_recaptcha")),m.append(create_recaptcha_invisible(e,l)),m.append(create_recaptcha_position(e,d,l)),m.append(create_recaptcha_score(e,_,l)),m.append(create_keys(e,"To set up recaptcha keys click here"));var s=jQuery('<div class="inside"></div>'),u=!1;"invisible"!=l&&"v3"!=l&&(u=!0),m.append(create_advanced_options_container(s,"recaptcha_advanced",u)),s.append(create_label(e,t)),s.append(create_label_position(e,a)),s.append(create_hide_label(e,n)),s.append(create_field_label_size(e,i)),element="img",type="captcha";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("value","type_recaptcha"),c.setAttribute("name",e+"_typeform_id_temp"),c.setAttribute("id",e+"_typeform_id_temp");var p=document.createElement("input");p.setAttribute("type","hidden"),p.setAttribute("value",n),p.setAttribute("name",e+"_hide_labelform_id_temp"),p.setAttribute("id",e+"_hide_labelform_id_temp");var f=document.createElement("div");f.setAttribute("id","recaptcha_keys_message"),f.setAttribute("class","error"),f.innerHTML=form_maker.invisible_recaptcha_error;var y=document.createElement("div");y.setAttribute("id","wd_recaptchaform_id_temp"),y.setAttribute("w_type",l),y.setAttribute("position",d);var h=document.createElement("span");h.style.color="red",h.style.fontStyle="italic",h.innerHTML=form_maker.no_preview,y.appendChild(h);var b=document.createElement("div");b.setAttribute("id","main_div");var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==n?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var A=document.createElement("br"),j=(document.createElement("br"),document.createElement("span"));j.setAttribute("id",e+"_element_labelform_id_temp"),j.innerHTML=t,j.setAttribute("class","label"),j.style.verticalAlign="top";var x=document.getElementById("show_table");g.appendChild(j),E.appendChild(c),E.appendChild(p),E.appendChild(y),v.appendChild(f),v.appendChild(g),v.appendChild(E),b.appendChild(v),b.appendChild(A),x.appendChild(b),jQuery("#main_div").append(form_maker.type_recaptcha_description),"top"==a&&label_top(e),"v2"==jQuery("input[name='edit_for_recaptcha_type']:checked").val()&&jQuery("#recaptcha_keys_message").hide()}function create_submit_label(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_title">Submit label</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_title" onKeyUp="change_label(\''+e+'_element_submitform_id_temp\', this.value)" value="'+t+'" />'))}function create_display_reset(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_reset_active">Display Reset</label>'),jQuery('<input type="checkbox" id="el_reset_active" onclick="active_reset(this.checked, '+e+')"'+(t?' checked="checked"':"")+" />"))}function active_reset(e,t){document.getElementById(t+"_element_resetform_id_temp").style.display=e?"inline":"none"}function create_reset_label(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_title_textarea">Reset label</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_title_textarea" onKeyUp="change_label(\''+e+'_element_resetform_id_temp\', this.value)" value="'+t+'" />'))}function go_to_type_submit_reset(e){w_attr_name=[],w_attr_value=[],type_submit_reset(e,"Submit","Reset","",!0,w_attr_name,w_attr_value)}function type_submit_reset(e,t,i,a,n,l,d){jQuery("#element_type").val("type_submit_reset"),delete_last_child();var _=jQuery("#edit_table"),r=jQuery('<div id="edit_div"></div>');_.append(r);var o=jQuery('<div id="edit_main_table"></div>');r.append(o),o.append(create_field_type("type_submit_reset")),o.append(create_submit_label(e,t)),o.append(create_display_reset(e,n)),o.append(create_reset_label(e,i));var m=jQuery('<div class="inside"></div>');o.append(create_advanced_options_container(m)),m.append(create_class(e,a)),m.append(create_additional_attributes(e,l,"type_submit_reset"));var s=document.createElement("br"),u=document.createElement("input");u.setAttribute("type","hidden"),u.setAttribute("value","type_submit_reset"),u.setAttribute("name",e+"_typeform_id_temp"),u.setAttribute("id",e+"_typeform_id_temp");var c=document.createElement("button");c.setAttribute("type","button"),c.setAttribute("class","button button-secondary button-hero button-submit"),c.setAttribute("id",e+"_element_submitform_id_temp"),c.setAttribute("value",t),c.innerHTML=t,c.setAttribute("disabled","disabled");var p=document.createElement("button");p.setAttribute("type","button"),p.setAttribute("class","button button-secondary button-hero button-reset"),n||(p.style.display="none"),p.setAttribute("id",e+"_element_resetform_id_temp"),p.setAttribute("value",i),p.setAttribute("disabled","disabled"),p.innerHTML=i;var f=document.createElement("div");f.setAttribute("id","main_div");var y=document.createElement("div");y.setAttribute("id",e+"_elemet_tableform_id_temp");var h=document.createElement("div");h.setAttribute("align","left"),h.style.display="table-cell",h.setAttribute("id",e+"_label_sectionform_id_temp");var b=document.createElement("div");b.setAttribute("align","left"),b.style.display="table-cell",b.setAttribute("id",e+"_element_sectionform_id_temp");var v=document.createElement("span");v.setAttribute("id",e+"_element_labelform_id_temp"),v.style.cssText="display:none",v.innerHTML="type_submit_reset_"+e;var w=document.getElementById("show_table");h.appendChild(v),b.appendChild(u),b.appendChild(c),b.appendChild(p),y.appendChild(h),y.appendChild(b),f.appendChild(y),f.appendChild(s),w.appendChild(f),jQuery("#main_div").append(form_maker.type_submit_description),change_class(a,e),refresh_attr(e,"type_submit_reset")}function type_editor(e,t){jQuery("#element_type").val("type_editor"),delete_last_child();var i=jQuery("#edit_table"),a=jQuery('<div id="edit_div"></div>');i.append(a);var n,l=jQuery('<div id="edit_main_table"></div>');a.append(l),l.append(create_field_type("type_editor")),iReturnLeft=jQuery("#edit_table").offset().left,document.getElementById("main_editor").style.display="block",document.getElementById("main_editor").style.left=iReturnLeft+15+"px",document.getElementById("main_editor").style.top="120px",document.getElementById("main_editor").style.width=jQuery("#edit_table").width()-30+"px",document.getElementById("form_maker_editor_ifr")&&"none"==document.getElementById("form_maker_editor").style.display?(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=t):document.getElementById("form_maker_editor").value=t,(n=document.createElement("div")).setAttribute("id","main_div"),document.getElementById("show_table").appendChild(n),(n=document.createElement("div")).style.width="500px",document.getElementById("edit_table").appendChild(n)}function type_section_break(e,t){jQuery("#element_type").val("type_section_break"),delete_last_child();var i=jQuery("#edit_table"),a=jQuery('<div id="edit_div"></div>');i.append(a);var n,l=jQuery('<div id="edit_main_table"></div>');a.append(l),l.append(create_field_type("type_section_break")),iReturnLeft=jQuery("#edit_table").offset().left,document.getElementById("main_editor").style.display="block",document.getElementById("main_editor").style.left=iReturnLeft+15+"px",document.getElementById("main_editor").style.top="120px",document.getElementById("main_editor").style.width=jQuery("#edit_table").width()-30+"px",document.getElementById("form_maker_editor_ifr")&&"none"==document.getElementById("form_maker_editor").style.display?(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=t):document.getElementById("form_maker_editor").value=t,element="div",(n=document.createElement("div")).setAttribute("id","main_div"),document.getElementById("show_table").appendChild(n),(n=document.createElement("div")).style.width="500px",document.getElementById("edit_table").appendChild(n)}function create_page_title(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_page_title_input">Page Title</label>'),jQuery('<input type="text" class="fm-width-100" id="el_page_title_input" name="el_page_title_input" onKeyup="pagebreak_title_change(this.value,'+e+')" value="'+t+'" />'))}function pagebreak_title_change(e){e=e.replace(/(<([^>]+)>)/gi,""),document.getElementById("_div_between").setAttribute("page_title",e),document.getElementById("div_page_title").innerHTML=e+"<br/><br/>"}function create_next_type(e,t){var i=jQuery('<label class="fm-field-label">Next Type</label>'),a=jQuery('<input type="radio" id="el_type_next_text" name="el_type_next" value="text" onclick="pagebreak_type_change(\'next\',\'text\')"'+("text"==t[0]?' checked="checked"':"")+" />"),n=jQuery('<label for="el_type_next_text">Text</label>'),l=jQuery('<input type="radio" id="el_type_next_img" name="el_type_next" value="img" onclick="pagebreak_type_change(\'next\',\'img\')"'+("text"==t[0]?"":' checked="checked"')+" />"),d=jQuery('<label for="el_type_next_img">Image</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function pagebreak_type_change(e,t){switch(document.getElementById("_div_between").setAttribute(e+"_type",t),t){case"button":document.getElementById("_div_between").setAttribute(e+"_title",e),(i=document.createElement("label")).setAttribute("class","fm-field-label"),i.setAttribute("for","el_title_"+e),i.setAttribute("id",e+"_label"),i.setAttribute("type","button"),i.innerHTML=e[0].toUpperCase()+e.slice(1)+" "+t+" name",document.getElementById(e+"_label").parentNode.replaceChild(i,document.getElementById(e+"_label")),document.getElementById("el_title_"+e).value=e,(a=document.createElement("button")).setAttribute("id","page_"+e+"_0"),a.setAttribute("class",document.getElementById("_div_between").getAttribute(e+"_class")),a.style.cursor="pointer",a.innerHTML=e,document.getElementById("_element_section_"+e).replaceChild(a,document.getElementById("page_"+e+"_0"));break;case"text":document.getElementById("_div_between").setAttribute(e+"_title",e),(i=document.createElement("label")).setAttribute("class","fm-field-label"),i.setAttribute("for","el_title_"+e),i.setAttribute("id",e+"_label"),i.innerHTML=e[0].toUpperCase()+e.slice(1)+" "+t+" name",document.getElementById(e+"_label").parentNode.replaceChild(i,document.getElementById(e+"_label")),document.getElementById("el_title_"+e).value=e[0].toUpperCase()+e.slice(1),(a=document.createElement("span")).setAttribute("id","page_"+e+"_0"),a.setAttribute("class",document.getElementById("_div_between").getAttribute(e+"_class")),a.style.cursor="pointer",a.innerHTML=e[0].toUpperCase()+e.slice(1),document.getElementById("_element_section_"+e).replaceChild(a,document.getElementById("page_"+e+"_0"));break;case"img":var i,a;document.getElementById("_div_between").setAttribute(e+"_title",plugin_url+"/images/"+e+".png"),(i=document.createElement("label")).setAttribute("class","fm-field-label"),i.setAttribute("for","el_title_"+e),i.setAttribute("id",e+"_label"),i.innerHTML=e[0].toUpperCase()+e.slice(1)+" "+t+" src",document.getElementById(e+"_label").parentNode.replaceChild(i,document.getElementById(e+"_label")),document.getElementById("el_title_"+e).value=plugin_url+"/images/"+e+".png",(a=document.createElement("img")).setAttribute("id","page_"+e+"_0"),a.setAttribute("class",document.getElementById("_div_between").getAttribute(e+"_class")),a.style.cursor="pointer",a.src=plugin_url+"/images/"+e+".png",document.getElementById("_element_section_"+e).replaceChild(a,document.getElementById("page_"+e+"_0"))}}function create_next_text_name(e,t){return create_option_container(jQuery('<label id="next_label" class="fm-field-label" for="el_title_next">Next text name</label>'),jQuery('<input type="text" class="fm-width-100" id="el_title_next" onKeyup="change_pagebreak_label( this.value, \'next\')" onChange="change_pagebreak_label( this.value, \'next\')" value="'+t[0]+'" />'))}function change_pagebreak_label(e,t){button_type=document.getElementById("_div_between").getAttribute(t+"_type"),"img"!=button_type?(document.getElementById("page_"+t+"_0").value=e,document.getElementById("page_"+t+"_0").innerHTML=e):document.getElementById("page_"+t+"_0").src=e,document.getElementById("_div_between").setAttribute(t+"_title",e)}function create_check_required_next(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_check_next_input">Check the required fields</label>'),jQuery('<input type="checkbox" id="el_check_next_input" onclick="set_checkable(\'next\')"'+("true"==t[0]?' checked="checked"':"")+" />"))}function set_checkable(e){document.getElementById("_div_between").setAttribute(e+"_checkable",document.getElementById("el_check_"+e+"_input").checked)}function create_previous_type(e,t){var i=jQuery('<label class="fm-field-label">Previous Type</label>'),a=jQuery('<input type="radio" id="el_type_previous_text" name="el_type_previous" value="text" onclick="pagebreak_type_change(\'previous\',\'text\')"'+("text"==t[1]?' checked="checked"':"")+" />"),n=jQuery('<label for="el_type_previous_text">Text</label>'),l=jQuery('<input type="radio" id="el_type_previous_img" name="el_type_previous" value="img" onclick="pagebreak_type_change(\'previous\',\'img\')"'+("text"==t[1]?"":' checked="checked"')+" />"),d=jQuery('<label for="el_type_previous_img">Image</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_previous_text_name(e,t){return create_option_container(jQuery('<label id="previous_label" class="fm-field-label" for="el_title_previous">Previous text name</label>'),jQuery('<input type="text" class="fm-width-100" id="el_title_previous" onKeyup="change_pagebreak_label( this.value, \'previous\')" onChange="change_pagebreak_label( this.value, \'previous\')" value="'+t[1]+'" />'))}function create_check_required_previous(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_check_previous_input">Check the required fields</label>'),jQuery('<input type="checkbox" id="el_check_previous_input" onclick="set_checkable(\'previous\')"'+("true"==t[1]?' checked="checked"':"")+" />"))}function create_next_class(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="next_element_style">Next class</label>'),jQuery('<input type="text" class="fm-width-100" id="next_element_style" onChange="change_pagebreak_class(this.value, \'next\')" value="'+t[0]+'" />'))}function create_previous_class(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="previous_element_style">Previous class</label>'),jQuery('<input type="text" class="fm-width-100" id="previous_element_style" onChange="change_pagebreak_class(this.value, \'previous\')" value="'+t[1]+'" />'))}function change_pagebreak_class(e,t){document.getElementById("page_"+t+"_0").setAttribute("class",e),document.getElementById("_div_between").setAttribute(t+"_class",e)}function type_page_break(e,t,i,a,n,l,d,_){jQuery("#element_type").val("type_page_break"),delete_last_child();var r=jQuery("#edit_table"),o=jQuery('<div id="edit_div"></div>');r.append(o);var m=jQuery('<div id="edit_main_table"></div>');o.append(m),m.append(create_field_type("type_page_break")),m.append(create_page_title(e,t)),m.append(create_next_type(e,a)),m.append(create_next_text_name(e,i)),m.append(create_check_required_next(e,l)),m.append(create_previous_type(e,a)),m.append(create_previous_text_name(e,i)),m.append(create_check_required_previous(e,l));var s=jQuery('<div class="inside"></div>');m.append(create_advanced_options_container(s)),s.append(create_next_class(e,n)),s.append(create_previous_class(e,n)),s.append(create_additional_attributes(e,d,"type_page_break"));var u=document.createElement("br"),c=document.createElement("div");c.setAttribute("id","main_div");var p=document.createElement("div");p.setAttribute("id",e+"_elemet_tableform_id_temp");var f=document.createElement("div");f.setAttribute("align","left"),f.style.display="table-cell",f.setAttribute("id",e+"_label_sectionform_id_temp");var y=document.createElement("div");y.setAttribute("align","left"),y.style.display="table-cell",y.setAttribute("id",e+"_element_sectionform_id_temp");var h=document.createElement("div");h.setAttribute("align","right"),h.setAttribute("id","_element_section_next");var b=make_pagebreak_button("next",i[0],a[0],n[0],0);h.appendChild(b);var v=document.createElement("div");v.setAttribute("align","left"),v.setAttribute("id","_element_section_previous");var w=make_pagebreak_button("previous",i[1],a[1],n[1],0);v.appendChild(w);var g=document.createElement("div");g.setAttribute("align","center"),g.setAttribute("style","border:2px solid blue;padding:20px; margin:20px"),g.innerHTM="FIELDS";var E=document.createElement("div");E.innerHTML=t+"<br/><br/>",E.setAttribute("id","div_page_title"),E.setAttribute("align","center");var A=document.createElement("div");A.setAttribute("page_title",t),A.setAttribute("next_type",a[0]),A.setAttribute("next_title",i[0]),A.setAttribute("next_class",n[0]),A.setAttribute("next_checkable",l[0]),A.setAttribute("previous_type",a[1]),A.setAttribute("previous_title",i[1]),A.setAttribute("previous_class",n[1]),A.setAttribute("previous_checkable",l[1]),A.setAttribute("align","center"),A.setAttribute("id","_div_between"),A.innerHTML="--------------------------------------<br />P A G E B R E A K<br />--------------------------------------",y.appendChild(E),y.appendChild(g),y.appendChild(h),y.appendChild(A),y.appendChild(v);var j=document.getElementById("show_table");p.appendChild(y),c.appendChild(p),c.appendChild(u),j.appendChild(c),refresh_attr(e,"type_page_break")}function make_pagebreak_button(e,t,i,a,n){switch(i){case"button":return(l=document.createElement("button")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("type","button"),l.setAttribute("class",a),l.style.cursor="pointer",l.innerHTML=t,l;case"text":return(l=document.createElement("span")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("class",a),l.style.cursor="pointer",l.innerHTML=t,l;case"img":var l;return(l=document.createElement("img")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("class",a),l.style.cursor="pointer",l.src=t,l}}function create_placeholder_name(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_first_value_input">Placeholder</label>'),jQuery('<input type="text" class="fm-width-40" id="el_first_value_first" onKeyUp="change_input_value(this.value,\''+e+'_element_firstform_id_temp\')" value="'+t[0].replace(/"/g,"&quot;")+'" />-<input type="text" class="fm-width-40" id="el_first_value_last" onKeyUp="change_input_value(this.value,\''+e+'_element_lastform_id_temp\')" value="'+t[1].replace(/"/g,"&quot;")+'" />'))}function create_field_size_name(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_input_size">Width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+"_element_firstform_id_temp', this.value); change_w_style('"+e+"_element_middleform_id_temp', this.value); change_w_style('"+e+'_element_lastform_id_temp\', this.value)" value="'+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function create_enable_name_fields(e,t,i){var a=jQuery('<label class="fm-field-label">Enable Field(s)</label>'),n=jQuery('<input type="checkbox" id="el_title" value="no" onclick="enable_name_fields('+e+",'title')\""+("yes"==t[0]?' checked="checked"':"")+" />"),l=jQuery('<label for="el_title" id="el_title_label">'+i[0]+"</label>"),d=jQuery('<input type="checkbox" id="el_middle" value="no" onclick="enable_name_fields('+e+",'middle')\""+("yes"==t[1]?' checked="checked"':"")+" />"),_=jQuery('<label for="el_middle" id="el_middle_label">'+i[3]+"</label>"),r=jQuery('<label id="el_first_label" class="fm-hide">'+i[1]+'</label><label id="el_last_label" class="fm-hide">'+i[2]+"</label>"),o=n;return create_option_container(a,o=(o=(o=(o=o.add(l)).add(d)).add(_)).add(r))}function enable_name_fields(t,e){var i="title"==e?2:3;tr_name1=document.getElementById(t+"_tr_name1"),tr_name2=document.getElementById(t+"_tr_name2"),first_input=document.getElementById(t+"_td_name_input_first"),first_label=document.getElementById(t+"_td_name_label_first");var a="title"==e?"40":document.getElementById("edit_for_input_size").value;if(1==document.getElementById("el_"+e).checked?document.getElementById(t+"_enable_fieldsform_id_temp").setAttribute(e,"yes"):document.getElementById(t+"_enable_fieldsform_id_temp").setAttribute(e,"no"),"yes"==document.getElementById(t+"_enable_fieldsform_id_temp").getAttribute(e)){var n=document.createElement("div");n.setAttribute("id",t+"_td_name_input_"+e),n.style.cssText="display:table-cell";var l=document.createElement("input");l.setAttribute("type","text"),w_title[i]==w_first_val[i]?(l.setAttribute("value",w_first_val[i]),l.setAttribute("placeholder",w_title[i])):l.setAttribute("value",w_first_val[i]),l.setAttribute("id",t+"_element_"+e+"form_id_temp"),l.setAttribute("name",t+"_element_"+e+"form_id_temp"),l.setAttribute("value",w_first_val[i]),l.setAttribute("title",w_title[i]),l.setAttribute("placeholder",w_title[i]),l.style.cssText="margin-right: 10px; width: "+a+"px";var d=document.createElement("div");d.setAttribute("id",t+"_td_name_label_"+e),d.style.cssText="display:table-cell";var _=document.createElement("label");_.setAttribute("class","mini_label"),_.setAttribute("id",t+"_mini_label_"+e),_.innerHTML=document.getElementById("el_"+e+"_label").innerHTML,n.appendChild(l),d.appendChild(_),"title"==e?(tr_name1.insertBefore(n,first_input),tr_name2.insertBefore(d,first_label)):(tr_name1.appendChild(n),tr_name2.appendChild(d))}else document.getElementById(t+"_td_name_input_"+e)&&(tr_name1.removeChild(document.getElementById(t+"_td_name_input_"+e)),tr_name2.removeChild(document.getElementById(t+"_td_name_label_"+e)));var r=document.createTextNode("-"),o=document.createTextNode("-");value_if_empty_width="title"==e?"60":"95";var m=document.createElement("input");m.setAttribute("id","el_first_value_"+e),m.setAttribute("type","text"),m.setAttribute("value",w_title[i]),m.style.cssText="width:"+value_if_empty_width+"px;",m.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_"+e+"form_id_temp')"),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,"yes"==document.getElementById(t+"_enable_fieldsform_id_temp").getAttribute(e)?"title"==e?(parent.insertBefore(r,el_first_value_first),parent.insertBefore(m,r)):(parent.appendChild(o),parent.appendChild(m)):document.getElementById("el_first_value_"+e)&&("title"==e?parent.removeChild(document.getElementById("el_first_value_title").nextSibling):parent.removeChild(document.getElementById("el_first_value_middle").previousSibling),parent.removeChild(document.getElementById("el_first_value_"+e))),refresh_attr(t,"type_name"),jQuery(function(){jQuery("label#"+t+"_mini_label_title").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='title' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.title").focus(),jQuery("input.title").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_title").text(e),document.getElementById("el_title_label").innerHTML=e})}}),jQuery("label#"+t+"_mini_label_middle").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_middle").text(e),document.getElementById("el_middle_label").innerHTML=e})}})})}function create_autofill_user_name(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_autofill">Autofill with user name</label>'),jQuery('<input type="checkbox" id="el_autofill" onclick="set_autofill(\''+e+"_autofillform_id_temp')\""+("yes"==t?' checked="checked"':"")+" />"))}function set_autofill(e){"yes"==document.getElementById(e).value?document.getElementById(e).value="no":document.getElementById(e).value="yes"}function go_to_type_name(e){w_attr_name=[],w_attr_value=[],w_first_val=["","","",""],w_title=["","","",""],w_mini_labels=["Title","First","Last","Middle"],w_name_fields=["no","no"],type_name(e,"Name","","top","no",w_first_val,w_title,w_mini_labels,"","normal","no","no","",w_attr_name,w_attr_value,w_name_fields,"no")}function type_name(t,e,i,a,n,l,d,_,r,o,m,s,u,c,p,f,y){jQuery("#element_type").val("type_name"),delete_last_child();var h=jQuery("#edit_table"),b=jQuery('<div id="edit_div"></div>');h.append(b);var v=jQuery('<div id="edit_main_table"></div>');b.append(v),v.append(create_field_type("type_name")),v.append(create_label(t,e)),v.append(create_label_position(t,a)),v.append(create_hide_label(t,n)),v.append(create_required(t,m)),v.append(create_placeholder_name(t,d)),v.append(create_field_size_name(t,r));var w=jQuery('<div class="inside"></div>');v.append(create_advanced_options_container(w)),w.append(create_enable_name_fields(t,f,_)),w.append(create_autofill_user_name(t,y)),w.append(create_unique_values(t,s)),w.append(create_field_label_size(t,i)),w.append(create_class(t,u)),w.append(create_additional_attributes(t,c,"type_name"));var g=document.createElement("br"),E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value","type_name"),E.setAttribute("name",t+"_typeform_id_temp"),E.setAttribute("id",t+"_typeform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",y),A.setAttribute("name",t+"_autofillform_id_temp"),A.setAttribute("id",t+"_autofillform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",m),j.setAttribute("name",t+"_requiredform_id_temp"),j.setAttribute("id",t+"_requiredform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",n),x.setAttribute("name",t+"_hide_labelform_id_temp"),x.setAttribute("id",t+"_hide_labelform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("name",t+"_enable_fieldsform_id_temp"),k.setAttribute("id",t+"_enable_fieldsform_id_temp"),k.setAttribute("title",f[0]),k.setAttribute("first","yes"),k.setAttribute("last","yes"),k.setAttribute("middle",f[1]);var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",t+"_uniqueform_id_temp"),I.setAttribute("id",t+"_uniqueform_id_temp"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit.");var C=document.createElement("div");C.setAttribute("id","main_div");var B=document.createElement("div");B.setAttribute("class","fm-editable-label"),B.appendChild(edit_labels);var Q=document.createElement("div");Q.setAttribute("id",t+"_elemet_tableform_id_temp");var T="yes"==n?"none":"table-cell",M=document.createElement("div");M.setAttribute("align","left"),M.style.display=T,M.style.width=i+"px",M.setAttribute("id",t+"_label_sectionform_id_temp");var L=document.createElement("div");L.setAttribute("align","left"),L.style.display="table-cell",L.setAttribute("id",t+"_element_sectionform_id_temp");var z=document.createElement("div");z.style.display="table",z.setAttribute("id",t+"_table_name"),z.setAttribute("cellpadding","0"),z.setAttribute("cellspacing","0");var q=document.createElement("div");q.style.display="table-row",q.setAttribute("id",t+"_tr_name1");var H=document.createElement("div");H.style.display="table-row",H.setAttribute("id",t+"_tr_name2");var N=document.createElement("div");N.style.display="table-cell",N.setAttribute("id",t+"_td_name_input_first");var S=document.createElement("div");S.style.display="table-cell",S.setAttribute("id",t+"_td_name_input_last");var D=document.createElement("div");D.style.display="table-cell",D.setAttribute("id",t+"_td_name_label_first"),D.setAttribute("align","left");var P=document.createElement("div");P.style.display="table-cell",P.setAttribute("id",t+"_td_name_label_last"),P.setAttribute("align","left");var O=document.createElement("span");O.setAttribute("id",t+"_element_labelform_id_temp"),O.innerHTML=e,O.setAttribute("class","label"),O.style.verticalAlign="top";var K=document.createElement("span");K.setAttribute("id",t+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),K.style.verticalAlign="top","yes"==m&&(K.innerHTML=" *");var U=document.createElement("input");U.setAttribute("type","text"),U.style.cssText="margin-right: 10px; width:"+r+"px",U.setAttribute("id",t+"_element_firstform_id_temp"),U.setAttribute("name",t+"_element_firstform_id_temp"),U.setAttribute("value",l[0]),U.setAttribute("title",d[0]),U.setAttribute("placeholder",d[0]);var F=document.createElement("label");F.setAttribute("class","mini_label"),F.setAttribute("id",t+"_mini_label_first"),F.innerHTML=_[1];var R=document.createElement("input");R.setAttribute("type","text"),R.style.cssText="margin-right: 10px; width:"+r+"px",R.setAttribute("id",t+"_element_lastform_id_temp"),R.setAttribute("name",t+"_element_lastform_id_temp"),R.setAttribute("value",l[1]),R.setAttribute("title",d[1]),R.setAttribute("placeholder",d[1]);var W=document.createElement("label");W.setAttribute("class","mini_label"),W.setAttribute("id",t+"_mini_label_last"),W.innerHTML=_[2];var V=document.getElementById("show_table");M.appendChild(O),M.appendChild(K),N.appendChild(U),S.appendChild(R),q.appendChild(N),q.appendChild(S),D.appendChild(F),P.appendChild(W),H.appendChild(D),H.appendChild(P),z.appendChild(q),z.appendChild(H),L.appendChild(E),L.appendChild(j),L.appendChild(x),L.appendChild(I),L.appendChild(A),L.appendChild(k),L.appendChild(z),Q.appendChild(M),Q.appendChild(L),C.appendChild(Q),C.appendChild(g),C.appendChild(B),V.appendChild(C),jQuery("#main_div").append("<br>"+form_maker.type_name_description),"top"==a&&label_top(t),change_class(u,t),"yes"==f[0]&&enable_name_fields(t,"title"),"yes"==f[1]&&enable_name_fields(t,"middle"),jQuery(function(){jQuery("label#"+t+"_mini_label_first").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.first").focus(),jQuery("input.first").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_first").text(e),document.getElementById("el_first_label").innerHTML=e})}}),jQuery("label#"+t+"_mini_label_last").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.last").focus(),jQuery("input.last").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_last").text(e),document.getElementById("el_last_label").innerHTML=e})}})}),refresh_attr(t,"type_name")}function create_autofill_user_email(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_autofill">Autofill with user email</label>'),jQuery('<input type="checkbox" id="el_autofill" onclick="set_autofill(\''+e+"_autofillform_id_temp')\""+("yes"==t?' checked="checked"':"")+" />"))}function create_confirmation_email(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_verification_mail">Confirmation Email</label>'),jQuery('<input type="checkbox" id="el_verification_mail" onclick="verification_mail('+e+')"'+("yes"==t?' checked="checked"':"")+" />"))}function verification_mail(e){document.getElementById("el_verification_mail").checked?(document.getElementById("confirm_validation_label").style.display="block",document.getElementById("confirm_validation_empty").style.display="block",document.getElementById(e+"_verification_id_temp").value="yes",document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById("confirm_validation_label").style.display="none",document.getElementById("confirm_validation_empty").style.display="none",document.getElementById(e+"_verification_id_temp").value="no",document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none")}function create_confirmation_email_label(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_label">Confirmation label</label>'),jQuery('<textarea id="edit_for_label" class="fm-width-100" onKeyUp="change_label(\''+e+"_element_labelform_id_temp', this.value, '"+e+'_1_element_labelform_id_temp\')" rows="4">'+i+"</textarea>"),"confirm_validation_label","yes"==t)}function create_confirmation_email_placeholder(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_first_value_verification_input">Confirmation placeholder</label>'),jQuery('<input type="text" class="fm-width-100" id="el_first_value_verification_input" onKeyUp="change_input_value(this.value,\''+e+'_1_elementform_id_temp\')" value="'+i.replace(/"/g,"&quot;")+'" />'),"confirm_validation_empty","yes"==t)}function go_to_type_submitter_mail(e){w_attr_name=[],w_attr_value=[],type_submitter_mail(e,"Email","","top","no","","","","no","no","","no","Email confirmation","",w_attr_name,w_attr_value,"no")}function type_submitter_mail(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f,y){jQuery("#element_type").val("type_submitter_mail"),delete_last_child();var h=jQuery("#edit_table"),b=jQuery('<div id="edit_div"></div>');h.append(b);var v=jQuery('<div id="edit_main_table"></div>');b.append(v),v.append(create_field_type("type_submitter_mail")),v.append(create_label(e,t)),v.append(create_label_position(e,a)),v.append(create_hide_label(e,n)),v.append(create_required(e,r)),v.append(create_placeholder(e,_)),v.append(create_field_size(e,l,"'"+e+"_elementform_id_temp'","'"+e+"_1_elementform_id_temp'"));var w=jQuery('<div class="inside"></div>');v.append(create_advanced_options_container(w)),w.append(create_confirmation_email(e,s)),w.append(create_confirmation_email_label(e,s,u)),w.append(create_confirmation_email_placeholder(e,s,c)),w.append(create_autofill_user_email(e,y)),w.append(create_unique_values(e,o)),w.append(create_field_label_size(e,i,"'"+e+"_label_sectionform_id_temp'","'"+e+"_1_label_sectionform_id_temp'")),w.append(create_class(e,m)),w.append(create_additional_attributes(e,p,"type_submitter_mail")),element="input",type="text";var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","type_submitter_mail"),g.setAttribute("name",e+"_typeform_id_temp"),g.setAttribute("id",e+"_typeform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",y),E.setAttribute("name",e+"_autofillform_id_temp"),E.setAttribute("id",e+"_autofillform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",r),A.setAttribute("name",e+"_requiredform_id_temp"),A.setAttribute("id",e+"_requiredform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",n),j.setAttribute("name",e+"_hide_labelform_id_temp"),j.setAttribute("id",e+"_hide_labelform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",o),x.setAttribute("name",e+"_uniqueform_id_temp"),x.setAttribute("id",e+"_uniqueform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",s),k.setAttribute("name",e+"_verification_id_temp"),k.setAttribute("id",e+"_verification_id_temp");var I=document.createElement(element);I.setAttribute("type",type),I.style.cssText="width:"+l+"px;",I.setAttribute("id",e+"_elementform_id_temp"),I.setAttribute("name",e+"_elementform_id_temp"),I.setAttribute("value",d),I.setAttribute("title",_),I.setAttribute("placeholder",_);var C=document.createElement(element);C.setAttribute("type",type),C.style.cssText="width:"+l+"px;",C.setAttribute("id",e+"_1_elementform_id_temp"),C.setAttribute("name",e+"_1_elementform_id_temp"),C.setAttribute("placeholder",c),C.setAttribute("title",c);var B=document.createElement("div");B.setAttribute("id","main_div");var Q=document.createElement("div");Q.setAttribute("id",e+"_elemet_tableform_id_temp");var T="yes"==n?"none":"table-cell",M=document.createElement("div");M.setAttribute("align","left"),M.style.display=T,M.style.width=i+"px",M.setAttribute("id",e+"_label_sectionform_id_temp");var L="yes"==n||"no"==s?"none":"table-cell",z=document.createElement("div");z.setAttribute("align","left"),z.style.display=L,z.style.width=i+"px",z.setAttribute("id",e+"_1_label_sectionform_id_temp");var q=document.createElement("div");q.setAttribute("align","left"),q.style.display="table-cell",q.setAttribute("id",e+"_element_sectionform_id_temp");var H="no"==s?"none":"table-cell",N=document.createElement("div");N.setAttribute("align","left"),N.style.display=H,N.setAttribute("id",e+"_1_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var S=document.createElement("br"),D=(document.createElement("br"),document.createElement("br")),P=document.createElement("span");P.setAttribute("id",e+"_element_labelform_id_temp"),P.innerHTML=t,P.setAttribute("class","label"),P.style.verticalAlign="top";var O=document.createElement("span");O.setAttribute("id",e+"_1_element_labelform_id_temp"),O.innerHTML=u,O.setAttribute("class","label"),O.style.verticalAlign="top";var K=document.createElement("span");K.setAttribute("id",e+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),K.style.verticalAlign="top","yes"==r&&(K.innerHTML=" *");var U=document.createElement("span");U.setAttribute("id",e+"_1_required_elementform_id_temp"),U.innerHTML="",U.setAttribute("class","required"),U.style.verticalAlign="top","yes"==r&&(U.innerHTML=" *");var F=document.getElementById("show_table");M.appendChild(P),M.appendChild(K),z.appendChild(O),z.appendChild(U),q.appendChild(g),q.appendChild(A),q.appendChild(j),q.appendChild(x),q.appendChild(k),q.appendChild(E),q.appendChild(I),N.appendChild(C),Q.appendChild(M),Q.appendChild(q),Q.appendChild(D),Q.appendChild(z),Q.appendChild(N),B.appendChild(Q),B.appendChild(S),F.appendChild(B),jQuery("#main_div").append(form_maker.type_email_description),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function go_to_type_phone_new(e){w_attr_name=[],w_attr_value=[],type_phone_new(e,"Phone","","top","no","","","us","no","no","",w_attr_name,w_attr_value)}function type_phone_new(e,t,i,a,n,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_phone_new"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('<div id="edit_div"></div>');c.append(p);var f=jQuery('<div id="edit_main_table"></div>');p.append(f),f.append(create_field_type("type_phone_new")),f.append(create_label(e,t)),f.append(create_label_position(e,a)),f.append(create_hide_label(e,n)),f.append(create_required(e,r)),f.append(create_field_size(e,l));var y=jQuery('<div class="inside"></div>');f.append(create_advanced_options_container(y)),y.append(create_unique_values(e,o)),y.append(create_field_label_size(e,i)),y.append(create_class(e,m)),y.append(create_additional_attributes(e,s,"type_phone_new"));var h=document.createElement("br"),b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_phone_new"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",r),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",e+"_hide_labelform_id_temp"),w.setAttribute("id",e+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",o),g.setAttribute("name",e+"_uniqueform_id_temp"),g.setAttribute("id",e+"_uniqueform_id_temp");var E=document.createElement("div");E.setAttribute("id","main_div");var A=document.createElement("div");A.setAttribute("id",e+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=i+"px",x.setAttribute("id",e+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",e+"_element_sectionform_id_temp");var I=document.createElement("div");I.style.display="table",I.setAttribute("id",e+"_table_name");var C=document.createElement("div");C.style.display="table-row",C.setAttribute("id",e+"_tr_name1");var B=document.createElement("div");B.style.display="table-cell",B.setAttribute("id",e+"_td_name_input_first");var Q=document.createElement("span");Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label"),Q.style.verticalAlign="top";var T=document.createElement("span");T.setAttribute("id",e+"_required_elementform_id_temp"),T.innerHTML="",T.setAttribute("class","required"),"yes"==r&&(T.innerHTML=" *");var M=document.createElement("input");M.setAttribute("type","text"),M.style.cssText="width:"+l+"px",M.setAttribute("id",e+"_elementform_id_temp"),M.setAttribute("name",e+"_elementform_id_temp"),M.setAttribute("value",d),M.setAttribute("top-country",_);var L=document.getElementById("show_table");x.appendChild(Q),x.appendChild(T),B.appendChild(M),C.appendChild(B),I.appendChild(C),k.appendChild(b),k.appendChild(v),k.appendChild(w),k.appendChild(g),k.appendChild(I),A.appendChild(x),A.appendChild(k),E.appendChild(A),E.appendChild(h),L.appendChild(E),jQuery("#main_div").append(form_maker.type_phone_description),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text"),jQuery("#"+e+"_elementform_id_temp").intlTelInput({nationalMode:!1,preferredCountries:[_]})}function create_address_size(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_input_size">Overall width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_div_address\', this.value)" value="'+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function create_use_us_states_list(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_us_states">Use list for US states and Canada provinces</label>'),jQuery('<input type="checkbox" id="el_us_states" onclick="disable_fields('+e+",'us_states');\""+("yes"==t[6]?' checked="checked"':"")+" />"))}function disable_fields(i,a){var e=document.getElementById(i+"_div_address");if(a&&(1==document.getElementById("el_"+a).checked?document.getElementById(i+"_disable_fieldsform_id_temp").setAttribute(a,"yes"):document.getElementById(i+"_disable_fieldsform_id_temp").setAttribute(a,"no")),"yes"==document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute("state"))document.getElementById("el_us_states").disabled=!0;else if(document.getElementById("el_us_states").disabled=!1,"us_states"==a)return void change_state_input(i,"form_id_temp");e.innerHTML="";var t=new Array,n=["street1","street2","city","state","postal","country"],d=0;for(l=0;l<6;l++){if("no"==document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute(n[l]))if("street1"==n[l]||"street2"==n[l]){var _=document.createElement("input");_.setAttribute("type","text"),_.style.cssText="width:100%",_.setAttribute("id",i+"_"+n[l]+"form_id_temp"),_.setAttribute("name",parseInt(i)+l+"_"+n[l]+"form_id_temp");var r=document.createElement("label");r.setAttribute("class","mini_label"),r.setAttribute("id",i+"_mini_label_"+n[l]),r.style.cssText="display:block;",r.innerHTML=document.getElementById("el_"+n[l]+"_label").innerHTML,w_mini_labels[l]=document.getElementById("el_"+n[l]+"_label").innerHTML,(m=document.createElement("span")).style.cssText="float:left; width:100%; padding-bottom: 8px; display:block",m.appendChild(_),m.appendChild(r),e.appendChild(m)}else{var o,m;if(d++,"country"!=n[l])(a=document.createElement("input")).setAttribute("type","text"),a.style.cssText="width:100%",a.setAttribute("id",i+"_"+n[l]+"form_id_temp"),a.setAttribute("name",parseInt(i)+l+"_"+n[l]+"form_id_temp"),(o=document.createElement("label")).setAttribute("class","mini_label"),o.setAttribute("id",i+"_mini_label_"+n[l]),o.style.cssText="display:block;",o.innerHTML=document.getElementById("el_"+n[l]+"_label").innerHTML,w_mini_labels[l]=document.getElementById("el_"+n[l]+"_label").innerHTML;else(a=document.createElement("select")).setAttribute("type","text"),a.style.cssText="width:100%",a.setAttribute("id",i+"_countryform_id_temp"),a.setAttribute("name",parseInt(i)+l+"_countryform_id_temp"),a.setAttribute("onChange","change_state_input('"+i+"', 'form_id_temp')"),(o=document.createElement("label")).setAttribute("class","mini_label"),o.setAttribute("id",i+"_mini_label_country"),o.style.cssText="display:block;",o.innerHTML=document.getElementById("el_"+n[l]+"_label").innerHTML,w_mini_labels[l]=document.getElementById("el_"+n[l]+"_label").innerHTML,countries=form_maker.countries,jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("value",t),i.innerHTML=t,a.appendChild(i)});if(d%2!=0)(m=document.createElement("span")).style.cssText="float:left; width:48%; padding-bottom: 8px;";else(m=document.createElement("span")).style.cssText="float:right; width:48%; padding-bottom: 8px;";m.appendChild(a),m.appendChild(o),e.appendChild(m)}else{var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("id",i+"_"+n[l]+"form_id_temp"),s.setAttribute("value",document.getElementById("el_"+n[l]+"_label").innerHTML),s.setAttribute("id_for_label",parseInt(i)+l),t.push(s)}for(k=0;k<t.length;k++)e.appendChild(t[k])}"no"==document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute("state")&&"yes"==document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute("country")&&change_state_input(i,"form_id_temp"),jQuery(function(t){t("label#"+i+"_mini_label_street1").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='street1' style='outline:none; border:none; background:none;' value=\""+t(this).text()+'">';t(this).html(e),t("input.street1").focus(),t("input.street1").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street1").text(e),document.getElementById("el_street1_label").innerHTML=e})}}),t("label#"+i+"_mini_label_street2").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='street2' style='outline:none; border:none; background:none;' value=\""+t(this).text()+'">';t(this).html(e),t("input.street2").focus(),t("input.street2").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street2").text(e),document.getElementById("el_street2_label").innerHTML=e})}}),t("label#"+i+"_mini_label_city").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='city' style='outline:none; border:none; background:none;' value=\""+t(this).text()+'">';t(this).html(e),t("input.city").focus(),t("input.city").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_city").text(e),document.getElementById("el_city_label").innerHTML=e})}}),t("label#"+i+"_mini_label_state").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='state' style='outline:none; border:none; background:none;' value=\""+t(this).text()+'">';t(this).html(e),t("input.state").focus(),t("input.state").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_state").text(e),document.getElementById("el_state_label").innerHTML=e})}}),t("label#"+i+"_mini_label_postal").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='postal' style='outline:none; border:none; background:none;' value=\""+t(this).text()+'">';t(this).html(e),t("input.postal").focus(),t("input.postal").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_postal").text(e),document.getElementById("el_postal_label").innerHTML=e})}}),t("label#"+i+"_mini_label_country").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='country' style='outline:none; border:none; background:none;' value=\""+t(this).text()+'">';t(this).html(e),t("input.country").focus(),t("input.country").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_country").text(e),document.getElementById("el_country_label").innerHTML=e})}})}),refresh_attr(i,"type_address")}function change_state_input(e,t){if(document.getElementById(e+"_country"+t)&&document.getElementById(e+"_state"+t)&&!document.getElementById("el_state").checked&&!document.getElementById("el_us_states").disabled){var i=!1,a=document.getElementById(e+"_state"+t);if("United States"==document.getElementById(e+"_country"+t).value&&document.getElementById("el_us_states").checked){var n=document.createElement("select"),l=form_maker.states;for(var d in l){(_=document.createElement("option")).setAttribute("value",d),_.innerHTML=l[d],n.appendChild(_)}i=!0}else if("Canada"==document.getElementById(e+"_country"+t).value&&document.getElementById("el_us_states").checked){n=document.createElement("select"),l=form_maker.provinces;for(var d in l){var _;(_=document.createElement("option")).setAttribute("value",d),_.innerHTML=l[d],n.appendChild(_)}i=!0}else if("SELECT"==document.getElementById(e+"_state"+t).tagName){n=document.createElement("input");i=!0}if(i){n.setAttribute("type","text"),n.style.cssText="width: 100%",n.setAttribute("id",e+"_state"+t),n.setAttribute("name",parseInt(e)+3+"_state"+t);var r=a.parentNode;r.removeChild(a),r.insertBefore(n,r.firstChild)}}}function create_disable_address_fields(e,t,i){var a=jQuery('<label class="fm-field-label">Disable Field(s)</label>'),n=jQuery('<input type="checkbox" id="el_street1" value="no" onclick="disable_fields('+e+",'street1')\""+("yes"==t[0]?' checked="checked"':"")+" />"),l=jQuery('<label for="el_street1" id="el_street1_label">'+i[0]+"</label>"),d=jQuery('<input type="checkbox" id="el_street2" value="no" onclick="disable_fields('+e+",'street2')\""+("yes"==t[1]?' checked="checked"':"")+" />"),_=jQuery('<label for="el_street2" id="el_street2_label">'+i[1]+"</label>"),r=jQuery('<input type="checkbox" id="el_city" value="no" onclick="disable_fields('+e+",'city')\""+("yes"==t[2]?' checked="checked"':"")+" />"),o=jQuery('<label for="el_city" id="el_city_label">'+i[2]+"</label>"),m=jQuery('<input type="checkbox" id="el_state" value="no" onclick="disable_fields('+e+",'state')\""+("yes"==t[3]?' checked="checked"':"")+" />"),s=jQuery('<label for="el_state" id="el_state_label">'+i[3]+"</label>"),u=jQuery('<input type="checkbox" id="el_postal" value="no" onclick="disable_fields('+e+",'postal')\""+("yes"==t[4]?' checked="checked"':"")+" />"),c=jQuery('<label for="el_postal" id="el_postal_label">'+i[4]+"</label>"),p=jQuery('<input type="checkbox" id="el_country" value="no" onclick="disable_fields('+e+",'country')\""+("yes"==t[5]?' checked="checked"':"")+" />"),f=jQuery('<label for="el_country" id="el_country_label">'+i[5]+"</label>"),y=n;return create_option_container(a,y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=y.add(l)).add(jQuery("<br />"))).add(d)).add(_)).add(jQuery("<br />"))).add(r)).add(o)).add(jQuery("<br />"))).add(m)).add(s)).add(jQuery("<br />"))).add(u)).add(c)).add(jQuery("<br />"))).add(p)).add(f))}function go_to_type_address(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["Street Address","Street Address Line 2","City","State / Province / Region","Postal / Zip Code","Country"],w_disabled_fields=["no","no","no","no","no","no","yes"],type_address(e,"Address","","top","no","",w_mini_labels,w_disabled_fields,"no","wdform_address",w_attr_name,w_attr_value)}function type_address(i,e,t,a,n,l,d,_,r,o,m,s){jQuery("#element_type").val("type_address"),delete_last_child();var u=jQuery("#edit_table"),c=jQuery('<div id="edit_div"></div>');u.append(c);var p=jQuery('<div id="edit_main_table"></div>');c.append(p),p.append(create_field_type("type_address")),p.append(create_label(i,e)),p.append(create_label_position(i,a)),p.append(create_hide_label(i,n)),p.append(create_required(i,r)),p.append(create_address_size(i,l)),p.append(create_use_us_states_list(i,_));var f=jQuery('<div class="inside"></div>');p.append(create_advanced_options_container(f)),f.append(create_disable_address_fields(i,_,d)),f.append(create_field_label_size(i,t)),f.append(create_class(i,o)),f.append(create_additional_attributes(i,m,"type_address"));var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value","type_address"),y.setAttribute("name",i+"_typeform_id_temp"),y.setAttribute("id",i+"_typeform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("name",i+"_disable_fieldsform_id_temp"),h.setAttribute("id",i+"_disable_fieldsform_id_temp"),h.setAttribute("street1",_[0]),h.setAttribute("street2",_[1]),h.setAttribute("city",_[2]),h.setAttribute("state",_[3]),h.setAttribute("us_states",_[6]),h.setAttribute("postal",_[4]),h.setAttribute("country",_[5]);var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",r),b.setAttribute("name",i+"_requiredform_id_temp"),b.setAttribute("id",i+"_requiredform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",n),v.setAttribute("name",i+"_hide_labelform_id_temp"),v.setAttribute("id",i+"_hide_labelform_id_temp");var w=document.createElement("div");w.setAttribute("id","main_div");var g=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),E=document.createElement("div");E.setAttribute("style","margin-left:4px; color:red; display:inline-block;"),E.appendChild(g);var A=document.createElement("div");A.setAttribute("id",i+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=t+"px",x.style.verticalAlign="top",x.setAttribute("id",i+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",i+"_element_sectionform_id_temp");var I=document.createElement("div");I.setAttribute("id",i+"_div_address"),I.style.cssText="width:"+l+"px";var C=document.createElement("span");C.style.cssText="float:left; width:100%; padding-bottom: 8px; display:block";var B=document.createElement("span");B.style.cssText="float:left; width:100%; padding-bottom: 8px; display:block";var Q=document.createElement("span");Q.style.cssText="float:left; width:48%; padding-bottom: 8px;";var T=document.createElement("span");T.style.cssText="float:right; width:48%; padding-bottom: 8px;";var M=document.createElement("span");M.style.cssText="float:left; width:48%; padding-bottom: 8px;";var L=document.createElement("span");L.style.cssText="float:right; width:48%; padding-bottom: 8px;";var z=document.createElement("br"),q=document.createElement("span");q.setAttribute("id",i+"_element_labelform_id_temp"),q.innerHTML=e,q.setAttribute("class","wd_form_label"),q.style.verticalAlign="top";var H=document.createElement("span");H.setAttribute("id",i+"_required_elementform_id_temp"),H.innerHTML="",H.setAttribute("class","required"),H.style.verticalAlign="top","yes"==r&&(H.innerHTML=" *");var N=document.createElement("input");N.setAttribute("type","text"),N.style.cssText="width:100%",N.setAttribute("id",i+"_street1form_id_temp"),N.setAttribute("name",i+"_street1form_id_temp");var S=document.createElement("label");S.setAttribute("class","mini_label"),S.setAttribute("id",i+"_mini_label_street1"),S.style.cssText="display:block;",S.innerHTML=d[0];var D=document.createElement("input");D.setAttribute("type","text"),D.style.cssText="width:100%",D.setAttribute("id",i+"_street2form_id_temp"),D.setAttribute("name",parseInt(i)+1+"_street2form_id_temp");var P=document.createElement("label");P.setAttribute("class","mini_label"),P.setAttribute("id",i+"_mini_label_street2"),P.style.cssText="display:block;",P.innerHTML=d[1];var O=document.createElement("input");O.setAttribute("type","text"),O.style.cssText="width:100%",O.setAttribute("id",i+"_cityform_id_temp"),O.setAttribute("name",parseInt(i)+2+"_cityform_id_temp");var K=document.createElement("label");K.setAttribute("class","mini_label"),K.setAttribute("id",i+"_mini_label_city"),K.style.cssText="display:block;",K.innerHTML=d[2];var U=document.createElement("input");U.setAttribute("type","text"),U.style.cssText="width:100%",U.setAttribute("id",i+"_stateform_id_temp"),U.setAttribute("name",parseInt(i)+3+"_stateform_id_temp");var F=document.createElement("label");F.setAttribute("class","mini_label"),F.setAttribute("id",i+"_mini_label_state"),F.style.cssText="display:block;",F.innerHTML=d[3];var R=document.createElement("input");R.setAttribute("type","text"),R.style.cssText="width:100%",R.setAttribute("id",i+"_postalform_id_temp"),R.setAttribute("name",parseInt(i)+4+"_postalform_id_temp");var W=document.createElement("label");W.setAttribute("class","mini_label"),W.setAttribute("id",i+"_mini_label_postal"),W.style.cssText="display:block;",W.innerHTML=d[4];var V=document.createElement("select");V.setAttribute("type","text"),V.style.cssText="width:100%",V.setAttribute("id",i+"_countryform_id_temp"),V.setAttribute("name",parseInt(i)+5+"_countryform_id_temp"),V.setAttribute("onChange","change_state_input('"+i+"','form_id_temp')");var $=document.createElement("label");$.setAttribute("class","mini_label"),$.setAttribute("id",i+"_mini_label_country"),$.style.cssText="display:block;",$.innerHTML=d[5],countries=form_maker.countries,jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("value",t),i.innerHTML=t,V.appendChild(i)});var G=document.getElementById("show_table");x.appendChild(q),x.appendChild(H),C.appendChild(N),C.appendChild(S),B.appendChild(D),B.appendChild(P),Q.appendChild(O),Q.appendChild(K),T.appendChild(U),T.appendChild(F),M.appendChild(R),M.appendChild(W),L.appendChild(V),L.appendChild($),I.appendChild(C),I.appendChild(B),I.appendChild(Q),I.appendChild(T),I.appendChild(M),I.appendChild(L),k.appendChild(y),k.appendChild(b),k.appendChild(v),k.appendChild(h),k.appendChild(I),A.appendChild(x),A.appendChild(k),w.appendChild(A),w.appendChild(z),w.appendChild(E),G.appendChild(w),jQuery("#main_div").append("<br><br>"+form_maker.type_address_description),"top"==a&&label_top(i),change_class(o,i),refresh_attr(i,"type_address"),"yes"==_[0]&&disable_fields(i,"street1"),"yes"==_[1]&&disable_fields(i,"street2"),"yes"==_[2]&&disable_fields(i,"city"),"yes"==_[3]&&disable_fields(i,"state"),"yes"==_[4]&&disable_fields(i,"postal"),"yes"==_[5]&&disable_fields(i,"country"),"yes"==_[6]&&disable_fields(i,"us_states"),jQuery(function(t){t("label#"+i+"_mini_label_street1").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='street1' style='outline:none; border:none; background:none; width:130px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.street1").focus(),t("input.street1").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street1").text(e),document.getElementById("el_street1_label").innerHTML=e})}}),t("label#"+i+"_mini_label_street2").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='street2' style='outline:none; border:none; background:none; width:130px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.street2").focus(),t("input.street2").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street2").text(e),document.getElementById("el_street2_label").innerHTML=e})}}),t("label#"+i+"_mini_label_city").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='city' style='outline:none; border:none; background:none; width:130px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.city").focus(),t("input.city").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_city").text(e),document.getElementById("el_city_label").innerHTML=e})}}),t("label#"+i+"_mini_label_state").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='state' style='outline:none; border:none; background:none; width:130px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.state").focus(),t("input.state").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_state").text(e),document.getElementById("el_state_label").innerHTML=e})}}),t("label#"+i+"_mini_label_postal").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='postal' style='outline:none; border:none; background:none; width:130px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.postal").focus(),t("input.postal").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_postal").text(e),document.getElementById("el_postal_label").innerHTML=e})}}),t("label#"+i+"_mini_label_country").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='country' style='outline:none; border:none; background:none; width:130px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.country").focus(),t("input.country").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_country").text(e),document.getElementById("el_country_label").innerHTML=e})}})})}function create_markmap_address(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="addrval'+t+'">Address</label>'),jQuery('<input type="text" class="fm-width-100" id="addrval'+t+'" onChange="changeAddress('+e+", "+t+')" value="" />'))}function create_markmap_longitude(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="longval'+i+'">Longitude</label>'),jQuery('<input type="text" class="fm-width-100" id="longval'+i+'" onkeyup="update_position('+e+", "+i+')" value="'+t+'" />'))}function create_markmap_latitude(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="latval'+i+'">Latitude</label>'),jQuery('<input type="text" class="fm-width-100" id="latval'+i+'" onkeyup="update_position('+e+", "+i+')" value="'+t+'" />'))}function create_markmap_size(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_input_size">Size(px)</label>'),jQuery('<input type="text" class="fm-width-40" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_elementform_id_temp\', this.value)" value="'+t+'" />x<input type="text" class="fm-width-40" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_h_style(\''+e+'_elementform_id_temp\', this.value)" value="'+i+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function create_markmap_info(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="info'+i+'">Marker Info</label>'),jQuery('<textarea class="fm-width-100" id="info'+i+'" rows="3" onKeyUp="change_info(this.value,'+e+", "+i+')">'+t+"</textarea>"))}function go_to_type_mark_map(e){w_attr_name=[],w_attr_value=[],type_mark_map(e,"Mark your place on map","","top","no","2.294254","48.858334","2.294254","48.858334","13","370","300","wdform_map","",w_attr_name,w_attr_value)}function type_mark_map(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f){jQuery("#element_type").val("type_mark_map"),delete_last_child();var y=jQuery("#edit_table"),h=jQuery('<div id="edit_div"></div>');y.append(h);var b=jQuery('<div id="edit_main_table"></div>');h.append(b),b.append(create_field_type("type_mark_map")),b.append(create_label(e,t)),b.append(create_label_position(e,a)),b.append(create_hide_label(e,n)),b.append(jQuery('<div class="notice notice-info"><p>Drag the marker to change default marker position.</p></div>')),b.append(create_markmap_address(e,0)),b.append(create_markmap_longitude(e,_,0)),b.append(create_markmap_latitude(e,r,0)),b.append(create_markmap_info(e,c,0)),b.append(create_markmap_size(e,m,s)),b.append(create_keys(e,"To set up map key click here"));var v=jQuery('<div class="inside"></div>');b.append(create_advanced_options_container(v)),v.append(create_field_label_size(e,i)),v.append(create_class(e,u)),v.append(create_additional_attributes(e,p,"type_mark_map")),element="div";var w=document.createElement("br"),g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","type_mark_map"),g.setAttribute("name",e+"_typeform_id_temp"),g.setAttribute("id",e+"_typeform_id_temp");var E=document.createElement("div");E.setAttribute("id",e+"_elementform_id_temp"),E.setAttribute("long0",_),E.setAttribute("lat0",r),E.setAttribute("zoom",o),E.style.cssText="width:"+m+"px; height: "+s+"px",E.setAttribute("info0",c),E.setAttribute("center_x",l),E.setAttribute("center_y",d);var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",n),A.setAttribute("name",e+"_hide_labelform_id_temp"),A.setAttribute("id",e+"_hide_labelform_id_temp");var j=document.createElement("span");j.setAttribute("id",e+"_element_labelform_id_temp"),j.innerHTML=t,j.setAttribute("class","wd_form_label"),j.style.verticalAlign="top";var x=document.createElement("div");x.setAttribute("id","main_div");var k=document.createElement("div");k.setAttribute("id",e+"_elemet_tableform_id_temp");var I="yes"==n?"none":"table-cell",C=document.createElement("div");C.setAttribute("align","left"),C.style.display=I,C.style.width=i+"px",C.style.verticalAlign="top",C.setAttribute("id",e+"_label_sectionform_id_temp");var B=document.createElement("div");B.setAttribute("align","left"),B.style.display="table-cell",B.setAttribute("id",e+"_element_sectionform_id_temp");var Q=document.getElementById("show_table");C.appendChild(j),B.appendChild(g),B.appendChild(E),B.appendChild(A),k.appendChild(C),k.appendChild(B),x.appendChild(k),x.appendChild(w),Q.appendChild(x),jQuery("#main_div").append(form_maker.type_mark_on_map_description),"top"==a&&label_top(e),change_class(u,e),refresh_attr(e,"type_text"),if_gmap_init(e),add_marker_on_map(e,0,_,r,c,!0)}function create_edit_country_list(e){jQuery('<label class="fm-field-label">Edit country list</label>');return create_option_container(null,jQuery("<a href=\"\" onclick=\"tb_show('', 'admin-ajax.php?action=FormMakerEditCountryinPopup&nonce="+fm_ajax.ajaxnonce+"&field_id="+e+'&width=530&height=370&TB_iframe=1\'); return false;" class="thickbox-preview fm-field-recaptcha-label">Edit country list</a>'))}function go_to_type_country(e){w_countries=form_maker.countries,w_attr_name=[],w_attr_value=[],type_country(e,"Country","","no",w_countries,"top","","no","wdform_select",w_attr_name,w_attr_value)}function type_country(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_country"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('<div id="edit_div"></div>');s.append(u);var c=jQuery('<div id="edit_main_table"></div>');u.append(c),c.append(create_field_type("type_country")),c.append(create_label(e,t)),c.append(create_label_position(e,l)),c.append(create_hide_label(e,a)),c.append(create_required(e,_)),c.append(create_field_size(e,d));var p=jQuery('<div class="inside"></div>');c.append(create_advanced_options_container(p)),p.append(create_edit_country_list(e)),p.append(create_field_label_size(e,i)),p.append(create_class(e,r)),p.append(create_additional_attributes(e,o,"type_country"));document.createElement("br");var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_country"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",e+"_requiredform_id_temp"),y.setAttribute("id",e+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",a),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("div");b.setAttribute("id","main_div");var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==a?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.style.width=i+"px",E.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var A=document.createElement("br"),j=(document.createElement("br"),document.createElement("div"));j.setAttribute("id",e+"_table_little"),j.style.display="table";var x=document.createElement("div");x.setAttribute("id",e+"_element_tr1"),x.style.display="table-row";var k=document.createElement("div");k.setAttribute("id",e+"_element_tr2"),k.style.display="table-row";var I=document.createElement("div");I.setAttribute("valign","top"),I.setAttribute("id",e+"_td_little1"),I.style.display="table-cell";var C=document.createElement("div");C.setAttribute("valign","top"),C.setAttribute("id",e+"_td_little2"),C.style.display="table-cell";var B=document.createElement("span");B.setAttribute("id",e+"_element_labelform_id_temp"),B.innerHTML=t,B.setAttribute("class","label"),B.style.verticalAlign="top";var Q=document.createElement("span");Q.setAttribute("id",e+"_required_elementform_id_temp"),Q.innerHTML="",Q.setAttribute("class","required"),Q.style.verticalAlign="top","yes"==_&&(Q.innerHTML=" *");var T=document.createElement("select");T.setAttribute("id",e+"_elementform_id_temp"),T.setAttribute("name",e+"_elementform_id_temp"),T.style.cssText="width:"+d+"px",jQuery.each(n,function(e,t){var i=document.createElement("option");i.setAttribute("value",t),i.innerHTML=t,T.appendChild(i)});var M=document.getElementById("show_table");g.appendChild(B),g.appendChild(Q),E.appendChild(h),E.appendChild(f),E.appendChild(y),E.appendChild(T),v.appendChild(g),v.appendChild(E),b.appendChild(v),b.appendChild(A),M.appendChild(b),jQuery("#main_div").append(form_maker.type_country_list_description),"top"==l&&label_top(e),change_class(r,e),refresh_attr(e,"type_text")}function create_datefields_separator(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_fields_divider">Fields separator</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_fields_divider" onKeyUp="set_divider('+e+', this.value)" value="'+t+'" />'))}function create_datefield_day_type(e,t){var i=jQuery('<label class="fm-field-label">Day field type</label>'),a=jQuery('<input type="radio" id="el_day_field_type_text" name="edit_for_day_field_type" onchange="field_to_text('+e+", 'day')\""+("SELECT"==t?"":' checked="checked"')+" />"),n=jQuery('<label for="el_day_field_type_text">Input</label>'),l=jQuery('<input type="radio" id="el_day_field_type_select" name="edit_for_day_field_type" onchange="field_to_select('+e+", 'day')\""+("SELECT"==t?' checked="checked"':"")+" />"),d=jQuery('<label for="el_day_field_type_select">Select</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_datefields_day_size(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_day_size">Day field width(px)</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_day_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_dayform_id_temp\', this.value)" value="'+t+'" />'))}function create_datefield_month_type(e,t){var i=jQuery('<label class="fm-field-label">Month field type</label>'),a=jQuery('<input type="radio" id="el_month_field_type_text" name="edit_for_month_field_type" onchange="field_to_text('+e+", 'month')\""+("SELECT"==t?"":' checked="checked"')+" />"),n=jQuery('<label for="el_month_field_type_text">Input</label>'),l=jQuery('<input type="radio" id="el_month_field_type_select" name="edit_for_month_field_type" onchange="field_to_select('+e+", 'month')\""+("SELECT"==t?' checked="checked"':"")+" />"),d=jQuery('<label for="el_month_field_type_select">Select</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_datefields_month_size(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_month_size">Month field width(px)</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_month_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_monthform_id_temp\', this.value)" value="'+t+'" />'))}function create_datefield_year_type(e,t){var i=jQuery('<label class="fm-field-label">Year field type</label>'),a=jQuery('<input type="radio" id="el_year_field_type_text" name="edit_for_year_field_type" onchange="field_to_text('+e+", 'year')\""+("SELECT"==t?"":' checked="checked"')+" />"),n=jQuery('<label for="el_year_field_type_text">Input</label>'),l=jQuery('<input type="radio" id="el_year_field_type_select" name="edit_for_year_field_type" onchange="field_to_select('+e+", 'year')\""+("SELECT"==t?' checked="checked"':"")+" />"),d=jQuery('<label for="el_year_field_type_select">Select</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_datefields_year_size(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_year_size">Year field width(px)</label>'),jQuery('<input type="text" class="fm-width-100" id="edit_for_year_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_yearform_id_temp\', this.value)" value="'+t+'" />'))}function create_datefields_year_interval(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_year_interval_from">Year interval</label>'),jQuery('<input type="text" class="fm-width-40" id="edit_for_year_interval_from" onKeyPress="return check_isnum(event)" onKeyUp="year_interval('+e+')" value="'+t+'" />-<input type="text" class="fm-width-40" id="edit_for_year_interval_to" onKeyPress="return check_isnum(event)" onKeyUp="year_interval('+e+')" value="'+i+'" />'))}function field_to_select(e,t){switch(t){case"day":w_width=""!=document.getElementById("edit_for_day_size").value?document.getElementById("edit_for_day_size").value:30,w_day=document.getElementById(e+"_dayform_id_temp").value,document.getElementById(e+"_td_date_input1").innerHTML="";var i=document.createElement("select");for(i.setAttribute("id",e+"_dayform_id_temp"),i.setAttribute("name",e+"_dayform_id_temp"),i.setAttribute("onChange","set_select(this)"),i.style.width=w_width+"px",(_=document.createElement("option")).setAttribute("value",""),_.innerHTML="",i.appendChild(_),k=1;k<=31;k++){k<10&&(k="0"+k),(_=document.createElement("option")).setAttribute("value",k),_.innerHTML=k,k==w_day&&_.setAttribute("selected","selected"),i.appendChild(_)}document.getElementById(e+"_td_date_input1").appendChild(i);break;case"month":w_width=""!=document.getElementById("edit_for_month_size").value?document.getElementById("edit_for_month_size").value:60,w_month=document.getElementById(e+"_monthform_id_temp").value,document.getElementById(e+"_td_date_input2").innerHTML="";var a=document.createElement("select");a.setAttribute("id",e+"_monthform_id_temp"),a.setAttribute("name",e+"_monthform_id_temp"),a.setAttribute("onChange","set_select(this)"),a.style.width=w_width+"px",(_=document.createElement("option")).setAttribute("value",""),_.innerHTML="",a.appendChild(_);var n=new Array("\x3c!--repstart--\x3eJanuary\x3c!--repend--\x3e","\x3c!--repstart--\x3eFebruary\x3c!--repend--\x3e","\x3c!--repstart--\x3eMarch\x3c!--repend--\x3e","\x3c!--repstart--\x3eApril\x3c!--repend--\x3e","\x3c!--repstart--\x3eMay\x3c!--repend--\x3e","\x3c!--repstart--\x3eJune\x3c!--repend--\x3e","\x3c!--repstart--\x3eJuly\x3c!--repend--\x3e","\x3c!--repstart--\x3eAugust\x3c!--repend--\x3e","\x3c!--repstart--\x3eSeptember\x3c!--repend--\x3e","\x3c!--repstart--\x3eOctober\x3c!--repend--\x3e","\x3c!--repstart--\x3eNovember\x3c!--repend--\x3e","\x3c!--repstart--\x3eDecember\x3c!--repend--\x3e");for(k=1;k<=12;k++){k<10&&(k="0"+k),(_=document.createElement("option")).setAttribute("value",k),_.innerHTML=n[k-1],k==w_month&&_.setAttribute("selected","selected"),a.appendChild(_)}document.getElementById(e+"_td_date_input2").appendChild(a);break;case"year":w_width=""!=document.getElementById("edit_for_year_size").value?document.getElementById("edit_for_year_size").value:60,w_year=document.getElementById(e+"_yearform_id_temp").value,document.getElementById(e+"_td_date_input3").innerHTML="";var l=document.createElement("select");l.setAttribute("id",e+"_yearform_id_temp"),l.setAttribute("name",e+"_yearform_id_temp"),l.setAttribute("onChange","set_select(this)"),l.style.width=w_width+"px",(_=document.createElement("option")).setAttribute("value",""),_.innerHTML="",l.appendChild(_);var d=new Date;for(from=parseInt(document.getElementById("edit_for_year_interval_from").value),to=""!=document.getElementById("edit_for_year_interval_to").value?parseInt(document.getElementById("edit_for_year_interval_to").value):d.getFullYear(),k=to;k>=from;k--){var _;(_=document.createElement("option")).setAttribute("value",k),_.innerHTML=k,k==w_year&&_.setAttribute("selected","selected"),l.appendChild(_)}l.value=w_year,l.setAttribute("from",from),l.setAttribute("to",to),document.getElementById(e+"_td_date_input3").appendChild(l)}refresh_attr(e,"type_date_fields")}function field_to_text(e,t){switch(t){case"day":w_width=""!=document.getElementById("edit_for_day_size").value?document.getElementById("edit_for_day_size").value:30,w_day=document.getElementById(e+"_dayform_id_temp").value,document.getElementById(e+"_td_date_input1").innerHTML="";var i=document.createElement("input");i.setAttribute("type","text"),i.setAttribute("value",w_day),i.setAttribute("id",e+"_dayform_id_temp"),i.setAttribute("name",e+"_dayform_id_temp"),i.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+e+"_dayform_id_temp')"),i.style.width=w_width+"px",document.getElementById(e+"_td_date_input1").appendChild(i);break;case"month":w_width=""!=document.getElementById("edit_for_month_size").value?document.getElementById("edit_for_month_size").value:60,w_month=document.getElementById(e+"_monthform_id_temp").value,document.getElementById(e+"_td_date_input2").innerHTML="";var a=document.createElement("input");a.setAttribute("type","text"),a.setAttribute("value",w_month),a.setAttribute("id",e+"_monthform_id_temp"),a.setAttribute("name",e+"_monthform_id_temp"),a.style.width=w_width+"px",a.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+e+"_monthform_id_temp')"),document.getElementById(e+"_td_date_input2").appendChild(a);break;case"year":w_width=""!=document.getElementById("edit_for_year_size").value?document.getElementById("edit_for_year_size").value:60,w_year=document.getElementById(e+"_yearform_id_temp").value,document.getElementById(e+"_td_date_input3").innerHTML="";var n=new Date;from=parseInt(document.getElementById("edit_for_year_interval_from").value),to=""!=document.getElementById("edit_for_year_interval_to").value?parseInt(document.getElementById("edit_for_year_interval_to").value):n.getFullYear(),(parseInt(w_year)<from||parseInt(w_year)>to)&&(w_year="");var l=document.createElement("input");l.setAttribute("type","text"),l.setAttribute("value",w_year),l.setAttribute("id",e+"_yearform_id_temp"),l.setAttribute("name",e+"_yearform_id_temp"),l.style.width=w_width+"px",l.setAttribute("from",from),l.setAttribute("to",to),document.getElementById(e+"_td_date_input3").appendChild(l)}refresh_attr(e,"type_date_fields")}function set_divider(e,t){document.getElementById(e+"_separator1").innerHTML=t,document.getElementById(e+"_separator2").innerHTML=t}function year_interval(e){var t=new Date;from=parseInt(document.getElementById("edit_for_year_interval_from").value),to=""!=document.getElementById("edit_for_year_interval_to").value?parseInt(document.getElementById("edit_for_year_interval_to").value):t.getFullYear(),to-from<0?(alert("Invalid interval of years."),document.getElementById("edit_for_year_interval_from").value=to):"SELECT"==document.getElementById(e+"_yearform_id_temp").tagName?field_to_select(e,"year"):field_to_text(e,"year")}function go_to_type_date_fields(e){w_attr_name=[],w_attr_value=[];var t=new Date;w_to=t.getFullYear(),type_date_fields(e,"Date of Birth","","top","no","","","","SELECT","SELECT","SELECT","day","month","year","60","100","80","no","wdform_date_fields","1901",w_to,"&nbsp;/&nbsp;",w_attr_name,w_attr_value)}function type_date_fields(i,e,t,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v,w,g,E,A){current_date=new Date,jQuery("#element_type").val("type_date_fields"),delete_last_child();var j=jQuery("#edit_table"),x=jQuery('<div id="edit_div"></div>');j.append(x);var k=jQuery('<div id="edit_main_table"></div>');x.append(k),k.append(create_field_type("type_date_fields")),k.append(create_label(i,e)),k.append(create_label_position(i,a)),k.append(create_hide_label(i,n)),k.append(create_required(i,h));var I=jQuery('<div class="inside"></div>');k.append(create_advanced_options_container(I)),I.append(create_datefields_separator(i,g)),I.append(create_datefield_day_type(i,r)),I.append(create_datefields_day_size(i,p)),I.append(create_datefield_month_type(i,o)),I.append(create_datefields_month_size(i,f)),I.append(create_datefield_year_type(i,m)),I.append(create_datefields_year_size(i,y)),I.append(create_datefields_year_interval(i,v,w)),I.append(jQuery('<div class="notice notice-info"><p>Leave the second field empty and the current year will be used automatically. For a specific year (other than current) fill out both the start and finish points of the range.</p></div>')),I.append(create_field_label_size(i,t)),I.append(create_class(i,b)),I.append(create_additional_attributes(i,E,"type_date_fields"));var C=document.createElement("br"),B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value","type_date_fields"),B.setAttribute("name",i+"_typeform_id_temp"),B.setAttribute("id",i+"_typeform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",h),Q.setAttribute("name",i+"_requiredform_id_temp"),Q.setAttribute("id",i+"_requiredform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",n),T.setAttribute("name",i+"_hide_labelform_id_temp"),T.setAttribute("id",i+"_hide_labelform_id_temp");var M=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),L=document.createElement("div");L.setAttribute("id","main_div");var z=document.createElement("div");z.setAttribute("style","margin-left:4px; color:red;"),z.appendChild(M);var q=document.createElement("div");q.setAttribute("id",i+"_elemet_tableform_id_temp");var H="yes"==n?"none":"table-cell",N=document.createElement("div");N.setAttribute("align","left"),N.style.cssText="display:"+H+"; vertical-align:top; width:"+t+"px",N.setAttribute("id",i+"_label_sectionform_id_temp");var S=document.createElement("div");S.setAttribute("align","left"),S.style.display="table-cell",S.setAttribute("id",i+"_element_sectionform_id_temp");var D=document.createElement("div");D.setAttribute("id",i+"_table_date"),D.style.display="table";var P=document.createElement("div");P.setAttribute("id",i+"_tr_date1"),P.style.display="table-row";var O=document.createElement("div");O.setAttribute("id",i+"_tr_date2"),O.style.display="table-row";var K=document.createElement("div");K.setAttribute("id",i+"_td_date_input1"),K.style.display="table-cell";var U=document.createElement("div");U.setAttribute("id",i+"_td_date_separator1"),U.style.display="table-cell";var F=document.createElement("div");F.setAttribute("id",i+"_td_date_input2"),F.style.display="table-cell";var R=document.createElement("div");R.setAttribute("id",i+"_td_date_separator2"),R.style.display="table-cell";var W=document.createElement("div");W.setAttribute("id",i+"_td_date_input3"),W.style.display="table-cell";var V=document.createElement("div");V.setAttribute("id",i+"_td_date_label1"),V.style.display="table-cell";var $=document.createElement("div");$.style.display="table-cell";var G=document.createElement("div");G.setAttribute("id",i+"_td_date_label2"),G.style.display="table-cell";var Y=document.createElement("div");Y.style.display="table-cell";var Z=document.createElement("div");Z.setAttribute("id",i+"_td_date_label3"),Z.style.display="table-cell";var X=document.createElement("span");X.setAttribute("id",i+"_element_labelform_id_temp"),X.innerHTML=e,X.setAttribute("class","wd_form_label"),X.style.verticalAlign="top";var J=document.createElement("span");J.setAttribute("id",i+"_required_elementform_id_temp"),J.innerHTML="",J.setAttribute("class","required"),J.style.verticalAlign="top","yes"==h&&(J.innerHTML=" *");var ee=document.createElement("input");ee.setAttribute("type","text"),ee.setAttribute("value",l),ee.setAttribute("id",i+"_dayform_id_temp"),ee.setAttribute("name",i+"_dayform_id_temp"),ee.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+i+"_dayform_id_temp')"),ee.style.width=p+"px";var te=document.createElement("label");te.setAttribute("class","mini_label"),te.setAttribute("id",i+"_day_label"),te.innerHTML=s;var ie=document.createElement("span");ie.setAttribute("id",i+"_separator1"),ie.setAttribute("class","wdform_separator"),ie.innerHTML=g;var ae=document.createElement("input");ae.setAttribute("type","text"),ae.setAttribute("value",d),ae.setAttribute("id",i+"_monthform_id_temp"),ae.setAttribute("name",i+"_monthform_id_temp"),ae.style.width=f+"px",ae.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+i+"_monthform_id_temp')");var ne=document.createElement("label");ne.setAttribute("class","mini_label"),ne.setAttribute("class","mini_label"),ne.setAttribute("id",i+"_month_label"),ne.innerHTML=u;var le=document.createElement("span");le.setAttribute("id",i+"_separator2"),le.setAttribute("class","wdform_separator"),le.innerHTML=g,""==w&&(w=current_date.getFullYear());var de=document.createElement("input");de.setAttribute("type","text"),de.setAttribute("from",v),de.setAttribute("to",w),de.setAttribute("value",_),de.setAttribute("id",i+"_yearform_id_temp"),de.setAttribute("name",i+"_yearform_id_temp"),de.style.width=y+"px";var _e=document.createElement("label");_e.setAttribute("class","mini_label"),_e.setAttribute("id",i+"_year_label"),_e.innerHTML=c;var re=document.getElementById("show_table");N.appendChild(X),N.appendChild(J),S.appendChild(T),K.appendChild(ee),U.appendChild(ie),F.appendChild(ae),R.appendChild(le),W.appendChild(de),P.appendChild(K),P.appendChild(U),P.appendChild(F),P.appendChild(R),P.appendChild(W),V.appendChild(te),G.appendChild(ne),Z.appendChild(_e),O.appendChild(V),O.appendChild($),O.appendChild(G),O.appendChild(Y),O.appendChild(Z),D.appendChild(P),D.appendChild(O),S.appendChild(B),S.appendChild(Q),S.appendChild(D),q.appendChild(N),q.appendChild(S),L.appendChild(q),L.appendChild(C),L.appendChild(z),re.appendChild(L),jQuery("#main_div").append("<br>"+form_maker.type_date_of_birth_description),"top"==a&&label_top(i),"SELECT"==r&&field_to_select(i,"day"),"SELECT"==o&&field_to_select(i,"month"),"SELECT"==m&&field_to_select(i,"year"),change_class(b,i),refresh_attr(i,"type_date_fields"),jQuery(function(t){t("label#"+i+"_day_label").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='day' style='outline:none; border:none; background:none; width:100px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.day").focus(),t("input.day").blur(function(){var e=t(this).val();t("#"+i+"_day_label").text(e)})}}),t("label#"+i+"_month_label").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='month' style='outline:none; border:none; background:none; width:100px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.month").focus(),t("input.month").blur(function(){var e=t(this).val();t("#"+i+"_month_label").text(e)})}}),t("label#"+i+"_year_label").click(function(){if(0==t(this).children("input").length){var e="<input type='text' class='year' size='8' style='outline:none; border:none; background:none; width:100px;' value=\""+t(this).text()+'">';t(this).html(e),t("input.year").focus(),t("input.year").blur(function(){var e=t(this).val();t("#"+i+"_year_label").text(e)})}})})}function create_payment_amount_range(e,t,i){return create_option_container(jQuery('<label class="fm-field-label">Range</label>'),jQuery('<input type="text" class="fm-width-40" id="el_range_min1" onKeyPress="return check_isnum(event)" onChange="change_input_range_new(\'min\', '+e+')" value="'+t+'" placeholder="Min" />-<input type="text" class="fm-width-40" id="el_range_max1" onKeyPress="return check_isnum(event)" onChange="change_input_range_new(\'max\', '+e+')" value="'+i+'" placeholder="Max" />'))}function create_hide_payment_currency(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_currency">Hide payment currency</label>'),jQuery('<input type="checkbox" id="el_currency" onchange="hide_currency(this.checked, '+e+')"'+("yes"==t?' checked="checked"':"")+" />"))}function change_input_range_new(e,t){var i="";""!=document.getElementById("el_range_"+e+"1").value&&(i=document.getElementById("el_range_"+e+"1").value),document.getElementById(t+"_range_"+e+"form_id_temp").value=i}function hide_currency(e,t){document.getElementById(t+"_td_name_currency").style.display=e?"none":"table-cell"}function go_to_type_paypal_price_new(e){w_attr_name=[],w_attr_value=[],type_paypal_price_new(e,"Amount","","top","no","","","","no","",w_attr_name,w_attr_value,"","","no","no")}function type_paypal_price_new(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f){jQuery("#element_type").val("type_paypal_price_new"),delete_last_child();var y=jQuery("#edit_table"),h=jQuery('<div id="edit_div"></div>');y.append(h);var b=jQuery('<div id="edit_main_table"></div>');h.append(b),b.append(create_field_type("type_paypal_price_new")),b.append(create_label(e,t)),b.append(create_label_position(e,a)),b.append(create_hide_label(e,n)),b.append(create_required(e,r)),b.append(create_readonly(e,p)),b.append(create_field_size(e,_));var v=jQuery('<div class="inside"></div>');b.append(create_advanced_options_container(v)),v.append(create_payment_amount_range(e,u,c)),v.append(create_hide_payment_currency(e,f)),v.append(create_field_label_size(e,i)),v.append(create_class(e,o)),v.append(create_additional_attributes(e,m,"type_paypal_price_new"));var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value","type_paypal_price_new"),w.setAttribute("name",e+"_typeform_id_temp"),w.setAttribute("id",e+"_typeform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",r),g.setAttribute("name",e+"_requiredform_id_temp"),g.setAttribute("id",e+"_requiredform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",n),E.setAttribute("name",e+"_hide_labelform_id_temp"),E.setAttribute("id",e+"_hide_labelform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",p),A.setAttribute("name",e+"_readonlyform_id_temp"),A.setAttribute("id",e+"_readonlyform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",u),j.setAttribute("name",e+"_range_minform_id_temp"),j.setAttribute("id",e+"_range_minform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",c),x.setAttribute("name",e+"_range_maxform_id_temp"),x.setAttribute("id",e+"_range_maxform_id_temp");var k=document.createElement("div");k.setAttribute("id","main_div");var I=document.createElement("div");I.setAttribute("id",e+"_elemet_tableform_id_temp");var C="yes"==n?"none":"table-cell",B=document.createElement("div");B.setAttribute("align","left"),B.style.display=C,B.style.width=i+"px",B.setAttribute("id",e+"_label_sectionform_id_temp");var Q=document.createElement("div");Q.setAttribute("align","left"),Q.style.display="table-cell",Q.setAttribute("id",e+"_element_sectionform_id_temp");var T=document.createElement("div");T.setAttribute("id",e+"_table_price"),T.style.display="table";var M=document.createElement("div");M.setAttribute("id",e+"_tr_price1"),M.style.display="table-row";var L=document.createElement("div");L.setAttribute("id",e+"_td_name_currency"),L.style.display="no"==f?"table-cell":"none";var z=document.createElement("div");z.setAttribute("id",e+"_td_name_dollars"),z.style.display="table-cell";var q=document.createElement("div");q.style.display="table-cell";var H=document.createElement("div");H.setAttribute("align","left"),H.style.display="table-cell";var N=document.createElement("div");N.setAttribute("id",e+"_td_name_label_divider"),N.style.display="table-cell";var S=document.createElement("div");S.setAttribute("align","left"),S.setAttribute("id",e+"_td_name_label_cents"),S.style.display="table-cell";var D=document.createElement("span");D.setAttribute("id",e+"_element_labelform_id_temp"),D.innerHTML=t,D.setAttribute("class","label"),D.style.verticalAlign="top";var P=document.createElement("span");P.setAttribute("id",e+"_required_elementform_id_temp"),P.innerHTML="",P.setAttribute("class","required"),P.style.verticalAlign="top","yes"==r&&(P.innerHTML=" *");var O=document.createElement("span");O.setAttribute("class","wdform_colon"),O.style.cssText="font-style:bold; vertical-align:middle",O.innerHTML="\x3c!--repstart--\x3e&nbsp;$&nbsp;\x3c!--repend--\x3e";var K=document.createElement("label");K.setAttribute("class","mini_label");var U=document.createElement("input");U.setAttribute("type","text"),U.style.cssText="width:"+_+"px",U.setAttribute("id",e+"_elementform_id_temp"),U.setAttribute("name",e+"_elementform_id_temp"),U.setAttribute("value",l),U.setAttribute("title",d),U.setAttribute("placeholder",d),"yes"==p&&U.setAttribute("readonly","readonly"),U.setAttribute("onKeyPress","return check_isnum(event)");var F=document.createElement("label");F.setAttribute("class","mini_label"),F.setAttribute("id",e+"_mini_label_dollars");var R=document.getElementById("show_table");B.appendChild(D),B.appendChild(P),Q.appendChild(E),L.appendChild(O),z.appendChild(U),M.appendChild(L),M.appendChild(z),q.appendChild(K),H.appendChild(F),T.appendChild(M),Q.appendChild(w),Q.appendChild(g),Q.appendChild(A),Q.appendChild(j),Q.appendChild(x),Q.appendChild(T),I.appendChild(B),I.appendChild(Q),k.appendChild(I),R.appendChild(k),jQuery("#main_div").append("<br>"+form_maker.type_price_description),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_text")}function create_paypal_select_options(e,t,i,a,l){var d=jQuery('<label class="fm-field-label">Options</label>'),_=jQuery('<button id="el_choices_add" class="fm-add-option button-secondary" onClick="add_choise_price(\'select\', '+e+'); return false;" title="Add option"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>Option</button>');if(form_maker.is_demo)var r=jQuery('<button class="fm-add-option button-secondary" onClick="alert(\'This feature is disabled in demo.\')" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');else r=jQuery("<button class=\"fm-add-option button-secondary\" onClick=\"tb_show('', 'admin-ajax.php?action=select_data_from_db&nonce="+fm_ajax.ajaxnonce+"&field_id="+e+'&field_type=paypal_select&width=530&height=370&TB_iframe=1\'); return false;" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');var o=jQuery('<div class="fm-width-100 error">IMPORTANT! Check the "Empty value" checkbox only if you want the option to be considered as empty.</div>'),m=jQuery('<div id="choices" class="fm-width-100 ui-sortable"></div>'),s=jQuery('<div class="fm-width-100"><div class="fm-header-label fm-width-40">Product name</div><div class="fm-header-label fm-width-20">Price</div><div class="fm-header-label fm-width-20">Empty value</div><div class="fm-header-label fm-width-10">Delete</div><div class="fm-header-label fm-width-10">Move</div></div>');for(m.append(s),n=t.length,j=0;j<n;j++){var u=jQuery('<div id="'+j+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice" id="el_option'+j+'" value="'+t[j].replace(/"/g,"&quot;")+'" onKeyUp="change_label_price(\''+e+"_option"+j+"', this.value)\""+(i[j]?' disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-20"><input type="text" class="fm-field-choice" id="el_option_price'+j+'" value="'+a[j]+'" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\''+e+"_option"+j+"', this.value)\""+(i[j]?' disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-20"><input type="hidden" id="el_option_params'+j+'" value="'+i[j]+'" /><input type="checkbox" title="Empty value" class="el_option_dis" id="el_option'+j+'_dis" onClick="dis_option_price('+e+","+j+', this.checked)"'+(l[j]?' checked="checked"':"")+' /></div><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_option'+j+'_remove" onClick="remove_option_price('+j+","+e+')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');m.append(u)}var c=d;return create_option_container(null,c=(c=(c=(c=c.add(_)).add(r)).add(m)).add(o))}function create_payment_quantity(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_quantity">Quantity property</label>'),jQuery('<input type="checkbox" id="el_quantity" value="yes" onchange="add_quantity('+e+","+t+')"'+("yes"==i?' checked="checked"':"")+" />"))}function add_quantity(e,t){if(div_=document.getElementById(e+"_divform_id_temp"),""==form_maker_getElementsByAttribute(div_,"*","id",e+"_element_quantityform_id_temp")){select_=document.createElement("input"),select_.setAttribute("type","text"),select_.setAttribute("value",t),select_.setAttribute("id",e+"_element_quantityform_id_temp"),select_.setAttribute("name",e+"_element_quantityform_id_temp"),select_.setAttribute("onKeyPress","return check_isnum(event)"),select_.style.cssText="width:30px; margin:2px 0px";var i=document.createElement("label");i.innerHTML="\x3c!--repstart--\x3eQuantity\x3c!--repend--\x3e",i.style.cssText="margin-right:5px",i.setAttribute("class","mini_label"),i.setAttribute("id",e+"_element_quantity_label_form_id_temp");var a=document.createElement("span");a.style.cssText="margin-right:15px",a.setAttribute("id",e+"_element_quantity_spanform_id_temp"),a.appendChild(i),a.appendChild(select_),div_.firstChild?div_.insertBefore(a,div_.firstChild):div_.appendChild(a)}else div_.removeChild(document.getElementById(e+"_element_quantity_spanform_id_temp"))}function create_payment_property(e){var t=jQuery('<label class="fm-field-label">Product properties</label>'),i=jQuery("<a class=\"thickbox-preview\" onClick=\"tb_show('', 'admin-ajax.php?action=product_option&nonce="+fm_ajax.ajaxnonce+"&field_id="+e+'&width=530&height=370&TB_iframe=1\')"><span class="fm-add-attribute dashicons dashicons-plus-alt" title="Add"></span></a>'),a=jQuery('<ul id="option_ul" class="fm-width-100"></ul>'),n=t;return create_option_container(null,n=(n=n.add(i)).add(a))}function add_choise_price(e,t){var i=0;document.getElementById(t+"_hor")&&(i=1,flow_ver(t));var a=0;if(jQuery(".change_pos").each(function(){var e=parseInt(jQuery(this)[0].id);a=a<e?e:a}),a+=1,"radio"==e||"checkbox"==e){element="input";var n=document.getElementById(t+"_table_little"),l=document.createElement("div");l.setAttribute("id",t+"_element_tr"+a),l.style.display="table-row";var d=document.createElement("div");d.setAttribute("valign","top"),d.setAttribute("id",t+"_td_little"+a),d.setAttribute("idi",a),d.style.display="table-cell";var _=document.createElement(element);_.setAttribute("type",e),_.setAttribute("value",""),_.setAttribute("id",t+"_elementform_id_temp"+a),"right"==document.getElementById(t+"_option_left_right").value&&(_.style.cssText="float: left !important"),"checkbox"==e&&(_.setAttribute("onClick","set_checked('"+t+"','"+a+"','form_id_temp')"),_.setAttribute("name",t+"_elementform_id_temp"+a)),"radio"==e&&(_.setAttribute("onClick","set_default('"+t+"','"+a+"','form_id_temp')"),_.setAttribute("name",t+"_elementform_id_temp"));var r=document.createElement("label");r.setAttribute("id",t+"_label_element"+a),r.setAttribute("class","ch-rad-label"),r.setAttribute("for",t+"_elementform_id_temp"+a),"right"==document.getElementById(t+"_option_left_right").value&&(r.style.cssText="float: none !important");var o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("id",t+"_elementlabel_form_id_temp"+a),o.setAttribute("name",t+"_elementform_id_temp"+a+"_label"),o.setAttribute("value",""),d.appendChild(_),d.appendChild(r),d.appendChild(o),l.appendChild(d),n.appendChild(l);var m=jQuery("#choices"),s=jQuery('<div id="'+a+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-60"><input type="text" class="fm-field-choice" id="el_choices'+a+'" value="" onKeyUp="change_label(\''+t+"_label_element"+a+"', this.value); change_label_1('"+t+"_elementlabel_form_id_temp"+a+'\', this.value);" /></div><div class="fm-table-col fm-width-20"><input type="text" class="fm-field-choice" id="el_option_price'+a+'" value="" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\''+t+"_elementform_id_temp"+a+'\', this.value)" /></div><input type="hidden" id="el_option_params'+a+'" value="" /><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_option'+a+'_remove" onClick="remove_choise_price('+a+","+t+')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');m.append(s),refresh_attr(t,"type_checkbox")}if("select"==e){var u=document.getElementById(t+"_elementform_id_temp"),c=document.createElement("option");c.setAttribute("id",t+"_option"+a),u.appendChild(c);m=jQuery("#choices"),s=jQuery('<div id="'+a+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-40"><input type="text" class="fm-field-choice" id="el_option'+a+'" value="" onKeyUp="change_label_price(\''+t+"_option"+a+'\', this.value)" /></div><div class="fm-table-col fm-width-20"><input type="text" class="fm-field-choice" id="el_option_price'+a+'" value="" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\''+t+"_option"+a+'\', this.value)" /></div><div class="fm-table-col fm-width-20"><input type="hidden" id="el_option_params'+a+'" value="" /><input type="checkbox" title="Empty value" class="el_option_dis" id="el_option'+a+'_dis" onClick="dis_option_price('+t+","+a+', this.checked)" /></div><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_option'+a+'_remove" onClick="remove_option_price('+a+","+t+')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');m.append(s)}1==i&&flow_hor(t)}function flow_hor(e){for(tbody=document.getElementById(e+"_table_little"),td_array=new Array,n=tbody.childNodes.length,k=0;k<n;k++)td_array[k]=tbody.childNodes[k].childNodes[0];for(k=0;k<n;k++)tbody.removeChild(tbody.childNodes[0]);var t=document.createElement("div");for(t.style.display="table-row",t.setAttribute("id",e+"_hor"),tbody.appendChild(t),k=0;k<n;k++)t.appendChild(td_array[k])}function flow_ver(e){for(tbody=document.getElementById(e+"_table_little"),tr=document.getElementById(e+"_hor"),td_array=new Array,n=tr.childNodes.length,k=0;k<n;k++)td_array[k]=tr.childNodes[k];for(tbody.removeChild(tr),k=0;k<n;k++){var t=document.createElement("div");t.setAttribute("id",e+"_element_tr"+td_array[k].getAttribute("idi")),t.style.display="table-row",t.appendChild(td_array[k]),tbody.appendChild(t)}}function change_label_price(e,t){document.getElementById(e).innerHTML=t}function change_value_price(e,t){document.getElementById(e).value=t}function dis_option_price(e,t,i){document.getElementById(e+"_option"+t).value=i?"":document.getElementById("el_option_price"+t).value}function remove_option_price(e,t){var i=document.getElementById(t+"_elementform_id_temp"),a=document.getElementById(t+"_option"+e);i.removeChild(a);var n=document.getElementById("choices"),l=document.getElementById(e);n.removeChild(l)}function add_properties(e,t,a){for(n=t.length,i=0;i<n;i++){for(select_=document.createElement("select"),select_.setAttribute("id",e+"_propertyform_id_temp"+i),select_.setAttribute("name",e+"_propertyform_id_temp"+i),select_.style.cssText="width:auto; margin:2px 0px",k=0;k<a[i].length;k++){var l=document.createElement("option");l.setAttribute("id",e+"_"+i+"_option"+k),l.setAttribute("value",a[i][k]),l.innerHTML=a[i][k],select_.appendChild(l)}var d=document.createElement("label");d.innerHTML=t[i],d.style.cssText="margin-right:5px",d.setAttribute("class","mini_label"),d.setAttribute("id",e+"_property_label_form_id_temp"+i);var _=document.createElement("span");_.style.cssText="margin-right:15px",_.setAttribute("id",e+"_property_"+i),div_=document.getElementById(e+"_divform_id_temp"),_.appendChild(d),_.appendChild(select_),div_.appendChild(_);var r=document.createElement("li");r.setAttribute("id","property_li_"+i);var o=document.createElement("label");o.innerHTML=t[i],o.setAttribute("id","label_property_"+i),o.style.cssText="font-weight:bold; font-size: 13px";var m=document.createElement("a");m.setAttribute("onclick","tb_show('', 'admin-ajax.php?action=product_option&nonce="+fm_ajax.ajaxnonce+"&field_id="+e+"&property_id="+i+"&width=530&height=370&TB_iframe=1')"),m.setAttribute("class","thickbox-preview");var s=document.createElement("span");s.setAttribute("class","fm-edit-attribute fm-ico-edit"),m.appendChild(s);var u=document.createElement("span");u.setAttribute("class","fm-remove-attribute dashicons dashicons-dismiss"),u.setAttribute("onClick","remove_property("+e+","+i+")"),ul_=document.getElementById("option_ul"),r.appendChild(o),r.appendChild(m),r.appendChild(u),ul_.appendChild(r)}}function remove_property(e,t){property_=document.getElementById(e+"_property_"+t),property_.parentNode.removeChild(property_),property_li_=document.getElementById("property_li_"+t),property_li_.parentNode.removeChild(property_li_)}function go_to_type_paypal_select(e){w_choices=["Select product","product 1","product 2"],w_choices_price=["","100","200"],w_choices_checked=["1","0","0"],w_choices_params=["","",""],w_choices_disabled=[!0,!1,!1],w_attr_name=[],w_attr_value=[],w_property=[],w_property_values=[],type_paypal_select(e,"Select Product","","top","no","",w_choices,w_choices_price,w_choices_checked,"no","no","1","wdform_select",w_attr_name,w_attr_value,w_choices_disabled,w_property,w_property_values,w_choices_params)}function type_paypal_select(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v){jQuery("#element_type").val("type_paypal_select"),delete_last_child();var w=jQuery("#edit_table"),g=jQuery('<div id="edit_div"></div>');w.append(g);var E=jQuery('<div id="edit_main_table"></div>');g.append(E),E.append(create_field_type("type_paypal_select")),E.append(create_label(i,e)),E.append(create_label_position(i,a)),E.append(create_hide_label(i,l)),E.append(create_required(i,m)),E.append(create_field_size(i,d)),E.append(create_paypal_select_options(i,_,v,r,y));var A=jQuery('<div class="inside"></div>');E.append(create_advanced_options_container(A)),A.append(create_payment_quantity(i,u,s)),A.append(create_payment_property(i)),A.append(create_field_label_size(i,t)),A.append(create_class(i,c)),A.append(create_additional_attributes(i,p,"type_paypal_select"));var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value","type_paypal_select"),x.setAttribute("name",i+"_typeform_id_temp"),x.setAttribute("id",i+"_typeform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",m),k.setAttribute("name",i+"_requiredform_id_temp"),k.setAttribute("id",i+"_requiredform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",l),I.setAttribute("name",i+"_hide_labelform_id_temp"),I.setAttribute("id",i+"_hide_labelform_id_temp");var C=document.createElement("div");C.setAttribute("id","main_div");var B=document.createElement("div");B.setAttribute("id",i+"_elemet_tableform_id_temp");var Q="yes"==l?"none":"table-cell",T=document.createElement("div");T.setAttribute("align","left"),T.style.display=Q,T.style.width=t+"px",T.setAttribute("id",i+"_label_sectionform_id_temp");var M=document.createElement("div");M.setAttribute("align","left"),M.style.display="table-cell",M.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var L=document.createElement("br"),z=(document.createElement("br"),document.createElement("div"));z.setAttribute("id",i+"_table_little"),z.style.display="table";var q=document.createElement("div");q.setAttribute("id",i+"_element_tr1"),q.style.display="table-row";var H=document.createElement("div");H.setAttribute("id",i+"_element_tr2"),H.style.display="table-row";var N=document.createElement("div");N.setAttribute("valign","top"),N.setAttribute("id",i+"_td_little1"),N.style.display="table-cell";var S=document.createElement("div");S.setAttribute("valign","top"),S.setAttribute("id",i+"_td_little2"),S.style.display="table-cell";var D=document.createElement("span");D.setAttribute("id",i+"_element_labelform_id_temp"),D.innerHTML=e,D.setAttribute("class","label"),D.style.verticalAlign="top";var P=document.createElement("span");P.setAttribute("id",i+"_required_elementform_id_temp"),P.innerHTML="",P.setAttribute("class","required"),P.style.verticalAlign="top","yes"==m&&(P.innerHTML=" *");var O=document.createElement("select");for(O.setAttribute("id",i+"_elementform_id_temp"),O.setAttribute("name",i+"_elementform_id_temp"),O.style.cssText="width:"+d+"px",O.setAttribute("onchange","set_select(this)"),n=_.length,j=0;j<n;j++){var K=document.createElement("option");K.setAttribute("id",i+"_option"+j),y[j]?K.value="":K.setAttribute("value",r[j]),v[j]&&(w_params=v[j].split("[where_order_by]"),K.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),K.setAttribute("order_by",w_params[0]),K.setAttribute("db_info",w_params[1])),K.setAttribute("onselect","set_select('"+i+"_option"+j+"')"),K.innerHTML=_[j].replace(/"/g,"&quot;"),1==o[j]&&K.setAttribute("selected","selected"),O.appendChild(K)}var U=document.createElement("div");U.setAttribute("id",i+"_divform_id_temp");var F=document.getElementById("show_table");T.appendChild(D),T.appendChild(P),M.appendChild(x),M.appendChild(k),M.appendChild(I),M.appendChild(O),M.appendChild(U),B.appendChild(T),B.appendChild(M),C.appendChild(B),C.appendChild(L),F.appendChild(C),jQuery("#main_div").append(form_maker.type_payment_select_description),"top"==a&&label_top(i),"yes"==s&&add_quantity(i,u),change_class(c,i),refresh_attr(i,"type_text"),add_properties(i,h,b),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_paypal_fields(i,"select")}})})}function refresh_paypal_fields(d,_){if("radio"==_||"checkbox"==_){var r=document.getElementById(d+"_table_little");r.innerHTML="",jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id,t=document.createElement("div");t.setAttribute("id",d+"_element_tr"+e),t.style.display="table-row";var i=document.createElement("div");i.setAttribute("valign","top"),i.setAttribute("id",d+"_td_little"+e),i.setAttribute("idi",e),i.style.display="table-cell";var a=document.createElement("input");a.setAttribute("type",_),a.setAttribute("id",d+"_elementform_id_temp"+e),a.setAttribute("value",jQuery(this).find(jQuery("#el_option_price"+e))[0].value),"checkbox"==_&&(a.setAttribute("onClick","set_checked('"+d+"','"+e+"','form_id_temp')"),a.setAttribute("name",d+"_elementform_id_temp"+e)),"radio"==_&&(a.setAttribute("onClick","set_default('"+d+"','"+e+"','form_id_temp')"),a.setAttribute("name",d+"_elementform_id_temp"));var n=document.createElement("label");n.setAttribute("id",d+"_label_element"+e),n.setAttribute("class","ch-rad-label"),n.setAttribute("for",d+"_elementform_id_temp"+e),n.innerHTML=jQuery(this).find(jQuery("#el_choices"+e))[0].value,jQuery(this).find(jQuery(".el_option_params")).val()&&(w_params=jQuery(this).find(jQuery(".el_option_params")).val().split("[where_order_by]"),n.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),n.setAttribute("order_by",w_params[0]),n.setAttribute("db_info",w_params[1]));var l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("id",d+"_elementlabel_form_id_temp"+e),l.setAttribute("name",d+"_elementform_id_temp"+e+"_label"),l.setAttribute("value",jQuery(this).find(jQuery("#el_choices"+e))[0].value),i.appendChild(a),i.appendChild(n),i.appendChild(l),t.appendChild(i),r.appendChild(t)}),document.getElementById("edit_for_flow_horizontal").checked&&flow_hor(d)}if("select"==_){var i=document.getElementById(d+"_elementform_id_temp");i.innerHTML="",jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id,t=document.createElement("option");t.setAttribute("id",d+"_option"+e),jQuery(this).find(jQuery("input[type='checkbox']")).prop("checked")?t.value="":t.setAttribute("value",jQuery(this).find(jQuery("#el_option_price"+e))[0].value),jQuery(this).find(jQuery(".el_option_params")).val()&&(w_params=jQuery(this).find(jQuery(".el_option_params")).val().split("[where_order_by]"),t.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),t.setAttribute("order_by",w_params[0]),t.setAttribute("db_info",w_params[1])),t.setAttribute("onselect","set_select('"+d+"_option"+e+"')"),t.innerHTML=jQuery(this).find(jQuery("#el_option"+e))[0].value,i.appendChild(t)})}}function create_payment_relative_position(e,t,i){var a=jQuery('<label class="fm-field-label">Relative Position</label>'),n=jQuery('<input type="radio" id="edit_for_flow_vertical" name="edit_for_flow" value="ver" onchange="flow_ver('+e+')"'+("hor"==t?"":' checked="checked"')+" />"),l=jQuery('<label for="edit_for_flow_vertical">Vertical</label>'),d=jQuery('<input type="radio" id="edit_for_flow_horizontal" name="edit_for_flow" value="hor" onchange="flow_hor('+e+',)"'+("hor"==t?' checked="checked"':"")+" />"),_=jQuery('<label for="edit_for_flow_horizontal">Horizontal</label>'),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function create_paypal_radio_options(e,t,i,a,l){var d=jQuery('<label class="fm-field-label">Options</label>'),_=jQuery('<button id="el_choices_add" class="fm-add-option button-secondary" onClick="add_choise_price(\''+l+"', "+e+'); return false;" title="Add option"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>Option</button>');if(form_maker.is_demo)var r=jQuery('<button class="fm-add-option button-secondary" onClick="alert(\'This feature is disabled in demo.\')" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');else r=jQuery("<button class=\"fm-add-option button-secondary\" onClick=\"tb_show('', 'admin-ajax.php?action=select_data_from_db&field_id="+e+"&nonce="+fm_ajax.ajaxnonce+"&field_type=paypal_"+l+'&width=530&height=370&TB_iframe=1\'); return false;" title="Add options from database"><span class="field-type-button fm-add-attribute dashicons dashicons-plus-alt"></span>From Database</button>');var o=jQuery('<div id="choices" class="fm-width-100 ui-sortable"></div>'),m=jQuery('<div class="fm-width-100"><div class="fm-header-label fm-width-60">Product name</div><div class="fm-header-label fm-width-20">Price</div><div class="fm-header-label fm-width-10">Delete</div><div class="fm-header-label fm-width-10">Move</div></div>');for(o.append(m),n=t.length,j=0;j<n;j++){var s=jQuery('<div id="'+j+'" class="change_pos fm-width-100"><div class="fm-table-col fm-width-60"><input type="text" class="fm-field-choice" id="el_choices'+j+'" value="'+t[j].replace(/"/g,"&quot;")+'" onKeyUp="change_label(\''+e+"_label_element"+j+"', this.value); change_label_1('"+e+"_elementlabel_form_id_temp"+j+"', this.value);\""+(i[j]?' disabled="disabled"':"")+' /></div><div class="fm-table-col fm-width-20"><input type="text" class="fm-field-choice" id="el_option_price'+j+'" value="'+a[j]+'" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\''+e+"_elementform_id_temp"+j+"', this.value)\""+(i[j]?' disabled="disabled"':"")+' /></div><input type="hidden" id="el_option_params'+j+'" value="'+i[j]+'" /><div class="fm-table-col fm-width-10"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_option'+j+'_remove" onClick="remove_choise_price('+j+","+e+')"></span></div><div class="fm-table-col fm-width-10"><span class="fm-move-attribute fm-ico-draggable el_choices_sortable"></span></div></div>');o.append(s)}var u=d;return create_option_container(null,u=(u=(u=u.add(_)).add(r)).add(o))}function change_label_1(e,t){document.getElementById(e).value=t}function remove_choise_price(e,t){var i=0;document.getElementById(t+"_hor")&&(i=1,flow_ver(t));var a=document.getElementById(t+"_table_little"),n=document.getElementById(t+"_element_tr"+e);a.removeChild(n);var l=document.getElementById("choices"),d=document.getElementById(e);l.removeChild(d),1==i&&flow_hor(t)}function go_to_type_paypal_radio(e){w_choices=["product 1","product 2"],w_choices_price=["100","200"],w_choices_checked=["0","0"],w_choices_params=["","",""],w_attr_name=[],w_attr_value=[],w_property=[],w_property_values=[],type_paypal_radio(e,"Payment Single Choice","","top","right","no","ver",w_choices,w_choices_price,w_choices_checked,"no","no","no","0","",w_attr_name,w_attr_value,w_property,w_property_values,"no","1",w_choices_params)}function type_paypal_radio(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v,w,g,E){jQuery("#element_type").val("type_paypal_radio"),delete_last_child();var A=jQuery("#edit_table"),x=jQuery('<div id="edit_div"></div>');A.append(x);var k=jQuery('<div id="edit_main_table"></div>');x.append(k),k.append(create_field_type("type_paypal_radio")),k.append(create_label(i,e)),k.append(create_label_position(i,a)),k.append(create_hide_label(i,d)),k.append(create_required(i,s)),k.append(create_payment_relative_position(i,_,"radio")),k.append(create_option_label_position(i,l,"radio")),k.append(create_paypal_radio_options(i,r,E,o,"radio"));var I=jQuery('<div class="inside"></div>');k.append(create_advanced_options_container(I)),I.append(create_payment_quantity(i,g,w)),I.append(create_payment_property(i)),I.append(create_field_label_size(i,t)),I.append(create_class(i,f)),I.append(create_additional_attributes(i,y,"type_paypal_radio"));var C=document.createElement("br"),B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value","type_paypal_radio"),B.setAttribute("name",i+"_typeform_id_temp"),B.setAttribute("id",i+"_typeform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",s),Q.setAttribute("name",i+"_requiredform_id_temp"),Q.setAttribute("id",i+"_requiredform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",d),T.setAttribute("name",i+"_hide_labelform_id_temp"),T.setAttribute("id",i+"_hide_labelform_id_temp");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",u),M.setAttribute("name",i+"_randomizeform_id_temp"),M.setAttribute("id",i+"_randomizeform_id_temp");var L=document.createElement("input");L.setAttribute("type","hidden"),L.setAttribute("value",c),L.setAttribute("name",i+"_allow_otherform_id_temp"),L.setAttribute("id",i+"_allow_otherform_id_temp");var z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",l),z.setAttribute("id",i+"_option_left_right");var q=document.createElement("div");q.setAttribute("id","main_div");var H=document.createElement("div");H.setAttribute("id",i+"_elemet_tableform_id_temp");var N="yes"==d?"none":"table-cell",S=document.createElement("div");S.setAttribute("align","left"),S.style.display=N,S.style.width=t+"px",S.setAttribute("id",i+"_label_sectionform_id_temp");var D=document.createElement("div");D.setAttribute("align","left"),D.style.display="table-cell",D.setAttribute("id",i+"_element_sectionform_id_temp");var P=document.createElement("div");P.style.display="table";var O=document.createElement("div");O.setAttribute("id",i+"_table_little"),O.style.display="table-row-group",P.appendChild(O);var K=document.createElement("div");K.setAttribute("id",i+"_element_tr1"),K.style.display="table-row";var U=document.createElement("div");U.setAttribute("id",i+"_element_tr2"),U.style.display="table-row";var F=document.createElement("div");F.setAttribute("valign","top"),F.setAttribute("id",i+"_td_little1"),F.style.display="table-cell";var R=document.createElement("div");R.setAttribute("valign","top"),R.setAttribute("id",i+"_td_little2"),R.style.display="table-cell";var W=document.createElement("span");W.setAttribute("id",i+"_element_labelform_id_temp"),W.innerHTML=e,W.setAttribute("class","wd_form_label"),W.style.verticalAlign="top";var V=document.createElement("span");for(V.setAttribute("id",i+"_required_elementform_id_temp"),V.innerHTML="",V.setAttribute("class","required"),V.style.verticalAlign="top","yes"==s&&(V.innerHTML=" *"),n=r.length,j=0;j<n;j++){var $=document.createElement("div");$.setAttribute("id",i+"_element_tr"+j),$.style.display="table-row";var G=document.createElement("div");G.setAttribute("valign","top"),G.setAttribute("id",i+"_td_little"+j),G.setAttribute("idi",j),G.style.display="table-cell";var Y=document.createElement("input");Y.setAttribute("type","radio"),Y.setAttribute("id",i+"_elementform_id_temp"+j),Y.setAttribute("name",i+"_elementform_id_temp"),Y.setAttribute("value",o[j]),"right"==l&&(Y.style.cssText="float: left !important"),Y.setAttribute("onclick","set_default('"+i+"','"+j+"','form_id_temp')"),"1"==m[j]&&Y.setAttribute("checked","checked");var Z=document.createElement("label");Z.setAttribute("id",i+"_label_element"+j),Z.setAttribute("class","ch-rad-label"),Z.setAttribute("for",i+"_elementform_id_temp"+j),Z.innerHTML=r[j].replace(/"/g,"&quot;"),"right"==l&&(Z.style.cssText="float: none !important"),E[j]&&(w_params=E[j].split("[where_order_by]"),Z.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),Z.setAttribute("order_by",w_params[0]),Z.setAttribute("db_info",w_params[1]));var X=document.createElement("input");X.setAttribute("type","hidden"),X.setAttribute("id",i+"_elementlabel_form_id_temp"+j),X.setAttribute("name",i+"_elementform_id_temp"+j+"_label"),X.setAttribute("value",r[j].replace(/"/g,"&quot;")),G.appendChild(Y),G.appendChild(Z),G.appendChild(X),$.appendChild(G),O.appendChild($)}var J=document.createElement("div");J.setAttribute("id",i+"_divform_id_temp");var ee=document.getElementById("show_table");S.appendChild(W),S.appendChild(V),D.appendChild(B),D.appendChild(Q),D.appendChild(T),D.appendChild(M),D.appendChild(L),D.appendChild(z),D.appendChild(P),D.appendChild(J),H.appendChild(S),H.appendChild(D),q.appendChild(H),q.appendChild(C),ee.appendChild(q),jQuery("#main_div").append(form_maker.type_payment_radio_description),"top"==a&&label_top(i),"hor"==_&&flow_hor(i),"yes"==w&&add_quantity(i,g),change_class(f,i),refresh_attr(i,"type_checkbox"),add_properties(i,b,v),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_paypal_fields(i,"radio")}})})}function go_to_type_paypal_checkbox(e){w_choices=["product 1","product 2"],w_choices_price=["100","200"],w_choices_checked=["0","0"],w_choices_params=["","",""],w_attr_name=[],w_attr_value=[],w_property=[],w_property_values=[],type_paypal_checkbox(e,"Payment Multiple Choice","","top","right","no","ver",w_choices,w_choices_price,w_choices_checked,"no","no","no","0","",w_attr_name,w_attr_value,w_property,w_property_values,"no","1",w_choices_params)}function type_paypal_checkbox(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v,w,g,E){jQuery("#element_type").val("type_paypal_checkbox"),delete_last_child();var A=jQuery("#edit_table"),x=jQuery('<div id="edit_div"></div>');A.append(x);var k=jQuery('<div id="edit_main_table"></div>');x.append(k),k.append(create_field_type("type_paypal_checkbox")),k.append(create_label(i,e)),k.append(create_label_position(i,a)),k.append(create_hide_label(i,d)),k.append(create_required(i,s)),k.append(create_payment_relative_position(i,_,"checkbox")),k.append(create_option_label_position(i,l,"checkbox")),k.append(create_paypal_radio_options(i,r,E,o,"checkbox"));var I=jQuery('<div class="inside"></div>');k.append(create_advanced_options_container(I)),I.append(create_payment_quantity(i,g,w)),I.append(create_payment_property(i)),I.append(create_field_label_size(i,t)),I.append(create_class(i,f)),I.append(create_additional_attributes(i,y,"type_paypal_checkbox")),element="input",type="checkbox";var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value","type_paypal_checkbox"),C.setAttribute("name",i+"_typeform_id_temp"),C.setAttribute("id",i+"_typeform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",s),B.setAttribute("name",i+"_requiredform_id_temp"),B.setAttribute("id",i+"_requiredform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",d),Q.setAttribute("name",i+"_hide_labelform_id_temp"),Q.setAttribute("id",i+"_hide_labelform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",u),T.setAttribute("name",i+"_randomizeform_id_temp"),T.setAttribute("id",i+"_randomizeform_id_temp");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",c),M.setAttribute("name",i+"_allow_otherform_id_temp"),M.setAttribute("id",i+"_allow_otherform_id_temp");var L=document.createElement("input");L.setAttribute("type","hidden"),L.setAttribute("value",p),L.setAttribute("name",i+"_allow_other_numform_id_temp"),L.setAttribute("id",i+"_allow_other_numform_id_temp");var z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",l),z.setAttribute("id",i+"_option_left_right");var q=document.createElement("div");q.setAttribute("id","main_div");var H=document.createElement("div");H.setAttribute("id",i+"_elemet_tableform_id_temp");var N="yes"==d?"none":"table-cell",S=document.createElement("div");S.setAttribute("align","left"),S.style.display=N,S.style.width=t+"px",S.setAttribute("id",i+"_label_sectionform_id_temp");var D=document.createElement("div");D.setAttribute("align","left"),D.style.display="table-cell",D.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var P=document.createElement("br"),O=(document.createElement("br"),document.createElement("div"));O.style.display="table";var K=document.createElement("div");K.setAttribute("id",i+"_table_little"),K.style.display="table-row-group",O.appendChild(K);var U=document.createElement("span");U.setAttribute("id",i+"_element_labelform_id_temp"),U.innerHTML=e,U.setAttribute("class","label"),U.style.verticalAlign="top";var F=document.createElement("span");for(F.setAttribute("id",i+"_required_elementform_id_temp"),F.innerHTML="",F.setAttribute("class","required"),F.style.verticalAlign="top","yes"==s&&(F.innerHTML=" *"),n=r.length,j=0;j<n;j++){var R=document.createElement("div");R.setAttribute("id",i+"_element_tr"+j),R.style.display="table-row";var W=document.createElement("div");W.setAttribute("valign","top"),W.setAttribute("id",i+"_td_little"+j),W.setAttribute("idi",j),W.style.display="table-cell";var V=document.createElement(element);V.setAttribute("type",type),V.setAttribute("id",i+"_elementform_id_temp"+j),V.setAttribute("name",i+"_elementform_id_temp"+j),V.setAttribute("value",o[j]),"right"==l&&(V.style.cssText="float: left !important"),"yes"==c&&j==p?(V.setAttribute("other","1"),V.setAttribute("onclick","if(set_checked('"+i+"','"+j+"','form_id_temp')) show_other_input('"+i+"','form_id_temp');")):V.setAttribute("onclick","set_checked('"+i+"','"+j+"','form_id_temp')"),"1"==m[j]&&V.setAttribute("checked","checked");var $=document.createElement("label");$.setAttribute("id",i+"_label_element"+j),$.setAttribute("class","ch-rad-label"),$.setAttribute("for",i+"_elementform_id_temp"+j),$.innerHTML=r[j].replace(/"/g,"&quot;"),"right"==l&&($.style.cssText="float: none !important"),E[j]&&(w_params=E[j].split("[where_order_by]"),$.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),$.setAttribute("order_by",w_params[0]),$.setAttribute("db_info",w_params[1]));var G=document.createElement("input");G.setAttribute("type","hidden"),G.setAttribute("id",i+"_elementlabel_form_id_temp"+j),G.setAttribute("name",i+"_elementform_id_temp"+j+"_label"),G.setAttribute("value",r[j].replace(/"/g,"&quot;")),W.appendChild(V),W.appendChild($),W.appendChild(G),R.appendChild(W),K.appendChild(R)}var Y=document.createElement("div");Y.setAttribute("id",i+"_divform_id_temp");var Z=document.getElementById("show_table");S.appendChild(U),S.appendChild(F),D.appendChild(C),D.appendChild(B),D.appendChild(Q),D.appendChild(T),D.appendChild(M),D.appendChild(L),D.appendChild(z),D.appendChild(O),D.appendChild(Y),H.appendChild(S),H.appendChild(D),q.appendChild(H),q.appendChild(P),Z.appendChild(q),jQuery("#main_div").append(form_maker.type_payment_checkbox_description),"top"==a&&label_top(i),"hor"==_&&flow_hor(i),change_class(f,i),refresh_attr(i,"type_checkbox"),"yes"==w&&add_quantity(i,g),add_properties(i,b,v),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_paypal_fields(i,"checkbox")}})})}function go_to_type_paypal_shipping(e){w_choices=["type 1","type 2"],w_choices_price=["100","200"],w_choices_checked=["0","0"],w_choices_params=["","",""],w_attr_name=[],w_attr_value=[],w_property=[],w_property_values=[],type_paypal_shipping(e,"Shipping","","top","right","no","ver",w_choices,w_choices_price,w_choices_checked,"no","no","no","0","",w_attr_name,w_attr_value,w_property,w_property_values,w_choices_params)}function type_paypal_shipping(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v,w){jQuery("#element_type").val("type_paypal_shipping"),delete_last_child();var g=jQuery("#edit_table"),E=jQuery('<div id="edit_div"></div>');g.append(E);var A=jQuery('<div id="edit_main_table"></div>');E.append(A),A.append(create_field_type("type_paypal_shipping")),A.append(create_label(i,e)),A.append(create_label_position(i,a)),A.append(create_hide_label(i,d)),A.append(create_required(i,s)),A.append(create_payment_relative_position(i,_,"radio")),A.append(create_option_label_position(i,l,"radio")),A.append(create_paypal_radio_options(i,r,w,o,"radio"));var x=jQuery('<div class="inside"></div>');A.append(create_advanced_options_container(x)),x.append(create_field_label_size(i,t)),x.append(create_class(i,f)),x.append(create_additional_attributes(i,y,"type_paypal_shipping")),element="input",type="radio";var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value","type_paypal_shipping"),k.setAttribute("name",i+"_typeform_id_temp"),k.setAttribute("id",i+"_typeform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",i+"_requiredform_id_temp"),I.setAttribute("id",i+"_requiredform_id_temp");var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value",d),C.setAttribute("name",i+"_hide_labelform_id_temp"),C.setAttribute("id",i+"_hide_labelform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",u),B.setAttribute("name",i+"_randomizeform_id_temp"),B.setAttribute("id",i+"_randomizeform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",c),Q.setAttribute("name",i+"_allow_otherform_id_temp"),Q.setAttribute("id",i+"_allow_otherform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",l),T.setAttribute("id",i+"_option_left_right");var M=document.createElement("div");M.setAttribute("id","main_div");var L=document.createElement("div");L.setAttribute("id",i+"_elemet_tableform_id_temp");var z="yes"==d?"none":"table-cell",q=document.createElement("div");q.setAttribute("align","left"),q.style.display=z,q.style.width=t+"px",q.setAttribute("id",i+"_label_sectionform_id_temp");var H=document.createElement("div");H.setAttribute("align","left"),H.style.display="table-cell",H.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var N=document.createElement("br"),S=(document.createElement("br"),document.createElement("div"));S.style.display="table";var D=document.createElement("div");D.setAttribute("id",i+"_table_little"),D.style.display="table-row-group",S.appendChild(D);var P=document.createElement("div");P.setAttribute("id",i+"_element_tr1"),P.style.display="table-row";var O=document.createElement("div");O.setAttribute("id",i+"_element_tr2"),O.style.display="table-row";var K=document.createElement("div");K.setAttribute("valign","top"),K.setAttribute("id",i+"_td_little1"),K.style.display="table-cell";var U=document.createElement("div");U.setAttribute("valign","top"),U.setAttribute("id",i+"_td_little2"),U.style.display="table-cell";var F=document.createElement("span");F.setAttribute("id",i+"_element_labelform_id_temp"),F.innerHTML=e,F.setAttribute("class","label"),F.style.verticalAlign="top";var R=document.createElement("span");for(R.setAttribute("id",i+"_required_elementform_id_temp"),R.innerHTML="",R.setAttribute("class","required"),R.style.verticalAlign="top","yes"==s&&(R.innerHTML=" *"),n=r.length,j=0;j<n;j++){var W=document.createElement("div");W.setAttribute("id",i+"_element_tr"+j),W.style.display="table-row";var V=document.createElement("td");V.setAttribute("valign","top"),V.setAttribute("id",i+"_td_little"+j),V.setAttribute("idi",j),V.style.display="table-cell";var $=document.createElement(element);$.setAttribute("type",type),$.setAttribute("id",i+"_elementform_id_temp"+j),$.setAttribute("name",i+"_elementform_id_temp"),$.setAttribute("value",o[j]),"right"==l&&($.style.cssText="float: left !important"),$.setAttribute("onclick","set_default('"+i+"','"+j+"','form_id_temp')"),"1"==m[j]&&$.setAttribute("checked","checked");var G=document.createElement("label");G.setAttribute("id",i+"_label_element"+j),G.setAttribute("class","ch-rad-label"),G.setAttribute("for",i+"_elementform_id_temp"+j),G.innerHTML=r[j].replace(/"/g,"&quot;"),"right"==l&&(G.style.cssText="float: none !important"),w[j]&&(w_params=w[j].split("[where_order_by]"),G.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),G.setAttribute("order_by",w_params[0]),G.setAttribute("db_info",w_params[1]));var Y=document.createElement("input");Y.setAttribute("type","hidden"),Y.setAttribute("id",i+"_elementlabel_form_id_temp"+j),Y.setAttribute("name",i+"_elementform_id_temp"+j+"_label"),Y.setAttribute("value",r[j].replace(/"/g,"&quot;")),V.appendChild($),V.appendChild(G),V.appendChild(Y),W.appendChild(V),D.appendChild(W)}var Z=document.createElement("div");Z.setAttribute("id",i+"_divform_id_temp");var X=document.getElementById("show_table");q.appendChild(F),q.appendChild(R),H.appendChild(k),H.appendChild(I),H.appendChild(C),H.appendChild(B),H.appendChild(Q),H.appendChild(T),H.appendChild(S),H.appendChild(Z),L.appendChild(q),L.appendChild(H),M.appendChild(L),M.appendChild(N),X.appendChild(M),jQuery("#main_div").append(form_maker.type_shipping_description),"top"==a&&label_top(i),"hor"==_&&flow_hor(i),change_class(f,i),refresh_attr(i,"type_checkbox"),add_properties(i,b,v),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_paypal_fields(i,"radio")}})})}function go_to_type_paypal_total(e){type_paypal_total(e,"Total","","top","no","","")}function type_paypal_total(e,t,i,a,n,l,d){jQuery("#element_type").val("type_paypal_total"),delete_last_child();var _=jQuery("#edit_table"),r=jQuery('<div id="edit_div"></div>');_.append(r);var o=jQuery('<div id="edit_main_table"></div>');r.append(o),o.append(create_field_type("type_paypal_total")),o.append(create_label(e,t)),o.append(create_label_position(e,a)),o.append(create_hide_label(e,n));var m=jQuery('<div class="inside"></div>');o.append(create_advanced_options_container(m)),m.append(create_field_label_size(e,i)),m.append(create_class(e,l));var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("value","type_paypal_total"),s.setAttribute("name",e+"_typeform_id_temp"),s.setAttribute("id",e+"_typeform_id_temp");var u=document.createElement("input");u.setAttribute("type","hidden"),u.setAttribute("value",n),u.setAttribute("name",e+"_hide_labelform_id_temp"),u.setAttribute("id",e+"_hide_labelform_id_temp");var c=document.createElement("div");c.setAttribute("id","main_div");var p=document.createElement("div");p.setAttribute("id",e+"_elemet_tableform_id_temp");var f="yes"==n?"none":"table-cell",y=document.createElement("div");y.setAttribute("align","left"),y.style.display=f,y.style.width=i+"px",y.setAttribute("id",e+"_label_sectionform_id_temp");var h=document.createElement("div");h.setAttribute("align","left"),h.style.display="table-cell",h.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var b=document.createElement("br"),v=(document.createElement("br"),document.createElement("span"));v.setAttribute("id",e+"_element_labelform_id_temp"),v.innerHTML=t,v.setAttribute("class","label");var w=document.createElement("div");w.setAttribute("id",e+"paypal_totalform_id_temp"),w.setAttribute("class","wdform_paypal_total paypal_totalform_id_temp"),w.style.cssText="width:"+d+"px;";var g=document.createElement("div");g.setAttribute("id",e+"div_totalform_id_temp"),g.setAttribute("class","div_totalform_id_temp"),g.style.cssText="margin-bottom:10px;",g.innerHTML="\x3c!--repstart--\x3e$300\x3c!--repend--\x3e";var E=document.createElement("div");E.setAttribute("id",e+"paypal_productsform_id_temp"),E.setAttribute("class","paypal_productsform_id_temp"),E.style.cssText="border-spacing: 2px;";var A=document.createElement("div");A.style.cssText="border-spacing: 2px;",A.innerHTML="\x3c!--repstart--\x3eproduct 1 $100\x3c!--repend--\x3e";var j=document.createElement("div");j.style.cssText="border-spacing: 2px;",j.innerHTML="\x3c!--repstart--\x3eproduct 2 $200\x3c!--repend--\x3e";var x=document.createElement("div");x.style.cssText="border-spacing: 2px; margin-top:7px;",x.setAttribute("id",e+"paypal_taxform_id_temp"),x.setAttribute("class","paypal_taxform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",""),k.setAttribute("name",e+"_paypal_totalform_id_temp"),k.setAttribute("class","input_paypal_totalform_id_temp"),w.appendChild(k),E.appendChild(A),E.appendChild(j),w.appendChild(g),w.appendChild(E),w.appendChild(x);var I=document.getElementById("show_table"),C=k=document.createElement("p");C.style.cssText="color: red;";var B=document.createTextNode("This is sample calculation. On front-end you will see the calculation based on your Payment field values.");C.appendChild(B),y.appendChild(v),h.appendChild(u),h.appendChild(s),h.appendChild(w),p.appendChild(y),p.appendChild(h),c.appendChild(p),c.appendChild(b),c.appendChild(C),I.appendChild(c),jQuery("#main_div").append(form_maker.type_total_description),"top"==a&&label_top(e),change_class(l,e)}function create_map_locations(e){var t=jQuery('<label class="fm-field-label">Location</label>'),i=jQuery('<span class="fm-add-attribute dashicons dashicons-plus-alt" title="Add" onClick="add_marker('+e+', -1)"></span>'),a=jQuery('<div class="notice notice-info"><p>Drag the marker to change default marker position.</p></div>'),n=jQuery('<div id="markers" class="fm-width-100"></div>'),l=t;return create_option_container(null,l=(l=(l=l.add(i)).add(a)).add(n))}function add_marker(e,t,i,a,n){var l=jQuery("#markers");if(-1==t){var d=l.children().last();t=0<d.length?parseInt(d.prop("idi"))+1:0,a=i=null,n=""}var _=jQuery('<div class="fm-width-100 fm-fields-set" id="marker_opt'+t+'" idi="'+t+'"></div>'),r=jQuery('<div class="fm-width-90"></div>');r.append(create_markmap_address(e,t)),r.append(create_markmap_longitude(e,i,t)),r.append(create_markmap_latitude(e,a,t)),r.append(create_markmap_info(e,n,t)),_.append(r);var o=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_map('+e+","+t+')"></span></div>');_.append(o),l.append(_);var m=document.getElementById(e+"_elementform_id_temp");m.setAttribute("long"+t,i),m.setAttribute("lat"+t,a),m.setAttribute("info"+t,n),add_marker_on_map(e,t,i,a,n,!0)}function remove_map(e,t){table=document.getElementById("marker_opt"+t),table.parentNode.removeChild(table),map=document.getElementById(e+"_elementform_id_temp"),map.removeAttribute("long"+t),map.removeAttribute("lat"+t),map.removeAttribute("info"+t),remove_marker(e,t)}function type_map(e,t,i,a,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_map"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('<div id="edit_div"></div>');c.append(p);var f=jQuery('<div id="edit_main_table"></div>');p.append(f),f.append(create_field_type("type_map")),f.append(create_map_locations(e)),f.append(create_markmap_size(e,_,r)),f.append(create_keys(e,"To set up map key click here"));var y=jQuery('<div class="inside"></div>');f.append(create_advanced_options_container(y)),y.append(create_class(e,o)),y.append(create_additional_attributes(e,s,"type_map"));var h=document.createElement("br"),b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_map"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("div");v.setAttribute("id",e+"_elementform_id_temp"),v.style.cssText="width:"+_+"px; height: "+r+"px;",v.setAttribute("zoom",d),v.setAttribute("center_x",t),v.setAttribute("center_y",i);var w=document.createElement("span");w.setAttribute("id",e+"_element_labelform_id_temp"),w.innerHTML="map_"+e,w.style.cssText="display:none";var g=document.createElement("div");g.setAttribute("id","main_div");var E=document.createElement("div");E.setAttribute("id",e+"_elemet_tableform_id_temp");var A=document.createElement("div");A.setAttribute("align","left"),A.style.display="table-cell",A.setAttribute("id",e+"_label_sectionform_id_temp");var x=document.createElement("div");x.setAttribute("align","left"),x.style.display="block",x.setAttribute("id",e+"_element_sectionform_id_temp");var k=document.getElementById("show_table");for(A.appendChild(w),x.appendChild(b),x.appendChild(v),E.appendChild(A),E.appendChild(x),g.appendChild(E),g.appendChild(h),k.appendChild(g),jQuery("#main_div").append(form_maker.type_map_description),change_class(o,e),refresh_attr(e,"type_text"),if_gmap_init(e),n=a.length,j=0;j<n;j++)add_marker(e,j,a[j],l[j],m[j])}function create_time_format(e,t){var i=jQuery('<label class="fm-field-label">Time Format</label>'),a=jQuery('<input type="radio" id="el_label_time_type1" name="edit_for_time_type" value="format_24" onchange="format_24('+e+')"'+("24"==t?' checked="checked"':"")+" />"),n=jQuery('<label for="el_label_time_type1">24 hour</label>'),l=jQuery('<input type="radio" id="el_label_time_type2" name="edit_for_time_type" value="format_12" onchange="format_12('+e+", 'am', '', '', '')\""+("24"==t?"":' checked="checked"')+" />"),d=jQuery('<label for="el_label_time_type2">12 hour</label>'),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function format_24(e){tr_time1=document.getElementById(e+"_tr_time1"),td1=document.getElementById(e+"_am_pm_select"),tr_time2=document.getElementById(e+"_tr_time2"),td2=document.getElementById(e+"_am_pm_label"),tr_time1.removeChild(td1),tr_time2.removeChild(td2),document.getElementById(e+"_hhform_id_temp").value="",document.getElementById(e+"_mmform_id_temp").value="",document.getElementById(e+"_ssform_id_temp")&&(document.getElementById(e+"_ssform_id_temp").value="")}function format_12(t,e,i,a,n){tr_time1=document.getElementById(t+"_tr_time1"),tr_time2=document.getElementById(t+"_tr_time2");var l=document.createElement("div");l.setAttribute("id",t+"_am_pm_select"),l.setAttribute("class","td_am_pm_select"),l.style.display="table-cell";var d=document.createElement("div");d.setAttribute("id",t+"_am_pm_label"),d.setAttribute("class","td_am_pm_select"),d.style.display="table-cell";var _=document.createElement("select");_.setAttribute("class","am_pm_select"),_.setAttribute("name",t+"_am_pmform_id_temp"),_.setAttribute("id",t+"_am_pmform_id_temp"),_.setAttribute("onchange","set_sel_am_pm(this)");var r=document.createElement("option");r.setAttribute("value","am"),r.innerHTML="AM";var o=document.createElement("option");o.setAttribute("value","pm"),o.innerHTML="PM","pm"==e?o.setAttribute("selected","selected"):r.setAttribute("selected","selected");var m=document.createElement("label");m.setAttribute("class","mini_label"),m.setAttribute("id",t+"_mini_label_am_pm"),m.innerHTML=w_mini_labels[3],_.appendChild(r),_.appendChild(o),l.appendChild(_),d.appendChild(m),tr_time1.appendChild(l),tr_time2.appendChild(d),document.getElementById(t+"_hhform_id_temp").value=i,document.getElementById(t+"_mmform_id_temp").value=a,document.getElementById(t+"_ssform_id_temp")&&(document.getElementById(t+"_ssform_id_temp").value=n),refresh_attr(t,"type_time"),jQuery(function(){jQuery("label#"+t+"_mini_label_am_pm").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.am_pm").focus(),jQuery("input.am_pm").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_am_pm").text(e)})}})})}function create_display_seconds(e,t,i){var a=jQuery('<label class="fm-field-label">Display Seconds</label>'),n=jQuery('<input type="radio" id="el_second_yes" name="edit_for_time_second" value="yes" onchange="second_yes('+e+",'"+t+"')\""+("1"==i?' checked="checked"':"")+" />"),l=jQuery('<label for="el_second_yes">Yes</label>'),d=jQuery('<input type="radio" id="el_second_no" name="edit_for_time_second" value="no" onchange="second_no('+e+')"'+("1"==i?"":' checked="checked"')+" />"),_=jQuery('<label for="el_second_no">No</label>'),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function second_yes(t,e){time_box=document.getElementById(t+"_tr_time1"),text_box=document.getElementById(t+"_tr_time2");var i=document.createElement("div");i.setAttribute("align","center"),i.style.display="table-cell";var a=document.createElement("div");a.setAttribute("id",t+"_td_time_input3"),a.style.display="table-cell";var n=document.createElement("div");n.style.display="table-cell";var l=document.createElement("div");l.setAttribute("id",t+"_td_time_label3"),l.style.display="table-cell";var d=document.createElement("span");d.setAttribute("class","wdform_colon"),d.style.cssText="font-style:bold; vertical-align:middle",d.innerHTML="&nbsp;:&nbsp;",i.appendChild(d);var _=document.createElement("input");_.setAttribute("type","text"),_.setAttribute("value",e),_.setAttribute("class","time_box"),_.setAttribute("id",t+"_ssform_id_temp"),_.setAttribute("name",t+"_ssform_id_temp"),_.setAttribute("onBlur","add_0('"+t+"_ssform_id_temp')");var r=document.createElement("label");r.setAttribute("class","mini_label"),r.innerHTML="SS",r.setAttribute("id",t+"_mini_label_ss"),a.appendChild(_),l.appendChild(r),document.getElementById(t+"_am_pm_select")?(select_=document.getElementById(t+"_am_pm_select"),select_text=document.getElementById(t+"_am_pm_label"),time_box.insertBefore(a,select_),time_box.insertBefore(i,a),text_box.insertBefore(l,select_text),text_box.insertBefore(n,l)):(time_box.appendChild(i),time_box.appendChild(a),text_box.appendChild(n),text_box.appendChild(l)),jQuery(function(){jQuery("label#"+t+"_mini_label_ss").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='ss' style='outline:none; border:none; background:none; width:40px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.ss").focus(),jQuery("input.ss").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_ss").text(e)})}})}),refresh_attr(t,"type_time")}function second_no(e){time_box=document.getElementById(e+"_tr_time1"),text_box=document.getElementById(e+"_tr_time2"),second_box=document.getElementById(e+"_td_time_input3"),second_text=document.getElementById(e+"_td_time_label3"),document.getElementById(e+"_td_time_input2").parentNode.removeChild(document.getElementById(e+"_td_time_input2").nextSibling),time_box.removeChild(second_box),text_box.removeChild(second_text.previousSibling),text_box.removeChild(second_text)}function go_to_type_time(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["HH","MM","SS","AM/PM"],type_time(e,"Time","","top","no","24","0","1","","","",w_mini_labels,"no","",w_attr_name,w_attr_value)}function type_time(t,e,i,a,n,l,d,_,r,o,m,s,u,c,p,f){jQuery("#element_type").val("type_time"),delete_last_child();var y=jQuery("#edit_table"),h=jQuery('<div id="edit_div"></div>');y.append(h);var b=jQuery('<div id="edit_main_table"></div>');h.append(b),b.append(create_field_type("type_time")),b.append(create_label(t,e)),b.append(create_label_position(t,a)),b.append(create_time_format(t,l)),b.append(create_display_seconds(t,m,_)),b.append(create_hide_label(t,n)),b.append(create_required(t,u));var v=jQuery('<div class="inside"></div>');b.append(create_advanced_options_container(v)),v.append(create_field_label_size(t,i)),v.append(create_class(t,c)),v.append(create_additional_attributes(t,p,"type_time"));var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value","type_time"),w.setAttribute("name",t+"_typeform_id_temp"),w.setAttribute("id",t+"_typeform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",u),g.setAttribute("name",t+"_requiredform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",n),E.setAttribute("name",t+"_hide_labelform_id_temp"),E.setAttribute("id",t+"_hide_labelform_id_temp"),g.setAttribute("id",t+"_requiredform_id_temp");var A=document.createElement("div");A.setAttribute("id","main_div");var j=document.createElement("div");j.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),j.appendChild(edit_labels);var x=document.createElement("div");x.setAttribute("id",t+"_elemet_tableform_id_temp");var k="yes"==n?"none":"table-cell",I=document.createElement("div");I.setAttribute("align","left"),I.style.display=k,I.style.width=i+"px",I.setAttribute("id",t+"_label_sectionform_id_temp");var C=document.createElement("div");C.setAttribute("align","left"),C.style.display="table-cell",C.setAttribute("id",t+"_element_sectionform_id_temp");var B=document.createElement("div");B.setAttribute("id",t+"_table_time"),B.style.display="table";var Q=document.createElement("div");Q.setAttribute("id",t+"_tr_time1"),Q.style.display="table-row";var T=document.createElement("div");T.setAttribute("id",t+"_tr_time2"),T.style.display="table-row";var M=document.createElement("div");M.setAttribute("id",t+"_td_time_input1"),M.style.cssText="width:32px",M.style.display="table-cell";var L=document.createElement("div");L.setAttribute("align","center"),L.style.display="table-cell";var z=document.createElement("div");z.setAttribute("id",t+"_td_time_input2"),z.style.cssText="width:32px",z.style.display="table-cell";var q=document.createElement("div");q.setAttribute("align","center"),q.style.display="table-cell";var H=document.createElement("div");H.setAttribute("id",t+"_td_time_input3"),H.style.cssText="width:32px",H.style.display="table-cell";var N=document.createElement("div");N.setAttribute("id",t+"_td_time_label1"),N.style.display="table-cell";var S=document.createElement("div");S.style.display="table-cell";var D=document.createElement("div");D.setAttribute("id",t+"_td_time_label2"),D.style.display="table-cell";var P=document.createElement("div");P.style.display="table-cell";var O=document.createElement("div");O.setAttribute("id",t+"_td_time_label3"),O.style.display="table-cell";document.createElement("br"),document.createElement("br");var K=document.createElement("br"),U=(document.createElement("br"),document.createElement("span"));U.setAttribute("id",t+"_element_labelform_id_temp"),U.innerHTML=e,U.setAttribute("class","label"),U.style.verticalAlign="top";var F=document.createElement("span");F.setAttribute("id",t+"_required_elementform_id_temp"),F.innerHTML="",F.setAttribute("class","required"),F.style.verticalAlign="top","yes"==u&&(F.innerHTML=" *");var R=document.createElement("input");R.setAttribute("type","text"),R.setAttribute("value",r),R.setAttribute("class","time_box"),R.setAttribute("id",t+"_hhform_id_temp"),R.setAttribute("name",t+"_hhform_id_temp"),R.setAttribute("onBlur","add_0('"+t+"_hhform_id_temp')");var W=document.createElement("label");W.setAttribute("class","mini_label"),W.setAttribute("id",t+"_mini_label_hh"),W.innerHTML=s[0];var V=document.createElement("span");V.setAttribute("class","wdform_colon"),V.style.cssText="font-style:bold; vertical-align:middle",V.innerHTML="&nbsp;:&nbsp;";var $=document.createElement("input");$.setAttribute("type","text"),$.setAttribute("value",o),$.setAttribute("class","time_box"),$.setAttribute("id",t+"_mmform_id_temp"),$.setAttribute("name",t+"_mmform_id_temp"),$.setAttribute("onBlur","add_0('"+t+"_mmform_id_temp')");var G=document.createElement("label");G.setAttribute("class","mini_label"),G.setAttribute("id",t+"_mini_label_mm"),G.innerHTML=s[1];var Y=document.createElement("span");Y.style.cssText="font-style:bold; vertical-align:middle",Y.innerHTML="&nbsp;:&nbsp;",Y.setAttribute("class","wdform_colon");var Z=document.createElement("input");Z.setAttribute("type","text"),Z.setAttribute("value",m),Z.setAttribute("class","time_box"),Z.setAttribute("id",t+"_ssform_id_temp"),Z.setAttribute("name",t+"_ssform_id_temp"),Z.setAttribute("onBlur","add_0('"+t+"_ssform_id_temp')");var X=document.createElement("label");X.setAttribute("class","mini_label"),X.setAttribute("id",t+"_mini_label_ss"),X.innerHTML=s[2];var J=document.getElementById("show_table");I.appendChild(U),I.appendChild(F),M.appendChild(R),L.appendChild(V),z.appendChild($),q.appendChild(Y),H.appendChild(Z),Q.appendChild(M),Q.appendChild(L),Q.appendChild(z),Q.appendChild(q),Q.appendChild(H),N.appendChild(W),D.appendChild(G),O.appendChild(X),T.appendChild(N),T.appendChild(S),T.appendChild(D),T.appendChild(P),T.appendChild(O),B.appendChild(Q),B.appendChild(T),C.appendChild(w),C.appendChild(g),C.appendChild(E),C.appendChild(B),x.appendChild(I),x.appendChild(C),A.appendChild(x),A.appendChild(K),A.appendChild(j),J.appendChild(A),jQuery("#main_div").append("<br>"+form_maker.type_time_description),"top"==a&&label_top(t),"12"==l&&format_12(t,d,r,o,m),"0"==_&&second_no(t),change_class(c,t),refresh_attr(t,"type_time"),jQuery(function(){jQuery("label#"+t+"_mini_label_hh").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.hh").focus(),jQuery("input.hh").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_hh").text(e)})}}),jQuery("label#"+t+"_mini_label_mm").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.mm").focus(),jQuery("input.mm").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_mm").text(e)})}}),jQuery("label#"+t+"_mini_label_ss").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.ss").focus(),jQuery("input.ss").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_ss").text(e)})}})})}function go_to_type_send_copy(e){if(0!=jQuery("#take").find(jQuery("div[type='type_send_copy']")).length)return alert("This field already has been created."),void delete_last_child();w_attr_name=[],type_send_copy(e,"Send a copy of this message to yourself","","top","no",!(w_attr_value=[]),"no",w_attr_name,w_attr_value)}function type_send_copy(e,t,i,a,n,l,d,_,r){jQuery("#element_type").val("type_send_copy"),delete_last_child();var o=jQuery("#edit_table"),m=jQuery('<div id="edit_div"></div>');o.append(m);var s=jQuery('<div id="edit_main_table"></div>');m.append(s),s.append(create_field_type("type_send_copy")),s.append(create_label(e,t)),s.append(create_hide_label(e,n)),s.append(create_required(e,d));var u=jQuery('<div class="inside"></div>');s.append(create_advanced_options_container(u)),u.append(create_field_label_size(e,i)),u.append(create_additional_attributes(e,_,"type_send_copy")),element="input",type="checkbox";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("value","type_send_copy"),c.setAttribute("name",e+"_typeform_id_temp"),c.setAttribute("id",e+"_typeform_id_temp");var p=document.createElement("input");p.setAttribute("type","hidden"),p.setAttribute("value",d),p.setAttribute("name",e+"_requiredform_id_temp"),p.setAttribute("id",e+"_requiredform_id_temp");var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value",n),f.setAttribute("name",e+"_hide_labelform_id_temp"),f.setAttribute("id",e+"_hide_labelform_id_temp");var y=document.createElement(element);y.setAttribute("type",type),l&&y.setAttribute("checked","checked"),y.setAttribute("id",e+"_elementform_id_temp"),y.setAttribute("name",e+"_elementform_id_temp"),y.setAttribute("onclick","set_checked('"+e+"','','form_id_temp')");var h=document.createElement("div");h.setAttribute("id","main_div");var b=document.createElement("div");b.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("Use the field to allow the user to choose whether to receive a copy of the submitted form or not. Do not forget to fill in User Email section in Email Options in advance."),b.appendChild(edit_labels);var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==n?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var A=document.createElement("br"),j=(document.createElement("br"),document.createElement("span"));j.setAttribute("id",e+"_element_labelform_id_temp"),j.innerHTML=t,j.setAttribute("class","label"),j.style.verticalAlign="top";var x=document.createElement("span");x.setAttribute("id",e+"_required_elementform_id_temp"),x.innerHTML="",x.setAttribute("class","required"),x.style.verticalAlign="top","yes"==d&&(x.innerHTML=" *");var k=document.getElementById("show_table");g.appendChild(j),g.appendChild(x),E.appendChild(c),E.appendChild(p),E.appendChild(f),E.appendChild(y),v.appendChild(g),v.appendChild(E),h.appendChild(v),h.appendChild(A),h.appendChild(b),k.appendChild(h),jQuery("#main_div").append("<br>"+form_maker.type_send_copy_description),"top"==a&&label_top(e),refresh_attr(e,"type_text")}function create_default_date_range(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="default_date_start">Default range</label>'),jQuery('<input type="text" class="fm-width-40" id="default_date_start" onKeyUp="change_hidden_input_value_range(this.value, \'default_date\', \'start\', '+e+", '"+e+'_default_date_id_temp_start\')" value="'+t+'" />-<input type="text" class="fm-width-40" id="default_date_end" onKeyUp="change_hidden_input_value_range(this.value, \'default_date\', \'end\', '+e+", '"+e+'_default_date_id_temp_end\')" value="'+i+'" />'))}function change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,new_element_value){if(void 0===new_element_value)var new_element_value=element_value;document.getElementById(id).value=new_element_value;var element_value_new=element_value;if("default_date"==date_fields)if("start"==start_end)if("today"==element_value)jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",new Date),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option","minDate",new Date);else if(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w"))if(""!==element_value)element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").prop("format"),new Date(element_value)),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option","minDate",element_value);else{jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",element_value),date_fields="minDate";var element_value=jQuery("#min_date").val();change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)}else jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option","minDate",element_value);else"today"==element_value?(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",new Date),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option","maxDate",new Date)):-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w")?""!==element_value?(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").prop("format"),new Date(element_value)),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option","maxDate",new Date(element_value))):(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",element_value),date_fields="maxDate",element_value=jQuery("#max_date").val(),change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)):(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option","maxDate",element_value));"minDate"!=date_fields&&"maxDate"!=date_fields||("today"==element_value?("minDate"==date_fields&&""==jQuery("#default_date_start").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,new Date),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,new Date)),"minDate"==date_fields&&""!=jQuery("#default_date_start").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,new Date),element_value=jQuery("#default_date_start").val(),date_fields="default_date",start_end="start",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)),"maxDate"==date_fields&&""==jQuery("#default_date_end").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,new Date),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,new Date)),"maxDate"==date_fields&&""!=jQuery("#default_date_end").val()&&(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,new Date),element_value=jQuery("#default_date_end").val(),date_fields="default_date",start_end="end",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new))):(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("w")&&-1==element_value.indexOf("y")&&""!==element_value&&(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").prop("format"),new Date(element_value))),("minDate"==date_fields&&""==jQuery("#default_date_start").val()||"maxDate"==date_fields&&""==jQuery("#default_date_end").val())&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,element_value),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,element_value)),"minDate"==date_fields&&""!=jQuery("#default_date_start").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,element_value),element_value=jQuery("#default_date_start").val(),date_fields="default_date",start_end="start",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)),"maxDate"==date_fields&&""!=jQuery("#default_date_end").val()&&(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,element_value),element_value=jQuery("#default_date_end").val(),date_fields="default_date",start_end="end",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)))),"invalide_date"==date_fields&&jQuery("input[id^="+id_int+"_elementform_id_temp]").datepicker("option","beforeShowDay",function(date){for(var invalid_dates=element_value,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var w_hide_sunday="yes"==jQuery("#"+id_int+"_show_week_days").prop("sunday")?"true":"day != 0",w_hide_monday="yes"==jQuery("#"+id_int+"_show_week_days").prop("monday")?"true":"day != 1",w_hide_tuesday="yes"==jQuery("#"+id_int+"_show_week_days").prop("tuesday")?"true":"day != 2",w_hide_wednesday="yes"==jQuery("#"+id_int+"_show_week_days").prop("wednesday")?"true":"day != 3",w_hide_thursday="yes"==jQuery("#"+id_int+"_show_week_days").prop("thursday")?"true":"day != 4",w_hide_friday="yes"==jQuery("#"+id_int+"_show_week_days").prop("friday")?"true":"day != 5",w_hide_saturday="yes"==jQuery("#"+id_int+"_show_week_days").prop("saturday")?"true":"day != 6",day=date.getDay(),string_days=jQuery.datepicker.formatDate("mm/dd/yy",date);return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]})}function go_to_type_date_range(e){w_attr_name=[],w_attr_value=[],w_show_days=["yes","yes","yes","yes","yes","yes","yes"],type_date_range(e,"Date range","","top","no","","","no","no","","mm/dd/yy","0","","","","","",w_show_days,"yes","...",w_attr_name,w_attr_value,"no")}function type_date_range(i,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date_start,w_default_date_end,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days){jQuery("#element_type").val("type_date_range"),delete_last_child();var t=jQuery("#edit_table"),edit_div=jQuery('<div id="edit_div"></div>');t.append(edit_div);var edit_main_table=jQuery('<div id="edit_main_table"></div>');edit_div.append(edit_main_table),edit_main_table.append(create_field_type("type_date_range")),edit_main_table.append(create_label(i,w_field_label)),edit_main_table.append(create_label_position(i,w_field_label_pos)),edit_main_table.append(create_hide_label(i,w_hide_label)),edit_main_table.append(create_required(i,w_required)),edit_main_table.append(create_field_size(i,w_size,"'"+i+"_elementform_id_temp0'","'"+i+"_elementform_id_temp1'")),edit_main_table.append(create_date_format(i,w_format)),edit_main_table.append(create_week_start(i,w_start_day));var advanced_options_container=jQuery('<div class="inside"></div>');edit_main_table.append(create_advanced_options_container(advanced_options_container)),advanced_options_container.append(create_default_date_range(i,w_default_date_start,w_default_date_end)),advanced_options_container.append(create_minimum_date(i,w_min_date,!0)),advanced_options_container.append(create_maximum_date(i,w_max_date,!0)),advanced_options_container.append(create_excluded_dates(i,w_invalid_dates,!0)),advanced_options_container.append(create_selectable_week_days(i,w_show_days)),advanced_options_container.append(create_field_label_size(i,w_field_label_size)),advanced_options_container.append(create_class(i,w_class)),advanced_options_container.append(create_show_date_picker_button(i,w_show_image,"date_range")),advanced_options_container.append(create_additional_attributes(i,w_attr_name,"type_date_range"));var adding_type=document.createElement("input");adding_type.setAttribute("type","hidden"),adding_type.setAttribute("value","type_date_range"),adding_type.setAttribute("name",i+"_typeform_id_temp"),adding_type.setAttribute("id",i+"_typeform_id_temp");var adding_required=document.createElement("input");adding_required.setAttribute("type","hidden"),adding_required.setAttribute("value",w_required),adding_required.setAttribute("name",i+"_requiredform_id_temp"),adding_required.setAttribute("id",i+"_requiredform_id_temp");var adding_hide_label=document.createElement("input");adding_hide_label.setAttribute("type","hidden"),adding_hide_label.setAttribute("value",w_hide_label),adding_hide_label.setAttribute("name",i+"_hide_labelform_id_temp"),adding_hide_label.setAttribute("id",i+"_hide_labelform_id_temp");var adding_dis_past_days=document.createElement("input");adding_dis_past_days.setAttribute("type","hidden"),adding_dis_past_days.setAttribute("value",w_disable_past_days),adding_dis_past_days.setAttribute("id",i+"_dis_past_daysform_id_temp"),adding_dis_past_days.setAttribute("name",i+"_dis_past_daysform_id_temp");var adding_start_day=document.createElement("input");adding_start_day.setAttribute("type","hidden"),adding_start_day.setAttribute("value",w_start_day),adding_start_day.setAttribute("name",i+"_start_dayform_id_temp"),adding_start_day.setAttribute("id",i+"_start_dayform_id_temp");var adding_default_date_start=document.createElement("input");adding_default_date_start.setAttribute("type","hidden"),adding_default_date_start.setAttribute("name",i+"_default_date_id_temp_start"),adding_default_date_start.setAttribute("id",i+"_default_date_id_temp_start"),adding_default_date_start.setAttribute("value",w_default_date_start);var adding_default_date_end=document.createElement("input");adding_default_date_end.setAttribute("type","hidden"),adding_default_date_end.setAttribute("name",i+"_default_date_id_temp_end"),adding_default_date_end.setAttribute("id",i+"_default_date_id_temp_end"),adding_default_date_end.setAttribute("value",w_default_date_end);var adding_min_date=document.createElement("input");adding_min_date.setAttribute("type","hidden"),adding_min_date.setAttribute("name",i+"_min_date_id_temp"),adding_min_date.setAttribute("id",i+"_min_date_id_temp"),adding_min_date.setAttribute("value",w_min_date);var adding_max_date=document.createElement("input");adding_max_date.setAttribute("type","hidden"),adding_max_date.setAttribute("name",i+"_max_date_id_temp"),adding_max_date.setAttribute("id",i+"_max_date_id_temp"),adding_max_date.setAttribute("value",w_max_date);var adding_invalid_dates=document.createElement("input");adding_invalid_dates.setAttribute("type","hidden"),adding_invalid_dates.setAttribute("name",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("id",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("value",w_invalid_dates);var adding_show_days=document.createElement("input");adding_show_days.setAttribute("type","hidden"),adding_show_days.setAttribute("name",i+"_show_week_days"),adding_show_days.setAttribute("id",i+"_show_week_days"),adding_show_days.setAttribute("sunday",w_show_days[0]),adding_show_days.setAttribute("monday",w_show_days[1]),adding_show_days.setAttribute("tuesday",w_show_days[2]),adding_show_days.setAttribute("wednesday",w_show_days[3]),adding_show_days.setAttribute("thursday",w_show_days[4]),adding_show_days.setAttribute("friday",w_show_days[5]),adding_show_days.setAttribute("saturday",w_show_days[6]);var adding_show_image=document.createElement("input");adding_show_image.setAttribute("type","hidden"),adding_show_image.setAttribute("value",w_show_image),adding_show_image.setAttribute("name",i+"_show_imageform_id_temp"),adding_show_image.setAttribute("id",i+"_show_imageform_id_temp");var adding_hide_time=document.createElement("input");adding_hide_time.setAttribute("type","hidden"),adding_hide_time.setAttribute("value",w_hide_time),adding_hide_time.setAttribute("name",i+"_hide_timeform_id_temp"),adding_hide_time.setAttribute("id",i+"_hide_timeform_id_temp");var div=document.createElement("div");div.setAttribute("id","main_div");var div_field=document.createElement("div");div_field.setAttribute("id",i+"_elemet_tableform_id_temp");var display_label_div="yes"==w_hide_label?"none":"table-cell",div_label=document.createElement("div");div_label.setAttribute("align","left"),div_label.style.display=display_label_div,div_label.style.width=w_field_label_size+"px",div_label.setAttribute("id",i+"_label_sectionform_id_temp");var div_element=document.createElement("div");div_element.setAttribute("align","left"),div_element.style.display="table-cell",div_element.style.position="relative",div_element.setAttribute("id",i+"_element_sectionform_id_temp");var table_date=document.createElement("div");table_date.setAttribute("id",i+"_table_date"),table_date.style.display="table";var tr_date1=document.createElement("div");tr_date1.setAttribute("id",i+"_tr_date1"),tr_date1.style.display="table-row";var tr_date2=document.createElement("div");tr_date2.setAttribute("id",i+"_tr_date2"),tr_date2.style.display="table-row";var td_date_input1=document.createElement("div");td_date_input1.setAttribute("id",i+"_td_date_input1"),td_date_input1.style.display="table-cell";var td_date_input2=document.createElement("div");td_date_input2.setAttribute("id",i+"_td_date_input2"),td_date_input2.style.display="table-cell";var td_date_input3=document.createElement("div");td_date_input3.setAttribute("id",i+"_td_date_input3"),td_date_input3.style.display="table-cell";var td_date_label1=document.createElement("div");td_date_label1.setAttribute("id",i+"_td_date_label1"),td_date_label1.style.display="table-cell";var td_date_label2=document.createElement("div");td_date_label2.setAttribute("id",i+"_td_date_label2"),td_date_label2.style.display="table-cell";var td_date_label3=document.createElement("div");td_date_label3.setAttribute("id",i+"_td_date_label3"),td_date_label3.style.display="table-cell";var br3=document.createElement("br"),br4=document.createElement("br"),label=document.createElement("span");label.setAttribute("id",i+"_element_labelform_id_temp"),label.innerHTML=w_field_label,label.setAttribute("class","label"),label.style.verticalAlign="top";var required=document.createElement("span");required.setAttribute("id",i+"_required_elementform_id_temp"),required.innerHTML="",required.setAttribute("class","required"),required.style.verticalAlign="top","yes"==w_required&&(required.innerHTML=" *");var adding=document.createElement("input");adding.setAttribute("type","text"),adding.setAttribute("value",w_date),adding.setAttribute("id",i+"_elementform_id_temp0"),adding.setAttribute("name",i+"_elementform_id_temp0"),adding.style.cssText="width:"+w_size+"px;";var adding_desc_p=document.createElement("p"),adding_desc_b=document.createElement("b"),text_format_1=document.createTextNode("The format can be combinations of the following:"),text_format_2=document.createTextNode("d - day of month (no leading zero)"),text_format_3=document.createTextNode("dd - day of month (two digit)"),text_format_4=document.createTextNode("o - day of the year (no leading zeros)"),text_format_5=document.createTextNode("oo - day of the year (three digit)"),text_format_6=document.createTextNode("D - day name short"),text_format_7=document.createTextNode("DD - day name long"),text_format_8=document.createTextNode("m - month of year (no leading zero)"),text_format_9=document.createTextNode("mm - month of year (two digit)"),text_format_10=document.createTextNode("M - month name short"),text_format_11=document.createTextNode("MM - month name long"),text_format_12=document.createTextNode("y - year (two digit)"),text_format_13=document.createTextNode("yy - year (four digit)"),format_br_1=document.createElement("br"),format_br_2=document.createElement("br"),format_br_3=document.createElement("br"),format_br_4=document.createElement("br"),format_br_5=document.createElement("br"),format_br_6=document.createElement("br"),format_br_7=document.createElement("br"),format_br_8=document.createElement("br"),format_br_9=document.createElement("br"),format_br_10=document.createElement("br"),format_br_11=document.createElement("br"),format_br_12=document.createElement("br"),format_br_13=document.createElement("br"),adding_desc_p_2=document.createElement("p"),adding_desc_b_2=document.createElement("b"),text_default_1=document.createTextNode("Accepted values of Default, Minimum and Maximum:"),text_default_3=document.createTextNode("Date: A fixed date using the date format mm/dd/yy, e.g. 05/25/2016"),text_default_2=document.createTextNode("Empty: No default / minimum / maximum"),text_default_4=document.createTextNode("'today' : current date"),text_default_5=document.createTextNode("Relative date: A number of days/weeks/months/years from today, e.g. '-1d' will be yesterday, '+1y+3m+2w+3d' will be 1 year, 3 months, 2 weeks and 3 days from today."),default_br_1=document.createElement("br"),default_br_2=document.createElement("br"),default_br_3=document.createElement("br"),default_br_4=document.createElement("br"),default_br_6=document.createElement("br"),default_br_7=document.createElement("br"),adding_desc_p_3=document.createElement("p"),adding_desc_b_3=document.createElement("b"),text_default_6=document.createTextNode("Dates to exclude:"),text_default_7=document.createTextNode("Enter comma-separated list of dates and date ranges using the date format 'mm/dd/yy', e.g. 08/15/2016, 06/15/2016-06/20/2016"),adding_0=document.createElement("input");adding_0.setAttribute("type","text"),adding_0.setAttribute("value",w_date),adding_0.setAttribute("id",i+"_elementform_id_temp0"),adding_0.setAttribute("name",i+"_elementform_id_temp0"),adding_0.style.cssText="width:"+w_size+"px;",adding_0.setAttribute("onChange","change_value_range('"+i+"_elementform_id_temp1', 'minDate', this.value)");var adding_1=document.createElement("input");adding_1.setAttribute("type","text"),adding_1.setAttribute("value",w_date),adding_1.setAttribute("id",i+"_elementform_id_temp1"),adding_1.setAttribute("name",i+"_elementform_id_temp1"),adding_1.style.cssText="width:"+w_size+"px;",adding_1.setAttribute("onChange","change_value_range('"+i+"_elementform_id_temp0', 'maxDate', this.value)");var adding_from=document.createTextNode("-"),adding_image_start=document.createElement("span");adding_image_start.setAttribute("id",i+"_show_imagedateform_id_temp0"),adding_image_start.setAttribute("class","dashicons dashicons-calendar-alt wd-calendar-button "+("yes"==w_show_image?"wd-inline-block":"wd-hidden")),adding_image_start.setAttribute("onClick","show_datepicker('"+i+"_elementform_id_temp0')");var adding_image_end=document.createElement("span");adding_image_end.setAttribute("id",i+"_show_imagedateform_id_temp1"),adding_image_end.setAttribute("class","dashicons dashicons-calendar-alt wd-calendar-button "+("yes"==w_show_image?"wd-inline-block":"wd-hidden")),adding_image_end.setAttribute("onClick","show_datepicker('"+i+"_elementform_id_temp1')");var dis_past_days="yes"==w_disable_past_days,adding_button=document.createElement("input");adding_button.setAttribute("id",i+"_buttonform_id_temp"),adding_button.setAttribute("class","button"),adding_button.setAttribute("type","hidden"),adding_button.setAttribute("value",w_but_val),adding_button.setAttribute("format",w_format);var main_td=document.getElementById("show_table");if(adding_desc_b.appendChild(text_format_1),adding_desc_p.appendChild(adding_desc_b),adding_desc_p.appendChild(format_br_1),adding_desc_p.appendChild(text_format_2),adding_desc_p.appendChild(format_br_2),adding_desc_p.appendChild(text_format_3),adding_desc_p.appendChild(format_br_3),adding_desc_p.appendChild(text_format_4),adding_desc_p.appendChild(format_br_4),adding_desc_p.appendChild(text_format_5),adding_desc_p.appendChild(format_br_5),adding_desc_p.appendChild(text_format_6),adding_desc_p.appendChild(format_br_6),adding_desc_p.appendChild(text_format_7),adding_desc_p.appendChild(format_br_7),adding_desc_p.appendChild(text_format_8),adding_desc_p.appendChild(format_br_8),adding_desc_p.appendChild(text_format_9),adding_desc_p.appendChild(format_br_9),adding_desc_p.appendChild(text_format_10),adding_desc_p.appendChild(format_br_10),adding_desc_p.appendChild(text_format_11),adding_desc_p.appendChild(format_br_11),adding_desc_p.appendChild(text_format_12),adding_desc_p.appendChild(format_br_12),adding_desc_p.appendChild(text_format_13),adding_desc_p.appendChild(format_br_13),adding_desc_b_2.appendChild(text_default_1),adding_desc_p_2.appendChild(adding_desc_b_2),adding_desc_p_2.appendChild(default_br_1),adding_desc_p_2.appendChild(text_default_2),adding_desc_p_2.appendChild(default_br_2),adding_desc_p_2.appendChild(text_default_3),adding_desc_p_2.appendChild(default_br_3),adding_desc_p_2.appendChild(text_default_4),adding_desc_p_2.appendChild(default_br_4),adding_desc_p_2.appendChild(text_default_5),adding_desc_b_3.appendChild(text_default_6),adding_desc_p_3.appendChild(adding_desc_b_3),adding_desc_p_3.appendChild(default_br_6),adding_desc_p_3.appendChild(text_default_7),adding_desc_p_3.appendChild(default_br_7),div_label.appendChild(label),div_label.appendChild(required),div_element.appendChild(adding_type),div_element.appendChild(adding_required),div_element.appendChild(adding_hide_label),div_element.appendChild(adding_show_image),div_element.appendChild(adding_dis_past_days),div_element.appendChild(adding_0),div_element.appendChild(adding_image_start),div_element.appendChild(adding_from),div_element.appendChild(adding_1),div_element.appendChild(adding_image_end),div_element.appendChild(adding_start_day),div_element.appendChild(adding_default_date_start),div_element.appendChild(adding_default_date_end),div_element.appendChild(adding_min_date),div_element.appendChild(adding_max_date),div_element.appendChild(adding_invalid_dates),div_element.appendChild(adding_hide_time),div_element.appendChild(adding_show_days),div_element.appendChild(adding_button),div_field.appendChild(div_label),div_field.appendChild(div_element),div.appendChild(div_field),div.appendChild(br3),div.appendChild(adding_desc_p),div.appendChild(adding_desc_p_2),div.appendChild(adding_desc_p_3),main_td.appendChild(div),"top"==w_field_label_pos&&label_top(i),change_class(w_class,i),refresh_attr(i,"type_range"),w_default_date_end&&"today"!=w_default_date_end)var w_max_date_start=w_default_date_end;else w_max_date_start="today"==w_default_date_end?jQuery.datepicker.formatDate("mm/dd/yy",new Date):w_max_date;if(jQuery("#"+i+"_elementform_id_temp0").datepicker({dateFormat:"mm/dd/yy",minDate:w_min_date,maxDate:w_max_date_start,firstDay:w_start_day,changeMonth:!0,changeYear:!0,yearRange:"-100:+50",showOtherMonths:!0,selectOtherMonths:!0,beforeShowDay:function(date){for(var invalid_dates=w_invalid_dates,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var string_days=jQuery.datepicker.formatDate("mm/dd/yy",date),day=date.getDay(),w_hide_sunday="yes"==w_show_days[0]?"true":"day != 0",w_hide_monday="yes"==w_show_days[1]?"true":"day != 1",w_hide_tuesday="yes"==w_show_days[2]?"true":"day != 2",w_hide_wednesday="yes"==w_show_days[3]?"true":"day != 3",w_hide_thursday="yes"==w_show_days[4]?"true":"day != 4",w_hide_friday="yes"==w_show_days[5]?"true":"day != 5",w_hide_saturday="yes"==w_show_days[6]?"true":"day != 6";return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]}}),jQuery("#"+i+"_elementform_id_temp0").datepicker("option","dateFormat",w_format),"today"==w_default_date_start?jQuery("#"+i+"_elementform_id_temp0").datepicker("setDate",new Date):(-1==w_default_date_start.indexOf("d")&&-1==w_default_date_start.indexOf("m")&&-1==w_default_date_start.indexOf("y")&&-1==w_default_date_start.indexOf("w")&&""!==w_default_date_start&&(w_default_date_start=jQuery.datepicker.formatDate(w_format,new Date(w_default_date_start))),jQuery("#"+i+"_elementform_id_temp0").datepicker("setDate",w_default_date_start)),w_default_date_start&&"today"!=w_default_date_start)var w_min_date_end=w_default_date_start;else"today"==w_default_date_start?w_max_date_start=jQuery.datepicker.formatDate("mm/dd/yy",new Date):w_min_date_end=w_min_date;jQuery("#"+i+"_elementform_id_temp1").datepicker({dateFormat:"mm/dd/yy",minDate:w_min_date_end,maxDate:w_max_date,firstDay:w_start_day,changeMonth:!0,changeYear:!0,yearRange:"-100:+50",showOtherMonths:!0,selectOtherMonths:!0,beforeShowDay:function(date){for(var invalid_dates=w_invalid_dates,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var string_days=jQuery.datepicker.formatDate("mm/dd/yy",date),day=date.getDay(),w_hide_sunday="yes"==w_show_days[0]?"true":"day != 0",w_hide_monday="yes"==w_show_days[1]?"true":"day != 1",w_hide_tuesday="yes"==w_show_days[2]?"true":"day != 2",w_hide_wednesday="yes"==w_show_days[3]?"true":"day != 3",w_hide_thursday="yes"==w_show_days[4]?"true":"day != 4",w_hide_friday="yes"==w_show_days[5]?"true":"day != 5",w_hide_saturday="yes"==w_show_days[6]?"true":"day != 6";return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]}}),jQuery("#"+i+"_elementform_id_temp1").datepicker("option","dateFormat",w_format),"today"==w_default_date_end?jQuery("#"+i+"_elementform_id_temp1").datepicker("setDate",new Date):(-1==w_default_date_end.indexOf("d")&&-1==w_default_date_end.indexOf("m")&&-1==w_default_date_end.indexOf("y")&&-1==w_default_date_end.indexOf("w")&&""!==w_default_date_end&&(w_default_date_end=jQuery.datepicker.formatDate(w_format,new Date(w_default_date_end))),jQuery("#"+i+"_elementform_id_temp1").datepicker("setDate",w_default_date_end))}function create_star_amount(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_star_size">Number of Stars</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_star_size" onKeyPress="return check_isnum(event)" onKeyUp="change_star_amount(this.value, '+e+", 'form_id_temp')\" value=\""+t+'" />'))}function change_star_amount(e,t,i){var a=document.getElementById(t+"_element_sectionform_id_temp"),n=document.getElementById(t+"_elementform_id_temp");a.removeChild(n);var l=document.createElement("div");l.setAttribute("id",t+"_elementform_id_temp");for(var d=0;d<e;d++){var _=document.createElement("img");_.setAttribute("id",t+"_star_"+d),_.setAttribute("src",plugin_url+"/images/star.png"),_.setAttribute("onmouseover","change_src("+d+","+t+",'form_id_temp')"),_.setAttribute("onmouseout","reset_src("+d+","+t+")"),_.setAttribute("onclick","select_star_rating("+d+","+t+",'form_id_temp')"),l.appendChild(_)}a.appendChild(l),document.getElementById(t+"_star_amountform_id_temp").value=e}function create_star_color(e,t){var i=jQuery('<label class="fm-field-label">Star Color</label>'),a=jQuery('<select class="fm-width-100" id="edit_for_label_color" name="edit_for_label_color" onChange="label_color(this.value, '+e+')"></select>'),n=[];for(var l in n.yellow="Yellow",n.green="Green",n.blue="Blue",n.red="Red",n)if(n.hasOwnProperty(l)){var d=jQuery('<option value="'+l+'"'+(t==l?' selected="selected"':"")+">"+n[l]+"</option>");a.append(d)}return create_option_container(i,a)}function label_color(e,t){document.getElementById(t+"_star_colorform_id_temp").value=e}function go_to_type_star_rating(e){w_attr_name=[],w_attr_value=[],type_star_rating(e,"Star Rating","","top","no","yellow","5","no","wdform_star_rating",w_attr_name,w_attr_value)}function type_star_rating(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_star_rating"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('<div id="edit_div"></div>');s.append(u);var c=jQuery('<div id="edit_main_table"></div>');u.append(c),c.append(create_field_type("type_star_rating")),c.append(create_label(e,t)),c.append(create_label_position(e,a)),c.append(create_hide_label(e,n)),c.append(create_required(e,_)),c.append(create_star_amount(e,d)),c.append(create_star_color(e,l));var p=jQuery('<div class="inside"></div>');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(e,i)),p.append(create_class(e,r)),p.append(create_additional_attributes(e,o,"type_star_rating"));var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_star_rating"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",e+"_requiredform_id_temp"),y.setAttribute("id",e+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",d),b.setAttribute("id",e+"_star_amountform_id_temp"),b.setAttribute("name",e+"_star_amountform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",l),v.setAttribute("name",e+"_star_colorform_id_temp"),v.setAttribute("id",e+"_star_colorform_id_temp");var w=document.createElement("div");w.setAttribute("id","main_div");var g=document.createElement("div");g.setAttribute("id",e+"_elemet_tableform_id_temp");var E="yes"==n?"none":"table-cell",A=document.createElement("div");A.setAttribute("align","left"),A.style.cssText="display:"+E+"; vertical-align:top; width:"+i+"px;",A.setAttribute("id",e+"_label_sectionform_id_temp");var j=document.createElement("div");j.setAttribute("align","left"),j.style.display="table-cell",j.setAttribute("id",e+"_element_sectionform_id_temp");var x=document.createElement("div");x.setAttribute("id",e+"_elementform_id_temp"),x.setAttribute("class","wdform_stars");var k=document.createElement("br"),I=document.createElement("span");I.setAttribute("id",e+"_element_labelform_id_temp"),I.innerHTML=t,I.setAttribute("class","label");var C=document.createElement("span");C.setAttribute("id",e+"_required_elementform_id_temp"),C.innerHTML="",C.setAttribute("class","required"),"yes"==_&&(C.innerHTML=" *");var B=document.getElementById("show_table");A.appendChild(I),A.appendChild(C),j.appendChild(h),j.appendChild(f),j.appendChild(y),j.appendChild(b),j.appendChild(v);for(var Q=0;Q<d;Q++){var T=document.createElement("img");T.setAttribute("id",e+"_star_"+Q),T.setAttribute("src",plugin_url+"/images/star.png"),T.setAttribute("onmouseover","change_src("+Q+","+e+",'form_id_temp')"),T.setAttribute("onmouseout","reset_src("+Q+","+e+")"),T.setAttribute("onclick","select_star_rating("+Q+","+e+",'form_id_temp')"),x.appendChild(T)}j.appendChild(x),g.appendChild(A),g.appendChild(j),w.appendChild(g),w.appendChild(k),B.appendChild(w),jQuery("#main_div").append(form_maker.type_stars_description),"top"==a&&label_top(e),change_class(r,e),refresh_attr(e,"type_star_rating")}function create_scale_amount(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_scale_amount">Scale Range</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_scale_amount" onKeyPress="return check_isnum(event)" onKeyUp="change_scale_amount(this.value, '+e+", 'form_id_temp')\" value=\""+t+'" />'))}function change_scale_amount(e,t,i){var a=document.getElementById(t+"_scale_tableform_id_temp"),n=document.getElementById(t+"_elementform_id_temp");n.removeChild(a);var l=document.createElement("div");l.setAttribute("id",t+"_scale_tableform_id_temp"),l.style.cssText="display:inline-table;";var d=document.createElement("div");d.setAttribute("id",t+"_scale_tr1form_id_temp"),d.style.cssText="display:table-row;";var _=document.createElement("div");_.setAttribute("id",t+"_scale_tr2form_id_temp"),_.style.cssText="display:table-row;",l.appendChild(d);for(var r=1;r<=e;r++)adding_num=document.createElement("span"),adding_num.innerHTML=r,adding_td=document.createElement("div"),adding_td.setAttribute("id",t+"_scale_td1_"+r+"form_id_temp"),adding_td.style.cssText="text-align:center; display:table-cell;",adding_td.appendChild(adding_num),d.appendChild(adding_td);for(var o=1;o<=e;o++){var m=document.createElement("input");m.setAttribute("id",t+"_scale_radioform_id_temp_"+o),m.setAttribute("name",t+"_scale_radioform_id_temp"),m.setAttribute("value",o),m.setAttribute("type","radio");var s=document.createElement("div");s.setAttribute("id",t+"_scale_td2_"+o+"form_id_temp"),s.style.cssText=" display:table-cell;",s.appendChild(m),_.appendChild(s)}l.appendChild(_),n.insertBefore(l,n.childNodes[1]),document.getElementById(t+"_scale_amountform_id_temp").value=e}function go_to_type_scale_rating(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["Worst","Best"],type_scale_rating(e,"Scale Rating","","top","no",w_mini_labels,"5","no","wdform_scale_rating",w_attr_name,w_attr_value)}function type_scale_rating(t,e,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_scale_rating"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('<div id="edit_div"></div>');s.append(u);var c=jQuery('<div id="edit_main_table"></div>');u.append(c),c.append(create_field_type("type_scale_rating")),c.append(create_label(t,e)),c.append(create_label_position(t,a)),c.append(create_hide_label(t,n)),c.append(create_required(t,_)),c.append(create_scale_amount(t,d));var p=jQuery('<div class="inside"></div>');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(t,i)),p.append(create_class(t,r)),p.append(create_additional_attributes(t,o,"type_scale_rating"));var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_scale_rating"),f.setAttribute("name",t+"_typeform_id_temp"),f.setAttribute("id",t+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",t+"_requiredform_id_temp"),y.setAttribute("id",t+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",t+"_hide_labelform_id_temp"),h.setAttribute("id",t+"_hide_labelform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",d),b.setAttribute("id",t+"_scale_amountform_id_temp"),b.setAttribute("name",t+"_scale_amountform_id_temp");var v=document.createElement("div");v.setAttribute("id","main_div"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit.");var w=document.createElement("div");w.setAttribute("class","fm-editable-label"),w.appendChild(edit_labels);var g=document.createElement("div");g.setAttribute("id",t+"_elemet_tableform_id_temp");var E="yes"==n?"none":"table-cell",A=document.createElement("div");A.setAttribute("align","left"),A.style.cssText="display:"+E+"; vertical-align:top; width:"+i+"px;",A.setAttribute("id",t+"_label_sectionform_id_temp");var j=document.createElement("div");j.setAttribute("align","left"),j.style.display="table-cell",j.setAttribute("id",t+"_element_sectionform_id_temp");var x=document.createElement("div");x.setAttribute("id",t+"_elementform_id_temp");var k=document.createElement("div");k.setAttribute("id",t+"_scale_tableform_id_temp"),k.style.cssText="display:inline-table;";var I=document.createElement("div");I.setAttribute("id",t+"_scale_tr1form_id_temp"),I.style.display="table-row";var C=document.createElement("div");C.setAttribute("id",t+"_scale_tr2form_id_temp"),C.style.display="table-row";var B=document.createElement("br"),Q=document.createElement("span");Q.setAttribute("id",t+"_element_labelform_id_temp"),Q.innerHTML=e,Q.setAttribute("class","label");var T=document.createElement("label");T.setAttribute("class","mini_label"),T.setAttribute("id",t+"_mini_label_worst"),T.innerHTML=l[0],T.style.cssText="position:relative; top:6px; font-size:11px; display:inline-table;";var M=document.createElement("label");M.setAttribute("class","mini_label"),M.setAttribute("id",t+"_mini_label_best"),M.innerHTML=l[1],M.style.cssText="position:relative; top:6px; font-size:11px; display:inline-table;";var L=document.createElement("span");L.setAttribute("id",t+"_required_elementform_id_temp"),L.innerHTML="",L.setAttribute("class","required"),"yes"==_&&(L.innerHTML=" *");var z=document.getElementById("show_table");A.appendChild(Q),A.appendChild(L),j.appendChild(h),j.appendChild(f),j.appendChild(y),j.appendChild(b),x.appendChild(T),k.appendChild(I);for(var q=1;q<=d;q++)adding_num=document.createElement("span"),adding_num.innerHTML=q,adding_td=document.createElement("td"),adding_td.setAttribute("id",t+"_scale_td1_"+q+"form_id_temp"),adding_td.style.cssText="text-align:center;",adding_td.style.display="table-cell",adding_td.appendChild(adding_num),I.appendChild(adding_td);for(var H=1;H<=d;H++){var N=document.createElement("input");N.setAttribute("id",t+"_scale_radioform_id_temp_"+H),N.setAttribute("name",t+"_scale_radioform_id_temp"),N.setAttribute("value",H),N.setAttribute("type","radio");var S=document.createElement("div");S.setAttribute("id",t+"_scale_td2_"+H+"form_id_temp"),S.style.display="table-cell",S.appendChild(N),C.appendChild(S),k.appendChild(C),x.appendChild(k)}k.appendChild(C),x.appendChild(k),x.appendChild(M),j.appendChild(x),g.appendChild(A),g.appendChild(j),v.appendChild(g),v.appendChild(B),v.appendChild(w),z.appendChild(v),jQuery("#main_div").append("<br>"+form_maker.type_rating_description),"top"==a&&label_top(t),change_class(r,t),refresh_attr(t,"type_scale_rating"),jQuery(function(){jQuery("label#"+t+"_mini_label_worst").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.worst").focus(),jQuery("input.worst").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_worst").text(e)})}}),jQuery("label#"+t+"_mini_label_best").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.best").focus(),jQuery("input.best").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_best").text(e)})}})})}function create_slider_minvalue(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_slider_min_value">Min Value</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_slider_min_value" onKeyPress="return check_isnum_or_minus(event)" onKeyUp="change_slider_min_or_max_value(this.value, '+e+", 'form_id_temp', 'min')\" onChange=\"change_slider_min_value(this.value, "+e+", 'form_id_temp')\" value=\""+t+'" />'))}function change_slider_min_or_max_value(e,t,i,a){document.getElementById(t+"_element_"+a+"form_id_temp").innerHTML=e}function change_slider_min_value(a,id,form_id){document.getElementById(id+"_slider_min_valueform_id_temp").value=a,eval(a)>document.getElementById(id+"_element_valueform_id_temp").innerHTML?(document.getElementById(id+"_element_valueform_id_temp").innerHTML=a,document.getElementById(id+"_slider_valueform_id_temp").value=a,jQuery("#"+id+"_elementform_id_temp").slider({min:eval(a),slide:function(e,t){document.getElementById(id+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(id+"_slider_valueform_id_temp").value=""+t.value}})):jQuery("#"+id+"_elementform_id_temp").slider({min:eval(a),slide:function(e,t){document.getElementById(id+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(id+"_slider_valueform_id_temp").value=""+t.value}})}function create_slider_maxvalue(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_slider_max_value">Max Value</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_slider_max_value" onKeyPress="return check_isnum_or_minus(event)" onKeyUp="change_slider_min_or_max_value(this.value, '+e+", 'form_id_temp', 'max')\" onChange=\"change_slider_max_value(this.value, "+e+", 'form_id_temp')\" value=\""+t+'" />'))}function change_slider_max_value(a,id,form_id){document.getElementById(id+"_slider_max_valueform_id_temp").value=a,eval(a)<parseInt(document.getElementById(id+"_slider_valueform_id_temp").value)?(document.getElementById(id+"_element_valueform_id_temp").innerHTML=a,document.getElementById(id+"_slider_valueform_id_temp").value=a,jQuery("#"+id+"_elementform_id_temp").slider({min:eval(document.getElementById(id+"_slider_min_valueform_id_temp").value),max:eval(a),value:eval(document.getElementById(id+"_slider_valueform_id_temp").value),slide:function(e,t){document.getElementById(id+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(id+"_slider_valueform_id_temp").value=""+t.value}})):jQuery("#"+id+"_elementform_id_temp").slider({min:eval(document.getElementById(id+"_slider_min_valueform_id_temp").value),max:eval(a),value:eval(document.getElementById(id+"_slider_valueform_id_temp").value),slide:function(e,t){document.getElementById(id+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(id+"_slider_valueform_id_temp").value=""+t.value}})}function create_slider_step(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_slider_step">Step</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_slider_step" onKeyPress="return check_isnum(event)" onChange="change_slider_step(this.value, '+e+", 'form_id_temp')\" value=\""+t+'" />'))}function change_slider_step(a,id,form_id){jQuery("#"+id+"_elementform_id_temp").slider({step:eval(a)}),document.getElementById(id+"_slider_stepform_id_temp").value=a}function create_slider_width(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_slider_width">Width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_slider_width" onKeyPress="return check_isnum(event)" onKeyUp="change_slider_width(this.value,'+e+",'form_id_temp')\" value=\""+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function change_slider_width(e,t,i){document.getElementById(t+"_elementform_id_temp").style.cssText="width:"+e+"px",document.getElementById(t+"_slider_table2form_id_temp").style.cssText="width:"+e+"px",document.getElementById(t+"_slider_widthform_id_temp").value=e}function go_to_type_slider(e){w_attr_name=[],w_attr_value=[],type_slider(e,"Slider","","top","no","","0","100","1","0","no","",w_attr_name,w_attr_value)}function type_slider(i,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value){jQuery("#element_type").val("type_slider"),delete_last_child();var t=jQuery("#edit_table"),edit_div=jQuery('<div id="edit_div"></div>');t.append(edit_div);var edit_main_table=jQuery('<div id="edit_main_table"></div>');edit_div.append(edit_main_table),edit_main_table.append(create_field_type("type_slider")),edit_main_table.append(create_label(i,w_field_label)),edit_main_table.append(create_label_position(i,w_field_label_pos)),edit_main_table.append(create_hide_label(i,w_hide_label)),edit_main_table.append(create_required(i,w_required)),edit_main_table.append(create_slider_minvalue(i,w_field_min_value)),edit_main_table.append(create_slider_maxvalue(i,w_field_max_value)),edit_main_table.append(create_slider_step(i,w_field_step)),edit_main_table.append(create_slider_width(i,w_field_width));var advanced_options_container=jQuery('<div class="inside"></div>');edit_main_table.append(create_advanced_options_container(advanced_options_container)),advanced_options_container.append(create_field_label_size(i,w_field_label_size)),advanced_options_container.append(create_class(i,w_class)),advanced_options_container.append(create_additional_attributes(i,w_attr_name,"type_slider"));var adding_type=document.createElement("input");adding_type.setAttribute("type","hidden"),adding_type.setAttribute("value","type_slider"),adding_type.setAttribute("name",i+"_typeform_id_temp"),adding_type.setAttribute("id",i+"_typeform_id_temp");var adding_required=document.createElement("input");adding_required.setAttribute("type","hidden"),adding_required.setAttribute("value",w_required),adding_required.setAttribute("name",i+"_requiredform_id_temp"),adding_required.setAttribute("id",i+"_requiredform_id_temp");var adding_hide_label=document.createElement("input");adding_hide_label.setAttribute("type","hidden"),adding_hide_label.setAttribute("value",w_hide_label),adding_hide_label.setAttribute("name",i+"_hide_labelform_id_temp"),adding_hide_label.setAttribute("id",i+"_hide_labelform_id_temp");var adding_slider_min_value=document.createElement("input");adding_slider_min_value.setAttribute("type","hidden"),adding_slider_min_value.setAttribute("value",w_field_min_value),adding_slider_min_value.setAttribute("id",i+"_slider_min_valueform_id_temp"),adding_slider_min_value.setAttribute("name",i+"_slider_min_valueform_id_temp");var adding_slider_max_value=document.createElement("input");adding_slider_max_value.setAttribute("type","hidden"),adding_slider_max_value.setAttribute("value",w_field_max_value),adding_slider_max_value.setAttribute("id",i+"_slider_max_valueform_id_temp"),adding_slider_max_value.setAttribute("name",i+"_slider_max_valueform_id_temp");var adding_slider_step=document.createElement("input");adding_slider_step.setAttribute("type","hidden"),adding_slider_step.setAttribute("value",w_field_step),adding_slider_step.setAttribute("id",i+"_slider_stepform_id_temp"),adding_slider_step.setAttribute("name",i+"_slider_stepform_id_temp");var adding_slider_value=document.createElement("input");adding_slider_value.setAttribute("type","hidden"),adding_slider_value.setAttribute("value",w_field_value),adding_slider_value.setAttribute("id",i+"_slider_valueform_id_temp"),adding_slider_value.setAttribute("name",i+"_slider_valueform_id_temp");var adding_slider_width=document.createElement("input");adding_slider_width.setAttribute("type","hidden"),adding_slider_width.setAttribute("value",w_field_width),adding_slider_width.setAttribute("name",i+"_slider_widthform_id_temp"),adding_slider_width.setAttribute("id",i+"_slider_widthform_id_temp");var adding_slider_div=document.createElement("div");adding_slider_div.style.cssText="width:"+w_field_width+"px",adding_slider_div.setAttribute("name",i+"_elementform_id_temp"),adding_slider_div.setAttribute("id",i+"_elementform_id_temp");var div=document.createElement("div");div.setAttribute("id","main_div");var div_field=document.createElement("div");div_field.setAttribute("id",i+"_elemet_tableform_id_temp");var display_label_div="yes"==w_hide_label?"none":"table-cell",div_label=document.createElement("div");div_label.setAttribute("align","left"),div_label.style.cssText="display:"+display_label_div+"; vertical-align:top; width:"+w_field_label_size+"px;",div_label.setAttribute("id",i+"_label_sectionform_id_temp");var div_element=document.createElement("div");div_element.setAttribute("align","left"),div_element.style.display="table-cell",div_element.setAttribute("id",i+"_element_sectionform_id_temp");var slider_table=document.createElement("div");slider_table.setAttribute("id",i+"_slider_tableform_id_temp");var slider_tr1=document.createElement("div"),slider_tr2=document.createElement("div");slider_tr2.setAttribute("id",i+"_slider_table2form_id_temp"),slider_tr2.style.cssText="width:"+w_field_width+"px";var slider_td1=document.createElement("div");slider_td1.setAttribute("id",i+"_slider_td1form_id_temp");var slider_td2=document.createElement("div");slider_td2.setAttribute("align","left"),slider_td2.setAttribute("id",i+"_slider_td2form_id_temp"),slider_td2.style.cssText="display:inline-table; width:33.3%; text-align:left;";var slider_td3=document.createElement("div");slider_td3.setAttribute("align","right"),slider_td3.setAttribute("id",i+"_slider_td3form_id_temp"),slider_td3.style.cssText="display:inline-table; width:33.3%; text-align:center;";var slider_td4=document.createElement("div");slider_td4.setAttribute("align","right"),slider_td4.setAttribute("id",i+"_slider_td4form_id_temp"),slider_td4.style.cssText="display:inline-table; width:33.3%; text-align:right; ";var br1=document.createElement("br"),label=document.createElement("span");label.setAttribute("id",i+"_element_labelform_id_temp"),label.innerHTML=w_field_label,label.setAttribute("class","label");var required=document.createElement("span");required.setAttribute("id",i+"_required_elementform_id_temp"),required.innerHTML="",required.setAttribute("class","required"),"yes"==w_required&&(required.innerHTML=" *");var main_td=document.getElementById("show_table");div_label.appendChild(label),div_label.appendChild(required),div_element.appendChild(adding_hide_label),div_element.appendChild(adding_type),div_element.appendChild(adding_required),div_element.appendChild(adding_slider_width),div_element.appendChild(adding_slider_min_value),div_element.appendChild(adding_slider_max_value),div_element.appendChild(adding_slider_step),div_element.appendChild(adding_slider_value);var slider_min=document.createElement("span");slider_min.setAttribute("id",i+"_element_minform_id_temp"),slider_min.innerHTML=w_field_min_value,slider_min.setAttribute("class","label");var slider_max=document.createElement("span");slider_max.setAttribute("id",i+"_element_maxform_id_temp"),slider_max.innerHTML=w_field_max_value,slider_max.setAttribute("class","label");var slider_value=document.createElement("span");slider_value.setAttribute("id",i+"_element_valueform_id_temp"),slider_value.innerHTML=w_field_value,slider_value.setAttribute("class","label"),slider_td1.appendChild(adding_slider_div),slider_tr1.appendChild(slider_td1),slider_table.appendChild(slider_tr1),slider_td2.appendChild(slider_min),slider_tr2.appendChild(slider_td2),slider_table.appendChild(slider_tr2),slider_td3.appendChild(slider_value),slider_tr2.appendChild(slider_td3),slider_table.appendChild(slider_tr2),slider_td4.appendChild(slider_max),slider_tr2.appendChild(slider_td4),slider_table.appendChild(slider_tr2),div_element.appendChild(slider_table),div_field.appendChild(div_label),div_field.appendChild(div_element),div.appendChild(div_field),div.appendChild(br1),main_td.appendChild(div),jQuery("#main_div").append(form_maker.type_slider_description),"top"==w_field_label_pos&&label_top(i),change_class(w_class,i),refresh_attr(i,"type_slider"),jQuery("#"+i+"_elementform_id_temp")[0].slide=null,jQuery(function(){jQuery("#"+i+"_elementform_id_temp").slider({step:eval(w_field_step),range:"min",value:eval(w_field_value),min:eval(w_field_min_value),max:eval(w_field_max_value),slide:function(e,t){document.getElementById(i+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(i+"_slider_valueform_id_temp").value=""+t.value}})})}function create_range_step(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_spinner_step">Step</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_step" onKeyPress="return check_isnum(event)" onChange="change_range_step(this.value, '+e+", 'form_id_temp')\" value=\""+t+'" />'))}function change_range_step(e,t,i){jQuery("#"+t+"_elementform_id_temp0").spinner({step:e}),jQuery("#"+t+"_elementform_id_temp1").spinner({step:e}),document.getElementById(t+"_range_stepform_id_temp").value=e}function create_range_width(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_spinner_width">Width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_width" onKeyPress="return check_isnum(event)" onKeyUp="change_range_width(this.value, '+e+", 'form_id_temp')\" value=\""+t+'" />'))}function go_to_type_range(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["From","To"],type_range(e,"Range","","top","no","70","1","","",w_mini_labels,"no","",w_attr_name,w_attr_value)}function type_range(t,e,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_range"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('<div id="edit_div"></div>');p.append(f);var y=jQuery('<div id="edit_main_table"></div>');f.append(y),y.append(create_field_type("type_range")),y.append(create_label(t,e)),y.append(create_label_position(t,a)),y.append(create_hide_label(t,n)),y.append(create_required(t,m)),y.append(create_range_step(t,d)),y.append(create_range_width(t,l));var h=jQuery('<div class="inside"></div>');y.append(create_advanced_options_container(h)),h.append(create_field_label_size(t,i)),h.append(create_class(t,s)),h.append(create_additional_attributes(t,u,"type_range"));var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_range"),b.setAttribute("name",t+"_typeform_id_temp"),b.setAttribute("id",t+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",m),v.setAttribute("name",t+"_requiredform_id_temp"),v.setAttribute("id",t+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",t+"_hide_labelform_id_temp"),w.setAttribute("id",t+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",l),g.setAttribute("name",t+"_range_widthform_id_temp"),g.setAttribute("id",t+"_range_widthform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",d),E.setAttribute("name",t+"_range_stepform_id_temp"),E.setAttribute("id",t+"_range_stepform_id_temp");var A=document.createElement("input");A.setAttribute("type",""),A.setAttribute("value",_),A.style.cssText="width:"+l+"px",A.setAttribute("name",t+"_elementform_id_temp0"),A.setAttribute("id",t+"_elementform_id_temp0"),A.setAttribute("onKeyPress","return check_isnum_or_minus(event)");var j=document.createElement("input");j.setAttribute("type",""),j.setAttribute("value",r),j.style.cssText="width:"+l+"px",j.setAttribute("name",t+"_elementform_id_temp1"),j.setAttribute("id",t+"_elementform_id_temp1"),j.setAttribute("onKeyPress","return check_isnum_or_minus(event)");var x=document.createElement("label");x.setAttribute("class","mini_label mini_label_from"),x.setAttribute("id",t+"_mini_label_from"),x.innerHTML=o[0];var k=document.createElement("label");k.setAttribute("class","mini_label mini_label_to"),k.setAttribute("id",t+"_mini_label_to"),k.innerHTML=o[1];var I=document.createElement("div");I.setAttribute("id","main_div"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit.");var C=document.createElement("div");C.setAttribute("class","fm-editable-label"),C.appendChild(edit_labels);var B=document.createElement("div");B.setAttribute("id",t+"_elemet_tableform_id_temp");var Q="yes"==n?"none":"table-cell",T=document.createElement("div");T.setAttribute("align","left"),T.style.display=Q,T.style.width=i+"px",T.setAttribute("id",t+"_label_sectionform_id_temp");var M=document.createElement("div");M.setAttribute("align","left"),M.style.display="table-cell",M.setAttribute("id",t+"_element_sectionform_id_temp");var L=document.createElement("div");L.setAttribute("id",t+"_elemet_table_littleform_id_temp"),L.style.display="table";var z=document.createElement("div");z.style.display="table-row";var q=document.createElement("div");q.style.display="table-row";var H=document.createElement("div");H.setAttribute("valign","middle"),H.setAttribute("align","left"),H.style.display="table-cell";var N=document.createElement("div");N.setAttribute("valign","middle"),N.setAttribute("align","left"),N.style.cssText="display:table-cell; padding-left:4px;";var S=document.createElement("div");S.setAttribute("valign","top"),S.setAttribute("align","left"),S.style.display="table-cell";var D=document.createElement("div");D.setAttribute("valign","top"),D.setAttribute("align","left"),D.style.display="table-cell";var P=document.createElement("br"),O=document.createElement("span");O.setAttribute("id",t+"_element_labelform_id_temp"),O.innerHTML=e,O.setAttribute("class","label");var K=document.createElement("span");K.setAttribute("id",t+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),"yes"==m&&(K.innerHTML=" *");var U=document.getElementById("show_table");T.appendChild(O),T.appendChild(K),M.appendChild(b),M.appendChild(v),M.appendChild(w),M.appendChild(g),M.appendChild(E),H.appendChild(A),N.appendChild(j),S.appendChild(x),D.appendChild(k),z.appendChild(H),z.appendChild(N),q.appendChild(S),q.appendChild(D),L.appendChild(z),L.appendChild(q),M.appendChild(L),B.appendChild(T),B.appendChild(M),I.appendChild(B),I.appendChild(P),I.appendChild(C),U.appendChild(I),jQuery("#main_div").append("<br>"+form_maker.type_range_description),"top"==a&&label_top(t),change_class(s,t),refresh_attr(t,"type_range"),jQuery("#"+t+"_elementform_id_temp0").spinner();jQuery("#"+t+"_elementform_id_temp0").spinner();jQuery("#"+t+"_elementform_id_temp0").spinner({step:d}),jQuery("#"+t+"_elementform_id_temp1").spinner();jQuery("#"+t+"_elementform_id_temp1").spinner();jQuery("#"+t+"_elementform_id_temp1").spinner({step:d}),jQuery(function(){jQuery("label#"+t+"_mini_label_from").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='form' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.form").focus(),jQuery("input.form").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_from").text(e)})}}),jQuery("label#"+t+"_mini_label_to").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='to' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.to").focus(),jQuery("input.to").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_to").text(e)})}})})}function create_hidden_name(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_hidden_name">Name</label>'),jQuery('<input type="text" class="fm-width-100" id="el_hidden_name" onChange="change_field_name('+e+', this)" value="'+t+'" />'))}function change_field_name(e,t){if(value=t.value,value==parseInt(value))return alert("The name of the field cannot be a number."),t.value="",document.getElementById(e+"_elementform_id_temp").name="",document.getElementById(e+"_element_labelform_id_temp").innerHTML="",void(document.getElementById(e+"_hidden_nameform_id_temp").innerHTML="");value==e+"_elementform_id_temp"?(alert('"Field Name" should differ from "Field Id".'),t.value=""):(document.getElementById(e+"_elementform_id_temp").name=value,document.getElementById(e+"_element_labelform_id_temp").innerHTML=value,document.getElementById(e+"_hidden_nameform_id_temp").innerHTML=value)}function create_hidden_value(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_hidden_value">Value</label>'),jQuery('<input type="text" class="fm-width-100" id="el_hidden_value" onChange="change_field_value('+e+', this.value)" value="'+t+'" />'))}function change_field_value(e,t){document.getElementById(e+"_elementform_id_temp").value=t,document.getElementById(e+"_hidden_valueform_id_temp").innerHTML=t}function go_to_type_hidden(e){w_attr_name=[],w_attr_value=[],type_hidden(e,"","","",w_attr_name,w_attr_value)}function type_hidden(e,t,i,a,n){jQuery("#element_type").val("type_hidden"),delete_last_child();var l=jQuery("#edit_table"),d=jQuery('<div id="edit_div"></div>');l.append(d);var _=jQuery('<div id="edit_main_table"></div>');d.append(_),_.append(create_field_type("type_hidden")),_.append(create_hidden_name(e,t)),_.append(create_hidden_value(e,i));var r=jQuery('<div class="inside"></div>');_.append(create_advanced_options_container(r)),r.append(create_additional_attributes(e,a,"type_hidden")),element="input",type="hidden";var o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("value","type_hidden"),o.setAttribute("name",e+"_typeform_id_temp"),o.setAttribute("id",e+"_typeform_id_temp");var m=document.createElement(element);m.setAttribute("type",type),m.setAttribute("value",i),m.setAttribute("id",e+"_elementform_id_temp"),m.setAttribute("name",t);var s=document.createElement("div");s.setAttribute("id","main_div");var u=document.createElement("div");u.setAttribute("id",e+"_elemet_tableform_id_temp");var c=document.createElement("div");c.setAttribute("align","left"),c.style.display="table-cell",c.setAttribute("id",e+"_label_sectionform_id_temp");var p=document.createElement("div");p.setAttribute("align","left"),p.style.cssText="display:table-cell; padding-left: 7px;",p.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var f=document.createElement("br"),y=(document.createElement("br"),document.createElement("span"));y.setAttribute("id",e+"_element_labelform_id_temp"),y.style.cssText="display:none",y.innerHTML=t;var h=document.createElement("span");h.style.cssText="color:red; font-size:13px;",h.innerHTML="Hidden field";var b=document.createElement("div"),v=document.createElement("span");v.setAttribute("align","left"),v.innerHTML="Name: ";var w=document.createElement("span");w.setAttribute("align","left"),w.innerHTML=t,w.setAttribute("id",e+"_hidden_nameform_id_temp");var g=document.createElement("div"),E=document.createElement("span");E.setAttribute("align","left"),E.innerHTML="Value: ";var A=document.createElement("span");A.setAttribute("align","left"),A.innerHTML=i,A.setAttribute("id",e+"_hidden_valueform_id_temp"),b.appendChild(v),b.appendChild(w),g.appendChild(E),g.appendChild(A);var j=document.getElementById("show_table");c.appendChild(y),c.appendChild(h),p.appendChild(m),p.appendChild(o),p.appendChild(b),p.appendChild(g),u.appendChild(c),u.appendChild(p),s.appendChild(u),s.appendChild(f),j.appendChild(s),jQuery("#main_div").append(form_maker.type_hidden_description),refresh_attr(e,"type_text")}function create_captcha_digits(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="captcha_digit">Symbols (3 - 9)</label>'),jQuery('<input class="fm-width-100" type="text" id="captcha_digit" onKeyPress="return check_isnum_3_10(event)" onKeyUp="change_captcha_digit(this.value, '+e+')" value="'+t+'" />'))}function check_isnum_3_10(e){var t=e.which||e.keyCode;return!(31<t&&(t<51||57<t))&&!(9<document.getElementById("captcha_digit").value+(t-48))}function go_to_type_captcha(e){w_attr_name=[],w_attr_value=[],type_captcha(e,"Word Verification","","top","yes","6","",w_attr_name,w_attr_value)}function type_captcha(e,t,i,a,n,l,d,_,r){jQuery("#element_type").val("type_captcha"),delete_last_child();var o=jQuery("#edit_table"),m=jQuery('<div id="edit_div"></div>');o.append(m);var s=jQuery('<div id="edit_main_table"></div>');m.append(s),s.append(create_field_type("type_captcha")),s.append(create_label(e,t)),s.append(create_label_position(e,a)),s.append(create_hide_label(e,n)),s.append(create_captcha_digits(e,l));var u=jQuery('<div class="inside"></div>');s.append(create_advanced_options_container(u)),u.append(create_field_label_size(e,i)),u.append(create_class(e,d)),u.append(create_additional_attributes(e,_,"type_captcha")),element="img",type="captcha";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("value","type_captcha"),c.setAttribute("name",e+"_typeform_id_temp"),c.setAttribute("id",e+"_typeform_id_temp");var p=document.createElement(element);p.setAttribute("type",type),p.setAttribute("digit",l),p.setAttribute("src",url_for_ajax+"?action=formmakerwdcaptcha&digit="+l+"&i=form_id_temp"),p.setAttribute("id","_wd_captchaform_id_temp"),p.setAttribute("class","captcha_img"),p.setAttribute("onClick","captcha_refresh('_wd_captcha','form_id_temp')");var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value",n),f.setAttribute("name",e+"_hide_labelform_id_temp"),f.setAttribute("id",e+"_hide_labelform_id_temp");var y=document.createElement("div");y.setAttribute("class","captcha_refresh"),y.setAttribute("id","_element_refreshform_id_temp"),y.setAttribute("onClick","captcha_refresh('_wd_captcha','form_id_temp')");var h=document.createElement("input");h.setAttribute("type","text"),h.style.cssText="width:"+(10*l+15)+"px;",h.setAttribute("class","captcha_input"),h.setAttribute("id","_wd_captcha_inputform_id_temp"),h.setAttribute("name","captcha_input");var b=document.createElement("div");b.setAttribute("id","main_div");var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==n?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.setAttribute("id",e+"_element_sectionform_id_temp");var A=document.createElement("div");A.style.display="table";var j=document.createElement("div");j.style.display="table-row";var x=document.createElement("div");x.style.display="table-row";var k=document.createElement("div");k.setAttribute("valign","middle"),k.style.display="table-cell";var I=document.createElement("div");I.setAttribute("valign","middle"),I.style.display="table-cell";var C=document.createElement("div");C.style.display="table-cell",A.appendChild(j),A.appendChild(x),j.appendChild(k),j.appendChild(I),x.appendChild(C),k.appendChild(p),I.appendChild(y),C.appendChild(h);document.createElement("br"),document.createElement("br");var B=document.createElement("br"),Q=(document.createElement("br"),document.createElement("span"));Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label"),Q.style.verticalAlign="top";var T=document.getElementById("show_table");g.appendChild(Q),E.appendChild(c),E.appendChild(f),E.appendChild(A),v.appendChild(g),v.appendChild(E),b.appendChild(v),b.appendChild(B),T.appendChild(b),jQuery("#main_div").append(form_maker.type_captcha_description),"top"==a&&label_top(e),change_class(d,e),refresh_attr(e,"type_captcha")}function create_arithmetic_operations(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_operations">Operations</label>'),jQuery('<input type="text" class="fm-width-100" id="el_operations" onKeyPress="return check_is_operation_valid(event)" onChange="change_arithmetic_captcha(this.value, \'operations\')" value="'+t+'" />'))}function check_is_operation_valid(e){var t=e.which||e.keyCode;return!(46==t||t<42||47<t)}function change_arithmetic_captcha(e,t){arithmetic_captcha=document.getElementById("_wd_arithmetic_captchaform_id_temp"),"oper_count"==t?(oper_count=e||1,operations=document.getElementById("el_operations")?document.getElementById("el_operations").value:"+, -, *, /"):oper_count=(operations="el_operations"==t?e||"+, -, *, /":document.getElementById("el_operations")?document.getElementById("el_operations").value:"+, -, *, /",document.getElementById("el_oper_count")?document.getElementById("el_oper_count").value:1),input_size=document.getElementById("el_captcha_input_size")?document.getElementById("el_captcha_input_size").value:60,arithmetic_captcha.setAttribute("operations_count",oper_count),arithmetic_captcha.setAttribute("operations",operations),arithmetic_captcha.setAttribute("input_size",input_size),arithmetic_captcha.setAttribute("src",url_for_ajax+"?action=formmakerwdmathcaptcha&operations_count="+oper_count+"&nonce="+fm_ajax.ajaxnonce+"&operations="+operations.replace("+","@")+"&i=form_id_temp")}function create_arithmetic_operations_count(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_oper_count">Operations count (1 - 5)</label>'),jQuery('<input type="text" class="fm-width-100" id="el_oper_count" onKeyPress="return check_isnum_less_then_5(event)" onChange="change_arithmetic_captcha(this.value, \'oper_count\')" value="'+t+'" />'))}function check_isnum_less_then_5(e){var t=e.which||e.keyCode;return!(31<t&&(t<49||57<t))&&!(5<document.getElementById("el_oper_count").value+(t-48))}function create_arithmetic_width(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_captcha_input_size">Input width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="el_captcha_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\'_wd_arithmetic_captcha_inputform_id_temp\', this.value); change_arithmetic_captcha();" value="'+t+'" />'))}function go_to_type_arithmetic_captcha(e){w_attr_name=[],w_attr_value=[],type_arithmetic_captcha(e,"Word Verification","","top","yes","1","+, -, *, /","","60",w_attr_name,w_attr_value)}function type_arithmetic_captcha(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_arithmetic_captcha"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('<div id="edit_div"></div>');s.append(u);var c=jQuery('<div id="edit_main_table"></div>');u.append(c),c.append(create_field_type("type_arithmetic_captcha")),c.append(create_label(e,t)),c.append(create_label_position(e,a)),c.append(create_hide_label(e,n)),c.append(create_arithmetic_operations(e,d)),c.append(create_arithmetic_operations_count(e,l)),c.append(create_arithmetic_width(e,r));var p=jQuery('<div class="inside"></div>');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(e,i)),p.append(create_class(e,_)),p.append(create_additional_attributes(e,o,"type_arithmetic_captcha"));var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_arithmetic_captcha"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("img");y.setAttribute("type","captcha"),y.setAttribute("operations_count",l),y.setAttribute("operations",d),y.setAttribute("input_size",r),y.setAttribute("src",url_for_ajax+"?action=formmakerwdmathcaptcha&operations_count="+l+"&operations="+d.replace("+","@")+"&i=form_id_temp"),y.setAttribute("id","_wd_arithmetic_captchaform_id_temp"),y.setAttribute("class","arithmetic_captcha_img"),y.setAttribute("onClick","captcha_refresh('_wd_arithmetic_captcha','form_id_temp')");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("div");b.setAttribute("class","captcha_refresh"),b.setAttribute("id","_element_refreshform_id_temp"),b.setAttribute("onClick","captcha_refresh('_wd_arithmetic_captcha','form_id_temp')");var v=document.createElement("input");v.setAttribute("type","text"),v.style.cssText="width:"+r+"px;",v.setAttribute("class","arithmetic_captcha_input"),v.setAttribute("id","_wd_arithmetic_captcha_inputform_id_temp"),v.setAttribute("name","arithmetic_captcha_input"),v.setAttribute("onKeyPress","return check_isnum(event)");var w=document.createElement("div");w.setAttribute("id","main_div");var g=document.createElement("div");g.setAttribute("id",e+"_elemet_tableform_id_temp");var E="yes"==n?"none":"table-cell",A=document.createElement("div");A.setAttribute("align","left"),A.style.display=E,A.style.width=i+"px",A.setAttribute("id",e+"_label_sectionform_id_temp");var j=document.createElement("div");j.setAttribute("align","left"),j.style.display="table-cell",j.setAttribute("id",e+"_element_sectionform_id_temp");var x=document.createElement("div");x.style.display="table";var k=document.createElement("div");k.style.display="table-row";var I=document.createElement("div");I.style.display="table-row";var C=document.createElement("div");C.style.display="table-cell";var B=document.createElement("div");B.style.cssText="display:table-cell; vertical-align:middle;";var Q=document.createElement("div");Q.style.display="table-cell",x.appendChild(k),x.appendChild(I),k.appendChild(C),k.appendChild(Q),k.appendChild(B),C.appendChild(y),B.appendChild(b),Q.appendChild(v);document.createElement("br"),document.createElement("br");var T=document.createElement("br"),M=(document.createElement("br"),document.createElement("span"));M.setAttribute("id",e+"_element_labelform_id_temp"),M.innerHTML=t,M.setAttribute("class","label"),M.style.verticalAlign="top";var L=document.getElementById("show_table");A.appendChild(M),j.appendChild(f),j.appendChild(h),j.appendChild(x),g.appendChild(A),g.appendChild(j),w.appendChild(g),w.appendChild(T),L.appendChild(w),jQuery("#main_div").append(form_maker.type_arithmetic_captcha_description),"top"==a&&label_top(e),change_class(_,e),refresh_attr(e,"type_arithmetic_captcha")}function create_field_size_phone(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_input_size">Width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_input_size" onKeyPress="return check_isnum(event)" onKeyUp="change_w_style(\''+e+'_element_lastform_id_temp\', this.value)" value="'+t+'" /><p class="description">'+form_maker.leave_empty+"</p>"))}function create_placeholder_phone(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_first_value_area">Placeholder</label>'),jQuery('<input type="text" class="fm-width-20" id="el_first_value_area" onKeyUp="change_input_value(this.value,\''+e+'_element_firstform_id_temp\')" value="'+t[0].replace(/"/g,"&quot;")+'" />-<input type="text" class="fm-width-60" id="el_first_value_phone" onKeyUp="change_input_value(this.value,\''+e+'_element_lastform_id_temp\')" value="'+t[1].replace(/"/g,"&quot;")+'" />'))}function go_to_type_phone(e){w_attr_name=[],w_attr_value=[],w_first_val=["",""],w_title=["",""],w_mini_labels=["Area Code","Phone Number"],type_phone(e,"Phone-Area Code","","top","no","",w_first_val,w_title,w_mini_labels,"no","no","",w_attr_name,w_attr_value)}function type_phone(t,e,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_phone"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('<div id="edit_div"></div>');p.append(f);var y=jQuery('<div id="edit_main_table"></div>');f.append(y),y.append(create_field_type("type_phone")),y.append(create_label(t,e)),y.append(create_label_position(t,a)),y.append(create_hide_label(t,n)),y.append(create_required(t,o)),y.append(create_field_size_phone(t,l)),y.append(create_placeholder_phone(t,_));var h=jQuery('<div class="inside"></div>');y.append(create_advanced_options_container(h)),h.append(create_unique_values(t,m)),h.append(create_field_label_size(t,i)),h.append(create_class(t,s)),h.append(create_additional_attributes(t,u,"type_phone"));var b=document.createElement("br"),v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value","type_phone"),v.setAttribute("name",t+"_typeform_id_temp"),v.setAttribute("id",t+"_typeform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",o),w.setAttribute("name",t+"_requiredform_id_temp"),w.setAttribute("id",t+"_requiredform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",n),g.setAttribute("name",t+"_hide_labelform_id_temp"),g.setAttribute("id",t+"_hide_labelform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",m),E.setAttribute("name",t+"_uniqueform_id_temp"),E.setAttribute("id",t+"_uniqueform_id_temp");var A=document.createElement("div");A.setAttribute("id","main_div");var j=document.createElement("div");j.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),j.appendChild(edit_labels);var x=document.createElement("div");x.setAttribute("id",t+"_elemet_tableform_id_temp");var k="yes"==n?"none":"table-cell",I=document.createElement("div");I.setAttribute("align","left"),I.style.display=k,I.style.width=i+"px",I.setAttribute("id",t+"_label_sectionform_id_temp");var C=document.createElement("div");C.setAttribute("align","left"),C.style.display="table-cell",C.setAttribute("id",t+"_element_sectionform_id_temp");var B=document.createElement("div");B.style.display="table",B.setAttribute("id",t+"_table_name");var Q=document.createElement("div");Q.style.display="table-row",Q.setAttribute("id",t+"_tr_name1");var T=document.createElement("div");T.style.display="table-row",T.setAttribute("id",t+"_tr_name2");var M=document.createElement("div");M.style.display="table-cell",M.setAttribute("id",t+"_td_name_input_first");var L=document.createElement("div");L.style.display="table-cell",L.setAttribute("id",t+"_td_name_input_last");var z=document.createElement("div");z.style.display="table-cell",z.setAttribute("id",t+"_td_name_label_first"),z.setAttribute("align","left");var q=document.createElement("div");q.style.display="table-cell",q.setAttribute("id",t+"_td_name_label_last"),q.setAttribute("align","left");var H=document.createElement("span");H.setAttribute("id",t+"_element_labelform_id_temp"),H.innerHTML=e,H.setAttribute("class","label"),H.style.verticalAlign="top";var N=document.createElement("span");N.setAttribute("id",t+"_required_elementform_id_temp"),N.innerHTML="",N.setAttribute("class","required"),"yes"==o&&(N.innerHTML=" *");var S=document.createElement("input");S.setAttribute("type","text"),S.style.cssText="width:50px",S.setAttribute("id",t+"_element_firstform_id_temp"),S.setAttribute("name",t+"_element_firstform_id_temp"),S.setAttribute("value",d[0]),S.setAttribute("title",_[0]),S.setAttribute("placeholder",_[0]),S.setAttribute("onKeyPress","return check_isnum(event)");var D=document.createElement("span");D.setAttribute("class","wdform_line"),D.style.cssText="margin: 0px 4px 0px 4px; padding: 0px;",D.innerHTML="-";var P=document.createElement("label");P.setAttribute("class","mini_label mini_label_area_code"),P.setAttribute("id",t+"_mini_label_area_code"),P.innerHTML=r[0];var O=document.createElement("input");O.setAttribute("type","text"),O.style.cssText="width:"+l+"px",O.setAttribute("id",t+"_element_lastform_id_temp"),O.setAttribute("name",t+"_element_lastform_id_temp"),O.setAttribute("value",d[1]),O.setAttribute("title",_[1]),O.setAttribute("placeholder",_[1]),O.setAttribute("onKeyPress","return check_isnum(event)");var K=document.createElement("label");K.setAttribute("class","mini_label mini_label_phone_number"),K.setAttribute("id",t+"_mini_label_phone_number"),K.innerHTML=r[1];var U=document.getElementById("show_table");I.appendChild(H),I.appendChild(N),M.appendChild(S),M.appendChild(D),L.appendChild(O),Q.appendChild(M),Q.appendChild(L),z.appendChild(P),q.appendChild(K),T.appendChild(z),T.appendChild(q),B.appendChild(Q),B.appendChild(T),C.appendChild(v),C.appendChild(w),C.appendChild(g),C.appendChild(E),C.appendChild(B),x.appendChild(I),x.appendChild(C),A.appendChild(x),A.appendChild(b),A.appendChild(j),U.appendChild(A),jQuery("#main_div").append("<br>"+form_maker.type_phone_area_code_description),"top"==a&&label_top(t),change_class(s,t),refresh_attr(t,"type_name"),jQuery(function(){jQuery("label#"+t+"_mini_label_area_code").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.area_code").focus(),jQuery("input.area_code").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_area_code").text(e)})}}),jQuery("label#"+t+"_mini_label_phone_number").click(function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.phone_number").focus(),jQuery("input.phone_number").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_phone_number").text(e)})}})})}function create_confirmation_password(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="el_verification_password">Password Confirmation</label>'),jQuery('<input type="checkbox" id="el_verification_password" onclick="verification_password('+e+')"'+("yes"==t?' checked="checked"':"")+" />"))}function verification_password(e){document.getElementById("el_verification_password").checked?(document.getElementById("confirm_validation_label").style.display="block",document.getElementById(e+"_verification_id_temp").value="yes",document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById("confirm_validation_label").style.display="none",document.getElementById(e+"_verification_id_temp").value="no",document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none")}function create_confirmation_password_label(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_label">Confirmation label</label>'),jQuery('<textarea id="edit_for_label" class="fm-width-100" onKeyUp="change_label(\''+e+"_element_labelform_id_temp', this.value, '"+e+'_1_element_labelform_id_temp\')" rows="4">'+i+"</textarea>"),"confirm_validation_label","yes"==t)}function go_to_type_password(e){w_placeholder_value="",w_attr_name=[],w_attr_value=[],type_password(e,"Password","","top","no","","no","no","wdform_input","no","Password confirmation",w_placeholder_value,w_attr_name,w_attr_value)}function type_password(e,t,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_password"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('<div id="edit_div"></div>');p.append(f);var y=jQuery('<div id="edit_main_table"></div>');f.append(y),y.append(create_field_type("type_password")),y.append(create_label(e,t)),y.append(create_label_position(e,a)),y.append(create_hide_label(e,n)),y.append(create_required(e,d)),y.append(create_field_size(e,l,"'"+e+"_elementform_id_temp'","'"+e+"_1_elementform_id_temp'"));var h=jQuery('<div class="inside"></div>');y.append(create_advanced_options_container(h)),h.append(create_confirmation_password(e,o)),h.append(create_confirmation_password_label(e,o,m)),h.append(create_field_label_size(e,i,"'"+e+"_label_sectionform_id_temp'","'"+e+"_1_label_sectionform_id_temp'")),h.append(create_class(e,r)),h.append(create_additional_attributes(e,u,"type_password")),element="input",type="password";var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_password"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",d),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",_),w.setAttribute("name",e+"_uniqueform_id_temp"),w.setAttribute("id",e+"_uniqueform_id_temp");var g=document.createElement(element);g.setAttribute("type",type),g.setAttribute("autocomplete","new-password"),g.setAttribute("id",e+"_elementform_id_temp"),g.setAttribute("name",e+"_elementform_id_temp"),g.setAttribute("placeholder",s),g.style.cssText="width:"+l+"px;";var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",n),E.setAttribute("name",e+"_hide_labelform_id_temp"),E.setAttribute("id",e+"_hide_labelform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",o),A.setAttribute("name",e+"_verification_id_temp"),A.setAttribute("id",e+"_verification_id_temp");var j=document.createElement(element);j.setAttribute("type",type),j.setAttribute("autocomplete","new-password"),j.style.cssText="width:"+l+"px;",j.setAttribute("id",e+"_1_elementform_id_temp"),j.setAttribute("name",e+"_1_elementform_id_temp");var x="yes"==n||"no"==o?"none":"table-cell",k=document.createElement("div");k.setAttribute("align","left"),k.style.display=x,k.style.width=i+"px",k.setAttribute("id",e+"_1_label_sectionform_id_temp");var I="no"==o?"none":"table-cell",C=document.createElement("div");C.setAttribute("align","left"),C.style.display=I,C.setAttribute("id",e+"_1_element_sectionform_id_temp");var B=document.createElement("span");B.setAttribute("id",e+"_1_element_labelform_id_temp"),B.innerHTML=m,B.setAttribute("class","label"),B.style.verticalAlign="top";var Q=document.createElement("span");Q.setAttribute("id",e+"_1_required_elementform_id_temp"),Q.innerHTML="",Q.setAttribute("class","required"),Q.style.verticalAlign="top","yes"==d&&(Q.innerHTML=" *"),k.appendChild(B),k.appendChild(Q);var T=document.createElement("div");T.setAttribute("id","main_div");var M=document.createElement("div");M.setAttribute("id",e+"_elemet_tableform_id_temp");var L="yes"==n?"none":"table-cell",z=document.createElement("div");z.setAttribute("align","left"),z.style.display=L,z.style.width=i+"px",z.setAttribute("id",e+"_label_sectionform_id_temp");var q=document.createElement("div");q.setAttribute("align","left"),q.style.display="table-cell",q.setAttribute("id",e+"_element_sectionform_id_temp");var H=document.createElement("span");H.setAttribute("id",e+"_element_labelform_id_temp"),H.innerHTML=t,H.setAttribute("class","label"),H.style.verticalAlign="top";var N=document.createElement("span");N.setAttribute("id",e+"_required_elementform_id_temp"),N.innerHTML="",N.setAttribute("class","required"),N.style.verticalAlign="top","yes"==d&&(N.innerHTML=" *");var S=document.getElementById("show_table"),D=document.createElement("br");z.appendChild(H),z.appendChild(N),q.appendChild(b),q.appendChild(v),q.appendChild(E),q.appendChild(A),q.appendChild(w),q.appendChild(g),M.appendChild(z),M.appendChild(q),C.appendChild(j),M.appendChild(D),M.appendChild(k),M.appendChild(C),T.appendChild(M),S.appendChild(T),jQuery("#main_div").append(form_maker.type_password_description),"top"==a&&label_top(e),change_class(r,e),refresh_attr(e,"type_text")}function create_custom_button_add(e,t,i){var a=jQuery('<label class="fm-field-label">Add a new button</label>'),l=jQuery('<span class="fm-add-attribute dashicons dashicons-plus-alt" title="Add" onClick="add_button('+e+')"></span>'),d=jQuery('<div id="buttons" class="fm-width-100"></div>');for(n=t.length,j=0;j<n;j++){var _=jQuery('<div class="fm-width-100 fm-fields-set" id="button_opt'+j+'" idi="'+j+'"></div>'),r=jQuery('<div class="fm-width-90"></div>');r.append(create_custom_button_name(e,j,t[j])),r.append(create_custom_button_function(e,j,i[j])),_.append(r);var o=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_button('+j+", "+e+')"></span></div>');_.append(o),d.append(_)}var m=a;return create_option_container(null,m=(m=m.add(l)).add(d))}function create_custom_button_name(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_title'+t+'">Name</label>'),jQuery('<input type="text" class="fm-width-100" id="el_title'+t+'" onChange="change_label(\''+e+"_elementform_id_temp"+t+'\', this.value)" value="'+i+'" />'))}function create_custom_button_function(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="el_func'+t+'">OnClick</label>'),jQuery('<input type="text" class="fm-width-100" id="el_func'+t+'" onChange="change_func(\''+e+"_elementform_id_temp"+t+'\', this.value)" value="'+i+'" />'))}function add_button(e){var t=jQuery("#buttons"),i=t.children().last();0<i.length?j=parseInt(i.prop("idi"))+1:j=0;var a=jQuery('<div class="fm-width-100 fm-fields-set" id="button_opt'+j+'" idi="'+j+'"></div>'),n=jQuery('<div class="fm-width-90"></div>');n.append(create_custom_button_name(e,j,"Button")),n.append(create_custom_button_function(e,j,"")),a.append(n);var l=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_button('+j+", "+e+')"></span></div>');a.append(l),t.append(a),element="button",type="button",td2=document.getElementById(e+"_element_sectionform_id_temp");var d=document.createElement(element);d.setAttribute("type",type),d.setAttribute("id",e+"_elementform_id_temp"+j),d.setAttribute("name",e+"_elementform_id_temp"+j),d.setAttribute("value","Button"),d.innerHTML="Button",d.setAttribute("onclick",""),td2.appendChild(d),refresh_attr(e,"type_checkbox")}function remove_button(e,t){table=document.getElementById("button_opt"+e),button=document.getElementById(t+"_elementform_id_temp"+e),table.parentNode.removeChild(table),button.parentNode.removeChild(button)}function go_to_type_button(e){w_title=["Button"],w_func=[""],w_attr_name=[],w_attr_value=[],type_button(e,w_title,w_func,"wdform_button",w_attr_name,w_attr_value)}function type_button(e,t,i,a,l,d){jQuery("#element_type").val("type_button"),delete_last_child();var _=jQuery("#edit_table"),r=jQuery('<div id="edit_div"></div>');_.append(r);var o=jQuery('<div id="edit_main_table"></div>');r.append(o),o.append(create_field_type("type_button")),o.append(create_custom_button_add(e,t,i));var m=jQuery('<div class="inside"></div>');o.append(create_advanced_options_container(m)),m.append(create_class(e,a)),m.append(create_additional_attributes(e,l,"type_button")),element="button",type="button";var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("value","type_button"),s.setAttribute("name",e+"_typeform_id_temp"),s.setAttribute("id",e+"_typeform_id_temp");var u=document.createElement("div");u.setAttribute("id","main_div");var c=document.createElement("div");c.setAttribute("id",e+"_elemet_tableform_id_temp");var p=document.createElement("div");p.setAttribute("align","left"),p.style.display="table-cell",p.setAttribute("id",e+"_label_sectionform_id_temp");var f=document.createElement("div");f.setAttribute("align","left"),f.style.display="table-cell",f.setAttribute("id",e+"_element_sectionform_id_temp");var y=document.createElement("br"),h=(document.createElement("br"),document.createElement("br"),document.createElement("br"),document.createElement("span"));for(h.setAttribute("id",e+"_element_labelform_id_temp"),h.innerHTML="button_"+e,h.style.cssText="display:none",n=t.length,j=0;j<n;j++){var b=document.createElement(element);b.setAttribute("type",type),b.setAttribute("id",e+"_elementform_id_temp"+j),b.setAttribute("class","button button-secondary button-large"),b.setAttribute("name",e+"_elementform_id_temp"+j),b.setAttribute("value",t[j]),b.innerHTML=t[j],b.setAttribute("onclick",i[j]),f.appendChild(b)}var v=document.getElementById("show_table");p.appendChild(h),f.appendChild(s),c.appendChild(p),c.appendChild(f),u.appendChild(c),u.appendChild(y),v.appendChild(u),jQuery("#main_div").append(form_maker.type_button_description),change_class(a,e),refresh_attr(e,"type_checkbox")}function create_grading_total(e,t){return create_option_container(jQuery('<label class="fm-field-label" for="element_total">Total</label>'),jQuery('<input class="fm-width-100" type="text" id="element_total" onKeyPress="return check_isnum_or_minus(event)" onKeyUp="change_total(this.value,'+e+')" value="'+t+'" />'))}function check_isnum_or_minus(e){var t=e.which||e.keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t&&(t<35||40<t))}function change_total(e,t){""==e&&(e=0),document.getElementById(t+"_grading_totalform_id_temp").value=e,0==(document.getElementById(t+"_total_elementform_id_temp").innerHTML=e)?jQuery("#"+t+"_element_total_divform_id_temp").hide():jQuery("#"+t+"_element_total_divform_id_temp").show()}function create_grading_items(e,t){var i=jQuery('<label class="fm-field-label">Items</label>'),a=jQuery('<span class="fm-add-attribute dashicons dashicons-plus-alt" title="Add" id="el_items_add" onClick="add_grading_items('+e+')"></span>'),l=jQuery('<div id="items" class="fm-width-100"></div>');for(n=t.length,j=0;j<n;j++){var d=jQuery('<div class="fm-width-100 fm-fields-set" id="item_row_'+j+'" idi="'+j+'"></div>'),_=jQuery('<div class="fm-width-90"></div>');_.append(create_grading_item(e,j,t[j])),d.append(_);var r=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_grading_items('+j+", "+e+')"></span></div>');d.append(r),l.append(d)}var o=i;return create_option_container(null,o=(o=o.add(a)).add(l))}function create_grading_item(e,t,i){jQuery('<label class="fm-field-label" for="el_title'+t+'">Name</label>');return create_option_container(null,jQuery('<input type="text" class="fm-width-100" id="el_items'+t+'" onChange="change_label(\''+e+"_label_elementform_id_temp"+t+"', this.value); change_in_value('"+e+"_label_elementform_id_temp"+t+'\', this.value)" value="'+i+'" />'))}function add_grading_items(e){for(i=100;0<i&&!document.getElementById("el_items"+i);i--);m=i+1;var t=jQuery("#items"),a=jQuery('<div class="fm-width-100 fm-fields-set" id="item_row_'+m+'" idi="'+m+'"></div>'),n=jQuery('<div class="fm-width-90"></div>');n.append(create_grading_item(e,m,"")),a.append(n);var l=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_grading_items('+m+", "+e+')"></span></div>');a.append(l),t.append(a),refresh_grading_items(e)}function remove_grading_items(e,t){var i=document.getElementById("items"),a=document.getElementById("item_row_"+e);i.removeChild(a),refresh_grading_items(t)}function refresh_grading_items(e){for(i=100;0<i&&!document.getElementById("el_items"+i);i--);m=i;var t=document.getElementById(e+"_elementform_id_temp");for(t.innerHTML="",i=0;i<=m;i++)if(document.getElementById("el_items"+i)){var a=document.createElement("div");a.setAttribute("id",e+"_element_div"+i),a.setAttribute("class","grading");var n=document.createElement("input");n.setAttribute("id",e+"_elementform_id_temp_"+i),n.setAttribute("name",e+"_elementform_id_temp_"+i),n.setAttribute("onKeyPress","return check_isnum_or_minus(event)"),n.setAttribute("value",""),n.setAttribute("size","5"),n.setAttribute("type","text"),n.setAttribute("onKeyUp","sum_grading_values("+e+",'form_id_temp')"),n.setAttribute("onChange","sum_grading_values("+e+",'form_id_temp')");var l=document.createElement("label");l.setAttribute("id",e+"_label_elementform_id_temp"+i),l.setAttribute("class","ch-rad-label"),l.innerHTML=document.getElementById("el_items"+i).value,a.appendChild(n),a.appendChild(l),t.appendChild(a)}var d=document.createElement("div");d.setAttribute("id",e+"_element_total_divform_id_temp"),d.setAttribute("class","grading_div");var _=document.getElementById(e+"_grading_totalform_id_temp").value;d.style.display=""!=_&&"0"!=_?"block":"none";var r=document.createTextNode("Total:"),o=document.createTextNode("/"),s=document.createElement("span");s.setAttribute("id",e+"_total_elementform_id_temp"),s.setAttribute("name",e+"_total_elementform_id_temp"),s.innerHTML=_;var u=document.createElement("span");u.setAttribute("id",e+"_sum_elementform_id_temp"),u.setAttribute("name",e+"_sum_elementform_id_temp"),u.innerHTML=0;var c=document.createElement("span");c.setAttribute("id",e+"_text_elementform_id_temp"),c.setAttribute("name",e+"_text_elementform_id_temp"),c.innerHTML="",d.appendChild(r),d.appendChild(u),d.appendChild(o),d.appendChild(s),d.appendChild(c),t.appendChild(d)}function sum_grading_values(e,t){for(var i=0,a=0;a<100;a++)document.getElementById(e+"_element"+t+"_"+a)&&document.getElementById(e+"_element"+t+"_"+a).value&&(i+=parseInt(document.getElementById(e+"_element"+t+"_"+a).value)),document.getElementById(e+"_total_element"+t)&&(i>document.getElementById(e+"_total_element"+t).innerHTML?document.getElementById(e+"_text_element"+t).innerHTML=" Total should be less than "+document.getElementById(e+"_total_element"+t).innerHTML:document.getElementById(e+"_text_element"+t).innerHTML="");document.getElementById(e+"_sum_element"+t)&&(document.getElementById(e+"_sum_element"+t).innerHTML=i)}function go_to_type_grading(e){w_attr_name=[],w_attr_value=[],w_items=["item1","item2","item3"],type_grading(e,"Grading","","top","no",w_items,"100","no","wdform_grading",w_attr_name,w_attr_value)}function type_grading(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_grading"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('<div id="edit_div"></div>');s.append(u);var c=jQuery('<div id="edit_main_table"></div>');u.append(c),c.append(create_field_type("type_grading")),c.append(create_label(e,t)),c.append(create_label_position(e,a)),c.append(create_hide_label(e,n)),c.append(create_required(e,_)),c.append(create_grading_total(e,d)),c.append(create_grading_items(e,l));var p=jQuery('<div class="inside"></div>');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(e,i)),p.append(create_class(e,r)),p.append(create_additional_attributes(e,o,"type_grading")),element="input",type="grading";var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_grading"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",e+"_requiredform_id_temp"),y.setAttribute("id",e+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",d),b.setAttribute("name",e+"_grading_totalform_id_temp"),b.setAttribute("id",e+"_grading_totalform_id_temp");var v=document.createElement("div");v.setAttribute("id","main_div");var w=document.createElement("div");w.setAttribute("id",e+"_elemet_tableform_id_temp");var g="yes"==n?"none":"table-cell",E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.style.cssText="display:"+g+"; vertical-align:top; width:"+i+"px;",E.setAttribute("id",e+"_label_sectionform_id_temp");var A=document.createElement("div");A.setAttribute("align","left"),A.style.display="table-cell",A.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var j=document.createElement("br"),x=(document.createElement("br"),document.createElement("div"));x.setAttribute("id",e+"_elementform_id_temp");var k=document.createElement("span");k.setAttribute("id",e+"_element_labelform_id_temp"),k.innerHTML=t,k.setAttribute("class","label");var I=document.createElement("span");I.setAttribute("id",e+"_required_elementform_id_temp"),I.innerHTML="",I.setAttribute("class","required"),"yes"==_&&(I.innerHTML=" *");var C=document.getElementById("show_table");E.appendChild(k),E.appendChild(I),A.appendChild(h),A.appendChild(f),A.appendChild(y),A.appendChild(b),A.appendChild(x),w.appendChild(E),w.appendChild(A),v.appendChild(w),v.appendChild(j),C.appendChild(v),jQuery("#main_div").append(form_maker.type_grades_description),"top"==a&&label_top(e),change_class(r,e),refresh_attr(e,"type_grading"),refresh_grading_items(e)}function create_matrix_input_type(e,t){var i=jQuery('<label class="fm-field-label">Input Type</label>'),a=jQuery('<select class="fm-width-100" id="edit_for_select_input_type" name="edit_for_select_input_type" onChange="change_input_type('+e+",this.value); refresh_matrix("+e+')"></select>');return a.append(jQuery('<option id="edit_for_input_type_radio" value="radio"'+("radio"==t?' selected="selected"':"")+">Radio Button</option>")),a.append(jQuery('<option id="edit_for_input_type_checkbox" value="checkbox"'+("checkbox"==t?' selected="selected"':"")+">Check Box</option>")),a.append(jQuery('<option id="edit_for_input_type_text" value="text"'+("text"==t?' selected="selected"':"")+">Text Box</option>")),a.append(jQuery('<option id="edit_for_input_type_select" value="select"'+("select"==t?' selected="selected"':"")+">Drop Down</option>")),create_option_container(i,a)}function change_input_type(e,t){document.getElementById(e+"_input_typeform_id_temp").value=t}function refresh_matrix(e){for(i=100;0<i&&!document.getElementById("el_rows"+i);i--);for(m=i,i=100;0<i&&!document.getElementById("el_columns"+i);i--);n=i;var t=document.getElementById(e+"_table_little");t.innerHTML="";var a=document.createElement("div");for(a.setAttribute("id",e+"_element_tr0"),a.style.display="table-row",t.appendChild(a),(d=document.createElement("div")).setAttribute("id",e+"_element_td0_0"),d.style.display="table-cell",d.innerHTML="",a.appendChild(d),k=1;k<=n;k++)if(document.getElementById("el_columns"+k)){(o=document.createElement("div")).setAttribute("id",e+"_element_td0_"+k),o.setAttribute("class","matrix_"),o.style.display="table-cell";var l=document.createElement("label");l.setAttribute("id",e+"_label_elementform_id_temp0_"+k),l.setAttribute("name",e+"_label_elementform_id_temp0_"+k),l.setAttribute("class","ch-rad-label"),l.setAttribute("for",e+"_elementform_id_temp"+k),l.innerHTML=document.getElementById("el_columns"+k).value,o.appendChild(l),a.appendChild(o)}for(i=1;i<=m;i++)if(document.getElementById("el_rows"+i)){var d,_=document.createElement("div");_.setAttribute("id",e+"_element_tr"+i),_.style.display="table-row",(d=document.createElement("div")).setAttribute("id",e+"_element_td"+i+"_0"),d.setAttribute("class","matrix_"),d.style.display="table-cell";var r=document.createElement("label");for(r.setAttribute("id",e+"_label_elementform_id_temp"+i+"_0"),r.setAttribute("class","ch-rad-label"),r.setAttribute("for",e+"_elementform_id_temp"+i),r.innerHTML=document.getElementById("el_rows"+i).value,d.appendChild(r),_.appendChild(d),t.appendChild(_),"text"==document.getElementById("edit_for_select_input_type").value?document.getElementById("el_textbox").removeAttribute("style"):document.getElementById("el_textbox").style.display="none",k=1;k<=n;k++)if(document.getElementById("el_columns"+k)){var o;if((o=document.createElement("div")).setAttribute("id",e+"_element_td"+i+"_"+k),o.style.cssText="display:table-cell; text-align:center; padding:5px 0 0 5px;","select"==document.getElementById("edit_for_select_input_type").value){var s=document.createElement("select");s.setAttribute("id",e+"_select_yes_noform_id_temp"+i+"_"+k),s.setAttribute("name",e+"_select_yes_noform_id_temp"+i+"_"+k);var u=document.createElement("option");u.setAttribute("value",""),Nothing=document.createTextNode(" ");var c=document.createElement("option");c.setAttribute("value","yes"),Yes=document.createTextNode("Yes");var p=document.createElement("option");p.setAttribute("value","no"),No=document.createTextNode("No"),u.appendChild(Nothing),c.appendChild(Yes),p.appendChild(No),s.appendChild(u),s.appendChild(c),s.appendChild(p),o.appendChild(s)}else{var f=document.createElement("input");f.setAttribute("id",e+"_input_elementform_id_temp"+i+"_"+k),f.setAttribute("align","center"),f.setAttribute("size","14"),f.setAttribute("type",document.getElementById("edit_for_select_input_type").value),"radio"==document.getElementById("edit_for_select_input_type").value?(f.setAttribute("name",e+"_input_elementform_id_temp"+i),f.setAttribute("value",i+"_"+k)):"checkbox"==document.getElementById("edit_for_select_input_type").value?(f.setAttribute("name",e+"_input_elementform_id_temp"+i+"_"+k),f.setAttribute("value",1)):(document.getElementById(e+"_textbox_sizeform_id_temp").value=document.getElementById("edit_for_label_textbox_size").value,f.setAttribute("name",e+"_input_elementform_id_temp"+i+"_"+k),f.setAttribute("value",""),f.style.cssText="width:"+document.getElementById("edit_for_label_textbox_size").value+"px;"),o.appendChild(f)}_.appendChild(o)}}}function create_matrix_input_size(e,t,i){return create_option_container(jQuery('<label class="fm-field-label" for="edit_for_label_textbox_size">Text Box width(px)</label>'),jQuery('<input class="fm-width-100" type="text" id="edit_for_label_textbox_size" onKeyPress="return check_isnum(event)" onKeyUp="refresh_matrix('+e+')" value="'+t+'" />'),"el_textbox","text"==i)}function create_matrix_rows(e,t){var i=jQuery('<label class="fm-field-label">Rows</label>'),a=jQuery('<span class="fm-add-attribute dashicons dashicons-plus-alt" title="Add" id="el_rows_add" onClick="add_to_matrix(\'rows\', '+e+')"></span>'),l=jQuery('<div id="rows" class="fm-width-100"></div>');for(n=t.length,j=1;j<n;j++){var d=jQuery('<div class="fm-width-100 fm-fields-set" id="el_row'+j+'" idi="'+j+'"></div>'),_=jQuery('<div class="fm-width-90"></div>');_.append(create_matrix_row_item(e,j,t[j])),d.append(_);var r=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_rows'+j+'_remove" onClick="remove_rowcols('+j+", "+e+", 'row')\"></span></div>");d.append(r),l.append(d)}var o=i;return create_option_container(null,o=(o=o.add(a)).add(l))}function create_matrix_row_item(e,t,i){jQuery('<label class="fm-field-label" for="el_title'+t+'">Name</label>');return create_option_container(null,jQuery('<input type="text" class="fm-width-100" id="el_rows'+t+'" onChange="change_label(\''+e+"_label_elementform_id_temp"+t+"_0', this.value); change_in_value('"+e+"_label_elementform_id_temp"+t+'_0\', this.value)" value="'+i+'" />'))}function create_matrix_columns(e,t){var i=jQuery('<label class="fm-field-label">Columns</label>'),a=jQuery('<span class="fm-add-attribute dashicons dashicons-plus-alt" title="Add" id="el_columns_add" onClick="add_to_matrix(\'columns\', '+e+')"></span>'),l=jQuery('<div id="columns" class="fm-width-100"></div>');for(n=t.length,j=1;j<n;j++){var d=jQuery('<div class="fm-width-100 fm-fields-set" id="el_column'+j+'" idi="'+j+'"></div>'),_=jQuery('<div class="fm-width-90"></div>');_.append(create_matrix_column_item(e,j,t[j])),d.append(_);var r=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" id="el_rows'+j+'_remove" onClick="remove_rowcols('+j+", "+e+", 'column')\"></span></div>");d.append(r),l.append(d)}var o=i;return create_option_container(null,o=(o=o.add(a)).add(l))}function create_matrix_column_item(e,t,i){jQuery('<label class="fm-field-label" for="el_title'+t+'">Name</label>');return create_option_container(null,jQuery('<input type="text" class="fm-width-100" id="el_columns'+t+'" onChange="change_label(\''+e+"_label_elementform_id_temp0_"+t+"', this.value); change_in_value('"+e+"_label_elementform_id_temp0_"+t+'\', this.value)" value="'+i+'" />'))}function add_to_matrix(e,t){for(i=100;0<i&&!document.getElementById("el_rows"+i);i--);for(m="rows"==e?i+1:i,i=100;0<i&&!document.getElementById("el_columns"+i);i--);if(n="columns"==e?i+1:i,"rows"==e){var a=jQuery("#rows"),l=jQuery('<div class="fm-width-100 fm-fields-set" id="item_row_'+m+'" idi="'+m+'"></div>');(_=jQuery('<div class="fm-width-90"></div>')).append(create_matrix_row_item(t,m,"")),l.append(_);var d=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_rowcols('+m+", "+t+", 'row')\"></span></div>");l.append(d),a.append(l)}else{var _,r=jQuery("#columns");l=jQuery('<div class="fm-width-100 fm-fields-set" id="item_column_'+n+'" idi="'+n+'"></div>');(_=jQuery('<div class="fm-width-90"></div>')).append(create_matrix_column_item(t,n,"")),l.append(_);var o=jQuery('<div class="fm-width-10 fm-remove-button"><span class="fm-remove-attribute dashicons dashicons-dismiss" onClick="remove_rowcols('+n+", "+t+", 'column')\"></span></div>");l.append(o),r.append(l)}refresh_matrix(t)}function remove_rowcols(e,t,i){jQuery("#el_"+i+e).remove(),jQuery("#item_"+i+"_"+e).remove(),refresh_matrix(t)}function go_to_type_matrix(e){w_attr_name=[],w_attr_value=[],w_rows=["","row1","row2"],w_columns=["","column1","column2"],type_matrix(e,"Matrix","","top","no","radio",w_rows,w_columns,"no","wdform_matrix",w_attr_name,w_attr_value,"100")}function type_matrix(e,t,i,a,n,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_matrix"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('<div id="edit_div"></div>');c.append(p);var f=jQuery('<div id="edit_main_table"></div>');p.append(f),f.append(create_field_type("type_matrix")),f.append(create_label(e,t)),f.append(create_label_position(e,a)),f.append(create_hide_label(e,n)),f.append(create_required(e,r)),f.append(create_matrix_input_type(e,l)),f.append(create_matrix_input_size(e,u,l)),f.append(create_matrix_rows(e,d)),f.append(create_matrix_columns(e,_));var y=jQuery('<div class="inside"></div>');f.append(create_advanced_options_container(y)),y.append(create_field_label_size(e,i)),y.append(create_class(e,o)),y.append(create_additional_attributes(e,m,"type_matrix")),element="input",type="matrix";var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value","type_matrix"),h.setAttribute("name",e+"_typeform_id_temp"),h.setAttribute("id",e+"_typeform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",r),b.setAttribute("name",e+"_requiredform_id_temp"),b.setAttribute("id",e+"_requiredform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",n),v.setAttribute("name",e+"_hide_labelform_id_temp"),v.setAttribute("id",e+"_hide_labelform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",l),w.setAttribute("name",e+"_input_typeform_id_temp"),w.setAttribute("id",e+"_input_typeform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",u),g.setAttribute("name",e+"_textbox_sizeform_id_temp"),g.setAttribute("id",e+"_textbox_sizeform_id_temp");var E=document.createElement("div");E.setAttribute("id","main_div");var A=document.createElement("div");A.setAttribute("id",e+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=i+"px",x.setAttribute("id",e+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var I=document.createElement("br"),C=(document.createElement("br"),document.createElement("div"));C.setAttribute("id",e+"_elementform_id_temp"),C.style.display="table";var B=document.createElement("div");B.setAttribute("id",e+"_table_little"),B.style.display="table-row-group",C.appendChild(B);var Q=document.createElement("span");Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label");var T=document.createElement("span");T.setAttribute("id",e+"_required_elementform_id_temp"),T.innerHTML="",T.setAttribute("class","required"),"yes"==r&&(T.innerHTML=" *");var M=document.getElementById("show_table");x.appendChild(Q),x.appendChild(T),k.appendChild(h),k.appendChild(b),k.appendChild(v),k.appendChild(w),k.appendChild(g),k.appendChild(C),A.appendChild(x),A.appendChild(k),E.appendChild(A),E.appendChild(I),M.appendChild(E),jQuery("#main_div").append(form_maker.type_matrix_description),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_matrix"),refresh_matrix(e)}function create_pagination_type(e){var t=jQuery('<label class="fm-field-label">Pagination Options</label>'),i=jQuery('<input type="radio" id="el_pagination_steps" name="el_pagination" onclick="pagination_type(\'steps\')"'+("steps"==e?' checked="checked"':"")+" />"),a=jQuery('<label for="el_pagination_steps">Steps</label>'),n=jQuery('<input type="radio" id="el_pagination_percentage" name="el_pagination" onclick="pagination_type(\'percentage\')"'+("percentage"==e?' checked="checked"':"")+" />"),l=jQuery('<label for="el_pagination_percentage">Percentage</label>'),d=jQuery('<input type="radio" id="el_pagination_none" name="el_pagination" onclick="pagination_type(\'none\')"'+("steps"!=e&&"percentage"!=e?' checked="checked"':"")+" />"),_=jQuery('<label for="el_pagination_none">No Context</label>'),r=i;return create_option_container(t,r=(r=(r=(r=(r=r.add(a)).add(n)).add(l)).add(d)).add(_))}function pagination_type(e){for(document.getElementById("pages_div").innerHTML="",w_pages=[],k=0,j=1;j<=form_view_max;j++)document.getElementById("form_id_tempform_view"+j)&&(k++,document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages[j]=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages[j]="none");"steps"==e?make_page_steps(w_pages):"percentage"==e?make_page_percentage(w_pages):make_page_none()}function make_page_none(){document.getElementById("pages_div").innerHTML=""}function make_page_percentage(e){document.getElementById("pages_div").innerHTML="",show_title=document.getElementById("el_show_title_input").checked;var t=document.createElement("div");t.setAttribute("class","page_percentage_deactive");var i=document.createElement("div");i.setAttribute("id","div_percentage"),i.setAttribute("class","page_percentage_active");var a=document.createElement("b");for(i.appendChild(a),k=0,n="",j=1;j<=form_view_max;j++)if(e[j]&&(k++,"none"==e[j]&&(e[j]=""),j==form_view)){if(show_title){var n=document.createElement("span");1==k?n.style.paddingLeft="40px":n.style.paddingLeft="5px",n.innerHTML=e[j]}page_number=k}a.innerHTML=Math.round((page_number-1)/k*100)+"%",i.style.width=(page_number-1)/k*100+"%",t.appendChild(i),n&&t.appendChild(n),document.getElementById("pages_div").appendChild(t)}function make_page_steps(e){for(document.getElementById("pages_div").innerHTML="",show_title=document.getElementById("el_show_title_input").checked,k=0,j=1;j<=form_view_max;j++)e[j]&&(k++,"none"==e[j]&&(e[j]=""),page_number=document.createElement("span"),j==form_view?page_number.setAttribute("class","page_active"):page_number.setAttribute("class","page_deactive"),show_title?page_number.innerHTML=e[j]:page_number.innerHTML=k,document.getElementById("pages_div").appendChild(page_number))}function create_pagination_title(e){return create_option_container(jQuery('<label class="fm-field-label" for="el_show_title_input">Show Page Titles in Progress Bar</label>'),jQuery('<input type="checkbox" id="el_show_title_input" onClick="show_title_pagebreak()"'+(e?' checked="checked"':"")+" />"))}function show_title_pagebreak(){document.getElementById("pages_div").innerHTML="",document.getElementById("el_pagination_steps").checked?pagination_type("steps"):document.getElementById("el_pagination_percentage").checked&&pagination_type("percentage")}function create_pagination_numbers(e){return create_option_container(jQuery('<label class="fm-field-label" for="el_show_numbers_input">Show Page Numbers in Footer</label>'),jQuery('<input type="checkbox" id="el_show_numbers_input" onClick="show_numbers_pagebreak()"'+(e?' checked="checked"':"")+" />"))}function show_numbers_pagebreak(){if(document.getElementById("numbers_div").innerHTML="",document.getElementById("el_show_numbers_input").checked){for(k=0,j=1;j<=form_view_max;j++)document.getElementById("form_id_tempform_view"+j)&&(k++,j==form_view&&(page_number=k));var e=document.createElement("span");e.setAttribute("class","page_numbersform_id_temp"),e.innerHTML=page_number+"/"+k,document.getElementById("numbers_div").appendChild(e)}}function create_page_titles(){var e=jQuery('<label class="fm-field-label">Pages Titles</label>'),t=jQuery('<div id="items" class="fm-width-100"></div>');for(k=0,j=1;j<=form_view_max;j++){var i=jQuery("#form_id_tempform_view"+j);if(0<i.length){var a=jQuery('<div class="fm-width-100"></div>'),n=i.prop("page_title");null==typeof n&&(n="Untitled Page");var l=jQuery('<input type="text" class="fm-width-90" id="page_title_'+j+'" onKeyUp="set_page_title(this.value, '+j+')" value="'+n+'" />');a.append(jQuery("<label>"+j+". </label>")),a.append(l),t.append(a)}}return create_option_container(null,l=(l=e).add(t))}function set_page_title(e,t){e=e.replace(/(<([^>]+)>)/gi,""),document.getElementById("form_id_tempform_view"+t).setAttribute("page_title",e),show_title_pagebreak()}function el_page_navigation(){w_type=document.getElementById("pages").getAttribute("type"),w_show_numbers=!1,w_show_title=!1,"true"==document.getElementById("pages").getAttribute("show_numbers")&&(w_show_numbers=!0),"true"==document.getElementById("pages").getAttribute("show_title")&&(w_show_title=!0),w_attr_name=[],w_attr_value=[],type_page_navigation(w_type,w_show_title,w_show_numbers,w_attr_name,w_attr_value)}function type_page_navigation(e,t,i,a,n){need_enable&&enable2(),jQuery("#element_type").val("type_page_navigation"),delete_last_child();var l=jQuery("#edit_table"),d=jQuery('<div id="edit_div"></div>');l.append(d);var _=jQuery('<div id="edit_main_table"></div>');for(d.append(_),_.append(create_field_type("type_page_navigation")),_.append(create_pagination_type(e)),_.append(create_pagination_title(t)),_.append(create_pagination_numbers(i)),_.append(create_page_titles()),w_pages=[],k=0,j=1;j<=form_view_max;j++)document.getElementById("form_id_tempform_view"+j)&&(document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages[j]=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages[j]="Untitled Page");var r=document.createElement("div");r.setAttribute("id","main_div");var o=document.createElement("table");o.setAttribute("id","_elemet_tableform_id_temp"),o.setAttribute("width","90%");var m=document.createElement("tr"),s=document.createElement("td");s.setAttribute("valign","top"),s.setAttribute("align","left"),s.setAttribute("id","_element_sectionform_id_temp"),s.setAttribute("width","100%");var u=document.createElement("br"),c=document.createElement("div");c.setAttribute("align","left"),c.setAttribute("id","pages_div"),c.style.width="100%",c.innerHTML="";var p=document.createElement("div");p.setAttribute("align","center"),p.setAttribute("id","numbers_div"),p.style.width="100%",p.style.paddingTop="100px",p.innerHTML="",s.appendChild(c),s.appendChild(p);var f=document.getElementById("show_table");m.appendChild(s),o.appendChild(m),r.appendChild(o),r.appendChild(u),f.appendChild(r),"steps"==e?make_page_steps(w_pages):"percentage"==e?make_page_percentage(w_pages):make_page_none(w_pages),i&&show_numbers_pagebreak()}function refresh_page_numbers(){var a=jQuery(".wdform-page-and-images"),n="true"==document.getElementById("pages").getAttribute("show_numbers");a.each(function(e){var t=jQuery(this).find(".form_id_tempform_view_img").prop("id").split("form_id_tempform_view_img");if(j=t[1],document.getElementById("page_numbersform_id_temp"+j)&&(document.getElementById("page_numbersform_id_temp"+j).innerHTML="",n)){var i=document.createElement("span");i.setAttribute("class","page_numbersform_id_temp"),i.innerHTML=e+1+"/"+a.length,document.getElementById("page_numbersform_id_temp"+j).appendChild(i)}})}function gen_form_fields(){switch(wdtype){case"type_editor":w_editor=document.getElementById("wdform_field"+id).innerHTML,form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_editor+"*:*w_editor*:*",form_fields+="*:*new_field*:*";break;case"type_send_copy":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(id+"_elementform_id_temp").checked,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_required+"*:*w_required*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_text":for(w_first_val=document.getElementById(id+"_elementform_id_temp").value,w_title=document.getElementById(id+"_elementform_id_temp").title,w_regExp_status=document.getElementById(id+"_regExpStatusform_id_temp").value,w_regExp_value=document.getElementById(id+"_regExp_valueform_id_temp").value,w_regExp_common=document.getElementById(id+"_regExp_commonform_id_temp").value,w_regExp_arg=document.getElementById(id+"_regArgumentform_id_temp").value,w_regExp_alert=document.getElementById(id+"_regExp_alertform_id_temp").value,w_readonly=document.getElementById(id+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_title+"*:*w_title*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_regExp_status+"*:*w_regExp_status*:*",form_fields+=w_regExp_value+"*:*w_regExp_value*:*",form_fields+=w_regExp_common+"*:*w_regExp_common*:*",form_fields+=w_regExp_arg+"*:*w_regExp_arg*:*",form_fields+=w_regExp_alert+"*:*w_regExp_alert*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_readonly+"*:*w_readonly*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_number":for(w_first_val=document.getElementById(id+"_elementform_id_temp").value,w_title=document.getElementById(id+"_elementform_id_temp").title,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_title+"*:*w_title*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_password":for(w_verification=document.getElementById(id+"_verification_id_temp").value,w_placeholder=document.getElementById(id+"_elementform_id_temp").placeholder,document.getElementById(id+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(id+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_verification+"*:*w_verification*:*",form_fields+=w_verification_label+"*:*w_verification_label*:*",form_fields+=w_placeholder+"*:*w_placeholder*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_textarea":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(id+"_elementform_id_temp").value,w_title=document.getElementById(id+"_elementform_id_temp").title,s=document.getElementById(id+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),w=document.getElementById(id+"_elementform_id_temp").style.width,w_size_w=w.substring(0,w.length-2),atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size_w*:*",form_fields+=w_size_h+"*:*w_size_h*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_title+"*:*w_title*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_wdeditor":for(w_title=document.getElementById(id+"_elementform_id_temp").title,s=document.getElementById(id+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),w=document.getElementById(id+"_elementform_id_temp").style.width,w_size_w=w.substring(0,w.length-2),atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_size+"*:*w_size_w*:*",form_fields+=w_size_h+"*:*w_size_h*:*",form_fields+=w_title+"*:*w_title*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_phone":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value,document.getElementById(id+"_element_lastform_id_temp").value],w_title=[document.getElementById(id+"_element_firstform_id_temp").title,document.getElementById(id+"_element_lastform_id_temp").title],s=document.getElementById(id+"_element_lastform_id_temp").style.width,w_size=s.substring(0,s.length-2),w_mini_labels=[document.getElementById(id+"_mini_label_area_code").innerHTML,document.getElementById(id+"_mini_label_phone_number").innerHTML],atrs=return_attributes(id+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_first_val.join("***")+"*:*w_first_val*:*",form_fields+=w_title.join("***")+"*:*w_title*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_phone_new":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(id+"_elementform_id_temp").value,w_top_country=document.getElementById(id+"_elementform_id_temp").getAttribute("top-country"),atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_top_country+"*:*w_top_country*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_name":if(document.getElementById(id+"_enable_fieldsform_id_temp")){w_name_format="normal",w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value,document.getElementById(id+"_element_lastform_id_temp").value],w_title=[document.getElementById(id+"_element_firstform_id_temp").title,document.getElementById(id+"_element_lastform_id_temp").title];for(var e=["title","middle"],t=0;t<2;t++)w_first_val.push(document.getElementById(id+"_element_"+e[t]+"form_id_temp")?document.getElementById(id+"_element_"+e[t]+"form_id_temp").value:""),w_title.push(document.getElementById(id+"_element_"+e[t]+"form_id_temp")?document.getElementById(id+"_element_"+e[t]+"form_id_temp").title:"")}else document.getElementById(id+"_element_middleform_id_temp")?w_name_format="extended":w_name_format="normal","normal"==w_name_format?(w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value,document.getElementById(id+"_element_lastform_id_temp").value],w_title=[document.getElementById(id+"_element_firstform_id_temp").title,document.getElementById(id+"_element_lastform_id_temp").title]):(w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value,document.getElementById(id+"_element_lastform_id_temp").value,document.getElementById(id+"_element_titleform_id_temp").value,document.getElementById(id+"_element_middleform_id_temp").value],w_title=[document.getElementById(id+"_element_firstform_id_temp").title,document.getElementById(id+"_element_lastform_id_temp").title,document.getElementById(id+"_element_titleform_id_temp").title,document.getElementById(id+"_element_middleform_id_temp").title]);for(document.getElementById(id+"_mini_label_title")?w_mini_title=document.getElementById(id+"_mini_label_title").innerHTML:w_mini_title="Title",document.getElementById(id+"_mini_label_middle")?w_mini_middle=document.getElementById(id+"_mini_label_middle").innerHTML:w_mini_middle="Middle",w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_mini_labels=[w_mini_title,document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML,w_mini_middle],w_name_title=document.getElementById(id+"_enable_fieldsform_id_temp")?document.getElementById(id+"_enable_fieldsform_id_temp").getAttribute("title"):"normal"==w_name_format?"no":"yes",w_name_middle=document.getElementById(id+"_enable_fieldsform_id_temp")?document.getElementById(id+"_enable_fieldsform_id_temp").getAttribute("middle"):"normal"==w_name_format?"no":"yes",w_name_fields=[w_name_title,w_name_middle],w_autofill=document.getElementById(id+"_autofillform_id_temp").value,s=document.getElementById(id+"_element_firstform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(id+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_first_val.join("***")+"*:*w_first_val*:*",form_fields+=w_title.join("***")+"*:*w_title*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_name_format+"*:*w_name_format*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_name_fields.join("***")+"*:*w_name_fields*:*",form_fields+=w_autofill+"*:*w_autofill*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_price":for(w_first_val=[document.getElementById(id+"_element_dollarsform_id_temp").value,document.getElementById(id+"_element_centsform_id_temp").value],w_title=[document.getElementById(id+"_element_dollarsform_id_temp").title,document.getElementById(id+"_element_centsform_id_temp").title],"none"==document.getElementById(id+"_td_name_cents").style.display?w_hide_cents="yes":w_hide_cents="no",s=document.getElementById(id+"_element_dollarsform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(id+"_element_dollarsform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(id+"_range_minform_id_temp").value,w_range_max=document.getElementById(id+"_range_maxform_id_temp").value,w_mini_labels=[document.getElementById(id+"_mini_label_dollars").innerHTML,document.getElementById(id+"_mini_label_cents").innerHTML],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_first_val.join("***")+"*:*w_first_val*:*",form_fields+=w_title.join("***")+"*:*w_title*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_hide_cents+"*:*w_hide_cents*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_range_min+"*:*w_range_min*:*",form_fields+=w_range_max+"*:*w_range_max*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_price_new":for(w_first_val=document.getElementById(id+"_elementform_id_temp").value,w_title=document.getElementById(id+"_elementform_id_temp").title,s=document.getElementById(id+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(id+"_range_minform_id_temp").value,w_range_max=document.getElementById(id+"_range_maxform_id_temp").value,w_readonly=document.getElementById(id+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,"none"==document.getElementById(id+"_td_name_currency").style.display?w_currency="yes":w_currency="no",form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_title+"*:*w_title*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_range_min+"*:*w_range_min*:*",form_fields+=w_range_max+"*:*w_range_max*:*",form_fields+=w_readonly+"*:*w_readonly*:*",form_fields+=w_currency+"*:*w_currency*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_address":s=document.getElementById(id+"_div_address").style.width,w_size=s.substring(0,s.length-2),document.getElementById(id+"_mini_label_street1")?w_street1=document.getElementById(id+"_mini_label_street1").innerHTML:w_street1=document.getElementById(id+"_street1form_id_temp").value,document.getElementById(id+"_mini_label_street2")?w_street2=document.getElementById(id+"_mini_label_street2").innerHTML:w_street2=document.getElementById(id+"_street2form_id_temp").value,document.getElementById(id+"_mini_label_city")?w_city=document.getElementById(id+"_mini_label_city").innerHTML:w_city=document.getElementById(id+"_cityform_id_temp").value,document.getElementById(id+"_mini_label_state")?w_state=document.getElementById(id+"_mini_label_state").innerHTML:w_state=document.getElementById(id+"_stateform_id_temp").value,document.getElementById(id+"_mini_label_postal")?w_postal=document.getElementById(id+"_mini_label_postal").innerHTML:w_postal=document.getElementById(id+"_postalform_id_temp").value,document.getElementById(id+"_mini_label_country")?w_country=document.getElementById(id+"_mini_label_country").innerHTML:w_country=document.getElementById(id+"_countryform_id_temp").value,w_mini_labels=[w_street1,w_street2,w_city,w_state,w_postal,w_country];var i=document.getElementById(id+"_disable_fieldsform_id_temp");for(w_street1_dis=i.getAttribute("street1"),w_street2_dis=i.getAttribute("street2"),w_city_dis=i.getAttribute("city"),w_state_dis=i.getAttribute("state"),w_us_states_dis=i.getAttribute("us_states"),w_postal_dis=i.getAttribute("postal"),w_country_dis=i.getAttribute("country"),w_disabled_fields=[w_street1_dis,w_street2_dis,w_city_dis,w_state_dis,w_postal_dis,w_country_dis,w_us_states_dis],w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_street1form_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_disabled_fields.join("***")+"*:*w_disabled_fields*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_submitter_mail":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(id+"_elementform_id_temp").value,w_title=document.getElementById(id+"_elementform_id_temp").title,w_autofill=document.getElementById(id+"_autofillform_id_temp").value,w_verification=document.getElementById(id+"_verification_id_temp").value,w_verification_placeholder=document.getElementById(id+"_1_elementform_id_temp").title,document.getElementById(id+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(id+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_title+"*:*w_title*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_unique+"*:*w_unique*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_verification+"*:*w_verification*:*",form_fields+=w_verification_label+"*:*w_verification_label*:*",form_fields+=w_verification_placeholder+"*:*w_verification_placeholder*:*",form_fields+=w_autofill+"*:*w_autofill*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_checkbox":if(w_randomize=document.getElementById(id+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value,tt=0,v=0,w_randomize=document.getElementById(id+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value,document.getElementById(id+"_rowcol_numform_id_temp").value?(document.getElementById(id+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(id+"_rowcol_numform_id_temp").value):(document.getElementById(id+"_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),"ver"==w_flow){var a=document.getElementById(id+"_table_little");for(k=0;k<a.childNodes.length;k++){var n=a.childNodes[k];for(m=0;m<n.childNodes.length;m++){var l=n.childNodes[m].getAttribute("idi");document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+l).innerHTML,w_choices_checked[tt]=document.getElementById(id+"_elementform_id_temp"+l).checked,w_choices_value[tt]=document.getElementById(id+"_elementform_id_temp"+l).value,document.getElementById(id+"_label_element"+l).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+l).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+l).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+l).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=l}}}else{var d=(_=(a=document.getElementById(id+"_table_little")).childNodes)[0].childNodes;for(k=0;k<d.length;k++)for(m=0;m<_.length;m++)if(_[m].childNodes[k]){l=(n=_[m].childNodes[k]).getAttribute("idi");document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+l).innerHTML,w_choices_checked[tt]=document.getElementById(id+"_elementform_id_temp"+l).checked,w_choices_value[tt]=document.getElementById(id+"_elementform_id_temp"+l).value,document.getElementById(id+"_label_element"+l).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+l).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+l).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+l).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=l}}for(document.getElementById(id+"_option_left_right")?w_field_option_pos=document.getElementById(id+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(id+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_field_option_pos+"*:*w_field_option_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_flow+"*:*w_flow*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_rowcol+"*:*w_rowcol*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_randomize+"*:*w_randomize*:*",form_fields+=w_allow_other+"*:*w_allow_other*:*",form_fields+=w_allow_other_num+"*:*w_allow_other_num*:*",form_fields+=w_value_disabled+"*:*w_value_disabled*:*",form_fields+=w_choices_value.join("***")+"*:*w_choices_value*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_checkbox":for(document.getElementById(id+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(id+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value,tt=0,v=0,k=0;k<100;k++)if(document.getElementById(id+"_elementform_id_temp"+k)&&(document.getElementById(id+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+k).innerHTML," "==w_choices[tt][w_choices[tt].length-1]&&(w_choices[tt]=w_choices[tt].substring(0,w_choices[tt].length-1)),w_choices_price[tt]=document.getElementById(id+"_elementform_id_temp"+k).value,w_choices_checked[tt]=document.getElementById(id+"_elementform_id_temp"+k).checked,document.getElementById(id+"_label_element"+k).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+k).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=k),document.getElementById(id+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(id+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]="",m=0;m<document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1]+="###"+document.getElementById(id+"_propertyform_id_temp"+k).childNodes[m].value;else w_property_values.push("");for(w_quantity="no",w_quantity_value=1,document.getElementById(id+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(id+"_element_quantityform_id_temp").value),document.getElementById(id+"_option_left_right")?w_field_option_pos=document.getElementById(id+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_field_option_pos+"*:*w_field_option_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_flow+"*:*w_flow*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_price.join("***")+"*:*w_choices_price*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_randomize+"*:*w_randomize*:*",form_fields+=w_allow_other+"*:*w_allow_other*:*",form_fields+=w_allow_other_num+"*:*w_allow_other_num*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_property.join("***")+"*:*w_property*:*",form_fields+=w_property_values.join("***")+"*:*w_property_values*:*",form_fields+=w_quantity+"*:*w_quantity*:*",form_fields+=w_quantity_value+"*:*w_quantity_value*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_radio":if(w_randomize=document.getElementById(id+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value,document.getElementById(id+"_rowcol_numform_id_temp").value?(document.getElementById(id+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(id+"_rowcol_numform_id_temp").value):(document.getElementById(id+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,tt=0,"ver"==w_flow){a=document.getElementById(id+"_table_little");for(k=0;k<a.childNodes.length;k++){n=a.childNodes[k];for(m=0;m<n.childNodes.length;m++){l=n.childNodes[m].getAttribute("idi");document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+l).innerHTML,w_choices_checked[tt]=document.getElementById(id+"_elementform_id_temp"+l).checked,w_choices_value[tt]=document.getElementById(id+"_elementform_id_temp"+l).value,document.getElementById(id+"_label_element"+l).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+l).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+l).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+l).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=l}}}else{var _;d=(_=(a=document.getElementById(id+"_table_little")).childNodes)[0].childNodes;for(k=0;k<d.length;k++)for(m=0;m<_.length;m++)if(_[m].childNodes[k]){l=(n=_[m].childNodes[k]).getAttribute("idi");document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+l).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+l).innerHTML,w_choices_checked[tt]=document.getElementById(id+"_elementform_id_temp"+l).checked,w_choices_value[tt]=document.getElementById(id+"_elementform_id_temp"+l).value,document.getElementById(id+"_label_element"+l).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+l).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+l).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+l).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=l}}for(document.getElementById(id+"_option_left_right")?w_field_option_pos=document.getElementById(id+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(id+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_field_option_pos+"*:*w_field_option_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_flow+"*:*w_flow*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_rowcol+"*:*w_rowcol*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_randomize+"*:*w_randomize*:*",form_fields+=w_allow_other+"*:*w_allow_other*:*",form_fields+=w_allow_other_num+"*:*w_allow_other_num*:*",form_fields+=w_value_disabled+"*:*w_value_disabled*:*",form_fields+=w_choices_value.join("***")+"*:*w_choices_value*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_radio":for(document.getElementById(id+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(id+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value,v=0,tt=0,k=0;k<100;k++)if(document.getElementById(id+"_elementform_id_temp"+k)&&(document.getElementById(id+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+k).innerHTML," "==w_choices[tt][w_choices[tt].length-1]&&(w_choices[tt]=w_choices[tt].substring(0,w_choices[tt].length-1)),w_choices_price[tt]=document.getElementById(id+"_elementform_id_temp"+k).value,w_choices_checked[tt]="checked"==document.getElementById(id+"_elementform_id_temp"+k).getAttribute("checked"),document.getElementById(id+"_label_element"+k).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+k).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=k),document.getElementById(id+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(id+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]="",m=0;m<document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1]+="###"+document.getElementById(id+"_propertyform_id_temp"+k).childNodes[m].value;else w_property_values.push("");for(w_quantity="no",w_quantity_value=1,document.getElementById(id+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(id+"_element_quantityform_id_temp").value),document.getElementById(id+"_option_left_right")?w_field_option_pos=document.getElementById(id+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_field_option_pos+"*:*w_field_option_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_flow+"*:*w_flow*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_price.join("***")+"*:*w_choices_price*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_randomize+"*:*w_randomize*:*",form_fields+=w_allow_other+"*:*w_allow_other*:*",form_fields+=w_allow_other_num+"*:*w_allow_other_num*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_property.join("***")+"*:*w_property*:*",form_fields+=w_property_values.join("***")+"*:*w_property_values*:*",form_fields+=w_quantity+"*:*w_quantity*:*",form_fields+=w_quantity_value+"*:*w_quantity_value*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_shipping":for(document.getElementById(id+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(id+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value,v=0,tt=0,k=0;k<100;k++)if(document.getElementById(id+"_elementform_id_temp"+k)&&(document.getElementById(id+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(id+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=tt),w_choices[tt]=document.getElementById(id+"_label_element"+k).innerHTML," "==w_choices[tt][w_choices[tt].length-1]&&(w_choices[tt]=w_choices[tt].substring(0,w_choices[tt].length-1)),w_choices_price[tt]=document.getElementById(id+"_elementform_id_temp"+k).value,w_choices_checked[tt]="checked"==document.getElementById(id+"_elementform_id_temp"+k).getAttribute("checked"),document.getElementById(id+"_label_element"+k).getAttribute("where")?w_choices_params[tt]=document.getElementById(id+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(id+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(id+"_label_element"+k).getAttribute("db_info"):w_choices_params[tt]="",tt++,v=k),document.getElementById(id+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(id+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(id+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");for(document.getElementById(id+"_option_left_right")?w_field_option_pos=document.getElementById(id+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_field_option_pos+"*:*w_field_option_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_flow+"*:*w_flow*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_price.join("***")+"*:*w_choices_price*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_randomize+"*:*w_randomize*:*",form_fields+=w_allow_other+"*:*w_allow_other*:*",form_fields+=w_allow_other_num+"*:*w_allow_other_num*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_total":w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_size=jQuery("#"+id+"paypal_totalform_id_temp").css("width")?jQuery("#"+id+"paypal_totalform_id_temp").css("width").substring(0,jQuery("#"+id+"paypal_totalform_id_temp").css("width").length-2):"300",form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+="*:*new_field*:*";break;case"type_stripe":form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_size+"*:*w_field_size*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+="*:*new_field*:*";break;case"type_star_rating":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_star_amount=document.getElementById(id+"_star_amountform_id_temp").value,w_field_label_col=document.getElementById(id+"_star_colorform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_field_label_col+"*:*w_field_label_col*:*",form_fields+=w_star_amount+"*:*w_star_amount*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_scale_rating":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_mini_labels=[document.getElementById(id+"_mini_label_worst").innerHTML,document.getElementById(id+"_mini_label_best").innerHTML],w_scale_amount=document.getElementById(id+"_scale_amountform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_scale_amount+"*:*w_scale_amount*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_spinner":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(id+"_min_valueform_id_temp").value,w_field_max_value=document.getElementById(id+"_max_valueform_id_temp").value,w_field_width=document.getElementById(id+"_spinner_widthform_id_temp").value,w_field_step=document.getElementById(id+"_stepform_id_temp").value,w_field_value=document.getElementById(id+"_elementform_id_temp").getAttribute("aria-valuenow"),atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_field_width+"*:*w_field_width*:*",form_fields+=w_field_min_value+"*:*w_field_min_value*:*",form_fields+=w_field_max_value+"*:*w_field_max_value*:*",form_fields+=w_field_step+"*:*w_field_step*:*",form_fields+=w_field_value+"*:*w_field_value*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_slider":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(id+"_slider_min_valueform_id_temp").value,w_field_max_value=document.getElementById(id+"_slider_max_valueform_id_temp").value,w_field_step=document.getElementById(id+"_slider_stepform_id_temp")&&document.getElementById(id+"_slider_stepform_id_temp").value?document.getElementById(id+"_slider_stepform_id_temp").value:1,w_field_width=document.getElementById(id+"_slider_widthform_id_temp").value,w_field_value=document.getElementById(id+"_slider_valueform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_field_width+"*:*w_field_width*:*",form_fields+=w_field_min_value+"*:*w_field_min_value*:*",form_fields+=w_field_max_value+"*:*w_field_max_value*:*",form_fields+=w_field_step+"*:*w_field_step*:*",form_fields+=w_field_value+"*:*w_field_value*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_range":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_field_range_width=document.getElementById(id+"_range_widthform_id_temp").value,w_field_range_step=document.getElementById(id+"_range_stepform_id_temp").value,w_field_value1=document.getElementById(id+"_elementform_id_temp0").getAttribute("aria-valuenow"),w_field_value2=document.getElementById(id+"_elementform_id_temp1").getAttribute("aria-valuenow"),atrs=return_attributes(id+"_elementform_id_temp0"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_mini_labels=[document.getElementById(id+"_mini_label_from").innerHTML,document.getElementById(id+"_mini_label_to").innerHTML],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_field_range_width+"*:*w_field_range_width*:*",form_fields+=w_field_range_step+"*:*w_field_range_step*:*",form_fields+=w_field_value1+"*:*w_field_value1*:*",form_fields+=w_field_value2+"*:*w_field_value2*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_grading":for(w_total=document.getElementById(id+"_grading_totalform_id_temp").value,w_items=[],k=0;k<100;k++)document.getElementById(id+"_label_elementform_id_temp"+k)&&w_items.push(document.getElementById(id+"_label_elementform_id_temp"+k).innerHTML);for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_items.join("***")+"*:*w_items*:*",form_fields+=w_total+"*:*w_total*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_matrix":for(w_rows=[],w_rows[0]="",k=1;k<100;k++)document.getElementById(id+"_label_elementform_id_temp"+k+"_0")&&w_rows.push(document.getElementById(id+"_label_elementform_id_temp"+k+"_0").innerHTML);for(w_columns=[],w_columns[0]="",k=1;k<100;k++)document.getElementById(id+"_label_elementform_id_temp0_"+k)&&w_columns.push(document.getElementById(id+"_label_elementform_id_temp0_"+k).innerHTML);for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_field_input_type=document.getElementById(id+"_input_typeform_id_temp").value,w_textbox_size=document.getElementById(id+"_textbox_sizeform_id_temp")?document.getElementById(id+"_textbox_sizeform_id_temp").value:"100",atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_field_input_type+"*:*w_field_input_type*:*",form_fields+=w_rows.join("***")+"*:*w_rows*:*",form_fields+=w_columns.join("***")+"*:*w_columns*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_textbox_size+"*:*w_textbox_size*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_time":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_hhform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_hh=document.getElementById(id+"_hhform_id_temp").value,w_mm=document.getElementById(id+"_mmform_id_temp").value,document.getElementById(id+"_ssform_id_temp")?(w_ss=document.getElementById(id+"_ssform_id_temp").value,w_sec="1",w_sec_label=document.getElementById(id+"_mini_label_ss").innerHTML):(w_ss="",w_sec="0",w_sec_label="SS"),document.getElementById(id+"_am_pm_select")?(w_am_pm=document.getElementById(id+"_am_pmform_id_temp").value,w_time_type="12",w_mini_labels=[document.getElementById(id+"_mini_label_hh").innerHTML,document.getElementById(id+"_mini_label_mm").innerHTML,w_sec_label,document.getElementById(id+"_mini_label_am_pm").innerHTML]):(w_am_pm=0,w_time_type="24",w_mini_labels=[document.getElementById(id+"_mini_label_hh").innerHTML,document.getElementById(id+"_mini_label_mm").innerHTML,w_sec_label,"AM/PM"]),form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_time_type+"*:*w_time_type*:*",form_fields+=w_am_pm+"*:*w_am_pm*:*",form_fields+=w_sec+"*:*w_sec*:*",form_fields+=w_hh+"*:*w_hh*:*",form_fields+=w_mm+"*:*w_mm*:*",form_fields+=w_ss+"*:*w_ss*:*",form_fields+=w_mini_labels.join("***")+"*:*w_mini_labels*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_date":for(atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(id+"_elementform_id_temp").value,w_format=document.getElementById(id+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(id+"_buttonform_id_temp").value,w_disable_past_days=document.getElementById(id+"_dis_past_daysform_id_temp")?document.getElementById(id+"_dis_past_daysform_id_temp").value:"no",form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_date+"*:*w_date*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_format+"*:*w_format*:*",form_fields+=w_but_val+"*:*w_but_val*:*",form_fields+=w_disable_past_days+"*:*w_disable_past_days*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_date_new":atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_format=document.getElementById(id+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(id+"_buttonform_id_temp").value,w_start_day=document.getElementById(id+"_start_dayform_id_temp").value,w_default_date=document.getElementById(id+"_default_date_id_temp").value,w_min_date=document.getElementById(id+"_min_date_id_temp").value,w_max_date=document.getElementById(id+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(id+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(id+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(id+"_show_imageform_id_temp").value,w_date=document.getElementById(id+"_elementform_id_temp").value,w_disable_past_days=document.getElementById(id+"_dis_past_daysform_id_temp")?document.getElementById(id+"_dis_past_daysform_id_temp").value:"no";var r=document.getElementById(id+"_show_week_days");for(w_sunday=r.getAttribute("sunday"),w_monday=r.getAttribute("monday"),w_tuesday=r.getAttribute("tuesday"),w_wednesday=r.getAttribute("wednesday"),w_thursday=r.getAttribute("thursday"),w_friday=r.getAttribute("friday"),w_saturday=r.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_date+"*:*w_date*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_show_image+"*:*w_show_image*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_format+"*:*w_format*:*",form_fields+=w_start_day+"*:*w_start_day*:*",form_fields+=w_default_date+"*:*w_default_date*:*",form_fields+=w_min_date+"*:*w_min_date*:*",form_fields+=w_max_date+"*:*w_max_date*:*",form_fields+=w_invalid_dates+"*:*w_invalid_dates*:*",form_fields+=w_show_days.join("***")+"*:*w_show_days*:*",form_fields+=w_hide_time+"*:*w_hide_time*:*",form_fields+=w_but_val+"*:*w_but_val*:*",form_fields+=w_disable_past_days+"*:*w_disable_past_days*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_date_range":atrs=return_attributes(id+"_elementform_id_temp0"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(id+"_elementform_id_temp0").value+","+document.getElementById(id+"_elementform_id_temp1").value,w_format=document.getElementById(id+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(id+"_buttonform_id_temp").value,w_start_day=document.getElementById(id+"_start_dayform_id_temp").value,w_default_date_start=document.getElementById(id+"_default_date_id_temp_start").value,w_default_date_end=document.getElementById(id+"_default_date_id_temp_end").value,w_min_date=document.getElementById(id+"_min_date_id_temp").value,w_max_date=document.getElementById(id+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(id+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(id+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(id+"_show_imageform_id_temp").value,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,s=document.getElementById(id+"_elementform_id_temp0").style.width,w_size=s.substring(0,s.length-2),w_disable_past_days=document.getElementById(id+"_dis_past_daysform_id_temp")?document.getElementById(id+"_dis_past_daysform_id_temp").value:"no";r=document.getElementById(id+"_show_week_days");for(w_sunday=r.getAttribute("sunday"),w_monday=r.getAttribute("monday"),w_tuesday=r.getAttribute("tuesday"),w_wednesday=r.getAttribute("wednesday"),w_thursday=r.getAttribute("thursday"),w_friday=r.getAttribute("friday"),w_saturday=r.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_date+"*:*w_date*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_show_image+"*:*w_show_image*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_format+"*:*w_format*:*",form_fields+=w_start_day+"*:*w_start_day*:*",form_fields+=w_default_date_start+"*:*w_default_date_start*:*",form_fields+=w_default_date_end+"*:*w_default_date_end*:*",form_fields+=w_min_date+"*:*w_min_date*:*",form_fields+=w_max_date+"*:*w_max_date*:*",form_fields+=w_invalid_dates+"*:*w_invalid_dates*:*",form_fields+=w_show_days.join("***")+"*:*w_show_days*:*",form_fields+=w_hide_time+"*:*w_hide_time*:*",form_fields+=w_but_val+"*:*w_but_val*:*",form_fields+=w_disable_past_days+"*:*w_disable_past_days*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_date_fields":for(atrs=return_attributes(id+"_dayform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_day=document.getElementById(id+"_dayform_id_temp").value,w_month=document.getElementById(id+"_monthform_id_temp").value,w_year=document.getElementById(id+"_yearform_id_temp").value,w_day_type=document.getElementById(id+"_dayform_id_temp").tagName,w_month_type=document.getElementById(id+"_monthform_id_temp").tagName,w_year_type=document.getElementById(id+"_yearform_id_temp").tagName,w_day_label=document.getElementById(id+"_day_label").innerHTML,w_month_label=document.getElementById(id+"_month_label").innerHTML,w_year_label=document.getElementById(id+"_year_label").innerHTML,s=document.getElementById(id+"_dayform_id_temp").style.width,w_day_size=s.substring(0,s.length-2),s=document.getElementById(id+"_monthform_id_temp").style.width,w_month_size=s.substring(0,s.length-2),s=document.getElementById(id+"_yearform_id_temp").style.width,w_year_size=s.substring(0,s.length-2),w_from=document.getElementById(id+"_yearform_id_temp").getAttribute("from"),w_to=document.getElementById(id+"_yearform_id_temp").getAttribute("to"),w_divider=document.getElementById(id+"_separator1").innerHTML,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_day+"*:*w_day*:*",form_fields+=w_month+"*:*w_month*:*",form_fields+=w_year+"*:*w_year*:*",form_fields+=w_day_type+"*:*w_day_type*:*",form_fields+=w_month_type+"*:*w_month_type*:*",form_fields+=w_year_type+"*:*w_year_type*:*",form_fields+=w_day_label+"*:*w_day_label*:*",form_fields+=w_month_label+"*:*w_month_label*:*",form_fields+=w_year_label+"*:*w_year_label*:*",form_fields+=w_day_size+"*:*w_day_size*:*",form_fields+=w_month_size+"*:*w_month_size*:*",form_fields+=w_year_size+"*:*w_year_size*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_from+"*:*w_from*:*",form_fields+=w_to+"*:*w_to*:*",form_fields+=w_divider+"*:*w_divider*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_own_select":for(tt=0,jQuery("#"+id+"_elementform_id_temp option").each(function(){w_choices[tt]=jQuery(this).html(),w_choices_value[tt]=jQuery(this).val(),w_choices_checked[tt]=jQuery(this)[0].selected,jQuery(this).prop("where")?w_choices_params[tt]=jQuery(this).prop("where")+"[where_order_by]"+jQuery(this).prop("order_by")+"[db_info]"+jQuery(this).prop("db_info"):w_choices_params[tt]="",jQuery(this).val()?w_choices_disabled[tt]=!1:w_choices_disabled[tt]=!0,tt++}),w_value_disabled=document.getElementById(id+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_choices_disabled.join("***")+"*:*w_choices_disabled*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_value_disabled+"*:*w_value_disabled*:*",form_fields+=w_choices_value.join("***")+"*:*w_choices_value*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_paypal_select":for(tt=0,jQuery("#"+id+"_elementform_id_temp option").each(function(){w_choices[tt]=jQuery(this).html(),w_choices_price[tt]=jQuery(this).val(),w_choices_checked[tt]=jQuery(this)[0].selected,jQuery(this).prop("where")?w_choices_params[tt]=jQuery(this).prop("where")+"[where_order_by]"+jQuery(this).prop("order_by")+"[db_info]"+jQuery(this).prop("db_info"):w_choices_params[tt]="",""==jQuery(this)[0].value?w_choices_disabled[tt]=!0:w_choices_disabled[tt]=!1,tt++}),k=0;k<100;k++)if(document.getElementById(id+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(id+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]="",m=0;m<document.getElementById(id+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1]+="###"+document.getElementById(id+"_propertyform_id_temp"+k).childNodes[m].value;else w_property_values.push("");for(w_quantity="no",w_quantity_value=1,document.getElementById(id+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(id+"_element_quantityform_id_temp").value),w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_choices.join("***")+"*:*w_choices*:*",form_fields+=w_choices_price.join("***")+"*:*w_choices_price*:*",form_fields+=w_choices_checked.join("***")+"*:*w_choices_checked*:*",form_fields+=w_choices_disabled.join("***")+"*:*w_choices_disabled*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_quantity+"*:*w_quantity*:*",form_fields+=w_quantity_value+"*:*w_quantity_value*:*",form_fields+=w_choices_params.join("***")+"*:*w_choices_params*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_property.join("***")+"*:*w_property*:*",form_fields+=w_property_values.join("***")+"*:*w_property_values*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_country":for(w_countries=[],select_=document.getElementById(id+"_elementform_id_temp"),k=select_.childNodes.length,j=0;j<k;j++)w_countries.push(select_.childNodes[j].value);for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_size+"*:*w_size*:*",form_fields+=w_countries.join("***")+"*:*w_countries*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_file_upload":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_destination=document.getElementById(id+"_destination").value.replace("***destinationverj"+id+"***","").replace("***destinationskizb"+id+"***",""),w_extension=document.getElementById(id+"_extension").value.replace("***extensionverj"+id+"***","").replace("***extensionskizb"+id+"***",""),w_max_size=document.getElementById(id+"_max_size").value.replace("***max_sizeverj"+id+"***","").replace("***max_sizeskizb"+id+"***",""),w_multiple=document.getElementById(id+"_elementform_id_temp").getAttribute("multiple")?"yes":"no",atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_destination+"*:*w_destination*:*",form_fields+=w_extension+"*:*w_extension*:*",form_fields+=w_max_size+"*:*w_max_size*:*",form_fields+=w_required+"*:*w_required*:*",form_fields+=w_multiple+"*:*w_multiple*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_captcha":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_digit=document.getElementById("_wd_captchaform_id_temp").getAttribute("digit"),atrs=return_attributes("_wd_captchaform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_digit+"*:*w_digit*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_arithmetic_captcha":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_count=document.getElementById("_wd_arithmetic_captchaform_id_temp").getAttribute("operations_count"),w_operations=document.getElementById("_wd_arithmetic_captchaform_id_temp").getAttribute("operations"),w_input_size=document.getElementById("_wd_arithmetic_captchaform_id_temp").getAttribute("input_size"),atrs=return_attributes("_wd_captchaform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_count+"*:*w_count*:*",form_fields+=w_operations+"*:*w_operations*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_input_size+"*:*w_input_size*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_recaptcha":w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_type=document.getElementById("wd_recaptchaform_id_temp").getAttribute("w_type"),w_position=document.getElementById("wd_recaptchaform_id_temp").getAttribute("position"),form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_type+"*:*w_type*:*",form_fields+=w_position+"*:*w_position*:*",form_fields+="*:*new_field*:*",document.getElementById("public_key").value=document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key"),document.getElementById("private_key").value=document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");break;case"type_map":for(w_lat=[],w_long=[],w_info=[],w_center_x=document.getElementById(id+"_elementform_id_temp").getAttribute("center_x"),w_center_y=document.getElementById(id+"_elementform_id_temp").getAttribute("center_y"),w_zoom=document.getElementById(id+"_elementform_id_temp").getAttribute("zoom"),w_width=""==document.getElementById(id+"_elementform_id_temp").style.width?"":parseInt(document.getElementById(id+"_elementform_id_temp").style.width),w_height=parseInt(document.getElementById(id+"_elementform_id_temp").style.height),j=0;j<=20;j++)document.getElementById(id+"_elementform_id_temp").getAttribute("lat"+j)&&(w_lat.push(document.getElementById(id+"_elementform_id_temp").getAttribute("lat"+j)),w_long.push(document.getElementById(id+"_elementform_id_temp").getAttribute("long"+j)),w_info.push(document.getElementById(id+"_elementform_id_temp").getAttribute("info"+j)));for(atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_center_x+"*:*w_center_x*:*",form_fields+=w_center_y+"*:*w_center_y*:*",form_fields+=w_long.join("***")+"*:*w_long*:*",form_fields+=w_lat.join("***")+"*:*w_lat*:*",form_fields+=w_zoom+"*:*w_zoom*:*",form_fields+=w_width+"*:*w_width*:*",form_fields+=w_height+"*:*w_height*:*",form_fields+=w_info.join("***")+"*:*w_info*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_mark_map":for(w_info=document.getElementById(id+"_elementform_id_temp").getAttribute("info0"),w_long=document.getElementById(id+"_elementform_id_temp").getAttribute("long0"),w_lat=document.getElementById(id+"_elementform_id_temp").getAttribute("lat0"),w_zoom=document.getElementById(id+"_elementform_id_temp").getAttribute("zoom"),w_width=""==document.getElementById(id+"_elementform_id_temp").style.width?"":parseInt(document.getElementById(id+"_elementform_id_temp").style.width),w_height=parseInt(document.getElementById(id+"_elementform_id_temp").style.height),w_center_x=document.getElementById(id+"_elementform_id_temp").getAttribute("center_x"),w_center_y=document.getElementById(id+"_elementform_id_temp").getAttribute("center_y"),w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_center_x+"*:*w_center_x*:*",form_fields+=w_center_y+"*:*w_center_y*:*",form_fields+=w_long+"*:*w_long*:*",form_fields+=w_lat+"*:*w_lat*:*",form_fields+=w_zoom+"*:*w_zoom*:*",form_fields+=w_width+"*:*w_width*:*",form_fields+=w_height+"*:*w_height*:*",form_fields+=w_info+"*:*w_info*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_submit_reset":for(atrs=return_attributes(id+"_element_submitform_id_temp"),w_act=!("none"==document.getElementById(id+"_element_resetform_id_temp").style.display),w_attr_name=atrs[0],w_attr_value=atrs[1],w_submit_title=document.getElementById(id+"_element_submitform_id_temp").value,w_reset_title=document.getElementById(id+"_element_resetform_id_temp").value,form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_submit_title+"*:*w_submit_title*:*",form_fields+=w_reset_title+"*:*w_reset_title*:*",form_fields+=w_class+"*:*w_class*:*",form_fields+=w_act+"*:*w_act*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_button":for(w_title=new Array,w_func=new Array,tt=0,v=0,k=0;k<100;k++)document.getElementById(id+"_elementform_id_temp"+k)&&(w_title[tt]=document.getElementById(id+"_elementform_id_temp"+k).value,w_func[tt]=document.getElementById(id+"_elementform_id_temp"+k).getAttribute("onclick"),tt++,v=k);for(atrs=return_attributes(id+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_title.join("***")+"*:*w_title*:*",form_fields+=w_func.join("***")+"*:*w_func*:*",form_fields+=w_class+"*:*w_class*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*";break;case"type_hidden":for(w_value=document.getElementById(id+"_elementform_id_temp").value,w_name=document.getElementById(id+"_elementform_id_temp").name,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_name+"*:*w_field_label*:*",form_fields+=w_name+"*:*w_name*:*",form_fields+=w_value+"*:*w_value*:*",j=0;j<w_attr_name.length;j++)form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";form_fields+="*:*new_field*:*"}}function fm_options_ready(){jQuery(".filed_label").each(function(){document.getElementById("frontend_submit_fields").value==document.getElementById("all_fields").value&&(document.getElementById("all_fields").checked=!0),inArray(this.value,document.getElementById("frontend_submit_fields").value.split(","))&&(this.checked=!0)}),jQuery(".stats_filed_label").each(function(){document.getElementById("frontend_submit_stat_fields").value==document.getElementById("all_stats_fields").value&&(document.getElementById("all_stats_fields").checked=!0),inArray(this.value,document.getElementById("frontend_submit_stat_fields").value.split(","))&&(this.checked=!0)}),jQuery(document).on("change",'input[name="all_fields"]',function(){jQuery(".filed_label").prop("checked",this.checked)}),jQuery(document).on("change",'input[name="all_stats_fields"]',function(){jQuery(".stats_filed_label").prop("checked",this.checked)}),fm_toggle_options("#div_gdpr_checkbox_text","1"==jQuery("input[name=gdpr_checkbox]:checked").val()),jQuery(".placeholders-filter").on("keyup input",function(){filter_placeholders(this)}),jQuery("#placeholders_overlay").on("click",function(){fm_placeholders_popup_close()}),jQuery(document).on("keydown",function(e){27===e.keyCode&&jQuery("#placeholders_overlay").is(":visible")&&fm_placeholders_popup_close()}),fm_remove_validate_error_message()}function fm_email_options_ready(){fm_toggle_options(".fm_email_options","1"==jQuery("input[name=sendemail]:checked").val()),jQuery(".placeholders-filter").on("keyup input",function(){filter_placeholders(this)}),jQuery("#placeholders_overlay").on("click",function(){fm_placeholders_popup_close()}),jQuery(document).on("keydown",function(e){27===e.keyCode&&jQuery("#placeholders_overlay").is(":visible")&&fm_placeholders_popup_close()}),fm_remove_validate_error_message()}function fm_document_ready(){var e=jQuery("#fieldset_id").val();form_maker_options_tabs(e),fm_change_payment_method(jQuery("input[name=paypal_mode]:checked").val()),"javascript"==e&&codemirror_for_javascript(),fm_popup()}function filter_placeholders(e){var t=jQuery(e).val().toLowerCase();if(jQuery(".filtered-placeholders .inside").html(""),""!=t){var i=!1;jQuery(".placeholders_cont .postbox").addClass("hide"),jQuery(".placeholders .postbox:not(.filtered-placeholders) .wd-button").each(function(){"-1"!=jQuery(this).html().toLowerCase().indexOf(t)&&(jQuery(".filtered-placeholders .inside").append(jQuery(this).clone()),i=!0)}),i||jQuery(".filtered-placeholders .inside").html(form_maker.nothing_found),jQuery(".placeholders_cont .filtered-placeholders").removeClass("hide")}else jQuery(".placeholders_cont .postbox").removeClass("hide"),jQuery(".placeholders_cont .filtered-placeholders").addClass("hide")}function wd_fm_apply_options(){var e=JSON.parse(jQuery("#fm_tabs_loaded").val());if(!inArray("form_options_tab",e)&&!inArray("form_email_options_tab",e))return!0;var o=!0;return jQuery(".fm-validate").each(function(){var e=jQuery(this).attr("data-type"),t=form_maker_manage.not_valid_value;"required"==e?t=form_maker_manage.required_field:"email"==e&&(t=form_maker_manage.not_valid_email),t="<p class='description fm-validate-description'>"+t+"</p>";var i=jQuery(this).attr("data-callback"),a=jQuery(this).attr("data-callback-parameter"),n=jQuery(this).attr("data-tab-id"),l=jQuery(this).attr("data-content-id"),d=jQuery(this).val();if("function"==typeof window[i]&&!window[i](d,a)){var _=jQuery("#"+l).closest(".ui-tabs-panel");if(jQuery("#fm-tabs").tabs({active:jQuery(".ui-tabs-panel").index(_)}),0!==jQuery(".fm_fieldset_active:visible").length&&(jQuery(".fm_fieldset_active").addClass("fm_fieldset_deactive").removeClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+l).removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery("#"+n).addClass("active"),jQuery("#fieldset_id").val(n)),0===jQuery(this).parent().find(".fm-validate-description").length){var r=jQuery(this).parent().find(".description");r.length?r.before(t):jQuery(this).parent().append(t),jQuery(this).addClass("fm-validate-field")}return jQuery("html, body").animate({scrollTop:jQuery(this).offset().top-200},500),o=!1}}),o&&set_condition(),o}function fm_remove_validate_error_message(){jQuery(".fm-validate").each(function(){jQuery(this).on("keypress change",function(){jQuery(this).parent().find(".fm-validate-description").remove(),jQuery(this).removeClass("fm-validate-field")})})}function fm_validate_email(e,t){if(""!=t&&!jQuery(t).is(":checked"))return!0;var i=e.split(","),a=/^[\u0400-\u04FFa-zA-Z0-9'.+_-]+@[\u0400-\u04FFa-zA-Z0-9.-]+\.[\u0400-\u04FFa-zA-Z]{2,61}$/,n=/^({)[0-9]+(})$/,l=["{adminemail}","{useremail}"];for(var d in i){var _=i[d].replace(/^\s+|\s+$/g,"");if(!l.includes(_)&&_&&!a.test(_)&&!n.test(_))return!1}return!0}function fm_add_inline_email_validation_message(e){return!!fm_validate_email(jQuery(e).val(),"")||(jQuery(e).after("<p class='description fm-validate-description'>"+form_maker_manage.not_valid_value+"</p>"),jQuery(e).addClass("fm-validate-field"),jQuery("html, body").animate({scrollTop:jQuery(this).offset().top-200},500),!1)}function fm_placeholders_popup(e){var t=jQuery("#"+e),i=t.closest(".wd-group");i.addClass("placeholders-active");var a=i.data("exclude-placeholder");jQuery(".fm-placeholder-item").show(),a&&1<a.length&&jQuery.each(a,function(e,t){jQuery("#fm-placeholder-"+t).hide()}),jQuery("html").animate({scrollTop:i.offset().top-50},500);var n=jQuery(".placeholder-popup");if(i.prepend(jQuery("#placeholders_overlay")),i.find(".wp-editor-wrap").length)i.find(".wp-editor-wrap").append(n);else{t.after(n);var l=t.val();t.focus().val("").val(l)}n.show()}function fm_placeholders_popup_close(){jQuery("#placeholders_overlay").closest(".wd-group").removeClass("placeholders-active");var e=jQuery("#placeholders_overlay"),t=jQuery(".placeholder-popup");jQuery(e).appendTo(".fm-placeholders-popup-wrap"),jQuery(t).appendTo(".fm-placeholders-popup-wrap"),t.hide()}function set_condition(){for(field_condition="",i=0;i<500;i++)if(conditions="",document.getElementById("condition"+i)){for(field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*",field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*",field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*",k=0;k<500;k++)if(document.getElementById("condition_div"+i+"_"+k)){if(conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***",conditions+=document.getElementById("is_select"+i+"_"+k).value+"***","SELECT"==document.getElementById("field_value"+i+"_"+k).tagName)if(document.getElementById("field_value"+i+"_"+k).getAttribute("multiple")){var e=document.getElementById("field_value"+i+"_"+k),t="";for(m=0;m<e.length;m++)e.options[m].selected&&(t+=e.options[m].value+"@@@");conditions+=t}else conditions+=document.getElementById("field_value"+i+"_"+k).value;else conditions+=fm_html_entities(document.getElementById("field_value"+i+"_"+k).value);conditions+="*:*next_condition*:*"}field_condition+=conditions,field_condition+="*:*new_condition*:*"}jQuery("#condition").length&&(document.getElementById("condition").value=field_condition)}function show_verify_options(e){e?(jQuery(".verification_div").removeAttr("style"),jQuery(".expire_link").removeAttr("style")):(jQuery(".verification_div").css("display","none"),jQuery(".expire_link").css("display","none"))}function inArray(e,t){for(var i=t.length,a=0;a<i;a++)if(t[a]==e)return!0;return!1}function checkAllByParentId(e){var t=document.getElementById(e).getElementsByTagName("input");if(t[0].checked)for(var i=0;i<t.length;i++)"checkbox"==t[i].type&&(t[i].checked=!0);else for(i=0;i<t.length;i++)"checkbox"==t[i].type&&(t[i].checked=!1)}function checked_labels(e){var t="";jQuery("."+e).each(function(){this.checked&&(t+=this.value+",")}),"filed_label"==e?(document.getElementById("frontend_submit_fields").value=t)==document.getElementById("all_fields").value?document.getElementById("all_fields").checked=!0:document.getElementById("all_fields").checked=!1:(document.getElementById("frontend_submit_stat_fields").value=t)==document.getElementById("all_stats_fields").value?document.getElementById("all_stats_fields").checked=!0:document.getElementById("all_stats_fields").checked=!1}function codemirror_for_javascript(){if(!jQuery("#form_javascript").next().length){var e=CodeMirror.fromTextArea(document.getElementById("form_javascript"),{lineNumbers:!0,lineWrapping:!0,mode:"javascript"});CodeMirror.commands.selectAll(e),e.autoFormatRange(e.getCursor(!0),e.getCursor(!1)),e.scrollTo(0,0)}}function fm_toggle_options(e,t){t?jQuery(e).show():jQuery(e).hide()}jQuery(window).on("beforeunload",function(){if(form_changed=!FormManageSubmitButton(!0),form_changed)return"Changes you made may not be saved."}),jQuery(window).on("load",function(){formOnload(gen)}),jQuery(function(){all_sortable_events(),1==is_sortable?jQuery(".wdform_arrows_advanced").hide():(jQuery(".wdform_column").sortable("disable"),jQuery(".wdform_arrows_advanced").show()),enable_drag(),jQuery(".wdform-page-and-images").hasClass("fm-form-builder")||jQuery(".fm-edit-content").append(jQuery('<div id="fm-edit-disable-overlay" class="wdform_arrows"><div class="fm-edit-disable-overlay-text"><span>This form is currently disabled for editing.<br />Please click <b>Convert</b> to adapt the form structure and enable editing.</span><div class="fm-edit-disable-overlay-button"><button class="button button-primary button-large" onclick="fm_convert_form_structure(); return false;">Convert</button></div></div></div>'))}),jQuery(document).on("keydown",function(e){27===e.keyCode&&(jQuery("#fm_popup_container").is(":visible")&&fm_popup_toggle("fm_popup_container"),jQuery("#fm_delete_page_popup_container").is(":visible")&&fm_popup_toggle("fm_delete_page_popup_container"),jQuery("#fm_revision_popup_container").is(":visible")&&fm_popup_toggle("fm_revision_popup_container"))}),jQuery(window).on("load",function(){storageAvailable("localStorage")&&localStorage.getItem("wd-form-first-time-use")||jQuery(".first-time-use").show(),jQuery(window).on("scroll",function(e){if(!jQuery("#add_field").hasClass("ui-sortable-helper")){var t=jQuery(".fm-edit-content").offset().top,i=jQuery(window).scrollTop();if(t-50<i)var a=i-t+50;else a=10;jQuery("#add_field_cont").css("top",a)}})}),jQuery(function(){jQuery(".first-time-use-close").on("click",function(){storageAvailable("localStorage")&&localStorage.setItem("wd-form-first-time-use",!0),jQuery(".first-time-use").hide()}),jQuery(".wdform_column").on("sortstart",function(e,t){jQuery(".first-time-use").hide()}),jQuery(".field-types-filter").on("keyup input",function(){filter(this)})}),jQuery(document).on("keydown",function(e){27===e.keyCode&&jQuery(".add-popup").is(":visible")&&close_window()}),jQuery(document).on("fm_tab_loaded",function(){fm_options_ready(),fm_document_ready()}),jQuery(document).on("fm_tab_email_loaded",function(){fm_email_options_ready()});var CodeMirror=function(){function Nt(e,t){var k={},i=Nt.defaults;for(var a in i)i.hasOwnProperty(a)&&(k[a]=(t&&t.hasOwnProperty(a)?t:i)[a]);var f=document.createElement("div");f.className="CodeMirror"+(k.lineWrapping?" CodeMirror-wrap":""),f.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scrollbar"><div class="CodeMirror-scrollbar-inner"></div></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><pre class="CodeMirror-cursor" style="visibility: hidden">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',e.appendChild?e.appendChild(f):e(f);var y=f.firstChild,_=y.firstChild,I=f.lastChild,u=I.firstChild,c=u.firstChild,h=c.firstChild,p=h.firstChild,b=h.nextSibling.firstChild,r=b.firstChild,v=r.nextSibling,o=v.nextSibling,w=o.nextSibling,g=w.nextSibling,E=y.nextSibling,n=E.firstChild;it(),at(),St&&(_.style.width="0px"),yi||(I.draggable=!0),b.style.outline="none",null!=k.tabindex&&(_.tabIndex=k.tabindex),k.autofocus&&Le(),k.gutter||k.lineNumbers||(h.style.display="none"),vi&&(y.style.height="1px",y.style.position="absolute"),wi?E.className+=function(){var e=document.createElement("div"),t=document.createElement("div");e.className="CodeMirror-scrollbar",e.style.cssText="position: absolute; left: -9999px; height: 100px;",t.className="CodeMirror-scrollbar-inner",t.style.height="200px",e.appendChild(t),document.body.appendChild(e);var i=e.offsetWidth<=1;return document.body.removeChild(e),i}()?" cm-sb-overlap":" cm-sb-nonoverlap":ci&&(E.className+=" cm-sb-ie7");try{rt("x")}catch(e){throw e.message.match(/runtime/i)&&(e=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),e}var l,C,B,A,d=new oi,m=new oi,Q=new Zt([new Yt([new Gt("")])]);Je();var s,j,x,T,M,L,z,q,H,N,S,D,P,O={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},K=0,U=0,F=!1,R=!1,W=0,V=0,$=0,G=0,Y="",Z=!1,X=!0,J={};zt(function(){_e(k.value||""),M=!1})();var ee,te=new ti;if(ri(I,"mousedown",zt(function(t){Ke(_i(t,"shiftKey"));for(var e=li(t);e!=f;e=e.parentNode)if(e.parentNode==u&&e!=c)return;for(var e=li(t);e!=f;e=e.parentNode)if(e.parentNode==p)return k.onGutterClick&&k.onGutterClick(ne,Ci(p.childNodes,e)+V,t),ai(t);var n=Et(t);switch(di(t)){case 3:return void(si&&!Dt&&At(t));case 2:return n&&We(n.line,n.ch,!0),setTimeout(Le,20),void ai(t)}if(!n)return void(li(t)==I&&ai(t));A||pe();var i=+new Date;{if(x&&x.time>i-400&&xi(x.pos,n))return ai(t),setTimeout(Le,20),void Ue({line:a=n.line,ch:0},$e({line:a+1,ch:0}));if(j&&j.time>i-400&&xi(j.pos,n))return x={time:i,pos:n},ai(t),Ze(n);j={time:i,pos:n}}var a;var l,d=n;if(k.dragDrop&&gi&&!k.readOnly&&!xi(O.from,O.to)&&!ki(n,O.from)&&!ki(O.to,n)){function _(e){yi&&(I.draggable=!1),T=!1,r(),o(),Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)<10&&(ai(e),We(n.line,n.ch,!0),Le())}yi&&(I.draggable=!0);var r=ri(document,"mouseup",zt(_),!0),o=ri(I,"drop",zt(_),!0);return T=!0,void(I.dragDrop&&I.dragDrop())}function m(e){clearTimeout(l);var t=Et(e);t&&Ue(n,t),ai(e),Le(),M=!0,s(),r()}ai(t),We(n.line,n.ch,!0);var s=ri(document,"mousemove",zt(function(e){clearTimeout(l),ai(e),ui||di(e)?function e(t){var i=Et(t,!0);if(i&&!xi(i,d)){A||pe(),Ue(n,d=i),M=!1;var a=Se();(i.line>=a.to||i.line<a.from)&&(l=setTimeout(zt(function(){e(t)}),150))}}(e):m(e)}),!0),r=ri(document,"mouseup",zt(m),!0)})),ri(I,"dblclick",zt(function(e){for(var t=li(e);t!=f;t=t.parentNode)if(t.parentNode==p)return ai(e);var i=Et(e);if(!i)return;x={time:+new Date,pos:i},ai(e),Ze(i)})),ri(b,"selectstart",ai),si||ri(I,"contextmenu",At),ri(I,"scroll",re),ri(E,"scroll",re),ri(E,"mousedown",function(){setTimeout(Le,0)}),ri(I,"mousewheel",he),ri(I,"DOMMouseScroll",he),ri(window,"resize",function(){De(!0)}),ri(_,"keyup",zt(function(e){if(k.onKeyEvent&&k.onKeyEvent(ne,ii(e)))return;16==_i(e,"keyCode")&&(s=null)})),ri(_,"input",Be),ri(_,"keydown",zt(ce)),ri(_,"keypress",zt(function(e){Ie&&Te();if(k.onKeyEvent&&k.onKeyEvent(ne,ii(e)))return;var t=_i(e,"keyCode"),i=_i(e,"charCode");if(bi&&t==ue)return ue=null,void ai(e);if((bi&&(!e.which||e.which<10)||vi)&&me(e))return;var a=String.fromCharCode(null==i?t:i);k.electricChars&&C.electricChars&&k.smartIndent&&!k.readOnly&&-1<C.electricChars.indexOf(a)&&setTimeout(zt(function(){Xe(O.to.line,"smart")}),75);if(function(e,t){var i=Ft("'"+t+"'",k.extraKeys,k.keyMap,function(e){return oe(e,!0)});i&&(ai(e),jt());return i}(e,a))return;Be()})),ri(_,"focus",pe),ri(_,"blur",fe),k.dragDrop){function ie(e){k.onDragEvent&&k.onDragEvent(ne,ii(e))||ni(e)}ri(I,"dragstart",function(e){var t=ke();if(e.dataTransfer.setData("Text",t),si||hi||bi){var i=document.createElement("img");i.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(i,0,0)}}),ri(I,"dragenter",ie),ri(I,"dragover",ie),ri(I,"drop",zt(function(e){if(k.onDragEvent&&k.onDragEvent(ne,ii(e)))return;e.preventDefault();var a=Et(e,!0),t=e.dataTransfer.files;if(!a||k.readOnly)return;if(t&&t.length&&window.FileReader&&window.File){function i(e,t){var i=new FileReader;i.onload=function(){l[t]=i.result,++d==n&&(a=$e(a),zt(function(){var e=Ee(l.join(""),a,a);Ue(a,e)})())},i.readAsText(e)}for(var n=t.length,l=Array(n),d=0,_=0;_<n;++_)i(t[_],_)}else{if(T&&!ki(a,O.from)&&!ki(O.to,a))return;try{var l=e.dataTransfer.getData("Text");l&&qt(function(){var e=O.from,t=O.to;Ue(a,a),T&&Ee("",e,t),Ae(l),Le()})}catch(e){}}}))}ri(I,"paste",function(){Le(),Be()}),ri(_,"paste",Be),ri(_,"cut",zt(function(){k.readOnly||Ae("")})),vi&&ri(u,"mouseup",function(){document.activeElement==_&&_.blur(),Le()});try{ee=document.activeElement==_}catch(e){}function ae(e){return 0<=e&&e<Q.size}ee||k.autofocus?setTimeout(pe,20):fe();var ne=f.CodeMirror={getValue:function(){var t=[];return Q.iter(0,Q.size,function(e){t.push(e.text)}),t.join("\n")},setValue:zt(_e),getSelection:ke,replaceSelection:zt(Ae),focus:function(){window.focus(),Le(),pe(),Be()},setOption:function(e,t){var i,a=k[e];k[e]=t,"mode"==e||"indentUnit"==e?Je():"readOnly"==e&&"nocursor"==t?(fe(),_.blur()):"readOnly"!=e||t?"theme"==e?it():"lineWrapping"==e&&a!=t?zt(et)():"tabSize"==e?De(!0):"keyMap"==e&&at():Me(!0),"lineNumbers"!=e&&"gutter"!=e&&"firstLineNumber"!=e&&"theme"!=e||(i=k.gutter||k.lineNumbers,h.style.display=i?"":"none",i?S=!0:g.parentNode.style.marginLeft=0,De(!0))},getOption:function(e){return k[e]},undo:zt(function(){ve(te.done,te.undone)}),redo:zt(function(){ve(te.undone,te.done)}),indentLine:zt(function(e,t){"string"!=typeof t&&(t=null==t?k.smartIndent?"smart":"prev":t?"add":"subtract"),ae(e)&&Xe(e,t)}),indentSelection:zt(function(e){if(xi(O.from,O.to))return Xe(O.from.line,e);for(var t=O.to.line-(O.to.ch?0:1),i=O.from.line;i<=t;++i)Xe(i,e)}),historySize:function(){return{undo:te.done.length,redo:te.undone.length}},clearHistory:function(){te=new ti},matchBrackets:zt(function(){kt(!0)}),getTokenAt:zt(function(e){return le((e=$e(e)).line).getTokenAt(C,Ct(e.line),e.ch)}),getStateAfter:function(e){return Ct((e=Ve(null==e?Q.size-1:e))+1)},cursorCoords:function(e,t){return null==e&&(e=O.inverted),this.charCoords(e?O.from:O.to,t)},charCoords:function(e,t){return e=$e(e),"local"==t?pt(e,!1):"div"==t?pt(e,!0):(i=pt(e,!0),{x:(a=Ai(b)).left+i.x,y:a.top+i.y,yBot:a.top+i.yBot});var i,a},coordsChar:function(e){var t=Ai(b);return ft(e.x-t.left,e.y-t.top)},markText:zt(lt),setBookmark:function(e){var t=new $t((e=$e(e)).ch);return le(e.line).addMark(t),t},findMarksAt:function(e){e=$e(e);var t=[],i=le(e.line).marked;if(!i)return t;for(var a=0,n=i.length;a<n;++a){var l=i[a];(null==l.from||l.from<=e.ch)&&(null==l.to||l.to>=e.ch)&&t.push(l.marker||l)}return t},setMarker:zt(function(e,t,i){"number"==typeof e&&(e=le(Ve(e)));return e.gutterMarker={text:t,style:i},S=!0,e}),clearMarker:zt(function(e){"number"==typeof e&&(e=le(Ve(e)));e.gutterMarker=null,S=!0}),setLineClass:zt(function(e,t,i){return dt(e,function(e){if(e.className!=t||e.bgClassName!=i)return e.className=t,e.bgClassName=i,!0})}),hideLine:zt(function(e){return _t(e,!0)}),showLine:zt(function(e){return _t(e,!1)}),onDeleteLine:function(e,t){if("number"==typeof e){if(!ae(e))return null;e=le(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:function(e){if("number"==typeof e){if(!ae(e))return null;var t=e;if(!(e=le(e)))return null}else{var t=Xt(e);if(null==t)return null}var i=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:i&&i.text,markerClass:i&&i.style,lineClass:e.className,bgClass:e.bgClassName}},addWidget:function(e,t,i,a,n){var l=(e=pt($e(e))).yBot,d=e.x;if(t.style.position="absolute",u.appendChild(t),"over"==a)l=e.y;else if("near"==a){var _=Math.max(I.offsetHeight,Q.height*yt()),r=Math.max(u.clientWidth,b.clientWidth)-gt();e.yBot+t.offsetHeight>_&&e.y>t.offsetHeight&&(l=e.y-t.offsetHeight),d+t.offsetWidth>r&&(d=r-t.offsetWidth)}t.style.top=l+wt()+"px",t.style.left=t.style.right="","right"==n?(d=u.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?d=0:"middle"==n&&(d=(u.clientWidth-t.offsetWidth)/2),t.style.left=d+gt()+"px"),i&&He(d,l,d+t.offsetWidth,l+t.offsetHeight)},lineCount:function(){return Q.size},clipPos:$e,getCursor:function(e){return null==e&&(e=O.inverted),{line:(t=e?O.from:O.to).line,ch:t.ch};var t},somethingSelected:function(){return!xi(O.from,O.to)},setCursor:zt(function(e,t,i){null==t&&"number"==typeof e.line?We(e.line,e.ch,i):We(e,t,i)}),setSelection:zt(function(e,t,i){(i?Ue:Fe)($e(e),$e(t||e))}),getLine:function(e){if(ae(e))return le(e).text},getLineHandle:function(e){if(ae(e))return le(e)},setLine:zt(function(e,t){ae(e)&&Ee(t,{line:e,ch:0},{line:e,ch:le(e).text.length})}),removeLine:zt(function(e){ae(e)&&Ee("",{line:e,ch:0},$e({line:e+1,ch:0}))}),replaceRange:zt(Ee),getRange:function(e,t){return xe($e(e),$e(t))},triggerOnKeyDown:zt(ce),execCommand:function(e){return Ot[e](ne)},moveH:zt(function(e,t){var i=e<0?O.from:O.to;(s||xi(O.from,O.to))&&(i=Ge(e,t));We(i.line,i.ch,!0)}),deleteH:zt(function(e,t){xi(O.from,O.to)?e<0?Ee("",Ge(e,t),O.to):Ee("",O.from,Ge(e,t)):Ee("",O.from,O.to);L=!0}),moveV:zt(function(e,t){var i=0,a=pt(O.inverted?O.from:O.to,!0);null!=Ye&&(a.x=Ye);"page"==t?i=Math.min(I.clientHeight,window.innerHeight||document.documentElement.clientHeight):"line"==t&&(i=yt());var n=ft(a.x,a.y+i*e+2);"page"==t&&(E.scrollTop+=pt(n,!0).y-a.y);We(n.line,n.ch,!0),Ye=a.x}),toggleOverwrite:function(){F?(F=!1,v.className=v.className.replace(" CodeMirror-overwrite","")):(F=!0,v.className+=" CodeMirror-overwrite")},posFromIndex:function(i){var a,n=0;return Q.iter(0,Q.size,function(e){var t=e.text.length+1;if(i<t)return a=i,!0;i-=t,++n}),$e({line:n,ch:a})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Q.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){null!=e&&(I.scrollLeft=e),null!=t&&(E.scrollTop=t),De([])},getScrollInfo:function(){return{x:I.scrollLeft,y:E.scrollTop,height:E.scrollHeight,width:I.scrollWidth}},operation:function(e){return zt(e)()},compoundChange:function(e){return qt(e)},refresh:function(){De(!0),E.scrollHeight>K&&(E.scrollTop=K)},getInputField:function(){return _},getWrapperElement:function(){return f},getScrollerElement:function(){return I},getGutterElement:function(){return h}};function le(e){return function(e,t){for(;!e.lines;)for(var i=0;;++i){var a=e.children[i],n=a.chunkSize();if(t<n){e=a;break}t-=n}return e.lines[t]}(Q,e)}function de(e,t){S=!0;for(var i=t-e.height,a=e;a;a=a.parent)a.height+=i}function _e(e){var t={line:0,ch:0};be(t,{line:Q.size-1,ch:le(Q.size-1).text.length},Qi(e),t,t),M=!0}function re(e){K==E.scrollTop&&U==I.scrollLeft||(K=E.scrollTop,U=I.scrollLeft,De([]),k.fixedGutter&&(h.style.left=I.scrollLeft+"px"),k.onScroll&&k.onScroll(ne))}function oe(e,t){if("string"==typeof e&&!(e=Ot[e]))return!1;var i=s;try{k.readOnly&&(R=!0),t&&(s=null),e(ne)}catch(e){if(e!=mi)throw e;return!1}finally{s=i,R=!1}return!0}function me(e){var t,i=Ut(k.keyMap),a=i.auto;clearTimeout(se),a&&("Ctrl"!=(t=Mi[_i(e,"keyCode")])&&"Alt"!=t&&"Shift"!=t&&"Mod"!=t)&&(se=setTimeout(function(){Ut(k.keyMap)==i&&(k.keyMap=a.call?a.call(null,ne):a)},50));var n=Mi[_i(e,"keyCode")],l=!1;if(null==n||e.altGraphKey)return!1;_i(e,"altKey")&&(n="Alt-"+n),_i(e,"ctrlKey")&&(n="Ctrl-"+n),_i(e,"metaKey")&&(n="Cmd-"+n);var d=!1;function _(){d=!0}return l=_i(e,"shiftKey")?Ft("Shift-"+n,k.extraKeys,k.keyMap,function(e){return oe(e,!0)},_)||Ft(n,k.extraKeys,k.keyMap,function(e){if("string"==typeof e&&/^go[A-Z]/.test(e))return oe(e)},_):Ft(n,k.extraKeys,k.keyMap,oe,_),d&&(l=!1),l&&(ai(e),jt(),ui&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),l}var se,ue=null;function ce(e){if(A||pe(),ui&&27==e.keyCode&&(e.returnValue=!1),Ie&&Te()&&(Ie=!1),!k.onKeyEvent||!k.onKeyEvent(ne,ii(e))){var t=_i(e,"keyCode");Ke(16==t||_i(e,"shiftKey"));var i=me(e);bi&&(ue=i?t:null,!i&&88==t&&_i(e,Dt?"metaKey":"ctrlKey")&&Ae(""))}}function pe(){"nocursor"!=k.readOnly&&(A||(k.onFocus&&k.onFocus(ne),A=!0,-1==I.className.search(/\bCodeMirror-focused\b/)&&(I.className+=" CodeMirror-focused"),N||Me(!0)),Ce(),jt())}function fe(){A&&(k.onBlur&&k.onBlur(ne),A=!1,P&&zt(function(){P&&(P(),P=null)})(),I.className=I.className.replace(" CodeMirror-focused","")),clearInterval(l),setTimeout(function(){A||(s=null)},150)}function ye(e){return 0<e&&e<1?1:-1<e&&e<0?-1:Math.round(e)}function he(e){var t=0,i=0;if("DOMMouseScroll"==e.type){var a=8*-e.detail;e.axis==e.HORIZONTAL_AXIS?t=a:e.axis==e.VERTICAL_AXIS&&(i=a)}else void 0!==e.wheelDeltaX&&void 0!==e.wheelDeltaY?(t=e.wheelDeltaX/3,i=e.wheelDeltaY/3):void 0!==e.wheelDelta&&(i=e.wheelDelta/3);var n=!1;t=ye(t),i=ye(i),(0<t&&0<I.scrollLeft||t<0&&I.scrollLeft+I.clientWidth<I.scrollWidth)&&(I.scrollLeft-=t,n=!0),(0<i&&0<E.scrollTop||i<0&&E.scrollTop+E.clientHeight<E.scrollHeight)&&(E.scrollTop-=i,n=!0),n&&ni(e)}function be(e,t,i,a,n){if(!R){if(te){var l=[];for(Q.iter(e.line,t.line+1,function(e){l.push(e.text)}),te.addChange(e.line,i.length,l);te.done.length>k.undoDepth;)te.done.shift()}we(e,t,i,a,n)}}function ve(e,t){if(e.length){for(var i=e.pop(),a=[],n=i.length-1;0<=n;n-=1){var l=i[n],d=[],_=l.start+l.added;Q.iter(l.start,_,function(e){d.push(e.text)}),a.push({start:l.start,added:l.old.length,old:d});var r={line:l.start+l.old.length-1,ch:Ii(d[d.length-1],l.old[l.old.length-1])};we({line:l.start,ch:0},{line:_-1,ch:le(_-1).text.length},l.old,r,r)}M=!0,t.push(a)}}function we(e,t,i,a,n){if(!R){var l=!1,d=Y.length;k.lineWrapping||Q.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==d)return l=!0}),(e.line!=t.line||1<i.length)&&(S=!0);var _=t.line-e.line,r=le(e.line),o=le(t.line);if(0==e.ch&&0==t.ch&&""==i[i.length-1]){var m=[],s=null;e.line?(s=le(e.line-1)).fixMarkEnds(o):o.fixMarkStarts();for(var u=0,c=i.length-1;u<c;++u)m.push(Gt.inheritMarks(i[u],s));_&&Q.remove(e.line,_,D),m.length&&Q.insert(e.line,m)}else if(r==o)if(1==i.length)r.replace(e.ch,t.ch,i[0]);else{o=r.split(t.ch,i[i.length-1]),r.replace(e.ch,null,i[0]),r.fixMarkEnds(o);for(m=[],u=1,c=i.length-1;u<c;++u)m.push(Gt.inheritMarks(i[u],r));m.push(o),Q.insert(e.line+1,m)}else if(1==i.length)r.replace(e.ch,null,i[0]),o.replace(null,t.ch,""),r.append(o),Q.remove(e.line+1,_,D);else{m=[];r.replace(e.ch,null,i[0]),o.replace(null,t.ch,i[i.length-1]),r.fixMarkEnds(o);for(u=1,c=i.length-1;u<c;++u)m.push(Gt.inheritMarks(i[u],r));1<_&&Q.remove(e.line+1,_-1,D),Q.insert(e.line+1,m)}if(k.lineWrapping){var p=Math.max(5,I.clientWidth/vt()-3);Q.iter(e.line,e.line+i.length,function(e){if(!e.hidden){var t=Math.ceil(e.text.length/p)||1;t!=e.height&&de(e,t)}})}else Q.iter(e.line,e.line+i.length,function(e){var t=e.text;!e.hidden&&t.length>d&&(d=(Y=t).length,l=!(X=!0))}),l&&(Z=!0);for(var f=[],y=i.length-_-1,h=(u=0,B.length);u<h;++u){var b=B[u];b<e.line?f.push(b):b>t.line&&f.push(b+y)}var v,w,g,E=e.line+Math.min(i.length,500);v=e.line,w=E,g=Ct(v),Q.iter(v,w,function(e){e.highlight(C,g,k.tabSize),e.stateAfter=Rt(C,g)}),f.push(E),B=f,Qt(100),z.push({from:e.line,to:t.line+1,diff:y});var A={from:e,to:t,text:i};if(q){for(var j=q;j.next;j=j.next);j.next=A}else q=A;Fe($e(a),$e(n),x(O.from.line),x(O.to.line))}function x(e){return e<=Math.min(t.line,t.line+y)?e:e+y}}function ge(e){var t=yt(),i=Math.floor(Q.height*t+2*wt()),a=I.clientHeight;E.style.height=a+"px",I.clientHeight&&(n.style.height=i+"px"),null!=e&&(E.scrollTop=e),c.style.top=W*t-E.scrollTop+"px",E.style.display=a<i?"block":"none"}function Ee(a,n,l){function t(e){if(ki(e,n))return e;if(!ki(l,e))return d;var t=e.line+a.length-(l.line-n.line)-1,i=e.ch;return e.line==l.line&&(i+=a[a.length-1].length-(l.ch-(l.line==n.line?n.ch:0))),{line:t,ch:i}}var d;return n=$e(n),l=l?$e(l):n,je(a=Qi(a),n,l,function(e){return d=e,{from:t(O.from),to:t(O.to)}}),d}function Ae(e,t){je(Qi(e),O.from,O.to,function(e){return"end"==t?{from:e,to:e}:"start"==t?{from:O.from,to:O.from}:{from:O.from,to:e}})}function je(e,t,i,a){var n=1==e.length?e[0].length+t.ch:e[e.length-1].length,l=a({line:t.line+e.length-1,ch:n});be(t,i,e,l.from,l.to)}function xe(e,t){var i=e.line,a=t.line;if(i==a)return le(i).text.slice(e.ch,t.ch);var n=[le(i).text.slice(e.ch)];return Q.iter(i+1,a,function(e){n.push(e.text)}),n.push(le(a).text.slice(0,t.ch)),n.join("\n")}function ke(){return xe(O.from,O.to)}var Ie=!1;function Ce(){Ie||d.set(k.pollInterval,function(){Tt(),Te(),A&&Ce(),Mt()})}function Be(){var t=!1;Ie=!0,d.set(20,function e(){Tt(),Te()||t?(Ie=!1,Ce()):(t=!0,d.set(60,e)),Mt()})}var Qe="";function Te(){if(N||!A||Ti(_)||k.readOnly)return!1;var e=_.value;if(e==Qe)return!1;s=null;for(var t=0,i=Math.min(Qe.length,e.length);t<i&&Qe[t]==e[t];)++t;return t<Qe.length?O.from={line:O.from.line,ch:O.from.ch-(Qe.length-t)}:F&&xi(O.from,O.to)&&(O.to={line:O.to.line,ch:Math.min(le(O.to.line).text.length,O.to.ch+(e.length-t))}),Ae(e.slice(t),"end"),1e3<e.length?_.value=Qe="":Qe=e,!0}function Me(e){xi(O.from,O.to)?e&&(Qe=_.value=""):(Qe="",_.value=ke(),ji(_))}function Le(){"nocursor"!=k.readOnly&&_.focus()}function ze(){var e=qe();return He(e.x,e.y,e.x,e.yBot)}function qe(){var e=pt(O.inverted?O.from:O.to);return{x:k.lineWrapping?Math.min(e.x,b.offsetWidth):e.x,y:e.y,yBot:e.yBot}}function He(e,t,i,a){var n=Ne(e,t,i,a),l=!1;null!=n.scrollLeft&&(I.scrollLeft=n.scrollLeft,l=!0),null!=n.scrollTop&&(E.scrollTop=n.scrollTop,l=!0),l&&k.onScroll&&k.onScroll(ne)}function Ne(e,t,i,a){var n=gt(),l=wt();t+=l,a+=l,e+=n,i+=n;var d=I.clientHeight,_=E.scrollTop,r={},o=t<wt()+10;t<_?r.scrollTop=o?0:Math.max(0,t):_+d<a&&(r.scrollTop=a-d);var m=I.clientWidth,s=I.scrollLeft,u=k.fixedGutter?h.clientWidth:0,c=e<u+n+10;return e<s+u||c?(c&&(e=0),r.scrollLeft=Math.max(0,e-10-u)):m+s-3<i&&(r.scrollLeft=i+10-m),r}function Se(e){var t=yt(),i=(null!=e?e:E.scrollTop)-wt(),a=Math.max(0,Math.floor(i/t)),n=Math.ceil((i+I.clientHeight)/t);return{from:Jt(Q,a),to:Jt(Q,n)}}function De(e,t,i){if(I.clientWidth){var a=Se(i);if(!0!==e&&0==e.length&&a.from>V&&a.to<$)ge(i);else{var n=Math.max(a.from-100,0),l=Math.min(Q.size,a.to+100);V<n&&n-V<20&&(n=V),l<$&&$-l<20&&(l=Math.min(Q.size,$));for(var d=!0===e?[]:function(e,t){for(var i=0,a=t.length||0;i<a;++i){for(var n=t[i],l=[],d=n.diff||0,_=0,r=e.length;_<r;++_){var o=e[_];n.to<=o.from&&n.diff?l.push({from:o.from+d,to:o.to+d,domStart:o.domStart}):n.to<=o.from||n.from>=o.to?l.push(o):(n.from>o.from&&l.push({from:o.from,to:n.from,domStart:o.domStart}),n.to<o.to&&l.push({from:n.to+d,to:o.to+d,domStart:o.domStart+(n.to-o.from)}))}e=l}return e}([{from:V,to:$,domStart:0}],e),_=0,r=0;r<d.length;++r){var o=d[r];o.from<n&&(o.domStart+=n-o.from,o.from=n),o.to>l&&(o.to=l),o.from>=o.to?d.splice(r--,1):_+=o.to-o.from}if(_!=l-n||n!=V||l!=$){d.sort(function(e,t){return e.domStart-t.domStart});var m=yt(),s=h.style.display;g.style.display="none",function(e,t,i){if(i.length){function a(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}for(var n=0,l=g.firstChild,d=0;d<i.length;++d){for(var _=i[d];_.domStart>n;)l=a(l),n++;for(var r=0,o=_.to-_.from;r<o;++r)l=l.nextSibling,n++}for(;l;)l=a(l)}else g.innerHTML="";var m=i.shift(),l=g.firstChild,r=e,s=document.createElement("div");Q.iter(e,t,function(e){if(m&&m.to==r&&(m=i.shift()),!m||m.from>r){if(e.hidden)var t=s.innerHTML="<pre></pre>";else{var t="<pre"+(e.className?' class="'+e.className+'"':"")+">"+e.getHTML(tt)+"</pre>";e.bgClassName&&(t='<div style="position: relative"><pre class="'+e.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+t+"</div>")}s.innerHTML=t,g.insertBefore(s.firstChild,l)}else l=l.nextSibling;++r})}(n,l,d),g.style.display=h.style.display="";var u=n!=V||l!=$||G!=I.clientHeight+m;if(u&&(G=I.clientHeight+m),$=l,W=ei(Q,V=n),g.childNodes.length!=$-V)throw new Error("BAD PATCH! "+JSON.stringify(d)+" size="+($-V)+" nodes="+g.childNodes.length);if(k.lineWrapping){var c=Math.floor(Q.height*m+2*wt());I.clientHeight<c&&(E.style.display="block"),p()}return h.style.display=s,(u||S)&&Pe()&&k.lineWrapping&&p()&&Pe(),Oe(),ge(i),!t&&k.onUpdate&&k.onUpdate(ne),!0}ge(i)}}else V=$=W=0;function p(){var i=g.firstChild,a=!1;return Q.iter(V,$,function(e){if(!e.hidden){var t=Math.round(i.offsetHeight/m)||1;e.height!=t&&(de(e,t),S=a=!0)}i=i.nextSibling}),a}}function Pe(){if(k.gutter||k.lineNumbers){var e=c.offsetHeight,t=I.clientHeight;h.style.height=(e-t<2?t:e)+"px";var n,i,l=[],d=V;if(Q.iter(V,Math.max($,V+1),function(e){if(e.hidden)l.push("<pre></pre>");else{var t=e.gutterMarker,i=k.lineNumbers?d+k.firstLineNumber:null;t&&t.text?i=t.text.replace("%N%",null!=i?i:""):null==i&&(i=" "),l.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",i);for(var a=1;a<e.height;++a)l.push("<br/>&#160;");l.push("</pre>"),t||(n=d)}++d}),h.style.display="none",p.innerHTML=l.join(""),null!=n&&k.lineNumbers){for(var a=p.childNodes[n-V],_=String(Q.size).length,r=(i=a.firstChild).textContent||i.innerText||i.nodeValue||"",o="";r.length+o.length<_;)o+=" ";o&&a.insertBefore(document.createTextNode(o),a.firstChild)}h.style.display="";var m=2<Math.abs((parseInt(b.style.marginLeft)||0)-h.offsetWidth);return b.style.marginLeft=h.offsetWidth+"px",S=!1,m}}function Oe(){var e=xi(O.from,O.to),t=pt(O.from,!0),i=e?t:pt(O.to,!0),a=O.inverted?t:i,n=yt(),l=Ai(f),d=Ai(g);if(y.style.top=Math.max(0,Math.min(I.offsetHeight,a.y+d.top-l.top))+"px",y.style.left=Math.max(0,Math.min(I.offsetWidth,a.x+d.left-l.left))+"px",e)v.style.top=a.y+"px",v.style.left=(k.lineWrapping?Math.min(a.x,b.offsetWidth):a.x)+"px",v.style.display="",w.style.display="none";else{var _=t.y==i.y,r="",o=b.clientWidth||b.offsetWidth,m=b.clientHeight||b.offsetHeight;function s(e,t,i,a){r+='<div class="CodeMirror-selected" style="position: absolute; left: '+e+"px; top: "+t+"px; "+(fi?"width: "+(i?o-i-e:o)+"px":"right: "+i+"px")+"; height: "+a+'px"></div>'}if(O.from.ch&&0<=t.y){var u=_?o-i.x:0;s(t.x,t.y,u,n)}var c=Math.max(0,t.y+(O.from.ch?n:0)),p=Math.min(i.y,m)-c;.2*n<p&&s(0,c,0,p),_&&O.from.ch||!(i.y<m-.5*n)||s(0,i.y,o-i.x,n),w.innerHTML=r,v.style.display="none",w.style.display=""}}function Ke(e){s=e?s||(O.inverted?O.to:O.from):null}function Ue(e,t){var i=s&&$e(s);i&&(ki(i,e)?e=i:ki(t,i)&&(t=i)),Fe(e,t),L=!0}function Fe(e,t,i,a){if((Ye=null)==i&&(i=O.from.line,a=O.to.line),!xi(O.from,e)||!xi(O.to,t)){if(ki(t,e)){var n=t;t=e,e=n}if(e.line!=i){var l=Re(e,i,O.from.ch);l?e=l:_t(e.line,!1)}if(t.line!=a&&(t=Re(t,a,O.to.ch)),xi(e,t)?O.inverted=!1:xi(e,O.to)?O.inverted=!1:xi(t,O.from)&&(O.inverted=!0),k.autoClearEmptyLines&&xi(O.from,O.to))if((O.inverted?e:t).line!=O.from.line&&O.from.line<Q.size){var d=le(O.from.line);/^\s+$/.test(d.text)&&setTimeout(zt(function(){if(d.parent&&/^\s+$/.test(d.text)){var e=Xt(d);Ee("",{line:e,ch:0},{line:e,ch:d.text.length})}}))}O.from=e,O.to=t,H=!0}}function Re(l,e,d){function t(e){for(var t=l.line+e,i=1==e?Q.size:-1;t!=i;){var a=le(t);if(!a.hidden){var n=l.ch;return(_||d<n||n>a.text.length)&&(n=a.text.length),{line:t,ch:n}}t+=e}}var i=le(l.line),_=l.ch==i.text.length&&l.ch!=d;return i.hidden?l.line>=e?t(1)||t(-1):t(-1)||t(1):l}function We(e,t,i){var a=$e({line:e,ch:t||0});(i?Ue:Fe)(a,a)}function Ve(e){return Math.max(0,Math.min(e,Q.size-1))}function $e(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Q.size)return{line:Q.size-1,ch:le(Q.size-1).text.length};var t=e.ch,i=le(e.line).text.length;return null==t||i<t?{line:e.line,ch:i}:t<0?{line:e.line,ch:0}:e}function Ge(a,e){var t=O.inverted?O.from:O.to,n=t.line,i=t.ch,l=le(n);function d(e){if(i==(a<0?0:l.text.length)){if(e||!function(){for(var e=n+a,t=a<0?-1:Q.size;e!=t;e+=a){var i=le(e);if(!i.hidden)return n=e,l=i,!0}}())return!1;i=a<0?l.text.length:0}else i+=a;return!0}if("char"==e)d();else if("column"==e)d(!0);else if("word"==e)for(var _=!1;!(a<0)||d();){if(Bi(l.text.charAt(i)))_=!0;else if(_){a<0&&(a=1,d());break}if(0<a&&!d())break}return{line:n,ch:i}}var Ye=null;function Ze(e){for(var t=le(e.line).text,i=e.ch,a=e.ch;0<i&&Bi(t.charAt(i-1));)--i;for(;a<t.length&&Bi(t.charAt(a));)++a;Ue({line:e.line,ch:i},{line:e.line,ch:a})}function Xe(e,t){if(t||(t="add"),"smart"==t)if(C.indent)var i=Ct(e);else t="prev";var a,n=le(e),l=n.indentation(k.tabSize),d=n.text.match(/^\s*/)[0];if("smart"==t&&(a=C.indent(i,n.text.slice(d.length),n.text))==mi&&(t="prev"),"prev"==t?a=e?le(e-1).indentation(k.tabSize):0:"add"==t?a=l+k.indentUnit:"subtract"==t&&(a=l-k.indentUnit),(a=Math.max(0,a))-l){o="";var _=0;if(k.indentWithTabs)for(var r=Math.floor(a/k.tabSize);r;--r)_+=k.tabSize,o+="\t";for(;_<a;)++_,o+=" "}else{if(O.from.line!=e&&O.to.line!=e)return;var o=d}Ee(o,{line:e,ch:0},{line:e,ch:d.length})}function Je(){C=Nt.getMode(k,k.mode),Q.iter(0,Q.size,function(e){e.stateAfter=null}),B=[0],Qt()}function et(e,t){if(k.lineWrapping){f.className+=" CodeMirror-wrap";var i=I.clientWidth/vt()-3;Q.iter(0,Q.size,function(e){if(!e.hidden){var t=Math.ceil(e.text.length/i)||1;1!=t&&de(e,t)}}),b.style.width=u.style.width="",o.style.left=""}else f.className=f.className.replace(" CodeMirror-wrap",""),X=!(Y=""),Q.iter(0,Q.size,function(e){1==e.height||e.hidden||de(e,1),e.text.length>Y.length&&(Y=e.text)});z.push({from:0,to:Q.size})}function tt(e){var t=k.tabSize-e%k.tabSize,i=J[t];if(i)return i;for(var a='<span class="cm-tab">',n=0;n<t;++n)a+=" ";return J[t]={html:a+"</span>",width:t}}function it(){I.className=I.className.replace(/\s*cm-s-\S+/g,"")+k.theme.replace(/(^|\s)\s*/g," cm-s-")}function at(){var e=Kt[k.keyMap].style;f.className=f.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function nt(){this.set=[]}function lt(e,t,i){e=$e(e),t=$e(t);var n=new nt;if(!ki(e,t))return n;function a(e,t,i,a){le(e).addMark(new Vt(t,i,a,n))}if(e.line==t.line)a(e.line,e.ch,t.ch,i);else{a(e.line,e.ch,null,i);for(var l=e.line+1,d=t.line;l<d;++l)a(l,null,null,i);a(t.line,null,t.ch,i)}return z.push({from:e.line,to:t.line+1}),n}function dt(e,t){var i=e,a=e;return"number"==typeof e?a=le(Ve(e)):i=Xt(e),null==i?null:t(a,i)?(z.push({from:i,to:i+1}),a):null}function _t(e,_){return dt(e,function(e,t){if(e.hidden!=_){if(e.hidden=_,!k.lineWrapping){var i=e.text;_&&i.length==Y.length?Z=!0:!_&&i.length>Y.length&&(Y=i,maxWidth=null,Z=!1)}de(e,_?0:1);var a=O.from.line,n=O.to.line;if(_&&(a==t||n==t)){var l=a==t?Re({line:a,ch:0},a,0):O.from,d=n==t?Re({line:n,ch:0},n,0):O.to;if(!d)return;Fe(l,d)}return S=!0}})}function rt(e){return r.innerHTML="<pre><span>x</span></pre>",r.firstChild.firstChild.firstChild.nodeValue=e,r.firstChild.firstChild.offsetWidth||10}nt.prototype.clear=zt(function(){for(var e=1/0,t=-1/0,i=0,a=this.set.length;i<a;++i){var n=this.set[i],l=n.marked;if(l&&n.parent){var d=Xt(n);e=Math.min(e,d),t=Math.max(t,d);for(var _=0;_<l.length;++_)l[_].marker==this&&l.splice(_--,1)}}e!=1/0&&z.push({from:e,to:t+1})}),nt.prototype.find=function(){for(var e,t,i=0,a=this.set.length;i<a;++i)for(var n=this.set[i],l=n.marked,d=0;d<l.length;++d){var _=l[d];if(_.marker==this&&(null!=_.from||null!=_.to)){var r=Xt(n);null!=r&&(null!=_.from&&(e={line:r,ch:_.from}),null!=_.to&&(t={line:r,ch:_.to}))}}return{from:e,to:t}};var ot,mt,st,ut="CodeMirror-temp-"+Math.floor(16777215*Math.random()).toString(16);function ct(e,t){if(0==t)return{top:0,left:0};var i=k.lineWrapping&&t<e.text.length&&Ei.test(e.text.slice(t-1,t+1));r.innerHTML="<pre>"+e.getHTML(tt,t,ut,i)+"</pre>";var a=document.getElementById(ut),n=a.offsetTop,l=a.offsetLeft;if(ui&&0==n&&0==l){var d=document.createElement("span");d.innerHTML="x",a.parentNode.insertBefore(d,a.nextSibling),n=d.offsetTop}return{top:n,left:l}}function pt(e,t){var i,a=yt(),n=a*(ei(Q,e.line)-(t?W:0));if(0==e.ch)i=0;else{var l=ct(le(e.line),e.ch);i=l.left,k.lineWrapping&&(n+=Math.max(0,l.top))}return{x:i,y:n,yBot:n+a}}function ft(e,t){t<0&&(t=0);var a=yt(),i=vt(),n=W+Math.floor(t/a),l=Jt(Q,n);if(l>=Q.size)return{line:Q.size-1,ch:le(Q.size-1).text.length};var d=le(l),_=d.text,r=k.lineWrapping,o=r?n-ei(Q,l):0;if(e<=0&&0==o)return{line:l,ch:0};function m(e){var t=ct(d,e);if(r){var i=Math.round(t.top/a);return Math.max(0,t.left+(i-o)*I.clientWidth)}return t.left}for(var s,u=0,c=0,p=_.length,f=Math.min(p,Math.ceil((e+o*I.clientWidth*.9)/i));;){var y=m(f);if(!(y<=e&&f<p)){s=y,p=f;break}f=Math.min(p,Math.ceil(1.2*f))}if(s<e)return{line:l,ch:p};for((y=m(f=Math.floor(.8*p)))<e&&(u=f,c=y);;){if(p-u<=1)return{line:l,ch:e-c<s-e?u:p};var h=Math.ceil((u+p)/2),b=m(h);e<b?(p=h,s=b):(u=h,c=b)}}function yt(){if(null==st){st="<pre>";for(var e=0;e<49;++e)st+="x<br/>";st+="x</pre>"}var t=g.clientHeight;return t==mt||(mt=t,r.innerHTML=st,ot=r.firstChild.offsetHeight/50||1,r.innerHTML=""),ot}var ht,bt=0;function vt(){return I.clientWidth==bt?ht:(bt=I.clientWidth,ht=rt("x"))}function wt(){return b.offsetTop}function gt(){return b.offsetLeft}function Et(e,t){var i,a,n=Ai(I,!0);try{i=e.clientX,a=e.clientY}catch(e){return null}if(!t&&(i-n.left>I.clientWidth||a-n.top>I.clientHeight))return null;var l=Ai(b,!0);return ft(i-l.left,a-l.top)}function At(e){var t=Et(e),i=E.scrollTop;if(t&&!bi){(xi(O.from,O.to)||ki(t,O.from)||!ki(t,O.to))&&zt(We)(t.line,t.ch);var a=_.style.cssText;y.style.position="absolute",_.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",N=!0;var n=_.value=ke();if(Le(),ji(_),si){ni(e);var l=ri(window,"mouseup",function(){l(),setTimeout(d,20)},!0)}else setTimeout(d,50)}function d(){var e=Qi(_.value).join("\n");e==n||k.readOnly||zt(Ae)(e,"end"),y.style.position="relative",_.style.cssText=a,pi&&(E.scrollTop=i),Me(!(N=!1)),Ce()}}function jt(){clearInterval(l);var e=!0;v.style.visibility="",l=setInterval(function(){v.style.visibility=(e=!e)?"":"hidden"},650)}var xt={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function kt(e){var t=O.inverted?O.from:O.to,i=le(t.line),a=t.ch-1,n=0<=a&&xt[i.text.charAt(a)]||xt[i.text.charAt(++a)];if(n){n.charAt(0);for(var u=">"==n.charAt(1),c=u?1:-1,l=i.styles,d=a+1,_=0,r=l.length;_<r;_+=2)if((d-=l[_].length)<=0){var p=l[_+1];break}var f=[i.text.charAt(a)],y=/[(){}[\]]/;for(_=t.line,r=u?Math.min(_+100,Q.size):Math.max(-1,_-100);_!=r;_+=c){i=le(_);var o=_==t.line,m=v(i,o&&u?a+1:0,o&&!u?a:i.text.length);if(m)break}m||(m={pos:null,match:!1});p=m.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";var s=lt({line:t.line,ch:a},{line:t.line,ch:a+1},p),h=null!=m.pos&&lt({line:_,ch:m.pos},{line:_,ch:m.pos+1},p),b=zt(function(){s.clear(),h&&h.clear()});e?setTimeout(b,800):P=b}function v(e,t,i){if(e.text)for(var a,n=e.styles,l=u?0:e.text.length-1,d=u?0:n.length-2,_=u?n.length:-2;d!=_;d+=2*c){var r=n[d];if(n[d+1]==p){for(var o=u?0:r.length-1,m=u?r.length:-1;o!=m;o+=c,l+=c)if(t<=l&&l<i&&y.test(a=r.charAt(o))){var s=xt[a];if(">"==s.charAt(1)==u)f.push(a);else{if(f.pop()!=s.charAt(0))return{pos:l,match:!1};if(!f.length)return{pos:l,match:!0}}}}else l+=c*r.length}}}function It(e){for(var t,i,a=e,n=e-40;n<a;--a){if(0==a)return 0;var l=le(a-1);if(l.stateAfter)return a;var d=l.indentation(k.tabSize);(null==i||d<t)&&(i=a-1,t=d)}return i}function Ct(e){var t=It(e),i=t&&le(t-1).stateAfter;return i=i?Rt(C,i):Wt(C),Q.iter(t,e,function(e){e.highlight(C,i,k.tabSize),e.stateAfter=Rt(C,i)}),t<e&&z.push({from:t,to:e}),e<Q.size&&!le(e).stateAfter&&B.push(e),i}function Bt(){for(var l=+new Date+k.workTime,e=B.length;B.length;){if(le(V).stateAfter)d=B.pop();else var d=V;if(!(d>=Q.size)){var t=It(d),_=t&&le(t-1).stateAfter;_=_?Rt(C,_):Wt(C);var r=0,o=C.compareStates,m=!1,s=t,u=!1;if(Q.iter(s,Q.size,function(e){var t=e.stateAfter;if(+new Date>l)return B.push(s),Qt(k.workDelay),m&&z.push({from:d,to:s+1}),u=!0;var i=e.highlight(C,_,k.tabSize);i&&(m=!0),e.stateAfter=Rt(C,_);var a=null;if(o){var n=t&&o(t,_);n!=mi&&(a=!!n)}if(null==a&&(!1===i&&t?3<++r&&(!C.indent||C.indent(t,"")==C.indent(_,""))&&(a=!0):r=0),a)return!0;++s}),u)return;m&&z.push({from:d,to:s+1})}}e&&k.onHighlightComplete&&k.onHighlightComplete(ne)}function Qt(e){B.length&&m.set(e,zt(Bt))}function Tt(){M=L=q=null,H=!(z=[]),D=[]}function Mt(){var i,e,t;if(Z&&(i=0,X=!(Y=""),Q.iter(0,Q.size,function(e){var t=e.text;!e.hidden&&t.length>i&&(i=t.length,Y=t)}),Z=!1),X&&!k.lineWrapping&&(o.style.left=rt(Y)+"px",X=!1),H){var a=qe();e=Ne(a.x,a.y,a.x,a.yBot)}z.length?t=De(z,!0,e?e.scrollTop:null):(H&&Oe(),S&&Pe()),e&&ze(),H&&(!function(){if(v.getBoundingClientRect){var e=v.getBoundingClientRect();if(!ui||e.top!=e.bottom){var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&ze()}}}(),jt()),A&&!N&&(!0===M||!1!==M&&H)&&Me(L),H&&k.matchBrackets&&setTimeout(zt(function(){P&&(P(),P=null),xi(O.from,O.to)&&kt(!1)}),20);var n=H,l=D;q&&k.onChange&&ne&&k.onChange(ne,q),n&&k.onCursorActivity&&k.onCursorActivity(ne);for(var d=0;d<l.length;++d)l[d](ne);t&&k.onUpdate&&k.onUpdate(ne)}var Lt=0;function zt(t){return function(){Lt++||Tt();try{var e=t.apply(this,arguments)}finally{--Lt||Mt()}return e}}function qt(e){te.startCompound();try{return e()}finally{te.endCompound()}}for(var Ht in Pt)Pt.propertyIsEnumerable(Ht)&&!ne.propertyIsEnumerable(Ht)&&(ne[Ht]=Pt[Ht]);return ne}Nt.defaults={value:"",mode:null,theme:"default",indentUnit:5,indentWithTabs:!1,smartIndent:!0,tabSize:6,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var St=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Dt=St||/Mac/.test(navigator.platform),a=(/Win/.test(navigator.platform),Nt.modes={}),i=Nt.mimeModes={};Nt.defineMode=function(e,t){if(Nt.defaults.mode||"null"==e||(Nt.defaults.mode=e),2<arguments.length){t.dependencies=[];for(var i=2;i<arguments.length;++i)t.dependencies.push(arguments[i])}a[e]=t},Nt.defineMIME=function(e,t){i[e]=t},Nt.resolveMode=function(e){if("string"==typeof e&&i.hasOwnProperty(e))e=i[e];else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Nt.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}},Nt.getMode=function(e,t){t=Nt.resolveMode(t);var i=a[t.name];return i?i(e,t):Nt.getMode(e,"text/plain")},Nt.listModes=function(){var e=[];for(var t in a)a.propertyIsEnumerable(t)&&e.push(t);return e},Nt.listMIMEs=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push({mime:t,mode:i[t]});return e};var Pt=Nt.extensions={};Nt.defineExtension=function(e,t){Pt[e]=t};var Ot=Nt.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),i=e.getCursor(!1),a=!xi(t,i);a||e.getLine(t.line).length!=t.ch?e.replaceRange("",t,a?i:{line:t.line}):e.replaceRange("",t,{line:t.line+1,ch:0})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),i=e.getLine(t.line),a=Math.max(0,i.search(/\S/));e.setCursor(t.line,t.ch<=a&&t.ch?0:a,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("\t","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection("\t","end")},transposeChars:function(e){var t=e.getCursor(),i=e.getLine(t.line);0<t.ch&&t.ch<i.length-1&&e.replaceRange(i.charAt(t.ch)+i.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},Kt=Nt.keyMap={};function Ut(e){return"string"==typeof e?Kt[e]:e}function Ft(l,e,t,d,_){function r(e){var t=(e=Ut(e))[l];if(null!=t&&d(t))return!0;if(e.nofallthrough)return _&&_(),!0;var i=e.fallthrough;if(null==i)return!1;if("[object Array]"!=Object.prototype.toString.call(i))return r(i);for(var a=0,n=i.length;a<n;++a)if(r(i[a]))return!0;return!1}return!(!e||!r(e))||r(t)}function Rt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var i={};for(var a in t){var n=t[a];n instanceof Array&&(n=n.concat([])),i[a]=n}return i}function Wt(e,t,i){return!e.startState||e.startState(t,i)}function s(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function Vt(e,t,i,a){this.from=e,this.to=t,this.style=i,this.marker=a}function $t(e){this.from=e,this.to=e,this.line=null}function Gt(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function o(e,t,i,a){for(var n=0,l=0,d=0;l<t;n+=2){var _=i[n],r=l+_.length;0==d?(e<r&&a.push(_.slice(e-l,Math.min(_.length,t-l)),i[n+1]),e<=r&&(d=1)):1==d&&(t<r?a.push(_.slice(0,t-l),i[n+1]):a.push(_,i[n+1])),l=r}}function Yt(e){this.lines=e,this.parent=null;for(var t=0,i=e.length,a=0;t<i;++t)e[t].parent=this,a+=e[t].height;this.height=a}function Zt(e){for(var t=0,i=0,a=0,n=(this.children=e).length;a<n;++a){var l=e[a];t+=l.chunkSize(),i+=l.height,l.parent=this}this.size=t,this.height=i,this.parent=null}function Xt(e){if(null==e.parent)return null;for(var t=e.parent,i=Ci(t.lines,e),a=t.parent;a;a=(t=a).parent){var n=0;for(a.children.length;a.children[n]!=t;++n)i+=a.children[n].chunkSize()}return i}function Jt(e,t){var i=0;e:do{for(var a=0,n=e.children.length;a<n;++a){var l=e.children[a],d=l.height;if(t<d){e=l;continue e}t-=d,i+=l.chunkSize()}return i}while(!e.lines);for(a=0,n=e.lines.length;a<n;++a){var _=e.lines[a].height;if(t<_)break;t-=_}return i+a}function ei(e,t){var i=0;e:do{for(var a=0,n=e.children.length;a<n;++a){var l=e.children[a],d=l.chunkSize();if(t<d){e=l;continue e}t-=d,i+=l.height}return i}while(!e.lines);for(a=0;a<t;++a)i+=e.lines[a].height;return i}function ti(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function t(){ni(this)}function ii(e){return e.stop||(e.stop=t),e}function ai(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function n(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ni(e){ai(e),n(e)}function li(e){return e.target||e.srcElement}function di(e){return e.which?e.which:1&e.button?1:2&e.button?3:4&e.button?2:void 0}function _i(e,t){return e.override&&e.override.hasOwnProperty(t)?e.override[t]:e[t]}function ri(e,t,i,a){if("function"==typeof e.addEventListener){if(e.addEventListener(t,i,!1),a)return function(){e.removeEventListener(t,i,!1)}}else{var n=function(e){i(e||window.event)};if(e.attachEvent("on"+t,n),a)return function(){e.detachEvent("on"+t,n)}}}function oi(){this.id=null}Kt.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},Kt.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},Kt.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},Kt.default=Dt?Kt.macDefault:Kt.pcDefault,Kt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},Nt.fromTextArea=function(t,e){function i(){t.value=l.getValue()}if(e||(e={}),e.value=t.value,!e.tabindex&&t.tabindex&&(e.tabindex=t.tabindex),null==e.autofocus&&null!=t.getAttribute("autofocus")&&(e.autofocus=!0),t.form){var a=ri(t.form,"submit",i,!0);if("function"==typeof t.form.submit){var n=t.form.submit;t.form.submit=function e(){i(),t.form.submit=n,t.form.submit(),t.form.submit=e}}}t.style.display="none";var l=Nt(function(e){t.parentNode.insertBefore(e,t.nextSibling)},e);return l.save=i,l.getTextArea=function(){return t},l.toTextArea=function(){i(),t.parentNode.removeChild(l.getWrapperElement()),t.style.display="",t.form&&(a(),"function"==typeof t.form.submit&&(t.form.submit=n))},l},Nt.copyState=Rt,Nt.startState=Wt,s.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var i=t==e;else i=t&&(e.test?e.test(t):e(t));if(i)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return d(this.string,this.start,this.tabSize)},indentation:function(){return d(this.string,null,this.tabSize)},match:function(e,t,i){if("string"!=typeof e){var a=this.string.slice(this.pos).match(e);return a&&!1!==t&&(this.pos+=a[0].length),a}function n(e){return i?e.toLowerCase():e}if(n(this.string).indexOf(n(e),this.pos)==this.pos)return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},Nt.StringStream=s,Vt.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=Ci(this.marker.set,e);-1<t&&this.marker.set.splice(t,1)},split:function(e,t){return this.to<=e&&null!=this.to?null:new Vt(this.from<e||null==this.from?null:this.from-e+t,null==this.to?null:this.to-e+t,this.style,this.marker)},dup:function(){return new Vt(null,null,this.style,this.marker)},clipTo:function(e,t,i,a,n){e&&a>this.from&&(a<this.to||null==this.to)?this.from=null:null!=this.from&&this.from>=t&&(this.from=Math.max(a,this.from)+n),i&&(t<this.to||null==this.to)&&(t>this.from||null==this.from)?this.to=null:null!=this.to&&this.to>t&&(this.to=a<this.to?this.to+n:t)},isDead:function(){return null!=this.from&&null!=this.to&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},$t.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,i,a,n){(e||t<this.from)&&(i||a>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(a,this.from)+n)},sameSet:function(e){return!1},find:function(){return this.line&&this.line.parent?{line:Xt(this.line),ch:this.from}:null},clear:function(){if(this.line){var e=Ci(this.line.marked,this);-1!=e&&this.line.marked.splice(e,1),this.line=null}}},Gt.inheritMarks=function(e,t){var i=new Gt(e),a=t&&t.marked;if(a)for(var n=0;n<a.length;++n)if(null==a[n].to&&a[n].style){var l=i.marked||(i.marked=[]),d=a[n].dup();l.push(d),d.attach(i)}return i},Gt.prototype={replace:function(e,t,i){var a=[],n=this.marked,l=null==t?this.text.length:t;if(o(0,e,this.styles,a),i&&a.push(i,null),o(l,this.text.length,this.styles,a),this.styles=a,this.text=this.text.slice(0,e)+i+this.text.slice(l),this.stateAfter=null,n)for(var d=i.length-(l-e),_=0;_<n.length;++_){var r=n[_];r.clipTo(null==e,e||0,null==t,l,d),r.isDead()&&(r.detach(this),n.splice(_--,1))}},split:function(e,t){var i=[t,null],a=this.marked;o(e,this.text.length,this.styles,i);var n=new Gt(t+this.text.slice(e),i);if(a)for(var l=0;l<a.length;++l){var d=a[l],_=d.split(e,t.length);_&&(n.marked||(n.marked=[]),n.marked.push(_),_.attach(n),_==d&&a.splice(l--,1))}return n},append:function(e){var t=this.text.length,i=e.marked,a=this.marked;if(this.text+=e.text,o(0,e.text.length,e.styles,this.styles),a)for(var n=0;n<a.length;++n)null==a[n].to&&(a[n].to=t);if(i&&i.length){a||(this.marked=a=[]);e:for(n=0;n<i.length;++n){var l=i[n];if(!l.from)for(var d=0;d<a.length;++d){var _=a[d];if(_.to==t&&_.sameSet(l)){_.to=null==l.to?null:l.to+t,_.isDead()&&(_.detach(this),i.splice(n--,1));continue e}}a.push(l),l.attach(this),l.from+=t,null!=l.to&&(l.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,i=e.marked;if(t)for(var a=0;a<t.length;++a){var n=t[a],l=null==n.to;if(l&&i)for(var d=0;d<i.length;++d)if(i[d].sameSet(n)){l=!1;break}l&&(n.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(e)for(var t=0;t<e.length;++t)null==e[t].from&&(e[t].from=0)},addMark:function(e){e.attach(this),null==this.marked&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,i){var a,n=new s(this.text,i),l=this.styles,d=0,_=!1,r=l[0];for(""==this.text&&e.blankLine&&e.blankLine(t);!n.eol();){var o=e.token(n,t),m=this.text.slice(n.start,n.pos);if(n.start=n.pos,d&&l[d-1]==o?l[d-2]+=m:m&&(!_&&(l[d+1]!=o||d&&l[d-2]!=a)&&(_=!0),l[d++]=m,l[d++]=o,a=r,r=l[d]),5e3<n.pos){l[d++]=this.text.slice(n.pos),l[d++]=null;break}}return l.length!=d&&(l.length=d,_=!0),d&&l[d-2]!=a&&(_=!0),_||l.length<5&&this.text.length<10&&null},getTokenAt:function(e,t,i){for(var a=new s(this.text);a.pos<i&&!a.eol();){a.start=a.pos;var n=e.token(a,t)}return{start:a.start,end:a.pos,string:a.current(),className:n||null,state:t}},indentation:function(e){return d(this.text,null,e)},getHTML:function(d,n,e,l){var _=[],r=!0,o=0;function m(e,t){if(e){if(r&&ui&&" "==e.charAt(0)&&(e=" "+e.slice(1)),r=!1,-1==e.indexOf("\t")){o+=e.length;var i=T(e)}else{i="";for(var a=0;;){var n=e.indexOf("\t",a);if(-1==n){i+=T(e.slice(a)),o+=e.length-a;break}var l=d(o+=n-a);i+=T(e.slice(a,n))+l.html,o+=l.width,a=n+1}}t?_.push('<span class="',t,'">',i,"</span>"):_.push(i)}}var s=m;if(null!=n){var u=0,c='<span id="'+e+'">';s=function(e,t){var i=e.length;if(u<=n&&n<u+i){u<n&&(m(e.slice(0,n-u),t),l&&_.push("<wbr>")),_.push(c);var a=n-u;m(bi?e.slice(a,a+1):e.slice(a),t),_.push("</span>"),bi&&m(e.slice(a+1),t),n--,u+=i}else u+=i,m(e,t),u==n&&u==p?_.push(c+" </span>"):n+10<u&&/\s/.test(e)&&(s=function(){})}}var t=this.styles,i=this.text,a=this.marked,p=i.length;function f(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}if(i||null!=n)if(a&&a.length){var y=0,h=(k=0,""),b=a[0].from||0,v=[],w=0;function g(){for(var e;w<a.length&&((e=a[w]).from==y||null==e.from);)null!=e.style&&v.push(e),++w;b=w<a.length?a[w].from:1/0;for(var t=0;t<v.length;++t){var i=v[t].to||1/0;i==y?v.splice(t--,1):b=Math.min(i,b)}}for(;y<p;){b==y&&g();for(var E=Math.min(p,b);;){if(h){for(var A=y+h.length,j=B,x=0;x<v.length;++x)j=(j?j+" ":"")+v[x].style;if(s(E<A?h.slice(0,E-y):h,j),E<=A){h=h.slice(E-y),y=E;break}y=A}h=t[k++],B=f(t[k++])}}}else for(var k=0,I=0;I<p;k+=2){var C=t[k],B=t[k+1],Q=C.length;p<I+Q&&(C=C.slice(0,p-I)),I+=Q,s(C,f(B))}else s(" ");return _.join("")},cleanUp:function(){if(this.parent=null,this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},Yt.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,i){for(var a=e,n=e+t;a<n;++a){var l=this.lines[a];if(this.height-=l.height,l.cleanUp(),l.handlers)for(var d=0;d<l.handlers.length;++d)i.push(l.handlers[d])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var a=0,n=t.length;a<n;++a)t[a].parent=this},iterN:function(e,t,i){for(var a=e+t;e<a;++e)if(i(this.lines[e]))return!0}},Zt.prototype={chunkSize:function(){return this.size},remove:function(e,t,i){this.size-=t;for(var a=0;a<this.children.length;++a){var n=this.children[a],l=n.chunkSize();if(e<l){var d=Math.min(t,l-e),_=n.height;if(n.remove(e,d,i),this.height-=_-n.height,l==d&&(this.children.splice(a--,1),n.parent=null),0==(t-=d))break;e=0}else e-=l}if(this.size-t<25){var r=[];this.collapse(r),this.children=[new Yt(r)],this.children[0].parent=this}},collapse:function(e){for(var t=0,i=this.children.length;t<i;++t)this.children[t].collapse(e)},insert:function(e,t){for(var i=0,a=0,n=t.length;a<n;++a)i+=t[a].height;this.insertHeight(e,t,i)},insertHeight:function(e,t,i){this.size+=t.length,this.height+=i;for(var a=0,n=this.children.length;a<n;++a){var l=this.children[a],d=l.chunkSize();if(e<=d){if(l.insertHeight(e,t,i),l.lines&&50<l.lines.length){for(;50<l.lines.length;){var _=new Yt(l.lines.splice(l.lines.length-25,25));l.height-=_.height,this.children.splice(a+1,0,_),_.parent=this}this.maybeSpill()}break}e-=d}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Zt(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var i=Ci(e.parent.children,e);e.parent.children.splice(i+1,0,t)}else{var a=new Zt(e.children);(a.parent=e).children=[a,t],e=a}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iter:function(e,t,i){this.iterN(e,t-e,i)},iterN:function(e,t,i){for(var a=0,n=this.children.length;a<n;++a){var l=this.children[a],d=l.chunkSize();if(e<d){var _=Math.min(t,d-e);if(l.iterN(e,_,i))return!0;if(0==(t-=_))break;e=0}else e-=d}}},ti.prototype={addChange:function(e,t,i){this.undone.length=0;var a=+new Date,n=this.done[this.done.length-1],l=n&&n[n.length-1],d=a-this.time;if(this.compound&&n&&!this.closed)n.push({start:e,added:t,old:i});else if(400<d||!l||this.closed||l.start>e+i.length||l.start+l.added<e)this.done.push([{start:e,added:t,old:i}]),this.closed=!1;else{for(var _=Math.max(0,l.start-e),r=Math.max(0,e+i.length-(l.start+l.added)),o=_;0<o;--o)l.old.unshift(i[o-1]);for(o=r;0<o;--o)l.old.push(i[i.length-o]);_&&(l.start=e),l.added+=t-(i.length-_-r)}this.time=a},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},Nt.e_stop=ni,Nt.e_preventDefault=ai,Nt.e_stopPropagation=n,Nt.connect=ri,oi.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var e,mi=Nt.Pass={toString:function(){return"CodeMirror.Pass"}},si=/gecko\/\d{7}/i.test(navigator.userAgent),ui=/MSIE \d/.test(navigator.userAgent),ci=/MSIE [1-7]\b/.test(navigator.userAgent),pi=/MSIE [1-8]\b/.test(navigator.userAgent),fi=ui&&5==document.documentMode,yi=/WebKit\//.test(navigator.userAgent),hi=/Chrome\//.test(navigator.userAgent),bi=/Opera\//.test(navigator.userAgent),l=/Apple Computer/.test(navigator.vendor),vi=/KHTML\//.test(navigator.userAgent),wi=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent),gi=function(){if(pi)return!1;var e=document.createElement("div");return"draggable"in e||"dragDrop"in e}(),Ei=((e=document.createElement("textarea")).value="foo\nbar",e.value.indexOf("\r"),/^$/);function d(e,t,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var a=0,n=0;a<t;++a)"\t"==e.charAt(a)?n+=i-n%i:++n;return n}function Ai(e,t){for(var i,a=e.ownerDocument.body,n=0,l=0,d=!1,_=e;_;_=_.offsetParent){var r=_.offsetLeft,o=_.offsetTop;_==a?(n+=Math.abs(r),l+=Math.abs(o)):(n+=r,l+=o),t&&"fixed"==(i=_,i.currentStyle?i.currentStyle:window.getComputedStyle(i,null)).position&&(d=!0)}var m=t&&!d?null:a;for(_=e.parentNode;_!=m;_=_.parentNode)null!=_.scrollLeft&&(n-=_.scrollLeft,l-=_.scrollTop);return{left:n,top:l}}function ji(e){St?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function xi(e,t){return e.line==t.line&&e.ch==t.ch}function ki(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}si?Ei=/$'/:l?Ei=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:hi&&(Ei=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/),null!=document.documentElement.getBoundingClientRect&&(Ai=function(e,t){try{var i=e.getBoundingClientRect();i={top:i.top,left:i.left}}catch(e){i={top:0,left:0}}if(!t)if(null==window.pageYOffset){var a=document.documentElement||document.body.parentNode;null==a.scrollTop&&(a=document.body),i.top+=a.scrollTop,i.left+=a.scrollLeft}else i.top+=window.pageYOffset,i.left+=window.pageXOffset;return i});var _=document.createElement("pre");function T(e){return _.textContent=e,_.innerHTML}function Ii(e,t){if(!t)return 0;if(!e)return t.length;for(var i=e.length,a=t.length;0<=i&&0<=a&&e.charAt(i)==t.charAt(a);--i,--a);return a+1}function Ci(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,a=e.length;i<a;++i)if(e[i]==t)return i;return-1}function Bi(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}"\na"==T("a")?T=function(e){return _.textContent=e,_.innerHTML.slice(1)}:"\t"!=T("\t")&&(T=function(e){return _.innerHTML="",_.appendChild(document.createTextNode(e)),_.innerHTML}),Nt.htmlEscape=T;var Qi=3!="\n\nb".split(/\n/).length?function(e){for(var t,i=0,a=[];-1<(t=e.indexOf("\n",i));)a.push(e.slice(i,"\r"==e.charAt(t-1)?t-1:t)),i=t+1;return a.push(e.slice(i)),a}:function(e){return e.split(/\r?\n/)};Nt.splitLines=Qi;var Ti=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)};Nt.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),Nt.defineMIME("text/plain","null");var Mi={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return Nt.keyNames=Mi,function(){for(var e=0;e<10;e++)Mi[e+48]=String(e);for(e=65;e<=90;e++)Mi[e]=String.fromCharCode(e);for(e=1;e<=12;e++)Mi[e+111]=Mi[e+63235]="F"+e}(),Nt}(),editor;function fm_apply_advanced_layout(){return inArray("form_layout_tab",JSON.parse(jQuery("#fm_tabs_loaded").val()))&&(jQuery("#autogen_layout").is(":checked")?jQuery("#custom_front").val(custom_front.replace(/\s+/g," ").replace(/> </g,"><")):jQuery("#custom_front").val(editor.getValue().replace(/\s+/g," ").replace(/> </g,"><"))),!0}function insertAtCursor_form(e,t){jQuery("#autogen_layout").is(":checked")?alert("Uncheck the Auto-Generate Layout box."):(myValue='<div wdid="'+e+'" class="wdform_row">%'+e+" - "+t+"%</div>",line=editor.getCursor().line,ch=editor.getCursor().ch,text=editor.getLine(line),text1=text.substr(0,ch),text2=text.substr(ch),text=text1+myValue+text2,editor.setLine(line,text),editor.focus())}function autogen(e){e?(custom_front=editor.getValue(),editor.setValue(form_front),editor.setOption("readOnly",!0)):(editor.setValue(custom_front),editor.setOption("readOnly",!1)),autoFormat()}function autoFormat(){return CodeMirror.commands.selectAll(editor),editor.autoFormatRange(editor.getCursor(!0),editor.getCursor(!1)),editor.scrollTo(0,0),!1}CodeMirror.modeExtensions||(CodeMirror.modeExtensions={}),CodeMirror.defineExtension("getModeExt",function(){var e=CodeMirror.resolveMode(this.getOption("mode")).name,t=CodeMirror.modeExtensions[e];if(!t)throw new Error("No extensions found for mode "+e);return t}),CodeMirror.defineExtension("getModeExtAtPos",function(e){var t=this.getTokenAt(e);return t&&t.state&&t.state.mode?CodeMirror.modeExtensions["html"==t.state.mode?"htmlmixed":t.state.mode]:this.getModeExt()}),CodeMirror.defineExtension("commentRange",function(e,t,i){var a=this.getModeExtAtPos(this.getCursor());if(e){this.getRange(t,i);this.replaceRange(a.commentStart+this.getRange(t,i)+a.commentEnd,t,i),t.line==i.line&&t.ch==i.ch&&this.setCursor(t.line,t.ch+a.commentStart.length)}else{var n=this.getRange(t,i),l=n.indexOf(a.commentStart),d=n.lastIndexOf(a.commentEnd);-1<l&&-1<d&&l<d&&(n=n.substr(0,l)+n.substring(l+a.commentStart.length,d)+n.substr(d+a.commentEnd.length)),this.replaceRange(n,t,i)}}),CodeMirror.defineExtension("autoIndentRange",function(t,i){var a=this;this.operation(function(){for(var e=t.line;e<=i.line;e++)a.indentLine(e,"smart")})}),CodeMirror.defineExtension("autoFormatRange",function(a,n){var l=this.indexFromPos(a),e=this.indexFromPos(n),d=this.getModeExt().autoFormatLineBreaks(this.getValue(),l,e),_=this;this.operation(function(){_.replaceRange(d,a,n);for(var e=_.posFromIndex(l).line,t=_.posFromIndex(l+d.length).line,i=e;i<=t;i++)_.indentLine(i,"smart")})}),CodeMirror.modeExtensions.css={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],autoFormatLineBreaks:function(e,t,i){return(e=e.substring(t,i)).replace(new RegExp("(;|\\{|\\})([^\r\n])","g"),"$1\n$2")}},CodeMirror.modeExtensions.javascript={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],getNonBreakableBlocks:function(e){for(var t=[new RegExp("for\\s*?\\(([\\s\\S]*?)\\)"),new RegExp("'([\\s\\S]*?)('|$)"),new RegExp('"([\\s\\S]*?)("|$)'),new RegExp("//.*([\r\n]|$)")],i=new Array,a=0;a<t.length;a++)for(var n=0;n<e.length;){var l=e.substr(n).match(t[a]);if(null==l)break;i.push({start:n+l.index,end:n+l.index+l[0].length}),n+=l.index+Math.max(1,l[0].length)}return i.sort(function(e,t){return e.start-t.start}),i},autoFormatLineBreaks:function(e,t,i){e=e.substring(t,i);var a=0,n=new RegExp("(;|\\{|\\})([^\r\n])","g"),l=this.getNonBreakableBlocks(e);if(null==l)return e.replace(n,"$1\n$2");for(var d="",_=0;_<l.length;_++)l[_].start>a&&(d+=e.substring(a,l[_].start).replace(n,"$1\n$2"),a=l[_].start),l[_].start<=a&&l[_].end>=a&&(d+=e.substring(a,l[_].end),a=l[_].end);return a<e.length-1&&(d+=e.substr(a).replace(n,"$1\n$2")),d}},CodeMirror.modeExtensions.xml={commentStart:"\x3c!--",commentEnd:"--\x3e",wordWrapChars:[">"],autoFormatLineBreaks:function(e,t,i){for(var a=(e=e.substring(t,i)).split("\n"),n=new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"),l=new RegExp("<","g"),d=new RegExp("(>)([^\r\n])","g"),_=0;_<a.length;_++){var r=a[_].match(n);null!=r&&3<r.length&&(a[_]=r[1]+r[2].replace(l,"\n$&").replace(d,"$1\n$2")+r[3])}return a.join("\n")}},CodeMirror.modeExtensions.htmlmixed={commentStart:"\x3c!--",commentEnd:"--\x3e",wordWrapChars:[">",";","\\{","\\}"],getModeInfos:function(e,t){var i=new Array;i[0]={pos:0,modeExt:CodeMirror.modeExtensions.xml,modeName:"xml"};var a=new Array;a[0]={regex:new RegExp("<style[^>]*>([\\s\\S]*?)(</style[^>]*>|$)","i"),modeExt:CodeMirror.modeExtensions.css,modeName:"css"},a[1]={regex:new RegExp("<script[^>]*>([\\s\\S]*?)(</script[^>]*>|$)","i"),modeExt:CodeMirror.modeExtensions.javascript,modeName:"javascript"};for(var n=void 0!==t?t:e.length-1,l=0;l<a.length;l++)for(var d=0;d<=n;){var _=e.substr(d).match(a[l].regex);if(null==_)break;if(1<_.length&&0<_[1].length){var r=d+_.index+_[0].indexOf(_[1]);i.push({pos:r,modeExt:a[l].modeExt,modeName:a[l].modeName}),i.push({pos:r+_[1].length,modeExt:i[0].modeExt,modeName:i[0].modeName}),d+=_.index+_[0].length}else d+=_.index+Math.max(_[0].length,1)}return i.sort(function(e,t){return e.pos-t.pos}),i},autoFormatLineBreaks:function(e,t,i){var a=this.getModeInfos(e),n=new RegExp("^\\s*?\n"),l=new RegExp("\n\\s*?$"),d="";if(1<a.length)for(var _=1;_<=a.length;_++){var r=a[_-1].pos,o=_<a.length?a[_].pos:i;if(i<=r)break;if(r<t){if(o<=t)continue;r=t}i<o&&(o=i);var m=e.substring(r,o);"xml"!=a[_-1].modeName&&(!n.test(m)&&0<r&&(m="\n"+m),!l.test(m)&&o<e.length-1&&(m+="\n")),d+=a[_-1].modeExt.autoFormatLineBreaks(m)}else d=a[0].modeExt.autoFormatLineBreaks(e.substring(t,i));return d}},CodeMirror.defineMode("clike",function(e,t){var d,l=e.indentUnit,_=t.keywords||{},r=t.blockKeywords||{},o=t.atoms||{},m=t.hooks||{},s=t.multiLineStrings,u=/[+\-*&%=<>!?|\/]/;function c(e,t){var l,i=e.next();if(m[i]){var a=m[i](e,t);if(!1!==a)return a}if('"'==i||"'"==i)return t.tokenize=(l=i,function(e,t){for(var i,a=!1,n=!1;null!=(i=e.next());){if(i==l&&!a){n=!0;break}a=!a&&"\\"==i}return(n||!a&&!s)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(i))return d=i,null;if(/\d/.test(i))return e.eatWhile(/[\w\.]/),"number";if("/"==i){if(e.eat("*"))return(t.tokenize=p)(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(u.test(i))return e.eatWhile(u),"operator";e.eatWhile(/[\w\$_]/);var n=e.current();return _.propertyIsEnumerable(n)?(r.propertyIsEnumerable(n)&&(d="newstatement"),"keyword"):o.propertyIsEnumerable(n)?"atom":"word"}function p(e,t){for(var i,a=!1;i=e.next();){if("/"==i&&a){t.tokenize=null;break}a="*"==i}return"comment"}function a(e,t,i,a,n){this.indented=e,this.column=t,this.type=i,this.align=a,this.prev=n}function n(e,t,i){return e.context=new a(e.indented,t,i,null,e.context)}function f(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}return{startState:function(e){return{tokenize:null,context:new a((e||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=null;var a=(t.tokenize||c)(e,t);if("comment"==a||"meta"==a)return a;if(null==i.align&&(i.align=!0),";"!=d&&":"!=d||"statement"!=i.type)if("{"==d)n(t,e.column(),"}");else if("["==d)n(t,e.column(),"]");else if("("==d)n(t,e.column(),")");else if("}"==d){for(;"statement"==i.type;)i=f(t);for("}"==i.type&&(i=f(t));"statement"==i.type;)i=f(t)}else d==i.type?f(t):("}"==i.type||"top"==i.type||"statement"==i.type&&"newstatement"==d)&&n(t,e.column(),"statement");else f(t);return t.startOfLine=!1,a},indent:function(e,t){if(e.tokenize!=c&&null!=e.tokenize)return 0;var i=e.context,a=t&&t.charAt(0);"statement"==i.type&&"}"==a&&(i=i.prev);var n=a==i.type;return"statement"==i.type?i.indented+("{"==a?0:l):i.align?i.column+(n?0:1):i.indented+(n?0:l)},electricChars:"{}"}}),function(){function e(e){for(var t={},i=e.split(" "),a=0;a<i.length;++a)t[i[a]]=!0;return t}var t="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";function i(e,t){return!!t.startOfLine&&(e.skipToEnd(),"meta")}function a(e,t){for(var i;null!=(i=e.next());)if('"'==i&&!e.eat('"')){t.tokenize=null;break}return"string"}CodeMirror.defineMIME("text/x-csrc",{name:"clike",keywords:e(t),blockKeywords:e("case do else for if switch while struct"),atoms:e("null"),hooks:{"#":i}}),CodeMirror.defineMIME("text/x-c++src",{name:"clike",keywords:e(t+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t"),blockKeywords:e("catch class do else finally for if struct switch try while"),atoms:e("true false null"),hooks:{"#":i}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:e("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:e("catch class do else finally for if switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:e("abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:e("catch class do else finally for foreach if struct switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=a)(e,t):(e.eatWhile(/[\w\$_]/),"meta")}}}),CodeMirror.defineMIME("text/x-scala",{name:"clike",keywords:e("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:e("catch class do else finally for forSome if match switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}})}(),CodeMirror.defineMode("css",function(e){var n,a=e.indentUnit;function l(e,t){return n=t,e}function d(e,t){var n,i=e.next();return"@"==i?(e.eatWhile(/[\w\\\-]/),l("meta",e.current())):"/"==i&&e.eat("*")?(t.tokenize=_)(e,t):"<"==i&&e.eat("!")?(t.tokenize=r)(e,t):"="!=i?"~"!=i&&"|"!=i||!e.eat("=")?'"'==i||"'"==i?(t.tokenize=(n=i,function(e,t){for(var i,a=!1;null!=(i=e.next())&&(i!=n||a);)a=!a&&"\\"==i;return a||(t.tokenize=d),l("string","string")}),t.tokenize(e,t)):"#"==i?(e.eatWhile(/[\w\\\-]/),l("atom","hash")):"!"==i?(e.match(/^\s*\w*/),l("keyword","important")):/\d/.test(i)?(e.eatWhile(/[\w.%]/),l("number","unit")):/[,.+>*\/]/.test(i)?l(null,"select-op"):/[;{}:\[\]]/.test(i)?l(null,i):(e.eatWhile(/[\w\\\-]/),l("variable","variable")):l(null,"compare"):void l(null,"compare")}function _(e,t){for(var i,a=!1;null!=(i=e.next());){if(a&&"/"==i){t.tokenize=d;break}a="*"==i}return l("comment","comment")}function r(e,t){for(var i,a=0;null!=(i=e.next());){if(2<=a&&">"==i){t.tokenize=d;break}a="-"==i?a+1:0}return l("comment","comment")}return{startState:function(e){return{tokenize:d,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var i=t.tokenize(e,t),a=t.stack[t.stack.length-1];return"hash"==n&&"rule"!=a?i="string-2":"variable"==i&&("rule"==a?i="number":a&&"@media{"!=a||(i="tag")),"rule"==a&&/^[\{\};]$/.test(n)&&t.stack.pop(),"{"==n?"@media"==a?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==n?t.stack.pop():"@media"==n?t.stack.push("@media"):"{"==a&&"comment"!=n&&t.stack.push("rule"),i},indent:function(e,t){var i=e.stack.length;return/^\}/.test(t)&&(i-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+i*a},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("javascript",function(e,t){var a,n,d=e.indentUnit,_=t.json,r=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),i=e("keyword b"),a=e("keyword c"),n=e("operator"),l={type:"atom",style:"atom"};return{if:t,while:t,with:t,else:i,do:i,try:i,finally:i,return:a,break:a,continue:a,new:a,delete:a,throw:a,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:n,typeof:n,instanceof:n,true:l,false:l,null:l,undefined:l,NaN:l,Infinity:l}}(),o=/[+\-*&%=<>!?|]/;function m(e,t,i){return(t.tokenize=i)(e,t)}function s(e,t){for(var i,a=!1;null!=(i=e.next());){if(i==t&&!a)return!1;a=!a&&"\\"==i}return a}function u(e,t,i){return a=e,n=i,t}function c(e,t){var i=e.next();if('"'==i||"'"==i)return m(e,t,(a=i,function(e,t){return s(e,a)||(t.tokenize=c),u("string","string")}));if(/[\[\]{}\(\),;\:\.]/.test(i))return u(i);if("0"==i&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),u("number","number");if(/\d/.test(i)||"-"==i&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),u("number","number");if("/"==i)return e.eat("*")?m(e,t,p):e.eat("/")?(e.skipToEnd(),u("comment","comment")):t.reAllowed?(s(e,"/"),e.eatWhile(/[gimy]/),u("regexp","string-2")):(e.eatWhile(o),u("operator",null,e.current()));if("#"==i)return e.skipToEnd(),u("error","error");if(o.test(i))return e.eatWhile(o),u("operator",null,e.current());e.eatWhile(/[\w\$_]/);var a,n=e.current(),l=r.propertyIsEnumerable(n)&&r[n];return l&&t.kwAllowed?u(l.type,l.style,n):u("variable","variable",n)}function p(e,t){for(var i,a=!1;i=e.next();){if("/"==i&&a){t.tokenize=c;break}a="*"==i}return u("comment","comment")}var i={atom:!0,number:!0,variable:!0,string:!0,regexp:!0};function l(e,t,i,a,n,l){this.indented=e,this.column=t,this.type=i,this.prev=n,this.info=l,null!=a&&(this.align=a)}function f(e,t){for(var i=e.localVars;i;i=i.next)if(i.name==t)return!0}var y={state:null,column:null,marked:null,cc:null};function h(){for(var e=arguments.length-1;0<=e;e--)y.cc.push(arguments[e])}function b(){return h.apply(null,arguments),!0}function v(e){var t=y.state;if(t.context){y.marked="def";for(var i=t.localVars;i;i=i.next)if(i.name==e)return;t.localVars={name:e,next:t.localVars}}}var w={name:"this",next:{name:"arguments"}};function g(){y.state.context||(y.state.localVars=w),y.state.context={prev:y.state.context,vars:y.state.localVars}}function E(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function A(t,i){var e=function(){var e=y.state;e.lexical=new l(e.indented,y.stream.column(),t,null,e.lexical,i)};return e.lex=!0,e}function j(){var e=y.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(t){return function(e){return e==t?b():";"==t?h():b(arguments.callee)}}function k(e){return"var"==e?b(A("vardef"),q,x(";"),j):"keyword a"==e?b(A("form"),I,k,j):"keyword b"==e?b(A("form"),k,j):"{"==e?b(A("}"),z,j):";"==e?b():"function"==e?b(O):"for"==e?b(A("form"),x("("),A(")"),N,x(")"),j,k,j):"variable"==e?b(A("stat"),Q):"switch"==e?b(A("form"),I,A("}","switch"),x("{"),z,j,j):"case"==e?b(I,x(":")):"default"==e?b(x(":")):"catch"==e?b(A("form"),g,x("("),K,x(")"),k,j,E):h(A("stat"),I,x(";"),j)}function I(e){return i.hasOwnProperty(e)?b(B):"function"==e?b(O):"keyword c"==e?b(C):"("==e?b(A(")"),C,x(")"),j,B):"operator"==e?b(I):"["==e?b(A("]"),L(I,"]"),j,B):"{"==e?b(A("}"),L(M,"}"),j,B):b()}function C(e){return e.match(/[;\}\)\],]/)?h():h(I)}function B(e,t){return"operator"==e&&/\+\+|--/.test(t)?b(B):"operator"==e||":"==e?b(I):";"!=e?"("==e?b(A(")"),L(I,")"),j,B):"."==e?b(T,B):"["==e?b(A("]"),I,x("]"),j,B):void 0:void 0}function Q(e){return":"==e?b(j,k):h(B,x(";"),j)}function T(e){if("variable"==e)return y.marked="property",b()}function M(e){if("variable"==e&&(y.marked="property"),i.hasOwnProperty(e))return b(x(":"),I)}function L(t,i){function a(e){return","==e?b(t,a):e==i?b():b(x(i))}return function(e){return e==i?b():h(t,a)}}function z(e){return"}"==e?b():h(k,z)}function q(e,t){return"variable"==e?(v(t),b(H)):b()}function H(e,t){return"="==t?b(I,H):","==e?b(q):void 0}function N(e){return"var"==e?b(q,D):";"==e?h(D):"variable"==e?b(S):h(D)}function S(e,t){return"in"==t?b(I):b(B,D)}function D(e,t){return";"==e?b(P):"in"==t?b(I):b(I,x(";"),P)}function P(e){")"!=e&&b(I)}function O(e,t){return"variable"==e?(v(t),b(O)):"("==e?b(A(")"),g,L(K,")"),j,k,E):void 0}function K(e,t){if("variable"==e)return v(t),b()}return j.lex=!0,{startState:function(e){return{tokenize:c,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new l((e||0)-d,0,"block",!1),localVars:t.localVars,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==a?i:(t.reAllowed=!("operator"!=a&&"keyword c"!=a&&!a.match(/^[\[{}\(,;:]$/)),t.kwAllowed="."!=a,function(e,t,i,a,n){var l=e.cc;for(y.state=e,y.stream=n,y.marked=null,y.cc=l,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((l.length?l.pop():_?I:k)(i,a)){for(;l.length&&l[l.length-1].lex;)l.pop()();return y.marked?y.marked:"variable"==i&&f(e,a)?"variable-2":t}}(t,i,a,n,e))},indent:function(e,t){if(e.tokenize!=c)return 0;var i=t&&t.charAt(0),a=e.lexical;"stat"==a.type&&"}"==i&&(a=a.prev);var n=a.type,l=i==n;return"vardef"==n?a.indented+4:"form"==n&&"{"==i?a.indented:"stat"==n||"form"==n?a.indented+d:"switch"!=a.info||l?a.align?a.column+(l?0:1):a.indented+(l?0:d):a.indented+(/^(?:case|default)\b/.test(t)?d:2*d)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("xml",function(e,t){var l,d,_,a,n=e.indentUnit,r=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},o=t.alignCDATA;function m(t,i){function e(e){return(i.tokenize=e)(t,i)}var a,n=t.next();if("<"!=n)return"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error";if(t.eat("!"))return t.eat("[")?t.match("CDATA[")?e(u("atom","]]>")):null:t.match("--")?e(u("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function a(n){return function(e,t){for(var i;null!=(i=e.next());){if("<"==i)return t.tokenize=a(n+1),t.tokenize(e,t);if(">"==i){if(1!=n)return t.tokenize=a(n-1),t.tokenize(e,t);t.tokenize=m;break}}return"meta"}}(1))):null;if(t.eat("?"))return t.eatWhile(/[\w\._\-]/),i.tokenize=u("meta","?>"),"meta";for(d=t.eat("/")?"closeTag":"openTag",t.eatSpace(),l="";a=t.eat(/[^\s\u00a0=<>\"\'\/?]/);)l+=a;return i.tokenize=s,"tag"}function s(e,t){var i,a=e.next();return">"==a||"/"==a&&e.eat(">")?(t.tokenize=m,d=">"==a?"endTag":"selfcloseTag","tag"):"="==a?(d="equals",null):/[\'\"]/.test(a)?(t.tokenize=(i=a,function(e,t){for(;!e.eol();)if(e.next()==i){t.tokenize=s;break}return"string"}),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function u(i,a){return function(e,t){for(;!e.eol();){if(e.match(a)){t.tokenize=m;break}e.next()}return i}}function i(){for(var e=arguments.length-1;0<=e;e--)_.cc.push(arguments[e])}function c(){return i.apply(null,arguments),!0}function p(){_.context&&(_.context=_.context.prev)}function f(e){if("openTag"==e)return _.tagName=l,c(h,(n=_.startOfLine,function(e){return"selfcloseTag"==e||"endTag"==e&&r.autoSelfClosers.hasOwnProperty(_.tagName.toLowerCase())?y(_.tagName.toLowerCase()):"endTag"==e&&(y(_.tagName.toLowerCase()),t=_.tagName,i=n,a=r.doNotIndent.hasOwnProperty(t)||_.context&&_.context.noIndent,_.context={prev:_.context,tagName:t,indent:_.indented,startOfLine:i,noIndent:a}),c();var t,i,a}));if("closeTag"!=e)return c();var t,n,i=!1;return _.context?_.context.tagName!=l&&(r.implicitlyClosed.hasOwnProperty(_.context.tagName.toLowerCase())&&p(),i=!_.context||_.context.tagName!=l):i=!0,i&&(a="error"),c((t=i,function(e){return t&&(a="error"),"endTag"==e?(p(),c()):(a="error",c(arguments.callee))}))}function y(e){for(var t;;){if(!_.context)return;if(t=_.context.tagName.toLowerCase(),!r.contextGrabbers.hasOwnProperty(t)||!r.contextGrabbers[t].hasOwnProperty(e))return;p()}}function h(e){return"word"==e?(a="attribute",c(b,h)):"endTag"==e||"selfcloseTag"==e?i():(a="error",c(h))}function b(e){return"equals"==e?c(v,h):(r.allowMissing||(a="error"),"endTag"==e||"selfcloseTag"==e?i():c())}function v(e){return"string"==e?c(w):"word"==e&&r.allowUnquoted?(a="string",c()):(a="error","endTag"==e||"selfCloseTag"==e?i():c())}function w(e){return"string"==e?c(w):i()}return{startState:function(){return{tokenize:m,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;a=d=l=null;var i=t.tokenize(e,t);if(t.type=d,(i||d)&&"comment"!=i)for(_=t;;){if((t.cc.pop()||f)(d||i))break}return t.startOfLine=!1,a||i},indent:function(e,t,i){var a=e.context;if(e.tokenize!=s&&e.tokenize!=m||a&&a.noIndent)return i?i.match(/^(\s*)/)[0].length:0;if(o&&/<!\[CDATA\[/.test(t))return 0;for(a&&/^<\//.test(t)&&(a=a.prev);a&&!a.startOfLine;)a=a.prev;return a?a.indent+n:0},compareStates:function(e,t){if(e.indented!=t.indented||e.tokenize!=t.tokenize)return!1;for(var i=e.context,a=t.context;;i=i.prev,a=a.prev){if(!i||!a)return i==a;if(i.tagName!=a.tagName)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),function(){function e(e){for(var t={},i=e.split(" "),a=0;a<i.length;++a)t[i[a]]=!0;return t}var i={name:"clike",keywords:e("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent"),blockKeywords:e("catch do else elseif for foreach if switch try while"),atoms:e("true false null TRUE FALSE NULL"),multiLineStrings:!0,hooks:{$:function(e,t){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){return!!e.match(/<</)&&(e.eatWhile(/[\w\.]/),t.tokenize=(i=e.current().slice(3),function(e,t){return e.match(i)?t.tokenize=null:e.skipToEnd(),"string"}),t.tokenize(e,t));var i},"#":function(e,t){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e,t){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(e,t){var _=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),r=CodeMirror.getMode(e,"javascript"),o=CodeMirror.getMode(e,"css"),m=CodeMirror.getMode(e,i);return{startState:function(){var e=_.startState();return{html:e,php:m.startState(),curMode:t.startOpen?m:_,curState:t.startOpen?m.startState():e,curClose:t.startOpen?/^\?>/:null,mode:t.startOpen?"php":"html",pending:null}},copyState:function(e){var t,i=e.html,a=CodeMirror.copyState(_,i),n=e.php,l=CodeMirror.copyState(m,n);return t=e.curState==i?a:e.curState==n?l:CodeMirror.copyState(e.curMode,e.curState),{html:a,php:l,curMode:e.curMode,curState:t,curClose:e.curClose,mode:e.mode,pending:e.pending}},token:function e(t,i){var a="php"==i.mode;if(t.sol()&&'"'!=i.pending&&(i.pending=null),i.curMode!=_)return a&&null!=i.php.tokenize||!t.match(i.curClose,a)?i.curMode.token(t,i.curState):(i.curMode=_,i.curState=i.html,i.curClose=null,i.mode="html",a?"meta":e(t,i));if(t.match(/^<\?\w*/))return i.curMode=m,i.curState=i.php,i.curClose="?>",i.mode="php","meta";if('"'==i.pending){for(;!t.eol()&&'"'!=t.next(););var n="string"}else n=i.pending&&t.pos<i.pending.end?(t.pos=i.pending.end,i.pending.style):_.token(t,i.curState);i.pending=null;var l=t.current(),d=l.search(/<\?/);return-1!=d?("string"==n&&/\"$/.test(l)&&!/\?>/.test(l)?i.pending='"':i.pending={end:t.pos,style:n},t.backUp(l.length-d)):"tag"==n&&">"==t.current()&&i.curState.context&&(/^script$/i.test(i.curState.context.tagName)?(i.curMode=r,i.curState=r.startState(_.indent(i.curState,"")),i.curClose=/^<\/\s*script\s*>/i,i.mode="javascript"):/^style$/i.test(i.curState.context.tagName)&&(i.curMode=o,i.curState=o.startState(_.indent(i.curState,"")),i.curClose=/^<\/\s*style\s*>/i,i.mode="css")),n},indent:function(e,t){return e.curMode!=m&&/^\s*<\//.test(t)||e.curMode==m&&/^\?>/.test(t)?_.indent(e.html,t):e.curMode.indent(e.curState,t)},electricChars:"/{}:"}},"xml","clike","javascript","css"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",i)}(),CodeMirror.defineMode("htmlmixed",function(e,t){var a=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),n=CodeMirror.getMode(e,"javascript"),l=CodeMirror.getMode(e,"css");function i(e,t){var i=a.token(e,t.htmlState);return"tag"==i&&">"==e.current()&&t.htmlState.context&&(/^script$/i.test(t.htmlState.context.tagName)?(t.token=_,t.localState=n.startState(a.indent(t.htmlState,"")),t.mode="javascript"):/^style$/i.test(t.htmlState.context.tagName)&&(t.token=r,t.localState=l.startState(a.indent(t.htmlState,"")),t.mode="css")),i}function d(e,t,i){var a=e.current(),n=a.search(t);return-1<n&&e.backUp(a.length-n),i}function _(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=i,t.localState=null,t.mode="html",i(e,t)):d(e,/<\/\s*script\s*>/,n.token(e,t.localState))}function r(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=i,t.localState=null,t.mode="html",i(e,t)):d(e,/<\/\s*style\s*>/,l.token(e,t.localState))}return{startState:function(){return{token:i,localState:null,mode:"html",htmlState:a.startState()}},copyState:function(e){if(e.localState)var t=CodeMirror.copyState(e.token==r?l:n,e.localState);return{token:e.token,localState:t,mode:e.mode,htmlState:CodeMirror.copyState(a,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==i||/^\s*<\//.test(t)?a.indent(e.htmlState,t):e.token==_?n.indent(e.localState,t):l.indent(e.localState,t)},compareStates:function(e,t){return e.mode==t.mode&&(e.localState?CodeMirror.Pass:a.compareStates(e.htmlState,t.htmlState))},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),jQuery(document).on("fm_tab_layout_loaded",function(){editor=CodeMirror.fromTextArea(document.getElementById("source"),{lineNumbers:!0,lineWrapping:!0,mode:"htmlmixed",value:form_front}),""==custom_front&&(custom_front=form_front),jQuery("#autogen_layout").is(":checked")?(editor.setOption("readOnly",!0),editor.setValue(form_front)):(editor.setOption("readOnly",!1),editor.setValue(custom_front)),jQuery("#autogen_layout").on("click",function(){autogen(jQuery(this).is(":checked"))}),autoFormat()});
1
+ function fm_admin_ready(){jQuery(".wd-header a").on("click",function(){jQuery("input[name='task']").val("add"),jQuery(this).parents("form").submit()}),set_no_items(),jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))}),jQuery(".hndle:not(.readonly), .handlediv").each(function(){jQuery(this).off("click").on("click",function(){fm_toggle_postbox(this)})}),jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function(){jQuery(this).attr("title",form_maker.add_placeholder)}),jQuery(document).on("click",".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view",function(){fm_placeholders_popup(jQuery(this).data("id"))}),fm_disabled_uninstall_btn(),jQuery(".fm-uninstall-form #check_yes").on("click",function(){fm_disabled_uninstall_btn()}),void 0!==jQuery(document).tooltip&&jQuery(document).tooltip({show:null,items:".wd-info",content:function(){if(jQuery(this).is(".wd-info"))return jQuery("#"+jQuery(this).data("id")).html()},open:function(e,t){if(void 0===e.originalEvent)return!1;var i=jQuery(t.tooltip).attr("id");jQuery("div.ui-tooltip").not("#"+i).remove()},close:function(e,t){t.tooltip.hover(function(){jQuery(this).stop(!0).fadeTo(400,1)},function(){jQuery(this).fadeOut("400",function(){jQuery(this).remove()})})},position:{my:"center top+30",at:"center top",using:function(e,t){jQuery(this).css(e),jQuery("<div>").addClass("tooltip-arrow").addClass(t.vertical).addClass(t.horizontal).appendTo(this)}}})}function wd_insert_placeholder(e,t){var i=document.getElementById(e);if("undefined"==typeof tinyMCE||(tinyMCE.get(e)&&tinyMCE.get(e).focus(),"none"!=i.style.display))if(i.focus(),document.selection)sel=document.selection.createRange(),sel.text=t;else if(i.selectionStart||"0"==i.selectionStart){var a=i.selectionStart,n=i.selectionEnd;i.value=i.value.substring(0,a)+"{"+t+"}"+i.value.substring(n,i.value.length)}else i.value+="{"+t+"}";else tinyMCE.execCommand("mceInsertContent",!1,"{"+t+"}")}function fm_toggle_postbox(e){jQuery(e).parent(".postbox").toggleClass("closed")}function fm_option_tabs_mail_validation(){return!0}function fm_clear_input_value(e){jQuery("#"+e).val("")}function set_no_items(){jQuery(".colspanchange").attr("colspan",jQuery(".wd-form table.adminlist>thead>tr>th:visible").length+jQuery(".wd-form table.adminlist>thead>tr>td:visible").length)}function search(e){var t=jQuery(e).parents("form");t.attr("action",t.attr("action")+"&paged=1&s="+jQuery("input[name='s']").val()),t.submit()}function input_search(e,t){return 13==(e.keyCode?e.keyCode:e.which)&&search(t),!0}function input_pagination(e,t){if(13==(e.keyCode?e.keyCode:e.which)){var i=jQuery(t).parents("form"),a=jQuery(t).val();if(a<=jQuery(t).parents(".pagination-links").data("pages-count")&&0<a){var n=new RegExp("&nonce_fm="+nonce_fm,"g"),l=i.attr("action").replace(n,"").replace(/&paged=(\d+)/,"")+"&paged="+a;i.attr("action",l),location.href=l}}return!0}function fm_select_value(e){e.focus(),e.select()}function fm_doNothing(e){13==(e.keyCode?e.keyCode:e.which?e.which:e.charCode)&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}function wd_bulk_action(e){var t=jQuery("select[name='bulk_action']").val();if(-1!=t){if(!jQuery("input[name^='check']").is(":checked"))return void alert(form_maker.select_at_least_one_item);if("delete"==t&&!confirm(form_maker.delete_confirmation))return!1;jQuery("input[name='task']").val(t),jQuery(e).parents("form").submit()}}function fm_ajax_save(e){var t=jQuery("#"+e).action,i=jQuery("#search_value").val(),a=jQuery("#current_id").val(),n=jQuery("#page_number").val(),l=(jQuery("#search_or_not").val(),jQuery("#ids_string").val()),d=jQuery("#image_order_by").val(),_=jQuery("#asc_or_desc").val(),r=jQuery("#ajax_task").val(),o=jQuery("#image_current_id").val();return ids_array=l.split(","),jQuery.ajax({type:"POST",url:t,data:{search_value:i,current_id:a,page_number:n,image_order_by:d,asc_or_desc:_,ids_string:l,task:"ajax_search",ajax_task:r,image_current_id:o,nonce:fm_ajax.ajaxnonce},success:function(e){var t=jQuery(e).find("#images_table").html();jQuery("#images_table").html(t);t=jQuery(e).find("#tablenav-pages").html();jQuery("#tablenav-pages").html(t),jQuery("#show_hide_weights").val("Hide order column"),fm_show_hide_weights(),fm_run_checkbox()}}),!1}function fm_run_checkbox(){jQuery("tbody").children().children(".check-column").find(":checkbox").click(function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!i)return!0;d=jQuery(i).closest("form").find(":checkbox"),f=d.index(i),j=d.index(this),h=jQuery(this).prop("checked"),0<f&&0<j&&f!=j&&d.slice(f,j).prop("checked",function(){return!!jQuery(this).closest("tr").is(":visible")&&h})}i=this;var t=jQuery(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");return jQuery(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0==t.length}),!0}),jQuery("thead, tfoot").find(".check-column :checkbox").click(function(e){var t=jQuery(this).prop("checked"),i="undefined"!=typeof toggleWithKeyboard&&toggleWithKeyboard,a=e.shiftKey||i;jQuery(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!jQuery(this).is(":hidden")&&(a?jQuery(this).prop("checked"):!!t)}),jQuery(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!a&&!!t})})}function fm_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function fm_form_submit(e,t,i,a){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function fm_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" field is required."),jQuery("#"+e).attr("style","border-color: #FF0000; border-style: solid; border-width: 1px;"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0)}function fm_show_hide_weights(){var a;"Show order column"==jQuery("#show_hide_weights").val()?(jQuery(".connectedSortable").css("cursor","default"),jQuery("#tbody_arr").find(".handle").hide(0),jQuery("#th_order").show(0),jQuery("#tbody_arr").find(".fm_order").show(0),jQuery("#show_hide_weights").val("Hide order column"),jQuery("#tbody_arr").sortable()&&jQuery("#tbody_arr").sortable("disable")):(jQuery(".connectedSortable").css("cursor","move"),a=jQuery("#page_number")&&""!=jQuery("#page_number").val()&&1!=jQuery("#page_number").val()?20*(jQuery("#page_number").val()-1)+1:1,jQuery("#tbody_arr").sortable({handle:".connectedSortable",connectWith:".connectedSortable",update:function(e,t){jQuery("#draganddrop").attr("style",""),jQuery("#draganddrop").html("<strong><p>Changes made in this table should be saved.</p></strong>");var i=a;jQuery(".fm_order").each(function(e){jQuery(this).find("input").val()&&jQuery(this).find("input").val(i++)})}}),jQuery("#tbody_arr").sortable("enable"),jQuery("#tbody_arr").find(".handle").show(0),jQuery("#tbody_arr").find(".handle").attr("class","handle connectedSortable"),jQuery("#th_order").hide(0),jQuery("#tbody_arr").find(".fm_order").hide(0),jQuery("#show_hide_weights").val("Show order column"))}function fm_popup(e){if(void 0===e)e="";var a,l,d;(a=function(){var e,t,i=jQuery("#TB_window"),a=jQuery(window).height(),n=jQuery(window).width();e=l&&l<n-90?l:n-40,t=d&&d<a-60?d:a-40,i.length&&(i.width(e).height(t),jQuery("#TB_iframeContent").width(e).height(t-27),i.css({"margin-left":"-"+parseInt(e/2,10)+"px"}),void 0!==document.body.style.maxWidth&&i.css({top:(a-t)/2,"margin-top":"0"}))})(),jQuery(window).resize(function(){a()}),jQuery("a.thickbox-preview"+e).click(function(){tb_click.call(this);var e=jQuery(this).parents(".available-theme").find(".activatelink"),t="",i=jQuery(this).attr("href");return l=(l=i.match(/&width=[0-9]+/))?parseInt(l[0].replace(/[^0-9]+/g,""),10):jQuery(window).width()-120,d=(d=i.match(/&height=[0-9]+/))?parseInt(d[0].replace(/[^0-9]+/g,""),10):jQuery(window).height()-120,t=e.length?'&nbsp; <a href="'+(e.attr("href")||"")+'" target="_top" class="tb-theme-preview-link">'+(e.attr("title")||"")+"</a>":'&nbsp; <span class="tb-theme-preview-link">'+(jQuery(this).attr("title")||"")+"</span>",jQuery("#TB_title").css({"background-color":"#222",color:"#dfdfdf"}),jQuery("#TB_closeAjaxWindow").css({float:"right"}),jQuery("#TB_ajaxWindowTitle").css({float:"left"}).html(t),jQuery("#TB_iframeContent").width("100%"),a(),!1}),jQuery(".theme-detail").click(function(){return jQuery(this).siblings(".themedetaildiv").toggle(),!1})}function bwg_inputs(){jQuery(".fm_int_input").keypress(function(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t)})}function fm_check_isnum(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||58<t)&&46!=t&&45!=t&&(t<65||70<t)&&(t<97||102<t))}function fm_change_payment_method(e){switch(e){case"paypal":jQuery(".fm_payment_option").show(),jQuery(".fm_paypal_option").show(),jQuery(".fm_payment_option_stripe").hide();break;case"stripe":jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").show();break;default:jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").hide()}}function stopRKey(e){var t=(e=e||(event||null)).target?e.target:e.srcElement?e.srcElement:null;if(13==e.keyCode&&("text"==t.type||"search"==t.type))return!1}function fmRemoveHeaderImage(e,t){jQuery("#header_image_url").val(""),jQuery("#header_image").css("background-image",""),jQuery("#header_image").addClass("fm-hide")}function fmOpenMediaUploader(e,t){void 0===t&&(t=!1),e.preventDefault();var i=wp.media({title:"Upload",button:{text:"Add Image"},multiple:!1}).on("select",function(){var e=i.state().get("selection").first().toJSON();jQuery("#header_image_url").val(e.url),jQuery("#header_image").css("background-image",'url("'+e.url+'")'),jQuery("#header_image").css("background-position","center"),jQuery("#header_image").removeClass("fm-hide")}).open();return!1}function fm_toggle_posts(e){jQuery(e).prop("checked")?jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}function fm_toggle_pages(e){jQuery(e).prop("checked")?jQuery(".fm-pages-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-pages-show").removeClass("fm-show").addClass("fm-hide")}function fm_apply_options(e){fm_set_input_value("task",e),document.getElementById("manage_form").submit()}function pp_live_search(e,t,i){var a=e,n=a.val(),l=a.data("post_type");setTimeout(function(){n===a.val()&&jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"manage_fm",task:"fm_live_search",nonce:fm_ajax.ajaxnonce,pp_live_search:n,pp_post_type:l,pp_full_content:i},beforeSend:function(e){a.css("width","95%"),a.parent().find(".fm-loading").css("display","inline-block")},success:function(e){a.css("width","100%"),a.parent().find(".fm-loading").css("display","none"),a.closest(".fm-pp").find(".pp_search_results").replaceWith(e)},error:function(e){console.log(e)}})},t)}function fm_toggle(e){jQuery(e).parent().next().toggleClass("hide")}function change_tab(e){jQuery(".fm-subscriber-header .fm-button").removeClass("active-button"),jQuery(".fm-subscriber-header ."+e).addClass("active-button"),jQuery(".fm-subscriber-content").hide(),jQuery("."+e+"-tab").show()}function change_form_type(e){jQuery("#fieldset_id").val(e),jQuery(".fm-form-types span").removeClass("active"),jQuery(".fm-form-types").find(".fm-"+e).addClass("active"),jQuery("#type_settings_fieldset .wd-group").removeClass("fm-show").addClass("fm-hide")}function change_hide_show(e){jQuery("."+e+".fm-hide").removeClass("fm-hide").addClass("fm-temporary"),jQuery("."+e+".fm-show").removeClass("fm-show").addClass("fm-hide"),jQuery("."+e+".fm-show-table").removeClass("fm-show-table").addClass("fm-hide"),jQuery("."+e+".fm-temporary").removeClass("fm-temporary").addClass("fm-show"),"fm-embedded"!=e&&(fm_toggle_posts(jQuery(".pp_display_on #pt3")),fm_toggle_pages(jQuery(".pp_display_on #pt4")))}function fm_change_radio_checkbox_text(e){var t=[];t.stripemode=["Test","Live"],t.checkout_mode=["Testmode","Production"],t.mail_mode=["Text","HTML"],t.mail_mode_user=["Text","HTML"],t.value=["1","0"],t.popover_show_on=["Page Exit","Page Load"],t.topbar_position=["Bottom","Top"],t.scrollbox_position=["Left","Right"],jQuery(e).val(t.value[jQuery(e).val()]),jQuery(e).next().val(jQuery(e).val());var i=t[jQuery(e).attr("name")];jQuery(e).find("label").html(i[jQuery(e).val()]),jQuery(e).hasClass("fm-text-yes")?(jQuery(e).removeClass("fm-text-yes").addClass("fm-text-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).removeClass("fm-text-no").addClass("fm-text-yes"),jQuery(e).find("span").animate({right:0},400,function(){}))}function fm_show_hide(e){jQuery("."+e).hasClass("fm-hide")?jQuery("."+e).removeClass("fm-hide").addClass("fm-show"):jQuery("."+e).removeClass("fm-show").addClass("fm-hide")}function fm_delete_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var i=jQuery("#blocked_ips").attr("action");jQuery.ajax({type:"POST",url:i,data:{current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"delete_blocked_ip"},success:function(e){var t=parseInt(jQuery(e).find("#total_for_paging").html());isNaN(t)||(i=i.replace(/(paged=)[^\&]+/,"$1"+t)),jQuery("#blocked_ips").parent(".wrap").load(i+" #blocked_ips",function(){window.history.pushState(null,null,i),0!=jQuery(".updated").length?jQuery(" .updated p strong").html("Items Successfully Deleted"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Deleted.</strong></p></div>").insertBefore("#blocked_ips"),set_no_items()})}})}function fm_save_ip(t){var i=jQuery("#ip"+t).val();url=jQuery("#blocked_ips").attr("action"),jQuery.ajax({type:"POST",url:url,data:{ip:i,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip"},success:function(e){jQuery("#td_ip_"+t).html('<a id="ip'+t+'" class="pointer" title="Edit" onclick="fm_edit_ip('+t+')">'+i+"</a>"),jQuery(".insert, .error").hide(),jQuery("#fm_blocked_ips_message").html("<div class='updated'><strong><p>Items Successfully Inserted.</p></strong></div>"),jQuery("#fm_blocked_ips_message").show()}})}function fm_insert_blocked_ip(){jQuery("#tr .loading").css("display","initial");var e=jQuery("#fm_ip").val(),t=window.location.href;jQuery.ajax({type:"POST",url:t,data:{ip:e,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip",last_id:1},success:function(e){jQuery("#blocked_ips").parent(".wrap").load(t+" #blocked_ips",function(){window.history.pushState(null,null,t),0!=jQuery(".updated").length?jQuery(".updated p strong").html("Items Successfully Saved"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Saved.</strong></p></div>").insertBefore("#blocked_ips")})}})}function fm_edit_ip(e){var t='<input id="ip'+e+'" class="input_th'+e+' ip_input" type="text" onkeypress="if(event.keyCode == 13){ if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); } return fm_check_isnum(event); " value="'+jQuery("#ip"+e).html()+'" name="ip'+e+'"/>';t+='<input type="button" class="button ip_save" style="margin-left: 5px" onclick="if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); return false;" value="Save"><div class="loading">',t+="<img src="+plugin_url+"/images/loading.gif></div>",jQuery("#td_ip_"+e).html(t)}function fm_enter_ip(e){if(13==e.which){if(fm_check_required("fm_ip","IP"))return!1;e.preventDefault(),fm_insert_blocked_ip()}}function fm_update_blocked_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var t=jQuery("#ip"+e).val(),i=window.location.href;jQuery.ajax({type:"POST",url:i,data:{ip:t,current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"update_blocked_ip"},success:function(e){jQuery("#fm-form-admin").load(i+" #blocked_ips",function(){0!=jQuery(".updated").length?(window.history.pushState(null,null,i),jQuery(".updated p strong").html("Items Successfully Updated")):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Updated.</strong></p></div>").insertBefore("#blocked_ips")})}})}function onEnableChange(e,t,i){var a=jQuery("#"+e+" #"+t);"1"==i?a.removeClass("hidden"):a.addClass("hidden")}function show_stats(){var e=jQuery(".fm-statistics .fm_error_sorted_label_key");""!=jQuery("#sorted_label_key").val()?(e.hide(),jQuery(".fm-div_stats-loading").addClass("is-active"),jQuery.ajax({dataType:"json",type:"POST",url:show_stats_url,data:{sorted_label_key:jQuery("#sorted_label_key").val(),startdate:jQuery("#startstats").val(),enddate:jQuery("#endstats").val(),nonce:fm_ajax.ajaxnonce},beforeSend:function(e){},error:function(e){},success:function(e){jQuery(".fm-div_stats-loading").removeClass("is-active"),e.html&&jQuery("#div_stats").html(e.html)}})):e.show()}function fm_loading_show(){jQuery("#fm_loading").show()}function fm_loading_hide(){jQuery("#fm_loading").hide(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items()}function getFormLocalStorage(){var e={};formId=getAllUrlParams().current_id;var t=localStorage.getItem("fm_form"+formId);return null!=t&&(e=jQuery.parseJSON(t)),e}function getAllUrlParams(e){var t=e?e.split("?")[1]:window.location.search.slice(1),i={};if(t)for(var a=(t=t.split("#")[0]).split("&"),n=0;n<a.length;n++){var l=a[n].split("="),d=void 0,_=l[0].replace(/\[\d*\]/,function(e){return d=e.slice(1,-1),""}),r=void 0===l[1]||l[1];_=_.toLowerCase(),r=r.toLowerCase(),i[_]?("string"==typeof i[_]&&(i[_]=[i[_]]),void 0===d?i[_].push(r):i[_][d]=r):i[_]=r}return i}function fm_disabled_uninstall_btn(){jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!0),jQuery(".fm-uninstall-form #check_yes").is(":checked")&&jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!1)}function fm_html_entities(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function fm_row_handle(e){var t=jQuery(e);t.find(".wdform_row_handle").remove();var i=jQuery('<div class="wdform_row_handle"><span class="fm-ico-draggable"></span><span title="Remove the column" class="page_toolbar fm-ico-delete" onclick="fm_remove_row_popup(this);"></span>'+"<span class=\"add-new-field\" onclick=\"jQuery('#cur_column').removeAttr('id');jQuery(this).parent().parent().attr('id', 'cur_column').val(1);popup_ready(); Enable(); return false;\">"+form_maker_manage.add_new_field+'</span><div class="fm-divider"></div></div>');t.prepend(i),i.after('<div class="fm-section-overlay"></div>')}function sortable_columns(){jQuery("#take").sortable({cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".form_id_tempform_view_img .fm-ico-draggable",items:"> .wdform-page-and-images",axis:"y",update:function(e,t){refresh_page_numbers()}}),jQuery(".wdform_page").sortable({connectWith:".wdform_page",cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".wdform_row_handle",cancel:".add-new-field, .page_toolbar",items:"> .wdform_section",create:function(e,t){jQuery(e.target).find(".wdform_section").each(function(){fm_row_handle(this)})},start:function(e,t){jQuery(".wdform_row_empty").hide()},stop:function(e,t){fm_rows_refresh(),jQuery(".wdform_row_empty").show()}}),jQuery(".wdform_column").sortable({connectWith:".wdform_column",cursor:"move",placeholder:"highlight",tolerance:"pointer",cancel:".wdform_section_handle",items:"> .wdform_row, #add_field",start:function(e,t){jQuery(".add-new-button").off("click"),jQuery(".wdform_column").removeClass("fm-hidden"),jQuery("#cur_column").removeAttr("id")},stop:function(e,t){return"add_field_cont"!=t.item.parent().attr("id")&&("add_field"==t.item.attr("id")&&"add_field_cont"!=t.item.parent().attr("id")?(fm_check_something_really_important()||(nextID=jQuery("#add_field").next(".wdform_row").attr("wdid"),jQuery("#add_field").parent().attr("id","cur_column"),popup_ready(),Enable(),jQuery(".add-new-button").removeAttr("onclick")),!1):(jQuery(".wdform_column:not(#add_field_cont):empty").addClass("fm-hidden"),void fm_columns_refresh()))}})}function all_sortable_events(){fm_rows_refresh(),fm_columns_refresh(),jQuery(".wdform_row, .wdform_tr_section_break").off("mouseover touchstart").on("mouseover touchstart",function(e){if(!jQuery(this).find(".wdform_arrows").is(":visible"))return jQuery(".wdform_arrows").hide(),jQuery(this).find(".wdform_arrows").show(),e.preventDefault(),!1}).off("mouseleave").on("mouseleave",function(){jQuery(this).find(".wdform_arrows").hide()}),jQuery(".wdform_section_handle, .wdform_row_handle").off("mouseover touchstart").on("mouseover touchstart",function(e){jQuery(this).parent().addClass("fm-hover")}).off("mouseleave").on("mouseleave",function(){jQuery(this).parent().removeClass("fm-hover")})}function fm_change_radio(e){jQuery(e).hasClass("fm-yes")?(jQuery(e).val("0"),jQuery(e).next().val("0"),jQuery(e).removeClass("fm-yes").addClass("fm-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).val("1"),jQuery(e).next().val("1"),jQuery(e).find("span").animate({right:0},400,function(){jQuery(e).removeClass("fm-no").addClass("fm-yes")})),"mail_verify"==jQuery(e).next().attr("name")&&show_verify_options(1==jQuery(e).val())}function enable_drag(){jQuery(".wdform_column").sortable("enable"),jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_field").css("cursor",""),jQuery("#add_field .wdform_field").css("cursor",""),all_sortable_events()}function refresh_(){document.getElementById("counter").value=gen,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.find("[id^=page_next_]").removeAttr("src"),e.find("[id^=page_previous_]").removeAttr("src"),e.find(".form_id_tempform_view_img").remove()}),jQuery("#take div").removeClass("ui-sortable ui-sortable-disabled ui-sortable-handle"),jQuery("#add_field_cont").remove(),document.getElementById("form_front").value=fm_base64EncodeUnicode(fm_htmlentities(document.getElementById("take").innerHTML))}function fm_base64EncodeUnicode(e){return utf8Bytes=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}),btoa(utf8Bytes)}function fm_htmlentities(e){var t=document.createElement("div"),i=document.createTextNode(e);return t.style.cssText="display:none",t.appendChild(i),t.innerHTML}function fm_add_submission_email(e,t,i,a){var n=jQuery("#"+t).val();if(n){var l=jQuery("<p>").attr("class","fm_mail_input").prependTo("#"+i);jQuery("<span>").attr("class","mail_name").text(n).appendTo(l),jQuery("<span>").attr("class","dashicons dashicons-trash").attr("onclick","fm_delete_mail(this, '"+n+"')").attr("title","Delete Email").appendTo(l),jQuery("#"+t).val(""),jQuery("#"+e).val(jQuery("#"+e).val()+n+",")}}function fm_delete_mail(e,t){jQuery(e).parent().remove(),jQuery("#mail").val(jQuery("#mail").val().replace(t+",",""))}function form_maker_options_tabs(e){return jQuery("#fieldset_id").val(e),jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive"),jQuery("#"+e+"_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+e).addClass("active"),!1}function set_type(e){switch(e){case"post":document.getElementById("post").removeAttribute("style"),document.getElementById("page").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").setAttribute("style","display:none");break;case"page":document.getElementById("page").removeAttribute("style"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").setAttribute("style","display:none");break;case"custom_text":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").removeAttribute("style"),document.getElementById("url_wrap").setAttribute("style","display:none");break;case"url_wrap":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").removeAttribute("style");break;case"none":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url_wrap").setAttribute("style","display:none")}}function check_isnum(e){var t=e.which||e.keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t&&(t<35||40<t))}function fm_check_email(e){if(document.getElementById(e)&&""!=jQuery("#"+e).val()){for(var t=jQuery("#"+e).val().split(","),i=/^[\u0400-\u04FFa-zA-Z0-9.+_-]+@[\u0400-\u04FFa-zA-Z0-9.-]+\.[\u0400-\u04FFa-zA-Z]{2,61}$/,a=0;a<t.length;a++){var n=t[a].replace(/^\s+|\s+$/g,"");if(n&&!i.test(n)&&-1===n.indexOf("{")){if(alert("This is not a valid email address."),jQuery("#submenu li a").hasClass("active")){var l=jQuery("#submenu .active").attr("id");if(void 0!==(_=jQuery("#"+e).closest(".fm_fieldset_deactive").attr("id")))if(l!=(r=_.split("_fieldset")[0])){var d=l+"_fieldset";jQuery("#"+d).removeClass("fm_fieldset_active"),jQuery("#"+d).removeClass("fm_fieldset_deactive"),jQuery("#"+_).addClass("fm_fieldset_active"),jQuery("#submenu .active").removeClass("active"),jQuery("#"+r).addClass("active")}}else{var _;if(void 0!==(_=jQuery("#"+e).closest(".fm_fieldset_deactive").attr("id"))){var r=_.split("_fieldset");r=r[0],jQuery("#"+_).removeClass("fm_fieldset_deactive"),jQuery("#"+_).addClass("fm_fieldset_active"),jQuery("#"+r).addClass("active")}}return jQuery("#"+e).css("border","1px solid #FF0000"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0}}jQuery("#"+e).css("border","1px solid #ddd")}return!1}function wdhide(e){document.getElementById(e).style.display="none"}function wdshow(e){document.getElementById(e).style.display="block"}function delete_field_condition(e){var t=e.split("_");document.getElementById("condition"+t[0]).removeChild(document.getElementById("condition_div"+e))}function change_choices(e,t,i,a){switch(e=e.split("_"),global_index=e[0],id=e[1],index=e[2],ids_array=t.split("@@**@@"),types_array=i.split("@@**@@"),params_array=a.split("@@**@@"),types_array[id]){case"type_text":case"type_password":case"type_textarea":case"type_name":case"type_submitter_mail":case"type_number":case"type_phone":case"type_paypal_price":case"type_paypal_price_new":case"type_spinner":case"type_date_new":case"type_phone_new":if("type_number"==types_array[id]||"type_phone"==types_array[id])var n="return check_isnum_space(event)";else if("type_paypal_price"==types_array[id]||"type_paypal_price_new"==types_array[id])n="return check_isnum_point(event)";else n="";if("SELECT"==document.getElementById("field_value"+global_index+"_"+index).tagName){document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index));var l=document.createElement("input");l.setAttribute("id","field_value"+global_index+"_"+index),l.setAttribute("type","text"),l.setAttribute("value",""),l.setAttribute("class","fm_condition_field_input_value"),l.setAttribute("onKeyPress",n),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(l,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index))}else document.getElementById("field_value"+global_index+"_"+index).value="",document.getElementById("field_value"+global_index+"_"+index).setAttribute("onKeyPress",n);break;case"type_own_select":case"type_radio":case"type_checkbox":for("type_own_select"==types_array[id]?w_size=params_array[id].split("*:*w_size*:*"):w_size=params_array[id].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),-1!==w_size[1].indexOf("*:*w_value_disabled*:*")?(w_value_disabled=w_size[1].split("*:*w_value_disabled*:*"),w_choices_value=w_value_disabled[1].split("*:*w_choices_value*:*"),w_choices_value_array=w_choices_value[0].split("***")):w_choices_value_array=w_choices_array,(_=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+index),_.setAttribute("class","fm_condition_field_select_value"),"type_checkbox"==types_array[id]&&(_.setAttribute("multiple","multiple"),_.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){(d=document.createElement("option")).setAttribute("id","choise_"+global_index+"_"+k),d.setAttribute("value",w_choices_value_array[k]),d.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&_.appendChild(d)}document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(_,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index));break;case"type_paypal_select":case"type_paypal_radio":case"type_paypal_checkbox":case"type_paypal_shipping":for("type_paypal_select"==types_array[id]?w_size=params_array[id].split("*:*w_size*:*"):w_size=params_array[id].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),w_choices_price=w_choices[1].split("*:*w_choices_price*:*"),w_choices_price_array=w_choices_price[0].split("***"),(_=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+index),_.setAttribute("class","fm_condition_field_select_value"),"type_paypal_checkbox"==types_array[id]&&(_.setAttribute("multiple","multiple"),_.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){var d;(d=document.createElement("option")).setAttribute("id","choise_"+global_index+"_"+k),d.setAttribute("value",w_choices_array[k]+"*:*value*:*"+w_choices_price_array[k]),d.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&_.appendChild(d)}document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(_,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index));break;case"type_address":var _;countries=form_maker.countries,(_=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+m),_.setAttribute("class","fm_condition_field_select_value"),jQuery.each(countries,function(e,t){var i=document.createElement("option");_.setAttribute("id","field_value"+global_index+"_"+index),i.setAttribute("value",t),i.innerHTML=t,_.appendChild(i)}),document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(_,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index))}}function add_condition_fields(a,e,t,n,l){for(ids=e.split("@@**@@"),labels=t.split("@@**@@"),types=n.split("@@**@@"),params=l.split("@@**@@"),i=500;0<=i&&!document.getElementById("condition_div"+a+"_"+i);i--);m=i+1;var d=document.createElement("div");d.setAttribute("id","condition_div"+a+"_"+m);var _=document.createElement("select");for(_.setAttribute("id","field_labels"+a+"_"+m),_.setAttribute("onchange","change_choices(options[selectedIndex].id+'_"+m+"','"+e+"','"+n+"','"+l.replace(/\'/g,"\\'")+"')"),_.setAttribute("class","fm_condition_field_labels"),k=0;k<labels.length;k++)if(ids[k]!=document.getElementById("fields"+a).value){var r=document.createElement("option");r.setAttribute("id",a+"_"+k),r.setAttribute("value",ids[k]),r.innerHTML=labels[k],_.appendChild(r)}d.appendChild(_),d.appendChild(document.createTextNode(" "));var o=document.createElement("select");o.setAttribute("id","is_select"+a+"_"+m),o.setAttribute("class","fm_condition_is_select");var s=document.createElement("option");s.setAttribute("id","is"),s.setAttribute("value","=="),s.innerHTML="is";var u=document.createElement("option");u.setAttribute("id","is_not"),u.setAttribute("value","!="),u.innerHTML="is not";var c=document.createElement("option");c.setAttribute("id","like"),c.setAttribute("value","%"),c.innerHTML="like";var p=document.createElement("option");p.setAttribute("id","not_like"),p.setAttribute("value","!%"),p.innerHTML="not like";var f=document.createElement("option");f.setAttribute("id","empty"),f.setAttribute("value","="),f.innerHTML="empty";var y=document.createElement("option");if(y.setAttribute("id","not_empty"),y.setAttribute("value","!"),y.innerHTML="not empty",o.appendChild(s),o.appendChild(u),o.appendChild(c),o.appendChild(p),o.appendChild(f),o.appendChild(y),d.appendChild(o),d.appendChild(document.createTextNode(" ")),ids[0]!=document.getElementById("fields"+a).value)var h=0;else h=1;switch(types[h]){case"type_text":case"type_star_rating":case"type_password":case"type_textarea":case"type_name":case"type_submitter_mail":case"type_phone":case"type_number":case"type_paypal_price":case"type_paypal_price_new":case"type_spinner":case"type_date_new":case"type_phone_new":if("type_number"==types[h]||"type_phone"==types[h])var b="return check_isnum_space(event)";else if("type_paypal_price"==types[h]||"type_paypal_price_new"==types[h])b="return check_isnum_point(event)";else b="";var v=document.createElement("input");v.setAttribute("id","field_value"+a+"_"+m),v.setAttribute("type","text"),v.setAttribute("value",""),v.setAttribute("class","fm_condition_field_input_value"),v.setAttribute("onKeyPress",b),d.appendChild(v);break;case"type_checkbox":case"type_radio":case"type_own_select":for("type_own_select"==types[h]?w_size=params[h].split("*:*w_size*:*"):w_size=params[h].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),-1!==w_size[1].indexOf("*:*w_value_disabled*:*")?(w_value_disabled=w_size[1].split("*:*w_value_disabled*:*"),w_choices_value=w_value_disabled[1].split("*:*w_choices_value*:*"),w_choices_value_array=w_choices_value[0].split("***")):w_choices_value_array=w_choices_array,(g=document.createElement("select")).setAttribute("id","field_value"+a+"_"+m),g.style.cssText="vertical-align: top; width:200px;","type_checkbox"==types[h]&&(g.setAttribute("multiple","multiple"),g.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){(w=document.createElement("option")).setAttribute("id","choise_"+a+"_"+k),w.setAttribute("value",w_choices_value_array[k]),w.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&g.appendChild(w)}d.appendChild(g);break;case"type_paypal_select":case"type_paypal_checkbox":case"type_paypal_radio":case"type_paypal_shipping":for("type_paypal_select"==types[h]?w_size=params[h].split("*:*w_size*:*"):w_size=params[h].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),w_choices_price=w_choices[1].split("*:*w_choices_price*:*"),w_choices_price_array=w_choices_price[0].split("***"),(g=document.createElement("select")).setAttribute("id","field_value"+a+"_"+m),g.style.cssText="vertical-align: top; width:200px;","type_paypal_checkbox"==types[h]&&(g.setAttribute("multiple","multiple"),g.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){var w;(w=document.createElement("option")).setAttribute("id","choise_"+a+"_"+k),w.setAttribute("value",w_choices_array[k]+"*:*value*:*"+w_choices_price_array[k]),w.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&g.appendChild(w)}d.appendChild(g);break;case"type_address":var g;countries=form_maker.countries,(g=document.createElement("select")).setAttribute("id","field_value"+a+"_"+m),g.setAttribute("class","fm_condition_field_select_value"),jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("id","choise_"+a+"_"+k),i.setAttribute("value",t),i.innerHTML=t,g.appendChild(i)}),d.appendChild(g)}d.appendChild(document.createTextNode(" "));var E=document.createElement("span");E.setAttribute("class","dashicons dashicons-trash"),E.setAttribute("id","delete_condition"+a+"_"+m),E.setAttribute("onClick",'delete_field_condition("'+a+"_"+m+'")'),E.style.cssText="vertical-align: middle",d.appendChild(E),document.getElementById("condition"+a).appendChild(d)}function add_condition(e,t,a,n,l,d){for(i=500;0<=i&&!document.getElementById("condition"+i);i--);num=i+1,ids=l.split("@@**@@"),labels=d.split("@@**@@");var _=document.createElement("div");_.setAttribute("id","condition"+num),_.setAttribute("class","fm_condition");var r=document.createElement("div");r.setAttribute("id","conditional_fileds"+num);var o=document.createElement("select");o.setAttribute("id","show_hide"+num),o.setAttribute("name","show_hide"+num),o.setAttribute("class","fm_condition_show_hide");var m=document.createElement("option");m.setAttribute("value","1"),m.innerHTML="show";var s=document.createElement("option");s.setAttribute("value","0"),s.innerHTML="hide",o.appendChild(m),o.appendChild(s);var u=document.createElement("select");for(u.setAttribute("id","fields"+num),u.setAttribute("name","fields"+num),u.setAttribute("class","fm_condition_fields"),k=0;k<labels.length;k++){var c=document.createElement("option");c.setAttribute("value",ids[k]),c.innerHTML=labels[k],u.appendChild(c)}var p=document.createElement("span");p.innerHTML="if";var f=document.createElement("select");f.setAttribute("id","all_any"+num),f.setAttribute("name","all_any"+num),f.setAttribute("class","fm_condition_all_any");var y=document.createElement("option");y.setAttribute("value","and"),y.innerHTML="all";var h=document.createElement("option");h.setAttribute("value","or"),h.innerHTML="any",f.appendChild(y),f.appendChild(h);var b=document.createElement("span");b.style.maxWidth="235px",b.style.width="100%",b.style.display="inline-block",b.innerHTML="of the following match:";var v=document.createElement("span");v.setAttribute("class","dashicons dashicons-plus-alt"),v.setAttribute("onClick",'add_condition_fields("'+num+'", "'+e+'", "'+t.replace(/\'/g,"\\'").replace(/\"/g,"&quot;")+'", "'+a.replace(/\'/g,"\\'").replace(/\"/g,"&quot;")+'", "'+n.replace(/\'/g,"\\'").replace(/\"/g,"&quot;")+'")');var w=document.createElement("span");w.setAttribute("class","dashicons dashicons-trash"),w.setAttribute("onClick",'delete_condition("'+num+'")'),r.appendChild(o),r.appendChild(document.createTextNode(" ")),r.appendChild(u),r.appendChild(document.createTextNode(" ")),r.appendChild(p),r.appendChild(document.createTextNode(" ")),r.appendChild(f),r.appendChild(document.createTextNode(" ")),r.appendChild(b),r.appendChild(document.createTextNode(" ")),r.appendChild(w),r.appendChild(document.createTextNode(" ")),r.appendChild(v),_.appendChild(r),document.getElementById("conditions_fieldset_wrap").appendChild(_)}function delete_condition(e){document.getElementById("conditions_fieldset_wrap").removeChild(document.getElementById("condition"+e))}function acces_level(e){var t="";for(i=0;i<=parseInt(e);i++)document.getElementById("user_"+i).checked&&(t=t+document.getElementById("user_"+i).value+",");document.getElementById("user_id_wd").value=t}function check_isnum_space(e){var t=e.which||e.keyCode;return 32==t||!(31<t&&(t<48||57<t))}function check_isnum_point(e){var t=e.which||e.keyCode;return 46==t||!(31<t&&(t<48||57<t))}function check_stripe_required_fields(){if(jQuery("#paypal_mode2").prop("checked"))for("1"==jQuery("#stripemode").val()?(fields=["live_sec","live_pub"],fields_titles=["Live secret key","Live publishable key"]):(fields=["test_sec","test_pub"],fields_titles=["Test secret key","Test publishable key"]),i=0;i<fields.length;i++)if(!jQuery("#"+fields[i]).val())return jQuery("#"+fields[i]).focus(),alert(fields_titles[i]+" is required."),!0;return!1}function check_calculator_required_fields(){var i=0;return jQuery(jQuery("#wd_calculated_field_table").find('[id^="wdc_equation_"]')).each(function(){if(""==jQuery(this).val()){var e=jQuery(this).attr("id").replace("wdc_equation_",""),t=jQuery(jQuery("#wd_calculated_field_table").find("[data-field='"+e+"']")).html();i=1,jQuery(this).focus(),alert("Set equation for the field "+t)}if(1==i)return!1}),1==i}function set_theme(){theme_id="0"==jQuery("#theme").val()?default_theme:jQuery("#theme").val(),jQuery("#edit_css").attr("onclick","window.open('"+theme_edit_url+"&current_id="+theme_id+"'); return false;"),1==jQuery("#theme option:selected").attr("data-version")?jQuery("#old_theme_notice").show():jQuery("#old_theme_notice").hide()}jQuery(function(){fm_admin_ready()}),jQuery(document).on("fm_tab_loaded, fm_tab_email_loaded",function(){fm_admin_ready()}),jQuery(window).on("load",function(){jQuery("#fm_loading").hide(),jQuery("#fm_admin_container").show(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items(),jQuery("#fm_ask_question").parent().attr("target","_blank")}),document.onkeypress=stopRKey,jQuery(function(){jQuery(".pp_display_on #pt0").click(function(){var e=jQuery(this).prop("checked");jQuery('.pp_display_on input[type="checkbox"]').prop("checked",e),e?jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}),jQuery('.pp_display_on input[type="checkbox"]:not("#pt0")').click(function(){var e=jQuery(this).prop("checked");jQuery(".pp_display_on #pt0").prop("checked")&&!e&&jQuery(".pp_display_on #pt0").prop("checked",!1)}),jQuery(".pp_display_on #pt4").click(function(){fm_toggle_pages(this)}),jQuery(".pp_display_on #pt3").click(function(){fm_toggle_posts(this)}),jQuery("body").on("focusin",".pp_search_posts",function(){var e=jQuery(this);e.closest("ul").find(".pp_live_search").removeClass("fm-hide"),e.hasClass("already_triggered")||(e.addClass("already_triggered"),pp_live_search(e,500,!0))}),jQuery(document).click(function(){jQuery(".pp_live_search").addClass("fm-hide")}),jQuery("body").on("click",".fm-pp",function(){return!1}),jQuery("body").on("input",".pp_search_posts",function(){pp_live_search(jQuery(this),500,!0)}),jQuery("body").on("click",".pp_search_results li",function(){var e=jQuery(this);if(!e.hasClass("pp_no_res")){var t=e.text(),i=e.data("post_id"),a=e.closest(".fm-pp"),n=a.find(".pp_selected"),l=a.find(".pp_exclude"),d='<span data-post_id="'+i+'">'+t+'<span class="pp_selected_remove">x</span></span>';-1===n.html().indexOf('data-post_id="'+i+'"')&&(n.append(d),""===l.val()?l.val(i):l.val(function(e,t){return t+","+i}))}return!1}),jQuery("body").on("click",".pp_selected span.pp_selected_remove",function(){var e=jQuery(this).parent(),t=e.closest(".fm-pp").find(".pp_exclude"),i=t.val(),a=e.data("post_id");if(-1!==i.indexOf(a)){var n,l=-1!==i.indexOf(","+a)?","+a:a+",";l=-1!==i.indexOf(",")?l:a;n=i.replace(l,""),t.val(n)}return e.remove(),!1}),jQuery("body").on("click",'.pp_display_on_categories input[name="display_on_categories[]"]',function(){var e=jQuery('.pp_display_on_categories input[name="display_on_categories[]"]'),t=jQuery(".fm-display-all-categories");if("select_all_categories"==jQuery(this).val())jQuery(this).is(":checked")?e.prop("checked",!0):e.prop("checked",!1);else{var i=jQuery('input[name="display_on_categories[]"]:checked').length,a=parseInt(t.attr("data-categories-count"));jQuery(this).prop("checked")||(i-=1),t.prop("checked",!1),i==a&&t.prop("checked",!0)}})}),function(_){_.fn.serializeObject=function(){var n=this,l={},t={},d={validate:/^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/};return this.build=function(e,t,i){return e[t]=i,e},this.push_counter=function(e){return void 0===t[e]&&(t[e]=0),t[e]++},_.each(_(this).serializeArray(),function(){if(d.validate.test(this.name)){for(var e,t=this.name.match(d.key),i=this.value,a=this.name;void 0!==(e=t.pop());)a=a.replace(new RegExp("\\["+e+"\\]$"),""),e.match(d.push)?i=n.build([],n.push_counter(a),i):e.match(d.fixed)?i=n.build([],e,i):e.match(d.named)&&(i=n.build({},e,i));l=_.extend(!0,l,i)}}),l}}(jQuery),jQuery(document).on("dblclick",".wdform_row, .wdform_tr_section_break",function(){edit(jQuery(this).attr("wdid"))}),function(t){function i(e,t){if(!(1<e.originalEvent.touches.length)){e.preventDefault();var i=e.originalEvent.changedTouches[0],a=document.createEvent("MouseEvents");a.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(a)}}if(t.support.touch="ontouchend"in document,t.support.touch){var a,e=t.ui.mouse.prototype,n=e._mouseInit,l=e._mouseDestroy;e._touchStart=function(e){!a&&this._mouseCapture(e.originalEvent.changedTouches[0])&&(a=!0,this._touchMoved=!1,i(e,"mouseover"),i(e,"mousemove"),i(e,"mousedown"))},e._touchMove=function(e){a&&(this._touchMoved=!0,i(e,"mousemove"))},e._touchEnd=function(e){a&&(i(e,"mouseup"),i(e,"mouseout"),this._touchMoved||i(e,"click"),a=!1)},e._mouseInit=function(){var e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)},e._mouseDestroy=function(){var e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),l.call(e)}}}(jQuery);var gmapdata=new Array,gmapmarker=new Array,c;function if_gmap_init(e){map=document.getElementById(e+"_elementform_id_temp");var t=parseInt(map.getAttribute("zoom")),i=map.getAttribute("center_x"),a=map.getAttribute("center_y"),n=new google.maps.LatLng(a,i);return gmapdata[e]=new google.maps.Map(document.getElementById(e+"_elementform_id_temp"),{center:n,zoom:t,mapTypeId:"roadmap"}),google.maps.event.addListener(gmapdata[e],"zoom_changed",function(){document.getElementById(e+"_elementform_id_temp").setAttribute("zoom",gmapdata[e].getZoom())}),gmapmarker[e]=new Array,!1}function update_position(e,i){var t=document.getElementById("longval"+i).value,a=document.getElementById("latval"+i).value;0<t.length?1==isNaN(parseFloat(t))&&(t=2.294254):t=2.294254,0<a.length?1==isNaN(parseFloat(a))&&(a=48.858334):a=48.858334;var n=new google.maps.LatLng(a,t);gmapmarker[e][i].setPosition(n),gmapdata[e].setCenter(n),cur_zoom=gmapdata[e].getZoom(),gmapdata[e].setZoom(cur_zoom),geocoder=new google.maps.Geocoder,geocoder.geocode({latLng:gmapmarker[e][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)});var l=document.getElementById(e+"_elementform_id_temp");return l.setAttribute("long"+i,t),l.setAttribute("lat"+i,a),!1}function remove_marker(e,t){gmapmarker[e][t].setMap(null)}function add_marker_on_map(t,i,e,a,n,l){if(map=document.getElementById(t+"_elementform_id_temp"),null==e){var d=gmapdata[t].getCenter();a=gmapdata[t].getCenter().lat(),e=gmapdata[t].getCenter().lng()}else d=new google.maps.LatLng(a,e);return geocoder=new google.maps.Geocoder,gmapmarker[t][i]=new google.maps.Marker({map:gmapdata[t],position:d,draggable:l}),gmapmarker[t][i].setDraggable(l),infoW=new google.maps.InfoWindow,google.maps.event.addListener(gmapdata[t],"mouseover",function(e){document.getElementById("longval"+i)||gmapmarker[t][i].setDraggable(!1)}),google.maps.event.addListener(gmapmarker[t][i],"drag",function(){document.getElementById("longval"+i)&&(geocoder.geocode({latLng:gmapmarker[t][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)}),map.setAttribute("long"+i,gmapmarker[t][i].getPosition().lng().toFixed(6)),map.setAttribute("lat"+i,gmapmarker[t][i].getPosition().lat().toFixed(6)),document.getElementById("latval"+i).value=gmapmarker[t][i].getPosition().lat().toFixed(6),document.getElementById("longval"+i).value=gmapmarker[t][i].getPosition().lng().toFixed(6))}),google.maps.event.addListener(gmapmarker[t][i],"click",function(){infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(t+"_elementform_id_temp").getAttribute("info"+i)+"</div>");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),document.getElementById("longval"+i)&&(document.getElementById("longval"+i).value=e,document.getElementById("latval"+i).value=a,geocoder.geocode({latLng:gmapmarker[t][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)}),map.setAttribute("long"+i,e),map.setAttribute("lat"+i,a)),!1}function changeAddress(i,a){var e=document.getElementById("addrval"+a).value;geocoder.geocode({address:e},function(e,t){t==google.maps.GeocoderStatus.OK&&(gmapdata[i].setCenter(e[0].geometry.location),gmapmarker[i][a].setPosition(e[0].geometry.location),document.getElementById("latval"+a).value=gmapmarker[i][a].getPosition().lat().toFixed(6),document.getElementById("longval"+a).value=gmapmarker[i][a].getPosition().lng().toFixed(6),map.setAttribute("long"+a,gmapmarker[i][a].getPosition().lng().toFixed(6)),map.setAttribute("lat"+a,gmapmarker[i][a].getPosition().lat().toFixed(6)))})}function change_info(e,t,i){map=document.getElementById(t+"_elementform_id_temp"),map.setAttribute("info"+i,e)}function if_gmap_updateMap(e){map=document.getElementById(e+"_elementform_id_temp"),w_long=gmapdata[e].getCenter().lng(),w_lat=gmapdata[e].getCenter().lat(),map.setAttribute("center_x",w_long),map.setAttribute("center_y",w_lat)}!function(t){"function"==typeof define&&define.amd?define(["jquery"],function(e){t(e,window,document)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window,document):t(jQuery,window,document)}(function(r,_,e,l){"use strict";var d="intlTelInput",i=1,a={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customPlaceholder:null,dropdownContainer:"",excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,initialCountry:"",nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},o=38,m=40,s=13,u=27,t=43,c=65,p=90,f=32,n=9,y=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"];function h(e,t){this.telInput=r(e),this.options=r.extend({},a,t),this.ns="."+d+i++,this.isGoodBrowser=Boolean(e.setSelectionRange),this.hadInitialPlaceholder=Boolean(r(e).attr("placeholder"))}r(_).on("load",function(){r.fn[d].windowLoaded=!0}),h.prototype={_init:function(){return this.options.nationalMode&&(this.options.autoHideDialCode=!1),this.options.separateDialCode&&(this.options.autoHideDialCode=this.options.nationalMode=!1),this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(r("body").addClass("iti-mobile"),this.options.dropdownContainer||(this.options.dropdownContainer="body")),this.autoCountryDeferred=new r.Deferred,this.utilsScriptDeferred=new r.Deferred,this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests(),[this.autoCountryDeferred,this.utilsScriptDeferred]},_processCountryData:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries()},_addCountryCode:function(e,t,i){t in this.countryCodes||(this.countryCodes[t]=[]);var a=i||0;this.countryCodes[t][a]=e},_filterCountries:function(e,t){var i;for(i=0;i<e.length;i++)e[i]=e[i].toLowerCase();for(this.countries=[],i=0;i<b.length;i++)t(r.inArray(b[i].iso2,e))&&this.countries.push(b[i])},_processAllCountries:function(){this.options.onlyCountries.length?this._filterCountries(this.options.onlyCountries,function(e){return-1<e}):this.options.excludeCountries.length?this._filterCountries(this.options.excludeCountries,function(e){return-1==e}):this.countries=b},_processCountryCodes:function(){this.countryCodes={};for(var e=0;e<this.countries.length;e++){var t=this.countries[e];if(this._addCountryCode(t.iso2,t.dialCode,t.priority),t.areaCodes)for(var i=0;i<t.areaCodes.length;i++)this._addCountryCode(t.iso2,t.dialCode+t.areaCodes[i])}},_processPreferredCountries:function(){this.preferredCountries=[];for(var e=0;e<this.options.preferredCountries.length;e++){var t=this.options.preferredCountries[e].toLowerCase(),i=this._getCountryData(t,!1,!0);i&&this.preferredCountries.push(i)}},_generateMarkup:function(){this.telInput.attr("autocomplete","off");var e="intl-tel-input";this.options.allowDropdown&&(e+=" allow-dropdown"),this.options.separateDialCode&&(e+=" separate-dial-code"),this.telInput.wrap(r("<div>",{class:e})),this.flagsContainer=r("<div>",{class:"flag-container"}).insertBefore(this.telInput);var t=r("<div>",{class:"selected-flag"});t.appendTo(this.flagsContainer),this.selectedFlagInner=r("<div>",{class:"iti-flag"}).appendTo(t),this.options.separateDialCode&&(this.selectedDialCode=r("<div>",{class:"selected-dial-code"}).appendTo(t)),this.options.allowDropdown?(t.attr("tabindex","0"),r("<div>",{class:"iti-arrow"}).appendTo(t),this.countryList=r("<ul>",{class:"country-list hide"}),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"preferred"),r("<li>",{class:"divider"}).appendTo(this.countryList)),this._appendListItems(this.countries,""),this.countryListItems=this.countryList.children(".country"),this.options.dropdownContainer?this.dropdown=r("<div>",{class:"intl-tel-input iti-container"}).append(this.countryList):this.countryList.appendTo(this.flagsContainer)):this.countryListItems=r()},_appendListItems:function(e,t){for(var i="",a=0;a<e.length;a++){var n=e[a];i+="<li class='country "+t+"' data-dial-code='"+n.dialCode+"' data-country-code='"+n.iso2+"'>",i+="<div class='flag-box'><div class='iti-flag "+n.iso2+"'></div></div>",i+="<span class='country-name'>"+n.name+"</span>",i+="<span class='dial-code'>+"+n.dialCode+"</span>",i+="</li>"}this.countryList.append(i)},_setInitialState:function(){var e=this.telInput.val();this._getDialCode(e)&&!this._isRegionlessNanp(e)?this._updateFlagFromNumber(e):"auto"!==this.options.initialCountry&&(this.options.initialCountry?this._setFlag(this.options.initialCountry.toLowerCase()):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),e||this.options.nationalMode||this.options.autoHideDialCode||this.options.separateDialCode||this.telInput.val("+"+this.selectedCountryData.dialCode)),e&&this._updateValFromNumber(e)},_initListeners:function(){this._initKeyListeners(),this.options.autoHideDialCode&&this._initFocusListeners(),this.options.allowDropdown&&this._initDropdownListeners()},_initDropdownListeners:function(){var t=this,e=this.telInput.closest("label");e.length&&e.on("click"+this.ns,function(e){t.countryList.hasClass("hide")?t.telInput.focus():e.preventDefault()}),this.selectedFlagInner.parent().on("click"+this.ns,function(e){!t.countryList.hasClass("hide")||t.telInput.prop("disabled")||t.telInput.prop("readonly")||t._showDropdown()}),this.flagsContainer.on("keydown"+t.ns,function(e){!t.countryList.hasClass("hide")||e.which!=o&&e.which!=m&&e.which!=f&&e.which!=s||(e.preventDefault(),e.stopPropagation(),t._showDropdown()),e.which==n&&t._closeDropdown()})},_initRequests:function(){var e=this;this.options.utilsScript?r.fn[d].windowLoaded?r.fn[d].loadUtils(this.options.utilsScript,this.utilsScriptDeferred):r(_).on("load",function(){r.fn[d].loadUtils(e.options.utilsScript,e.utilsScriptDeferred)}):this.utilsScriptDeferred.resolve(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.autoCountryDeferred.resolve()},_loadAutoCountry:function(){r.fn[d].autoCountry?this.handleAutoCountry():r.fn[d].startedLoadingAutoCountry||(r.fn[d].startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup(function(e){r.fn[d].autoCountry=e.toLowerCase(),setTimeout(function(){r(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_initKeyListeners:function(){var e=this;this.telInput.on("keyup"+this.ns,function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()}),this.telInput.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()})})},_cap:function(e){var t=this.telInput.attr("maxlength");return t&&e.length>t?e.substr(0,t):e},_initFocusListeners:function(){var i=this;this.telInput.on("mousedown"+this.ns,function(e){i.telInput.is(":focus")||i.telInput.val()||(e.preventDefault(),i.telInput.focus())}),this.telInput.on("focus"+this.ns,function(e){i.telInput.val()||i.telInput.prop("readonly")||!i.selectedCountryData.dialCode||(i.telInput.val("+"+i.selectedCountryData.dialCode),i.telInput.one("keypress.plus"+i.ns,function(e){e.which==t&&i.telInput.val("")}),setTimeout(function(){var e=i.telInput[0];if(i.isGoodBrowser){var t=i.telInput.val().length;e.setSelectionRange(t,t)}}))});var e=this.telInput.prop("form");e&&r(e).on("submit"+this.ns,function(){i._removeEmptyDialCode()}),this.telInput.on("blur"+this.ns,function(){i._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var e=this.telInput.val();if("+"==e.charAt(0)){var t=this._getNumeric(e);t&&this.selectedCountryData.dialCode!=t||this.telInput.val("")}this.telInput.off("keypress.plus"+this.ns)},_getNumeric:function(e){return e.replace(/\D/g,"")},_showDropdown:function(){this._setDropdownPosition();var e=this.countryList.children(".active");e.length&&(this._highlightListItem(e),this._scrollTo(e)),this._bindDropdownListeners(),this.selectedFlagInner.children(".iti-arrow").addClass("up")},_setDropdownPosition:function(){var e=this;if(this.options.dropdownContainer&&this.dropdown.appendTo(this.options.dropdownContainer),this.dropdownHeight=this.countryList.removeClass("hide").outerHeight(),!this.isMobile){var t=this.telInput.offset(),i=t.top,a=r(_).scrollTop(),n=i+this.telInput.outerHeight()+this.dropdownHeight<a+r(_).height(),l=i-this.dropdownHeight>a;if(this.countryList.toggleClass("dropup",!n&&l),this.options.dropdownContainer){var d=!n&&l?0:this.telInput.innerHeight();this.dropdown.css({top:i+d,left:t.left}),r(_).on("scroll"+this.ns,function(){e._closeDropdown()})}}},_bindDropdownListeners:function(){var t=this;this.countryList.on("mouseover"+this.ns,".country",function(e){t._highlightListItem(r(this))}),this.countryList.on("click"+this.ns,".country",function(e){t._selectListItem(r(this))});var i=!0;r("html").on("click"+this.ns,function(e){i||t._closeDropdown(),i=!1});var a="",n=null;r(e).on("keydown"+this.ns,function(e){e.preventDefault(),e.which==o||e.which==m?t._handleUpDownKey(e.which):e.which==s?t._handleEnterKey():e.which==u?t._closeDropdown():(e.which>=c&&e.which<=p||e.which==f)&&(n&&clearTimeout(n),a+=String.fromCharCode(e.which),t._searchForCountry(a),n=setTimeout(function(){a=""},1e3))})},_handleUpDownKey:function(e){var t=this.countryList.children(".highlight").first(),i=e==o?t.prev():t.next();i.length&&(i.hasClass("divider")&&(i=e==o?i.prev():i.next()),this._highlightListItem(i),this._scrollTo(i))},_handleEnterKey:function(){var e=this.countryList.children(".highlight").first();e.length&&this._selectListItem(e)},_searchForCountry:function(e){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,e)){var i=this.countryList.children("[data-country-code="+this.countries[t].iso2+"]").not(".preferred");this._highlightListItem(i),this._scrollTo(i,!0);break}},_startsWith:function(e,t){return e.substr(0,t.length).toUpperCase()==t},_updateValFromNumber:function(e){if(this.options.formatOnDisplay&&_.intlTelInputUtils&&this.selectedCountryData){var t=this.options.separateDialCode||!this.options.nationalMode&&"+"==e.charAt(0)?intlTelInputUtils.numberFormat.INTERNATIONAL:intlTelInputUtils.numberFormat.NATIONAL;e=intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,t)}e=this._beforeSetNumber(e),this.telInput.val(e)},_updateFlagFromNumber:function(e){e&&this.options.nationalMode&&this.selectedCountryData&&"1"==this.selectedCountryData.dialCode&&"+"!=e.charAt(0)&&("1"!=e.charAt(0)&&(e="1"+e),e="+"+e);var t=this._getDialCode(e),i=null,a=this._getNumeric(e);if(t){var n=this.countryCodes[this._getNumeric(t)],l=this.selectedCountryData&&-1<r.inArray(this.selectedCountryData.iso2,n),d="+1"==t&&4<=a.length;if((!(this.selectedCountryData&&"1"==this.selectedCountryData.dialCode)||!this._isRegionlessNanp(a))&&(!l||d))for(var _=0;_<n.length;_++)if(n[_]){i=n[_];break}}else"+"==e.charAt(0)&&a.length?i="":e&&"+"!=e||(i=this.defaultCountry);return null!==i&&this._setFlag(i)},_isRegionlessNanp:function(e){var t=this._getNumeric(e);if("1"!=t.charAt(0))return!1;var i=t.substr(1,3);return-1<r.inArray(i,y)},_highlightListItem:function(e){this.countryListItems.removeClass("highlight"),e.addClass("highlight")},_getCountryData:function(e,t,i){for(var a=t?b:this.countries,n=0;n<a.length;n++)if(a[n].iso2==e)return a[n];if(i)return null;throw new Error("No country data for '"+e+"'")},_setFlag:function(e){var t=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?this._getCountryData(e,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedFlagInner.attr("class","iti-flag "+e);var i=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown";if(this.selectedFlagInner.parent().attr("title",i),this.options.separateDialCode){var a=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",n=this.telInput.parent();t.dialCode&&n.removeClass("iti-sdc-"+(t.dialCode.length+1)),a&&n.addClass("iti-sdc-"+a.length),this.selectedDialCode.text(a)}return this._updatePlaceholder(),this.countryListItems.removeClass("active"),e&&this.countryListItems.find(".iti-flag."+e).first().closest(".country").addClass("active"),t.iso2!==e},_updatePlaceholder:function(){var e="aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&(!0===this.options.autoPlaceholder||"polite"===this.options.autoPlaceholder);if(_.intlTelInputUtils&&e&&this.selectedCountryData){var t=intlTelInputUtils.numberType[this.options.placeholderNumberType],i=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,t):"";i=this._beforeSetNumber(i),"function"==typeof this.options.customPlaceholder&&(i=this.options.customPlaceholder(i,this.selectedCountryData)),this.telInput.attr("placeholder",i)}},_selectListItem:function(e){var t=this._setFlag(e.attr("data-country-code"));if(this._closeDropdown(),this._updateDialCode(e.attr("data-dial-code"),!0),this.telInput.focus(),this.isGoodBrowser){var i=this.telInput.val().length;this.telInput[0].setSelectionRange(i,i)}t&&this._triggerCountryChange()},_closeDropdown:function(){this.countryList.addClass("hide"),this.selectedFlagInner.children(".iti-arrow").removeClass("up"),r(e).off(this.ns),r("html").off(this.ns),this.countryList.off(this.ns),this.options.dropdownContainer&&(this.isMobile||r(_).off("scroll"+this.ns),this.dropdown.detach())},_scrollTo:function(e,t){var i=this.countryList,a=i.height(),n=i.offset().top,l=n+a,d=e.outerHeight(),_=e.offset().top,r=_+d,o=_-n+i.scrollTop(),m=a/2-d/2;if(_<n)t&&(o-=m),i.scrollTop(o);else if(l<r){t&&(o+=m);var s=a-d;i.scrollTop(o-s)}},_updateDialCode:function(e,t){var i,a=this.telInput.val();if(e="+"+e,"+"==a.charAt(0)){var n=this._getDialCode(a);i=n?a.replace(n,e):e}else{if(this.options.nationalMode||this.options.separateDialCode)return;if(a)i=e+a;else{if(!t&&this.options.autoHideDialCode)return;i=e}}this.telInput.val(i)},_getDialCode:function(e){var t="";if("+"==e.charAt(0))for(var i="",a=0;a<e.length;a++){var n=e.charAt(a);if(r.isNumeric(n)&&(i+=n,this.countryCodes[i]&&(t=e.substr(0,a+1)),4==i.length))break}return t},_getFullNumber:function(){var e=r.trim(this.telInput.val()),t=this.selectedCountryData.dialCode,i=this._getNumeric(e),a="1"==i.charAt(0)?i:"1"+i;return(this.options.separateDialCode?"+"+t:"+"!=e.charAt(0)&&"1"!=e.charAt(0)&&t&&"1"==t.charAt(0)&&4==t.length&&t!=a.substr(0,4)?t.substr(1):"")+e},_beforeSetNumber:function(e){if(this.options.separateDialCode){var t=this._getDialCode(e);if(t){null!==this.selectedCountryData.areaCodes&&(t="+"+this.selectedCountryData.dialCode);var i=" "===e[t.length]||"-"===e[t.length]?t.length+1:t.length;e=e.substr(i)}}return this._cap(e)},_triggerCountryChange:function(){this.telInput.trigger("countrychange",this.selectedCountryData)},handleAutoCountry:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=r.fn[d].autoCountry,this.telInput.val()||this.setCountry(this.defaultCountry),this.autoCountryDeferred.resolve())},handleUtils:function(){_.intlTelInputUtils&&(this.telInput.val()&&this._updateValFromNumber(this.telInput.val()),this._updatePlaceholder()),this.utilsScriptDeferred.resolve()},destroy:function(){if(this.allowDropdown&&(this._closeDropdown(),this.selectedFlagInner.parent().off(this.ns),this.telInput.closest("label").off(this.ns)),this.options.autoHideDialCode){var e=this.telInput.prop("form");e&&r(e).off(this.ns)}this.telInput.off(this.ns),this.telInput.parent().before(this.telInput).remove()},getExtension:function(){return _.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""},getNumber:function(e){return _.intlTelInputUtils?intlTelInputUtils.formatNumber(this._getFullNumber(),this.selectedCountryData.iso2,e):""},getNumberType:function(){return _.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99},getSelectedCountryData:function(){return this.selectedCountryData||{}},getValidationError:function(){return _.intlTelInputUtils?intlTelInputUtils.getValidationError(this._getFullNumber(),this.selectedCountryData.iso2):-99},isValidNumber:function(){var e=r.trim(this._getFullNumber()),t=this.options.nationalMode?this.selectedCountryData.iso2:"";return _.intlTelInputUtils?intlTelInputUtils.isValidNumber(e,t):null},setCountry:function(e){e=e.toLowerCase(),this.selectedFlagInner.hasClass(e)||(this._setFlag(e),this._updateDialCode(this.selectedCountryData.dialCode,!1),this._triggerCountryChange())},setNumber:function(e){var t=this._updateFlagFromNumber(e);this._updateValFromNumber(e),t&&this._triggerCountryChange()}},r.fn[d]=function(i){var t,a=arguments;if(i===l||"object"==typeof i){var n=[];return this.each(function(){if(!r.data(this,"plugin_"+d)){var e=new h(this,i),t=e._init();n.push(t[0]),n.push(t[1]),r.data(this,"plugin_"+d,e)}}),r.when.apply(null,n)}if("string"==typeof i&&"_"!==i[0])return this.each(function(){var e=r.data(this,"plugin_"+d);e instanceof h&&"function"==typeof e[i]&&(t=e[i].apply(e,Array.prototype.slice.call(a,1))),"destroy"===i&&r.data(this,"plugin_"+d,null)}),t!==l?t:this},r.fn[d].getCountryData=function(){return b},r.fn[d].loadUtils=function(e,t){r.fn[d].loadedUtilsScript?t&&t.resolve():(r.fn[d].loadedUtilsScript=!0,r.ajax({type:"GET",url:e,complete:function(){r(".intl-tel-input input").intlTelInput("handleUtils")},dataType:"script",cache:!0}))},r.fn[d].version="11.0.0",r.fn[d].defaults=a;for(var b=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1441"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Cote d'Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curacao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1876"],["Japan","jp","81"],["Jersey","je","44",3],["Jordan","jo","962"],["Kazakhstan","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1664"],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Reunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Saint Barthelemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin","mf","590",2],["Saint Pierre and Miquelon","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["Sao Tome and Principe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis and Futuna","wf","681"],["Western Sahara","eh","212",1],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Aland Islands","ax","358",1]],v=0;v<b.length;v++){var w=b[v];b[v]={name:w[0],iso2:w[1],dialCode:w[2],priority:w[3]||0,areaCodes:w[4]||null}}}),j=2;var need_enable=!0,a=new Array,is_addon_stripe_active,is_addon_calculator_active,nextID;if(-1!=ajaxurl.indexOf("://"))var url_for_ajax=ajaxurl;else var url_for_ajax=location.protocol+"//"+location.host+ajaxurl;function isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function disable_past_days(e,t){document.getElementById(t+"_buttonform_id_temp").setAttribute("format",e)}function set_send(e){"yes"==document.getElementById(e).value?document.getElementById(e).setAttribute("value","no"):document.getElementById(e).setAttribute("value","yes")}function show_datepicker(e){jQuery("#"+e).datepicker("show")}function hide_time(e){"no"==document.getElementById(e+"form_id_temp").value?document.getElementById(e+"form_id_temp").value="yes":document.getElementById(e+"form_id_temp").value="no"}function show_week_days(id,week_day){week_day&&(1==document.getElementById("el_show_"+week_day).checked?document.getElementById(id+"_show_week_days").setAttribute(week_day,"yes"):document.getElementById(id+"_show_week_days").setAttribute(week_day,"no")),jQuery("input[name^="+id+"_elementform_id_temp]").datepicker("option","beforeShowDay",function(date){for(var w_hide_sunday="yes"==jQuery("#"+id+"_show_week_days").attr("sunday")?"true":"day != 0",w_hide_monday="yes"==jQuery("#"+id+"_show_week_days").attr("monday")?"true":"day != 1",w_hide_tuesday="yes"==jQuery("#"+id+"_show_week_days").attr("tuesday")?"true":"day != 2",w_hide_wednesday="yes"==jQuery("#"+id+"_show_week_days").attr("wednesday")?"true":"day != 3",w_hide_thursday="yes"==jQuery("#"+id+"_show_week_days").attr("thursday")?"true":"day != 4",w_hide_friday="yes"==jQuery("#"+id+"_show_week_days").attr("friday")?"true":"day != 5",w_hide_saturday="yes"==jQuery("#"+id+"_show_week_days").attr("saturday")?"true":"day != 6",invalid_dates=jQuery("#"+id+"_invalid_dates_id_temp").val(),invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i<invalid_dates_start.length;i++)if(invalid_dates_start[i]=invalid_dates_start[i].trim(),invalid_dates_start[i].length<11)invalid_dates_finish.push(invalid_dates_start[i]);else if(4<invalid_dates_start[i].indexOf("-"))invalid_date_range.push(invalid_dates_start[i].split("-"));else{var invalid_date_array=invalid_dates_start[i].split("-"),start_invalid_day=invalid_date_array[0]+"-"+invalid_date_array[1]+"-"+invalid_date_array[2],end_invalid_day=invalid_date_array[3]+"-"+invalid_date_array[4]+"-"+invalid_date_array[5];invalid_date_range.push([start_invalid_day,end_invalid_day])}jQuery.each(invalid_date_range,function(e,t){for(var i=new Date(t[0]);i<=new Date(t[1]);i.setDate(i.getDate()+1))invalid_dates_finish.push(jQuery.datepicker.formatDate("mm/dd/yy",i))});var string_days=jQuery.datepicker.formatDate("mm/dd/yy",date),day=date.getDay();return[-1==invalid_dates_finish.indexOf(string_days)&&eval(w_hide_sunday)&&eval(w_hide_monday)&&eval(w_hide_tuesday)&&eval(w_hide_wednesday)&&eval(w_hide_thursday)&&eval(w_hide_friday)&&eval(w_hide_saturday)]})}function set_sel_am_pm(e){e.options[0].selected?(e.options[0].setAttribute("selected","selected"),e.options[1].removeAttribute("selected")):(e.options[1].setAttribute("selected","selected"),e.options[0].removeAttribute("selected"))}function change_captcha_digit(e){captcha=document.getElementById("_wd_captchaform_id_temp"),document.getElementById("captcha_digit").value?(captcha.setAttribute("digit",e),captcha.setAttribute("src",url_for_ajax+"?action=formmakerwdcaptcha&digit="+e+"&i=form_id_temp"),document.getElementById("_wd_captcha_inputform_id_temp").style.width=10*document.getElementById("captcha_digit").value+15+"px"):(captcha.setAttribute("digit","6"),captcha.setAttribute("src",url_for_ajax+"?action=formmakerwdcaptcha&digit=6&i=form_id_temp"),document.getElementById("_wd_captcha_inputform_id_temp").style.width="75px")}function check_isnum_interval(e,t,i,a){var n=e.which||e.keyCode;return!(31<n&&(n<48||57<n))&&(val=""+document.getElementById(t).value+String.fromCharCode(n),!(2<val.length)&&("00"!=val&&!(val<i||val>a)))}function check_isnum_point(e){var t=e.which||e.keyCode;return 46==t||!(31<t&&(t<48||57<t))}function check_isnum_price(e,t){var i=e.which||e.keyCode;return!((""==t||-1<t.indexOf("."))&&31<i&&(i<48||57<i))&&!(31<i&&46!=i&&(i<48||57<i))}function check_isspacebar(e){return 32!=(e.which||e.keyCode)}function change_w_label(e,t){document.getElementById(e)&&(document.getElementById(e).innerHTML=t)}function change_w(e,t){document.getElementById(e).setAttribute("width",t)}function change_h(e,t){document.getElementById(e).setAttribute("height",t)}function change_key(e,t){document.getElementById("wd_recaptchaform_id_temp").setAttribute(t,e)}function captcha_refresh(e){srcArr=document.getElementById(e+"form_id_temp").src.split("&r="),document.getElementById(e+"form_id_temp").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_inputform_id_temp").value=""}function up_row(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,k=0;wdform_column.childNodes[k]&&(!wdform_column.childNodes[k].getAttribute("wdid")||e!=wdform_column.childNodes[k].getAttribute("wdid"));)k++;if(0!=k)return up=wdform_column.childNodes[k-1],down=wdform_column.childNodes[k],wdform_column.removeChild(down),void wdform_column.insertBefore(down,up);wdform_section.previousSibling&&wdform_section.previousSibling.getAttribute("type")?wdform_section.previousSibling.previousSibling.firstChild.appendChild(wdform_row):page_up(e)}function down_row(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,l=wdform_column.childNodes.length,k=0;wdform_column.childNodes[k]&&(!wdform_column.childNodes[k].getAttribute("wdid")||e!=wdform_column.childNodes[k].getAttribute("wdid"));)k++;if(k!=l-1)return up=wdform_column.childNodes[k],down=wdform_column.childNodes[k+2],wdform_column.removeChild(up),down||(down=null),void wdform_column.insertBefore(up,down);wdform_section.nextSibling.getAttribute("type")?wdform_section.nextSibling.nextSibling.firstChild.appendChild(wdform_row):page_down(e)}function right_row(e){if("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,null!=wdform_column.nextSibling)wdform_column_next=wdform_column.nextSibling,wdform_column_next.appendChild(wdform_row);else{var t=document.createElement("div");t.setAttribute("class","wdform_column"),wdform_section.appendChild(t),t.appendChild(wdform_row)}sortable_columns()}function left_row(e){"undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,null!=wdform_column.previousSibling&&(wdform_column_next=wdform_column.previousSibling,wdform_column_next.appendChild(wdform_row)),sortable_columns()}function page_up(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,wdform_page_and_images=wdform_page.parentNode;wdform_page_and_images;){if(wdform_page_and_images=wdform_page_and_images.previousSibling,!wdform_page_and_images)return void alert("Unable to move");if(jQuery(wdform_page_and_images.firstChild).is(":visible"))break}n=wdform_page_and_images.getElementsByClassName("wdform_page")[0].childNodes.length,wdform_page_and_images.getElementsByClassName("wdform_page")[0].childNodes[n-2].firstChild.appendChild(wdform_row),refresh_pages(e)}function page_down(e){for("undefined"!=typeof event&&event.stopPropagation(),wdform_field=document.getElementById("wdform_field"+e),wdform_row=wdform_field.parentNode,wdform_column=wdform_row.parentNode,wdform_section=wdform_column.parentNode,wdform_page=wdform_section.parentNode,wdform_page_and_images=wdform_page.parentNode;wdform_page_and_images;){if(wdform_page_and_images=wdform_page_and_images.nextSibling,!wdform_page_and_images||"add_field_cont"==wdform_page_and_images.id)return void alert("Unable to move");if(jQuery(wdform_page_and_images.firstChild).is(":visible"))break}wdform_page_and_images.getElementsByClassName("wdform_page")[0].firstChild.firstChild.insertBefore(wdform_row,wdform_page_and_images.firstChild.firstChild.firstChild.firstChild),refresh_pages(e)}function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function Disable(){}function all_labels(){for(labels=new Array,k=1;k<=form_view_max;k++)if(document.getElementById("form_id_tempform_view"+k))for(wdform_page=document.getElementById("form_id_tempform_view"+k),remove_whitespace(wdform_page),n=wdform_page.childNodes.length-2,z=0;z<=n;z++)if(!wdform_page.childNodes[z].getAttribute("wdid"))for(wdform_section=wdform_page.childNodes[z],x=0;x<wdform_section.childNodes.length;x++)if(wdform_column=wdform_section.childNodes[x],wdform_column.firstChild)for(y=0;y<wdform_column.childNodes.length;y++)wdform_row=wdform_column.childNodes[y],3!=wdform_row.nodeType&&(wdid=wdform_row.getAttribute("wdid"),wdid&&labels.push(document.getElementById(wdid+"_element_labelform_id_temp").innerHTML));return labels}function set_checked(e,t){return checking=document.getElementById(e+"_elementform_id_temp"+t),checking.checked&&checking.setAttribute("checked","checked"),!(!checking.checked&&(checking.removeAttribute("checked"),checking.getAttribute("other")&&1==checking.getAttribute("other")))||(document.getElementById(e+"_other_inputform_id_temp")&&(document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_brform_id_temp")),document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_inputform_id_temp"))),!1)}function set_default(e,t){for(k=0;k<100;k++)document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).checked?document.getElementById(e+"_elementform_id_temp"+t).setAttribute("checked","checked"):document.getElementById(e+"_elementform_id_temp"+k).removeAttribute("checked"));document.getElementById(e+"_other_inputform_id_temp")&&(document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_brform_id_temp")),document.getElementById(e+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(e+"_other_inputform_id_temp")))}function set_select(e){for(p=e.length-1;0<=p;p--)e.options[p].selected?e.options[p].setAttribute("selected","selected"):e.options[p].removeAttribute("selected")}function add_0(e){input=document.getElementById(e),1==input.value.length&&(input.value="0"+input.value,input.setAttribute("value",input.value))}function label_top_stripe(e){document.getElementById(e+"_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_element_sectionform_id_temp").style.display="block"}function label_left_stripe(e){document.getElementById(e+"_label_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_element_sectionform_id_temp").style.display="table-cell"}function change_value_range(e,t,i){jQuery("#"+e).datepicker("option",t,i)}function change_func(e,t){document.getElementById(e).setAttribute("onclick",t)}function change_in_value(e,t){t=(t=t.replace(/(<([^>]+)>)/gi,"")).replace(/"/g,"&quot;"),document.getElementById(e).setAttribute("value",t)}function change_size(e,t){switch(document.getElementById(t+"_elementform_id_temp").style.width=e+"px",document.getElementById(t+"_element_input")&&(document.getElementById(t+"_element_input").style.width=e+"px"),e){case"111":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","2");break;case"222":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","4");break;case"444":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","8")}}function getIFrameDocument(e){var t=null;return document.getElementById(e)&&document.getElementById(e).contentDocument?t=document.getElementById(e).contentDocument:document.getElementById(e)&&(t=document.frames[e].document),t}function format_extended(t,e,i,a,n){w_size=document.getElementById(t+"_element_firstform_id_temp").style.width,tr_name1=document.getElementById(t+"_tr_name1"),tr_name2=document.getElementById(t+"_tr_name2");var l=document.createElement("div");l.setAttribute("id",t+"_td_name_input_title"),l.style.display="table-cell";var d=document.createElement("div");d.setAttribute("id",t+"_td_name_input_middle"),d.style.display="table-cell";var _=document.createElement("div");_.setAttribute("id",t+"_td_name_label_title"),_.setAttribute("align","left"),_.style.display="table-cell";var r=document.createElement("div");r.setAttribute("id",t+"_td_name_label_middle"),r.setAttribute("align","left"),r.style.display="table-cell";var o=document.createElement("input");o.setAttribute("type","text"),o.style.cssText="margin: 0px 10px 0px 0px; padding: 0px; width:40px",o.setAttribute("id",t+"_element_titleform_id_temp"),o.setAttribute("name",t+"_element_titleform_id_temp"),e==a?o.setAttribute("value",a):o.setAttribute("value",e),o.setAttribute("title",a);var m=document.createElement("label");m.setAttribute("class","mini_label"),m.setAttribute("id",t+"_mini_label_title"),m.innerHTML=w_mini_labels[0];var s=document.createElement("input");s.setAttribute("type","text"),s.style.cssText="padding: 0px; width:"+w_size,s.setAttribute("id",t+"_element_middleform_id_temp"),s.setAttribute("name",t+"_element_middleform_id_temp"),i==n?s.setAttribute("value",n):s.setAttribute("value",i),s.setAttribute("title",n);var u=document.createElement("label");u.setAttribute("class","mini_label"),u.setAttribute("id",t+"_mini_label_middle"),u.innerHTML=w_mini_labels[3],first_input=document.getElementById(t+"_td_name_input_first"),last_input=document.getElementById(t+"_td_name_input_last"),first_label=document.getElementById(t+"_td_name_label_first"),last_label=document.getElementById(t+"_td_name_label_last"),l.appendChild(o),d.appendChild(s),tr_name1.insertBefore(l,first_input),tr_name1.insertBefore(d,null),_.appendChild(m),r.appendChild(u),tr_name2.insertBefore(_,first_label),tr_name2.insertBefore(r,null);var c=document.createTextNode("-"),p=document.createTextNode("-"),f=document.createElement("input");f.setAttribute("id","el_first_value_title"),f.setAttribute("type","text"),f.setAttribute("value",a),f.style.cssText="width:50px; margin-left:4px; margin-right:4px",f.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_titleform_id_temp')");var y=document.createElement("input");y.setAttribute("id","el_first_value_middle"),y.setAttribute("type","text"),y.setAttribute("value",n),y.style.cssText="width:100px; margin-left:4px",y.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_middleform_id_temp')"),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,parent.insertBefore(c,el_first_value_first),parent.insertBefore(f,c),parent.appendChild(p),parent.appendChild(y),refresh_attr(t,"type_name"),refresh_id_name(t,"type_name"),jQuery(function(){jQuery("label#"+t+"_mini_label_title").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.title").focus(),jQuery("input.title").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_title").text(e)})}}),jQuery("label#"+t+"_mini_label_middle").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_middle").text(e)})}})})}function format_normal(e){tr_name1=document.getElementById(e+"_tr_name1"),tr_name2=document.getElementById(e+"_tr_name2"),td_name_input1=document.getElementById(e+"_td_name_input_title"),td_name_input4=document.getElementById(e+"_td_name_input_middle"),td_name_label1=document.getElementById(e+"_td_name_label_title"),td_name_label4=document.getElementById(e+"_td_name_label_middle"),tr_name1.removeChild(td_name_input1),tr_name1.removeChild(td_name_input4),tr_name2.removeChild(td_name_label1),tr_name2.removeChild(td_name_label4),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,parent.removeChild(document.getElementById("el_first_value_title").nextSibling),parent.removeChild(document.getElementById("el_first_value_title")),parent.removeChild(document.getElementById("el_first_value_middle").previousSibling),parent.removeChild(document.getElementById("el_first_value_middle")),refresh_attr(e,"type_name"),refresh_id_name(e,"type_name")}function type_number(e,t,i,a,l,d,_,r,o,m,s,u){document.getElementById("element_type").value="type_number",delete_last_child();var c=document.createElement("div");c.setAttribute("id","edit_div");var p=document.createElement("table");p.setAttribute("id","edit_main_table"),p.setAttribute("cellpadding","3"),p.setAttribute("cellspacing","0");var f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td"),q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=(document.createElement("td"),document.createElement("td")),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("label");K.setAttribute("class","fm-field-label"),K.setAttribute("for","edit_for_label"),K.innerHTML="Field label";var U=document.createElement("textarea");U.setAttribute("id","edit_for_label"),U.setAttribute("rows","4"),U.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),U.innerHTML=t;var F=document.createElement("label");F.setAttribute("class","fm-field-label"),F.setAttribute("for","edit_for_label_size"),F.innerHTML="Field label size(px) ";var R=document.createElement("input");R.setAttribute("id","edit_for_label_size"),R.setAttribute("type","text"),R.setAttribute("value",i),R.setAttribute("onKeyPress","return check_isnum(event)"),R.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var W=document.createElement("label");W.setAttribute("class","fm-field-label"),W.innerHTML="Field label position";var V=document.createElement("input");V.setAttribute("id","edit_for_label_position_top"),V.setAttribute("type","radio"),V.setAttribute("name","edit_for_label_position"),V.setAttribute("onchange","label_left("+e+")");var $=document.createElement("label");$.setAttribute("for","edit_for_label_position_top"),$.innerHTML="Left";var G=document.createElement("input");G.setAttribute("id","edit_for_label_position_left"),G.setAttribute("type","radio"),G.setAttribute("name","edit_for_label_position"),G.setAttribute("onchange","label_top("+e+")");var Y=document.createElement("label");Y.setAttribute("for","edit_for_label_position_left"),Y.innerHTML="Top","top"==a?G.setAttribute("checked","checked"):V.setAttribute("checked","checked");var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","edit_for_input_size"),Z.innerHTML="Field size(px) ";var X=document.createElement("input");X.setAttribute("id","edit_for_input_size"),X.setAttribute("type","text"),X.setAttribute("value",l),X.setAttribute("onKeyPress","return check_isnum(event)"),X.setAttribute("onKeyUp","change_w_style('"+e+"_elementform_id_temp', this.value)");var J=document.createElement("label");J.setAttribute("class","fm-field-label"),J.setAttribute("for","el_first_value_input"),J.innerHTML="Placeholder ";var ee=document.createElement("input");ee.setAttribute("id","el_first_value_input"),ee.setAttribute("type","text"),ee.setAttribute("value",_),ee.setAttribute("onKeyUp","change_input_value(this.value,'"+e+"_elementform_id_temp');");var te=document.createElement("label");te.setAttribute("class","fm-field-label"),te.setAttribute("for","el_required"),te.innerHTML="Required";var ie=document.createElement("input");ie.setAttribute("id","el_required"),ie.setAttribute("type","checkbox"),ie.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==r&&ie.setAttribute("checked","checked");var ae=document.createElement("label");ae.setAttribute("class","fm-field-label"),ae.setAttribute("for","el_unique"),ae.innerHTML="Allow only unique values";var ne=document.createElement("input");ne.setAttribute("id","el_unique"),ne.setAttribute("type","checkbox"),ne.setAttribute("onclick","set_unique('"+e+"_uniqueform_id_temp')"),"yes"==o&&ne.setAttribute("checked","checked");var le=document.createElement("label");le.setAttribute("class","fm-field-label"),le.setAttribute("for","el_style_textarea"),le.innerHTML="Class name";var de=document.createElement("input");de.setAttribute("id","el_style_textarea"),de.setAttribute("type","text"),de.setAttribute("value",m),de.setAttribute("onChange","change_class(this.value,'"+e+"')");var _e=document.createElement("label");_e.setAttribute("class","fm-field-label"),_e.innerHTML="Additional Attributes";var re=document.createElement("img");re.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),re.style.cssText="cursor:pointer; margin-left:68px",re.setAttribute("title","add"),re.setAttribute("onClick","add_attr("+e+", 'type_text')");var oe=document.createElement("table");oe.setAttribute("id","attributes"),oe.setAttribute("border","0"),oe.style.cssText="margin-left:0px";var me=document.createElement("tr");me.setAttribute("idi","0");var se=document.createElement("th");se.style.cssText="width:100px";var ue=document.createElement("th");ue.style.cssText="width:100px";var ce=document.createElement("th");ce.style.cssText="width:10px";var pe=document.createElement("label");pe.style.cssText="color:#000; font-weight:bold; font-size: 11px",pe.innerHTML="Name";var fe=document.createElement("label");for(fe.style.cssText="color:#000; font-weight:bold; font-size: 11px",fe.innerHTML="Value",oe.appendChild(me),me.appendChild(se),me.appendChild(ue),me.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),n=s.length,j=1;j<=n;j++){var ye=document.createElement("tr");ye.setAttribute("id","attr_row_"+j),ye.setAttribute("idi",j);var he=document.createElement("td");he.style.cssText="width:100px";var be=document.createElement("td");be.style.cssText="width:100px";var ve=document.createElement("td"),we=document.createElement("input");we.setAttribute("type","text"),we.setAttribute("class","fm-field-choice"),we.setAttribute("value",s[j-1]),we.setAttribute("id","attr_name"+j),we.setAttribute("onChange","change_attribute_name("+e+", this, 'type_text')");var ge=document.createElement("input");ge.setAttribute("type","text"),ge.setAttribute("class","fm-field-choice"),ge.setAttribute("value",u[j-1]),ge.setAttribute("id","attr_value"+j),ge.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_text')");var Ee=document.createElement("img");Ee.setAttribute("id","el_choices"+j+"_remove"),Ee.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Ee.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Ee.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_text')"),oe.appendChild(ye),ye.appendChild(he),ye.appendChild(be),ye.appendChild(ve),he.appendChild(we),be.appendChild(ge),ve.appendChild(Ee)}var Ae=document.getElementById("edit_table"),je=document.createElement("br"),xe=document.createElement("br");x.appendChild(K),k.appendChild(U),P.appendChild(F),O.appendChild(R),I.appendChild(W),C.appendChild(V),C.appendChild($),C.appendChild(je),C.appendChild(G),C.appendChild(Y),B.appendChild(Z),Q.appendChild(X),T.appendChild(J),M.appendChild(ee),L.appendChild(le),z.appendChild(de),q.appendChild(te),H.appendChild(ie),S.appendChild(ae),D.appendChild(ne),N.appendChild(_e),N.appendChild(re),N.appendChild(xe),N.appendChild(oe),N.setAttribute("colspan","2"),f.appendChild(x),f.appendChild(k),A.appendChild(P),A.appendChild(O),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),E.appendChild(S),E.appendChild(D),g.appendChild(N),p.appendChild(f),p.appendChild(A),p.appendChild(y),p.appendChild(h),p.appendChild(b),p.appendChild(v),p.appendChild(w),p.appendChild(E),p.appendChild(g),c.appendChild(p),Ae.appendChild(c),add_id_and_name(e,"type_text"),element="input",type="text";var ke=document.createElement("input");ke.setAttribute("type","hidden"),ke.setAttribute("value","type_number"),ke.setAttribute("name",e+"_typeform_id_temp"),ke.setAttribute("id",e+"_typeform_id_temp");var Ie=document.createElement("input");Ie.setAttribute("type","hidden"),Ie.setAttribute("value",r),Ie.setAttribute("name",e+"_requiredform_id_temp"),Ie.setAttribute("id",e+"_requiredform_id_temp");var Ce=document.createElement("input");Ce.setAttribute("type","hidden"),Ce.setAttribute("value",o),Ce.setAttribute("name",e+"_uniqueform_id_temp"),Ce.setAttribute("id",e+"_uniqueform_id_temp");var Be=document.createElement(element);Be.setAttribute("type",type),Be.style.cssText="width:"+l+"px;",Be.setAttribute("id",e+"_elementform_id_temp"),Be.setAttribute("name",e+"_elementform_id_temp"),Be.setAttribute("value",d),Be.setAttribute("title",_),Be.setAttribute("placeholder",_),Be.setAttribute("onKeyPress","return check_isnum(event)");var Qe=document.createElement("div");Qe.setAttribute("id","main_div");var Te=document.createElement("div");Te.setAttribute("id",e+"_elemet_tableform_id_temp");var Me=document.createElement("div");Me.setAttribute("align","left"),Me.style.display="table-cell",Me.style.width=i+"px",Me.setAttribute("id",e+"_label_sectionform_id_temp");var Le=document.createElement("div");Le.setAttribute("align","left"),Le.style.display="table-cell",Le.setAttribute("id",e+"_element_sectionform_id_temp");var ze=document.createElement("span");ze.setAttribute("id",e+"_element_labelform_id_temp"),ze.innerHTML=t,ze.setAttribute("class","label"),ze.style.verticalAlign="top";var qe=document.createElement("span");qe.setAttribute("id",e+"_required_elementform_id_temp"),qe.innerHTML="",qe.setAttribute("class","required"),qe.style.verticalAlign="top","yes"==r&&(qe.innerHTML=" *");var He=document.getElementById("show_table");Me.appendChild(ze),Me.appendChild(qe),Le.appendChild(ke),Le.appendChild(Ie),Le.appendChild(Ce),Le.appendChild(Be),Te.appendChild(Me),Te.appendChild(Le),Qe.appendChild(Te),He.appendChild(Qe),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function type_wdeditor(e,t,i,a,l,d,_,r,o,m,s){document.getElementById("element_type").value="type_wdeditor",delete_last_child();var u=document.createElement("div");u.setAttribute("id","edit_div");var c=document.createElement("table");c.setAttribute("id","edit_main_table"),c.setAttribute("cellpadding","3"),c.setAttribute("cellspacing","0");var p=document.createElement("tr"),f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("td"),A=document.createElement("td"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td");C.style.cssText="padding-top:10px";var B=document.createElement("td"),Q=document.createElement("td");Q.style.cssText="padding-top:10px";var T=document.createElement("td"),M=document.createElement("td");M.style.cssText="padding-top:10px";var L=document.createElement("td"),z=document.createElement("td");z.style.cssText="padding-top:10px";var q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("label");D.setAttribute("class","fm-field-label"),D.setAttribute("for","edit_for_label"),D.innerHTML="Field label";var P=document.createElement("textarea");P.setAttribute("id","edit_for_label"),P.setAttribute("rows","4"),P.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),P.innerHTML=t;var O=document.createElement("label");O.setAttribute("class","fm-field-label"),O.setAttribute("for","edit_for_label_size"),O.innerHTML="Field label size(px) ";var K=document.createElement("input");K.setAttribute("id","edit_for_label_size"),K.setAttribute("type","text"),K.setAttribute("value",i),K.setAttribute("onKeyPress","return check_isnum(event)"),K.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var U=document.createElement("label");U.setAttribute("class","fm-field-label"),U.setAttribute("for","edit_for_label_position_top"),U.innerHTML="Field label position";var F=document.createElement("input");F.setAttribute("id","edit_for_label_position_top"),F.setAttribute("type","radio"),F.setAttribute("value","left"),F.setAttribute("name","edit_for_label_position"),F.setAttribute("onchange","label_left("+e+")"),Left=document.createTextNode("Left");var R=document.createElement("input");R.setAttribute("id","edit_for_label_position_left"),R.setAttribute("type","radio"),R.setAttribute("value","top"),R.setAttribute("name","edit_for_label_position"),R.setAttribute("onchange","label_top("+e+")"),Top=document.createTextNode("Top"),"top"==a?R.setAttribute("checked","checked"):F.setAttribute("checked","checked");var W=document.createElement("label");W.style.cssText="color:#000; font-weight:bold; font-size: 13px",W.innerHTML="Field size(px) ";var V=document.createElement("input");V.setAttribute("id","edit_for_input_size"),V.setAttribute("type","text"),V.setAttribute("value",l),V.style.cssText="margin-right:2px; width: 60px",V.setAttribute("name","edit_for_size"),V.setAttribute("onKeyPress","return check_isnum(event)"),V.setAttribute("onKeyUp","change_w_style('"+e+"_elementform_id_temp', this.value)"),X=document.createTextNode("x");var $=document.createElement("input");$.setAttribute("id","edit_for_input_size"),$.setAttribute("type","text"),$.setAttribute("value",d),$.style.cssText="margin-left:2px; width:60px",$.setAttribute("name","edit_for_size"),$.setAttribute("onKeyPress","return check_isnum(event)"),$.setAttribute("onKeyUp","change_h_style('"+e+"_elementform_id_temp', this.value)");var G=document.createElement("label");G.style.cssText="color:#000; font-weight:bold; font-size: 13px",G.innerHTML="Placeholder";var Y=document.createElement("input");Y.setAttribute("id","el_first_value_input"),Y.setAttribute("type","text"),Y.setAttribute("value",_),Y.setAttribute("onKeyUp","change_input_value(this.value,'"+e+"_elementform_id_temp')");var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","el_send"),Z.innerHTML="Required";var J=document.createElement("input");J.setAttribute("id","el_send"),J.setAttribute("type","checkbox"),J.setAttribute("value","yes"),J.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==r&&J.setAttribute("checked","checked");var ee=document.createElement("label");ee.setAttribute("class","fm-field-label"),ee.setAttribute("for","element_style"),ee.innerHTML="Class name";var te=document.createElement("input");te.setAttribute("id","element_style"),te.setAttribute("type","text"),te.setAttribute("value",o),te.setAttribute("onChange","change_class(this.value,'"+e+"')");var ie=document.createElement("label");ie.setAttribute("class","fm-field-label"),ie.setAttribute("for","el_choices_add"),ie.innerHTML="Additional Attributes";var ae=document.createElement("img");ae.setAttribute("id","el_choices_add"),ae.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),ae.style.cssText="cursor:pointer; margin-left:68px",ae.setAttribute("title","add"),ae.setAttribute("onClick","add_attr("+e+", 'type_text')");var ne=document.createElement("table");ne.setAttribute("id","attributes"),ne.setAttribute("border","0"),ne.style.cssText="margin-left:0px";var le=document.createElement("tr");le.setAttribute("idi","0");var de=document.createElement("th");de.style.cssText="width:100px";var _e=document.createElement("th");_e.style.cssText="width:100px";var re=document.createElement("th");re.style.cssText="width:10px";var oe=document.createElement("label");oe.style.cssText="color:#000; font-weight:bold; font-size: 11px",oe.innerHTML="Name";var me=document.createElement("label");for(me.style.cssText="color:#000; font-weight:bold; font-size: 11px",me.innerHTML="Value",ne.appendChild(le),le.appendChild(de),le.appendChild(_e),le.appendChild(re),de.appendChild(oe),_e.appendChild(me),n=m.length,j=1;j<=n;j++){var se=document.createElement("tr");se.setAttribute("id","attr_row_"+j),se.setAttribute("idi",j);var ue=document.createElement("td");ue.style.cssText="width:100px";var ce=document.createElement("td");ce.style.cssText="width:100px";var pe=document.createElement("td"),fe=document.createElement("input");fe.setAttribute("type","text"),fe.setAttribute("class","fm-field-choice"),fe.setAttribute("value",m[j-1]),fe.setAttribute("id","attr_name"+j),fe.setAttribute("onChange","change_attribute_name("+e+", this, 'type_text')");var ye=document.createElement("input");ye.setAttribute("type","text"),ye.setAttribute("class","fm-field-choice"),ye.setAttribute("value",s[j-1]),ye.setAttribute("id","attr_value"+j),ye.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_text')");var he=document.createElement("img");he.setAttribute("id","el_choices"+j+"_remove"),he.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),he.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",he.setAttribute("align","top"),he.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_text')"),ne.appendChild(se),se.appendChild(ue),se.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),ce.appendChild(ye),pe.appendChild(he)}var be=document.getElementById("edit_table"),ve=document.createElement("br"),we=(document.createElement("br"),document.createElement("br"),document.createElement("br")),ge=(document.createElement("br"),document.createElement("br"),document.createElement("br"));E.appendChild(D),A.appendChild(P),N.appendChild(O),S.appendChild(K),x.appendChild(U),k.appendChild(F),k.appendChild(el_label_left),k.appendChild(ve),k.appendChild(R),k.appendChild(el_label_top),I.appendChild(W),C.appendChild(V),C.appendChild(X),C.appendChild($),B.appendChild(G),Q.appendChild(Y),T.appendChild(ee),M.appendChild(te),L.appendChild(Z),z.appendChild(J),q.appendChild(ie),q.appendChild(ae),q.appendChild(ge),q.appendChild(ne),q.setAttribute("colspan","2"),p.appendChild(E),p.appendChild(A),g.appendChild(N),g.appendChild(S),f.appendChild(x),f.appendChild(k),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),c.appendChild(p),c.appendChild(g),c.appendChild(f),c.appendChild(y),c.appendChild(h),c.appendChild(b),c.appendChild(v),c.appendChild(w),u.appendChild(c),be.appendChild(u),add_id_and_name(e,"type_text"),element="editor";var Ee=document.createElement("input");Ee.setAttribute("type","hidden"),Ee.setAttribute("value","type_wdeditor"),Ee.setAttribute("name",e+"_typeform_id_temp"),Ee.setAttribute("id",e+"_typeform_id_temp");var Ae=document.createElement("input");Ae.setAttribute("type","hidden"),Ae.setAttribute("value",r),Ae.setAttribute("name",e+"_requiredform_id_temp"),Ae.setAttribute("id",e+"_requiredform_id_temp");var je=document.createElement("div");je.setAttribute("id","main_div");var xe=document.createElement("div");xe.setAttribute("id",e+"_elemet_tableform_id_temp");var ke=document.createElement("div");ke.setAttribute("align","left"),ke.style.display="table-cell",ke.style.width=i+"px",ke.setAttribute("id",e+"_label_sectionform_id_temp");var Ie=document.createElement("div");Ie.setAttribute("align","left"),Ie.style.display="table-cell",Ie.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br"),we=document.createElement("br"),document.createElement("br");var Ce=document.createElement("span");Ce.setAttribute("id",e+"_element_labelform_id_temp"),Ce.innerHTML=t,Ce.setAttribute("class","label");var Be=document.createElement("span");Be.setAttribute("id",e+"_required_elementform_id_temp"),Be.innerHTML="",Be.setAttribute("class","required"),"yes"==r&&(Be.innerHTML=" *");var Qe=document.createElement("input");Qe.setAttribute("id",e+"_elementform_id_temp"),Qe.setAttribute("name",e+"_elementform_id_temp"),Qe.setAttribute("type","hidden"),Qe.style.width=l+"px",Qe.style.height=d+"px",Qe.setAttribute("title",_);var Te=document.createElement("span");Te.style.color="red",Te.style.fontStyle="italic",Te.innerHTML="Editor doesn't display in back end",Left=document.createTextNode(e+"_editorform_id_temp");var Me=document.createElement("div");Me.style.display="none";var Le=document.getElementById("show_table");ke.appendChild(Ce),ke.appendChild(Be),Ie.appendChild(Ee),Ie.appendChild(Ae),Ie.appendChild(Qe),Ie.appendChild(Te),Me.appendChild(Left),Ie.appendChild(Me),xe.appendChild(ke),xe.appendChild(Ie),je.appendChild(xe),je.appendChild(we),Le.appendChild(je),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_text")}function change_input_range(e,t){var i="";""!=document.getElementById("el_range_"+e+"1").value&&(i=document.getElementById("el_range_"+e+"1").value),""!=document.getElementById("el_range_"+e+"2").value&&(""==document.getElementById("el_range_"+e+"1").value&&(i="0"),i=i+"."+document.getElementById("el_range_"+e+"2").value),document.getElementById(t+"_range_"+e+"form_id_temp").value=i}function explode(e,t){return 2!=arguments.length||void 0===e||void 0===t?null:""!==e&&!1!==e&&null!==e&&("function"==typeof e||"object"==typeof e||"function"==typeof t||"object"==typeof t?{0:""}:(!0===e&&(e="1"),t.toString().split(e.toString())))}function type_paypal_price(t,e,i,a,l,d,_,r,o,m,s,u,c,p,f){document.getElementById("element_type").value="type_paypal_price",delete_last_child();var y=document.createElement("div");y.setAttribute("id","edit_div");var h=document.createElement("table");h.setAttribute("id","edit_main_table"),h.setAttribute("cellpadding","3"),h.setAttribute("cellspacing","0");var b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("tr"),k=document.createElement("tr"),I=document.createElement("tr"),C=document.createElement("tr"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td");z.style.cssText="line-height:20px";var q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("td"),U=document.createElement("td"),F=document.createElement("td"),R=document.createElement("td"),W=document.createElement("td"),V=document.createElement("td"),$=document.createElement("td"),G=document.createElement("label");G.setAttribute("class","fm-field-label"),G.setAttribute("for","edit_for_label"),G.innerHTML="Field label";var Y=document.createElement("textarea");Y.setAttribute("id","edit_for_label"),Y.setAttribute("rows","4"),Y.setAttribute("onKeyUp","change_label('"+t+"_element_labelform_id_temp', this.value)"),Y.innerHTML=e;var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","edit_for_label_size"),Z.innerHTML="Field label size(px) ";var X=document.createElement("input");X.setAttribute("id","edit_for_label_size"),X.setAttribute("type","text"),X.setAttribute("value",i),X.setAttribute("onKeyPress","return check_isnum(event)"),X.setAttribute("onKeyUp","change_w_style('"+t+"_label_sectionform_id_temp', this.value)");var J=document.createElement("label");J.setAttribute("class","fm-field-label"),J.innerHTML="Field label position";var ee=document.createElement("input");ee.setAttribute("id","edit_for_label_position_top"),ee.setAttribute("type","radio"),ee.setAttribute("name","edit_for_label_position"),ee.setAttribute("onchange","label_left("+t+")");var te=document.createElement("label");te.setAttribute("for","edit_for_label_position_top"),te.innerHTML="Left";var ie=document.createElement("input");ie.setAttribute("id","edit_for_label_position_left"),ie.setAttribute("type","radio"),ie.setAttribute("name","edit_for_label_position"),ie.setAttribute("onchange","label_top("+t+")");var ae=document.createElement("label");ae.setAttribute("for","edit_for_label_position_left"),ae.innerHTML="Top","top"==a?ie.setAttribute("checked","checked"):ee.setAttribute("checked","checked"),w_range_minarray=explode(".",p),w_range_maxarray=explode(".",f);var ne=document.createElement("label");ne.setAttribute("class","fm-field-label"),ne.innerHTML="Range ";var le=document.createTextNode("Min"),de=document.createElement("input");de.setAttribute("type","text"),de.setAttribute("id","el_range_min1"),w_range_minarray[0]&&de.setAttribute("value",w_range_minarray[0]),de.style.cssText="width:60px; margin-right:4px;margin-left:8px",de.setAttribute("onKeyPress","return check_isnum(event)"),de.setAttribute("onChange","change_input_range('min', '"+t+"')");var _e=document.createTextNode("."),re=document.createElement("input");re.setAttribute("type","text"),re.setAttribute("id","el_range_min2"),w_range_minarray[1]&&re.setAttribute("value",w_range_minarray[1]),re.style.cssText="width:30px; margin-left:4px",re.setAttribute("onKeyPress","return check_isnum(event)"),re.setAttribute("onChange","change_input_range('min', '"+t+"')");var oe=document.createTextNode("Max"),me=document.createElement("input");me.setAttribute("type","text"),me.setAttribute("id","el_range_max1"),w_range_maxarray[0]&&me.setAttribute("value",w_range_maxarray[0]),me.style.cssText="width:60px; margin-right:4px; margin-left:7px",me.setAttribute("onKeyPress","return check_isnum(event)"),me.setAttribute("onChange","change_input_range('max', '"+t+"')");var se=document.createTextNode("."),ue=document.createElement("input");ue.setAttribute("type","text"),ue.setAttribute("id","el_range_max2"),w_range_maxarray[1]&&ue.setAttribute("value",w_range_maxarray[1]),ue.style.cssText="width:30px; margin-left:4px",ue.setAttribute("onKeyPress","return check_isnum(event)"),ue.setAttribute("onChange","change_input_range('max', '"+t+"')");var ce=document.createTextNode("-"),pe=document.createElement("label");pe.setAttribute("class","fm-field-label"),pe.setAttribute("for","el_first_value_first"),pe.innerHTML="Placeholder ";var fe=document.createElement("input");fe.setAttribute("id","el_first_value_first"),fe.setAttribute("type","text"),fe.setAttribute("value",d[0]),fe.style.cssText="width:120px; margin-right:4px",fe.setAttribute("onKeyPress","return check_isnum(event)"),fe.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_dollarsform_id_temp')");var ye=document.createElement("input");ye.setAttribute("id","el_first_value_last"),ye.setAttribute("type","text"),ye.setAttribute("value",d[1]),ye.style.cssText="width:67px; margin-left:4px; margin-right:4px",ye.setAttribute("onKeyPress","return check_isnum_interval(event,'"+t+"_element_centsform_id_temp',0,99)"),ye.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_centsform_id_temp')");var he=document.createElement("label");he.setAttribute("class","fm-field-label"),he.setAttribute("for","edit_for_input_size"),he.innerHTML="Field size(px) ";var be=document.createElement("input");be.setAttribute("id","edit_for_input_size"),be.setAttribute("type","text"),be.setAttribute("value",r),be.setAttribute("onKeyPress","return check_isnum(event)"),be.setAttribute("onKeyUp","change_w_style('"+t+"_element_dollarsform_id_temp', this.value);");var ve=document.createElement("label");ve.setAttribute("class","fm-field-label"),ve.setAttribute("for","el_required"),ve.innerHTML="Required";var we=document.createElement("input");we.setAttribute("id","el_required"),we.setAttribute("type","checkbox"),we.setAttribute("onclick","set_required('"+t+"_required')"),"yes"==o&&we.setAttribute("checked","checked");var ge=document.createElement("label");ge.setAttribute("class","fm-field-label"),ge.setAttribute("for","el_hide_cents"),ge.innerHTML="Hide Cents";var Ee=document.createElement("input");Ee.setAttribute("id","el_hide_cents"),Ee.setAttribute("type","checkbox"),Ee.setAttribute("onclick","hide_show_cents(this.checked, "+t+")"),"yes"==m&&Ee.setAttribute("checked","checked");var Ae=document.createElement("label");Ae.setAttribute("class","fm-field-label"),Ae.setAttribute("for","el_style_textarea"),Ae.innerHTML="Class name";var je=document.createElement("input");je.setAttribute("id","el_style_textarea"),je.setAttribute("type","text"),je.setAttribute("value",s),je.setAttribute("onChange","change_class(this.value,'"+t+"')");var xe=document.createElement("label");xe.setAttribute("class","fm-field-label"),xe.innerHTML="Additional Attributes";var ke=document.createElement("img");ke.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),ke.style.cssText="cursor:pointer; margin-left:68px",ke.setAttribute("title","add"),ke.setAttribute("onClick","add_attr("+t+", 'type_paypal_price')");var Ie=document.createElement("table");Ie.setAttribute("id","attributes"),Ie.setAttribute("border","0"),Ie.style.cssText="margin-left:0px";var Ce=document.createElement("tr");Ce.setAttribute("idi","0");var Be=document.createElement("th");Be.style.cssText="width:100px";var Qe=document.createElement("th");Qe.style.cssText="width:100px";var Te=document.createElement("th");Te.style.cssText="width:10px";var Me=document.createElement("label");Me.style.cssText="color:#000; font-weight:bold; font-size: 11px",Me.innerHTML="Name";var Le=document.createElement("label");for(Le.style.cssText="color:#000; font-weight:bold; font-size: 11px",Le.innerHTML="Value",Ie.appendChild(Ce),Ce.appendChild(Be),Ce.appendChild(Qe),Ce.appendChild(Te),Be.appendChild(Me),Qe.appendChild(Le),n=u.length,j=1;j<=n;j++){var ze=document.createElement("tr");ze.setAttribute("id","attr_row_"+j),ze.setAttribute("idi",j);var qe=document.createElement("td");qe.style.cssText="width:100px";var He=document.createElement("td");He.style.cssText="width:100px";var Ne=document.createElement("td"),Se=document.createElement("input");Se.setAttribute("type","text"),Se.setAttribute("class","fm-field-choice"),Se.setAttribute("value",u[j-1]),Se.setAttribute("id","attr_name"+j),Se.setAttribute("onChange","change_attribute_name("+t+", this, 'type_paypal_price')");var De=document.createElement("input");De.setAttribute("type","text"),De.setAttribute("class","fm-field-choice"),De.setAttribute("value",c[j-1]),De.setAttribute("id","attr_value"+j),De.setAttribute("onChange","change_attribute_value("+t+", "+j+", 'type_paypal_price')");var Pe=document.createElement("img");Pe.setAttribute("id","el_choices"+j+"_remove"),Pe.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Pe.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Pe.setAttribute("onClick","remove_attr("+j+", "+t+", 'type_paypal_price')"),Ie.appendChild(ze),ze.appendChild(qe),ze.appendChild(He),ze.appendChild(Ne),qe.appendChild(Se),He.appendChild(De),Ne.appendChild(Pe)}var Oe=document.getElementById("edit_table"),Ke=document.createElement("br"),Ue=document.createElement("br"),Fe=(document.createElement("br"),document.createElement("br"));document.createElement("br"),document.createElement("br"),document.createElement("br");B.appendChild(G),Q.appendChild(Y),V.appendChild(Z),$.appendChild(X),T.appendChild(J),M.appendChild(ee),M.appendChild(te),M.appendChild(Ke),M.appendChild(ie),M.appendChild(ae),L.appendChild(ne),z.appendChild(le),z.appendChild(de),z.appendChild(_e),z.appendChild(re),z.appendChild(Ue),z.appendChild(oe),z.appendChild(me),z.appendChild(se),z.appendChild(ue),R.appendChild(pe),W.appendChild(fe),W.appendChild(ce),W.appendChild(ye),O.appendChild(he),K.appendChild(be),q.appendChild(Ae),H.appendChild(je),N.appendChild(ve),S.appendChild(we),U.appendChild(ge),F.appendChild(Ee),D.appendChild(xe),D.appendChild(ke),D.appendChild(Fe),D.appendChild(Ie),D.setAttribute("colspan","2"),b.appendChild(B),b.appendChild(Q),C.appendChild(V),C.appendChild($),v.appendChild(T),v.appendChild(M),w.appendChild(L),w.appendChild(z),x.appendChild(O),x.appendChild(K),g.appendChild(q),g.appendChild(H),E.appendChild(N),E.appendChild(S),A.appendChild(D),A.appendChild(P),k.appendChild(U),k.appendChild(F),I.appendChild(R),I.appendChild(W),h.appendChild(b),h.appendChild(C),h.appendChild(v),h.appendChild(w),h.appendChild(I),h.appendChild(x),h.appendChild(g),h.appendChild(E),h.appendChild(k),h.appendChild(A),y.appendChild(h),Oe.appendChild(y),add_id_and_name(t,"type_name");var Re=document.createElement("input");Re.setAttribute("type","hidden"),Re.setAttribute("value","type_paypal_price"),Re.setAttribute("name",t+"_typeform_id_temp"),Re.setAttribute("id",t+"_typeform_id_temp");var We=document.createElement("input");We.setAttribute("type","hidden"),We.setAttribute("value",o),We.setAttribute("name",t+"_requiredform_id_temp"),We.setAttribute("id",t+"_requiredform_id_temp");var Ve=document.createElement("input");Ve.setAttribute("type","hidden"),Ve.setAttribute("value",p),Ve.setAttribute("name",t+"_range_minform_id_temp"),Ve.setAttribute("id",t+"_range_minform_id_temp");var $e=document.createElement("input");$e.setAttribute("type","hidden"),$e.setAttribute("value",f),$e.setAttribute("name",t+"_range_maxform_id_temp"),$e.setAttribute("id",t+"_range_maxform_id_temp");var Ge=document.createElement("div");Ge.setAttribute("id","main_div");var Ye=document.createElement("div");Ye.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),Ye.appendChild(edit_labels);var Ze=document.createElement("div");Ze.setAttribute("id",t+"_elemet_tableform_id_temp");var Xe=document.createElement("div");Xe.setAttribute("align","left"),Xe.style.display="table-cell",Xe.style.width=i+"px",Xe.setAttribute("id",t+"_label_sectionform_id_temp");var Je=document.createElement("div");Je.setAttribute("align","left"),Je.style.display="table-cell",Je.setAttribute("id",t+"_element_sectionform_id_temp");var et=document.createElement("div");et.setAttribute("id",t+"_table_price"),et.style.display="table";var tt=document.createElement("div");tt.setAttribute("id",t+"_tr_price1"),tt.style.display="table-row";var it=document.createElement("div");it.setAttribute("id",t+"_tr_price2"),it.style.display="table-row";var at=document.createElement("div");at.setAttribute("id",t+"_td_name_currency"),at.style.display="table-cell";var nt=document.createElement("div");nt.setAttribute("id",t+"_td_name_dollars"),nt.style.display="table-cell";var lt=document.createElement("div");lt.setAttribute("id",t+"_td_name_divider"),lt.style.display="table-cell";var dt=document.createElement("div");dt.setAttribute("id",t+"_td_name_cents"),dt.style.display="table-cell";var _t=document.createElement("div");_t.style.display="table-cell";var rt=document.createElement("div");rt.setAttribute("align","left"),rt.style.display="table-cell";var ot=document.createElement("div");ot.setAttribute("id",t+"_td_name_label_divider"),ot.style.display="table-cell";var mt=document.createElement("div");mt.setAttribute("align","left"),mt.setAttribute("id",t+"_td_name_label_cents"),mt.style.display="table-cell";var st=document.createElement("span");st.setAttribute("id",t+"_element_labelform_id_temp"),st.innerHTML=e,st.setAttribute("class","label"),st.style.verticalAlign="top";var ut=document.createElement("span");ut.setAttribute("id",t+"_required_elementform_id_temp"),ut.innerHTML="",ut.setAttribute("class","required"),ut.style.verticalAlign="top","yes"==o&&(ut.innerHTML=" *");var ct=document.createElement("span");ct.setAttribute("class","wdform_colon"),ct.style.cssText="font-style:bold; vertical-align:middle",ct.innerHTML="\x3c!--repstart--\x3e&nbsp;$&nbsp;\x3c!--repend--\x3e";var pt=document.createElement("label");pt.setAttribute("class","mini_label");var ft=document.createElement("input");ft.setAttribute("type","text"),ft.style.cssText="width:"+r+"px",ft.setAttribute("id",t+"_element_dollarsform_id_temp"),ft.setAttribute("name",t+"_element_dollarsform_id_temp"),ft.setAttribute("value",l[0]),ft.setAttribute("title",d[0]),ft.setAttribute("onKeyPress","return check_isnum(event)");var yt=document.createElement("label");yt.setAttribute("class","mini_label"),yt.setAttribute("id",t+"_mini_label_dollars"),yt.innerHTML=_[0];var ht=document.createElement("span");ht.setAttribute("class","wdform_colon"),ht.style.cssText="font-style:bold; vertical-align:middle",ht.innerHTML="&nbsp;.&nbsp;";var bt=document.createElement("label");bt.setAttribute("class","mini_label");var vt=document.createElement("input");vt.setAttribute("type","text"),vt.style.cssText="width:30px",vt.setAttribute("id",t+"_element_centsform_id_temp"),vt.setAttribute("name",t+"_element_centsform_id_temp"),vt.setAttribute("value",l[1]),vt.setAttribute("title",d[1]),vt.setAttribute("onBlur",'add_0("'+t+'_element_centsform_id_temp")'),vt.setAttribute("onKeyPress","return check_isnum_interval(event,'"+t+"_element_centsform_id_temp',0,99)");var wt=document.createElement("label");wt.setAttribute("class","mini_label"),wt.setAttribute("id",t+"_mini_label_cents"),wt.innerHTML=_[1];var gt=document.getElementById("show_table");Xe.appendChild(st),Xe.appendChild(ut),at.appendChild(ct),nt.appendChild(ft),lt.appendChild(ht),dt.appendChild(vt),tt.appendChild(at),tt.appendChild(nt),tt.appendChild(lt),tt.appendChild(dt),_t.appendChild(pt),rt.appendChild(yt),ot.appendChild(bt),mt.appendChild(wt),it.appendChild(_t),it.appendChild(rt),it.appendChild(ot),it.appendChild(mt),et.appendChild(tt),et.appendChild(it),Je.appendChild(Re),Je.appendChild(We),Je.appendChild(Ve),Je.appendChild($e),Je.appendChild(et),Ze.appendChild(Xe),Ze.appendChild(Je),Ge.appendChild(Ze),Ge.appendChild(Fe),Ge.appendChild(Ye),gt.appendChild(Ge),"top"==a&&label_top(t),"yes"==m&&hide_show_cents(!0,t),change_class(s,t),refresh_attr(t,"type_paypal_price"),jQuery(function(){jQuery("label#"+t+"_mini_label_dollars").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery(e).focus(),jQuery("input.dollars").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_dollars").text(e)})}}),jQuery("label#"+t+"_mini_label_cents").on("click",function(){if(0==jQuery(this).children("input").length){var e="<input type='text' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+'">';jQuery(this).html(e),jQuery("input.cents").focus(),jQuery("input.cents").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_cents").text(e)})}})})}function hide_show_cents(e,t){td_divider=document.getElementById(t+"_td_name_divider"),td_cents=document.getElementById(t+"_td_name_cents"),td_divider_label=document.getElementById(t+"_td_name_label_divider"),td_cents_label=document.getElementById(t+"_td_name_label_cents"),change_input_value("",t+"_element_centsform_id_temp"),document.getElementById("el_first_value_last").value="",document.getElementById(t+"_element_centsform_id_temp").value="",td_cents_label.style.display=e?(td_divider.style.display="none",td_cents.style.display="none",td_divider_label.style.display="none"):(td_divider.style.display="table-cell",td_cents.style.display="table-cell",td_divider_label.style.display="table-cell")}function type_date(e,t,i,a,l,d,_,r,o,m,s,u){document.getElementById("element_type").value="type_date",delete_last_child();var c=document.createElement("div");c.setAttribute("id","edit_div");var p=document.createElement("table");p.setAttribute("id","edit_main_table"),p.setAttribute("cellpadding","3"),p.setAttribute("cellspacing","0");var f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr");b.style.cssText="display:none;";var v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td"),q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("td"),U=document.createElement("label");U.setAttribute("for","edit_for_label"),U.setAttribute("class","fm-field-label"),U.innerHTML="Field label";var F=document.createElement("textarea");F.setAttribute("id","edit_for_label"),F.setAttribute("rows","4"),F.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),F.innerHTML=t;var R=document.createElement("label");R.setAttribute("class","fm-field-label"),R.setAttribute("for","edit_for_label_size"),R.innerHTML="Field label size(px) ";var W=document.createElement("input");W.setAttribute("id","edit_for_label_size"),W.setAttribute("type","text"),W.setAttribute("value",i),W.setAttribute("onKeyPress","return check_isnum(event)"),W.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var V=document.createElement("label");V.setAttribute("class","fm-field-label"),V.innerHTML="Field label position";var $=document.createElement("input");$.setAttribute("id","edit_for_label_position_top"),$.setAttribute("type","radio"),$.setAttribute("name","edit_for_label_position"),$.setAttribute("onchange","label_left("+e+")");var G=document.createElement("label");G.setAttribute("for","edit_for_label_position_top"),G.innerHTML="Left";var Y=document.createElement("input");Y.setAttribute("id","edit_for_label_position_left"),Y.setAttribute("type","radio"),Y.setAttribute("name","edit_for_label_position"),Y.setAttribute("onchange","label_top("+e+")");var Z=document.createElement("label");Z.setAttribute("for","edit_for_label_position_left"),Z.innerHTML="Top","top"==a?Y.setAttribute("checked","checked"):$.setAttribute("checked","checked");var X=document.createElement("label");X.setAttribute("class","fm-field-label"),X.setAttribute("for","date_format"),X.innerHTML="Date format";var J=document.createElement("input");J.setAttribute("id","date_format"),J.setAttribute("type","text"),J.setAttribute("value",r),J.setAttribute("onChange","change_date_format(this.value,'"+e+"', 'format')");var ee=document.createElement("label");ee.setAttribute("class","fm-field-label"),ee.setAttribute("for","button_value"),ee.innerHTML="Date Picker label";var te=document.createElement("input");te.setAttribute("id","button_value"),te.setAttribute("type","text"),te.setAttribute("value",o),te.style.cssText="width:150px;",te.setAttribute("onKeyUp","change_file_value(this.value,'"+e+"_buttonform_id_temp')");var ie=document.createElement("label");ie.setAttribute("class","fm-field-label"),ie.setAttribute("for","el_disable_past_days"),ie.innerHTML="Allow selecting dates starting from current day";var ae=document.createElement("input");ae.setAttribute("id","el_disable_past_days"),ae.setAttribute("type","checkbox"),ae.setAttribute("onclick","change_date_format(this.checked, '"+e+"', 'dis_days')"),"yes"==u&&ae.setAttribute("checked","checked");var ne=document.createElement("label");ne.setAttribute("class","fm-field-label"),ne.setAttribute("for","el_style_textarea"),ne.innerHTML="Class name";var le=document.createElement("input");le.setAttribute("id","el_style_textarea"),le.setAttribute("type","text"),le.setAttribute("value",_),le.setAttribute("onChange","change_class(this.value,'"+e+"')");var de=document.createElement("label");de.setAttribute("class","fm-field-label"),de.setAttribute("for","el_required"),de.innerHTML="Required";var _e=document.createElement("input");_e.setAttribute("id","el_required"),_e.setAttribute("type","checkbox"),_e.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==d&&_e.setAttribute("checked","checked");var re=document.createElement("label");re.setAttribute("class","fm-field-label"),re.innerHTML="Additional Attributes";var oe=document.createElement("img");oe.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),oe.style.cssText="cursor:pointer; margin-left:68px",oe.setAttribute("title","add"),oe.setAttribute("onClick","add_attr("+e+", 'type_date')");var me=document.createElement("table");me.setAttribute("id","attributes"),me.setAttribute("border","0"),me.style.cssText="margin-left:0px";var se=document.createElement("tr");se.setAttribute("idi","0");var ue=document.createElement("th");ue.style.cssText="width:100px";var ce=document.createElement("th");ce.style.cssText="width:100px";var pe=document.createElement("th");pe.style.cssText="width:10px";var fe=document.createElement("label");fe.style.cssText="color:#000; font-weight:bold; font-size: 11px",fe.innerHTML="Name";var ye=document.createElement("label");for(ye.style.cssText="color:#000; font-weight:bold; font-size: 11px",ye.innerHTML="Value",me.appendChild(se),se.appendChild(ue),se.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),ce.appendChild(ye),n=m.length,j=1;j<=n;j++){var he=document.createElement("tr");he.setAttribute("id","attr_row_"+j),he.setAttribute("idi",j);var be=document.createElement("td");be.style.cssText="width:100px";var ve=document.createElement("td");ve.style.cssText="width:100px";var we=document.createElement("td"),ge=document.createElement("input");ge.setAttribute("type","text"),ge.setAttribute("class","fm-field-choice"),ge.setAttribute("value",m[j-1]),ge.setAttribute("id","attr_name"+j),ge.setAttribute("onChange","change_attribute_name("+e+", this, 'type_date')");var Ee=document.createElement("input");Ee.setAttribute("type","text"),Ee.setAttribute("class","fm-field-choice"),Ee.setAttribute("value",s[j-1]),Ee.setAttribute("id","attr_value"+j),Ee.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_date')");var Ae=document.createElement("img");Ae.setAttribute("id","el_choices"+j+"_remove"),Ae.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Ae.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Ae.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_date')"),me.appendChild(he),he.appendChild(be),he.appendChild(ve),he.appendChild(we),be.appendChild(ge),ve.appendChild(Ee),we.appendChild(Ae)}var je=document.getElementById("edit_table"),xe=document.createElement("br"),ke=document.createElement("br");x.appendChild(U),k.appendChild(F),D.appendChild(R),P.appendChild(W),I.appendChild(V),C.appendChild($),C.appendChild(G),C.appendChild(xe),C.appendChild(Y),C.appendChild(Z),B.appendChild(X),Q.appendChild(J),T.appendChild(ee),M.appendChild(te),O.appendChild(ie),K.appendChild(ae),L.appendChild(ne),z.appendChild(le),q.appendChild(de),H.appendChild(_e),N.appendChild(re),N.appendChild(oe),N.appendChild(ke),N.appendChild(me),N.setAttribute("colspan","2"),f.appendChild(x),f.appendChild(k),E.appendChild(D),E.appendChild(P),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),A.appendChild(O),A.appendChild(K),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),g.appendChild(N),g.appendChild(S),p.appendChild(f),p.appendChild(E),p.appendChild(y),p.appendChild(h),p.appendChild(b),p.appendChild(A),p.appendChild(v),p.appendChild(w),p.appendChild(g),c.appendChild(p),je.appendChild(c),add_id_and_name(e,"type_text");var Ie=document.createElement("input");Ie.setAttribute("type","hidden"),Ie.setAttribute("value","type_date"),Ie.setAttribute("name",e+"_typeform_id_temp"),Ie.setAttribute("id",e+"_typeform_id_temp");var Ce=document.createElement("input");Ce.setAttribute("type","hidden"),Ce.setAttribute("value",d),Ce.setAttribute("name",e+"_requiredform_id_temp"),Ce.setAttribute("id",e+"_requiredform_id_temp");var Be=document.createElement("input");Be.setAttribute("type","hidden"),Be.setAttribute("value",u),Be.setAttribute("id",e+"_dis_past_daysform_id_temp"),Be.setAttribute("name",e+"_dis_past_daysform_id_temp");var Qe=document.createElement("div");Qe.setAttribute("id","main_div");var Te=document.createElement("div");Te.setAttribute("id",e+"_elemet_tableform_id_temp");var Me=document.createElement("div");Me.setAttribute("align","left"),Me.style.display="table-cell",Me.style.width=i+"px",Me.setAttribute("id",e+"_label_sectionform_id_temp");var Le=document.createElement("div");Le.setAttribute("align","left"),Le.style.display="table-cell",Le.setAttribute("id",e+"_element_sectionform_id_temp");var ze=document.createElement("div");ze.setAttribute("id",e+"_table_date"),ze.style.display="table";var qe=document.createElement("div");qe.setAttribute("id",e+"_tr_date1"),qe.style.display="table-row";var He=document.createElement("div");He.setAttribute("id",e+"_tr_date2"),He.style.display="table-row";var Ne=document.createElement("div");Ne.setAttribute("id",e+"_td_date_input1"),Ne.style.display="table-cell";var Se=document.createElement("div");Se.setAttribute("id",e+"_td_date_input2"),Se.style.display="table-cell";var De=document.createElement("div");De.setAttribute("id",e+"_td_date_input3"),De.style.display="table-cell";var Pe=document.createElement("div");Pe.setAttribute("id",e+"_td_date_label1"),Pe.style.display="table-cell";var Oe=document.createElement("div");Oe.setAttribute("id",e+"_td_date_label2"),Oe.style.display="table-cell";var Ke=document.createElement("div");Ke.setAttribute("id",e+"_td_date_label3"),Ke.style.display="table-cell";var Ue=document.createElement("br"),Fe=(document.createElement("br"),document.createElement("span"));Fe.setAttribute("id",e+"_element_labelform_id_temp"),Fe.innerHTML=t,Fe.setAttribute("class","label"),Fe.style.verticalAlign="top";var Re=document.createElement("span");Re.setAttribute("id",e+"_required_elementform_id_temp"),Re.innerHTML="",Re.setAttribute("class","required"),Re.style.verticalAlign="top","yes"==d&&(Re.innerHTML=" *");var We=document.createElement("input");We.setAttribute("type","text"),We.setAttribute("value",l),We.setAttribute("class","wdform-date"),We.setAttribute("id",e+"_elementform_id_temp"),We.setAttribute("name",e+"_elementform_id_temp"),We.setAttribute("maxlength","10"),We.setAttribute("size","10");var Ve=document.createElement("input");Ve.setAttribute("id",e+"_buttonform_id_temp"),Ve.setAttribute("class","button"),Ve.setAttribute("type","reset"),Ve.setAttribute("value",o),Ve.setAttribute("format",r);var $e=document.getElementById("show_table");Me.appendChild(Fe),Me.appendChild(Re),Le.appendChild(Ie),Le.appendChild(Ce),Le.appendChild(Be),Le.appendChild(We),Le.appendChild(Ve),Te.appendChild(Me),Te.appendChild(Le),Qe.appendChild(Te),Qe.appendChild(Ue),$e.appendChild(Qe),"top"==a&&label_top(e),change_class(_,e),refresh_attr(e,"type_date")}function form_maker_getElementsByAttribute(e,t,i,a){for(var n,l,d="*"==t&&e.all?e.all:e.getElementsByTagName(t),_=new Array,r=void 0!==a?new RegExp("(^|\\s)"+a+"(\\s|$)"):null,o=0;o<d.length;o++)"string"==typeof(n=(l=d[o]).getAttribute&&l.getAttribute(i))&&0<n.length&&(void 0===a||r&&r.test(n))&&_.push(l);return _}function change_element_attribute(e,t,i){"w_readonly"==i||"w_hide_field"==i?"yes"==document.getElementById(t+"_elementform_id_temp").getAttribute(i)?document.getElementById(t+"_elementform_id_temp").setAttribute(i,"no"):document.getElementById(t+"_elementform_id_temp").setAttribute(i,"yes"):document.getElementById(t+"_elementform_id_temp").setAttribute(i,e)}function change_input_style(e){document.getElementById(e+"_elementform_id_temp").getAttribute("readonly")?document.getElementById(e+"_elementform_id_temp").removeAttribute("readonly"):document.getElementById(e+"_elementform_id_temp").setAttribute("readonly","readonly")}function change_src(e,t,i){for(var a=0;a<=e;a++)document.getElementById(t+"_star_"+a).src=plugin_url+"/images/star_"+document.getElementById(t+"_star_colorform_id_temp").value+".png"}function reset_src(e,t){for(var i=0;i<=e;i++)document.getElementById(t+"_star_"+i).src=plugin_url+"/images/star.png"}function select_star_rating(e,t,i){}function change_range_width(e,t,i){document.getElementById(t+"_elementform_id_temp0").style.cssText="width:"+e+"px",document.getElementById(t+"_elementform_id_temp1").style.cssText="width:"+e+"px",document.getElementById(t+"_range_widthform_id_temp").value=e}function go_to_type_paypal_price(e){w_attr_name=[],w_attr_value=[],w_first_val=["",""],w_title=["",""],w_mini_labels=["Dollars","Cents"],type_paypal_price(e,"Amount","100","left",w_first_val,w_title,w_mini_labels,"100","no","no","",w_attr_name,w_attr_value,"","")}function go_to_type_number(e){w_attr_name=[],w_attr_value=[],type_number(e,"Number:","100","left","200","","","no","no","",w_attr_name,w_attr_value)}function go_to_type_wdeditor(e){w_attr_name=[],w_attr_value=[],type_wdeditor(e,"Editor:","100","left","380","200","","no","",w_attr_name,w_attr_value)}function go_to_type_date(e){w_attr_name=[],w_attr_value=[],type_date(e,"Date:","100","left","","no","","%Y-%m-%d","...",w_attr_name,w_attr_value,"no")}function remove_section_break(e){var t=jQuery("#wdform_field"+e).parent(),i=t.next(),a=t.prev();i.find(".wdform_column").each(function(e,t){var i=a.children().eq(e);!i||i.hasClass("wdform_column_empty")?a.find(".wdform_column_empty").before(t):jQuery(t).find(".wdform_row").each(function(e,t){i.append(t)})}),t.remove(),i.remove()}function fm_remove_section(e){var t=jQuery(".fm-row-deleting").first().closest(".wdform_section"),i=t.prev(".wdform_tr_section_break");if(!e){var a=t.prevAll(".wdform_section:first");if(a.length||(a=t.nextAll(".wdform_section:first")),!a.length)return;t.find(".wdform_column").each(function(e,t){a.append(t)})}i.remove(),t.remove()}function remove_row(e){var t=document.getElementById("wdform_field"+e).parentNode;t.parentNode.removeChild(t)}function destroyChildren(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function show_or_hide(e){jQuery("#form_id_tempform_view"+e).is(":visible")?hide_form_view(e):show_form_view(e)}function show_form_view(e){jQuery("#form_id_tempform_view"+e).show()}function hide_form_view(e){jQuery("#form_id_tempform_view"+e).hide()}function generate_buttons(e){var t;form_view_elemet=document.getElementById("form_id_tempform_view"+e),(t=document.createElement("div")).setAttribute("valign","middle"),t.setAttribute("align","left"),t.style.display="inline-block",t.style.width="40%",page_nav.appendChild(t),form_view_elemet.parentNode.previousSibling&&("DIV"==form_view_elemet.parentNode.previousSibling.tagName?table=!0:form_view_elemet.parentNode.previousSibling.previousSibling&&"DIV"==form_view_elemet.parentNode.previousSibling.previousSibling.tagName?table=!0:table=!1,table&&(form_view_elemet.getAttribute("previous_title")?(previous_title=form_view_elemet.getAttribute("previous_title"),previous_type=form_view_elemet.getAttribute("previous_type"),previous_class=form_view_elemet.getAttribute("previous_class")):(previous_title="Previous",previous_type="button",previous_class=""),next_or_previous="previous",previous=make_pagebreak_button(next_or_previous,previous_title,previous_type,previous_class,e),t.appendChild(previous))),(t=document.createElement("div")).setAttribute("id","page_numbersform_id_temp"+e),t.setAttribute("valign","middle"),t.setAttribute("align","center"),t.style.display="inline-block",t.style.width="20%",page_nav.appendChild(t),(t=document.createElement("div")).setAttribute("valign","middle"),t.setAttribute("align","right"),t.style.display="inline-block",t.style.width="40%",page_nav.appendChild(t),form_view_elemet.parentNode.nextSibling&&("DIV"==form_view_elemet.parentNode.nextSibling.tagName?table=!0:form_view_elemet.parentNode.nextSibling.nextSibling&&"DIV"==form_view_elemet.parentNode.nextSibling.nextSibling.tagName?table=!0:table=!1,table&&(form_view_elemet.getAttribute("previous_title")?(next_title=form_view_elemet.getAttribute("next_title"),next_type=form_view_elemet.getAttribute("next_type"),next_class=form_view_elemet.getAttribute("next_class")):(next_title="Next",next_type="button",next_class=""),next_or_previous="next",next=make_pagebreak_button(next_or_previous,next_title,next_type,next_class,e),t.appendChild(next)))}function generate_page_nav(e){form_view=e,document.getElementById("form_id_tempform_view"+e).parentNode.style.borderWidth="1px",jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".form_id_tempform_view_img").attr("id").split("form_id_tempform_view_img");t=e[1],page_nav=document.getElementById("form_id_temppage_nav"+t),destroyChildren(page_nav),generate_buttons(t)}),generate_page_bar(),refresh_page_numbers()}function remove_page(e){jQuery("#fm_delete_page_id").val(e),fm_popup_toggle("fm_delete_page_popup_container")}function remove_field(e,t){jQuery("#fm_delete_field_id").val(e),fm_popup_toggle("fm_delete_field_popup_container"),void 0!==t&&(t.stopPropagation(),t.preventDefault())}function fm_remove_column_popup(e){jQuery(".wdform_column").removeClass("fm-column-deleting"),jQuery(e).closest(".wdform_column").addClass("fm-column-deleting"),fm_popup_toggle("fm_delete_column_popup_container")}function fm_remove_row_popup(e){jQuery(".wdform_section").removeClass("fm-row-deleting"),jQuery(e).closest(".wdform_section").addClass("fm-row-deleting"),jQuery(e).closest(".wdform_section").find(".wdform_row").length?fm_popup_toggle("fm_delete_row_popup_container"):fm_remove_section(!1)}function fm_remove_column(){jQuery(".fm-column-deleting").remove()}function remove_page_only(){id=jQuery("#fm_delete_page_id").val(),refresh_pages_without_deleting(id)}function remove_page_all(){id=jQuery("#fm_delete_page_id").val(),form_view_elemet=document.getElementById("form_id_tempform_view"+id);var e=jQuery(".wdform-page-and-images").length;if(2==e&&(jQuery(".form_id_tempform_view_img").removeClass("form_view_show").addClass("form_view_hide"),jQuery("*[id*=form_id_temppage_nav]").empty()),1==e)return form_view_elemet.innerHTML="",tbody=form_view_elemet,tr=document.createElement("div"),tr.setAttribute("class","wdform_section"),tr.style.display="table-row",tr_page_nav=document.createElement("div"),tr_page_nav.setAttribute("valign","top"),tr_page_nav.setAttribute("class","wdform_footer"),tr_page_nav.style.width="100%",td_page_nav=document.createElement("div"),td_page_nav.style.width="100%",table_min_page_nav=document.createElement("div"),table_min_page_nav.style.width="100%",table_min_page_nav.style.display="table",tbody_min_page_nav=document.createElement("div"),tbody_min_page_nav.style.display="table-row-group",tr_min_page_nav=document.createElement("div"),tr_min_page_nav.setAttribute("id","form_id_temppage_nav"+form_view),tr_min_page_nav.style.display="table-row",table_min=document.createElement("div"),table_min.setAttribute("class","wdform_column"),tr.appendChild(table_min),tbody_min_page_nav.appendChild(tr_min_page_nav),table_min_page_nav.appendChild(tbody_min_page_nav),td_page_nav.appendChild(table_min_page_nav),tr_page_nav.appendChild(td_page_nav),tbody.appendChild(tr),void tbody.appendChild(tr_page_nav);form_view_table=form_view_elemet.parentNode,document.getElementById("take").removeChild(form_view_table),refresh_pages(id)}function refresh_pages(e){temp=1,destroyChildren(document.getElementById("pages"));var t=jQuery(".wdform-page-and-images").length;generate_page_bar(),1<t?jQuery("#page_bar").removeClass("form_view_hide"):(destroyChildren(document.getElementById("edit_page_navigation")),jQuery("#page_bar").addClass("form_view_hide"),jQuery(".wdform_page").removeAttr("style"))}function refresh_pages_without_deleting(e){var t=jQuery("#form_id_tempform_view"+e);t.find(".wdform_row");2==jQuery(".wdform-page-and-images").length&&(jQuery(".form_id_tempform_view_img").removeClass("form_view_show").addClass("form_view_hide"),jQuery("*[id*=form_id_temppage_nav]").empty());var i=t.parent(),a=i.prevAll(".wdform-page-and-images:first");a.length||(a=i.nextAll(".wdform-page-and-images:first")),a.length&&(i.find(".wdform_section").each(function(e,t){var i=a.find(".wdform_section").eq(e);i.length?jQuery(t).find(".wdform_column:not(:empty)").each(function(e,t){i.append(t)}):a.find(".wdform_row_empty").before(t)}),i.remove(),refresh_pages(e),all_sortable_events())}function make_page_steps_front(){destroyChildren(document.getElementById("pages")),show_title=document.getElementById("el_show_title_input").checked,k=0,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_id_tempform_view")[1],document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages="",k++,page_number=document.createElement("span"),page_number.setAttribute("id","page_"+j),page_number.setAttribute("onClick",'generate_page_nav("'+j+'")'),j==form_view?page_number.setAttribute("class","page_active"):page_number.setAttribute("class","page_deactive"),show_title?page_number.innerHTML=w_pages:page_number.innerHTML=k,document.getElementById("pages").appendChild(page_number)})}function make_page_percentage_front(){destroyChildren(document.getElementById("pages")),show_title=document.getElementById("el_show_title_input").checked;var e=document.createElement("div");e.setAttribute("class","page_percentage_deactive");var t=document.createElement("div");t.setAttribute("id","div_percentage"),t.setAttribute("class","page_percentage_active");var i=document.createElement("b");t.appendChild(i),k=0,cur_page_title="",jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");if(j=e.split("form_id_tempform_view")[1],document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages="",k++,j==form_view){if(show_title){var t=document.createElement("span");1==k?t.style.paddingLeft="30px":t.style.paddingLeft="5px",t.innerHTML=w_pages}page_number=k}}),i.innerHTML=Math.round((page_number-1)/k*100)+"%",t.style.width=(page_number-1)/k*100+"%",e.appendChild(t),cur_page_title&&e.appendChild(cur_page_title),document.getElementById("pages").appendChild(e)}function make_page_none_front(){var e=document.createElement("div");e.innerHTML="NO PAGE BAR",jQuery("#pages").empty(),jQuery("#pages").append(e)}function generate_page_bar(){need_enable=!1,el_page_navigation(),add(0,!1),need_enable=!0}function remove_add_(e){attr_name=new Array,attr_value=new Array;var t=document.getElementById(e);for(atr=t.attributes,v=0;v<30;v++)atr[v]&&0==atr[v].name.indexOf("add_")&&(attr_name.push(atr[v].name.replace("add_","")),attr_value.push(atr[v].value),t.removeAttribute(atr[v].name),v--);for(v=0;v<attr_name.length;v++)t.setAttribute(attr_name[v],attr_value[v])}function duplicate(e,a){if(jQuery("#wdform_field"+e).closest(".wdform_column").after("<div id='cur_column' class='wdform_column'></div>"),type=document.getElementById("wdform_field"+e).getAttribute("type"),document.getElementById(e+"_element_labelform_id_temp").innerHTML&&(w_field_label=document.getElementById(e+"_element_labelform_id_temp").innerHTML),labels=all_labels(),m=0,t=!0,"type_section_break"!=type){for(;t;)for(m++,k=0;k<labels.length&&(t=!0,labels[k]!=w_field_label+"("+m+")");k++)t=!1;w_field_label=w_field_label+"("+m+")"}switch(k=0,w_choices=new Array,w_choices_value=new Array,w_choices_params=new Array,w_choices_checked=new Array,w_choices_disabled=new Array,w_allow_other_num=0,w_property=new Array,w_property_values=new Array,w_choices_price=new Array,t=0,document.getElementById(e+"_label_sectionform_id_temp")&&("block"==document.getElementById(e+"_label_sectionform_id_temp").style.display?w_field_label_pos="top":w_field_label_pos="left"),document.getElementById(e+"_elementform_id_temp")&&(s=document.getElementById(e+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2)),document.getElementById(e+"_label_sectionform_id_temp")&&(s=document.getElementById(e+"_label_sectionform_id_temp").style.width,w_field_label_size=s.substring(0,s.length-2)),document.getElementById(e+"_requiredform_id_temp")&&(w_required=document.getElementById(e+"_requiredform_id_temp").value),document.getElementById(e+"_uniqueform_id_temp")&&(w_unique=document.getElementById(e+"_uniqueform_id_temp").value),document.getElementById(e+"_label_sectionform_id_temp")&&(w_class=document.getElementById(e+"_label_sectionform_id_temp").getAttribute("class"),w_class||(w_class="")),type){case"type_editor":w_editor=document.getElementById("wdform_field"+e).innerHTML,type_editor(gen,w_editor);break;case"type_section_break":w_editor=document.getElementById(e+"_element_sectionform_id_temp").innerHTML,type_section_break(gen,w_editor);break;case"type_send_copy":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").checked,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_send_copy(e,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_required,w_attr_name,w_attr_value);break;case"type_text":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,w_regExp_status=document.getElementById(e+"_regExpStatusform_id_temp").value,w_regExp_value=unescape(document.getElementById(e+"_regExp_valueform_id_temp").value),w_regExp_common=document.getElementById(e+"_regExp_commonform_id_temp").value,w_regExp_arg=document.getElementById(e+"_regArgumentform_id_temp").value,w_regExp_alert=document.getElementById(e+"_regExp_alertform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_readonly=document.getElementById(e+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,type_text(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_required,w_regExp_status,w_regExp_value,w_regExp_common,w_regExp_arg,w_regExp_alert,w_unique,w_attr_name,w_attr_value,w_readonly);break;case"type_number":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_number(gen,w_field_label,w_field_label_size,w_field_label_pos,w_size,w_first_val,w_title,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_password":w_placeholder_value=document.getElementById(e+"_elementform_id_temp").placeholder,w_verification=document.getElementById(e+"_verification_id_temp").value,document.getElementById(e+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(e+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_password(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_required,w_unique,w_class,w_verification,w_verification_label,w_placeholder_value,w_attr_name,w_attr_value);break;case"type_textarea":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_textarea(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_size_h,w_first_val,w_title,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_wdeditor":w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.height,w_size_h=s.substring(0,s.length-2),w=document.getElementById(e+"_elementform_id_temp").style.width,w_size_w=w.substring(0,w.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_wdeditor(gen,w_field_label,w_field_label_size,w_field_label_pos,w_size_w,w_size_h,w_title,w_required,w_class,w_attr_name,w_attr_value);break;case"type_phone":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title],s=document.getElementById(e+"_element_lastform_id_temp").style.width,w_size=s.substring(0,s.length-2),w_mini_labels=[document.getElementById(e+"_mini_label_area_code").innerHTML,document.getElementById(e+"_mini_label_phone_number").innerHTML],atrs=return_attributes(e+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_phone(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_mini_labels,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_phone_new":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_top_country=document.getElementById(e+"_elementform_id_temp").getAttribute("top-country"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_phone_new(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_top_country,w_required,w_unique,w_class,w_attr_name,w_attr_value);break;case"type_name":if(document.getElementById(e+"_enable_fieldsform_id_temp")){w_name_format="normal",w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title];for(var l=["title","middle"],d=0;d<2;d++)w_first_val.push(document.getElementById(e+"_element_"+l[d]+"form_id_temp")?document.getElementById(e+"_element_"+l[d]+"form_id_temp").value:""),w_title.push(document.getElementById(e+"_element_"+l[d]+"form_id_temp")?document.getElementById(e+"_element_"+l[d]+"form_id_temp").title:"")}else document.getElementById(e+"_element_middleform_id_temp")?w_name_format="extended":w_name_format="normal","normal"==w_name_format?(w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title]):(w_first_val=[document.getElementById(e+"_element_firstform_id_temp").value,document.getElementById(e+"_element_lastform_id_temp").value,document.getElementById(e+"_element_titleform_id_temp").value,document.getElementById(e+"_element_middleform_id_temp").value],w_title=[document.getElementById(e+"_element_firstform_id_temp").title,document.getElementById(e+"_element_lastform_id_temp").title,document.getElementById(e+"_element_titleform_id_temp").title,document.getElementById(e+"_element_middleform_id_temp").title]);document.getElementById(e+"_mini_label_title")?w_mini_title=document.getElementById(e+"_mini_label_title").innerHTML:w_mini_title="Title",document.getElementById(e+"_mini_label_middle")?w_mini_middle=document.getElementById(e+"_mini_label_middle").innerHTML:w_mini_middle="Middle",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_mini_labels=[w_mini_title,document.getElementById(e+"_mini_label_first").innerHTML,document.getElementById(e+"_mini_label_last").innerHTML,w_mini_middle],w_name_title=document.getElementById(e+"_enable_fieldsform_id_temp")?document.getElementById(e+"_enable_fieldsform_id_temp").getAttribute("title"):"normal"==w_name_format?"no":"yes",w_name_middle=document.getElementById(e+"_enable_fieldsform_id_temp")?document.getElementById(e+"_enable_fieldsform_id_temp").getAttribute("middle"):"normal"==w_name_format?"no":"yes",w_name_fields=[w_name_title,w_name_middle],w_autofill=document.getElementById(e+"_autofillform_id_temp").value,s=document.getElementById(e+"_element_firstform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_element_firstform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_name(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_title,w_mini_labels,w_size,w_name_format,w_required,w_unique,w_class,w_attr_name,w_attr_value,w_name_fields,w_autofill);break;case"type_paypal_price":w_first_val=[document.getElementById(e+"_element_dollarsform_id_temp").value,document.getElementById(e+"_element_centsform_id_temp").value],w_title=[document.getElementById(e+"_element_dollarsform_id_temp").title,document.getElementById(e+"_element_centsform_id_temp").title],"none"==document.getElementById(e+"_td_name_cents").style.display?w_hide_cents="yes":w_hide_cents="no",s=document.getElementById(e+"_element_dollarsform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_element_dollarsform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(e+"_range_minform_id_temp").value,w_range_max=document.getElementById(e+"_range_maxform_id_temp").value,w_mini_labels=[document.getElementById(e+"_mini_label_dollars").innerHTML,document.getElementById(e+"_mini_label_cents").innerHTML],type_paypal_price(gen,w_field_label,w_field_label_size,w_field_label_pos,w_first_val,w_title,w_mini_labels,w_size,w_required,w_hide_cents,w_class,w_attr_name,w_attr_value,w_range_min,w_range_max);break;case"type_paypal_price_new":w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,s=document.getElementById(e+"_elementform_id_temp").style.width,w_size=s.substring(0,s.length-2),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_range_min=document.getElementById(e+"_range_minform_id_temp").value,w_range_max=document.getElementById(e+"_range_maxform_id_temp").value,w_readonly=document.getElementById(e+"_readonlyform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,"none"==document.getElementById(e+"_td_name_currency").style.display?w_currency="yes":w_currency="no",type_paypal_price_new(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_first_val,w_title,w_size,w_required,w_class,w_attr_name,w_attr_value,w_range_min,w_range_max,w_readonly,w_currency);break;case"type_address":s=document.getElementById(e+"_div_address").style.width,w_size=s.substring(0,s.length-2),document.getElementById(e+"_mini_label_street1")?w_street1=document.getElementById(e+"_mini_label_street1").innerHTML:w_street1=document.getElementById(e+"_street1form_id_temp").value,document.getElementById(e+"_mini_label_street2")?w_street2=document.getElementById(e+"_mini_label_street2").innerHTML:w_street2=document.getElementById(e+"_street2form_id_temp").value,document.getElementById(e+"_mini_label_city")?w_city=document.getElementById(e+"_mini_label_city").innerHTML:w_city=document.getElementById(e+"_cityform_id_temp").value,document.getElementById(e+"_mini_label_state")?w_state=document.getElementById(e+"_mini_label_state").innerHTML:w_state=document.getElementById(e+"_stateform_id_temp").value,document.getElementById(e+"_mini_label_postal")?w_postal=document.getElementById(e+"_mini_label_postal").innerHTML:w_postal=document.getElementById(e+"_postalform_id_temp").value,document.getElementById(e+"_mini_label_country")?w_country=document.getElementById(e+"_mini_label_country").innerHTML:w_country=document.getElementById(e+"_countryform_id_temp").value,w_mini_labels=[w_street1,w_street2,w_city,w_state,w_postal,w_country];var _=document.getElementById(e+"_disable_fieldsform_id_temp");w_street1_dis=_.getAttribute("street1"),w_street2_dis=_.getAttribute("street2"),w_city_dis=_.getAttribute("city"),w_state_dis=_.getAttribute("state"),w_us_states_dis=_.getAttribute("us_states"),w_postal_dis=_.getAttribute("postal"),w_country_dis=_.getAttribute("country"),w_disabled_fields=[w_street1_dis,w_street2_dis,w_city_dis,w_state_dis,w_postal_dis,w_country_dis,w_us_states_dis],w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_street1form_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_address(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_mini_labels,w_disabled_fields,w_required,w_class,w_attr_name,w_attr_value);break;case"type_submitter_mail":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(e+"_elementform_id_temp").value,w_title=document.getElementById(e+"_elementform_id_temp").title,w_autofill=document.getElementById(e+"_autofillform_id_temp").value,w_verification=document.getElementById(e+"_verification_id_temp").value,w_verification_placeholder=document.getElementById(e+"_1_elementform_id_temp").title,document.getElementById(e+"_1_element_labelform_id_temp").innerHTML?w_verification_label=document.getElementById(e+"_1_element_labelform_id_temp").innerHTML:w_verification_label=" ",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_submitter_mail(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_first_val,w_title,w_required,w_unique,w_class,w_verification,w_verification_label,w_verification_placeholder,w_attr_name,w_attr_value,w_autofill);break;case"type_checkbox":if(w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,document.getElementById(e+"_rowcol_numform_id_temp").value?(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(e+"_rowcol_numform_id_temp").value):(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,"ver"==w_flow){var r=document.getElementById(e+"_table_little");for(k=0;k<r.childNodes.length;k++){var o=r.childNodes[k];for(m=0;m<o.childNodes.length;m++){var u=o.childNodes[m].getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}}else{var c=(p=(r=document.getElementById(e+"_table_little")).childNodes)[0].childNodes;for(k=0;k<c.length;k++)for(m=0;m<p.length;m++)if(p[m].childNodes[k]){u=(o=p[m].childNodes[k]).getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_checkbox(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_checked,w_rowcol,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_value_disabled,w_choices_value,w_choices_params);break;case"type_paypal_checkbox":for(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,v=0,k=0;k<100;k++)if(document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+k).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+k).checked,document.getElementById(e+"_label_element"+k).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+k).getAttribute("db_info"):w_choices_params[t]="",t++,v=k),document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_checkbox(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_property,w_property_values,w_quantity,w_quantity_value,w_choices_params);break;case"type_radio":if(w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,document.getElementById(e+"_rowcol_numform_id_temp").value?(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=document.getElementById(e+"_rowcol_numform_id_temp").value):(document.getElementById(e+"_table_little").getAttribute("for_hor")?w_flow="hor":w_flow="ver",w_rowcol=1),v=0,"ver"==w_flow){r=document.getElementById(e+"_table_little");for(k=0;k<r.childNodes.length;k++){o=r.childNodes[k];for(m=0;m<o.childNodes.length;m++){u=o.childNodes[m].getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}}else{var p;c=(p=(r=document.getElementById(e+"_table_little")).childNodes)[0].childNodes;for(k=0;k<c.length;k++)for(m=0;m<p.length;m++)if(p[m].childNodes[k]){u=(o=p[m].childNodes[k]).getAttribute("idi");document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+u).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+u).innerHTML,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+u).checked,w_choices_value[t]=document.getElementById(e+"_elementform_id_temp"+u).value,document.getElementById(e+"_label_element"+u).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+u).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+u).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+u).getAttribute("db_info"):w_choices_params[t]="",t++,v=u}}document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_radio(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_checked,w_rowcol,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_value_disabled,w_choices_value,w_choices_params);break;case"type_paypal_radio":for(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,v=0,k=0;k<100;k++)if(document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+k).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+k).checked,document.getElementById(e+"_label_element"+k).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+k).getAttribute("db_info"):w_choices_params[t]="",t++,v=k),document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");w_quantity="no",w_quantity_value=1,document.getElementById(e+"_element_quantityform_id_temp")&&(w_quantity="yes",w_quantity_value=document.getElementById(e+"_element_quantityform_id_temp").value),document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_radio(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_property,w_property_values,w_quantity,w_quantity_value,w_choices_params);break;case"type_paypal_shipping":for(document.getElementById(e+"_hor")?w_flow="hor":w_flow="ver",w_randomize=document.getElementById(e+"_randomizeform_id_temp").value,w_allow_other=document.getElementById(e+"_allow_otherform_id_temp").value,v=0,k=0;k<100;k++)if(document.getElementById(e+"_elementform_id_temp"+k)&&(document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&"1"==document.getElementById(e+"_elementform_id_temp"+k).getAttribute("other")&&(w_allow_other_num=t),w_choices[t]=document.getElementById(e+"_label_element"+k).innerHTML,w_choices_price[t]=document.getElementById(e+"_elementform_id_temp"+k).value,w_choices_checked[t]=document.getElementById(e+"_elementform_id_temp"+k).checked,document.getElementById(e+"_label_element"+k).getAttribute("where")?w_choices_params[t]=document.getElementById(e+"_label_element"+k).getAttribute("where")+"[where_order_by]"+document.getElementById(e+"_label_element"+k).getAttribute("order_by")+"[db_info]"+document.getElementById(e+"_label_element"+k).getAttribute("db_info"):w_choices_params[t]="",t++,v=k),document.getElementById(e+"_propertyform_id_temp"+k))if(w_property.push(document.getElementById(e+"_property_label_form_id_temp"+k).innerHTML),document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length)for(w_property_values[w_property.length-1]=new Array,m=0;m<document.getElementById(e+"_propertyform_id_temp"+k).childNodes.length;m++)w_property_values[w_property.length-1].push(document.getElementById(e+"_propertyform_id_temp"+k).childNodes[m].value);else w_property_values.push("");document.getElementById(e+"_option_left_right")?w_field_option_pos=document.getElementById(e+"_option_left_right").value:w_field_option_pos="left",w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"+v),w_attr_name=atrs[0],w_attr_value=atrs[1],type_paypal_shipping(gen,w_field_label,w_field_label_size,w_field_label_pos,w_field_option_pos,w_hide_label,w_flow,w_choices,w_choices_price,w_choices_checked,w_required,w_randomize,w_allow_other,w_allow_other_num,w_class,w_attr_name,w_attr_value,w_property,w_property_values,w_choices_params);break;case"type_paypal_total":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_size=jQuery("#"+e+"paypal_totalform_id_temp").css("width")?jQuery("#"+e+"paypal_totalform_id_temp").css("width").substring(0,jQuery("#"+e+"paypal_totalform_id_temp").css("width").length-2):"300",type_paypal_total(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_class,w_size);break;case"type_stripe":type_stripe(gen,w_size,w_field_label_size,w_field_label_pos,w_class);break;case"type_star_rating":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_star_amount=document.getElementById(e+"_star_amountform_id_temp").value,w_field_label_col=document.getElementById(e+"_star_colorform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_star_rating(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_label_col,w_star_amount,w_required,w_class,w_attr_name,w_attr_value);break;case"type_scale_rating":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_mini_labels=[document.getElementById(e+"_mini_label_worst").innerHTML,document.getElementById(e+"_mini_label_best").innerHTML],w_scale_amount=document.getElementById(e+"_scale_amountform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_scale_rating(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_mini_labels,w_scale_amount,w_required,w_class,w_attr_name,w_attr_value);break;case"type_spinner":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(e+"_min_valueform_id_temp").value,w_field_max_value=document.getElementById(e+"_max_valueform_id_temp").value,w_field_width=document.getElementById(e+"_spinner_widthform_id_temp").value,w_field_step=document.getElementById(e+"_stepform_id_temp").value,w_field_value=document.getElementById(e+"_elementform_id_temp").getAttribute("aria-valuenow"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_spinner(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value);break;case"type_slider":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_min_value=document.getElementById(e+"_slider_min_valueform_id_temp").value,w_field_max_value=document.getElementById(e+"_slider_max_valueform_id_temp").value,w_field_step=document.getElementById(e+"_slider_stepform_id_temp")&&document.getElementById(e+"_slider_stepform_id_temp").value?document.getElementById(e+"_slider_stepform_id_temp").value:1,w_field_width=document.getElementById(e+"_slider_widthform_id_temp").value,w_field_value=document.getElementById(e+"_slider_valueform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_slider(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value);break;case"type_range":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_range_width=document.getElementById(e+"_range_widthform_id_temp").value,w_field_range_step=document.getElementById(e+"_range_stepform_id_temp").value,w_field_value1=document.getElementById(e+"_elementform_id_temp0").getAttribute("aria-valuenow"),w_field_value2=document.getElementById(e+"_elementform_id_temp1").getAttribute("aria-valuenow"),atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_mini_labels=[document.getElementById(e+"_mini_label_from").innerHTML,document.getElementById(e+"_mini_label_to").innerHTML],type_range(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_range_width,w_field_range_step,w_field_value1,w_field_value2,w_mini_labels,w_required,w_class,w_attr_name,w_attr_value);break;case"type_grading":for(w_total=document.getElementById(e+"_grading_totalform_id_temp").value,w_items=[],k=0;k<100;k++)document.getElementById(e+"_label_elementform_id_temp"+k)&&w_items.push(document.getElementById(e+"_label_elementform_id_temp"+k).innerHTML);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_grading(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_items,w_total,w_required,w_class,w_attr_name,w_attr_value),refresh_grading_items(e);break;case"type_matrix":for(w_rows=[],w_rows[0]="",k=1;k<100;k++)document.getElementById(e+"_label_elementform_id_temp"+k+"_0")&&w_rows.push(document.getElementById(e+"_label_elementform_id_temp"+k+"_0").innerHTML);for(w_columns=[],w_columns[0]="",k=1;k<100;k++)document.getElementById(e+"_label_elementform_id_temp0_"+k)&&w_columns.push(document.getElementById(e+"_label_elementform_id_temp0_"+k).innerHTML);w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,w_field_input_type=document.getElementById(e+"_input_typeform_id_temp").value,w_textbox_size=document.getElementById(e+"_textbox_sizeform_id_temp")?document.getElementById(e+"_textbox_sizeform_id_temp").value:"100",atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],type_matrix(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_input_type,w_rows,w_columns,w_required,w_class,w_attr_name,w_attr_value,w_textbox_size),refresh_matrix(e);break;case"type_time":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_hhform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_hh=document.getElementById(e+"_hhform_id_temp").value,w_mm=document.getElementById(e+"_mmform_id_temp").value,document.getElementById(e+"_ssform_id_temp")?(w_ss=document.getElementById(e+"_ssform_id_temp").value,w_sec="1",w_mini_label_ss=document.getElementById(e+"_mini_label_ss").innerHTML):(w_ss="",w_sec="0",w_mini_label_ss=""),document.getElementById(e+"_am_pm_select")?(w_am_pm=document.getElementById(e+"_am_pmform_id_temp").value,w_time_type="12",w_mini_labels=[document.getElementById(e+"_mini_label_hh").innerHTML,document.getElementById(e+"_mini_label_mm").innerHTML,w_mini_label_ss,document.getElementById(e+"_mini_label_am_pm").innerHTML]):(w_am_pm=0,w_time_type="24",w_mini_labels=[document.getElementById(e+"_mini_label_hh").innerHTML,document.getElementById(e+"_mini_label_mm").innerHTML,w_mini_label_ss,"AM/PM"]),type_time(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_time_type,w_am_pm,w_sec,w_hh,w_mm,w_ss,w_mini_labels,w_required,w_class,w_attr_name,w_attr_value);break;case"type_date":atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(e+"_elementform_id_temp").value,w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no",type_date(gen,w_field_label,w_field_label_size,w_field_label_pos,w_date,w_required,w_class,w_format,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_new":w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date=document.getElementById(e+"_elementform_id_temp").value,w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_start_day=document.getElementById(e+"_start_dayform_id_temp").value,w_default_date=document.getElementById(e+"_default_date_id_temp").value,w_min_date=document.getElementById(e+"_min_date_id_temp").value,w_max_date=document.getElementById(e+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(e+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(e+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(e+"_show_imageform_id_temp").value,w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no";var f=document.getElementById(e+"_show_week_days");w_sunday=f.getAttribute("sunday"),w_monday=f.getAttribute("monday"),w_tuesday=f.getAttribute("tuesday"),w_wednesday=f.getAttribute("wednesday"),w_thursday=f.getAttribute("thursday"),w_friday=f.getAttribute("friday"),w_saturday=f.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],type_date_new(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_range":atrs=return_attributes(e+"_elementform_id_temp0"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_date="",w_format=document.getElementById(e+"_buttonform_id_temp").getAttribute("format"),w_but_val=document.getElementById(e+"_buttonform_id_temp").value,w_default_date_start=document.getElementById(e+"_default_date_id_temp_start").value,w_default_date_end=document.getElementById(e+"_default_date_id_temp_end").value,w_min_date=document.getElementById(e+"_min_date_id_temp").value,w_start_day=document.getElementById(e+"_start_dayform_id_temp").value,w_max_date=document.getElementById(e+"_max_date_id_temp").value,w_invalid_dates=document.getElementById(e+"_invalid_dates_id_temp").value,w_hide_time=document.getElementById(e+"_hide_timeform_id_temp").value,w_show_image=document.getElementById(e+"_show_imageform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,s=document.getElementById(e+"_elementform_id_temp0").style.width,w_size=s.substring(0,s.length-2),w_disable_past_days=document.getElementById(e+"_dis_past_daysform_id_temp")?document.getElementById(e+"_dis_past_daysform_id_temp").value:"no";f=document.getElementById(e+"_show_week_days");w_sunday=f.getAttribute("sunday"),w_monday=f.getAttribute("monday"),w_tuesday=f.getAttribute("tuesday"),w_wednesday=f.getAttribute("wednesday"),w_thursday=f.getAttribute("thursday"),w_friday=f.getAttribute("friday"),w_saturday=f.getAttribute("saturday"),w_show_days=[w_sunday,w_monday,w_tuesday,w_wednesday,w_thursday,w_friday,w_saturday],type_date_range(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date_start,w_default_date_end,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days);break;case"type_date_fields":atrs=return_attributes(e+"_dayform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],w_day=document.getElementById(e+"_dayform_id_temp").value,w_month=document.getElementById(e+"_monthform_id_temp").value,w_year=document.getElementById(e+"_yearform_id_temp").value,w_day_type=document.getElementById(e+"_dayform_id_temp").tagName,w_month_type=document.getElementById(e+"_monthform_id_temp").tagName,w_year_type=document.getElementById(e+"_yearform_id_temp").tagName,w_day_label=document.getElementById(e+"_day_label").innerHTML,w_month_label=document.getElementById(e+"_month_label").innerHTML,w_year_label=document.getElementById(e+"_year_label").innerHTML,s=document.getElementById(e+"_dayform_id_temp").style.width,w_day_size=s.substring(0,s.length-2),s=document.getElementById(e+"_monthform_id_temp").style.width,w_month_size=s.substring(0,s.length-2),s=document.getElementById(e+"_yearform_id_temp").style.width,w_year_size=s.substring(0,s.length-2),w_from=document.getElementById(e+"_yearform_id_temp").getAttribute("from"),w_to=document.getElementById(e+"_yearform_id_temp").getAttribute("to"),w_divider=document.getElementById(e+"_separator1").innerHTML,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,type_date_fields(gen,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_day,w_month,w_year,w_day_type,w_month_type,w_year_type,w_day_label,w_month_label,w_year_label,w_day_size,w_month_size,w_year_size,w_required,w_class,w_from,w_to,w_divider,w_attr_name,w_attr_value);break;case"type_own_select":jQuery("#"+e+"_elementform_id_temp option").each(function(){w_choices[t]=jQuery(this).html(),w_choices_value[t]=jQuery(this).val(),w_choices_checked[t]=jQuery(this)[0].selected,jQuery(this).attr("where")?w_choices_params[t]=jQuery(this).attr("where")+"[where_order_by]"+jQuery(this).attr("order_by")+"[db_info]"+jQuery(this).attr("db_info"):w_choices_params[t]="",jQuery(this).val()?w_choices_disabled[t]=!1:w_choices_disabled[t]=!0,t++}),w_value_disabled=document.getElementById(e+"_value_disabledform_id_temp").value,w_hide_label=document.getElementById(e+"_hide_labelform_id_temp").value,atrs=return_attributes(e+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=at