The HEAD of the Page put the follow script
<script type=”text/javascript”>
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
Open window Script
<a href="#" onmousedown="MM_openBrWindow('page_path.php','gallery','scrollbars=yes,resizable=yes,width=600,height=500')" >Open Window</a>
Close window Script (inside page_path.php )
<a href="#" onclick="javascript:self.close(); ">Close Window</a>
Close window popup and reload parent Page (inside page_path.php )
<a href="#" onclick="window.opener.window.location.reload(true);window.self.close()">Close Window</a>