For an "On Exit" script, DW won't be able to help much... unless it's included in its library as a pre-packaged script of some sort. Kinda like the one they had for Netscape... their "Netscape Resize Fix" or something like that
Anyway, for JS - take a look at JQuery. JQuery makes javascript coding much easier IMO. You'll likely learn it in a day or two if you're willing to read up on it. Check out W3 Schools (http://www.w3schools.com).
For an "On Exit" type script, read up on the "OnBeforeUnload" Event. When that event triggers (when visitor goes to leave page) you can throw up Message asking visitors if they are sure they want leave.