Okay, I've tried a few different things, and I'm afraid I'm on the wrong path. I have a div called "center" that gets resized with the window. I can successfully retrieve the width of this div with
dwidth = document.getElementById('center').offsetWidth;
I can also re-retrieve the width of this width upon window resizes with
<body onResize="document.location.href = document.location.href">
What I need now is some sort of mechanism to retrieve the dimensions of an image, that will be referred to as a php variable "$header". I want to display this image in the "center" div, sized to fit the width of the "center" div, while maintaining its aspect ratio. What should I be searching for? I tried numerous searches for things like "dynamic image resize fit div javascript", but I can't seem to find anything that fits. Does anyone know of a script like this?