function random_images(imgnum, alignpic, folder, alt, width, height, border, pictype)
{
  var output = "";
  if (!imgnum)
  {
    imgnum=2;
  }
  if (!folder)
  {
    folder='images';
  }
  var useRand = 0;
  var rand1 = 0;
  do {
    var randnum = Math.random();
    rand1 = Math.round((imgnum - 1) * randnum) + 1;
  } while (rand1 == useRand);
  useRand = rand1;
  output = '<img src="';
  if (!pictype){pictype='jpg';}
  if (useRand<10){
    output += '../'+folder+'/00'+useRand+'.'+pictype;
  }
  else if (useRand<100)
  {
    output += '../'+folder+'/0'+useRand+'.'+pictype;
  }
  else
  {
    output += '../'+folder+'/'+ useRand+'.'+pictypes;
  }
  output += '" alt="'+alt+'"';
  if (width)
  {
    output += ' width="'+width+'"';
  }
  if (height)
  {
    output += ' height="'+height+'"';
  }
  if (border)
  {
    output += ' border="'+border+'"';
  } 
  else 
  {
    output += ' border="0"';
  }
  if (alignpic)
  {
    output += ' align="'+alignpic+'"';
  }
  else
  {
     output += ' align="left"';
  } 
  output += '>';
  
  return output;
}

