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

Version Description

Added: Hong Kong to country list. Fixed: List of US states.

Download this release

Release Info

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

Code changes from version 1.12.4 to 1.12.5

admin/models/Manage_fm.php CHANGED
@@ -799,7 +799,7 @@ class FMModelManage_fm {
799
  }
800
  if ( $w_disabled_fields[5] == 'no' ) {
801
  $g++;
802
- $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><select type="text" id="' . $id . '_countryform_id_temp" name="' . ($id + 5) . '_countryform_id_temp" onchange="change_value(&quot;' . $id . '_countryform_id_temp&quot;)" style="width: 100%;" ' . $param['attributes'] . ' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Curacao">Curacao</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_country">' . $w_mini_labels[5] . '</span>';
803
  }
804
  $rep = '<div id="wdform_field' . $id . '" type="type_address" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px; vertical-align:top;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_address" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" name="' . $id . '_disable_fieldsform_id_temp" id="' . $id . '_disable_fieldsform_id_temp" street1="' . $w_disabled_fields[0] . '" street2="' . $w_disabled_fields[1] . '" city="' . $w_disabled_fields[2] . '" state="' . $w_disabled_fields[3] . '" postal="' . $w_disabled_fields[4] . '" country="' . $w_disabled_fields[5] . '" us_states="' . $w_disabled_fields[6] . '"><div id="' . $id . '_div_address" style="width: ' . $param['w_size'] . 'px;">' . $address_fields . $hidden_inputs . '</div></div></div>';
805
  break;
799
  }
800
  if ( $w_disabled_fields[5] == 'no' ) {
801
  $g++;
802
+ $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><select type="text" id="' . $id . '_countryform_id_temp" name="' . ($id + 5) . '_countryform_id_temp" onchange="change_value(&quot;' . $id . '_countryform_id_temp&quot;)" style="width: 100%;" ' . $param['attributes'] . ' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Curacao">Curacao</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hong Kong">Hong Kong</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_country">' . $w_mini_labels[5] . '</span>';
803
  }
804
  $rep = '<div id="wdform_field' . $id . '" type="type_address" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px; vertical-align:top;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_address" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" name="' . $id . '_disable_fieldsform_id_temp" id="' . $id . '_disable_fieldsform_id_temp" street1="' . $w_disabled_fields[0] . '" street2="' . $w_disabled_fields[1] . '" city="' . $w_disabled_fields[2] . '" state="' . $w_disabled_fields[3] . '" postal="' . $w_disabled_fields[4] . '" country="' . $w_disabled_fields[5] . '" us_states="' . $w_disabled_fields[6] . '"><div id="' . $id . '_div_address" style="width: ' . $param['w_size'] . 'px;">' . $address_fields . $hidden_inputs . '</div></div></div>';
805
  break;
admin/views/FMEditCountryinPopup.php CHANGED
@@ -71,7 +71,7 @@ class FMViewFromeditcountryinpopup {
71
  </div>
72
  <script>
73
  selec_coutries = [];
74
- coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
75
  select_ = window.parent.document.getElementById('<?php echo $field_id ?>_elementform_id_temp');
76
  n = select_.childNodes.length;
77
  for (i = 0; i < n; i++) {
71
  </div>
72
  <script>
73
  selec_coutries = [];
74
+ coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
75
  select_ = window.parent.document.getElementById('<?php echo $field_id ?>_elementform_id_temp');
76
  n = select_.childNodes.length;
77
  for (i = 0; i < n; i++) {
admin/views/Manage_fm.php CHANGED
@@ -1760,7 +1760,7 @@ class FMViewManage_fm extends FMAdminView {
1760
 
1761
  if($types[$key_select_or_input]=="type_address")
1762
  {
1763
- $w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
1764
  $w_options = '';
1765
  foreach($w_countries as $w_country)
1766
  {
1760
 
1761
  if($types[$key_select_or_input]=="type_address")
1762
  {
1763
+ $w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong", "Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
1764
  $w_options = '';
1765
  foreach($w_countries as $w_country)
1766
  {
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
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.12.4
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -88,8 +88,8 @@ final class WDFM {
88
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
89
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
90
  $this->main_file = plugin_basename(__FILE__);
91
- $this->plugin_version = '1.12.4';
92
- $this->db_version = '2.12.4';
93
  $this->menu_slug = 'manage_fm';
94
  $this->prefix = 'form_maker';
95
  $this->css_prefix = 'fm_';
@@ -642,6 +642,7 @@ final class WDFM {
642
  wp_register_script('fm-gmap_form', $this->plugin_url . '/js/if_gmap_front_end.js', array(), $this->plugin_version);
643
 
644
  wp_localize_script('fm-frontend', 'fm_objectL10n', array(
 
645
  'plugin_url' => $this->plugin_url,
646
  'form_maker_admin_ajax' => admin_url('admin-ajax.php'),
647
  'fm_file_type_error' => addslashes(__('Can not upload this type of file', $this->prefix)),
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
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.12.5
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
88
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
89
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
90
  $this->main_file = plugin_basename(__FILE__);
91
+ $this->plugin_version = '1.12.5';
92
+ $this->db_version = '2.12.5';
93
  $this->menu_slug = 'manage_fm';
94
  $this->prefix = 'form_maker';
95
  $this->css_prefix = 'fm_';
642
  wp_register_script('fm-gmap_form', $this->plugin_url . '/js/if_gmap_front_end.js', array(), $this->plugin_version);
643
 
644
  wp_localize_script('fm-frontend', 'fm_objectL10n', array(
645
+ 'states' => WDW_FM_Library::get_states(),
646
  'plugin_url' => $this->plugin_url,
647
  'form_maker_admin_ajax' => admin_url('admin-ajax.php'),
648
  'fm_file_type_error' => addslashes(__('Can not upload this type of file', $this->prefix)),
framework/WDW_FM_Library.php CHANGED
@@ -3996,6 +3996,70 @@ class WDW_FM_Library {
3996
  }
3997
  }
3998
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3999
  }
4000
 
4001
  /*
3996
  }
3997
  }
3998
  }
3999
+
4000
+ /**
4001
+ * Get states list.
4002
+ *
4003
+ * @return array
4004
+ */
4005
+ public static function get_states() {
4006
+ $states = array(
4007
+ "" => "",
4008
+ "Alabama" => __("Alabama", WDFM()->prefix),
4009
+ "Alaska" => __("Alaska", WDFM()->prefix),
4010
+ "Arizona" => __("Arizona", WDFM()->prefix),
4011
+ "Arkansas" => __("Arkansas", WDFM()->prefix),
4012
+ "California" => __("California", WDFM()->prefix),
4013
+ "Colorado" => __("Colorado", WDFM()->prefix),
4014
+ "Connecticut" => __("Connecticut", WDFM()->prefix),
4015
+ "Delaware" => __("Delaware", WDFM()->prefix),
4016
+ "District Of Columbia" => __("District Of Columbia", WDFM()->prefix),
4017
+ "Florida" => __("Florida", WDFM()->prefix),
4018
+ "Georgia" => __("Georgia", WDFM()->prefix),
4019
+ "Hawaii" => __("Hawaii", WDFM()->prefix),
4020
+ "Idaho" => __("Idaho", WDFM()->prefix),
4021
+ "Illinois" => __("Illinois", WDFM()->prefix),
4022
+ "Indiana" => __("Indiana", WDFM()->prefix),
4023
+ "Iowa" => __("Iowa", WDFM()->prefix),
4024
+ "Kansas" => __("Kansas", WDFM()->prefix),
4025
+ "Kentucky" => __("Kentucky", WDFM()->prefix),
4026
+ "Louisiana" => __("Louisiana", WDFM()->prefix),
4027
+ "Maine" => __("Maine", WDFM()->prefix),
4028
+ "Maryland" => __("Maryland", WDFM()->prefix),
4029
+ "Massachusetts" => __("Massachusetts", WDFM()->prefix),
4030
+ "Michigan" => __("Michigan", WDFM()->prefix),
4031
+ "Minnesota" => __("Minnesota", WDFM()->prefix),
4032
+ "Mississippi" => __("Mississippi", WDFM()->prefix),
4033
+ "Missouri" => __("Missouri", WDFM()->prefix),
4034
+ "Montana" => __("Montana", WDFM()->prefix),
4035
+ "Nebraska" => __("Nebraska", WDFM()->prefix),
4036
+ "Nevada" => __("Nevada", WDFM()->prefix),
4037
+ "New Hampshire" => __("New Hampshire", WDFM()->prefix),
4038
+ "New Jersey" => __("New Jersey", WDFM()->prefix),
4039
+ "New Mexico" => __("New Mexico", WDFM()->prefix),
4040
+ "New York" => __("New York", WDFM()->prefix),
4041
+ "North Carolina" => __("North Carolina", WDFM()->prefix),
4042
+ "North Dakota" => __("North Dakota", WDFM()->prefix),
4043
+ "Ohio" => __("Ohio", WDFM()->prefix),
4044
+ "Oklahoma" => __("Oklahoma", WDFM()->prefix),
4045
+ "Oregon" => __("Oregon", WDFM()->prefix),
4046
+ "Pennsylvania" => __("Pennsylvania", WDFM()->prefix),
4047
+ "Rhode Island" => __("Rhode Island", WDFM()->prefix),
4048
+ "South Carolina" => __("South Carolina", WDFM()->prefix),
4049
+ "South Dakota" => __("South Dakota", WDFM()->prefix),
4050
+ "Tennessee" => __("Tennessee", WDFM()->prefix),
4051
+ "Texas" => __("Texas", WDFM()->prefix),
4052
+ "Utah" => __("Utah", WDFM()->prefix),
4053
+ "Vermont" => __("Vermont", WDFM()->prefix),
4054
+ "Virginia" => __("Virginia", WDFM()->prefix),
4055
+ "Washington" => __("Washington", WDFM()->prefix),
4056
+ "West Virginia" => __("West Virginia", WDFM()->prefix),
4057
+ "Wisconsin" => __("Wisconsin", WDFM()->prefix),
4058
+ "Wyoming" => __("Wyoming", WDFM()->prefix),
4059
+ );
4060
+
4061
+ return $states;
4062
+ }
4063
  }
4064
 
4065
  /*
frontend/views/form_maker.php CHANGED
@@ -1123,6 +1123,7 @@ class FMViewForm_maker {
1123
  "Guyana",
1124
  "Haiti",
1125
  "Honduras",
 
1126
  "Hungary",
1127
  "Iceland",
1128
  "India",
@@ -1256,7 +1257,9 @@ class FMViewForm_maker {
1256
  }
1257
  if ( isset($w_disabled_fields[5]) && $w_disabled_fields[5] == 'no' ) {
1258
  $g++;
1259
- $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;display: inline-block;"><select type="text" id="wdform_' . $id1 . '_country' . $form_id . '" name="wdform_' . ($id1 + 5) . '_country' . $form_id . '" style="width:100%" ' . $param['attributes'] . '>' . $w_options . '</select><label class="mini_label">' . $w_mini_labels[5] . '</label></span>';
 
 
1260
  }
1261
  $rep .= '</div><div class="wdform-element-section ' . $param['w_class'] . '" style="' . $param['w_field_label_pos2'] . ' width: ' . $param['w_size'] . 'px;"><div>
1262
  ' . $address_fields . '</div><div style="clear:both;"></div></div></div>';
1123
  "Guyana",
1124
  "Haiti",
1125
  "Honduras",
1126
+ "Hong Kong",
1127
  "Hungary",
1128
  "Iceland",
1129
  "India",
1257
  }
1258
  if ( isset($w_disabled_fields[5]) && $w_disabled_fields[5] == 'no' ) {
1259
  $g++;
1260
+ $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;display: inline-block;"><select type="text" id="wdform_' . $id1 . '_country' . $form_id . '" name="wdform_' . ($id1 + 5) . '_country' . $form_id . '" style="width:100%" ' . $param['attributes'] . '
1261
+ ' . (( isset($w_disabled_fields[6]) && $w_disabled_fields[6] == 'yes' ) ? 'onchange="wd_change_state_input(\'wdform_' . $id1 . '\', \'' . $form_id . '\')"' : '') . '
1262
+ >' . $w_options . '</select><label class="mini_label">' . $w_mini_labels[5] . '</label></span>';
1263
  }
1264
  $rep .= '</div><div class="wdform-element-section ' . $param['w_class'] . '" style="' . $param['w_field_label_pos2'] . ' width: ' . $param['w_size'] . 'px;"><div>
1265
  ' . $address_fields . '</div><div style="clear:both;"></div></div></div>';
js/add_field.js CHANGED
@@ -7130,7 +7130,7 @@ function disable_fields(id, field) {
7130
  option_.innerHTML = "";
7131
  field.appendChild(option_);
7132
 
7133
- coutries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
7134
 
7135
  for (r = 0; r < coutries.length; r++) {
7136
  var option_ = document.createElement('option');
@@ -7540,7 +7540,7 @@ function type_address(i, w_field_label, w_field_label_size, w_field_label_pos, w
7540
  option_.innerHTML = "";
7541
 
7542
  country.appendChild(option_);
7543
- coutries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
7544
 
7545
  for (r = 0; r < coutries.length; r++) {
7546
  var option_ = document.createElement('option');
@@ -7834,7 +7834,7 @@ function create_edit_country_list(i) {
7834
  }
7835
 
7836
  function go_to_type_country(new_id) {
7837
- w_countries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
7838
  w_attr_name = [];
7839
  w_attr_value = [];
7840
  type_country(new_id, 'Country:', '100', 'no', w_countries, 'left', '200', 'no', 'wdform_select', w_attr_name, w_attr_value);
7130
  option_.innerHTML = "";
7131
  field.appendChild(option_);
7132
 
7133
+ coutries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
7134
 
7135
  for (r = 0; r < coutries.length; r++) {
7136
  var option_ = document.createElement('option');
7540
  option_.innerHTML = "";
7541
 
7542
  country.appendChild(option_);
7543
+ coutries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
7544
 
7545
  for (r = 0; r < coutries.length; r++) {
7546
  var option_ = document.createElement('option');
7834
  }
7835
 
7836
  function go_to_type_country(new_id) {
7837
+ w_countries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
7838
  w_attr_name = [];
7839
  w_attr_value = [];
7840
  type_country(new_id, 'Country:', '100', 'no', w_countries, 'left', '200', 'no', 'wdform_select', w_attr_name, w_attr_value);
js/form_maker_manage.js CHANGED
@@ -461,7 +461,7 @@ function change_choices(value, ids, types, params) {
461
  break;
462
  case "type_address":
463
 
464
- coutries=["Afghanistan","Albania", "Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombi","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepa","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"];
465
 
466
  var choise_select = document.createElement('select');
467
  choise_select.setAttribute("id", "field_value"+global_index+'_'+m);
461
  break;
462
  case "type_address":
463
 
464
+ coutries=["Afghanistan","Albania", "Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombi","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepa","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"];
465
 
466
  var choise_select = document.createElement('select');
467
  choise_select.setAttribute("id", "field_value"+global_index+'_'+m);
js/main_div_front_end.js CHANGED
@@ -1 +1 @@
1
- F=2;
2
  jQuery(".wd-datepicker").each(function () {
3
  jQuery(this).datepicker();
4
  jQuery(this).datepicker("option", "dateFormat", jQuery(this).data("format"));
5
  });
6
  var FormCurrency = eval("FormCurrency_" + form_id);
7
  if(jQuery('.paypal_total'+form_id).length==0) {
8
  return;
9
  }
10
  var div_paypal_show = jQuery('.paypal_total'+form_id);
11
  var div_paypal_products = jQuery('.paypal_products'+form_id);
12
  var div_paypal_tax = jQuery('.paypal_tax'+form_id);
13
  var input_paypal_total = jQuery('.input_paypal_total'+form_id);
14
  var total=0;
15
  var total_shipping=0;
16
  div_paypal_products.html('');
17
  div_paypal_tax.html('');
18
  n = parseInt(jQuery('#counter'+form_id).val());
19
  jQuery("#form" +form_id+ " div[type='type_paypal_checkbox'], #form" +form_id+ " div[type='type_paypal_radio']").each(function() {
20
  id=jQuery(this).parent().attr('wdid');
21
  jQuery(this).find('input:checked').each(
22
  function() {
23
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
24
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
25
  total =total + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
26
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
27
  }
28
  );
29
  });
30
  jQuery("#form" +form_id+ " div[type='type_paypal_shipping']").each(function() {
31
  id=jQuery(this).parent().attr('wdid');
32
  jQuery(this).find('input:checked').each(
33
  function() {
34
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
35
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
36
  total_shipping =total_shipping + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
37
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
38
  }
39
  );
40
  });
41
  jQuery("#form" +form_id+ " div[type='type_paypal_select']").each(function() {
42
  id=jQuery(this).parent().attr('wdid');
43
  if(jQuery(this).find('select').val()!='') {
44
  label = jQuery(this).find('select option:selected').html();
45
  span_value = FormCurrency + jQuery(this).find('select').val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
46
  total =total + jQuery(this).find('select').val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
47
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
48
  }
49
  });
50
  jQuery("#form" +form_id+ " div[type='type_paypal_price']").each(function() {
51
  id=jQuery(this).parent().attr('wdid');
52
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active') || jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active')) {
53
  label= jQuery(this).find('.wdform-label').html();
54
  cents='00';
55
  dollars='0';
56
  if( jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active')) {
57
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).val()!='') {
58
  dollars=jQuery('#wdform_'+id+"_element_dollars"+form_id).val();
59
  }
60
  }
61
  if( jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active') && jQuery('#wdform_'+id+"_element_cents"+form_id).val()!='') {
62
  if(jQuery('#wdform_'+id+"_element_cents"+form_id).val().length==1) {
63
  cents='0'+jQuery('#wdform_'+id+"_element_cents"+form_id).val();
64
  }
65
  else {
66
  cents=jQuery('#wdform_'+id+"_element_cents"+form_id).val();
67
  }
68
  }
69
  span_value = FormCurrency + dollars+'.'+cents;
70
  total =total + parseFloat(dollars+'.'+cents);
71
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
72
  }
73
  });
74
  jQuery("#form" +form_id+ " div[type='type_paypal_price_new']").each(function(){
75
  id=jQuery(this).parent().attr('wdid');
76
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
77
  label= jQuery(this).find('.wdform-label').html();
78
  dollars='0';
79
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
80
  if(jQuery('#wdform_'+id+"_element"+form_id).val()!='') {
81
  dollars=jQuery('#wdform_'+id+"_element"+form_id).val();
82
  }
83
  }
84
  span_value = FormCurrency + dollars;
85
  total =total + parseFloat(dollars);
86
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
87
  }
88
  });
89
  var FormPaypalTax = eval("FormPaypalTax_" + form_id);
90
  if(FormPaypalTax != 0) {
91
  div_paypal_tax.html('Tax: ' + FormCurrency + (((total)*FormPaypalTax) / 100).toFixed(2));
92
  }
93
  jQuery('.div_total'+form_id).html(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
94
  input_paypal_total.val(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
95
  var chCode1 = e.which || e.keyCode;
96
  if (chCode1 != 45) {
97
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
98
  return false;
99
  }
100
  }
101
  return true;
102
  var sum = 0;
103
  for(var k=0; k<100;k++) {
104
  if(document.getElementById(num+'_element'+form_id+'_'+k)) {
105
  if(document.getElementById(num+'_element'+form_id+'_'+k).value) {
106
  sum = sum+parseInt(document.getElementById(num+'_element'+form_id+'_'+k).value);
107
  }
108
  }
109
  if(document.getElementById(num+'_total_element'+form_id)) {
110
  if(sum > document.getElementById(num+'_total_element'+form_id).innerHTML) {
111
  document.getElementById(num+'_text_element'+form_id).innerHTML =" "+ fm_objectL10n.fm_grading_text + " " + document.getElementById(num+'_total_element'+form_id).innerHTML;
112
  }
113
  else {
114
  document.getElementById(num+'_text_element'+form_id).innerHTML="";
115
  }
116
  }
117
  }
118
  if(document.getElementById(num+'_sum_element'+form_id)) {
119
  document.getElementById(num+'_sum_element'+form_id).innerHTML = sum;
120
  }
121
  if(rated==false) {
122
  for(var j=0;j<=id;j++) {
123
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+'.png';
124
  }
125
  }
126
  if(rated==false) {
127
  for(var j=0;j<=id;j++) {
128
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
129
  }
130
  }
131
  rated=true;
132
  for(var j=0;j<=id;j++) {
133
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+".png";
134
  }
135
  for(var k=id+1;k<=star_amount-1;k++) {
136
  document.getElementById(el_id+'_star_'+k+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
137
  }
138
  document.getElementById(el_id+'_selected_star_amount'+form_id).value=id+1;
139
  var element_other = jQuery('.form' + form_id + ' [id^=' + num + '_element' + form_id + '][other="1"]');
140
  var parent_ = element_other.parent();
141
  var br = document.createElement('br');
142
  br.setAttribute("id", num + "_other_br" + form_id);
143
  var elem_id = num.split("_")[1];
144
  var el_other = document.createElement('input');
145
  el_other.setAttribute("id", num + "_other_input" + form_id);
146
  el_other.setAttribute("name", num + "_other_input" + form_id);
147
  el_other.setAttribute("type", "text");
148
  el_other.setAttribute("class", "other_input");
149
  el_other.setAttribute("onchange", "other_input_change(this, '" + form_id + "', '" + elem_id + "')");
150
  parent_.append(br);
151
  parent_.append(el_other);
152
  if (jQuery(elem).val() == "") {
153
  wd_is_filled(form_id, wdid);
154
  }
155
  else {
156
  jQuery("#form" + form_id + " #wd_required_" + wdid).remove();
157
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label").removeClass("error_label");
158
  }
159
  var chCode1 = e.which || e.keyCode;
160
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
161
  return true;
162
  }
163
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
164
  return false;
165
  }
166
  return true;
167
  srcArr=document.getElementById(id+genid).src.split("&r=");
168
  document.getElementById(id+genid).src=srcArr[0]+'&r='+Math.floor(Math.random()*100);
169
  document.getElementById(id+"_input"+genid).value='';
170
  document.getElementById(id+genid).style.display="inline-block";
171
  checking=document.getElementById(id+"_element"+form_id+j);
172
  if(checking.getAttribute('other')) {
173
  if(checking.getAttribute('other')==1) {
174
  if(!checking.checked) {
175
  if(document.getElementById(id+"_other_input"+form_id)) {
176
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
177
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
178
  }
179
  return false;
180
  }
181
  }
182
  }
183
  return true;
184
  if(document.getElementById(id+"_other_input"+form_id)) {
185
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
186
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
187
  }
188
  if(jQuery(x).val().length==1) {
189
  jQuery(x).val('0'+jQuery(x).val());
190
  }
191
  var chCode1 = e.which || e.keyCode;
192
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
193
  return false;
194
  }
195
  hour=""+document.getElementById(id).value+String.fromCharCode(chCode1);
196
  hour=parseFloat(hour);
197
  if((hour<0) || (hour>hour_interval)) {
198
  return false;
199
  }
200
  return true;
201
  var chCode1 = e.which || e.keyCode;
202
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
203
  return false;
204
  }
205
  minute=""+document.getElementById(id).value+String.fromCharCode(chCode1);
206
  minute=parseFloat(minute);
207
  if ((minute<0) || (minute>59)) {
208
  return false;
209
  }
210
  return true;
211
  var chCode1 = e.which || e.keyCode;
212
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
213
  return false;
214
  }
215
  second=""+document.getElementById(id).value+String.fromCharCode(chCode1);
216
  second=parseFloat(second);
217
  if ((second<0) || (second>59)) {
218
  return false;
219
  }
220
  return true;
221
  var chCode1 = e.which || e.keyCode;
222
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
223
  return true;
224
  }
225
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
226
  return false;
227
  }
228
  val1=""+jQuery(x).val()+String.fromCharCode(chCode1);
229
  if (val1.length>2) {
230
  return false;
231
  }
232
  if (val1=='00') {
233
  return false;
234
  }
235
  if ((val1<from) || (val1>to)) {
236
  return false;
237
  }
238
  return true;
239
  year=jQuery(x).val();
240
  from=parseFloat(jQuery(x).attr('from'));
241
  to=parseFloat(jQuery(x).attr('to'));
242
  year=parseFloat(year);
243
  if((year>=from) && (year<=to)) {
244
  jQuery(x).val(year);
245
  }
246
  else {
247
  jQuery(x).val('');
248
  }
249
  var chCode1 = e.which || e.keyCode;
250
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
251
  return false;
252
  }
253
  day=""+jQuery(x).val()+String.fromCharCode(chCode1);
254
  if(day.length>2) {
255
  return false;
256
  }
257
  if(day=='00') {
258
  return false;
259
  }
260
  day=parseFloat(day);
261
  if((day<0) || (day>31)) {
262
  return false;
263
  }
264
  return true;
265
  var chCode1 = e.which || e.keyCode;
266
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
267
  return false;
268
  }
269
  month=""+jQuery(x).val()+String.fromCharCode(chCode1);
270
  if(month.length>2) {
271
  return false;
272
  }
273
  if(month=='00') {
274
  return false;
275
  }
276
  month=parseFloat(month);
277
  if((month<0) || (month>12)) {
278
  return false;
279
  }
280
  return true;
281
  var chCode1 = e.which || e.keyCode;
282
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
283
  return false;
284
  }
285
  year=""+jQuery(x).val()+String.fromCharCode(chCode1);
286
  to=parseFloat(jQuery(x).attr('to'));
287
  year=parseFloat(year);
288
  if(year>to) {
289
  return false;
290
  }
291
  return true;
292
  ofontStyle=jQuery(x).attr('class');
293
  if(ofontStyle.indexOf("input_deactive")!=-1) {
294
  jQuery(x).val("").removeClass("input_deactive").addClass("input_active");
295
  }
296
  if(jQuery(x).val()=="") {
297
  jQuery(x).val(jQuery(x).attr('title')).removeClass("input_active").addClass("input_deactive");
298
  }
299
  while (node.firstChild) {
300
  node.removeChild(node.firstChild);
301
  }
302
  form_view=id;
303
  page_nav=document.getElementById(form_id+'page_nav'+id);
304
  destroyChildren(page_nav);
305
  form_view_elemet=document.getElementById(form_id+'form_view'+id);
306
  remove_whitespace(form_view_elemet.parentNode.parentNode);
307
  display_none_form_views_all(form_id);
308
  generate_page_bar(id, form_id, form_view_count, form_view_max);
309
  form_view_elemet.parentNode.style.display="";
310
  var td = document.createElement("div");
311
  td.setAttribute("valign", "middle");
312
  td.setAttribute("align", "left");
313
  td.style.display="table-cell";
314
  td.style.width="40%";
315
  page_nav.appendChild(td);
316
  if(form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
317
  if(form_view_elemet.parentNode.previousSibling.tagName=="DIV") {
318
  table=form_view_elemet.parentNode.previousSibling;
319
  }
320
  else {
321
  if(form_view_elemet.parentNode.previousSibling.previousSibling.tagName=="DIV") {
322
  table=form_view_elemet.parentNode.previousSibling.previousSibling;
323
  }
324
  else {
325
  table="none";
326
  }
327
  }
328
  if(table!="none") {
329
  if(!table.firstChild.tagName) {
330
  table.removeChild(table.firstChild);
331
  }
332
  previous_title = form_view_elemet.getAttribute('previous_title');
333
  previous_type = form_view_elemet.getAttribute('previous_type');
334
  if(previous_type=="text") {
335
  td.setAttribute("class", "previous-page");
336
  }
337
  previous_class = form_view_elemet.getAttribute('previous_class');
338
  previous_checkable = form_view_elemet.getAttribute('previous_checkable');
339
  next_or_previous="previous";
340
  previous=make_pagebreak_button(next_or_previous, previous_title, previous_type, previous_class, previous_checkable, id, form_id, form_view_count, form_view_max);
341
  td.appendChild(previous);
342
  }
343
  }
344
  var td = document.createElement("div");
345
  td.setAttribute("id", form_id+"page_numbers"+form_view);
346
  td.setAttribute("valign", "middle");
347
  td.setAttribute("class", "page-numbers");
348
  td.setAttribute("align", "center");
349
  td.style.display="table-cell";
350
  if(document.getElementById('fm-pages' + form_id).getAttribute('show_numbers')=="true") {
351
  k=0;
352
  for(j=1; j<=form_view_max; j++) {
353
  if(document.getElementById(form_id+'form_view'+j)) {
354
  k++;
355
  if(j==form_view) {
356
  page_number=k;
357
  }
358
  }
359
  }
360
  var cur = document.createElement('span');
361
  cur.setAttribute("class", "page_numbers");
362
  cur.innerHTML=page_number+'/'+k;
363
  td.appendChild(cur);
364
  }
365
  page_nav.appendChild(td);
366
  var td = document.createElement("div");
367
  td.setAttribute("valign", "middle");
368
  td.setAttribute("align", "right");
369
  td.style.cssText = "display:table-cell; width:40%; text-align:right;";
370
  page_nav.appendChild(td);
371
  not_next=false;
372
  if(form_view_elemet.parentNode.nextSibling) {
373
  if(form_view_elemet.parentNode.nextSibling.tagName=="DIV" && form_view_elemet.parentNode.nextSibling.className=="wdform-page-and-images") {
374
  table=form_view_elemet.parentNode.nextSibling;
375
  }
376
  else {
377
  if(form_view_elemet.parentNode.nextSibling.nextSibling) {
378
  if(form_view_elemet.parentNode.nextSibling.nextSibling.tagName=="DIV") {
379
  table=form_view_elemet.parentNode.nextSibling.nextSibling;
380
  }
381
  else {
382
  table="none";
383
  }
384
  }
385
  else {
386
  table="none";
387
  }
388
  }
389
  if(table!="none") {
390
  next_title =form_view_elemet.getAttribute('next_title');
391
  next_type =form_view_elemet.getAttribute('next_type');
392
  if(next_type=="text") {
393
  td.setAttribute("class", "next-page");
394
  }
395
  next_class = form_view_elemet.getAttribute('next_class');
396
  next_checkable = form_view_elemet.getAttribute('next_checkable');
397
  next_or_previous="next";
398
  next=make_pagebreak_button(next_or_previous, next_title, next_type, next_class, next_checkable, id, form_id, form_view_count, form_view_max);
399
  td.appendChild(next);
400
  }
401
  else {
402
  not_next=true;
403
  }
404
  }
405
  else {
406
  not_next=true;
407
  }
408
  fm_initilize_form(form_id);
409
  jQuery("#form" + form_id + " div[type='type_map']").each(function() {
410
  id=jQuery(this).parent().attr('wdid');
411
  if_gmap_init('wdform_'+id, form_id);
412
  for(q=0; q<20; q++) {
413
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
414
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
415
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
416
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
417
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,false);
418
  }
419
  }
420
  });
421
  jQuery("#form" + form_id + " div[type='type_mark_map']").each(function() {
422
  id=jQuery(this).parent().attr('wdid');
423
  if_gmap_init('wdform_'+id, form_id);
424
  q=0;
425
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
426
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
427
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
428
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
429
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,true);
430
  }
431
  });
432
  jQuery('.wdform-element-section').each(function() {
433
  });
434
  for(t=1; t<30; t++) {
435
  if(document.getElementById(form_id+'form_view'+t)) {
436
  document.getElementById(form_id+'form_view'+t).parentNode.style.display="none";
437
  }
438
  }
439
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='steps') {
440
  make_page_steps_front(form_view, form_id, form_view_count, form_view_max);
441
  }
442
  else {
443
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='percentage') {
444
  make_page_percentage_front(form_view, form_id, form_view_count, form_view_max);
445
  }
446
  else {
447
  make_page_none_front(form_id);
448
  }
449
  }
450
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='show_numbers') {
451
  td = document.getElementById(form_id+'page_numbers'+form_view);
452
  if(td) {
453
  destroyChildren(td);
454
  k=0;
455
  for(j=1; j<=form_view_max; j++) {
456
  if(document.getElementById(form_id+'form_view'+j)) {
457
  k++;
458
  if(j==form_view) {
459
  page_number=k;
460
  }
461
  }
462
  }
463
  var cur = document.createElement('span');
464
  cur.setAttribute("class", "page_numbers");
465
  cur.innerHTML=page_number+'/'+k;
466
  td.appendChild(cur);
467
  }
468
  }
469
  else {
470
  td = document.getElementById(form_id+'page_numbers'+form_view);
471
  if(td) {
472
  destroyChildren(document.getElementById(form_id+'page_numbers'+form_view));
473
  }
474
  }
475
  destroyChildren(document.getElementById('fm-pages' + form_id));
476
  show_title =(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
477
  next_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('next_checkable')=='true');
478
  previous_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('previous_checkable')=='true');
479
  k=0;
480
  for(j=1; j<=form_view_max; j++) {
481
  if(document.getElementById(form_id+'form_view'+j)) {
482
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
483
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
484
  }
485
  else {
486
  w_pages="";
487
  }
488
  k++;
489
  page_number = document.createElement('span');
490
  page_number.setAttribute('id','page_'+j);
491
  if(j<form_view) {
492
  if(previous_checkable) {
493
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
494
  }
495
  else {
496
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
497
  }
498
  }
499
  if(j>form_view) {
500
  if(next_checkable) {
501
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
502
  }
503
  else {
504
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
505
  }
506
  }
507
  if(j==form_view) {
508
  page_number.setAttribute('class',"page_active");
509
  }
510
  else {
511
  page_number.setAttribute('class',"page_deactive");
512
  }
513
  if(show_title) {
514
  page_number.innerHTML=w_pages;
515
  }
516
  else {
517
  page_number.innerHTML=k;
518
  }
519
  document.getElementById('fm-pages' + form_id).appendChild(page_number);
520
  }
521
  }
522
  destroyChildren(document.getElementById('fm-pages' + form_id));
523
  show_title=(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
524
  var div_parent = document.createElement('div');
525
  div_parent.setAttribute("class", "page_percentage_deactive");
526
  var div = document.createElement('div');
527
  div.setAttribute("id", "div_percentage");
528
  div.setAttribute("class", "page_percentage_active");
529
  div.setAttribute("align", "right");
530
  var div_arrow = document.createElement('div');
531
  div_arrow.setAttribute("class", "wdform_percentage_arrow");
532
  var b = document.createElement('b');
533
  b.setAttribute("class", "wdform_percentage_text");
534
  div.appendChild(b);
535
  k=0;
536
  cur_page_title='';
537
  for(j=1; j<=form_view_max; j++) {
538
  if(document.getElementById(form_id+'form_view'+j)) {
539
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
540
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
541
  }
542
  else {
543
  w_pages="";
544
  }
545
  k++;
546
  if(j==form_view) {
547
  if(show_title) {
548
  var cur_page_title = document.createElement('div');
549
  cur_page_title.innerHTML=w_pages;
550
  cur_page_title.innerHTML=w_pages;
551
  cur_page_title.setAttribute("class", "wdform_percentage_title");
552
  }
553
  page_number=k;
554
  }
555
  }
556
  }
557
  b.innerHTML=Math.round(((page_number-1)/k)*100)+'%';
558
  div.style.width=((page_number-1)/k)*100+'%';
559
  if(page_number==1) {
560
  div_arrow.style.display='none';
561
  }
562
  div_parent.appendChild(div);
563
  div_parent.appendChild(div_arrow);
564
  if(cur_page_title) {
565
  div_parent.appendChild(cur_page_title);
566
  }
567
  document.getElementById('fm-pages' + form_id).appendChild(div_parent);
568
  destroyChildren(document.getElementById('fm-pages' + form_id));
569
  switch(type) {
570
  case 'text': {
571
  var element = document.createElement('div');
572
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
573
  element.setAttribute('class', class_);
574
  if(checkable=="true") {
575
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
576
  }
577
  else {
578
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
579
  }
580
  element.innerHTML=title;
581
  return element;
582
  }
583
  case 'img':{
584
  var element = document.createElement('img');
585
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
586
  element.setAttribute('class', class_);
587
  if(checkable=="true") {
588
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
589
  }
590
  else {
591
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
592
  }
593
  if(title.indexOf("http")==0) {
594
  element.src=title;
595
  }
596
  else {
597
  element.src=fm_objectL10n.plugin_url+'/'+title;
598
  }
599
  return element;
600
  }
601
  }
602
  var curtop = 0;
603
  if (obj.offsetParent) {
604
  do {
605
  curtop += obj.offsetTop;
606
  } while (obj = obj.offsetParent);
607
  return [curtop];
608
  }
609
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
610
  if (form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
611
  if (form_view_elemet.parentNode.previousSibling.tagName == "DIV") {
612
  table = form_view_elemet.parentNode.previousSibling;
613
  }
614
  else {
615
  table = form_view_elemet.parentNode.previousSibling.previousSibling;
616
  }
617
  }
618
  if (!table.firstChild.tagName) {
619
  table.removeChild(table.firstChild);
620
  }
621
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
622
  form = jQuery("#form" + form_id);
623
  if (!form.parent().hasClass('fm-scrollbox-form')) {
624
  window.scroll(0, form_maker_findPos(form));
625
  }
626
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
627
  if (form_view_elemet.parentNode.nextSibling) {
628
  if (form_view_elemet.parentNode.nextSibling.tagName == "DIV") {
629
  table = form_view_elemet.parentNode.nextSibling;
630
  }
631
  else {
632
  table = form_view_elemet.parentNode.nextSibling.nextSibling;
633
  }
634
  }
635
  if (!table.firstChild.tagName) {
636
  table.removeChild(table.firstChild);
637
  }
638
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
639
  form = jQuery("#form" + form_id);
640
  if (!form.parent().hasClass('fm-scrollbox-form')) {
641
  window.scroll(0, form_maker_findPos(form));
642
  }
643
  if(filename.length == 0) {
644
  return true;
645
  }
646
  var dot = filename.lastIndexOf(".");
647
  var extension = filename.substr(dot+1,filename.length);
648
  exten=exten.split(',');
649
  for(var j=0 ; j<exten.length; j++) {
650
  exten[j]=exten[j].replace(/\./g,'');
651
  exten[j]=exten[j].replace(/ /g,'');
652
  if(extension.toLowerCase()==exten[j].toLowerCase())
653
  return true;
654
  }
655
  return false;
656
  addclass = typeof(addclass) != 'undefined' ? addclass : '';
657
  jQuery(select).wrap('<div class="sel-wrap ' + addclass + '"/>');
658
  var sel_options = '';
659
  var selected_option = false;
660
  jQuery(select).children('option').each(function() {
661
  if(jQuery(this).is(':selected')){
662
  selected_option = jQuery(this).index();
663
  }
664
  sel_options = sel_options + '<div class="sel-option" value="' + jQuery(this).val() + '">' + jQuery(this).html() + '</div>';
665
  });
666
  w=jQuery(select)[0].style.width;
667
  if(w=='100%') {
668
  w='100%';
669
  }
670
  else {
671
  w=(jQuery(select).width()+32)+'px';
672
  }
673
  var sel_imul = '<div class="sel-imul" style="width:'+w+'">\
674
  <div class="sel-selected">\
675
  <div class="selected-text">' + jQuery(select).children('option').eq(selected_option).html() + '</div>\
676
  <div class="sel-arraw"></div>\
677
  </div>\
678
  <div class="sel-options">' + sel_options + '</div>\
679
  </div>';
680
  jQuery(select).addClass('no-width');
681
  jQuery(select).before(sel_imul);
682
  var tektext = jQuery(this).children("option:selected").text();
683
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
684
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').children('.sel-option').removeClass('sel-ed');
685
  jQuery(this).addClass('sel-ed');
686
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').each(function() {
687
  if (jQuery(this).html() == tektext) {
688
  jQuery(this).addClass('sel-ed');
689
  }
690
  });
691
  jQuery('.sel-imul').removeClass('act');
692
  jQuery(this).addClass('act');
693
  if (jQuery(this).children('.sel-options').is(':visible')) {
694
  jQuery('.sel-options').hide();
695
  }
696
  else {
697
  jQuery('.sel-options').hide();
698
  jQuery(this).children('.sel-options').show();
699
  jQuery(this).children('.sel-options').css('width',jQuery(this).width());
700
  }
701
  var tektext = jQuery(this).html();
702
  jQuery(this).parent('.sel-options').parent('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
703
  jQuery(this).parent('.sel-options').children('.sel-option').removeClass('sel-ed');
704
  jQuery(this).addClass('sel-ed');
705
  var tekval = jQuery(this).attr('value');
706
  tekval = typeof(tekval) != 'undefined' ? tekval : tektext;
707
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').children('option').removeAttr('selected').each(function() {
708
  if (jQuery(this).html() == tektext) {
709
  jQuery(this).attr('selected', 'select');
710
  }
711
  });
712
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').change();
713
  selenter = true;
714
  selenter = false;
715
  if (!selenter) {
716
  jQuery('.sel-options').hide();
717
  jQuery('.sel-imul').removeClass('act');
718
  }
719
  var ttt;
720
  for (ttt=0; ttt < node.childNodes.length; ttt++) {
721
  if( node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test( node.childNodes[ttt].nodeValue )) {
722
  node.removeChild(node.childNodes[ttt]);
723
  ttt--;
724
  }
725
  else {
726
  if(node.childNodes[ttt].childNodes.length) {
727
  remove_whitespace(node.childNodes[ttt]);
728
  }
729
  }
730
  }
731
  return;
732
  if(element_value) {
733
  jQuery("#"+id).datepicker('option', min_max, element_value);
734
  }
735
  else {
736
  if(default_min_max == "today") {
737
  jQuery("#"+id).datepicker('option', min_max, new Date());
738
  }
739
  else {
740
  if (default_min_max.indexOf("d") == -1 && default_min_max.indexOf("m") == -1 && default_min_max.indexOf("y") == -1 && default_min_max.indexOf("w") == -1 && default_min_max != "") {
741
  default_min_max = jQuery.datepicker.formatDate(format, new Date(default_min_max));
742
  }
743
  jQuery("#"+id).datepicker('option', min_max, default_min_max);
744
  }
745
  }
746
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
747
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
748
  var condition_confirm_email = false;
749
  if(!window["check_before_submit" + form_id][wdid + "_" + form_id]) {
750
  condition_confirm_email = true;
751
  }
752
  else {
753
  condition_confirm_email = jQuery(element).val() != jQuery(element_confirm).val() ? true : false;
754
  }
755
  if(condition_confirm_email) {
756
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
757
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
758
  if(jQuery(element).val() != jQuery(element_confirm).val()) {
759
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
760
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_confirm");
761
  }
762
  window["check_before_submit" + form_id][wdid + "_" + form_id] = (wdid + "_" + form_id in window["check_before_submit" + form_id]) ? window["check_before_submit" + form_id][wdid + "_" + form_id] : true;
763
  }
764
  else {
765
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
766
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
767
  if(window["check_before_submit" + form_id][wdid + "_" + form_id] == true) {
768
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
769
  }
770
  }
771
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
772
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
773
  var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
774
  if(jQuery(element).val()!="" && !re.test(jQuery.trim(jQuery(element).val())) && jQuery(element).attr("title") != jQuery(element).val()){
775
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
776
  jQuery(element).parent().append("<div id='check_email_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message_check + "</div>");
777
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_check_mail");
778
  if(element.val() == element_confirm.val()) {
779
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
780
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
781
  }
782
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
783
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
784
  }
785
  else {
786
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
787
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_check_mail").removeClass("error_label_check_mail");
788
  window["check_before_submit" + form_id][wdid + "_" + form_id] = true;
789
  if(typeof element_confirm.val() ==="undefined") {
790
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
791
  }
792
  }
793
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
794
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
795
  var condition_confirm_pass = false;
796
  condition_confirm_pass = element.val() !== element_confirm.val();
797
  if(condition_confirm_pass) {
798
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
799
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
800
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_check_pass");
801
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
802
  }
803
  else {
804
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
805
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_check_pass").removeClass("error_label_check_pass");
806
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
807
  }
808
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown fm-minimized");
809
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeOutDown").addClass("fm-show fm-animated fadeInUp");
810
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
811
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeOutDown fm-minimized").addClass("fm-show fm-animated fadeInUp");
812
  var hide_date = new Date();
813
  hide_date.setDate(hide_date.getDate() + hide_interval);
814
  if( hide_interval > 0 ) {
815
  localStorage.setItem('hide-'+form_id, hide_date.getTime());
816
  }
817
  if(typeof close_callback === 'function') {
818
  close_callback();
819
  }
820
  var x = jQuery("#form" + form_id);
821
  var find_wrong_exp = false;
822
  var check_regExp = regExpObj ? regExpObj : window['check_regExp_all'+form_id];
823
  jQuery.each( check_regExp, function( wdid, exp ) {
824
  var element = "#wdform_" + wdid + "_element" + form_id;
825
  var RegExpression = "";
826
  var rules = unescape(exp[0]);
827
  (exp[1].length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules, exp[1]);
828
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
829
  if(jQuery(element).val().length > 0 && jQuery(element).val() != jQuery(element).attr('title')) {
830
  if (RegExpression.test(jQuery(element).val()) != true) {
831
  jQuery("#form"+form_id+" #wd_exp_"+wdid).remove();
832
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_exp_"+wdid+"' class='fm-not-filled'>" + exp[2] + "</div>");
833
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp");
834
  find_wrong_exp = true;
835
  if(!regExpObj){
836
  scroll_on_element(form_id);
837
  }
838
  }
839
  }
840
  }
841
  });
842
  if(find_wrong_exp === false) {
843
  return true;
844
  }
845
  return false;
846
  var parent_div = jQuery("#form" + form_id + " .fm-not-filled")[0].closest(".wdform_row");
847
  var body_hight = document.body.clientHeight;
848
  var element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
849
  var scrollChecker = function() {
850
  if(document.body.clientHeight !== body_hight ) {
851
  body_hight = document.body.clientHeight;
852
  element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
853
  jQuery('html body').stop();
854
  animateBodyToError();
855
  }
856
  };
857
  jQuery(window).on("scroll",scrollChecker);
858
  function animateBodyToError() {
859
  jQuery('html body').animate({
860
  scrollTop: element_offset - 150
861
  }, 500, function() {
862
  jQuery(window).off("scroll", scrollChecker);
863
  old_bg=jQuery(parent_div).css("background-color");
864
  jQuery(parent_div).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
865
  });
866
  }
867
  animateBodyToError();
868
  var x = jQuery("#form" + form_id);
869
  var find_wrong_type_upload = false;
870
  var upload_check = upload_check_field ? upload_check_field : window['file_upload_check'+form_id];
871
  jQuery.each( upload_check, function( wdid, upload_types ) {
872
  var element = "#wdform_" + wdid + "_element" + form_id;
873
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
874
  ext_available=getfileextension(jQuery(element).val(), upload_types);
875
  if(!ext_available) {
876
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
877
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_upload_type_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_file_type_error + "</div>");
878
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_upload");
879
  find_wrong_type_upload = true;
880
  }
881
  else {
882
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
883
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_upload").removeClass("error_label_upload")
884
  }
885
  }
886
  });
887
  if(!upload_check_field && find_wrong_type_upload === true){
888
  scroll_on_element(form_id);
889
  }
890
  if(find_wrong_type_upload === false) {
891
  return true;
892
  }
893
  return false;
894
  var x = jQuery("#form" + form_id);
895
  var req_fields = field_id ? field_id.split() : window['required_fields'+form_id];
896
  var not_filled = {};
897
  jQuery(req_fields).each(function(index, wdid) {
898
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none" ) {
899
  switch(window['labels_and_ids'+form_id][wdid]) {
900
  case 'type_text':
901
  case 'type_textarea':
902
  case 'type_paypal_price_new':
903
  case 'type_spinner':
904
  case 'type_number':
905
  case 'type_phone_new':
906
  case 'type_submitter_mail': {
907
  var element = "#wdform_" + wdid + "_element" + form_id;
908
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
909
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
910
  not_filled[wdid] = element;
911
  }
912
  }
913
  if(!field_id && !window['check_submit'+form_id]) {
914
  jQuery(element).focus(function() {
915
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
916
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
917
  }).blur(function() {
918
  wd_is_filled(form_id, wdid);
919
  });
920
  }
921
  break;
922
  }
923
  case 'type_own_select':
924
  case 'type_country':
925
  case 'type_paypal_select': {
926
  var element = "#wdform_" + wdid + "_element" + form_id;
927
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
928
  if(jQuery(element).val() == "") {
929
  not_filled[wdid] = element;
930
  }
931
  }
932
  if(!field_id && !window['check_submit'+form_id]) {
933
  jQuery(element).focus(function() {
934
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
935
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
936
  }).blur(function() {
937
  wd_is_filled(form_id, wdid);
938
  }).change(function() {
939
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
940
  wd_is_filled(form_id, wdid);
941
  });
942
  }
943
  break;
944
  }
945
  case 'type_phone': {
946
  var element = ["#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id];
947
  jQuery.each(element, function(i, elem){
948
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
949
  if(jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')){
950
  not_filled[wdid] = elem;
951
  }
952
  }
953
  if(!field_id && !window['check_submit'+form_id]){
954
  jQuery(elem).focus(function() {
955
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
956
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
957
  }).blur(function() {
958
  wd_is_filled(form_id, wdid);
959
  });
960
  }
961
  });
962
  break;
963
  }
964
  case 'type_name': {
965
  var element = ["#wdform_" + wdid + "_element_title" + form_id, "#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id, "#wdform_" + wdid + "_element_middle" + form_id];
966
  jQuery.each(element, function(i, elem){
967
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
968
  if((jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')) && typeof jQuery(elem).val() != "undefined"){
969
  not_filled[wdid] = elem;
970
  }
971
  }
972
  if(!field_id && !window['check_submit'+form_id]){
973
  jQuery(elem).focus(function() {
974
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
975
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
976
  }).blur(function() {
977
  wd_is_filled(form_id, wdid);
978
  });
979
  }
980
  });
981
  break;
982
  }
983
  case 'type_address': {
984
  var element = ["#wdform_" + wdid + "_street1" + form_id, "#wdform_" + wdid + "_street2" + form_id, "#wdform_" + wdid + "_city" + form_id, "#wdform_" + wdid + "_state" + form_id, "#wdform_" + wdid + "_postal" + form_id, "#wdform_" + wdid + "_country" + form_id];
985
  jQuery.each(element, function(i, elem){
986
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
987
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
988
  not_filled[wdid] = elem;
989
  }
990
  }
991
  if(!field_id && !window['check_submit'+form_id]){
992
  jQuery(elem).focus(function() {
993
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
994
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
995
  }).blur(function() {
996
  wd_is_filled(form_id, wdid);
997
  });
998
  }
999
  });
1000
  break;
1001
  }
1002
  case 'type_checkbox':
1003
  case 'type_radio':
1004
  case 'type_scale_rating':
1005
  case 'type_paypal_checkbox':
1006
  case 'type_paypal_radio':
1007
  case 'type_paypal_shipping': {
1008
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none"){
1009
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
1010
  not_filled[wdid] = true;
1011
  }
1012
  }
1013
  if(!field_id && !window['check_submit'+form_id]){
1014
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1015
  jQuery(this).change(function() {
1016
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
1017
  wd_is_filled(form_id, wdid);
1018
  }
1019
  else{
1020
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1021
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1022
  }
1023
  });
1024
  });
1025
  }
1026
  break;
1027
  }
1028
  case 'type_star_rating': {
1029
  var element = "#wdform_" + wdid + "_selected_star_amount" + form_id;
1030
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1031
  if(jQuery(element).val() == ""){
1032
  not_filled[wdid] = true;
1033
  }
1034
  }
1035
  if(!field_id && !window['check_submit'+form_id]){
1036
  jQuery("#wdform_" + wdid + "_element" + form_id).click(function(){
1037
  if(jQuery(element).val() != ""){
1038
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1039
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1040
  }
1041
  });
1042
  }
1043
  break;
1044
  }
1045
  case 'type_range': {
1046
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
1047
  jQuery.each(element, function(i, elem){
1048
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1049
  if(jQuery(elem).val() == ""){
1050
  not_filled[wdid] = elem;
1051
  }
1052
  }
1053
  if(!field_id && !window['check_submit'+form_id]){
1054
  jQuery(elem).focus(function() {
1055
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1056
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1057
  }).blur(function() {
1058
  wd_is_filled(form_id, wdid);
1059
  });
1060
  }
1061
  });
1062
  break;
1063
  }
1064
  case 'type_grading': {
1065
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1066
  var count_grading = 0;
1067
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
1068
  if(jQuery(this).val() != "")
1069
  count_grading ++;
1070
  });
1071
  if(count_grading == 0)
1072
  not_filled[wdid] = true;
1073
  }
1074
  if(!field_id && !window['check_submit'+form_id]){
1075
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
1076
  jQuery(this).focus(function() {
1077
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1078
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1079
  }).blur(function() {
1080
  wd_is_filled(form_id, wdid);
1081
  });
1082
  });
1083
  }
1084
  break;
1085
  }
1086
  case 'type_slider': {
1087
  var slider_element = "#wdform_" + wdid + "_element" + form_id;
1088
  var element = "#wdform_" + wdid + "_slider_value" + form_id;
1089
  var min_value = "#wdform_" + wdid + "_element_min" + form_id;
1090
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1091
  if(jQuery(element).val() == jQuery(min_value).html()){
1092
  not_filled[wdid] = true;
1093
  }
1094
  }
1095
  if(!field_id && !window['check_submit'+form_id]){
1096
  jQuery(slider_element).slider({
1097
  change: function( event, ui ) {
1098
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1099
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1100
  wd_is_filled(form_id, wdid);
1101
  }
1102
  });
1103
  }
1104
  break;
1105
  }
1106
  case 'type_date':
1107
  case 'type_date_new': {
1108
  var element = "#wdform_" + wdid + "_element" + form_id;
1109
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1110
  if(jQuery(element).val() == ""){
1111
  not_filled[wdid] = element;
1112
  }
1113
  }
1114
  if(!field_id && !window['check_submit'+form_id]){
1115
  jQuery(element).focus(function() {
1116
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1117
  }).change(function() {
1118
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1119
  wd_is_filled(form_id, wdid);
1120
  });
1121
  }
1122
  break;
1123
  }
1124
  case 'type_date_range': {
1125
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
1126
  jQuery.each(element, function(i, elem){
1127
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1128
  if(jQuery(elem).val() == ""){
1129
  not_filled[wdid] = elem;
1130
  }
1131
  }
1132
  if(!field_id && !window['check_submit'+form_id]){
1133
  jQuery(elem).focus(function() {
1134
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1135
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1136
  }).change(function() {
1137
  wd_is_filled(form_id, wdid);
1138
  });
1139
  }
1140
  });
1141
  break;
1142
  }
1143
  case 'type_date_fields': {
1144
  var element = ["#wdform_" + wdid + "_day" + form_id, "#wdform_" + wdid + "_month" + form_id, "#wdform_" + wdid + "_year" + form_id];
1145
  jQuery.each(element, function(i, elem) {
1146
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1147
  if(jQuery(elem).val() == ""){
1148
  not_filled[wdid] = elem;
1149
  }
1150
  }
1151
  if(!field_id && !window['check_submit'+form_id]){
1152
  jQuery(elem).focus(function() {
1153
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1154
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1155
  }).blur(function() {
1156
  wd_is_filled(form_id, wdid);
1157
  }).change(function() {
1158
  wd_is_filled(form_id, wdid);
1159
  });
1160
  }
1161
  });
1162
  break;
1163
  }
1164
  case 'type_time': {
1165
  var element = ["#wdform_" + wdid + "_hh" + form_id, "#wdform_" + wdid + "_mm" + form_id, "#wdform_" + wdid + "_ss" + form_id];
1166
  jQuery.each(element, function(i, elem){
1167
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1168
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
1169
  not_filled[wdid] = elem;
1170
  }
1171
  }
1172
  if(!field_id && !window['check_submit'+form_id]){
1173
  jQuery(elem).focus(function() {
1174
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1175
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1176
  }).blur(function() {
1177
  wd_is_filled(form_id, wdid);
1178
  });
1179
  }
1180
  });
1181
  break;
1182
  }
1183
  case 'type_password': {
1184
  var element = "#wdform_" + wdid + "_element" + form_id;
1185
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1186
  if(jQuery(element).val() == ""){
1187
  not_filled[wdid] = element;
1188
  }
1189
  }
1190
  if(!field_id && !window['check_submit'+form_id]){
1191
  jQuery(element).focus(function() {
1192
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1193
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1194
  }).blur(function() {
1195
  wd_is_filled(form_id, wdid);
1196
  });
1197
  }
1198
  break;
1199
  }
1200
  case 'type_file_upload': {
1201
  var element = "#wdform_" + wdid + "_element" + form_id;
1202
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1203
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
1204
  not_filled[wdid] = element;
1205
  }
1206
  }
1207
  if(!field_id && !window['check_submit'+form_id]) {
1208
  jQuery(element).focus(function() {
1209
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1210
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1211
  }).change(function() {
1212
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1213
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1214
  wd_is_filled(form_id, wdid);
1215
  });
1216
  }
1217
  break;
1218
  }
1219
  case 'type_matrix': {
1220
  if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="radio" || jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="checkbox"){
1221
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1222
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
1223
  not_filled[wdid] = true;
1224
  }
1225
  }
1226
  if(!field_id && !window['check_submit'+form_id]) {
1227
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1228
  jQuery(this).change(function() {
1229
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
1230
  wd_is_filled(form_id, wdid);
1231
  }
1232
  else{
1233
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1234
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1235
  }
1236
  });
1237
  });
1238
  }
1239
  }
1240
  else if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="text") {
1241
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1242
  var count_input_matrix = 0;
1243
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1244
  if(jQuery(this).val() != "")
1245
  count_input_matrix ++;
1246
  });
1247
  if(count_input_matrix == 0)
1248
  not_filled[wdid] = true;
1249
  }
1250
  if(!field_id && !window['check_submit'+form_id]){
1251
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1252
  jQuery(this)
1253
  .focus(function() {
1254
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1255
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1256
  })
1257
  .blur(function() {
1258
  wd_is_filled(form_id, wdid);
1259
  });
1260
  });
1261
  }
1262
  }
1263
  else {
1264
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1265
  var count_select_matrix = 0;
1266
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
1267
  if(jQuery(this).val() != "")
1268
  count_select_matrix ++;
1269
  });
1270
  if(count_select_matrix == 0)
1271
  not_filled[wdid] = true;
1272
  }
1273
  if(!field_id && !window['check_submit'+form_id]){
1274
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
1275
  jQuery(this).focus(function() {
1276
  if(jQuery(this).val() == ""){
1277
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1278
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1279
  }
1280
  }).change(function() {
1281
  wd_is_filled(form_id, wdid);
1282
  }).blur(function() {
1283
  wd_is_filled(form_id, wdid);
1284
  });
1285
  });
1286
  }
1287
  }
1288
  break;
1289
  }
1290
  case 'type_send_copy': {
1291
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1292
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
1293
  not_filled[wdid] = true;
1294
  }
1295
  }
1296
  if(!field_id && !window['check_submit'+form_id]){
1297
  jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").change(function() {
1298
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
1299
  wd_is_filled(form_id, wdid);
1300
  }
1301
  else {
1302
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1303
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1304
  }
1305
  });
1306
  }
1307
  break;
1308
  }
1309
  case 'type_captcha':
1310
  case 'type_arithmetic_captcha': {
1311
  var element = "";
1312
  if(window['labels_and_ids'+form_id][wdid] == 'type_captcha') {
1313
  element = '#wd_captcha_input' + form_id;
1314
  }
1315
  else {
1316
  element = '#wd_arithmetic_captcha_input' + form_id;
1317
  }
1318
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1319
  if(jQuery(element).val() == ""){
1320
  not_filled[wdid] = element;
1321
  }
1322
  }
1323
  if(!field_id && !window['check_submit'+form_id]){
1324
  jQuery(element).focus(function() {
1325
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1326
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1327
  }).blur(function() {
1328
  wd_is_filled(form_id, wdid);
1329
  });
1330
  }
1331
  break;
1332
  }
1333
  }
1334
  }
1335
  });
1336
  if (Object.keys(not_filled).length === 0 && Object.keys(window["check_before_submit" + form_id]).length === 0) {
1337
  return true;
1338
  }
1339
  else {
1340
  if (Object.keys(not_filled).length !== 0) {
1341
  jQuery.each( not_filled, function( wdid, elem ) {
1342
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1343
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-element-section:first").append("<div id='wd_required_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_field_is_required + "</div>");
1344
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label");
1345
  });
1346
  }
1347
  if(!field_id){
1348
  scroll_on_element(form_id);
1349
  }
1350
  window['check_submit'+form_id] = 1;
1351
  return false;
1352
  }
1353
  var x = jQuery("#form" + form_id);
1354
  var check_price_min_max = price_nim_max ? price_nim_max : window['check_paypal_price_min_max'+form_id];
1355
  var find_wrong_price = false;
1356
  jQuery.each( check_price_min_max, function( wdid, min_max_option ) {
1357
  var element = "#wdform_" + wdid + "_element" + form_id;
1358
  var range_min = min_max_option[3] ? min_max_option[3] : 0;
1359
  var range_max = min_max_option[4] ? min_max_option[4] : -1;
1360
  if((min_max_option[2] ? true : false) || jQuery(element).val()!=min_max_option[1]) {
1361
  if((range_max!=-1 && parseFloat(jQuery(element).val()) > range_max) || parseFloat(jQuery(element).val()) < range_min) {
1362
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
1363
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_min_max_check_1 + min_max_option[0] + fm_objectL10n.fm_min_max_check_2 + (min_max_option[3] ? min_max_option[3] : 0) + '-' + (min_max_option[4] ? min_max_option[4] : "any") + "</div>");
1364
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
1365
  find_wrong_price = true;
1366
  if(!price_nim_max) {
1367
  scroll_on_element(form_id);
1368
  }
1369
  }
1370
  }
1371
  });
1372
  if(find_wrong_price === false) {
1373
  return true;
1374
  }
1375
  return false;
1376
  var x = jQuery("#form" + form_id);
1377
  var find_wrong_values = false;
1378
  var spinner_check = spinner_check_field ? spinner_check_field : window['spinner_check'+form_id];
1379
  jQuery.each( spinner_check, function( wdid, spinner_values ) {
1380
  var element = "#wdform_" + wdid + "_element" + form_id;
1381
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
1382
  if(parseInt(jQuery(element).val()) < parseInt(spinner_values[0]) || parseInt(jQuery(element).val()) > parseInt(spinner_values[1])) {
1383
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
1384
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_spinner_check + (spinner_values[0] ? spinner_values[0] : 0) + '-' + (spinner_values[1] ? spinner_values[1] : "any") + "</div>");
1385
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
1386
  find_wrong_values = true;
1387
  if(!spinner_check_field) {
1388
  scroll_on_element(form_id);
1389
  }
1390
  }
1391
  }
1392
  });
1393
  if(find_wrong_values === false) {
1394
  return true;
1395
  }
1396
  return false;
1397
  var scrollPercent = 100 * jQuery(window).scrollTop() / (jQuery(document).height() - jQuery(window).height());
1398
  if(!jQuery("#fm-scrollbox" + form_id).hasClass("fm-minimized") && scrollPercent >= window["scrollbox_trigger_point" + form_id]) {
1399
  setTimeout(function() {
1400
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1401
  jQuery("#fm-scrollbox" + form_id).css("visibility", "");
1402
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").addClass("fm-animated " + window["header_image_animation" + form_id]);
1403
  }, window["scrollbox_loading_delay" + form_id] * 1000);
1404
  } else {
1405
  if(window["scrollbox_auto_hide" + form_id]) {
1406
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").removeClass("fm-animated " + window["header_image_animation" + form_id]);
1407
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
1408
  }
1409
  }
1410
  if (typeof window["before_submit" + form_id] == 'function') {
1411
  if (window["before_submit" + form_id]()) {
1412
  return false;
1413
  }
1414
  }
1415
  if (!fm_check(0, form_id)) {
1416
  return false;
1417
  }
1418
  jQuery("#form" + form_id + " button").each(function () {
1419
  jQuery(this).attr('disabled', 'disabled');
1420
  });
1421
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"submit\" />").appendTo("#form"+form_id);
1422
  window["onsubmit_js" + form_id]();
1423
  if(window['checkStripe' + form_id] == 1) {
1424
  var jq_mainForm = jQuery("form[id='form"+form_id+"']");
1425
  if (jq_mainForm.find(".wdfm_stripe_elem").first().parents(".wdform_row").is(":visible")) {
1426
  wdfm_call_stripe();
1427
  }
1428
  else {
1429
  jQuery("#form"+form_id).submit();
1430
  }
1431
  }
1432
  else {
1433
  jQuery("#form"+form_id).submit();
1434
  }
1435
  if ( typeof window["before_reset" + form_id] == 'function' ) {
1436
  window["before_reset" + form_id]();
1437
  }
1438
  jQuery.each(window['labels_and_ids'+form_id], function (index, elem) {
1439
  switch(elem) {
1440
  case "type_text":
1441
  case "type_textarea":
1442
  case "type_number":
1443
  case "type_spinner":
1444
  case 'type_own_select':
1445
  case 'type_country':
1446
  case 'type_date':
1447
  case 'type_date_new':
1448
  case 'type_hidden':
1449
  case 'type_paypal_price_new':
1450
  jQuery("#wdform_"+index+"_element"+form_id).val('');
1451
  break;
1452
  case 'type_submitter_mail':
1453
  case 'type_password':
1454
  jQuery("#wdform_"+index+"_element"+form_id).val('');
1455
  if(jQuery("#wdform_"+index+"_1_element"+form_id)){
1456
  jQuery("#wdform_"+index+"_1_element"+form_id).val('');
1457
  if(jQuery("#confirm_"+index+"_"+form_id))
1458
  jQuery("#confirm_"+index+"_"+form_id).remove();
1459
  if(elem == 'type_submitter_mail' && jQuery("#check_email_"+index+"_"+form_id))
1460
  jQuery("#check_email_"+index+"_"+form_id).remove();
1461
  }
1462
  break;
1463
  case 'type_date_range':
1464
  jQuery("#wdform_"+index+"_element"+form_id+"0").val('');
1465
  jQuery("#wdform_"+index+"_element"+form_id+"1").val('');
1466
  break;
1467
  case 'type_send_copy':
1468
  jQuery("#wdform_"+index+"_element"+form_id).prop('checked', false);
1469
  break;
1470
  case 'type_phone':
1471
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id).val('');
1472
  break;
1473
  case 'type_name':
1474
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id+", #wdform_"+index+"_element_title"+form_id+", #wdform_"+index+"_element_middle"+form_id).val('');
1475
  break;
1476
  case 'type_address':
1477
  jQuery("#wdform_"+index+"_street1"+form_id+", #wdform_"+index+"_street2"+form_id+", #wdform_"+index+"_city"+form_id+", #wdform_"+index+"_state"+form_id+", #wdform_"+index+"_postal"+form_id+", #wdform_"+index+"_country"+form_id).val('');
1478
  break;
1479
  case 'type_checkbox':
1480
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
1481
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
1482
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
1483
  break;
1484
  case 'type_radio':
1485
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1486
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
1487
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
1488
  break;
1489
  case 'type_time':
1490
  jQuery("#wdform_"+index+"_hh"+form_id+", #wdform_"+index+"_mm"+form_id+", #wdform_"+index+"_ss"+form_id+", #wdform_"+index+"_am_pm"+form_id).val('');
1491
  break;
1492
  case 'type_date_fields':
1493
  jQuery("#wdform_"+index+"_day"+form_id+", #wdform_"+index+"_month"+form_id+", #wdform_"+index+"_year"+form_id).val('');
1494
  break;
1495
  case 'type_file_upload':
1496
  jQuery("#wdform_"+index+"_element"+form_id+"_save").remove();
1497
  break;
1498
  case 'type_paypal_price':
1499
  jQuery("#wdform_"+index+"_element_dollars"+form_id+", #wdform_"+index+"_element_cents"+form_id).val('');
1500
  break;
1501
  case 'type_paypal_select':
1502
  jQuery("#wdform_"+index+"_element"+form_id+", #wdform_"+index+"_element_quantity"+form_id+", #form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
1503
  break;
1504
  case 'type_paypal_radio':
1505
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
1506
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1507
  break;
1508
  case 'type_paypal_shipping':
1509
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1510
  break;
1511
  case 'type_paypal_checkbox':
1512
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
1513
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
1514
  break;
1515
  case 'type_star_rating':
1516
  jQuery("#wdform_"+index+"_selected_star_amount"+form_id).val('');
1517
  jQuery("#wdform_"+index+"_element"+form_id+" img").attr('src', fm_objectL10n.plugin_url + '/images/star.png');
1518
  break;
1519
  case 'type_scale_rating':
1520
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1521
  break;
1522
  case 'type_slider':
1523
  jQuery("#wdform_"+index+"_element"+form_id).slider({
1524
  value: eval(0),
1525
  });
1526
  jQuery("#wdform_"+index+"_element_value"+form_id).html('0');
1527
  break;
1528
  case 'type_range':
1529
  jQuery("#wdform_"+index+"_element"+form_id+"0, #wdform_"+index+"_element"+form_id+"1").val('');
1530
  break;
1531
  case 'type_grading':
1532
  jQuery("#wdform_"+index+"_element"+form_id+" input").val('');
1533
  break;
1534
  case 'type_matrix':
1535
  jQuery("#wdform_"+index+"_element"+form_id+" .radio-div input").prop('checked', false);
1536
  jQuery("#wdform_"+index+"_element"+form_id+" .checkbox-div input").prop('checked', false);
1537
  jQuery("#wdform_"+index+"_element"+form_id+" input[type='text']").val('');
1538
  jQuery("#wdform_"+index+"_element"+form_id+" select").val('');
1539
  break;
1540
  case 'type_paypal_total':
1541
  jQuery("#wdform_"+index+"div_total"+form_id).html('$0');
1542
  jQuery("#wdform_"+index+"paypal_products"+form_id).empty();
1543
  break;
1544
  default:
1545
  break;
1546
  }
1547
  });
1548
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"save\" />").appendTo("#form"+form_id);
1549
  window["onsubmit_js" + form_id]();
1550
  jQuery("#form" + form_id + " button").each(function () {
1551
  jQuery(this).attr('disabled', 'disabled');
1552
  });
1553
  jQuery("#form"+form_id).submit();
1554
  var clear_data = confirm(fm_objectL10n.fm_clear_data);
1555
  if (clear_data == true) {
1556
  jQuery("#form" + form_id + " button").each(function () {
1557
  jQuery(this).attr('disabled', 'disabled');
1558
  });
1559
  jQuery.get(fm_objectL10n.form_maker_admin_ajax + '?action=FMClearProg&addon_task=clear_data&form_id=' + form_id).done(function() {
1560
  window.location = jQuery('#form' + form_id).attr('action');
1561
  });
1562
  }
1563
  if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
1564
  jQuery("#form" + form_id).find(jQuery("input[type='radio']")).click(function() {
1565
  jQuery("input[type='radio']+label").removeClass('if-ie-div-label');
1566
  jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')
1567
  });
1568
  jQuery("#form" + form_id).find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
1569
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']")).click(function() {
1570
  jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label');
1571
  jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')
1572
  });
1573
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']:checked+label")).addClass('if-ie-div-label');
1574
  }
1575
  jQuery.each(window["check_regExp_all" + form_id], function( wdid, exp ) {
1576
  var exp_array = {};
1577
  exp_array[wdid] = exp;
1578
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
1579
  wd_check_regExp(form_id, exp_array);
1580
  }).focus(function() {
1581
  jQuery("#form" + form_id + " #wd_exp_"+wdid).remove();
1582
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_exp").removeClass("error_label_exp")
1583
  });
1584
  });
1585
  jQuery.each(window["check_paypal_price_min_max" + form_id], function( wdid, price_min_max_option ) {
1586
  var price_min_max_array = {};
1587
  price_min_max_array[wdid] = price_min_max_option;
1588
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
1589
  wd_check_price_min_max(form_id, price_min_max_array)
1590
  }).focus(function() {
1591
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
1592
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
1593
  });
1594
  });
1595
  jQuery.each(window["spinner_check" + form_id], function( wdid, spinner_min_max ) {
1596
  var spinner_min_max_array = {};
1597
  spinner_min_max_array[wdid] = spinner_min_max;
1598
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
1599
  wd_spinner_check(form_id, spinner_min_max_array)
1600
  }).focus(function() {
1601
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
1602
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
1603
  });
1604
  });
1605
  jQuery.each(window["file_upload_check" + form_id], function( wdid, upload_types ) {
1606
  var upload_types_array = {};
1607
  upload_types_array[wdid] = upload_types;
1608
  jQuery("div[wdid='" + wdid + "'] input").change(function() {
1609
  wd_file_upload_check(form_id, upload_types_array);
1610
  });
1611
  });
1612
  jQuery("div[type='type_text'] input, div[type='type_number'] input, div[type='type_phone'] input, div[type='type_name'] input, div[type='type_submitter_mail'] input, div[type='type_submitter_mail_confirmation'] input, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input, div[type='type_textarea'] textarea").focus(function() {
1613
  delete_value(this)
1614
  }).blur(function() {
1615
  return_value(this)
1616
  });
1617
  jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity, div[type='type_paypal_price_new'] input").keypress(function(evt) {
1618
  return check_isnum(evt);
1619
  });
1620
  jQuery("div[type='type_grading'] input").keypress(function(evt) {
1621
  return check_isnum_or_minus(evt);
1622
  });
1623
  jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function() {
1624
  set_total_value(form_id);
1625
  });
1626
  jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input").change(function() {
1627
  set_total_value(form_id);
1628
  });
1629
  jQuery(".wdform-quantity").change(function() {
1630
  set_total_value(form_id);
1631
  });
1632
  jQuery("div[type='type_address'] select").change(function() {
1633
  set_total_value(form_id);
1634
  });
1635
  jQuery("div[type='type_time'] input").blur(function() {
1636
  add_0(this);
1637
  });
1638
  jQuery('.wdform-element-section').each(function() {
1639
  if(!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
1640
  if(jQuery(this).css('display')=="table-cell") {
1641
  if(jQuery(this).parent().attr('type')!="type_captcha") {
1642
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1643
  }
1644
  else {
1645
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1646
  }
1647
  }
1648
  }
1649
  if (!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
1650
  if (jQuery(this).css('display') == "table-cell") {
1651
  if (jQuery(this).parent().attr('type') != "type_captcha") {
1652
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1653
  }
1654
  else {
1655
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1656
  }
1657
  }
1658
  }
1659
  if(parseInt(jQuery(this)[0].style.width.replace('px', '')) < parseInt(jQuery(this).css('min-width').replace('px', ''))) {
1660
  jQuery(this).css('min-width', parseInt(jQuery(this)[0].style.width.replace('px', ''))-10);
1661
  }
1662
  });
1663
  jQuery('.wdform-label').each(function() {
1664
  if(parseInt(jQuery(this).height()) >= 2*parseInt(jQuery(this).css('line-height').replace('px', ''))) {
1665
  jQuery(this).parent().css('max-width', jQuery(this).parent().width());
1666
  jQuery(this).parent().css('width', '');
1667
  }
1668
  });
1669
  (function(jQuery) {
1670
  jQuery.fn.shuffle = function() {
1671
  var allElems = this.get(),
1672
  getRandom = function(max) {
1673
  return Math.floor(Math.random() * max);
1674
  },
1675
  shuffled = jQuery.map(allElems, function() {
1676
  var random = getRandom(allElems.length),
1677
  randEl = jQuery(allElems[parseInt(random)]).clone(true)[0];
1678
  allElems.splice(random, 1);
1679
  return randEl;
1680
  });
1681
  this.each(function(i) {
1682
  jQuery(this).replaceWith(jQuery(shuffled[i]));
1683
  });
1684
  return jQuery(shuffled);
1685
  };
1686
  })(jQuery);
1687
  window["onload_js" + form_id]();
1688
  window["condition_js" + form_id]();
1689
  if (typeof window["before_load" + form_id] == 'function') {
1690
  window["before_load" + form_id]();
1691
  }
1692
  for(i=1; i<=30; i++) {
1693
  if (document.getElementById(form_id + 'form_view' + i)) {
1694
  window['form_view_count' + form_id]++;
1695
  window['form_view_max' + form_id] = i;
1696
  }
1697
  }
1698
  if (window['form_view_count' + form_id] > 1) {
1699
  for (i = 1; i <= window['form_view_max' + form_id]; i++) {
1700
  if (document.getElementById(form_id + 'form_view' + i)) {
1701
  window['first_form_view' + form_id] = i;
1702
  break;
1703
  }
1704
  }
1705
  generate_page_nav(window['first_form_view' + form_id], form_id, window['form_view_count' + form_id], window['form_view_max' + form_id]);
1706
  }
1707
  fm_initilize_form(form_id);
1708
  if(!wd_is_filled(form_id)) {
1709
  return false;
1710
  }
1711
  if(!wd_check_regExp(form_id)) {
1712
  return false;
1713
  }
1714
  if(!wd_check_price_min_max(form_id)) {
1715
  return false;
1716
  }
1717
  if(!wd_spinner_check(form_id)) {
1718
  return false;
1719
  }
1720
  if(!wd_file_upload_check(form_id)) {
1721
  return false;
1722
  }
1723
  window["check_js" + form_id](id, form_id);
1724
  return true;
1725
  jQuery(".g-recaptcha").each(function () {
1726
  grecaptcha.render(jQuery(this).attr('id'), {
1727
  'sitekey': jQuery(this).attr('data-sitekey'),
1728
  'theme': 'light'
1729
  });
1730
  });
 
1731
  jQuery(".wd-datepicker").each(function () {
1732
  jQuery(this).datepicker();
1733
  jQuery(this).datepicker("option", "dateFormat", jQuery(this).data("format"));
1734
  });
1735
  var FormCurrency = eval("FormCurrency_" + form_id);
1736
  if(jQuery('.paypal_total'+form_id).length==0) {
1737
  return;
1738
  }
1739
  var div_paypal_show = jQuery('.paypal_total'+form_id);
1740
  var div_paypal_products = jQuery('.paypal_products'+form_id);
1741
  var div_paypal_tax = jQuery('.paypal_tax'+form_id);
1742
  var input_paypal_total = jQuery('.input_paypal_total'+form_id);
1743
  var total=0;
1744
  var total_shipping=0;
1745
  div_paypal_products.html('');
1746
  div_paypal_tax.html('');
1747
  n = parseInt(jQuery('#counter'+form_id).val());
1748
  jQuery("#form" +form_id+ " div[type='type_paypal_checkbox'], #form" +form_id+ " div[type='type_paypal_radio']").each(function() {
1749
  id=jQuery(this).parent().attr('wdid');
1750
  jQuery(this).find('input:checked').each(
1751
  function() {
1752
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
1753
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
1754
  total =total + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
1755
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1756
  }
1757
  );
1758
  });
1759
  jQuery("#form" +form_id+ " div[type='type_paypal_shipping']").each(function() {
1760
  id=jQuery(this).parent().attr('wdid');
1761
  jQuery(this).find('input:checked').each(
1762
  function() {
1763
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
1764
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
1765
  total_shipping =total_shipping + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
1766
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1767
  }
1768
  );
1769
  });
1770
  jQuery("#form" +form_id+ " div[type='type_paypal_select']").each(function() {
1771
  id=jQuery(this).parent().attr('wdid');
1772
  if(jQuery(this).find('select').val()!='') {
1773
  label = jQuery(this).find('select option:selected').html();
1774
  span_value = FormCurrency + jQuery(this).find('select').val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
1775
  total =total + jQuery(this).find('select').val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
1776
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1777
  }
1778
  });
1779
  jQuery("#form" +form_id+ " div[type='type_paypal_price']").each(function() {
1780
  id=jQuery(this).parent().attr('wdid');
1781
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active') || jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active')) {
1782
  label= jQuery(this).find('.wdform-label').html();
1783
  cents='00';
1784
  dollars='0';
1785
  if( jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active')) {
1786
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).val()!='') {
1787
  dollars=jQuery('#wdform_'+id+"_element_dollars"+form_id).val();
1788
  }
1789
  }
1790
  if( jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active') && jQuery('#wdform_'+id+"_element_cents"+form_id).val()!='') {
1791
  if(jQuery('#wdform_'+id+"_element_cents"+form_id).val().length==1) {
1792
  cents='0'+jQuery('#wdform_'+id+"_element_cents"+form_id).val();
1793
  }
1794
  else {
1795
  cents=jQuery('#wdform_'+id+"_element_cents"+form_id).val();
1796
  }
1797
  }
1798
  span_value = FormCurrency + dollars+'.'+cents;
1799
  total =total + parseFloat(dollars+'.'+cents);
1800
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1801
  }
1802
  });
1803
  jQuery("#form" +form_id+ " div[type='type_paypal_price_new']").each(function(){
1804
  id=jQuery(this).parent().attr('wdid');
1805
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
1806
  label= jQuery(this).find('.wdform-label').html();
1807
  dollars='0';
1808
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
1809
  if(jQuery('#wdform_'+id+"_element"+form_id).val()!='') {
1810
  dollars=jQuery('#wdform_'+id+"_element"+form_id).val();
1811
  }
1812
  }
1813
  span_value = FormCurrency + dollars;
1814
  total =total + parseFloat(dollars);
1815
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1816
  }
1817
  });
1818
  var FormPaypalTax = eval("FormPaypalTax_" + form_id);
1819
  if(FormPaypalTax != 0) {
1820
  div_paypal_tax.html('Tax: ' + FormCurrency + (((total)*FormPaypalTax) / 100).toFixed(2));
1821
  }
1822
  jQuery('.div_total'+form_id).html(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
1823
  input_paypal_total.val(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
1824
  var chCode1 = e.which || e.keyCode;
1825
  if (chCode1 != 45) {
1826
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1827
  return false;
1828
  }
1829
  }
1830
  return true;
1831
  var sum = 0;
1832
  for(var k=0; k<100;k++) {
1833
  if(document.getElementById(num+'_element'+form_id+'_'+k)) {
1834
  if(document.getElementById(num+'_element'+form_id+'_'+k).value) {
1835
  sum = sum+parseInt(document.getElementById(num+'_element'+form_id+'_'+k).value);
1836
  }
1837
  }
1838
  if(document.getElementById(num+'_total_element'+form_id)) {
1839
  if(sum > document.getElementById(num+'_total_element'+form_id).innerHTML) {
1840
  document.getElementById(num+'_text_element'+form_id).innerHTML =" "+ fm_objectL10n.fm_grading_text + " " + document.getElementById(num+'_total_element'+form_id).innerHTML;
1841
  }
1842
  else {
1843
  document.getElementById(num+'_text_element'+form_id).innerHTML="";
1844
  }
1845
  }
1846
  }
1847
  if(document.getElementById(num+'_sum_element'+form_id)) {
1848
  document.getElementById(num+'_sum_element'+form_id).innerHTML = sum;
1849
  }
1850
  if(rated==false) {
1851
  for(var j=0;j<=id;j++) {
1852
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+'.png';
1853
  }
1854
  }
1855
  if(rated==false) {
1856
  for(var j=0;j<=id;j++) {
1857
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
1858
  }
1859
  }
1860
  rated=true;
1861
  for(var j=0;j<=id;j++) {
1862
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+".png";
1863
  }
1864
  for(var k=id+1;k<=star_amount-1;k++) {
1865
  document.getElementById(el_id+'_star_'+k+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
1866
  }
1867
  document.getElementById(el_id+'_selected_star_amount'+form_id).value=id+1;
1868
  var element_other = jQuery('.form' + form_id + ' [id^=' + num + '_element' + form_id + '][other="1"]');
1869
  var parent_ = element_other.parent();
1870
  var br = document.createElement('br');
1871
  br.setAttribute("id", num + "_other_br" + form_id);
1872
  var elem_id = num.split("_")[1];
1873
  var el_other = document.createElement('input');
1874
  el_other.setAttribute("id", num + "_other_input" + form_id);
1875
  el_other.setAttribute("name", num + "_other_input" + form_id);
1876
  el_other.setAttribute("type", "text");
1877
  el_other.setAttribute("class", "other_input");
1878
  el_other.setAttribute("onchange", "other_input_change(this, '" + form_id + "', '" + elem_id + "')");
1879
  parent_.append(br);
1880
  parent_.append(el_other);
1881
  if (jQuery(elem).val() == "") {
1882
  wd_is_filled(form_id, wdid);
1883
  }
1884
  else {
1885
  jQuery("#form" + form_id + " #wd_required_" + wdid).remove();
1886
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label").removeClass("error_label");
1887
  }
1888
  var chCode1 = e.which || e.keyCode;
1889
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
1890
  return true;
1891
  }
1892
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1893
  return false;
1894
  }
1895
  return true;
1896
  srcArr=document.getElementById(id+genid).src.split("&r=");
1897
  document.getElementById(id+genid).src=srcArr[0]+'&r='+Math.floor(Math.random()*100);
1898
  document.getElementById(id+"_input"+genid).value='';
1899
  document.getElementById(id+genid).style.display="inline-block";
1900
  checking=document.getElementById(id+"_element"+form_id+j);
1901
  if(checking.getAttribute('other')) {
1902
  if(checking.getAttribute('other')==1) {
1903
  if(!checking.checked) {
1904
  if(document.getElementById(id+"_other_input"+form_id)) {
1905
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
1906
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
1907
  }
1908
  return false;
1909
  }
1910
  }
1911
  }
1912
  return true;
1913
  if(document.getElementById(id+"_other_input"+form_id)) {
1914
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
1915
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
1916
  }
1917
  if(jQuery(x).val().length==1) {
1918
  jQuery(x).val('0'+jQuery(x).val());
1919
  }
1920
  var chCode1 = e.which || e.keyCode;
1921
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1922
  return false;
1923
  }
1924
  hour=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1925
  hour=parseFloat(hour);
1926
  if((hour<0) || (hour>hour_interval)) {
1927
  return false;
1928
  }
1929
  return true;
1930
  var chCode1 = e.which || e.keyCode;
1931
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1932
  return false;
1933
  }
1934
  minute=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1935
  minute=parseFloat(minute);
1936
  if ((minute<0) || (minute>59)) {
1937
  return false;
1938
  }
1939
  return true;
1940
  var chCode1 = e.which || e.keyCode;
1941
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1942
  return false;
1943
  }
1944
  second=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1945
  second=parseFloat(second);
1946
  if ((second<0) || (second>59)) {
1947
  return false;
1948
  }
1949
  return true;
1950
  var chCode1 = e.which || e.keyCode;
1951
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
1952
  return true;
1953
  }
1954
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1955
  return false;
1956
  }
1957
  val1=""+jQuery(x).val()+String.fromCharCode(chCode1);
1958
  if (val1.length>2) {
1959
  return false;
1960
  }
1961
  if (val1=='00') {
1962
  return false;
1963
  }
1964
  if ((val1<from) || (val1>to)) {
1965
  return false;
1966
  }
1967
  return true;
1968
  year=jQuery(x).val();
1969
  from=parseFloat(jQuery(x).attr('from'));
1970
  to=parseFloat(jQuery(x).attr('to'));
1971
  year=parseFloat(year);
1972
  if((year>=from) && (year<=to)) {
1973
  jQuery(x).val(year);
1974
  }
1975
  else {
1976
  jQuery(x).val('');
1977
  }
1978
  var chCode1 = e.which || e.keyCode;
1979
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1980
  return false;
1981
  }
1982
  day=""+jQuery(x).val()+String.fromCharCode(chCode1);
1983
  if(day.length>2) {
1984
  return false;
1985
  }
1986
  if(day=='00') {
1987
  return false;
1988
  }
1989
  day=parseFloat(day);
1990
  if((day<0) || (day>31)) {
1991
  return false;
1992
  }
1993
  return true;
1994
  var chCode1 = e.which || e.keyCode;
1995
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1996
  return false;
1997
  }
1998
  month=""+jQuery(x).val()+String.fromCharCode(chCode1);
1999
  if(month.length>2) {
2000
  return false;
2001
  }
2002
  if(month=='00') {
2003
  return false;
2004
  }
2005
  month=parseFloat(month);
2006
  if((month<0) || (month>12)) {
2007
  return false;
2008
  }
2009
  return true;
2010
  var chCode1 = e.which || e.keyCode;
2011
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
2012
  return false;
2013
  }
2014
  year=""+jQuery(x).val()+String.fromCharCode(chCode1);
2015
  to=parseFloat(jQuery(x).attr('to'));
2016
  year=parseFloat(year);
2017
  if(year>to) {
2018
  return false;
2019
  }
2020
  return true;
2021
  ofontStyle=jQuery(x).attr('class');
2022
  if(ofontStyle.indexOf("input_deactive")!=-1) {
2023
  jQuery(x).val("").removeClass("input_deactive").addClass("input_active");
2024
  }
2025
  if(jQuery(x).val()=="") {
2026
  jQuery(x).val(jQuery(x).attr('title')).removeClass("input_active").addClass("input_deactive");
2027
  }
2028
  while (node.firstChild) {
2029
  node.removeChild(node.firstChild);
2030
  }
2031
  form_view=id;
2032
  page_nav=document.getElementById(form_id+'page_nav'+id);
2033
  destroyChildren(page_nav);
2034
  form_view_elemet=document.getElementById(form_id+'form_view'+id);
2035
  remove_whitespace(form_view_elemet.parentNode.parentNode);
2036
  display_none_form_views_all(form_id);
2037
  generate_page_bar(id, form_id, form_view_count, form_view_max);
2038
  form_view_elemet.parentNode.style.display="";
2039
  var td = document.createElement("div");
2040
  td.setAttribute("valign", "middle");
2041
  td.setAttribute("align", "left");
2042
  td.style.display="table-cell";
2043
  td.style.width="40%";
2044
  page_nav.appendChild(td);
2045
  if(form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
2046
  if(form_view_elemet.parentNode.previousSibling.tagName=="DIV") {
2047
  table=form_view_elemet.parentNode.previousSibling;
2048
  }
2049
  else {
2050
  if(form_view_elemet.parentNode.previousSibling.previousSibling.tagName=="DIV") {
2051
  table=form_view_elemet.parentNode.previousSibling.previousSibling;
2052
  }
2053
  else {
2054
  table="none";
2055
  }
2056
  }
2057
  if(table!="none") {
2058
  if(!table.firstChild.tagName) {
2059
  table.removeChild(table.firstChild);
2060
  }
2061
  previous_title = form_view_elemet.getAttribute('previous_title');
2062
  previous_type = form_view_elemet.getAttribute('previous_type');
2063
  if(previous_type=="text") {
2064
  td.setAttribute("class", "previous-page");
2065
  }
2066
  previous_class = form_view_elemet.getAttribute('previous_class');
2067
  previous_checkable = form_view_elemet.getAttribute('previous_checkable');
2068
  next_or_previous="previous";
2069
  previous=make_pagebreak_button(next_or_previous, previous_title, previous_type, previous_class, previous_checkable, id, form_id, form_view_count, form_view_max);
2070
  td.appendChild(previous);
2071
  }
2072
  }
2073
  var td = document.createElement("div");
2074
  td.setAttribute("id", form_id+"page_numbers"+form_view);
2075
  td.setAttribute("valign", "middle");
2076
  td.setAttribute("class", "page-numbers");
2077
  td.setAttribute("align", "center");
2078
  td.style.display="table-cell";
2079
  if(document.getElementById('fm-pages' + form_id).getAttribute('show_numbers')=="true") {
2080
  k=0;
2081
  for(j=1; j<=form_view_max; j++) {
2082
  if(document.getElementById(form_id+'form_view'+j)) {
2083
  k++;
2084
  if(j==form_view) {
2085
  page_number=k;
2086
  }
2087
  }
2088
  }
2089
  var cur = document.createElement('span');
2090
  cur.setAttribute("class", "page_numbers");
2091
  cur.innerHTML=page_number+'/'+k;
2092
  td.appendChild(cur);
2093
  }
2094
  page_nav.appendChild(td);
2095
  var td = document.createElement("div");
2096
  td.setAttribute("valign", "middle");
2097
  td.setAttribute("align", "right");
2098
  td.style.cssText = "display:table-cell; width:40%; text-align:right;";
2099
  page_nav.appendChild(td);
2100
  not_next=false;
2101
  if(form_view_elemet.parentNode.nextSibling) {
2102
  if(form_view_elemet.parentNode.nextSibling.tagName=="DIV" && form_view_elemet.parentNode.nextSibling.className=="wdform-page-and-images") {
2103
  table=form_view_elemet.parentNode.nextSibling;
2104
  }
2105
  else {
2106
  if(form_view_elemet.parentNode.nextSibling.nextSibling) {
2107
  if(form_view_elemet.parentNode.nextSibling.nextSibling.tagName=="DIV") {
2108
  table=form_view_elemet.parentNode.nextSibling.nextSibling;
2109
  }
2110
  else {
2111
  table="none";
2112
  }
2113
  }
2114
  else {
2115
  table="none";
2116
  }
2117
  }
2118
  if(table!="none") {
2119
  next_title =form_view_elemet.getAttribute('next_title');
2120
  next_type =form_view_elemet.getAttribute('next_type');
2121
  if(next_type=="text") {
2122
  td.setAttribute("class", "next-page");
2123
  }
2124
  next_class = form_view_elemet.getAttribute('next_class');
2125
  next_checkable = form_view_elemet.getAttribute('next_checkable');
2126
  next_or_previous="next";
2127
  next=make_pagebreak_button(next_or_previous, next_title, next_type, next_class, next_checkable, id, form_id, form_view_count, form_view_max);
2128
  td.appendChild(next);
2129
  }
2130
  else {
2131
  not_next=true;
2132
  }
2133
  }
2134
  else {
2135
  not_next=true;
2136
  }
2137
  fm_initilize_form(form_id);
2138
  jQuery("#form" + form_id + " div[type='type_map']").each(function() {
2139
  id=jQuery(this).parent().attr('wdid');
2140
  if_gmap_init('wdform_'+id, form_id);
2141
  for(q=0; q<20; q++) {
2142
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
2143
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
2144
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
2145
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
2146
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,false);
2147
  }
2148
  }
2149
  });
2150
  jQuery("#form" + form_id + " div[type='type_mark_map']").each(function() {
2151
  id=jQuery(this).parent().attr('wdid');
2152
  if_gmap_init('wdform_'+id, form_id);
2153
  q=0;
2154
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
2155
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
2156
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
2157
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
2158
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,true);
2159
  }
2160
  });
2161
  jQuery('.wdform-element-section').each(function() {
2162
  });
2163
  for(t=1; t<30; t++) {
2164
  if(document.getElementById(form_id+'form_view'+t)) {
2165
  document.getElementById(form_id+'form_view'+t).parentNode.style.display="none";
2166
  }
2167
  }
2168
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='steps') {
2169
  make_page_steps_front(form_view, form_id, form_view_count, form_view_max);
2170
  }
2171
  else {
2172
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='percentage') {
2173
  make_page_percentage_front(form_view, form_id, form_view_count, form_view_max);
2174
  }
2175
  else {
2176
  make_page_none_front(form_id);
2177
  }
2178
  }
2179
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='show_numbers') {
2180
  td = document.getElementById(form_id+'page_numbers'+form_view);
2181
  if(td) {
2182
  destroyChildren(td);
2183
  k=0;
2184
  for(j=1; j<=form_view_max; j++) {
2185
  if(document.getElementById(form_id+'form_view'+j)) {
2186
  k++;
2187
  if(j==form_view) {
2188
  page_number=k;
2189
  }
2190
  }
2191
  }
2192
  var cur = document.createElement('span');
2193
  cur.setAttribute("class", "page_numbers");
2194
  cur.innerHTML=page_number+'/'+k;
2195
  td.appendChild(cur);
2196
  }
2197
  }
2198
  else {
2199
  td = document.getElementById(form_id+'page_numbers'+form_view);
2200
  if(td) {
2201
  destroyChildren(document.getElementById(form_id+'page_numbers'+form_view));
2202
  }
2203
  }
2204
  destroyChildren(document.getElementById('fm-pages' + form_id));
2205
  show_title =(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
2206
  next_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('next_checkable')=='true');
2207
  previous_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('previous_checkable')=='true');
2208
  k=0;
2209
  for(j=1; j<=form_view_max; j++) {
2210
  if(document.getElementById(form_id+'form_view'+j)) {
2211
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
2212
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
2213
  }
2214
  else {
2215
  w_pages="";
2216
  }
2217
  k++;
2218
  page_number = document.createElement('span');
2219
  page_number.setAttribute('id','page_'+j);
2220
  if(j<form_view) {
2221
  if(previous_checkable) {
2222
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2223
  }
2224
  else {
2225
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2226
  }
2227
  }
2228
  if(j>form_view) {
2229
  if(next_checkable) {
2230
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2231
  }
2232
  else {
2233
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2234
  }
2235
  }
2236
  if(j==form_view) {
2237
  page_number.setAttribute('class',"page_active");
2238
  }
2239
  else {
2240
  page_number.setAttribute('class',"page_deactive");
2241
  }
2242
  if(show_title) {
2243
  page_number.innerHTML=w_pages;
2244
  }
2245
  else {
2246
  page_number.innerHTML=k;
2247
  }
2248
  document.getElementById('fm-pages' + form_id).appendChild(page_number);
2249
  }
2250
  }
2251
  destroyChildren(document.getElementById('fm-pages' + form_id));
2252
  show_title=(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
2253
  var div_parent = document.createElement('div');
2254
  div_parent.setAttribute("class", "page_percentage_deactive");
2255
  var div = document.createElement('div');
2256
  div.setAttribute("id", "div_percentage");
2257
  div.setAttribute("class", "page_percentage_active");
2258
  div.setAttribute("align", "right");
2259
  var div_arrow = document.createElement('div');
2260
  div_arrow.setAttribute("class", "wdform_percentage_arrow");
2261
  var b = document.createElement('b');
2262
  b.setAttribute("class", "wdform_percentage_text");
2263
  div.appendChild(b);
2264
  k=0;
2265
  cur_page_title='';
2266
  for(j=1; j<=form_view_max; j++) {
2267
  if(document.getElementById(form_id+'form_view'+j)) {
2268
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
2269
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
2270
  }
2271
  else {
2272
  w_pages="";
2273
  }
2274
  k++;
2275
  if(j==form_view) {
2276
  if(show_title) {
2277
  var cur_page_title = document.createElement('div');
2278
  cur_page_title.innerHTML=w_pages;
2279
  cur_page_title.innerHTML=w_pages;
2280
  cur_page_title.setAttribute("class", "wdform_percentage_title");
2281
  }
2282
  page_number=k;
2283
  }
2284
  }
2285
  }
2286
  b.innerHTML=Math.round(((page_number-1)/k)*100)+'%';
2287
  div.style.width=((page_number-1)/k)*100+'%';
2288
  if(page_number==1) {
2289
  div_arrow.style.display='none';
2290
  }
2291
  div_parent.appendChild(div);
2292
  div_parent.appendChild(div_arrow);
2293
  if(cur_page_title) {
2294
  div_parent.appendChild(cur_page_title);
2295
  }
2296
  document.getElementById('fm-pages' + form_id).appendChild(div_parent);
2297
  destroyChildren(document.getElementById('fm-pages' + form_id));
2298
  switch(type) {
2299
  case 'text': {
2300
  var element = document.createElement('div');
2301
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
2302
  element.setAttribute('class', class_);
2303
  if(checkable=="true") {
2304
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2305
  }
2306
  else {
2307
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2308
  }
2309
  element.innerHTML=title;
2310
  return element;
2311
  }
2312
  case 'img':{
2313
  var element = document.createElement('img');
2314
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
2315
  element.setAttribute('class', class_);
2316
  if(checkable=="true") {
2317
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2318
  }
2319
  else {
2320
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2321
  }
2322
  if(title.indexOf("http")==0) {
2323
  element.src=title;
2324
  }
2325
  else {
2326
  element.src=fm_objectL10n.plugin_url+'/'+title;
2327
  }
2328
  return element;
2329
  }
2330
  }
2331
  var curtop = 0;
2332
  if (obj.offsetParent) {
2333
  do {
2334
  curtop += obj.offsetTop;
2335
  } while (obj = obj.offsetParent);
2336
  return [curtop];
2337
  }
2338
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
2339
  if (form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
2340
  if (form_view_elemet.parentNode.previousSibling.tagName == "DIV") {
2341
  table = form_view_elemet.parentNode.previousSibling;
2342
  }
2343
  else {
2344
  table = form_view_elemet.parentNode.previousSibling.previousSibling;
2345
  }
2346
  }
2347
  if (!table.firstChild.tagName) {
2348
  table.removeChild(table.firstChild);
2349
  }
2350
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
2351
  form = jQuery("#form" + form_id);
2352
  if (!form.parent().hasClass('fm-scrollbox-form')) {
2353
  window.scroll(0, form_maker_findPos(form));
2354
  }
2355
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
2356
  if (form_view_elemet.parentNode.nextSibling) {
2357
  if (form_view_elemet.parentNode.nextSibling.tagName == "DIV") {
2358
  table = form_view_elemet.parentNode.nextSibling;
2359
  }
2360
  else {
2361
  table = form_view_elemet.parentNode.nextSibling.nextSibling;
2362
  }
2363
  }
2364
  if (!table.firstChild.tagName) {
2365
  table.removeChild(table.firstChild);
2366
  }
2367
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
2368
  form = jQuery("#form" + form_id);
2369
  if (!form.parent().hasClass('fm-scrollbox-form')) {
2370
  window.scroll(0, form_maker_findPos(form));
2371
  }
2372
  if(filename.length == 0) {
2373
  return true;
2374
  }
2375
  var dot = filename.lastIndexOf(".");
2376
  var extension = filename.substr(dot+1,filename.length);
2377
  exten=exten.split(',');
2378
  for(var j=0 ; j<exten.length; j++) {
2379
  exten[j]=exten[j].replace(/\./g,'');
2380
  exten[j]=exten[j].replace(/ /g,'');
2381
  if(extension.toLowerCase()==exten[j].toLowerCase())
2382
  return true;
2383
  }
2384
  return false;
2385
  addclass = typeof(addclass) != 'undefined' ? addclass : '';
2386
  jQuery(select).wrap('<div class="sel-wrap ' + addclass + '"/>');
2387
  var sel_options = '';
2388
  var selected_option = false;
2389
  jQuery(select).children('option').each(function() {
2390
  if(jQuery(this).is(':selected')){
2391
  selected_option = jQuery(this).index();
2392
  }
2393
  sel_options = sel_options + '<div class="sel-option" value="' + jQuery(this).val() + '">' + jQuery(this).html() + '</div>';
2394
  });
2395
  w=jQuery(select)[0].style.width;
2396
  if(w=='100%') {
2397
  w='100%';
2398
  }
2399
  else {
2400
  w=(jQuery(select).width()+32)+'px';
2401
  }
2402
  var sel_imul = '<div class="sel-imul" style="width:'+w+'">\
2403
  <div class="sel-selected">\
2404
  <div class="selected-text">' + jQuery(select).children('option').eq(selected_option).html() + '</div>\
2405
  <div class="sel-arraw"></div>\
2406
  </div>\
2407
  <div class="sel-options">' + sel_options + '</div>\
2408
  </div>';
2409
  jQuery(select).addClass('no-width');
2410
  jQuery(select).before(sel_imul);
2411
  var tektext = jQuery(this).children("option:selected").text();
2412
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
2413
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').children('.sel-option').removeClass('sel-ed');
2414
  jQuery(this).addClass('sel-ed');
2415
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').each(function() {
2416
  if (jQuery(this).html() == tektext) {
2417
  jQuery(this).addClass('sel-ed');
2418
  }
2419
  });
2420
  jQuery('.sel-imul').removeClass('act');
2421
  jQuery(this).addClass('act');
2422
  if (jQuery(this).children('.sel-options').is(':visible')) {
2423
  jQuery('.sel-options').hide();
2424
  }
2425
  else {
2426
  jQuery('.sel-options').hide();
2427
  jQuery(this).children('.sel-options').show();
2428
  jQuery(this).children('.sel-options').css('width',jQuery(this).width());
2429
  }
2430
  var tektext = jQuery(this).html();
2431
  jQuery(this).parent('.sel-options').parent('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
2432
  jQuery(this).parent('.sel-options').children('.sel-option').removeClass('sel-ed');
2433
  jQuery(this).addClass('sel-ed');
2434
  var tekval = jQuery(this).attr('value');
2435
  tekval = typeof(tekval) != 'undefined' ? tekval : tektext;
2436
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').children('option').removeAttr('selected').each(function() {
2437
  if (jQuery(this).html() == tektext) {
2438
  jQuery(this).attr('selected', 'select');
2439
  }
2440
  });
2441
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').change();
2442
  selenter = true;
2443
  selenter = false;
2444
  if (!selenter) {
2445
  jQuery('.sel-options').hide();
2446
  jQuery('.sel-imul').removeClass('act');
2447
  }
2448
  var ttt;
2449
  for (ttt=0; ttt < node.childNodes.length; ttt++) {
2450
  if( node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test( node.childNodes[ttt].nodeValue )) {
2451
  node.removeChild(node.childNodes[ttt]);
2452
  ttt--;
2453
  }
2454
  else {
2455
  if(node.childNodes[ttt].childNodes.length) {
2456
  remove_whitespace(node.childNodes[ttt]);
2457
  }
2458
  }
2459
  }
2460
  return;
2461
  if(element_value) {
2462
  jQuery("#"+id).datepicker('option', min_max, element_value);
2463
  }
2464
  else {
2465
  if(default_min_max == "today") {
2466
  jQuery("#"+id).datepicker('option', min_max, new Date());
2467
  }
2468
  else {
2469
  if (default_min_max.indexOf("d") == -1 && default_min_max.indexOf("m") == -1 && default_min_max.indexOf("y") == -1 && default_min_max.indexOf("w") == -1 && default_min_max != "") {
2470
  default_min_max = jQuery.datepicker.formatDate(format, new Date(default_min_max));
2471
  }
2472
  jQuery("#"+id).datepicker('option', min_max, default_min_max);
2473
  }
2474
  }
2475
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
2476
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
2477
  var condition_confirm_email = false;
2478
  if(!window["check_before_submit" + form_id][wdid + "_" + form_id]) {
2479
  condition_confirm_email = true;
2480
  }
2481
  else {
2482
  condition_confirm_email = jQuery(element).val() != jQuery(element_confirm).val() ? true : false;
2483
  }
2484
  if(condition_confirm_email) {
2485
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2486
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
2487
  if(jQuery(element).val() != jQuery(element_confirm).val()) {
2488
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
2489
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_confirm");
2490
  }
2491
  window["check_before_submit" + form_id][wdid + "_" + form_id] = (wdid + "_" + form_id in window["check_before_submit" + form_id]) ? window["check_before_submit" + form_id][wdid + "_" + form_id] : true;
2492
  }
2493
  else {
2494
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2495
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
2496
  if(window["check_before_submit" + form_id][wdid + "_" + form_id] == true) {
2497
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2498
  }
2499
  }
2500
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
2501
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
2502
  var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
2503
  if(jQuery(element).val()!="" && !re.test(jQuery.trim(jQuery(element).val())) && jQuery(element).attr("title") != jQuery(element).val()){
2504
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
2505
  jQuery(element).parent().append("<div id='check_email_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message_check + "</div>");
2506
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_check_mail");
2507
  if(element.val() == element_confirm.val()) {
2508
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2509
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
2510
  }
2511
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2512
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
2513
  }
2514
  else {
2515
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
2516
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_check_mail").removeClass("error_label_check_mail");
2517
  window["check_before_submit" + form_id][wdid + "_" + form_id] = true;
2518
  if(typeof element_confirm.val() ==="undefined") {
2519
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2520
  }
2521
  }
2522
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
2523
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
2524
  var condition_confirm_pass = false;
2525
  condition_confirm_pass = element.val() !== element_confirm.val();
2526
  if(condition_confirm_pass) {
2527
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2528
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
2529
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_check_pass");
2530
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
2531
  }
2532
  else {
2533
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2534
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_check_pass").removeClass("error_label_check_pass");
2535
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2536
  }
2537
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown fm-minimized");
2538
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeOutDown").addClass("fm-show fm-animated fadeInUp");
2539
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
2540
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeOutDown fm-minimized").addClass("fm-show fm-animated fadeInUp");
2541
  var hide_date = new Date();
2542
  hide_date.setDate(hide_date.getDate() + hide_interval);
2543
  if( hide_interval > 0 ) {
2544
  localStorage.setItem('hide-'+form_id, hide_date.getTime());
2545
  }
2546
  if(typeof close_callback === 'function') {
2547
  close_callback();
2548
  }
2549
  var x = jQuery("#form" + form_id);
2550
  var find_wrong_exp = false;
2551
  var check_regExp = regExpObj ? regExpObj : window['check_regExp_all'+form_id];
2552
  jQuery.each( check_regExp, function( wdid, exp ) {
2553
  var element = "#wdform_" + wdid + "_element" + form_id;
2554
  var RegExpression = "";
2555
  var rules = unescape(exp[0]);
2556
  (exp[1].length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules, exp[1]);
2557
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
2558
  if(jQuery(element).val().length > 0 && jQuery(element).val() != jQuery(element).attr('title')) {
2559
  if (RegExpression.test(jQuery(element).val()) != true) {
2560
  jQuery("#form"+form_id+" #wd_exp_"+wdid).remove();
2561
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_exp_"+wdid+"' class='fm-not-filled'>" + exp[2] + "</div>");
2562
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp");
2563
  find_wrong_exp = true;
2564
  if(!regExpObj){
2565
  scroll_on_element(form_id);
2566
  }
2567
  }
2568
  }
2569
  }
2570
  });
2571
  if(find_wrong_exp === false) {
2572
  return true;
2573
  }
2574
  return false;
2575
  var parent_div = jQuery("#form" + form_id + " .fm-not-filled")[0].closest(".wdform_row");
2576
  var body_hight = document.body.clientHeight;
2577
  var element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
2578
  var scrollChecker = function() {
2579
  if(document.body.clientHeight !== body_hight ) {
2580
  body_hight = document.body.clientHeight;
2581
  element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
2582
  jQuery('html body').stop();
2583
  animateBodyToError();
2584
  }
2585
  };
2586
  jQuery(window).on("scroll",scrollChecker);
2587
  function animateBodyToError() {
2588
  jQuery('html body').animate({
2589
  scrollTop: element_offset - 150
2590
  }, 500, function() {
2591
  jQuery(window).off("scroll", scrollChecker);
2592
  old_bg=jQuery(parent_div).css("background-color");
2593
  jQuery(parent_div).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
2594
  });
2595
  }
2596
  animateBodyToError();
2597
  var x = jQuery("#form" + form_id);
2598
  var find_wrong_type_upload = false;
2599
  var upload_check = upload_check_field ? upload_check_field : window['file_upload_check'+form_id];
2600
  jQuery.each( upload_check, function( wdid, upload_types ) {
2601
  var element = "#wdform_" + wdid + "_element" + form_id;
2602
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
2603
  ext_available=getfileextension(jQuery(element).val(), upload_types);
2604
  if(!ext_available) {
2605
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
2606
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_upload_type_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_file_type_error + "</div>");
2607
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_upload");
2608
  find_wrong_type_upload = true;
2609
  }
2610
  else {
2611
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
2612
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_upload").removeClass("error_label_upload")
2613
  }
2614
  }
2615
  });
2616
  if(!upload_check_field && find_wrong_type_upload === true){
2617
  scroll_on_element(form_id);
2618
  }
2619
  if(find_wrong_type_upload === false) {
2620
  return true;
2621
  }
2622
  return false;
2623
  var x = jQuery("#form" + form_id);
2624
  var req_fields = field_id ? field_id.split() : window['required_fields'+form_id];
2625
  var not_filled = {};
2626
  jQuery(req_fields).each(function(index, wdid) {
2627
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none" ) {
2628
  switch(window['labels_and_ids'+form_id][wdid]) {
2629
  case 'type_text':
2630
  case 'type_textarea':
2631
  case 'type_paypal_price_new':
2632
  case 'type_spinner':
2633
  case 'type_number':
2634
  case 'type_phone_new':
2635
  case 'type_submitter_mail': {
2636
  var element = "#wdform_" + wdid + "_element" + form_id;
2637
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2638
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
2639
  not_filled[wdid] = element;
2640
  }
2641
  }
2642
  if(!field_id && !window['check_submit'+form_id]) {
2643
  jQuery(element).focus(function() {
2644
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2645
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2646
  }).blur(function() {
2647
  wd_is_filled(form_id, wdid);
2648
  });
2649
  }
2650
  break;
2651
  }
2652
  case 'type_own_select':
2653
  case 'type_country':
2654
  case 'type_paypal_select': {
2655
  var element = "#wdform_" + wdid + "_element" + form_id;
2656
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2657
  if(jQuery(element).val() == "") {
2658
  not_filled[wdid] = element;
2659
  }
2660
  }
2661
  if(!field_id && !window['check_submit'+form_id]) {
2662
  jQuery(element).focus(function() {
2663
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2664
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2665
  }).blur(function() {
2666
  wd_is_filled(form_id, wdid);
2667
  }).change(function() {
2668
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2669
  wd_is_filled(form_id, wdid);
2670
  });
2671
  }
2672
  break;
2673
  }
2674
  case 'type_phone': {
2675
  var element = ["#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id];
2676
  jQuery.each(element, function(i, elem){
2677
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2678
  if(jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')){
2679
  not_filled[wdid] = elem;
2680
  }
2681
  }
2682
  if(!field_id && !window['check_submit'+form_id]){
2683
  jQuery(elem).focus(function() {
2684
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2685
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2686
  }).blur(function() {
2687
  wd_is_filled(form_id, wdid);
2688
  });
2689
  }
2690
  });
2691
  break;
2692
  }
2693
  case 'type_name': {
2694
  var element = ["#wdform_" + wdid + "_element_title" + form_id, "#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id, "#wdform_" + wdid + "_element_middle" + form_id];
2695
  jQuery.each(element, function(i, elem){
2696
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2697
  if((jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')) && typeof jQuery(elem).val() != "undefined"){
2698
  not_filled[wdid] = elem;
2699
  }
2700
  }
2701
  if(!field_id && !window['check_submit'+form_id]){
2702
  jQuery(elem).focus(function() {
2703
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2704
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2705
  }).blur(function() {
2706
  wd_is_filled(form_id, wdid);
2707
  });
2708
  }
2709
  });
2710
  break;
2711
  }
2712
  case 'type_address': {
2713
  var element = ["#wdform_" + wdid + "_street1" + form_id, "#wdform_" + wdid + "_street2" + form_id, "#wdform_" + wdid + "_city" + form_id, "#wdform_" + wdid + "_state" + form_id, "#wdform_" + wdid + "_postal" + form_id, "#wdform_" + wdid + "_country" + form_id];
2714
  jQuery.each(element, function(i, elem){
2715
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2716
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
2717
  not_filled[wdid] = elem;
2718
  }
2719
  }
2720
  if(!field_id && !window['check_submit'+form_id]){
2721
  jQuery(elem).focus(function() {
2722
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2723
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2724
  }).blur(function() {
2725
  wd_is_filled(form_id, wdid);
2726
  });
2727
  }
2728
  });
2729
  break;
2730
  }
2731
  case 'type_checkbox':
2732
  case 'type_radio':
2733
  case 'type_scale_rating':
2734
  case 'type_paypal_checkbox':
2735
  case 'type_paypal_radio':
2736
  case 'type_paypal_shipping': {
2737
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none"){
2738
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
2739
  not_filled[wdid] = true;
2740
  }
2741
  }
2742
  if(!field_id && !window['check_submit'+form_id]){
2743
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2744
  jQuery(this).change(function() {
2745
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
2746
  wd_is_filled(form_id, wdid);
2747
  }
2748
  else{
2749
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2750
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2751
  }
2752
  });
2753
  });
2754
  }
2755
  break;
2756
  }
2757
  case 'type_star_rating': {
2758
  var element = "#wdform_" + wdid + "_selected_star_amount" + form_id;
2759
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2760
  if(jQuery(element).val() == ""){
2761
  not_filled[wdid] = true;
2762
  }
2763
  }
2764
  if(!field_id && !window['check_submit'+form_id]){
2765
  jQuery("#wdform_" + wdid + "_element" + form_id).click(function(){
2766
  if(jQuery(element).val() != ""){
2767
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2768
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2769
  }
2770
  });
2771
  }
2772
  break;
2773
  }
2774
  case 'type_range': {
2775
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
2776
  jQuery.each(element, function(i, elem){
2777
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2778
  if(jQuery(elem).val() == ""){
2779
  not_filled[wdid] = elem;
2780
  }
2781
  }
2782
  if(!field_id && !window['check_submit'+form_id]){
2783
  jQuery(elem).focus(function() {
2784
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2785
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2786
  }).blur(function() {
2787
  wd_is_filled(form_id, wdid);
2788
  });
2789
  }
2790
  });
2791
  break;
2792
  }
2793
  case 'type_grading': {
2794
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2795
  var count_grading = 0;
2796
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
2797
  if(jQuery(this).val() != "")
2798
  count_grading ++;
2799
  });
2800
  if(count_grading == 0)
2801
  not_filled[wdid] = true;
2802
  }
2803
  if(!field_id && !window['check_submit'+form_id]){
2804
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
2805
  jQuery(this).focus(function() {
2806
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2807
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2808
  }).blur(function() {
2809
  wd_is_filled(form_id, wdid);
2810
  });
2811
  });
2812
  }
2813
  break;
2814
  }
2815
  case 'type_slider': {
2816
  var slider_element = "#wdform_" + wdid + "_element" + form_id;
2817
  var element = "#wdform_" + wdid + "_slider_value" + form_id;
2818
  var min_value = "#wdform_" + wdid + "_element_min" + form_id;
2819
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2820
  if(jQuery(element).val() == jQuery(min_value).html()){
2821
  not_filled[wdid] = true;
2822
  }
2823
  }
2824
  if(!field_id && !window['check_submit'+form_id]){
2825
  jQuery(slider_element).slider({
2826
  change: function( event, ui ) {
2827
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2828
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2829
  wd_is_filled(form_id, wdid);
2830
  }
2831
  });
2832
  }
2833
  break;
2834
  }
2835
  case 'type_date':
2836
  case 'type_date_new': {
2837
  var element = "#wdform_" + wdid + "_element" + form_id;
2838
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2839
  if(jQuery(element).val() == ""){
2840
  not_filled[wdid] = element;
2841
  }
2842
  }
2843
  if(!field_id && !window['check_submit'+form_id]){
2844
  jQuery(element).focus(function() {
2845
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2846
  }).change(function() {
2847
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2848
  wd_is_filled(form_id, wdid);
2849
  });
2850
  }
2851
  break;
2852
  }
2853
  case 'type_date_range': {
2854
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
2855
  jQuery.each(element, function(i, elem){
2856
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2857
  if(jQuery(elem).val() == ""){
2858
  not_filled[wdid] = elem;
2859
  }
2860
  }
2861
  if(!field_id && !window['check_submit'+form_id]){
2862
  jQuery(elem).focus(function() {
2863
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2864
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2865
  }).change(function() {
2866
  wd_is_filled(form_id, wdid);
2867
  });
2868
  }
2869
  });
2870
  break;
2871
  }
2872
  case 'type_date_fields': {
2873
  var element = ["#wdform_" + wdid + "_day" + form_id, "#wdform_" + wdid + "_month" + form_id, "#wdform_" + wdid + "_year" + form_id];
2874
  jQuery.each(element, function(i, elem) {
2875
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2876
  if(jQuery(elem).val() == ""){
2877
  not_filled[wdid] = elem;
2878
  }
2879
  }
2880
  if(!field_id && !window['check_submit'+form_id]){
2881
  jQuery(elem).focus(function() {
2882
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2883
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2884
  }).blur(function() {
2885
  wd_is_filled(form_id, wdid);
2886
  }).change(function() {
2887
  wd_is_filled(form_id, wdid);
2888
  });
2889
  }
2890
  });
2891
  break;
2892
  }
2893
  case 'type_time': {
2894
  var element = ["#wdform_" + wdid + "_hh" + form_id, "#wdform_" + wdid + "_mm" + form_id, "#wdform_" + wdid + "_ss" + form_id];
2895
  jQuery.each(element, function(i, elem){
2896
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2897
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
2898
  not_filled[wdid] = elem;
2899
  }
2900
  }
2901
  if(!field_id && !window['check_submit'+form_id]){
2902
  jQuery(elem).focus(function() {
2903
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2904
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2905
  }).blur(function() {
2906
  wd_is_filled(form_id, wdid);
2907
  });
2908
  }
2909
  });
2910
  break;
2911
  }
2912
  case 'type_password': {
2913
  var element = "#wdform_" + wdid + "_element" + form_id;
2914
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2915
  if(jQuery(element).val() == ""){
2916
  not_filled[wdid] = element;
2917
  }
2918
  }
2919
  if(!field_id && !window['check_submit'+form_id]){
2920
  jQuery(element).focus(function() {
2921
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2922
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2923
  }).blur(function() {
2924
  wd_is_filled(form_id, wdid);
2925
  });
2926
  }
2927
  break;
2928
  }
2929
  case 'type_file_upload': {
2930
  var element = "#wdform_" + wdid + "_element" + form_id;
2931
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2932
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
2933
  not_filled[wdid] = element;
2934
  }
2935
  }
2936
  if(!field_id && !window['check_submit'+form_id]) {
2937
  jQuery(element).focus(function() {
2938
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2939
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2940
  }).change(function() {
2941
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2942
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2943
  wd_is_filled(form_id, wdid);
2944
  });
2945
  }
2946
  break;
2947
  }
2948
  case 'type_matrix': {
2949
  if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="radio" || jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="checkbox"){
2950
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2951
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
2952
  not_filled[wdid] = true;
2953
  }
2954
  }
2955
  if(!field_id && !window['check_submit'+form_id]) {
2956
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2957
  jQuery(this).change(function() {
2958
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
2959
  wd_is_filled(form_id, wdid);
2960
  }
2961
  else{
2962
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2963
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2964
  }
2965
  });
2966
  });
2967
  }
2968
  }
2969
  else if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="text") {
2970
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2971
  var count_input_matrix = 0;
2972
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2973
  if(jQuery(this).val() != "")
2974
  count_input_matrix ++;
2975
  });
2976
  if(count_input_matrix == 0)
2977
  not_filled[wdid] = true;
2978
  }
2979
  if(!field_id && !window['check_submit'+form_id]){
2980
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2981
  jQuery(this)
2982
  .focus(function() {
2983
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2984
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2985
  })
2986
  .blur(function() {
2987
  wd_is_filled(form_id, wdid);
2988
  });
2989
  });
2990
  }
2991
  }
2992
  else {
2993
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2994
  var count_select_matrix = 0;
2995
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
2996
  if(jQuery(this).val() != "")
2997
  count_select_matrix ++;
2998
  });
2999
  if(count_select_matrix == 0)
3000
  not_filled[wdid] = true;
3001
  }
3002
  if(!field_id && !window['check_submit'+form_id]){
3003
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
3004
  jQuery(this).focus(function() {
3005
  if(jQuery(this).val() == ""){
3006
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3007
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
3008
  }
3009
  }).change(function() {
3010
  wd_is_filled(form_id, wdid);
3011
  }).blur(function() {
3012
  wd_is_filled(form_id, wdid);
3013
  });
3014
  });
3015
  }
3016
  }
3017
  break;
3018
  }
3019
  case 'type_send_copy': {
3020
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
3021
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
3022
  not_filled[wdid] = true;
3023
  }
3024
  }
3025
  if(!field_id && !window['check_submit'+form_id]){
3026
  jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").change(function() {
3027
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
3028
  wd_is_filled(form_id, wdid);
3029
  }
3030
  else {
3031
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3032
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
3033
  }
3034
  });
3035
  }
3036
  break;
3037
  }
3038
  case 'type_captcha':
3039
  case 'type_arithmetic_captcha': {
3040
  var element = "";
3041
  if(window['labels_and_ids'+form_id][wdid] == 'type_captcha') {
3042
  element = '#wd_captcha_input' + form_id;
3043
  }
3044
  else {
3045
  element = '#wd_arithmetic_captcha_input' + form_id;
3046
  }
3047
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
3048
  if(jQuery(element).val() == ""){
3049
  not_filled[wdid] = element;
3050
  }
3051
  }
3052
  if(!field_id && !window['check_submit'+form_id]){
3053
  jQuery(element).focus(function() {
3054
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3055
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
3056
  }).blur(function() {
3057
  wd_is_filled(form_id, wdid);
3058
  });
3059
  }
3060
  break;
3061
  }
3062
  }
3063
  }
3064
  });
3065
  if (Object.keys(not_filled).length === 0 && Object.keys(window["check_before_submit" + form_id]).length === 0) {
3066
  return true;
3067
  }
3068
  else {
3069
  if (Object.keys(not_filled).length !== 0) {
3070
  jQuery.each( not_filled, function( wdid, elem ) {
3071
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3072
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-element-section:first").append("<div id='wd_required_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_field_is_required + "</div>");
3073
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label");
3074
  });
3075
  }
3076
  if(!field_id){
3077
  scroll_on_element(form_id);
3078
  }
3079
  window['check_submit'+form_id] = 1;
3080
  return false;
3081
  }
3082
  var x = jQuery("#form" + form_id);
3083
  var check_price_min_max = price_nim_max ? price_nim_max : window['check_paypal_price_min_max'+form_id];
3084
  var find_wrong_price = false;
3085
  jQuery.each( check_price_min_max, function( wdid, min_max_option ) {
3086
  var element = "#wdform_" + wdid + "_element" + form_id;
3087
  var range_min = min_max_option[3] ? min_max_option[3] : 0;
3088
  var range_max = min_max_option[4] ? min_max_option[4] : -1;
3089
  if((min_max_option[2] ? true : false) || jQuery(element).val()!=min_max_option[1]) {
3090
  if((range_max!=-1 && parseFloat(jQuery(element).val()) > range_max) || parseFloat(jQuery(element).val()) < range_min) {
3091
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
3092
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_min_max_check_1 + min_max_option[0] + fm_objectL10n.fm_min_max_check_2 + (min_max_option[3] ? min_max_option[3] : 0) + '-' + (min_max_option[4] ? min_max_option[4] : "any") + "</div>");
3093
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
3094
  find_wrong_price = true;
3095
  if(!price_nim_max) {
3096
  scroll_on_element(form_id);
3097
  }
3098
  }
3099
  }
3100
  });
3101
  if(find_wrong_price === false) {
3102
  return true;
3103
  }
3104
  return false;
3105
  var x = jQuery("#form" + form_id);
3106
  var find_wrong_values = false;
3107
  var spinner_check = spinner_check_field ? spinner_check_field : window['spinner_check'+form_id];
3108
  jQuery.each( spinner_check, function( wdid, spinner_values ) {
3109
  var element = "#wdform_" + wdid + "_element" + form_id;
3110
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
3111
  if(parseInt(jQuery(element).val()) < parseInt(spinner_values[0]) || parseInt(jQuery(element).val()) > parseInt(spinner_values[1])) {
3112
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
3113
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_spinner_check + (spinner_values[0] ? spinner_values[0] : 0) + '-' + (spinner_values[1] ? spinner_values[1] : "any") + "</div>");
3114
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
3115
  find_wrong_values = true;
3116
  if(!spinner_check_field) {
3117
  scroll_on_element(form_id);
3118
  }
3119
  }
3120
  }
3121
  });
3122
  if(find_wrong_values === false) {
3123
  return true;
3124
  }
3125
  return false;
3126
  var scrollPercent = 100 * jQuery(window).scrollTop() / (jQuery(document).height() - jQuery(window).height());
3127
  if(!jQuery("#fm-scrollbox" + form_id).hasClass("fm-minimized") && scrollPercent >= window["scrollbox_trigger_point" + form_id]) {
3128
  setTimeout(function() {
3129
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
3130
  jQuery("#fm-scrollbox" + form_id).css("visibility", "");
3131
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").addClass("fm-animated " + window["header_image_animation" + form_id]);
3132
  }, window["scrollbox_loading_delay" + form_id] * 1000);
3133
  } else {
3134
  if(window["scrollbox_auto_hide" + form_id]) {
3135
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").removeClass("fm-animated " + window["header_image_animation" + form_id]);
3136
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
3137
  }
3138
  }
3139
  if (typeof window["before_submit" + form_id] == 'function') {
3140
  if (window["before_submit" + form_id]()) {
3141
  return false;
3142
  }
3143
  }
3144
  if (!fm_check(0, form_id)) {
3145
  return false;
3146
  }
3147
  jQuery("#form" + form_id + " button").each(function () {
3148
  jQuery(this).attr('disabled', 'disabled');
3149
  });
3150
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"submit\" />").appendTo("#form"+form_id);
3151
  window["onsubmit_js" + form_id]();
3152
  if(window['checkStripe' + form_id] == 1) {
3153
  var jq_mainForm = jQuery("form[id='form"+form_id+"']");
3154
  if (jq_mainForm.find(".wdfm_stripe_elem").first().parents(".wdform_row").is(":visible")) {
3155
  wdfm_call_stripe();
3156
  }
3157
  else {
3158
  jQuery("#form"+form_id).submit();
3159
  }
3160
  }
3161
  else {
3162
  jQuery("#form"+form_id).submit();
3163
  }
3164
  if ( typeof window["before_reset" + form_id] == 'function' ) {
3165
  window["before_reset" + form_id]();
3166
  }
3167
  jQuery.each(window['labels_and_ids'+form_id], function (index, elem) {
3168
  switch(elem) {
3169
  case "type_text":
3170
  case "type_textarea":
3171
  case "type_number":
3172
  case "type_spinner":
3173
  case 'type_own_select':
3174
  case 'type_country':
3175
  case 'type_date':
3176
  case 'type_date_new':
3177
  case 'type_hidden':
3178
  case 'type_paypal_price_new':
3179
  jQuery("#wdform_"+index+"_element"+form_id).val('');
3180
  break;
3181
  case 'type_submitter_mail':
3182
  case 'type_password':
3183
  jQuery("#wdform_"+index+"_element"+form_id).val('');
3184
  if(jQuery("#wdform_"+index+"_1_element"+form_id)){
3185
  jQuery("#wdform_"+index+"_1_element"+form_id).val('');
3186
  if(jQuery("#confirm_"+index+"_"+form_id))
3187
  jQuery("#confirm_"+index+"_"+form_id).remove();
3188
  if(elem == 'type_submitter_mail' && jQuery("#check_email_"+index+"_"+form_id))
3189
  jQuery("#check_email_"+index+"_"+form_id).remove();
3190
  }
3191
  break;
3192
  case 'type_date_range':
3193
  jQuery("#wdform_"+index+"_element"+form_id+"0").val('');
3194
  jQuery("#wdform_"+index+"_element"+form_id+"1").val('');
3195
  break;
3196
  case 'type_send_copy':
3197
  jQuery("#wdform_"+index+"_element"+form_id).prop('checked', false);
3198
  break;
3199
  case 'type_phone':
3200
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id).val('');
3201
  break;
3202
  case 'type_name':
3203
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id+", #wdform_"+index+"_element_title"+form_id+", #wdform_"+index+"_element_middle"+form_id).val('');
3204
  break;
3205
  case 'type_address':
3206
  jQuery("#wdform_"+index+"_street1"+form_id+", #wdform_"+index+"_street2"+form_id+", #wdform_"+index+"_city"+form_id+", #wdform_"+index+"_state"+form_id+", #wdform_"+index+"_postal"+form_id+", #wdform_"+index+"_country"+form_id).val('');
3207
  break;
3208
  case 'type_checkbox':
3209
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
3210
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
3211
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
3212
  break;
3213
  case 'type_radio':
3214
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3215
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
3216
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
3217
  break;
3218
  case 'type_time':
3219
  jQuery("#wdform_"+index+"_hh"+form_id+", #wdform_"+index+"_mm"+form_id+", #wdform_"+index+"_ss"+form_id+", #wdform_"+index+"_am_pm"+form_id).val('');
3220
  break;
3221
  case 'type_date_fields':
3222
  jQuery("#wdform_"+index+"_day"+form_id+", #wdform_"+index+"_month"+form_id+", #wdform_"+index+"_year"+form_id).val('');
3223
  break;
3224
  case 'type_file_upload':
3225
  jQuery("#wdform_"+index+"_element"+form_id+"_save").remove();
3226
  break;
3227
  case 'type_paypal_price':
3228
  jQuery("#wdform_"+index+"_element_dollars"+form_id+", #wdform_"+index+"_element_cents"+form_id).val('');
3229
  break;
3230
  case 'type_paypal_select':
3231
  jQuery("#wdform_"+index+"_element"+form_id+", #wdform_"+index+"_element_quantity"+form_id+", #form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
3232
  break;
3233
  case 'type_paypal_radio':
3234
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
3235
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3236
  break;
3237
  case 'type_paypal_shipping':
3238
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3239
  break;
3240
  case 'type_paypal_checkbox':
3241
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
3242
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
3243
  break;
3244
  case 'type_star_rating':
3245
  jQuery("#wdform_"+index+"_selected_star_amount"+form_id).val('');
3246
  jQuery("#wdform_"+index+"_element"+form_id+" img").attr('src', fm_objectL10n.plugin_url + '/images/star.png');
3247
  break;
3248
  case 'type_scale_rating':
3249
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3250
  break;
3251
  case 'type_slider':
3252
  jQuery("#wdform_"+index+"_element"+form_id).slider({
3253
  value: eval(0),
3254
  });
3255
  jQuery("#wdform_"+index+"_element_value"+form_id).html('0');
3256
  break;
3257
  case 'type_range':
3258
  jQuery("#wdform_"+index+"_element"+form_id+"0, #wdform_"+index+"_element"+form_id+"1").val('');
3259
  break;
3260
  case 'type_grading':
3261
  jQuery("#wdform_"+index+"_element"+form_id+" input").val('');
3262
  break;
3263
  case 'type_matrix':
3264
  jQuery("#wdform_"+index+"_element"+form_id+" .radio-div input").prop('checked', false);
3265
  jQuery("#wdform_"+index+"_element"+form_id+" .checkbox-div input").prop('checked', false);
3266
  jQuery("#wdform_"+index+"_element"+form_id+" input[type='text']").val('');
3267
  jQuery("#wdform_"+index+"_element"+form_id+" select").val('');
3268
  break;
3269
  case 'type_paypal_total':
3270
  jQuery("#wdform_"+index+"div_total"+form_id).html('$0');
3271
  jQuery("#wdform_"+index+"paypal_products"+form_id).empty();
3272
  break;
3273
  default:
3274
  break;
3275
  }
3276
  });
3277
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"save\" />").appendTo("#form"+form_id);
3278
  window["onsubmit_js" + form_id]();
3279
  jQuery("#form" + form_id + " button").each(function () {
3280
  jQuery(this).attr('disabled', 'disabled');
3281
  });
3282
  jQuery("#form"+form_id).submit();
3283
  var clear_data = confirm(fm_objectL10n.fm_clear_data);
3284
  if (clear_data == true) {
3285
  jQuery("#form" + form_id + " button").each(function () {
3286
  jQuery(this).attr('disabled', 'disabled');
3287
  });
3288
  jQuery.get(fm_objectL10n.form_maker_admin_ajax + '?action=FMClearProg&addon_task=clear_data&form_id=' + form_id).done(function() {
3289
  window.location = jQuery('#form' + form_id).attr('action');
3290
  });
3291
  }
3292
  if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
3293
  jQuery("#form" + form_id).find(jQuery("input[type='radio']")).click(function() {
3294
  jQuery("input[type='radio']+label").removeClass('if-ie-div-label');
3295
  jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')
3296
  });
3297
  jQuery("#form" + form_id).find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
3298
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']")).click(function() {
3299
  jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label');
3300
  jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')
3301
  });
3302
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']:checked+label")).addClass('if-ie-div-label');
3303
  }
3304
  jQuery.each(window["check_regExp_all" + form_id], function( wdid, exp ) {
3305
  var exp_array = {};
3306
  exp_array[wdid] = exp;
3307
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
3308
  wd_check_regExp(form_id, exp_array);
3309
  }).focus(function() {
3310
  jQuery("#form" + form_id + " #wd_exp_"+wdid).remove();
3311
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_exp").removeClass("error_label_exp")
3312
  });
3313
  });
3314
  jQuery.each(window["check_paypal_price_min_max" + form_id], function( wdid, price_min_max_option ) {
3315
  var price_min_max_array = {};
3316
  price_min_max_array[wdid] = price_min_max_option;
3317
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
3318
  wd_check_price_min_max(form_id, price_min_max_array)
3319
  }).focus(function() {
3320
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
3321
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
3322
  });
3323
  });
3324
  jQuery.each(window["spinner_check" + form_id], function( wdid, spinner_min_max ) {
3325
  var spinner_min_max_array = {};
3326
  spinner_min_max_array[wdid] = spinner_min_max;
3327
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
3328
  wd_spinner_check(form_id, spinner_min_max_array)
3329
  }).focus(function() {
3330
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
3331
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
3332
  });
3333
  });
3334
  jQuery.each(window["file_upload_check" + form_id], function( wdid, upload_types ) {
3335
  var upload_types_array = {};
3336
  upload_types_array[wdid] = upload_types;
3337
  jQuery("div[wdid='" + wdid + "'] input").change(function() {
3338
  wd_file_upload_check(form_id, upload_types_array);
3339
  });
3340
  });
3341
  jQuery("div[type='type_text'] input, div[type='type_number'] input, div[type='type_phone'] input, div[type='type_name'] input, div[type='type_submitter_mail'] input, div[type='type_submitter_mail_confirmation'] input, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input, div[type='type_textarea'] textarea").focus(function() {
3342
  delete_value(this)
3343
  }).blur(function() {
3344
  return_value(this)
3345
  });
3346
  jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity, div[type='type_paypal_price_new'] input").keypress(function(evt) {
3347
  return check_isnum(evt);
3348
  });
3349
  jQuery("div[type='type_grading'] input").keypress(function(evt) {
3350
  return check_isnum_or_minus(evt);
3351
  });
3352
  jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function() {
3353
  set_total_value(form_id);
3354
  });
3355
  jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input").change(function() {
3356
  set_total_value(form_id);
3357
  });
3358
  jQuery(".wdform-quantity").change(function() {
3359
  set_total_value(form_id);
3360
  });
3361
  jQuery("div[type='type_address'] select").change(function() {
3362
  set_total_value(form_id);
3363
  });
3364
  jQuery("div[type='type_time'] input").blur(function() {
3365
  add_0(this);
3366
  });
3367
  jQuery('.wdform-element-section').each(function() {
3368
  if(!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
3369
  if(jQuery(this).css('display')=="table-cell") {
3370
  if(jQuery(this).parent().attr('type')!="type_captcha") {
3371
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3372
  }
3373
  else {
3374
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3375
  }
3376
  }
3377
  }
3378
  if (!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
3379
  if (jQuery(this).css('display') == "table-cell") {
3380
  if (jQuery(this).parent().attr('type') != "type_captcha") {
3381
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3382
  }
3383
  else {
3384
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3385
  }
3386
  }
3387
  }
3388
  if(parseInt(jQuery(this)[0].style.width.replace('px', '')) < parseInt(jQuery(this).css('min-width').replace('px', ''))) {
3389
  jQuery(this).css('min-width', parseInt(jQuery(this)[0].style.width.replace('px', ''))-10);
3390
  }
3391
  });
3392
  jQuery('.wdform-label').each(function() {
3393
  if(parseInt(jQuery(this).height()) >= 2*parseInt(jQuery(this).css('line-height').replace('px', ''))) {
3394
  jQuery(this).parent().css('max-width', jQuery(this).parent().width());
3395
  jQuery(this).parent().css('width', '');
3396
  }
3397
  });
3398
  (function(jQuery) {
3399
  jQuery.fn.shuffle = function() {
3400
  var allElems = this.get(),
3401
  getRandom = function(max) {
3402
  return Math.floor(Math.random() * max);
3403
  },
3404
  shuffled = jQuery.map(allElems, function() {
3405
  var random = getRandom(allElems.length),
3406
  randEl = jQuery(allElems[parseInt(random)]).clone(true)[0];
3407
  allElems.splice(random, 1);
3408
  return randEl;
3409
  });
3410
  this.each(function(i) {
3411
  jQuery(this).replaceWith(jQuery(shuffled[i]));
3412
  });
3413
  return jQuery(shuffled);
3414
  };
3415
  })(jQuery);
3416
  window["onload_js" + form_id]();
3417
  window["condition_js" + form_id]();
3418
  if (typeof window["before_load" + form_id] == 'function') {
3419
  window["before_load" + form_id]();
3420
  }
3421
  for(i=1; i<=30; i++) {
3422
  if (document.getElementById(form_id + 'form_view' + i)) {
3423
  window['form_view_count' + form_id]++;
3424
  window['form_view_max' + form_id] = i;
3425
  }
3426
  }
3427
  if (window['form_view_count' + form_id] > 1) {
3428
  for (i = 1; i <= window['form_view_max' + form_id]; i++) {
3429
  if (document.getElementById(form_id + 'form_view' + i)) {
3430
  window['first_form_view' + form_id] = i;
3431
  break;
3432
  }
3433
  }
3434
  generate_page_nav(window['first_form_view' + form_id], form_id, window['form_view_count' + form_id], window['form_view_max' + form_id]);
3435
  }
3436
  fm_initilize_form(form_id);
3437
  if(!wd_is_filled(form_id)) {
3438
  return false;
3439
  }
3440
  if(!wd_check_regExp(form_id)) {
3441
  return false;
3442
  }
3443
  if(!wd_check_price_min_max(form_id)) {
3444
  return false;
3445
  }
3446
  if(!wd_spinner_check(form_id)) {
3447
  return false;
3448
  }
3449
  if(!wd_file_upload_check(form_id)) {
3450
  return false;
3451
  }
3452
  window["check_js" + form_id](id, form_id);
3453
  return true;
3454
  jQuery(".g-recaptcha").each(function () {
3455
  grecaptcha.render(jQuery(this).attr('id'), {
3456
  'sitekey': jQuery(this).attr('data-sitekey'),
3457
  'theme': 'light'
3458
  });
3459
  });
3460
  * Chnage state input.
3461
  *
3462
  * @param id
3463
  * @param form_id
3464
  */
3465
  if ( document.getElementById(id + "_country" + form_id)
3466
  && document.getElementById(id + "_state" + form_id) ) {
3467
  var flag = false;
3468
  var state_input = document.getElementById(id + "_state" + form_id);
3469
  if ( document.getElementById(id + "_country" + form_id).value == "United States" ) {
3470
  var state = document.createElement('select');
3471
  var states = fm_objectL10n.states;
3472
  for (var r in states) {
3473
  var option_ = document.createElement('option');
3474
  option_.setAttribute("value", r);
3475
  option_.innerHTML = states[r];
3476
  state.appendChild(option_);
3477
  }
3478
  flag = true;
3479
  }
3480
  else {
3481
  if ( document.getElementById(id + "_state" + form_id).tagName == 'SELECT' ) {
3482
  var state = document.createElement('input');
3483
  flag = true;
3484
  }
3485
  }
3486
  if ( flag ) {
3487
  state.setAttribute("type", 'text');
3488
  state.setAttribute("id", id + "_state" + form_id);
3489
  state.setAttribute("name", (parseInt(id.replace('wdform_', '')) + 3) + "_state" + form_id);
3490
  state.setAttribute("class", "wd-width-100");
3491
  var state_input_parent = state_input.parentNode;
3492
  state_input_parent.removeChild(state_input);
3493
  state_input_parent.insertBefore(state, state_input_parent.firstChild);
3494
  }
3495
  }
 
1
  jQuery(".wd-datepicker").each(function () {
2
  jQuery(this).datepicker();
3
  jQuery(this).datepicker("option", "dateFormat", jQuery(this).data("format"));
4
  });
5
  var FormCurrency = eval("FormCurrency_" + form_id);
6
  if(jQuery('.paypal_total'+form_id).length==0) {
7
  return;
8
  }
9
  var div_paypal_show = jQuery('.paypal_total'+form_id);
10
  var div_paypal_products = jQuery('.paypal_products'+form_id);
11
  var div_paypal_tax = jQuery('.paypal_tax'+form_id);
12
  var input_paypal_total = jQuery('.input_paypal_total'+form_id);
13
  var total=0;
14
  var total_shipping=0;
15
  div_paypal_products.html('');
16
  div_paypal_tax.html('');
17
  n = parseInt(jQuery('#counter'+form_id).val());
18
  jQuery("#form" +form_id+ " div[type='type_paypal_checkbox'], #form" +form_id+ " div[type='type_paypal_radio']").each(function() {
19
  id=jQuery(this).parent().attr('wdid');
20
  jQuery(this).find('input:checked').each(
21
  function() {
22
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
23
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
24
  total =total + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
25
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
26
  }
27
  );
28
  });
29
  jQuery("#form" +form_id+ " div[type='type_paypal_shipping']").each(function() {
30
  id=jQuery(this).parent().attr('wdid');
31
  jQuery(this).find('input:checked').each(
32
  function() {
33
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
34
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
35
  total_shipping =total_shipping + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
36
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
37
  }
38
  );
39
  });
40
  jQuery("#form" +form_id+ " div[type='type_paypal_select']").each(function() {
41
  id=jQuery(this).parent().attr('wdid');
42
  if(jQuery(this).find('select').val()!='') {
43
  label = jQuery(this).find('select option:selected').html();
44
  span_value = FormCurrency + jQuery(this).find('select').val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
45
  total =total + jQuery(this).find('select').val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
46
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
47
  }
48
  });
49
  jQuery("#form" +form_id+ " div[type='type_paypal_price']").each(function() {
50
  id=jQuery(this).parent().attr('wdid');
51
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active') || jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active')) {
52
  label= jQuery(this).find('.wdform-label').html();
53
  cents='00';
54
  dollars='0';
55
  if( jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active')) {
56
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).val()!='') {
57
  dollars=jQuery('#wdform_'+id+"_element_dollars"+form_id).val();
58
  }
59
  }
60
  if( jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active') && jQuery('#wdform_'+id+"_element_cents"+form_id).val()!='') {
61
  if(jQuery('#wdform_'+id+"_element_cents"+form_id).val().length==1) {
62
  cents='0'+jQuery('#wdform_'+id+"_element_cents"+form_id).val();
63
  }
64
  else {
65
  cents=jQuery('#wdform_'+id+"_element_cents"+form_id).val();
66
  }
67
  }
68
  span_value = FormCurrency + dollars+'.'+cents;
69
  total =total + parseFloat(dollars+'.'+cents);
70
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
71
  }
72
  });
73
  jQuery("#form" +form_id+ " div[type='type_paypal_price_new']").each(function(){
74
  id=jQuery(this).parent().attr('wdid');
75
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
76
  label= jQuery(this).find('.wdform-label').html();
77
  dollars='0';
78
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
79
  if(jQuery('#wdform_'+id+"_element"+form_id).val()!='') {
80
  dollars=jQuery('#wdform_'+id+"_element"+form_id).val();
81
  }
82
  }
83
  span_value = FormCurrency + dollars;
84
  total =total + parseFloat(dollars);
85
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
86
  }
87
  });
88
  var FormPaypalTax = eval("FormPaypalTax_" + form_id);
89
  if(FormPaypalTax != 0) {
90
  div_paypal_tax.html('Tax: ' + FormCurrency + (((total)*FormPaypalTax) / 100).toFixed(2));
91
  }
92
  jQuery('.div_total'+form_id).html(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
93
  input_paypal_total.val(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
94
  var chCode1 = e.which || e.keyCode;
95
  if (chCode1 != 45) {
96
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
97
  return false;
98
  }
99
  }
100
  return true;
101
  var sum = 0;
102
  for(var k=0; k<100;k++) {
103
  if(document.getElementById(num+'_element'+form_id+'_'+k)) {
104
  if(document.getElementById(num+'_element'+form_id+'_'+k).value) {
105
  sum = sum+parseInt(document.getElementById(num+'_element'+form_id+'_'+k).value);
106
  }
107
  }
108
  if(document.getElementById(num+'_total_element'+form_id)) {
109
  if(sum > document.getElementById(num+'_total_element'+form_id).innerHTML) {
110
  document.getElementById(num+'_text_element'+form_id).innerHTML =" "+ fm_objectL10n.fm_grading_text + " " + document.getElementById(num+'_total_element'+form_id).innerHTML;
111
  }
112
  else {
113
  document.getElementById(num+'_text_element'+form_id).innerHTML="";
114
  }
115
  }
116
  }
117
  if(document.getElementById(num+'_sum_element'+form_id)) {
118
  document.getElementById(num+'_sum_element'+form_id).innerHTML = sum;
119
  }
120
  if(rated==false) {
121
  for(var j=0;j<=id;j++) {
122
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+'.png';
123
  }
124
  }
125
  if(rated==false) {
126
  for(var j=0;j<=id;j++) {
127
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
128
  }
129
  }
130
  rated=true;
131
  for(var j=0;j<=id;j++) {
132
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+".png";
133
  }
134
  for(var k=id+1;k<=star_amount-1;k++) {
135
  document.getElementById(el_id+'_star_'+k+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
136
  }
137
  document.getElementById(el_id+'_selected_star_amount'+form_id).value=id+1;
138
  var element_other = jQuery('.form' + form_id + ' [id^=' + num + '_element' + form_id + '][other="1"]');
139
  var parent_ = element_other.parent();
140
  var br = document.createElement('br');
141
  br.setAttribute("id", num + "_other_br" + form_id);
142
  var elem_id = num.split("_")[1];
143
  var el_other = document.createElement('input');
144
  el_other.setAttribute("id", num + "_other_input" + form_id);
145
  el_other.setAttribute("name", num + "_other_input" + form_id);
146
  el_other.setAttribute("type", "text");
147
  el_other.setAttribute("class", "other_input");
148
  el_other.setAttribute("onchange", "other_input_change(this, '" + form_id + "', '" + elem_id + "')");
149
  parent_.append(br);
150
  parent_.append(el_other);
151
  if (jQuery(elem).val() == "") {
152
  wd_is_filled(form_id, wdid);
153
  }
154
  else {
155
  jQuery("#form" + form_id + " #wd_required_" + wdid).remove();
156
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label").removeClass("error_label");
157
  }
158
  var chCode1 = e.which || e.keyCode;
159
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
160
  return true;
161
  }
162
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
163
  return false;
164
  }
165
  return true;
166
  srcArr=document.getElementById(id+genid).src.split("&r=");
167
  document.getElementById(id+genid).src=srcArr[0]+'&r='+Math.floor(Math.random()*100);
168
  document.getElementById(id+"_input"+genid).value='';
169
  document.getElementById(id+genid).style.display="inline-block";
170
  checking=document.getElementById(id+"_element"+form_id+j);
171
  if(checking.getAttribute('other')) {
172
  if(checking.getAttribute('other')==1) {
173
  if(!checking.checked) {
174
  if(document.getElementById(id+"_other_input"+form_id)) {
175
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
176
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
177
  }
178
  return false;
179
  }
180
  }
181
  }
182
  return true;
183
  if(document.getElementById(id+"_other_input"+form_id)) {
184
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
185
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
186
  }
187
  if(jQuery(x).val().length==1) {
188
  jQuery(x).val('0'+jQuery(x).val());
189
  }
190
  var chCode1 = e.which || e.keyCode;
191
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
192
  return false;
193
  }
194
  hour=""+document.getElementById(id).value+String.fromCharCode(chCode1);
195
  hour=parseFloat(hour);
196
  if((hour<0) || (hour>hour_interval)) {
197
  return false;
198
  }
199
  return true;
200
  var chCode1 = e.which || e.keyCode;
201
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
202
  return false;
203
  }
204
  minute=""+document.getElementById(id).value+String.fromCharCode(chCode1);
205
  minute=parseFloat(minute);
206
  if ((minute<0) || (minute>59)) {
207
  return false;
208
  }
209
  return true;
210
  var chCode1 = e.which || e.keyCode;
211
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
212
  return false;
213
  }
214
  second=""+document.getElementById(id).value+String.fromCharCode(chCode1);
215
  second=parseFloat(second);
216
  if ((second<0) || (second>59)) {
217
  return false;
218
  }
219
  return true;
220
  var chCode1 = e.which || e.keyCode;
221
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
222
  return true;
223
  }
224
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
225
  return false;
226
  }
227
  val1=""+jQuery(x).val()+String.fromCharCode(chCode1);
228
  if (val1.length>2) {
229
  return false;
230
  }
231
  if (val1=='00') {
232
  return false;
233
  }
234
  if ((val1<from) || (val1>to)) {
235
  return false;
236
  }
237
  return true;
238
  year=jQuery(x).val();
239
  from=parseFloat(jQuery(x).attr('from'));
240
  to=parseFloat(jQuery(x).attr('to'));
241
  year=parseFloat(year);
242
  if((year>=from) && (year<=to)) {
243
  jQuery(x).val(year);
244
  }
245
  else {
246
  jQuery(x).val('');
247
  }
248
  var chCode1 = e.which || e.keyCode;
249
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
250
  return false;
251
  }
252
  day=""+jQuery(x).val()+String.fromCharCode(chCode1);
253
  if(day.length>2) {
254
  return false;
255
  }
256
  if(day=='00') {
257
  return false;
258
  }
259
  day=parseFloat(day);
260
  if((day<0) || (day>31)) {
261
  return false;
262
  }
263
  return true;
264
  var chCode1 = e.which || e.keyCode;
265
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
266
  return false;
267
  }
268
  month=""+jQuery(x).val()+String.fromCharCode(chCode1);
269
  if(month.length>2) {
270
  return false;
271
  }
272
  if(month=='00') {
273
  return false;
274
  }
275
  month=parseFloat(month);
276
  if((month<0) || (month>12)) {
277
  return false;
278
  }
279
  return true;
280
  var chCode1 = e.which || e.keyCode;
281
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
282
  return false;
283
  }
284
  year=""+jQuery(x).val()+String.fromCharCode(chCode1);
285
  to=parseFloat(jQuery(x).attr('to'));
286
  year=parseFloat(year);
287
  if(year>to) {
288
  return false;
289
  }
290
  return true;
291
  ofontStyle=jQuery(x).attr('class');
292
  if(ofontStyle.indexOf("input_deactive")!=-1) {
293
  jQuery(x).val("").removeClass("input_deactive").addClass("input_active");
294
  }
295
  if(jQuery(x).val()=="") {
296
  jQuery(x).val(jQuery(x).attr('title')).removeClass("input_active").addClass("input_deactive");
297
  }
298
  while (node.firstChild) {
299
  node.removeChild(node.firstChild);
300
  }
301
  form_view=id;
302
  page_nav=document.getElementById(form_id+'page_nav'+id);
303
  destroyChildren(page_nav);
304
  form_view_elemet=document.getElementById(form_id+'form_view'+id);
305
  remove_whitespace(form_view_elemet.parentNode.parentNode);
306
  display_none_form_views_all(form_id);
307
  generate_page_bar(id, form_id, form_view_count, form_view_max);
308
  form_view_elemet.parentNode.style.display="";
309
  var td = document.createElement("div");
310
  td.setAttribute("valign", "middle");
311
  td.setAttribute("align", "left");
312
  td.style.display="table-cell";
313
  td.style.width="40%";
314
  page_nav.appendChild(td);
315
  if(form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
316
  if(form_view_elemet.parentNode.previousSibling.tagName=="DIV") {
317
  table=form_view_elemet.parentNode.previousSibling;
318
  }
319
  else {
320
  if(form_view_elemet.parentNode.previousSibling.previousSibling.tagName=="DIV") {
321
  table=form_view_elemet.parentNode.previousSibling.previousSibling;
322
  }
323
  else {
324
  table="none";
325
  }
326
  }
327
  if(table!="none") {
328
  if(!table.firstChild.tagName) {
329
  table.removeChild(table.firstChild);
330
  }
331
  previous_title = form_view_elemet.getAttribute('previous_title');
332
  previous_type = form_view_elemet.getAttribute('previous_type');
333
  if(previous_type=="text") {
334
  td.setAttribute("class", "previous-page");
335
  }
336
  previous_class = form_view_elemet.getAttribute('previous_class');
337
  previous_checkable = form_view_elemet.getAttribute('previous_checkable');
338
  next_or_previous="previous";
339
  previous=make_pagebreak_button(next_or_previous, previous_title, previous_type, previous_class, previous_checkable, id, form_id, form_view_count, form_view_max);
340
  td.appendChild(previous);
341
  }
342
  }
343
  var td = document.createElement("div");
344
  td.setAttribute("id", form_id+"page_numbers"+form_view);
345
  td.setAttribute("valign", "middle");
346
  td.setAttribute("class", "page-numbers");
347
  td.setAttribute("align", "center");
348
  td.style.display="table-cell";
349
  if(document.getElementById('fm-pages' + form_id).getAttribute('show_numbers')=="true") {
350
  k=0;
351
  for(j=1; j<=form_view_max; j++) {
352
  if(document.getElementById(form_id+'form_view'+j)) {
353
  k++;
354
  if(j==form_view) {
355
  page_number=k;
356
  }
357
  }
358
  }
359
  var cur = document.createElement('span');
360
  cur.setAttribute("class", "page_numbers");
361
  cur.innerHTML=page_number+'/'+k;
362
  td.appendChild(cur);
363
  }
364
  page_nav.appendChild(td);
365
  var td = document.createElement("div");
366
  td.setAttribute("valign", "middle");
367
  td.setAttribute("align", "right");
368
  td.style.cssText = "display:table-cell; width:40%; text-align:right;";
369
  page_nav.appendChild(td);
370
  not_next=false;
371
  if(form_view_elemet.parentNode.nextSibling) {
372
  if(form_view_elemet.parentNode.nextSibling.tagName=="DIV" && form_view_elemet.parentNode.nextSibling.className=="wdform-page-and-images") {
373
  table=form_view_elemet.parentNode.nextSibling;
374
  }
375
  else {
376
  if(form_view_elemet.parentNode.nextSibling.nextSibling) {
377
  if(form_view_elemet.parentNode.nextSibling.nextSibling.tagName=="DIV") {
378
  table=form_view_elemet.parentNode.nextSibling.nextSibling;
379
  }
380
  else {
381
  table="none";
382
  }
383
  }
384
  else {
385
  table="none";
386
  }
387
  }
388
  if(table!="none") {
389
  next_title =form_view_elemet.getAttribute('next_title');
390
  next_type =form_view_elemet.getAttribute('next_type');
391
  if(next_type=="text") {
392
  td.setAttribute("class", "next-page");
393
  }
394
  next_class = form_view_elemet.getAttribute('next_class');
395
  next_checkable = form_view_elemet.getAttribute('next_checkable');
396
  next_or_previous="next";
397
  next=make_pagebreak_button(next_or_previous, next_title, next_type, next_class, next_checkable, id, form_id, form_view_count, form_view_max);
398
  td.appendChild(next);
399
  }
400
  else {
401
  not_next=true;
402
  }
403
  }
404
  else {
405
  not_next=true;
406
  }
407
  fm_initilize_form(form_id);
408
  jQuery("#form" + form_id + " div[type='type_map']").each(function() {
409
  id=jQuery(this).parent().attr('wdid');
410
  if_gmap_init('wdform_'+id, form_id);
411
  for(q=0; q<20; q++) {
412
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
413
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
414
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
415
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
416
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,false);
417
  }
418
  }
419
  });
420
  jQuery("#form" + form_id + " div[type='type_mark_map']").each(function() {
421
  id=jQuery(this).parent().attr('wdid');
422
  if_gmap_init('wdform_'+id, form_id);
423
  q=0;
424
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
425
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
426
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
427
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
428
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,true);
429
  }
430
  });
431
  jQuery('.wdform-element-section').each(function() {
432
  });
433
  for(t=1; t<30; t++) {
434
  if(document.getElementById(form_id+'form_view'+t)) {
435
  document.getElementById(form_id+'form_view'+t).parentNode.style.display="none";
436
  }
437
  }
438
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='steps') {
439
  make_page_steps_front(form_view, form_id, form_view_count, form_view_max);
440
  }
441
  else {
442
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='percentage') {
443
  make_page_percentage_front(form_view, form_id, form_view_count, form_view_max);
444
  }
445
  else {
446
  make_page_none_front(form_id);
447
  }
448
  }
449
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='show_numbers') {
450
  td = document.getElementById(form_id+'page_numbers'+form_view);
451
  if(td) {
452
  destroyChildren(td);
453
  k=0;
454
  for(j=1; j<=form_view_max; j++) {
455
  if(document.getElementById(form_id+'form_view'+j)) {
456
  k++;
457
  if(j==form_view) {
458
  page_number=k;
459
  }
460
  }
461
  }
462
  var cur = document.createElement('span');
463
  cur.setAttribute("class", "page_numbers");
464
  cur.innerHTML=page_number+'/'+k;
465
  td.appendChild(cur);
466
  }
467
  }
468
  else {
469
  td = document.getElementById(form_id+'page_numbers'+form_view);
470
  if(td) {
471
  destroyChildren(document.getElementById(form_id+'page_numbers'+form_view));
472
  }
473
  }
474
  destroyChildren(document.getElementById('fm-pages' + form_id));
475
  show_title =(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
476
  next_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('next_checkable')=='true');
477
  previous_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('previous_checkable')=='true');
478
  k=0;
479
  for(j=1; j<=form_view_max; j++) {
480
  if(document.getElementById(form_id+'form_view'+j)) {
481
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
482
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
483
  }
484
  else {
485
  w_pages="";
486
  }
487
  k++;
488
  page_number = document.createElement('span');
489
  page_number.setAttribute('id','page_'+j);
490
  if(j<form_view) {
491
  if(previous_checkable) {
492
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
493
  }
494
  else {
495
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
496
  }
497
  }
498
  if(j>form_view) {
499
  if(next_checkable) {
500
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
501
  }
502
  else {
503
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
504
  }
505
  }
506
  if(j==form_view) {
507
  page_number.setAttribute('class',"page_active");
508
  }
509
  else {
510
  page_number.setAttribute('class',"page_deactive");
511
  }
512
  if(show_title) {
513
  page_number.innerHTML=w_pages;
514
  }
515
  else {
516
  page_number.innerHTML=k;
517
  }
518
  document.getElementById('fm-pages' + form_id).appendChild(page_number);
519
  }
520
  }
521
  destroyChildren(document.getElementById('fm-pages' + form_id));
522
  show_title=(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
523
  var div_parent = document.createElement('div');
524
  div_parent.setAttribute("class", "page_percentage_deactive");
525
  var div = document.createElement('div');
526
  div.setAttribute("id", "div_percentage");
527
  div.setAttribute("class", "page_percentage_active");
528
  div.setAttribute("align", "right");
529
  var div_arrow = document.createElement('div');
530
  div_arrow.setAttribute("class", "wdform_percentage_arrow");
531
  var b = document.createElement('b');
532
  b.setAttribute("class", "wdform_percentage_text");
533
  div.appendChild(b);
534
  k=0;
535
  cur_page_title='';
536
  for(j=1; j<=form_view_max; j++) {
537
  if(document.getElementById(form_id+'form_view'+j)) {
538
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
539
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
540
  }
541
  else {
542
  w_pages="";
543
  }
544
  k++;
545
  if(j==form_view) {
546
  if(show_title) {
547
  var cur_page_title = document.createElement('div');
548
  cur_page_title.innerHTML=w_pages;
549
  cur_page_title.innerHTML=w_pages;
550
  cur_page_title.setAttribute("class", "wdform_percentage_title");
551
  }
552
  page_number=k;
553
  }
554
  }
555
  }
556
  b.innerHTML=Math.round(((page_number-1)/k)*100)+'%';
557
  div.style.width=((page_number-1)/k)*100+'%';
558
  if(page_number==1) {
559
  div_arrow.style.display='none';
560
  }
561
  div_parent.appendChild(div);
562
  div_parent.appendChild(div_arrow);
563
  if(cur_page_title) {
564
  div_parent.appendChild(cur_page_title);
565
  }
566
  document.getElementById('fm-pages' + form_id).appendChild(div_parent);
567
  destroyChildren(document.getElementById('fm-pages' + form_id));
568
  switch(type) {
569
  case 'text': {
570
  var element = document.createElement('div');
571
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
572
  element.setAttribute('class', class_);
573
  if(checkable=="true") {
574
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
575
  }
576
  else {
577
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
578
  }
579
  element.innerHTML=title;
580
  return element;
581
  }
582
  case 'img':{
583
  var element = document.createElement('img');
584
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
585
  element.setAttribute('class', class_);
586
  if(checkable=="true") {
587
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
588
  }
589
  else {
590
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
591
  }
592
  if(title.indexOf("http")==0) {
593
  element.src=title;
594
  }
595
  else {
596
  element.src=fm_objectL10n.plugin_url+'/'+title;
597
  }
598
  return element;
599
  }
600
  }
601
  var curtop = 0;
602
  if (obj.offsetParent) {
603
  do {
604
  curtop += obj.offsetTop;
605
  } while (obj = obj.offsetParent);
606
  return [curtop];
607
  }
608
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
609
  if (form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
610
  if (form_view_elemet.parentNode.previousSibling.tagName == "DIV") {
611
  table = form_view_elemet.parentNode.previousSibling;
612
  }
613
  else {
614
  table = form_view_elemet.parentNode.previousSibling.previousSibling;
615
  }
616
  }
617
  if (!table.firstChild.tagName) {
618
  table.removeChild(table.firstChild);
619
  }
620
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
621
  form = jQuery("#form" + form_id);
622
  if (!form.parent().hasClass('fm-scrollbox-form')) {
623
  window.scroll(0, form_maker_findPos(form));
624
  }
625
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
626
  if (form_view_elemet.parentNode.nextSibling) {
627
  if (form_view_elemet.parentNode.nextSibling.tagName == "DIV") {
628
  table = form_view_elemet.parentNode.nextSibling;
629
  }
630
  else {
631
  table = form_view_elemet.parentNode.nextSibling.nextSibling;
632
  }
633
  }
634
  if (!table.firstChild.tagName) {
635
  table.removeChild(table.firstChild);
636
  }
637
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
638
  form = jQuery("#form" + form_id);
639
  if (!form.parent().hasClass('fm-scrollbox-form')) {
640
  window.scroll(0, form_maker_findPos(form));
641
  }
642
  if(filename.length == 0) {
643
  return true;
644
  }
645
  var dot = filename.lastIndexOf(".");
646
  var extension = filename.substr(dot+1,filename.length);
647
  exten=exten.split(',');
648
  for(var j=0 ; j<exten.length; j++) {
649
  exten[j]=exten[j].replace(/\./g,'');
650
  exten[j]=exten[j].replace(/ /g,'');
651
  if(extension.toLowerCase()==exten[j].toLowerCase())
652
  return true;
653
  }
654
  return false;
655
  addclass = typeof(addclass) != 'undefined' ? addclass : '';
656
  jQuery(select).wrap('<div class="sel-wrap ' + addclass + '"/>');
657
  var sel_options = '';
658
  var selected_option = false;
659
  jQuery(select).children('option').each(function() {
660
  if(jQuery(this).is(':selected')){
661
  selected_option = jQuery(this).index();
662
  }
663
  sel_options = sel_options + '<div class="sel-option" value="' + jQuery(this).val() + '">' + jQuery(this).html() + '</div>';
664
  });
665
  w=jQuery(select)[0].style.width;
666
  if(w=='100%') {
667
  w='100%';
668
  }
669
  else {
670
  w=(jQuery(select).width()+32)+'px';
671
  }
672
  var sel_imul = '<div class="sel-imul" style="width:'+w+'">\
673
  <div class="sel-selected">\
674
  <div class="selected-text">' + jQuery(select).children('option').eq(selected_option).html() + '</div>\
675
  <div class="sel-arraw"></div>\
676
  </div>\
677
  <div class="sel-options">' + sel_options + '</div>\
678
  </div>';
679
  jQuery(select).addClass('no-width');
680
  jQuery(select).before(sel_imul);
681
  var tektext = jQuery(this).children("option:selected").text();
682
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
683
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').children('.sel-option').removeClass('sel-ed');
684
  jQuery(this).addClass('sel-ed');
685
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').each(function() {
686
  if (jQuery(this).html() == tektext) {
687
  jQuery(this).addClass('sel-ed');
688
  }
689
  });
690
  jQuery('.sel-imul').removeClass('act');
691
  jQuery(this).addClass('act');
692
  if (jQuery(this).children('.sel-options').is(':visible')) {
693
  jQuery('.sel-options').hide();
694
  }
695
  else {
696
  jQuery('.sel-options').hide();
697
  jQuery(this).children('.sel-options').show();
698
  jQuery(this).children('.sel-options').css('width',jQuery(this).width());
699
  }
700
  var tektext = jQuery(this).html();
701
  jQuery(this).parent('.sel-options').parent('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
702
  jQuery(this).parent('.sel-options').children('.sel-option').removeClass('sel-ed');
703
  jQuery(this).addClass('sel-ed');
704
  var tekval = jQuery(this).attr('value');
705
  tekval = typeof(tekval) != 'undefined' ? tekval : tektext;
706
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').children('option').removeAttr('selected').each(function() {
707
  if (jQuery(this).html() == tektext) {
708
  jQuery(this).attr('selected', 'select');
709
  }
710
  });
711
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').change();
712
  selenter = true;
713
  selenter = false;
714
  if (!selenter) {
715
  jQuery('.sel-options').hide();
716
  jQuery('.sel-imul').removeClass('act');
717
  }
718
  var ttt;
719
  for (ttt=0; ttt < node.childNodes.length; ttt++) {
720
  if( node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test( node.childNodes[ttt].nodeValue )) {
721
  node.removeChild(node.childNodes[ttt]);
722
  ttt--;
723
  }
724
  else {
725
  if(node.childNodes[ttt].childNodes.length) {
726
  remove_whitespace(node.childNodes[ttt]);
727
  }
728
  }
729
  }
730
  return;
731
  if(element_value) {
732
  jQuery("#"+id).datepicker('option', min_max, element_value);
733
  }
734
  else {
735
  if(default_min_max == "today") {
736
  jQuery("#"+id).datepicker('option', min_max, new Date());
737
  }
738
  else {
739
  if (default_min_max.indexOf("d") == -1 && default_min_max.indexOf("m") == -1 && default_min_max.indexOf("y") == -1 && default_min_max.indexOf("w") == -1 && default_min_max != "") {
740
  default_min_max = jQuery.datepicker.formatDate(format, new Date(default_min_max));
741
  }
742
  jQuery("#"+id).datepicker('option', min_max, default_min_max);
743
  }
744
  }
745
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
746
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
747
  var condition_confirm_email = false;
748
  if(!window["check_before_submit" + form_id][wdid + "_" + form_id]) {
749
  condition_confirm_email = true;
750
  }
751
  else {
752
  condition_confirm_email = jQuery(element).val() != jQuery(element_confirm).val() ? true : false;
753
  }
754
  if(condition_confirm_email) {
755
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
756
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
757
  if(jQuery(element).val() != jQuery(element_confirm).val()) {
758
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
759
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_confirm");
760
  }
761
  window["check_before_submit" + form_id][wdid + "_" + form_id] = (wdid + "_" + form_id in window["check_before_submit" + form_id]) ? window["check_before_submit" + form_id][wdid + "_" + form_id] : true;
762
  }
763
  else {
764
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
765
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
766
  if(window["check_before_submit" + form_id][wdid + "_" + form_id] == true) {
767
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
768
  }
769
  }
770
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
771
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
772
  var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
773
  if(jQuery(element).val()!="" && !re.test(jQuery.trim(jQuery(element).val())) && jQuery(element).attr("title") != jQuery(element).val()){
774
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
775
  jQuery(element).parent().append("<div id='check_email_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message_check + "</div>");
776
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_check_mail");
777
  if(element.val() == element_confirm.val()) {
778
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
779
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
780
  }
781
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
782
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
783
  }
784
  else {
785
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
786
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_check_mail").removeClass("error_label_check_mail");
787
  window["check_before_submit" + form_id][wdid + "_" + form_id] = true;
788
  if(typeof element_confirm.val() ==="undefined") {
789
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
790
  }
791
  }
792
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
793
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
794
  var condition_confirm_pass = false;
795
  condition_confirm_pass = element.val() !== element_confirm.val();
796
  if(condition_confirm_pass) {
797
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
798
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
799
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_check_pass");
800
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
801
  }
802
  else {
803
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
804
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_check_pass").removeClass("error_label_check_pass");
805
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
806
  }
807
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown fm-minimized");
808
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeOutDown").addClass("fm-show fm-animated fadeInUp");
809
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
810
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeOutDown fm-minimized").addClass("fm-show fm-animated fadeInUp");
811
  var hide_date = new Date();
812
  hide_date.setDate(hide_date.getDate() + hide_interval);
813
  if( hide_interval > 0 ) {
814
  localStorage.setItem('hide-'+form_id, hide_date.getTime());
815
  }
816
  if(typeof close_callback === 'function') {
817
  close_callback();
818
  }
819
  var x = jQuery("#form" + form_id);
820
  var find_wrong_exp = false;
821
  var check_regExp = regExpObj ? regExpObj : window['check_regExp_all'+form_id];
822
  jQuery.each( check_regExp, function( wdid, exp ) {
823
  var element = "#wdform_" + wdid + "_element" + form_id;
824
  var RegExpression = "";
825
  var rules = unescape(exp[0]);
826
  (exp[1].length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules, exp[1]);
827
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
828
  if(jQuery(element).val().length > 0 && jQuery(element).val() != jQuery(element).attr('title')) {
829
  if (RegExpression.test(jQuery(element).val()) != true) {
830
  jQuery("#form"+form_id+" #wd_exp_"+wdid).remove();
831
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_exp_"+wdid+"' class='fm-not-filled'>" + exp[2] + "</div>");
832
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp");
833
  find_wrong_exp = true;
834
  if(!regExpObj){
835
  scroll_on_element(form_id);
836
  }
837
  }
838
  }
839
  }
840
  });
841
  if(find_wrong_exp === false) {
842
  return true;
843
  }
844
  return false;
845
  var parent_div = jQuery("#form" + form_id + " .fm-not-filled")[0].closest(".wdform_row");
846
  var body_hight = document.body.clientHeight;
847
  var element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
848
  var scrollChecker = function() {
849
  if(document.body.clientHeight !== body_hight ) {
850
  body_hight = document.body.clientHeight;
851
  element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
852
  jQuery('html body').stop();
853
  animateBodyToError();
854
  }
855
  };
856
  jQuery(window).on("scroll",scrollChecker);
857
  function animateBodyToError() {
858
  jQuery('html body').animate({
859
  scrollTop: element_offset - 150
860
  }, 500, function() {
861
  jQuery(window).off("scroll", scrollChecker);
862
  old_bg=jQuery(parent_div).css("background-color");
863
  jQuery(parent_div).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
864
  });
865
  }
866
  animateBodyToError();
867
  var x = jQuery("#form" + form_id);
868
  var find_wrong_type_upload = false;
869
  var upload_check = upload_check_field ? upload_check_field : window['file_upload_check'+form_id];
870
  jQuery.each( upload_check, function( wdid, upload_types ) {
871
  var element = "#wdform_" + wdid + "_element" + form_id;
872
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
873
  ext_available=getfileextension(jQuery(element).val(), upload_types);
874
  if(!ext_available) {
875
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
876
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_upload_type_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_file_type_error + "</div>");
877
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_upload");
878
  find_wrong_type_upload = true;
879
  }
880
  else {
881
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
882
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_upload").removeClass("error_label_upload")
883
  }
884
  }
885
  });
886
  if(!upload_check_field && find_wrong_type_upload === true){
887
  scroll_on_element(form_id);
888
  }
889
  if(find_wrong_type_upload === false) {
890
  return true;
891
  }
892
  return false;
893
  var x = jQuery("#form" + form_id);
894
  var req_fields = field_id ? field_id.split() : window['required_fields'+form_id];
895
  var not_filled = {};
896
  jQuery(req_fields).each(function(index, wdid) {
897
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none" ) {
898
  switch(window['labels_and_ids'+form_id][wdid]) {
899
  case 'type_text':
900
  case 'type_textarea':
901
  case 'type_paypal_price_new':
902
  case 'type_spinner':
903
  case 'type_number':
904
  case 'type_phone_new':
905
  case 'type_submitter_mail': {
906
  var element = "#wdform_" + wdid + "_element" + form_id;
907
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
908
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
909
  not_filled[wdid] = element;
910
  }
911
  }
912
  if(!field_id && !window['check_submit'+form_id]) {
913
  jQuery(element).focus(function() {
914
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
915
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
916
  }).blur(function() {
917
  wd_is_filled(form_id, wdid);
918
  });
919
  }
920
  break;
921
  }
922
  case 'type_own_select':
923
  case 'type_country':
924
  case 'type_paypal_select': {
925
  var element = "#wdform_" + wdid + "_element" + form_id;
926
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
927
  if(jQuery(element).val() == "") {
928
  not_filled[wdid] = element;
929
  }
930
  }
931
  if(!field_id && !window['check_submit'+form_id]) {
932
  jQuery(element).focus(function() {
933
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
934
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
935
  }).blur(function() {
936
  wd_is_filled(form_id, wdid);
937
  }).change(function() {
938
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
939
  wd_is_filled(form_id, wdid);
940
  });
941
  }
942
  break;
943
  }
944
  case 'type_phone': {
945
  var element = ["#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id];
946
  jQuery.each(element, function(i, elem){
947
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
948
  if(jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')){
949
  not_filled[wdid] = elem;
950
  }
951
  }
952
  if(!field_id && !window['check_submit'+form_id]){
953
  jQuery(elem).focus(function() {
954
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
955
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
956
  }).blur(function() {
957
  wd_is_filled(form_id, wdid);
958
  });
959
  }
960
  });
961
  break;
962
  }
963
  case 'type_name': {
964
  var element = ["#wdform_" + wdid + "_element_title" + form_id, "#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id, "#wdform_" + wdid + "_element_middle" + form_id];
965
  jQuery.each(element, function(i, elem){
966
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
967
  if((jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')) && typeof jQuery(elem).val() != "undefined"){
968
  not_filled[wdid] = elem;
969
  }
970
  }
971
  if(!field_id && !window['check_submit'+form_id]){
972
  jQuery(elem).focus(function() {
973
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
974
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
975
  }).blur(function() {
976
  wd_is_filled(form_id, wdid);
977
  });
978
  }
979
  });
980
  break;
981
  }
982
  case 'type_address': {
983
  var element = ["#wdform_" + wdid + "_street1" + form_id, "#wdform_" + wdid + "_street2" + form_id, "#wdform_" + wdid + "_city" + form_id, "#wdform_" + wdid + "_state" + form_id, "#wdform_" + wdid + "_postal" + form_id, "#wdform_" + wdid + "_country" + form_id];
984
  jQuery.each(element, function(i, elem){
985
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
986
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
987
  not_filled[wdid] = elem;
988
  }
989
  }
990
  if(!field_id && !window['check_submit'+form_id]){
991
  jQuery(elem).focus(function() {
992
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
993
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
994
  }).blur(function() {
995
  wd_is_filled(form_id, wdid);
996
  });
997
  }
998
  });
999
  break;
1000
  }
1001
  case 'type_checkbox':
1002
  case 'type_radio':
1003
  case 'type_scale_rating':
1004
  case 'type_paypal_checkbox':
1005
  case 'type_paypal_radio':
1006
  case 'type_paypal_shipping': {
1007
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none"){
1008
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
1009
  not_filled[wdid] = true;
1010
  }
1011
  }
1012
  if(!field_id && !window['check_submit'+form_id]){
1013
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1014
  jQuery(this).change(function() {
1015
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
1016
  wd_is_filled(form_id, wdid);
1017
  }
1018
  else{
1019
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1020
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1021
  }
1022
  });
1023
  });
1024
  }
1025
  break;
1026
  }
1027
  case 'type_star_rating': {
1028
  var element = "#wdform_" + wdid + "_selected_star_amount" + form_id;
1029
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1030
  if(jQuery(element).val() == ""){
1031
  not_filled[wdid] = true;
1032
  }
1033
  }
1034
  if(!field_id && !window['check_submit'+form_id]){
1035
  jQuery("#wdform_" + wdid + "_element" + form_id).click(function(){
1036
  if(jQuery(element).val() != ""){
1037
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1038
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1039
  }
1040
  });
1041
  }
1042
  break;
1043
  }
1044
  case 'type_range': {
1045
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
1046
  jQuery.each(element, function(i, elem){
1047
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1048
  if(jQuery(elem).val() == ""){
1049
  not_filled[wdid] = elem;
1050
  }
1051
  }
1052
  if(!field_id && !window['check_submit'+form_id]){
1053
  jQuery(elem).focus(function() {
1054
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1055
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1056
  }).blur(function() {
1057
  wd_is_filled(form_id, wdid);
1058
  });
1059
  }
1060
  });
1061
  break;
1062
  }
1063
  case 'type_grading': {
1064
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1065
  var count_grading = 0;
1066
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
1067
  if(jQuery(this).val() != "")
1068
  count_grading ++;
1069
  });
1070
  if(count_grading == 0)
1071
  not_filled[wdid] = true;
1072
  }
1073
  if(!field_id && !window['check_submit'+form_id]){
1074
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
1075
  jQuery(this).focus(function() {
1076
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1077
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1078
  }).blur(function() {
1079
  wd_is_filled(form_id, wdid);
1080
  });
1081
  });
1082
  }
1083
  break;
1084
  }
1085
  case 'type_slider': {
1086
  var slider_element = "#wdform_" + wdid + "_element" + form_id;
1087
  var element = "#wdform_" + wdid + "_slider_value" + form_id;
1088
  var min_value = "#wdform_" + wdid + "_element_min" + form_id;
1089
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1090
  if(jQuery(element).val() == jQuery(min_value).html()){
1091
  not_filled[wdid] = true;
1092
  }
1093
  }
1094
  if(!field_id && !window['check_submit'+form_id]){
1095
  jQuery(slider_element).slider({
1096
  change: function( event, ui ) {
1097
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1098
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1099
  wd_is_filled(form_id, wdid);
1100
  }
1101
  });
1102
  }
1103
  break;
1104
  }
1105
  case 'type_date':
1106
  case 'type_date_new': {
1107
  var element = "#wdform_" + wdid + "_element" + form_id;
1108
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1109
  if(jQuery(element).val() == ""){
1110
  not_filled[wdid] = element;
1111
  }
1112
  }
1113
  if(!field_id && !window['check_submit'+form_id]){
1114
  jQuery(element).focus(function() {
1115
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1116
  }).change(function() {
1117
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1118
  wd_is_filled(form_id, wdid);
1119
  });
1120
  }
1121
  break;
1122
  }
1123
  case 'type_date_range': {
1124
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
1125
  jQuery.each(element, function(i, elem){
1126
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1127
  if(jQuery(elem).val() == ""){
1128
  not_filled[wdid] = elem;
1129
  }
1130
  }
1131
  if(!field_id && !window['check_submit'+form_id]){
1132
  jQuery(elem).focus(function() {
1133
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1134
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1135
  }).change(function() {
1136
  wd_is_filled(form_id, wdid);
1137
  });
1138
  }
1139
  });
1140
  break;
1141
  }
1142
  case 'type_date_fields': {
1143
  var element = ["#wdform_" + wdid + "_day" + form_id, "#wdform_" + wdid + "_month" + form_id, "#wdform_" + wdid + "_year" + form_id];
1144
  jQuery.each(element, function(i, elem) {
1145
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1146
  if(jQuery(elem).val() == ""){
1147
  not_filled[wdid] = elem;
1148
  }
1149
  }
1150
  if(!field_id && !window['check_submit'+form_id]){
1151
  jQuery(elem).focus(function() {
1152
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1153
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1154
  }).blur(function() {
1155
  wd_is_filled(form_id, wdid);
1156
  }).change(function() {
1157
  wd_is_filled(form_id, wdid);
1158
  });
1159
  }
1160
  });
1161
  break;
1162
  }
1163
  case 'type_time': {
1164
  var element = ["#wdform_" + wdid + "_hh" + form_id, "#wdform_" + wdid + "_mm" + form_id, "#wdform_" + wdid + "_ss" + form_id];
1165
  jQuery.each(element, function(i, elem){
1166
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1167
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
1168
  not_filled[wdid] = elem;
1169
  }
1170
  }
1171
  if(!field_id && !window['check_submit'+form_id]){
1172
  jQuery(elem).focus(function() {
1173
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1174
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1175
  }).blur(function() {
1176
  wd_is_filled(form_id, wdid);
1177
  });
1178
  }
1179
  });
1180
  break;
1181
  }
1182
  case 'type_password': {
1183
  var element = "#wdform_" + wdid + "_element" + form_id;
1184
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1185
  if(jQuery(element).val() == ""){
1186
  not_filled[wdid] = element;
1187
  }
1188
  }
1189
  if(!field_id && !window['check_submit'+form_id]){
1190
  jQuery(element).focus(function() {
1191
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1192
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1193
  }).blur(function() {
1194
  wd_is_filled(form_id, wdid);
1195
  });
1196
  }
1197
  break;
1198
  }
1199
  case 'type_file_upload': {
1200
  var element = "#wdform_" + wdid + "_element" + form_id;
1201
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1202
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
1203
  not_filled[wdid] = element;
1204
  }
1205
  }
1206
  if(!field_id && !window['check_submit'+form_id]) {
1207
  jQuery(element).focus(function() {
1208
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1209
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1210
  }).change(function() {
1211
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1212
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1213
  wd_is_filled(form_id, wdid);
1214
  });
1215
  }
1216
  break;
1217
  }
1218
  case 'type_matrix': {
1219
  if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="radio" || jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="checkbox"){
1220
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1221
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
1222
  not_filled[wdid] = true;
1223
  }
1224
  }
1225
  if(!field_id && !window['check_submit'+form_id]) {
1226
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1227
  jQuery(this).change(function() {
1228
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
1229
  wd_is_filled(form_id, wdid);
1230
  }
1231
  else{
1232
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1233
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1234
  }
1235
  });
1236
  });
1237
  }
1238
  }
1239
  else if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="text") {
1240
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1241
  var count_input_matrix = 0;
1242
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1243
  if(jQuery(this).val() != "")
1244
  count_input_matrix ++;
1245
  });
1246
  if(count_input_matrix == 0)
1247
  not_filled[wdid] = true;
1248
  }
1249
  if(!field_id && !window['check_submit'+form_id]){
1250
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
1251
  jQuery(this)
1252
  .focus(function() {
1253
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1254
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1255
  })
1256
  .blur(function() {
1257
  wd_is_filled(form_id, wdid);
1258
  });
1259
  });
1260
  }
1261
  }
1262
  else {
1263
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1264
  var count_select_matrix = 0;
1265
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
1266
  if(jQuery(this).val() != "")
1267
  count_select_matrix ++;
1268
  });
1269
  if(count_select_matrix == 0)
1270
  not_filled[wdid] = true;
1271
  }
1272
  if(!field_id && !window['check_submit'+form_id]){
1273
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
1274
  jQuery(this).focus(function() {
1275
  if(jQuery(this).val() == ""){
1276
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1277
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1278
  }
1279
  }).change(function() {
1280
  wd_is_filled(form_id, wdid);
1281
  }).blur(function() {
1282
  wd_is_filled(form_id, wdid);
1283
  });
1284
  });
1285
  }
1286
  }
1287
  break;
1288
  }
1289
  case 'type_send_copy': {
1290
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1291
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
1292
  not_filled[wdid] = true;
1293
  }
1294
  }
1295
  if(!field_id && !window['check_submit'+form_id]){
1296
  jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").change(function() {
1297
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
1298
  wd_is_filled(form_id, wdid);
1299
  }
1300
  else {
1301
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1302
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1303
  }
1304
  });
1305
  }
1306
  break;
1307
  }
1308
  case 'type_captcha':
1309
  case 'type_arithmetic_captcha': {
1310
  var element = "";
1311
  if(window['labels_and_ids'+form_id][wdid] == 'type_captcha') {
1312
  element = '#wd_captcha_input' + form_id;
1313
  }
1314
  else {
1315
  element = '#wd_arithmetic_captcha_input' + form_id;
1316
  }
1317
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
1318
  if(jQuery(element).val() == ""){
1319
  not_filled[wdid] = element;
1320
  }
1321
  }
1322
  if(!field_id && !window['check_submit'+form_id]){
1323
  jQuery(element).focus(function() {
1324
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1325
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
1326
  }).blur(function() {
1327
  wd_is_filled(form_id, wdid);
1328
  });
1329
  }
1330
  break;
1331
  }
1332
  }
1333
  }
1334
  });
1335
  if (Object.keys(not_filled).length === 0 && Object.keys(window["check_before_submit" + form_id]).length === 0) {
1336
  return true;
1337
  }
1338
  else {
1339
  if (Object.keys(not_filled).length !== 0) {
1340
  jQuery.each( not_filled, function( wdid, elem ) {
1341
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
1342
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-element-section:first").append("<div id='wd_required_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_field_is_required + "</div>");
1343
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label");
1344
  });
1345
  }
1346
  if(!field_id){
1347
  scroll_on_element(form_id);
1348
  }
1349
  window['check_submit'+form_id] = 1;
1350
  return false;
1351
  }
1352
  var x = jQuery("#form" + form_id);
1353
  var check_price_min_max = price_nim_max ? price_nim_max : window['check_paypal_price_min_max'+form_id];
1354
  var find_wrong_price = false;
1355
  jQuery.each( check_price_min_max, function( wdid, min_max_option ) {
1356
  var element = "#wdform_" + wdid + "_element" + form_id;
1357
  var range_min = min_max_option[3] ? min_max_option[3] : 0;
1358
  var range_max = min_max_option[4] ? min_max_option[4] : -1;
1359
  if((min_max_option[2] ? true : false) || jQuery(element).val()!=min_max_option[1]) {
1360
  if((range_max!=-1 && parseFloat(jQuery(element).val()) > range_max) || parseFloat(jQuery(element).val()) < range_min) {
1361
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
1362
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_min_max_check_1 + min_max_option[0] + fm_objectL10n.fm_min_max_check_2 + (min_max_option[3] ? min_max_option[3] : 0) + '-' + (min_max_option[4] ? min_max_option[4] : "any") + "</div>");
1363
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
1364
  find_wrong_price = true;
1365
  if(!price_nim_max) {
1366
  scroll_on_element(form_id);
1367
  }
1368
  }
1369
  }
1370
  });
1371
  if(find_wrong_price === false) {
1372
  return true;
1373
  }
1374
  return false;
1375
  var x = jQuery("#form" + form_id);
1376
  var find_wrong_values = false;
1377
  var spinner_check = spinner_check_field ? spinner_check_field : window['spinner_check'+form_id];
1378
  jQuery.each( spinner_check, function( wdid, spinner_values ) {
1379
  var element = "#wdform_" + wdid + "_element" + form_id;
1380
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
1381
  if(parseInt(jQuery(element).val()) < parseInt(spinner_values[0]) || parseInt(jQuery(element).val()) > parseInt(spinner_values[1])) {
1382
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
1383
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_spinner_check + (spinner_values[0] ? spinner_values[0] : 0) + '-' + (spinner_values[1] ? spinner_values[1] : "any") + "</div>");
1384
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
1385
  find_wrong_values = true;
1386
  if(!spinner_check_field) {
1387
  scroll_on_element(form_id);
1388
  }
1389
  }
1390
  }
1391
  });
1392
  if(find_wrong_values === false) {
1393
  return true;
1394
  }
1395
  return false;
1396
  var scrollPercent = 100 * jQuery(window).scrollTop() / (jQuery(document).height() - jQuery(window).height());
1397
  if(!jQuery("#fm-scrollbox" + form_id).hasClass("fm-minimized") && scrollPercent >= window["scrollbox_trigger_point" + form_id]) {
1398
  setTimeout(function() {
1399
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1400
  jQuery("#fm-scrollbox" + form_id).css("visibility", "");
1401
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").addClass("fm-animated " + window["header_image_animation" + form_id]);
1402
  }, window["scrollbox_loading_delay" + form_id] * 1000);
1403
  } else {
1404
  if(window["scrollbox_auto_hide" + form_id]) {
1405
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").removeClass("fm-animated " + window["header_image_animation" + form_id]);
1406
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
1407
  }
1408
  }
1409
  if (typeof window["before_submit" + form_id] == 'function') {
1410
  if (window["before_submit" + form_id]()) {
1411
  return false;
1412
  }
1413
  }
1414
  if (!fm_check(0, form_id)) {
1415
  return false;
1416
  }
1417
  jQuery("#form" + form_id + " button").each(function () {
1418
  jQuery(this).attr('disabled', 'disabled');
1419
  });
1420
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"submit\" />").appendTo("#form"+form_id);
1421
  window["onsubmit_js" + form_id]();
1422
  if(window['checkStripe' + form_id] == 1) {
1423
  var jq_mainForm = jQuery("form[id='form"+form_id+"']");
1424
  if (jq_mainForm.find(".wdfm_stripe_elem").first().parents(".wdform_row").is(":visible")) {
1425
  wdfm_call_stripe();
1426
  }
1427
  else {
1428
  jQuery("#form"+form_id).submit();
1429
  }
1430
  }
1431
  else {
1432
  jQuery("#form"+form_id).submit();
1433
  }
1434
  if ( typeof window["before_reset" + form_id] == 'function' ) {
1435
  window["before_reset" + form_id]();
1436
  }
1437
  jQuery.each(window['labels_and_ids'+form_id], function (index, elem) {
1438
  switch(elem) {
1439
  case "type_text":
1440
  case "type_textarea":
1441
  case "type_number":
1442
  case "type_spinner":
1443
  case 'type_own_select':
1444
  case 'type_country':
1445
  case 'type_date':
1446
  case 'type_date_new':
1447
  case 'type_hidden':
1448
  case 'type_paypal_price_new':
1449
  jQuery("#wdform_"+index+"_element"+form_id).val('');
1450
  break;
1451
  case 'type_submitter_mail':
1452
  case 'type_password':
1453
  jQuery("#wdform_"+index+"_element"+form_id).val('');
1454
  if(jQuery("#wdform_"+index+"_1_element"+form_id)){
1455
  jQuery("#wdform_"+index+"_1_element"+form_id).val('');
1456
  if(jQuery("#confirm_"+index+"_"+form_id))
1457
  jQuery("#confirm_"+index+"_"+form_id).remove();
1458
  if(elem == 'type_submitter_mail' && jQuery("#check_email_"+index+"_"+form_id))
1459
  jQuery("#check_email_"+index+"_"+form_id).remove();
1460
  }
1461
  break;
1462
  case 'type_date_range':
1463
  jQuery("#wdform_"+index+"_element"+form_id+"0").val('');
1464
  jQuery("#wdform_"+index+"_element"+form_id+"1").val('');
1465
  break;
1466
  case 'type_send_copy':
1467
  jQuery("#wdform_"+index+"_element"+form_id).prop('checked', false);
1468
  break;
1469
  case 'type_phone':
1470
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id).val('');
1471
  break;
1472
  case 'type_name':
1473
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id+", #wdform_"+index+"_element_title"+form_id+", #wdform_"+index+"_element_middle"+form_id).val('');
1474
  break;
1475
  case 'type_address':
1476
  jQuery("#wdform_"+index+"_street1"+form_id+", #wdform_"+index+"_street2"+form_id+", #wdform_"+index+"_city"+form_id+", #wdform_"+index+"_state"+form_id+", #wdform_"+index+"_postal"+form_id+", #wdform_"+index+"_country"+form_id).val('');
1477
  break;
1478
  case 'type_checkbox':
1479
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
1480
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
1481
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
1482
  break;
1483
  case 'type_radio':
1484
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1485
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
1486
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
1487
  break;
1488
  case 'type_time':
1489
  jQuery("#wdform_"+index+"_hh"+form_id+", #wdform_"+index+"_mm"+form_id+", #wdform_"+index+"_ss"+form_id+", #wdform_"+index+"_am_pm"+form_id).val('');
1490
  break;
1491
  case 'type_date_fields':
1492
  jQuery("#wdform_"+index+"_day"+form_id+", #wdform_"+index+"_month"+form_id+", #wdform_"+index+"_year"+form_id).val('');
1493
  break;
1494
  case 'type_file_upload':
1495
  jQuery("#wdform_"+index+"_element"+form_id+"_save").remove();
1496
  break;
1497
  case 'type_paypal_price':
1498
  jQuery("#wdform_"+index+"_element_dollars"+form_id+", #wdform_"+index+"_element_cents"+form_id).val('');
1499
  break;
1500
  case 'type_paypal_select':
1501
  jQuery("#wdform_"+index+"_element"+form_id+", #wdform_"+index+"_element_quantity"+form_id+", #form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
1502
  break;
1503
  case 'type_paypal_radio':
1504
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
1505
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1506
  break;
1507
  case 'type_paypal_shipping':
1508
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1509
  break;
1510
  case 'type_paypal_checkbox':
1511
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
1512
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
1513
  break;
1514
  case 'type_star_rating':
1515
  jQuery("#wdform_"+index+"_selected_star_amount"+form_id).val('');
1516
  jQuery("#wdform_"+index+"_element"+form_id+" img").attr('src', fm_objectL10n.plugin_url + '/images/star.png');
1517
  break;
1518
  case 'type_scale_rating':
1519
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
1520
  break;
1521
  case 'type_slider':
1522
  jQuery("#wdform_"+index+"_element"+form_id).slider({
1523
  value: eval(0),
1524
  });
1525
  jQuery("#wdform_"+index+"_element_value"+form_id).html('0');
1526
  break;
1527
  case 'type_range':
1528
  jQuery("#wdform_"+index+"_element"+form_id+"0, #wdform_"+index+"_element"+form_id+"1").val('');
1529
  break;
1530
  case 'type_grading':
1531
  jQuery("#wdform_"+index+"_element"+form_id+" input").val('');
1532
  break;
1533
  case 'type_matrix':
1534
  jQuery("#wdform_"+index+"_element"+form_id+" .radio-div input").prop('checked', false);
1535
  jQuery("#wdform_"+index+"_element"+form_id+" .checkbox-div input").prop('checked', false);
1536
  jQuery("#wdform_"+index+"_element"+form_id+" input[type='text']").val('');
1537
  jQuery("#wdform_"+index+"_element"+form_id+" select").val('');
1538
  break;
1539
  case 'type_paypal_total':
1540
  jQuery("#wdform_"+index+"div_total"+form_id).html('$0');
1541
  jQuery("#wdform_"+index+"paypal_products"+form_id).empty();
1542
  break;
1543
  default:
1544
  break;
1545
  }
1546
  });
1547
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"save\" />").appendTo("#form"+form_id);
1548
  window["onsubmit_js" + form_id]();
1549
  jQuery("#form" + form_id + " button").each(function () {
1550
  jQuery(this).attr('disabled', 'disabled');
1551
  });
1552
  jQuery("#form"+form_id).submit();
1553
  var clear_data = confirm(fm_objectL10n.fm_clear_data);
1554
  if (clear_data == true) {
1555
  jQuery("#form" + form_id + " button").each(function () {
1556
  jQuery(this).attr('disabled', 'disabled');
1557
  });
1558
  jQuery.get(fm_objectL10n.form_maker_admin_ajax + '?action=FMClearProg&addon_task=clear_data&form_id=' + form_id).done(function() {
1559
  window.location = jQuery('#form' + form_id).attr('action');
1560
  });
1561
  }
1562
  if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
1563
  jQuery("#form" + form_id).find(jQuery("input[type='radio']")).click(function() {
1564
  jQuery("input[type='radio']+label").removeClass('if-ie-div-label');
1565
  jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')
1566
  });
1567
  jQuery("#form" + form_id).find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
1568
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']")).click(function() {
1569
  jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label');
1570
  jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')
1571
  });
1572
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']:checked+label")).addClass('if-ie-div-label');
1573
  }
1574
  jQuery.each(window["check_regExp_all" + form_id], function( wdid, exp ) {
1575
  var exp_array = {};
1576
  exp_array[wdid] = exp;
1577
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
1578
  wd_check_regExp(form_id, exp_array);
1579
  }).focus(function() {
1580
  jQuery("#form" + form_id + " #wd_exp_"+wdid).remove();
1581
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_exp").removeClass("error_label_exp")
1582
  });
1583
  });
1584
  jQuery.each(window["check_paypal_price_min_max" + form_id], function( wdid, price_min_max_option ) {
1585
  var price_min_max_array = {};
1586
  price_min_max_array[wdid] = price_min_max_option;
1587
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
1588
  wd_check_price_min_max(form_id, price_min_max_array)
1589
  }).focus(function() {
1590
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
1591
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
1592
  });
1593
  });
1594
  jQuery.each(window["spinner_check" + form_id], function( wdid, spinner_min_max ) {
1595
  var spinner_min_max_array = {};
1596
  spinner_min_max_array[wdid] = spinner_min_max;
1597
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
1598
  wd_spinner_check(form_id, spinner_min_max_array)
1599
  }).focus(function() {
1600
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
1601
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
1602
  });
1603
  });
1604
  jQuery.each(window["file_upload_check" + form_id], function( wdid, upload_types ) {
1605
  var upload_types_array = {};
1606
  upload_types_array[wdid] = upload_types;
1607
  jQuery("div[wdid='" + wdid + "'] input").change(function() {
1608
  wd_file_upload_check(form_id, upload_types_array);
1609
  });
1610
  });
1611
  jQuery("div[type='type_text'] input, div[type='type_number'] input, div[type='type_phone'] input, div[type='type_name'] input, div[type='type_submitter_mail'] input, div[type='type_submitter_mail_confirmation'] input, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input, div[type='type_textarea'] textarea").focus(function() {
1612
  delete_value(this)
1613
  }).blur(function() {
1614
  return_value(this)
1615
  });
1616
  jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity, div[type='type_paypal_price_new'] input").keypress(function(evt) {
1617
  return check_isnum(evt);
1618
  });
1619
  jQuery("div[type='type_grading'] input").keypress(function(evt) {
1620
  return check_isnum_or_minus(evt);
1621
  });
1622
  jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function() {
1623
  set_total_value(form_id);
1624
  });
1625
  jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input").change(function() {
1626
  set_total_value(form_id);
1627
  });
1628
  jQuery(".wdform-quantity").change(function() {
1629
  set_total_value(form_id);
1630
  });
1631
  jQuery("div[type='type_address'] select").change(function() {
1632
  set_total_value(form_id);
1633
  });
1634
  jQuery("div[type='type_time'] input").blur(function() {
1635
  add_0(this);
1636
  });
1637
  jQuery('.wdform-element-section').each(function() {
1638
  if(!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
1639
  if(jQuery(this).css('display')=="table-cell") {
1640
  if(jQuery(this).parent().attr('type')!="type_captcha") {
1641
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1642
  }
1643
  else {
1644
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1645
  }
1646
  }
1647
  }
1648
  if (!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
1649
  if (jQuery(this).css('display') == "table-cell") {
1650
  if (jQuery(this).parent().attr('type') != "type_captcha") {
1651
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1652
  }
1653
  else {
1654
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
1655
  }
1656
  }
1657
  }
1658
  if(parseInt(jQuery(this)[0].style.width.replace('px', '')) < parseInt(jQuery(this).css('min-width').replace('px', ''))) {
1659
  jQuery(this).css('min-width', parseInt(jQuery(this)[0].style.width.replace('px', ''))-10);
1660
  }
1661
  });
1662
  jQuery('.wdform-label').each(function() {
1663
  if(parseInt(jQuery(this).height()) >= 2*parseInt(jQuery(this).css('line-height').replace('px', ''))) {
1664
  jQuery(this).parent().css('max-width', jQuery(this).parent().width());
1665
  jQuery(this).parent().css('width', '');
1666
  }
1667
  });
1668
  (function(jQuery) {
1669
  jQuery.fn.shuffle = function() {
1670
  var allElems = this.get(),
1671
  getRandom = function(max) {
1672
  return Math.floor(Math.random() * max);
1673
  },
1674
  shuffled = jQuery.map(allElems, function() {
1675
  var random = getRandom(allElems.length),
1676
  randEl = jQuery(allElems[parseInt(random)]).clone(true)[0];
1677
  allElems.splice(random, 1);
1678
  return randEl;
1679
  });
1680
  this.each(function(i) {
1681
  jQuery(this).replaceWith(jQuery(shuffled[i]));
1682
  });
1683
  return jQuery(shuffled);
1684
  };
1685
  })(jQuery);
1686
  window["onload_js" + form_id]();
1687
  window["condition_js" + form_id]();
1688
  if (typeof window["before_load" + form_id] == 'function') {
1689
  window["before_load" + form_id]();
1690
  }
1691
  for(i=1; i<=30; i++) {
1692
  if (document.getElementById(form_id + 'form_view' + i)) {
1693
  window['form_view_count' + form_id]++;
1694
  window['form_view_max' + form_id] = i;
1695
  }
1696
  }
1697
  if (window['form_view_count' + form_id] > 1) {
1698
  for (i = 1; i <= window['form_view_max' + form_id]; i++) {
1699
  if (document.getElementById(form_id + 'form_view' + i)) {
1700
  window['first_form_view' + form_id] = i;
1701
  break;
1702
  }
1703
  }
1704
  generate_page_nav(window['first_form_view' + form_id], form_id, window['form_view_count' + form_id], window['form_view_max' + form_id]);
1705
  }
1706
  fm_initilize_form(form_id);
1707
  if(!wd_is_filled(form_id)) {
1708
  return false;
1709
  }
1710
  if(!wd_check_regExp(form_id)) {
1711
  return false;
1712
  }
1713
  if(!wd_check_price_min_max(form_id)) {
1714
  return false;
1715
  }
1716
  if(!wd_spinner_check(form_id)) {
1717
  return false;
1718
  }
1719
  if(!wd_file_upload_check(form_id)) {
1720
  return false;
1721
  }
1722
  window["check_js" + form_id](id, form_id);
1723
  return true;
1724
  jQuery(".g-recaptcha").each(function () {
1725
  grecaptcha.render(jQuery(this).attr('id'), {
1726
  'sitekey': jQuery(this).attr('data-sitekey'),
1727
  'theme': 'light'
1728
  });
1729
  });
1730
+ F=2;
1731
  jQuery(".wd-datepicker").each(function () {
1732
  jQuery(this).datepicker();
1733
  jQuery(this).datepicker("option", "dateFormat", jQuery(this).data("format"));
1734
  });
1735
  var FormCurrency = eval("FormCurrency_" + form_id);
1736
  if(jQuery('.paypal_total'+form_id).length==0) {
1737
  return;
1738
  }
1739
  var div_paypal_show = jQuery('.paypal_total'+form_id);
1740
  var div_paypal_products = jQuery('.paypal_products'+form_id);
1741
  var div_paypal_tax = jQuery('.paypal_tax'+form_id);
1742
  var input_paypal_total = jQuery('.input_paypal_total'+form_id);
1743
  var total=0;
1744
  var total_shipping=0;
1745
  div_paypal_products.html('');
1746
  div_paypal_tax.html('');
1747
  n = parseInt(jQuery('#counter'+form_id).val());
1748
  jQuery("#form" +form_id+ " div[type='type_paypal_checkbox'], #form" +form_id+ " div[type='type_paypal_radio']").each(function() {
1749
  id=jQuery(this).parent().attr('wdid');
1750
  jQuery(this).find('input:checked').each(
1751
  function() {
1752
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
1753
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
1754
  total =total + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
1755
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1756
  }
1757
  );
1758
  });
1759
  jQuery("#form" +form_id+ " div[type='type_paypal_shipping']").each(function() {
1760
  id=jQuery(this).parent().attr('wdid');
1761
  jQuery(this).find('input:checked').each(
1762
  function() {
1763
  label= jQuery("label[for='"+jQuery(this).attr('id')+"']").html();
1764
  span_value = FormCurrency + jQuery(this).val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
1765
  total_shipping =total_shipping + jQuery(this).val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
1766
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1767
  }
1768
  );
1769
  });
1770
  jQuery("#form" +form_id+ " div[type='type_paypal_select']").each(function() {
1771
  id=jQuery(this).parent().attr('wdid');
1772
  if(jQuery(this).find('select').val()!='') {
1773
  label = jQuery(this).find('select option:selected').html();
1774
  span_value = FormCurrency + jQuery(this).find('select').val()+(jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? ' x'+jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : '');
1775
  total =total + jQuery(this).find('select').val() * parseInt((jQuery('#wdform_'+id+"_element_quantity"+form_id).length!=0 ? jQuery('#wdform_'+id+"_element_quantity"+form_id).val() : 1));
1776
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1777
  }
1778
  });
1779
  jQuery("#form" +form_id+ " div[type='type_paypal_price']").each(function() {
1780
  id=jQuery(this).parent().attr('wdid');
1781
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active') || jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active')) {
1782
  label= jQuery(this).find('.wdform-label').html();
1783
  cents='00';
1784
  dollars='0';
1785
  if( jQuery('#wdform_'+id+"_element_dollars"+form_id).hasClass('input_active')) {
1786
  if(jQuery('#wdform_'+id+"_element_dollars"+form_id).val()!='') {
1787
  dollars=jQuery('#wdform_'+id+"_element_dollars"+form_id).val();
1788
  }
1789
  }
1790
  if( jQuery('#wdform_'+id+"_element_cents"+form_id).hasClass('input_active') && jQuery('#wdform_'+id+"_element_cents"+form_id).val()!='') {
1791
  if(jQuery('#wdform_'+id+"_element_cents"+form_id).val().length==1) {
1792
  cents='0'+jQuery('#wdform_'+id+"_element_cents"+form_id).val();
1793
  }
1794
  else {
1795
  cents=jQuery('#wdform_'+id+"_element_cents"+form_id).val();
1796
  }
1797
  }
1798
  span_value = FormCurrency + dollars+'.'+cents;
1799
  total =total + parseFloat(dollars+'.'+cents);
1800
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1801
  }
1802
  });
1803
  jQuery("#form" +form_id+ " div[type='type_paypal_price_new']").each(function(){
1804
  id=jQuery(this).parent().attr('wdid');
1805
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
1806
  label= jQuery(this).find('.wdform-label').html();
1807
  dollars='0';
1808
  if(jQuery('#wdform_'+id+"_element"+form_id).hasClass('input_active')) {
1809
  if(jQuery('#wdform_'+id+"_element"+form_id).val()!='') {
1810
  dollars=jQuery('#wdform_'+id+"_element"+form_id).val();
1811
  }
1812
  }
1813
  span_value = FormCurrency + dollars;
1814
  total =total + parseFloat(dollars);
1815
  div_paypal_products.html(div_paypal_products.html()+"<div>"+label+ ' - '+ span_value+"</div>");
1816
  }
1817
  });
1818
  var FormPaypalTax = eval("FormPaypalTax_" + form_id);
1819
  if(FormPaypalTax != 0) {
1820
  div_paypal_tax.html('Tax: ' + FormCurrency + (((total)*FormPaypalTax) / 100).toFixed(2));
1821
  }
1822
  jQuery('.div_total'+form_id).html(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
1823
  input_paypal_total.val(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
1824
  var chCode1 = e.which || e.keyCode;
1825
  if (chCode1 != 45) {
1826
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1827
  return false;
1828
  }
1829
  }
1830
  return true;
1831
  var sum = 0;
1832
  for(var k=0; k<100;k++) {
1833
  if(document.getElementById(num+'_element'+form_id+'_'+k)) {
1834
  if(document.getElementById(num+'_element'+form_id+'_'+k).value) {
1835
  sum = sum+parseInt(document.getElementById(num+'_element'+form_id+'_'+k).value);
1836
  }
1837
  }
1838
  if(document.getElementById(num+'_total_element'+form_id)) {
1839
  if(sum > document.getElementById(num+'_total_element'+form_id).innerHTML) {
1840
  document.getElementById(num+'_text_element'+form_id).innerHTML =" "+ fm_objectL10n.fm_grading_text + " " + document.getElementById(num+'_total_element'+form_id).innerHTML;
1841
  }
1842
  else {
1843
  document.getElementById(num+'_text_element'+form_id).innerHTML="";
1844
  }
1845
  }
1846
  }
1847
  if(document.getElementById(num+'_sum_element'+form_id)) {
1848
  document.getElementById(num+'_sum_element'+form_id).innerHTML = sum;
1849
  }
1850
  if(rated==false) {
1851
  for(var j=0;j<=id;j++) {
1852
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+'.png';
1853
  }
1854
  }
1855
  if(rated==false) {
1856
  for(var j=0;j<=id;j++) {
1857
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
1858
  }
1859
  }
1860
  rated=true;
1861
  for(var j=0;j<=id;j++) {
1862
  document.getElementById(el_id+'_star_'+j+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star_"+color+".png";
1863
  }
1864
  for(var k=id+1;k<=star_amount-1;k++) {
1865
  document.getElementById(el_id+'_star_'+k+'_'+form_id).src=fm_objectL10n.plugin_url+"/images/star.png";
1866
  }
1867
  document.getElementById(el_id+'_selected_star_amount'+form_id).value=id+1;
1868
  var element_other = jQuery('.form' + form_id + ' [id^=' + num + '_element' + form_id + '][other="1"]');
1869
  var parent_ = element_other.parent();
1870
  var br = document.createElement('br');
1871
  br.setAttribute("id", num + "_other_br" + form_id);
1872
  var elem_id = num.split("_")[1];
1873
  var el_other = document.createElement('input');
1874
  el_other.setAttribute("id", num + "_other_input" + form_id);
1875
  el_other.setAttribute("name", num + "_other_input" + form_id);
1876
  el_other.setAttribute("type", "text");
1877
  el_other.setAttribute("class", "other_input");
1878
  el_other.setAttribute("onchange", "other_input_change(this, '" + form_id + "', '" + elem_id + "')");
1879
  parent_.append(br);
1880
  parent_.append(el_other);
1881
  if (jQuery(elem).val() == "") {
1882
  wd_is_filled(form_id, wdid);
1883
  }
1884
  else {
1885
  jQuery("#form" + form_id + " #wd_required_" + wdid).remove();
1886
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label").removeClass("error_label");
1887
  }
1888
  var chCode1 = e.which || e.keyCode;
1889
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
1890
  return true;
1891
  }
1892
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1893
  return false;
1894
  }
1895
  return true;
1896
  srcArr=document.getElementById(id+genid).src.split("&r=");
1897
  document.getElementById(id+genid).src=srcArr[0]+'&r='+Math.floor(Math.random()*100);
1898
  document.getElementById(id+"_input"+genid).value='';
1899
  document.getElementById(id+genid).style.display="inline-block";
1900
  checking=document.getElementById(id+"_element"+form_id+j);
1901
  if(checking.getAttribute('other')) {
1902
  if(checking.getAttribute('other')==1) {
1903
  if(!checking.checked) {
1904
  if(document.getElementById(id+"_other_input"+form_id)) {
1905
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
1906
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
1907
  }
1908
  return false;
1909
  }
1910
  }
1911
  }
1912
  return true;
1913
  if(document.getElementById(id+"_other_input"+form_id)) {
1914
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_br"+form_id));
1915
  document.getElementById(id+"_other_input"+form_id).parentNode.removeChild(document.getElementById(id+"_other_input"+form_id));
1916
  }
1917
  if(jQuery(x).val().length==1) {
1918
  jQuery(x).val('0'+jQuery(x).val());
1919
  }
1920
  var chCode1 = e.which || e.keyCode;
1921
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1922
  return false;
1923
  }
1924
  hour=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1925
  hour=parseFloat(hour);
1926
  if((hour<0) || (hour>hour_interval)) {
1927
  return false;
1928
  }
1929
  return true;
1930
  var chCode1 = e.which || e.keyCode;
1931
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1932
  return false;
1933
  }
1934
  minute=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1935
  minute=parseFloat(minute);
1936
  if ((minute<0) || (minute>59)) {
1937
  return false;
1938
  }
1939
  return true;
1940
  var chCode1 = e.which || e.keyCode;
1941
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1942
  return false;
1943
  }
1944
  second=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1945
  second=parseFloat(second);
1946
  if ((second<0) || (second>59)) {
1947
  return false;
1948
  }
1949
  return true;
1950
  var chCode1 = e.which || e.keyCode;
1951
  if (jQuery.inArray(chCode1,[46,8,9,27,13,190]) != -1 || e.ctrlKey === true || (chCode1 >= 35 && chCode1 < 39)) {
1952
  return true;
1953
  }
1954
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1955
  return false;
1956
  }
1957
  val1=""+jQuery(x).val()+String.fromCharCode(chCode1);
1958
  if (val1.length>2) {
1959
  return false;
1960
  }
1961
  if (val1=='00') {
1962
  return false;
1963
  }
1964
  if ((val1<from) || (val1>to)) {
1965
  return false;
1966
  }
1967
  return true;
1968
  year=jQuery(x).val();
1969
  from=parseFloat(jQuery(x).attr('from'));
1970
  to=parseFloat(jQuery(x).attr('to'));
1971
  year=parseFloat(year);
1972
  if((year>=from) && (year<=to)) {
1973
  jQuery(x).val(year);
1974
  }
1975
  else {
1976
  jQuery(x).val('');
1977
  }
1978
  var chCode1 = e.which || e.keyCode;
1979
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1980
  return false;
1981
  }
1982
  day=""+jQuery(x).val()+String.fromCharCode(chCode1);
1983
  if(day.length>2) {
1984
  return false;
1985
  }
1986
  if(day=='00') {
1987
  return false;
1988
  }
1989
  day=parseFloat(day);
1990
  if((day<0) || (day>31)) {
1991
  return false;
1992
  }
1993
  return true;
1994
  var chCode1 = e.which || e.keyCode;
1995
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
1996
  return false;
1997
  }
1998
  month=""+jQuery(x).val()+String.fromCharCode(chCode1);
1999
  if(month.length>2) {
2000
  return false;
2001
  }
2002
  if(month=='00') {
2003
  return false;
2004
  }
2005
  month=parseFloat(month);
2006
  if((month<0) || (month>12)) {
2007
  return false;
2008
  }
2009
  return true;
2010
  var chCode1 = e.which || e.keyCode;
2011
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
2012
  return false;
2013
  }
2014
  year=""+jQuery(x).val()+String.fromCharCode(chCode1);
2015
  to=parseFloat(jQuery(x).attr('to'));
2016
  year=parseFloat(year);
2017
  if(year>to) {
2018
  return false;
2019
  }
2020
  return true;
2021
  ofontStyle=jQuery(x).attr('class');
2022
  if(ofontStyle.indexOf("input_deactive")!=-1) {
2023
  jQuery(x).val("").removeClass("input_deactive").addClass("input_active");
2024
  }
2025
  if(jQuery(x).val()=="") {
2026
  jQuery(x).val(jQuery(x).attr('title')).removeClass("input_active").addClass("input_deactive");
2027
  }
2028
  while (node.firstChild) {
2029
  node.removeChild(node.firstChild);
2030
  }
2031
  form_view=id;
2032
  page_nav=document.getElementById(form_id+'page_nav'+id);
2033
  destroyChildren(page_nav);
2034
  form_view_elemet=document.getElementById(form_id+'form_view'+id);
2035
  remove_whitespace(form_view_elemet.parentNode.parentNode);
2036
  display_none_form_views_all(form_id);
2037
  generate_page_bar(id, form_id, form_view_count, form_view_max);
2038
  form_view_elemet.parentNode.style.display="";
2039
  var td = document.createElement("div");
2040
  td.setAttribute("valign", "middle");
2041
  td.setAttribute("align", "left");
2042
  td.style.display="table-cell";
2043
  td.style.width="40%";
2044
  page_nav.appendChild(td);
2045
  if(form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
2046
  if(form_view_elemet.parentNode.previousSibling.tagName=="DIV") {
2047
  table=form_view_elemet.parentNode.previousSibling;
2048
  }
2049
  else {
2050
  if(form_view_elemet.parentNode.previousSibling.previousSibling.tagName=="DIV") {
2051
  table=form_view_elemet.parentNode.previousSibling.previousSibling;
2052
  }
2053
  else {
2054
  table="none";
2055
  }
2056
  }
2057
  if(table!="none") {
2058
  if(!table.firstChild.tagName) {
2059
  table.removeChild(table.firstChild);
2060
  }
2061
  previous_title = form_view_elemet.getAttribute('previous_title');
2062
  previous_type = form_view_elemet.getAttribute('previous_type');
2063
  if(previous_type=="text") {
2064
  td.setAttribute("class", "previous-page");
2065
  }
2066
  previous_class = form_view_elemet.getAttribute('previous_class');
2067
  previous_checkable = form_view_elemet.getAttribute('previous_checkable');
2068
  next_or_previous="previous";
2069
  previous=make_pagebreak_button(next_or_previous, previous_title, previous_type, previous_class, previous_checkable, id, form_id, form_view_count, form_view_max);
2070
  td.appendChild(previous);
2071
  }
2072
  }
2073
  var td = document.createElement("div");
2074
  td.setAttribute("id", form_id+"page_numbers"+form_view);
2075
  td.setAttribute("valign", "middle");
2076
  td.setAttribute("class", "page-numbers");
2077
  td.setAttribute("align", "center");
2078
  td.style.display="table-cell";
2079
  if(document.getElementById('fm-pages' + form_id).getAttribute('show_numbers')=="true") {
2080
  k=0;
2081
  for(j=1; j<=form_view_max; j++) {
2082
  if(document.getElementById(form_id+'form_view'+j)) {
2083
  k++;
2084
  if(j==form_view) {
2085
  page_number=k;
2086
  }
2087
  }
2088
  }
2089
  var cur = document.createElement('span');
2090
  cur.setAttribute("class", "page_numbers");
2091
  cur.innerHTML=page_number+'/'+k;
2092
  td.appendChild(cur);
2093
  }
2094
  page_nav.appendChild(td);
2095
  var td = document.createElement("div");
2096
  td.setAttribute("valign", "middle");
2097
  td.setAttribute("align", "right");
2098
  td.style.cssText = "display:table-cell; width:40%; text-align:right;";
2099
  page_nav.appendChild(td);
2100
  not_next=false;
2101
  if(form_view_elemet.parentNode.nextSibling) {
2102
  if(form_view_elemet.parentNode.nextSibling.tagName=="DIV" && form_view_elemet.parentNode.nextSibling.className=="wdform-page-and-images") {
2103
  table=form_view_elemet.parentNode.nextSibling;
2104
  }
2105
  else {
2106
  if(form_view_elemet.parentNode.nextSibling.nextSibling) {
2107
  if(form_view_elemet.parentNode.nextSibling.nextSibling.tagName=="DIV") {
2108
  table=form_view_elemet.parentNode.nextSibling.nextSibling;
2109
  }
2110
  else {
2111
  table="none";
2112
  }
2113
  }
2114
  else {
2115
  table="none";
2116
  }
2117
  }
2118
  if(table!="none") {
2119
  next_title =form_view_elemet.getAttribute('next_title');
2120
  next_type =form_view_elemet.getAttribute('next_type');
2121
  if(next_type=="text") {
2122
  td.setAttribute("class", "next-page");
2123
  }
2124
  next_class = form_view_elemet.getAttribute('next_class');
2125
  next_checkable = form_view_elemet.getAttribute('next_checkable');
2126
  next_or_previous="next";
2127
  next=make_pagebreak_button(next_or_previous, next_title, next_type, next_class, next_checkable, id, form_id, form_view_count, form_view_max);
2128
  td.appendChild(next);
2129
  }
2130
  else {
2131
  not_next=true;
2132
  }
2133
  }
2134
  else {
2135
  not_next=true;
2136
  }
2137
  fm_initilize_form(form_id);
2138
  jQuery("#form" + form_id + " div[type='type_map']").each(function() {
2139
  id=jQuery(this).parent().attr('wdid');
2140
  if_gmap_init('wdform_'+id, form_id);
2141
  for(q=0; q<20; q++) {
2142
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
2143
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
2144
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
2145
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
2146
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,false);
2147
  }
2148
  }
2149
  });
2150
  jQuery("#form" + form_id + " div[type='type_mark_map']").each(function() {
2151
  id=jQuery(this).parent().attr('wdid');
2152
  if_gmap_init('wdform_'+id, form_id);
2153
  q=0;
2154
  if(jQuery("#wdform_"+id+"_element"+form_id)[0].getAttribute("long"+q)) {
2155
  w_long=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("long"+q));
2156
  w_lat=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("lat"+q));
2157
  w_info=parseFloat(document.getElementById('wdform_'+id+"_element"+form_id).getAttribute("info"+q));
2158
  add_marker_on_map('wdform_'+id, q, w_long, w_lat, w_info, form_id,true);
2159
  }
2160
  });
2161
  jQuery('.wdform-element-section').each(function() {
2162
  });
2163
  for(t=1; t<30; t++) {
2164
  if(document.getElementById(form_id+'form_view'+t)) {
2165
  document.getElementById(form_id+'form_view'+t).parentNode.style.display="none";
2166
  }
2167
  }
2168
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='steps') {
2169
  make_page_steps_front(form_view, form_id, form_view_count, form_view_max);
2170
  }
2171
  else {
2172
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='percentage') {
2173
  make_page_percentage_front(form_view, form_id, form_view_count, form_view_max);
2174
  }
2175
  else {
2176
  make_page_none_front(form_id);
2177
  }
2178
  }
2179
  if(document.getElementById('fm-pages' + form_id).getAttribute('type')=='show_numbers') {
2180
  td = document.getElementById(form_id+'page_numbers'+form_view);
2181
  if(td) {
2182
  destroyChildren(td);
2183
  k=0;
2184
  for(j=1; j<=form_view_max; j++) {
2185
  if(document.getElementById(form_id+'form_view'+j)) {
2186
  k++;
2187
  if(j==form_view) {
2188
  page_number=k;
2189
  }
2190
  }
2191
  }
2192
  var cur = document.createElement('span');
2193
  cur.setAttribute("class", "page_numbers");
2194
  cur.innerHTML=page_number+'/'+k;
2195
  td.appendChild(cur);
2196
  }
2197
  }
2198
  else {
2199
  td = document.getElementById(form_id+'page_numbers'+form_view);
2200
  if(td) {
2201
  destroyChildren(document.getElementById(form_id+'page_numbers'+form_view));
2202
  }
2203
  }
2204
  destroyChildren(document.getElementById('fm-pages' + form_id));
2205
  show_title =(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
2206
  next_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('next_checkable')=='true');
2207
  previous_checkable =(document.getElementById(form_id+'form_view'+form_view).getAttribute('previous_checkable')=='true');
2208
  k=0;
2209
  for(j=1; j<=form_view_max; j++) {
2210
  if(document.getElementById(form_id+'form_view'+j)) {
2211
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
2212
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
2213
  }
2214
  else {
2215
  w_pages="";
2216
  }
2217
  k++;
2218
  page_number = document.createElement('span');
2219
  page_number.setAttribute('id','page_'+j);
2220
  if(j<form_view) {
2221
  if(previous_checkable) {
2222
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2223
  }
2224
  else {
2225
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2226
  }
2227
  }
2228
  if(j>form_view) {
2229
  if(next_checkable) {
2230
  page_number.setAttribute('onClick','if(fm_check('+form_view+', '+form_id+')) generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2231
  }
2232
  else {
2233
  page_number.setAttribute('onClick','generate_page_nav("'+j+'", "'+form_id+'", "'+form_view_count+'", "'+form_view_max+'")');
2234
  }
2235
  }
2236
  if(j==form_view) {
2237
  page_number.setAttribute('class',"page_active");
2238
  }
2239
  else {
2240
  page_number.setAttribute('class',"page_deactive");
2241
  }
2242
  if(show_title) {
2243
  page_number.innerHTML=w_pages;
2244
  }
2245
  else {
2246
  page_number.innerHTML=k;
2247
  }
2248
  document.getElementById('fm-pages' + form_id).appendChild(page_number);
2249
  }
2250
  }
2251
  destroyChildren(document.getElementById('fm-pages' + form_id));
2252
  show_title=(document.getElementById('fm-pages' + form_id).getAttribute('show_title')=='true');
2253
  var div_parent = document.createElement('div');
2254
  div_parent.setAttribute("class", "page_percentage_deactive");
2255
  var div = document.createElement('div');
2256
  div.setAttribute("id", "div_percentage");
2257
  div.setAttribute("class", "page_percentage_active");
2258
  div.setAttribute("align", "right");
2259
  var div_arrow = document.createElement('div');
2260
  div_arrow.setAttribute("class", "wdform_percentage_arrow");
2261
  var b = document.createElement('b');
2262
  b.setAttribute("class", "wdform_percentage_text");
2263
  div.appendChild(b);
2264
  k=0;
2265
  cur_page_title='';
2266
  for(j=1; j<=form_view_max; j++) {
2267
  if(document.getElementById(form_id+'form_view'+j)) {
2268
  if(document.getElementById(form_id+'form_view'+j).getAttribute('page_title')) {
2269
  w_pages=document.getElementById(form_id+'form_view'+j).getAttribute('page_title');
2270
  }
2271
  else {
2272
  w_pages="";
2273
  }
2274
  k++;
2275
  if(j==form_view) {
2276
  if(show_title) {
2277
  var cur_page_title = document.createElement('div');
2278
  cur_page_title.innerHTML=w_pages;
2279
  cur_page_title.innerHTML=w_pages;
2280
  cur_page_title.setAttribute("class", "wdform_percentage_title");
2281
  }
2282
  page_number=k;
2283
  }
2284
  }
2285
  }
2286
  b.innerHTML=Math.round(((page_number-1)/k)*100)+'%';
2287
  div.style.width=((page_number-1)/k)*100+'%';
2288
  if(page_number==1) {
2289
  div_arrow.style.display='none';
2290
  }
2291
  div_parent.appendChild(div);
2292
  div_parent.appendChild(div_arrow);
2293
  if(cur_page_title) {
2294
  div_parent.appendChild(cur_page_title);
2295
  }
2296
  document.getElementById('fm-pages' + form_id).appendChild(div_parent);
2297
  destroyChildren(document.getElementById('fm-pages' + form_id));
2298
  switch(type) {
2299
  case 'text': {
2300
  var element = document.createElement('div');
2301
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
2302
  element.setAttribute('class', class_);
2303
  if(checkable=="true") {
2304
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2305
  }
2306
  else {
2307
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2308
  }
2309
  element.innerHTML=title;
2310
  return element;
2311
  }
2312
  case 'img':{
2313
  var element = document.createElement('img');
2314
  element.setAttribute('id', "page_"+next_or_previous+"_"+id);
2315
  element.setAttribute('class', class_);
2316
  if(checkable=="true") {
2317
  element.setAttribute('onClick', "if(fm_check("+id+", "+form_id+")) page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2318
  }
2319
  else {
2320
  element.setAttribute('onClick', "page_"+next_or_previous+"("+id+","+form_id+","+form_view_count+","+form_view_max+")");
2321
  }
2322
  if(title.indexOf("http")==0) {
2323
  element.src=title;
2324
  }
2325
  else {
2326
  element.src=fm_objectL10n.plugin_url+'/'+title;
2327
  }
2328
  return element;
2329
  }
2330
  }
2331
  var curtop = 0;
2332
  if (obj.offsetParent) {
2333
  do {
2334
  curtop += obj.offsetTop;
2335
  } while (obj = obj.offsetParent);
2336
  return [curtop];
2337
  }
2338
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
2339
  if (form_view_elemet.parentNode.previousSibling && form_view_elemet.parentNode.previousSibling.previousSibling) {
2340
  if (form_view_elemet.parentNode.previousSibling.tagName == "DIV") {
2341
  table = form_view_elemet.parentNode.previousSibling;
2342
  }
2343
  else {
2344
  table = form_view_elemet.parentNode.previousSibling.previousSibling;
2345
  }
2346
  }
2347
  if (!table.firstChild.tagName) {
2348
  table.removeChild(table.firstChild);
2349
  }
2350
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
2351
  form = jQuery("#form" + form_id);
2352
  if (!form.parent().hasClass('fm-scrollbox-form')) {
2353
  window.scroll(0, form_maker_findPos(form));
2354
  }
2355
  form_view_elemet = document.getElementById(form_id + 'form_view' + id);
2356
  if (form_view_elemet.parentNode.nextSibling) {
2357
  if (form_view_elemet.parentNode.nextSibling.tagName == "DIV") {
2358
  table = form_view_elemet.parentNode.nextSibling;
2359
  }
2360
  else {
2361
  table = form_view_elemet.parentNode.nextSibling.nextSibling;
2362
  }
2363
  }
2364
  if (!table.firstChild.tagName) {
2365
  table.removeChild(table.firstChild);
2366
  }
2367
  generate_page_nav(table.firstChild.id.replace(form_id + 'form_view', ""), form_id, form_view_count, form_view_max);
2368
  form = jQuery("#form" + form_id);
2369
  if (!form.parent().hasClass('fm-scrollbox-form')) {
2370
  window.scroll(0, form_maker_findPos(form));
2371
  }
2372
  if(filename.length == 0) {
2373
  return true;
2374
  }
2375
  var dot = filename.lastIndexOf(".");
2376
  var extension = filename.substr(dot+1,filename.length);
2377
  exten=exten.split(',');
2378
  for(var j=0 ; j<exten.length; j++) {
2379
  exten[j]=exten[j].replace(/\./g,'');
2380
  exten[j]=exten[j].replace(/ /g,'');
2381
  if(extension.toLowerCase()==exten[j].toLowerCase())
2382
  return true;
2383
  }
2384
  return false;
2385
  addclass = typeof(addclass) != 'undefined' ? addclass : '';
2386
  jQuery(select).wrap('<div class="sel-wrap ' + addclass + '"/>');
2387
  var sel_options = '';
2388
  var selected_option = false;
2389
  jQuery(select).children('option').each(function() {
2390
  if(jQuery(this).is(':selected')){
2391
  selected_option = jQuery(this).index();
2392
  }
2393
  sel_options = sel_options + '<div class="sel-option" value="' + jQuery(this).val() + '">' + jQuery(this).html() + '</div>';
2394
  });
2395
  w=jQuery(select)[0].style.width;
2396
  if(w=='100%') {
2397
  w='100%';
2398
  }
2399
  else {
2400
  w=(jQuery(select).width()+32)+'px';
2401
  }
2402
  var sel_imul = '<div class="sel-imul" style="width:'+w+'">\
2403
  <div class="sel-selected">\
2404
  <div class="selected-text">' + jQuery(select).children('option').eq(selected_option).html() + '</div>\
2405
  <div class="sel-arraw"></div>\
2406
  </div>\
2407
  <div class="sel-options">' + sel_options + '</div>\
2408
  </div>';
2409
  jQuery(select).addClass('no-width');
2410
  jQuery(select).before(sel_imul);
2411
  var tektext = jQuery(this).children("option:selected").text();
2412
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
2413
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').children('.sel-option').removeClass('sel-ed');
2414
  jQuery(this).addClass('sel-ed');
2415
  jQuery(this).parent('.sel-wrap ').children('.sel-imul').children('.sel-options').each(function() {
2416
  if (jQuery(this).html() == tektext) {
2417
  jQuery(this).addClass('sel-ed');
2418
  }
2419
  });
2420
  jQuery('.sel-imul').removeClass('act');
2421
  jQuery(this).addClass('act');
2422
  if (jQuery(this).children('.sel-options').is(':visible')) {
2423
  jQuery('.sel-options').hide();
2424
  }
2425
  else {
2426
  jQuery('.sel-options').hide();
2427
  jQuery(this).children('.sel-options').show();
2428
  jQuery(this).children('.sel-options').css('width',jQuery(this).width());
2429
  }
2430
  var tektext = jQuery(this).html();
2431
  jQuery(this).parent('.sel-options').parent('.sel-imul').children('.sel-selected').children('.selected-text').html(tektext);
2432
  jQuery(this).parent('.sel-options').children('.sel-option').removeClass('sel-ed');
2433
  jQuery(this).addClass('sel-ed');
2434
  var tekval = jQuery(this).attr('value');
2435
  tekval = typeof(tekval) != 'undefined' ? tekval : tektext;
2436
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').children('option').removeAttr('selected').each(function() {
2437
  if (jQuery(this).html() == tektext) {
2438
  jQuery(this).attr('selected', 'select');
2439
  }
2440
  });
2441
  jQuery(this).parent('.sel-options').parent('.sel-imul').parent('.sel-wrap').children('select').change();
2442
  selenter = true;
2443
  selenter = false;
2444
  if (!selenter) {
2445
  jQuery('.sel-options').hide();
2446
  jQuery('.sel-imul').removeClass('act');
2447
  }
2448
  var ttt;
2449
  for (ttt=0; ttt < node.childNodes.length; ttt++) {
2450
  if( node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test( node.childNodes[ttt].nodeValue )) {
2451
  node.removeChild(node.childNodes[ttt]);
2452
  ttt--;
2453
  }
2454
  else {
2455
  if(node.childNodes[ttt].childNodes.length) {
2456
  remove_whitespace(node.childNodes[ttt]);
2457
  }
2458
  }
2459
  }
2460
  return;
2461
  if(element_value) {
2462
  jQuery("#"+id).datepicker('option', min_max, element_value);
2463
  }
2464
  else {
2465
  if(default_min_max == "today") {
2466
  jQuery("#"+id).datepicker('option', min_max, new Date());
2467
  }
2468
  else {
2469
  if (default_min_max.indexOf("d") == -1 && default_min_max.indexOf("m") == -1 && default_min_max.indexOf("y") == -1 && default_min_max.indexOf("w") == -1 && default_min_max != "") {
2470
  default_min_max = jQuery.datepicker.formatDate(format, new Date(default_min_max));
2471
  }
2472
  jQuery("#"+id).datepicker('option', min_max, default_min_max);
2473
  }
2474
  }
2475
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
2476
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
2477
  var condition_confirm_email = false;
2478
  if(!window["check_before_submit" + form_id][wdid + "_" + form_id]) {
2479
  condition_confirm_email = true;
2480
  }
2481
  else {
2482
  condition_confirm_email = jQuery(element).val() != jQuery(element_confirm).val() ? true : false;
2483
  }
2484
  if(condition_confirm_email) {
2485
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2486
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
2487
  if(jQuery(element).val() != jQuery(element_confirm).val()) {
2488
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
2489
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_confirm");
2490
  }
2491
  window["check_before_submit" + form_id][wdid + "_" + form_id] = (wdid + "_" + form_id in window["check_before_submit" + form_id]) ? window["check_before_submit" + form_id][wdid + "_" + form_id] : true;
2492
  }
2493
  else {
2494
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2495
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
2496
  if(window["check_before_submit" + form_id][wdid + "_" + form_id] == true) {
2497
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2498
  }
2499
  }
2500
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
2501
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
2502
  var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
2503
  if(jQuery(element).val()!="" && !re.test(jQuery.trim(jQuery(element).val())) && jQuery(element).attr("title") != jQuery(element).val()){
2504
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
2505
  jQuery(element).parent().append("<div id='check_email_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message_check + "</div>");
2506
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_check_mail");
2507
  if(element.val() == element_confirm.val()) {
2508
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2509
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm");
2510
  }
2511
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2512
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
2513
  }
2514
  else {
2515
  jQuery("#check_email_" + wdid + "_" + form_id).remove();
2516
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_check_mail").removeClass("error_label_check_mail");
2517
  window["check_before_submit" + form_id][wdid + "_" + form_id] = true;
2518
  if(typeof element_confirm.val() ==="undefined") {
2519
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2520
  }
2521
  }
2522
  var element = jQuery("#wdform_" + wdid +"_element" + form_id);
2523
  var element_confirm = jQuery("#wdform_" + wdid +"_1_element" + form_id);
2524
  var condition_confirm_pass = false;
2525
  condition_confirm_pass = element.val() !== element_confirm.val();
2526
  if(condition_confirm_pass) {
2527
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2528
  jQuery(element_confirm).parent().append("<div id='confirm_" + wdid + "_" + form_id + "' class='fm-not-filled'>" + message + "</div>");
2529
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_check_pass");
2530
  window["check_before_submit" + form_id][wdid + "_" + form_id] = false;
2531
  }
2532
  else {
2533
  jQuery("#confirm_" + wdid + "_" + form_id).remove();
2534
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:eq( 1 ) .error_label_check_pass").removeClass("error_label_check_pass");
2535
  delete window["check_before_submit" + form_id][wdid + "_" + form_id];
2536
  }
2537
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown fm-minimized");
2538
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeOutDown").addClass("fm-show fm-animated fadeInUp");
2539
  jQuery("#fm-minimize-text"+form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
2540
  jQuery("#fm-scrollbox"+form_id).removeClass("fm-animated fadeOutDown fm-minimized").addClass("fm-show fm-animated fadeInUp");
2541
  var hide_date = new Date();
2542
  hide_date.setDate(hide_date.getDate() + hide_interval);
2543
  if( hide_interval > 0 ) {
2544
  localStorage.setItem('hide-'+form_id, hide_date.getTime());
2545
  }
2546
  if(typeof close_callback === 'function') {
2547
  close_callback();
2548
  }
2549
  var x = jQuery("#form" + form_id);
2550
  var find_wrong_exp = false;
2551
  var check_regExp = regExpObj ? regExpObj : window['check_regExp_all'+form_id];
2552
  jQuery.each( check_regExp, function( wdid, exp ) {
2553
  var element = "#wdform_" + wdid + "_element" + form_id;
2554
  var RegExpression = "";
2555
  var rules = unescape(exp[0]);
2556
  (exp[1].length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules, exp[1]);
2557
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
2558
  if(jQuery(element).val().length > 0 && jQuery(element).val() != jQuery(element).attr('title')) {
2559
  if (RegExpression.test(jQuery(element).val()) != true) {
2560
  jQuery("#form"+form_id+" #wd_exp_"+wdid).remove();
2561
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_exp_"+wdid+"' class='fm-not-filled'>" + exp[2] + "</div>");
2562
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp");
2563
  find_wrong_exp = true;
2564
  if(!regExpObj){
2565
  scroll_on_element(form_id);
2566
  }
2567
  }
2568
  }
2569
  }
2570
  });
2571
  if(find_wrong_exp === false) {
2572
  return true;
2573
  }
2574
  return false;
2575
  var parent_div = jQuery("#form" + form_id + " .fm-not-filled")[0].closest(".wdform_row");
2576
  var body_hight = document.body.clientHeight;
2577
  var element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
2578
  var scrollChecker = function() {
2579
  if(document.body.clientHeight !== body_hight ) {
2580
  body_hight = document.body.clientHeight;
2581
  element_offset = jQuery(jQuery("#form" + form_id + " .fm-not-filled")[0]).offset().top;
2582
  jQuery('html body').stop();
2583
  animateBodyToError();
2584
  }
2585
  };
2586
  jQuery(window).on("scroll",scrollChecker);
2587
  function animateBodyToError() {
2588
  jQuery('html body').animate({
2589
  scrollTop: element_offset - 150
2590
  }, 500, function() {
2591
  jQuery(window).off("scroll", scrollChecker);
2592
  old_bg=jQuery(parent_div).css("background-color");
2593
  jQuery(parent_div).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
2594
  });
2595
  }
2596
  animateBodyToError();
2597
  var x = jQuery("#form" + form_id);
2598
  var find_wrong_type_upload = false;
2599
  var upload_check = upload_check_field ? upload_check_field : window['file_upload_check'+form_id];
2600
  jQuery.each( upload_check, function( wdid, upload_types ) {
2601
  var element = "#wdform_" + wdid + "_element" + form_id;
2602
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
2603
  ext_available=getfileextension(jQuery(element).val(), upload_types);
2604
  if(!ext_available) {
2605
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
2606
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_upload_type_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_file_type_error + "</div>");
2607
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_upload");
2608
  find_wrong_type_upload = true;
2609
  }
2610
  else {
2611
  jQuery("#form"+form_id+" #wd_upload_type_"+wdid).remove();
2612
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label_upload").removeClass("error_label_upload")
2613
  }
2614
  }
2615
  });
2616
  if(!upload_check_field && find_wrong_type_upload === true){
2617
  scroll_on_element(form_id);
2618
  }
2619
  if(find_wrong_type_upload === false) {
2620
  return true;
2621
  }
2622
  return false;
2623
  var x = jQuery("#form" + form_id);
2624
  var req_fields = field_id ? field_id.split() : window['required_fields'+form_id];
2625
  var not_filled = {};
2626
  jQuery(req_fields).each(function(index, wdid) {
2627
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none" ) {
2628
  switch(window['labels_and_ids'+form_id][wdid]) {
2629
  case 'type_text':
2630
  case 'type_textarea':
2631
  case 'type_paypal_price_new':
2632
  case 'type_spinner':
2633
  case 'type_number':
2634
  case 'type_phone_new':
2635
  case 'type_submitter_mail': {
2636
  var element = "#wdform_" + wdid + "_element" + form_id;
2637
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2638
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
2639
  not_filled[wdid] = element;
2640
  }
2641
  }
2642
  if(!field_id && !window['check_submit'+form_id]) {
2643
  jQuery(element).focus(function() {
2644
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2645
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2646
  }).blur(function() {
2647
  wd_is_filled(form_id, wdid);
2648
  });
2649
  }
2650
  break;
2651
  }
2652
  case 'type_own_select':
2653
  case 'type_country':
2654
  case 'type_paypal_select': {
2655
  var element = "#wdform_" + wdid + "_element" + form_id;
2656
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2657
  if(jQuery(element).val() == "") {
2658
  not_filled[wdid] = element;
2659
  }
2660
  }
2661
  if(!field_id && !window['check_submit'+form_id]) {
2662
  jQuery(element).focus(function() {
2663
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2664
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2665
  }).blur(function() {
2666
  wd_is_filled(form_id, wdid);
2667
  }).change(function() {
2668
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2669
  wd_is_filled(form_id, wdid);
2670
  });
2671
  }
2672
  break;
2673
  }
2674
  case 'type_phone': {
2675
  var element = ["#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id];
2676
  jQuery.each(element, function(i, elem){
2677
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2678
  if(jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')){
2679
  not_filled[wdid] = elem;
2680
  }
2681
  }
2682
  if(!field_id && !window['check_submit'+form_id]){
2683
  jQuery(elem).focus(function() {
2684
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2685
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2686
  }).blur(function() {
2687
  wd_is_filled(form_id, wdid);
2688
  });
2689
  }
2690
  });
2691
  break;
2692
  }
2693
  case 'type_name': {
2694
  var element = ["#wdform_" + wdid + "_element_title" + form_id, "#wdform_" + wdid + "_element_first" + form_id, "#wdform_" + wdid + "_element_last" + form_id, "#wdform_" + wdid + "_element_middle" + form_id];
2695
  jQuery.each(element, function(i, elem){
2696
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2697
  if((jQuery(elem).val() == "" || jQuery(elem).val() == jQuery(elem).attr('title')) && typeof jQuery(elem).val() != "undefined"){
2698
  not_filled[wdid] = elem;
2699
  }
2700
  }
2701
  if(!field_id && !window['check_submit'+form_id]){
2702
  jQuery(elem).focus(function() {
2703
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2704
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2705
  }).blur(function() {
2706
  wd_is_filled(form_id, wdid);
2707
  });
2708
  }
2709
  });
2710
  break;
2711
  }
2712
  case 'type_address': {
2713
  var element = ["#wdform_" + wdid + "_street1" + form_id, "#wdform_" + wdid + "_street2" + form_id, "#wdform_" + wdid + "_city" + form_id, "#wdform_" + wdid + "_state" + form_id, "#wdform_" + wdid + "_postal" + form_id, "#wdform_" + wdid + "_country" + form_id];
2714
  jQuery.each(element, function(i, elem){
2715
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2716
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
2717
  not_filled[wdid] = elem;
2718
  }
2719
  }
2720
  if(!field_id && !window['check_submit'+form_id]){
2721
  jQuery(elem).focus(function() {
2722
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2723
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2724
  }).blur(function() {
2725
  wd_is_filled(form_id, wdid);
2726
  });
2727
  }
2728
  });
2729
  break;
2730
  }
2731
  case 'type_checkbox':
2732
  case 'type_radio':
2733
  case 'type_scale_rating':
2734
  case 'type_paypal_checkbox':
2735
  case 'type_paypal_radio':
2736
  case 'type_paypal_shipping': {
2737
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none"){
2738
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
2739
  not_filled[wdid] = true;
2740
  }
2741
  }
2742
  if(!field_id && !window['check_submit'+form_id]){
2743
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2744
  jQuery(this).change(function() {
2745
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0 || jQuery("#wdform_"+ wdid +"_other_input" + form_id).val() == ""){
2746
  wd_is_filled(form_id, wdid);
2747
  }
2748
  else{
2749
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2750
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2751
  }
2752
  });
2753
  });
2754
  }
2755
  break;
2756
  }
2757
  case 'type_star_rating': {
2758
  var element = "#wdform_" + wdid + "_selected_star_amount" + form_id;
2759
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2760
  if(jQuery(element).val() == ""){
2761
  not_filled[wdid] = true;
2762
  }
2763
  }
2764
  if(!field_id && !window['check_submit'+form_id]){
2765
  jQuery("#wdform_" + wdid + "_element" + form_id).click(function(){
2766
  if(jQuery(element).val() != ""){
2767
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2768
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2769
  }
2770
  });
2771
  }
2772
  break;
2773
  }
2774
  case 'type_range': {
2775
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
2776
  jQuery.each(element, function(i, elem){
2777
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2778
  if(jQuery(elem).val() == ""){
2779
  not_filled[wdid] = elem;
2780
  }
2781
  }
2782
  if(!field_id && !window['check_submit'+form_id]){
2783
  jQuery(elem).focus(function() {
2784
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2785
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2786
  }).blur(function() {
2787
  wd_is_filled(form_id, wdid);
2788
  });
2789
  }
2790
  });
2791
  break;
2792
  }
2793
  case 'type_grading': {
2794
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2795
  var count_grading = 0;
2796
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
2797
  if(jQuery(this).val() != "")
2798
  count_grading ++;
2799
  });
2800
  if(count_grading == 0)
2801
  not_filled[wdid] = true;
2802
  }
2803
  if(!field_id && !window['check_submit'+form_id]){
2804
  jQuery.each(jQuery("#wdform_" + wdid + "_element" + form_id + " input"), function( i, val ){
2805
  jQuery(this).focus(function() {
2806
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2807
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2808
  }).blur(function() {
2809
  wd_is_filled(form_id, wdid);
2810
  });
2811
  });
2812
  }
2813
  break;
2814
  }
2815
  case 'type_slider': {
2816
  var slider_element = "#wdform_" + wdid + "_element" + form_id;
2817
  var element = "#wdform_" + wdid + "_slider_value" + form_id;
2818
  var min_value = "#wdform_" + wdid + "_element_min" + form_id;
2819
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2820
  if(jQuery(element).val() == jQuery(min_value).html()){
2821
  not_filled[wdid] = true;
2822
  }
2823
  }
2824
  if(!field_id && !window['check_submit'+form_id]){
2825
  jQuery(slider_element).slider({
2826
  change: function( event, ui ) {
2827
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2828
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2829
  wd_is_filled(form_id, wdid);
2830
  }
2831
  });
2832
  }
2833
  break;
2834
  }
2835
  case 'type_date':
2836
  case 'type_date_new': {
2837
  var element = "#wdform_" + wdid + "_element" + form_id;
2838
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2839
  if(jQuery(element).val() == ""){
2840
  not_filled[wdid] = element;
2841
  }
2842
  }
2843
  if(!field_id && !window['check_submit'+form_id]){
2844
  jQuery(element).focus(function() {
2845
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2846
  }).change(function() {
2847
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2848
  wd_is_filled(form_id, wdid);
2849
  });
2850
  }
2851
  break;
2852
  }
2853
  case 'type_date_range': {
2854
  var element = ["#wdform_" + wdid + "_element" + form_id + "0", "#wdform_" + wdid + "_element" + form_id + "1"];
2855
  jQuery.each(element, function(i, elem){
2856
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2857
  if(jQuery(elem).val() == ""){
2858
  not_filled[wdid] = elem;
2859
  }
2860
  }
2861
  if(!field_id && !window['check_submit'+form_id]){
2862
  jQuery(elem).focus(function() {
2863
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2864
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2865
  }).change(function() {
2866
  wd_is_filled(form_id, wdid);
2867
  });
2868
  }
2869
  });
2870
  break;
2871
  }
2872
  case 'type_date_fields': {
2873
  var element = ["#wdform_" + wdid + "_day" + form_id, "#wdform_" + wdid + "_month" + form_id, "#wdform_" + wdid + "_year" + form_id];
2874
  jQuery.each(element, function(i, elem) {
2875
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2876
  if(jQuery(elem).val() == ""){
2877
  not_filled[wdid] = elem;
2878
  }
2879
  }
2880
  if(!field_id && !window['check_submit'+form_id]){
2881
  jQuery(elem).focus(function() {
2882
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2883
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2884
  }).blur(function() {
2885
  wd_is_filled(form_id, wdid);
2886
  }).change(function() {
2887
  wd_is_filled(form_id, wdid);
2888
  });
2889
  }
2890
  });
2891
  break;
2892
  }
2893
  case 'type_time': {
2894
  var element = ["#wdform_" + wdid + "_hh" + form_id, "#wdform_" + wdid + "_mm" + form_id, "#wdform_" + wdid + "_ss" + form_id];
2895
  jQuery.each(element, function(i, elem){
2896
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2897
  if(jQuery(elem).val() == "" && typeof jQuery(elem).val() != "undefined"){
2898
  not_filled[wdid] = elem;
2899
  }
2900
  }
2901
  if(!field_id && !window['check_submit'+form_id]){
2902
  jQuery(elem).focus(function() {
2903
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2904
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2905
  }).blur(function() {
2906
  wd_is_filled(form_id, wdid);
2907
  });
2908
  }
2909
  });
2910
  break;
2911
  }
2912
  case 'type_password': {
2913
  var element = "#wdform_" + wdid + "_element" + form_id;
2914
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2915
  if(jQuery(element).val() == ""){
2916
  not_filled[wdid] = element;
2917
  }
2918
  }
2919
  if(!field_id && !window['check_submit'+form_id]){
2920
  jQuery(element).focus(function() {
2921
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2922
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2923
  }).blur(function() {
2924
  wd_is_filled(form_id, wdid);
2925
  });
2926
  }
2927
  break;
2928
  }
2929
  case 'type_file_upload': {
2930
  var element = "#wdform_" + wdid + "_element" + form_id;
2931
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2932
  if(jQuery(element).val() == jQuery(element).attr('title') || jQuery(element).val() == ""){
2933
  not_filled[wdid] = element;
2934
  }
2935
  }
2936
  if(!field_id && !window['check_submit'+form_id]) {
2937
  jQuery(element).focus(function() {
2938
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2939
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2940
  }).change(function() {
2941
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2942
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2943
  wd_is_filled(form_id, wdid);
2944
  });
2945
  }
2946
  break;
2947
  }
2948
  case 'type_matrix': {
2949
  if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="radio" || jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="checkbox"){
2950
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2951
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
2952
  not_filled[wdid] = true;
2953
  }
2954
  }
2955
  if(!field_id && !window['check_submit'+form_id]) {
2956
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2957
  jQuery(this).change(function() {
2958
  if(x.find(jQuery("div[wdid='"+ wdid +"'] input:checked")).length == 0){
2959
  wd_is_filled(form_id, wdid);
2960
  }
2961
  else{
2962
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2963
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2964
  }
2965
  });
2966
  });
2967
  }
2968
  }
2969
  else if(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").attr('type') =="text") {
2970
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2971
  var count_input_matrix = 0;
2972
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2973
  if(jQuery(this).val() != "")
2974
  count_input_matrix ++;
2975
  });
2976
  if(count_input_matrix == 0)
2977
  not_filled[wdid] = true;
2978
  }
2979
  if(!field_id && !window['check_submit'+form_id]){
2980
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input"), function( i, val ){
2981
  jQuery(this)
2982
  .focus(function() {
2983
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
2984
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
2985
  })
2986
  .blur(function() {
2987
  wd_is_filled(form_id, wdid);
2988
  });
2989
  });
2990
  }
2991
  }
2992
  else {
2993
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
2994
  var count_select_matrix = 0;
2995
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
2996
  if(jQuery(this).val() != "")
2997
  count_select_matrix ++;
2998
  });
2999
  if(count_select_matrix == 0)
3000
  not_filled[wdid] = true;
3001
  }
3002
  if(!field_id && !window['check_submit'+form_id]){
3003
  jQuery.each(jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] select"), function( i, val ){
3004
  jQuery(this).focus(function() {
3005
  if(jQuery(this).val() == ""){
3006
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3007
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
3008
  }
3009
  }).change(function() {
3010
  wd_is_filled(form_id, wdid);
3011
  }).blur(function() {
3012
  wd_is_filled(form_id, wdid);
3013
  });
3014
  });
3015
  }
3016
  }
3017
  break;
3018
  }
3019
  case 'type_send_copy': {
3020
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
3021
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
3022
  not_filled[wdid] = true;
3023
  }
3024
  }
3025
  if(!field_id && !window['check_submit'+form_id]){
3026
  jQuery("#form" + form_id + " div[wdid='"+ wdid +"'] input").change(function() {
3027
  if(jQuery("div[wdid='"+ wdid +"'] input:checked").length == 0){
3028
  wd_is_filled(form_id, wdid);
3029
  }
3030
  else {
3031
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3032
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
3033
  }
3034
  });
3035
  }
3036
  break;
3037
  }
3038
  case 'type_captcha':
3039
  case 'type_arithmetic_captcha': {
3040
  var element = "";
3041
  if(window['labels_and_ids'+form_id][wdid] == 'type_captcha') {
3042
  element = '#wd_captcha_input' + form_id;
3043
  }
3044
  else {
3045
  element = '#wd_arithmetic_captcha_input' + form_id;
3046
  }
3047
  if(x.find(jQuery("div[wdid='"+wdid+"']")).closest(".wdform-page-and-images").css('display') !="none") {
3048
  if(jQuery(element).val() == ""){
3049
  not_filled[wdid] = element;
3050
  }
3051
  }
3052
  if(!field_id && !window['check_submit'+form_id]){
3053
  jQuery(element).focus(function() {
3054
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3055
  jQuery("#form"+form_id+" div[wdid='"+wdid+"'] .wdform-label-section:first .error_label").removeClass("error_label");
3056
  }).blur(function() {
3057
  wd_is_filled(form_id, wdid);
3058
  });
3059
  }
3060
  break;
3061
  }
3062
  }
3063
  }
3064
  });
3065
  if (Object.keys(not_filled).length === 0 && Object.keys(window["check_before_submit" + form_id]).length === 0) {
3066
  return true;
3067
  }
3068
  else {
3069
  if (Object.keys(not_filled).length !== 0) {
3070
  jQuery.each( not_filled, function( wdid, elem ) {
3071
  jQuery("#form"+form_id+" #wd_required_"+wdid).remove();
3072
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-element-section:first").append("<div id='wd_required_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_field_is_required + "</div>");
3073
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label");
3074
  });
3075
  }
3076
  if(!field_id){
3077
  scroll_on_element(form_id);
3078
  }
3079
  window['check_submit'+form_id] = 1;
3080
  return false;
3081
  }
3082
  var x = jQuery("#form" + form_id);
3083
  var check_price_min_max = price_nim_max ? price_nim_max : window['check_paypal_price_min_max'+form_id];
3084
  var find_wrong_price = false;
3085
  jQuery.each( check_price_min_max, function( wdid, min_max_option ) {
3086
  var element = "#wdform_" + wdid + "_element" + form_id;
3087
  var range_min = min_max_option[3] ? min_max_option[3] : 0;
3088
  var range_max = min_max_option[4] ? min_max_option[4] : -1;
3089
  if((min_max_option[2] ? true : false) || jQuery(element).val()!=min_max_option[1]) {
3090
  if((range_max!=-1 && parseFloat(jQuery(element).val()) > range_max) || parseFloat(jQuery(element).val()) < range_min) {
3091
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
3092
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_min_max_check_1 + min_max_option[0] + fm_objectL10n.fm_min_max_check_2 + (min_max_option[3] ? min_max_option[3] : 0) + '-' + (min_max_option[4] ? min_max_option[4] : "any") + "</div>");
3093
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
3094
  find_wrong_price = true;
3095
  if(!price_nim_max) {
3096
  scroll_on_element(form_id);
3097
  }
3098
  }
3099
  }
3100
  });
3101
  if(find_wrong_price === false) {
3102
  return true;
3103
  }
3104
  return false;
3105
  var x = jQuery("#form" + form_id);
3106
  var find_wrong_values = false;
3107
  var spinner_check = spinner_check_field ? spinner_check_field : window['spinner_check'+form_id];
3108
  jQuery.each( spinner_check, function( wdid, spinner_values ) {
3109
  var element = "#wdform_" + wdid + "_element" + form_id;
3110
  if(x.find(jQuery("div[wdid='"+wdid+"']")).length != 0 && x.find(jQuery("div[wdid='"+wdid+"']")).css("display") != "none") {
3111
  if(parseInt(jQuery(element).val()) < parseInt(spinner_values[0]) || parseInt(jQuery(element).val()) > parseInt(spinner_values[1])) {
3112
  jQuery("#form"+form_id+" #wd_price_"+wdid).remove();
3113
  x.find(jQuery("div[wdid='"+wdid+"'] .wdform-element-section")).append("<div id='wd_price_"+wdid+"' class='fm-not-filled'>" + fm_objectL10n.fm_spinner_check + (spinner_values[0] ? spinner_values[0] : 0) + '-' + (spinner_values[1] ? spinner_values[1] : "any") + "</div>");
3114
  jQuery("#form"+form_id+ " div[wdid='"+wdid+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price");
3115
  find_wrong_values = true;
3116
  if(!spinner_check_field) {
3117
  scroll_on_element(form_id);
3118
  }
3119
  }
3120
  }
3121
  });
3122
  if(find_wrong_values === false) {
3123
  return true;
3124
  }
3125
  return false;
3126
  var scrollPercent = 100 * jQuery(window).scrollTop() / (jQuery(document).height() - jQuery(window).height());
3127
  if(!jQuery("#fm-scrollbox" + form_id).hasClass("fm-minimized") && scrollPercent >= window["scrollbox_trigger_point" + form_id]) {
3128
  setTimeout(function() {
3129
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
3130
  jQuery("#fm-scrollbox" + form_id).css("visibility", "");
3131
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").addClass("fm-animated " + window["header_image_animation" + form_id]);
3132
  }, window["scrollbox_loading_delay" + form_id] * 1000);
3133
  } else {
3134
  if(window["scrollbox_auto_hide" + form_id]) {
3135
  jQuery("#fm-scrollbox" + form_id + " .fm-header-img").removeClass("fm-animated " + window["header_image_animation" + form_id]);
3136
  jQuery("#fm-scrollbox" + form_id).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown");
3137
  }
3138
  }
3139
  if (typeof window["before_submit" + form_id] == 'function') {
3140
  if (window["before_submit" + form_id]()) {
3141
  return false;
3142
  }
3143
  }
3144
  if (!fm_check(0, form_id)) {
3145
  return false;
3146
  }
3147
  jQuery("#form" + form_id + " button").each(function () {
3148
  jQuery(this).attr('disabled', 'disabled');
3149
  });
3150
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"submit\" />").appendTo("#form"+form_id);
3151
  window["onsubmit_js" + form_id]();
3152
  if(window['checkStripe' + form_id] == 1) {
3153
  var jq_mainForm = jQuery("form[id='form"+form_id+"']");
3154
  if (jq_mainForm.find(".wdfm_stripe_elem").first().parents(".wdform_row").is(":visible")) {
3155
  wdfm_call_stripe();
3156
  }
3157
  else {
3158
  jQuery("#form"+form_id).submit();
3159
  }
3160
  }
3161
  else {
3162
  jQuery("#form"+form_id).submit();
3163
  }
3164
  if ( typeof window["before_reset" + form_id] == 'function' ) {
3165
  window["before_reset" + form_id]();
3166
  }
3167
  jQuery.each(window['labels_and_ids'+form_id], function (index, elem) {
3168
  switch(elem) {
3169
  case "type_text":
3170
  case "type_textarea":
3171
  case "type_number":
3172
  case "type_spinner":
3173
  case 'type_own_select':
3174
  case 'type_country':
3175
  case 'type_date':
3176
  case 'type_date_new':
3177
  case 'type_hidden':
3178
  case 'type_paypal_price_new':
3179
  jQuery("#wdform_"+index+"_element"+form_id).val('');
3180
  break;
3181
  case 'type_submitter_mail':
3182
  case 'type_password':
3183
  jQuery("#wdform_"+index+"_element"+form_id).val('');
3184
  if(jQuery("#wdform_"+index+"_1_element"+form_id)){
3185
  jQuery("#wdform_"+index+"_1_element"+form_id).val('');
3186
  if(jQuery("#confirm_"+index+"_"+form_id))
3187
  jQuery("#confirm_"+index+"_"+form_id).remove();
3188
  if(elem == 'type_submitter_mail' && jQuery("#check_email_"+index+"_"+form_id))
3189
  jQuery("#check_email_"+index+"_"+form_id).remove();
3190
  }
3191
  break;
3192
  case 'type_date_range':
3193
  jQuery("#wdform_"+index+"_element"+form_id+"0").val('');
3194
  jQuery("#wdform_"+index+"_element"+form_id+"1").val('');
3195
  break;
3196
  case 'type_send_copy':
3197
  jQuery("#wdform_"+index+"_element"+form_id).prop('checked', false);
3198
  break;
3199
  case 'type_phone':
3200
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id).val('');
3201
  break;
3202
  case 'type_name':
3203
  jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id+", #wdform_"+index+"_element_title"+form_id+", #wdform_"+index+"_element_middle"+form_id).val('');
3204
  break;
3205
  case 'type_address':
3206
  jQuery("#wdform_"+index+"_street1"+form_id+", #wdform_"+index+"_street2"+form_id+", #wdform_"+index+"_city"+form_id+", #wdform_"+index+"_state"+form_id+", #wdform_"+index+"_postal"+form_id+", #wdform_"+index+"_country"+form_id).val('');
3207
  break;
3208
  case 'type_checkbox':
3209
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
3210
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
3211
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
3212
  break;
3213
  case 'type_radio':
3214
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3215
  jQuery("#wdform_"+index+"_other_br"+form_id).remove();
3216
  jQuery("#wdform_"+index+"_other_input"+form_id).remove();
3217
  break;
3218
  case 'type_time':
3219
  jQuery("#wdform_"+index+"_hh"+form_id+", #wdform_"+index+"_mm"+form_id+", #wdform_"+index+"_ss"+form_id+", #wdform_"+index+"_am_pm"+form_id).val('');
3220
  break;
3221
  case 'type_date_fields':
3222
  jQuery("#wdform_"+index+"_day"+form_id+", #wdform_"+index+"_month"+form_id+", #wdform_"+index+"_year"+form_id).val('');
3223
  break;
3224
  case 'type_file_upload':
3225
  jQuery("#wdform_"+index+"_element"+form_id+"_save").remove();
3226
  break;
3227
  case 'type_paypal_price':
3228
  jQuery("#wdform_"+index+"_element_dollars"+form_id+", #wdform_"+index+"_element_cents"+form_id).val('');
3229
  break;
3230
  case 'type_paypal_select':
3231
  jQuery("#wdform_"+index+"_element"+form_id+", #wdform_"+index+"_element_quantity"+form_id+", #form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
3232
  break;
3233
  case 'type_paypal_radio':
3234
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
3235
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3236
  break;
3237
  case 'type_paypal_shipping':
3238
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3239
  break;
3240
  case 'type_paypal_checkbox':
3241
  jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val('');
3242
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop('checked', false);
3243
  break;
3244
  case 'type_star_rating':
3245
  jQuery("#wdform_"+index+"_selected_star_amount"+form_id).val('');
3246
  jQuery("#wdform_"+index+"_element"+form_id+" img").attr('src', fm_objectL10n.plugin_url + '/images/star.png');
3247
  break;
3248
  case 'type_scale_rating':
3249
  jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop('checked', false);
3250
  break;
3251
  case 'type_slider':
3252
  jQuery("#wdform_"+index+"_element"+form_id).slider({
3253
  value: eval(0),
3254
  });
3255
  jQuery("#wdform_"+index+"_element_value"+form_id).html('0');
3256
  break;
3257
  case 'type_range':
3258
  jQuery("#wdform_"+index+"_element"+form_id+"0, #wdform_"+index+"_element"+form_id+"1").val('');
3259
  break;
3260
  case 'type_grading':
3261
  jQuery("#wdform_"+index+"_element"+form_id+" input").val('');
3262
  break;
3263
  case 'type_matrix':
3264
  jQuery("#wdform_"+index+"_element"+form_id+" .radio-div input").prop('checked', false);
3265
  jQuery("#wdform_"+index+"_element"+form_id+" .checkbox-div input").prop('checked', false);
3266
  jQuery("#wdform_"+index+"_element"+form_id+" input[type='text']").val('');
3267
  jQuery("#wdform_"+index+"_element"+form_id+" select").val('');
3268
  break;
3269
  case 'type_paypal_total':
3270
  jQuery("#wdform_"+index+"div_total"+form_id).html('$0');
3271
  jQuery("#wdform_"+index+"paypal_products"+form_id).empty();
3272
  break;
3273
  default:
3274
  break;
3275
  }
3276
  });
3277
  jQuery("<input type=\"hidden\" name=\"save_or_submit"+form_id+"\" value =\"save\" />").appendTo("#form"+form_id);
3278
  window["onsubmit_js" + form_id]();
3279
  jQuery("#form" + form_id + " button").each(function () {
3280
  jQuery(this).attr('disabled', 'disabled');
3281
  });
3282
  jQuery("#form"+form_id).submit();
3283
  var clear_data = confirm(fm_objectL10n.fm_clear_data);
3284
  if (clear_data == true) {
3285
  jQuery("#form" + form_id + " button").each(function () {
3286
  jQuery(this).attr('disabled', 'disabled');
3287
  });
3288
  jQuery.get(fm_objectL10n.form_maker_admin_ajax + '?action=FMClearProg&addon_task=clear_data&form_id=' + form_id).done(function() {
3289
  window.location = jQuery('#form' + form_id).attr('action');
3290
  });
3291
  }
3292
  if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
3293
  jQuery("#form" + form_id).find(jQuery("input[type='radio']")).click(function() {
3294
  jQuery("input[type='radio']+label").removeClass('if-ie-div-label');
3295
  jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')
3296
  });
3297
  jQuery("#form" + form_id).find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
3298
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']")).click(function() {
3299
  jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label');
3300
  jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')
3301
  });
3302
  jQuery("#form" + form_id).find(jQuery("input[type='checkbox']:checked+label")).addClass('if-ie-div-label');
3303
  }
3304
  jQuery.each(window["check_regExp_all" + form_id], function( wdid, exp ) {
3305
  var exp_array = {};
3306
  exp_array[wdid] = exp;
3307
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
3308
  wd_check_regExp(form_id, exp_array);
3309
  }).focus(function() {
3310
  jQuery("#form" + form_id + " #wd_exp_"+wdid).remove();
3311
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_exp").removeClass("error_label_exp")
3312
  });
3313
  });
3314
  jQuery.each(window["check_paypal_price_min_max" + form_id], function( wdid, price_min_max_option ) {
3315
  var price_min_max_array = {};
3316
  price_min_max_array[wdid] = price_min_max_option;
3317
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
3318
  wd_check_price_min_max(form_id, price_min_max_array)
3319
  }).focus(function() {
3320
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
3321
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
3322
  });
3323
  });
3324
  jQuery.each(window["spinner_check" + form_id], function( wdid, spinner_min_max ) {
3325
  var spinner_min_max_array = {};
3326
  spinner_min_max_array[wdid] = spinner_min_max;
3327
  jQuery("div[wdid='" + wdid + "'] input").blur(function() {
3328
  wd_spinner_check(form_id, spinner_min_max_array)
3329
  }).focus(function() {
3330
  jQuery("#form" + form_id + " #wd_price_" + wdid).remove();
3331
  jQuery("#form" + form_id + " div[wdid='" + wdid + "'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")
3332
  });
3333
  });
3334
  jQuery.each(window["file_upload_check" + form_id], function( wdid, upload_types ) {
3335
  var upload_types_array = {};
3336
  upload_types_array[wdid] = upload_types;
3337
  jQuery("div[wdid='" + wdid + "'] input").change(function() {
3338
  wd_file_upload_check(form_id, upload_types_array);
3339
  });
3340
  });
3341
  jQuery("div[type='type_text'] input, div[type='type_number'] input, div[type='type_phone'] input, div[type='type_name'] input, div[type='type_submitter_mail'] input, div[type='type_submitter_mail_confirmation'] input, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input, div[type='type_textarea'] textarea").focus(function() {
3342
  delete_value(this)
3343
  }).blur(function() {
3344
  return_value(this)
3345
  });
3346
  jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity, div[type='type_paypal_price_new'] input").keypress(function(evt) {
3347
  return check_isnum(evt);
3348
  });
3349
  jQuery("div[type='type_grading'] input").keypress(function(evt) {
3350
  return check_isnum_or_minus(evt);
3351
  });
3352
  jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function() {
3353
  set_total_value(form_id);
3354
  });
3355
  jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input").change(function() {
3356
  set_total_value(form_id);
3357
  });
3358
  jQuery(".wdform-quantity").change(function() {
3359
  set_total_value(form_id);
3360
  });
3361
  jQuery("div[type='type_address'] select").change(function() {
3362
  set_total_value(form_id);
3363
  });
3364
  jQuery("div[type='type_time'] input").blur(function() {
3365
  add_0(this);
3366
  });
3367
  jQuery('.wdform-element-section').each(function() {
3368
  if(!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
3369
  if(jQuery(this).css('display')=="table-cell") {
3370
  if(jQuery(this).parent().attr('type')!="type_captcha") {
3371
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3372
  }
3373
  else {
3374
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3375
  }
3376
  }
3377
  }
3378
  if (!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
3379
  if (jQuery(this).css('display') == "table-cell") {
3380
  if (jQuery(this).parent().attr('type') != "type_captcha") {
3381
  jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3382
  }
3383
  else {
3384
  jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width) * 2 + 50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width) + 15);
3385
  }
3386
  }
3387
  }
3388
  if(parseInt(jQuery(this)[0].style.width.replace('px', '')) < parseInt(jQuery(this).css('min-width').replace('px', ''))) {
3389
  jQuery(this).css('min-width', parseInt(jQuery(this)[0].style.width.replace('px', ''))-10);
3390
  }
3391
  });
3392
  jQuery('.wdform-label').each(function() {
3393
  if(parseInt(jQuery(this).height()) >= 2*parseInt(jQuery(this).css('line-height').replace('px', ''))) {
3394
  jQuery(this).parent().css('max-width', jQuery(this).parent().width());
3395
  jQuery(this).parent().css('width', '');
3396
  }
3397
  });
3398
  (function(jQuery) {
3399
  jQuery.fn.shuffle = function() {
3400
  var allElems = this.get(),
3401
  getRandom = function(max) {
3402
  return Math.floor(Math.random() * max);
3403
  },
3404
  shuffled = jQuery.map(allElems, function() {
3405
  var random = getRandom(allElems.length),
3406
  randEl = jQuery(allElems[parseInt(random)]).clone(true)[0];
3407
  allElems.splice(random, 1);
3408
  return randEl;
3409
  });
3410
  this.each(function(i) {
3411
  jQuery(this).replaceWith(jQuery(shuffled[i]));
3412
  });
3413
  return jQuery(shuffled);
3414
  };
3415
  })(jQuery);
3416
  window["onload_js" + form_id]();
3417
  window["condition_js" + form_id]();
3418
  if (typeof window["before_load" + form_id] == 'function') {
3419
  window["before_load" + form_id]();
3420
  }
3421
  for(i=1; i<=30; i++) {
3422
  if (document.getElementById(form_id + 'form_view' + i)) {
3423
  window['form_view_count' + form_id]++;
3424
  window['form_view_max' + form_id] = i;
3425
  }
3426
  }
3427
  if (window['form_view_count' + form_id] > 1) {
3428
  for (i = 1; i <= window['form_view_max' + form_id]; i++) {
3429
  if (document.getElementById(form_id + 'form_view' + i)) {
3430
  window['first_form_view' + form_id] = i;
3431
  break;
3432
  }
3433
  }
3434
  generate_page_nav(window['first_form_view' + form_id], form_id, window['form_view_count' + form_id], window['form_view_max' + form_id]);
3435
  }
3436
  fm_initilize_form(form_id);
3437
  if(!wd_is_filled(form_id)) {
3438
  return false;
3439
  }
3440
  if(!wd_check_regExp(form_id)) {
3441
  return false;
3442
  }
3443
  if(!wd_check_price_min_max(form_id)) {
3444
  return false;
3445
  }
3446
  if(!wd_spinner_check(form_id)) {
3447
  return false;
3448
  }
3449
  if(!wd_file_upload_check(form_id)) {
3450
  return false;
3451
  }
3452
  window["check_js" + form_id](id, form_id);
3453
  return true;
3454
  jQuery(".g-recaptcha").each(function () {
3455
  grecaptcha.render(jQuery(this).attr('id'), {
3456
  'sitekey': jQuery(this).attr('data-sitekey'),
3457
  'theme': 'light'
3458
  });
3459
  });
3460
  * Chnage state input.
3461
  *
3462
  * @param id
3463
  * @param form_id
3464
  */
3465
  if ( document.getElementById(id + "_country" + form_id)
3466
  && document.getElementById(id + "_state" + form_id) ) {
3467
  var flag = false;
3468
  var state_input = document.getElementById(id + "_state" + form_id);
3469
  if ( document.getElementById(id + "_country" + form_id).value == "United States" ) {
3470
  var state = document.createElement('select');
3471
  var states = fm_objectL10n.states;
3472
  for (var r in states) {
3473
  var option_ = document.createElement('option');
3474
  option_.setAttribute("value", r);
3475
  option_.innerHTML = states[r];
3476
  state.appendChild(option_);
3477
  }
3478
  flag = true;
3479
  }
3480
  else {
3481
  if ( document.getElementById(id + "_state" + form_id).tagName == 'SELECT' ) {
3482
  var state = document.createElement('input');
3483
  flag = true;
3484
  }
3485
  }
3486
  if ( flag ) {
3487
  state.setAttribute("type", 'text');
3488
  state.setAttribute("id", id + "_state" + form_id);
3489
  state.setAttribute("name", (parseInt(id.replace('wdform_', '')) + 3) + "_state" + form_id);
3490
  state.setAttribute("class", "wd-width-100");
3491
  var state_input_parent = state_input.parentNode;
3492
  state_input_parent.removeChild(state_input);
3493
  state_input_parent.insertBefore(state, state_input_parent.firstChild);
3494
  }
3495
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webdorado,wdsupport,formmakersupport
3
  Donate link: https://web-dorado.com/products/wordpress-form.html
4
  Tags: form, form builder, contact form, custom form, feedback, contact, contact forms, captcha, email, form manager, forms, survey
5
  Requires at least: 3.4
6
- Tested up to: 4.8
7
- Stable tag: 1.12.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -26,18 +26,18 @@ Form Maker is a FREE and user-friendly plugin to create highly customizable and
26
 
27
  = Form Maker Add-ons: =
28
 
29
- * [Google PDF Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/pdf.html)
30
- * [Conditional Emails Add-on](https://web-dorado.com/products/wordpress-form/add-ons/conditional-emails.html)
31
- * [Stripe Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/stripe.html)
32
- * [Import/Export Add-on](https://web-dorado.com/products/wordpress-form/add-ons/export-import.html)
33
- * [Save Progress Add-on](https://web-dorado.com/products/wordpress-form/add-ons/save-progress.html)
34
- * [Mailchimp Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/mailchimp.html)
35
- * [WordPress Registration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/registration.html)
36
- * [Post Generation Add-on](https://web-dorado.com/products/wordpress-form/add-ons/post-generation.html)
37
- * [Dropbox Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/dropbox.html)
38
- * [Google Drive Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/google-drive.html)
39
- * [Pushover Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/pushover.html)
40
- * [Calculator Add-on](https://web-dorado.com/products/wordpress-form/add-ons/calculator.html)
41
 
42
 
43
  This free form builder plugin with its multi-functional features is one of the most intuitive and modern form creator plugins for WordPress. It takes just a few clicks to construct complex HTML forms, and configure their structure with easy-to-use drag and drop interface.
@@ -48,16 +48,16 @@ Form Maker plugin is the best choice both for WordPress beginners and advanced u
48
  This form creator is developed to build unlimited number of simple forms, surveys and questionnaires, registrations, online applications, and more. Make your responsive web forms using the following field types:
49
 
50
  * Text Input (Name, Email, Phone fields and more)
51
- * Multiple and Single Choice
52
  * Time and Date
 
 
53
  * Select Box
54
  * Survey Tools (Star Rating, Matrix, Spinner and more)
55
  * Section Break and Page Break
56
  * Simple and Arithmetic Captcha
57
  * Google ReCaptcha
58
- * Submit and Reset Buttons
59
  * Custom Buttons
60
- * Custom HTML
61
 
62
  This WordPress form creator plugin provides a number of classy themes and display options to apply to your contact forms. Besides the drag and drop easy forms builder, Form Maker themes come with various user-friendly settings, as well as custom CSS editor, to let you fully personalize the display of your form.
63
 
@@ -73,7 +73,7 @@ To choose the best fitting form design, preview your custom form to quickly chec
73
 
74
  Form Maker package includes a list of pre-installed template forms, which you can quickly edit and publish on your WordPress website. Furthermore, the plugin lets you save copies these forms and customize them to fit your needs.
75
 
76
- Spambot protection for online contact forms is high priority. Therefore, Form Maker plugin provides these 3 types of validation to avoid spam on your contact me forms: Simple Captcha, Arithmetic Captcha and Google ReCaptcha. Also, with Block IP feature of the plugin, your HTML forms can be secured from certain IP addresses.
77
 
78
  Save your contact form submissions on MySQL database of your website, or send them to multiple recipient email addresses with Email Options of your custom forms. Additionally, Submissions page of the forms creator plugin lets you export submitted information with CSV or XML files. You can use CSV files of this WordPress free form builder for data analysis and presentation by creating charts and diagrams.
79
 
@@ -290,6 +290,10 @@ MailChimp form add-on of Form Maker lets you build up a customer database on you
290
 
291
  == Changelog ==
292
 
 
 
 
 
293
  = 1.12.4 =
294
  * Changed: Email validation field now allows + symbol
295
  * Changed: Remove Font Awesome.
3
  Donate link: https://web-dorado.com/products/wordpress-form.html
4
  Tags: form, form builder, contact form, custom form, feedback, contact, contact forms, captcha, email, form manager, forms, survey
5
  Requires at least: 3.4
6
+ Tested up to: 4.9
7
+ Stable tag: 1.12.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
26
 
27
  = Form Maker Add-ons: =
28
 
29
+ [Import/Export Add-on](https://web-dorado.com/products/wordpress-form/add-ons/export-import.html)
30
+ [Save Progress Add-on](https://web-dorado.com/products/wordpress-form/add-ons/save-progress.html)
31
+ [Stripe Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/stripe.html)
32
+ [Google PDF Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/pdf.html)
33
+ [Mailchimp Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/mailchimp.html)
34
+ [WordPress Registration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/registration.html)
35
+ [Post Generation Add-on](https://web-dorado.com/products/wordpress-form/add-ons/post-generation.html)
36
+ [Conditional Emails Add-on](https://web-dorado.com/products/wordpress-form/add-ons/conditional-emails.html)
37
+ [Dropbox Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/dropbox.html)
38
+ [Google Drive Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/google-drive.html)
39
+ [Pushover Integration Add-on](https://web-dorado.com/products/wordpress-form/add-ons/pushover.html)
40
+ [Calculator Add-on](https://web-dorado.com/products/wordpress-form/add-ons/calculator.html)
41
 
42
 
43
  This free form builder plugin with its multi-functional features is one of the most intuitive and modern form creator plugins for WordPress. It takes just a few clicks to construct complex HTML forms, and configure their structure with easy-to-use drag and drop interface.
48
  This form creator is developed to build unlimited number of simple forms, surveys and questionnaires, registrations, online applications, and more. Make your responsive web forms using the following field types:
49
 
50
  * Text Input (Name, Email, Phone fields and more)
51
+ * Submit and Reset Buttons
52
  * Time and Date
53
+ * Custom HTML
54
+ * Multiple and Single Choice
55
  * Select Box
56
  * Survey Tools (Star Rating, Matrix, Spinner and more)
57
  * Section Break and Page Break
58
  * Simple and Arithmetic Captcha
59
  * Google ReCaptcha
 
60
  * Custom Buttons
 
61
 
62
  This WordPress form creator plugin provides a number of classy themes and display options to apply to your contact forms. Besides the drag and drop easy forms builder, Form Maker themes come with various user-friendly settings, as well as custom CSS editor, to let you fully personalize the display of your form.
63
 
73
 
74
  Form Maker package includes a list of pre-installed template forms, which you can quickly edit and publish on your WordPress website. Furthermore, the plugin lets you save copies these forms and customize them to fit your needs.
75
 
76
+ Spambot protection for online contact forms is high priority. Therefore, Form Maker plugin provides these 3 types of validation to avoid spam on your contact me forms: Google ReCaptcha, Simple Captcha and Arithmetic Captcha. Also, with IP Blocking feature of the plugin, your HTML forms can be secured from certain IP addresses.
77
 
78
  Save your contact form submissions on MySQL database of your website, or send them to multiple recipient email addresses with Email Options of your custom forms. Additionally, Submissions page of the forms creator plugin lets you export submitted information with CSV or XML files. You can use CSV files of this WordPress free form builder for data analysis and presentation by creating charts and diagrams.
79
 
290
 
291
  == Changelog ==
292
 
293
+ = 1.12.5 =
294
+ Added: Hong Kong to country list.
295
+ Fixed: List of US states.
296
+
297
  = 1.12.4 =
298
  * Changed: Email validation field now allows + symbol
299
  * Changed: Remove Font Awesome.