function bldthmimgs() {
 
  var mfsplit = mfnum.split('::');
  if (mfsplit.length != 2)
    return;

  var numberimages = mfsplit[1];
 
  if (!isNumeric(numberimages))
    return;

  var imgtype = thmimgpath.lastIndexOf('.');
 
  if (imgtype == -1 ) 
    return;
 
  var thmimgtpl = thmimgpath.substring(0, imgtype);
  var img_sep = '-';
  var pictype = '.jpg';

  var divtop = document.getElementById('img_cont_div');
  
  for (var x = 1; x <= numberimages; ++ x) { 
    thumb_img = thmimgtpl + img_sep + (x + 1) + pictype;
    divelem = document.createElement('div');
    divelem.className = 'thmimglay';

    imgelem= document.createElement('img');
    imgelem.src=thumb_img;
    imgelem.onmouseover=function(){name_swap(this.src, this.style)};
    imgelem.onclick=function(){zoom_img(this.src)};
    imgelem.className = 'thmimgsize';
    divelem.appendChild(imgelem);
    divtop.appendChild(divelem);
  }
}


function name_swap(img_name, sty) {
  sty.cursor='pointer';
  large_img_new = img_name.replace('-120-','-250-');
  var large_img = document.getElementsByName('largeimg');
  large_img[0].src = large_img_new;
}

function zoom_img(img_name) {
  var zoom_img_new = img_name.replace('-120-','-450-');
  MM_openBrWindow(zoom_img_new,'ZoomImage','width=600,height=600');
 
  return;
}

function isNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

addEvent(window, 'load', bldthmimgs);