<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Mobile
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<div id="checkout-paypaliframe-load" class="authentication"></div>
<script type="text/javascript">
//<![CDATA[
Review.prototype.save = function() {
    if (checkout.loadWaiting!=false) return;
    checkout.setLoadWaiting('review');
    var params = Form.serialize(payment.form);
    if (this.agreementsForm) {
        params += '&'+Form.serialize(this.agreementsForm);
    }
    params.save = true;
    var request = new Ajax.Request(
        this.saveUrl,
        {
            method:'post',
            parameters:params,
            onComplete: function(transport) {
                if (transport && transport.responseText) {
                    try{
                        response = eval('(' + transport.responseText + ')');
                    }
                    catch (e) {
                        response = {};
                    }
                    if (response.error_messages) {
                        checkout.setLoadWaiting(false);
                    }
                }
            },
            onSuccess: this.onSave,
            onFailure: checkout.ajaxFailure.bind(checkout)
        }
    );
}
//]]>
</script>
