This is a script a fellow made for proboards but its all Greek to me
.It resizes photos on the forum to 640x480 when they are posted.
If it makes sense to you then feel free to use it.I have this in my global footer.Its a proboards forum if that matters?
http://support.proboards.com/thread/474992/image-resizing<script type="text/javascript">
<!--
/*
Modify image size to fit forum
By Todge
Please keep this header intact
*/
var picWidth = '640'; //Maximum image width..
var picHeight = '480'; //Maximum image height..
var pics = document.images;
window.onload = imageSize;
function imageSize()
{
var p=pics.length-1;
while(p>-1)
{
if(pics[p].alt=='[image] ')
{
if(pics[p].width>picWidth || pics[p].height>picHeight)
{
var thisPicWidth = picWidth;
if(pics[p].height/(pics[p].width/picWidth)>picHeight)
{
thisPicWidth = pics[p].width/(pics[p].height/picHeight)
}
var newWidth = 100-parseInt(thisPicWidth/pics[p].width*100);
var picLoaded = document.createElement('A');
picLoaded.setAttribute('href',pics[p].src);
picLoaded.setAttribute('target','_blank');
picLoaded.innerHTML = '<font size="0">This image is reduced by '+newWidth+'%, click it to view full size.</font><br><img src="'+pics[p].src+'" width="'+thisPicWidth+'" border="0">';
pics[p].parentNode.replaceChild(picLoaded,pics[p]);
}}
p--;
}}
// -->
</script>