I've made a simple plugin for CKeditor for inserting PayPal buy now buttons, and within the plugin are 3 dialogs, 1 giving users the option of whether they want a single item buy now button or a multi option buy now button. when they select either single or multi option a corresponding dialog opens, which takes all the details of the item such as name, currency, shipping, value etc. It works perfectly the first time it is used on that page, however the second time you use it, after you make a selection on the first dialog and call the onOk method to open the next dialog the page crashes, i'm not sure on where the problem is stemming from, so if anyone would mind giving me some advice it would be much appreciated.
I know it's alot of code (see links below) but i'm sure that the problem must lie in the way I am initialising the dialogs in plugin.js or the possibly the way I am calling them in paypal.js - quite a newbie to CKeditor atm.
The code can be seen here:
This is my plugin.js code : http://pastebin.com/JU0j2tB5
This is my paypal.js code: http://pastebin.com/CMMEqAQN
This is my multibutton code : http://pastebin.com/uBP1MPat
This is my single button code : http://pastebin.com/Jk06LbfF
Thanks for looking!