title: Thumbnail Gallery - How to keep the large center image from distorting when clicking on the thumbnail images?
body: <p>This is the code I am using to make a thumbnail gallery. It works pretty well, but the large images keep distorting when I click on the thumbnails. I dont know how to fix this. This is not completely my own code, so I don't understand it fully - please note that I am very new to this and am only jumping into an advanced problem (at least to me) out of necessity. Any help would truly be appreciated!! Thanks in advance. </p>
  
  <pre><code>&lt;!-- image code --&gt;&lt;script type="text/javascript"&gt;
  function mb1_getObjectByID(id,o){
   var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
   else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
   if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
   for(n=0; n&lt;c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
   f=o.forms; if(f) for(n=0; n&lt;f.length; n++) { els=f[n].elements;
   for(m=0; m&lt;els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
   return null;
  }
  function mb1_swapImg(i){
      mb1Obj=mb1_getObjectByID('mb1Img'+i);
      var imgAry = String(mb1Obj.value).split('|');
      mb1BigImg=mb1_getObjectByID('bigImg');
      mb1BigImg.src = imgAry[0];
      mb1BigImg.width = imgAry[1];
      mb1BigImg.height = imgAry[2];
      return true;
  }
  &lt;/script&gt;
  &lt;table align="center" border="0" cellpadding="3" cellspacing="0" width="100%"&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td align="center" valign="top"&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb0" name="thmb0" onclick="mb1_swapImg('0')" src="[IMAGE1_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img0" name="mb1Img0" type="hidden" value="[IMAGE1_URL]|380|570" /&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb1" name="thmb1" onclick="mb1_swapImg('1')" src="[IMAGE2_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img1" name="mb1Img1" type="hidden" value="[IMAGE2_URL]|380|570" /&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb2" name="thmb2" onclick="mb1_swapImg('2')" src="[IMAGE3_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img2" name="mb1Img2" type="hidden" value="[IMAGE3_URL]|380|570" /&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb3" name="thmb3" onclick="mb1_swapImg('3')" src="[IMAGE4_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img3" name="mb1Img3" type="hidden" value="[IMAGE4_URL]|380|570" /&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb4" name="thmb4" onclick="mb1_swapImg('4')" src="[IMAGE5_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img4" name="mb1Img4" type="hidden" value="[IMAGE5_URL]|380|570" /&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb5" name="thmb5" onclick="mb1_swapImg('5')" src="[IMAGE6_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img5" name="mb1Img5" type="hidden" value="[IMAGE6_URL]|380|570" /&gt;
          &lt;div style="padding:4px;"&gt;&lt;img alt="" border="0" height="64" id="thmb6" name="thmb6" onclick="mb1_swapImg('6')" src="[IMAGE7_URL]" style="cursor:pointer" width="43" /&gt;&lt;/div&gt;
          &lt;input id="mb1Img6" name="mb1Img6" type="hidden" value="[IMAGE7_URL]|380|570" /&gt;&lt;/td&gt;
          &lt;td align="center" valign="top"&gt;&lt;img alt="" border="0" height="570" id="bigImg" name="bigImg" src="[IMAGE1_URL]" width="380" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><a href="http://s952.photobucket.com/user/mlahrichi22/library/" rel="nofollow">http://s952.photobucket.com/user/mlahrichi22/library/</a></p>