If tDoc and pDoc are declared somewhere and have been assigned values, then you call the function with this line:
loadTrans(tDoc,pDoc);
You don't need the script library as a resource on the button. It only needs to be included in the custom control.
Also, outside the function, the two document variables don't need the same name as they have inside the function. You could define them in the button with different names. E.g. If they're declared outside the function as document1 and document2, then the function call would be:
loadTrans(document1,document2);