Popup window using a custom Maxamise/Minimise layout

Hi Guys,
I can’t seem to find how to make a custom maximize/minimise buttons for popup windows. Could you please provide assistance in providing a script to maximize a window?

I am also interested in a feature to change a popup window to a docked window (i.e. to to the RHS of screen) assistance on this is also appreciated.

Lastly is there an API document available that provides a list of all functions etc for quick reference?

Ok i have managed to get most of this functionality by opening a new instance of the window with some bindings to control the startMaxamised function. However ideally i would like to forward the other parameters of the original window automatically ie:

window = system.gui.getParentWindow(event)
params = window.getParams() #Function does not exist but you get the idea

#modify the few parameters i need to and then open instance
newWindow = system.nav.openWindowInstance(window.getPath(), {‘maximiseState’ : 0, params })

This will mean i wont need to customise the toolbar function for every UDT i pass.

Any ideas?