var App_ECommerce_Checkout = { _paymentElementId: 'servicePayment-type-element', _form: null, _cardTipId: 'cardCode-tip', init: function(formId) { if (formId) { this._form = $('#' + formId); var obj = this; var paymentElements = $('#' + this._paymentElementId); if ($(paymentElements).size()) { var cardTip = $('#' + obj._cardTipId); if (cardTip.size()) { cardTip.qtip({ content: { text: $('#' + obj._cardTipId + '-value').val() } }); } paymentElements.find('input').click(function() { obj._onPaymentClick(this); }); var paymentChecked = paymentElements.find('input:checked, input[type="hidden"]'); if (paymentChecked) { obj._onPaymentClick(paymentChecked); } } } }, _onPaymentClick: function(element) { $('.payment').hide(); $('#servicePayment-fieldset-' + $(element).val() + 'Methods').show(); }, onAsBillingClick: function (asBilling, type) { for (var i = 0; i < this.options.addressFields.length; i++) { var name = this.options.addressFields[i]; var selector = '#' + type + '-' + name; if ($(asBilling).is(':checked')) { $(selector).attr('disabled', 'disabled'); this.setElementValue(type, name, this.getElementValue(this.options.inheritedAddress, name)); } else { $(selector).removeAttr('disabled'); if (!this.getElementValue(type, name)) { this.setElementValue(type, name, this.getElementValue(this.options.inheritedAddress, name)); } } } return true; } }; var App_ECommerce_Checkout_OtherServices = { _containerId: null, init: function(id) { this._containerId = id; $('#' + this._containerId).find('input[type=checkbox]').click(function() { var valueFieldId = $(this).attr('id') + 'Value-element' ; var valueField = $('#' + valueFieldId); if ($(this).is(':checked')) { valueField.show(); } else { valueField.hide(); } }); }, _removeErrors: function() { $('#' + this._containerId).find('ul.errors').remove(); }, _addErrors: function(message, afterContainer) { afterContainer.after('