(function(a){if(typeof a.sprintf!=="function"){a.sprintf=function(){var g=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;var h=arguments,f=0,k=h[f++];var b=function(o,i,l,n){if(!l){l=" "}var m=(o.length>=i)?"":Array(1+i-o.length>>>0).join(l);return n?o+m:m+o};var c=function(n,m,q,i,l,p){var o=i-n.length;if(o>0){if(q||!l){n=b(n,i,p,q)}else{n=n.slice(0,m.length)+b("",o,"0",true)+n.slice(m.length)}}return n};var j=function(q,p,o,r,l,i,n){var m=q>>>0;o=o&&m&&{"2":"0b","8":"0","16":"0x"}[p]||"";q=o+b(m.toString(p),i||0,"0",false);return c(q,o,r,l,n)};var e=function(n,p,l,i,m,o){if(i!=null){n=n.slice(0,i)}return c(n,"",p,l,m,o)};var d=function(A,n,o,s,C,x,m){var i;var w;var l;var B;var u;if(A=="%%"){return"%"}var t=false,p="",r=false,z=false,y=" ";var q=o.length;for(var v=0;o&&v-1?6:(m=="d")?0:undefined}else{if(x=="*"){x=+h[f++]}else{if(x.charAt(0)=="*"){x=+h[x.slice(1,-1)]}else{x=+x}}}u=n?h[n.slice(0,-1)]:h[f++];switch(m){case"s":return e(String(u),t,s,x,r,y);case"c":return e(String.fromCharCode(+u),t,s,x,r);case"b":return j(u,2,z,t,s,x,r);case"o":return j(u,8,z,t,s,x,r);case"x":return j(u,16,z,t,s,x,r);case"X":return j(u,16,z,t,s,x,r).toUpperCase();case"u":return j(u,10,z,t,s,x,r);case"i":case"d":i=(+u)|0;w=i<0?"-":p;u=w+b(String(Math.abs(i)),x,"0",false);return c(u,w,t,s,r);case"e":case"E":case"f":case"F":case"g":case"G":i=+u;w=i<0?"-":p;l=["toExponential","toFixed","toPrecision"]["efg".indexOf(m.toLowerCase())];B=["toString","toUpperCase"]["eEfFgG".indexOf(m)%2];u=w+Math.abs(i)[l](x);return c(u,w,t,s,r)[B]();default:return A}};return k.replace(g,d)}}})(jQuery); var OPTIMIZEMEMBER_VERSION = '1.2.3',OPTIMIZEMEMBER_CURRENT_USER_LOGIN_COUNTER = -1,OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN = false,OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = false,OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL = -1,OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LABEL = '',OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_ID = '',OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_OR_WP_ID = '',OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_GATEWAY = '',OPTIMIZEMEMBER_CURRENT_USER_CUSTOM = '',OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_TIME = 0,OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = 0,OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = 0,OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_DAYS = 0,OPTIMIZEMEMBER_CURRENT_USER_DISPLAY_NAME = '',OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME = '',OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME = '',OPTIMIZEMEMBER_CURRENT_USER_LOGIN = '',OPTIMIZEMEMBER_CURRENT_USER_EMAIL = '',OPTIMIZEMEMBER_CURRENT_USER_IP = '160.178.242.200',OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_IP = '',OPTIMIZEMEMBER_CURRENT_USER_ID = 0,OPTIMIZEMEMBER_CURRENT_USER_FIELDS = [],OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED = 0,OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED = false,OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY = 0,OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS = 0,OPTIMIZEMEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID = 0,OPTIMIZEMEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = 4302,OPTIMIZEMEMBER_LOGIN_WELCOME_PAGE_ID = 0,OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = 'https://optimizepressplus.com/?optimizemember_profile=1',OPTIMIZEMEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = 'https://optimizepressplus.com/',OPTIMIZEMEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = 'https://optimizepressplus.com/members-home/',OPTIMIZEMEMBER_LOGIN_WELCOME_PAGE_URL = 'http://optimizepressplus.com/',OPTIMIZEMEMBER_LOGOUT_PAGE_URL = 'https://optimizepressplus.com/wp-login.php?action=logout&_wpnonce=a6c00c8f9d',OPTIMIZEMEMBER_LOGIN_PAGE_URL = 'https://optimizepressplus.com/wp-login.php',OPTIMIZEMEMBER_LEVEL0_LABEL = 'Free Subscriber',OPTIMIZEMEMBER_LEVEL1_LABEL = 'Bronze Member',OPTIMIZEMEMBER_LEVEL2_LABEL = 'Silver Member',OPTIMIZEMEMBER_LEVEL3_LABEL = 'Gold Member',OPTIMIZEMEMBER_LEVEL4_LABEL = 'Platinum Member',OPTIMIZEMEMBER_LEVEL5_LABEL = 'Level 5 Member',OPTIMIZEMEMBER_LEVEL6_LABEL = 'Level 6 Member',OPTIMIZEMEMBER_LEVEL7_LABEL = 'Level 7 Member',OPTIMIZEMEMBER_LEVEL8_LABEL = 'Level 8 Member',OPTIMIZEMEMBER_LEVEL9_LABEL = 'Level 9 Member',OPTIMIZEMEMBER_LEVEL10_LABEL = 'Level 10 Member',OPTIMIZEMEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL5_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL6_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL7_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL8_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL9_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL10_FILE_DOWNLOADS_ALLOWED = 99999,OPTIMIZEMEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL5_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL6_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL7_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL8_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL9_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_LEVEL10_FILE_DOWNLOADS_ALLOWED_DAYS = 365,OPTIMIZEMEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '',OPTIMIZEMEMBER_REG_EMAIL_FROM_NAME = 'optimizepressplus.com',OPTIMIZEMEMBER_REG_EMAIL_FROM_EMAIL = 'opplus55@optimizepressplus.com',OPTIMIZEMEMBER_PAYPAL_NOTIFY_URL = 'https://optimizepressplus.com/?optimizemember_paypal_notify=1',OPTIMIZEMEMBER_PAYPAL_RETURN_URL = 'https://optimizepressplus.com/?optimizemember_paypal_return=1',OPTIMIZEMEMBER_PAYPAL_BUSINESS = 'sales@optimizepress.com',OPTIMIZEMEMBER_PAYPAL_ENDPOINT = 'www.paypal.com',OPTIMIZEMEMBER_PAYPAL_API_ENDPOINT = 'api-3t.paypal.com',OPTIMIZEMEMBER_VALUE_FOR_PP_INV = Math.round (new Date ().getTime ()) + '~160.178.242.200',OPTIMIZEMEMBER_VALUE_FOR_PP_INV_GEN = optimizemember_value_for_pp_inv_gen = function(){ var invoice = '', formatSeed = function(seed, reqWidth) { seed = parseInt(seed, 10).toString (16); if (reqWidth < seed.length) return seed.slice (seed.length - reqWidth); else if (reqWidth > seed.length) return Array(1 + (reqWidth - seed.length)).join ('0') + seed; return seed; }; if (typeof OPTIMIZEMEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED === 'undefined') OPTIMIZEMEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED = Math.floor (Math.random () * 0x75bcd15); OPTIMIZEMEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED++; invoice = formatSeed(parseInt(new Date ().getTime () / 1000, 10), 8); invoice += formatSeed(OPTIMIZEMEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED, 5); invoice += '~' + OPTIMIZEMEMBER_CURRENT_USER_IP; return invoice; },OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = 'Originating Domain',OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = 'optimizepressplus.com',OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_ON1 = 'Customer IP Address',OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_OS1 = '160.178.242.200'; jQuery(document).ready(function(e){var t='';var n='optimizeMember-files';var r=typeof ws_plugin__optimizemember_skip_all_file_confirmations!=="undefined"&&ws_plugin__optimizemember_skip_all_file_confirmations?true:false;var i=[];if(OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN&&OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY div.mu_register > form#setupform").submit(function(){var t=this,n="",r="",i="";e("input#user_email",t).attr("data-expected","email");var s=e('p.submit input[type="submit"]',t);e("input#user_name, input#user_email, input#blogname, input#blog_title, input#captcha_code",t).attr({"aria-required":"true"});e(":input",t).each(function(){var s=e.trim(e(this).attr("id")).replace(/-[0-9]+$/g,"");if(s&&(n=e.trim(e('label[for="'+s+'"]',t).first().text().replace(/[\r\n\t]+/g," ")))){if(r=ws_plugin__optimizemember_validationErrors(n,this,t))i+=r+"\n\n"}});if(i=e.trim(i)){alert('— Oops, you missed something: —'+"\n\n"+i);return false}ws_plugin__optimizemember_animateProcessing(s);return true})}if(location.href.match(/\/wp-login\.php/)){e("input#user_login").attr("tabindex","10"),e("input#user_email").attr("tabindex","20");e("div#login > form#registerform input#wp-submit").attr("tabindex","1000");e("input#ws-plugin--optimizemember-custom-reg-field-user-pass1, input#ws-plugin--optimizemember-custom-reg-field-user-pass2").keyup(function(){ws_plugin__optimizemember_passwordStrength(e("input#user_login"),e("input#ws-plugin--optimizemember-custom-reg-field-user-pass1"),e("input#ws-plugin--optimizemember-custom-reg-field-user-pass2"),e("div#ws-plugin--optimizemember-custom-reg-field-user-pass-strength"))});e("div#login > form#registerform").submit(function(){var t=this,n="",r="",i="";e("input#user_email",t).attr("data-expected","email");var s=e('input#ws-plugin--optimizemember-custom-reg-field-user-pass1[aria-required="true"]',t);var o=e("input#ws-plugin--optimizemember-custom-reg-field-user-pass2",t);var u=e("input#wp-submit",t);e("input#user_login, input#user_email, input#captcha_code",t).attr({"aria-required":"true"});e(":input",t).each(function(){var s=e.trim(e(this).attr("id")).replace(/-[0-9]+$/g,"");if(e.inArray(s,["user_login","user_email","captcha_code"])!==-1){if(n=e.trim(e(this).parent("label").text().replace(/[\r\n\t]+/g," "))){if(r=ws_plugin__optimizemember_validationErrors(n,this,t))i+=r+"\n\n"}}else if(s&&(n=e.trim(e('label[for="'+s+'"]',t).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(r=ws_plugin__optimizemember_validationErrors(n,this,t))i+=r+"\n\n"}});if(i=e.trim(i)){alert('— Oops, you missed something: —'+"\n\n"+i);return false}else if(s.length&&e.trim(s.val())!==e.trim(o.val())){alert('— Oops, you missed something: —'+"\n\n"+'Passwords do not match up. Please try again.');return false}else if(s.length&&e.trim(s.val()).length<6){alert('— Oops, you missed something: —'+"\n\n"+'Password MUST be at least 6 characters. Please try again.');return false}ws_plugin__optimizemember_animateProcessing(u);return true})}if(location.href.match(/\/wp-admin\/(user\/)?profile\.php/)){e("form#your-profile").submit(function(){var t=this,n="",r="",i="";e("input#email",t).attr("data-expected","email");e(':input[id^="ws-plugin--optimizemember-profile-"]',t).each(function(){var s=e.trim(e(this).attr("id")).replace(/-[0-9]+$/g,"");if(s&&(n=e.trim(e('label[for="'+s+'"]',t).first().text().replace(/[\r\n\t]+/g," ")))){if(r=ws_plugin__optimizemember_validationErrors(n,this,t))i+=r+"\n\n"}});if(i=e.trim(i)){alert('— Oops, you missed something: —'+"\n\n"+i);return false}return true})}if(t){e("body.registration form div#ws-plugin--optimizemember-custom-reg-fields-4bp-section").closest("form").submit(function(){var t=this,n="",r="",i="";e("input#signup_email",t).attr("data-expected","email");e("input#signup_username, input#signup_email, input#signup_password, input#field_1",t).attr({"aria-required":"true"});e(":input",t).each(function(){var s=e.trim(e(this).attr("id")).replace(/-[0-9]+$/g,"");if(s&&(n=e.trim(e('label[for="'+s+'"]',t).first().text().replace(/[\r\n\t]+/g," ")))){if(r=ws_plugin__optimizemember_validationErrors(n,this,t))i+=r+"\n\n"}});if(i=e.trim(i)){alert('— Oops, you missed something: —'+"\n\n"+i);return false}return true});e("body.logged-in.profile.profile-edit :input.ws-plugin--optimizemember-profile-field-4bp").closest("form").submit(function(){var t=this,n="",r="",i="";e("input#field_1",t).attr({"aria-required":"true"});e(":input",t).each(function(){var s=e.trim(e(this).attr("id")).replace(/-[0-9]+$/g,"");if(s&&(n=e.trim(e('label[for="'+s+'"]',t).first().text().replace(/[\r\n\t]+/g," ")))){if(r=ws_plugin__optimizemember_validationErrors(n,this,t))i+=r+"\n\n"}});if(i=e.trim(i)){alert('— Oops, you missed something: —'+"\n\n"+i);return false}return true})}ws_plugin__optimizemember_passwordStrength=function(e,t,n,r){if(e instanceof jQuery&&t instanceof jQuery&&n instanceof jQuery&&r instanceof jQuery&&typeof passwordStrength==="function"&&typeof pwsL10n==="object"){r.removeClass("ws-plugin--optimizemember-password-strength-short ws-plugin--optimizemember-password-strength-bad ws-plugin--optimizemember-password-strength-good ws-plugin--optimizemember-password-strength-strong ws-plugin--optimizemember-password-strength-mismatch");switch(passwordStrength(t.val(),e.val(),n.val())){case 1:r.addClass("ws-plugin--optimizemember-password-strength-short").html(pwsL10n["short"]);break;case 2:r.addClass("ws-plugin--optimizemember-password-strength-bad").html(pwsL10n["bad"]);break;case 3:r.addClass("ws-plugin--optimizemember-password-strength-good").html(pwsL10n["good"]);break;case 4:r.addClass("ws-plugin--optimizemember-password-strength-strong").html(pwsL10n["strong"]);break;case 5:r.addClass("ws-plugin--optimizemember-password-strength-mismatch").html(pwsL10n["mismatch"]);break;default:r.addClass("ws-plugin--optimizemember-password-strength-short").html(pwsL10n["short"])}}return};ws_plugin__optimizemember_validationErrors=function(t,n,r,i,s){if(typeof t==="string"&&t&&typeof n==="object"&&typeof r==="object")if(typeof n.tagName==="string"&&n.tagName.match(/^(input|textarea|select)$/i)&&!n.disabled){var o=n.tagName.toLowerCase(),u=e(n),a=e.trim(u.attr("type")).toLowerCase(),f=e.trim(u.attr("name")),l=u.val();var i=typeof i==="boolean"?i:u.attr("aria-required")==="true",s=typeof s==="string"?s:e.trim(u.attr("data-expected"));var c='0'>0?true:false;var h=new RegExp('^()@',"i");if(o==="input"&&a==="checkbox"&&f.match(/\[\]$/)){if(typeof n.id==="string"&&n.id.match(/-0$/))if(i&&!e('input[name="'+f.replace(/([\[\]])/g,"$1")+'"]:checked',r).length)return t+"\n"+'Please check at least one of the boxes.'}else if(o==="input"&&a==="checkbox"){if(i&&!n.checked)return t+"\n"+'Required. This box must be checked.'}else if(o==="input"&&a==="radio"){if(typeof n.id==="string"&&n.id.match(/-0$/))if(i&&!e('input[name="'+f.replace(/([\[\]])/g,"$1")+'"]:checked',r).length)return t+"\n"+'Please select one of the options.'}else if(o==="select"&&u.attr("multiple")){if(i&&(!(l instanceof Array)||!l.length))return t+"\n"+'Please select at least one of the options.'}else if(typeof l!=="string"||i&&!(l=e.trim(l)).length){return t+"\n"+'This is a required field, please try again.'}else if((l=e.trim(l)).length&&(o==="input"&&a.match(/^(text|password)$/i)||o==="textarea")&&typeof s==="string"&&s.length){if(s==="numeric-wp-commas"&&(!l.match(/^[0-9\.,]+$/)||isNaN(l.replace(/,/g,"")))){return t+"\n"+'Must be numeric ( with or without decimals, commas allowed ).'}else if(s==="numeric"&&(!l.match(/^[0-9\.]+$/)||isNaN(l))){return t+"\n"+'Must be numeric ( with or without decimals, no commas ).'}else if(s==="integer"&&(!l.match(/^[0-9]+$/)||isNaN(l))){return t+"\n"+'Must be an integer ( a whole number, without any decimals ).'}else if(s==="integer-gt-0"&&(!l.match(/^[0-9]+$/)||isNaN(l)||l<=0)){return t+"\n"+'Must be an integer > 0 ( whole number, no decimals, greater than 0 ).'}else if(s==="float"&&(!l.match(/^[0-9\.]+$/)||!l.match(/[0-9]/)||!l.match(/\./)||isNaN(l))){return t+"\n"+'Must be a float ( floating point number, decimals required ).'}else if(s==="float-gt-0"&&(!l.match(/^[0-9\.]+$/)||!l.match(/[0-9]/)||!l.match(/\./)||isNaN(l)||l<=0)){return t+"\n"+'Must be a float > 0 ( floating point number, decimals required, greater than 0 ).'}else if(s==="date"&&!l.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/)){return t+"\n"+'Must be a date ( required date format: dd/mm/yyyy ).'}else if(s==="email"&&!l.match(/^([a-z_~0-9\+\-]+)(((\.?)([a-z_~0-9\+\-]+))*)(@)([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return t+"\n"+'Must be a valid email address.'}else if(s==="email"&&c&&l.match(h)){return t+"\n"+e.sprintf('Please use a personal email address.\nAddresses like <%s@> are problematic.',l.split("@")[0])}else if(s==="url"&&!l.match(/^http(s?)\:\/\/(.{5,})$/i)){return t+"\n"+'Must be a full URL ( starting with http or https ).'}else if(s==="domain"&&!l.match(/^([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return t+"\n"+'Must be a domain name ( domain name only, without http ).'}else if(s==="phone"&&(!l.match(/^[0-9 \(\)\-]+$/)||l.replace(/[^0-9]/g,"").length!==10)){return t+"\n"+'Must be a phone # ( 10 digits w/possible hyphens,spaces,brackets ).'}else if(s==="uszip"&&!l.match(/^[0-9]{5}(-[0-9]{4})?$/)){return t+"\n"+'Must be a US zipcode ( 5-9 digits w/possible hyphen ).'}else if(s==="cazip"&&!l.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return t+"\n"+'Must be a Canadian zipcode ( 6 alpha-numerics w/possible space ).'}else if(s==="uczip"&&!l.match(/^[0-9]{5}(-[0-9]{4})?$/)&&!l.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return t+"\n"+'Must be a zipcode ( either a US or Canadian zipcode ).'}else if(s.match(/^alphanumerics-spaces-punctuation-([0-9]+)(-e)?$/)&&!l.match(/^[a-z 0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return t+"\n"+'Please use alphanumerics, spaces & punctuation only.'}else if(s.match(/^alphanumerics-spaces-([0-9]+)(-e)?$/)&&!l.match(/^[a-z 0-9]+$/i)){return t+"\n"+'Please use alphanumerics & spaces only.'}else if(s.match(/^alphanumerics-punctuation-([0-9]+)(-e)?$/)&&!l.match(/^[a-z0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return t+"\n"+'Please use alphanumerics & punctuation only ( no spaces ).'}else if(s.match(/^alphanumerics-([0-9]+)(-e)?$/)&&!l.match(/^[a-z0-9]+$/i)){return t+"\n"+'Please use alphanumerics only ( no spaces/punctuation ).'}else if(s.match(/^alphabetics-([0-9]+)(-e)?$/)&&!l.match(/^[a-z]+$/i)){return t+"\n"+'Please use alphabetics only ( no digits/spaces/punctuation ).'}else if(s.match(/^numerics-([0-9]+)(-e)?$/)&&!l.match(/^[0-9]+$/i)){return t+"\n"+'Please use numeric digits only.'}else if(s.match(/^(any|alphanumerics-spaces-punctuation|alphanumerics-spaces|alphanumerics-punctuation|alphanumerics|alphabetics|numerics)-([0-9]+)(-e)?$/)){var p=s.split("-"),d=Number(p[1]),v=p.length>2&&p[2]==="e"?true:false;if(v&&l.length!==d)return t+"\n"+e.sprintf('Must be exactly %s %s.',d,p[0]==="numerics"?d===1?'digit':'digits':d===1?'character':'characters');else if(l.length=0)n=n-1,r="l";else n=n+1,r="r"}for(var e=i[n],s=i[n].length;s"']/.test(e=String(e)))e=e.replace(/&/g,"&").replace(//g,">"),e=e.replace(/"/g,""").replace(/'/g,"'");return e};window.ws_plugin__optimizemember_escjQAttr=function(e){return String(e).replace(/([.:\[\]])/g,"\\$1")}}) var OPTIMIZEMEMBER_PRO_VERSION = '1.2.3'; jQuery(document).ready(function(a){}); var optimizeMEMBER_PRO_STRIPE_GATEWAY = true; jQuery(document).ready( // DOM ready. function($) // Depends on Stripe lib. { var stripeCheck = function() { if(window.StripeCheckout) // Stripe available? clearInterval(stripeCheckInterval), setupProForms(); }, stripeCheckInterval = setInterval(stripeCheck, 100); $.ajax({cache: true, dataType: 'script', url: 'https://checkout.stripe.com/checkout.js'}); var setupProForms = function() { /* Initializations. */ var preloadAjaxLoader, // Loading image. $clForm, $upForm, $rgForm, $spForm, $coForm, ariaTrue = {'aria-required': 'true'}, ariaFalse = {'aria-required': 'false'}, ariaFalseDis = {'aria-required': 'false', 'disabled': 'disabled'}, disabled = {'disabled': 'disabled'}, taxMayApply = true, calculateTax, cTaxDelay, cTaxTimeout, cTaxReq, cTaxLocation, ajaxTaxDiv, optionsSection, optionsSelect, descSection, couponSection, couponApplyButton, registrationSection, customFieldsSection, billingMethodSection, handleBillingMethod, cardTokenButton, cardTokenSummary, cardTokenInput, cardTokenSummaryInput, billingAddressSection, captchaSection, submissionSection, submissionButton, submissionNonceVerification; preloadAjaxLoader = new Image(), preloadAjaxLoader.src = 'https://optimizepressplus.com/wp-content/plugins/optimizeMember/images/ajax-loader.gif'; /* Check for more than a single form on this page. */ if($('form.optimizemember-pro-stripe-cancellation-form').length > 1 || $('form.optimizemember-pro-stripe-registration-form').length > 1 || $('form.optimizemember-pro-stripe-update-form').length > 1 || $('form.optimizemember-pro-stripe-sp-checkout-form').length > 1 || $('form.optimizemember-pro-stripe-checkout-form').length > 1) { return alert('Detected more than one OptimizeMember Pro Form.\n\nPlease use only ONE OptimizeMember Pro Form Shortcode on each Post/Page.' + ' Attempting to serve more than one Pro Form on each Post/Page (even w/ DHTML) may result in unexpected/broken functionality.'); } /* Cancellation form handler. */ if(($clForm = $('form#optimizemember-pro-stripe-cancellation-form')).length === 1) { captchaSection = 'div#optimizemember-pro-stripe-cancellation-form-captcha-section', submissionSection = 'div#optimizemember-pro-stripe-cancellation-form-submission-section', submissionButton = submissionSection + ' button#optimizemember-pro-stripe-cancellation-submit'; $(submissionButton).removeAttr('disabled'), ws_plugin__optimizemember_animateProcessing($(submissionButton), 'reset'); $clForm.on('submit', function(/* Form validation. */) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field'); $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__optimizemember_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Code missing. Please try again.'); return false; } $(submissionButton).attr(disabled), ws_plugin__optimizemember_animateProcessing($(submissionButton)); return true; }); } /* Registration form handler. */ else if(($rgForm = $('form#optimizemember-pro-stripe-registration-form')).length === 1) { optionsSection = 'div#optimizemember-pro-stripe-registration-form-options-section', optionsSelect = optionsSection + ' select#optimizemember-pro-stripe-registration-options', descSection = 'div#optimizemember-pro-stripe-registration-form-description-section', registrationSection = 'div#optimizemember-pro-stripe-registration-form-registration-section', captchaSection = 'div#optimizemember-pro-stripe-registration-form-captcha-section', submissionSection = 'div#optimizemember-pro-stripe-registration-form-submission-section', submissionButton = submissionSection + ' button#optimizemember-pro-stripe-registration-submit', submissionNonceVerification = submissionSection + ' input#optimizemember-pro-stripe-registration-nonce'; $(submissionButton).removeAttr('disabled'), ws_plugin__optimizemember_animateProcessing($(submissionButton), 'reset'); if(!$(optionsSelect + ' option').length) $(optionsSection).hide(), $(descSection).show(); else $(optionsSection).show(), $(descSection).hide(), $(optionsSelect).on('change', function(/* Handle checkout option changes. */) { $(submissionNonceVerification).val('option'), $rgForm.attr('action', $rgForm.attr('action').replace(/#.*$/, '') + '#s2p-option'), $rgForm.submit(); // Submit form with a new checkout option. }); if($(submissionSection + ' input#optimizemember-pro-stripe-registration-names-not-required-or-not-possible').length) { $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-first-name-div').hide(), $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-first-name-div :input').attr(ariaFalseDis); $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-last-name-div').hide(), $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-last-name-div :input').attr(ariaFalseDis); } if($(submissionSection + ' input#optimizemember-pro-stripe-registration-password-not-required-or-not-possible').length) { $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-password-div').hide(), $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-password-div :input').attr(ariaFalseDis); } $(registrationSection + ' > div#optimizemember-pro-stripe-registration-form-password-div :input').on('keyup', function() { ws_plugin__optimizemember_passwordStrength( $(registrationSection + ' input#optimizemember-pro-stripe-registration-username'), $(registrationSection + ' input#optimizemember-pro-stripe-registration-password1'), $(registrationSection + ' input#optimizemember-pro-stripe-registration-password2'), $(registrationSection + ' div#optimizemember-pro-stripe-registration-form-password-strength') ); }); $rgForm.on('submit', function(/* Form validation. */) { if($.inArray($(submissionNonceVerification).val(), ['option']) === -1) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field'), $password1 = $(registrationSection + ' input#optimizemember-pro-stripe-registration-password1[aria-required="true"]'), $password2 = $(registrationSection + ' input#optimizemember-pro-stripe-registration-password2'); $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__optimizemember_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; } else if($password1.length && $.trim($password1.val()) !== $.trim($password2.val())) { alert('— Oops, you missed something: —' + '\n\n' + 'Passwords do not match up. Please try again.'); return false; } else if($password1.length && $.trim($password1.val()).length < 6/* Enforce minimum length requirement here. */) { alert('— Oops, you missed something: —' + '\n\n' + 'Password MUST be at least 6 characters. Please try again.'); return false; } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Code missing. Please try again.'); return false; } //$(optionsSelect).attr(disabled); } $(submissionButton).attr(disabled), ws_plugin__optimizemember_animateProcessing($(submissionButton)); return true; }); } /* Update form handler. */ else if(($upForm = $('form#optimizemember-pro-stripe-update-form')).length === 1) { billingMethodSection = 'div#optimizemember-pro-stripe-update-form-billing-method-section', cardTokenButton = billingMethodSection + ' button#optimizemember-pro-stripe-update-form-card-token-button', cardTokenSummary = billingMethodSection + ' div#optimizemember-pro-stripe-update-form-card-token-summary', billingAddressSection = 'div#optimizemember-pro-stripe-update-form-billing-address-section', captchaSection = 'div#optimizemember-pro-stripe-update-form-captcha-section', submissionSection = 'div#optimizemember-pro-stripe-update-form-submission-section', cardTokenInput = submissionSection + ' input[name="' + ws_plugin__optimizemember_escjQAttr('optimizemember_pro_stripe_update[card_token]') + '"]', cardTokenSummaryInput = submissionSection + ' input[name="' + ws_plugin__optimizemember_escjQAttr('optimizemember_pro_stripe_update[card_token_summary]') + '"]', submissionButton = submissionSection + ' button#optimizemember-pro-stripe-update-submit'; $(submissionButton).removeAttr('disabled'), ws_plugin__optimizemember_animateProcessing($(submissionButton), 'reset'); handleBillingMethod = function(eventTrigger /* eventTrigger is passed by jQuery for DOM events. */) { var cardToken = $(cardTokenInput).val(/* Card token from Stripe. */); if(cardToken/* They have now supplied a credit card? */) { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.optimizemember-pro-stripe-update-form-div').show(), $(billingMethodSection + ' > div.optimizemember-pro-stripe-update-form-div :input').attr(ariaTrue); if(taxMayApply/* If tax may apply, we need to collect a tax location. */) { $(billingAddressSection).show(), // Show billing address section. $(billingAddressSection + ' > div.optimizemember-pro-stripe-update-form-div').show(), $(billingAddressSection + ' > div.optimizemember-pro-stripe-update-form-div :input').attr(ariaTrue); } else // There is no reason to collect tax information in this case. { $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.optimizemember-pro-stripe-update-form-div').hide(), $(billingAddressSection + ' > div.optimizemember-pro-stripe-update-form-div :input').attr(ariaFalse); } if(eventTrigger) $(submissionSection + ' button#optimizemember-pro-stripe-update-submit').focus(); } else if(!cardToken/* Else there is no Billing Method supplied. */) { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.optimizemember-pro-stripe-update-form-div').show(), $(billingMethodSection + ' > div.optimizemember-pro-stripe-update-form-div :input').attr(ariaTrue); $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.optimizemember-pro-stripe-update-form-div').hide(), $(billingAddressSection + ' > div.optimizemember-pro-stripe-update-form-div :input').attr(ariaFalse); } }; handleBillingMethod(); // Handle billing method immediately to deal with fields already filled in. $(cardTokenButton).on('click', function() // Stripe integration. { var getCardToken = StripeCheckout.configure ({ key : 'pk_test_ZnCPrdYtd4aLjEMci7QeyKxx', zipCode : '0' == '1', image : '//optimizepressplus.com/wp-content/plugins/optimizeMember/optimizeMember-pro/images/stripe-square.png', panelLabel : 'Add', email : typeof OPTIMIZEMEMBER_CURRENT_USER_EMAIL === 'string' ? OPTIMIZEMEMBER_CURRENT_USER_EMAIL : '', allowRememberMe: true, // Allow Stripe to remember the customer. token : function(token) { $(cardTokenInput).val(token.id), $(cardTokenSummaryInput).val(buildCardTokenTextSummary(token)), $(cardTokenSummary).html(ws_plugin__optimizemember_escHtml(buildCardTokenTextSummary(token))), handleBillingMethod(); // Adjust billing methods fields now also. } }); getCardToken.open(); // Open Stripe overlay. }); $upForm.on('submit', function(/* Form validation. */) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field'); if(!$(cardTokenInput).val()) { alert('No Billing Method; please try again.'); return false; } $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id.replace(/-(month|year)/, '') + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__optimizemember_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Code missing. Please try again.'); return false; } $(submissionButton).attr(disabled), ws_plugin__optimizemember_animateProcessing($(submissionButton)); return true; }); } /* Handles both types of checkout forms. */ else if(($coForm = $('form#optimizemember-pro-stripe-sp-checkout-form')).length === 1 || ($coForm = $('form#optimizemember-pro-stripe-checkout-form')).length === 1) { (function($coForm)// Handles both types of checkout forms; i.e. Specific Post/Page and also Checkout/Modification forms. { var coTypeWithDashes = $coForm[0].id.replace(/^optimizemember\-pro\-stripe\-/, '').replace(/\-form$/, ''), coTypeWithUnderscores = coTypeWithDashes.replace(/[^a-z0-9]/gi, '_'); // e.g. `sp_checkout`. optionsSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-options-section', optionsSelect = optionsSection + ' select#optimizemember-pro-stripe-' + coTypeWithDashes + '-options', descSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-description-section', couponSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-coupon-section', couponApplyButton = couponSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-coupon-apply', registrationSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-registration-section', customFieldsSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-custom-fields-section', billingMethodSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-billing-method-section', cardTokenButton = billingMethodSection + ' button#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-card-token-button', cardTokenSummary = billingMethodSection + ' div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-card-token-summary', billingAddressSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-billing-address-section', ajaxTaxDiv = billingAddressSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-ajax-tax-div', captchaSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-captcha-section', submissionSection = 'div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-submission-section', cardTokenInput = submissionSection + ' input[name="' + ws_plugin__optimizemember_escjQAttr('optimizemember_pro_stripe_' + coTypeWithUnderscores + '[card_token]') + '"]', cardTokenSummaryInput = submissionSection + ' input[name="' + ws_plugin__optimizemember_escjQAttr('optimizemember_pro_stripe_' + coTypeWithUnderscores + '[card_token_summary]') + '"]', submissionNonceVerification = submissionSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-nonce', submissionButton = submissionSection + ' button#optimizemember-pro-stripe-' + coTypeWithDashes + '-submit'; /* Reset button states; in case of a back button. */ $(optionsSelect).removeAttr('disabled'), $(couponApplyButton).removeAttr('disabled'), $(submissionButton).removeAttr('disabled'), ws_plugin__optimizemember_animateProcessing($(submissionButton), 'reset'); /* Handle checkout options. Does this form have checkout options? */ if(!$(optionsSelect + ' option').length) $(optionsSection).hide(), $(descSection).show(); else $(optionsSection).show(), $(descSection).hide(), $(optionsSelect).on('change', function(/* Handle checkout option changes. */) { $(submissionNonceVerification).val('option'), $coForm.attr('action', $coForm.attr('action').replace(/#.*$/, '') + '#s2p-option'), $coForm.submit(); // Submit form with a new checkout option. }); /* Handle the coupon code section. Enabled on this form? */ if($(submissionSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-coupons-not-required-or-not-possible').length) $(couponSection).hide(); // Not accepting coupons on this particular form. else $(couponSection).show(), $(couponApplyButton).on('click', function(/* Submit coupon code upon clicking apply button. */) { $(submissionNonceVerification).val('apply-coupon'), $coForm.attr('action', $coForm.attr('action').replace(/#.*$/, '') + '#s2p-option'), $coForm.submit(); // Submit form with hash positioning. }); /* Handle a user that is already logged into their account. */ if(OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN/* User is already logged in? */) { $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-first-name') .each(function() { var $this = $(this), val = $this.val(); if(!val) $this.val(OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME); }); $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-last-name') .each(function() { var $this = $(this), val = $this.val(); if(!val) $this.val(OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME); }); $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-email').val(OPTIMIZEMEMBER_CURRENT_USER_EMAIL).attr(ariaFalseDis), $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-username').val(OPTIMIZEMEMBER_CURRENT_USER_LOGIN).attr(ariaFalseDis); $(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-password-div').hide(), $(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-password-div :input').attr(ariaFalseDis); if($.trim($(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-registration-section-title').html()) === 'Create Profile') $(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-registration-section-title').html('Your Profile'); $(customFieldsSection).hide(), $(customFieldsSection + ' :input').attr(ariaFalseDis); } /* Handle the password input field in various scenarios. */ if($(submissionSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-password-not-required-or-not-possible').length) { $(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-password-div').hide(), $(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-password-div :input').attr(ariaFalseDis); } else $(registrationSection + ' > div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-password-div :input').on('keyup', function() { ws_plugin__optimizemember_passwordStrength( $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-username'), $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-password1'), $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-password2'), $(registrationSection + ' div#optimizemember-pro-stripe-' + coTypeWithDashes + '-form-password-strength') ); }); /* Handle tax calulations via tax-related input fields. */ if($(submissionSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-tax-not-required-or-not-possible').length) $(ajaxTaxDiv).hide(), taxMayApply = false; // Tax does NOT even apply. else // We need to setup a few handlers. { cTaxDelay = function(eventTrigger) { setTimeout(function(){ calculateTax(eventTrigger); }, 10); }; calculateTax = function(eventTrigger) // Calculates tax. { if(!taxMayApply) return; // Not applicable. if(eventTrigger && eventTrigger.interval && document.activeElement && document.activeElement.id === 'optimizemember-pro-stripe-' + coTypeWithDashes + '-country') return; // Nothing to do in this special case. var attr = $(submissionSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-attr').val(), state = $.trim($(billingAddressSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-state').val()), country = $.trim($(billingAddressSection + ' select#optimizemember-pro-stripe-' + coTypeWithDashes + '-country').val()), zip = $.trim($(billingAddressSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-zip').val()), thisTaxLocation = state + '|' + country + '|' + zip; // Three part location. if(state && country && zip && thisTaxLocation && (!cTaxLocation || cTaxLocation !== thisTaxLocation)) { clearTimeout(cTaxTimeout), cTaxTimeout = 0, cTaxLocation = thisTaxLocation; // Set current location. if(cTaxReq) cTaxReq.abort(); // Abort any existing connections. var verifier = 'fnIyOnQySG9zTGpvZEFxVXBQVUtLamJ0MHIyYUlRekNpYWxROmYxOWNjZDQxMDc3ZDY2MjZiNTVkYmY5ZTY5YTY2ODYyfFyrhQ5iQfyhwVELxlzwORON9HFdZnRVpqEJKuhQefQ4mj0fxhU-TTobt2Mz5fJPX_CpXGdXg_GYwEzgn788njg', calculating = '
calculating sales tax...
', ajaxTaxHandler = function(/* Create a new cTaxTimeout with a one second delay. */) { cTaxReq = $.post('https://optimizepressplus.com/wp-admin/admin-ajax.php', { 'action' : 'ws_plugin__optimizemember_pro_stripe_ajax_tax', 'ws_plugin__optimizemember_pro_stripe_ajax_tax' : verifier, 'ws_plugin__optimizemember_pro_stripe_ajax_tax_vars[attr]' : attr, 'ws_plugin__optimizemember_pro_stripe_ajax_tax_vars[state]' : state, 'ws_plugin__optimizemember_pro_stripe_ajax_tax_vars[country]': country, 'ws_plugin__optimizemember_pro_stripe_ajax_tax_vars[zip]' : zip }, function(response, textStatus) { clearTimeout(cTaxTimeout), cTaxTimeout = 0; if(typeof response === 'object' && response.hasOwnProperty('tax')) /* translators: `Sales Tax (Today)` and `Total (Today)`. The word `Today` is displayed when/if a trial period is offered. The word `Today` is translated elsewhere. */ $(ajaxTaxDiv).html('
' + $.sprintf('Sales Tax%s: %s
— Total%s: %s', ((response.trial) ? ' ' + 'Today' : ''), ((response.tax_per) ? '' + response.tax_per + ' ( ' + response.cur_symbol + '' + response.tax + ' )' : response.cur_symbol + '' + response.tax), ((response.trial) ? ' ' + 'Today' : ''), response.cur_symbol + '' + response.total) + '
'); }, 'json'); }; $(ajaxTaxDiv).html(calculating), cTaxTimeout = setTimeout(ajaxTaxHandler, ((eventTrigger && eventTrigger.keyCode) ? 1000 : 100)); } else if(!state || !country || !zip || !thisTaxLocation) { clearTimeout(cTaxTimeout), cTaxTimeout = 0, cTaxLocation = ''; // Reset the current location. if(cTaxReq) cTaxReq.abort(); // Abort any existing connections. $(ajaxTaxDiv).html(''); // Empty the tax calculation div here also. } }; setInterval(function(){ calculateTax({interval: true}); }, 1000), // Helps with things like Google's Autofill feature. $(billingAddressSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-state').on('keyup blur', calculateTax).on('cut paste', cTaxDelay), $(billingAddressSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-zip').on('keyup blur', calculateTax).on('cut paste', cTaxDelay), $(billingAddressSection + ' select#optimizemember-pro-stripe-' + coTypeWithDashes + '-country').on('change', calculateTax), calculateTax(); // Calculate immediately to deal with fields already filled in. } handleBillingMethod = function(eventTrigger /* eventTrigger is passed by jQuery for DOM events. */) { if($(submissionSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-payment-not-required-or-not-possible').length) $(cardTokenInput).val('free'); // No payment required in this VERY special case. var cardToken = $(cardTokenInput).val(/* Card token from Stripe. */); if(cardToken/* They have now supplied a credit card? */) { if(cardToken === 'free' /* Special card token value. */) { $(billingMethodSection).hide(), // Hide billing method section. $(billingMethodSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingMethodSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } else // We need to display the billing method section in all other cases. { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingMethodSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); } if(cardToken !== 'free' && taxMayApply/* If tax may apply, we need to collect a tax location. */) { $(billingAddressSection).show(), // Show billing address section. $(billingAddressSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingAddressSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); } else // There is no reason to collect tax information in this case. { $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingAddressSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } if(eventTrigger) $(submissionSection + ' button#optimizemember-pro-stripe-' + coTypeWithDashes + '-submit').focus(); } else if(!cardToken/* Else there is no Billing Method supplied. */) { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingMethodSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingAddressSection + ' > div.optimizemember-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } }; handleBillingMethod(); // Handle billing method immediately to deal with fields already filled in. $(cardTokenButton).on('click', function() // Stripe integration. { var getCardToken = StripeCheckout.configure ({ key : 'pk_test_ZnCPrdYtd4aLjEMci7QeyKxx', zipCode : '0' == '1', image : '//optimizepressplus.com/wp-content/plugins/optimizeMember/optimizeMember-pro/images/stripe-square.png', panelLabel : 'Add', email : $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-email').val(), allowRememberMe: true, // Allow Stripe to remember the customer. token : function(token) { $(cardTokenInput).val(token.id), $(cardTokenSummaryInput).val(buildCardTokenTextSummary(token)), $(cardTokenSummary).html(ws_plugin__optimizemember_escHtml(buildCardTokenTextSummary(token))), handleBillingMethod(); // Adjust billing methods fields now also. } }); getCardToken.open(); // Open Stripe overlay. }); $coForm.on('submit', function(/* Form validation. */) { if($.inArray($(submissionNonceVerification).val(), ['option', 'apply-coupon']) === -1) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field'), $password1 = $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-password1[aria-required="true"]'), $password2 = $(registrationSection + ' input#optimizemember-pro-stripe-' + coTypeWithDashes + '-password2'); if(!$(cardTokenInput).val()) { alert('No Billing Method; please try again.'); return false; } $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id.replace(/-(month|year)/, '') + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__optimizemember_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; } else if($password1.length && $.trim($password1.val()) !== $.trim($password2.val())) { alert('— Oops, you missed something: —' + '\n\n' + 'Passwords do not match up. Please try again.'); return false; } else if($password1.length && $.trim($password1.val()).length < 6/* Enforce minimum length requirement here. */) { alert('— Oops, you missed something: —' + '\n\n' + 'Password MUST be at least 6 characters. Please try again.'); return false; } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Code missing. Please try again.'); return false; } //$(optionsSelect).attr(disabled); } $(couponApplyButton).attr(disabled), $(submissionButton).attr(disabled), ws_plugin__optimizemember_animateProcessing($(submissionButton)); return true; }); })($coForm); } var buildCardTokenTextSummary = function(token) { if(typeof token !== 'object') return ''; if(token.type === 'bank_account' && token.bank_account) return token.bank_account.bank_name + ': xxxx...' + token.bank_account.last4; if(token.type === 'card' && token.card) return token.card.brand + ': xxxx-xxxx-xxxx-' + token.card.last4; return 'Token: ' + token.id; }; /* Jump to responses. */ $('div#optimizemember-pro-stripe-form-response') .each(function() { scrollTo(0, $(this).offset().top - 100); }); } }); var OPTIMIZEMEMBER_PRO_AUTHNET_GATEWAY = true; jQuery(document).ready(function(w){var d,n,g,j,m,F,u,t={"aria-required":"true"},a={"aria-required":"false"},x={disabled:"disabled"},f={"aria-required":"false",disabled:"disabled"};u=new Image(),u.src='https://optimizepressplus.com/wp-content/plugins/optimizeMember/images/ajax-loader.gif';if((d=w("form#s2member-pro-authnet-cancellation-form")).length===1){var I="div#s2member-pro-authnet-cancellation-form-captcha-section",k="div#s2member-pro-authnet-cancellation-form-submission-section",s=w(k+" input#s2member-pro-authnet-cancellation-submit");ws_plugin__optimizemember_animateProcessing(s,"reset"),s.removeAttr("disabled");d.submit(function(){var O=this,M="",L="",P="";var N=w(I+" input#recaptcha_response_field");w(":input",O).each(function(){var Q=w.trim(w(this).attr("id")).replace(/-[0-9]+$/g,"");if(Q&&(M=w.trim(w('label[for="'+Q+'"]',O).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(L=ws_plugin__optimizemember_validationErrors(M,this,O)){P+=L+"\n\n"}}});if(P=w.trim(P)){alert('— Oops, you missed something: —\n\n'+P);return false}else{if(N.length&&!N.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}s.attr(x),ws_plugin__optimizemember_animateProcessing(s);return true})}else{if((n=w("form#s2member-pro-authnet-update-form")).length===1){var q,r="div#s2member-pro-authnet-update-form-billing-method-section",C="div#s2member-pro-authnet-update-form-billing-address-section",i=r+' input[name="optimizemember_pro_authnet_update[card_type]"]',I="div#s2member-pro-authnet-update-form-captcha-section",k="div#s2member-pro-authnet-update-form-submission-section",s=w(k+" input#s2member-pro-authnet-update-submit");ws_plugin__optimizemember_animateProcessing(s,"reset"),s.removeAttr("disabled");(q=function(L){var M=w(i+":checked").val();if(w.inArray(M,["Visa","MasterCard","Amex","Discover"])!==-1){w(r+" > div.s2member-pro-authnet-update-form-div").show();w(r+" > div.s2member-pro-authnet-update-form-div :input").attr(t);w(r+" > div#s2member-pro-authnet-update-form-card-start-date-issue-number-div").hide();w(r+" > div#s2member-pro-authnet-update-form-card-start-date-issue-number-div :input").attr(a);w(C+" > div.s2member-pro-authnet-update-form-div").show();w(C+" > div.s2member-pro-authnet-update-form-div :input").attr(t);w(C).show(),(L)?w(r+" input#s2member-pro-authnet-update-card-number").focus():null}else{if(w.inArray(M,["Maestro","Solo"])!==-1){w(r+" > div.s2member-pro-authnet-update-form-div").show();w(r+" > div.s2member-pro-authnet-update-form-div :input").attr(t);w(C+" > div.s2member-pro-authnet-update-form-div").show();w(C+" > div.s2member-pro-authnet-update-form-div :input").attr(t);w(C).show(),(L)?w(r+" input#s2member-pro-authnet-update-card-number").focus():null}else{if(!M){w(r+" > div.s2member-pro-authnet-update-form-div").hide();w(r+" > div.s2member-pro-authnet-update-form-div :input").attr(a);w(r+" > div#s2member-pro-authnet-update-form-card-type-div").show();w(r+" > div#s2member-pro-authnet-update-form-card-type-div :input").attr(t);w(C+" > div.s2member-pro-authnet-update-form-div").hide();w(C+" > div.s2member-pro-authnet-update-form-div :input").attr(a);w(C).hide(),(L)?w(k+" input#s2member-pro-authnet-update-submit").focus():null}}}})();w(i).click(q).change(q);n.submit(function(){var O=this,M="",L="",P="";var N=w(I+" input#recaptcha_response_field");if(!w(i+":checked").val()){alert('Please choose a Billing Method.');return false}w(":input",O).each(function(){var Q=w.trim(w(this).attr("id")).replace(/-[0-9]+$/g,"");if(Q&&(M=w.trim(w('label[for="'+Q+'"]',O).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(L=ws_plugin__optimizemember_validationErrors(M,this,O)){P+=L+"\n\n"}}});if(P=w.trim(P)){alert('— Oops, you missed something: —\n\n'+P);return false}else{if(N.length&&!N.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}s.attr(x),ws_plugin__optimizemember_animateProcessing(s);return true})}else{if((g=w("form#s2member-pro-authnet-registration-form")).length===1){var G,o,H="div#s2member-pro-authnet-registration-form-registration-section",I="div#s2member-pro-authnet-registration-form-captcha-section",k="div#s2member-pro-authnet-registration-form-submission-section",s=w(k+" input#s2member-pro-authnet-registration-submit");ws_plugin__optimizemember_animateProcessing(s,"reset"),s.removeAttr("disabled");(G=function(L){if(w(k+" input#s2member-pro-authnet-registration-names-not-required-or-not-possible").length){w(H+" > div#s2member-pro-authnet-registration-form-first-name-div").hide();w(H+" > div#s2member-pro-authnet-registration-form-first-name-div :input").attr(f);w(H+" > div#s2member-pro-authnet-registration-form-last-name-div").hide();w(H+" > div#s2member-pro-authnet-registration-form-last-name-div :input").attr(f)}})();(o=function(L){if(w(k+" input#s2member-pro-authnet-registration-password-not-required-or-not-possible").length){w(H+" > div#s2member-pro-authnet-registration-form-password-div").hide();w(H+" > div#s2member-pro-authnet-registration-form-password-div :input").attr(f)}})();w(H+" > div#s2member-pro-authnet-registration-form-password-div :input").keyup(function(){ws_plugin__optimizemember_passwordStrength(w(H+" input#s2member-pro-authnet-registration-username"),w(H+" input#s2member-pro-authnet-registration-password1"),w(H+" input#s2member-pro-authnet-registration-password2"),w(H+" div#s2member-pro-authnet-registration-form-password-strength"))});g.submit(function(){var O=this,M="",L="",R="";var N=w(I+" input#recaptcha_response_field");var Q=w(H+' input#s2member-pro-authnet-registration-password1[aria-required="true"]');var P=w(H+" input#s2member-pro-authnet-registration-password2");w(":input",O).each(function(){var S=w.trim(w(this).attr("id")).replace(/-[0-9]+$/g,"");if(S&&(M=w.trim(w('label[for="'+S+'"]',O).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(L=ws_plugin__optimizemember_validationErrors(M,this,O)){R+=L+"\n\n"}}});if(R=w.trim(R)){alert('— Oops, you missed something: —\n\n'+R);return false}else{if(Q.length&&w.trim(Q.val())!==w.trim(P.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(Q.length&&w.trim(Q.val()).length<6){alert('— Oops, you missed something: —\n\nPassword MUST be at least 6 characters. Please try again.');return false}else{if(N.length&&!N.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}}}s.attr(x),ws_plugin__optimizemember_animateProcessing(s);return true})}else{if((j=w("form#s2member-pro-authnet-sp-checkout-form")).length===1){var A,E,p=true,D,l,e,y,b,z,q,B="div#s2member-pro-authnet-sp-checkout-form-coupon-section",J=B+" input#s2member-pro-authnet-sp-checkout-coupon-apply",H="div#s2member-pro-authnet-sp-checkout-form-registration-section",r="div#s2member-pro-authnet-sp-checkout-form-billing-method-section",i=r+' input[name="optimizemember_pro_authnet_sp_checkout[card_type]"]',C="div#s2member-pro-authnet-sp-checkout-form-billing-address-section",v=w(C+" > div#s2member-pro-authnet-sp-checkout-form-ajax-tax-div"),I="div#s2member-pro-authnet-sp-checkout-form-captcha-section",k="div#s2member-pro-authnet-sp-checkout-form-submission-section",h=k+" input#s2member-pro-authnet-sp-checkout-nonce",c=k+" input#s2member-pro-authnet-sp-checkout-submit";ws_plugin__optimizemember_animateProcessing(w(c),"reset"),w(c).removeAttr("disabled"),w(J).removeAttr("disabled");(A=function(L){if(w(k+" input#s2member-pro-authnet-sp-checkout-coupons-not-required-or-not-possible").length){w(B).hide()}else{w(B).show()}})();(E=function(L){if(w(k+" input#s2member-pro-authnet-sp-checkout-tax-not-required-or-not-possible").length){v.hide(),p=false}})();(D=function(M){if(p&&!(M&&M.interval&&document.activeElement.id==="s2member-pro-authnet-sp-checkout-country")){var L=w(k+" input#s2member-pro-authnet-sp-checkout-attr").val();var P=w.trim(w(C+" input#s2member-pro-authnet-sp-checkout-state").val());var Q=w(C+" select#s2member-pro-authnet-sp-checkout-country").val();var O=w.trim(w(C+" input#s2member-pro-authnet-sp-checkout-zip").val());var N=P+"|"+Q+"|"+O;if(P&&Q&&O&&N&&(!b||b!==N)&&(b=N)){(y)?y.abort():null,clearTimeout(e),e=null;v.html('
Calculating Sales Tax... calculating sales tax...
');e=setTimeout(function(){y=w.post('https://optimizepressplus.com/wp-admin/admin-ajax.php',{action:"ws_plugin__optimizemember_pro_authnet_ajax_tax",ws_plugin__optimizemember_pro_authnet_ajax_tax:'fnIyOkthRVZOUVg1SFlJUndLanRuWlM5akdZTGF4YnRERHJpOjQwZDI5NDg3OTI2MGM4NjMwYWY0NWI3NmI2YWYxYzM0fBzIZFQuVmQ6fp8QfYhn4tt7lj00R2T6050B3HNR5G967fmSUDEvuwwpqI35fDIgGK8WoQwy_cieNUCZ-4GI7AI',"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[attr]":L,"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[state]":P,"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[country]":Q,"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[zip]":O},function(R){clearTimeout(e),e=null;try{v.html("
"+w.sprintf('Sales Tax%s: %s
— Total%s: %s',((R.trial)?' Today':""),((R.tax_per)?""+R.tax_per+" ( "+R.cur_symbol+""+R.tax+" )":R.cur_symbol+""+R.tax),((R.trial)?' Today':""),R.cur_symbol+""+R.total)+"
")}catch(S){}},"json")},((M&&M.keyCode)?1000:100))}else{if(!P||!Q||!O||!N){v.html(""),b=null}}}})();l=function(L){setTimeout(function(){D(L)},10)};w(C+" input#s2member-pro-authnet-sp-checkout-state").bind("keyup blur",D).bind("cut paste",l);w(C+" input#s2member-pro-authnet-sp-checkout-zip").bind("keyup blur",D).bind("cut paste",l);w(C+" select#s2member-pro-authnet-sp-checkout-country").bind("change",D);setInterval(function(){D({interval:true})},1000);(z=function(L){if(OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN){w(H+" input#s2member-pro-authnet-sp-checkout-first-name").each(function(){var M=w(this),N=M.val();(!N)?M.val(OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME):null});w(H+" input#s2member-pro-authnet-sp-checkout-last-name").each(function(){var M=w(this),N=M.val();(!N)?M.val(OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME):null});w(H+" input#s2member-pro-authnet-sp-checkout-email").each(function(){var M=w(this),N=M.val();(!N)?M.val(OPTIMIZEMEMBER_CURRENT_USER_EMAIL):null})}})();(q=function(L){var M=w(i+":checked").val();if(w.inArray(M,["Visa","MasterCard","Amex","Discover"])!==-1){w(r+" > div.s2member-pro-authnet-sp-checkout-form-div").show();w(r+" > div.s2member-pro-authnet-sp-checkout-form-div :input").attr(t);w(r+" > div#s2member-pro-authnet-sp-checkout-form-card-start-date-issue-number-div").hide();w(r+" > div#s2member-pro-authnet-sp-checkout-form-card-start-date-issue-number-div :input").attr(a);w(C+" > div.s2member-pro-authnet-sp-checkout-form-div").show();w(C+" > div.s2member-pro-authnet-sp-checkout-form-div :input").attr(t);(!p)?v.hide():null;w(C).show(),(L)?w(r+" input#s2member-pro-authnet-sp-checkout-card-number").focus():null}else{if(w.inArray(M,["Maestro","Solo"])!==-1){w(r+" > div.s2member-pro-authnet-sp-checkout-form-div").show();w(r+" > div.s2member-pro-authnet-sp-checkout-form-div :input").attr(t);w(C+" > div.s2member-pro-authnet-sp-checkout-form-div").show();w(C+" > div.s2member-pro-authnet-sp-checkout-form-div :input").attr(t);(!p)?v.hide():null;w(C).show(),(L)?w(r+" input#s2member-pro-authnet-sp-checkout-card-number").focus():null}else{if(!M){w(r+" > div.s2member-pro-authnet-sp-checkout-form-div").hide();w(r+" > div.s2member-pro-authnet-sp-checkout-form-div :input").attr(a);w(r+" > div#s2member-pro-authnet-sp-checkout-form-card-type-div").show();w(r+" > div#s2member-pro-authnet-sp-checkout-form-card-type-div :input").attr(t);w(C+" > div.s2member-pro-authnet-sp-checkout-form-div").hide();w(C+" > div.s2member-pro-authnet-sp-checkout-form-div :input").attr(a);(!p)?v.hide():null;w(C).hide(),(L)?w(k+" input#s2member-pro-authnet-sp-checkout-submit").focus():null}}}E()})();w(i).click(q).change(q);w(J).click(function(){w(h).val("apply-coupon"),j.submit()});j.submit(function(){if(w(h).val()!=="apply-coupon"){var O=this,M="",L="",P="";var N=w(I+" input#recaptcha_response_field");if(!w(i+":checked").val()){alert('Please choose a Billing Method.');return false}w(":input",O).each(function(){var Q=w.trim(w(this).attr("id")).replace(/-[0-9]+$/g,"");if(Q&&(M=w.trim(w('label[for="'+Q+'"]',O).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(L=ws_plugin__optimizemember_validationErrors(M,this,O)){P+=L+"\n\n"}}});if(P=w.trim(P)){alert('— Oops, you missed something: —\n\n'+P);return false}else{if(N.length&&!N.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}}w(c).attr(x),ws_plugin__optimizemember_animateProcessing(w(c)),w(J).attr(x);return true})}else{if((m=w("form#s2member-pro-authnet-checkout-form")).length===1){var A,E,p=true,D,l,e,y,b,o,q,z,B="div#s2member-pro-authnet-checkout-form-coupon-section",J=B+" input#s2member-pro-authnet-checkout-coupon-apply",H="div#s2member-pro-authnet-checkout-form-registration-section",K="div#s2member-pro-authnet-checkout-form-custom-fields-section",r="div#s2member-pro-authnet-checkout-form-billing-method-section",i=r+' input[name="optimizemember_pro_authnet_checkout[card_type]"]',C="div#s2member-pro-authnet-checkout-form-billing-address-section",v=w(C+" > div#s2member-pro-authnet-checkout-form-ajax-tax-div"),I="div#s2member-pro-authnet-checkout-form-captcha-section",k="div#s2member-pro-authnet-checkout-form-submission-section",h=k+" input#s2member-pro-authnet-checkout-nonce",c=k+" input#s2member-pro-authnet-checkout-submit";ws_plugin__optimizemember_animateProcessing(w(c),"reset"),w(c).removeAttr("disabled"),w(J).removeAttr("disabled");(A=function(L){if(w(k+" input#s2member-pro-authnet-checkout-coupons-not-required-or-not-possible").length){w(B).hide()}else{w(B).show()}})();(E=function(L){if(w(k+" input#s2member-pro-authnet-checkout-tax-not-required-or-not-possible").length){v.hide(),p=false}})();(D=function(M){if(p&&!(M&&M.interval&&document.activeElement.id==="s2member-pro-authnet-checkout-country")){var L=w(k+" input#s2member-pro-authnet-checkout-attr").val();var P=w.trim(w(C+" input#s2member-pro-authnet-checkout-state").val());var Q=w(C+" select#s2member-pro-authnet-checkout-country").val();var O=w.trim(w(C+" input#s2member-pro-authnet-checkout-zip").val());var N=P+"|"+Q+"|"+O;if(P&&Q&&O&&N&&(!b||b!==N)&&(b=N)){(y)?y.abort():null,clearTimeout(e),e=null;v.html('
Calculating Sales Tax... calculating sales tax...
');e=setTimeout(function(){y=w.post('https://optimizepressplus.com/wp-admin/admin-ajax.php',{action:"ws_plugin__optimizemember_pro_authnet_ajax_tax",ws_plugin__optimizemember_pro_authnet_ajax_tax:'fnIyOjFFb2R4VHB6aU93NG5OUnpHbHBsZkM4SnVxcEpXUEY1OmUzZTNmYzY0ZTlmNTgyMmE5ZmEzZjI0NDVjYzAyOGE0fNM5n0XZ3lM2xPUNWSpyCEgrpN9LpX15EkZNlXVwGVU_EyzL3Ai2PBpGilL_PJDUW57iqHEWh6pVfQwkkX66Lws',"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[attr]":L,"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[state]":P,"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[country]":Q,"ws_plugin__optimizemember_pro_authnet_ajax_tax_vars[zip]":O},function(R,T){clearTimeout(e),e=null;try{v.html("
"+w.sprintf('Sales Tax%s: %s
— Total%s: %s',((R.trial)?' Today':""),((R.tax_per)?""+R.tax_per+" ( "+R.cur_symbol+""+R.tax+" )":R.cur_symbol+""+R.tax),((R.trial)?' Today':""),R.cur_symbol+""+R.total)+"
")}catch(S){}},"json")},((M&&M.keyCode)?1000:100))}else{if(!P||!Q||!O||!N){v.html(""),b=null}}}})();l=function(L){setTimeout(function(){D(L)},10)};w(C+" input#s2member-pro-authnet-checkout-state").bind("keyup blur",D).bind("cut paste",l);w(C+" input#s2member-pro-authnet-checkout-zip").bind("keyup blur",D).bind("cut paste",l);w(C+" select#s2member-pro-authnet-checkout-country").bind("change",D);setInterval(function(){D({interval:true})},1000);(o=function(L){if(w(k+" input#s2member-pro-authnet-checkout-password-not-required-or-not-possible").length){w(H+" > div#s2member-pro-authnet-checkout-form-password-div").hide();w(H+" > div#s2member-pro-authnet-checkout-form-password-div :input").attr(f)}})();(z=function(L){if(OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN){w(H+" input#s2member-pro-authnet-checkout-first-name").each(function(){var M=w(this),N=M.val();(!N)?M.val(OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME):null});w(H+" input#s2member-pro-authnet-checkout-last-name").each(function(){var M=w(this),N=M.val();(!N)?M.val(OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME):null});w(H+" input#s2member-pro-authnet-checkout-email").val(OPTIMIZEMEMBER_CURRENT_USER_EMAIL).attr(f);w(H+" input#s2member-pro-authnet-checkout-username").val(OPTIMIZEMEMBER_CURRENT_USER_LOGIN).attr(f);w(H+" > div#s2member-pro-authnet-checkout-form-password-div").hide();w(H+" > div#s2member-pro-authnet-checkout-form-password-div :input").attr(f);if(w.trim(w(H+" > div#s2member-pro-authnet-checkout-form-registration-section-title").html())==='Create Profile'){w(H+" > div#s2member-pro-authnet-checkout-form-registration-section-title").html('Your Profile')}w(K).hide(),w(K+" :input").attr(f)}})();(q=function(L){var M=w(i+":checked").val();if(w.inArray(M,["Visa","MasterCard","Amex","Discover"])!==-1){w(r+" > div.s2member-pro-authnet-checkout-form-div").show();w(r+" > div.s2member-pro-authnet-checkout-form-div :input").attr(t);w(r+" > div#s2member-pro-authnet-checkout-form-card-start-date-issue-number-div").hide();w(r+" > div#s2member-pro-authnet-checkout-form-card-start-date-issue-number-div :input").attr(a);w(C+" > div.s2member-pro-authnet-checkout-form-div").show();w(C+" > div.s2member-pro-authnet-checkout-form-div :input").attr(t);(!p)?v.hide():null;w(C).show(),(L)?w(r+" input#s2member-pro-authnet-checkout-card-number").focus():null}else{if(w.inArray(M,["Maestro","Solo"])!==-1){w(r+" > div.s2member-pro-authnet-checkout-form-div").show();w(r+" > div.s2member-pro-authnet-checkout-form-div :input").attr(t);w(C+" > div.s2member-pro-authnet-checkout-form-div").show();w(C+" > div.s2member-pro-authnet-checkout-form-div :input").attr(t);(!p)?v.hide():null;w(C).show(),(L)?w(r+" input#s2member-pro-authnet-checkout-card-number").focus():null}else{if(!M){w(r+" > div.s2member-pro-authnet-checkout-form-div").hide();w(r+" > div.s2member-pro-authnet-checkout-form-div :input").attr(a);w(r+" > div#s2member-pro-authnet-checkout-form-card-type-div").show();w(r+" > div#s2member-pro-authnet-checkout-form-card-type-div :input").attr(t);w(C+" > div.s2member-pro-authnet-checkout-form-div").hide();w(C+" > div.s2member-pro-authnet-checkout-form-div :input").attr(a);(!p)?v.hide():null;w(C).hide(),(L)?w(k+" input#s2member-pro-authnet-checkout-submit").focus():null}}}})();w(i).click(q).change(q);w(J).click(function(){w(h).val("apply-coupon"),m.submit()});w(H+" > div#s2member-pro-authnet-checkout-form-password-div :input").keyup(function(){ws_plugin__optimizemember_passwordStrength(w(H+" input#s2member-pro-authnet-checkout-username"),w(H+" input#s2member-pro-authnet-checkout-password1"),w(H+" input#s2member-pro-authnet-checkout-password2"),w(H+" div#s2member-pro-authnet-checkout-form-password-strength"))});m.submit(function(){if(w(h).val()!=="apply-coupon"){var O=this,M="",L="",R="";var N=w(I+" input#recaptcha_response_field");var Q=w(H+' input#s2member-pro-authnet-checkout-password1[aria-required="true"]');var P=w(H+" input#s2member-pro-authnet-checkout-password2");if(!w(i+":checked").val()){alert('Please choose a Billing Method.');return false}w(":input",O).each(function(){var S=w.trim(w(this).attr("id")).replace(/-[0-9]+$/g,"");if(S&&(M=w.trim(w('label[for="'+S+'"]',O).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(L=ws_plugin__optimizemember_validationErrors(M,this,O)){R+=L+"\n\n"}}});if(R=w.trim(R)){alert('— Oops, you missed something: —\n\n'+R);return false}else{if(Q.length&&w.trim(Q.val())!==w.trim(P.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(Q.length&&w.trim(Q.val()).length<6){alert('— Oops, you missed something: —\n\nPassword MUST be at least 6 characters. Please try again.');return false}else{if(N.length&&!N.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}}}}w(c).attr(x),ws_plugin__optimizemember_animateProcessing(w(c)),w(J).attr(x);return true})}}}}}(F=function(){w("div#s2member-pro-authnet-form-response").each(function(){var L=w(this).offset();window.scrollTo(0,L.top-100)})})()}); var OPTIMIZEMEMBER_PRO_CLICKBANK_GATEWAY = true; jQuery(document).ready(function(a){}); var OPTIMIZEMEMBER_PRO_PAYPAL_GATEWAY = true; jQuery(document).ready(function(y){var d,p,i,l,o,H,w,v={"aria-required":"true"},a={"aria-required":"false"},z={disabled:"disabled"},h={"aria-required":"false",disabled:"disabled"};w=new Image(),w.src='https://optimizepressplus.com/wp-content/plugins/optimizeMember/images/ajax-loader.gif';if((d=y("form#s2member-pro-paypal-cancellation-form")).length===1){var K="div#s2member-pro-paypal-cancellation-form-captcha-section",m="div#s2member-pro-paypal-cancellation-form-submission-section",u=y(m+" input#s2member-pro-paypal-cancellation-submit");ws_plugin__optimizemember_animateProcessing(u,"reset"),u.removeAttr("disabled");d.submit(function(){var Q=this,O="",N="",R="";var P=y(K+" input#recaptcha_response_field");y(":input",Q).each(function(){var S=y.trim(y(this).attr("id")).replace(/-[0-9]+$/g,"");if(S&&(O=y.trim(y('label[for="'+S+'"]',Q).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(N=ws_plugin__optimizemember_validationErrors(O,this,Q)){R+=N+"\n\n"}}});if(R=y.trim(R)){alert('— Oops, you missed something: —\n\n'+R);return false}else{if(P.length&&!P.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}u.attr(z),ws_plugin__optimizemember_animateProcessing(u);return true})}else{if((p=y("form#s2member-pro-paypal-update-form")).length===1){var s,t="div#s2member-pro-paypal-update-form-billing-method-section",E="div#s2member-pro-paypal-update-form-billing-address-section",k=t+' input[name="optimizemember_pro_paypal_update[card_type]"]',K="div#s2member-pro-paypal-update-form-captcha-section",m="div#s2member-pro-paypal-update-form-submission-section",u=y(m+" input#s2member-pro-paypal-update-submit");ws_plugin__optimizemember_animateProcessing(u,"reset"),u.removeAttr("disabled");(s=function(N){var O=y(k+":checked").val();if(y.inArray(O,["Visa","MasterCard","Amex","Discover"])!==-1){y(t+" > div.s2member-pro-paypal-update-form-div").show();y(t+" > div.s2member-pro-paypal-update-form-div :input").attr(v);y(t+" > div#s2member-pro-paypal-update-form-card-start-date-issue-number-div").hide();y(t+" > div#s2member-pro-paypal-update-form-card-start-date-issue-number-div :input").attr(a);y(E+" > div.s2member-pro-paypal-update-form-div").show();y(E+" > div.s2member-pro-paypal-update-form-div :input").attr(v);y(E).show(),(N)?y(t+" input#s2member-pro-paypal-update-card-number").focus():null}else{if(y.inArray(O,["Maestro","Solo"])!==-1){y(t+" > div.s2member-pro-paypal-update-form-div").show();y(t+" > div.s2member-pro-paypal-update-form-div :input").attr(v);y(E+" > div.s2member-pro-paypal-update-form-div").show();y(E+" > div.s2member-pro-paypal-update-form-div :input").attr(v);y(E).show(),(N)?y(t+" input#s2member-pro-paypal-update-card-number").focus():null}else{if(!O){y(t+" > div.s2member-pro-paypal-update-form-div").hide();y(t+" > div.s2member-pro-paypal-update-form-div :input").attr(a);y(t+" > div#s2member-pro-paypal-update-form-card-type-div").show();y(t+" > div#s2member-pro-paypal-update-form-card-type-div :input").attr(v);y(E+" > div.s2member-pro-paypal-update-form-div").hide();y(E+" > div.s2member-pro-paypal-update-form-div :input").attr(a);y(E).hide(),(N)?y(m+" input#s2member-pro-paypal-update-submit").focus():null}}}})();y(k).click(s).change(s);p.submit(function(){var Q=this,O="",N="",R="";var P=y(K+" input#recaptcha_response_field");if(!y(k+":checked").val()){alert('Please choose a Billing Method.');return false}y(":input",Q).each(function(){var S=y.trim(y(this).attr("id")).replace(/-[0-9]+$/g,"");if(S&&(O=y.trim(y('label[for="'+S+'"]',Q).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(N=ws_plugin__optimizemember_validationErrors(O,this,Q)){R+=N+"\n\n"}}});if(R=y.trim(R)){alert('— Oops, you missed something: —\n\n'+R);return false}else{if(P.length&&!P.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}u.attr(z),ws_plugin__optimizemember_animateProcessing(u);return true})}else{if((i=y("form#s2member-pro-paypal-registration-form")).length===1){var I,q,J="div#s2member-pro-paypal-registration-form-registration-section",K="div#s2member-pro-paypal-registration-form-captcha-section",m="div#s2member-pro-paypal-registration-form-submission-section",u=y(m+" input#s2member-pro-paypal-registration-submit");ws_plugin__optimizemember_animateProcessing(u,"reset"),u.removeAttr("disabled");(I=function(N){if(y(m+" input#s2member-pro-paypal-registration-names-not-required-or-not-possible").length){y(J+" > div#s2member-pro-paypal-registration-form-first-name-div").hide();y(J+" > div#s2member-pro-paypal-registration-form-first-name-div :input").attr(h);y(J+" > div#s2member-pro-paypal-registration-form-last-name-div").hide();y(J+" > div#s2member-pro-paypal-registration-form-last-name-div :input").attr(h)}})();(q=function(N){if(y(m+" input#s2member-pro-paypal-registration-password-not-required-or-not-possible").length){y(J+" > div#s2member-pro-paypal-registration-form-password-div").hide();y(J+" > div#s2member-pro-paypal-registration-form-password-div :input").attr(h)}})();y(J+" > div#s2member-pro-paypal-registration-form-password-div :input").keyup(function(){ws_plugin__optimizemember_passwordStrength(y(J+" input#s2member-pro-paypal-registration-username"),y(J+" input#s2member-pro-paypal-registration-password1"),y(J+" input#s2member-pro-paypal-registration-password2"),y(J+" div#s2member-pro-paypal-registration-form-password-strength"))});i.submit(function(){var Q=this,O="",N="",T="";var P=y(K+" input#recaptcha_response_field");var S=y(J+' input#s2member-pro-paypal-registration-password1[aria-required="true"]');var R=y(J+" input#s2member-pro-paypal-registration-password2");y(":input",Q).each(function(){var U=y.trim(y(this).attr("id")).replace(/-[0-9]+$/g,"");if(U&&(O=y.trim(y('label[for="'+U+'"]',Q).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(N=ws_plugin__optimizemember_validationErrors(O,this,Q)){T+=N+"\n\n"}}});if(T=y.trim(T)){alert('— Oops, you missed something: —\n\n'+T);return false}else{if(S.length&&y.trim(S.val())!==y.trim(R.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(S.length&&y.trim(S.val()).length<6){alert('— Oops, you missed something: —\n\nPassword MUST be at least 6 characters. Please try again.');return false}else{if(P.length&&!P.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}}}u.attr(z),ws_plugin__optimizemember_animateProcessing(u);return true})}else{if((l=y("form#s2member-pro-paypal-sp-checkout-form")).length===1){var C,G,r=true,F,n,e,A,b,B,s,D="div#s2member-pro-paypal-sp-checkout-form-coupon-section",L=D+" input#s2member-pro-paypal-sp-checkout-coupon-apply",J="div#s2member-pro-paypal-sp-checkout-form-registration-section",t="div#s2member-pro-paypal-sp-checkout-form-billing-method-section",k=t+' input[name="optimizemember_pro_paypal_sp_checkout[card_type]"]',E="div#s2member-pro-paypal-sp-checkout-form-billing-address-section",x=y(E+" > div#s2member-pro-paypal-sp-checkout-form-ajax-tax-div"),K="div#s2member-pro-paypal-sp-checkout-form-captcha-section",m="div#s2member-pro-paypal-sp-checkout-form-submission-section",j=m+" input#s2member-pro-paypal-sp-checkout-nonce",c=m+" input#s2member-pro-paypal-sp-checkout-submit";var f='';var g='';ws_plugin__optimizemember_animateProcessing(y(c),"reset"),y(c).removeAttr("disabled"),y(L).removeAttr("disabled");(C=function(N){if(y(m+" input#s2member-pro-paypal-sp-checkout-coupons-not-required-or-not-possible").length){y(D).hide()}else{y(D).show()}})();(G=function(N){if(y(m+" input#s2member-pro-paypal-sp-checkout-tax-not-required-or-not-possible").length){x.hide(),r=false}})();(F=function(O){if(r&&!(O&&O.interval&&document.activeElement.id==="s2member-pro-paypal-sp-checkout-country")){var N=y(m+" input#s2member-pro-paypal-sp-checkout-attr").val();var R=y.trim(y(E+" input#s2member-pro-paypal-sp-checkout-state").val());var S=y(E+" select#s2member-pro-paypal-sp-checkout-country").val();var Q=y.trim(y(E+" input#s2member-pro-paypal-sp-checkout-zip").val());var P=R+"|"+S+"|"+Q;if(R&&S&&Q&&P&&(!b||b!==P)&&(b=P)){(A)?A.abort():null,clearTimeout(e),e=null;x.html('
Calculating Sales Tax... calculating sales tax...
');e=setTimeout(function(){A=y.post('https://optimizepressplus.com/wp-admin/admin-ajax.php',{action:"ws_plugin__optimizemember_pro_paypal_ajax_tax",ws_plugin__optimizemember_pro_paypal_ajax_tax:'fnIyOjhjeGZNN2tMaHAycnN6bkhjbW8waW5kZXU4UkFPbFBwOjhkNjcyNWZiNzIzNTA3ZjAyNGQ3MTNiNTkzZjg4YmFifPYc3sAdKXmC_URJ5Oi2O_LGNnzUqeBTG2h2EWNzOIAEryWmZXmJGRgmQjwP3DUtxblDfJFqdBZan1TLL-H3M5Q',"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[attr]":N,"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[state]":R,"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[country]":S,"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[zip]":Q},function(T){clearTimeout(e),e=null;try{x.html("
"+y.sprintf('Sales Tax%s: %s
— Total%s: %s',((T.trial)?' Today':""),((T.tax_per)?""+T.tax_per+" ( "+T.cur_symbol+""+T.tax+" )":T.cur_symbol+""+T.tax),((T.trial)?' Today':""),T.cur_symbol+""+T.total)+"
")}catch(U){}},"json")},((O&&O.keyCode)?1000:100))}else{if(!R||!S||!Q||!P){x.html(""),b=null}}}})();n=function(N){setTimeout(function(){F(N)},10)};y(E+" input#s2member-pro-paypal-sp-checkout-state").bind("keyup blur",F).bind("cut paste",n);y(E+" input#s2member-pro-paypal-sp-checkout-zip").bind("keyup blur",F).bind("cut paste",n);y(E+" select#s2member-pro-paypal-sp-checkout-country").bind("change",F);setInterval(function(){F({interval:true})},1000);(B=function(N){if(OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN){y(J+" input#s2member-pro-paypal-sp-checkout-first-name").each(function(){var O=y(this),P=O.val();(!P)?O.val(OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME):null});y(J+" input#s2member-pro-paypal-sp-checkout-last-name").each(function(){var O=y(this),P=O.val();(!P)?O.val(OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME):null});y(J+" input#s2member-pro-paypal-sp-checkout-email").each(function(){var O=y(this),P=O.val();(!P)?O.val(OPTIMIZEMEMBER_CURRENT_USER_EMAIL):null})}})();(s=function(N){var O=y(k+":checked").val();if(y.inArray(O,["Visa","MasterCard","Amex","Discover"])!==-1){y(t+" > div.s2member-pro-paypal-sp-checkout-form-div").show();y(t+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(v);y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div").hide();y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div :input").attr(a);y(E+" > div.s2member-pro-paypal-sp-checkout-form-div").show();y(E+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(v);(!r)?x.hide():null;y(E).show(),y(m+" input#s2member-pro-paypal-sp-checkout-submit").replaceWith(f);(N)?y(t+" input#s2member-pro-paypal-sp-checkout-card-number").focus():null}else{if(y.inArray(O,["Maestro","Solo"])!==-1){y(t+" > div.s2member-pro-paypal-sp-checkout-form-div").show();y(t+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(v);y(E+" > div.s2member-pro-paypal-sp-checkout-form-div").show();y(E+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(v);(!r)?x.hide():null;y(E).show(),y(m+" input#s2member-pro-paypal-sp-checkout-submit").replaceWith(f);(N)?y(t+" input#s2member-pro-paypal-sp-checkout-card-number").focus():null}else{if((!O||O==="PayPal")&&r){y(t+" > div.s2member-pro-paypal-sp-checkout-form-div").show();y(t+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(v);y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-number-div").hide();y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-number-div :input").attr(a);y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-expiration-div").hide();y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-expiration-div :input").attr(a);y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-verification-div").hide();y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-verification-div :input").attr(a);y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div").hide();y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div :input").attr(a);y(E+" > div.s2member-pro-paypal-sp-checkout-form-div").show();y(E+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(v);y(E+" > div#s2member-pro-paypal-sp-checkout-form-street-div").hide();y(E+" > div#s2member-pro-paypal-sp-checkout-form-street-div :input").attr(a);y(E+" > div#s2member-pro-paypal-sp-checkout-form-city-div").hide();y(E+" > div#s2member-pro-paypal-sp-checkout-form-city-div :input").attr(a);y(E).show(),y(m+" input#s2member-pro-paypal-sp-checkout-submit").replaceWith(g);(N)?y(E+" input#s2member-pro-paypal-sp-checkout-state").focus():null}else{if(!O||O==="PayPal"){y(t+" > div.s2member-pro-paypal-sp-checkout-form-div").hide();y(t+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(a);y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-type-div").show();y(t+" > div#s2member-pro-paypal-sp-checkout-form-card-type-div :input").attr(v);y(E+" > div.s2member-pro-paypal-sp-checkout-form-div").hide();y(E+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(a);y(E).hide(),y(m+" input#s2member-pro-paypal-sp-checkout-submit").replaceWith(g);(N)?y(m+" input#s2member-pro-paypal-sp-checkout-submit").focus():null}}}}G()})();y(k).click(s).change(s);y(L).click(function(){y(j).val("apply-coupon"),l.submit()});l.submit(function(){if(y(j).val()!=="apply-coupon"){var Q=this,O="",N="",R="";var P=y(K+" input#recaptcha_response_field");if(!y(k+":checked").val()){y(k).val(["PayPal"])}y(":input",Q).each(function(){var S=y.trim(y(this).attr("id")).replace(/-[0-9]+$/g,"");if(S&&(O=y.trim(y('label[for="'+S+'"]',Q).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(N=ws_plugin__optimizemember_validationErrors(O,this,Q)){R+=N+"\n\n"}}});if(R=y.trim(R)){alert('— Oops, you missed something: —\n\n'+R);return false}else{if(P.length&&!P.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}}y(c).attr(z),ws_plugin__optimizemember_animateProcessing(y(c)),y(L).attr(z);return true})}else{if((o=y("form#s2member-pro-paypal-checkout-form")).length===1){var C,G,r=true,F,n,e,A,b,q,s,B,D="div#s2member-pro-paypal-checkout-form-coupon-section",L=D+" input#s2member-pro-paypal-checkout-coupon-apply",J="div#s2member-pro-paypal-checkout-form-registration-section",M="div#s2member-pro-paypal-checkout-form-custom-fields-section",t="div#s2member-pro-paypal-checkout-form-billing-method-section",k=t+' input[name="optimizemember_pro_paypal_checkout[card_type]"]',E="div#s2member-pro-paypal-checkout-form-billing-address-section",x=y(E+" > div#s2member-pro-paypal-checkout-form-ajax-tax-div"),K="div#s2member-pro-paypal-checkout-form-captcha-section",m="div#s2member-pro-paypal-checkout-form-submission-section",j=m+" input#s2member-pro-paypal-checkout-nonce",c=m+" input#s2member-pro-paypal-checkout-submit";var f='';var g='';ws_plugin__optimizemember_animateProcessing(y(c),"reset"),y(c).removeAttr("disabled"),y(L).removeAttr("disabled");(C=function(N){if(y(m+" input#s2member-pro-paypal-checkout-coupons-not-required-or-not-possible").length){y(D).hide()}else{y(D).show()}})();(G=function(N){if(y(m+" input#s2member-pro-paypal-checkout-tax-not-required-or-not-possible").length){x.hide(),r=false}})();(F=function(O){if(r&&!(O&&O.interval&&document.activeElement.id==="s2member-pro-paypal-checkout-country")){var N=y(m+" input#s2member-pro-paypal-checkout-attr").val();var R=y.trim(y(E+" input#s2member-pro-paypal-checkout-state").val());var S=y(E+" select#s2member-pro-paypal-checkout-country").val();var Q=y.trim(y(E+" input#s2member-pro-paypal-checkout-zip").val());var P=R+"|"+S+"|"+Q;if(R&&S&&Q&&P&&(!b||b!==P)&&(b=P)){(A)?A.abort():null,clearTimeout(e),e=null;x.html('
Calculating Sales Tax... calculating sales tax...
');e=setTimeout(function(){A=y.post('https://optimizepressplus.com/wp-admin/admin-ajax.php',{action:"ws_plugin__optimizemember_pro_paypal_ajax_tax",ws_plugin__optimizemember_pro_paypal_ajax_tax:'fnIyOmtiYWtVekg0MXdVYVlMWTR0ZWtTNTg1dmtuRDdWeEs4OjY4MTJmZGMzMjc3MTM3MzBiN2U5YjVmMzM1MTY4NGQ4fFKgbLuIXTwLJzk21mc5ONE6PO7Pt9RAJcFeSGz3avZ_aWbq6e7EQLRlGaF9BxASdAyR9OPSG8jMT7DSbVfAZgk',"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[attr]":N,"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[state]":R,"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[country]":S,"ws_plugin__optimizemember_pro_paypal_ajax_tax_vars[zip]":Q},function(T,V){clearTimeout(e),e=null;try{x.html("
"+y.sprintf('Sales Tax%s: %s
— Total%s: %s',((T.trial)?' Today':""),((T.tax_per)?""+T.tax_per+" ( "+T.cur_symbol+""+T.tax+" )":T.cur_symbol+""+T.tax),((T.trial)?' Today':""),T.cur_symbol+""+T.total)+"
")}catch(U){}},"json")},((O&&O.keyCode)?1000:100))}else{if(!R||!S||!Q||!P){x.html(""),b=null}}}})();n=function(N){setTimeout(function(){F(N)},10)};y(E+" input#s2member-pro-paypal-checkout-state").bind("keyup blur",F).bind("cut paste",n);y(E+" input#s2member-pro-paypal-checkout-zip").bind("keyup blur",F).bind("cut paste",n);y(E+" select#s2member-pro-paypal-checkout-country").bind("change",F);setInterval(function(){F({interval:true})},1000);(q=function(N){if(y(m+" input#s2member-pro-paypal-checkout-password-not-required-or-not-possible").length){y(J+" > div#s2member-pro-paypal-checkout-form-password-div").hide();y(J+" > div#s2member-pro-paypal-checkout-form-password-div :input").attr(h)}})();(B=function(N){if(OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN){y(J+" input#s2member-pro-paypal-checkout-first-name").each(function(){var O=y(this),P=O.val();(!P)?O.val(OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME):null});y(J+" input#s2member-pro-paypal-checkout-last-name").each(function(){var O=y(this),P=O.val();(!P)?O.val(OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME):null});y(J+" input#s2member-pro-paypal-checkout-email").val(OPTIMIZEMEMBER_CURRENT_USER_EMAIL).attr(h);y(J+" input#s2member-pro-paypal-checkout-username").val(OPTIMIZEMEMBER_CURRENT_USER_LOGIN).attr(h);y(J+" > div#s2member-pro-paypal-checkout-form-password-div").hide();y(J+" > div#s2member-pro-paypal-checkout-form-password-div :input").attr(h);if(y.trim(y(J+" > div#s2member-pro-paypal-checkout-form-registration-section-title").html())==='Create Profile'){y(J+" > div#s2member-pro-paypal-checkout-form-registration-section-title").html('Your Profile')}y(M).hide(),y(M+" :input").attr(h)}})();(s=function(N){var O=y(k+":checked").val();if(y.inArray(O,["Visa","MasterCard","Amex","Discover"])!==-1){y(t+" > div.s2member-pro-paypal-checkout-form-div").show();y(t+" > div.s2member-pro-paypal-checkout-form-div :input").attr(v);y(t+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div").hide();y(t+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div :input").attr(a);y(E+" > div.s2member-pro-paypal-checkout-form-div").show();y(E+" > div.s2member-pro-paypal-checkout-form-div :input").attr(v);(!r)?x.hide():null;y(E).show(),y(m+" input#s2member-pro-paypal-checkout-submit").replaceWith(f);(N)?y(t+" input#s2member-pro-paypal-checkout-card-number").focus():null}else{if(y.inArray(O,["Maestro","Solo"])!==-1){y(t+" > div.s2member-pro-paypal-checkout-form-div").show();y(t+" > div.s2member-pro-paypal-checkout-form-div :input").attr(v);y(E+" > div.s2member-pro-paypal-checkout-form-div").show();y(E+" > div.s2member-pro-paypal-checkout-form-div :input").attr(v);(!r)?x.hide():null;y(E).show(),y(m+" input#s2member-pro-paypal-checkout-submit").replaceWith(f);(N)?y(t+" input#s2member-pro-paypal-checkout-card-number").focus():null}else{if((!O||O==="PayPal")&&r){y(t+" > div.s2member-pro-paypal-checkout-form-div").show();y(t+" > div.s2member-pro-paypal-checkout-form-div :input").attr(v);y(t+" > div#s2member-pro-paypal-checkout-form-card-number-div").hide();y(t+" > div#s2member-pro-paypal-checkout-form-card-number-div :input").attr(a);y(t+" > div#s2member-pro-paypal-checkout-form-card-expiration-div").hide();y(t+" > div#s2member-pro-paypal-checkout-form-card-expiration-div :input").attr(a);y(t+" > div#s2member-pro-paypal-checkout-form-card-verification-div").hide();y(t+" > div#s2member-pro-paypal-checkout-form-card-verification-div :input").attr(a);y(t+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div").hide();y(t+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div :input").attr(a);y(E+" > div.s2member-pro-paypal-checkout-form-div").show();y(E+" > div.s2member-pro-paypal-checkout-form-div :input").attr(v);y(E+" > div#s2member-pro-paypal-checkout-form-street-div").hide();y(E+" > div#s2member-pro-paypal-checkout-form-street-div :input").attr(a);y(E+" > div#s2member-pro-paypal-checkout-form-city-div").hide();y(E+" > div#s2member-pro-paypal-checkout-form-city-div :input").attr(a);y(E).show(),y(m+" input#s2member-pro-paypal-checkout-submit").replaceWith(g);(N)?y(E+" input#s2member-pro-paypal-checkout-state").focus():null}else{if(!O||O==="PayPal"){y(t+" > div.s2member-pro-paypal-checkout-form-div").hide();y(t+" > div.s2member-pro-paypal-checkout-form-div :input").attr(a);y(t+" > div#s2member-pro-paypal-checkout-form-card-type-div").show();y(t+" > div#s2member-pro-paypal-checkout-form-card-type-div :input").attr(v);y(E+" > div.s2member-pro-paypal-checkout-form-div").hide();y(E+" > div.s2member-pro-paypal-checkout-form-div :input").attr(a);y(E).hide(),y(m+" input#s2member-pro-paypal-checkout-submit").replaceWith(g);(N)?y(m+" input#s2member-pro-paypal-checkout-submit").focus():null}}}}})();y(k).click(s).change(s);y(L).click(function(){y(j).val("apply-coupon"),o.submit()});y(J+" > div#s2member-pro-paypal-checkout-form-password-div :input").keyup(function(){ws_plugin__optimizemember_passwordStrength(y(J+" input#s2member-pro-paypal-checkout-username"),y(J+" input#s2member-pro-paypal-checkout-password1"),y(J+" input#s2member-pro-paypal-checkout-password2"),y(J+" div#s2member-pro-paypal-checkout-form-password-strength"))});o.submit(function(){if(y(j).val()!=="apply-coupon"){var Q=this,O="",N="",T="";var P=y(K+" input#recaptcha_response_field");var S=y(J+' input#s2member-pro-paypal-checkout-password1[aria-required="true"]');var R=y(J+" input#s2member-pro-paypal-checkout-password2");if(!y(k+":checked").val()){y(k).val(["PayPal"])}y(":input",Q).each(function(){var U=y.trim(y(this).attr("id")).replace(/-[0-9]+$/g,"");if(U&&(O=y.trim(y('label[for="'+U+'"]',Q).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(N=ws_plugin__optimizemember_validationErrors(O,this,Q)){T+=N+"\n\n"}}});if(T=y.trim(T)){alert('— Oops, you missed something: —\n\n'+T);return false}else{if(S.length&&y.trim(S.val())!==y.trim(R.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(S.length&&y.trim(S.val()).length<6){alert('— Oops, you missed something: —\n\nPassword MUST be at least 6 characters. Please try again.');return false}else{if(P.length&&!P.val()){alert('— Oops, you missed something: —\n\nSecurity Code missing. Please try again.');return false}}}}}y(c).attr(z),ws_plugin__optimizemember_animateProcessing(y(c)),y(L).attr(z);return true})}}}}}(H=function(){y("div#s2member-pro-paypal-form-response").each(function(){var N=y(this).offset();window.scrollTo(0,N.top-100)})})()});