/*! * SSSL: smallest, simpelst script loader * version: 1.0.1 */ (function(){var e=document.getElementsByTagName("script")[0],t=e.parentNode,n=/ded|co/,r="onload",i="onreadystatechange",s="readyState",o=function(o,u){var a=document.createElement("script");a[r]=a[i]=function(){if(!this[s]||n.test(this[s])){a[r]=a[i]=null;u&&u(a);a=null}};a.async=true;a.src=o;t.insertBefore(a,e.nextSibling)};window.sssl=function(e,t){if(typeof e=="string"){o(e,t);return}var n=e.shift();o(n,function(){if(e.length){window.sssl(e,t)}else{t&&t()}})}})(); (function(){ var request_list = [ '//forms.ontraport.com/v2.4/include/minify/?g=genjs-v3', '//app.ontraport.com/js/formeditor/moonrayform/paymentplandisplay/moonrayform.paymentplandisplay.js' ]; // HANDLE JQUERY VERSIONING var jQueryVersion, currentSubVersion, jQueryUISrc = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js' , appendJQueryBool = true; // Look to see if we need to add jQuery to the page if ( window.jQuery ) { // $ can be a property of window, but still be assigned "undefined" // therefore, an extra check is made to assure that the property is populated if ( typeof window.jQuery === "function" && "fn" in window.jQuery ) { window.$ = window.jQuery } jQueryVersion = jQuery.fn.jquery.split( "." ); // The grid requires between jQuery version 1.7.0 and 1.8.1 if ( jQueryVersion[0] === "1" ) { // Strip off the first version so we can actually compare the float values currentSubVersion = parseFloat( jQueryVersion[1] + "." + jQueryVersion[2] ); if ( /* Min version: 1.7.0 */ 7.0 <= currentSubVersion && /* Max version: 1.8.1 */ 8.1 >= currentSubVersion ) { appendJQueryBool = false; } } } // END HANDLING JQUERY VERSIONING // if we have to append jquery, reattach jqui if ( appendJQueryBool ) { request_list.unshift( jQueryUISrc ); request_list.unshift( 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js' ); } else if ( appendJQueryBool == false && !jQuery.ui ) { request_list.unshift( jQueryUISrc ); } sssl(request_list, function(){ var html = ''; jQuery('.moonray-form-p2c9719f1930 form').moonraySmartForm() .formConditions({ processorMutator: function( condition, rulesResult ){ if( rulesResult && condition['tru'] != undefined ){ this._processOutcomes( condition['tru'], true ); //this should work for all cart / payment related conditions }else if( rulesResult == false && condition['fal'] != undefined ){ this._processOutcomes( condition['fal'], false); //just invert }else if(rulesResult == false){ this._processOutcomes( condition['tru'], false); } }, outcomeActionMutator: function( outcome, rulesResult ){ var ret = outcome.action; //invert only if its a show if( rulesResult === false ){ //if its a string filp the result. tax and shipping rules sets are funcs if( $.type( outcome.action ) == 'string' ){ if( outcome.action == 'show'){ ret = 'hide'; }else{ ret = null; } } } return ret; }, inputEvent: 'blur change', conditions: [] }) .validator({ errorClass: 'moonray-form-state-error', messageClass: 'moonray-form-error-message moonray-form-state-error', offset: [ 0, 13 ], position: 'top right', errorInputEvent: 'blur', inputEvent: 'blur', effect: 'ontraport-default' }) var ssslEvent = document.createEvent( 'Event' ); ssslEvent.initEvent( 'ssslReady', true, true ); document.dispatchEvent( ssslEvent ); }) })();