Yes, you get Javascripts to do such a task (normally it's in the guise of a screen resolution detector) but I'm not liking you're plan of action.
Personally, I wouldn't do it because it sounds like a very tacky effect (unless you can somehow pull it off, which -no offence - is not likely). But if I did want to do it, I'd get a few background images to cope with the different resolutions, and use a bit of javascript or another scripting language to pick the appropriate file.
But that's just me. This site offers a script you might like (you may need to adapt it slightly):
http://www.pageresource.com/jscript/jscreen.htmAlternatively, you could use CSS to centre the background image. Obviously you'll have the white background showing through at the edges but if it doesn't affect your design too much...