Sharepoint 2010 modal dialog , apply different style/javascript at runtime from parent page

Sharepoint 2010 have a very good featuree of Modal dialog, Modal dialogs in sharepoint 2010 use the client library SP.UI.ModalDialog and showModalDialog

There come the requirement when you want to find the weather the modal dialog is opened or not and you want to modify certain style in modal dialog  from the parent page, this can be achieved by using  javascript  adding it to master page, where you can identify the window location and can create the javascript or style tag that can be add it to modal dialog while rendering.

Sharepoint 2010 LaunchPickerTreeDialog , Folder picker

There have been many instances when one required to upload the document to the document library in a particular folder. If one have noticed that while  uploading the document to document library we get a browse option which let one to select the folder to  add the document in library.

To achieve this sharepoint uses the LaunchPickerTreeDialog method this can be found in /_layouts/1033/PickerTreeDialog.js file under 14 hive folder.  This is used to display the site content and filter the content based on the WebOnly, listOnly, WebAndLIsts and websAndListFolders.