Try the following code fragment:
1.htm:
<script>
function mm()
{
    var win = window.open("a.htm","","toolbars=no,status=no,width=160,height=100");
   
    //Do Something Here    
    //Then Use win.close();
}
</script>
<input type=button value=search onclick=mm()>
a.htm:
<body onblur='window.focus()'>
please wait....
</body>