﻿function showPaymentEngineChoiceForm(subscriptionId) {

    //Create choice form
    var choiceForm = new Ext.FormPanel({

      url:'subscribe.aspx',
      frame: false,
      items: [
         {
            xtype: 'hidden',
            visibility: false
         }
      ],
      buttons: [
         {
            text: 'Pay Pal',
            layout: 'form',
            handler: function()
              {
                    window.location.href = 'subscribe.aspx?subscriptionId=' + subscriptionId + 
                                           '&userId=' + getCookie('userId') + '&paymentEngine=PayPal';
              } 
         },
          {
            text: 'Google Checkout',
            layout: 'form',
            handler: function()
              {
                    window.location.href = 'subscribe.aspx?subscriptionId=' + subscriptionId + 
                                           '&userId=' + getCookie('userId') + '&paymentEngine=GoogleCheckout';
              } 
          }
      ]  
    });


    //Create choice window
    var choiceWindow = new Ext.Window({
        frame: true,
        title: 'Choose payment system',
        id: 'choicePaymentForm',
        width: 230,
        closable: true,
        sizeable: false,
        modal: true,
        plain: true,
        items: choiceForm
    });
     
    choiceWindow.show();

}