The following code will close a popup window after the user selects to download the file, or if he/she cancels the download.
Between thetags of the document is popped up, add the code below:
In thetag add this:
Somewhere in the body of the document add:
And finally wherever you need them, the links:
Note: This works for both Internet Explorer and FireFox.