function fm_admin_ready(){jQuery(".wd-header a").on("click",function(){jQuery("input[name='task']").val("add"),jQuery(this).parents("form").submit()}),set_no_items(),jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))}),jQuery(".hndle:not(.readonly), .handlediv").each(function(){jQuery(this).off("click").on("click",function(){fm_toggle_postbox(this)})}),jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function(){jQuery(this).attr("title",form_maker.add_placeholder)}),jQuery(document).on("click",".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view",function(){fm_placeholders_popup(jQuery(this).data("id"))}),fm_disabled_uninstall_btn(),jQuery(".fm-uninstall-form #check_yes").on("click",function(){fm_disabled_uninstall_btn()}),void 0!==jQuery(document).tooltip&&jQuery(document).tooltip({show:null,items:".wd-info",content:function(){if(jQuery(this).is(".wd-info"))return jQuery("#"+jQuery(this).data("id")).html()},open:function(e,t){if(void 0===e.originalEvent)return!1;var i=jQuery(t.tooltip).attr("id");jQuery("div.ui-tooltip").not("#"+i).remove()},close:function(e,t){t.tooltip.hover(function(){jQuery(this).stop(!0).fadeTo(400,1)},function(){jQuery(this).fadeOut("400",function(){jQuery(this).remove()})})},position:{my:"center top+30",at:"center top",using:function(e,t){jQuery(this).css(e),jQuery("
'+""+form_maker_manage.add_new_field+'
');t.prepend(i),i.after('
')}function sortable_columns(){jQuery("#take").sortable({cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".form_id_tempform_view_img .fm-ico-draggable",items:"> .wdform-page-and-images",axis:"y",update:function(e,t){refresh_page_numbers()}}),jQuery(".wdform_page").sortable({connectWith:".wdform_page",cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".wdform_row_handle",cancel:".add-new-field, .page_toolbar",items:"> .wdform_section",create:function(e,t){jQuery(e.target).find(".wdform_section").each(function(){fm_row_handle(this)})},start:function(e,t){jQuery(".wdform_row_empty").hide()},stop:function(e,t){fm_rows_refresh(),jQuery(".wdform_row_empty").show()}}),jQuery(".wdform_column").sortable({connectWith:".wdform_column",cursor:"move",placeholder:"highlight",tolerance:"pointer",cancel:".wdform_section_handle",items:"> .wdform_row, #add_field",start:function(e,t){jQuery(".add-new-button").off("click"),jQuery(".wdform_column").removeClass("fm-hidden"),jQuery("#cur_column").removeAttr("id")},stop:function(e,t){return"add_field_cont"!=t.item.parent().attr("id")&&("add_field"==t.item.attr("id")&&"add_field_cont"!=t.item.parent().attr("id")?(fm_check_something_really_important()||(nextID=jQuery("#add_field").next(".wdform_row").attr("wdid"),jQuery("#add_field").parent().attr("id","cur_column"),popup_ready(),Enable(),jQuery(".add-new-button").removeAttr("onclick")),!1):(jQuery(".wdform_column:not(#add_field_cont):empty").addClass("fm-hidden"),void fm_columns_refresh()))}})}function all_sortable_events(){fm_rows_refresh(),fm_columns_refresh(),jQuery(".wdform_row, .wdform_tr_section_break").off("hover, touchstart").on("hover, touchstart",function(e){if(!jQuery(this).find(".wdform_arrows").is(":visible"))return jQuery(".wdform_arrows").hide(),jQuery(this).find(".wdform_arrows").show(),e.preventDefault(),!1}).off("mouseleave").on("mouseleave",function(){jQuery(this).find(".wdform_arrows").hide()}),jQuery(".wdform_section_handle, .wdform_row_handle").off("hover, touchstart").on("hover, touchstart",function(e){jQuery(this).parent().addClass("fm-hover")}).off("mouseleave").on("mouseleave",function(){jQuery(this).parent().removeClass("fm-hover")})}function fm_change_radio(e){jQuery(e).hasClass("fm-yes")?(jQuery(e).val("0"),jQuery(e).next().val("0"),jQuery(e).removeClass("fm-yes").addClass("fm-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).val("1"),jQuery(e).next().val("1"),jQuery(e).find("span").animate({right:0},400,function(){jQuery(e).removeClass("fm-no").addClass("fm-yes")})),"mail_verify"==jQuery(e).next().attr("name")&&show_verify_options(1==jQuery(e).val())}function enable_drag(){jQuery(".wdform_column").sortable("enable"),jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_field").css("cursor",""),jQuery("#add_field .wdform_field").css("cursor",""),all_sortable_events()}function refresh_(){document.getElementById("counter").value=gen,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.find("[id^=page_next_]").removeAttr("src"),e.find("[id^=page_previous_]").removeAttr("src"),e.find(".form_id_tempform_view_img").remove()}),jQuery("#take div").removeClass("ui-sortable ui-sortable-disabled ui-sortable-handle"),jQuery("#add_field_cont").remove(),document.getElementById("form_front").value=document.getElementById("take").innerHTML}function fm_add_submission_email(e,t,i,a){var n=jQuery("#"+t).val();if(n){var l=jQuery("").attr("class","fm_mail_input").prependTo("#"+i);jQuery("").attr("class","mail_name").text(n).appendTo(l),jQuery("").attr("class","dashicons dashicons-trash").attr("onclick","fm_delete_mail(this, '"+n+"')").attr("title","Delete Email").appendTo(l),jQuery("#"+t).val(""),jQuery("#"+e).val(jQuery("#"+e).val()+n+",")}}function fm_delete_mail(e,t){jQuery(e).parent().remove(),jQuery("#mail").val(jQuery("#mail").val().replace(t+",",""))}function form_maker_options_tabs(e){return jQuery("#fieldset_id").val(e),jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive"),jQuery("#"+e+"_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+e).addClass("active"),!1}function set_type(e){switch(e){case"post":document.getElementById("post").removeAttribute("style"),document.getElementById("page").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none");break;case"page":document.getElementById("page").removeAttribute("style"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none");break;case"custom_text":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").removeAttribute("style"),document.getElementById("url").setAttribute("style","display:none");break;case"url":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").removeAttribute("style");break;case"none":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none")}}function check_isnum(e){var t=e.which||e.keyCode;return!(31'+t+'x ';-1===n.html().indexOf('data-post_id="'+i+'"')&&(n.append(d),""===l.val()?l.val(i):l.val(function(e,t){return t+","+i}))}return!1}),jQuery("body").on("click",".pp_selected span.pp_selected_remove",function(){var e=jQuery(this).parent(),t=e.closest(".fm-pp").find(".pp_exclude"),i=t.val(),a=e.data("post_id");if(-1!==i.indexOf(a)){var n,l=-1!==i.indexOf(","+a)?","+a:a+",";l=-1!==i.indexOf(",")?l:a;n=i.replace(l,""),t.val(n)}return e.remove(),!1}),jQuery("body").on("click",'.pp_display_on_categories input[name="display_on_categories[]"]',function(){var e=jQuery('.pp_display_on_categories input[name="display_on_categories[]"]'),t=jQuery(".fm-display-all-categories");if("select_all_categories"==jQuery(this).val())jQuery(this).is(":checked")?e.prop("checked",!0):e.prop("checked",!1);else{var i=jQuery('input[name="display_on_categories[]"]:checked').length,a=parseInt(t.attr("data-categories-count"));jQuery(this).prop("checked")||(i-=1),t.prop("checked",!1),i==a&&t.prop("checked",!0)}})}),function(_){_.fn.serializeObject=function(){var n=this,l={},t={},d={validate:/^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/};return this.build=function(e,t,i){return e[t]=i,e},this.push_counter=function(e){return void 0===t[e]&&(t[e]=0),t[e]++},_.each(_(this).serializeArray(),function(){if(d.validate.test(this.name)){for(var e,t=this.name.match(d.key),i=this.value,a=this.name;void 0!==(e=t.pop());)a=a.replace(new RegExp("\\["+e+"\\]$"),""),e.match(d.push)?i=n.build([],n.push_counter(a),i):e.match(d.fixed)?i=n.build([],e,i):e.match(d.named)&&(i=n.build({},e,i));l=_.extend(!0,l,i)}}),l}}(jQuery),jQuery(document).on("dblclick",".wdform_row, .wdform_tr_section_break",function(){edit(jQuery(this).attr("wdid"))}),function(t){function i(e,t){if(!(1'+document.getElementById(t+"_elementform_id_temp").getAttribute("info"+i)+"");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),document.getElementById("longval"+i)&&(document.getElementById("longval"+i).value=e,document.getElementById("latval"+i).value=a,geocoder.geocode({latLng:gmapmarker[t][i].getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval"+i)&&(document.getElementById("addrval"+i).value=e[0].formatted_address)}),map.setAttribute("long"+i,e),map.setAttribute("lat"+i,a)),!1}function changeAddress(i,a){var e=document.getElementById("addrval"+a).value;geocoder.geocode({address:e},function(e,t){t==google.maps.GeocoderStatus.OK&&(gmapdata[i].setCenter(e[0].geometry.location),gmapmarker[i][a].setPosition(e[0].geometry.location),document.getElementById("latval"+a).value=gmapmarker[i][a].getPosition().lat().toFixed(6),document.getElementById("longval"+a).value=gmapmarker[i][a].getPosition().lng().toFixed(6),map.setAttribute("long"+a,gmapmarker[i][a].getPosition().lng().toFixed(6)),map.setAttribute("lat"+a,gmapmarker[i][a].getPosition().lat().toFixed(6)))})}function change_info(e,t,i){map=document.getElementById(t+"_elementform_id_temp"),map.setAttribute("info"+i,e)}function if_gmap_updateMap(e){map=document.getElementById(e+"_elementform_id_temp"),w_long=gmapdata[e].getCenter().lng(),w_lat=gmapdata[e].getCenter().lat(),map.setAttribute("center_x",w_long),map.setAttribute("center_y",w_lat)}!function(t){"function"==typeof define&&define.amd?define(["jquery"],function(e){t(e,window,document)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window,document):t(jQuery,window,document)}(function(r,_,e,l){"use strict";var d="intlTelInput",i=1,a={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customPlaceholder:null,dropdownContainer:"",excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,initialCountry:"",nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},o=38,m=40,s=13,u=27,t=43,c=65,p=90,f=32,n=9,y=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"];function h(e,t){this.telInput=r(e),this.options=r.extend({},a,t),this.ns="."+d+i++,this.isGoodBrowser=Boolean(e.setSelectionRange),this.hadInitialPlaceholder=Boolean(r(e).attr("placeholder"))}r(_).on("load",function(){r.fn[d].windowLoaded=!0}),h.prototype={_init:function(){return this.options.nationalMode&&(this.options.autoHideDialCode=!1),this.options.separateDialCode&&(this.options.autoHideDialCode=this.options.nationalMode=!1),this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(r("body").addClass("iti-mobile"),this.options.dropdownContainer||(this.options.dropdownContainer="body")),this.autoCountryDeferred=new r.Deferred,this.utilsScriptDeferred=new r.Deferred,this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests(),[this.autoCountryDeferred,this.utilsScriptDeferred]},_processCountryData:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries()},_addCountryCode:function(e,t,i){t in this.countryCodes||(this.countryCodes[t]=[]);var a=i||0;this.countryCodes[t][a]=e},_filterCountries:function(e,t){var i;for(i=0;i",{class:e})),this.flagsContainer=r("",{class:"flag-container"}).insertBefore(this.telInput);var t=r("
",{class:"selected-flag"});t.appendTo(this.flagsContainer),this.selectedFlagInner=r("
",{class:"iti-flag"}).appendTo(t),this.options.separateDialCode&&(this.selectedDialCode=r("
",{class:"selected-dial-code"}).appendTo(t)),this.options.allowDropdown?(t.attr("tabindex","0"),r("
",{class:"iti-arrow"}).appendTo(t),this.countryList=r("
",{class:"country-list hide"}),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"preferred"),r("",{class:"divider"}).appendTo(this.countryList)),this._appendListItems(this.countries,""),this.countryListItems=this.countryList.children(".country"),this.options.dropdownContainer?this.dropdown=r("",{class:"intl-tel-input iti-container"}).append(this.countryList):this.countryList.appendTo(this.flagsContainer)):this.countryListItems=r()},_appendListItems:function(e,t){for(var i="",a=0;a
",i+="",i+=""+n.name+" ",i+="+"+n.dialCode+" ",i+=""}this.countryList.append(i)},_setInitialState:function(){var e=this.telInput.val();this._getDialCode(e)&&!this._isRegionlessNanp(e)?this._updateFlagFromNumber(e):"auto"!==this.options.initialCountry&&(this.options.initialCountry?this._setFlag(this.options.initialCountry.toLowerCase()):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),e||this.options.nationalMode||this.options.autoHideDialCode||this.options.separateDialCode||this.telInput.val("+"+this.selectedCountryData.dialCode)),e&&this._updateValFromNumber(e)},_initListeners:function(){this._initKeyListeners(),this.options.autoHideDialCode&&this._initFocusListeners(),this.options.allowDropdown&&this._initDropdownListeners()},_initDropdownListeners:function(){var t=this,e=this.telInput.closest("label");e.length&&e.on("click"+this.ns,function(e){t.countryList.hasClass("hide")?t.telInput.focus():e.preventDefault()}),this.selectedFlagInner.parent().on("click"+this.ns,function(e){!t.countryList.hasClass("hide")||t.telInput.prop("disabled")||t.telInput.prop("readonly")||t._showDropdown()}),this.flagsContainer.on("keydown"+t.ns,function(e){!t.countryList.hasClass("hide")||e.which!=o&&e.which!=m&&e.which!=f&&e.which!=s||(e.preventDefault(),e.stopPropagation(),t._showDropdown()),e.which==n&&t._closeDropdown()})},_initRequests:function(){var e=this;this.options.utilsScript?r.fn[d].windowLoaded?r.fn[d].loadUtils(this.options.utilsScript,this.utilsScriptDeferred):r(_).on("load",function(){r.fn[d].loadUtils(e.options.utilsScript,e.utilsScriptDeferred)}):this.utilsScriptDeferred.resolve(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.autoCountryDeferred.resolve()},_loadAutoCountry:function(){r.fn[d].autoCountry?this.handleAutoCountry():r.fn[d].startedLoadingAutoCountry||(r.fn[d].startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup(function(e){r.fn[d].autoCountry=e.toLowerCase(),setTimeout(function(){r(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_initKeyListeners:function(){var e=this;this.telInput.on("keyup"+this.ns,function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()}),this.telInput.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()})})},_cap:function(e){var t=this.telInput.attr("maxlength");return t&&e.length>t?e.substr(0,t):e},_initFocusListeners:function(){var i=this;this.telInput.on("mousedown"+this.ns,function(e){i.telInput.is(":focus")||i.telInput.val()||(e.preventDefault(),i.telInput.focus())}),this.telInput.on("focus"+this.ns,function(e){i.telInput.val()||i.telInput.prop("readonly")||!i.selectedCountryData.dialCode||(i.telInput.val("+"+i.selectedCountryData.dialCode),i.telInput.one("keypress.plus"+i.ns,function(e){e.which==t&&i.telInput.val("")}),setTimeout(function(){var e=i.telInput[0];if(i.isGoodBrowser){var t=i.telInput.val().length;e.setSelectionRange(t,t)}}))});var e=this.telInput.prop("form");e&&r(e).on("submit"+this.ns,function(){i._removeEmptyDialCode()}),this.telInput.on("blur"+this.ns,function(){i._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var e=this.telInput.val();if("+"==e.charAt(0)){var t=this._getNumeric(e);t&&this.selectedCountryData.dialCode!=t||this.telInput.val("")}this.telInput.off("keypress.plus"+this.ns)},_getNumeric:function(e){return e.replace(/\D/g,"")},_showDropdown:function(){this._setDropdownPosition();var e=this.countryList.children(".active");e.length&&(this._highlightListItem(e),this._scrollTo(e)),this._bindDropdownListeners(),this.selectedFlagInner.children(".iti-arrow").addClass("up")},_setDropdownPosition:function(){var e=this;if(this.options.dropdownContainer&&this.dropdown.appendTo(this.options.dropdownContainer),this.dropdownHeight=this.countryList.removeClass("hide").outerHeight(),!this.isMobile){var t=this.telInput.offset(),i=t.top,a=r(_).scrollTop(),n=i+this.telInput.outerHeight()+this.dropdownHeighta;if(this.countryList.toggleClass("dropup",!n&&l),this.options.dropdownContainer){var d=!n&&l?0:this.telInput.innerHeight();this.dropdown.css({top:i+d,left:t.left}),r(_).on("scroll"+this.ns,function(){e._closeDropdown()})}}},_bindDropdownListeners:function(){var t=this;this.countryList.on("mouseover"+this.ns,".country",function(e){t._highlightListItem(r(this))}),this.countryList.on("click"+this.ns,".country",function(e){t._selectListItem(r(this))});var i=!0;r("html").on("click"+this.ns,function(e){i||t._closeDropdown(),i=!1});var a="",n=null;r(e).on("keydown"+this.ns,function(e){e.preventDefault(),e.which==o||e.which==m?t._handleUpDownKey(e.which):e.which==s?t._handleEnterKey():e.which==u?t._closeDropdown():(e.which>=c&&e.which<=p||e.which==f)&&(n&&clearTimeout(n),a+=String.fromCharCode(e.which),t._searchForCountry(a),n=setTimeout(function(){a=""},1e3))})},_handleUpDownKey:function(e){var t=this.countryList.children(".highlight").first(),i=e==o?t.prev():t.next();i.length&&(i.hasClass("divider")&&(i=e==o?i.prev():i.next()),this._highlightListItem(i),this._scrollTo(i))},_handleEnterKey:function(){var e=this.countryList.children(".highlight").first();e.length&&this._selectListItem(e)},_searchForCountry:function(e){for(var t=0;ta)))}function check_isnum_point(e){var t=e.which||e.keyCode;return 46==t||!(31]+)>)/gi,"")).replace(/"/g,"""),document.getElementById(e).setAttribute("value",t)}function change_size(e,t){switch(document.getElementById(t+"_elementform_id_temp").style.width=e+"px",document.getElementById(t+"_element_input")&&(document.getElementById(t+"_element_input").style.width=e+"px"),e){case"111":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","2");break;case"222":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","4");break;case"444":document.getElementById(t+"_elementform_id_temp").setAttribute("rows","8")}}function getIFrameDocument(e){var t=null;return document.getElementById(e)&&document.getElementById(e).contentDocument?t=document.getElementById(e).contentDocument:document.getElementById(e)&&(t=document.frames[e].document),t}function format_extended(t,e,i,a,n){w_size=document.getElementById(t+"_element_firstform_id_temp").style.width,tr_name1=document.getElementById(t+"_tr_name1"),tr_name2=document.getElementById(t+"_tr_name2");var l=document.createElement("div");l.setAttribute("id",t+"_td_name_input_title"),l.style.display="table-cell";var d=document.createElement("div");d.setAttribute("id",t+"_td_name_input_middle"),d.style.display="table-cell";var _=document.createElement("div");_.setAttribute("id",t+"_td_name_label_title"),_.setAttribute("align","left"),_.style.display="table-cell";var r=document.createElement("div");r.setAttribute("id",t+"_td_name_label_middle"),r.setAttribute("align","left"),r.style.display="table-cell";var o=document.createElement("input");o.setAttribute("type","text"),o.style.cssText="margin: 0px 10px 0px 0px; padding: 0px; width:40px",o.setAttribute("id",t+"_element_titleform_id_temp"),o.setAttribute("name",t+"_element_titleform_id_temp"),e==a?o.setAttribute("value",a):o.setAttribute("value",e),o.setAttribute("title",a);var m=document.createElement("label");m.setAttribute("class","mini_label"),m.setAttribute("id",t+"_mini_label_title"),m.innerHTML=w_mini_labels[0];var s=document.createElement("input");s.setAttribute("type","text"),s.style.cssText="padding: 0px; width:"+w_size,s.setAttribute("id",t+"_element_middleform_id_temp"),s.setAttribute("name",t+"_element_middleform_id_temp"),i==n?s.setAttribute("value",n):s.setAttribute("value",i),s.setAttribute("title",n);var u=document.createElement("label");u.setAttribute("class","mini_label"),u.setAttribute("id",t+"_mini_label_middle"),u.innerHTML=w_mini_labels[3],first_input=document.getElementById(t+"_td_name_input_first"),last_input=document.getElementById(t+"_td_name_input_last"),first_label=document.getElementById(t+"_td_name_label_first"),last_label=document.getElementById(t+"_td_name_label_last"),l.appendChild(o),d.appendChild(s),tr_name1.insertBefore(l,first_input),tr_name1.insertBefore(d,null),_.appendChild(m),r.appendChild(u),tr_name2.insertBefore(_,first_label),tr_name2.insertBefore(r,null);var c=document.createTextNode("-"),p=document.createTextNode("-"),f=document.createElement("input");f.setAttribute("id","el_first_value_title"),f.setAttribute("type","text"),f.setAttribute("value",a),f.style.cssText="width:50px; margin-left:4px; margin-right:4px",f.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_titleform_id_temp')");var y=document.createElement("input");y.setAttribute("id","el_first_value_middle"),y.setAttribute("type","text"),y.setAttribute("value",n),y.style.cssText="width:100px; margin-left:4px",y.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_middleform_id_temp')"),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,parent.insertBefore(c,el_first_value_first),parent.insertBefore(f,c),parent.appendChild(p),parent.appendChild(y),refresh_attr(t,"type_name"),refresh_id_name(t,"type_name"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_title").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.title").focus(),jQuery("input.title").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_title").text(e)})}}),jQuery("label#"+t+"_mini_label_middle").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_middle").text(e)})}})})}function format_normal(e){tr_name1=document.getElementById(e+"_tr_name1"),tr_name2=document.getElementById(e+"_tr_name2"),td_name_input1=document.getElementById(e+"_td_name_input_title"),td_name_input4=document.getElementById(e+"_td_name_input_middle"),td_name_label1=document.getElementById(e+"_td_name_label_title"),td_name_label4=document.getElementById(e+"_td_name_label_middle"),tr_name1.removeChild(td_name_input1),tr_name1.removeChild(td_name_input4),tr_name2.removeChild(td_name_label1),tr_name2.removeChild(td_name_label4),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,parent.removeChild(document.getElementById("el_first_value_title").nextSibling),parent.removeChild(document.getElementById("el_first_value_title")),parent.removeChild(document.getElementById("el_first_value_middle").previousSibling),parent.removeChild(document.getElementById("el_first_value_middle")),refresh_attr(e,"type_name"),refresh_id_name(e,"type_name")}function type_number(e,t,i,a,l,d,_,r,o,m,s,u){document.getElementById("element_type").value="type_number",delete_last_child();var c=document.createElement("div");c.setAttribute("id","edit_div");var p=document.createElement("table");p.setAttribute("id","edit_main_table"),p.setAttribute("cellpadding","3"),p.setAttribute("cellspacing","0");var f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td"),q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=(document.createElement("td"),document.createElement("td")),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("label");K.setAttribute("class","fm-field-label"),K.setAttribute("for","edit_for_label"),K.innerHTML="Field label";var U=document.createElement("textarea");U.setAttribute("id","edit_for_label"),U.setAttribute("rows","4"),U.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),U.innerHTML=t;var F=document.createElement("label");F.setAttribute("class","fm-field-label"),F.setAttribute("for","edit_for_label_size"),F.innerHTML="Field label size(px) ";var R=document.createElement("input");R.setAttribute("id","edit_for_label_size"),R.setAttribute("type","text"),R.setAttribute("value",i),R.setAttribute("onKeyPress","return check_isnum(event)"),R.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var W=document.createElement("label");W.setAttribute("class","fm-field-label"),W.innerHTML="Field label position";var V=document.createElement("input");V.setAttribute("id","edit_for_label_position_top"),V.setAttribute("type","radio"),V.setAttribute("name","edit_for_label_position"),V.setAttribute("onchange","label_left("+e+")");var $=document.createElement("label");$.setAttribute("for","edit_for_label_position_top"),$.innerHTML="Left";var G=document.createElement("input");G.setAttribute("id","edit_for_label_position_left"),G.setAttribute("type","radio"),G.setAttribute("name","edit_for_label_position"),G.setAttribute("onchange","label_top("+e+")");var Y=document.createElement("label");Y.setAttribute("for","edit_for_label_position_left"),Y.innerHTML="Top","top"==a?G.setAttribute("checked","checked"):V.setAttribute("checked","checked");var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","edit_for_input_size"),Z.innerHTML="Field size(px) ";var X=document.createElement("input");X.setAttribute("id","edit_for_input_size"),X.setAttribute("type","text"),X.setAttribute("value",l),X.setAttribute("onKeyPress","return check_isnum(event)"),X.setAttribute("onKeyUp","change_w_style('"+e+"_elementform_id_temp', this.value)");var J=document.createElement("label");J.setAttribute("class","fm-field-label"),J.setAttribute("for","el_first_value_input"),J.innerHTML="Placeholder ";var ee=document.createElement("input");ee.setAttribute("id","el_first_value_input"),ee.setAttribute("type","text"),ee.setAttribute("value",_),ee.setAttribute("onKeyUp","change_input_value(this.value,'"+e+"_elementform_id_temp');");var te=document.createElement("label");te.setAttribute("class","fm-field-label"),te.setAttribute("for","el_required"),te.innerHTML="Required";var ie=document.createElement("input");ie.setAttribute("id","el_required"),ie.setAttribute("type","checkbox"),ie.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==r&&ie.setAttribute("checked","checked");var ae=document.createElement("label");ae.setAttribute("class","fm-field-label"),ae.setAttribute("for","el_unique"),ae.innerHTML="Allow only unique values";var ne=document.createElement("input");ne.setAttribute("id","el_unique"),ne.setAttribute("type","checkbox"),ne.setAttribute("onclick","set_unique('"+e+"_uniqueform_id_temp')"),"yes"==o&&ne.setAttribute("checked","checked");var le=document.createElement("label");le.setAttribute("class","fm-field-label"),le.setAttribute("for","el_style_textarea"),le.innerHTML="Class name";var de=document.createElement("input");de.setAttribute("id","el_style_textarea"),de.setAttribute("type","text"),de.setAttribute("value",m),de.setAttribute("onChange","change_class(this.value,'"+e+"')");var _e=document.createElement("label");_e.setAttribute("class","fm-field-label"),_e.innerHTML="Additional Attributes";var re=document.createElement("img");re.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),re.style.cssText="cursor:pointer; margin-left:68px",re.setAttribute("title","add"),re.setAttribute("onClick","add_attr("+e+", 'type_text')");var oe=document.createElement("table");oe.setAttribute("id","attributes"),oe.setAttribute("border","0"),oe.style.cssText="margin-left:0px";var me=document.createElement("tr");me.setAttribute("idi","0");var se=document.createElement("th");se.style.cssText="width:100px";var ue=document.createElement("th");ue.style.cssText="width:100px";var ce=document.createElement("th");ce.style.cssText="width:10px";var pe=document.createElement("label");pe.style.cssText="color:#000; font-weight:bold; font-size: 11px",pe.innerHTML="Name";var fe=document.createElement("label");for(fe.style.cssText="color:#000; font-weight:bold; font-size: 11px",fe.innerHTML="Value",oe.appendChild(me),me.appendChild(se),me.appendChild(ue),me.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),n=s.length,j=1;j<=n;j++){var ye=document.createElement("tr");ye.setAttribute("id","attr_row_"+j),ye.setAttribute("idi",j);var he=document.createElement("td");he.style.cssText="width:100px";var be=document.createElement("td");be.style.cssText="width:100px";var ve=document.createElement("td"),we=document.createElement("input");we.setAttribute("type","text"),we.setAttribute("class","fm-field-choice"),we.setAttribute("value",s[j-1]),we.setAttribute("id","attr_name"+j),we.setAttribute("onChange","change_attribute_name("+e+", this, 'type_text')");var ge=document.createElement("input");ge.setAttribute("type","text"),ge.setAttribute("class","fm-field-choice"),ge.setAttribute("value",u[j-1]),ge.setAttribute("id","attr_value"+j),ge.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_text')");var Ee=document.createElement("img");Ee.setAttribute("id","el_choices"+j+"_remove"),Ee.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Ee.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Ee.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_text')"),oe.appendChild(ye),ye.appendChild(he),ye.appendChild(be),ye.appendChild(ve),he.appendChild(we),be.appendChild(ge),ve.appendChild(Ee)}var Ae=document.getElementById("edit_table"),je=document.createElement("br"),xe=document.createElement("br");x.appendChild(K),k.appendChild(U),P.appendChild(F),O.appendChild(R),I.appendChild(W),C.appendChild(V),C.appendChild($),C.appendChild(je),C.appendChild(G),C.appendChild(Y),B.appendChild(Z),Q.appendChild(X),T.appendChild(J),M.appendChild(ee),L.appendChild(le),z.appendChild(de),q.appendChild(te),H.appendChild(ie),S.appendChild(ae),D.appendChild(ne),N.appendChild(_e),N.appendChild(re),N.appendChild(xe),N.appendChild(oe),N.setAttribute("colspan","2"),f.appendChild(x),f.appendChild(k),A.appendChild(P),A.appendChild(O),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),E.appendChild(S),E.appendChild(D),g.appendChild(N),p.appendChild(f),p.appendChild(A),p.appendChild(y),p.appendChild(h),p.appendChild(b),p.appendChild(v),p.appendChild(w),p.appendChild(E),p.appendChild(g),c.appendChild(p),Ae.appendChild(c),add_id_and_name(e,"type_text"),element="input",type="text";var ke=document.createElement("input");ke.setAttribute("type","hidden"),ke.setAttribute("value","type_number"),ke.setAttribute("name",e+"_typeform_id_temp"),ke.setAttribute("id",e+"_typeform_id_temp");var Ie=document.createElement("input");Ie.setAttribute("type","hidden"),Ie.setAttribute("value",r),Ie.setAttribute("name",e+"_requiredform_id_temp"),Ie.setAttribute("id",e+"_requiredform_id_temp");var Ce=document.createElement("input");Ce.setAttribute("type","hidden"),Ce.setAttribute("value",o),Ce.setAttribute("name",e+"_uniqueform_id_temp"),Ce.setAttribute("id",e+"_uniqueform_id_temp");var Be=document.createElement(element);Be.setAttribute("type",type),Be.style.cssText="width:"+l+"px;",Be.setAttribute("id",e+"_elementform_id_temp"),Be.setAttribute("name",e+"_elementform_id_temp"),Be.setAttribute("value",d),Be.setAttribute("title",_),Be.setAttribute("placeholder",_),Be.setAttribute("onKeyPress","return check_isnum(event)");var Qe=document.createElement("div");Qe.setAttribute("id","main_div");var Te=document.createElement("div");Te.setAttribute("id",e+"_elemet_tableform_id_temp");var Me=document.createElement("div");Me.setAttribute("align","left"),Me.style.display="table-cell",Me.style.width=i+"px",Me.setAttribute("id",e+"_label_sectionform_id_temp");var Le=document.createElement("div");Le.setAttribute("align","left"),Le.style.display="table-cell",Le.setAttribute("id",e+"_element_sectionform_id_temp");var ze=document.createElement("span");ze.setAttribute("id",e+"_element_labelform_id_temp"),ze.innerHTML=t,ze.setAttribute("class","label"),ze.style.verticalAlign="top";var qe=document.createElement("span");qe.setAttribute("id",e+"_required_elementform_id_temp"),qe.innerHTML="",qe.setAttribute("class","required"),qe.style.verticalAlign="top","yes"==r&&(qe.innerHTML=" *");var He=document.getElementById("show_table");Me.appendChild(ze),Me.appendChild(qe),Le.appendChild(ke),Le.appendChild(Ie),Le.appendChild(Ce),Le.appendChild(Be),Te.appendChild(Me),Te.appendChild(Le),Qe.appendChild(Te),He.appendChild(Qe),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function type_wdeditor(e,t,i,a,l,d,_,r,o,m,s){document.getElementById("element_type").value="type_wdeditor",delete_last_child();var u=document.createElement("div");u.setAttribute("id","edit_div");var c=document.createElement("table");c.setAttribute("id","edit_main_table"),c.setAttribute("cellpadding","3"),c.setAttribute("cellspacing","0");var p=document.createElement("tr"),f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("td"),A=document.createElement("td"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td");C.style.cssText="padding-top:10px";var B=document.createElement("td"),Q=document.createElement("td");Q.style.cssText="padding-top:10px";var T=document.createElement("td"),M=document.createElement("td");M.style.cssText="padding-top:10px";var L=document.createElement("td"),z=document.createElement("td");z.style.cssText="padding-top:10px";var q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("label");D.setAttribute("class","fm-field-label"),D.setAttribute("for","edit_for_label"),D.innerHTML="Field label";var P=document.createElement("textarea");P.setAttribute("id","edit_for_label"),P.setAttribute("rows","4"),P.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),P.innerHTML=t;var O=document.createElement("label");O.setAttribute("class","fm-field-label"),O.setAttribute("for","edit_for_label_size"),O.innerHTML="Field label size(px) ";var K=document.createElement("input");K.setAttribute("id","edit_for_label_size"),K.setAttribute("type","text"),K.setAttribute("value",i),K.setAttribute("onKeyPress","return check_isnum(event)"),K.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var U=document.createElement("label");U.setAttribute("class","fm-field-label"),U.setAttribute("for","edit_for_label_position_top"),U.innerHTML="Field label position";var F=document.createElement("input");F.setAttribute("id","edit_for_label_position_top"),F.setAttribute("type","radio"),F.setAttribute("value","left"),F.setAttribute("name","edit_for_label_position"),F.setAttribute("onchange","label_left("+e+")"),Left=document.createTextNode("Left");var R=document.createElement("input");R.setAttribute("id","edit_for_label_position_left"),R.setAttribute("type","radio"),R.setAttribute("value","top"),R.setAttribute("name","edit_for_label_position"),R.setAttribute("onchange","label_top("+e+")"),Top=document.createTextNode("Top"),"top"==a?R.setAttribute("checked","checked"):F.setAttribute("checked","checked");var W=document.createElement("label");W.style.cssText="color:#000; font-weight:bold; font-size: 13px",W.innerHTML="Field size(px) ";var V=document.createElement("input");V.setAttribute("id","edit_for_input_size"),V.setAttribute("type","text"),V.setAttribute("value",l),V.style.cssText="margin-right:2px; width: 60px",V.setAttribute("name","edit_for_size"),V.setAttribute("onKeyPress","return check_isnum(event)"),V.setAttribute("onKeyUp","change_w_style('"+e+"_elementform_id_temp', this.value)"),X=document.createTextNode("x");var $=document.createElement("input");$.setAttribute("id","edit_for_input_size"),$.setAttribute("type","text"),$.setAttribute("value",d),$.style.cssText="margin-left:2px; width:60px",$.setAttribute("name","edit_for_size"),$.setAttribute("onKeyPress","return check_isnum(event)"),$.setAttribute("onKeyUp","change_h_style('"+e+"_elementform_id_temp', this.value)");var G=document.createElement("label");G.style.cssText="color:#000; font-weight:bold; font-size: 13px",G.innerHTML="Placeholder";var Y=document.createElement("input");Y.setAttribute("id","el_first_value_input"),Y.setAttribute("type","text"),Y.setAttribute("value",_),Y.setAttribute("onKeyUp","change_input_value(this.value,'"+e+"_elementform_id_temp')");var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","el_send"),Z.innerHTML="Required";var J=document.createElement("input");J.setAttribute("id","el_send"),J.setAttribute("type","checkbox"),J.setAttribute("value","yes"),J.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==r&&J.setAttribute("checked","checked");var ee=document.createElement("label");ee.setAttribute("class","fm-field-label"),ee.setAttribute("for","element_style"),ee.innerHTML="Class name";var te=document.createElement("input");te.setAttribute("id","element_style"),te.setAttribute("type","text"),te.setAttribute("value",o),te.setAttribute("onChange","change_class(this.value,'"+e+"')");var ie=document.createElement("label");ie.setAttribute("class","fm-field-label"),ie.setAttribute("for","el_choices_add"),ie.innerHTML="Additional Attributes";var ae=document.createElement("img");ae.setAttribute("id","el_choices_add"),ae.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),ae.style.cssText="cursor:pointer; margin-left:68px",ae.setAttribute("title","add"),ae.setAttribute("onClick","add_attr("+e+", 'type_text')");var ne=document.createElement("table");ne.setAttribute("id","attributes"),ne.setAttribute("border","0"),ne.style.cssText="margin-left:0px";var le=document.createElement("tr");le.setAttribute("idi","0");var de=document.createElement("th");de.style.cssText="width:100px";var _e=document.createElement("th");_e.style.cssText="width:100px";var re=document.createElement("th");re.style.cssText="width:10px";var oe=document.createElement("label");oe.style.cssText="color:#000; font-weight:bold; font-size: 11px",oe.innerHTML="Name";var me=document.createElement("label");for(me.style.cssText="color:#000; font-weight:bold; font-size: 11px",me.innerHTML="Value",ne.appendChild(le),le.appendChild(de),le.appendChild(_e),le.appendChild(re),de.appendChild(oe),_e.appendChild(me),n=m.length,j=1;j<=n;j++){var se=document.createElement("tr");se.setAttribute("id","attr_row_"+j),se.setAttribute("idi",j);var ue=document.createElement("td");ue.style.cssText="width:100px";var ce=document.createElement("td");ce.style.cssText="width:100px";var pe=document.createElement("td"),fe=document.createElement("input");fe.setAttribute("type","text"),fe.setAttribute("class","fm-field-choice"),fe.setAttribute("value",m[j-1]),fe.setAttribute("id","attr_name"+j),fe.setAttribute("onChange","change_attribute_name("+e+", this, 'type_text')");var ye=document.createElement("input");ye.setAttribute("type","text"),ye.setAttribute("class","fm-field-choice"),ye.setAttribute("value",s[j-1]),ye.setAttribute("id","attr_value"+j),ye.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_text')");var he=document.createElement("img");he.setAttribute("id","el_choices"+j+"_remove"),he.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),he.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",he.setAttribute("align","top"),he.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_text')"),ne.appendChild(se),se.appendChild(ue),se.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),ce.appendChild(ye),pe.appendChild(he)}var be=document.getElementById("edit_table"),ve=document.createElement("br"),we=(document.createElement("br"),document.createElement("br"),document.createElement("br")),ge=(document.createElement("br"),document.createElement("br"),document.createElement("br"));E.appendChild(D),A.appendChild(P),N.appendChild(O),S.appendChild(K),x.appendChild(U),k.appendChild(F),k.appendChild(el_label_left),k.appendChild(ve),k.appendChild(R),k.appendChild(el_label_top),I.appendChild(W),C.appendChild(V),C.appendChild(X),C.appendChild($),B.appendChild(G),Q.appendChild(Y),T.appendChild(ee),M.appendChild(te),L.appendChild(Z),z.appendChild(J),q.appendChild(ie),q.appendChild(ae),q.appendChild(ge),q.appendChild(ne),q.setAttribute("colspan","2"),p.appendChild(E),p.appendChild(A),g.appendChild(N),g.appendChild(S),f.appendChild(x),f.appendChild(k),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),c.appendChild(p),c.appendChild(g),c.appendChild(f),c.appendChild(y),c.appendChild(h),c.appendChild(b),c.appendChild(v),c.appendChild(w),u.appendChild(c),be.appendChild(u),add_id_and_name(e,"type_text"),element="editor";var Ee=document.createElement("input");Ee.setAttribute("type","hidden"),Ee.setAttribute("value","type_wdeditor"),Ee.setAttribute("name",e+"_typeform_id_temp"),Ee.setAttribute("id",e+"_typeform_id_temp");var Ae=document.createElement("input");Ae.setAttribute("type","hidden"),Ae.setAttribute("value",r),Ae.setAttribute("name",e+"_requiredform_id_temp"),Ae.setAttribute("id",e+"_requiredform_id_temp");var je=document.createElement("div");je.setAttribute("id","main_div");var xe=document.createElement("div");xe.setAttribute("id",e+"_elemet_tableform_id_temp");var ke=document.createElement("div");ke.setAttribute("align","left"),ke.style.display="table-cell",ke.style.width=i+"px",ke.setAttribute("id",e+"_label_sectionform_id_temp");var Ie=document.createElement("div");Ie.setAttribute("align","left"),Ie.style.display="table-cell",Ie.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br"),we=document.createElement("br"),document.createElement("br");var Ce=document.createElement("span");Ce.setAttribute("id",e+"_element_labelform_id_temp"),Ce.innerHTML=t,Ce.setAttribute("class","label");var Be=document.createElement("span");Be.setAttribute("id",e+"_required_elementform_id_temp"),Be.innerHTML="",Be.setAttribute("class","required"),"yes"==r&&(Be.innerHTML=" *");var Qe=document.createElement("input");Qe.setAttribute("id",e+"_elementform_id_temp"),Qe.setAttribute("name",e+"_elementform_id_temp"),Qe.setAttribute("type","hidden"),Qe.style.width=l+"px",Qe.style.height=d+"px",Qe.setAttribute("title",_);var Te=document.createElement("span");Te.style.color="red",Te.style.fontStyle="italic",Te.innerHTML="Editor doesn't display in back end",Left=document.createTextNode(e+"_editorform_id_temp");var Me=document.createElement("div");Me.style.display="none";var Le=document.getElementById("show_table");ke.appendChild(Ce),ke.appendChild(Be),Ie.appendChild(Ee),Ie.appendChild(Ae),Ie.appendChild(Qe),Ie.appendChild(Te),Me.appendChild(Left),Ie.appendChild(Me),xe.appendChild(ke),xe.appendChild(Ie),je.appendChild(xe),je.appendChild(we),Le.appendChild(je),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_text")}function change_input_range(e,t){var i="";""!=document.getElementById("el_range_"+e+"1").value&&(i=document.getElementById("el_range_"+e+"1").value),""!=document.getElementById("el_range_"+e+"2").value&&(""==document.getElementById("el_range_"+e+"1").value&&(i="0"),i=i+"."+document.getElementById("el_range_"+e+"2").value),document.getElementById(t+"_range_"+e+"form_id_temp").value=i}function explode(e,t){return 2!=arguments.length||void 0===e||void 0===t?null:""!==e&&!1!==e&&null!==e&&("function"==typeof e||"object"==typeof e||"function"==typeof t||"object"==typeof t?{0:""}:(!0===e&&(e="1"),t.toString().split(e.toString())))}function type_paypal_price(t,e,i,a,l,d,_,r,o,m,s,u,c,p,f){document.getElementById("element_type").value="type_paypal_price",delete_last_child();var y=document.createElement("div");y.setAttribute("id","edit_div");var h=document.createElement("table");h.setAttribute("id","edit_main_table"),h.setAttribute("cellpadding","3"),h.setAttribute("cellspacing","0");var b=document.createElement("tr"),v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("tr"),k=document.createElement("tr"),I=document.createElement("tr"),C=document.createElement("tr"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td");z.style.cssText="line-height:20px";var q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("td"),U=document.createElement("td"),F=document.createElement("td"),R=document.createElement("td"),W=document.createElement("td"),V=document.createElement("td"),$=document.createElement("td"),G=document.createElement("label");G.setAttribute("class","fm-field-label"),G.setAttribute("for","edit_for_label"),G.innerHTML="Field label";var Y=document.createElement("textarea");Y.setAttribute("id","edit_for_label"),Y.setAttribute("rows","4"),Y.setAttribute("onKeyUp","change_label('"+t+"_element_labelform_id_temp', this.value)"),Y.innerHTML=e;var Z=document.createElement("label");Z.setAttribute("class","fm-field-label"),Z.setAttribute("for","edit_for_label_size"),Z.innerHTML="Field label size(px) ";var X=document.createElement("input");X.setAttribute("id","edit_for_label_size"),X.setAttribute("type","text"),X.setAttribute("value",i),X.setAttribute("onKeyPress","return check_isnum(event)"),X.setAttribute("onKeyUp","change_w_style('"+t+"_label_sectionform_id_temp', this.value)");var J=document.createElement("label");J.setAttribute("class","fm-field-label"),J.innerHTML="Field label position";var ee=document.createElement("input");ee.setAttribute("id","edit_for_label_position_top"),ee.setAttribute("type","radio"),ee.setAttribute("name","edit_for_label_position"),ee.setAttribute("onchange","label_left("+t+")");var te=document.createElement("label");te.setAttribute("for","edit_for_label_position_top"),te.innerHTML="Left";var ie=document.createElement("input");ie.setAttribute("id","edit_for_label_position_left"),ie.setAttribute("type","radio"),ie.setAttribute("name","edit_for_label_position"),ie.setAttribute("onchange","label_top("+t+")");var ae=document.createElement("label");ae.setAttribute("for","edit_for_label_position_left"),ae.innerHTML="Top","top"==a?ie.setAttribute("checked","checked"):ee.setAttribute("checked","checked"),w_range_minarray=explode(".",p),w_range_maxarray=explode(".",f);var ne=document.createElement("label");ne.setAttribute("class","fm-field-label"),ne.innerHTML="Range ";var le=document.createTextNode("Min"),de=document.createElement("input");de.setAttribute("type","text"),de.setAttribute("id","el_range_min1"),w_range_minarray[0]&&de.setAttribute("value",w_range_minarray[0]),de.style.cssText="width:60px; margin-right:4px;margin-left:8px",de.setAttribute("onKeyPress","return check_isnum(event)"),de.setAttribute("onChange","change_input_range('min', '"+t+"')");var _e=document.createTextNode("."),re=document.createElement("input");re.setAttribute("type","text"),re.setAttribute("id","el_range_min2"),w_range_minarray[1]&&re.setAttribute("value",w_range_minarray[1]),re.style.cssText="width:30px; margin-left:4px",re.setAttribute("onKeyPress","return check_isnum(event)"),re.setAttribute("onChange","change_input_range('min', '"+t+"')");var oe=document.createTextNode("Max"),me=document.createElement("input");me.setAttribute("type","text"),me.setAttribute("id","el_range_max1"),w_range_maxarray[0]&&me.setAttribute("value",w_range_maxarray[0]),me.style.cssText="width:60px; margin-right:4px; margin-left:7px",me.setAttribute("onKeyPress","return check_isnum(event)"),me.setAttribute("onChange","change_input_range('max', '"+t+"')");var se=document.createTextNode("."),ue=document.createElement("input");ue.setAttribute("type","text"),ue.setAttribute("id","el_range_max2"),w_range_maxarray[1]&&ue.setAttribute("value",w_range_maxarray[1]),ue.style.cssText="width:30px; margin-left:4px",ue.setAttribute("onKeyPress","return check_isnum(event)"),ue.setAttribute("onChange","change_input_range('max', '"+t+"')");var ce=document.createTextNode("-"),pe=document.createElement("label");pe.setAttribute("class","fm-field-label"),pe.setAttribute("for","el_first_value_first"),pe.innerHTML="Placeholder ";var fe=document.createElement("input");fe.setAttribute("id","el_first_value_first"),fe.setAttribute("type","text"),fe.setAttribute("value",d[0]),fe.style.cssText="width:120px; margin-right:4px",fe.setAttribute("onKeyPress","return check_isnum(event)"),fe.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_dollarsform_id_temp')");var ye=document.createElement("input");ye.setAttribute("id","el_first_value_last"),ye.setAttribute("type","text"),ye.setAttribute("value",d[1]),ye.style.cssText="width:67px; margin-left:4px; margin-right:4px",ye.setAttribute("onKeyPress","return check_isnum_interval(event,'"+t+"_element_centsform_id_temp',0,99)"),ye.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_centsform_id_temp')");var he=document.createElement("label");he.setAttribute("class","fm-field-label"),he.setAttribute("for","edit_for_input_size"),he.innerHTML="Field size(px) ";var be=document.createElement("input");be.setAttribute("id","edit_for_input_size"),be.setAttribute("type","text"),be.setAttribute("value",r),be.setAttribute("onKeyPress","return check_isnum(event)"),be.setAttribute("onKeyUp","change_w_style('"+t+"_element_dollarsform_id_temp', this.value);");var ve=document.createElement("label");ve.setAttribute("class","fm-field-label"),ve.setAttribute("for","el_required"),ve.innerHTML="Required";var we=document.createElement("input");we.setAttribute("id","el_required"),we.setAttribute("type","checkbox"),we.setAttribute("onclick","set_required('"+t+"_required')"),"yes"==o&&we.setAttribute("checked","checked");var ge=document.createElement("label");ge.setAttribute("class","fm-field-label"),ge.setAttribute("for","el_hide_cents"),ge.innerHTML="Hide Cents";var Ee=document.createElement("input");Ee.setAttribute("id","el_hide_cents"),Ee.setAttribute("type","checkbox"),Ee.setAttribute("onclick","hide_show_cents(this.checked, "+t+")"),"yes"==m&&Ee.setAttribute("checked","checked");var Ae=document.createElement("label");Ae.setAttribute("class","fm-field-label"),Ae.setAttribute("for","el_style_textarea"),Ae.innerHTML="Class name";var je=document.createElement("input");je.setAttribute("id","el_style_textarea"),je.setAttribute("type","text"),je.setAttribute("value",s),je.setAttribute("onChange","change_class(this.value,'"+t+"')");var xe=document.createElement("label");xe.setAttribute("class","fm-field-label"),xe.innerHTML="Additional Attributes";var ke=document.createElement("img");ke.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),ke.style.cssText="cursor:pointer; margin-left:68px",ke.setAttribute("title","add"),ke.setAttribute("onClick","add_attr("+t+", 'type_paypal_price')");var Ie=document.createElement("table");Ie.setAttribute("id","attributes"),Ie.setAttribute("border","0"),Ie.style.cssText="margin-left:0px";var Ce=document.createElement("tr");Ce.setAttribute("idi","0");var Be=document.createElement("th");Be.style.cssText="width:100px";var Qe=document.createElement("th");Qe.style.cssText="width:100px";var Te=document.createElement("th");Te.style.cssText="width:10px";var Me=document.createElement("label");Me.style.cssText="color:#000; font-weight:bold; font-size: 11px",Me.innerHTML="Name";var Le=document.createElement("label");for(Le.style.cssText="color:#000; font-weight:bold; font-size: 11px",Le.innerHTML="Value",Ie.appendChild(Ce),Ce.appendChild(Be),Ce.appendChild(Qe),Ce.appendChild(Te),Be.appendChild(Me),Qe.appendChild(Le),n=u.length,j=1;j<=n;j++){var ze=document.createElement("tr");ze.setAttribute("id","attr_row_"+j),ze.setAttribute("idi",j);var qe=document.createElement("td");qe.style.cssText="width:100px";var He=document.createElement("td");He.style.cssText="width:100px";var Ne=document.createElement("td"),Se=document.createElement("input");Se.setAttribute("type","text"),Se.setAttribute("class","fm-field-choice"),Se.setAttribute("value",u[j-1]),Se.setAttribute("id","attr_name"+j),Se.setAttribute("onChange","change_attribute_name("+t+", this, 'type_paypal_price')");var De=document.createElement("input");De.setAttribute("type","text"),De.setAttribute("class","fm-field-choice"),De.setAttribute("value",c[j-1]),De.setAttribute("id","attr_value"+j),De.setAttribute("onChange","change_attribute_value("+t+", "+j+", 'type_paypal_price')");var Pe=document.createElement("img");Pe.setAttribute("id","el_choices"+j+"_remove"),Pe.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Pe.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Pe.setAttribute("onClick","remove_attr("+j+", "+t+", 'type_paypal_price')"),Ie.appendChild(ze),ze.appendChild(qe),ze.appendChild(He),ze.appendChild(Ne),qe.appendChild(Se),He.appendChild(De),Ne.appendChild(Pe)}var Oe=document.getElementById("edit_table"),Ke=document.createElement("br"),Ue=document.createElement("br"),Fe=(document.createElement("br"),document.createElement("br"));document.createElement("br"),document.createElement("br"),document.createElement("br");B.appendChild(G),Q.appendChild(Y),V.appendChild(Z),$.appendChild(X),T.appendChild(J),M.appendChild(ee),M.appendChild(te),M.appendChild(Ke),M.appendChild(ie),M.appendChild(ae),L.appendChild(ne),z.appendChild(le),z.appendChild(de),z.appendChild(_e),z.appendChild(re),z.appendChild(Ue),z.appendChild(oe),z.appendChild(me),z.appendChild(se),z.appendChild(ue),R.appendChild(pe),W.appendChild(fe),W.appendChild(ce),W.appendChild(ye),O.appendChild(he),K.appendChild(be),q.appendChild(Ae),H.appendChild(je),N.appendChild(ve),S.appendChild(we),U.appendChild(ge),F.appendChild(Ee),D.appendChild(xe),D.appendChild(ke),D.appendChild(Fe),D.appendChild(Ie),D.setAttribute("colspan","2"),b.appendChild(B),b.appendChild(Q),C.appendChild(V),C.appendChild($),v.appendChild(T),v.appendChild(M),w.appendChild(L),w.appendChild(z),x.appendChild(O),x.appendChild(K),g.appendChild(q),g.appendChild(H),E.appendChild(N),E.appendChild(S),A.appendChild(D),A.appendChild(P),k.appendChild(U),k.appendChild(F),I.appendChild(R),I.appendChild(W),h.appendChild(b),h.appendChild(C),h.appendChild(v),h.appendChild(w),h.appendChild(I),h.appendChild(x),h.appendChild(g),h.appendChild(E),h.appendChild(k),h.appendChild(A),y.appendChild(h),Oe.appendChild(y),add_id_and_name(t,"type_name");var Re=document.createElement("input");Re.setAttribute("type","hidden"),Re.setAttribute("value","type_paypal_price"),Re.setAttribute("name",t+"_typeform_id_temp"),Re.setAttribute("id",t+"_typeform_id_temp");var We=document.createElement("input");We.setAttribute("type","hidden"),We.setAttribute("value",o),We.setAttribute("name",t+"_requiredform_id_temp"),We.setAttribute("id",t+"_requiredform_id_temp");var Ve=document.createElement("input");Ve.setAttribute("type","hidden"),Ve.setAttribute("value",p),Ve.setAttribute("name",t+"_range_minform_id_temp"),Ve.setAttribute("id",t+"_range_minform_id_temp");var $e=document.createElement("input");$e.setAttribute("type","hidden"),$e.setAttribute("value",f),$e.setAttribute("name",t+"_range_maxform_id_temp"),$e.setAttribute("id",t+"_range_maxform_id_temp");var Ge=document.createElement("div");Ge.setAttribute("id","main_div");var Ye=document.createElement("div");Ye.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),Ye.appendChild(edit_labels);var Ze=document.createElement("div");Ze.setAttribute("id",t+"_elemet_tableform_id_temp");var Xe=document.createElement("div");Xe.setAttribute("align","left"),Xe.style.display="table-cell",Xe.style.width=i+"px",Xe.setAttribute("id",t+"_label_sectionform_id_temp");var Je=document.createElement("div");Je.setAttribute("align","left"),Je.style.display="table-cell",Je.setAttribute("id",t+"_element_sectionform_id_temp");var et=document.createElement("div");et.setAttribute("id",t+"_table_price"),et.style.display="table";var tt=document.createElement("div");tt.setAttribute("id",t+"_tr_price1"),tt.style.display="table-row";var it=document.createElement("div");it.setAttribute("id",t+"_tr_price2"),it.style.display="table-row";var at=document.createElement("div");at.setAttribute("id",t+"_td_name_currency"),at.style.display="table-cell";var nt=document.createElement("div");nt.setAttribute("id",t+"_td_name_dollars"),nt.style.display="table-cell";var lt=document.createElement("div");lt.setAttribute("id",t+"_td_name_divider"),lt.style.display="table-cell";var dt=document.createElement("div");dt.setAttribute("id",t+"_td_name_cents"),dt.style.display="table-cell";var _t=document.createElement("div");_t.style.display="table-cell";var rt=document.createElement("div");rt.setAttribute("align","left"),rt.style.display="table-cell";var ot=document.createElement("div");ot.setAttribute("id",t+"_td_name_label_divider"),ot.style.display="table-cell";var mt=document.createElement("div");mt.setAttribute("align","left"),mt.setAttribute("id",t+"_td_name_label_cents"),mt.style.display="table-cell";var st=document.createElement("span");st.setAttribute("id",t+"_element_labelform_id_temp"),st.innerHTML=e,st.setAttribute("class","label"),st.style.verticalAlign="top";var ut=document.createElement("span");ut.setAttribute("id",t+"_required_elementform_id_temp"),ut.innerHTML="",ut.setAttribute("class","required"),ut.style.verticalAlign="top","yes"==o&&(ut.innerHTML=" *");var ct=document.createElement("span");ct.setAttribute("class","wdform_colon"),ct.style.cssText="font-style:bold; vertical-align:middle",ct.innerHTML="\x3c!--repstart--\x3e $ \x3c!--repend--\x3e";var pt=document.createElement("label");pt.setAttribute("class","mini_label");var ft=document.createElement("input");ft.setAttribute("type","text"),ft.style.cssText="width:"+r+"px",ft.setAttribute("id",t+"_element_dollarsform_id_temp"),ft.setAttribute("name",t+"_element_dollarsform_id_temp"),ft.setAttribute("value",l[0]),ft.setAttribute("title",d[0]),ft.setAttribute("onKeyPress","return check_isnum(event)");var yt=document.createElement("label");yt.setAttribute("class","mini_label"),yt.setAttribute("id",t+"_mini_label_dollars"),yt.innerHTML=_[0];var ht=document.createElement("span");ht.setAttribute("class","wdform_colon"),ht.style.cssText="font-style:bold; vertical-align:middle",ht.innerHTML=" . ";var bt=document.createElement("label");bt.setAttribute("class","mini_label");var vt=document.createElement("input");vt.setAttribute("type","text"),vt.style.cssText="width:30px",vt.setAttribute("id",t+"_element_centsform_id_temp"),vt.setAttribute("name",t+"_element_centsform_id_temp"),vt.setAttribute("value",l[1]),vt.setAttribute("title",d[1]),vt.setAttribute("onBlur",'add_0("'+t+'_element_centsform_id_temp")'),vt.setAttribute("onKeyPress","return check_isnum_interval(event,'"+t+"_element_centsform_id_temp',0,99)");var wt=document.createElement("label");wt.setAttribute("class","mini_label"),wt.setAttribute("id",t+"_mini_label_cents"),wt.innerHTML=_[1];var gt=document.getElementById("show_table");Xe.appendChild(st),Xe.appendChild(ut),at.appendChild(ct),nt.appendChild(ft),lt.appendChild(ht),dt.appendChild(vt),tt.appendChild(at),tt.appendChild(nt),tt.appendChild(lt),tt.appendChild(dt),_t.appendChild(pt),rt.appendChild(yt),ot.appendChild(bt),mt.appendChild(wt),it.appendChild(_t),it.appendChild(rt),it.appendChild(ot),it.appendChild(mt),et.appendChild(tt),et.appendChild(it),Je.appendChild(Re),Je.appendChild(We),Je.appendChild(Ve),Je.appendChild($e),Je.appendChild(et),Ze.appendChild(Xe),Ze.appendChild(Je),Ge.appendChild(Ze),Ge.appendChild(Fe),Ge.appendChild(Ye),gt.appendChild(Ge),"top"==a&&label_top(t),"yes"==m&&hide_show_cents(!0,t),change_class(s,t),refresh_attr(t,"type_paypal_price"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_dollars").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery(e).focus(),jQuery("input.dollars").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_dollars").text(e)})}}),jQuery("label#"+t+"_mini_label_cents").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.cents").focus(),jQuery("input.cents").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_cents").text(e)})}})})}function hide_show_cents(e,t){td_divider=document.getElementById(t+"_td_name_divider"),td_cents=document.getElementById(t+"_td_name_cents"),td_divider_label=document.getElementById(t+"_td_name_label_divider"),td_cents_label=document.getElementById(t+"_td_name_label_cents"),change_input_value("",t+"_element_centsform_id_temp"),document.getElementById("el_first_value_last").value="",document.getElementById(t+"_element_centsform_id_temp").value="",td_cents_label.style.display=e?(td_divider.style.display="none",td_cents.style.display="none",td_divider_label.style.display="none"):(td_divider.style.display="table-cell",td_cents.style.display="table-cell",td_divider_label.style.display="table-cell")}function type_date(e,t,i,a,l,d,_,r,o,m,s,u){document.getElementById("element_type").value="type_date",delete_last_child();var c=document.createElement("div");c.setAttribute("id","edit_div");var p=document.createElement("table");p.setAttribute("id","edit_main_table"),p.setAttribute("cellpadding","3"),p.setAttribute("cellspacing","0");var f=document.createElement("tr"),y=document.createElement("tr"),h=document.createElement("tr"),b=document.createElement("tr");b.style.cssText="display:none;";var v=document.createElement("tr"),w=document.createElement("tr"),g=document.createElement("tr"),E=document.createElement("tr"),A=document.createElement("tr"),x=document.createElement("td"),k=document.createElement("td"),I=document.createElement("td"),C=document.createElement("td"),B=document.createElement("td"),Q=document.createElement("td"),T=document.createElement("td"),M=document.createElement("td"),L=document.createElement("td"),z=document.createElement("td"),q=document.createElement("td"),H=document.createElement("td"),N=document.createElement("td"),S=document.createElement("td"),D=document.createElement("td"),P=document.createElement("td"),O=document.createElement("td"),K=document.createElement("td"),U=document.createElement("label");U.setAttribute("for","edit_for_label"),U.setAttribute("class","fm-field-label"),U.innerHTML="Field label";var F=document.createElement("textarea");F.setAttribute("id","edit_for_label"),F.setAttribute("rows","4"),F.setAttribute("onKeyUp","change_label('"+e+"_element_labelform_id_temp', this.value)"),F.innerHTML=t;var R=document.createElement("label");R.setAttribute("class","fm-field-label"),R.setAttribute("for","edit_for_label_size"),R.innerHTML="Field label size(px) ";var W=document.createElement("input");W.setAttribute("id","edit_for_label_size"),W.setAttribute("type","text"),W.setAttribute("value",i),W.setAttribute("onKeyPress","return check_isnum(event)"),W.setAttribute("onKeyUp","change_w_style('"+e+"_label_sectionform_id_temp', this.value)");var V=document.createElement("label");V.setAttribute("class","fm-field-label"),V.innerHTML="Field label position";var $=document.createElement("input");$.setAttribute("id","edit_for_label_position_top"),$.setAttribute("type","radio"),$.setAttribute("name","edit_for_label_position"),$.setAttribute("onchange","label_left("+e+")");var G=document.createElement("label");G.setAttribute("for","edit_for_label_position_top"),G.innerHTML="Left";var Y=document.createElement("input");Y.setAttribute("id","edit_for_label_position_left"),Y.setAttribute("type","radio"),Y.setAttribute("name","edit_for_label_position"),Y.setAttribute("onchange","label_top("+e+")");var Z=document.createElement("label");Z.setAttribute("for","edit_for_label_position_left"),Z.innerHTML="Top","top"==a?Y.setAttribute("checked","checked"):$.setAttribute("checked","checked");var X=document.createElement("label");X.setAttribute("class","fm-field-label"),X.setAttribute("for","date_format"),X.innerHTML="Date format";var J=document.createElement("input");J.setAttribute("id","date_format"),J.setAttribute("type","text"),J.setAttribute("value",r),J.setAttribute("onChange","change_date_format(this.value,'"+e+"', 'format')");var ee=document.createElement("label");ee.setAttribute("class","fm-field-label"),ee.setAttribute("for","button_value"),ee.innerHTML="Date Picker label";var te=document.createElement("input");te.setAttribute("id","button_value"),te.setAttribute("type","text"),te.setAttribute("value",o),te.style.cssText="width:150px;",te.setAttribute("onKeyUp","change_file_value(this.value,'"+e+"_buttonform_id_temp')");var ie=document.createElement("label");ie.setAttribute("class","fm-field-label"),ie.setAttribute("for","el_disable_past_days"),ie.innerHTML="Allow selecting dates starting from current day";var ae=document.createElement("input");ae.setAttribute("id","el_disable_past_days"),ae.setAttribute("type","checkbox"),ae.setAttribute("onclick","change_date_format(this.checked, '"+e+"', 'dis_days')"),"yes"==u&&ae.setAttribute("checked","checked");var ne=document.createElement("label");ne.setAttribute("class","fm-field-label"),ne.setAttribute("for","el_style_textarea"),ne.innerHTML="Class name";var le=document.createElement("input");le.setAttribute("id","el_style_textarea"),le.setAttribute("type","text"),le.setAttribute("value",_),le.setAttribute("onChange","change_class(this.value,'"+e+"')");var de=document.createElement("label");de.setAttribute("class","fm-field-label"),de.setAttribute("for","el_required"),de.innerHTML="Required";var _e=document.createElement("input");_e.setAttribute("id","el_required"),_e.setAttribute("type","checkbox"),_e.setAttribute("onclick","set_required('"+e+"_required')"),"yes"==d&&_e.setAttribute("checked","checked");var re=document.createElement("label");re.setAttribute("class","fm-field-label"),re.innerHTML="Additional Attributes";var oe=document.createElement("img");oe.setAttribute("src",plugin_url+"/images/add.png?ver=1.8.0"),oe.style.cssText="cursor:pointer; margin-left:68px",oe.setAttribute("title","add"),oe.setAttribute("onClick","add_attr("+e+", 'type_date')");var me=document.createElement("table");me.setAttribute("id","attributes"),me.setAttribute("border","0"),me.style.cssText="margin-left:0px";var se=document.createElement("tr");se.setAttribute("idi","0");var ue=document.createElement("th");ue.style.cssText="width:100px";var ce=document.createElement("th");ce.style.cssText="width:100px";var pe=document.createElement("th");pe.style.cssText="width:10px";var fe=document.createElement("label");fe.style.cssText="color:#000; font-weight:bold; font-size: 11px",fe.innerHTML="Name";var ye=document.createElement("label");for(ye.style.cssText="color:#000; font-weight:bold; font-size: 11px",ye.innerHTML="Value",me.appendChild(se),se.appendChild(ue),se.appendChild(ce),se.appendChild(pe),ue.appendChild(fe),ce.appendChild(ye),n=m.length,j=1;j<=n;j++){var he=document.createElement("tr");he.setAttribute("id","attr_row_"+j),he.setAttribute("idi",j);var be=document.createElement("td");be.style.cssText="width:100px";var ve=document.createElement("td");ve.style.cssText="width:100px";var we=document.createElement("td"),ge=document.createElement("input");ge.setAttribute("type","text"),ge.setAttribute("class","fm-field-choice"),ge.setAttribute("value",m[j-1]),ge.setAttribute("id","attr_name"+j),ge.setAttribute("onChange","change_attribute_name("+e+", this, 'type_date')");var Ee=document.createElement("input");Ee.setAttribute("type","text"),Ee.setAttribute("class","fm-field-choice"),Ee.setAttribute("value",s[j-1]),Ee.setAttribute("id","attr_value"+j),Ee.setAttribute("onChange","change_attribute_value("+e+", "+j+", 'type_date')");var Ae=document.createElement("img");Ae.setAttribute("id","el_choices"+j+"_remove"),Ae.setAttribute("src",plugin_url+"/images/delete.png?ver=1.8.0"),Ae.style.cssText="cursor:pointer; vertical-align:middle; margin:2px",Ae.setAttribute("onClick","remove_attr("+j+", "+e+", 'type_date')"),me.appendChild(he),he.appendChild(be),he.appendChild(ve),he.appendChild(we),be.appendChild(ge),ve.appendChild(Ee),we.appendChild(Ae)}var je=document.getElementById("edit_table"),xe=document.createElement("br"),ke=document.createElement("br");x.appendChild(U),k.appendChild(F),D.appendChild(R),P.appendChild(W),I.appendChild(V),C.appendChild($),C.appendChild(G),C.appendChild(xe),C.appendChild(Y),C.appendChild(Z),B.appendChild(X),Q.appendChild(J),T.appendChild(ee),M.appendChild(te),O.appendChild(ie),K.appendChild(ae),L.appendChild(ne),z.appendChild(le),q.appendChild(de),H.appendChild(_e),N.appendChild(re),N.appendChild(oe),N.appendChild(ke),N.appendChild(me),N.setAttribute("colspan","2"),f.appendChild(x),f.appendChild(k),E.appendChild(D),E.appendChild(P),y.appendChild(I),y.appendChild(C),h.appendChild(B),h.appendChild(Q),b.appendChild(T),b.appendChild(M),A.appendChild(O),A.appendChild(K),v.appendChild(L),v.appendChild(z),w.appendChild(q),w.appendChild(H),g.appendChild(N),g.appendChild(S),p.appendChild(f),p.appendChild(E),p.appendChild(y),p.appendChild(h),p.appendChild(b),p.appendChild(A),p.appendChild(v),p.appendChild(w),p.appendChild(g),c.appendChild(p),je.appendChild(c),add_id_and_name(e,"type_text");var Ie=document.createElement("input");Ie.setAttribute("type","hidden"),Ie.setAttribute("value","type_date"),Ie.setAttribute("name",e+"_typeform_id_temp"),Ie.setAttribute("id",e+"_typeform_id_temp");var Ce=document.createElement("input");Ce.setAttribute("type","hidden"),Ce.setAttribute("value",d),Ce.setAttribute("name",e+"_requiredform_id_temp"),Ce.setAttribute("id",e+"_requiredform_id_temp");var Be=document.createElement("input");Be.setAttribute("type","hidden"),Be.setAttribute("value",u),Be.setAttribute("id",e+"_dis_past_daysform_id_temp"),Be.setAttribute("name",e+"_dis_past_daysform_id_temp");var Qe=document.createElement("div");Qe.setAttribute("id","main_div");var Te=document.createElement("div");Te.setAttribute("id",e+"_elemet_tableform_id_temp");var Me=document.createElement("div");Me.setAttribute("align","left"),Me.style.display="table-cell",Me.style.width=i+"px",Me.setAttribute("id",e+"_label_sectionform_id_temp");var Le=document.createElement("div");Le.setAttribute("align","left"),Le.style.display="table-cell",Le.setAttribute("id",e+"_element_sectionform_id_temp");var ze=document.createElement("div");ze.setAttribute("id",e+"_table_date"),ze.style.display="table";var qe=document.createElement("div");qe.setAttribute("id",e+"_tr_date1"),qe.style.display="table-row";var He=document.createElement("div");He.setAttribute("id",e+"_tr_date2"),He.style.display="table-row";var Ne=document.createElement("div");Ne.setAttribute("id",e+"_td_date_input1"),Ne.style.display="table-cell";var Se=document.createElement("div");Se.setAttribute("id",e+"_td_date_input2"),Se.style.display="table-cell";var De=document.createElement("div");De.setAttribute("id",e+"_td_date_input3"),De.style.display="table-cell";var Pe=document.createElement("div");Pe.setAttribute("id",e+"_td_date_label1"),Pe.style.display="table-cell";var Oe=document.createElement("div");Oe.setAttribute("id",e+"_td_date_label2"),Oe.style.display="table-cell";var Ke=document.createElement("div");Ke.setAttribute("id",e+"_td_date_label3"),Ke.style.display="table-cell";var Ue=document.createElement("br"),Fe=(document.createElement("br"),document.createElement("span"));Fe.setAttribute("id",e+"_element_labelform_id_temp"),Fe.innerHTML=t,Fe.setAttribute("class","label"),Fe.style.verticalAlign="top";var Re=document.createElement("span");Re.setAttribute("id",e+"_required_elementform_id_temp"),Re.innerHTML="",Re.setAttribute("class","required"),Re.style.verticalAlign="top","yes"==d&&(Re.innerHTML=" *");var We=document.createElement("input");We.setAttribute("type","text"),We.setAttribute("value",l),We.setAttribute("class","wdform-date"),We.setAttribute("id",e+"_elementform_id_temp"),We.setAttribute("name",e+"_elementform_id_temp"),We.setAttribute("maxlength","10"),We.setAttribute("size","10");var Ve=document.createElement("input");Ve.setAttribute("id",e+"_buttonform_id_temp"),Ve.setAttribute("class","button"),Ve.setAttribute("type","reset"),Ve.setAttribute("value",o),Ve.setAttribute("format",r);var $e=document.getElementById("show_table");Me.appendChild(Fe),Me.appendChild(Re),Le.appendChild(Ie),Le.appendChild(Ce),Le.appendChild(Be),Le.appendChild(We),Le.appendChild(Ve),Te.appendChild(Me),Te.appendChild(Le),Qe.appendChild(Te),Qe.appendChild(Ue),$e.appendChild(Qe),"top"==a&&label_top(e),change_class(_,e),refresh_attr(e,"type_date")}function form_maker_getElementsByAttribute(e,t,i,a){for(var n,l,d="*"==t&&e.all?e.all:e.getElementsByTagName(t),_=new Array,r=void 0!==a?new RegExp("(^|\\s)"+a+"(\\s|$)"):null,o=0;o "),type=document.getElementById("wdform_field"+e).getAttribute("type"),document.getElementById(e+"_element_labelform_id_temp").innerHTML&&(w_field_label=document.getElementById(e+"_element_labelform_id_temp").innerHTML),labels=all_labels(),m=0,t=!0,"type_section_break"!=type){for(;t;)for(m++,k=0;k ')),jQuery(".fm-form-builder .wdform_column:not(#add_field_cont):last-child").after(jQuery('
')),jQuery(".fm-form-builder .wdform_section").each(function(){var e=jQuery(this);0==e.find(".wdform_column").length&&e.append('
')}),sortable_columns()}function fm_rows_refresh(){jQuery(".wdform_page").each(function(){jQuery(this).children(".wdform_row_empty").remove(),0===jQuery(this).find(".wdform_row_empty").length&&jQuery(this).find(".wdform_footer").before(jQuery('
"))}),jQuery(".wdform_row_empty > div").off("click").on("click",function(){var e=jQuery('
').addClass("wdform_section");jQuery(this).closest(".wdform_row_empty").before(e),fm_row_handle(e),all_sortable_events()}),sortable_columns()}function fm_convert_form_structure(){jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.addClass("fm-form-builder");e.find(".wdform_section").length;e.find(".wdform_section").each(function(){var t=jQuery(this),a=t.find(".wdform_column").length;t.find(".wdform_column").each(function(){var e=jQuery(this),i=jQuery('
');e.find(".wdform_row").each(function(){var e=jQuery(this),t=jQuery('
').append(e);i.append(t)}),t.before(i),fm_row_handle(i)}),t.remove()})}),jQuery(".wdform_tr_section_break").remove(),all_sortable_events(),jQuery("#fm-edit-disable-overlay").remove()}function FormManageSubmitButton(e){for(null==e&&(e=!1,jQuery(window).off("beforeunload")),tox="",form_fields="",jQuery("#saving").html('
'),e||(document.getElementById("take").style.display="none",document.getElementById("page_bar").style.display="none",jQuery(".wdform_section").each(function(){var e=this;jQuery(e).find(".wdform_column").each(function(){!jQuery(this).html()&&1
"+a+"").html()!=jQuery(""+l+" ").html()&&(form_changed=!0),jQuery("#header_hide_image").prop("checked")!=(1==jQuery("#header_hide_image").attr("data-initial-value"))&&(form_changed=!0)}return!e||!form_changed}function formOnload(rows){for(t=0;t';jQuery(this).html(e),jQuery("input.first").focus(),jQuery("input.first").blur(function(){var e=document.getElementById("first").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_first").text(t)})}}),jQuery("label#"+myu+"_mini_label_last").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.last").focus(),jQuery("input.last").blur(function(){var e=document.getElementById("last").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_last").text(t)})}}),jQuery("label#"+myu+"_mini_label_title").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.title_").focus(),jQuery("input.title_").blur(function(){var e=document.getElementById("title_").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_title").text(t)})}}),jQuery("label#"+myu+"_mini_label_middle").on("click",function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=document.getElementById("middle").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_middle").text(t)})}})})}else if("type_phone"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(document).ready(function(){jQuery("label#"+myu+"_mini_label_area_code").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.area_code").focus(),jQuery("input.area_code").blur(function(){var e=document.getElementById("area_code").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_area_code").text(t)})}}),jQuery("label#"+myu+"_mini_label_phone_number").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.phone_number").focus(),jQuery("input.phone_number").blur(function(){var e=document.getElementById("phone_number").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_phone_number").text(t)})}})})}else if("type_date_fields"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(document).ready(function(){jQuery("label#"+myu+"_day_label").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.day").focus(),jQuery("input.day").blur(function(){var e=document.getElementById("day").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_day_label").text(t)})}}),jQuery("label#"+myu+"_month_label").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.month").focus(),jQuery("input.month").blur(function(){var e=document.getElementById("month").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_month_label").text(t)})}}),jQuery("label#"+myu+"_year_label").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.year").focus(),jQuery("input.year").blur(function(){var e=document.getElementById("year").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_year_label").text(t)})}})})}else if("type_time"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(document).ready(function(){jQuery("label#"+myu+"_mini_label_hh").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.hh").focus(),jQuery("input.hh").blur(function(){var e=document.getElementById("hh").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_hh").text(t)})}}),jQuery("label#"+myu+"_mini_label_mm").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.mm").focus(),jQuery("input.mm").blur(function(){var e=document.getElementById("mm").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_mm").text(t)})}}),jQuery("label#"+myu+"_mini_label_ss").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.ss").focus(),jQuery("input.ss").blur(function(){var e=document.getElementById("ss").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_ss").text(t)})}}),jQuery("label#"+myu+"_mini_label_am_pm").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.am_pm").focus(),jQuery("input.am_pm").blur(function(){var e=document.getElementById("am_pm").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_am_pm").text(t)})}})})}else if("type_paypal_price"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(document).ready(function(){jQuery("#"+myu+"_mini_label_dollars").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.dollars").focus(),jQuery("input.dollars").blur(function(){var e=document.getElementById("dollars").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_dollars").text(t)})}}),jQuery("label#"+myu+"_mini_label_cents").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.cents").focus(),jQuery("input.cents").blur(function(){var e=document.getElementById("cents").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_cents").text(t)})}})})}else if("type_address"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(document).ready(function(){jQuery("label#"+myu+"_mini_label_street1").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.street1").focus(),jQuery("input.street1").blur(function(){var e=document.getElementById("street1").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_street1").text(t)})}}),jQuery("label#"+myu+"_mini_label_street2").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.street2").focus(),jQuery("input.street2").blur(function(){var e=document.getElementById("street2").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_street2").text(t)})}}),jQuery("label#"+myu+"_mini_label_city").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.city").focus(),jQuery("input.city").blur(function(){var e=document.getElementById("city").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_city").text(t)})}}),jQuery("label#"+myu+"_mini_label_state").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.state").focus(),jQuery("input.state").blur(function(){var e=document.getElementById("state").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_state").text(t)})}}),jQuery("label#"+myu+"_mini_label_postal").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.postal").focus(),jQuery("input.postal").blur(function(){var e=document.getElementById("postal").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_postal").text(t)})}}),jQuery("label#"+myu+"_mini_label_country").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.country").focus(),jQuery("input.country").blur(function(){var e=document.getElementById("country").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_country").text(t)})}})})}else if("type_scale_rating"==document.getElementById(t+"_typeform_id_temp").value){var myu=t;jQuery(document).ready(function(){jQuery("#"+myu+"_mini_label_worst").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.worst").focus(),jQuery("input.worst").blur(function(){var e=document.getElementById("worst").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_worst").text(t)})}}),jQuery("label#"+myu+"_mini_label_best").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.best").focus(),jQuery("input.best").blur(function(){var e=document.getElementById("best").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_best").text(t)})}})})}else if("type_spinner"==document.getElementById(t+"_typeform_id_temp").value){var spinner_value=document.getElementById(t+"_elementform_id_temp").value,spinner_min_value=document.getElementById(t+"_min_valueform_id_temp").value,spinner_max_value=document.getElementById(t+"_max_valueform_id_temp").value,spinner_step=document.getElementById(t+"_stepform_id_temp").value;jQuery("#"+t+"_elementform_id_temp")[0].spin=null,spinner=jQuery("#"+t+"_elementform_id_temp").spinner(),null==spinner_value&&spinner.spinner("value",""),jQuery("#"+t+"_elementform_id_temp").spinner({min:spinner_min_value}),jQuery("#"+t+"_elementform_id_temp").spinner({max:spinner_max_value}),jQuery("#"+t+"_elementform_id_temp").spinner({step:spinner_step})}else if("type_slider"==document.getElementById(t+"_typeform_id_temp").value){var slider_value=document.getElementById(t+"_slider_valueform_id_temp").value,slider_min_value=document.getElementById(t+"_slider_min_valueform_id_temp").value,slider_max_value=document.getElementById(t+"_slider_max_valueform_id_temp").value,slider_element_value=document.getElementById(t+"_element_valueform_id_temp"),slider_value_save=document.getElementById(t+"_slider_valueform_id_temp");jQuery("#"+t+"_elementform_id_temp")[0].slide=null,jQuery(function(){jQuery("#"+t+"_elementform_id_temp").slider({range:"min",value:eval(slider_value),min:eval(slider_min_value),max:eval(slider_max_value),slide:function(e,t){slider_element_value.innerHTML=""+t.value,slider_value_save.value=""+t.value}})})}else if("type_range"==document.getElementById(t+"_typeform_id_temp").value){var spinner_value0=document.getElementById(t+"_elementform_id_temp0").value,spinner_step=document.getElementById(t+"_range_stepform_id_temp").value;jQuery("#"+t+"_elementform_id_temp0")[0].spin=null,jQuery("#"+t+"_elementform_id_temp1")[0].spin=null,spinner0=jQuery("#"+t+"_elementform_id_temp0").spinner(),null==spinner_value0&&spinner0.spinner("value",""),jQuery("#"+t+"_elementform_id_temp0").spinner({step:spinner_step});var spinner_value1=document.getElementById(t+"_elementform_id_temp1").value;spinner1=jQuery("#"+t+"_elementform_id_temp1").spinner(),null==spinner_value1&&spinner1.spinner("value",""),jQuery("#"+t+"_elementform_id_temp1").spinner({step:spinner_step});var myu=t;jQuery(document).ready(function(){jQuery("#"+myu+"_mini_label_from").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.from").focus(),jQuery("input.from").blur(function(){var e=document.getElementById("from").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_from").text(t)})}}),jQuery("label#"+myu+"_mini_label_to").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.to").focus(),jQuery("input.to").blur(function(){var e=document.getElementById("to").parentNode.id.split("_"),t=jQuery(this).val();jQuery("#"+e[0]+"_mini_label_to").text(t)})}})})}else if("type_date_range"==document.getElementById(t+"_typeform_id_temp").value){var default_date_start=jQuery("#"+t+"_default_date_id_temp_start").val(),default_date_end=jQuery("#"+t+"_default_date_id_temp_end").val(),date_format=jQuery("#"+t+"_buttonform_id_temp").attr("format");jQuery("#"+t+"_elementform_id_temp0").datepicker(),jQuery("#"+t+"_elementform_id_temp1").datepicker(),jQuery("#"+t+"_elementform_id_temp0").datepicker("option","dateFormat",date_format),jQuery("#"+t+"_elementform_id_temp1").datepicker("option","dateFormat",date_format),"today"==default_date_start?jQuery("#"+t+"_elementform_id_temp0").datepicker("setDate",new Date):(-1==default_date_start.indexOf("d")&&-1==default_date_start.indexOf("m")&&-1==default_date_start.indexOf("y")&&-1==default_date_start.indexOf("w")&&""!==default_date_start&&(default_date_start=jQuery.datepicker.formatDate(date_format,new Date(default_date_start))),jQuery("#"+t+"_elementform_id_temp0").datepicker("setDate",default_date_start)),"today"==default_date_end?jQuery("#"+t+"_elementform_id_temp1").datepicker("setDate",new Date):(-1==default_date_end.indexOf("d")&&-1==default_date_end.indexOf("m")&&-1==default_date_end.indexOf("y")&&-1==default_date_end.indexOf("w")&&""!==default_date_end&&(default_date_end=jQuery.datepicker.formatDate(date_format,new Date(default_date_end))),jQuery("#"+t+"_elementform_id_temp1").datepicker("setDate",default_date_end))}else if("type_date_new"==document.getElementById(t+"_typeform_id_temp").value){var default_date=jQuery("#"+t+"_default_date_id_temp").val(),date_format=jQuery("#"+t+"_buttonform_id_temp").attr("format");jQuery("#"+t+"_elementform_id_temp").datepicker(),jQuery("#"+t+"_elementform_id_temp").datepicker("option","dateFormat",date_format),"today"==default_date?jQuery("#"+t+"_elementform_id_temp").datepicker("setDate",new Date):(-1==default_date.indexOf("d")&&-1==default_date.indexOf("m")&&-1==default_date.indexOf("y")&&-1==default_date.indexOf("w")&&""!==default_date&&(default_date=jQuery.datepicker.formatDate(date_format,new Date(default_date))),jQuery("#"+t+"_elementform_id_temp").datepicker("setDate",default_date))}else"type_phone_new"==document.getElementById(t+"_typeform_id_temp").value&&(jQuery("#"+t+"_elementform_id_temp").intlTelInput({nationalMode:!1,preferredCountries:[jQuery("#"+t+"_elementform_id_temp").attr("top-country")]}),jQuery("#"+t+"_elementform_id_temp").intlTelInput("setNumber",jQuery("#"+t+"_elementform_id_temp").val()));remove_whitespace(document.getElementById("take")),form_view=1,form_view_max=1;var form_view_count=jQuery(".wdform-page-and-images").length;if(jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id").split("form_id_tempform_view"),t=parseInt(e[1]);form_view_max=t>form_view_max?t:form_view_max,page_toolbar_wrap=document.createElement("div"),page_toolbar_wrap.setAttribute("id","form_id_tempform_view_img"+t),page_toolbar_wrap.setAttribute("class","form_id_tempform_view_img"),page_title=document.createElement("div"),page_title.setAttribute("class","wdform_page_title"),page_title.innerHTML=' '+document.getElementById("form_id_tempform_view"+t).getAttribute("page_title"),page_toolbar_wrap.appendChild(page_title),page_toolbar=document.createElement("div");var i="none"==document.getElementById("form_id_tempform_view"+t).style.display?"fm-ico-expand":"fm-ico-collapse",a=document.createElement("span");a.setAttribute("title","Show or hide the page"),a.setAttribute("class","page_toolbar dashicons "+i),a.setAttribute("id","show_page_img_"+t),a.setAttribute("onClick",'show_or_hide("'+t+'"); change_show_hide_icon(this);');var n=document.createElement("span");n.setAttribute("title","Delete the page"),n.setAttribute("class","page_toolbar fm-ico-delete"),n.setAttribute("onclick",'remove_page("'+t+'")');var l=document.createElement("span");l.setAttribute("title","Edit the page"),l.setAttribute("class","page_toolbar fm-ico-edit"),l.setAttribute("onclick",'edit_page_break("'+t+'")'),page_toolbar.appendChild(n),page_toolbar.appendChild(l),page_toolbar.appendChild(a),page_toolbar_wrap.appendChild(page_toolbar);var d=document.getElementById("form_id_tempform_view"+t).parentNode;d.insertBefore(page_toolbar_wrap,d.childNodes[0])}),1Untitled Page',2==form_view_count?(generate_page_nav(form_view),generate_page_nav(old_to_gen)):generate_page_nav(form_view),all_sortable_events(),jQuery(".wdform_arrows").hide(),draggable_page_break(nextID,form_view_max),nextID="",form_view_element.scrollIntoView()}function add(e,a,d){if("type_grading"==document.getElementById("element_type").value){for(k=100;0 ';q.innerHTML=g;var E=document.createElement("div");E.setAttribute("id",i+"_element_sectionform_id_temp"),E.setAttribute("align","left"),E.setAttribute("class","wdform_section_break"),ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),"none"==document.getElementById("form_maker_editor").style.display?E.innerHTML=ifr.body.innerHTML:E.innerHTML=document.getElementById("form_maker_editor").value,(I=document.createElement("span")).setAttribute("id",i+"_element_labelform_id_temp"),I.innerHTML="Custom HTML"+i,I.style.cssText="display:none",z.appendChild(E),beforeTr=wdform_page.lastChild,wdform_page.insertBefore(L,beforeTr),wdform_section_new=document.createElement("div"),wdform_section_new.setAttribute("class","wdform_section"),wdform_column_new=document.createElement("div"),wdform_column_new.setAttribute("class","wdform_column"),wdform_column_new1=document.createElement("div"),wdform_column_new1.setAttribute("class","wdform_column"),wdform_section_new.appendChild(wdform_column_new1),draggable_section_break(nextID,L),nextID="",j=2}return jQuery(".wdform_arrows").hide(),close_window(),void all_sortable_events()}if("type_page_navigation"==document.getElementById("element_type").value)return document.getElementById("pages").setAttribute("show_title",document.getElementById("el_show_title_input").checked),document.getElementById("pages").setAttribute("show_numbers",document.getElementById("el_show_numbers_input").checked),document.getElementById("el_pagination_steps").checked?(document.getElementById("pages").setAttribute("type","steps"),make_page_steps_front()):document.getElementById("el_pagination_percentage").checked?(document.getElementById("pages").setAttribute("type","percentage"),make_page_percentage_front()):(document.getElementById("pages").setAttribute("type","none"),make_page_none_front()),refresh_page_numbers(),void close_window();if("type_page_break"==document.getElementById("element_type").value&&document.getElementById("editing_id").value){i=document.getElementById("editing_id").value,form_view_element=document.getElementById("form_id_tempform_view"+i),page_title=document.getElementById("_div_between").getAttribute("page_title"),next_title=document.getElementById("_div_between").getAttribute("next_title"),next_type=document.getElementById("_div_between").getAttribute("next_type"),next_class=document.getElementById("_div_between").getAttribute("next_class"),next_checkable=document.getElementById("_div_between").getAttribute("next_checkable"),previous_title=document.getElementById("_div_between").getAttribute("previous_title"),previous_type=document.getElementById("_div_between").getAttribute("previous_type"),previous_class=document.getElementById("_div_between").getAttribute("previous_class"),previous_checkable=document.getElementById("_div_between").getAttribute("previous_checkable"),form_view_element.setAttribute("next_title",next_title),form_view_element.setAttribute("next_type",next_type),form_view_element.setAttribute("next_class",next_class),form_view_element.setAttribute("next_checkable",next_checkable),form_view_element.setAttribute("previous_title",previous_title),form_view_element.setAttribute("previous_type",previous_type),form_view_element.setAttribute("previous_class",previous_class),form_view_element.setAttribute("previous_checkable",previous_checkable),form_view_element.setAttribute("page_title",page_title),document.getElementById("form_id_tempform_view_img"+i).firstChild.innerHTML=' '+page_title;var A=document.getElementById("_div_between");for(atr=A.attributes,v=0;v<30;v++)atr[v]&&0==atr[v].name.indexOf("add_")&&form_view_element.setAttribute(atr[v].name,atr[v].value);return form_view_count=jQuery(".wdform-page-and-images").length,1!=form_view_count&&generate_page_nav(form_view),sortable_columns(),jQuery(".wdform_arrows").hide(),void close_window()}for(form_view=0,t=form_view_max;0 ';q.innerHTML=g,ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),"none"==document.getElementById("form_maker_editor").style.display?z.innerHTML=ifr.body.innerHTML:z.innerHTML=document.getElementById("form_maker_editor").value,(I=document.createElement("span")).setAttribute("id",i+"_element_labelform_id_temp"),I.innerHTML="Custom HTML"+i,I.style.color="red",L.appendChild(I),add_field_in_position(nextID,L),nextID="",j=2}close_window()}else if(document.getElementById("show_table").innerHTML){if(document.getElementById("editing_id").value?i=document.getElementById("editing_id").value:i=gen,type=document.getElementById("element_type").value,"type_hidden"==type&&""==document.getElementById(i+"_elementform_id_temp").name)return void alert("The name of the field is required.");if("type_map"==type){if(void 0===gmapdata[i]||void 0===gmapdata[i].getCenter())return alert("Please go to Global Options to setup the Map API key. It may take up to 5 minutes for API key change to take effect."),!1;if_gmap_updateMap(i)}if("type_mark_map"==type){if(void 0===gmapdata[i]||void 0===gmapdata[i].getCenter())return alert("Please go to Global Options to setup the Map API key. It may take up to 5 minutes for API key change to take effect."),!1;if_gmap_updateMap(i)}if(!document.getElementById(i+"_element_labelform_id_temp").innerHTML)return void alert("The field label is required.");if(document.getElementById("editing_id").value){for(Disable(),i=document.getElementById("editing_id").value,in_lab=!1,labels_array=new Array,w=0;w '+("type_captcha"!=type&&"type_arithmetic_captcha"!=type&&"type_recaptcha"!=type&&"type_send_copy"!=type&&"type_stripe"!=type?' ':"")+' ';q.innerHTML=g;C=document.getElementById(i+"_label_sectionform_id_temp"),B=document.getElementById(i+"_element_sectionform_id_temp");if(z.appendChild(C),z.appendChild(B),"type_submitter_mail"==type||"type_password"==type){Q=document.createElement("br"),T=document.getElementById(i+"_1_label_sectionform_id_temp"),M=document.getElementById(i+"_1_element_sectionform_id_temp");z.appendChild(Q),z.appendChild(T),z.appendChild(M)}add_field_in_position(nextID,L),nextID="",j=2,close_window(),call(i,e)}}else alert("Please select an element to add.");jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_page input[type='text'], .wdform_page input[type='password'], .wdform_page input[type='file'], .wdform_page textarea, .wdform_page input[type='checkbox'], .wdform_page input[type='radio'], .wdform_page select").prop("disabled",!0),all_sortable_events()}}else alert("The pages are closed")}function move_submit_to_end(e){var t=jQuery(e).children(":not(.fm-hidden)").last();return!!t.find("[type=type_submit_reset]").length&&t}function add_field_in_position(e,t){if(null==e||""==e){var i=jQuery("#cur_column");if(1==i.val()){var a=jQuery('
').append(t),n=move_submit_to_end(i);!1!==n?jQuery(a).insertBefore(n):i.append(a)}else i.append(t)}else beforeTr=document.getElementById("wdform_field"+e).parentNode,wdform_column=beforeTr.parentNode,wdform_column.insertBefore(t,beforeTr);jQuery(window).scrollTop(jQuery(t).offset().top-100),jQuery("#cur_column").removeAttr("id")}function draggable_page_break(e,t){var i=jQuery(".wdform_row[wdid='"+e+"']"),a="form_id_tempform_view"+t;if(!(null==e||""==e||2").insertAfter(a.parent().parent()).append(a.nextAll().andSelf()),jQuery(".wdform_section .wdform_tr_section_break").each(function(){jQuery(this).insertBefore(jQuery(this).parent())}),jQuery("#cur_column").removeAttr("id"),jQuery(".curr").children().appendTo(".curr .wdform_column"),jQuery(".curr").append("
"),jQuery(".curr").removeClass("curr")}function call(e,t){need_enable=!1,after_edit=!1,0==t&&(after_edit=!0,edit(e),add("1",after_edit,e)),need_enable=!0}function popup_ready(){jQuery(".popup-title").html(form_maker.add_field),jQuery("#add-button-cont").html(""),jQuery("#field_container .fm-free-message").addClass("fm-hidden"),jQuery(".field-types-filter").val(""),filter(jQuery(".field-types-filter")),jQuery(".field_types .postbox button.wd-button").removeClass("button-primary"),jQuery(".field_types").show(),jQuery("#field_container").removeClass("field_container_full"),jQuery(".add-popup").slideToggle(200)}function close_window(){need_enable&&popup_ready(),need_enable=!0,document.getElementById("edit_table").innerHTML="",document.getElementById("show_table").innerHTML="",document.getElementById("main_editor").style.display="none",document.getElementById("form_maker_editor_ifr")&&(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=""),document.getElementById("form_maker_editor").value="",document.getElementById("editing_id").value="",document.getElementById("element_type").value=""}function addRow(e,t,i,a){if(jQuery(".field_types .postbox button.wd-button").removeClass("button-primary"),jQuery(t).addClass("button-primary"),void 0===a)a="";document.getElementById("show_table").innerHTML&&(document.getElementById("show_table").innerHTML="",document.getElementById("edit_table").innerHTML="");var n=""==jQuery("#editing_id").val()?gen:jQuery("#editing_id").val();window["el_"+i](a,n),fm_add_field_button(t,a)}function fm_add_field_button(e,t){jQuery(e).hasClass("wd-pro-fields")&&"stripe"!=t?(jQuery("#edit_main_table input").attr("disabled","disabled"),jQuery("#edit_main_table textarea").attr("disabled","disabled"),jQuery("#edit_main_table .fm-input-container span.dashicons").attr("onclick",""),jQuery("#add-button-cont").removeClass("add-button-cont").html(""),jQuery("#premium_message").removeClass("fm-hidden"),jQuery("#stripe_message").addClass("fm-hidden"),jQuery("#field_container .popup-body-col").addClass("fm-opacity-40")):"stripe"!=t||0!=is_addon_stripe_active&&0!=is_stripe_enabled?(jQuery("#add-button-cont").addClass("add-button-cont").html('
'+form_maker.add+" "),jQuery("#premium_message").addClass("fm-hidden"),jQuery("#stripe_message").addClass("fm-hidden"),jQuery("#field_container .popup-body-col").removeClass("fm-opacity-40")):(jQuery("#edit_main_table input").attr("disabled","disabled"),jQuery("#edit_main_table textarea").attr("disabled","disabled"),jQuery("#edit_main_table .fm-input-container span.dashicons").attr("onclick",""),jQuery(e).hasClass("wd-pro-fields")||0!=is_stripe_enabled||1!=is_addon_stripe_active?(jQuery("#add-button-cont").removeClass("add-button-cont").html(""),jQuery("#premium_message").addClass("fm-hidden"),jQuery("#stripe_message").removeClass("fm-hidden"),jQuery("#field_container .popup-body-col").addClass("fm-opacity-40")):(jQuery("#add-button-cont").removeClass("add-button-cont").html('
"),jQuery("#premium_message").addClass("fm-hidden"),jQuery("#stripe_message").addClass("fm-hidden"),jQuery("#field_container .popup-body-col").removeClass("fm-opacity-40")))}function el_text(e,t){window["go_to_type_"+e](t)}function el_checkbox(e,t){w_choices=["option 1","option 2"],w_choices_checked=[!1,!1],w_choices_value=["option 1","option 2"],w_choices_params=["",""],w_attr_name=[],w_attr_value=[],type_checkbox(t,"Multiple Choice","","top","right","no","ver",w_choices,w_choices_checked,"1","no","no","no","0","",w_attr_name,w_attr_value,"no",w_choices_value,w_choices_params)}function el_radio(e,t){w_choices=["option 1","option 2"],w_choices_checked=[!1,!1],w_choices_value=["option 1","option 2"],w_choices_params=["",""],w_attr_name=[],w_attr_value=[],type_radio(t,"Single Choice","","top","right","no","ver",w_choices,w_choices_checked,"1","no","no","no","0","",w_attr_name,w_attr_value,"no",w_choices_value,w_choices_params)}function el_survey(e,t){window["go_to_type_"+e](t)}function el_time_and_date(e,t){window["go_to_type_"+e](t)}function el_select(e,t){window["go_to_type_"+e](t)}function el_file_upload(e,t){w_attr_name=[],w_attr_value=[],type_file_upload(t,"Upload a File","","top","no","form-maker","jpg, jpeg, png, gif, bmp, tif, tiff, svg, pdf, txt, log, doc, docx, csv, xls, xlsx, pps, ppt, pptx, xml, mp3, mp4, wma, wav, mpg, wmv","2000","no","no","",w_attr_name,w_attr_value)}function el_section_break(e,t){type_section_break(t,"
")}function el_page_break(e,t){w_page_title="Untitled Page",w_title=["Next","Previous"],w_type=["text","text"],w_class=["wdform-page-button","wdform-page-button"],w_check=["true","false"],w_attr_name=[],w_attr_value=[],type_page_break("0",w_page_title,w_title,w_type,w_class,w_check,w_attr_name,w_attr_value)}function el_map(e,t){w_long=["2.294254"],w_lat=["48.858334"],w_info=[""],w_attr_name=[],w_attr_value=[],type_map(t,"2.294254","48.858334",w_long,w_lat,"13","370","300","wdform_map",w_info,w_attr_name,w_attr_value)}function el_paypal(e,t){window["go_to_type_"+e](t)}function el_captcha(e,t){document.getElementById("_wd_captchaform_id_temp")||document.getElementById("_wd_arithmetic_captchaform_id_temp")||document.getElementById("wd_recaptchaform_id_temp")?alert(form_maker.captcha_created):window["go_to_type_"+e](t)}function el_button(e,t){window["go_to_type_"+e](t)}function el_editor(e,t){type_editor(t,"")}function create_option_container(e,t,i,a){var n=jQuery('
");if(null!=e){var l=jQuery('
');l.append(e),n.append(l)}if(null!=t){var d=jQuery('
');d.append(t),n.append(d)}return n}function create_advanced_options_container(e,t,i){var a=jQuery("
"),n=jQuery('
Toggle panel Advanced options ');return a.append(n),a.append(e),a}function create_field_type(e){return create_option_container(null,jQuery('
'+jQuery(".wd-button[data-type="+e+"]").first().text()+" "))}function create_label(e,t){return create_option_container(jQuery('
Label '),jQuery('
"))}function change_label(e,t,i){t=(t=t.replace(/(<([^>]+)>)/gi,"")).replace(/"/g,"""),i?document.getElementById(i).innerHTML=t:(document.getElementById(e).innerHTML=t,document.getElementById(e).value=t)}function create_label_position(e,t){var i=jQuery('
Label position '),a=jQuery('
"),n=jQuery('
Left '),l=jQuery('
"),d=jQuery('
Top '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_label_position_stripe(e,t){var i=jQuery('
Label position '),a=jQuery('
"),n=jQuery('
Left '),l=jQuery('
"),d=jQuery('
Top '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function label_left(e){"no"==document.getElementById(e+"_hide_labelform_id_temp").value?document.getElementById(e+"_label_sectionform_id_temp").style.display="table-cell":document.getElementById(e+"_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_element_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_1_label_sectionform_id_temp")&&("yes"==document.getElementById(e+"_verification_id_temp").value?(document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none"))}function label_top(e){"no"==document.getElementById(e+"_hide_labelform_id_temp").value?(document.getElementById(e+"_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_element_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_label_sectionform_id_temp")&&("yes"==document.getElementById(e+"_verification_id_temp").value?(document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none"))):(document.getElementById(e+"_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_element_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_label_sectionform_id_temp")&&("yes"==document.getElementById(e+"_verification_id_temp").value?(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="block"):(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none")))}function create_hide_label(e,t){return create_option_container(jQuery('
Hide label '),jQuery('
"))}function hide_label(e){"no"==document.getElementById(e+"_hide_labelform_id_temp").value?(document.getElementById(e+"_hide_labelform_id_temp").value="yes",document.getElementById(e+"_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_elementform_id_temp")&&document.getElementById(e+"_1_elementform_id_temp").offsetParent&&(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none")):(document.getElementById("edit_for_label_position_left").checked?(document.getElementById(e+"_label_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_element_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_1_elementform_id_temp")&&document.getElementById(e+"_1_elementform_id_temp").offsetParent&&(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="table-cell",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="table-cell")):(document.getElementById(e+"_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_element_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_elementform_id_temp")&&document.getElementById(e+"_1_elementform_id_temp").offsetParent&&(document.getElementById(e+"_1_label_sectionform_id_temp").style.display="block",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="block")),document.getElementById(e+"_hide_labelform_id_temp").value="no")}function create_placeholder(e,t){return create_option_container(jQuery('
Placeholder '),jQuery('
'))}function change_input_value(e,t){input=document.getElementById(t),input.title=e,input.placeholder=e}function create_required(e,t){return create_option_container(jQuery('
Required '),jQuery('
"))}function set_required(e,t){"yes"==document.getElementById(e+"form_id_temp").value?(document.getElementById(e+"form_id_temp").setAttribute("value","no"),document.getElementById(e+"_elementform_id_temp").innerHTML="",void 0!==t&&(document.getElementById(t+"_elementform_id_temp").innerHTML="")):(document.getElementById(e+"form_id_temp").setAttribute("value","yes"),document.getElementById(e+"_elementform_id_temp").innerHTML=" *",void 0!==t&&(document.getElementById(t+"_elementform_id_temp").innerHTML=" *"))}function create_field_size(e,t,i,a){return null==i&&(i="'"+e+"_elementform_id_temp'"),create_option_container(jQuery('
Width(px) '),jQuery('
'+form_maker.leave_empty+"
"))}function create_field_label_size(e,t,i,a){return null==i&&(i="'"+e+"_label_sectionform_id_temp'"),create_option_container(jQuery('
Label width(px) '),jQuery('
'+form_maker.leave_empty+"
"))}function change_w_style(e,t,i){""==t?jQuery("#"+e).css("width",t):(jQuery("#"+e).css("width",t+"px"),i&&(document.getElementById(i).style.width=t+"px"))}function change_h_style(e,t){document.getElementById(e).style.height=t+"px"}function create_readonly(e,t){return create_option_container(jQuery('
Readonly '),jQuery('
"))}function set_readonly(e){"no"==document.getElementById(e+"_readonlyform_id_temp").value?(document.getElementById(e+"_readonlyform_id_temp").value="yes",document.getElementById(e+"_elementform_id_temp").setAttribute("readonly","readonly")):(document.getElementById(e+"_elementform_id_temp").removeAttribute("readonly"),document.getElementById(e+"_readonlyform_id_temp").value="no")}function create_unique_values(e,t){return create_option_container(jQuery('
Allow only unique values '),jQuery('
"))}function set_unique(e){"yes"==document.getElementById(e).value?document.getElementById(e).setAttribute("value","no"):document.getElementById(e).setAttribute("value","yes")}function create_regexp(e,t){return create_option_container(jQuery('
Validation (RegExp.) '),jQuery('
"))}function set_regExpStatus(e){jQuery("#edit_main_tr12, #edit_main_tr13, #edit_main_tr14, #edit_main_tr15").toggle(200),"yes"==document.getElementById(e+"form_id_temp").value?document.getElementById(e+"form_id_temp").setAttribute("value","no"):document.getElementById(e+"form_id_temp").setAttribute("value","yes")}function create_custom_regexp(e,t,i){return create_option_container(jQuery('
Regular Expression '),jQuery('
"),"edit_main_tr12","yes"==t)}function change_regExpValue(e,t,i,a){0
Common Regular Expressions'),n=jQuery(' "),l=0,d=[];for(var _ in d.Select="",d["Name(Latin letters and some symbols)"]="^[a-zA-Z'-'\\s]+$",d["Phone Number(Digits and dashes)"]="^(\\+)?[0-9]+(-[0-9]+)?(-[0-9]+)?(-[0-9]+)?$",d["Integer Number"]="^(-)?[0-9]+$",d["Decimal Number"]="^(-)?[0-9]+(\\.[0-9]+)?$",d["Latin letters and Numbers"]="^[a-z&A-Z0-9]*$",d["Credit Card (16 Digits)"]="^([0-9](\\.)?){15}[0-9]$",d["Zip Code"]="^(\\d{5}-\\d{4}|\\d{5}|\\d{9})$|^([a-zA-Z]\\d[a-zA-Z] \\d[a-zA-Z]\\d)$",d["IP Address"]="^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$",d["Date m/d/y (e.g. 12/21/2013)"]="^([0-9]|1[0,1,2])/([0-9]|[0,1,2][0-9]|3[0,1])/[0-9]{4}$",d["Date d.m.y (e.g. 21.12.2013)"]="^([0-9]|[0,1,2][0-9]|3[0,1])\\.([0-9]|1[0,1,2])\\.[0-9]{4}$",d["MySQL Date Format (2013-12-21)"]="^\\d{4}-(0[0-9]|1[0,1,2])-([0,1,2][0-9]|3[0,1])$",d)if(d.hasOwnProperty(_)){var r=jQuery('"+_+" ");n.append(r),l++}return create_option_container(a,n,"edit_main_tr13","yes"==t)}function create_case_sensitive(e,t,i){return create_option_container(jQuery('Case Insensitive '),jQuery(' "),"edit_main_tr14","yes"==t)}function set_regExpArgument(e){document.getElementById(e+"form_id_temp").value.length<=0?document.getElementById(e+"form_id_temp").setAttribute("value","i"):document.getElementById(e+"form_id_temp").setAttribute("value","")}function create_alert_message(e,t,i){return create_option_container(jQuery('Alert Message '),jQuery('"),"edit_main_tr15","yes"==t)}function change_regExpAlert(e,t){document.getElementById(t).value=e}function create_additional_attributes(e,t,i){var a=jQuery('Additional Attributes '),l=jQuery(' '),d=jQuery('
'),_=jQuery('');for(d.append(_),d.hide(),n=t.length,j=1;j<=n;j++){var r=jQuery('");d.append(r),d.show()}var o=a;return create_option_container(null,o=(o=o.add(l)).add(d))}function add_attr(e,t){var i=jQuery("#attributes");i.show(),j=parseInt(i.children().last().attr("idi"))+1,w_attr_name="attribute",w_attr_value="value";var a=jQuery('");i.append(a),refresh_attr(e,t),jQuery("#edit_table").scrollTop(jQuery("#attributes").offset().top)}function change_attribute_name(e,t,i){if(value=t.value,value)if("style"!=value.toLowerCase())if(value!=parseInt(value)){if(-1!=value.indexOf(" ")){return value=value.replace(/\s+/g,""),t.value=value,alert("The name of the attribute cannot contain a space."),void refresh_attr(e,i)}refresh_attr(e,i)}else alert("The name of the attribute cannot be a number.");else alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');else alert("The name of the attribute is required.")}function change_attribute_value(e,t,i){document.getElementById("attr_name"+t).value?"style"!=document.getElementById("attr_name"+t).value.toLowerCase()?refresh_attr(e,i):alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.'):alert("The name of the attribute is required.")}function remove_attr(e,t,i){tr=jQuery("#attr_row_"+e),table=jQuery("#attributes"),tr.remove(),1==table.children().length&&table.hide(),refresh_attr(t,i)}function refresh_attr(e,t){switch(t){case"type_text":case"type_paypal_price_new":case"type_star_rating":case"type_scale_rating":case"type_spinner":case"type_slider":case"type_grading":case"type_matrix":id_array=Array(),id_array[0]=e+"_elementform_id_temp";break;case"type_paypal_price":id_array=Array(),id_array[0]=e+"_element_dollarsform_id_temp",id_array[1]=e+"_element_centsform_id_temp";break;case"type_range":id_array=Array(),id_array[0]=e+"_elementform_id_temp0",id_array[1]=e+"_elementform_id_temp1";break;case"type_name":id_array=Array(),id_array[0]=e+"_element_firstform_id_temp",id_array[1]=e+"_element_lastform_id_temp",id_array[2]=e+"_element_titleform_id_temp",id_array[3]=e+"_element_middleform_id_temp";break;case"type_address":id_array=Array(),id_array[0]=e+"_street1form_id_temp",id_array[1]=e+"_street2form_id_temp",id_array[2]=e+"_cityform_id_temp",id_array[3]=e+"_stateform_id_temp",id_array[4]=e+"_postalform_id_temp",id_array[5]=e+"_countryform_id_temp";break;case"type_checkbox":case"type_radio":for(id_array=Array(),z=0;z<50;z++)id_array[z]=e+"_elementform_id_temp"+z;break;case"type_time":id_array=Array(),id_array[0]=e+"_hhform_id_temp",id_array[1]=e+"_mmform_id_temp",id_array[2]=e+"_ssform_id_temp",id_array[3]=e+"_am_pmform_id_temp";break;case"type_date":id_array=Array(),id_array[0]=e+"_elementform_id_temp",id_array[1]=e+"_buttonform_id_temp";break;case"type_date_fields":id_array=Array(),id_array[0]=e+"_dayform_id_temp",id_array[1]=e+"_monthform_id_temp",id_array[2]=e+"_yearform_id_temp";break;case"type_captcha":id_array=Array(),id_array[0]="_wd_captchaform_id_temp",id_array[1]="_wd_captcha_inputform_id_temp",id_array[2]="_element_refreshform_id_temp";break;case"type_arithmetic_captcha":id_array=Array(),id_array[0]="_wd_arithmetic_captchaform_id_temp",id_array[1]="_wd_arithmetic_captcha_inputform_id_temp",id_array[2]="_element_refreshform_id_temp";break;case"type_recaptcha":id_array=Array(),id_array[0]="wd_recaptchaform_id_temp";break;case"type_submit_reset":id_array=Array(),id_array[0]=e+"_element_submitform_id_temp",id_array[1]=e+"_element_resetform_id_temp";break;case"type_page_break":id_array=Array(),id_array[0]="_div_between"}for(q=0;q ');v.append(w);var g=jQuery('
');w.append(g),g.append(create_field_type("type_text")),g.append(create_label(e,t)),g.append(create_label_position(e,a)),g.append(create_hide_label(e,n)),g.append(create_required(e,r)),g.append(create_placeholder(e,_)),g.append(create_field_size(e,l));var E=jQuery('
');g.append(create_advanced_options_container(E)),E.append(create_field_label_size(e,i)),E.append(create_readonly(e,h)),E.append(create_unique_values(e,p)),E.append(create_regexp(e,o)),E.append(create_common_regexp(e,o,s)),E.append(create_custom_regexp(e,o,m)),E.append(create_case_sensitive(e,o,u)),E.append(create_alert_message(e,o,c)),E.append(create_class(e,b)),E.append(create_additional_attributes(e,f,"type_text")),element="input",cur_type="text";var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value","type_text"),A.setAttribute("name",e+"_typeform_id_temp"),A.setAttribute("id",e+"_typeform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",r),j.setAttribute("name",e+"_requiredform_id_temp"),j.setAttribute("id",e+"_requiredform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",h),x.setAttribute("name",e+"_readonlyform_id_temp"),x.setAttribute("id",e+"_readonlyform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",n),k.setAttribute("name",e+"_hide_labelform_id_temp"),k.setAttribute("id",e+"_hide_labelform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",p),I.setAttribute("name",e+"_uniqueform_id_temp"),I.setAttribute("id",e+"_uniqueform_id_temp");var C=document.createElement(element);C.setAttribute("type",cur_type),C.style.cssText="width:"+l+"px;",C.setAttribute("id",e+"_elementform_id_temp"),C.setAttribute("name",e+"_elementform_id_temp"),C.setAttribute("value",d),C.setAttribute("title",_),C.setAttribute("placeholder",_),"yes"==h&&C.setAttribute("readonly","readonly");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",o),B.setAttribute("name",e+"_regExpStatusform_id_temp"),B.setAttribute("id",e+"_regExpStatusform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",u),Q.setAttribute("name",e+"_regArgumentform_id_temp"),Q.setAttribute("id",e+"_regArgumentform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",s),T.setAttribute("name",e+"_regExp_commonform_id_temp"),T.setAttribute("id",e+"_regExp_commonform_id_temp");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",escape(m)),M.setAttribute("name",e+"_regExp_valueform_id_temp"),M.setAttribute("id",e+"_regExp_valueform_id_temp");var L=document.createElement("input");L.setAttribute("type","hidden"),L.setAttribute("value",c),L.setAttribute("name",e+"_regExp_alertform_id_temp"),L.setAttribute("id",e+"_regExp_alertform_id_temp");var z=document.createElement("div");z.setAttribute("id","main_div");var q=document.createElement("div");q.setAttribute("id",e+"_elemet_tableform_id_temp");var H="yes"==n?"none":"table-cell",N=document.createElement("div");N.setAttribute("align","left"),N.style.cssText="display:"+H,N.style.width=i+"px",N.setAttribute("id",e+"_label_sectionform_id_temp");var S=document.createElement("div");S.setAttribute("align","left"),S.style.display="table-cell",S.setAttribute("id",e+"_element_sectionform_id_temp");var D=document.createElement("br"),P=document.createElement("span");P.setAttribute("id",e+"_element_labelform_id_temp"),P.innerHTML=t,P.setAttribute("class","label"),P.style.verticalAlign="top";var O=document.createElement("span");O.setAttribute("id",e+"_required_elementform_id_temp"),O.innerHTML="",O.setAttribute("class","required"),O.style.verticalAlign="top","yes"==r&&(O.innerHTML=" *");var K=document.getElementById("show_table");N.appendChild(P),N.appendChild(O),S.appendChild(A),S.appendChild(j),S.appendChild(x),S.appendChild(k),S.appendChild(B),S.appendChild(M),S.appendChild(T),S.appendChild(L),S.appendChild(Q),S.appendChild(I),S.appendChild(C),q.appendChild(N),q.appendChild(S),z.appendChild(q),z.appendChild(D),K.appendChild(z),jQuery("#main_div").append(form_maker.type_text_description),"top"==a&&label_top(e),change_class(b,e),refresh_attr(e,"type_text")}function create_upload_max_size(e,t){return create_option_container(jQuery('Maximum size(KB) '),jQuery(' '))}function change_file_value(e,t,i,a){void 0===i&&(a=i=""),input=document.getElementById(t),input.value=i+e+a,input.setAttribute("value",i+e+a)}function create_upload_destination(e,t){return create_option_container(jQuery('Destination '),jQuery(''+upload_url.replace(fm_site_url,"")+'/ '))}function create_upload_extensions(e,t){return create_option_container(jQuery('Allowed file extensions '),jQuery('"))}function create_class(e,t){return create_option_container(jQuery('Class name '),jQuery(' '))}function change_class(e,t){document.getElementById(t+"_label_sectionform_id_temp")&&document.getElementById(t+"_label_sectionform_id_temp").setAttribute("class",e),document.getElementById(t+"_element_sectionform_id_temp")&&document.getElementById(t+"_element_sectionform_id_temp").setAttribute("class",e)}function create_multiple_upload(e,t){return create_option_container(jQuery('Allow Uploading Multiple Files '),jQuery(' "))}function set_multiple(e,t){t?document.getElementById(e+"_elementform_id_temp").setAttribute("multiple","multiple"):document.getElementById(e+"_elementform_id_temp").removeAttribute("multiple")}function type_file_upload(e,t,i,a,n,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_file_upload"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('
');c.append(p);var f=jQuery('
');p.append(f),f.append(create_field_type("type_file_upload")),f.append(create_label(e,t)),f.append(create_label_position(e,a)),f.append(create_hide_label(e,n)),f.append(create_required(e,r)),f.append(create_upload_extensions(e,d));var y=jQuery('
');f.append(create_advanced_options_container(y)),y.append(create_field_label_size(e,i)),y.append(create_upload_max_size(e,_)),y.append(create_upload_destination(e,l)),y.append(create_class(e,m)),y.append(create_multiple_upload(e,o)),y.append(create_additional_attributes(e,s,"type_file_upload")),element="input",type="file";var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value","type_file_upload"),h.setAttribute("name",e+"_typeform_id_temp"),h.setAttribute("id",e+"_typeform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",r),b.setAttribute("name",e+"_requiredform_id_temp"),b.setAttribute("id",e+"_requiredform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",n),v.setAttribute("name",e+"_hide_labelform_id_temp"),v.setAttribute("id",e+"_hide_labelform_id_temp");var w=document.createElement(element);w.setAttribute("type",type),w.setAttribute("class","file_upload"),w.setAttribute("id",e+"_elementform_id_temp"),w.setAttribute("name",e+"_fileform_id_temp"),"yes"==o&&w.setAttribute("multiple","multiple");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","***max_sizeskizb"+e+"***"+_+"***max_sizeverj"+e+"***"),g.setAttribute("id",e+"_max_size"),g.setAttribute("name",e+"_max_size");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value","***destinationskizb"+e+"***"+l+"***destinationverj"+e+"***"),E.setAttribute("id",e+"_destination"),E.setAttribute("name",e+"_destination");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value","***extensionskizb"+e+"***"+d+"***extensionverj"+e+"***"),A.setAttribute("id",e+"_extension"),A.setAttribute("name",e+"_extension");var j=document.createElement("div");j.setAttribute("id","main_div");var x=document.createElement("div");x.setAttribute("id",e+"_elemet_tableform_id_temp");var k="yes"==n?"none":"table-cell",I=document.createElement("div");I.setAttribute("align","left"),I.style.display=k,I.style.width=i+"px",I.setAttribute("id",e+"_label_sectionform_id_temp");var C=document.createElement("div");C.setAttribute("align","left"),C.style.display="table-cell",C.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var B=document.createElement("br"),Q=(document.createElement("br"),document.createElement("span"));Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label"),Q.style.verticalAlign="top";var T=document.createElement("span");T.setAttribute("id",e+"_required_elementform_id_temp"),T.innerHTML="",T.setAttribute("class","required"),T.style.verticalAlign="top","yes"==r&&(T.innerHTML=" *");var M=document.getElementById("show_table");I.appendChild(Q),I.appendChild(T),C.appendChild(v),C.appendChild(h),C.appendChild(b),C.appendChild(g),C.appendChild(E),C.appendChild(A),C.appendChild(w),x.appendChild(I),x.appendChild(C),j.appendChild(x),j.appendChild(B),M.appendChild(j),jQuery("#main_div").append(form_maker.type_file_upload_description),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function go_to_type_stripe(e){if(document.getElementById("is_stripe"))return!1;type_stripe(e,"","","top","")}function type_stripe(e,t,i,a,n){jQuery("#element_type").val("type_stripe"),delete_last_child();var l=jQuery("#edit_table"),d=jQuery('
');l.append(d);var _=jQuery('
');d.append(_),_.append(create_field_type("type_stripe")),_.append(create_field_size(e,t)),_.append(create_label_position_stripe(e,a));var r=jQuery('
');_.append(create_advanced_options_container(r)),r.append(create_field_label_size(e,i)),r.append(create_class(e,n));var o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("value","type_stripe"),o.setAttribute("name",e+"_typeform_id_temp"),o.setAttribute("id",e+"_typeform_id_temp");var m=document.createElement("div");m.setAttribute("id","main_div");var s=document.createElement("div");s.setAttribute("id",e+"_elemet_tableform_id_temp");var u=document.createElement("div");u.setAttribute("align","left"),u.style.display="table-cell",u.setAttribute("id",e+"_label_sectionform_id_temp"),u.style.width=i+"px";var c=document.createElement("div");c.setAttribute("align","left"),c.style.display="table-cell",c.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var p=document.createElement("br"),f=(document.createElement("br"),document.createElement("span"));f.setAttribute("id",e+"_element_labelform_id_temp"),f.innerHTML="stripe",f.setAttribute("class","label"),f.style.display="none";var y=document.getElementById("show_table");u.appendChild(f),c.innerHTML=" Stripe Section
",c.appendChild(o),s.appendChild(u),s.appendChild(c),m.appendChild(s),m.appendChild(p),y.appendChild(m),jQuery("#main_div").append(form_maker.type_stripe_description),"top"==a?label_top_stripe(e):label_left_stripe(),change_class(n,e)}function create_field_size_2(e,t,i){return create_option_container(jQuery('Size(px) '),jQuery(' x'+form_maker.leave_empty+"
"))}function go_to_type_textarea(e){w_attr_name=[],w_attr_value=[],type_textarea(e,"Textarea","","top","no","","100","","","no","no","",w_attr_name,w_attr_value)}function type_textarea(e,t,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_textarea"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('
');p.append(f);var y=jQuery('
');f.append(y),y.append(create_field_type("type_textarea")),y.append(create_label(e,t)),y.append(create_label_position(e,a)),y.append(create_hide_label(e,n)),y.append(create_required(e,o)),y.append(create_placeholder(e,r)),y.append(create_field_size_2(e,l,d));var h=jQuery('
');y.append(create_advanced_options_container(h)),h.append(create_field_label_size(e,i)),h.append(create_unique_values(e,m)),h.append(create_class(e,s)),h.append(create_additional_attributes(e,u,"type_textarea")),element="textarea";var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_textarea"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",o),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",e+"_hide_labelform_id_temp"),w.setAttribute("id",e+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",m),g.setAttribute("name",e+"_uniqueform_id_temp"),g.setAttribute("id",e+"_uniqueform_id_temp");var E=document.createElement("div");E.setAttribute("id","main_div");var A=document.createElement("div");A.setAttribute("id",e+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=i+"px",x.style.verticalAlign="top",x.setAttribute("id",e+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",e+"_element_sectionform_id_temp");var I=document.createElement("span");I.setAttribute("id",e+"_element_labelform_id_temp"),I.innerHTML=t,I.setAttribute("class","label"),I.style.verticalAlign="top";var C=document.createElement("span");C.setAttribute("id",e+"_required_elementform_id_temp"),C.innerHTML="",C.setAttribute("class","required"),C.style.verticalAlign="top","yes"==o&&(C.innerHTML=" *");var B=document.createElement(element);B.style.cssText="width:"+l+"px; height:"+d+"px;",B.setAttribute("id",e+"_elementform_id_temp"),B.setAttribute("name",e+"_elementform_id_temp"),B.setAttribute("title",r),B.setAttribute("placeholder",r),B.setAttribute("value",_),B.innerHTML=_;var Q=document.getElementById("show_table");x.appendChild(I),x.appendChild(C),k.appendChild(b),k.appendChild(v),k.appendChild(w),k.appendChild(g),k.appendChild(B),A.appendChild(x),A.appendChild(k),E.appendChild(A),Q.appendChild(E),jQuery("#main_div").append(" "+form_maker.type_textarea_description),"top"==a&&label_top(e),change_class(s,e),refresh_attr(e,"type_text")}function create_spinner_width(e,t){return create_option_container(jQuery('Width(px) '),jQuery(''+form_maker.leave_empty+"
"))}function change_spinner_width(e,t,i){document.getElementById(t+"_elementform_id_temp").style.cssText="width:"+e+"px",document.getElementById(t+"_spinner_widthform_id_temp").value=e}function create_spinner_step(e,t){return create_option_container(jQuery('Step '),jQuery(' '))}function change_spinner_step(e,t,i){jQuery("#"+t+"_elementform_id_temp").spinner({step:e}),document.getElementById(t+"_stepform_id_temp").value=e}function create_spinner_minvalue(e,t){return create_option_container(jQuery('Min Value '),jQuery(' '))}function change_spinner_min_value(e,t,i){jQuery("#"+t+"_elementform_id_temp").spinner({min:e}),document.getElementById(t+"_min_valueform_id_temp").value=e}function create_spinner_maxvalue(e,t){return create_option_container(jQuery('Max Value '),jQuery(' '))}function change_spinner_max_value(e,t,i){jQuery("#"+t+"_elementform_id_temp").spinner({max:e}),document.getElementById(t+"_max_valueform_id_temp").value=e}function go_to_type_spinner(e){w_attr_name=[],w_attr_value=[],type_spinner(e,"Number","","top","no","60","","","1","","no","",w_attr_name,w_attr_value)}function type_spinner(e,t,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_spinner"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('
');p.append(f);var y=jQuery('
');f.append(y),y.append(create_field_type("type_spinner")),y.append(create_label(e,t)),y.append(create_label_position(e,a)),y.append(create_hide_label(e,n)),y.append(create_required(e,m)),y.append(create_spinner_step(e,r)),y.append(create_spinner_minvalue(e,d)),y.append(create_spinner_maxvalue(e,_)),y.append(create_spinner_width(e,l));var h=jQuery('
');y.append(create_advanced_options_container(h)),h.append(create_field_label_size(e,i)),h.append(create_class(e,s)),h.append(create_additional_attributes(e,u,"type_spinner"));var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_spinner"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",m),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",e+"_hide_labelform_id_temp"),w.setAttribute("id",e+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",l),g.setAttribute("name",e+"_spinner_widthform_id_temp"),g.setAttribute("id",e+"_spinner_widthform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",d),E.setAttribute("id",e+"_min_valueform_id_temp"),E.setAttribute("name",e+"_min_valueform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",_),A.setAttribute("name",e+"_max_valueform_id_temp"),A.setAttribute("id",e+"_max_valueform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",r),j.setAttribute("name",e+"_stepform_id_temp"),j.setAttribute("id",e+"_stepform_id_temp");var x=document.createElement("input");x.setAttribute("type",""),x.style.cssText="width:"+l+"px",x.setAttribute("name",e+"_elementform_id_temp"),x.setAttribute("id",e+"_elementform_id_temp"),x.setAttribute("value",o),x.setAttribute("onClick","check_isnum_or_minus(event)"),x.setAttribute("onKeyPress","return check_isnum_or_minus(event)");var k=document.createElement("div");k.setAttribute("id","main_div");var I=document.createElement("div");I.setAttribute("id",e+"_elemet_tableform_id_temp");var C="yes"==n?"none":"table-cell",B=document.createElement("div");B.setAttribute("align","left"),B.style.display=C,B.style.width=i+"px",B.setAttribute("id",e+"_label_sectionform_id_temp");var Q=document.createElement("div");Q.setAttribute("align","left"),Q.style.display="table-cell",Q.setAttribute("id",e+"_element_sectionform_id_temp");var T=document.createElement("br"),M=document.createElement("span");M.setAttribute("id",e+"_element_labelform_id_temp"),M.innerHTML=t,M.setAttribute("class","label");var L=document.createElement("span");L.setAttribute("id",e+"_required_elementform_id_temp"),L.innerHTML="",L.setAttribute("class","required"),"yes"==m&&(L.innerHTML=" *");var z=document.getElementById("show_table");B.appendChild(M),B.appendChild(L),Q.appendChild(w),Q.appendChild(b),Q.appendChild(v),Q.appendChild(g),Q.appendChild(E),Q.appendChild(A),Q.appendChild(j),Q.appendChild(x),I.appendChild(B),I.appendChild(Q),k.appendChild(I),k.appendChild(T),z.appendChild(k),"top"==a&&label_top(e),change_class(s,e),refresh_attr(e,"type_spinner"),jQuery("#"+e+"_elementform_id_temp").spinner();var q=jQuery("#"+e+"_elementform_id_temp").spinner();null==o&&q.spinner("value",""),jQuery("#"+e+"_elementform_id_temp").spinner({min:d}),jQuery("#"+e+"_elementform_id_temp").spinner({max:_}),jQuery("#"+e+"_elementform_id_temp").spinner({step:r}),jQuery("#main_div").append(form_maker.type_number_description)}function create_date_format(e,t){return create_option_container(jQuery('Date Format '),jQuery(' '))}function change_date_format(e,t,i){var a=document.getElementById(t+"_buttonform_id_temp");if("format"==i){document.getElementById(t+"_dis_past_daysform_id_temp").value;a.setAttribute("format",e)}else{document.getElementById(t+"_dis_past_daysform_id_temp").value=1==e?"yes":"no";e=document.getElementById("date_format").value}jQuery("[name^="+t+"_elementform_id_temp]").datepicker("option","dateFormat",e)}function create_week_start(e,t){var i=jQuery('First Day of the Week '),a=jQuery(' '),n=0,l=[];for(var d in l[0]=form_maker.sunday,l[1]=form_maker.monday,l[2]=form_maker.tuesday,l[3]=form_maker.wednesday,l[4]=form_maker.thursday,l[5]=form_maker.friday,l[6]=form_maker.saturday,l)if(l.hasOwnProperty(d)){var _=jQuery('"+l[d]+" ");a.append(_),n++}return create_option_container(i,a)}function change_start_day(e,t){document.getElementById(t+"_start_dayform_id_temp").value=e,jQuery("input[name^="+t+"_elementform_id_temp]").datepicker("option","firstDay",e)}function create_default_date(e,t){return create_option_container(jQuery('Default Date '),jQuery(' '))}function change_hidden_input_value(element_value,date_fields,id_int,id){document.getElementById(id).value=element_value,"default_date"==date_fields?"today"==element_value?jQuery("#"+id_int+"_elementform_id_temp").datepicker("setDate",new Date):(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w")&&""!==element_value&&(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").attr("format"),new Date(element_value))),jQuery("#"+id_int+"_elementform_id_temp").datepicker("setDate",element_value)):"minDate"==date_fields||"maxDate"==date_fields?"today"==element_value?jQuery("#"+id_int+"_elementform_id_temp").datepicker("option",date_fields,new Date):(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w")&&""!==element_value&&(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").attr("format"),new Date(element_value))),jQuery("#"+id_int+"_elementform_id_temp").datepicker("option",date_fields,element_value)):jQuery("#"+id_int+"_elementform_id_temp").datepicker("option","beforeShowDay",function(date){for(var invalid_dates=element_value,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;iMinimum Date'),jQuery(' '))}function create_maximum_date(e,t,i){return create_option_container(jQuery('Maximum Date '),jQuery(' '))}function create_excluded_dates(e,t,i){return create_option_container(jQuery('Dates to Exclude '),jQuery('"))}function create_show_date_picker_button(e,t,i){return create_option_container(jQuery('Show Date Picker Button '),jQuery(' "))}function show_image_datepicker(e,t){"yes"==document.getElementById(e+"form_id_temp").value?("date_range"==t?(jQuery("#"+e+"dateform_id_temp0").removeClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp0").addClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp1").removeClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp1").addClass("wd-hidden")):(jQuery("#"+e+"dateform_id_temp").removeClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp").addClass("wd-hidden")),document.getElementById(e+"form_id_temp").setAttribute("value","no")):("date_range"==t?(jQuery("#"+e+"dateform_id_temp0").removeClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp0").addClass("wd-inline-block"),jQuery("#"+e+"dateform_id_temp1").removeClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp1").addClass("wd-inline-block")):(jQuery("#"+e+"dateform_id_temp").removeClass("wd-hidden"),jQuery("#"+e+"dateform_id_temp").addClass("wd-inline-block")),document.getElementById(e+"form_id_temp").setAttribute("value","yes"))}function create_selectable_week_days(e,t){var i=jQuery('Selectable Week Days '),a=jQuery(' "),n=jQuery(''+form_maker.sunday+" "),l=jQuery(' "),d=jQuery(''+form_maker.monday+" "),_=jQuery(' "),r=jQuery(''+form_maker.tuesday+" "),o=jQuery(' "),m=jQuery(''+form_maker.wednesday+" "),s=jQuery(' "),u=jQuery(''+form_maker.thursday+" "),c=jQuery(' "),p=jQuery(''+form_maker.friday+" "),f=jQuery(' "),y=jQuery(''+form_maker.saturday+" "),h=a;return create_option_container(i,h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=h.add(n)).add(jQuery(" "))).add(l)).add(d)).add(jQuery(" "))).add(_)).add(r)).add(jQuery(" "))).add(o)).add(m)).add(jQuery(" "))).add(s)).add(u)).add(jQuery(" "))).add(c)).add(p)).add(jQuery(" "))).add(f)).add(y))}function go_to_type_date_new(e){w_attr_name=[],w_attr_value=[],w_show_days=["yes","yes","yes","yes","yes","yes","yes"],type_date_new(e,"Date","","top","no","","","no","no","","mm/dd/yy","0","","","","",w_show_days,"yes","...",w_attr_name,w_attr_value,"no")}function type_date_new(i,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_size,w_date,w_required,w_show_image,w_class,w_format,w_start_day,w_default_date,w_min_date,w_max_date,w_invalid_dates,w_show_days,w_hide_time,w_but_val,w_attr_name,w_attr_value,w_disable_past_days){jQuery("#element_type").val("type_date_new"),delete_last_child();var t=jQuery("#edit_table"),edit_div=jQuery('
');t.append(edit_div);var edit_main_table=jQuery('
');edit_div.append(edit_main_table),edit_main_table.append(create_field_type("type_date_new")),edit_main_table.append(create_label(i,w_field_label)),edit_main_table.append(create_label_position(i,w_field_label_pos)),edit_main_table.append(create_hide_label(i,w_hide_label)),edit_main_table.append(create_required(i,w_required)),edit_main_table.append(create_field_size(i,w_size)),edit_main_table.append(create_date_format(i,w_format)),edit_main_table.append(create_week_start(i,w_start_day));var advanced_options_container=jQuery('
');edit_main_table.append(create_advanced_options_container(advanced_options_container)),advanced_options_container.append(create_default_date(i,w_default_date)),advanced_options_container.append(create_minimum_date(i,w_min_date)),advanced_options_container.append(create_maximum_date(i,w_max_date)),advanced_options_container.append(create_excluded_dates(i,w_invalid_dates)),advanced_options_container.append(create_selectable_week_days(i,w_show_days)),advanced_options_container.append(create_field_label_size(i,w_field_label_size)),advanced_options_container.append(create_class(i,w_class)),advanced_options_container.append(create_show_date_picker_button(i,w_show_image,"new_date")),advanced_options_container.append(create_additional_attributes(i,w_attr_name,"type_date_new"));var adding_type=document.createElement("input");adding_type.setAttribute("type","hidden"),adding_type.setAttribute("value","type_date_new"),adding_type.setAttribute("name",i+"_typeform_id_temp"),adding_type.setAttribute("id",i+"_typeform_id_temp");var adding_required=document.createElement("input");adding_required.setAttribute("type","hidden"),adding_required.setAttribute("value",w_required),adding_required.setAttribute("name",i+"_requiredform_id_temp"),adding_required.setAttribute("id",i+"_requiredform_id_temp");var adding_hide_label=document.createElement("input");adding_hide_label.setAttribute("type","hidden"),adding_hide_label.setAttribute("value",w_hide_label),adding_hide_label.setAttribute("name",i+"_hide_labelform_id_temp"),adding_hide_label.setAttribute("id",i+"_hide_labelform_id_temp");var adding_dis_past_days=document.createElement("input");adding_dis_past_days.setAttribute("type","hidden"),adding_dis_past_days.setAttribute("value",w_disable_past_days),adding_dis_past_days.setAttribute("id",i+"_dis_past_daysform_id_temp"),adding_dis_past_days.setAttribute("name",i+"_dis_past_daysform_id_temp");var adding_start_day=document.createElement("input");adding_start_day.setAttribute("type","hidden"),adding_start_day.setAttribute("value",w_start_day),adding_start_day.setAttribute("name",i+"_start_dayform_id_temp"),adding_start_day.setAttribute("id",i+"_start_dayform_id_temp");var adding_default_date=document.createElement("input");adding_default_date.setAttribute("type","hidden"),adding_default_date.setAttribute("name",i+"_default_date_id_temp"),adding_default_date.setAttribute("id",i+"_default_date_id_temp"),adding_default_date.setAttribute("value",w_default_date);var adding_min_date=document.createElement("input");adding_min_date.setAttribute("type","hidden"),adding_min_date.setAttribute("name",i+"_min_date_id_temp"),adding_min_date.setAttribute("id",i+"_min_date_id_temp"),adding_min_date.setAttribute("value",w_min_date);var adding_max_date=document.createElement("input");adding_max_date.setAttribute("type","hidden"),adding_max_date.setAttribute("name",i+"_max_date_id_temp"),adding_max_date.setAttribute("id",i+"_max_date_id_temp"),adding_max_date.setAttribute("value",w_max_date);var adding_invalid_dates=document.createElement("input");adding_invalid_dates.setAttribute("type","hidden"),adding_invalid_dates.setAttribute("name",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("id",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("value",w_invalid_dates);var adding_show_days=document.createElement("input");adding_show_days.setAttribute("type","hidden"),adding_show_days.setAttribute("name",i+"_show_week_days"),adding_show_days.setAttribute("id",i+"_show_week_days"),adding_show_days.setAttribute("sunday",w_show_days[0]),adding_show_days.setAttribute("monday",w_show_days[1]),adding_show_days.setAttribute("tuesday",w_show_days[2]),adding_show_days.setAttribute("wednesday",w_show_days[3]),adding_show_days.setAttribute("thursday",w_show_days[4]),adding_show_days.setAttribute("friday",w_show_days[5]),adding_show_days.setAttribute("saturday",w_show_days[6]);var adding_show_image=document.createElement("input");adding_show_image.setAttribute("type","hidden"),adding_show_image.setAttribute("value",w_show_image),adding_show_image.setAttribute("name",i+"_show_imageform_id_temp"),adding_show_image.setAttribute("id",i+"_show_imageform_id_temp");var adding_hide_time=document.createElement("input");adding_hide_time.setAttribute("type","hidden"),adding_hide_time.setAttribute("value",w_hide_time),adding_hide_time.setAttribute("name",i+"_hide_timeform_id_temp"),adding_hide_time.setAttribute("id",i+"_hide_timeform_id_temp");var div=document.createElement("div");div.setAttribute("id","main_div");var div_field=document.createElement("div");div_field.setAttribute("id",i+"_elemet_tableform_id_temp");var display_label_div="yes"==w_hide_label?"none":"table-cell",div_label=document.createElement("div");div_label.setAttribute("align","left"),div_label.style.display=display_label_div,div_label.style.width=w_field_label_size+"px",div_label.setAttribute("id",i+"_label_sectionform_id_temp");var div_element=document.createElement("div");div_element.setAttribute("align","left"),div_element.style.display="table-cell",div_element.style.position="relative",div_element.setAttribute("id",i+"_element_sectionform_id_temp");var table_date=document.createElement("div");table_date.setAttribute("id",i+"_table_date"),table_date.style.display="table";var tr_date1=document.createElement("div");tr_date1.setAttribute("id",i+"_tr_date1"),tr_date1.style.display="table-row";var tr_date2=document.createElement("div");tr_date2.setAttribute("id",i+"_tr_date2"),tr_date2.style.display="table-row";var td_date_input1=document.createElement("div");td_date_input1.setAttribute("id",i+"_td_date_input1"),td_date_input1.style.display="table-cell";var td_date_input2=document.createElement("div");td_date_input2.setAttribute("id",i+"_td_date_input2"),td_date_input2.style.display="table-cell";var td_date_input3=document.createElement("div");td_date_input3.setAttribute("id",i+"_td_date_input3"),td_date_input3.style.display="table-cell";var td_date_label1=document.createElement("div");td_date_label1.setAttribute("id",i+"_td_date_label1"),td_date_label1.style.display="table-cell";var td_date_label2=document.createElement("div");td_date_label2.setAttribute("id",i+"_td_date_label2"),td_date_label2.style.display="table-cell";var td_date_label3=document.createElement("div");td_date_label3.setAttribute("id",i+"_td_date_label3"),td_date_label3.style.display="table-cell";var br3=document.createElement("br"),br4=document.createElement("br"),label=document.createElement("span");label.setAttribute("id",i+"_element_labelform_id_temp"),label.innerHTML=w_field_label,label.setAttribute("class","label"),label.style.verticalAlign="top";var required=document.createElement("span");required.setAttribute("id",i+"_required_elementform_id_temp"),required.innerHTML="",required.setAttribute("class","required"),required.style.verticalAlign="top","yes"==w_required&&(required.innerHTML=" *");var adding=document.createElement("input");adding.setAttribute("type","text"),adding.setAttribute("value",w_date),adding.setAttribute("id",i+"_elementform_id_temp"),adding.setAttribute("name",i+"_elementform_id_temp"),adding.style.cssText="width:"+w_size+"px;";var adding_image=document.createElement("span");adding_image.setAttribute("id",i+"_show_imagedateform_id_temp"),adding_image.setAttribute("class","dashicons dashicons-calendar-alt wd-calendar-button "+("yes"==w_show_image?"wd-inline-block":"wd-hidden")),adding_image.setAttribute("onClick","show_datepicker('"+i+"_elementform_id_temp')");var adding_desc_p=document.createElement("p"),adding_desc_b=document.createElement("b"),text_format_1=document.createTextNode("The format can be combinations of the following:"),text_format_2=document.createTextNode("d - day of month (no leading zero)"),text_format_3=document.createTextNode("dd - day of month (two digit)"),text_format_4=document.createTextNode("o - day of the year (no leading zeros)"),text_format_5=document.createTextNode("oo - day of the year (three digit)"),text_format_6=document.createTextNode("D - day name short"),text_format_7=document.createTextNode("DD - day name long"),text_format_8=document.createTextNode("m - month of year (no leading zero)"),text_format_9=document.createTextNode("mm - month of year (two digit)"),text_format_10=document.createTextNode("M - month name short"),text_format_11=document.createTextNode("MM - month name long"),text_format_12=document.createTextNode("y - year (two digit)"),text_format_13=document.createTextNode("yy - year (four digit)"),format_br_1=document.createElement("br"),format_br_2=document.createElement("br"),format_br_3=document.createElement("br"),format_br_4=document.createElement("br"),format_br_5=document.createElement("br"),format_br_6=document.createElement("br"),format_br_7=document.createElement("br"),format_br_8=document.createElement("br"),format_br_9=document.createElement("br"),format_br_10=document.createElement("br"),format_br_11=document.createElement("br"),format_br_12=document.createElement("br"),format_br_13=document.createElement("br"),adding_desc_p_2=document.createElement("p"),adding_desc_b_2=document.createElement("b"),text_default_1=document.createTextNode("Accepted values of Default, Minimum and Maximum:"),text_default_3=document.createTextNode("Date: A fixed date using the date format mm/dd/yy, e.g. 05/25/2016"),text_default_2=document.createTextNode("Empty: No default / minimum / maximum"),text_default_4=document.createTextNode("'today' : current date"),text_default_5=document.createTextNode("Relative date: A number of days/weeks/months/years from today, e.g. '-1d' will be yesterday, '+1y+3m+2w+3d' will be 1 year, 3 months, 2 weeks and 3 days from today."),adding_desc_p_3=document.createElement("p"),adding_desc_b_3=document.createElement("b"),text_default_6=document.createTextNode("Dates to exclude:"),text_default_7=document.createTextNode("Enter comma-separated list of dates and date ranges using the date format 'mm/dd/yy', e.g. 08/15/2016, 06/15/2016-06/20/2016"),default_br_1=document.createElement("br"),default_br_2=document.createElement("br"),default_br_3=document.createElement("br"),default_br_4=document.createElement("br"),default_br_5=document.createElement("br"),default_br_6=document.createElement("br"),default_br_7=document.createElement("br"),dis_past_days="yes"==w_disable_past_days,adding_button=document.createElement("input");adding_button.setAttribute("id",i+"_buttonform_id_temp"),adding_button.setAttribute("class","button"),adding_button.setAttribute("type","hidden"),adding_button.setAttribute("value",w_but_val),adding_button.setAttribute("format",w_format);var main_td=document.getElementById("show_table");div_label.appendChild(label),div_label.appendChild(required),div_element.appendChild(adding_type),div_element.appendChild(adding_required),div_element.appendChild(adding_hide_label),div_element.appendChild(adding_show_image),div_element.appendChild(adding_dis_past_days),div_element.appendChild(adding),div_element.appendChild(adding_image),adding_desc_b.appendChild(text_format_1),adding_desc_p.appendChild(adding_desc_b),adding_desc_p.appendChild(format_br_1),adding_desc_p.appendChild(text_format_2),adding_desc_p.appendChild(format_br_2),adding_desc_p.appendChild(text_format_3),adding_desc_p.appendChild(format_br_3),adding_desc_p.appendChild(text_format_4),adding_desc_p.appendChild(format_br_4),adding_desc_p.appendChild(text_format_5),adding_desc_p.appendChild(format_br_5),adding_desc_p.appendChild(text_format_6),adding_desc_p.appendChild(format_br_6),adding_desc_p.appendChild(text_format_7),adding_desc_p.appendChild(format_br_7),adding_desc_p.appendChild(text_format_8),adding_desc_p.appendChild(format_br_8),adding_desc_p.appendChild(text_format_9),adding_desc_p.appendChild(format_br_9),adding_desc_p.appendChild(text_format_10),adding_desc_p.appendChild(format_br_10),adding_desc_p.appendChild(text_format_11),adding_desc_p.appendChild(format_br_11),adding_desc_p.appendChild(text_format_12),adding_desc_p.appendChild(format_br_12),adding_desc_p.appendChild(text_format_13),adding_desc_p.appendChild(format_br_13),adding_desc_b_2.appendChild(text_default_1),adding_desc_p_2.appendChild(adding_desc_b_2),adding_desc_p_2.appendChild(default_br_1),adding_desc_p_2.appendChild(text_default_2),adding_desc_p_2.appendChild(default_br_2),adding_desc_p_2.appendChild(text_default_3),adding_desc_p_2.appendChild(default_br_3),adding_desc_p_2.appendChild(text_default_4),adding_desc_p_2.appendChild(default_br_4),adding_desc_p_2.appendChild(text_default_5),adding_desc_b_3.appendChild(text_default_6),adding_desc_p_3.appendChild(adding_desc_b_3),adding_desc_p_3.appendChild(default_br_6),adding_desc_p_3.appendChild(text_default_7),adding_desc_p_3.appendChild(default_br_7),div_element.appendChild(adding_default_date),div_element.appendChild(adding_start_day),div_element.appendChild(adding_min_date),div_element.appendChild(adding_max_date),div_element.appendChild(adding_invalid_dates),div_element.appendChild(adding_hide_time),div_element.appendChild(adding_show_days),div_element.appendChild(adding_button),div_field.appendChild(div_label),div_field.appendChild(div_element),div.appendChild(div_field),div.appendChild(br3),div.appendChild(adding_desc_p),div.appendChild(adding_desc_p_2),div.appendChild(adding_desc_p_3),main_td.appendChild(div),"top"==w_field_label_pos&&label_top(i),change_class(w_class,i),refresh_attr(i,"type_text"),jQuery("#"+i+"_elementform_id_temp").datepicker({dateFormat:"mm/dd/yy",minDate:w_min_date,maxDate:w_max_date,firstDay:w_start_day,changeMonth:!0,changeYear:!0,yearRange:"-100:+50",showOtherMonths:!0,selectOtherMonths:!0,beforeShowDay:function(date){for(var invalid_dates=w_invalid_dates,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;iEnable option\'s value'),jQuery(' "))}function refresh_sel_options(i,e){if("checkbox"!=e&&"radio"!=e||(jQuery("#el_disable_value").prop("checked")?(jQuery("#"+i+"_value_disabledform_id_temp").val("yes"),jQuery(".el_option_value").removeAttr("disabled")):(jQuery("#"+i+"_value_disabledform_id_temp").val("no"),jQuery(".el_option_value").attr("disabled","disabled")),refresh_rowcol(i,e)),"select"==e){jQuery("#el_disable_value").prop("checked")?(jQuery("#"+i+"_value_disabledform_id_temp").val("yes"),jQuery(".el_option_value").removeAttr("disabled"),jQuery(".el_option_dis").attr("disabled","disabled")):(jQuery("#"+i+"_value_disabledform_id_temp").val("no"),jQuery(".el_option_value").attr("disabled","disabled"),jQuery(".el_option_dis").removeAttr("disabled"));var a=document.getElementById(i+"_elementform_id_temp");a.innerHTML="",jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id,t=document.createElement("option");t.setAttribute("id",i+"_option"+e),jQuery("#el_disable_value").prop("checked")?t.setAttribute("value",jQuery(this).find(jQuery("input[type='text']"))[1].value):jQuery(this).find(jQuery("input[type='checkbox']")).prop("checked")?t.value="":t.setAttribute("value",jQuery(this).find(jQuery("input[type='text']"))[0].value),jQuery(this).find(jQuery(".el_option_params")).val()&&(w_params=jQuery(this).find(jQuery(".el_option_params")).val().split("[where_order_by]"),t.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),t.setAttribute("order_by",w_params[0]),t.setAttribute("db_info",w_params[1])),t.setAttribute("onselect","set_select('"+i+"_option"+e+"')"),t.innerHTML=jQuery(this).find(jQuery("input[type='text']"))[0].value,a.appendChild(t)})}form_maker.is_demo?jQuery("#el_choices_add").next().attr("onclick","alert('This feature is disabled in demo.')"):jQuery("#el_choices_add").next().attr("onclick","tb_show('', 'admin-ajax.php?action=select_data_from_db&field_id="+i+"&nonce="+fm_ajax.ajaxnonce+"&field_type="+e+"&value_disabled="+jQuery("#"+i+"_value_disabledform_id_temp").val()+"&width=530&height=370&TB_iframe=1');return false;")}function create_select_options(e,t,i,a,l,d){var _=jQuery('Options '),r=jQuery(' Option ');if(form_maker.is_demo)var o=jQuery(' From Database ');else o=jQuery(" From Database ');var m=jQuery('IMPORTANT! Check the "Empty value" checkbox only if you want the option to be considered as empty.
'),s=jQuery('
'),u=jQuery('
');for(s.append(u),n=i.length,j=0;j
');s.append(c)}var p=_;return create_option_container(null,p=(p=(p=(p=p.add(r)).add(o)).add(s)).add(m))}function add_choise(e,t){var i=0;if(jQuery(".change_pos").each(function(){var e=parseInt(jQuery(this)[0].id);i=i
');a.append(n),refresh_rowcol(t,e)}if("select"==e){var l=jQuery("#"+t+"_elementform_id_temp"),d=jQuery('
');l.append(d);a=jQuery("#choices"),n=jQuery('
');a.append(n)}}function change_label_name(e,t,i,a){jQuery("#"+t).html(i),jQuery("#el_disable_value").prop("checked")||(jQuery("#el_choices"+e).attr("other")||jQuery("#el_option_value"+e).val(i),"select"==a&&jQuery("#"+t).val(i))}function change_label_name_on_paste(e,t,i,a){setTimeout(function(){i=elem.value,jQuery("#"+t).html(i),jQuery("#el_disable_value").prop("checked")||(jQuery("#el_choices"+e).attr("other")||jQuery("#el_option_value"+e).val(i),"select"==a&&jQuery("#"+t).val(i))},100)}function change_label_value(e,t){document.getElementById(e).value=t}function change_label_value_on_paste(e,t){setTimeout(function(){label=t.value,document.getElementById(e).value=label},100)}function dis_option(e,t,i){t?(jQuery("#"+e).val(""),jQuery("#el_option_value"+i).val("")):(jQuery("#"+e).val(jQuery("#"+e).html()),jQuery("#el_option_value"+i).val(jQuery("#el_option"+i).val()))}function remove_option(e,t){var i=document.getElementById(t+"_elementform_id_temp"),a=document.getElementById(t+"_option"+e);i.removeChild(a);var n=document.getElementById("choices"),l=document.getElementById(e);n.removeChild(l)}function go_to_type_own_select(e){w_choices=["Select value","option 1","option 2"],w_choices_value=["","option 1","option 2"],w_choices_params=["","",""],w_choices_checked=["1","0","0"],w_choices_disabled=[!0,!1,!1],w_attr_name=[],w_attr_value=[],type_own_select(e,"Select","","top","no","",w_choices,w_choices_checked,"no","no","wdform_select",w_attr_name,w_attr_value,w_choices_disabled,w_choices_value,w_choices_params)}function type_own_select(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y){jQuery("#element_type").val("type_own_select"),delete_last_child();var h=jQuery("#edit_table"),b=jQuery('
');h.append(b);var v=jQuery('
');b.append(v),v.append(create_field_type("type_own_select")),v.append(create_label(i,e)),v.append(create_label_position(i,a)),v.append(create_hide_label(i,l)),v.append(create_required(i,o)),v.append(create_field_size(i,d)),v.append(create_select_options(i,m,_,y,f,p));var w=jQuery('
');v.append(create_advanced_options_container(w)),w.append(create_field_label_size(i,t)),w.append(create_class(i,s)),w.append(create_enable_options_value(i,m,"select")),w.append(create_additional_attributes(i,u,"type_own_select")),n=_.length;var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","type_own_select"),g.setAttribute("name",i+"_typeform_id_temp"),g.setAttribute("id",i+"_typeform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",o),E.setAttribute("name",i+"_requiredform_id_temp"),E.setAttribute("id",i+"_requiredform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",l),A.setAttribute("name",i+"_hide_labelform_id_temp"),A.setAttribute("id",i+"_hide_labelform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",m),x.setAttribute("name",i+"_value_disabledform_id_temp"),x.setAttribute("id",i+"_value_disabledform_id_temp");var k=document.createElement("div");k.setAttribute("id","main_div");var I=document.createElement("div");I.setAttribute("id",i+"_elemet_tableform_id_temp");var C="yes"==l?"none":"table-cell",B=document.createElement("div");B.setAttribute("align","left"),B.style.display=C,B.style.width=t+"px",B.setAttribute("id",i+"_label_sectionform_id_temp");var Q=document.createElement("div");Q.setAttribute("align","left"),Q.style.display="table-cell",Q.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var T=document.createElement("br"),M=(document.createElement("br"),document.createElement("div"));M.setAttribute("id",i+"_table_little"),M.style.display="table";var L=document.createElement("div");L.setAttribute("id",i+"_element_tr1"),L.style.display="table-row";var z=document.createElement("div");z.setAttribute("id",i+"_element_tr2"),z.style.display="table-row";var q=document.createElement("div");q.setAttribute("valign","top"),q.setAttribute("id",i+"_td_little1"),q.style.display="table-cell";var H=document.createElement("div");H.setAttribute("valign","top"),H.setAttribute("id",i+"_td_little2"),H.style.display="table-cell";var N=document.createElement("span");N.setAttribute("id",i+"_element_labelform_id_temp"),N.innerHTML=e,N.setAttribute("class","label"),N.style.verticalAlign="top";var S=document.createElement("span");S.setAttribute("id",i+"_required_elementform_id_temp"),S.innerHTML="",S.setAttribute("class","required"),S.style.verticalAlign="top","yes"==o&&(S.innerHTML=" *");var D=document.createElement("select");for(D.setAttribute("id",i+"_elementform_id_temp"),D.setAttribute("name",i+"_elementform_id_temp"),D.style.cssText="width:"+d+"px",D.setAttribute("onchange","set_select(this)"),j=0;j
Relative Position'),n=jQuery(' "),l=jQuery('Vertical '),d=jQuery(' "),_=jQuery('Horizontal '),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function refresh_rowcol(l,d){document.getElementById("edit_for_rowcol").value||(document.getElementById("edit_for_rowcol").value=1),document.getElementById(l+"_rowcol_numform_id_temp").value=document.getElementById("edit_for_rowcol").value;var _=document.getElementById(l+"_table_little");if(_.removeAttribute("for_hor"),_.innerHTML="",choeices=jQuery(".change_pos").length,1==document.getElementById("edit_for_flow_vertical").checked){var n=document.getElementById("edit_for_rowcol").value,r=parseInt((choeices+1)/n),o=0,m=1;tr_row=document.createElement("div"),tr_row.setAttribute("id",l+"_element_tr0"),tr_row.style.display="table-row",jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id;n<=o&&(o=0,tr_row=document.createElement("div"),tr_row.setAttribute("id",l+"_element_tr"+m),tr_row.style.display="table-row",m++);var t=document.createElement("div");t.setAttribute("valign","top"),t.setAttribute("id",l+"_td_little"+e),t.setAttribute("idi",e),t.style.display="table-cell";var i=document.createElement("input");i.setAttribute("type",d),i.setAttribute("id",l+"_elementform_id_temp"+e),"checked"==jQuery("#"+l+"_elementform_id_temp"+e).attr("checked")&&i.setAttribute("checked","checked"),"right"==document.getElementById(l+"_option_left_right").value&&(i.style.cssText="float: left !important"),"checkbox"==d&&(i.setAttribute("name",l+"_elementform_id_temp"+e),"yes"==document.getElementById(l+"_allow_otherform_id_temp").value&&"1"==jQuery(this).find("#el_choices"+e).attr("other")?(i.setAttribute("value",""),i.setAttribute("other","1"),i.setAttribute("onclick","if(set_checked('"+l+"','"+e+"','form_id_temp')) show_other_input('"+l+"','form_id_temp');")):("no"==document.getElementById(l+"_value_disabledform_id_temp").value?i.setAttribute("value",jQuery(this).find("#el_choices"+e).val()):i.setAttribute("value",jQuery(this).find("#el_option_value"+e).val()),i.setAttribute("onclick","set_checked('"+l+"','"+e+"','form_id_temp')"))),"radio"==d&&(i.setAttribute("name",l+"_elementform_id_temp"),"yes"==document.getElementById(l+"_allow_otherform_id_temp").value&&"1"==jQuery(this).find("#el_choices"+e).attr("other")?(i.setAttribute("value",""),i.setAttribute("other","1"),i.setAttribute("onClick","set_default('"+l+"','"+e+"','form_id_temp'); show_other_input('"+l+"','form_id_temp');")):("no"==document.getElementById(l+"_value_disabledform_id_temp").value?i.setAttribute("value",jQuery(this).find("#el_choices"+e).val()):i.setAttribute("value",jQuery(this).find("#el_option_value"+e).val()),i.setAttribute("onClick","set_default('"+l+"','"+e+"','form_id_temp')")));var a=document.createElement("label");a.setAttribute("id",l+"_label_element"+e),a.setAttribute("class","ch-rad-label"),a.setAttribute("for",l+"_elementform_id_temp"+e),a.innerHTML=jQuery(this).find("#el_choices"+e).val(),"right"==document.getElementById(l+"_option_left_right").value&&(a.style.cssText="float: none !important"),jQuery(this).find("#el_option_params"+e).val()&&(w_params=jQuery(this).find("#el_option_params"+e).val().split("[where_order_by]"),a.setAttribute("where",w_params[0]),w_params=w_params[1].split("[db_info]"),a.setAttribute("order_by",w_params[0]),a.setAttribute("db_info",w_params[1])),t.appendChild(a),t.appendChild(i),tr_row.appendChild(t),_.appendChild(tr_row),o++})}else{r=document.getElementById("edit_for_rowcol").value,n=parseInt((choeices+1)/r),o=0,m=0;jQuery(".change_pos").each(function(e){var t=jQuery(this)[0].id;oOption Label Position'),n=jQuery(' "),l=jQuery('Left '),d=jQuery(' "),_=jQuery('Right '),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function option_right(e,t){jQuery("#"+e+"_table_little").find(jQuery(".ch-rad-label")).css("cssText","float: none !important;"),jQuery("#"+e+"_table_little").find(jQuery('#main_div input[type="'+t+'"]')).css("cssText","float: left !important;"),jQuery("#"+e+"_option_left_right").val("right")}function option_left(e,t){jQuery("#"+e+"_table_little").find(jQuery(".ch-rad-label")).css("cssText","float: left !important;"),jQuery("#"+e+"_table_little").find(jQuery('#main_div input[type="'+t+'"]')).css("cssText","float: right !important;"),jQuery("#"+e+"_option_left_right").val("left")}function create_rowcol(e,t,i){return create_option_container(jQuery('Rows/Columns '),jQuery(' '))}function create_randomize(e,t){return create_option_container(jQuery('Randomize in frontend '),jQuery(' "))}function set_randomize(e){"yes"==document.getElementById(e).value?document.getElementById(e).setAttribute("value","no"):document.getElementById(e).setAttribute("value","yes")}function create_allow_other(e,t,i){return create_option_container(jQuery('Allow other '),jQuery(' "))}function set_allow_other(t,i){if("yes"==document.getElementById(t+"_allow_otherform_id_temp").value)document.getElementById(t+"_allow_otherform_id_temp").setAttribute("value","no"),jQuery(".change_pos").each(function(){var e=jQuery(this)[0].id;if(document.getElementById("el_choices"+e)&&document.getElementById("el_choices"+e).getAttribute("other")&&1==document.getElementById("el_choices"+e).getAttribute("other"))return remove_choise(e,t,i),!1});else{document.getElementById(t+"_allow_otherform_id_temp").setAttribute("value","yes");var a=0;jQuery(".change_pos").each(function(){var e=parseInt(jQuery(this)[0].id);a=a
');e.append(n),refresh_rowcol(t,i)}}function create_radio_options(e,t,i,a,l,d,_,r,o){var m=jQuery('
Options '),s=jQuery('
Option');if(form_maker.is_demo)var u=jQuery('
From Database');else u=jQuery("
From Database');var c=jQuery('
'),p=jQuery('
');for(c.append(p),aaa=!1,n=i.length,j=0;j
'+("yes"==d&&j==_?"":' ")+'
');c.append(f),1==r[j]&&"yes"==d&&j==_&&(aaa=!0)}var y=m;return create_option_container(null,y=(y=(y=y.add(s)).add(u)).add(c))}function remove_choise(e,t,i){var a=document.getElementById("choices"),n=document.getElementById(e);a.removeChild(n),refresh_rowcol(t,i)}function type_radio(i,e,t,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v){jQuery("#element_type").val("type_radio"),delete_last_child();var w=jQuery("#edit_table"),g=jQuery('
');w.append(g);var E=jQuery('
');g.append(E),E.append(create_field_type("type_radio")),E.append(create_label(i,e)),E.append(create_label_position(i,a)),E.append(create_hide_label(i,l)),E.append(create_required(i,m)),E.append(create_relative_position(i,d,"radio")),E.append(create_option_label_position(i,n,"radio")),E.append(create_radio_options(i,h,_,v,b,u,c,r,"radio"));var A=jQuery('
');E.append(create_advanced_options_container(A)),A.append(create_field_label_size(i,t)),A.append(create_class(i,p)),A.append(create_rowcol(i,o,"radio")),A.append(create_randomize(i,s)),A.append(create_enable_options_value(i,h,"radio")),A.append(create_allow_other(i,u,"radio")),A.append(create_additional_attributes(i,f,"type_radio")),element="input",type="radio";var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value","type_radio"),j.setAttribute("name",i+"_typeform_id_temp"),j.setAttribute("id",i+"_typeform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",m),x.setAttribute("name",i+"_requiredform_id_temp"),x.setAttribute("id",i+"_requiredform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",l),k.setAttribute("name",i+"_hide_labelform_id_temp"),k.setAttribute("id",i+"_hide_labelform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",i+"_randomizeform_id_temp"),I.setAttribute("id",i+"_randomizeform_id_temp");var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value",u),C.setAttribute("name",i+"_allow_otherform_id_temp"),C.setAttribute("id",i+"_allow_otherform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",o),B.setAttribute("name",i+"_rowcol_numform_id_temp"),B.setAttribute("id",i+"_rowcol_numform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",n),Q.setAttribute("id",i+"_option_left_right");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",h),T.setAttribute("name",i+"_value_disabledform_id_temp"),T.setAttribute("id",i+"_value_disabledform_id_temp");var M=document.createElement("div");M.setAttribute("id","main_div");var L=document.createElement("div");L.setAttribute("id",i+"_elemet_tableform_id_temp");var z="yes"==l?"none":"table-cell",q=document.createElement("div");q.setAttribute("align","left"),q.style.display=z,q.style.width=t+"px",q.setAttribute("id",i+"_label_sectionform_id_temp");var H=document.createElement("div");H.setAttribute("align","left"),H.style.display="table-cell",H.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var N=document.createElement("br"),S=(document.createElement("br"),document.createElement("div"));S.style.display="table";var D=document.createElement("div");D.setAttribute("id",i+"_table_little"),D.style.display="table-row-group",S.appendChild(D);var P=document.createElement("div");P.setAttribute("id",i+"_element_tr1"),P.style.display="table-row";var O=document.createElement("div");O.setAttribute("id",i+"_element_tr2"),O.style.display="table-row";var K=document.createElement("div");K.setAttribute("valign","top"),K.setAttribute("id",i+"_td_little1"),K.style.display="table-cell";var U=document.createElement("div");U.setAttribute("valign","top"),U.setAttribute("id",i+"_td_little2"),U.style.display="table-cell";var F=document.createElement("span");F.setAttribute("id",i+"_element_labelform_id_temp"),F.innerHTML=e,F.setAttribute("class","label"),F.style.verticalAlign="top";var R=document.createElement("span");R.setAttribute("id",i+"_required_elementform_id_temp"),R.innerHTML="",R.setAttribute("class","required"),R.style.verticalAlign="top","yes"==m&&(R.innerHTML=" *");var W=document.getElementById("show_table");q.appendChild(F),q.appendChild(R),H.appendChild(j),H.appendChild(x),H.appendChild(k),H.appendChild(I),H.appendChild(C),H.appendChild(B),H.appendChild(Q),H.appendChild(T),H.appendChild(S),L.appendChild(q),L.appendChild(H),M.appendChild(L),M.appendChild(N),W.appendChild(M),jQuery("#main_div").append(form_maker.type_radio_description),"top"==a&&label_top(i),change_class(p,i),refresh_rowcol(i,"radio"),aaa&&show_other_input(i),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_rowcol(i,"radio")}})})}function type_checkbox(i,e,t,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v){jQuery("#element_type").val("type_checkbox"),delete_last_child();var w=jQuery("#edit_table"),g=jQuery('
');w.append(g);var E=jQuery('
');g.append(E),E.append(create_field_type("type_checkbox")),E.append(create_label(i,e)),E.append(create_label_position(i,a)),E.append(create_hide_label(i,l)),E.append(create_required(i,m)),E.append(create_relative_position(i,d,"checkbox")),E.append(create_option_label_position(i,n,"checkbox")),E.append(create_radio_options(i,h,_,v,b,u,c,r,"checkbox"));var A=jQuery('
');E.append(create_advanced_options_container(A)),A.append(create_field_label_size(i,t)),A.append(create_class(i,p)),A.append(create_rowcol(i,o,"checkbox")),A.append(create_randomize(i,s)),A.append(create_enable_options_value(i,h,"checkbox")),A.append(create_allow_other(i,u,"checkbox")),A.append(create_additional_attributes(i,f,"type_checkbox")),element="input",type="checkbox";var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value","type_checkbox"),j.setAttribute("name",i+"_typeform_id_temp"),j.setAttribute("id",i+"_typeform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",m),x.setAttribute("name",i+"_requiredform_id_temp"),x.setAttribute("id",i+"_requiredform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",l),k.setAttribute("name",i+"_hide_labelform_id_temp"),k.setAttribute("id",i+"_hide_labelform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",i+"_randomizeform_id_temp"),I.setAttribute("id",i+"_randomizeform_id_temp");var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value",u),C.setAttribute("name",i+"_allow_otherform_id_temp"),C.setAttribute("id",i+"_allow_otherform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",c),B.setAttribute("name",i+"_allow_other_numform_id_temp"),B.setAttribute("id",i+"_allow_other_numform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",o),Q.setAttribute("name",i+"_rowcol_numform_id_temp"),Q.setAttribute("id",i+"_rowcol_numform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",n),T.setAttribute("id",i+"_option_left_right");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",h),M.setAttribute("name",i+"_value_disabledform_id_temp"),M.setAttribute("id",i+"_value_disabledform_id_temp");var L=document.createElement("div");L.setAttribute("id","main_div");var z=document.createElement("div");z.setAttribute("id",i+"_elemet_tableform_id_temp");var q="yes"==l?"none":"table-cell",H=document.createElement("div");H.setAttribute("align","left"),H.style.display=q,H.style.width=t+"px",H.setAttribute("id",i+"_label_sectionform_id_temp");var N=document.createElement("div");N.setAttribute("align","left"),N.style.display="table-cell",N.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var S=document.createElement("br"),D=(document.createElement("br"),document.createElement("div"));D.style.display="table";var P=document.createElement("div");P.setAttribute("id",i+"_table_little"),P.style.display="table-row-group",D.appendChild(P);var O=document.createElement("span");O.setAttribute("id",i+"_element_labelform_id_temp"),O.innerHTML=e,O.setAttribute("class","label"),O.style.verticalAlign="top";var K=document.createElement("span");K.setAttribute("id",i+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),K.style.verticalAlign="top","yes"==m&&(K.innerHTML=" *");var U=document.getElementById("show_table");H.appendChild(O),H.appendChild(K),N.appendChild(j),N.appendChild(x),N.appendChild(k),N.appendChild(I),N.appendChild(C),N.appendChild(B),N.appendChild(Q),N.appendChild(T),N.appendChild(M),N.appendChild(D),z.appendChild(H),z.appendChild(N),L.appendChild(z),L.appendChild(S),U.appendChild(L),jQuery("#main_div").append(form_maker.type_checkbox_description),"top"==a&&label_top(i),change_class(p,i),refresh_rowcol(i,"checkbox"),aaa&&show_other_input(i),jQuery(function(){jQuery("#choices").sortable({items:".change_pos",handle:".el_choices_sortable",update:function(e,t){refresh_rowcol(i,"checkbox")}})})}function create_keys(e,t){jQuery('Keys ');return create_option_container(null,jQuery(''+t+" "))}function create_recaptcha_invisible(e,t){var i=jQuery('Type '),a=jQuery(' "),n=jQuery('reCAPTCHA v2 (checkbox) '),l=jQuery(' "),d=jQuery('reCAPTCHA v2 (invisible) '),_=jQuery(' "),r=jQuery('reCAPTCHA v3 '),o=a;return create_option_container(i,o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.add(n)).add(jQuery(" "))).add(jQuery('Validate users with the "I\'m not a robot" checkbox. '))).add(jQuery(" "))).add(l)).add(d)).add(jQuery(" "))).add(jQuery('Validate users in the background. '))).add(jQuery(" "))).add(_)).add(r)).add(jQuery(" "))).add(jQuery('Verify requests with a score. ')))}function fm_recaptcha_type(e,t){jQuery("#wd_recaptchaform_id_temp").attr("w_type",t),"invisible"==t?(jQuery("#recaptcha_position").show(),jQuery("#recaptcha_keys_message").show(),jQuery("#recaptcha_advanced").hide(),jQuery("#recaptcha_score").hide(),jQuery("#"+e+"_hide_labelform_id_temp").val("no"),jQuery("#el_hide_label").attr("checked","checked"),hide_label(e)):"v3"==t?(jQuery("#recaptcha_score").show(),jQuery("#recaptcha_keys_message").show(),jQuery("#recaptcha_advanced").hide(),jQuery("#recaptcha_position").hide(),jQuery("#"+e+"_hide_labelform_id_temp").val("no"),jQuery("#el_hide_label").attr("checked","checked"),hide_label(e)):(jQuery("#recaptcha_position").hide(),jQuery("#recaptcha_score").hide(),jQuery("#recaptcha_keys_message").hide(),jQuery("#recaptcha_advanced").show())}function create_recaptcha_score(e,t,i){return create_option_container(jQuery('Score '),'ReCaptcha v3 returns a score based on the user interactions with your forms. Scores range from 0.0 to 1.0, with 0.0 indicating abusive traffic and 1.0 indicating good traffic. To change recaptcha score click here ',"recaptcha_score","v3"==i)}function create_recaptcha_position(e,t,i){var a=jQuery('Display '),n=jQuery(' "),l=jQuery('Hidden '),d=jQuery(' "),_=jQuery('Inline '),r=jQuery(' "),o=jQuery('Bottom-Right '),m=jQuery(' "),s=jQuery('Bottom-Left '),u=n;return create_option_container(a,u=(u=(u=(u=(u=(u=(u=(u=(u=(u=u.add(l)).add(jQuery(" "))).add(d)).add(_)).add(jQuery(" "))).add(r)).add(o)).add(jQuery(" "))).add(m)).add(s),"recaptcha_position","invisible"==i)}function fm_recaptcha_position(e,t){jQuery("#wd_recaptchaform_id_temp").attr("position",t)}function go_to_type_recaptcha(e){type_recaptcha(e,"reCAPTCHA","","top","yes","invisible","bottomright",.5)}function type_recaptcha(e,t,i,a,n,l,d,_){jQuery("#element_type").val("type_recaptcha"),delete_last_child();var r=jQuery("#edit_table"),o=jQuery('
');r.append(o);var m=jQuery('
');o.append(m),m.append(create_field_type("type_recaptcha")),m.append(create_recaptcha_invisible(e,l)),m.append(create_recaptcha_position(e,d,l)),m.append(create_recaptcha_score(e,_,l)),m.append(create_keys(e,"To set up recaptcha keys click here"));var s=jQuery('
'),u=!1;"invisible"!=l&&"v3"!=l&&(u=!0),m.append(create_advanced_options_container(s,"recaptcha_advanced",u)),s.append(create_label(e,t)),s.append(create_label_position(e,a)),s.append(create_hide_label(e,n)),s.append(create_field_label_size(e,i)),element="img",type="captcha";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("value","type_recaptcha"),c.setAttribute("name",e+"_typeform_id_temp"),c.setAttribute("id",e+"_typeform_id_temp");var p=document.createElement("input");p.setAttribute("type","hidden"),p.setAttribute("value",n),p.setAttribute("name",e+"_hide_labelform_id_temp"),p.setAttribute("id",e+"_hide_labelform_id_temp");var f=document.createElement("div");f.setAttribute("id","recaptcha_keys_message"),f.setAttribute("class","error"),f.innerHTML=form_maker.invisible_recaptcha_error;var y=document.createElement("div");y.setAttribute("id","wd_recaptchaform_id_temp"),y.setAttribute("w_type",l),y.setAttribute("position",d);var h=document.createElement("span");h.style.color="red",h.style.fontStyle="italic",h.innerHTML=form_maker.no_preview,y.appendChild(h);var b=document.createElement("div");b.setAttribute("id","main_div");var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==n?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var A=document.createElement("br"),j=(document.createElement("br"),document.createElement("span"));j.setAttribute("id",e+"_element_labelform_id_temp"),j.innerHTML=t,j.setAttribute("class","label"),j.style.verticalAlign="top";var x=document.getElementById("show_table");g.appendChild(j),E.appendChild(c),E.appendChild(p),E.appendChild(y),v.appendChild(f),v.appendChild(g),v.appendChild(E),b.appendChild(v),b.appendChild(A),x.appendChild(b),jQuery("#main_div").append(form_maker.type_recaptcha_description),"top"==a&&label_top(e),"v2"==jQuery("input[name='edit_for_recaptcha_type']:checked").val()&&jQuery("#recaptcha_keys_message").hide()}function create_submit_label(e,t){return create_option_container(jQuery('Submit label '),jQuery(' '))}function create_display_reset(e,t){return create_option_container(jQuery('Display Reset '),jQuery(' "))}function active_reset(e,t){document.getElementById(t+"_element_resetform_id_temp").style.display=e?"inline":"none"}function create_reset_label(e,t){return create_option_container(jQuery('Reset label '),jQuery(' '))}function go_to_type_submit_reset(e){w_attr_name=[],w_attr_value=[],type_submit_reset(e,"Submit","Reset","",!0,w_attr_name,w_attr_value)}function type_submit_reset(e,t,i,a,n,l,d){jQuery("#element_type").val("type_submit_reset"),delete_last_child();var _=jQuery("#edit_table"),r=jQuery('
');_.append(r);var o=jQuery('
');r.append(o),o.append(create_field_type("type_submit_reset")),o.append(create_submit_label(e,t)),o.append(create_display_reset(e,n)),o.append(create_reset_label(e,i));var m=jQuery('
');o.append(create_advanced_options_container(m)),m.append(create_class(e,a)),m.append(create_additional_attributes(e,l,"type_submit_reset"));var s=document.createElement("br"),u=document.createElement("input");u.setAttribute("type","hidden"),u.setAttribute("value","type_submit_reset"),u.setAttribute("name",e+"_typeform_id_temp"),u.setAttribute("id",e+"_typeform_id_temp");var c=document.createElement("button");c.setAttribute("type","button"),c.setAttribute("class","button button-secondary button-hero button-submit"),c.setAttribute("id",e+"_element_submitform_id_temp"),c.setAttribute("value",t),c.innerHTML=t,c.setAttribute("disabled","disabled");var p=document.createElement("button");p.setAttribute("type","button"),p.setAttribute("class","button button-secondary button-hero button-reset"),n||(p.style.display="none"),p.setAttribute("id",e+"_element_resetform_id_temp"),p.setAttribute("value",i),p.setAttribute("disabled","disabled"),p.innerHTML=i;var f=document.createElement("div");f.setAttribute("id","main_div");var y=document.createElement("div");y.setAttribute("id",e+"_elemet_tableform_id_temp");var h=document.createElement("div");h.setAttribute("align","left"),h.style.display="table-cell",h.setAttribute("id",e+"_label_sectionform_id_temp");var b=document.createElement("div");b.setAttribute("align","left"),b.style.display="table-cell",b.setAttribute("id",e+"_element_sectionform_id_temp");var v=document.createElement("span");v.setAttribute("id",e+"_element_labelform_id_temp"),v.style.cssText="display:none",v.innerHTML="type_submit_reset_"+e;var w=document.getElementById("show_table");h.appendChild(v),b.appendChild(u),b.appendChild(c),b.appendChild(p),y.appendChild(h),y.appendChild(b),f.appendChild(y),f.appendChild(s),w.appendChild(f),jQuery("#main_div").append(form_maker.type_submit_description),change_class(a,e),refresh_attr(e,"type_submit_reset")}function type_editor(e,t){jQuery("#element_type").val("type_editor"),delete_last_child();var i=jQuery("#edit_table"),a=jQuery('
');i.append(a);var n,l=jQuery('
');a.append(l),l.append(create_field_type("type_editor")),iReturnLeft=jQuery("#edit_table").offset().left,document.getElementById("main_editor").style.display="block",document.getElementById("main_editor").style.left=iReturnLeft+15+"px",document.getElementById("main_editor").style.top="120px",document.getElementById("main_editor").style.width=jQuery("#edit_table").width()-30+"px",document.getElementById("form_maker_editor_ifr")&&"none"==document.getElementById("form_maker_editor").style.display?(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=t):document.getElementById("form_maker_editor").value=t,(n=document.createElement("div")).setAttribute("id","main_div"),document.getElementById("show_table").appendChild(n),(n=document.createElement("div")).style.width="500px",document.getElementById("edit_table").appendChild(n)}function type_section_break(e,t){jQuery("#element_type").val("type_section_break"),delete_last_child();var i=jQuery("#edit_table"),a=jQuery('
');i.append(a);var n,l=jQuery('
');a.append(l),l.append(create_field_type("type_section_break")),iReturnLeft=jQuery("#edit_table").offset().left,document.getElementById("main_editor").style.display="block",document.getElementById("main_editor").style.left=iReturnLeft+15+"px",document.getElementById("main_editor").style.top="120px",document.getElementById("main_editor").style.width=jQuery("#edit_table").width()-30+"px",document.getElementById("form_maker_editor_ifr")&&"none"==document.getElementById("form_maker_editor").style.display?(ifr_id="form_maker_editor_ifr",ifr=getIFrameDocument(ifr_id),ifr.body.innerHTML=t):document.getElementById("form_maker_editor").value=t,element="div",(n=document.createElement("div")).setAttribute("id","main_div"),document.getElementById("show_table").appendChild(n),(n=document.createElement("div")).style.width="500px",document.getElementById("edit_table").appendChild(n)}function create_page_title(e,t){return create_option_container(jQuery('Page Title '),jQuery(' '))}function pagebreak_title_change(e){e=e.replace(/(<([^>]+)>)/gi,""),document.getElementById("_div_between").setAttribute("page_title",e),document.getElementById("div_page_title").innerHTML=e+" "}function create_next_type(e,t){var i=jQuery('Next Type '),a=jQuery(' "),n=jQuery('Text '),l=jQuery(' "),d=jQuery('Image '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function pagebreak_type_change(e,t){switch(document.getElementById("_div_between").setAttribute(e+"_type",t),t){case"button":document.getElementById("_div_between").setAttribute(e+"_title",e),(i=document.createElement("label")).setAttribute("class","fm-field-label"),i.setAttribute("for","el_title_"+e),i.setAttribute("id",e+"_label"),i.setAttribute("type","button"),i.innerHTML=e[0].toUpperCase()+e.slice(1)+" "+t+" name",document.getElementById(e+"_label").parentNode.replaceChild(i,document.getElementById(e+"_label")),document.getElementById("el_title_"+e).value=e,(a=document.createElement("button")).setAttribute("id","page_"+e+"_0"),a.setAttribute("class",document.getElementById("_div_between").getAttribute(e+"_class")),a.style.cursor="pointer",a.innerHTML=e,document.getElementById("_element_section_"+e).replaceChild(a,document.getElementById("page_"+e+"_0"));break;case"text":document.getElementById("_div_between").setAttribute(e+"_title",e),(i=document.createElement("label")).setAttribute("class","fm-field-label"),i.setAttribute("for","el_title_"+e),i.setAttribute("id",e+"_label"),i.innerHTML=e[0].toUpperCase()+e.slice(1)+" "+t+" name",document.getElementById(e+"_label").parentNode.replaceChild(i,document.getElementById(e+"_label")),document.getElementById("el_title_"+e).value=e[0].toUpperCase()+e.slice(1),(a=document.createElement("span")).setAttribute("id","page_"+e+"_0"),a.setAttribute("class",document.getElementById("_div_between").getAttribute(e+"_class")),a.style.cursor="pointer",a.innerHTML=e[0].toUpperCase()+e.slice(1),document.getElementById("_element_section_"+e).replaceChild(a,document.getElementById("page_"+e+"_0"));break;case"img":var i,a;document.getElementById("_div_between").setAttribute(e+"_title",plugin_url+"/images/"+e+".png"),(i=document.createElement("label")).setAttribute("class","fm-field-label"),i.setAttribute("for","el_title_"+e),i.setAttribute("id",e+"_label"),i.innerHTML=e[0].toUpperCase()+e.slice(1)+" "+t+" src",document.getElementById(e+"_label").parentNode.replaceChild(i,document.getElementById(e+"_label")),document.getElementById("el_title_"+e).value=plugin_url+"/images/"+e+".png",(a=document.createElement("img")).setAttribute("id","page_"+e+"_0"),a.setAttribute("class",document.getElementById("_div_between").getAttribute(e+"_class")),a.style.cursor="pointer",a.src=plugin_url+"/images/"+e+".png",document.getElementById("_element_section_"+e).replaceChild(a,document.getElementById("page_"+e+"_0"))}}function create_next_text_name(e,t){return create_option_container(jQuery('Next text name '),jQuery(' '))}function change_pagebreak_label(e,t){button_type=document.getElementById("_div_between").getAttribute(t+"_type"),"img"!=button_type?(document.getElementById("page_"+t+"_0").value=e,document.getElementById("page_"+t+"_0").innerHTML=e):document.getElementById("page_"+t+"_0").src=e,document.getElementById("_div_between").setAttribute(t+"_title",e)}function create_check_required_next(e,t){return create_option_container(jQuery('Check the required fields '),jQuery(' "))}function set_checkable(e){document.getElementById("_div_between").setAttribute(e+"_checkable",document.getElementById("el_check_"+e+"_input").checked)}function create_previous_type(e,t){var i=jQuery('Previous Type '),a=jQuery(' "),n=jQuery('Text '),l=jQuery(' "),d=jQuery('Image '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_previous_text_name(e,t){return create_option_container(jQuery('Previous text name '),jQuery(' '))}function create_check_required_previous(e,t){return create_option_container(jQuery('Check the required fields '),jQuery(' "))}function create_next_class(e,t){return create_option_container(jQuery('Next class '),jQuery(' '))}function create_previous_class(e,t){return create_option_container(jQuery('Previous class '),jQuery(' '))}function change_pagebreak_class(e,t){document.getElementById("page_"+t+"_0").setAttribute("class",e),document.getElementById("_div_between").setAttribute(t+"_class",e)}function type_page_break(e,t,i,a,n,l,d,_){jQuery("#element_type").val("type_page_break"),delete_last_child();var r=jQuery("#edit_table"),o=jQuery('
');r.append(o);var m=jQuery('
');o.append(m),m.append(create_field_type("type_page_break")),m.append(create_page_title(e,t)),m.append(create_next_type(e,a)),m.append(create_next_text_name(e,i)),m.append(create_check_required_next(e,l)),m.append(create_previous_type(e,a)),m.append(create_previous_text_name(e,i)),m.append(create_check_required_previous(e,l));var s=jQuery('
');m.append(create_advanced_options_container(s)),s.append(create_next_class(e,n)),s.append(create_previous_class(e,n)),s.append(create_additional_attributes(e,d,"type_page_break"));var u=document.createElement("br"),c=document.createElement("div");c.setAttribute("id","main_div");var p=document.createElement("div");p.setAttribute("id",e+"_elemet_tableform_id_temp");var f=document.createElement("div");f.setAttribute("align","left"),f.style.display="table-cell",f.setAttribute("id",e+"_label_sectionform_id_temp");var y=document.createElement("div");y.setAttribute("align","left"),y.style.display="table-cell",y.setAttribute("id",e+"_element_sectionform_id_temp");var h=document.createElement("div");h.setAttribute("align","right"),h.setAttribute("id","_element_section_next");var b=make_pagebreak_button("next",i[0],a[0],n[0],0);h.appendChild(b);var v=document.createElement("div");v.setAttribute("align","left"),v.setAttribute("id","_element_section_previous");var w=make_pagebreak_button("previous",i[1],a[1],n[1],0);v.appendChild(w);var g=document.createElement("div");g.setAttribute("align","center"),g.setAttribute("style","border:2px solid blue;padding:20px; margin:20px"),g.innerHTM="FIELDS";var E=document.createElement("div");E.innerHTML=t+" ",E.setAttribute("id","div_page_title"),E.setAttribute("align","center");var A=document.createElement("div");A.setAttribute("page_title",t),A.setAttribute("next_type",a[0]),A.setAttribute("next_title",i[0]),A.setAttribute("next_class",n[0]),A.setAttribute("next_checkable",l[0]),A.setAttribute("previous_type",a[1]),A.setAttribute("previous_title",i[1]),A.setAttribute("previous_class",n[1]),A.setAttribute("previous_checkable",l[1]),A.setAttribute("align","center"),A.setAttribute("id","_div_between"),A.innerHTML="-------------------------------------- P A G E B R E A K --------------------------------------",y.appendChild(E),y.appendChild(g),y.appendChild(h),y.appendChild(A),y.appendChild(v);var j=document.getElementById("show_table");p.appendChild(y),c.appendChild(p),c.appendChild(u),j.appendChild(c),refresh_attr(e,"type_page_break")}function make_pagebreak_button(e,t,i,a,n){switch(i){case"button":return(l=document.createElement("button")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("type","button"),l.setAttribute("class",a),l.style.cursor="pointer",l.innerHTML=t,l;case"text":return(l=document.createElement("span")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("class",a),l.style.cursor="pointer",l.innerHTML=t,l;case"img":var l;return(l=document.createElement("img")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("class",a),l.style.cursor="pointer",l.src=t,l}}function create_placeholder_name(e,t){return create_option_container(jQuery('Placeholder '),jQuery(' - '))}function create_field_size_name(e,t){return create_option_container(jQuery('Width(px) '),jQuery(''+form_maker.leave_empty+"
"))}function create_enable_name_fields(e,t,i){var a=jQuery('Enable Field(s) '),n=jQuery(' "),l=jQuery(''+i[0]+" "),d=jQuery(' "),_=jQuery(''+i[3]+" "),r=jQuery(''+i[1]+' '+i[2]+" "),o=n;return create_option_container(a,o=(o=(o=(o=o.add(l)).add(d)).add(_)).add(r))}function enable_name_fields(t,e){var i="title"==e?2:3;tr_name1=document.getElementById(t+"_tr_name1"),tr_name2=document.getElementById(t+"_tr_name2"),first_input=document.getElementById(t+"_td_name_input_first"),first_label=document.getElementById(t+"_td_name_label_first");var a="title"==e?"40":document.getElementById("edit_for_input_size").value;if(1==document.getElementById("el_"+e).checked?document.getElementById(t+"_enable_fieldsform_id_temp").setAttribute(e,"yes"):document.getElementById(t+"_enable_fieldsform_id_temp").setAttribute(e,"no"),"yes"==document.getElementById(t+"_enable_fieldsform_id_temp").getAttribute(e)){var n=document.createElement("div");n.setAttribute("id",t+"_td_name_input_"+e),n.style.cssText="display:table-cell";var l=document.createElement("input");l.setAttribute("type","text"),w_title[i]==w_first_val[i]?(l.setAttribute("value",w_first_val[i]),l.setAttribute("placeholder",w_title[i])):l.setAttribute("value",w_first_val[i]),l.setAttribute("id",t+"_element_"+e+"form_id_temp"),l.setAttribute("name",t+"_element_"+e+"form_id_temp"),l.setAttribute("value",w_first_val[i]),l.setAttribute("title",w_title[i]),l.setAttribute("placeholder",w_title[i]),l.style.cssText="margin-right: 10px; width: "+a+"px";var d=document.createElement("div");d.setAttribute("id",t+"_td_name_label_"+e),d.style.cssText="display:table-cell";var _=document.createElement("label");_.setAttribute("class","mini_label"),_.setAttribute("id",t+"_mini_label_"+e),_.innerHTML=document.getElementById("el_"+e+"_label").innerHTML,n.appendChild(l),d.appendChild(_),"title"==e?(tr_name1.insertBefore(n,first_input),tr_name2.insertBefore(d,first_label)):(tr_name1.appendChild(n),tr_name2.appendChild(d))}else document.getElementById(t+"_td_name_input_"+e)&&(tr_name1.removeChild(document.getElementById(t+"_td_name_input_"+e)),tr_name2.removeChild(document.getElementById(t+"_td_name_label_"+e)));var r=document.createTextNode("-"),o=document.createTextNode("-");value_if_empty_width="title"==e?"60":"95";var m=document.createElement("input");m.setAttribute("id","el_first_value_"+e),m.setAttribute("type","text"),m.setAttribute("value",w_title[i]),m.style.cssText="width:"+value_if_empty_width+"px;",m.setAttribute("onKeyUp","change_input_value(this.value,'"+t+"_element_"+e+"form_id_temp')"),el_first_value_first=document.getElementById("el_first_value_first"),parent=el_first_value_first.parentNode,"yes"==document.getElementById(t+"_enable_fieldsform_id_temp").getAttribute(e)?"title"==e?(parent.insertBefore(r,el_first_value_first),parent.insertBefore(m,r)):(parent.appendChild(o),parent.appendChild(m)):document.getElementById("el_first_value_"+e)&&("title"==e?parent.removeChild(document.getElementById("el_first_value_title").nextSibling):parent.removeChild(document.getElementById("el_first_value_middle").previousSibling),parent.removeChild(document.getElementById("el_first_value_"+e))),refresh_attr(t,"type_name"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_title").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.title").focus(),jQuery("input.title").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_title").text(e),document.getElementById("el_title_label").innerHTML=e})}}),jQuery("label#"+t+"_mini_label_middle").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.middle").focus(),jQuery("input.middle").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_middle").text(e),document.getElementById("el_middle_label").innerHTML=e})}})})}function create_autofill_user_name(e,t){return create_option_container(jQuery('Autofill with user name '),jQuery(' "))}function set_autofill(e){"yes"==document.getElementById(e).value?document.getElementById(e).value="no":document.getElementById(e).value="yes"}function go_to_type_name(e){w_attr_name=[],w_attr_value=[],w_first_val=["","","",""],w_title=["","","",""],w_mini_labels=["Title","First","Last","Middle"],w_name_fields=["no","no"],type_name(e,"Name","","top","no",w_first_val,w_title,w_mini_labels,"","normal","no","no","",w_attr_name,w_attr_value,w_name_fields,"no")}function type_name(t,e,i,a,n,l,d,_,r,o,m,s,u,c,p,f,y){jQuery("#element_type").val("type_name"),delete_last_child();var h=jQuery("#edit_table"),b=jQuery('
');h.append(b);var v=jQuery('
');b.append(v),v.append(create_field_type("type_name")),v.append(create_label(t,e)),v.append(create_label_position(t,a)),v.append(create_hide_label(t,n)),v.append(create_required(t,m)),v.append(create_placeholder_name(t,d)),v.append(create_field_size_name(t,r));var w=jQuery('
');v.append(create_advanced_options_container(w)),w.append(create_enable_name_fields(t,f,_)),w.append(create_autofill_user_name(t,y)),w.append(create_unique_values(t,s)),w.append(create_field_label_size(t,i)),w.append(create_class(t,u)),w.append(create_additional_attributes(t,c,"type_name"));var g=document.createElement("br"),E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value","type_name"),E.setAttribute("name",t+"_typeform_id_temp"),E.setAttribute("id",t+"_typeform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",y),A.setAttribute("name",t+"_autofillform_id_temp"),A.setAttribute("id",t+"_autofillform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",m),j.setAttribute("name",t+"_requiredform_id_temp"),j.setAttribute("id",t+"_requiredform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",n),x.setAttribute("name",t+"_hide_labelform_id_temp"),x.setAttribute("id",t+"_hide_labelform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("name",t+"_enable_fieldsform_id_temp"),k.setAttribute("id",t+"_enable_fieldsform_id_temp"),k.setAttribute("title",f[0]),k.setAttribute("first","yes"),k.setAttribute("last","yes"),k.setAttribute("middle",f[1]);var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",t+"_uniqueform_id_temp"),I.setAttribute("id",t+"_uniqueform_id_temp"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit.");var C=document.createElement("div");C.setAttribute("id","main_div");var B=document.createElement("div");B.setAttribute("class","fm-editable-label"),B.appendChild(edit_labels);var Q=document.createElement("div");Q.setAttribute("id",t+"_elemet_tableform_id_temp");var T="yes"==n?"none":"table-cell",M=document.createElement("div");M.setAttribute("align","left"),M.style.display=T,M.style.width=i+"px",M.setAttribute("id",t+"_label_sectionform_id_temp");var L=document.createElement("div");L.setAttribute("align","left"),L.style.display="table-cell",L.setAttribute("id",t+"_element_sectionform_id_temp");var z=document.createElement("div");z.style.display="table",z.setAttribute("id",t+"_table_name"),z.setAttribute("cellpadding","0"),z.setAttribute("cellspacing","0");var q=document.createElement("div");q.style.display="table-row",q.setAttribute("id",t+"_tr_name1");var H=document.createElement("div");H.style.display="table-row",H.setAttribute("id",t+"_tr_name2");var N=document.createElement("div");N.style.display="table-cell",N.setAttribute("id",t+"_td_name_input_first");var S=document.createElement("div");S.style.display="table-cell",S.setAttribute("id",t+"_td_name_input_last");var D=document.createElement("div");D.style.display="table-cell",D.setAttribute("id",t+"_td_name_label_first"),D.setAttribute("align","left");var P=document.createElement("div");P.style.display="table-cell",P.setAttribute("id",t+"_td_name_label_last"),P.setAttribute("align","left");var O=document.createElement("span");O.setAttribute("id",t+"_element_labelform_id_temp"),O.innerHTML=e,O.setAttribute("class","label"),O.style.verticalAlign="top";var K=document.createElement("span");K.setAttribute("id",t+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),K.style.verticalAlign="top","yes"==m&&(K.innerHTML=" *");var U=document.createElement("input");U.setAttribute("type","text"),U.style.cssText="margin-right: 10px; width:"+r+"px",U.setAttribute("id",t+"_element_firstform_id_temp"),U.setAttribute("name",t+"_element_firstform_id_temp"),U.setAttribute("value",l[0]),U.setAttribute("title",d[0]),U.setAttribute("placeholder",d[0]);var F=document.createElement("label");F.setAttribute("class","mini_label"),F.setAttribute("id",t+"_mini_label_first"),F.innerHTML=_[1];var R=document.createElement("input");R.setAttribute("type","text"),R.style.cssText="margin-right: 10px; width:"+r+"px",R.setAttribute("id",t+"_element_lastform_id_temp"),R.setAttribute("name",t+"_element_lastform_id_temp"),R.setAttribute("value",l[1]),R.setAttribute("title",d[1]),R.setAttribute("placeholder",d[1]);var W=document.createElement("label");W.setAttribute("class","mini_label"),W.setAttribute("id",t+"_mini_label_last"),W.innerHTML=_[2];var V=document.getElementById("show_table");M.appendChild(O),M.appendChild(K),N.appendChild(U),S.appendChild(R),q.appendChild(N),q.appendChild(S),D.appendChild(F),P.appendChild(W),H.appendChild(D),H.appendChild(P),z.appendChild(q),z.appendChild(H),L.appendChild(E),L.appendChild(j),L.appendChild(x),L.appendChild(I),L.appendChild(A),L.appendChild(k),L.appendChild(z),Q.appendChild(M),Q.appendChild(L),C.appendChild(Q),C.appendChild(g),C.appendChild(B),V.appendChild(C),jQuery("#main_div").append(" "+form_maker.type_name_description),"top"==a&&label_top(t),change_class(u,t),"yes"==f[0]&&enable_name_fields(t,"title"),"yes"==f[1]&&enable_name_fields(t,"middle"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_first").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.first").focus(),jQuery("input.first").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_first").text(e),document.getElementById("el_first_label").innerHTML=e})}}),jQuery("label#"+t+"_mini_label_last").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.last").focus(),jQuery("input.last").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_last").text(e),document.getElementById("el_last_label").innerHTML=e})}})}),refresh_attr(t,"type_name")}function create_autofill_user_email(e,t){return create_option_container(jQuery('Autofill with user email '),jQuery(' "))}function create_confirmation_email(e,t){return create_option_container(jQuery('Confirmation Email '),jQuery(' "))}function verification_mail(e){document.getElementById("el_verification_mail").checked?(document.getElementById("confirm_validation_label").style.display="block",document.getElementById("confirm_validation_empty").style.display="block",document.getElementById(e+"_verification_id_temp").value="yes",document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById("confirm_validation_label").style.display="none",document.getElementById("confirm_validation_empty").style.display="none",document.getElementById(e+"_verification_id_temp").value="no",document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none")}function create_confirmation_email_label(e,t,i){return create_option_container(jQuery('Confirmation label '),jQuery('"),"confirm_validation_label","yes"==t)}function create_confirmation_email_placeholder(e,t,i){return create_option_container(jQuery('Confirmation placeholder '),jQuery(' '),"confirm_validation_empty","yes"==t)}function go_to_type_submitter_mail(e){w_attr_name=[],w_attr_value=[],type_submitter_mail(e,"Email","","top","no","","","","no","no","","no","Email confirmation","",w_attr_name,w_attr_value,"no")}function type_submitter_mail(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f,y){jQuery("#element_type").val("type_submitter_mail"),delete_last_child();var h=jQuery("#edit_table"),b=jQuery('
');h.append(b);var v=jQuery('
');b.append(v),v.append(create_field_type("type_submitter_mail")),v.append(create_label(e,t)),v.append(create_label_position(e,a)),v.append(create_hide_label(e,n)),v.append(create_required(e,r)),v.append(create_placeholder(e,_)),v.append(create_field_size(e,l,"'"+e+"_elementform_id_temp'","'"+e+"_1_elementform_id_temp'"));var w=jQuery('
');v.append(create_advanced_options_container(w)),w.append(create_confirmation_email(e,s)),w.append(create_confirmation_email_label(e,s,u)),w.append(create_confirmation_email_placeholder(e,s,c)),w.append(create_autofill_user_email(e,y)),w.append(create_unique_values(e,o)),w.append(create_field_label_size(e,i,"'"+e+"_label_sectionform_id_temp'","'"+e+"_1_label_sectionform_id_temp'")),w.append(create_class(e,m)),w.append(create_additional_attributes(e,p,"type_submitter_mail")),element="input",type="text";var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","type_submitter_mail"),g.setAttribute("name",e+"_typeform_id_temp"),g.setAttribute("id",e+"_typeform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",y),E.setAttribute("name",e+"_autofillform_id_temp"),E.setAttribute("id",e+"_autofillform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",r),A.setAttribute("name",e+"_requiredform_id_temp"),A.setAttribute("id",e+"_requiredform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",n),j.setAttribute("name",e+"_hide_labelform_id_temp"),j.setAttribute("id",e+"_hide_labelform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",o),x.setAttribute("name",e+"_uniqueform_id_temp"),x.setAttribute("id",e+"_uniqueform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",s),k.setAttribute("name",e+"_verification_id_temp"),k.setAttribute("id",e+"_verification_id_temp");var I=document.createElement(element);I.setAttribute("type",type),I.style.cssText="width:"+l+"px;",I.setAttribute("id",e+"_elementform_id_temp"),I.setAttribute("name",e+"_elementform_id_temp"),I.setAttribute("value",d),I.setAttribute("title",_),I.setAttribute("placeholder",_);var C=document.createElement(element);C.setAttribute("type",type),C.style.cssText="width:"+l+"px;",C.setAttribute("id",e+"_1_elementform_id_temp"),C.setAttribute("name",e+"_1_elementform_id_temp"),C.setAttribute("placeholder",c),C.setAttribute("title",c);var B=document.createElement("div");B.setAttribute("id","main_div");var Q=document.createElement("div");Q.setAttribute("id",e+"_elemet_tableform_id_temp");var T="yes"==n?"none":"table-cell",M=document.createElement("div");M.setAttribute("align","left"),M.style.display=T,M.style.width=i+"px",M.setAttribute("id",e+"_label_sectionform_id_temp");var L="yes"==n||"no"==s?"none":"table-cell",z=document.createElement("div");z.setAttribute("align","left"),z.style.display=L,z.style.width=i+"px",z.setAttribute("id",e+"_1_label_sectionform_id_temp");var q=document.createElement("div");q.setAttribute("align","left"),q.style.display="table-cell",q.setAttribute("id",e+"_element_sectionform_id_temp");var H="no"==s?"none":"table-cell",N=document.createElement("div");N.setAttribute("align","left"),N.style.display=H,N.setAttribute("id",e+"_1_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var S=document.createElement("br"),D=(document.createElement("br"),document.createElement("br")),P=document.createElement("span");P.setAttribute("id",e+"_element_labelform_id_temp"),P.innerHTML=t,P.setAttribute("class","label"),P.style.verticalAlign="top";var O=document.createElement("span");O.setAttribute("id",e+"_1_element_labelform_id_temp"),O.innerHTML=u,O.setAttribute("class","label"),O.style.verticalAlign="top";var K=document.createElement("span");K.setAttribute("id",e+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),K.style.verticalAlign="top","yes"==r&&(K.innerHTML=" *");var U=document.createElement("span");U.setAttribute("id",e+"_1_required_elementform_id_temp"),U.innerHTML="",U.setAttribute("class","required"),U.style.verticalAlign="top","yes"==r&&(U.innerHTML=" *");var F=document.getElementById("show_table");M.appendChild(P),M.appendChild(K),z.appendChild(O),z.appendChild(U),q.appendChild(g),q.appendChild(A),q.appendChild(j),q.appendChild(x),q.appendChild(k),q.appendChild(E),q.appendChild(I),N.appendChild(C),Q.appendChild(M),Q.appendChild(q),Q.appendChild(D),Q.appendChild(z),Q.appendChild(N),B.appendChild(Q),B.appendChild(S),F.appendChild(B),jQuery("#main_div").append(form_maker.type_email_description),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text")}function go_to_type_phone_new(e){w_attr_name=[],w_attr_value=[],type_phone_new(e,"Phone","","top","no","","","us","no","no","",w_attr_name,w_attr_value)}function type_phone_new(e,t,i,a,n,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_phone_new"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('
');c.append(p);var f=jQuery('
');p.append(f),f.append(create_field_type("type_phone_new")),f.append(create_label(e,t)),f.append(create_label_position(e,a)),f.append(create_hide_label(e,n)),f.append(create_required(e,r)),f.append(create_field_size(e,l));var y=jQuery('
');f.append(create_advanced_options_container(y)),y.append(create_unique_values(e,o)),y.append(create_field_label_size(e,i)),y.append(create_class(e,m)),y.append(create_additional_attributes(e,s,"type_phone_new"));var h=document.createElement("br"),b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_phone_new"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",r),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",e+"_hide_labelform_id_temp"),w.setAttribute("id",e+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",o),g.setAttribute("name",e+"_uniqueform_id_temp"),g.setAttribute("id",e+"_uniqueform_id_temp");var E=document.createElement("div");E.setAttribute("id","main_div");var A=document.createElement("div");A.setAttribute("id",e+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=i+"px",x.setAttribute("id",e+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",e+"_element_sectionform_id_temp");var I=document.createElement("div");I.style.display="table",I.setAttribute("id",e+"_table_name");var C=document.createElement("div");C.style.display="table-row",C.setAttribute("id",e+"_tr_name1");var B=document.createElement("div");B.style.display="table-cell",B.setAttribute("id",e+"_td_name_input_first");var Q=document.createElement("span");Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label"),Q.style.verticalAlign="top";var T=document.createElement("span");T.setAttribute("id",e+"_required_elementform_id_temp"),T.innerHTML="",T.setAttribute("class","required"),"yes"==r&&(T.innerHTML=" *");var M=document.createElement("input");M.setAttribute("type","text"),M.style.cssText="width:"+l+"px",M.setAttribute("id",e+"_elementform_id_temp"),M.setAttribute("name",e+"_elementform_id_temp"),M.setAttribute("value",d),M.setAttribute("top-country",_);var L=document.getElementById("show_table");x.appendChild(Q),x.appendChild(T),B.appendChild(M),C.appendChild(B),I.appendChild(C),k.appendChild(b),k.appendChild(v),k.appendChild(w),k.appendChild(g),k.appendChild(I),A.appendChild(x),A.appendChild(k),E.appendChild(A),E.appendChild(h),L.appendChild(E),jQuery("#main_div").append(form_maker.type_phone_description),"top"==a&&label_top(e),change_class(m,e),refresh_attr(e,"type_text"),jQuery("#"+e+"_elementform_id_temp").intlTelInput({nationalMode:!1,preferredCountries:[_]})}function create_address_size(e,t){return create_option_container(jQuery('Overall width(px) '),jQuery(''+form_maker.leave_empty+"
"))}function create_use_us_states_list(e,t){return create_option_container(jQuery('Use list for US states and Canada provinces '),jQuery(' "))}function disable_fields(i,a){var e=document.getElementById(i+"_div_address");if(a&&(1==document.getElementById("el_"+a).checked?document.getElementById(i+"_disable_fieldsform_id_temp").setAttribute(a,"yes"):document.getElementById(i+"_disable_fieldsform_id_temp").setAttribute(a,"no")),"yes"==document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute("state"))document.getElementById("el_us_states").disabled=!0;else if(document.getElementById("el_us_states").disabled=!1,"us_states"==a)return void change_state_input(i,"form_id_temp");e.innerHTML="";var t=new Array,n=["street1","street2","city","state","postal","country"],d=0;for(l=0;l<6;l++){if("no"==document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute(n[l]))if("street1"==n[l]||"street2"==n[l]){var _=document.createElement("input");_.setAttribute("type","text"),_.style.cssText="width:100%",_.setAttribute("id",i+"_"+n[l]+"form_id_temp"),_.setAttribute("name",parseInt(i)+l+"_"+n[l]+"form_id_temp");var r=document.createElement("label");r.setAttribute("class","mini_label"),r.setAttribute("id",i+"_mini_label_"+n[l]),r.style.cssText="display:block;",r.innerHTML=document.getElementById("el_"+n[l]+"_label").innerHTML,w_mini_labels[l]=document.getElementById("el_"+n[l]+"_label").innerHTML,(m=document.createElement("span")).style.cssText="float:left; width:100%; padding-bottom: 8px; display:block",m.appendChild(_),m.appendChild(r),e.appendChild(m)}else{var o,m;if(d++,"country"!=n[l])(a=document.createElement("input")).setAttribute("type","text"),a.style.cssText="width:100%",a.setAttribute("id",i+"_"+n[l]+"form_id_temp"),a.setAttribute("name",parseInt(i)+l+"_"+n[l]+"form_id_temp"),(o=document.createElement("label")).setAttribute("class","mini_label"),o.setAttribute("id",i+"_mini_label_"+n[l]),o.style.cssText="display:block;",o.innerHTML=document.getElementById("el_"+n[l]+"_label").innerHTML,w_mini_labels[l]=document.getElementById("el_"+n[l]+"_label").innerHTML;else(a=document.createElement("select")).setAttribute("type","text"),a.style.cssText="width:100%",a.setAttribute("id",i+"_countryform_id_temp"),a.setAttribute("name",parseInt(i)+l+"_countryform_id_temp"),a.setAttribute("onChange","change_state_input('"+i+"', 'form_id_temp')"),(o=document.createElement("label")).setAttribute("class","mini_label"),o.setAttribute("id",i+"_mini_label_country"),o.style.cssText="display:block;",o.innerHTML=document.getElementById("el_"+n[l]+"_label").innerHTML,w_mini_labels[l]=document.getElementById("el_"+n[l]+"_label").innerHTML,countries=form_maker.countries,jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("value",t),i.innerHTML=t,a.appendChild(i)});if(d%2!=0)(m=document.createElement("span")).style.cssText="float:left; width:48%; padding-bottom: 8px;";else(m=document.createElement("span")).style.cssText="float:right; width:48%; padding-bottom: 8px;";m.appendChild(a),m.appendChild(o),e.appendChild(m)}else{var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("id",i+"_"+n[l]+"form_id_temp"),s.setAttribute("value",document.getElementById("el_"+n[l]+"_label").innerHTML),s.setAttribute("id_for_label",parseInt(i)+l),t.push(s)}for(k=0;k';t(this).html(e),t("input.street1").focus(),t("input.street1").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street1").text(e),document.getElementById("el_street1_label").innerHTML=e})}}),t("label#"+i+"_mini_label_street2").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.street2").focus(),t("input.street2").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street2").text(e),document.getElementById("el_street2_label").innerHTML=e})}}),t("label#"+i+"_mini_label_city").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.city").focus(),t("input.city").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_city").text(e),document.getElementById("el_city_label").innerHTML=e})}}),t("label#"+i+"_mini_label_state").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.state").focus(),t("input.state").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_state").text(e),document.getElementById("el_state_label").innerHTML=e})}}),t("label#"+i+"_mini_label_postal").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.postal").focus(),t("input.postal").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_postal").text(e),document.getElementById("el_postal_label").innerHTML=e})}}),t("label#"+i+"_mini_label_country").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.country").focus(),t("input.country").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_country").text(e),document.getElementById("el_country_label").innerHTML=e})}})}),refresh_attr(i,"type_address")}function change_state_input(e,t){if(document.getElementById(e+"_country"+t)&&document.getElementById(e+"_state"+t)&&!document.getElementById("el_state").checked&&!document.getElementById("el_us_states").disabled){var i=!1,a=document.getElementById(e+"_state"+t);if("United States"==document.getElementById(e+"_country"+t).value&&document.getElementById("el_us_states").checked){var n=document.createElement("select"),l=form_maker.states;for(var d in l){(_=document.createElement("option")).setAttribute("value",d),_.innerHTML=l[d],n.appendChild(_)}i=!0}else if("Canada"==document.getElementById(e+"_country"+t).value&&document.getElementById("el_us_states").checked){n=document.createElement("select"),l=form_maker.provinces;for(var d in l){var _;(_=document.createElement("option")).setAttribute("value",d),_.innerHTML=l[d],n.appendChild(_)}i=!0}else if("SELECT"==document.getElementById(e+"_state"+t).tagName){n=document.createElement("input");i=!0}if(i){n.setAttribute("type","text"),n.style.cssText="width: 100%",n.setAttribute("id",e+"_state"+t),n.setAttribute("name",parseInt(e)+3+"_state"+t);var r=a.parentNode;r.removeChild(a),r.insertBefore(n,r.firstChild)}}}function create_disable_address_fields(e,t,i){var a=jQuery('Disable Field(s) '),n=jQuery(' "),l=jQuery(''+i[0]+" "),d=jQuery(' "),_=jQuery(''+i[1]+" "),r=jQuery(' "),o=jQuery(''+i[2]+" "),m=jQuery(' "),s=jQuery(''+i[3]+" "),u=jQuery(' "),c=jQuery(''+i[4]+" "),p=jQuery(' "),f=jQuery(''+i[5]+" "),y=n;return create_option_container(a,y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=y.add(l)).add(jQuery(" "))).add(d)).add(_)).add(jQuery(" "))).add(r)).add(o)).add(jQuery(" "))).add(m)).add(s)).add(jQuery(" "))).add(u)).add(c)).add(jQuery(" "))).add(p)).add(f))}function go_to_type_address(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["Street Address","Street Address Line 2","City","State / Province / Region","Postal / Zip Code","Country"],w_disabled_fields=["no","no","no","no","no","no","yes"],type_address(e,"Address","","top","no","",w_mini_labels,w_disabled_fields,"no","wdform_address",w_attr_name,w_attr_value)}function type_address(i,e,t,a,n,l,d,_,r,o,m,s){jQuery("#element_type").val("type_address"),delete_last_child();var u=jQuery("#edit_table"),c=jQuery('
');u.append(c);var p=jQuery('
');c.append(p),p.append(create_field_type("type_address")),p.append(create_label(i,e)),p.append(create_label_position(i,a)),p.append(create_hide_label(i,n)),p.append(create_required(i,r)),p.append(create_address_size(i,l)),p.append(create_use_us_states_list(i,_));var f=jQuery('
');p.append(create_advanced_options_container(f)),f.append(create_disable_address_fields(i,_,d)),f.append(create_field_label_size(i,t)),f.append(create_class(i,o)),f.append(create_additional_attributes(i,m,"type_address"));var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value","type_address"),y.setAttribute("name",i+"_typeform_id_temp"),y.setAttribute("id",i+"_typeform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("name",i+"_disable_fieldsform_id_temp"),h.setAttribute("id",i+"_disable_fieldsform_id_temp"),h.setAttribute("street1",_[0]),h.setAttribute("street2",_[1]),h.setAttribute("city",_[2]),h.setAttribute("state",_[3]),h.setAttribute("us_states",_[6]),h.setAttribute("postal",_[4]),h.setAttribute("country",_[5]);var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",r),b.setAttribute("name",i+"_requiredform_id_temp"),b.setAttribute("id",i+"_requiredform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",n),v.setAttribute("name",i+"_hide_labelform_id_temp"),v.setAttribute("id",i+"_hide_labelform_id_temp");var w=document.createElement("div");w.setAttribute("id","main_div");var g=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),E=document.createElement("div");E.setAttribute("style","margin-left:4px; color:red; display:inline-block;"),E.appendChild(g);var A=document.createElement("div");A.setAttribute("id",i+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=t+"px",x.style.verticalAlign="top",x.setAttribute("id",i+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",i+"_element_sectionform_id_temp");var I=document.createElement("div");I.setAttribute("id",i+"_div_address"),I.style.cssText="width:"+l+"px";var C=document.createElement("span");C.style.cssText="float:left; width:100%; padding-bottom: 8px; display:block";var B=document.createElement("span");B.style.cssText="float:left; width:100%; padding-bottom: 8px; display:block";var Q=document.createElement("span");Q.style.cssText="float:left; width:48%; padding-bottom: 8px;";var T=document.createElement("span");T.style.cssText="float:right; width:48%; padding-bottom: 8px;";var M=document.createElement("span");M.style.cssText="float:left; width:48%; padding-bottom: 8px;";var L=document.createElement("span");L.style.cssText="float:right; width:48%; padding-bottom: 8px;";var z=document.createElement("br"),q=document.createElement("span");q.setAttribute("id",i+"_element_labelform_id_temp"),q.innerHTML=e,q.setAttribute("class","wd_form_label"),q.style.verticalAlign="top";var H=document.createElement("span");H.setAttribute("id",i+"_required_elementform_id_temp"),H.innerHTML="",H.setAttribute("class","required"),H.style.verticalAlign="top","yes"==r&&(H.innerHTML=" *");var N=document.createElement("input");N.setAttribute("type","text"),N.style.cssText="width:100%",N.setAttribute("id",i+"_street1form_id_temp"),N.setAttribute("name",i+"_street1form_id_temp");var S=document.createElement("label");S.setAttribute("class","mini_label"),S.setAttribute("id",i+"_mini_label_street1"),S.style.cssText="display:block;",S.innerHTML=d[0];var D=document.createElement("input");D.setAttribute("type","text"),D.style.cssText="width:100%",D.setAttribute("id",i+"_street2form_id_temp"),D.setAttribute("name",parseInt(i)+1+"_street2form_id_temp");var P=document.createElement("label");P.setAttribute("class","mini_label"),P.setAttribute("id",i+"_mini_label_street2"),P.style.cssText="display:block;",P.innerHTML=d[1];var O=document.createElement("input");O.setAttribute("type","text"),O.style.cssText="width:100%",O.setAttribute("id",i+"_cityform_id_temp"),O.setAttribute("name",parseInt(i)+2+"_cityform_id_temp");var K=document.createElement("label");K.setAttribute("class","mini_label"),K.setAttribute("id",i+"_mini_label_city"),K.style.cssText="display:block;",K.innerHTML=d[2];var U=document.createElement("input");U.setAttribute("type","text"),U.style.cssText="width:100%",U.setAttribute("id",i+"_stateform_id_temp"),U.setAttribute("name",parseInt(i)+3+"_stateform_id_temp");var F=document.createElement("label");F.setAttribute("class","mini_label"),F.setAttribute("id",i+"_mini_label_state"),F.style.cssText="display:block;",F.innerHTML=d[3];var R=document.createElement("input");R.setAttribute("type","text"),R.style.cssText="width:100%",R.setAttribute("id",i+"_postalform_id_temp"),R.setAttribute("name",parseInt(i)+4+"_postalform_id_temp");var W=document.createElement("label");W.setAttribute("class","mini_label"),W.setAttribute("id",i+"_mini_label_postal"),W.style.cssText="display:block;",W.innerHTML=d[4];var V=document.createElement("select");V.setAttribute("type","text"),V.style.cssText="width:100%",V.setAttribute("id",i+"_countryform_id_temp"),V.setAttribute("name",parseInt(i)+5+"_countryform_id_temp"),V.setAttribute("onChange","change_state_input('"+i+"','form_id_temp')");var $=document.createElement("label");$.setAttribute("class","mini_label"),$.setAttribute("id",i+"_mini_label_country"),$.style.cssText="display:block;",$.innerHTML=d[5],countries=form_maker.countries,jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("value",t),i.innerHTML=t,V.appendChild(i)});var G=document.getElementById("show_table");x.appendChild(q),x.appendChild(H),C.appendChild(N),C.appendChild(S),B.appendChild(D),B.appendChild(P),Q.appendChild(O),Q.appendChild(K),T.appendChild(U),T.appendChild(F),M.appendChild(R),M.appendChild(W),L.appendChild(V),L.appendChild($),I.appendChild(C),I.appendChild(B),I.appendChild(Q),I.appendChild(T),I.appendChild(M),I.appendChild(L),k.appendChild(y),k.appendChild(b),k.appendChild(v),k.appendChild(h),k.appendChild(I),A.appendChild(x),A.appendChild(k),w.appendChild(A),w.appendChild(z),w.appendChild(E),G.appendChild(w),jQuery("#main_div").append(" "+form_maker.type_address_description),"top"==a&&label_top(i),change_class(o,i),refresh_attr(i,"type_address"),"yes"==_[0]&&disable_fields(i,"street1"),"yes"==_[1]&&disable_fields(i,"street2"),"yes"==_[2]&&disable_fields(i,"city"),"yes"==_[3]&&disable_fields(i,"state"),"yes"==_[4]&&disable_fields(i,"postal"),"yes"==_[5]&&disable_fields(i,"country"),"yes"==_[6]&&disable_fields(i,"us_states"),jQuery(document).ready(function(t){t("label#"+i+"_mini_label_street1").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.street1").focus(),t("input.street1").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street1").text(e),document.getElementById("el_street1_label").innerHTML=e})}}),t("label#"+i+"_mini_label_street2").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.street2").focus(),t("input.street2").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_street2").text(e),document.getElementById("el_street2_label").innerHTML=e})}}),t("label#"+i+"_mini_label_city").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.city").focus(),t("input.city").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_city").text(e),document.getElementById("el_city_label").innerHTML=e})}}),t("label#"+i+"_mini_label_state").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.state").focus(),t("input.state").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_state").text(e),document.getElementById("el_state_label").innerHTML=e})}}),t("label#"+i+"_mini_label_postal").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.postal").focus(),t("input.postal").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_postal").text(e),document.getElementById("el_postal_label").innerHTML=e})}}),t("label#"+i+"_mini_label_country").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.country").focus(),t("input.country").blur(function(){var e=t(this).val();t("#"+i+"_mini_label_country").text(e),document.getElementById("el_country_label").innerHTML=e})}})})}function create_markmap_address(e,t){return create_option_container(jQuery('Address '),jQuery(' '))}function create_markmap_longitude(e,t,i){return create_option_container(jQuery('Longitude '),jQuery(' '))}function create_markmap_latitude(e,t,i){return create_option_container(jQuery('Latitude '),jQuery(' '))}function create_markmap_size(e,t,i){return create_option_container(jQuery('Size(px) '),jQuery(' x'+form_maker.leave_empty+"
"))}function create_markmap_info(e,t,i){return create_option_container(jQuery('Marker Info '),jQuery('"))}function go_to_type_mark_map(e){w_attr_name=[],w_attr_value=[],type_mark_map(e,"Mark your place on map","","top","no","2.294254","48.858334","2.294254","48.858334","13","370","300","wdform_map","",w_attr_name,w_attr_value)}function type_mark_map(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f){jQuery("#element_type").val("type_mark_map"),delete_last_child();var y=jQuery("#edit_table"),h=jQuery('
');y.append(h);var b=jQuery('
');h.append(b),b.append(create_field_type("type_mark_map")),b.append(create_label(e,t)),b.append(create_label_position(e,a)),b.append(create_hide_label(e,n)),b.append(jQuery('Drag the marker to change default marker position.
')),b.append(create_markmap_address(e,0)),b.append(create_markmap_longitude(e,_,0)),b.append(create_markmap_latitude(e,r,0)),b.append(create_markmap_info(e,c,0)),b.append(create_markmap_size(e,m,s)),b.append(create_keys(e,"To set up map key click here"));var v=jQuery('
');b.append(create_advanced_options_container(v)),v.append(create_field_label_size(e,i)),v.append(create_class(e,u)),v.append(create_additional_attributes(e,p,"type_mark_map")),element="div";var w=document.createElement("br"),g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value","type_mark_map"),g.setAttribute("name",e+"_typeform_id_temp"),g.setAttribute("id",e+"_typeform_id_temp");var E=document.createElement("div");E.setAttribute("id",e+"_elementform_id_temp"),E.setAttribute("long0",_),E.setAttribute("lat0",r),E.setAttribute("zoom",o),E.style.cssText="width:"+m+"px; height: "+s+"px",E.setAttribute("info0",c),E.setAttribute("center_x",l),E.setAttribute("center_y",d);var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",n),A.setAttribute("name",e+"_hide_labelform_id_temp"),A.setAttribute("id",e+"_hide_labelform_id_temp");var j=document.createElement("span");j.setAttribute("id",e+"_element_labelform_id_temp"),j.innerHTML=t,j.setAttribute("class","wd_form_label"),j.style.verticalAlign="top";var x=document.createElement("div");x.setAttribute("id","main_div");var k=document.createElement("div");k.setAttribute("id",e+"_elemet_tableform_id_temp");var I="yes"==n?"none":"table-cell",C=document.createElement("div");C.setAttribute("align","left"),C.style.display=I,C.style.width=i+"px",C.style.verticalAlign="top",C.setAttribute("id",e+"_label_sectionform_id_temp");var B=document.createElement("div");B.setAttribute("align","left"),B.style.display="table-cell",B.setAttribute("id",e+"_element_sectionform_id_temp");var Q=document.getElementById("show_table");C.appendChild(j),B.appendChild(g),B.appendChild(E),B.appendChild(A),k.appendChild(C),k.appendChild(B),x.appendChild(k),x.appendChild(w),Q.appendChild(x),jQuery("#main_div").append(form_maker.type_mark_on_map_description),"top"==a&&label_top(e),change_class(u,e),refresh_attr(e,"type_text"),if_gmap_init(e),add_marker_on_map(e,0,_,r,c,!0)}function create_edit_country_list(e){jQuery('Edit country list ');return create_option_container(null,jQuery("Edit country list '))}function go_to_type_country(e){w_countries=form_maker.countries,w_attr_name=[],w_attr_value=[],type_country(e,"Country","","no",w_countries,"top","","no","wdform_select",w_attr_name,w_attr_value)}function type_country(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_country"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('
');s.append(u);var c=jQuery('
');u.append(c),c.append(create_field_type("type_country")),c.append(create_label(e,t)),c.append(create_label_position(e,l)),c.append(create_hide_label(e,a)),c.append(create_required(e,_)),c.append(create_field_size(e,d));var p=jQuery('
');c.append(create_advanced_options_container(p)),p.append(create_edit_country_list(e)),p.append(create_field_label_size(e,i)),p.append(create_class(e,r)),p.append(create_additional_attributes(e,o,"type_country"));document.createElement("br");var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_country"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",e+"_requiredform_id_temp"),y.setAttribute("id",e+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",a),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("div");b.setAttribute("id","main_div");var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==a?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.style.width=i+"px",E.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var A=document.createElement("br"),j=(document.createElement("br"),document.createElement("div"));j.setAttribute("id",e+"_table_little"),j.style.display="table";var x=document.createElement("div");x.setAttribute("id",e+"_element_tr1"),x.style.display="table-row";var k=document.createElement("div");k.setAttribute("id",e+"_element_tr2"),k.style.display="table-row";var I=document.createElement("div");I.setAttribute("valign","top"),I.setAttribute("id",e+"_td_little1"),I.style.display="table-cell";var C=document.createElement("div");C.setAttribute("valign","top"),C.setAttribute("id",e+"_td_little2"),C.style.display="table-cell";var B=document.createElement("span");B.setAttribute("id",e+"_element_labelform_id_temp"),B.innerHTML=t,B.setAttribute("class","label"),B.style.verticalAlign="top";var Q=document.createElement("span");Q.setAttribute("id",e+"_required_elementform_id_temp"),Q.innerHTML="",Q.setAttribute("class","required"),Q.style.verticalAlign="top","yes"==_&&(Q.innerHTML=" *");var T=document.createElement("select");T.setAttribute("id",e+"_elementform_id_temp"),T.setAttribute("name",e+"_elementform_id_temp"),T.style.cssText="width:"+d+"px",jQuery.each(n,function(e,t){var i=document.createElement("option");i.setAttribute("value",t),i.innerHTML=t,T.appendChild(i)});var M=document.getElementById("show_table");g.appendChild(B),g.appendChild(Q),E.appendChild(h),E.appendChild(f),E.appendChild(y),E.appendChild(T),v.appendChild(g),v.appendChild(E),b.appendChild(v),b.appendChild(A),M.appendChild(b),jQuery("#main_div").append(form_maker.type_country_list_description),"top"==l&&label_top(e),change_class(r,e),refresh_attr(e,"type_text")}function create_datefields_separator(e,t){return create_option_container(jQuery('Fields separator '),jQuery(' '))}function create_datefield_day_type(e,t){var i=jQuery('Day field type '),a=jQuery(' "),n=jQuery('Input '),l=jQuery(' "),d=jQuery('Select '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_datefields_day_size(e,t){return create_option_container(jQuery('Day field width(px) '),jQuery(' '))}function create_datefield_month_type(e,t){var i=jQuery('Month field type '),a=jQuery(' "),n=jQuery('Input '),l=jQuery(' "),d=jQuery('Select '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_datefields_month_size(e,t){return create_option_container(jQuery('Month field width(px) '),jQuery(' '))}function create_datefield_year_type(e,t){var i=jQuery('Year field type '),a=jQuery(' "),n=jQuery('Input '),l=jQuery(' "),d=jQuery('Select '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function create_datefields_year_size(e,t){return create_option_container(jQuery('Year field width(px) '),jQuery(' '))}function create_datefields_year_interval(e,t,i){return create_option_container(jQuery('Year interval '),jQuery(' - '))}function field_to_select(e,t){switch(t){case"day":w_width=""!=document.getElementById("edit_for_day_size").value?document.getElementById("edit_for_day_size").value:30,w_day=document.getElementById(e+"_dayform_id_temp").value,document.getElementById(e+"_td_date_input1").innerHTML="";var i=document.createElement("select");for(i.setAttribute("id",e+"_dayform_id_temp"),i.setAttribute("name",e+"_dayform_id_temp"),i.setAttribute("onChange","set_select(this)"),i.style.width=w_width+"px",(_=document.createElement("option")).setAttribute("value",""),_.innerHTML="",i.appendChild(_),k=1;k<=31;k++){k<10&&(k="0"+k),(_=document.createElement("option")).setAttribute("value",k),_.innerHTML=k,k==w_day&&_.setAttribute("selected","selected"),i.appendChild(_)}document.getElementById(e+"_td_date_input1").appendChild(i);break;case"month":w_width=""!=document.getElementById("edit_for_month_size").value?document.getElementById("edit_for_month_size").value:60,w_month=document.getElementById(e+"_monthform_id_temp").value,document.getElementById(e+"_td_date_input2").innerHTML="";var a=document.createElement("select");a.setAttribute("id",e+"_monthform_id_temp"),a.setAttribute("name",e+"_monthform_id_temp"),a.setAttribute("onChange","set_select(this)"),a.style.width=w_width+"px",(_=document.createElement("option")).setAttribute("value",""),_.innerHTML="",a.appendChild(_);var n=new Array("\x3c!--repstart--\x3eJanuary\x3c!--repend--\x3e","\x3c!--repstart--\x3eFebruary\x3c!--repend--\x3e","\x3c!--repstart--\x3eMarch\x3c!--repend--\x3e","\x3c!--repstart--\x3eApril\x3c!--repend--\x3e","\x3c!--repstart--\x3eMay\x3c!--repend--\x3e","\x3c!--repstart--\x3eJune\x3c!--repend--\x3e","\x3c!--repstart--\x3eJuly\x3c!--repend--\x3e","\x3c!--repstart--\x3eAugust\x3c!--repend--\x3e","\x3c!--repstart--\x3eSeptember\x3c!--repend--\x3e","\x3c!--repstart--\x3eOctober\x3c!--repend--\x3e","\x3c!--repstart--\x3eNovember\x3c!--repend--\x3e","\x3c!--repstart--\x3eDecember\x3c!--repend--\x3e");for(k=1;k<=12;k++){k<10&&(k="0"+k),(_=document.createElement("option")).setAttribute("value",k),_.innerHTML=n[k-1],k==w_month&&_.setAttribute("selected","selected"),a.appendChild(_)}document.getElementById(e+"_td_date_input2").appendChild(a);break;case"year":w_width=""!=document.getElementById("edit_for_year_size").value?document.getElementById("edit_for_year_size").value:60,w_year=document.getElementById(e+"_yearform_id_temp").value,document.getElementById(e+"_td_date_input3").innerHTML="";var l=document.createElement("select");l.setAttribute("id",e+"_yearform_id_temp"),l.setAttribute("name",e+"_yearform_id_temp"),l.setAttribute("onChange","set_select(this)"),l.style.width=w_width+"px",(_=document.createElement("option")).setAttribute("value",""),_.innerHTML="",l.appendChild(_);var d=new Date;for(from=parseInt(document.getElementById("edit_for_year_interval_from").value),to=""!=document.getElementById("edit_for_year_interval_to").value?parseInt(document.getElementById("edit_for_year_interval_to").value):d.getFullYear(),k=to;k>=from;k--){var _;(_=document.createElement("option")).setAttribute("value",k),_.innerHTML=k,k==w_year&&_.setAttribute("selected","selected"),l.appendChild(_)}l.value=w_year,l.setAttribute("from",from),l.setAttribute("to",to),document.getElementById(e+"_td_date_input3").appendChild(l)}refresh_attr(e,"type_date_fields")}function field_to_text(e,t){switch(t){case"day":w_width=""!=document.getElementById("edit_for_day_size").value?document.getElementById("edit_for_day_size").value:30,w_day=document.getElementById(e+"_dayform_id_temp").value,document.getElementById(e+"_td_date_input1").innerHTML="";var i=document.createElement("input");i.setAttribute("type","text"),i.setAttribute("value",w_day),i.setAttribute("id",e+"_dayform_id_temp"),i.setAttribute("name",e+"_dayform_id_temp"),i.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+e+"_dayform_id_temp')"),i.style.width=w_width+"px",document.getElementById(e+"_td_date_input1").appendChild(i);break;case"month":w_width=""!=document.getElementById("edit_for_month_size").value?document.getElementById("edit_for_month_size").value:60,w_month=document.getElementById(e+"_monthform_id_temp").value,document.getElementById(e+"_td_date_input2").innerHTML="";var a=document.createElement("input");a.setAttribute("type","text"),a.setAttribute("value",w_month),a.setAttribute("id",e+"_monthform_id_temp"),a.setAttribute("name",e+"_monthform_id_temp"),a.style.width=w_width+"px",a.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+e+"_monthform_id_temp')"),document.getElementById(e+"_td_date_input2").appendChild(a);break;case"year":w_width=""!=document.getElementById("edit_for_year_size").value?document.getElementById("edit_for_year_size").value:60,w_year=document.getElementById(e+"_yearform_id_temp").value,document.getElementById(e+"_td_date_input3").innerHTML="";var n=new Date;from=parseInt(document.getElementById("edit_for_year_interval_from").value),to=""!=document.getElementById("edit_for_year_interval_to").value?parseInt(document.getElementById("edit_for_year_interval_to").value):n.getFullYear(),(parseInt(w_year)to)&&(w_year="");var l=document.createElement("input");l.setAttribute("type","text"),l.setAttribute("value",w_year),l.setAttribute("id",e+"_yearform_id_temp"),l.setAttribute("name",e+"_yearform_id_temp"),l.style.width=w_width+"px",l.setAttribute("from",from),l.setAttribute("to",to),document.getElementById(e+"_td_date_input3").appendChild(l)}refresh_attr(e,"type_date_fields")}function set_divider(e,t){document.getElementById(e+"_separator1").innerHTML=t,document.getElementById(e+"_separator2").innerHTML=t}function year_interval(e){var t=new Date;from=parseInt(document.getElementById("edit_for_year_interval_from").value),to=""!=document.getElementById("edit_for_year_interval_to").value?parseInt(document.getElementById("edit_for_year_interval_to").value):t.getFullYear(),to-from<0?(alert("Invalid interval of years."),document.getElementById("edit_for_year_interval_from").value=to):"SELECT"==document.getElementById(e+"_yearform_id_temp").tagName?field_to_select(e,"year"):field_to_text(e,"year")}function go_to_type_date_fields(e){w_attr_name=[],w_attr_value=[];var t=new Date;w_to=t.getFullYear(),type_date_fields(e,"Date of Birth","","top","no","","","","SELECT","SELECT","SELECT","day","month","year","60","100","80","no","wdform_date_fields","1901",w_to," / ",w_attr_name,w_attr_value)}function type_date_fields(i,e,t,a,n,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v,w,g,E,A){current_date=new Date,jQuery("#element_type").val("type_date_fields"),delete_last_child();var j=jQuery("#edit_table"),x=jQuery('
');j.append(x);var k=jQuery('
');x.append(k),k.append(create_field_type("type_date_fields")),k.append(create_label(i,e)),k.append(create_label_position(i,a)),k.append(create_hide_label(i,n)),k.append(create_required(i,h));var I=jQuery('
');k.append(create_advanced_options_container(I)),I.append(create_datefields_separator(i,g)),I.append(create_datefield_day_type(i,r)),I.append(create_datefields_day_size(i,p)),I.append(create_datefield_month_type(i,o)),I.append(create_datefields_month_size(i,f)),I.append(create_datefield_year_type(i,m)),I.append(create_datefields_year_size(i,y)),I.append(create_datefields_year_interval(i,v,w)),I.append(jQuery('Leave the second field empty and the current year will be used automatically. For a specific year (other than current) fill out both the start and finish points of the range.
')),I.append(create_field_label_size(i,t)),I.append(create_class(i,b)),I.append(create_additional_attributes(i,E,"type_date_fields"));var C=document.createElement("br"),B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value","type_date_fields"),B.setAttribute("name",i+"_typeform_id_temp"),B.setAttribute("id",i+"_typeform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",h),Q.setAttribute("name",i+"_requiredform_id_temp"),Q.setAttribute("id",i+"_requiredform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",n),T.setAttribute("name",i+"_hide_labelform_id_temp"),T.setAttribute("id",i+"_hide_labelform_id_temp");var M=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),L=document.createElement("div");L.setAttribute("id","main_div");var z=document.createElement("div");z.setAttribute("style","margin-left:4px; color:red;"),z.appendChild(M);var q=document.createElement("div");q.setAttribute("id",i+"_elemet_tableform_id_temp");var H="yes"==n?"none":"table-cell",N=document.createElement("div");N.setAttribute("align","left"),N.style.cssText="display:"+H+"; vertical-align:top; width:"+t+"px",N.setAttribute("id",i+"_label_sectionform_id_temp");var S=document.createElement("div");S.setAttribute("align","left"),S.style.display="table-cell",S.setAttribute("id",i+"_element_sectionform_id_temp");var D=document.createElement("div");D.setAttribute("id",i+"_table_date"),D.style.display="table";var P=document.createElement("div");P.setAttribute("id",i+"_tr_date1"),P.style.display="table-row";var O=document.createElement("div");O.setAttribute("id",i+"_tr_date2"),O.style.display="table-row";var K=document.createElement("div");K.setAttribute("id",i+"_td_date_input1"),K.style.display="table-cell";var U=document.createElement("div");U.setAttribute("id",i+"_td_date_separator1"),U.style.display="table-cell";var F=document.createElement("div");F.setAttribute("id",i+"_td_date_input2"),F.style.display="table-cell";var R=document.createElement("div");R.setAttribute("id",i+"_td_date_separator2"),R.style.display="table-cell";var W=document.createElement("div");W.setAttribute("id",i+"_td_date_input3"),W.style.display="table-cell";var V=document.createElement("div");V.setAttribute("id",i+"_td_date_label1"),V.style.display="table-cell";var $=document.createElement("div");$.style.display="table-cell";var G=document.createElement("div");G.setAttribute("id",i+"_td_date_label2"),G.style.display="table-cell";var Y=document.createElement("div");Y.style.display="table-cell";var Z=document.createElement("div");Z.setAttribute("id",i+"_td_date_label3"),Z.style.display="table-cell";var X=document.createElement("span");X.setAttribute("id",i+"_element_labelform_id_temp"),X.innerHTML=e,X.setAttribute("class","wd_form_label"),X.style.verticalAlign="top";var J=document.createElement("span");J.setAttribute("id",i+"_required_elementform_id_temp"),J.innerHTML="",J.setAttribute("class","required"),J.style.verticalAlign="top","yes"==h&&(J.innerHTML=" *");var ee=document.createElement("input");ee.setAttribute("type","text"),ee.setAttribute("value",l),ee.setAttribute("id",i+"_dayform_id_temp"),ee.setAttribute("name",i+"_dayform_id_temp"),ee.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+i+"_dayform_id_temp')"),ee.style.width=p+"px";var te=document.createElement("label");te.setAttribute("class","mini_label"),te.setAttribute("id",i+"_day_label"),te.innerHTML=s;var ie=document.createElement("span");ie.setAttribute("id",i+"_separator1"),ie.setAttribute("class","wdform_separator"),ie.innerHTML=g;var ae=document.createElement("input");ae.setAttribute("type","text"),ae.setAttribute("value",d),ae.setAttribute("id",i+"_monthform_id_temp"),ae.setAttribute("name",i+"_monthform_id_temp"),ae.style.width=f+"px",ae.setAttribute("onBlur","if (this.value=='0') this.value=''; else add_0('"+i+"_monthform_id_temp')");var ne=document.createElement("label");ne.setAttribute("class","mini_label"),ne.setAttribute("class","mini_label"),ne.setAttribute("id",i+"_month_label"),ne.innerHTML=u;var le=document.createElement("span");le.setAttribute("id",i+"_separator2"),le.setAttribute("class","wdform_separator"),le.innerHTML=g,""==w&&(w=current_date.getFullYear());var de=document.createElement("input");de.setAttribute("type","text"),de.setAttribute("from",v),de.setAttribute("to",w),de.setAttribute("value",_),de.setAttribute("id",i+"_yearform_id_temp"),de.setAttribute("name",i+"_yearform_id_temp"),de.style.width=y+"px";var _e=document.createElement("label");_e.setAttribute("class","mini_label"),_e.setAttribute("id",i+"_year_label"),_e.innerHTML=c;var re=document.getElementById("show_table");N.appendChild(X),N.appendChild(J),S.appendChild(T),K.appendChild(ee),U.appendChild(ie),F.appendChild(ae),R.appendChild(le),W.appendChild(de),P.appendChild(K),P.appendChild(U),P.appendChild(F),P.appendChild(R),P.appendChild(W),V.appendChild(te),G.appendChild(ne),Z.appendChild(_e),O.appendChild(V),O.appendChild($),O.appendChild(G),O.appendChild(Y),O.appendChild(Z),D.appendChild(P),D.appendChild(O),S.appendChild(B),S.appendChild(Q),S.appendChild(D),q.appendChild(N),q.appendChild(S),L.appendChild(q),L.appendChild(C),L.appendChild(z),re.appendChild(L),jQuery("#main_div").append(" "+form_maker.type_date_of_birth_description),"top"==a&&label_top(i),"SELECT"==r&&field_to_select(i,"day"),"SELECT"==o&&field_to_select(i,"month"),"SELECT"==m&&field_to_select(i,"year"),change_class(b,i),refresh_attr(i,"type_date_fields"),jQuery(document).ready(function(t){t("label#"+i+"_day_label").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.day").focus(),t("input.day").blur(function(){var e=t(this).val();t("#"+i+"_day_label").text(e)})}}),t("label#"+i+"_month_label").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.month").focus(),t("input.month").blur(function(){var e=t(this).val();t("#"+i+"_month_label").text(e)})}}),t("label#"+i+"_year_label").click(function(){if(0==t(this).children("input").length){var e=" ';t(this).html(e),t("input.year").focus(),t("input.year").blur(function(){var e=t(this).val();t("#"+i+"_year_label").text(e)})}})})}function create_payment_amount_range(e,t,i){return create_option_container(jQuery('Range '),jQuery(' - '))}function create_hide_payment_currency(e,t){return create_option_container(jQuery('Hide payment currency '),jQuery(' "))}function change_input_range_new(e,t){var i="";""!=document.getElementById("el_range_"+e+"1").value&&(i=document.getElementById("el_range_"+e+"1").value),document.getElementById(t+"_range_"+e+"form_id_temp").value=i}function hide_currency(e,t){document.getElementById(t+"_td_name_currency").style.display=e?"none":"table-cell"}function go_to_type_paypal_price_new(e){w_attr_name=[],w_attr_value=[],type_paypal_price_new(e,"Amount","","top","no","","","","no","",w_attr_name,w_attr_value,"","","no","no")}function type_paypal_price_new(e,t,i,a,n,l,d,_,r,o,m,s,u,c,p,f){jQuery("#element_type").val("type_paypal_price_new"),delete_last_child();var y=jQuery("#edit_table"),h=jQuery('
');y.append(h);var b=jQuery('
');h.append(b),b.append(create_field_type("type_paypal_price_new")),b.append(create_label(e,t)),b.append(create_label_position(e,a)),b.append(create_hide_label(e,n)),b.append(create_required(e,r)),b.append(create_readonly(e,p)),b.append(create_field_size(e,_));var v=jQuery('
');b.append(create_advanced_options_container(v)),v.append(create_payment_amount_range(e,u,c)),v.append(create_hide_payment_currency(e,f)),v.append(create_field_label_size(e,i)),v.append(create_class(e,o)),v.append(create_additional_attributes(e,m,"type_paypal_price_new"));var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value","type_paypal_price_new"),w.setAttribute("name",e+"_typeform_id_temp"),w.setAttribute("id",e+"_typeform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",r),g.setAttribute("name",e+"_requiredform_id_temp"),g.setAttribute("id",e+"_requiredform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",n),E.setAttribute("name",e+"_hide_labelform_id_temp"),E.setAttribute("id",e+"_hide_labelform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",p),A.setAttribute("name",e+"_readonlyform_id_temp"),A.setAttribute("id",e+"_readonlyform_id_temp");var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("value",u),j.setAttribute("name",e+"_range_minform_id_temp"),j.setAttribute("id",e+"_range_minform_id_temp");var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value",c),x.setAttribute("name",e+"_range_maxform_id_temp"),x.setAttribute("id",e+"_range_maxform_id_temp");var k=document.createElement("div");k.setAttribute("id","main_div");var I=document.createElement("div");I.setAttribute("id",e+"_elemet_tableform_id_temp");var C="yes"==n?"none":"table-cell",B=document.createElement("div");B.setAttribute("align","left"),B.style.display=C,B.style.width=i+"px",B.setAttribute("id",e+"_label_sectionform_id_temp");var Q=document.createElement("div");Q.setAttribute("align","left"),Q.style.display="table-cell",Q.setAttribute("id",e+"_element_sectionform_id_temp");var T=document.createElement("div");T.setAttribute("id",e+"_table_price"),T.style.display="table";var M=document.createElement("div");M.setAttribute("id",e+"_tr_price1"),M.style.display="table-row";var L=document.createElement("div");L.setAttribute("id",e+"_td_name_currency"),L.style.display="no"==f?"table-cell":"none";var z=document.createElement("div");z.setAttribute("id",e+"_td_name_dollars"),z.style.display="table-cell";var q=document.createElement("div");q.style.display="table-cell";var H=document.createElement("div");H.setAttribute("align","left"),H.style.display="table-cell";var N=document.createElement("div");N.setAttribute("id",e+"_td_name_label_divider"),N.style.display="table-cell";var S=document.createElement("div");S.setAttribute("align","left"),S.setAttribute("id",e+"_td_name_label_cents"),S.style.display="table-cell";var D=document.createElement("span");D.setAttribute("id",e+"_element_labelform_id_temp"),D.innerHTML=t,D.setAttribute("class","label"),D.style.verticalAlign="top";var P=document.createElement("span");P.setAttribute("id",e+"_required_elementform_id_temp"),P.innerHTML="",P.setAttribute("class","required"),P.style.verticalAlign="top","yes"==r&&(P.innerHTML=" *");var O=document.createElement("span");O.setAttribute("class","wdform_colon"),O.style.cssText="font-style:bold; vertical-align:middle",O.innerHTML="\x3c!--repstart--\x3e $ \x3c!--repend--\x3e";var K=document.createElement("label");K.setAttribute("class","mini_label");var U=document.createElement("input");U.setAttribute("type","text"),U.style.cssText="width:"+_+"px",U.setAttribute("id",e+"_elementform_id_temp"),U.setAttribute("name",e+"_elementform_id_temp"),U.setAttribute("value",l),U.setAttribute("title",d),U.setAttribute("placeholder",d),"yes"==p&&U.setAttribute("readonly","readonly"),U.setAttribute("onKeyPress","return check_isnum(event)");var F=document.createElement("label");F.setAttribute("class","mini_label"),F.setAttribute("id",e+"_mini_label_dollars");var R=document.getElementById("show_table");B.appendChild(D),B.appendChild(P),Q.appendChild(E),L.appendChild(O),z.appendChild(U),M.appendChild(L),M.appendChild(z),q.appendChild(K),H.appendChild(F),T.appendChild(M),Q.appendChild(w),Q.appendChild(g),Q.appendChild(A),Q.appendChild(j),Q.appendChild(x),Q.appendChild(T),I.appendChild(B),I.appendChild(Q),k.appendChild(I),R.appendChild(k),jQuery("#main_div").append(" "+form_maker.type_price_description),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_text")}function create_paypal_select_options(e,t,i,a,l){var d=jQuery('Options '),_=jQuery(' Option ');if(form_maker.is_demo)var r=jQuery(' From Database ');else r=jQuery(" From Database ');var o=jQuery('IMPORTANT! Check the "Empty value" checkbox only if you want the option to be considered as empty.
'),m=jQuery('
'),s=jQuery('
');for(m.append(s),n=t.length,j=0;j
');m.append(u)}var c=d;return create_option_container(null,c=(c=(c=(c=c.add(_)).add(r)).add(m)).add(o))}function create_payment_quantity(e,t,i){return create_option_container(jQuery('Quantity property '),jQuery(' "))}function add_quantity(e,t){if(div_=document.getElementById(e+"_divform_id_temp"),""==form_maker_getElementsByAttribute(div_,"*","id",e+"_element_quantityform_id_temp")){select_=document.createElement("input"),select_.setAttribute("type","text"),select_.setAttribute("value",t),select_.setAttribute("id",e+"_element_quantityform_id_temp"),select_.setAttribute("name",e+"_element_quantityform_id_temp"),select_.setAttribute("onKeyPress","return check_isnum(event)"),select_.style.cssText="width:30px; margin:2px 0px";var i=document.createElement("label");i.innerHTML="\x3c!--repstart--\x3eQuantity\x3c!--repend--\x3e",i.style.cssText="margin-right:5px",i.setAttribute("class","mini_label"),i.setAttribute("id",e+"_element_quantity_label_form_id_temp");var a=document.createElement("span");a.style.cssText="margin-right:15px",a.setAttribute("id",e+"_element_quantity_spanform_id_temp"),a.appendChild(i),a.appendChild(select_),div_.firstChild?div_.insertBefore(a,div_.firstChild):div_.appendChild(a)}else div_.removeChild(document.getElementById(e+"_element_quantity_spanform_id_temp"))}function create_payment_property(e){var t=jQuery('Product properties '),i=jQuery(" '),a=jQuery(''),n=t;return create_option_container(null,n=(n=n.add(i)).add(a))}function add_choise_price(e,t){var i=0;document.getElementById(t+"_hor")&&(i=1,flow_ver(t));var a=0;if(jQuery(".change_pos").each(function(){var e=parseInt(jQuery(this)[0].id);a=a
');m.append(s),refresh_attr(t,"type_checkbox")}if("select"==e){var u=document.getElementById(t+"_elementform_id_temp"),c=document.createElement("option");c.setAttribute("id",t+"_option"+a),u.appendChild(c);m=jQuery("#choices"),s=jQuery('');m.append(s)}1==i&&flow_hor(t)}function flow_hor(e){for(tbody=document.getElementById(e+"_table_little"),td_array=new Array,n=tbody.childNodes.length,k=0;k');w.append(g);var E=jQuery('
');g.append(E),E.append(create_field_type("type_paypal_select")),E.append(create_label(i,e)),E.append(create_label_position(i,a)),E.append(create_hide_label(i,l)),E.append(create_required(i,m)),E.append(create_field_size(i,d)),E.append(create_paypal_select_options(i,_,v,r,y));var A=jQuery('
');E.append(create_advanced_options_container(A)),A.append(create_payment_quantity(i,u,s)),A.append(create_payment_property(i)),A.append(create_field_label_size(i,t)),A.append(create_class(i,c)),A.append(create_additional_attributes(i,p,"type_paypal_select"));var x=document.createElement("input");x.setAttribute("type","hidden"),x.setAttribute("value","type_paypal_select"),x.setAttribute("name",i+"_typeform_id_temp"),x.setAttribute("id",i+"_typeform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",m),k.setAttribute("name",i+"_requiredform_id_temp"),k.setAttribute("id",i+"_requiredform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",l),I.setAttribute("name",i+"_hide_labelform_id_temp"),I.setAttribute("id",i+"_hide_labelform_id_temp");var C=document.createElement("div");C.setAttribute("id","main_div");var B=document.createElement("div");B.setAttribute("id",i+"_elemet_tableform_id_temp");var Q="yes"==l?"none":"table-cell",T=document.createElement("div");T.setAttribute("align","left"),T.style.display=Q,T.style.width=t+"px",T.setAttribute("id",i+"_label_sectionform_id_temp");var M=document.createElement("div");M.setAttribute("align","left"),M.style.display="table-cell",M.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var L=document.createElement("br"),z=(document.createElement("br"),document.createElement("div"));z.setAttribute("id",i+"_table_little"),z.style.display="table";var q=document.createElement("div");q.setAttribute("id",i+"_element_tr1"),q.style.display="table-row";var H=document.createElement("div");H.setAttribute("id",i+"_element_tr2"),H.style.display="table-row";var N=document.createElement("div");N.setAttribute("valign","top"),N.setAttribute("id",i+"_td_little1"),N.style.display="table-cell";var S=document.createElement("div");S.setAttribute("valign","top"),S.setAttribute("id",i+"_td_little2"),S.style.display="table-cell";var D=document.createElement("span");D.setAttribute("id",i+"_element_labelform_id_temp"),D.innerHTML=e,D.setAttribute("class","label"),D.style.verticalAlign="top";var P=document.createElement("span");P.setAttribute("id",i+"_required_elementform_id_temp"),P.innerHTML="",P.setAttribute("class","required"),P.style.verticalAlign="top","yes"==m&&(P.innerHTML=" *");var O=document.createElement("select");for(O.setAttribute("id",i+"_elementform_id_temp"),O.setAttribute("name",i+"_elementform_id_temp"),O.style.cssText="width:"+d+"px",O.setAttribute("onchange","set_select(this)"),n=_.length,j=0;jRelative Position'),n=jQuery(' "),l=jQuery('Vertical '),d=jQuery(' "),_=jQuery('Horizontal '),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function create_paypal_radio_options(e,t,i,a,l){var d=jQuery('Options '),_=jQuery(' Option ');if(form_maker.is_demo)var r=jQuery(' From Database ');else r=jQuery(" From Database ');var o=jQuery('
'),m=jQuery('
');for(o.append(m),n=t.length,j=0;j
');o.append(s)}var u=d;return create_option_container(null,u=(u=(u=u.add(_)).add(r)).add(o))}function change_label_1(e,t){document.getElementById(e).value=t}function remove_choise_price(e,t){var i=0;document.getElementById(t+"_hor")&&(i=1,flow_ver(t));var a=document.getElementById(t+"_table_little"),n=document.getElementById(t+"_element_tr"+e);a.removeChild(n);var l=document.getElementById("choices"),d=document.getElementById(e);l.removeChild(d),1==i&&flow_hor(t)}function go_to_type_paypal_radio(e){w_choices=["product 1","product 2"],w_choices_price=["100","200"],w_choices_checked=["0","0"],w_choices_params=["","",""],w_attr_name=[],w_attr_value=[],w_property=[],w_property_values=[],type_paypal_radio(e,"Payment Single Choice","","top","right","no","ver",w_choices,w_choices_price,w_choices_checked,"no","no","no","0","",w_attr_name,w_attr_value,w_property,w_property_values,"no","1",w_choices_params)}function type_paypal_radio(i,e,t,a,l,d,_,r,o,m,s,u,c,p,f,y,h,b,v,w,g,E){jQuery("#element_type").val("type_paypal_radio"),delete_last_child();var A=jQuery("#edit_table"),x=jQuery('
');A.append(x);var k=jQuery('
');x.append(k),k.append(create_field_type("type_paypal_radio")),k.append(create_label(i,e)),k.append(create_label_position(i,a)),k.append(create_hide_label(i,d)),k.append(create_required(i,s)),k.append(create_payment_relative_position(i,_,"radio")),k.append(create_option_label_position(i,l,"radio")),k.append(create_paypal_radio_options(i,r,E,o,"radio"));var I=jQuery('
');k.append(create_advanced_options_container(I)),I.append(create_payment_quantity(i,g,w)),I.append(create_payment_property(i)),I.append(create_field_label_size(i,t)),I.append(create_class(i,f)),I.append(create_additional_attributes(i,y,"type_paypal_radio"));var C=document.createElement("br"),B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value","type_paypal_radio"),B.setAttribute("name",i+"_typeform_id_temp"),B.setAttribute("id",i+"_typeform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",s),Q.setAttribute("name",i+"_requiredform_id_temp"),Q.setAttribute("id",i+"_requiredform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",d),T.setAttribute("name",i+"_hide_labelform_id_temp"),T.setAttribute("id",i+"_hide_labelform_id_temp");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",u),M.setAttribute("name",i+"_randomizeform_id_temp"),M.setAttribute("id",i+"_randomizeform_id_temp");var L=document.createElement("input");L.setAttribute("type","hidden"),L.setAttribute("value",c),L.setAttribute("name",i+"_allow_otherform_id_temp"),L.setAttribute("id",i+"_allow_otherform_id_temp");var z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",l),z.setAttribute("id",i+"_option_left_right");var q=document.createElement("div");q.setAttribute("id","main_div");var H=document.createElement("div");H.setAttribute("id",i+"_elemet_tableform_id_temp");var N="yes"==d?"none":"table-cell",S=document.createElement("div");S.setAttribute("align","left"),S.style.display=N,S.style.width=t+"px",S.setAttribute("id",i+"_label_sectionform_id_temp");var D=document.createElement("div");D.setAttribute("align","left"),D.style.display="table-cell",D.setAttribute("id",i+"_element_sectionform_id_temp");var P=document.createElement("div");P.style.display="table";var O=document.createElement("div");O.setAttribute("id",i+"_table_little"),O.style.display="table-row-group",P.appendChild(O);var K=document.createElement("div");K.setAttribute("id",i+"_element_tr1"),K.style.display="table-row";var U=document.createElement("div");U.setAttribute("id",i+"_element_tr2"),U.style.display="table-row";var F=document.createElement("div");F.setAttribute("valign","top"),F.setAttribute("id",i+"_td_little1"),F.style.display="table-cell";var R=document.createElement("div");R.setAttribute("valign","top"),R.setAttribute("id",i+"_td_little2"),R.style.display="table-cell";var W=document.createElement("span");W.setAttribute("id",i+"_element_labelform_id_temp"),W.innerHTML=e,W.setAttribute("class","wd_form_label"),W.style.verticalAlign="top";var V=document.createElement("span");for(V.setAttribute("id",i+"_required_elementform_id_temp"),V.innerHTML="",V.setAttribute("class","required"),V.style.verticalAlign="top","yes"==s&&(V.innerHTML=" *"),n=r.length,j=0;j');A.append(x);var k=jQuery('
');x.append(k),k.append(create_field_type("type_paypal_checkbox")),k.append(create_label(i,e)),k.append(create_label_position(i,a)),k.append(create_hide_label(i,d)),k.append(create_required(i,s)),k.append(create_payment_relative_position(i,_,"checkbox")),k.append(create_option_label_position(i,l,"checkbox")),k.append(create_paypal_radio_options(i,r,E,o,"checkbox"));var I=jQuery('
');k.append(create_advanced_options_container(I)),I.append(create_payment_quantity(i,g,w)),I.append(create_payment_property(i)),I.append(create_field_label_size(i,t)),I.append(create_class(i,f)),I.append(create_additional_attributes(i,y,"type_paypal_checkbox")),element="input",type="checkbox";var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value","type_paypal_checkbox"),C.setAttribute("name",i+"_typeform_id_temp"),C.setAttribute("id",i+"_typeform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",s),B.setAttribute("name",i+"_requiredform_id_temp"),B.setAttribute("id",i+"_requiredform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",d),Q.setAttribute("name",i+"_hide_labelform_id_temp"),Q.setAttribute("id",i+"_hide_labelform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",u),T.setAttribute("name",i+"_randomizeform_id_temp"),T.setAttribute("id",i+"_randomizeform_id_temp");var M=document.createElement("input");M.setAttribute("type","hidden"),M.setAttribute("value",c),M.setAttribute("name",i+"_allow_otherform_id_temp"),M.setAttribute("id",i+"_allow_otherform_id_temp");var L=document.createElement("input");L.setAttribute("type","hidden"),L.setAttribute("value",p),L.setAttribute("name",i+"_allow_other_numform_id_temp"),L.setAttribute("id",i+"_allow_other_numform_id_temp");var z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",l),z.setAttribute("id",i+"_option_left_right");var q=document.createElement("div");q.setAttribute("id","main_div");var H=document.createElement("div");H.setAttribute("id",i+"_elemet_tableform_id_temp");var N="yes"==d?"none":"table-cell",S=document.createElement("div");S.setAttribute("align","left"),S.style.display=N,S.style.width=t+"px",S.setAttribute("id",i+"_label_sectionform_id_temp");var D=document.createElement("div");D.setAttribute("align","left"),D.style.display="table-cell",D.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var P=document.createElement("br"),O=(document.createElement("br"),document.createElement("div"));O.style.display="table";var K=document.createElement("div");K.setAttribute("id",i+"_table_little"),K.style.display="table-row-group",O.appendChild(K);var U=document.createElement("span");U.setAttribute("id",i+"_element_labelform_id_temp"),U.innerHTML=e,U.setAttribute("class","label"),U.style.verticalAlign="top";var F=document.createElement("span");for(F.setAttribute("id",i+"_required_elementform_id_temp"),F.innerHTML="",F.setAttribute("class","required"),F.style.verticalAlign="top","yes"==s&&(F.innerHTML=" *"),n=r.length,j=0;j');g.append(E);var A=jQuery('
');E.append(A),A.append(create_field_type("type_paypal_shipping")),A.append(create_label(i,e)),A.append(create_label_position(i,a)),A.append(create_hide_label(i,d)),A.append(create_required(i,s)),A.append(create_payment_relative_position(i,_,"radio")),A.append(create_option_label_position(i,l,"radio")),A.append(create_paypal_radio_options(i,r,w,o,"radio"));var x=jQuery('
');A.append(create_advanced_options_container(x)),x.append(create_field_label_size(i,t)),x.append(create_class(i,f)),x.append(create_additional_attributes(i,y,"type_paypal_shipping")),element="input",type="radio";var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value","type_paypal_shipping"),k.setAttribute("name",i+"_typeform_id_temp"),k.setAttribute("id",i+"_typeform_id_temp");var I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("value",s),I.setAttribute("name",i+"_requiredform_id_temp"),I.setAttribute("id",i+"_requiredform_id_temp");var C=document.createElement("input");C.setAttribute("type","hidden"),C.setAttribute("value",d),C.setAttribute("name",i+"_hide_labelform_id_temp"),C.setAttribute("id",i+"_hide_labelform_id_temp");var B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",u),B.setAttribute("name",i+"_randomizeform_id_temp"),B.setAttribute("id",i+"_randomizeform_id_temp");var Q=document.createElement("input");Q.setAttribute("type","hidden"),Q.setAttribute("value",c),Q.setAttribute("name",i+"_allow_otherform_id_temp"),Q.setAttribute("id",i+"_allow_otherform_id_temp");var T=document.createElement("input");T.setAttribute("type","hidden"),T.setAttribute("value",l),T.setAttribute("id",i+"_option_left_right");var M=document.createElement("div");M.setAttribute("id","main_div");var L=document.createElement("div");L.setAttribute("id",i+"_elemet_tableform_id_temp");var z="yes"==d?"none":"table-cell",q=document.createElement("div");q.setAttribute("align","left"),q.style.display=z,q.style.width=t+"px",q.setAttribute("id",i+"_label_sectionform_id_temp");var H=document.createElement("div");H.setAttribute("align","left"),H.style.display="table-cell",H.setAttribute("id",i+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var N=document.createElement("br"),S=(document.createElement("br"),document.createElement("div"));S.style.display="table";var D=document.createElement("div");D.setAttribute("id",i+"_table_little"),D.style.display="table-row-group",S.appendChild(D);var P=document.createElement("div");P.setAttribute("id",i+"_element_tr1"),P.style.display="table-row";var O=document.createElement("div");O.setAttribute("id",i+"_element_tr2"),O.style.display="table-row";var K=document.createElement("div");K.setAttribute("valign","top"),K.setAttribute("id",i+"_td_little1"),K.style.display="table-cell";var U=document.createElement("div");U.setAttribute("valign","top"),U.setAttribute("id",i+"_td_little2"),U.style.display="table-cell";var F=document.createElement("span");F.setAttribute("id",i+"_element_labelform_id_temp"),F.innerHTML=e,F.setAttribute("class","label"),F.style.verticalAlign="top";var R=document.createElement("span");for(R.setAttribute("id",i+"_required_elementform_id_temp"),R.innerHTML="",R.setAttribute("class","required"),R.style.verticalAlign="top","yes"==s&&(R.innerHTML=" *"),n=r.length,j=0;j');_.append(r);var o=jQuery('
');r.append(o),o.append(create_field_type("type_paypal_total")),o.append(create_label(e,t)),o.append(create_label_position(e,a)),o.append(create_hide_label(e,n));var m=jQuery('
');o.append(create_advanced_options_container(m)),m.append(create_field_label_size(e,i)),m.append(create_class(e,l));var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("value","type_paypal_total"),s.setAttribute("name",e+"_typeform_id_temp"),s.setAttribute("id",e+"_typeform_id_temp");var u=document.createElement("input");u.setAttribute("type","hidden"),u.setAttribute("value",n),u.setAttribute("name",e+"_hide_labelform_id_temp"),u.setAttribute("id",e+"_hide_labelform_id_temp");var c=document.createElement("div");c.setAttribute("id","main_div");var p=document.createElement("div");p.setAttribute("id",e+"_elemet_tableform_id_temp");var f="yes"==n?"none":"table-cell",y=document.createElement("div");y.setAttribute("align","left"),y.style.display=f,y.style.width=i+"px",y.setAttribute("id",e+"_label_sectionform_id_temp");var h=document.createElement("div");h.setAttribute("align","left"),h.style.display="table-cell",h.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var b=document.createElement("br"),v=(document.createElement("br"),document.createElement("span"));v.setAttribute("id",e+"_element_labelform_id_temp"),v.innerHTML=t,v.setAttribute("class","label");var w=document.createElement("div");w.setAttribute("id",e+"paypal_totalform_id_temp"),w.setAttribute("class","wdform_paypal_total paypal_totalform_id_temp"),w.style.cssText="width:"+d+"px;";var g=document.createElement("div");g.setAttribute("id",e+"div_totalform_id_temp"),g.setAttribute("class","div_totalform_id_temp"),g.style.cssText="margin-bottom:10px;",g.innerHTML="\x3c!--repstart--\x3e$300\x3c!--repend--\x3e";var E=document.createElement("div");E.setAttribute("id",e+"paypal_productsform_id_temp"),E.setAttribute("class","paypal_productsform_id_temp"),E.style.cssText="border-spacing: 2px;";var A=document.createElement("div");A.style.cssText="border-spacing: 2px;",A.innerHTML="\x3c!--repstart--\x3eproduct 1 $100\x3c!--repend--\x3e";var j=document.createElement("div");j.style.cssText="border-spacing: 2px;",j.innerHTML="\x3c!--repstart--\x3eproduct 2 $200\x3c!--repend--\x3e";var x=document.createElement("div");x.style.cssText="border-spacing: 2px; margin-top:7px;",x.setAttribute("id",e+"paypal_taxform_id_temp"),x.setAttribute("class","paypal_taxform_id_temp");var k=document.createElement("input");k.setAttribute("type","hidden"),k.setAttribute("value",""),k.setAttribute("name",e+"_paypal_totalform_id_temp"),k.setAttribute("class","input_paypal_totalform_id_temp"),w.appendChild(k),E.appendChild(A),E.appendChild(j),w.appendChild(g),w.appendChild(E),w.appendChild(x);var I=document.getElementById("show_table"),C=k=document.createElement("p");C.style.cssText="color: red;";var B=document.createTextNode("This is sample calculation. On front-end you will see the calculation based on your Payment field values.");C.appendChild(B),y.appendChild(v),h.appendChild(u),h.appendChild(s),h.appendChild(w),p.appendChild(y),p.appendChild(h),c.appendChild(p),c.appendChild(b),c.appendChild(C),I.appendChild(c),jQuery("#main_div").append(form_maker.type_total_description),"top"==a&&label_top(e),change_class(l,e)}function create_map_locations(e){var t=jQuery('Location '),i=jQuery(' '),a=jQuery('Drag the marker to change default marker position.
'),n=jQuery('
'),l=t;return create_option_container(null,l=(l=(l=l.add(i)).add(a)).add(n))}function add_marker(e,t,i,a,n){var l=jQuery("#markers");if(-1==t){var d=l.children().last();t=0'),r=jQuery('
');r.append(create_markmap_address(e,t)),r.append(create_markmap_longitude(e,i,t)),r.append(create_markmap_latitude(e,a,t)),r.append(create_markmap_info(e,n,t)),_.append(r);var o=jQuery('
');_.append(o),l.append(_);var m=document.getElementById(e+"_elementform_id_temp");m.setAttribute("long"+t,i),m.setAttribute("lat"+t,a),m.setAttribute("info"+t,n),add_marker_on_map(e,t,i,a,n,!0)}function remove_map(e,t){table=document.getElementById("marker_opt"+t),table.parentNode.removeChild(table),map=document.getElementById(e+"_elementform_id_temp"),map.removeAttribute("long"+t),map.removeAttribute("lat"+t),map.removeAttribute("info"+t),remove_marker(e,t)}function type_map(e,t,i,a,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_map"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('
');c.append(p);var f=jQuery('
');p.append(f),f.append(create_field_type("type_map")),f.append(create_map_locations(e)),f.append(create_markmap_size(e,_,r)),f.append(create_keys(e,"To set up map key click here"));var y=jQuery('
');f.append(create_advanced_options_container(y)),y.append(create_class(e,o)),y.append(create_additional_attributes(e,s,"type_map"));var h=document.createElement("br"),b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_map"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("div");v.setAttribute("id",e+"_elementform_id_temp"),v.style.cssText="width:"+_+"px; height: "+r+"px;",v.setAttribute("zoom",d),v.setAttribute("center_x",t),v.setAttribute("center_y",i);var w=document.createElement("span");w.setAttribute("id",e+"_element_labelform_id_temp"),w.innerHTML="map_"+e,w.style.cssText="display:none";var g=document.createElement("div");g.setAttribute("id","main_div");var E=document.createElement("div");E.setAttribute("id",e+"_elemet_tableform_id_temp");var A=document.createElement("div");A.setAttribute("align","left"),A.style.display="table-cell",A.setAttribute("id",e+"_label_sectionform_id_temp");var x=document.createElement("div");x.setAttribute("align","left"),x.style.display="block",x.setAttribute("id",e+"_element_sectionform_id_temp");var k=document.getElementById("show_table");for(A.appendChild(w),x.appendChild(b),x.appendChild(v),E.appendChild(A),E.appendChild(x),g.appendChild(E),g.appendChild(h),k.appendChild(g),jQuery("#main_div").append(form_maker.type_map_description),change_class(o,e),refresh_attr(e,"type_text"),if_gmap_init(e),n=a.length,j=0;jTime Format'),a=jQuery(' "),n=jQuery('24 hour '),l=jQuery(' "),d=jQuery('12 hour '),_=a;return create_option_container(i,_=(_=(_=_.add(n)).add(l)).add(d))}function format_24(e){tr_time1=document.getElementById(e+"_tr_time1"),td1=document.getElementById(e+"_am_pm_select"),tr_time2=document.getElementById(e+"_tr_time2"),td2=document.getElementById(e+"_am_pm_label"),tr_time1.removeChild(td1),tr_time2.removeChild(td2),document.getElementById(e+"_hhform_id_temp").value="",document.getElementById(e+"_mmform_id_temp").value="",document.getElementById(e+"_ssform_id_temp")&&(document.getElementById(e+"_ssform_id_temp").value="")}function format_12(t,e,i,a,n){tr_time1=document.getElementById(t+"_tr_time1"),tr_time2=document.getElementById(t+"_tr_time2");var l=document.createElement("div");l.setAttribute("id",t+"_am_pm_select"),l.setAttribute("class","td_am_pm_select"),l.style.display="table-cell";var d=document.createElement("div");d.setAttribute("id",t+"_am_pm_label"),d.setAttribute("class","td_am_pm_select"),d.style.display="table-cell";var _=document.createElement("select");_.setAttribute("class","am_pm_select"),_.setAttribute("name",t+"_am_pmform_id_temp"),_.setAttribute("id",t+"_am_pmform_id_temp"),_.setAttribute("onchange","set_sel_am_pm(this)");var r=document.createElement("option");r.setAttribute("value","am"),r.innerHTML="AM";var o=document.createElement("option");o.setAttribute("value","pm"),o.innerHTML="PM","pm"==e?o.setAttribute("selected","selected"):r.setAttribute("selected","selected");var m=document.createElement("label");m.setAttribute("class","mini_label"),m.setAttribute("id",t+"_mini_label_am_pm"),m.innerHTML=w_mini_labels[3],_.appendChild(r),_.appendChild(o),l.appendChild(_),d.appendChild(m),tr_time1.appendChild(l),tr_time2.appendChild(d),document.getElementById(t+"_hhform_id_temp").value=i,document.getElementById(t+"_mmform_id_temp").value=a,document.getElementById(t+"_ssform_id_temp")&&(document.getElementById(t+"_ssform_id_temp").value=n),refresh_attr(t,"type_time"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_am_pm").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.am_pm").focus(),jQuery("input.am_pm").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_am_pm").text(e)})}})})}function create_display_seconds(e,t,i){var a=jQuery('Display Seconds '),n=jQuery(' "),l=jQuery('Yes '),d=jQuery(' "),_=jQuery('No '),r=n;return create_option_container(a,r=(r=(r=r.add(l)).add(d)).add(_))}function second_yes(t,e){time_box=document.getElementById(t+"_tr_time1"),text_box=document.getElementById(t+"_tr_time2");var i=document.createElement("div");i.setAttribute("align","center"),i.style.display="table-cell";var a=document.createElement("div");a.setAttribute("id",t+"_td_time_input3"),a.style.display="table-cell";var n=document.createElement("div");n.style.display="table-cell";var l=document.createElement("div");l.setAttribute("id",t+"_td_time_label3"),l.style.display="table-cell";var d=document.createElement("span");d.setAttribute("class","wdform_colon"),d.style.cssText="font-style:bold; vertical-align:middle",d.innerHTML=" : ",i.appendChild(d);var _=document.createElement("input");_.setAttribute("type","text"),_.setAttribute("value",e),_.setAttribute("class","time_box"),_.setAttribute("id",t+"_ssform_id_temp"),_.setAttribute("name",t+"_ssform_id_temp"),_.setAttribute("onBlur","add_0('"+t+"_ssform_id_temp')");var r=document.createElement("label");r.setAttribute("class","mini_label"),r.innerHTML="SS",r.setAttribute("id",t+"_mini_label_ss"),a.appendChild(_),l.appendChild(r),document.getElementById(t+"_am_pm_select")?(select_=document.getElementById(t+"_am_pm_select"),select_text=document.getElementById(t+"_am_pm_label"),time_box.insertBefore(a,select_),time_box.insertBefore(i,a),text_box.insertBefore(l,select_text),text_box.insertBefore(n,l)):(time_box.appendChild(i),time_box.appendChild(a),text_box.appendChild(n),text_box.appendChild(l)),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_ss").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.ss").focus(),jQuery("input.ss").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_ss").text(e)})}})}),refresh_attr(t,"type_time")}function second_no(e){time_box=document.getElementById(e+"_tr_time1"),text_box=document.getElementById(e+"_tr_time2"),second_box=document.getElementById(e+"_td_time_input3"),second_text=document.getElementById(e+"_td_time_label3"),document.getElementById(e+"_td_time_input2").parentNode.removeChild(document.getElementById(e+"_td_time_input2").nextSibling),time_box.removeChild(second_box),text_box.removeChild(second_text.previousSibling),text_box.removeChild(second_text)}function go_to_type_time(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["HH","MM","SS","AM/PM"],type_time(e,"Time","","top","no","24","0","1","","","",w_mini_labels,"no","",w_attr_name,w_attr_value)}function type_time(t,e,i,a,n,l,d,_,r,o,m,s,u,c,p,f){jQuery("#element_type").val("type_time"),delete_last_child();var y=jQuery("#edit_table"),h=jQuery('
');y.append(h);var b=jQuery('
');h.append(b),b.append(create_field_type("type_time")),b.append(create_label(t,e)),b.append(create_label_position(t,a)),b.append(create_time_format(t,l)),b.append(create_display_seconds(t,m,_)),b.append(create_hide_label(t,n)),b.append(create_required(t,u));var v=jQuery('
');b.append(create_advanced_options_container(v)),v.append(create_field_label_size(t,i)),v.append(create_class(t,c)),v.append(create_additional_attributes(t,p,"type_time"));var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value","type_time"),w.setAttribute("name",t+"_typeform_id_temp"),w.setAttribute("id",t+"_typeform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",u),g.setAttribute("name",t+"_requiredform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",n),E.setAttribute("name",t+"_hide_labelform_id_temp"),E.setAttribute("id",t+"_hide_labelform_id_temp"),g.setAttribute("id",t+"_requiredform_id_temp");var A=document.createElement("div");A.setAttribute("id","main_div");var j=document.createElement("div");j.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),j.appendChild(edit_labels);var x=document.createElement("div");x.setAttribute("id",t+"_elemet_tableform_id_temp");var k="yes"==n?"none":"table-cell",I=document.createElement("div");I.setAttribute("align","left"),I.style.display=k,I.style.width=i+"px",I.setAttribute("id",t+"_label_sectionform_id_temp");var C=document.createElement("div");C.setAttribute("align","left"),C.style.display="table-cell",C.setAttribute("id",t+"_element_sectionform_id_temp");var B=document.createElement("div");B.setAttribute("id",t+"_table_time"),B.style.display="table";var Q=document.createElement("div");Q.setAttribute("id",t+"_tr_time1"),Q.style.display="table-row";var T=document.createElement("div");T.setAttribute("id",t+"_tr_time2"),T.style.display="table-row";var M=document.createElement("div");M.setAttribute("id",t+"_td_time_input1"),M.style.cssText="width:32px",M.style.display="table-cell";var L=document.createElement("div");L.setAttribute("align","center"),L.style.display="table-cell";var z=document.createElement("div");z.setAttribute("id",t+"_td_time_input2"),z.style.cssText="width:32px",z.style.display="table-cell";var q=document.createElement("div");q.setAttribute("align","center"),q.style.display="table-cell";var H=document.createElement("div");H.setAttribute("id",t+"_td_time_input3"),H.style.cssText="width:32px",H.style.display="table-cell";var N=document.createElement("div");N.setAttribute("id",t+"_td_time_label1"),N.style.display="table-cell";var S=document.createElement("div");S.style.display="table-cell";var D=document.createElement("div");D.setAttribute("id",t+"_td_time_label2"),D.style.display="table-cell";var P=document.createElement("div");P.style.display="table-cell";var O=document.createElement("div");O.setAttribute("id",t+"_td_time_label3"),O.style.display="table-cell";document.createElement("br"),document.createElement("br");var K=document.createElement("br"),U=(document.createElement("br"),document.createElement("span"));U.setAttribute("id",t+"_element_labelform_id_temp"),U.innerHTML=e,U.setAttribute("class","label"),U.style.verticalAlign="top";var F=document.createElement("span");F.setAttribute("id",t+"_required_elementform_id_temp"),F.innerHTML="",F.setAttribute("class","required"),F.style.verticalAlign="top","yes"==u&&(F.innerHTML=" *");var R=document.createElement("input");R.setAttribute("type","text"),R.setAttribute("value",r),R.setAttribute("class","time_box"),R.setAttribute("id",t+"_hhform_id_temp"),R.setAttribute("name",t+"_hhform_id_temp"),R.setAttribute("onBlur","add_0('"+t+"_hhform_id_temp')");var W=document.createElement("label");W.setAttribute("class","mini_label"),W.setAttribute("id",t+"_mini_label_hh"),W.innerHTML=s[0];var V=document.createElement("span");V.setAttribute("class","wdform_colon"),V.style.cssText="font-style:bold; vertical-align:middle",V.innerHTML=" : ";var $=document.createElement("input");$.setAttribute("type","text"),$.setAttribute("value",o),$.setAttribute("class","time_box"),$.setAttribute("id",t+"_mmform_id_temp"),$.setAttribute("name",t+"_mmform_id_temp"),$.setAttribute("onBlur","add_0('"+t+"_mmform_id_temp')");var G=document.createElement("label");G.setAttribute("class","mini_label"),G.setAttribute("id",t+"_mini_label_mm"),G.innerHTML=s[1];var Y=document.createElement("span");Y.style.cssText="font-style:bold; vertical-align:middle",Y.innerHTML=" : ",Y.setAttribute("class","wdform_colon");var Z=document.createElement("input");Z.setAttribute("type","text"),Z.setAttribute("value",m),Z.setAttribute("class","time_box"),Z.setAttribute("id",t+"_ssform_id_temp"),Z.setAttribute("name",t+"_ssform_id_temp"),Z.setAttribute("onBlur","add_0('"+t+"_ssform_id_temp')");var X=document.createElement("label");X.setAttribute("class","mini_label"),X.setAttribute("id",t+"_mini_label_ss"),X.innerHTML=s[2];var J=document.getElementById("show_table");I.appendChild(U),I.appendChild(F),M.appendChild(R),L.appendChild(V),z.appendChild($),q.appendChild(Y),H.appendChild(Z),Q.appendChild(M),Q.appendChild(L),Q.appendChild(z),Q.appendChild(q),Q.appendChild(H),N.appendChild(W),D.appendChild(G),O.appendChild(X),T.appendChild(N),T.appendChild(S),T.appendChild(D),T.appendChild(P),T.appendChild(O),B.appendChild(Q),B.appendChild(T),C.appendChild(w),C.appendChild(g),C.appendChild(E),C.appendChild(B),x.appendChild(I),x.appendChild(C),A.appendChild(x),A.appendChild(K),A.appendChild(j),J.appendChild(A),jQuery("#main_div").append(" "+form_maker.type_time_description),"top"==a&&label_top(t),"12"==l&&format_12(t,d,r,o,m),"0"==_&&second_no(t),change_class(c,t),refresh_attr(t,"type_time"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_hh").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.hh").focus(),jQuery("input.hh").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_hh").text(e)})}}),jQuery("label#"+t+"_mini_label_mm").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.mm").focus(),jQuery("input.mm").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_mm").text(e)})}}),jQuery("label#"+t+"_mini_label_ss").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.ss").focus(),jQuery("input.ss").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_ss").text(e)})}})})}function go_to_type_send_copy(e){if(0!=jQuery("#take").find(jQuery("div[type='type_send_copy']")).length)return alert("This field already has been created."),void delete_last_child();w_attr_name=[],type_send_copy(e,"Send a copy of this message to yourself","","top","no",!(w_attr_value=[]),"no",w_attr_name,w_attr_value)}function type_send_copy(e,t,i,a,n,l,d,_,r){jQuery("#element_type").val("type_send_copy"),delete_last_child();var o=jQuery("#edit_table"),m=jQuery('
');o.append(m);var s=jQuery('
');m.append(s),s.append(create_field_type("type_send_copy")),s.append(create_label(e,t)),s.append(create_hide_label(e,n)),s.append(create_required(e,d));var u=jQuery('
');s.append(create_advanced_options_container(u)),u.append(create_field_label_size(e,i)),u.append(create_additional_attributes(e,_,"type_send_copy")),element="input",type="checkbox";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("value","type_send_copy"),c.setAttribute("name",e+"_typeform_id_temp"),c.setAttribute("id",e+"_typeform_id_temp");var p=document.createElement("input");p.setAttribute("type","hidden"),p.setAttribute("value",d),p.setAttribute("name",e+"_requiredform_id_temp"),p.setAttribute("id",e+"_requiredform_id_temp");var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value",n),f.setAttribute("name",e+"_hide_labelform_id_temp"),f.setAttribute("id",e+"_hide_labelform_id_temp");var y=document.createElement(element);y.setAttribute("type",type),l&&y.setAttribute("checked","checked"),y.setAttribute("id",e+"_elementform_id_temp"),y.setAttribute("name",e+"_elementform_id_temp"),y.setAttribute("onclick","set_checked('"+e+"','','form_id_temp')");var h=document.createElement("div");h.setAttribute("id","main_div");var b=document.createElement("div");b.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("Use the field to allow the user to choose whether to receive a copy of the submitted form or not. Do not forget to fill in User Email section in Email Options in advance."),b.appendChild(edit_labels);var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==n?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var A=document.createElement("br"),j=(document.createElement("br"),document.createElement("span"));j.setAttribute("id",e+"_element_labelform_id_temp"),j.innerHTML=t,j.setAttribute("class","label"),j.style.verticalAlign="top";var x=document.createElement("span");x.setAttribute("id",e+"_required_elementform_id_temp"),x.innerHTML="",x.setAttribute("class","required"),x.style.verticalAlign="top","yes"==d&&(x.innerHTML=" *");var k=document.getElementById("show_table");g.appendChild(j),g.appendChild(x),E.appendChild(c),E.appendChild(p),E.appendChild(f),E.appendChild(y),v.appendChild(g),v.appendChild(E),h.appendChild(v),h.appendChild(A),h.appendChild(b),k.appendChild(h),jQuery("#main_div").append(" "+form_maker.type_send_copy_description),"top"==a&&label_top(e),refresh_attr(e,"type_text")}function create_default_date_range(e,t,i){return create_option_container(jQuery('Default range '),jQuery(' - '))}function change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,new_element_value){if(void 0===new_element_value)var new_element_value=element_value;document.getElementById(id).value=new_element_value;var element_value_new=element_value;if("default_date"==date_fields)if("start"==start_end)if("today"==element_value)jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",new Date),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option","minDate",new Date);else if(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w"))if(""!==element_value)element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").attr("format"),new Date(element_value)),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option","minDate",element_value);else{jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",element_value),date_fields="minDate";var element_value=jQuery("#min_date").val();change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)}else jQuery("#"+id_int+"_elementform_id_temp0").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option","minDate",element_value);else"today"==element_value?(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",new Date),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option","maxDate",new Date)):-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("y")&&-1==element_value.indexOf("w")?""!==element_value?(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").attr("format"),new Date(element_value)),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option","maxDate",new Date(element_value))):(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",element_value),date_fields="maxDate",element_value=jQuery("#max_date").val(),change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)):(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("setDate",element_value),jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option","maxDate",element_value));"minDate"!=date_fields&&"maxDate"!=date_fields||("today"==element_value?("minDate"==date_fields&&""==jQuery("#default_date_start").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,new Date),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,new Date)),"minDate"==date_fields&&""!=jQuery("#default_date_start").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,new Date),element_value=jQuery("#default_date_start").val(),date_fields="default_date",start_end="start",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)),"maxDate"==date_fields&&""==jQuery("#default_date_end").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,new Date),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,new Date)),"maxDate"==date_fields&&""!=jQuery("#default_date_end").val()&&(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,new Date),element_value=jQuery("#default_date_end").val(),date_fields="default_date",start_end="end",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new))):(-1==element_value.indexOf("d")&&-1==element_value.indexOf("m")&&-1==element_value.indexOf("w")&&-1==element_value.indexOf("y")&&""!==element_value&&(element_value=jQuery.datepicker.formatDate(jQuery("#"+id_int+"_buttonform_id_temp").attr("format"),new Date(element_value))),("minDate"==date_fields&&""==jQuery("#default_date_start").val()||"maxDate"==date_fields&&""==jQuery("#default_date_end").val())&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,element_value),jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,element_value)),"minDate"==date_fields&&""!=jQuery("#default_date_start").val()&&(jQuery("#"+id_int+"_elementform_id_temp0").datepicker("option",date_fields,element_value),element_value=jQuery("#default_date_start").val(),date_fields="default_date",start_end="start",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)),"maxDate"==date_fields&&""!=jQuery("#default_date_end").val()&&(jQuery("#"+id_int+"_elementform_id_temp1").datepicker("option",date_fields,element_value),element_value=jQuery("#default_date_end").val(),date_fields="default_date",start_end="end",change_hidden_input_value_range(element_value,date_fields,start_end,id_int,id,element_value_new)))),"invalide_date"==date_fields&&jQuery("input[id^="+id_int+"_elementform_id_temp]").datepicker("option","beforeShowDay",function(date){for(var invalid_dates=element_value,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;i');t.append(edit_div);var edit_main_table=jQuery('
');edit_div.append(edit_main_table),edit_main_table.append(create_field_type("type_date_range")),edit_main_table.append(create_label(i,w_field_label)),edit_main_table.append(create_label_position(i,w_field_label_pos)),edit_main_table.append(create_hide_label(i,w_hide_label)),edit_main_table.append(create_required(i,w_required)),edit_main_table.append(create_field_size(i,w_size,"'"+i+"_elementform_id_temp0'","'"+i+"_elementform_id_temp1'")),edit_main_table.append(create_date_format(i,w_format)),edit_main_table.append(create_week_start(i,w_start_day));var advanced_options_container=jQuery('
');edit_main_table.append(create_advanced_options_container(advanced_options_container)),advanced_options_container.append(create_default_date_range(i,w_default_date_start,w_default_date_end)),advanced_options_container.append(create_minimum_date(i,w_min_date,!0)),advanced_options_container.append(create_maximum_date(i,w_max_date,!0)),advanced_options_container.append(create_excluded_dates(i,w_invalid_dates,!0)),advanced_options_container.append(create_selectable_week_days(i,w_show_days)),advanced_options_container.append(create_field_label_size(i,w_field_label_size)),advanced_options_container.append(create_class(i,w_class)),advanced_options_container.append(create_show_date_picker_button(i,w_show_image,"date_range")),advanced_options_container.append(create_additional_attributes(i,w_attr_name,"type_date_range"));var adding_type=document.createElement("input");adding_type.setAttribute("type","hidden"),adding_type.setAttribute("value","type_date_range"),adding_type.setAttribute("name",i+"_typeform_id_temp"),adding_type.setAttribute("id",i+"_typeform_id_temp");var adding_required=document.createElement("input");adding_required.setAttribute("type","hidden"),adding_required.setAttribute("value",w_required),adding_required.setAttribute("name",i+"_requiredform_id_temp"),adding_required.setAttribute("id",i+"_requiredform_id_temp");var adding_hide_label=document.createElement("input");adding_hide_label.setAttribute("type","hidden"),adding_hide_label.setAttribute("value",w_hide_label),adding_hide_label.setAttribute("name",i+"_hide_labelform_id_temp"),adding_hide_label.setAttribute("id",i+"_hide_labelform_id_temp");var adding_dis_past_days=document.createElement("input");adding_dis_past_days.setAttribute("type","hidden"),adding_dis_past_days.setAttribute("value",w_disable_past_days),adding_dis_past_days.setAttribute("id",i+"_dis_past_daysform_id_temp"),adding_dis_past_days.setAttribute("name",i+"_dis_past_daysform_id_temp");var adding_start_day=document.createElement("input");adding_start_day.setAttribute("type","hidden"),adding_start_day.setAttribute("value",w_start_day),adding_start_day.setAttribute("name",i+"_start_dayform_id_temp"),adding_start_day.setAttribute("id",i+"_start_dayform_id_temp");var adding_default_date_start=document.createElement("input");adding_default_date_start.setAttribute("type","hidden"),adding_default_date_start.setAttribute("name",i+"_default_date_id_temp_start"),adding_default_date_start.setAttribute("id",i+"_default_date_id_temp_start"),adding_default_date_start.setAttribute("value",w_default_date_start);var adding_default_date_end=document.createElement("input");adding_default_date_end.setAttribute("type","hidden"),adding_default_date_end.setAttribute("name",i+"_default_date_id_temp_end"),adding_default_date_end.setAttribute("id",i+"_default_date_id_temp_end"),adding_default_date_end.setAttribute("value",w_default_date_end);var adding_min_date=document.createElement("input");adding_min_date.setAttribute("type","hidden"),adding_min_date.setAttribute("name",i+"_min_date_id_temp"),adding_min_date.setAttribute("id",i+"_min_date_id_temp"),adding_min_date.setAttribute("value",w_min_date);var adding_max_date=document.createElement("input");adding_max_date.setAttribute("type","hidden"),adding_max_date.setAttribute("name",i+"_max_date_id_temp"),adding_max_date.setAttribute("id",i+"_max_date_id_temp"),adding_max_date.setAttribute("value",w_max_date);var adding_invalid_dates=document.createElement("input");adding_invalid_dates.setAttribute("type","hidden"),adding_invalid_dates.setAttribute("name",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("id",i+"_invalid_dates_id_temp"),adding_invalid_dates.setAttribute("value",w_invalid_dates);var adding_show_days=document.createElement("input");adding_show_days.setAttribute("type","hidden"),adding_show_days.setAttribute("name",i+"_show_week_days"),adding_show_days.setAttribute("id",i+"_show_week_days"),adding_show_days.setAttribute("sunday",w_show_days[0]),adding_show_days.setAttribute("monday",w_show_days[1]),adding_show_days.setAttribute("tuesday",w_show_days[2]),adding_show_days.setAttribute("wednesday",w_show_days[3]),adding_show_days.setAttribute("thursday",w_show_days[4]),adding_show_days.setAttribute("friday",w_show_days[5]),adding_show_days.setAttribute("saturday",w_show_days[6]);var adding_show_image=document.createElement("input");adding_show_image.setAttribute("type","hidden"),adding_show_image.setAttribute("value",w_show_image),adding_show_image.setAttribute("name",i+"_show_imageform_id_temp"),adding_show_image.setAttribute("id",i+"_show_imageform_id_temp");var adding_hide_time=document.createElement("input");adding_hide_time.setAttribute("type","hidden"),adding_hide_time.setAttribute("value",w_hide_time),adding_hide_time.setAttribute("name",i+"_hide_timeform_id_temp"),adding_hide_time.setAttribute("id",i+"_hide_timeform_id_temp");var div=document.createElement("div");div.setAttribute("id","main_div");var div_field=document.createElement("div");div_field.setAttribute("id",i+"_elemet_tableform_id_temp");var display_label_div="yes"==w_hide_label?"none":"table-cell",div_label=document.createElement("div");div_label.setAttribute("align","left"),div_label.style.display=display_label_div,div_label.style.width=w_field_label_size+"px",div_label.setAttribute("id",i+"_label_sectionform_id_temp");var div_element=document.createElement("div");div_element.setAttribute("align","left"),div_element.style.display="table-cell",div_element.style.position="relative",div_element.setAttribute("id",i+"_element_sectionform_id_temp");var table_date=document.createElement("div");table_date.setAttribute("id",i+"_table_date"),table_date.style.display="table";var tr_date1=document.createElement("div");tr_date1.setAttribute("id",i+"_tr_date1"),tr_date1.style.display="table-row";var tr_date2=document.createElement("div");tr_date2.setAttribute("id",i+"_tr_date2"),tr_date2.style.display="table-row";var td_date_input1=document.createElement("div");td_date_input1.setAttribute("id",i+"_td_date_input1"),td_date_input1.style.display="table-cell";var td_date_input2=document.createElement("div");td_date_input2.setAttribute("id",i+"_td_date_input2"),td_date_input2.style.display="table-cell";var td_date_input3=document.createElement("div");td_date_input3.setAttribute("id",i+"_td_date_input3"),td_date_input3.style.display="table-cell";var td_date_label1=document.createElement("div");td_date_label1.setAttribute("id",i+"_td_date_label1"),td_date_label1.style.display="table-cell";var td_date_label2=document.createElement("div");td_date_label2.setAttribute("id",i+"_td_date_label2"),td_date_label2.style.display="table-cell";var td_date_label3=document.createElement("div");td_date_label3.setAttribute("id",i+"_td_date_label3"),td_date_label3.style.display="table-cell";var br3=document.createElement("br"),br4=document.createElement("br"),label=document.createElement("span");label.setAttribute("id",i+"_element_labelform_id_temp"),label.innerHTML=w_field_label,label.setAttribute("class","label"),label.style.verticalAlign="top";var required=document.createElement("span");required.setAttribute("id",i+"_required_elementform_id_temp"),required.innerHTML="",required.setAttribute("class","required"),required.style.verticalAlign="top","yes"==w_required&&(required.innerHTML=" *");var adding=document.createElement("input");adding.setAttribute("type","text"),adding.setAttribute("value",w_date),adding.setAttribute("id",i+"_elementform_id_temp0"),adding.setAttribute("name",i+"_elementform_id_temp0"),adding.style.cssText="width:"+w_size+"px;";var adding_desc_p=document.createElement("p"),adding_desc_b=document.createElement("b"),text_format_1=document.createTextNode("The format can be combinations of the following:"),text_format_2=document.createTextNode("d - day of month (no leading zero)"),text_format_3=document.createTextNode("dd - day of month (two digit)"),text_format_4=document.createTextNode("o - day of the year (no leading zeros)"),text_format_5=document.createTextNode("oo - day of the year (three digit)"),text_format_6=document.createTextNode("D - day name short"),text_format_7=document.createTextNode("DD - day name long"),text_format_8=document.createTextNode("m - month of year (no leading zero)"),text_format_9=document.createTextNode("mm - month of year (two digit)"),text_format_10=document.createTextNode("M - month name short"),text_format_11=document.createTextNode("MM - month name long"),text_format_12=document.createTextNode("y - year (two digit)"),text_format_13=document.createTextNode("yy - year (four digit)"),format_br_1=document.createElement("br"),format_br_2=document.createElement("br"),format_br_3=document.createElement("br"),format_br_4=document.createElement("br"),format_br_5=document.createElement("br"),format_br_6=document.createElement("br"),format_br_7=document.createElement("br"),format_br_8=document.createElement("br"),format_br_9=document.createElement("br"),format_br_10=document.createElement("br"),format_br_11=document.createElement("br"),format_br_12=document.createElement("br"),format_br_13=document.createElement("br"),adding_desc_p_2=document.createElement("p"),adding_desc_b_2=document.createElement("b"),text_default_1=document.createTextNode("Accepted values of Default, Minimum and Maximum:"),text_default_3=document.createTextNode("Date: A fixed date using the date format mm/dd/yy, e.g. 05/25/2016"),text_default_2=document.createTextNode("Empty: No default / minimum / maximum"),text_default_4=document.createTextNode("'today' : current date"),text_default_5=document.createTextNode("Relative date: A number of days/weeks/months/years from today, e.g. '-1d' will be yesterday, '+1y+3m+2w+3d' will be 1 year, 3 months, 2 weeks and 3 days from today."),default_br_1=document.createElement("br"),default_br_2=document.createElement("br"),default_br_3=document.createElement("br"),default_br_4=document.createElement("br"),default_br_6=document.createElement("br"),default_br_7=document.createElement("br"),adding_desc_p_3=document.createElement("p"),adding_desc_b_3=document.createElement("b"),text_default_6=document.createTextNode("Dates to exclude:"),text_default_7=document.createTextNode("Enter comma-separated list of dates and date ranges using the date format 'mm/dd/yy', e.g. 08/15/2016, 06/15/2016-06/20/2016"),adding_0=document.createElement("input");adding_0.setAttribute("type","text"),adding_0.setAttribute("value",w_date),adding_0.setAttribute("id",i+"_elementform_id_temp0"),adding_0.setAttribute("name",i+"_elementform_id_temp0"),adding_0.style.cssText="width:"+w_size+"px;",adding_0.setAttribute("onChange","change_value_range('"+i+"_elementform_id_temp1', 'minDate', this.value)");var adding_1=document.createElement("input");adding_1.setAttribute("type","text"),adding_1.setAttribute("value",w_date),adding_1.setAttribute("id",i+"_elementform_id_temp1"),adding_1.setAttribute("name",i+"_elementform_id_temp1"),adding_1.style.cssText="width:"+w_size+"px;",adding_1.setAttribute("onChange","change_value_range('"+i+"_elementform_id_temp0', 'maxDate', this.value)");var adding_from=document.createTextNode("-"),adding_image_start=document.createElement("span");adding_image_start.setAttribute("id",i+"_show_imagedateform_id_temp0"),adding_image_start.setAttribute("class","dashicons dashicons-calendar-alt wd-calendar-button "+("yes"==w_show_image?"wd-inline-block":"wd-hidden")),adding_image_start.setAttribute("onClick","show_datepicker('"+i+"_elementform_id_temp0')");var adding_image_end=document.createElement("span");adding_image_end.setAttribute("id",i+"_show_imagedateform_id_temp1"),adding_image_end.setAttribute("class","dashicons dashicons-calendar-alt wd-calendar-button "+("yes"==w_show_image?"wd-inline-block":"wd-hidden")),adding_image_end.setAttribute("onClick","show_datepicker('"+i+"_elementform_id_temp1')");var dis_past_days="yes"==w_disable_past_days,adding_button=document.createElement("input");adding_button.setAttribute("id",i+"_buttonform_id_temp"),adding_button.setAttribute("class","button"),adding_button.setAttribute("type","hidden"),adding_button.setAttribute("value",w_but_val),adding_button.setAttribute("format",w_format);var main_td=document.getElementById("show_table");if(adding_desc_b.appendChild(text_format_1),adding_desc_p.appendChild(adding_desc_b),adding_desc_p.appendChild(format_br_1),adding_desc_p.appendChild(text_format_2),adding_desc_p.appendChild(format_br_2),adding_desc_p.appendChild(text_format_3),adding_desc_p.appendChild(format_br_3),adding_desc_p.appendChild(text_format_4),adding_desc_p.appendChild(format_br_4),adding_desc_p.appendChild(text_format_5),adding_desc_p.appendChild(format_br_5),adding_desc_p.appendChild(text_format_6),adding_desc_p.appendChild(format_br_6),adding_desc_p.appendChild(text_format_7),adding_desc_p.appendChild(format_br_7),adding_desc_p.appendChild(text_format_8),adding_desc_p.appendChild(format_br_8),adding_desc_p.appendChild(text_format_9),adding_desc_p.appendChild(format_br_9),adding_desc_p.appendChild(text_format_10),adding_desc_p.appendChild(format_br_10),adding_desc_p.appendChild(text_format_11),adding_desc_p.appendChild(format_br_11),adding_desc_p.appendChild(text_format_12),adding_desc_p.appendChild(format_br_12),adding_desc_p.appendChild(text_format_13),adding_desc_p.appendChild(format_br_13),adding_desc_b_2.appendChild(text_default_1),adding_desc_p_2.appendChild(adding_desc_b_2),adding_desc_p_2.appendChild(default_br_1),adding_desc_p_2.appendChild(text_default_2),adding_desc_p_2.appendChild(default_br_2),adding_desc_p_2.appendChild(text_default_3),adding_desc_p_2.appendChild(default_br_3),adding_desc_p_2.appendChild(text_default_4),adding_desc_p_2.appendChild(default_br_4),adding_desc_p_2.appendChild(text_default_5),adding_desc_b_3.appendChild(text_default_6),adding_desc_p_3.appendChild(adding_desc_b_3),adding_desc_p_3.appendChild(default_br_6),adding_desc_p_3.appendChild(text_default_7),adding_desc_p_3.appendChild(default_br_7),div_label.appendChild(label),div_label.appendChild(required),div_element.appendChild(adding_type),div_element.appendChild(adding_required),div_element.appendChild(adding_hide_label),div_element.appendChild(adding_show_image),div_element.appendChild(adding_dis_past_days),div_element.appendChild(adding_0),div_element.appendChild(adding_image_start),div_element.appendChild(adding_from),div_element.appendChild(adding_1),div_element.appendChild(adding_image_end),div_element.appendChild(adding_start_day),div_element.appendChild(adding_default_date_start),div_element.appendChild(adding_default_date_end),div_element.appendChild(adding_min_date),div_element.appendChild(adding_max_date),div_element.appendChild(adding_invalid_dates),div_element.appendChild(adding_hide_time),div_element.appendChild(adding_show_days),div_element.appendChild(adding_button),div_field.appendChild(div_label),div_field.appendChild(div_element),div.appendChild(div_field),div.appendChild(br3),div.appendChild(adding_desc_p),div.appendChild(adding_desc_p_2),div.appendChild(adding_desc_p_3),main_td.appendChild(div),"top"==w_field_label_pos&&label_top(i),change_class(w_class,i),refresh_attr(i,"type_range"),w_default_date_end&&"today"!=w_default_date_end)var w_max_date_start=w_default_date_end;else w_max_date_start="today"==w_default_date_end?jQuery.datepicker.formatDate("mm/dd/yy",new Date):w_max_date;if(jQuery("#"+i+"_elementform_id_temp0").datepicker({dateFormat:"mm/dd/yy",minDate:w_min_date,maxDate:w_max_date_start,firstDay:w_start_day,changeMonth:!0,changeYear:!0,yearRange:"-100:+50",showOtherMonths:!0,selectOtherMonths:!0,beforeShowDay:function(date){for(var invalid_dates=w_invalid_dates,invalid_dates_finish=[],invalid_dates_start=invalid_dates.split(","),invalid_date_range=[],i=0;iNumber of Stars'),jQuery(' '))}function change_star_amount(e,t,i){var a=document.getElementById(t+"_element_sectionform_id_temp"),n=document.getElementById(t+"_elementform_id_temp");a.removeChild(n);var l=document.createElement("div");l.setAttribute("id",t+"_elementform_id_temp");for(var d=0;dStar Color'),a=jQuery(' '),n=[];for(var l in n.yellow="Yellow",n.green="Green",n.blue="Blue",n.red="Red",n)if(n.hasOwnProperty(l)){var d=jQuery('"+n[l]+" ");a.append(d)}return create_option_container(i,a)}function label_color(e,t){document.getElementById(t+"_star_colorform_id_temp").value=e}function go_to_type_star_rating(e){w_attr_name=[],w_attr_value=[],type_star_rating(e,"Star Rating","","top","no","yellow","5","no","wdform_star_rating",w_attr_name,w_attr_value)}function type_star_rating(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_star_rating"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('
');s.append(u);var c=jQuery('
');u.append(c),c.append(create_field_type("type_star_rating")),c.append(create_label(e,t)),c.append(create_label_position(e,a)),c.append(create_hide_label(e,n)),c.append(create_required(e,_)),c.append(create_star_amount(e,d)),c.append(create_star_color(e,l));var p=jQuery('
');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(e,i)),p.append(create_class(e,r)),p.append(create_additional_attributes(e,o,"type_star_rating"));var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_star_rating"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",e+"_requiredform_id_temp"),y.setAttribute("id",e+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",d),b.setAttribute("id",e+"_star_amountform_id_temp"),b.setAttribute("name",e+"_star_amountform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",l),v.setAttribute("name",e+"_star_colorform_id_temp"),v.setAttribute("id",e+"_star_colorform_id_temp");var w=document.createElement("div");w.setAttribute("id","main_div");var g=document.createElement("div");g.setAttribute("id",e+"_elemet_tableform_id_temp");var E="yes"==n?"none":"table-cell",A=document.createElement("div");A.setAttribute("align","left"),A.style.cssText="display:"+E+"; vertical-align:top; width:"+i+"px;",A.setAttribute("id",e+"_label_sectionform_id_temp");var j=document.createElement("div");j.setAttribute("align","left"),j.style.display="table-cell",j.setAttribute("id",e+"_element_sectionform_id_temp");var x=document.createElement("div");x.setAttribute("id",e+"_elementform_id_temp"),x.setAttribute("class","wdform_stars");var k=document.createElement("br"),I=document.createElement("span");I.setAttribute("id",e+"_element_labelform_id_temp"),I.innerHTML=t,I.setAttribute("class","label");var C=document.createElement("span");C.setAttribute("id",e+"_required_elementform_id_temp"),C.innerHTML="",C.setAttribute("class","required"),"yes"==_&&(C.innerHTML=" *");var B=document.getElementById("show_table");A.appendChild(I),A.appendChild(C),j.appendChild(h),j.appendChild(f),j.appendChild(y),j.appendChild(b),j.appendChild(v);for(var Q=0;QScale Range'),jQuery(' '))}function change_scale_amount(e,t,i){var a=document.getElementById(t+"_scale_tableform_id_temp"),n=document.getElementById(t+"_elementform_id_temp");n.removeChild(a);var l=document.createElement("div");l.setAttribute("id",t+"_scale_tableform_id_temp"),l.style.cssText="display:inline-table;";var d=document.createElement("div");d.setAttribute("id",t+"_scale_tr1form_id_temp"),d.style.cssText="display:table-row;";var _=document.createElement("div");_.setAttribute("id",t+"_scale_tr2form_id_temp"),_.style.cssText="display:table-row;",l.appendChild(d);for(var r=1;r<=e;r++)adding_num=document.createElement("span"),adding_num.innerHTML=r,adding_td=document.createElement("div"),adding_td.setAttribute("id",t+"_scale_td1_"+r+"form_id_temp"),adding_td.style.cssText="text-align:center; display:table-cell;",adding_td.appendChild(adding_num),d.appendChild(adding_td);for(var o=1;o<=e;o++){var m=document.createElement("input");m.setAttribute("id",t+"_scale_radioform_id_temp_"+o),m.setAttribute("name",t+"_scale_radioform_id_temp"),m.setAttribute("value",o),m.setAttribute("type","radio");var s=document.createElement("div");s.setAttribute("id",t+"_scale_td2_"+o+"form_id_temp"),s.style.cssText=" display:table-cell;",s.appendChild(m),_.appendChild(s)}l.appendChild(_),n.insertBefore(l,n.childNodes[1]),document.getElementById(t+"_scale_amountform_id_temp").value=e}function go_to_type_scale_rating(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["Worst","Best"],type_scale_rating(e,"Scale Rating","","top","no",w_mini_labels,"5","no","wdform_scale_rating",w_attr_name,w_attr_value)}function type_scale_rating(t,e,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_scale_rating"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('
');s.append(u);var c=jQuery('
');u.append(c),c.append(create_field_type("type_scale_rating")),c.append(create_label(t,e)),c.append(create_label_position(t,a)),c.append(create_hide_label(t,n)),c.append(create_required(t,_)),c.append(create_scale_amount(t,d));var p=jQuery('
');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(t,i)),p.append(create_class(t,r)),p.append(create_additional_attributes(t,o,"type_scale_rating"));var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_scale_rating"),f.setAttribute("name",t+"_typeform_id_temp"),f.setAttribute("id",t+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",t+"_requiredform_id_temp"),y.setAttribute("id",t+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",t+"_hide_labelform_id_temp"),h.setAttribute("id",t+"_hide_labelform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",d),b.setAttribute("id",t+"_scale_amountform_id_temp"),b.setAttribute("name",t+"_scale_amountform_id_temp");var v=document.createElement("div");v.setAttribute("id","main_div"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit.");var w=document.createElement("div");w.setAttribute("class","fm-editable-label"),w.appendChild(edit_labels);var g=document.createElement("div");g.setAttribute("id",t+"_elemet_tableform_id_temp");var E="yes"==n?"none":"table-cell",A=document.createElement("div");A.setAttribute("align","left"),A.style.cssText="display:"+E+"; vertical-align:top; width:"+i+"px;",A.setAttribute("id",t+"_label_sectionform_id_temp");var j=document.createElement("div");j.setAttribute("align","left"),j.style.display="table-cell",j.setAttribute("id",t+"_element_sectionform_id_temp");var x=document.createElement("div");x.setAttribute("id",t+"_elementform_id_temp");var k=document.createElement("div");k.setAttribute("id",t+"_scale_tableform_id_temp"),k.style.cssText="display:inline-table;";var I=document.createElement("div");I.setAttribute("id",t+"_scale_tr1form_id_temp"),I.style.display="table-row";var C=document.createElement("div");C.setAttribute("id",t+"_scale_tr2form_id_temp"),C.style.display="table-row";var B=document.createElement("br"),Q=document.createElement("span");Q.setAttribute("id",t+"_element_labelform_id_temp"),Q.innerHTML=e,Q.setAttribute("class","label");var T=document.createElement("label");T.setAttribute("class","mini_label"),T.setAttribute("id",t+"_mini_label_worst"),T.innerHTML=l[0],T.style.cssText="position:relative; top:6px; font-size:11px; display:inline-table;";var M=document.createElement("label");M.setAttribute("class","mini_label"),M.setAttribute("id",t+"_mini_label_best"),M.innerHTML=l[1],M.style.cssText="position:relative; top:6px; font-size:11px; display:inline-table;";var L=document.createElement("span");L.setAttribute("id",t+"_required_elementform_id_temp"),L.innerHTML="",L.setAttribute("class","required"),"yes"==_&&(L.innerHTML=" *");var z=document.getElementById("show_table");A.appendChild(Q),A.appendChild(L),j.appendChild(h),j.appendChild(f),j.appendChild(y),j.appendChild(b),x.appendChild(T),k.appendChild(I);for(var q=1;q<=d;q++)adding_num=document.createElement("span"),adding_num.innerHTML=q,adding_td=document.createElement("td"),adding_td.setAttribute("id",t+"_scale_td1_"+q+"form_id_temp"),adding_td.style.cssText="text-align:center;",adding_td.style.display="table-cell",adding_td.appendChild(adding_num),I.appendChild(adding_td);for(var H=1;H<=d;H++){var N=document.createElement("input");N.setAttribute("id",t+"_scale_radioform_id_temp_"+H),N.setAttribute("name",t+"_scale_radioform_id_temp"),N.setAttribute("value",H),N.setAttribute("type","radio");var S=document.createElement("div");S.setAttribute("id",t+"_scale_td2_"+H+"form_id_temp"),S.style.display="table-cell",S.appendChild(N),C.appendChild(S),k.appendChild(C),x.appendChild(k)}k.appendChild(C),x.appendChild(k),x.appendChild(M),j.appendChild(x),g.appendChild(A),g.appendChild(j),v.appendChild(g),v.appendChild(B),v.appendChild(w),z.appendChild(v),jQuery("#main_div").append(" "+form_maker.type_rating_description),"top"==a&&label_top(t),change_class(r,t),refresh_attr(t,"type_scale_rating"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_worst").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.worst").focus(),jQuery("input.worst").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_worst").text(e)})}}),jQuery("label#"+t+"_mini_label_best").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.best").focus(),jQuery("input.best").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_best").text(e)})}})})}function create_slider_minvalue(e,t){return create_option_container(jQuery('Min Value '),jQuery(' '))}function change_slider_min_or_max_value(e,t,i,a){document.getElementById(t+"_element_"+a+"form_id_temp").innerHTML=e}function change_slider_min_value(a,id,form_id){document.getElementById(id+"_slider_min_valueform_id_temp").value=a,eval(a)>document.getElementById(id+"_element_valueform_id_temp").innerHTML?(document.getElementById(id+"_element_valueform_id_temp").innerHTML=a,document.getElementById(id+"_slider_valueform_id_temp").value=a,jQuery("#"+id+"_elementform_id_temp").slider({min:eval(a),slide:function(e,t){document.getElementById(id+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(id+"_slider_valueform_id_temp").value=""+t.value}})):jQuery("#"+id+"_elementform_id_temp").slider({min:eval(a),slide:function(e,t){document.getElementById(id+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(id+"_slider_valueform_id_temp").value=""+t.value}})}function create_slider_maxvalue(e,t){return create_option_container(jQuery('Max Value '),jQuery(' '))}function change_slider_max_value(a,id,form_id){document.getElementById(id+"_slider_max_valueform_id_temp").value=a,eval(a)Step'),jQuery(' '))}function change_slider_step(a,id,form_id){jQuery("#"+id+"_elementform_id_temp").slider({step:eval(a)}),document.getElementById(id+"_slider_stepform_id_temp").value=a}function create_slider_width(e,t){return create_option_container(jQuery('Width(px) '),jQuery(''+form_maker.leave_empty+"
"))}function change_slider_width(e,t,i){document.getElementById(t+"_elementform_id_temp").style.cssText="width:"+e+"px",document.getElementById(t+"_slider_table2form_id_temp").style.cssText="width:"+e+"px",document.getElementById(t+"_slider_widthform_id_temp").value=e}function go_to_type_slider(e){w_attr_name=[],w_attr_value=[],type_slider(e,"Slider","","top","no","","0","100","1","0","no","",w_attr_name,w_attr_value)}function type_slider(i,w_field_label,w_field_label_size,w_field_label_pos,w_hide_label,w_field_width,w_field_min_value,w_field_max_value,w_field_step,w_field_value,w_required,w_class,w_attr_name,w_attr_value){jQuery("#element_type").val("type_slider"),delete_last_child();var t=jQuery("#edit_table"),edit_div=jQuery('
');t.append(edit_div);var edit_main_table=jQuery('
');edit_div.append(edit_main_table),edit_main_table.append(create_field_type("type_slider")),edit_main_table.append(create_label(i,w_field_label)),edit_main_table.append(create_label_position(i,w_field_label_pos)),edit_main_table.append(create_hide_label(i,w_hide_label)),edit_main_table.append(create_required(i,w_required)),edit_main_table.append(create_slider_minvalue(i,w_field_min_value)),edit_main_table.append(create_slider_maxvalue(i,w_field_max_value)),edit_main_table.append(create_slider_step(i,w_field_step)),edit_main_table.append(create_slider_width(i,w_field_width));var advanced_options_container=jQuery('
');edit_main_table.append(create_advanced_options_container(advanced_options_container)),advanced_options_container.append(create_field_label_size(i,w_field_label_size)),advanced_options_container.append(create_class(i,w_class)),advanced_options_container.append(create_additional_attributes(i,w_attr_name,"type_slider"));var adding_type=document.createElement("input");adding_type.setAttribute("type","hidden"),adding_type.setAttribute("value","type_slider"),adding_type.setAttribute("name",i+"_typeform_id_temp"),adding_type.setAttribute("id",i+"_typeform_id_temp");var adding_required=document.createElement("input");adding_required.setAttribute("type","hidden"),adding_required.setAttribute("value",w_required),adding_required.setAttribute("name",i+"_requiredform_id_temp"),adding_required.setAttribute("id",i+"_requiredform_id_temp");var adding_hide_label=document.createElement("input");adding_hide_label.setAttribute("type","hidden"),adding_hide_label.setAttribute("value",w_hide_label),adding_hide_label.setAttribute("name",i+"_hide_labelform_id_temp"),adding_hide_label.setAttribute("id",i+"_hide_labelform_id_temp");var adding_slider_min_value=document.createElement("input");adding_slider_min_value.setAttribute("type","hidden"),adding_slider_min_value.setAttribute("value",w_field_min_value),adding_slider_min_value.setAttribute("id",i+"_slider_min_valueform_id_temp"),adding_slider_min_value.setAttribute("name",i+"_slider_min_valueform_id_temp");var adding_slider_max_value=document.createElement("input");adding_slider_max_value.setAttribute("type","hidden"),adding_slider_max_value.setAttribute("value",w_field_max_value),adding_slider_max_value.setAttribute("id",i+"_slider_max_valueform_id_temp"),adding_slider_max_value.setAttribute("name",i+"_slider_max_valueform_id_temp");var adding_slider_step=document.createElement("input");adding_slider_step.setAttribute("type","hidden"),adding_slider_step.setAttribute("value",w_field_step),adding_slider_step.setAttribute("id",i+"_slider_stepform_id_temp"),adding_slider_step.setAttribute("name",i+"_slider_stepform_id_temp");var adding_slider_value=document.createElement("input");adding_slider_value.setAttribute("type","hidden"),adding_slider_value.setAttribute("value",w_field_value),adding_slider_value.setAttribute("id",i+"_slider_valueform_id_temp"),adding_slider_value.setAttribute("name",i+"_slider_valueform_id_temp");var adding_slider_width=document.createElement("input");adding_slider_width.setAttribute("type","hidden"),adding_slider_width.setAttribute("value",w_field_width),adding_slider_width.setAttribute("name",i+"_slider_widthform_id_temp"),adding_slider_width.setAttribute("id",i+"_slider_widthform_id_temp");var adding_slider_div=document.createElement("div");adding_slider_div.style.cssText="width:"+w_field_width+"px",adding_slider_div.setAttribute("name",i+"_elementform_id_temp"),adding_slider_div.setAttribute("id",i+"_elementform_id_temp");var div=document.createElement("div");div.setAttribute("id","main_div");var div_field=document.createElement("div");div_field.setAttribute("id",i+"_elemet_tableform_id_temp");var display_label_div="yes"==w_hide_label?"none":"table-cell",div_label=document.createElement("div");div_label.setAttribute("align","left"),div_label.style.cssText="display:"+display_label_div+"; vertical-align:top; width:"+w_field_label_size+"px;",div_label.setAttribute("id",i+"_label_sectionform_id_temp");var div_element=document.createElement("div");div_element.setAttribute("align","left"),div_element.style.display="table-cell",div_element.setAttribute("id",i+"_element_sectionform_id_temp");var slider_table=document.createElement("div");slider_table.setAttribute("id",i+"_slider_tableform_id_temp");var slider_tr1=document.createElement("div"),slider_tr2=document.createElement("div");slider_tr2.setAttribute("id",i+"_slider_table2form_id_temp"),slider_tr2.style.cssText="width:"+w_field_width+"px";var slider_td1=document.createElement("div");slider_td1.setAttribute("id",i+"_slider_td1form_id_temp");var slider_td2=document.createElement("div");slider_td2.setAttribute("align","left"),slider_td2.setAttribute("id",i+"_slider_td2form_id_temp"),slider_td2.style.cssText="display:inline-table; width:33.3%; text-align:left;";var slider_td3=document.createElement("div");slider_td3.setAttribute("align","right"),slider_td3.setAttribute("id",i+"_slider_td3form_id_temp"),slider_td3.style.cssText="display:inline-table; width:33.3%; text-align:center;";var slider_td4=document.createElement("div");slider_td4.setAttribute("align","right"),slider_td4.setAttribute("id",i+"_slider_td4form_id_temp"),slider_td4.style.cssText="display:inline-table; width:33.3%; text-align:right; ";var br1=document.createElement("br"),label=document.createElement("span");label.setAttribute("id",i+"_element_labelform_id_temp"),label.innerHTML=w_field_label,label.setAttribute("class","label");var required=document.createElement("span");required.setAttribute("id",i+"_required_elementform_id_temp"),required.innerHTML="",required.setAttribute("class","required"),"yes"==w_required&&(required.innerHTML=" *");var main_td=document.getElementById("show_table");div_label.appendChild(label),div_label.appendChild(required),div_element.appendChild(adding_hide_label),div_element.appendChild(adding_type),div_element.appendChild(adding_required),div_element.appendChild(adding_slider_width),div_element.appendChild(adding_slider_min_value),div_element.appendChild(adding_slider_max_value),div_element.appendChild(adding_slider_step),div_element.appendChild(adding_slider_value);var slider_min=document.createElement("span");slider_min.setAttribute("id",i+"_element_minform_id_temp"),slider_min.innerHTML=w_field_min_value,slider_min.setAttribute("class","label");var slider_max=document.createElement("span");slider_max.setAttribute("id",i+"_element_maxform_id_temp"),slider_max.innerHTML=w_field_max_value,slider_max.setAttribute("class","label");var slider_value=document.createElement("span");slider_value.setAttribute("id",i+"_element_valueform_id_temp"),slider_value.innerHTML=w_field_value,slider_value.setAttribute("class","label"),slider_td1.appendChild(adding_slider_div),slider_tr1.appendChild(slider_td1),slider_table.appendChild(slider_tr1),slider_td2.appendChild(slider_min),slider_tr2.appendChild(slider_td2),slider_table.appendChild(slider_tr2),slider_td3.appendChild(slider_value),slider_tr2.appendChild(slider_td3),slider_table.appendChild(slider_tr2),slider_td4.appendChild(slider_max),slider_tr2.appendChild(slider_td4),slider_table.appendChild(slider_tr2),div_element.appendChild(slider_table),div_field.appendChild(div_label),div_field.appendChild(div_element),div.appendChild(div_field),div.appendChild(br1),main_td.appendChild(div),jQuery("#main_div").append(form_maker.type_slider_description),"top"==w_field_label_pos&&label_top(i),change_class(w_class,i),refresh_attr(i,"type_slider"),jQuery("#"+i+"_elementform_id_temp")[0].slide=null,jQuery(function(){jQuery("#"+i+"_elementform_id_temp").slider({step:eval(w_field_step),range:"min",value:eval(w_field_value),min:eval(w_field_min_value),max:eval(w_field_max_value),slide:function(e,t){document.getElementById(i+"_element_valueform_id_temp").innerHTML=""+t.value,document.getElementById(i+"_slider_valueform_id_temp").value=""+t.value}})})}function create_range_step(e,t){return create_option_container(jQuery('Step '),jQuery(' '))}function change_range_step(e,t,i){jQuery("#"+t+"_elementform_id_temp0").spinner({step:e}),jQuery("#"+t+"_elementform_id_temp1").spinner({step:e}),document.getElementById(t+"_range_stepform_id_temp").value=e}function create_range_width(e,t){return create_option_container(jQuery('Width(px) '),jQuery(' '))}function go_to_type_range(e){w_attr_name=[],w_attr_value=[],w_mini_labels=["From","To"],type_range(e,"Range","","top","no","70","1","","",w_mini_labels,"no","",w_attr_name,w_attr_value)}function type_range(t,e,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_range"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('
');p.append(f);var y=jQuery('
');f.append(y),y.append(create_field_type("type_range")),y.append(create_label(t,e)),y.append(create_label_position(t,a)),y.append(create_hide_label(t,n)),y.append(create_required(t,m)),y.append(create_range_step(t,d)),y.append(create_range_width(t,l));var h=jQuery('
');y.append(create_advanced_options_container(h)),h.append(create_field_label_size(t,i)),h.append(create_class(t,s)),h.append(create_additional_attributes(t,u,"type_range"));var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_range"),b.setAttribute("name",t+"_typeform_id_temp"),b.setAttribute("id",t+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",m),v.setAttribute("name",t+"_requiredform_id_temp"),v.setAttribute("id",t+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",n),w.setAttribute("name",t+"_hide_labelform_id_temp"),w.setAttribute("id",t+"_hide_labelform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",l),g.setAttribute("name",t+"_range_widthform_id_temp"),g.setAttribute("id",t+"_range_widthform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",d),E.setAttribute("name",t+"_range_stepform_id_temp"),E.setAttribute("id",t+"_range_stepform_id_temp");var A=document.createElement("input");A.setAttribute("type",""),A.setAttribute("value",_),A.style.cssText="width:"+l+"px",A.setAttribute("name",t+"_elementform_id_temp0"),A.setAttribute("id",t+"_elementform_id_temp0"),A.setAttribute("onKeyPress","return check_isnum_or_minus(event)");var j=document.createElement("input");j.setAttribute("type",""),j.setAttribute("value",r),j.style.cssText="width:"+l+"px",j.setAttribute("name",t+"_elementform_id_temp1"),j.setAttribute("id",t+"_elementform_id_temp1"),j.setAttribute("onKeyPress","return check_isnum_or_minus(event)");var x=document.createElement("label");x.setAttribute("class","mini_label mini_label_from"),x.setAttribute("id",t+"_mini_label_from"),x.innerHTML=o[0];var k=document.createElement("label");k.setAttribute("class","mini_label mini_label_to"),k.setAttribute("id",t+"_mini_label_to"),k.innerHTML=o[1];var I=document.createElement("div");I.setAttribute("id","main_div"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit.");var C=document.createElement("div");C.setAttribute("class","fm-editable-label"),C.appendChild(edit_labels);var B=document.createElement("div");B.setAttribute("id",t+"_elemet_tableform_id_temp");var Q="yes"==n?"none":"table-cell",T=document.createElement("div");T.setAttribute("align","left"),T.style.display=Q,T.style.width=i+"px",T.setAttribute("id",t+"_label_sectionform_id_temp");var M=document.createElement("div");M.setAttribute("align","left"),M.style.display="table-cell",M.setAttribute("id",t+"_element_sectionform_id_temp");var L=document.createElement("div");L.setAttribute("id",t+"_elemet_table_littleform_id_temp"),L.style.display="table";var z=document.createElement("div");z.style.display="table-row";var q=document.createElement("div");q.style.display="table-row";var H=document.createElement("div");H.setAttribute("valign","middle"),H.setAttribute("align","left"),H.style.display="table-cell";var N=document.createElement("div");N.setAttribute("valign","middle"),N.setAttribute("align","left"),N.style.cssText="display:table-cell; padding-left:4px;";var S=document.createElement("div");S.setAttribute("valign","top"),S.setAttribute("align","left"),S.style.display="table-cell";var D=document.createElement("div");D.setAttribute("valign","top"),D.setAttribute("align","left"),D.style.display="table-cell";var P=document.createElement("br"),O=document.createElement("span");O.setAttribute("id",t+"_element_labelform_id_temp"),O.innerHTML=e,O.setAttribute("class","label");var K=document.createElement("span");K.setAttribute("id",t+"_required_elementform_id_temp"),K.innerHTML="",K.setAttribute("class","required"),"yes"==m&&(K.innerHTML=" *");var U=document.getElementById("show_table");T.appendChild(O),T.appendChild(K),M.appendChild(b),M.appendChild(v),M.appendChild(w),M.appendChild(g),M.appendChild(E),H.appendChild(A),N.appendChild(j),S.appendChild(x),D.appendChild(k),z.appendChild(H),z.appendChild(N),q.appendChild(S),q.appendChild(D),L.appendChild(z),L.appendChild(q),M.appendChild(L),B.appendChild(T),B.appendChild(M),I.appendChild(B),I.appendChild(P),I.appendChild(C),U.appendChild(I),jQuery("#main_div").append(" "+form_maker.type_range_description),"top"==a&&label_top(t),change_class(s,t),refresh_attr(t,"type_range"),jQuery("#"+t+"_elementform_id_temp0").spinner();jQuery("#"+t+"_elementform_id_temp0").spinner();jQuery("#"+t+"_elementform_id_temp0").spinner({step:d}),jQuery("#"+t+"_elementform_id_temp1").spinner();jQuery("#"+t+"_elementform_id_temp1").spinner();jQuery("#"+t+"_elementform_id_temp1").spinner({step:d}),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_from").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.form").focus(),jQuery("input.form").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_from").text(e)})}}),jQuery("label#"+t+"_mini_label_to").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.to").focus(),jQuery("input.to").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_to").text(e)})}})})}function create_hidden_name(e,t){return create_option_container(jQuery('Name '),jQuery(' '))}function change_field_name(e,t){if(value=t.value,value==parseInt(value))return alert("The name of the field cannot be a number."),t.value="",document.getElementById(e+"_elementform_id_temp").name="",document.getElementById(e+"_element_labelform_id_temp").innerHTML="",void(document.getElementById(e+"_hidden_nameform_id_temp").innerHTML="");value==e+"_elementform_id_temp"?(alert('"Field Name" should differ from "Field Id".'),t.value=""):(document.getElementById(e+"_elementform_id_temp").name=value,document.getElementById(e+"_element_labelform_id_temp").innerHTML=value,document.getElementById(e+"_hidden_nameform_id_temp").innerHTML=value)}function create_hidden_value(e,t){return create_option_container(jQuery('Value '),jQuery(' '))}function change_field_value(e,t){document.getElementById(e+"_elementform_id_temp").value=t,document.getElementById(e+"_hidden_valueform_id_temp").innerHTML=t}function go_to_type_hidden(e){w_attr_name=[],w_attr_value=[],type_hidden(e,"","","",w_attr_name,w_attr_value)}function type_hidden(e,t,i,a,n){jQuery("#element_type").val("type_hidden"),delete_last_child();var l=jQuery("#edit_table"),d=jQuery('
');l.append(d);var _=jQuery('
');d.append(_),_.append(create_field_type("type_hidden")),_.append(create_hidden_name(e,t)),_.append(create_hidden_value(e,i));var r=jQuery('
');_.append(create_advanced_options_container(r)),r.append(create_additional_attributes(e,a,"type_hidden")),element="input",type="hidden";var o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("value","type_hidden"),o.setAttribute("name",e+"_typeform_id_temp"),o.setAttribute("id",e+"_typeform_id_temp");var m=document.createElement(element);m.setAttribute("type",type),m.setAttribute("value",i),m.setAttribute("id",e+"_elementform_id_temp"),m.setAttribute("name",t);var s=document.createElement("div");s.setAttribute("id","main_div");var u=document.createElement("div");u.setAttribute("id",e+"_elemet_tableform_id_temp");var c=document.createElement("div");c.setAttribute("align","left"),c.style.display="table-cell",c.setAttribute("id",e+"_label_sectionform_id_temp");var p=document.createElement("div");p.setAttribute("align","left"),p.style.cssText="display:table-cell; padding-left: 7px;",p.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var f=document.createElement("br"),y=(document.createElement("br"),document.createElement("span"));y.setAttribute("id",e+"_element_labelform_id_temp"),y.style.cssText="display:none",y.innerHTML=t;var h=document.createElement("span");h.style.cssText="color:red; font-size:13px;",h.innerHTML="Hidden field";var b=document.createElement("div"),v=document.createElement("span");v.setAttribute("align","left"),v.innerHTML="Name: ";var w=document.createElement("span");w.setAttribute("align","left"),w.innerHTML=t,w.setAttribute("id",e+"_hidden_nameform_id_temp");var g=document.createElement("div"),E=document.createElement("span");E.setAttribute("align","left"),E.innerHTML="Value: ";var A=document.createElement("span");A.setAttribute("align","left"),A.innerHTML=i,A.setAttribute("id",e+"_hidden_valueform_id_temp"),b.appendChild(v),b.appendChild(w),g.appendChild(E),g.appendChild(A);var j=document.getElementById("show_table");c.appendChild(y),c.appendChild(h),p.appendChild(m),p.appendChild(o),p.appendChild(b),p.appendChild(g),u.appendChild(c),u.appendChild(p),s.appendChild(u),s.appendChild(f),j.appendChild(s),jQuery("#main_div").append(form_maker.type_hidden_description),refresh_attr(e,"type_text")}function create_captcha_digits(e,t){return create_option_container(jQuery('Symbols (3 - 9) '),jQuery(' '))}function check_isnum_3_10(e){var t=e.which||e.keyCode;return!(31');o.append(m);var s=jQuery('
');m.append(s),s.append(create_field_type("type_captcha")),s.append(create_label(e,t)),s.append(create_label_position(e,a)),s.append(create_hide_label(e,n)),s.append(create_captcha_digits(e,l));var u=jQuery('
');s.append(create_advanced_options_container(u)),u.append(create_field_label_size(e,i)),u.append(create_class(e,d)),u.append(create_additional_attributes(e,_,"type_captcha")),element="img",type="captcha";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("value","type_captcha"),c.setAttribute("name",e+"_typeform_id_temp"),c.setAttribute("id",e+"_typeform_id_temp");var p=document.createElement(element);p.setAttribute("type",type),p.setAttribute("digit",l),p.setAttribute("src",url_for_ajax+"?action=formmakerwdcaptcha&nonce="+fm_ajax.ajaxnonce+"&digit="+l+"&i=form_id_temp"),p.setAttribute("id","_wd_captchaform_id_temp"),p.setAttribute("class","captcha_img"),p.setAttribute("onClick","captcha_refresh('_wd_captcha','form_id_temp')");var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value",n),f.setAttribute("name",e+"_hide_labelform_id_temp"),f.setAttribute("id",e+"_hide_labelform_id_temp");var y=document.createElement("div");y.setAttribute("class","captcha_refresh"),y.setAttribute("id","_element_refreshform_id_temp"),y.setAttribute("onClick","captcha_refresh('_wd_captcha','form_id_temp')");var h=document.createElement("input");h.setAttribute("type","text"),h.style.cssText="width:"+(10*l+15)+"px;",h.setAttribute("class","captcha_input"),h.setAttribute("id","_wd_captcha_inputform_id_temp"),h.setAttribute("name","captcha_input");var b=document.createElement("div");b.setAttribute("id","main_div");var v=document.createElement("div");v.setAttribute("id",e+"_elemet_tableform_id_temp");var w="yes"==n?"none":"table-cell",g=document.createElement("div");g.setAttribute("align","left"),g.style.display=w,g.style.width=i+"px",g.setAttribute("id",e+"_label_sectionform_id_temp");var E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.setAttribute("id",e+"_element_sectionform_id_temp");var A=document.createElement("div");A.style.display="table";var j=document.createElement("div");j.style.display="table-row";var x=document.createElement("div");x.style.display="table-row";var k=document.createElement("div");k.setAttribute("valign","middle"),k.style.display="table-cell";var I=document.createElement("div");I.setAttribute("valign","middle"),I.style.display="table-cell";var C=document.createElement("div");C.style.display="table-cell",A.appendChild(j),A.appendChild(x),j.appendChild(k),j.appendChild(I),x.appendChild(C),k.appendChild(p),I.appendChild(y),C.appendChild(h);document.createElement("br"),document.createElement("br");var B=document.createElement("br"),Q=(document.createElement("br"),document.createElement("span"));Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label"),Q.style.verticalAlign="top";var T=document.getElementById("show_table");g.appendChild(Q),E.appendChild(c),E.appendChild(f),E.appendChild(A),v.appendChild(g),v.appendChild(E),b.appendChild(v),b.appendChild(B),T.appendChild(b),jQuery("#main_div").append(form_maker.type_captcha_description),"top"==a&&label_top(e),change_class(d,e),refresh_attr(e,"type_captcha")}function create_arithmetic_operations(e,t){return create_option_container(jQuery('Operations '),jQuery(' '))}function check_is_operation_valid(e){var t=e.which||e.keyCode;return!(46==t||t<42||47Operations count (1 - 5)'),jQuery(' '))}function check_isnum_less_then_5(e){var t=e.which||e.keyCode;return!(31Input width(px)'),jQuery(' '))}function go_to_type_arithmetic_captcha(e){w_attr_name=[],w_attr_value=[],type_arithmetic_captcha(e,"Word Verification","","top","yes","1","+, -, *, /","","60",w_attr_name,w_attr_value)}function type_arithmetic_captcha(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_arithmetic_captcha"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('
');s.append(u);var c=jQuery('
');u.append(c),c.append(create_field_type("type_arithmetic_captcha")),c.append(create_label(e,t)),c.append(create_label_position(e,a)),c.append(create_hide_label(e,n)),c.append(create_arithmetic_operations(e,d)),c.append(create_arithmetic_operations_count(e,l)),c.append(create_arithmetic_width(e,r));var p=jQuery('
');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(e,i)),p.append(create_class(e,_)),p.append(create_additional_attributes(e,o,"type_arithmetic_captcha"));var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_arithmetic_captcha"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("img");y.setAttribute("type","captcha"),y.setAttribute("operations_count",l),y.setAttribute("operations",d),y.setAttribute("input_size",r),y.setAttribute("src",url_for_ajax+"?action=formmakerwdmathcaptcha&operations_count="+l+"&nonce="+fm_ajax.ajaxnonce+"&operations="+d.replace("+","@")+"&i=form_id_temp"),y.setAttribute("id","_wd_arithmetic_captchaform_id_temp"),y.setAttribute("class","arithmetic_captcha_img"),y.setAttribute("onClick","captcha_refresh('_wd_arithmetic_captcha','form_id_temp')");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("div");b.setAttribute("class","captcha_refresh"),b.setAttribute("id","_element_refreshform_id_temp"),b.setAttribute("onClick","captcha_refresh('_wd_arithmetic_captcha','form_id_temp')");var v=document.createElement("input");v.setAttribute("type","text"),v.style.cssText="width:"+r+"px;",v.setAttribute("class","arithmetic_captcha_input"),v.setAttribute("id","_wd_arithmetic_captcha_inputform_id_temp"),v.setAttribute("name","arithmetic_captcha_input"),v.setAttribute("onKeyPress","return check_isnum(event)");var w=document.createElement("div");w.setAttribute("id","main_div");var g=document.createElement("div");g.setAttribute("id",e+"_elemet_tableform_id_temp");var E="yes"==n?"none":"table-cell",A=document.createElement("div");A.setAttribute("align","left"),A.style.display=E,A.style.width=i+"px",A.setAttribute("id",e+"_label_sectionform_id_temp");var j=document.createElement("div");j.setAttribute("align","left"),j.style.display="table-cell",j.setAttribute("id",e+"_element_sectionform_id_temp");var x=document.createElement("div");x.style.display="table";var k=document.createElement("div");k.style.display="table-row";var I=document.createElement("div");I.style.display="table-row";var C=document.createElement("div");C.style.display="table-cell";var B=document.createElement("div");B.style.cssText="display:table-cell; vertical-align:middle;";var Q=document.createElement("div");Q.style.display="table-cell",x.appendChild(k),x.appendChild(I),k.appendChild(C),k.appendChild(Q),k.appendChild(B),C.appendChild(y),B.appendChild(b),Q.appendChild(v);document.createElement("br"),document.createElement("br");var T=document.createElement("br"),M=(document.createElement("br"),document.createElement("span"));M.setAttribute("id",e+"_element_labelform_id_temp"),M.innerHTML=t,M.setAttribute("class","label"),M.style.verticalAlign="top";var L=document.getElementById("show_table");A.appendChild(M),j.appendChild(f),j.appendChild(h),j.appendChild(x),g.appendChild(A),g.appendChild(j),w.appendChild(g),w.appendChild(T),L.appendChild(w),jQuery("#main_div").append(form_maker.type_arithmetic_captcha_description),"top"==a&&label_top(e),change_class(_,e),refresh_attr(e,"type_arithmetic_captcha")}function create_field_size_phone(e,t,i){return create_option_container(jQuery('Width(px) '),jQuery(''+form_maker.leave_empty+"
"))}function create_placeholder_phone(e,t){return create_option_container(jQuery('Placeholder '),jQuery(' - '))}function go_to_type_phone(e){w_attr_name=[],w_attr_value=[],w_first_val=["",""],w_title=["",""],w_mini_labels=["Area Code","Phone Number"],type_phone(e,"Phone-Area Code","","top","no","",w_first_val,w_title,w_mini_labels,"no","no","",w_attr_name,w_attr_value)}function type_phone(t,e,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_phone"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('
');p.append(f);var y=jQuery('
');f.append(y),y.append(create_field_type("type_phone")),y.append(create_label(t,e)),y.append(create_label_position(t,a)),y.append(create_hide_label(t,n)),y.append(create_required(t,o)),y.append(create_field_size_phone(t,l)),y.append(create_placeholder_phone(t,_));var h=jQuery('
');y.append(create_advanced_options_container(h)),h.append(create_unique_values(t,m)),h.append(create_field_label_size(t,i)),h.append(create_class(t,s)),h.append(create_additional_attributes(t,u,"type_phone"));var b=document.createElement("br"),v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value","type_phone"),v.setAttribute("name",t+"_typeform_id_temp"),v.setAttribute("id",t+"_typeform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",o),w.setAttribute("name",t+"_requiredform_id_temp"),w.setAttribute("id",t+"_requiredform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",n),g.setAttribute("name",t+"_hide_labelform_id_temp"),g.setAttribute("id",t+"_hide_labelform_id_temp");var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",m),E.setAttribute("name",t+"_uniqueform_id_temp"),E.setAttribute("id",t+"_uniqueform_id_temp");var A=document.createElement("div");A.setAttribute("id","main_div");var j=document.createElement("div");j.setAttribute("class","fm-editable-label"),edit_labels=document.createTextNode("The labels of the fields are editable. Please, click on the label to edit."),j.appendChild(edit_labels);var x=document.createElement("div");x.setAttribute("id",t+"_elemet_tableform_id_temp");var k="yes"==n?"none":"table-cell",I=document.createElement("div");I.setAttribute("align","left"),I.style.display=k,I.style.width=i+"px",I.setAttribute("id",t+"_label_sectionform_id_temp");var C=document.createElement("div");C.setAttribute("align","left"),C.style.display="table-cell",C.setAttribute("id",t+"_element_sectionform_id_temp");var B=document.createElement("div");B.style.display="table",B.setAttribute("id",t+"_table_name");var Q=document.createElement("div");Q.style.display="table-row",Q.setAttribute("id",t+"_tr_name1");var T=document.createElement("div");T.style.display="table-row",T.setAttribute("id",t+"_tr_name2");var M=document.createElement("div");M.style.display="table-cell",M.setAttribute("id",t+"_td_name_input_first");var L=document.createElement("div");L.style.display="table-cell",L.setAttribute("id",t+"_td_name_input_last");var z=document.createElement("div");z.style.display="table-cell",z.setAttribute("id",t+"_td_name_label_first"),z.setAttribute("align","left");var q=document.createElement("div");q.style.display="table-cell",q.setAttribute("id",t+"_td_name_label_last"),q.setAttribute("align","left");var H=document.createElement("span");H.setAttribute("id",t+"_element_labelform_id_temp"),H.innerHTML=e,H.setAttribute("class","label"),H.style.verticalAlign="top";var N=document.createElement("span");N.setAttribute("id",t+"_required_elementform_id_temp"),N.innerHTML="",N.setAttribute("class","required"),"yes"==o&&(N.innerHTML=" *");var S=document.createElement("input");S.setAttribute("type","text"),S.style.cssText="width:50px",S.setAttribute("id",t+"_element_firstform_id_temp"),S.setAttribute("name",t+"_element_firstform_id_temp"),S.setAttribute("value",d[0]),S.setAttribute("title",_[0]),S.setAttribute("placeholder",_[0]),S.setAttribute("onKeyPress","return check_isnum(event)");var D=document.createElement("span");D.setAttribute("class","wdform_line"),D.style.cssText="margin: 0px 4px 0px 4px; padding: 0px;",D.innerHTML="-";var P=document.createElement("label");P.setAttribute("class","mini_label mini_label_area_code"),P.setAttribute("id",t+"_mini_label_area_code"),P.innerHTML=r[0];var O=document.createElement("input");O.setAttribute("type","text"),O.style.cssText="width:"+l+"px",O.setAttribute("id",t+"_element_lastform_id_temp"),O.setAttribute("name",t+"_element_lastform_id_temp"),O.setAttribute("value",d[1]),O.setAttribute("title",_[1]),O.setAttribute("placeholder",_[1]),O.setAttribute("onKeyPress","return check_isnum(event)");var K=document.createElement("label");K.setAttribute("class","mini_label mini_label_phone_number"),K.setAttribute("id",t+"_mini_label_phone_number"),K.innerHTML=r[1];var U=document.getElementById("show_table");I.appendChild(H),I.appendChild(N),M.appendChild(S),M.appendChild(D),L.appendChild(O),Q.appendChild(M),Q.appendChild(L),z.appendChild(P),q.appendChild(K),T.appendChild(z),T.appendChild(q),B.appendChild(Q),B.appendChild(T),C.appendChild(v),C.appendChild(w),C.appendChild(g),C.appendChild(E),C.appendChild(B),x.appendChild(I),x.appendChild(C),A.appendChild(x),A.appendChild(b),A.appendChild(j),U.appendChild(A),jQuery("#main_div").append(" "+form_maker.type_phone_area_code_description),"top"==a&&label_top(t),change_class(s,t),refresh_attr(t,"type_name"),jQuery(document).ready(function(){jQuery("label#"+t+"_mini_label_area_code").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.area_code").focus(),jQuery("input.area_code").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_area_code").text(e)})}}),jQuery("label#"+t+"_mini_label_phone_number").click(function(){if(0==jQuery(this).children("input").length){var e=" ';jQuery(this).html(e),jQuery("input.phone_number").focus(),jQuery("input.phone_number").blur(function(){var e=jQuery(this).val();jQuery("#"+t+"_mini_label_phone_number").text(e)})}})})}function create_confirmation_password(e,t){return create_option_container(jQuery('Password Confirmation '),jQuery(' "))}function verification_password(e){document.getElementById("el_verification_password").checked?(document.getElementById("confirm_validation_label").style.display="block",document.getElementById(e+"_verification_id_temp").value="yes",document.getElementById(e+"_1_label_sectionform_id_temp").style.display=document.getElementById(e+"_label_sectionform_id_temp").style.display,document.getElementById(e+"_1_element_sectionform_id_temp").style.display=document.getElementById(e+"_element_sectionform_id_temp").style.display):(document.getElementById("confirm_validation_label").style.display="none",document.getElementById(e+"_verification_id_temp").value="no",document.getElementById(e+"_1_label_sectionform_id_temp").style.display="none",document.getElementById(e+"_1_element_sectionform_id_temp").style.display="none")}function create_confirmation_password_label(e,t,i){return create_option_container(jQuery('Confirmation label '),jQuery('"),"confirm_validation_label","yes"==t)}function go_to_type_password(e){w_placeholder_value="",w_attr_name=[],w_attr_value=[],type_password(e,"Password","","top","no","","no","no","wdform_input","no","Password confirmation",w_placeholder_value,w_attr_name,w_attr_value)}function type_password(e,t,i,a,n,l,d,_,r,o,m,s,u,c){jQuery("#element_type").val("type_password"),delete_last_child();var p=jQuery("#edit_table"),f=jQuery('
');p.append(f);var y=jQuery('
');f.append(y),y.append(create_field_type("type_password")),y.append(create_label(e,t)),y.append(create_label_position(e,a)),y.append(create_hide_label(e,n)),y.append(create_required(e,d)),y.append(create_field_size(e,l,"'"+e+"_elementform_id_temp'","'"+e+"_1_elementform_id_temp'"));var h=jQuery('
');y.append(create_advanced_options_container(h)),h.append(create_confirmation_password(e,o)),h.append(create_confirmation_password_label(e,o,m)),h.append(create_field_label_size(e,i,"'"+e+"_label_sectionform_id_temp'","'"+e+"_1_label_sectionform_id_temp'")),h.append(create_class(e,r)),h.append(create_additional_attributes(e,u,"type_password")),element="input",type="password";var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value","type_password"),b.setAttribute("name",e+"_typeform_id_temp"),b.setAttribute("id",e+"_typeform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",d),v.setAttribute("name",e+"_requiredform_id_temp"),v.setAttribute("id",e+"_requiredform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",_),w.setAttribute("name",e+"_uniqueform_id_temp"),w.setAttribute("id",e+"_uniqueform_id_temp");var g=document.createElement(element);g.setAttribute("type",type),g.setAttribute("autocomplete","new-password"),g.setAttribute("id",e+"_elementform_id_temp"),g.setAttribute("name",e+"_elementform_id_temp"),g.setAttribute("placeholder",s),g.style.cssText="width:"+l+"px;";var E=document.createElement("input");E.setAttribute("type","hidden"),E.setAttribute("value",n),E.setAttribute("name",e+"_hide_labelform_id_temp"),E.setAttribute("id",e+"_hide_labelform_id_temp");var A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("value",o),A.setAttribute("name",e+"_verification_id_temp"),A.setAttribute("id",e+"_verification_id_temp");var j=document.createElement(element);j.setAttribute("type",type),j.setAttribute("autocomplete","new-password"),j.style.cssText="width:"+l+"px;",j.setAttribute("id",e+"_1_elementform_id_temp"),j.setAttribute("name",e+"_1_elementform_id_temp");var x="yes"==n||"no"==o?"none":"table-cell",k=document.createElement("div");k.setAttribute("align","left"),k.style.display=x,k.style.width=i+"px",k.setAttribute("id",e+"_1_label_sectionform_id_temp");var I="no"==o?"none":"table-cell",C=document.createElement("div");C.setAttribute("align","left"),C.style.display=I,C.setAttribute("id",e+"_1_element_sectionform_id_temp");var B=document.createElement("span");B.setAttribute("id",e+"_1_element_labelform_id_temp"),B.innerHTML=m,B.setAttribute("class","label"),B.style.verticalAlign="top";var Q=document.createElement("span");Q.setAttribute("id",e+"_1_required_elementform_id_temp"),Q.innerHTML="",Q.setAttribute("class","required"),Q.style.verticalAlign="top","yes"==d&&(Q.innerHTML=" *"),k.appendChild(B),k.appendChild(Q);var T=document.createElement("div");T.setAttribute("id","main_div");var M=document.createElement("div");M.setAttribute("id",e+"_elemet_tableform_id_temp");var L="yes"==n?"none":"table-cell",z=document.createElement("div");z.setAttribute("align","left"),z.style.display=L,z.style.width=i+"px",z.setAttribute("id",e+"_label_sectionform_id_temp");var q=document.createElement("div");q.setAttribute("align","left"),q.style.display="table-cell",q.setAttribute("id",e+"_element_sectionform_id_temp");var H=document.createElement("span");H.setAttribute("id",e+"_element_labelform_id_temp"),H.innerHTML=t,H.setAttribute("class","label"),H.style.verticalAlign="top";var N=document.createElement("span");N.setAttribute("id",e+"_required_elementform_id_temp"),N.innerHTML="",N.setAttribute("class","required"),N.style.verticalAlign="top","yes"==d&&(N.innerHTML=" *");var S=document.getElementById("show_table"),D=document.createElement("br");z.appendChild(H),z.appendChild(N),q.appendChild(b),q.appendChild(v),q.appendChild(E),q.appendChild(A),q.appendChild(w),q.appendChild(g),M.appendChild(z),M.appendChild(q),C.appendChild(j),M.appendChild(D),M.appendChild(k),M.appendChild(C),T.appendChild(M),S.appendChild(T),jQuery("#main_div").append(form_maker.type_password_description),"top"==a&&label_top(e),change_class(r,e),refresh_attr(e,"type_text")}function create_custom_button_add(e,t,i){var a=jQuery('Add a new button '),l=jQuery(' '),d=jQuery('
');for(n=t.length,j=0;j'),r=jQuery('
');r.append(create_custom_button_name(e,j,t[j])),r.append(create_custom_button_function(e,j,i[j])),_.append(r);var o=jQuery('
');_.append(o),d.append(_)}var m=a;return create_option_container(null,m=(m=m.add(l)).add(d))}function create_custom_button_name(e,t,i){return create_option_container(jQuery('Name '),jQuery(' '))}function create_custom_button_function(e,t,i){return create_option_container(jQuery('OnClick '),jQuery(' '))}function add_button(e){var t=jQuery("#buttons"),i=t.children().last();0'),n=jQuery('
');n.append(create_custom_button_name(e,j,"Button")),n.append(create_custom_button_function(e,j,"")),a.append(n);var l=jQuery('
');a.append(l),t.append(a),element="button",type="button",td2=document.getElementById(e+"_element_sectionform_id_temp");var d=document.createElement(element);d.setAttribute("type",type),d.setAttribute("id",e+"_elementform_id_temp"+j),d.setAttribute("name",e+"_elementform_id_temp"+j),d.setAttribute("value","Button"),d.innerHTML="Button",d.setAttribute("onclick",""),td2.appendChild(d),refresh_attr(e,"type_checkbox")}function remove_button(e,t){table=document.getElementById("button_opt"+e),button=document.getElementById(t+"_elementform_id_temp"+e),table.parentNode.removeChild(table),button.parentNode.removeChild(button)}function go_to_type_button(e){w_title=["Button"],w_func=[""],w_attr_name=[],w_attr_value=[],type_button(e,w_title,w_func,"wdform_button",w_attr_name,w_attr_value)}function type_button(e,t,i,a,l,d){jQuery("#element_type").val("type_button"),delete_last_child();var _=jQuery("#edit_table"),r=jQuery('
');_.append(r);var o=jQuery('
');r.append(o),o.append(create_field_type("type_button")),o.append(create_custom_button_add(e,t,i));var m=jQuery('
');o.append(create_advanced_options_container(m)),m.append(create_class(e,a)),m.append(create_additional_attributes(e,l,"type_button")),element="button",type="button";var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("value","type_button"),s.setAttribute("name",e+"_typeform_id_temp"),s.setAttribute("id",e+"_typeform_id_temp");var u=document.createElement("div");u.setAttribute("id","main_div");var c=document.createElement("div");c.setAttribute("id",e+"_elemet_tableform_id_temp");var p=document.createElement("div");p.setAttribute("align","left"),p.style.display="table-cell",p.setAttribute("id",e+"_label_sectionform_id_temp");var f=document.createElement("div");f.setAttribute("align","left"),f.style.display="table-cell",f.setAttribute("id",e+"_element_sectionform_id_temp");var y=document.createElement("br"),h=(document.createElement("br"),document.createElement("br"),document.createElement("br"),document.createElement("span"));for(h.setAttribute("id",e+"_element_labelform_id_temp"),h.innerHTML="button_"+e,h.style.cssText="display:none",n=t.length,j=0;jTotal'),jQuery(' '))}function check_isnum_or_minus(e){var t=e.which||e.keyCode;return!(31Items'),a=jQuery(' '),l=jQuery('
');for(n=t.length,j=0;j'),_=jQuery('
');_.append(create_grading_item(e,j,t[j])),d.append(_);var r=jQuery('
');d.append(r),l.append(d)}var o=i;return create_option_container(null,o=(o=o.add(a)).add(l))}function create_grading_item(e,t,i){jQuery('Name ');return create_option_container(null,jQuery(' '))}function add_grading_items(e){for(i=100;0'),n=jQuery('
');n.append(create_grading_item(e,m,"")),a.append(n);var l=jQuery('
');a.append(l),t.append(a),refresh_grading_items(e)}function remove_grading_items(e,t){var i=document.getElementById("items"),a=document.getElementById("item_row_"+e);i.removeChild(a),refresh_grading_items(t)}function refresh_grading_items(e){for(i=100;0document.getElementById(e+"_total_element"+t).innerHTML?document.getElementById(e+"_text_element"+t).innerHTML=" Total should be less than "+document.getElementById(e+"_total_element"+t).innerHTML:document.getElementById(e+"_text_element"+t).innerHTML="");document.getElementById(e+"_sum_element"+t)&&(document.getElementById(e+"_sum_element"+t).innerHTML=i)}function go_to_type_grading(e){w_attr_name=[],w_attr_value=[],w_items=["item1","item2","item3"],type_grading(e,"Grading","","top","no",w_items,"100","no","wdform_grading",w_attr_name,w_attr_value)}function type_grading(e,t,i,a,n,l,d,_,r,o,m){jQuery("#element_type").val("type_grading"),delete_last_child();var s=jQuery("#edit_table"),u=jQuery('
');s.append(u);var c=jQuery('
');u.append(c),c.append(create_field_type("type_grading")),c.append(create_label(e,t)),c.append(create_label_position(e,a)),c.append(create_hide_label(e,n)),c.append(create_required(e,_)),c.append(create_grading_total(e,d)),c.append(create_grading_items(e,l));var p=jQuery('
');c.append(create_advanced_options_container(p)),p.append(create_field_label_size(e,i)),p.append(create_class(e,r)),p.append(create_additional_attributes(e,o,"type_grading")),element="input",type="grading";var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("value","type_grading"),f.setAttribute("name",e+"_typeform_id_temp"),f.setAttribute("id",e+"_typeform_id_temp");var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("value",_),y.setAttribute("name",e+"_requiredform_id_temp"),y.setAttribute("id",e+"_requiredform_id_temp");var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value",n),h.setAttribute("name",e+"_hide_labelform_id_temp"),h.setAttribute("id",e+"_hide_labelform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",d),b.setAttribute("name",e+"_grading_totalform_id_temp"),b.setAttribute("id",e+"_grading_totalform_id_temp");var v=document.createElement("div");v.setAttribute("id","main_div");var w=document.createElement("div");w.setAttribute("id",e+"_elemet_tableform_id_temp");var g="yes"==n?"none":"table-cell",E=document.createElement("div");E.setAttribute("align","left"),E.style.display="table-cell",E.style.cssText="display:"+g+"; vertical-align:top; width:"+i+"px;",E.setAttribute("id",e+"_label_sectionform_id_temp");var A=document.createElement("div");A.setAttribute("align","left"),A.style.display="table-cell",A.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var j=document.createElement("br"),x=(document.createElement("br"),document.createElement("div"));x.setAttribute("id",e+"_elementform_id_temp");var k=document.createElement("span");k.setAttribute("id",e+"_element_labelform_id_temp"),k.innerHTML=t,k.setAttribute("class","label");var I=document.createElement("span");I.setAttribute("id",e+"_required_elementform_id_temp"),I.innerHTML="",I.setAttribute("class","required"),"yes"==_&&(I.innerHTML=" *");var C=document.getElementById("show_table");E.appendChild(k),E.appendChild(I),A.appendChild(h),A.appendChild(f),A.appendChild(y),A.appendChild(b),A.appendChild(x),w.appendChild(E),w.appendChild(A),v.appendChild(w),v.appendChild(j),C.appendChild(v),jQuery("#main_div").append(form_maker.type_grades_description),"top"==a&&label_top(e),change_class(r,e),refresh_attr(e,"type_grading"),refresh_grading_items(e)}function create_matrix_input_type(e,t){var i=jQuery('Input Type '),a=jQuery(' ');return a.append(jQuery('Radio Button ")),a.append(jQuery('Check Box ")),a.append(jQuery('Text Box ")),a.append(jQuery('Drop Down ")),create_option_container(i,a)}function change_input_type(e,t){document.getElementById(e+"_input_typeform_id_temp").value=t}function refresh_matrix(e){for(i=100;0Text Box width(px)'),jQuery(' '),"el_textbox","text"==i)}function create_matrix_rows(e,t){var i=jQuery('Rows '),a=jQuery(' '),l=jQuery('
');for(n=t.length,j=1;j'),_=jQuery('
');_.append(create_matrix_row_item(e,j,t[j])),d.append(_);var r=jQuery('
");d.append(r),l.append(d)}var o=i;return create_option_container(null,o=(o=o.add(a)).add(l))}function create_matrix_row_item(e,t,i){jQuery('Name ');return create_option_container(null,jQuery(' '))}function create_matrix_columns(e,t){var i=jQuery('Columns '),a=jQuery(' '),l=jQuery('
');for(n=t.length,j=1;j'),_=jQuery('
');_.append(create_matrix_column_item(e,j,t[j])),d.append(_);var r=jQuery('
");d.append(r),l.append(d)}var o=i;return create_option_container(null,o=(o=o.add(a)).add(l))}function create_matrix_column_item(e,t,i){jQuery('Name ');return create_option_container(null,jQuery(' '))}function add_to_matrix(e,t){for(i=100;0');(_=jQuery('
')).append(create_matrix_row_item(t,m,"")),l.append(_);var d=jQuery('
");l.append(d),a.append(l)}else{var _,r=jQuery("#columns");l=jQuery('
');(_=jQuery('
')).append(create_matrix_column_item(t,n,"")),l.append(_);var o=jQuery('
");l.append(o),r.append(l)}refresh_matrix(t)}function remove_rowcols(e,t,i){jQuery("#el_"+i+e).remove(),jQuery("#item_"+i+"_"+e).remove(),refresh_matrix(t)}function go_to_type_matrix(e){w_attr_name=[],w_attr_value=[],w_rows=["","row1","row2"],w_columns=["","column1","column2"],type_matrix(e,"Matrix","","top","no","radio",w_rows,w_columns,"no","wdform_matrix",w_attr_name,w_attr_value,"100")}function type_matrix(e,t,i,a,n,l,d,_,r,o,m,s,u){jQuery("#element_type").val("type_matrix"),delete_last_child();var c=jQuery("#edit_table"),p=jQuery('
');c.append(p);var f=jQuery('
');p.append(f),f.append(create_field_type("type_matrix")),f.append(create_label(e,t)),f.append(create_label_position(e,a)),f.append(create_hide_label(e,n)),f.append(create_required(e,r)),f.append(create_matrix_input_type(e,l)),f.append(create_matrix_input_size(e,u,l)),f.append(create_matrix_rows(e,d)),f.append(create_matrix_columns(e,_));var y=jQuery('
');f.append(create_advanced_options_container(y)),y.append(create_field_label_size(e,i)),y.append(create_class(e,o)),y.append(create_additional_attributes(e,m,"type_matrix")),element="input",type="matrix";var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("value","type_matrix"),h.setAttribute("name",e+"_typeform_id_temp"),h.setAttribute("id",e+"_typeform_id_temp");var b=document.createElement("input");b.setAttribute("type","hidden"),b.setAttribute("value",r),b.setAttribute("name",e+"_requiredform_id_temp"),b.setAttribute("id",e+"_requiredform_id_temp");var v=document.createElement("input");v.setAttribute("type","hidden"),v.setAttribute("value",n),v.setAttribute("name",e+"_hide_labelform_id_temp"),v.setAttribute("id",e+"_hide_labelform_id_temp");var w=document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("value",l),w.setAttribute("name",e+"_input_typeform_id_temp"),w.setAttribute("id",e+"_input_typeform_id_temp");var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("value",u),g.setAttribute("name",e+"_textbox_sizeform_id_temp"),g.setAttribute("id",e+"_textbox_sizeform_id_temp");var E=document.createElement("div");E.setAttribute("id","main_div");var A=document.createElement("div");A.setAttribute("id",e+"_elemet_tableform_id_temp");var j="yes"==n?"none":"table-cell",x=document.createElement("div");x.setAttribute("align","left"),x.style.display=j,x.style.width=i+"px",x.setAttribute("id",e+"_label_sectionform_id_temp");var k=document.createElement("div");k.setAttribute("align","left"),k.style.display="table-cell",k.setAttribute("id",e+"_element_sectionform_id_temp");document.createElement("br"),document.createElement("br");var I=document.createElement("br"),C=(document.createElement("br"),document.createElement("div"));C.setAttribute("id",e+"_elementform_id_temp"),C.style.display="table";var B=document.createElement("div");B.setAttribute("id",e+"_table_little"),B.style.display="table-row-group",C.appendChild(B);var Q=document.createElement("span");Q.setAttribute("id",e+"_element_labelform_id_temp"),Q.innerHTML=t,Q.setAttribute("class","label");var T=document.createElement("span");T.setAttribute("id",e+"_required_elementform_id_temp"),T.innerHTML="",T.setAttribute("class","required"),"yes"==r&&(T.innerHTML=" *");var M=document.getElementById("show_table");x.appendChild(Q),x.appendChild(T),k.appendChild(h),k.appendChild(b),k.appendChild(v),k.appendChild(w),k.appendChild(g),k.appendChild(C),A.appendChild(x),A.appendChild(k),E.appendChild(A),E.appendChild(I),M.appendChild(E),jQuery("#main_div").append(form_maker.type_matrix_description),"top"==a&&label_top(e),change_class(o,e),refresh_attr(e,"type_matrix"),refresh_matrix(e)}function create_pagination_type(e){var t=jQuery('Pagination Options '),i=jQuery('"),a=jQuery('Steps '),n=jQuery('"),l=jQuery('Percentage '),d=jQuery('"),_=jQuery('No Context '),r=i;return create_option_container(t,r=(r=(r=(r=(r=r.add(a)).add(n)).add(l)).add(d)).add(_))}function pagination_type(e){for(document.getElementById("pages_div").innerHTML="",w_pages=[],k=0,j=1;j<=form_view_max;j++)document.getElementById("form_id_tempform_view"+j)&&(k++,document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages[j]=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages[j]="none");"steps"==e?make_page_steps(w_pages):"percentage"==e?make_page_percentage(w_pages):make_page_none()}function make_page_none(){document.getElementById("pages_div").innerHTML=""}function make_page_percentage(e){document.getElementById("pages_div").innerHTML="",show_title=document.getElementById("el_show_title_input").checked;var t=document.createElement("div");t.setAttribute("class","page_percentage_deactive");var i=document.createElement("div");i.setAttribute("id","div_percentage"),i.setAttribute("class","page_percentage_active");var a=document.createElement("b");for(i.appendChild(a),k=0,n="",j=1;j<=form_view_max;j++)if(e[j]&&(k++,"none"==e[j]&&(e[j]=""),j==form_view)){if(show_title){var n=document.createElement("span");1==k?n.style.paddingLeft="40px":n.style.paddingLeft="5px",n.innerHTML=e[j]}page_number=k}a.innerHTML=Math.round((page_number-1)/k*100)+"%",i.style.width=(page_number-1)/k*100+"%",t.appendChild(i),n&&t.appendChild(n),document.getElementById("pages_div").appendChild(t)}function make_page_steps(e){for(document.getElementById("pages_div").innerHTML="",show_title=document.getElementById("el_show_title_input").checked,k=0,j=1;j<=form_view_max;j++)e[j]&&(k++,"none"==e[j]&&(e[j]=""),page_number=document.createElement("span"),j==form_view?page_number.setAttribute("class","page_active"):page_number.setAttribute("class","page_deactive"),show_title?page_number.innerHTML=e[j]:page_number.innerHTML=k,document.getElementById("pages_div").appendChild(page_number))}function create_pagination_title(e){return create_option_container(jQuery('Show Page Titles in Progress Bar '),jQuery(' "))}function show_title_pagebreak(){document.getElementById("pages_div").innerHTML="",document.getElementById("el_pagination_steps").checked?pagination_type("steps"):document.getElementById("el_pagination_percentage").checked&&pagination_type("percentage")}function create_pagination_numbers(e){return create_option_container(jQuery('Show Page Numbers in Footer '),jQuery(' "))}function show_numbers_pagebreak(){if(document.getElementById("numbers_div").innerHTML="",document.getElementById("el_show_numbers_input").checked){for(k=0,j=1;j<=form_view_max;j++)document.getElementById("form_id_tempform_view"+j)&&(k++,j==form_view&&(page_number=k));var e=document.createElement("span");e.setAttribute("class","page_numbersform_id_temp"),e.innerHTML=page_number+"/"+k,document.getElementById("numbers_div").appendChild(e)}}function create_page_titles(){var e=jQuery('Pages Titles '),t=jQuery('
');for(k=0,j=1;j<=form_view_max;j++){var i=jQuery("#form_id_tempform_view"+j);if(0'),n=i.attr("page_title");null==typeof n&&(n="Untitled Page");var l=jQuery(' ');a.append(jQuery(""+j+". ")),a.append(l),t.append(a)}}return create_option_container(null,l=(l=e).add(t))}function set_page_title(e,t){e=e.replace(/(<([^>]+)>)/gi,""),document.getElementById("form_id_tempform_view"+t).setAttribute("page_title",e),show_title_pagebreak()}function el_page_navigation(){w_type=document.getElementById("pages").getAttribute("type"),w_show_numbers=!1,w_show_title=!1,"true"==document.getElementById("pages").getAttribute("show_numbers")&&(w_show_numbers=!0),"true"==document.getElementById("pages").getAttribute("show_title")&&(w_show_title=!0),w_attr_name=[],w_attr_value=[],type_page_navigation(w_type,w_show_title,w_show_numbers,w_attr_name,w_attr_value)}function type_page_navigation(e,t,i,a,n){need_enable&&enable2(),jQuery("#element_type").val("type_page_navigation"),delete_last_child();var l=jQuery("#edit_table"),d=jQuery('
');l.append(d);var _=jQuery('
');for(d.append(_),_.append(create_field_type("type_page_navigation")),_.append(create_pagination_type(e)),_.append(create_pagination_title(t)),_.append(create_pagination_numbers(i)),_.append(create_page_titles()),w_pages=[],k=0,j=1;j<=form_view_max;j++)document.getElementById("form_id_tempform_view"+j)&&(document.getElementById("form_id_tempform_view"+j).getAttribute("page_title")?w_pages[j]=document.getElementById("form_id_tempform_view"+j).getAttribute("page_title"):w_pages[j]="Untitled Page");var r=document.createElement("div");r.setAttribute("id","main_div");var o=document.createElement("table");o.setAttribute("id","_elemet_tableform_id_temp"),o.setAttribute("width","90%");var m=document.createElement("tr"),s=document.createElement("td");s.setAttribute("valign","top"),s.setAttribute("align","left"),s.setAttribute("id","_element_sectionform_id_temp"),s.setAttribute("width","100%");var u=document.createElement("br"),c=document.createElement("div");c.setAttribute("align","left"),c.setAttribute("id","pages_div"),c.style.width="100%",c.innerHTML="";var p=document.createElement("div");p.setAttribute("align","center"),p.setAttribute("id","numbers_div"),p.style.width="100%",p.style.paddingTop="100px",p.innerHTML="",s.appendChild(c),s.appendChild(p);var f=document.getElementById("show_table");m.appendChild(s),o.appendChild(m),r.appendChild(o),r.appendChild(u),f.appendChild(r),"steps"==e?make_page_steps(w_pages):"percentage"==e?make_page_percentage(w_pages):make_page_none(w_pages),i&&show_numbers_pagebreak()}function refresh_page_numbers(){var a=jQuery(".wdform-page-and-images"),n="true"==document.getElementById("pages").getAttribute("show_numbers");a.each(function(e){var t=jQuery(this).find(".form_id_tempform_view_img").attr("id").split("form_id_tempform_view_img");if(j=t[1],document.getElementById("page_numbersform_id_temp"+j)&&(document.getElementById("page_numbersform_id_temp"+j).innerHTML="",n)){var i=document.createElement("span");i.setAttribute("class","page_numbersform_id_temp"),i.innerHTML=e+1+"/"+a.length,document.getElementById("page_numbersform_id_temp"+j).appendChild(i)}})}function gen_form_fields(){switch(wdtype){case"type_editor":w_editor=document.getElementById("wdform_field"+id).innerHTML,form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_editor+"*:*w_editor*:*",form_fields+="*:*new_field*:*";break;case"type_send_copy":for(w_hide_label=document.getElementById(id+"_hide_labelform_id_temp").value,w_first_val=document.getElementById(id+"_elementform_id_temp").checked,atrs=return_attributes(id+"_elementform_id_temp"),w_attr_name=atrs[0],w_attr_value=atrs[1],form_fields+=w_field_label+"*:*w_field_label*:*",form_fields+=w_field_label_size+"*:*w_field_label_size*:*",form_fields+=w_field_label_pos+"*:*w_field_label_pos*:*",form_fields+=w_hide_label+"*:*w_hide_label*:*",form_fields+=w_first_val+"*:*w_first_val*:*",form_fields+=w_required+"*:*w_required*:*",j=0;j"+t+"
";var i=jQuery(this).attr("data-callback"),a=jQuery(this).attr("data-callback-parameter"),n=jQuery(this).attr("data-tab-id"),l=jQuery(this).attr("data-content-id"),d=jQuery(this).val();if("function"==typeof window[i]&&!window[i](d,a)){var _=jQuery("#"+l).closest(".ui-tabs-panel");if(jQuery("#fm-tabs").tabs({active:jQuery(".ui-tabs-panel").index(_)}),0!==jQuery(".fm_fieldset_active:visible").length&&(jQuery(".fm_fieldset_active").addClass("fm_fieldset_deactive").removeClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+l).removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery("#"+n).addClass("active"),jQuery("#fieldset_id").val(n)),0===jQuery(this).parent().find(".fm-validate-description").length){var r=jQuery(this).parent().find(".description");r.length?r.before(t):jQuery(this).parent().append(t),jQuery(this).addClass("fm-validate-field")}return jQuery("html, body").animate({scrollTop:jQuery(this).offset().top-200},500),o=!1}}),o&&set_condition(),o}function fm_remove_validate_error_message(){jQuery(".fm-validate").each(function(){jQuery(this).on("keypress change",function(){jQuery(this).parent().find(".fm-validate-description").remove(),jQuery(this).removeClass("fm-validate-field")})})}function fm_validate_email(e,t){if(""!=t&&!jQuery(t).is(":checked"))return!0;var i=e.split(","),a=/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,61}$/,n=/^({)[0-9]+(})$/,l=["{adminemail}","{useremail}"];for(var d in i){var _=i[d].replace(/^\s+|\s+$/g,"");if(!l.includes(_)&&_&&!a.test(_)&&!n.test(_))return!1}return!0}function fm_add_inline_email_validation_message(e){return!!fm_validate_email(jQuery(e).val(),"")||(jQuery(e).after(""+form_maker_manage.not_valid_value+"
"),jQuery(e).addClass("fm-validate-field"),jQuery("html, body").animate({scrollTop:jQuery(this).offset().top-200},500),!1)}function fm_placeholders_popup(e){var t=jQuery("#"+e),i=t.closest(".wd-group");i.addClass("placeholders-active"),jQuery("html").animate({scrollTop:i.offset().top-50},500);var a=jQuery(".placeholder-popup");if(i.prepend(jQuery("#placeholders_overlay")),i.find(".wp-editor-wrap").length)i.find(".wp-editor-wrap").append(a);else{t.after(a);var n=t.val();t.focus().val("").val(n)}a.show()}function fm_placeholders_popup_close(){jQuery("#placeholders_overlay").closest(".wd-group").removeClass("placeholders-active"),jQuery(".placeholder-popup").hide()}function set_condition(){for(field_condition="",i=0;i<500;i++)if(conditions="",document.getElementById("condition"+i)){for(field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*",field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*",field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*",k=0;k<500;k++)if(document.getElementById("condition_div"+i+"_"+k)){if(conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***",conditions+=document.getElementById("is_select"+i+"_"+k).value+"***","SELECT"==document.getElementById("field_value"+i+"_"+k).tagName)if(document.getElementById("field_value"+i+"_"+k).getAttribute("multiple")){var e=document.getElementById("field_value"+i+"_"+k),t="";for(m=0;mThis form is currently disabled for editing. Please click Convert to adapt the form structure and enable editing. Convert
'))}),jQuery(document).on("keydown",function(e){27===e.keyCode&&(jQuery("#fm_popup_container").is(":visible")&&fm_popup_toggle("fm_popup_container"),jQuery("#fm_delete_page_popup_container").is(":visible")&&fm_popup_toggle("fm_delete_page_popup_container"),jQuery("#fm_revision_popup_container").is(":visible")&&fm_popup_toggle("fm_revision_popup_container"))}),jQuery(window).on("load",function(){storageAvailable("localStorage")&&localStorage.getItem("wd-form-first-time-use")||jQuery(".first-time-use").show(),jQuery(window).on("scroll",function(e){if(!jQuery("#add_field").hasClass("ui-sortable-helper")){var t=jQuery(".fm-edit-content").offset().top,i=jQuery(window).scrollTop();if(t-50',e.appendChild?e.appendChild(f):e(f);var y=f.firstChild,_=y.firstChild,I=f.lastChild,u=I.firstChild,c=u.firstChild,h=c.firstChild,p=h.firstChild,b=h.nextSibling.firstChild,r=b.firstChild,v=r.nextSibling,o=v.nextSibling,w=o.nextSibling,g=w.nextSibling,E=y.nextSibling,n=E.firstChild;it(),at(),St&&(_.style.width="0px"),yi||(I.draggable=!0),b.style.outline="none",null!=k.tabindex&&(_.tabIndex=k.tabindex),k.autofocus&&Le(),k.gutter||k.lineNumbers||(h.style.display="none"),vi&&(y.style.height="1px",y.style.position="absolute"),wi?E.className+=function(){var e=document.createElement("div"),t=document.createElement("div");e.className="CodeMirror-scrollbar",e.style.cssText="position: absolute; left: -9999px; height: 100px;",t.className="CodeMirror-scrollbar-inner",t.style.height="200px",e.appendChild(t),document.body.appendChild(e);var i=e.offsetWidth<=1;return document.body.removeChild(e),i}()?" cm-sb-overlap":" cm-sb-nonoverlap":ci&&(E.className+=" cm-sb-ie7");try{rt("x")}catch(e){throw e.message.match(/runtime/i)&&(e=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),e}var l,C,B,A,d=new oi,m=new oi,Q=new Zt([new Yt([new Gt("")])]);Je();var s,j,x,T,M,L,z,q,H,N,S,D,P,O={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},K=0,U=0,F=!1,R=!1,W=0,V=0,$=0,G=0,Y="",Z=!1,X=!0,J={};zt(function(){_e(k.value||""),M=!1})();var ee,te=new ti;if(ri(I,"mousedown",zt(function(t){Ke(_i(t,"shiftKey"));for(var e=li(t);e!=f;e=e.parentNode)if(e.parentNode==u&&e!=c)return;for(var e=li(t);e!=f;e=e.parentNode)if(e.parentNode==p)return k.onGutterClick&&k.onGutterClick(ne,Ci(p.childNodes,e)+V,t),ai(t);var n=Et(t);switch(di(t)){case 3:return void(si&&!Dt&&At(t));case 2:return n&&We(n.line,n.ch,!0),setTimeout(Le,20),void ai(t)}if(!n)return void(li(t)==I&&ai(t));A||pe();var i=+new Date;{if(x&&x.time>i-400&&xi(x.pos,n))return ai(t),setTimeout(Le,20),void Ue({line:a=n.line,ch:0},$e({line:a+1,ch:0}));if(j&&j.time>i-400&&xi(j.pos,n))return x={time:i,pos:n},ai(t),Ze(n);j={time:i,pos:n}}var a;var l,d=n;if(k.dragDrop&&gi&&!k.readOnly&&!xi(O.from,O.to)&&!ki(n,O.from)&&!ki(O.to,n)){function _(e){yi&&(I.draggable=!1),T=!1,r(),o(),Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)<10&&(ai(e),We(n.line,n.ch,!0),Le())}yi&&(I.draggable=!0);var r=ri(document,"mouseup",zt(_),!0),o=ri(I,"drop",zt(_),!0);return T=!0,void(I.dragDrop&&I.dragDrop())}function m(e){clearTimeout(l);var t=Et(e);t&&Ue(n,t),ai(e),Le(),M=!0,s(),r()}ai(t),We(n.line,n.ch,!0);var s=ri(document,"mousemove",zt(function(e){clearTimeout(l),ai(e),ui||di(e)?function e(t){var i=Et(t,!0);if(i&&!xi(i,d)){A||pe(),Ue(n,d=i),M=!1;var a=Se();(i.line>=a.to||i.line=e.ch)&&t.push(l.marker||l)}return t},setMarker:zt(function(e,t,i){"number"==typeof e&&(e=le(Ve(e)));return e.gutterMarker={text:t,style:i},S=!0,e}),clearMarker:zt(function(e){"number"==typeof e&&(e=le(Ve(e)));e.gutterMarker=null,S=!0}),setLineClass:zt(function(e,t,i){return dt(e,function(e){if(e.className!=t||e.bgClassName!=i)return e.className=t,e.bgClassName=i,!0})}),hideLine:zt(function(e){return _t(e,!0)}),showLine:zt(function(e){return _t(e,!1)}),onDeleteLine:function(e,t){if("number"==typeof e){if(!ae(e))return null;e=le(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:function(e){if("number"==typeof e){if(!ae(e))return null;var t=e;if(!(e=le(e)))return null}else{var t=Xt(e);if(null==t)return null}var i=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:i&&i.text,markerClass:i&&i.style,lineClass:e.className,bgClass:e.bgClassName}},addWidget:function(e,t,i,a,n){var l=(e=pt($e(e))).yBot,d=e.x;if(t.style.position="absolute",u.appendChild(t),"over"==a)l=e.y;else if("near"==a){var _=Math.max(I.offsetHeight,Q.height*yt()),r=Math.max(u.clientWidth,b.clientWidth)-gt();e.yBot+t.offsetHeight>_&&e.y>t.offsetHeight&&(l=e.y-t.offsetHeight),d+t.offsetWidth>r&&(d=r-t.offsetWidth)}t.style.top=l+wt()+"px",t.style.left=t.style.right="","right"==n?(d=u.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?d=0:"middle"==n&&(d=(u.clientWidth-t.offsetWidth)/2),t.style.left=d+gt()+"px"),i&&He(d,l,d+t.offsetWidth,l+t.offsetHeight)},lineCount:function(){return Q.size},clipPos:$e,getCursor:function(e){return null==e&&(e=O.inverted),{line:(t=e?O.from:O.to).line,ch:t.ch};var t},somethingSelected:function(){return!xi(O.from,O.to)},setCursor:zt(function(e,t,i){null==t&&"number"==typeof e.line?We(e.line,e.ch,i):We(e,t,i)}),setSelection:zt(function(e,t,i){(i?Ue:Fe)($e(e),$e(t||e))}),getLine:function(e){if(ae(e))return le(e).text},getLineHandle:function(e){if(ae(e))return le(e)},setLine:zt(function(e,t){ae(e)&&Ee(t,{line:e,ch:0},{line:e,ch:le(e).text.length})}),removeLine:zt(function(e){ae(e)&&Ee("",{line:e,ch:0},$e({line:e+1,ch:0}))}),replaceRange:zt(Ee),getRange:function(e,t){return xe($e(e),$e(t))},triggerOnKeyDown:zt(ce),execCommand:function(e){return Ot[e](ne)},moveH:zt(function(e,t){var i=e<0?O.from:O.to;(s||xi(O.from,O.to))&&(i=Ge(e,t));We(i.line,i.ch,!0)}),deleteH:zt(function(e,t){xi(O.from,O.to)?e<0?Ee("",Ge(e,t),O.to):Ee("",O.from,Ge(e,t)):Ee("",O.from,O.to);L=!0}),moveV:zt(function(e,t){var i=0,a=pt(O.inverted?O.from:O.to,!0);null!=Ye&&(a.x=Ye);"page"==t?i=Math.min(I.clientHeight,window.innerHeight||document.documentElement.clientHeight):"line"==t&&(i=yt());var n=ft(a.x,a.y+i*e+2);"page"==t&&(E.scrollTop+=pt(n,!0).y-a.y);We(n.line,n.ch,!0),Ye=a.x}),toggleOverwrite:function(){F?(F=!1,v.className=v.className.replace(" CodeMirror-overwrite","")):(F=!0,v.className+=" CodeMirror-overwrite")},posFromIndex:function(i){var a,n=0;return Q.iter(0,Q.size,function(e){var t=e.text.length+1;if(iK&&(E.scrollTop=K)},getInputField:function(){return _},getWrapperElement:function(){return f},getScrollerElement:function(){return I},getGutterElement:function(){return h}};function le(e){return function(e,t){for(;!e.lines;)for(var i=0;;++i){var a=e.children[i],n=a.chunkSize();if(tk.undoDepth;)te.done.shift()}we(e,t,i,a,n)}}function ve(e,t){if(e.length){for(var i=e.pop(),a=[],n=i.length-1;0<=n;n-=1){var l=i[n],d=[],_=l.start+l.added;Q.iter(l.start,_,function(e){d.push(e.text)}),a.push({start:l.start,added:l.old.length,old:d});var r={line:l.start+l.old.length-1,ch:Ii(d[d.length-1],l.old[l.old.length-1])};we({line:l.start,ch:0},{line:_-1,ch:le(_-1).text.length},l.old,r,r)}M=!0,t.push(a)}}function we(e,t,i,a,n){if(!R){var l=!1,d=Y.length;k.lineWrapping||Q.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==d)return l=!0}),(e.line!=t.line||1d&&(d=(Y=t).length,l=!(X=!0))}),l&&(Z=!0);for(var f=[],y=i.length-_-1,h=(u=0,B.length);ut.line&&f.push(b+y)}var v,w,g,E=e.line+Math.min(i.length,500);v=e.line,w=E,g=Ct(v),Q.iter(v,w,function(e){e.highlight(C,g,k.tabSize),e.stateAfter=Rt(C,g)}),f.push(E),B=f,Qt(100),z.push({from:e.line,to:t.line+1,diff:y});var A={from:e,to:t,text:i};if(q){for(var j=q;j.next;j=j.next);j.next=A}else q=A;Fe($e(a),$e(n),x(O.from.line),x(O.to.line))}function x(e){return e<=Math.min(t.line,t.line+y)?e:e+y}}function ge(e){var t=yt(),i=Math.floor(Q.height*t+2*wt()),a=I.clientHeight;E.style.height=a+"px",I.clientHeight&&(n.style.height=i+"px"),null!=e&&(E.scrollTop=e),c.style.top=W*t-E.scrollTop+"px",E.style.display=aV&&a.to<$)ge(i);else{var n=Math.max(a.from-100,0),l=Math.min(Q.size,a.to+100);V=o.to?l.push(o):(n.from>o.from&&l.push({from:o.from,to:n.from,domStart:o.domStart}),n.tol&&(o.to=l),o.from>=o.to?d.splice(r--,1):_+=o.to-o.from}if(_!=l-n||n!=V||l!=$){d.sort(function(e,t){return e.domStart-t.domStart});var m=yt(),s=h.style.display;g.style.display="none",function(e,t,i){if(i.length){function a(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}for(var n=0,l=g.firstChild,d=0;dn;)l=a(l),n++;for(var r=0,o=_.to-_.from;rr){if(e.hidden)var t=s.innerHTML=" ";else{var t=""+e.getHTML(tt)+" ";e.bgClassName&&(t='")}s.innerHTML=t,g.insertBefore(s.firstChild,l)}else l=l.nextSibling;++r})}(n,l,d),g.style.display=h.style.display="";var u=n!=V||l!=$||G!=I.clientHeight+m;if(u&&(G=I.clientHeight+m),$=l,W=ei(Q,V=n),g.childNodes.length!=$-V)throw new Error("BAD PATCH! "+JSON.stringify(d)+" size="+($-V)+" nodes="+g.childNodes.length);if(k.lineWrapping){var c=Math.floor(Q.height*m+2*wt());I.clientHeight");else{var t=e.gutterMarker,i=k.lineNumbers?d+k.firstLineNumber:null;t&&t.text?i=t.text.replace("%N%",null!=i?i:""):null==i&&(i=" "),l.push(t&&t.style?'':"",i);for(var a=1;a ");l.push(" "),t||(n=d)}++d}),h.style.display="none",p.innerHTML=l.join(""),null!=n&&k.lineNumbers){for(var a=p.childNodes[n-V],_=String(Q.size).length,r=(i=a.firstChild).textContent||i.innerText||i.nodeValue||"",o="";r.length+o.length<_;)o+=" ";o&&a.insertBefore(document.createTextNode(o),a.firstChild)}h.style.display="";var m=2'}if(O.from.ch&&0<=t.y){var u=_?o-i.x:0;s(t.x,t.y,u,n)}var c=Math.max(0,t.y+(O.from.ch?n:0)),p=Math.min(i.y,m)-c;.2*na.text.length)&&(n=a.text.length),{line:t,ch:n}}t+=e}}var i=le(l.line),_=l.ch==i.text.length&&l.ch!=d;return i.hidden?l.line>=e?t(1)||t(-1):t(-1)||t(1):l}function We(e,t,i){var a=$e({line:e,ch:t||0});(i?Ue:Fe)(a,a)}function Ve(e){return Math.max(0,Math.min(e,Q.size-1))}function $e(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Q.size)return{line:Q.size-1,ch:le(Q.size-1).text.length};var t=e.ch,i=le(e.line).text.length;return null==t||iY.length&&(Y=e.text)});z.push({from:0,to:Q.size})}function tt(e){var t=k.tabSize-e%k.tabSize,i=J[t];if(i)return i;for(var a='',n=0;n",width:t}}function it(){I.className=I.className.replace(/\s*cm-s-\S+/g,"")+k.theme.replace(/(^|\s)\s*/g," cm-s-")}function at(){var e=Kt[k.keyMap].style;f.className=f.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function nt(){this.set=[]}function lt(e,t,i){e=$e(e),t=$e(t);var n=new nt;if(!ki(e,t))return n;function a(e,t,i,a){le(e).addMark(new Vt(t,i,a,n))}if(e.line==t.line)a(e.line,e.ch,t.ch,i);else{a(e.line,e.ch,null,i);for(var l=e.line+1,d=t.line;lY.length&&(Y=i,maxWidth=null,Z=!1)}de(e,_?0:1);var a=O.from.line,n=O.to.line;if(_&&(a==t||n==t)){var l=a==t?Re({line:a,ch:0},a,0):O.from,d=n==t?Re({line:n,ch:0},n,0):O.to;if(!d)return;Fe(l,d)}return S=!0}})}function rt(e){return r.innerHTML="x ",r.firstChild.firstChild.firstChild.nodeValue=e,r.firstChild.firstChild.offsetWidth||10}nt.prototype.clear=zt(function(){for(var e=1/0,t=-1/0,i=0,a=this.set.length;i"+e.getHTML(tt,t,ut,i)+"
";var a=document.getElementById(ut),n=a.offsetTop,l=a.offsetLeft;if(ui&&0==n&&0==l){var d=document.createElement("span");d.innerHTML="x",a.parentNode.insertBefore(d,a.nextSibling),n=d.offsetTop}return{top:n,left:l}}function pt(e,t){var i,a=yt(),n=a*(ei(Q,e.line)-(t?W:0));if(0==e.ch)i=0;else{var l=ct(le(e.line),e.ch);i=l.left,k.lineWrapping&&(n+=Math.max(0,l.top))}return{x:i,y:n,yBot:n+a}}function ft(e,t){t<0&&(t=0);var a=yt(),i=vt(),n=W+Math.floor(t/a),l=Jt(Q,n);if(l>=Q.size)return{line:Q.size-1,ch:le(Q.size-1).text.length};var d=le(l),_=d.text,r=k.lineWrapping,o=r?n-ei(Q,l):0;if(e<=0&&0==o)return{line:l,ch:0};function m(e){var t=ct(d,e);if(r){var i=Math.round(t.top/a);return Math.max(0,t.left+(i-o)*I.clientWidth)}return t.left}for(var s,u=0,c=0,p=_.length,f=Math.min(p,Math.ceil((e+o*I.clientWidth*.9)/i));;){var y=m(f);if(!(y<=e&&f";for(var e=0;e<49;++e)st+="x ";st+="x"}var t=g.clientHeight;return t==mt||(mt=t,r.innerHTML=st,ot=r.firstChild.offsetHeight/50||1,r.innerHTML=""),ot}var ht,bt=0;function vt(){return I.clientWidth==bt?ht:(bt=I.clientWidth,ht=rt("x"))}function wt(){return b.offsetTop}function gt(){return b.offsetLeft}function Et(e,t){var i,a,n=Ai(I,!0);try{i=e.clientX,a=e.clientY}catch(e){return null}if(!t&&(i-n.left>I.clientWidth||a-n.top>I.clientHeight))return null;var l=Ai(b,!0);return ft(i-l.left,a-l.top)}function At(e){var t=Et(e),i=E.scrollTop;if(t&&!bi){(xi(O.from,O.to)||ki(t,O.from)||!ki(t,O.to))&&zt(We)(t.line,t.ch);var a=_.style.cssText;y.style.position="absolute",_.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",N=!0;var n=_.value=ke();if(Le(),ji(_),si){ni(e);var l=ri(window,"mouseup",function(){l(),setTimeout(d,20)},!0)}else setTimeout(d,50)}function d(){var e=Qi(_.value).join("\n");e==n||k.readOnly||zt(Ae)(e,"end"),y.style.position="relative",_.style.cssText=a,pi&&(E.scrollTop=i),Me(!(N=!1)),Ce()}}function jt(){clearInterval(l);var e=!0;v.style.visibility="",l=setInterval(function(){v.style.visibility=(e=!e)?"":"hidden"},650)}var xt={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function kt(e){var t=O.inverted?O.from:O.to,i=le(t.line),a=t.ch-1,n=0<=a&&xt[i.text.charAt(a)]||xt[i.text.charAt(++a)];if(n){n.charAt(0);for(var u=">"==n.charAt(1),c=u?1:-1,l=i.styles,d=a+1,_=0,r=l.length;_"==s.charAt(1)==u)f.push(a);else{if(f.pop()!=s.charAt(0))return{pos:l,match:!1};if(!f.length)return{pos:l,match:!0}}}}else l+=c*r.length}}}function It(e){for(var t,i,a=e,n=e-40;n=Q.size)){var t=It(d),_=t&&le(t-1).stateAfter;_=_?Rt(C,_):Wt(C);var r=0,o=C.compareStates,m=!1,s=t,u=!1;if(Q.iter(s,Q.size,function(e){var t=e.stateAfter;if(+new Date>l)return B.push(s),Qt(k.workDelay),m&&z.push({from:d,to:s+1}),u=!0;var i=e.highlight(C,_,k.tabSize);i&&(m=!0),e.stateAfter=Rt(C,_);var a=null;if(o){var n=t&&o(t,_);n!=mi&&(a=!!n)}if(null==a&&(!1===i&&t?3<++r&&(!C.indent||C.indent(t,"")==C.indent(_,""))&&(a=!0):r=0),a)return!0;++s}),u)return;m&&z.push({from:d,to:s+1})}}e&&k.onHighlightComplete&&k.onHighlightComplete(ne)}function Qt(e){B.length&&m.set(e,zt(Bt))}function Tt(){M=L=q=null,H=!(z=[]),D=[]}function Mt(){var i,e,t;if(Z&&(i=0,X=!(Y=""),Q.iter(0,Q.size,function(e){var t=e.text;!e.hidden&&t.length>i&&(i=t.length,Y=t)}),Z=!1),X&&!k.lineWrapping&&(o.style.left=rt(Y)+"px",X=!1),H){var a=qe();e=Ne(a.x,a.y,a.x,a.yBot)}z.length?t=De(z,!0,e?e.scrollTop:null):(H&&Oe(),S&&Pe()),e&&ze(),H&&(!function(){if(v.getBoundingClientRect){var e=v.getBoundingClientRect();if(!ui||e.top!=e.bottom){var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&ze()}}}(),jt()),A&&!N&&(!0===M||!1!==M&&H)&&Me(L),H&&k.matchBrackets&&setTimeout(zt(function(){P&&(P(),P=null),xi(O.from,O.to)&&kt(!1)}),20);var n=H,l=D;q&&k.onChange&&ne&&k.onChange(ne,q),n&&k.onCursorActivity&&k.onCursorActivity(ne);for(var d=0;d=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(-1this.from&&(a=t&&(this.from=Math.max(a,this.from)+n),i&&(tthis.from||null==this.from)?this.to=null:null!=this.to&&this.to>t&&(this.to=a=this.to},sameSet:function(e){return this.marker==e.marker}},$t.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(ethis.to},clipTo:function(e,t,i,a,n){(e||tthis.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(a,this.from)+n)},sameSet:function(e){return!1},find:function(){return this.line&&this.line.parent?{line:Xt(this.line),ch:this.from}:null},clear:function(){if(this.line){var e=Ci(this.line.marked,this);-1!=e&&this.line.marked.splice(e,1),this.line=null}}},Gt.inheritMarks=function(e,t){var i=new Gt(e),a=t&&t.marked;if(a)for(var n=0;n',i,""):_.push(i)}}var s=m;if(null!=n){var u=0,c='';s=function(e,t){var i=e.length;if(u<=n&&n")),_.push(c);var a=n-u;m(bi?e.slice(a,a+1):e.slice(a),t),_.push(" "),bi&&m(e.slice(a+1),t),n--,u+=i}else u+=i,m(e,t),u==n&&u==p?_.push(c+" "):n+10e+i.length||l.start+l.added\]|\}~][\(\{\[<]|\$'/),null!=document.documentElement.getBoundingClientRect&&(Ai=function(e,t){try{var i=e.getBoundingClientRect();i={top:i.top,left:i.left}}catch(e){i={top:0,left:0}}if(!t)if(null==window.pageYOffset){var a=document.documentElement||document.body.parentNode;null==a.scrollTop&&(a=document.body),i.top+=a.scrollTop,i.left+=a.scrollLeft}else i.top+=window.pageYOffset,i.left+=window.pageXOffset;return i});var _=document.createElement("pre");function T(e){return _.textContent=e,_.innerHTML}function Ii(e,t){if(!t)return 0;if(!e)return t.length;for(var i=e.length,a=t.length;0<=i&&0<=a&&e.charAt(i)==t.charAt(a);--i,--a);return a+1}function Ci(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,a=e.length;i <")):jQuery("#custom_front").val(editor.getValue().replace(/\s+/g," ").replace(/> <"))),!0}function insertAtCursor_form(e,t){jQuery("#autogen_layout").is(":checked")?alert("Uncheck the Auto-Generate Layout box."):(myValue='%'+e+" - "+t+"%
",line=editor.getCursor().line,ch=editor.getCursor().ch,text=editor.getLine(line),text1=text.substr(0,ch),text2=text.substr(ch),text=text1+myValue+text2,editor.setLine(line,text),editor.focus())}function autogen(e){e?(custom_front=editor.getValue(),editor.setValue(form_front),editor.setOption("readOnly",!0)):(editor.setValue(custom_front),editor.setOption("readOnly",!1)),autoFormat()}function autoFormat(){return CodeMirror.commands.selectAll(editor),editor.autoFormatRange(editor.getCursor(!0),editor.getCursor(!1)),editor.scrollTo(0,0),!1}CodeMirror.modeExtensions||(CodeMirror.modeExtensions={}),CodeMirror.defineExtension("getModeExt",function(){var e=CodeMirror.resolveMode(this.getOption("mode")).name,t=CodeMirror.modeExtensions[e];if(!t)throw new Error("No extensions found for mode "+e);return t}),CodeMirror.defineExtension("getModeExtAtPos",function(e){var t=this.getTokenAt(e);return t&&t.state&&t.state.mode?CodeMirror.modeExtensions["html"==t.state.mode?"htmlmixed":t.state.mode]:this.getModeExt()}),CodeMirror.defineExtension("commentRange",function(e,t,i){var a=this.getModeExtAtPos(this.getCursor());if(e){this.getRange(t,i);this.replaceRange(a.commentStart+this.getRange(t,i)+a.commentEnd,t,i),t.line==i.line&&t.ch==i.ch&&this.setCursor(t.line,t.ch+a.commentStart.length)}else{var n=this.getRange(t,i),l=n.indexOf(a.commentStart),d=n.lastIndexOf(a.commentEnd);-1a&&(d+=e.substring(a,l[_].start).replace(n,"$1\n$2"),a=l[_].start),l[_].start<=a&&l[_].end>=a&&(d+=e.substring(a,l[_].end),a=l[_].end);return a"],autoFormatLineBreaks:function(e,t,i){for(var a=(e=e.substring(t,i)).split("\n"),n=new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"),l=new RegExp("<","g"),d=new RegExp("(>)([^\r\n])","g"),_=0;_",";","\\{","\\}"],getModeInfos:function(e,t){var i=new Array;i[0]={pos:0,modeExt:CodeMirror.modeExtensions.xml,modeName:"xml"};var a=new Array;a[0]={regex:new RegExp("]*>|$)","i"),modeExt:CodeMirror.modeExtensions.css,modeName:"css"},a[1]={regex:new RegExp("]*>|$)","i"),modeExt:CodeMirror.modeExtensions.javascript,modeName:"javascript"};for(var n=void 0!==t?t:e.length-1,l=0;l!?|\/]/;function c(e,t){var l,i=e.next();if(m[i]){var a=m[i](e,t);if(!1!==a)return a}if('"'==i||"'"==i)return t.tokenize=(l=i,function(e,t){for(var i,a=!1,n=!1;null!=(i=e.next());){if(i==l&&!a){n=!0;break}a=!a&&"\\"==i}return(n||!a&&!s)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(i))return d=i,null;if(/\d/.test(i))return e.eatWhile(/[\w\.]/),"number";if("/"==i){if(e.eat("*"))return(t.tokenize=p)(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(u.test(i))return e.eatWhile(u),"operator";e.eatWhile(/[\w\$_]/);var n=e.current();return _.propertyIsEnumerable(n)?(r.propertyIsEnumerable(n)&&(d="newstatement"),"keyword"):o.propertyIsEnumerable(n)?"atom":"word"}function p(e,t){for(var i,a=!1;i=e.next();){if("/"==i&&a){t.tokenize=null;break}a="*"==i}return"comment"}function a(e,t,i,a,n){this.indented=e,this.column=t,this.type=i,this.align=a,this.prev=n}function n(e,t,i){return e.context=new a(e.indented,t,i,null,e.context)}function f(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}return{startState:function(e){return{tokenize:null,context:new a((e||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=null;var a=(t.tokenize||c)(e,t);if("comment"==a||"meta"==a)return a;if(null==i.align&&(i.align=!0),";"!=d&&":"!=d||"statement"!=i.type)if("{"==d)n(t,e.column(),"}");else if("["==d)n(t,e.column(),"]");else if("("==d)n(t,e.column(),")");else if("}"==d){for(;"statement"==i.type;)i=f(t);for("}"==i.type&&(i=f(t));"statement"==i.type;)i=f(t)}else d==i.type?f(t):("}"==i.type||"top"==i.type||"statement"==i.type&&"newstatement"==d)&&n(t,e.column(),"statement");else f(t);return t.startOfLine=!1,a},indent:function(e,t){if(e.tokenize!=c&&null!=e.tokenize)return 0;var i=e.context,a=t&&t.charAt(0);"statement"==i.type&&"}"==a&&(i=i.prev);var n=a==i.type;return"statement"==i.type?i.indented+("{"==a?0:l):i.align?i.column+(n?0:1):i.indented+(n?0:l)},electricChars:"{}"}}),function(){function e(e){for(var t={},i=e.split(" "),a=0;a <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:e("catch class do else finally for forSome if match switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}})}(),CodeMirror.defineMode("css",function(e){var n,a=e.indentUnit;function l(e,t){return n=t,e}function d(e,t){var n,i=e.next();return"@"==i?(e.eatWhile(/[\w\\\-]/),l("meta",e.current())):"/"==i&&e.eat("*")?(t.tokenize=_)(e,t):"<"==i&&e.eat("!")?(t.tokenize=r)(e,t):"="!=i?"~"!=i&&"|"!=i||!e.eat("=")?'"'==i||"'"==i?(t.tokenize=(n=i,function(e,t){for(var i,a=!1;null!=(i=e.next())&&(i!=n||a);)a=!a&&"\\"==i;return a||(t.tokenize=d),l("string","string")}),t.tokenize(e,t)):"#"==i?(e.eatWhile(/[\w\\\-]/),l("atom","hash")):"!"==i?(e.match(/^\s*\w*/),l("keyword","important")):/\d/.test(i)?(e.eatWhile(/[\w.%]/),l("number","unit")):/[,.+>*\/]/.test(i)?l(null,"select-op"):/[;{}:\[\]]/.test(i)?l(null,i):(e.eatWhile(/[\w\\\-]/),l("variable","variable")):l(null,"compare"):void l(null,"compare")}function _(e,t){for(var i,a=!1;null!=(i=e.next());){if(a&&"/"==i){t.tokenize=d;break}a="*"==i}return l("comment","comment")}function r(e,t){for(var i,a=0;null!=(i=e.next());){if(2<=a&&">"==i){t.tokenize=d;break}a="-"==i?a+1:0}return l("comment","comment")}return{startState:function(e){return{tokenize:d,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var i=t.tokenize(e,t),a=t.stack[t.stack.length-1];return"hash"==n&&"rule"!=a?i="string-2":"variable"==i&&("rule"==a?i="number":a&&"@media{"!=a||(i="tag")),"rule"==a&&/^[\{\};]$/.test(n)&&t.stack.pop(),"{"==n?"@media"==a?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==n?t.stack.pop():"@media"==n?t.stack.push("@media"):"{"==a&&"comment"!=n&&t.stack.push("rule"),i},indent:function(e,t){var i=e.stack.length;return/^\}/.test(t)&&(i-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+i*a},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("javascript",function(e,t){var a,n,d=e.indentUnit,_=t.json,r=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),i=e("keyword b"),a=e("keyword c"),n=e("operator"),l={type:"atom",style:"atom"};return{if:t,while:t,with:t,else:i,do:i,try:i,finally:i,return:a,break:a,continue:a,new:a,delete:a,throw:a,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:n,typeof:n,instanceof:n,true:l,false:l,null:l,undefined:l,NaN:l,Infinity:l}}(),o=/[+\-*&%=<>!?|]/;function m(e,t,i){return(t.tokenize=i)(e,t)}function s(e,t){for(var i,a=!1;null!=(i=e.next());){if(i==t&&!a)return!1;a=!a&&"\\"==i}return a}function u(e,t,i){return a=e,n=i,t}function c(e,t){var i=e.next();if('"'==i||"'"==i)return m(e,t,(a=i,function(e,t){return s(e,a)||(t.tokenize=c),u("string","string")}));if(/[\[\]{}\(\),;\:\.]/.test(i))return u(i);if("0"==i&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),u("number","number");if(/\d/.test(i)||"-"==i&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),u("number","number");if("/"==i)return e.eat("*")?m(e,t,p):e.eat("/")?(e.skipToEnd(),u("comment","comment")):t.reAllowed?(s(e,"/"),e.eatWhile(/[gimy]/),u("regexp","string-2")):(e.eatWhile(o),u("operator",null,e.current()));if("#"==i)return e.skipToEnd(),u("error","error");if(o.test(i))return e.eatWhile(o),u("operator",null,e.current());e.eatWhile(/[\w\$_]/);var a,n=e.current(),l=r.propertyIsEnumerable(n)&&r[n];return l&&t.kwAllowed?u(l.type,l.style,n):u("variable","variable",n)}function p(e,t){for(var i,a=!1;i=e.next();){if("/"==i&&a){t.tokenize=c;break}a="*"==i}return u("comment","comment")}var i={atom:!0,number:!0,variable:!0,string:!0,regexp:!0};function l(e,t,i,a,n,l){this.indented=e,this.column=t,this.type=i,this.prev=n,this.info=l,null!=a&&(this.align=a)}function f(e,t){for(var i=e.localVars;i;i=i.next)if(i.name==t)return!0}var y={state:null,column:null,marked:null,cc:null};function h(){for(var e=arguments.length-1;0<=e;e--)y.cc.push(arguments[e])}function b(){return h.apply(null,arguments),!0}function v(e){var t=y.state;if(t.context){y.marked="def";for(var i=t.localVars;i;i=i.next)if(i.name==e)return;t.localVars={name:e,next:t.localVars}}}var w={name:"this",next:{name:"arguments"}};function g(){y.state.context||(y.state.localVars=w),y.state.context={prev:y.state.context,vars:y.state.localVars}}function E(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function A(t,i){var e=function(){var e=y.state;e.lexical=new l(e.indented,y.stream.column(),t,null,e.lexical,i)};return e.lex=!0,e}function j(){var e=y.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(t){return function(e){return e==t?b():";"==t?h():b(arguments.callee)}}function k(e){return"var"==e?b(A("vardef"),q,x(";"),j):"keyword a"==e?b(A("form"),I,k,j):"keyword b"==e?b(A("form"),k,j):"{"==e?b(A("}"),z,j):";"==e?b():"function"==e?b(O):"for"==e?b(A("form"),x("("),A(")"),N,x(")"),j,k,j):"variable"==e?b(A("stat"),Q):"switch"==e?b(A("form"),I,A("}","switch"),x("{"),z,j,j):"case"==e?b(I,x(":")):"default"==e?b(x(":")):"catch"==e?b(A("form"),g,x("("),K,x(")"),k,j,E):h(A("stat"),I,x(";"),j)}function I(e){return i.hasOwnProperty(e)?b(B):"function"==e?b(O):"keyword c"==e?b(C):"("==e?b(A(")"),C,x(")"),j,B):"operator"==e?b(I):"["==e?b(A("]"),L(I,"]"),j,B):"{"==e?b(A("}"),L(M,"}"),j,B):b()}function C(e){return e.match(/[;\}\)\],]/)?h():h(I)}function B(e,t){return"operator"==e&&/\+\+|--/.test(t)?b(B):"operator"==e||":"==e?b(I):";"!=e?"("==e?b(A(")"),L(I,")"),j,B):"."==e?b(T,B):"["==e?b(A("]"),I,x("]"),j,B):void 0:void 0}function Q(e){return":"==e?b(j,k):h(B,x(";"),j)}function T(e){if("variable"==e)return y.marked="property",b()}function M(e){if("variable"==e&&(y.marked="property"),i.hasOwnProperty(e))return b(x(":"),I)}function L(t,i){function a(e){return","==e?b(t,a):e==i?b():b(x(i))}return function(e){return e==i?b():h(t,a)}}function z(e){return"}"==e?b():h(k,z)}function q(e,t){return"variable"==e?(v(t),b(H)):b()}function H(e,t){return"="==t?b(I,H):","==e?b(q):void 0}function N(e){return"var"==e?b(q,D):";"==e?h(D):"variable"==e?b(S):h(D)}function S(e,t){return"in"==t?b(I):b(B,D)}function D(e,t){return";"==e?b(P):"in"==t?b(I):b(I,x(";"),P)}function P(e){")"!=e&&b(I)}function O(e,t){return"variable"==e?(v(t),b(O)):"("==e?b(A(")"),g,L(K,")"),j,k,E):void 0}function K(e,t){if("variable"==e)return v(t),b()}return j.lex=!0,{startState:function(e){return{tokenize:c,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new l((e||0)-d,0,"block",!1),localVars:t.localVars,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==a?i:(t.reAllowed=!("operator"!=a&&"keyword c"!=a&&!a.match(/^[\[{}\(,;:]$/)),t.kwAllowed="."!=a,function(e,t,i,a,n){var l=e.cc;for(y.state=e,y.stream=n,y.marked=null,y.cc=l,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((l.length?l.pop():_?I:k)(i,a)){for(;l.length&&l[l.length-1].lex;)l.pop()();return y.marked?y.marked:"variable"==i&&f(e,a)?"variable-2":t}}(t,i,a,n,e))},indent:function(e,t){if(e.tokenize!=c)return 0;var i=t&&t.charAt(0),a=e.lexical;"stat"==a.type&&"}"==i&&(a=a.prev);var n=a.type,l=i==n;return"vardef"==n?a.indented+4:"form"==n&&"{"==i?a.indented:"stat"==n||"form"==n?a.indented+d:"switch"!=a.info||l?a.align?a.column+(l?0:1):a.indented+(l?0:d):a.indented+(/^(?:case|default)\b/.test(t)?d:2*d)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("xml",function(e,t){var l,d,_,a,n=e.indentUnit,r=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},o=t.alignCDATA;function m(t,i){function e(e){return(i.tokenize=e)(t,i)}var a,n=t.next();if("<"!=n)return"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error";if(t.eat("!"))return t.eat("[")?t.match("CDATA[")?e(u("atom","]]>")):null:t.match("--")?e(u("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function a(n){return function(e,t){for(var i;null!=(i=e.next());){if("<"==i)return t.tokenize=a(n+1),t.tokenize(e,t);if(">"==i){if(1!=n)return t.tokenize=a(n-1),t.tokenize(e,t);t.tokenize=m;break}}return"meta"}}(1))):null;if(t.eat("?"))return t.eatWhile(/[\w\._\-]/),i.tokenize=u("meta","?>"),"meta";for(d=t.eat("/")?"closeTag":"openTag",t.eatSpace(),l="";a=t.eat(/[^\s\u00a0=<>\"\'\/?]/);)l+=a;return i.tokenize=s,"tag"}function s(e,t){var i,a=e.next();return">"==a||"/"==a&&e.eat(">")?(t.tokenize=m,d=">"==a?"endTag":"selfcloseTag","tag"):"="==a?(d="equals",null):/[\'\"]/.test(a)?(t.tokenize=(i=a,function(e,t){for(;!e.eol();)if(e.next()==i){t.tokenize=s;break}return"string"}),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function u(i,a){return function(e,t){for(;!e.eol();){if(e.match(a)){t.tokenize=m;break}e.next()}return i}}function i(){for(var e=arguments.length-1;0<=e;e--)_.cc.push(arguments[e])}function c(){return i.apply(null,arguments),!0}function p(){_.context&&(_.context=_.context.prev)}function f(e){if("openTag"==e)return _.tagName=l,c(h,(n=_.startOfLine,function(e){return"selfcloseTag"==e||"endTag"==e&&r.autoSelfClosers.hasOwnProperty(_.tagName.toLowerCase())?y(_.tagName.toLowerCase()):"endTag"==e&&(y(_.tagName.toLowerCase()),t=_.tagName,i=n,a=r.doNotIndent.hasOwnProperty(t)||_.context&&_.context.noIndent,_.context={prev:_.context,tagName:t,indent:_.indented,startOfLine:i,noIndent:a}),c();var t,i,a}));if("closeTag"!=e)return c();var t,n,i=!1;return _.context?_.context.tagName!=l&&(r.implicitlyClosed.hasOwnProperty(_.context.tagName.toLowerCase())&&p(),i=!_.context||_.context.tagName!=l):i=!0,i&&(a="error"),c((t=i,function(e){return t&&(a="error"),"endTag"==e?(p(),c()):(a="error",c(arguments.callee))}))}function y(e){for(var t;;){if(!_.context)return;if(t=_.context.tagName.toLowerCase(),!r.contextGrabbers.hasOwnProperty(t)||!r.contextGrabbers[t].hasOwnProperty(e))return;p()}}function h(e){return"word"==e?(a="attribute",c(b,h)):"endTag"==e||"selfcloseTag"==e?i():(a="error",c(h))}function b(e){return"equals"==e?c(v,h):(r.allowMissing||(a="error"),"endTag"==e||"selfcloseTag"==e?i():c())}function v(e){return"string"==e?c(w):"word"==e&&r.allowUnquoted?(a="string",c()):(a="error","endTag"==e||"selfCloseTag"==e?i():c())}function w(e){return"string"==e?c(w):i()}return{startState:function(){return{tokenize:m,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;a=d=l=null;var i=t.tokenize(e,t);if(t.type=d,(i||d)&&"comment"!=i)for(_=t;;){if((t.cc.pop()||f)(d||i))break}return t.startOfLine=!1,a||i},indent:function(e,t,i){var a=e.context;if(e.tokenize!=s&&e.tokenize!=m||a&&a.noIndent)return i?i.match(/^(\s*)/)[0].length:0;if(o&&/",!1);)e.next();return"comment"},"/":function(e,t){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(e,t){var _=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),r=CodeMirror.getMode(e,"javascript"),o=CodeMirror.getMode(e,"css"),m=CodeMirror.getMode(e,i);return{startState:function(){var e=_.startState();return{html:e,php:m.startState(),curMode:t.startOpen?m:_,curState:t.startOpen?m.startState():e,curClose:t.startOpen?/^\?>/:null,mode:t.startOpen?"php":"html",pending:null}},copyState:function(e){var t,i=e.html,a=CodeMirror.copyState(_,i),n=e.php,l=CodeMirror.copyState(m,n);return t=e.curState==i?a:e.curState==n?l:CodeMirror.copyState(e.curMode,e.curState),{html:a,php:l,curMode:e.curMode,curState:t,curClose:e.curClose,mode:e.mode,pending:e.pending}},token:function e(t,i){var a="php"==i.mode;if(t.sol()&&'"'!=i.pending&&(i.pending=null),i.curMode!=_)return a&&null!=i.php.tokenize||!t.match(i.curClose,a)?i.curMode.token(t,i.curState):(i.curMode=_,i.curState=i.html,i.curClose=null,i.mode="html",a?"meta":e(t,i));if(t.match(/^<\?\w*/))return i.curMode=m,i.curState=i.php,i.curClose="?>",i.mode="php","meta";if('"'==i.pending){for(;!t.eol()&&'"'!=t.next(););var n="string"}else n=i.pending&&t.pos/.test(l)?i.pending='"':i.pending={end:t.pos,style:n},t.backUp(l.length-d)):"tag"==n&&">"==t.current()&&i.curState.context&&(/^script$/i.test(i.curState.context.tagName)?(i.curMode=r,i.curState=r.startState(_.indent(i.curState,"")),i.curClose=/^<\/\s*script\s*>/i,i.mode="javascript"):/^style$/i.test(i.curState.context.tagName)&&(i.curMode=o,i.curState=o.startState(_.indent(i.curState,"")),i.curClose=/^<\/\s*style\s*>/i,i.mode="css")),n},indent:function(e,t){return e.curMode!=m&&/^\s*<\//.test(t)||e.curMode==m&&/^\?>/.test(t)?_.indent(e.html,t):e.curMode.indent(e.curState,t)},electricChars:"/{}:"}},"xml","clike","javascript","css"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",i)}(),CodeMirror.defineMode("htmlmixed",function(e,t){var a=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),n=CodeMirror.getMode(e,"javascript"),l=CodeMirror.getMode(e,"css");function i(e,t){var i=a.token(e,t.htmlState);return"tag"==i&&">"==e.current()&&t.htmlState.context&&(/^script$/i.test(t.htmlState.context.tagName)?(t.token=_,t.localState=n.startState(a.indent(t.htmlState,"")),t.mode="javascript"):/^style$/i.test(t.htmlState.context.tagName)&&(t.token=r,t.localState=l.startState(a.indent(t.htmlState,"")),t.mode="css")),i}function d(e,t,i){var a=e.current(),n=a.search(t);return-1/i,!1)?(t.token=i,t.localState=null,t.mode="html",i(e,t)):d(e,/<\/\s*script\s*>/,n.token(e,t.localState))}function r(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=i,t.localState=null,t.mode="html",i(e,t)):d(e,/<\/\s*style\s*>/,l.token(e,t.localState))}return{startState:function(){return{token:i,localState:null,mode:"html",htmlState:a.startState()}},copyState:function(e){if(e.localState)var t=CodeMirror.copyState(e.token==r?l:n,e.localState);return{token:e.token,localState:t,mode:e.mode,htmlState:CodeMirror.copyState(a,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==i||/^\s*<\//.test(t)?a.indent(e.htmlState,t):e.token==_?n.indent(e.localState,t):l.indent(e.localState,t)},compareStates:function(e,t){return e.mode==t.mode&&(e.localState?CodeMirror.Pass:a.compareStates(e.htmlState,t.htmlState))},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),jQuery(document).on("fm_tab_layout_loaded",function(){editor=CodeMirror.fromTextArea(document.getElementById("source"),{lineNumbers:!0,lineWrapping:!0,mode:"htmlmixed",value:form_front}),""==custom_front&&(custom_front=form_front),jQuery("#autogen_layout").is(":checked")?(editor.setOption("readOnly",!0),editor.setValue(form_front)):(editor.setOption("readOnly",!1),editor.setValue(custom_front)),jQuery("#autogen_layout").on("click",function(){autogen(jQuery(this).is(":checked"))}),autoFormat()});