In my project site, if I click on a link, the PDF opens in a new or parent window. Well I want a box to appear that prompts the user to download the file instead of opening
You can't do it via javascript, you need server side implementation.
Here's the SO Post which should help: Allowing user to download from my site through Response.WriteFile()