function popWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

/* the window opener function is called with the following anchor syntax:
<a href="javascript:popWindow('url','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600')">Link Name</a> */



 function HTML_Dialog_CloseAll() {
	for (dialog in HTML_Dialogs_Open) HTML_Dialogs_Open[dialog].close();
}
/* Place in the popup window's body tag
<body onunload="HTML_Dialog_CloseAll();">

or use a hrfef="javacript:window.close();" in the pop window's close link


*/