would it be possible to use my own script for images that pop up?

i was using a great one on my old site, and it darkened the background while the popup was on