<p>I am writing one web chat program using AJAX (a little bit). It is working when both users open a chat page, but I want to open a window when one user send data to others.</p>

Sounds like you need to write some javascript to open a new window when a message is received.  How are you sending the message -
reverse Ajax
?
Presumably both users will need to have your chat applications web page open so that you have somewhere to put the reverse ajax hook code.