Thanks for the reply.in the main form we have multiple buttons.if we click one of the button at that time only we need to show this overlay.as you said when the page is "unloaded" i think we can call "onbeforeunload" event ,In that event can we call this modal dialog box?
i think whenever you call this event "onbeforeunload" i am afraid that whatever you click(any buttons,links etc..) in the main page then this overlay will come.but we should have the capabitlity when to show this overlay.
we should call this overlay in the below scenarios only.
1)close the page, or navigate to a different web site.
2)click one of the button in the form.
3)when session times out .(if we make it works above scenarios.i think we can do this as well.)