I need a JS that will dynamically resize an image to be used as a background on a website. The background image must retain its original aspect ratio (no stretching or pinching) and also must be as small as possible while filling the screen as seen at this website:
[url removed, login to view]
The exception is that I need the image to self center as well, so that the center of the image is always the at the center of the browser window. I need this as an external JS file that I can implement as needed - with instructions on how to call and implement it on the web document itself.
See attachment for graphical and detailed explanations of what I am looking for. Thanks!