function resizeImages( maxWidth ) 
{ 
    for( i = 0; i < document.images.length; i++ ) 
    { 
        while ( !document.images[i].complete ) 
        { 
            break; 
        } 
        if ( document.images[i].width > maxWidth ) 
        { 
            myScale   = maxWidth / document.images[i].width;
            newHeight = document.images[i].height * myScale;
            document.images[i].width  = maxWidth; 
            document.images[i].height = newHeight; 
        } 
    } 
} 

