<script type="text/javascript"> var img1 =document.getElementById('img1'); if(img1.width > 840){ img1.width = 840; } </script>