As we know JavaScript is the heart of web Application, and so that we need to create two functions in JavaScript inside your head tag section of html/jsp page.
Functions should be as below:
Function Yes_fun(){
Window.parent.close();
Window.opener.close();
}
The above function will be called for YES button.
Create another function for No button called.
Function No_fun(){
Window.parent.close();
}
Now , write both functions inside script tag and called with button onclick.
For parent page if you want to create button onclick with open new page, then write function as below.
Function Mt function(){
Window.open('jsp','555',666');}